You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* .
* ..
* ...
* material-ui boolean widget
* material-ui date widget
* realized these extra funcs are unecessary, can be handled by date-io or customProps
* fix material-ui date widget, add material-ui dateTime widget and material-ui time widget
* delete commented out code
* date/time - added useKeyboard
time - show/hide seconds according to timeFormat
boolean - use grid for 2 labels
select - use renderValue intead of empty value
multiselect - new
all - don't show placeholer in r/o mode
all - use customProps
lint fix
* number
* partial material-ui slider widget (#308)
* partial material-ui slider widget
* finish working on material-ui slider widget
* use Number() instead of parse*
* customSliderProps
* slider
* range
* fix uncontrolled
Co-authored-by: Denis Oblogin <ukrbublik@gmail.com>
* remove isSpecialRange for date/time
* confirm
* moved MuiPickersUtilsProvider
* fixed uncontrolled
* some docs
* .
* restore config
* added MUI packages to sandbox
* lint-fix
* enable mui in tests
* to/from labels and materialValueSources (#311)
* use inline-flex and alignment to fix the vertical alignment of to/from labels
* fix css formatting
* fix formatting
* start on materialValueSources using popover and radio btns
* nit
* lint
Co-authored-by: Denis Oblogin <ukrbublik@gmail.com>
* conjs improvemnt
* better alignment styling for mui widget sep and widget value src (#314)
* better alignment styling for mui widget sep and widget value src
* ...
Co-authored-by: Denis Oblogin <ukrbublik@gmail.com>
* `value` is default source
* ts
* readme
* .
* refactor MaterialFieldSelect with renderValue (#316)
* refactor MaterialFieldSelect with renderValue
* .
* init skin is antd
Co-authored-by: Megan Taylor <mtaylor@megantaylor.org>
|renderSize |`small` |Size of AntDesign components - `small` or `large`
298
313
|renderField |`(props) => <FieldSelect {...props} />` |Render fields list +
299
-
Available widgets: `FieldSelect`, `FieldDropdown`, `FieldCascader`, `FieldTreeSelect`, `VanillaFieldSelect` (see `AntdWidgets` and `Widgets` above)
314
+
Available widgets for AntDesign: `FieldSelect`, `FieldDropdown`, `FieldCascader`, `FieldTreeSelect`
300
315
|renderOperator |`(props) => <FieldSelect {...props} />` |Render operators list +
301
-
Available widgets: `FieldSelect`, `FieldDropdown`, `VanillaFieldSelect`
316
+
Available widgets for AntDesign: `FieldSelect`, `FieldDropdown`
302
317
|renderFunc |`(props) => <FieldSelect {...props} />` |Render functions list +
303
-
Available widgets: `FieldSelect`, `FieldDropdown`, `VanillaFieldSelect`
304
-
|renderConjs, renderButton, renderButtonGroup, renderProvider, renderValueSources, renderConfirm, renderRuleError | |Other internal render functions you can override if using another UI framework (https://github.com/ukrbublik/react-awesome-query-builder/blob/master/modules/config/antd.js#L47[example])
318
+
Available widgets for AntDesign: `FieldSelect`, `FieldDropdown`
319
+
|renderConjs, renderButton, renderButtonGroup, renderProvider, renderValueSources, renderConfirm, useConfirm, renderRuleError | |Other internal render functions you can override if using another UI framework (https://github.com/ukrbublik/react-awesome-query-builder/blob/master/modules/config/antd.js#L47[example])
305
320
|showLabels |false |Show labels above all fields?
306
321
|hideConjForOne |true |Don't show conjunctions switcher for only 1 rule?
307
322
|maxLabelsLength |100 |To shorten long labels of fields/values (by length, i.e. number of chars)
@@ -320,7 +335,10 @@ Other settings:
320
335
[cols="1m,1,3a",options="header",]
321
336
|===
322
337
|key |default |meaning
323
-
|locale |en |Locale used for AntDesign widgets
338
+
|locale.moment |"en" |Locale (string or array of strings) used for https://momentjs.com/docs/#/i18n/[moment]
339
+
|locale.antd |`en_US` |Locale object used for https://ant.design/docs/react/i18n[AntDesign] widgets
340
+
|locale.material |`enUS` |Locale object used for https://material-ui.com/ru/guides/localization/[MaterialUI] widgets
341
+
|theme.material |{} |Options for https://material-ui.com/ru/customization/theming/[createMuiTheme]
324
342
|formatReverse | |Function for formatting query string, used to format rule with reverse operator which haven't `formatOp`. +
`q` - already formatted rule for opposite operator (which have `formatOp`) +
@@ -472,6 +490,7 @@ See https://github.com/ukrbublik/react-awesome-query-builder/tree/master/example
472
490
----
473
491
import {Widgets} from 'react-awesome-query-builder';
474
492
import AntdWidgets from 'react-awesome-query-builder/lib/components/widgets/antd';
493
+
import MaterialWidgets from 'react-awesome-query-builder/lib/components/widgets/material';
475
494
const {
476
495
TextWidget,
477
496
NumberWidget,
@@ -482,6 +501,11 @@ const {
482
501
VanillaNumberWidget,
483
502
...
484
503
} = Widgets;
504
+
const {
505
+
MaterialTextWidget,
506
+
MaterialNumberWidget,
507
+
...
508
+
} = MaterialWidgets;
485
509
----
486
510
487
511
[source,javascript]
@@ -522,6 +546,7 @@ const {
522
546
|valuePlaceholder | |`config.settings.valuePlaceholder` |Common option, placeholder text to be shown in widget for empty value
523
547
|timeFormat | |`HH:mm:ss` |Option for `<TimeWidget>`, `<DateTimeWidget>` to display time in widget. Example: `'HH:mm'`
524
548
|use12Hours | |`false` |Option for `<TimeWidget>`
549
+
|useKeyboard | |`true` |Option for Material-UI date/time pickers, `false` disables input with keyboard, only picker use is allowed
525
550
|dateFormat | |`YYYY-MM-DD` |Option for `<DateWidget>`, `<DateTimeWidget>` to display date in widget. Example: `YYYY-MM-DD`
526
551
|valueFormat | | |Option for `<TimeWidget>`, `<DateWidget>`, `<DateTimeWidget>` to prepare string representation of value to be stored. Example: `YYYY-MM-DD HH:mm`
527
552
|labelYes, labelNo | | |Option for `<BooleanWidget>`
Copy file name to clipboardExpand all lines: README.md
+33-7Lines changed: 33 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# react-awesome-query-builder
2
-
[](https://www.npmjs.com/package/react-awesome-query-builder)[](https://travis-ci.com/github/ukrbublik/react-awesome-query-builder)[](https://codecov.io/gh/ukrbublik/react-awesome-query-builder)[](https://opencollective.com/react-awesome-query-builder)
2
+
[](https://www.npmjs.com/package/react-awesome-query-builder)[](https://travis-ci.com/github/ukrbublik/react-awesome-query-builder)[](https://codecov.io/gh/ukrbublik/react-awesome-query-builder)[](https://ant.design)[](https://material-ui.com)[](https://opencollective.com/react-awesome-query-builder)
@@ -32,14 +34,31 @@ Using awesome [Ant Design](https://ant.design/) v4 for widgets
32
34
- function (arguments also can be values/fields/funcs)
33
35
- Reordering (drag-n-drop) support for rules and groups of rules
34
36
- Using awesome [Ant Design](https://ant.design/) as UI framework with rich features.
35
-
(But using custom widgets of another framework is possible, see below)
37
+
Now [Material-UI](https://material-ui.com/) is also supported!
38
+
(Using another UI framework and custom widgets is possible, see below)
36
39
- Export to MongoDb, SQL, [JsonLogic](http://jsonlogic.com) or your custom format
37
40
- Import from [JsonLogic](http://jsonlogic.com)
38
41
- TypeScript support (see [types](https://github.com/ukrbublik/react-awesome-query-builder/tree/master/modules/index.d.ts) and [demo in TS](https://github.com/ukrbublik/react-awesome-query-builder/tree/master/examples))
39
42
40
43
41
44
## Getting started
42
-
Install: `npm i react-awesome-query-builder` (packages `antd`, `typescript` are optional)
45
+
Install:
46
+
```
47
+
npm i react-awesome-query-builder
48
+
```
49
+
50
+
For AntDesign widgets only:
51
+
```
52
+
npm i antd
53
+
```
54
+
55
+
For Material-UI widgets only:
56
+
```
57
+
npm i @material-ui/core
58
+
npm i @material-ui/icons
59
+
npm i @material-ui/pickers
60
+
npm i material-ui-confirm
61
+
```
43
62
44
63
See [basic usage](#usage) and [API](#api) below.
45
64
@@ -53,18 +72,24 @@ Demo apps:
53
72
From v2.0 of this lib AntDesign is now optional (peer) dependency, so you need to explicitly include `antd` (4.x) in `package.json` of your project if you want to use AntDesign UI.
54
73
Please import `AntdConfig` from `react-awesome-query-builder/lib/config/antd` and use it as base for your config (see below in [usage](#usage)).
55
74
Alternatively you can use `BasicConfig` for simple vanilla UI, which is by default.
56
-
Support of other UI frameworks (like Bootstrap, Material UI) are planned for future, see [Other UI frameworks](#other-ui-frameworks).
75
+
Support of other UI frameworks (like Bootstrap) are planned for future, see [Other UI frameworks](#other-ui-frameworks).
0 commit comments