
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
cl-react-ui
Advanced tools
Simple react form rendering
You can try out some of the component via react story book, still a work in progress:
yarn storybook
In the mean time the old examples can be built :
cd src/examples
yarn build
google-chrome index.html
import layout from './MyFormLayout';
import {validations} from 'cl-react-ui';
const config = {
view: 'example',
lib : 'reactstrap',
form: {
actions: {
submit: {
id: 'upload-action-submit',
type: 'submit',
label: 'Upload',
style: 'primary'
}
},
fields: {
id: {
type: 'hidden'
},
name: {
label: 'Name',
type: 'text',
ref: 'name',
value: '',
placeholder: 'Name',
validate: {
promises: [{
rule: validations.required
}],
msg: (value, data) => 'Name required'
}
},
label: {
value: 'foo',
access: {
new: (field, data) => true,
edit: (field, data) => true
}
},
age: {
pristine: true,
accesss: {}
},
checkbox: {
type: 'checkbox'
}
}
}
};
<Form
config={config}
layout={layout}
errors={errors}
title="override title (can be a function or string)"
visibility={{age: false}} // Hide the age field
onSubmit={(e: Event, data: Object) => {
}} />
lib: 'react-bootstrap' | 'reactstrap'
Validations use the validate-promise library
Form errors should be an object, keyed on the field name, whose values are an array of error messages
let errors = {
name: ['Please enter a name', 'Cheese is not a proper name']
};
render() {
const config = {
view: 'example',
lib : 'reactstrap',
list: {
columns: {
id: {
label: 'ID'
},
name: {
label: 'Name'
},
}
},
messages: {
emptyData: 'No records found',
},
}
const data = [
{id: '1', name: 'one'},
{id: '2', name: 'two'}
];
// Hooks into various list events, this is a good place to bind your redux actions
const listActions = {
add: (view, state) => {
this.props.save(state);
},
setForm: (view, row) => null, // A row is selected for editing
selectRow: () => null, // A Row is selected
}
return <List
config={config}
data={data}
access={{
add: true,
}}
actions={listActions}>
{({actions, handleUpdate, showModal, close}) => <Modal isOpen={showModal} toggle={close}>
<Form
actions={{close: {
action: close,
id: 'modal-close',
label: 'Close',
type: 'button',
}}}
data={{ // Initial form data
name: 'three',
}}
formUpdate={actions.formUpdate}
layout="Modal"
config={config}
onSubmit={(e, state) => handleUpdate(e, state)}
/>
</Modal>
}
<List>
}
Renders a font-awesome icon
import {Icon} from 'cl-react-ui';
<Icon
icon: string,
color?: string,
label?: string,
pull?: string,
size?: 0 | 1 | 2 | 3 | 4 | 5,
stack: number,
inverse: boolean,
spin: boolean />
FAQs
Cognitive Logic React UI
The npm package cl-react-ui receives a total of 134 weekly downloads. As such, cl-react-ui popularity was classified as not popular.
We found that cl-react-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.