
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
teselagen-react-components
Advanced tools
Demo: https://teselagen.github.io/teselagen-react-components/
yarn add teselagen-react-components
Add peer-dependencies:
yarn add @blueprintjs/core @blueprintjs/datetime @blueprintjs/select react-addons-css-transition-group react-redux redux
withDialog()(YourComponent) wraps YourComponent in a blueprint Dialog!
First hook up dialog to redux (only need to do this once):
//rootReducer.js
import {tg_modalState} from 'teselagen-react-components'
export default combineReducers({
tg_modalState,
})
Use the component
const DialogComp = withDialog({...bpDialogPropsHere})(MyComponent)
render() {
return <DialogComp
dialogName={string} //optionally pass a UNIQUE dialog name to be used
dialogProps={object} //optionally pass additional runtime blueprint dialog props here
//all other props passed directly to wrapped component
>
<Trigger/>
</DialogComp>
}
In RARE cases where you need to open the dialog programatically, make sure the dialog component is on the page (just don't pass a child component and nothing will appear to be added to the DOM), and call dispatch like:
dispatch({
type: "TG_SHOW_MODAL",
name: dialogName //you'll need to pass a unique dialogName prop to the compoennt
props: // pass props to the wrapped component here :)
})
Use the component with withTableParams() enhancer or by itself (locally connected) DataTable props
import {DataTable} from "teselagen-react-components";
<DataTable {DataTableProps here} />
Simple DataTable Demo Src Code
Use withTableParams in conjunction with withQuery
withTableParams({
formName: String; // - required unique identifier for the table
schema: Boolean; // - The data table schema
urlConnected: Boolean; // - default: false - whether the table should connect to/update the URL
withSelectedEntities: Boolean; // - whether or not to pass the selected entities
defaults: defaults; // - tableParam defaults such as pageSize, filter, etc
})
withQuery() //the usual withQuery stuff here
withTableParams returns a prop called tableParams which you can spread like:
<DataTable {...tableParams}/> //this provides, entities, schema, handlers etc
import {
InputField,
SelectField,
DateInputField,
CheckboxField,
TextareaField,
EditableTextField,
ReactSelectField,
NumericInputField,
RadioGroupField,
FileUploadField
} from 'teselagen-react-components'
<InputField
name={"fieldName"}
label="fieldLabel"
placeholder="Enter text..."
inputClassName="className(s) for input"
/>
Node.js >= v4 must be installed.
npm install
in the components's root directory will install everything you need for development.npm start
will run a development server with the component's demo app at http://localhost:3000 with hot module reloading. You can check the /demo folder for the source code.//link everything up:
//LIMS EXAMPLE:
cd lims/node_modules/react //this is so we don't have 2 copies of react being used on the front-end (react will throw errors if so)
yarn link
cd teselagen-react-components
yarn link
yarn link react
cd lims
yarn link teselagen-react-components
//HDE EXAMPLE:
cd hde/client/node_modules/react //this is so we don't have 2 copies of react being used on the front-end (react will throw errors if so)
yarn link
cd teselagen-react-components
yarn link
yarn link react
cd hde/client
yarn link teselagen-react-components
//ALWAYS:
//start the auto rebuild:
cd teselagen-react-components
yarn build-watch
npm test
will run the tests once.
npm run test:coverage
will run the tests and produce a coverage report in coverage/
.
npm run test:watch
will run the tests on every change.
npm whoami
you should be teselagen-adminnpm login
teselagen-admin//ask @tnrich or @tgreen or @tgadam for password//devops@teselagen.comSee the demo page for live examples!
open src/customIcons.js
and add a new exported svg with a name of xxxxIcon (you can find the svgs from iconmonstr or flaticon or wherever)
be sure to add it to the demo/src/examples/CustomIcons.js
page to TEST THAT IT WORKS and so that people know it exists!
FAQs
Teselagen React Component Library
The npm package teselagen-react-components receives a total of 1,796 weekly downloads. As such, teselagen-react-components popularity was classified as popular.
We found that teselagen-react-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.