Feel free to open PRs to fix bugs, add new features, add new reusable types/widgets/operators (eg., regex operator/widget, IP type/widget).
Clone this repo and run npm start
.
Open http://localhost:3001/
in a browser.
You will see demo app with hot reload of demo code and local library code.
modules
- Main source code of librarycomponents
- Core React componentswidgets
- Components to render list of fields, operators, values of different types. Built with UI frameworks
config
- Basic config lives here. SeeCONFIG
docs.export
- Code for export to JsonLogic, MongoDb, SQL, ElasticSearch, plain stringimport
- Code for import from JsonLogicactions
- Redux actionsstores/tree.js
- Redux storeindex.d.ts
- TS definitions
css
- Styles for query builderexamples
- Demo app with hot reload of demo code and local library code, uses TS, uses complex config to demonstrate anvanced usage.sandbox
- Demo app with hot reload of only demo code (uses latest version of library from npm), uses TS, uses AntDesign widgets.sandbox_simple
- Demo app with hot reload of only demo code (uses latest version of library from npm), not uses TS, uses vanilla widgets.tests
- All tests are here. Uses Karma, Mocha, Chai, Enzyme
npm run install-all
- Install npm packages in root, examples, sandboxes. Required for other scripts!npm test
- Run tests with Karma and update coverage. Requires Node.js v10+npm run lint
- Run ESLint and TSC (in root, tests, examples, sandboxes)npm run lint-fix
- Run ESLint with--fix
option (in root, tests, examples, sandboxes)npm run clean
- Clean all data that can be re-generated (likenode_modules
,build
,coverage
)npm run smoke
- Run tests, lint, build lib, build examples, build sandboxes. Recommended before making PRnpm run build
- Build npm module tolib
, build minified production package tobuild
npm run build-examples
- Build demo with webpack toexamples/build
Feel free to open PR to add new reusable types/widgets/operators (eg., regex operator for string, IP type & widget).
Pull Requests are always welcomed :)
Currently there are 5 collections of widgets:
Let's say you want to create new collection of Bootstrap widgets to be used in this lib (and submit PR which is always welcomed!).
You can use vanilla widgets as skeleton.
Then to enable new widgets you need to create config overrides like this:
material config