@react-querybuilder/antd 4.4.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,34 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
1
  import { Button, Switch, Select, Radio, Checkbox, Input, TimePicker, DatePicker } from "antd";
33
2
  import require$$0, { forwardRef, useMemo, useEffect } from "react";
34
3
  import { HolderOutlined } from "@ant-design/icons";
@@ -64,108 +33,70 @@ reactJsxRuntime_production_min.jsxs = q;
64
33
  jsxRuntime.exports = reactJsxRuntime_production_min;
65
34
  }
66
35
  const jsx = jsxRuntime.exports.jsx;
67
- const AntDActionElement = (_a) => {
68
- var _b = _a, {
69
- className,
70
- handleOnClick,
71
- label,
72
- title,
73
- disabled,
74
- disabledTranslation,
75
- testID: _testID,
76
- rules: _rules,
77
- level: _level,
78
- path: _path,
79
- context: _context,
80
- validation: _validation
81
- } = _b, extraProps = __objRest(_b, [
82
- "className",
83
- "handleOnClick",
84
- "label",
85
- "title",
86
- "disabled",
87
- "disabledTranslation",
88
- "testID",
89
- "rules",
90
- "level",
91
- "path",
92
- "context",
93
- "validation"
94
- ]);
95
- return /* @__PURE__ */ jsx(Button, __spreadProps(__spreadValues({
96
- type: "primary",
97
- className,
98
- title: disabledTranslation && disabled ? disabledTranslation.title : title,
99
- onClick: (e) => handleOnClick(e),
100
- disabled: disabled && !disabledTranslation
101
- }, extraProps), {
102
- children: disabledTranslation && disabled ? disabledTranslation.label : label
103
- }));
104
- };
105
- AntDActionElement.displayName = "AntDActionElement";
106
- const AntDDragHandle = forwardRef((_c, dragRef) => {
107
- var _d = _c, {
108
- className,
109
- title,
110
- testID: _testID,
111
- level: _level,
112
- path: _path,
113
- label: _label,
114
- disabled: _disabled,
115
- context: _context,
116
- validation: _validation
117
- } = _d, extraProps = __objRest(_d, [
118
- "className",
119
- "title",
120
- "testID",
121
- "level",
122
- "path",
123
- "label",
124
- "disabled",
125
- "context",
126
- "validation"
127
- ]);
128
- return /* @__PURE__ */ jsx(HolderOutlined, __spreadValues({
129
- ref: dragRef,
130
- className,
131
- title
132
- }, extraProps));
36
+ const AntDActionElement = ({
37
+ className,
38
+ handleOnClick,
39
+ label,
40
+ title,
41
+ disabled,
42
+ disabledTranslation,
43
+ testID: _testID,
44
+ rules: _rules,
45
+ level: _level,
46
+ path: _path,
47
+ context: _context,
48
+ validation: _validation,
49
+ ...extraProps
50
+ }) => /* @__PURE__ */ jsx(Button, {
51
+ type: "primary",
52
+ className,
53
+ title: disabledTranslation && disabled ? disabledTranslation.title : title,
54
+ onClick: (e) => handleOnClick(e),
55
+ disabled: disabled && !disabledTranslation,
56
+ ...extraProps,
57
+ children: disabledTranslation && disabled ? disabledTranslation.label : label
133
58
  });
59
+ AntDActionElement.displayName = "AntDActionElement";
60
+ const AntDDragHandle = forwardRef(({
61
+ className,
62
+ title,
63
+ testID: _testID,
64
+ level: _level,
65
+ path: _path,
66
+ label: _label,
67
+ disabled: _disabled,
68
+ context: _context,
69
+ validation: _validation,
70
+ ...extraProps
71
+ }, dragRef) => /* @__PURE__ */ jsx(HolderOutlined, {
72
+ ref: dragRef,
73
+ className,
74
+ title,
75
+ ...extraProps
76
+ }));
134
77
  AntDDragHandle.displayName = "AntDDragHandle";
135
- const AntDNotToggle = (_e) => {
136
- var _f = _e, {
137
- className,
138
- handleOnChange,
139
- label,
140
- checked,
141
- title,
142
- disabled,
143
- path: _path,
144
- context: _context,
145
- validation: _validation,
146
- testID: _testID
147
- } = _f, extraProps = __objRest(_f, [
148
- "className",
149
- "handleOnChange",
150
- "label",
151
- "checked",
152
- "title",
153
- "disabled",
154
- "path",
155
- "context",
156
- "validation",
157
- "testID"
158
- ]);
159
- return /* @__PURE__ */ jsx(Switch, __spreadValues({
160
- title,
161
- className,
162
- onChange: (v) => handleOnChange(v),
163
- checked: !!checked,
164
- disabled,
165
- checkedChildren: label,
166
- unCheckedChildren: "="
167
- }, extraProps));
168
- };
78
+ const AntDNotToggle = ({
79
+ className,
80
+ handleOnChange,
81
+ label,
82
+ checked,
83
+ title,
84
+ disabled,
85
+ path: _path,
86
+ context: _context,
87
+ validation: _validation,
88
+ testID: _testID,
89
+ ...extraProps
90
+ }) => /* @__PURE__ */ jsx(Switch, {
91
+ title,
92
+ className,
93
+ onChange: (v) => handleOnChange(v),
94
+ checked: !!checked,
95
+ disabled,
96
+ checkedChildren: label,
97
+ unCheckedChildren: "=",
98
+ ...extraProps
99
+ });
169
100
  AntDNotToggle.displayName = "AntDNotToggle";
170
101
  //! moment.js
171
102
  //! version : 2.29.3
@@ -3874,42 +3805,25 @@ const toOptions = (arr) => isOptionGroupArray(arr) ? arr.map((og) => /* @__PURE_
3874
3805
  value: opt.name,
3875
3806
  children: opt.label
3876
3807
  }, opt.name)) : null;
3877
- const AntDValueSelector = (_g) => {
3878
- var _h = _g, {
3879
- className,
3880
- handleOnChange,
3881
- options,
3882
- value,
3883
- title,
3884
- disabled,
3885
- multiple,
3886
- testID: _testID,
3887
- rules: _rules,
3888
- level: _level,
3889
- path: _path,
3890
- context: _context,
3891
- validation: _validation,
3892
- operator: _operator,
3893
- field: _field,
3894
- fieldData: _fieldData
3895
- } = _h, extraProps = __objRest(_h, [
3896
- "className",
3897
- "handleOnChange",
3898
- "options",
3899
- "value",
3900
- "title",
3901
- "disabled",
3902
- "multiple",
3903
- "testID",
3904
- "rules",
3905
- "level",
3906
- "path",
3907
- "context",
3908
- "validation",
3909
- "operator",
3910
- "field",
3911
- "fieldData"
3912
- ]);
3808
+ const AntDValueSelector = ({
3809
+ className,
3810
+ handleOnChange,
3811
+ options,
3812
+ value,
3813
+ title,
3814
+ disabled,
3815
+ multiple,
3816
+ testID: _testID,
3817
+ rules: _rules,
3818
+ level: _level,
3819
+ path: _path,
3820
+ context: _context,
3821
+ validation: _validation,
3822
+ operator: _operator,
3823
+ field: _field,
3824
+ fieldData: _fieldData,
3825
+ ...extraProps
3826
+ }) => {
3913
3827
  const onChange = useMemo(() => {
3914
3828
  if (multiple) {
3915
3829
  return (v) => handleOnChange(Array.isArray(v) ? v.join(",") : v);
@@ -3923,43 +3837,32 @@ const AntDValueSelector = (_g) => {
3923
3837
  return /* @__PURE__ */ jsx("span", {
3924
3838
  title,
3925
3839
  className,
3926
- children: /* @__PURE__ */ jsx(Select, __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, modeObj), {
3840
+ children: /* @__PURE__ */ jsx(Select, {
3841
+ ...modeObj,
3927
3842
  dropdownMatchSelectWidth: false,
3928
3843
  disabled,
3929
3844
  value: val,
3930
- onChange
3931
- }), extraProps), {
3845
+ onChange,
3846
+ ...extraProps,
3932
3847
  children: toOptions(options)
3933
- }))
3848
+ })
3934
3849
  });
3935
3850
  };
3936
3851
  AntDValueSelector.displayName = "AntDValueSelector";
3937
- const AntDValueEditor = (_i) => {
3938
- var _j = _i, {
3939
- fieldData,
3940
- operator,
3941
- value,
3942
- handleOnChange,
3943
- title,
3944
- className,
3945
- type,
3946
- inputType,
3947
- values,
3948
- valueSource: _vs,
3949
- disabled
3950
- } = _j, props = __objRest(_j, [
3951
- "fieldData",
3952
- "operator",
3953
- "value",
3954
- "handleOnChange",
3955
- "title",
3956
- "className",
3957
- "type",
3958
- "inputType",
3959
- "values",
3960
- "valueSource",
3961
- "disabled"
3962
- ]);
3852
+ const AntDValueEditor = ({
3853
+ fieldData,
3854
+ operator,
3855
+ value,
3856
+ handleOnChange,
3857
+ title,
3858
+ className,
3859
+ type,
3860
+ inputType,
3861
+ values,
3862
+ valueSource: _vs,
3863
+ disabled,
3864
+ ...props
3865
+ }) => {
3963
3866
  var _a;
3964
3867
  useEffect(() => {
3965
3868
  if (inputType === "number" && !["between", "notBetween", "in", "notIn"].includes(operator) && typeof value === "string" && value.includes(",")) {
@@ -3974,7 +3877,8 @@ const AntDValueEditor = (_i) => {
3974
3877
  switch (type) {
3975
3878
  case "select":
3976
3879
  case "multiselect":
3977
- return /* @__PURE__ */ jsx(AntDValueSelector, __spreadProps(__spreadValues({}, props), {
3880
+ return /* @__PURE__ */ jsx(AntDValueSelector, {
3881
+ ...props,
3978
3882
  className,
3979
3883
  handleOnChange,
3980
3884
  options: values,
@@ -3982,7 +3886,7 @@ const AntDValueEditor = (_i) => {
3982
3886
  title,
3983
3887
  disabled,
3984
3888
  multiple: type === "multiselect"
3985
- }));
3889
+ });
3986
3890
  case "textarea":
3987
3891
  return /* @__PURE__ */ jsx(Input.TextArea, {
3988
3892
  value,