@react-querybuilder/antd 8.8.3 → 8.9.1

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.
Files changed (33) hide show
  1. package/dist/cjs/index.d.ts +1 -0
  2. package/dist/cjs/react-querybuilder_antd.cjs.development.d.ts +2770 -0
  3. package/dist/cjs/react-querybuilder_antd.cjs.development.js +520 -962
  4. package/dist/cjs/react-querybuilder_antd.cjs.development.js.map +1 -1
  5. package/dist/cjs/react-querybuilder_antd.cjs.production.d.ts +2770 -0
  6. package/dist/cjs/react-querybuilder_antd.cjs.production.js +1 -2
  7. package/dist/cjs/react-querybuilder_antd.cjs.production.js.map +1 -1
  8. package/dist/react-querybuilder_antd.d.mts +2770 -0
  9. package/dist/react-querybuilder_antd.legacy-esm.d.ts +2770 -0
  10. package/dist/react-querybuilder_antd.legacy-esm.js +655 -1010
  11. package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
  12. package/dist/react-querybuilder_antd.mjs +496 -937
  13. package/dist/react-querybuilder_antd.mjs.map +1 -1
  14. package/dist/react-querybuilder_antd.production.d.mts +2770 -0
  15. package/dist/react-querybuilder_antd.production.mjs +1 -2
  16. package/dist/react-querybuilder_antd.production.mjs.map +1 -1
  17. package/package.json +14 -14
  18. package/dist/types/AntDActionElement.d.ts +0 -14
  19. package/dist/types/AntDDragHandle.d.ts +0 -14
  20. package/dist/types/AntDNotToggle.d.ts +0 -12
  21. package/dist/types/AntDShiftActions.d.ts +0 -6
  22. package/dist/types/AntDValueEditor.d.ts +0 -12
  23. package/dist/types/AntDValueSelector.d.ts +0 -12
  24. package/dist/types/dayjs.d.ts +0 -45
  25. package/dist/types/index.d.ts +0 -19
  26. package/dist/types-esm/AntDActionElement.d.mts +0 -14
  27. package/dist/types-esm/AntDDragHandle.d.mts +0 -14
  28. package/dist/types-esm/AntDNotToggle.d.mts +0 -12
  29. package/dist/types-esm/AntDShiftActions.d.mts +0 -6
  30. package/dist/types-esm/AntDValueEditor.d.mts +0 -12
  31. package/dist/types-esm/AntDValueSelector.d.mts +0 -12
  32. package/dist/types-esm/dayjs.d.mts +0 -45
  33. package/dist/types-esm/index.d.mts +0 -19
@@ -1,1056 +1,701 @@
1
+ import { CloseOutlined, CopyOutlined, DownOutlined, HolderOutlined, LockOutlined, UnlockOutlined, UpOutlined } from "@ant-design/icons";
2
+ import * as React from "react";
3
+ import { forwardRef } from "react";
4
+ import { ValueEditor, getCompatContextProvider, joinWith, useValueEditor, useValueSelector } from "react-querybuilder";
5
+ import { Button, Checkbox, Input, InputNumber, Radio, Select, Switch } from "antd";
6
+ import generatePicker from "antd/es/date-picker/generatePicker/index.js";
7
+ import dayjs from "dayjs";
8
+ import advancedFormat from "dayjs/plugin/advancedFormat.js";
9
+ import customParseFormat from "dayjs/plugin/customParseFormat.js";
10
+ import localeData from "dayjs/plugin/localeData.js";
11
+ import weekOfYear from "dayjs/plugin/weekOfYear.js";
12
+ import weekYear from "dayjs/plugin/weekYear.js";
13
+ import weekday from "dayjs/plugin/weekday.js";
14
+
15
+ //#region rolldown:runtime
1
16
  var __create = Object.create;
2
17
  var __defProp = Object.defineProperty;
3
18
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
19
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
20
  var __getProtoOf = Object.getPrototypeOf;
6
21
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
+ var __commonJS = (cb, mod) => function() {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
24
  };
10
25
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
26
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
27
+ key = keys[i];
28
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
29
+ get: ((k) => from[k]).bind(null, key),
30
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
31
+ });
32
+ }
33
+ return to;
17
34
  };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
35
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
36
+ value: mod,
37
+ enumerable: true
38
+ }) : target, mod));
26
39
 
27
- // ../../node_modules/rc-util/lib/warning.js
28
- var require_warning = __commonJS({
29
- "../../node_modules/rc-util/lib/warning.js"(exports) {
30
- "use strict";
31
- Object.defineProperty(exports, "__esModule", {
32
- value: true
33
- });
34
- exports.call = call;
35
- exports.default = void 0;
36
- exports.note = note;
37
- exports.noteOnce = noteOnce2;
38
- exports.preMessage = void 0;
39
- exports.resetWarned = resetWarned;
40
- exports.warning = warning;
41
- exports.warningOnce = warningOnce;
42
- var warned = {};
43
- var preWarningFns = [];
44
- var preMessage = exports.preMessage = function preMessage2(fn) {
45
- preWarningFns.push(fn);
46
- };
47
- function warning(valid, message) {
48
- if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
49
- var finalMessage = preWarningFns.reduce(function(msg, preMessageFn) {
50
- return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
51
- }, message);
52
- if (finalMessage) {
53
- console.error("Warning: ".concat(finalMessage));
54
- }
55
- }
56
- }
57
- function note(valid, message) {
58
- if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
59
- var finalMessage = preWarningFns.reduce(function(msg, preMessageFn) {
60
- return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
61
- }, message);
62
- if (finalMessage) {
63
- console.warn("Note: ".concat(finalMessage));
64
- }
65
- }
66
- }
67
- function resetWarned() {
68
- warned = {};
69
- }
70
- function call(method, valid, message) {
71
- if (!valid && !warned[message]) {
72
- method(false, message);
73
- warned[message] = true;
74
- }
75
- }
76
- function warningOnce(valid, message) {
77
- call(warning, valid, message);
78
- }
79
- function noteOnce2(valid, message) {
80
- call(note, valid, message);
81
- }
82
- warningOnce.preMessage = preMessage;
83
- warningOnce.resetWarned = resetWarned;
84
- warningOnce.noteOnce = noteOnce2;
85
- var _default = exports.default = warningOnce;
86
- }
87
- });
40
+ //#endregion
41
+ //#region \0@oxc-project+runtime@0.89.0/helpers/objectWithoutPropertiesLoose.js
42
+ function _objectWithoutPropertiesLoose(r, e) {
43
+ if (null == r) return {};
44
+ var t = {};
45
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
46
+ if (e.includes(n)) continue;
47
+ t[n] = r[n];
48
+ }
49
+ return t;
50
+ }
88
51
 
89
- // src/index.tsx
90
- import { jsx as jsx7 } from "react/jsx-runtime";
91
- import { CloseOutlined, CopyOutlined, DownOutlined, LockOutlined, UnlockOutlined, UpOutlined } from "@ant-design/icons";
92
- import { getCompatContextProvider } from "react-querybuilder";
52
+ //#endregion
53
+ //#region \0@oxc-project+runtime@0.89.0/helpers/objectWithoutProperties.js
54
+ function _objectWithoutProperties(e, t) {
55
+ if (null == e) return {};
56
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
57
+ if (Object.getOwnPropertySymbols) {
58
+ var s = Object.getOwnPropertySymbols(e);
59
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
60
+ }
61
+ return i;
62
+ }
93
63
 
94
- // src/AntDActionElement.tsx
95
- import { jsx } from "react/jsx-runtime";
96
- import { Button } from "antd";
97
- function _createForOfIteratorHelper(r, e) {
98
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
99
- if (!t) {
100
- if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
101
- t && (r = t);
102
- var _n = 0, F = function F2() {
103
- };
104
- return { s: F, n: function n() {
105
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
106
- }, e: function e2(r2) {
107
- throw r2;
108
- }, f: F };
109
- }
110
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
111
- }
112
- var o, a = true, u = false;
113
- return { s: function s() {
114
- t = t.call(r);
115
- }, n: function n() {
116
- var r2 = t.next();
117
- return a = r2.done, r2;
118
- }, e: function e2(r2) {
119
- u = true, o = r2;
120
- }, f: function f() {
121
- try {
122
- a || null == t["return"] || t["return"]();
123
- } finally {
124
- if (u) throw o;
125
- }
126
- } };
64
+ //#endregion
65
+ //#region \0@oxc-project+runtime@0.89.0/helpers/typeof.js
66
+ function _typeof(o) {
67
+ "@babel/helpers - typeof";
68
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
69
+ return typeof o$1;
70
+ } : function(o$1) {
71
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
72
+ }, _typeof(o);
127
73
  }
128
- function _unsupportedIterableToArray(r, a) {
129
- if (r) {
130
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
131
- var t = {}.toString.call(r).slice(8, -1);
132
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
133
- }
74
+
75
+ //#endregion
76
+ //#region \0@oxc-project+runtime@0.89.0/helpers/toPrimitive.js
77
+ function toPrimitive(t, r) {
78
+ if ("object" != _typeof(t) || !t) return t;
79
+ var e = t[Symbol.toPrimitive];
80
+ if (void 0 !== e) {
81
+ var i = e.call(t, r || "default");
82
+ if ("object" != _typeof(i)) return i;
83
+ throw new TypeError("@@toPrimitive must return a primitive value.");
84
+ }
85
+ return ("string" === r ? String : Number)(t);
134
86
  }
135
- function _arrayLikeToArray(r, a) {
136
- (null == a || a > r.length) && (a = r.length);
137
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
138
- return n;
87
+
88
+ //#endregion
89
+ //#region \0@oxc-project+runtime@0.89.0/helpers/toPropertyKey.js
90
+ function toPropertyKey(t) {
91
+ var i = toPrimitive(t, "string");
92
+ return "symbol" == _typeof(i) ? i : i + "";
139
93
  }
140
- var __defProp2 = Object.defineProperty;
141
- var __defProps = Object.defineProperties;
142
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
143
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
144
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
145
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
146
- var __defNormalProp = function __defNormalProp2(obj, key, value) {
147
- return key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
148
- };
149
- var __spreadValues = function __spreadValues2(a, b) {
150
- for (var prop in b || (b = {})) if (__hasOwnProp2.call(b, prop)) __defNormalProp(a, prop, b[prop]);
151
- if (__getOwnPropSymbols) {
152
- var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)), _step;
153
- try {
154
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
155
- var prop = _step.value;
156
- if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
157
- }
158
- } catch (err) {
159
- _iterator.e(err);
160
- } finally {
161
- _iterator.f();
162
- }
163
- }
164
- return a;
165
- };
166
- var __spreadProps = function __spreadProps2(a, b) {
167
- return __defProps(a, __getOwnPropDescs(b));
168
- };
169
- var __objRest = function __objRest2(source, exclude) {
170
- var target = {};
171
- for (var prop in source) if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
172
- if (source != null && __getOwnPropSymbols) {
173
- var _iterator2 = _createForOfIteratorHelper(__getOwnPropSymbols(source)), _step2;
174
- try {
175
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
176
- var prop = _step2.value;
177
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
178
- }
179
- } catch (err) {
180
- _iterator2.e(err);
181
- } finally {
182
- _iterator2.f();
183
- }
184
- }
185
- return target;
186
- };
187
- var AntDActionElement = function AntDActionElement2(_a) {
188
- var _b = _a, className = _b.className, handleOnClick = _b.handleOnClick, label = _b.label, title = _b.title, disabled = _b.disabled, disabledTranslation = _b.disabledTranslation, _testID = _b.testID, _level = _b.level, _path = _b.path, _context = _b.context, _validation = _b.validation, _ruleOrGroup = _b.ruleOrGroup, _schema = _b.schema, extraProps = __objRest(_b, [
189
- "className",
190
- "handleOnClick",
191
- "label",
192
- "title",
193
- "disabled",
194
- "disabledTranslation",
195
- // Props that should not be in extraProps
196
- "testID",
197
- "level",
198
- "path",
199
- "context",
200
- "validation",
201
- "ruleOrGroup",
202
- "schema"
203
- ]);
204
- return /* @__PURE__ */ jsx(Button, __spreadProps(__spreadValues({ type: "primary", className, title: disabledTranslation && disabled ? disabledTranslation.title : title, onClick: function onClick(e) {
205
- return handleOnClick(e);
206
- }, disabled: disabled && !disabledTranslation }, extraProps), { children: disabledTranslation && disabled ? disabledTranslation.label : label }));
207
- };
208
94
 
209
- // src/AntDDragHandle.tsx
210
- import { jsx as jsx2 } from "react/jsx-runtime";
211
- import { HolderOutlined } from "@ant-design/icons";
212
- import { forwardRef } from "react";
213
- function _createForOfIteratorHelper2(r, e) {
214
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
215
- if (!t) {
216
- if (Array.isArray(r) || (t = _unsupportedIterableToArray2(r)) || e && r && "number" == typeof r.length) {
217
- t && (r = t);
218
- var _n = 0, F = function F2() {
219
- };
220
- return { s: F, n: function n() {
221
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
222
- }, e: function e2(r2) {
223
- throw r2;
224
- }, f: F };
225
- }
226
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
227
- }
228
- var o, a = true, u = false;
229
- return { s: function s() {
230
- t = t.call(r);
231
- }, n: function n() {
232
- var r2 = t.next();
233
- return a = r2.done, r2;
234
- }, e: function e2(r2) {
235
- u = true, o = r2;
236
- }, f: function f() {
237
- try {
238
- a || null == t["return"] || t["return"]();
239
- } finally {
240
- if (u) throw o;
241
- }
242
- } };
95
+ //#endregion
96
+ //#region \0@oxc-project+runtime@0.89.0/helpers/defineProperty.js
97
+ function _defineProperty(e, r, t) {
98
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
99
+ value: t,
100
+ enumerable: !0,
101
+ configurable: !0,
102
+ writable: !0
103
+ }) : e[r] = t, e;
243
104
  }
244
- function _unsupportedIterableToArray2(r, a) {
245
- if (r) {
246
- if ("string" == typeof r) return _arrayLikeToArray2(r, a);
247
- var t = {}.toString.call(r).slice(8, -1);
248
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray2(r, a) : void 0;
249
- }
105
+
106
+ //#endregion
107
+ //#region \0@oxc-project+runtime@0.89.0/helpers/objectSpread2.js
108
+ function ownKeys(e, r) {
109
+ var t = Object.keys(e);
110
+ if (Object.getOwnPropertySymbols) {
111
+ var o = Object.getOwnPropertySymbols(e);
112
+ r && (o = o.filter(function(r$1) {
113
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
114
+ })), t.push.apply(t, o);
115
+ }
116
+ return t;
250
117
  }
251
- function _arrayLikeToArray2(r, a) {
252
- (null == a || a > r.length) && (a = r.length);
253
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
254
- return n;
118
+ function _objectSpread2(e) {
119
+ for (var r = 1; r < arguments.length; r++) {
120
+ var t = null != arguments[r] ? arguments[r] : {};
121
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
122
+ _defineProperty(e, r$1, t[r$1]);
123
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
124
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
125
+ });
126
+ }
127
+ return e;
255
128
  }
256
- var __defProp3 = Object.defineProperty;
257
- var __defProps2 = Object.defineProperties;
258
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
259
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
260
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
261
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
262
- var __defNormalProp3 = function __defNormalProp4(obj, key, value) {
263
- return key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
264
- };
265
- var __spreadValues3 = function __spreadValues4(a, b) {
266
- for (var prop in b || (b = {})) if (__hasOwnProp3.call(b, prop)) __defNormalProp3(a, prop, b[prop]);
267
- if (__getOwnPropSymbols2) {
268
- var _iterator = _createForOfIteratorHelper2(__getOwnPropSymbols2(b)), _step;
269
- try {
270
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
271
- var prop = _step.value;
272
- if (__propIsEnum2.call(b, prop)) __defNormalProp3(a, prop, b[prop]);
273
- }
274
- } catch (err) {
275
- _iterator.e(err);
276
- } finally {
277
- _iterator.f();
278
- }
279
- }
280
- return a;
281
- };
282
- var __spreadProps3 = function __spreadProps4(a, b) {
283
- return __defProps2(a, __getOwnPropDescs2(b));
284
- };
285
- var __objRest3 = function __objRest4(source, exclude) {
286
- var target = {};
287
- for (var prop in source) if (__hasOwnProp3.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
288
- if (source != null && __getOwnPropSymbols2) {
289
- var _iterator2 = _createForOfIteratorHelper2(__getOwnPropSymbols2(source)), _step2;
290
- try {
291
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
292
- var prop = _step2.value;
293
- if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop)) target[prop] = source[prop];
294
- }
295
- } catch (err) {
296
- _iterator2.e(err);
297
- } finally {
298
- _iterator2.f();
299
- }
300
- }
301
- return target;
129
+
130
+ //#endregion
131
+ //#region src/AntDActionElement.tsx
132
+ const _excluded$4 = [
133
+ "className",
134
+ "handleOnClick",
135
+ "label",
136
+ "title",
137
+ "disabled",
138
+ "disabledTranslation",
139
+ "testID",
140
+ "level",
141
+ "path",
142
+ "context",
143
+ "validation",
144
+ "ruleOrGroup",
145
+ "schema"
146
+ ];
147
+ /**
148
+ * @group Components
149
+ */
150
+ const AntDActionElement = (_ref) => {
151
+ let { className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema } = _ref, extraProps = _objectWithoutProperties(_ref, _excluded$4);
152
+ return /* @__PURE__ */ React.createElement(Button, _objectSpread2({
153
+ type: "primary",
154
+ className,
155
+ title: disabledTranslation && disabled ? disabledTranslation.title : title,
156
+ onClick: (e) => handleOnClick(e),
157
+ disabled: disabled && !disabledTranslation
158
+ }, extraProps), disabledTranslation && disabled ? disabledTranslation.label : label);
302
159
  };
303
- var AntDDragHandle = /* @__PURE__ */ forwardRef(function(_a, dragRef) {
304
- var _b = _a, className = _b.className, title = _b.title, _testID = _b.testID, _level = _b.level, _path = _b.path, _label = _b.label, _disabled = _b.disabled, _context = _b.context, _validation = _b.validation, _schema = _b.schema, _ruleOrGroup = _b.ruleOrGroup, extraProps = __objRest3(_b, [
305
- "className",
306
- "title",
307
- // Props that should not be in extraProps
308
- "testID",
309
- "level",
310
- "path",
311
- "label",
312
- "disabled",
313
- "context",
314
- "validation",
315
- "schema",
316
- "ruleOrGroup"
317
- ]);
318
- return /* @__PURE__ */ jsx2(HolderOutlined, __spreadProps3(__spreadValues3({ className, title }, extraProps), { ref: dragRef }));
160
+
161
+ //#endregion
162
+ //#region src/AntDDragHandle.tsx
163
+ const _excluded$3 = [
164
+ "className",
165
+ "title",
166
+ "testID",
167
+ "level",
168
+ "path",
169
+ "label",
170
+ "disabled",
171
+ "context",
172
+ "validation",
173
+ "schema",
174
+ "ruleOrGroup"
175
+ ];
176
+ /**
177
+ * @group Components
178
+ */
179
+ const AntDDragHandle = forwardRef((_ref, dragRef) => {
180
+ let { className, title, testID: _testID, level: _level, path: _path, label: _label, disabled: _disabled, context: _context, validation: _validation, schema: _schema, ruleOrGroup: _ruleOrGroup } = _ref, extraProps = _objectWithoutProperties(_ref, _excluded$3);
181
+ return /* @__PURE__ */ React.createElement(HolderOutlined, _objectSpread2(_objectSpread2({
182
+ className,
183
+ title
184
+ }, extraProps), {}, { ref: dragRef }));
319
185
  });
320
186
 
321
- // src/AntDNotToggle.tsx
322
- import { jsx as jsx3 } from "react/jsx-runtime";
323
- import { Switch } from "antd";
324
- function _createForOfIteratorHelper3(r, e) {
325
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
326
- if (!t) {
327
- if (Array.isArray(r) || (t = _unsupportedIterableToArray3(r)) || e && r && "number" == typeof r.length) {
328
- t && (r = t);
329
- var _n = 0, F = function F2() {
330
- };
331
- return { s: F, n: function n() {
332
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
333
- }, e: function e2(r2) {
334
- throw r2;
335
- }, f: F };
336
- }
337
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
338
- }
339
- var o, a = true, u = false;
340
- return { s: function s() {
341
- t = t.call(r);
342
- }, n: function n() {
343
- var r2 = t.next();
344
- return a = r2.done, r2;
345
- }, e: function e2(r2) {
346
- u = true, o = r2;
347
- }, f: function f() {
348
- try {
349
- a || null == t["return"] || t["return"]();
350
- } finally {
351
- if (u) throw o;
352
- }
353
- } };
354
- }
355
- function _unsupportedIterableToArray3(r, a) {
356
- if (r) {
357
- if ("string" == typeof r) return _arrayLikeToArray3(r, a);
358
- var t = {}.toString.call(r).slice(8, -1);
359
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray3(r, a) : void 0;
360
- }
361
- }
362
- function _arrayLikeToArray3(r, a) {
363
- (null == a || a > r.length) && (a = r.length);
364
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
365
- return n;
366
- }
367
- var __defProp4 = Object.defineProperty;
368
- var __getOwnPropSymbols3 = Object.getOwnPropertySymbols;
369
- var __hasOwnProp4 = Object.prototype.hasOwnProperty;
370
- var __propIsEnum3 = Object.prototype.propertyIsEnumerable;
371
- var __defNormalProp5 = function __defNormalProp6(obj, key, value) {
372
- return key in obj ? __defProp4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
373
- };
374
- var __spreadValues5 = function __spreadValues6(a, b) {
375
- for (var prop in b || (b = {})) if (__hasOwnProp4.call(b, prop)) __defNormalProp5(a, prop, b[prop]);
376
- if (__getOwnPropSymbols3) {
377
- var _iterator = _createForOfIteratorHelper3(__getOwnPropSymbols3(b)), _step;
378
- try {
379
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
380
- var prop = _step.value;
381
- if (__propIsEnum3.call(b, prop)) __defNormalProp5(a, prop, b[prop]);
382
- }
383
- } catch (err) {
384
- _iterator.e(err);
385
- } finally {
386
- _iterator.f();
387
- }
388
- }
389
- return a;
390
- };
391
- var __objRest5 = function __objRest6(source, exclude) {
392
- var target = {};
393
- for (var prop in source) if (__hasOwnProp4.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
394
- if (source != null && __getOwnPropSymbols3) {
395
- var _iterator2 = _createForOfIteratorHelper3(__getOwnPropSymbols3(source)), _step2;
396
- try {
397
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
398
- var prop = _step2.value;
399
- if (exclude.indexOf(prop) < 0 && __propIsEnum3.call(source, prop)) target[prop] = source[prop];
400
- }
401
- } catch (err) {
402
- _iterator2.e(err);
403
- } finally {
404
- _iterator2.f();
405
- }
406
- }
407
- return target;
408
- };
409
- var AntDNotToggle = function AntDNotToggle2(_a) {
410
- var _b = _a, className = _b.className, handleOnChange = _b.handleOnChange, label = _b.label, checked = _b.checked, title = _b.title, disabled = _b.disabled, _path = _b.path, _context = _b.context, _validation = _b.validation, _testID = _b.testID, _schema = _b.schema, _ruleGroup = _b.ruleGroup, extraProps = __objRest5(_b, [
411
- "className",
412
- "handleOnChange",
413
- "label",
414
- "checked",
415
- "title",
416
- "disabled",
417
- // Props that should not be in extraProps
418
- "path",
419
- "context",
420
- "validation",
421
- "testID",
422
- "schema",
423
- "ruleGroup"
424
- ]);
425
- return /* @__PURE__ */ jsx3(Switch, __spreadValues5({ title, className, onChange: function onChange(v) {
426
- return handleOnChange(v);
427
- }, checked: !!checked, disabled, checkedChildren: label, unCheckedChildren: "=" }, extraProps));
187
+ //#endregion
188
+ //#region src/AntDNotToggle.tsx
189
+ const _excluded$2 = [
190
+ "className",
191
+ "handleOnChange",
192
+ "label",
193
+ "checked",
194
+ "title",
195
+ "disabled",
196
+ "path",
197
+ "context",
198
+ "validation",
199
+ "testID",
200
+ "schema",
201
+ "ruleGroup"
202
+ ];
203
+ /**
204
+ * @group Components
205
+ */
206
+ const AntDNotToggle = (_ref) => {
207
+ let { className, handleOnChange, label, checked, title, disabled, path: _path, context: _context, validation: _validation, testID: _testID, schema: _schema, ruleGroup: _ruleGroup } = _ref, extraProps = _objectWithoutProperties(_ref, _excluded$2);
208
+ return /* @__PURE__ */ React.createElement(Switch, _objectSpread2({
209
+ title,
210
+ className,
211
+ onChange: (v) => handleOnChange(v),
212
+ checked: !!checked,
213
+ disabled,
214
+ checkedChildren: label,
215
+ unCheckedChildren: "="
216
+ }, extraProps));
428
217
  };
429
218
 
430
- // src/AntDShiftActions.tsx
431
- import { jsx as jsx4, jsxs } from "react/jsx-runtime";
432
- import { Button as Button2 } from "antd";
433
- var AntDShiftActions = function AntDShiftActions2(_ref) {
434
- var shiftUp = _ref.shiftUp, shiftDown = _ref.shiftDown, shiftUpDisabled = _ref.shiftUpDisabled, shiftDownDisabled = _ref.shiftDownDisabled, disabled = _ref.disabled, className = _ref.className, labels = _ref.labels, titles = _ref.titles, testID = _ref.testID;
435
- return /* @__PURE__ */ jsxs("div", { "data-testid": testID, className, children: [/* @__PURE__ */ jsx4(Button2, { type: "primary", size: "small", title: titles == null ? void 0 : titles.shiftUp, onClick: shiftUp, disabled: disabled || shiftUpDisabled, children: labels == null ? void 0 : labels.shiftUp }), /* @__PURE__ */ jsx4(Button2, { type: "primary", size: "small", title: titles == null ? void 0 : titles.shiftDown, onClick: shiftDown, disabled: disabled || shiftDownDisabled, children: labels == null ? void 0 : labels.shiftDown })] });
436
- };
219
+ //#endregion
220
+ //#region src/AntDShiftActions.tsx
221
+ /**
222
+ * @group Components
223
+ */
224
+ const AntDShiftActions = ({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabled, disabled, className, labels, titles, testID }) => /* @__PURE__ */ React.createElement("div", {
225
+ "data-testid": testID,
226
+ className
227
+ }, /* @__PURE__ */ React.createElement(Button, {
228
+ type: "primary",
229
+ size: "small",
230
+ title: titles === null || titles === void 0 ? void 0 : titles.shiftUp,
231
+ onClick: shiftUp,
232
+ disabled: disabled || shiftUpDisabled
233
+ }, labels === null || labels === void 0 ? void 0 : labels.shiftUp), /* @__PURE__ */ React.createElement(Button, {
234
+ type: "primary",
235
+ size: "small",
236
+ title: titles === null || titles === void 0 ? void 0 : titles.shiftDown,
237
+ onClick: shiftDown,
238
+ disabled: disabled || shiftDownDisabled
239
+ }, labels === null || labels === void 0 ? void 0 : labels.shiftDown));
437
240
 
438
- // src/AntDValueEditor.tsx
439
- import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
440
- import { Checkbox, Input, InputNumber, Radio, Switch as Switch2 } from "antd";
441
- import generatePicker from "antd/es/date-picker/generatePicker/index.js";
442
- import dayjs2 from "dayjs";
443
- import { joinWith, useValueEditor, ValueEditor } from "react-querybuilder";
241
+ //#endregion
242
+ //#region ../../node_modules/rc-util/lib/warning.js
243
+ var require_warning = /* @__PURE__ */ __commonJS({ "../../node_modules/rc-util/lib/warning.js": ((exports) => {
244
+ Object.defineProperty(exports, "__esModule", { value: true });
245
+ exports.noteOnce = noteOnce$1;
246
+ var warned = {};
247
+ var preWarningFns = [];
248
+ /**
249
+ * Pre warning enable you to parse content before console.error.
250
+ * Modify to null will prevent warning.
251
+ */
252
+ var preMessage = exports.preMessage = function preMessage$1(fn) {
253
+ preWarningFns.push(fn);
254
+ };
255
+ /**
256
+ * Warning if condition not match.
257
+ * @param valid Condition
258
+ * @param message Warning message
259
+ * @example
260
+ * ```js
261
+ * warning(false, 'some error'); // print some error
262
+ * warning(true, 'some error'); // print nothing
263
+ * warning(1 === 2, 'some error'); // print some error
264
+ * ```
265
+ */
266
+ function warning(valid, message) {
267
+ if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
268
+ var finalMessage = preWarningFns.reduce(function(msg, preMessageFn) {
269
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "warning");
270
+ }, message);
271
+ if (finalMessage) console.error("Warning: ".concat(finalMessage));
272
+ }
273
+ }
274
+ /** @see Similar to {@link warning} */
275
+ function note(valid, message) {
276
+ if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
277
+ var finalMessage = preWarningFns.reduce(function(msg, preMessageFn) {
278
+ return preMessageFn(msg !== null && msg !== void 0 ? msg : "", "note");
279
+ }, message);
280
+ if (finalMessage) console.warn("Note: ".concat(finalMessage));
281
+ }
282
+ }
283
+ function resetWarned() {
284
+ warned = {};
285
+ }
286
+ function call(method, valid, message) {
287
+ if (!valid && !warned[message]) {
288
+ method(false, message);
289
+ warned[message] = true;
290
+ }
291
+ }
292
+ /** @see Same as {@link warning}, but only warn once for the same message */
293
+ function warningOnce(valid, message) {
294
+ call(warning, valid, message);
295
+ }
296
+ /** @see Same as {@link warning}, but only warn once for the same message */
297
+ function noteOnce$1(valid, message) {
298
+ call(note, valid, message);
299
+ }
300
+ warningOnce.preMessage = preMessage;
301
+ warningOnce.resetWarned = resetWarned;
302
+ warningOnce.noteOnce = noteOnce$1;
303
+ }) });
444
304
 
445
- // src/dayjs.ts
446
- var import_warning = __toESM(require_warning());
447
- import dayjs from "dayjs";
448
- import advancedFormat from "dayjs/plugin/advancedFormat.js";
449
- import customParseFormat from "dayjs/plugin/customParseFormat.js";
450
- import localeData from "dayjs/plugin/localeData.js";
451
- import weekOfYear from "dayjs/plugin/weekOfYear.js";
452
- import weekYear from "dayjs/plugin/weekYear.js";
453
- import weekday from "dayjs/plugin/weekday.js";
454
- function _createForOfIteratorHelper4(r, e) {
455
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
456
- if (!t) {
457
- if (Array.isArray(r) || (t = _unsupportedIterableToArray4(r)) || e && r && "number" == typeof r.length) {
458
- t && (r = t);
459
- var _n = 0, F = function F2() {
460
- };
461
- return { s: F, n: function n() {
462
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
463
- }, e: function e2(r2) {
464
- throw r2;
465
- }, f: F };
466
- }
467
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
468
- }
469
- var o, a = true, u = false;
470
- return { s: function s() {
471
- t = t.call(r);
472
- }, n: function n() {
473
- var r2 = t.next();
474
- return a = r2.done, r2;
475
- }, e: function e2(r2) {
476
- u = true, o = r2;
477
- }, f: function f() {
478
- try {
479
- a || null == t["return"] || t["return"]();
480
- } finally {
481
- if (u) throw o;
482
- }
483
- } };
484
- }
485
- function _unsupportedIterableToArray4(r, a) {
486
- if (r) {
487
- if ("string" == typeof r) return _arrayLikeToArray4(r, a);
488
- var t = {}.toString.call(r).slice(8, -1);
489
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray4(r, a) : void 0;
490
- }
491
- }
492
- function _arrayLikeToArray4(r, a) {
493
- (null == a || a > r.length) && (a = r.length);
494
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
495
- return n;
496
- }
305
+ //#endregion
306
+ //#region src/dayjs.ts
307
+ var import_warning = /* @__PURE__ */ __toESM(require_warning());
497
308
  dayjs.extend(customParseFormat);
498
309
  dayjs.extend(advancedFormat);
499
310
  dayjs.extend(weekday);
500
311
  dayjs.extend(localeData);
501
312
  dayjs.extend(weekOfYear);
502
313
  dayjs.extend(weekYear);
503
- dayjs.extend(function(o, c) {
504
- var proto = c.prototype;
505
- var oldFormat = proto.format;
506
- proto.format = function f(formatStr) {
507
- var str = (formatStr || "").replace("Wo", "wo");
508
- return oldFormat.bind(this)(str);
509
- };
314
+ dayjs.extend((o, c) => {
315
+ const proto = c.prototype;
316
+ const oldFormat = proto.format;
317
+ proto.format = function f(formatStr) {
318
+ const str = (formatStr || "").replace("Wo", "wo");
319
+ return oldFormat.bind(this)(str);
320
+ };
510
321
  });
511
- var localeMap = {
512
- // ar_EG:
513
- // az_AZ:
514
- // bg_BG:
515
- bn_BD: "bn-bd",
516
- by_BY: "be",
517
- // ca_ES:
518
- // cs_CZ:
519
- // da_DK:
520
- // de_DE:
521
- // el_GR:
522
- en_GB: "en-gb",
523
- en_US: "en",
524
- // es_ES:
525
- // et_EE:
526
- // fa_IR:
527
- // fi_FI:
528
- fr_BE: "fr",
529
- // todo: dayjs has no fr_BE locale, use fr at present
530
- fr_CA: "fr-ca",
531
- // fr_FR:
532
- // ga_IE:
533
- // gl_ES:
534
- // he_IL:
535
- // hi_IN:
536
- // hr_HR:
537
- // hu_HU:
538
- hy_AM: "hy-am",
539
- // id_ID:
540
- // is_IS:
541
- // it_IT:
542
- // ja_JP:
543
- // ka_GE:
544
- // kk_KZ:
545
- // km_KH:
546
- kmr_IQ: "ku",
547
- // kn_IN:
548
- // ko_KR:
549
- // ku_IQ: // previous ku in antd
550
- // lt_LT:
551
- // lv_LV:
552
- // mk_MK:
553
- // ml_IN:
554
- // mn_MN:
555
- // ms_MY:
556
- // nb_NO:
557
- // ne_NP:
558
- nl_BE: "nl-be",
559
- // nl_NL:
560
- // pl_PL:
561
- pt_BR: "pt-br",
562
- // pt_PT:
563
- // ro_RO:
564
- // ru_RU:
565
- // sk_SK:
566
- // sl_SI:
567
- // sr_RS:
568
- // sv_SE:
569
- // ta_IN:
570
- // th_TH:
571
- // tr_TR:
572
- // uk_UA:
573
- // ur_PK:
574
- // vi_VN:
575
- zh_CN: "zh-cn",
576
- zh_HK: "zh-hk",
577
- zh_TW: "zh-tw"
322
+ const localeMap = {
323
+ bn_BD: "bn-bd",
324
+ by_BY: "be",
325
+ en_GB: "en-gb",
326
+ en_US: "en",
327
+ fr_BE: "fr",
328
+ fr_CA: "fr-ca",
329
+ hy_AM: "hy-am",
330
+ kmr_IQ: "ku",
331
+ nl_BE: "nl-be",
332
+ pt_BR: "pt-br",
333
+ zh_CN: "zh-cn",
334
+ zh_HK: "zh-hk",
335
+ zh_TW: "zh-tw"
578
336
  };
579
- var parseLocale = function parseLocale2(locale) {
580
- var mapLocale = localeMap[locale];
581
- return mapLocale || locale.split("_")[0];
337
+ const parseLocale = (locale) => {
338
+ return localeMap[locale] || locale.split("_")[0];
582
339
  };
583
- var parseNoMatchNotice = function parseNoMatchNotice2() {
584
- (0, import_warning.noteOnce)(false, "Not match any format. Please help to fire a issue about this.");
340
+ const parseNoMatchNotice = () => {
341
+ /* istanbul ignore next */
342
+ (0, import_warning.noteOnce)(false, "Not match any format. Please help to fire a issue about this.");
585
343
  };
586
- var generateConfig = {
587
- // get
588
- getNow: function getNow() {
589
- return dayjs();
590
- },
591
- getFixedDate: function getFixedDate(string) {
592
- return dayjs(string, ["YYYY-M-DD", "YYYY-MM-DD"]);
593
- },
594
- getEndDate: function getEndDate(date) {
595
- return date.endOf("month");
596
- },
597
- getWeekDay: function getWeekDay(date) {
598
- var clone = date.locale("en");
599
- return clone.weekday() + clone.localeData().firstDayOfWeek();
600
- },
601
- getYear: function getYear(date) {
602
- return date.year();
603
- },
604
- getMonth: function getMonth(date) {
605
- return date.month();
606
- },
607
- getDate: function getDate(date) {
608
- return date.date();
609
- },
610
- getHour: function getHour(date) {
611
- return date.hour();
612
- },
613
- getMinute: function getMinute(date) {
614
- return date.minute();
615
- },
616
- getSecond: function getSecond(date) {
617
- return date.second();
618
- },
619
- getMillisecond: function getMillisecond(date) {
620
- return date.millisecond();
621
- },
622
- // set
623
- addYear: function addYear(date, diff) {
624
- return date.add(diff, "year");
625
- },
626
- addMonth: function addMonth(date, diff) {
627
- return date.add(diff, "month");
628
- },
629
- addDate: function addDate(date, diff) {
630
- return date.add(diff, "day");
631
- },
632
- setYear: function setYear(date, year) {
633
- return date.year(year);
634
- },
635
- setMonth: function setMonth(date, month) {
636
- return date.month(month);
637
- },
638
- setDate: function setDate(date, num) {
639
- return date.date(num);
640
- },
641
- setHour: function setHour(date, hour) {
642
- return date.hour(hour);
643
- },
644
- setMinute: function setMinute(date, minute) {
645
- return date.minute(minute);
646
- },
647
- setSecond: function setSecond(date, second) {
648
- return date.second(second);
649
- },
650
- setMillisecond: function setMillisecond(date, milliseconds) {
651
- return date.millisecond(milliseconds);
652
- },
653
- // Compare
654
- isAfter: function isAfter(date1, date2) {
655
- return date1.isAfter(date2);
656
- },
657
- isValidate: function isValidate(date) {
658
- return date.isValid();
659
- },
660
- locale: { getWeekFirstDay: function getWeekFirstDay(locale) {
661
- return dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek();
662
- }, getWeekFirstDate: function getWeekFirstDate(locale, date) {
663
- return date.locale(parseLocale(locale)).weekday(0);
664
- }, getWeek: function getWeek(locale, date) {
665
- return date.locale(parseLocale(locale)).week();
666
- }, getShortWeekDays: function getShortWeekDays(locale) {
667
- return dayjs().locale(parseLocale(locale)).localeData().weekdaysMin();
668
- }, getShortMonths: function getShortMonths(locale) {
669
- return dayjs().locale(parseLocale(locale)).localeData().monthsShort();
670
- }, format: function format(locale, date, _format) {
671
- return date.locale(parseLocale(locale)).format(_format);
672
- }, parse: function parse(locale, text, formats) {
673
- var localeStr = parseLocale(locale);
674
- var _iterator = _createForOfIteratorHelper4(formats), _step;
675
- try {
676
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
677
- var format2 = _step.value;
678
- var formatText = text;
679
- if (format2.includes("wo") || format2.includes("Wo")) {
680
- var year = formatText.split("-")[0];
681
- var weekStr = formatText.split("-")[1];
682
- var firstWeek = dayjs(year, "YYYY").startOf("year").locale(localeStr);
683
- for (var j = 0; j <= 52; j += 1) {
684
- var nextWeek = firstWeek.add(j, "week");
685
- if (nextWeek.format("Wo") === weekStr) {
686
- return nextWeek;
687
- }
688
- }
689
- parseNoMatchNotice();
690
- return null;
691
- }
692
- var date = dayjs(formatText, format2, true).locale(localeStr);
693
- if (date.isValid()) {
694
- return date;
695
- }
696
- }
697
- } catch (err) {
698
- _iterator.e(err);
699
- } finally {
700
- _iterator.f();
701
- }
702
- if (text) {
703
- parseNoMatchNotice();
704
- }
705
- return null;
706
- } }
344
+ const generateConfig = {
345
+ getNow: () => dayjs(),
346
+ getFixedDate: (string) => dayjs(string, ["YYYY-M-DD", "YYYY-MM-DD"]),
347
+ getEndDate: (date) => date.endOf("month"),
348
+ getWeekDay: (date) => {
349
+ const clone = date.locale("en");
350
+ return clone.weekday() + clone.localeData().firstDayOfWeek();
351
+ },
352
+ getYear: (date) => date.year(),
353
+ getMonth: (date) => date.month(),
354
+ getDate: (date) => date.date(),
355
+ getHour: (date) => date.hour(),
356
+ getMinute: (date) => date.minute(),
357
+ getSecond: (date) => date.second(),
358
+ getMillisecond: (date) => date.millisecond(),
359
+ addYear: (date, diff) => date.add(diff, "year"),
360
+ addMonth: (date, diff) => date.add(diff, "month"),
361
+ addDate: (date, diff) => date.add(diff, "day"),
362
+ setYear: (date, year) => date.year(year),
363
+ setMonth: (date, month) => date.month(month),
364
+ setDate: (date, num) => date.date(num),
365
+ setHour: (date, hour) => date.hour(hour),
366
+ setMinute: (date, minute) => date.minute(minute),
367
+ setSecond: (date, second) => date.second(second),
368
+ setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),
369
+ isAfter: (date1, date2) => date1.isAfter(date2),
370
+ isValidate: (date) => date.isValid(),
371
+ locale: {
372
+ getWeekFirstDay: (locale) => dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek(),
373
+ getWeekFirstDate: (locale, date) => date.locale(parseLocale(locale)).weekday(0),
374
+ getWeek: (locale, date) => date.locale(parseLocale(locale)).week(),
375
+ getShortWeekDays: (locale) => dayjs().locale(parseLocale(locale)).localeData().weekdaysMin(),
376
+ getShortMonths: (locale) => dayjs().locale(parseLocale(locale)).localeData().monthsShort(),
377
+ format: (locale, date, format) => date.locale(parseLocale(locale)).format(format),
378
+ parse: (locale, text, formats) => {
379
+ const localeStr = parseLocale(locale);
380
+ for (const format of formats) {
381
+ const formatText = text;
382
+ if (format.includes("wo") || format.includes("Wo")) {
383
+ const year = formatText.split("-")[0];
384
+ const weekStr = formatText.split("-")[1];
385
+ const firstWeek = dayjs(year, "YYYY").startOf("year").locale(localeStr);
386
+ for (let j = 0; j <= 52; j += 1) {
387
+ const nextWeek = firstWeek.add(j, "week");
388
+ if (nextWeek.format("Wo") === weekStr) return nextWeek;
389
+ }
390
+ parseNoMatchNotice();
391
+ return null;
392
+ }
393
+ const date = dayjs(formatText, format, true).locale(localeStr);
394
+ if (date.isValid()) return date;
395
+ }
396
+ if (text) parseNoMatchNotice();
397
+ return null;
398
+ }
399
+ }
707
400
  };
708
401
  var dayjs_default = generateConfig;
709
402
 
710
- // src/AntDValueEditor.tsx
711
- function _createForOfIteratorHelper5(r, e) {
712
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
713
- if (!t) {
714
- if (Array.isArray(r) || (t = _unsupportedIterableToArray5(r)) || e && r && "number" == typeof r.length) {
715
- t && (r = t);
716
- var _n = 0, F = function F2() {
717
- };
718
- return { s: F, n: function n() {
719
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
720
- }, e: function e2(r2) {
721
- throw r2;
722
- }, f: F };
723
- }
724
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
725
- }
726
- var o, a = true, u = false;
727
- return { s: function s() {
728
- t = t.call(r);
729
- }, n: function n() {
730
- var r2 = t.next();
731
- return a = r2.done, r2;
732
- }, e: function e2(r2) {
733
- u = true, o = r2;
734
- }, f: function f() {
735
- try {
736
- a || null == t["return"] || t["return"]();
737
- } finally {
738
- if (u) throw o;
739
- }
740
- } };
741
- }
742
- function _unsupportedIterableToArray5(r, a) {
743
- if (r) {
744
- if ("string" == typeof r) return _arrayLikeToArray5(r, a);
745
- var t = {}.toString.call(r).slice(8, -1);
746
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray5(r, a) : void 0;
747
- }
748
- }
749
- function _arrayLikeToArray5(r, a) {
750
- (null == a || a > r.length) && (a = r.length);
751
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
752
- return n;
753
- }
754
- var __defProp5 = Object.defineProperty;
755
- var __defProps3 = Object.defineProperties;
756
- var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
757
- var __getOwnPropSymbols4 = Object.getOwnPropertySymbols;
758
- var __hasOwnProp5 = Object.prototype.hasOwnProperty;
759
- var __propIsEnum4 = Object.prototype.propertyIsEnumerable;
760
- var __defNormalProp7 = function __defNormalProp8(obj, key, value) {
761
- return key in obj ? __defProp5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
762
- };
763
- var __spreadValues7 = function __spreadValues8(a, b) {
764
- for (var prop in b || (b = {})) if (__hasOwnProp5.call(b, prop)) __defNormalProp7(a, prop, b[prop]);
765
- if (__getOwnPropSymbols4) {
766
- var _iterator = _createForOfIteratorHelper5(__getOwnPropSymbols4(b)), _step;
767
- try {
768
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
769
- var prop = _step.value;
770
- if (__propIsEnum4.call(b, prop)) __defNormalProp7(a, prop, b[prop]);
771
- }
772
- } catch (err) {
773
- _iterator.e(err);
774
- } finally {
775
- _iterator.f();
776
- }
777
- }
778
- return a;
779
- };
780
- var __spreadProps5 = function __spreadProps6(a, b) {
781
- return __defProps3(a, __getOwnPropDescs3(b));
782
- };
783
- var __objRest7 = function __objRest8(source, exclude) {
784
- var target = {};
785
- for (var prop in source) if (__hasOwnProp5.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
786
- if (source != null && __getOwnPropSymbols4) {
787
- var _iterator2 = _createForOfIteratorHelper5(__getOwnPropSymbols4(source)), _step2;
788
- try {
789
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
790
- var prop = _step2.value;
791
- if (exclude.indexOf(prop) < 0 && __propIsEnum4.call(source, prop)) target[prop] = source[prop];
792
- }
793
- } catch (err) {
794
- _iterator2.e(err);
795
- } finally {
796
- _iterator2.f();
797
- }
798
- }
799
- return target;
800
- };
801
- var DatePicker = generatePicker(dayjs_default);
802
- var AntDValueEditor = function AntDValueEditor2(allProps) {
803
- var _b;
804
- var _a = allProps, fieldData = _a.fieldData, operator = _a.operator, value = _a.value, handleOnChange = _a.handleOnChange, title = _a.title, className = _a.className, type = _a.type, inputType = _a.inputType, _a$values = _a.values, values = _a$values === void 0 ? [] : _a$values, listsAsArrays = _a.listsAsArrays, separator = _a.separator, _vs = _a.valueSource, disabled = _a.disabled, testID = _a.testID, _a$selectorComponent = _a.selectorComponent, SelectorComponent = _a$selectorComponent === void 0 ? allProps.schema.controls.valueSelector : _a$selectorComponent, extraProps = _a.extraProps, _parseNumbers = _a.parseNumbers, propsForValueSelector = __objRest7(_a, ["fieldData", "operator", "value", "handleOnChange", "title", "className", "type", "inputType", "values", "listsAsArrays", "separator", "valueSource", "disabled", "testID", "selectorComponent", "extraProps", "parseNumbers"]);
805
- var _useValueEditor = useValueEditor(allProps), valueAsArray = _useValueEditor.valueAsArray, multiValueHandler = _useValueEditor.multiValueHandler, bigIntValueHandler = _useValueEditor.bigIntValueHandler, valueListItemClassName = _useValueEditor.valueListItemClassName, inputTypeCoerced = _useValueEditor.inputTypeCoerced;
806
- if (operator === "null" || operator === "notNull") {
807
- return null;
808
- }
809
- var placeHolderText = (_b = fieldData == null ? void 0 : fieldData.placeholder) != null ? _b : "";
810
- if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") && // Date ranges are handled differently in AntD--see below
811
- inputTypeCoerced !== "date" && inputTypeCoerced !== "datetime-local") {
812
- if (type === "text") {
813
- var editors = ["from", "to"].map(function(key, i) {
814
- var _a2, _b2;
815
- if (inputTypeCoerced === "time") {
816
- return /* @__PURE__ */ jsx5(DatePicker.TimePicker, __spreadValues7({ value: valueAsArray[i] ? dayjs2(valueAsArray[i], "HH:mm:ss") : null, className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(d) {
817
- var _a3;
818
- return multiValueHandler((_a3 = d == null ? void 0 : d.format("HH:mm:ss")) != null ? _a3 : "", i);
819
- } }, extraProps), key);
820
- } else if (inputTypeCoerced === "number") {
821
- return /* @__PURE__ */ jsx5(InputNumber, __spreadValues7({ type: inputTypeCoerced, value: (_a2 = valueAsArray[i]) != null ? _a2 : "", className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(v) {
822
- return multiValueHandler(v, i);
823
- } }, extraProps), key);
824
- }
825
- return /* @__PURE__ */ jsx5(Input, __spreadValues7({ type: inputTypeCoerced, value: (_b2 = valueAsArray[i]) != null ? _b2 : "", className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(e) {
826
- return multiValueHandler(e.target.value, i);
827
- } }, extraProps), key);
828
- });
829
- return /* @__PURE__ */ jsxs2("span", { "data-testid": testID, className, title, children: [editors[0], separator, editors[1]] });
830
- }
831
- return /* @__PURE__ */ jsx5(ValueEditor, __spreadProps5(__spreadValues7({}, allProps), { skipHook: true }));
832
- }
833
- switch (type) {
834
- case "select":
835
- case "multiselect":
836
- return /* @__PURE__ */ jsx5(SelectorComponent, __spreadValues7(__spreadProps5(__spreadValues7({}, propsForValueSelector), { className, title, value, disabled, listsAsArrays, multiple: type === "multiselect", handleOnChange, options: values }), extraProps));
837
- case "textarea":
838
- return /* @__PURE__ */ jsx5(Input.TextArea, __spreadValues7({ value, title, className, disabled, placeholder: placeHolderText, onChange: function onChange(e_2) {
839
- return handleOnChange(e_2.target.value);
840
- } }, extraProps));
841
- case "switch":
842
- return /* @__PURE__ */ jsx5(Switch2, __spreadValues7({ checked: !!value, title, className, disabled, onChange: function onChange(v_1) {
843
- return handleOnChange(v_1);
844
- } }, extraProps));
845
- case "checkbox":
846
- return /* @__PURE__ */ jsx5("span", { title, className, children: /* @__PURE__ */ jsx5(Checkbox, __spreadValues7({ type: "checkbox", disabled, onChange: function onChange(e_1) {
847
- return handleOnChange(e_1.target.checked);
848
- }, checked: !!value }, extraProps)) });
849
- case "radio":
850
- return /* @__PURE__ */ jsx5("span", { className, title, children: values.map(function(v_0) {
851
- return /* @__PURE__ */ jsx5(Radio, __spreadProps5(__spreadValues7({ value: v_0.name, checked: value === v_0.name, disabled, onChange: function onChange(e_0) {
852
- return handleOnChange(e_0.target.value);
853
- } }, extraProps), { children: v_0.label }), v_0.name);
854
- }) });
855
- }
856
- switch (inputTypeCoerced) {
857
- case "date":
858
- case "datetime-local": {
859
- if (operator === "between" || operator === "notBetween") {
860
- var dayjsArray = valueAsArray.slice(0, 2).map(function(v_2) {
861
- return dayjs2(v_2);
862
- });
863
- return /* @__PURE__ */ jsx5(DatePicker.RangePicker, __spreadValues7({ value: dayjsArray.every(function(d_1) {
864
- return d_1.isValid();
865
- }) ? dayjsArray : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: [placeHolderText, placeHolderText], onChange: (
866
- // istanbul ignore next
867
- function onChange(dates) {
868
- var timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
869
- var format2 = "YYYY-MM-DD".concat(timeFormat);
870
- var dateArray = dates == null ? void 0 : dates.map(function(d_2) {
871
- return (d_2 == null ? void 0 : d_2.isValid()) ? d_2.format(format2) : void 0;
872
- });
873
- handleOnChange(dateArray ? listsAsArrays ? dateArray : joinWith(dateArray, ",") : dates);
874
- }
875
- ) }, extraProps));
876
- }
877
- var dateValue_0 = dayjs2(value);
878
- return /* @__PURE__ */ jsx5(DatePicker, __spreadValues7({ value: dateValue_0.isValid() ? dateValue_0 : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: placeHolderText, onChange: function onChange(_d, dateString) {
879
- return handleOnChange(dateString);
880
- } }, extraProps));
881
- }
882
- case "time": {
883
- var dateValue = dayjs2(value, "HH:mm:ss");
884
- return /* @__PURE__ */ jsx5(DatePicker.TimePicker, __spreadValues7({ value: dateValue.isValid() ? dateValue : void 0, className, disabled, placeholder: placeHolderText, onChange: function onChange(d_0) {
885
- var _a2_0;
886
- return handleOnChange((_a2_0 = d_0 == null ? void 0 : d_0.format("HH:mm:ss")) != null ? _a2_0 : "");
887
- } }, extraProps));
888
- }
889
- case "number": {
890
- return /* @__PURE__ */ jsx5(InputNumber, __spreadValues7({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: handleOnChange }, extraProps));
891
- }
892
- }
893
- if (inputType === "bigint") {
894
- return /* @__PURE__ */ jsx5(Input, __spreadValues7({ "data-testid": testID, type: inputTypeCoerced, placeholder: placeHolderText, value: "".concat(value), title, className, disabled, onChange: function onChange(e_3) {
895
- return bigIntValueHandler(e_3.target.value);
896
- } }, extraProps));
897
- }
898
- return /* @__PURE__ */ jsx5(Input, __spreadValues7({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: function onChange(e_4) {
899
- return handleOnChange(e_4.target.value);
900
- } }, extraProps));
403
+ //#endregion
404
+ //#region src/AntDValueEditor.tsx
405
+ const _excluded$1 = [
406
+ "fieldData",
407
+ "operator",
408
+ "value",
409
+ "handleOnChange",
410
+ "title",
411
+ "className",
412
+ "type",
413
+ "inputType",
414
+ "values",
415
+ "listsAsArrays",
416
+ "separator",
417
+ "valueSource",
418
+ "disabled",
419
+ "testID",
420
+ "selectorComponent",
421
+ "extraProps",
422
+ "parseNumbers"
423
+ ];
424
+ const DatePicker = generatePicker(dayjs_default);
425
+ /**
426
+ * @group Components
427
+ */
428
+ const AntDValueEditor = (allProps) => {
429
+ var _fieldData$placeholde;
430
+ const { fieldData, operator, value, handleOnChange, title, className, type, inputType, values = [], listsAsArrays, separator, valueSource: _vs, disabled, testID, selectorComponent: SelectorComponent = allProps.schema.controls.valueSelector, extraProps, parseNumbers: _parseNumbers } = allProps, propsForValueSelector = _objectWithoutProperties(allProps, _excluded$1);
431
+ const { valueAsArray, multiValueHandler, bigIntValueHandler, valueListItemClassName, inputTypeCoerced } = useValueEditor(allProps);
432
+ if (operator === "null" || operator === "notNull") return null;
433
+ const placeHolderText = (_fieldData$placeholde = fieldData === null || fieldData === void 0 ? void 0 : fieldData.placeholder) !== null && _fieldData$placeholde !== void 0 ? _fieldData$placeholde : "";
434
+ if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") && inputTypeCoerced !== "date" && inputTypeCoerced !== "datetime-local") {
435
+ if (type === "text") {
436
+ const editors = ["from", "to"].map((key, i) => {
437
+ var _valueAsArray$i2;
438
+ if (inputTypeCoerced === "time") return /* @__PURE__ */ React.createElement(DatePicker.TimePicker, _objectSpread2({
439
+ key,
440
+ value: valueAsArray[i] ? dayjs(valueAsArray[i], "HH:mm:ss") : null,
441
+ className: valueListItemClassName,
442
+ disabled,
443
+ placeholder: placeHolderText,
444
+ onChange: (d) => {
445
+ var _d$format;
446
+ return multiValueHandler((_d$format = d === null || d === void 0 ? void 0 : d.format("HH:mm:ss")) !== null && _d$format !== void 0 ? _d$format : "", i);
447
+ }
448
+ }, extraProps));
449
+ else if (inputTypeCoerced === "number") {
450
+ var _valueAsArray$i;
451
+ return /* @__PURE__ */ React.createElement(InputNumber, _objectSpread2({
452
+ key,
453
+ type: inputTypeCoerced,
454
+ value: (_valueAsArray$i = valueAsArray[i]) !== null && _valueAsArray$i !== void 0 ? _valueAsArray$i : "",
455
+ className: valueListItemClassName,
456
+ disabled,
457
+ placeholder: placeHolderText,
458
+ onChange: (v) => multiValueHandler(v, i)
459
+ }, extraProps));
460
+ }
461
+ return /* @__PURE__ */ React.createElement(Input, _objectSpread2({
462
+ key,
463
+ type: inputTypeCoerced,
464
+ value: (_valueAsArray$i2 = valueAsArray[i]) !== null && _valueAsArray$i2 !== void 0 ? _valueAsArray$i2 : "",
465
+ className: valueListItemClassName,
466
+ disabled,
467
+ placeholder: placeHolderText,
468
+ onChange: (e) => multiValueHandler(e.target.value, i)
469
+ }, extraProps));
470
+ });
471
+ return /* @__PURE__ */ React.createElement("span", {
472
+ "data-testid": testID,
473
+ className,
474
+ title
475
+ }, editors[0], separator, editors[1]);
476
+ }
477
+ return /* @__PURE__ */ React.createElement(ValueEditor, _objectSpread2(_objectSpread2({}, allProps), {}, { skipHook: true }));
478
+ }
479
+ switch (type) {
480
+ case "select":
481
+ case "multiselect": return /* @__PURE__ */ React.createElement(SelectorComponent, _objectSpread2(_objectSpread2({}, propsForValueSelector), {}, {
482
+ className,
483
+ title,
484
+ value,
485
+ disabled,
486
+ listsAsArrays,
487
+ multiple: type === "multiselect",
488
+ handleOnChange,
489
+ options: values
490
+ }, extraProps));
491
+ case "textarea": return /* @__PURE__ */ React.createElement(Input.TextArea, _objectSpread2({
492
+ value,
493
+ title,
494
+ className,
495
+ disabled,
496
+ placeholder: placeHolderText,
497
+ onChange: (e) => handleOnChange(e.target.value)
498
+ }, extraProps));
499
+ case "switch": return /* @__PURE__ */ React.createElement(Switch, _objectSpread2({
500
+ checked: !!value,
501
+ title,
502
+ className,
503
+ disabled,
504
+ onChange: (v) => handleOnChange(v)
505
+ }, extraProps));
506
+ case "checkbox": return /* @__PURE__ */ React.createElement("span", {
507
+ title,
508
+ className
509
+ }, /* @__PURE__ */ React.createElement(Checkbox, _objectSpread2({
510
+ type: "checkbox",
511
+ disabled,
512
+ onChange: (e) => handleOnChange(e.target.checked),
513
+ checked: !!value
514
+ }, extraProps)));
515
+ case "radio": return /* @__PURE__ */ React.createElement("span", {
516
+ className,
517
+ title
518
+ }, values.map((v) => /* @__PURE__ */ React.createElement(Radio, _objectSpread2({
519
+ key: v.name,
520
+ value: v.name,
521
+ checked: value === v.name,
522
+ disabled,
523
+ onChange: (e) => handleOnChange(e.target.value)
524
+ }, extraProps), v.label)));
525
+ }
526
+ switch (inputTypeCoerced) {
527
+ case "date":
528
+ case "datetime-local": {
529
+ if (operator === "between" || operator === "notBetween") {
530
+ const dayjsArray = valueAsArray.slice(0, 2).map((v) => dayjs(v));
531
+ return /* @__PURE__ */ React.createElement(DatePicker.RangePicker, _objectSpread2({
532
+ value: dayjsArray.every((d) => d.isValid()) ? dayjsArray : void 0,
533
+ showTime: inputTypeCoerced === "datetime-local",
534
+ className,
535
+ disabled,
536
+ placeholder: [placeHolderText, placeHolderText],
537
+ onChange: (dates) => {
538
+ const format = `YYYY-MM-DD${inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : ""}`;
539
+ const dateArray = dates === null || dates === void 0 ? void 0 : dates.map((d) => (d === null || d === void 0 ? void 0 : d.isValid()) ? d.format(format) : void 0);
540
+ handleOnChange(dateArray ? listsAsArrays ? dateArray : joinWith(dateArray, ",") : dates);
541
+ }
542
+ }, extraProps));
543
+ }
544
+ const dateValue = dayjs(value);
545
+ return /* @__PURE__ */ React.createElement(DatePicker, _objectSpread2({
546
+ value: dateValue.isValid() ? dateValue : void 0,
547
+ showTime: inputTypeCoerced === "datetime-local",
548
+ className,
549
+ disabled,
550
+ placeholder: placeHolderText,
551
+ onChange: (_d, dateString) => handleOnChange(dateString)
552
+ }, extraProps));
553
+ }
554
+ case "time": {
555
+ const dateValue = dayjs(value, "HH:mm:ss");
556
+ return /* @__PURE__ */ React.createElement(DatePicker.TimePicker, _objectSpread2({
557
+ value: dateValue.isValid() ? dateValue : void 0,
558
+ className,
559
+ disabled,
560
+ placeholder: placeHolderText,
561
+ onChange: (d) => {
562
+ var _d$format2;
563
+ return handleOnChange((_d$format2 = d === null || d === void 0 ? void 0 : d.format("HH:mm:ss")) !== null && _d$format2 !== void 0 ? _d$format2 : "");
564
+ }
565
+ }, extraProps));
566
+ }
567
+ case "number": return /* @__PURE__ */ React.createElement(InputNumber, _objectSpread2({
568
+ type: inputTypeCoerced,
569
+ value,
570
+ title,
571
+ className,
572
+ disabled,
573
+ placeholder: placeHolderText,
574
+ onChange: handleOnChange
575
+ }, extraProps));
576
+ }
577
+ if (inputType === "bigint") return /* @__PURE__ */ React.createElement(Input, _objectSpread2({
578
+ "data-testid": testID,
579
+ type: inputTypeCoerced,
580
+ placeholder: placeHolderText,
581
+ value: `${value}`,
582
+ title,
583
+ className,
584
+ disabled,
585
+ onChange: (e) => bigIntValueHandler(e.target.value)
586
+ }, extraProps));
587
+ return /* @__PURE__ */ React.createElement(Input, _objectSpread2({
588
+ type: inputTypeCoerced,
589
+ value,
590
+ title,
591
+ className,
592
+ disabled,
593
+ placeholder: placeHolderText,
594
+ onChange: (e) => handleOnChange(e.target.value)
595
+ }, extraProps));
901
596
  };
902
597
 
903
- // src/AntDValueSelector.tsx
904
- import { jsx as jsx6 } from "react/jsx-runtime";
905
- import { Select } from "antd";
906
- import * as React from "react";
907
- import { joinWith as joinWith2, useValueSelector } from "react-querybuilder";
908
- function _createForOfIteratorHelper6(r, e) {
909
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
910
- if (!t) {
911
- if (Array.isArray(r) || (t = _unsupportedIterableToArray6(r)) || e && r && "number" == typeof r.length) {
912
- t && (r = t);
913
- var _n = 0, F = function F2() {
914
- };
915
- return { s: F, n: function n() {
916
- return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
917
- }, e: function e2(r2) {
918
- throw r2;
919
- }, f: F };
920
- }
921
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
922
- }
923
- var o, a = true, u = false;
924
- return { s: function s() {
925
- t = t.call(r);
926
- }, n: function n() {
927
- var r2 = t.next();
928
- return a = r2.done, r2;
929
- }, e: function e2(r2) {
930
- u = true, o = r2;
931
- }, f: function f() {
932
- try {
933
- a || null == t["return"] || t["return"]();
934
- } finally {
935
- if (u) throw o;
936
- }
937
- } };
938
- }
939
- function _unsupportedIterableToArray6(r, a) {
940
- if (r) {
941
- if ("string" == typeof r) return _arrayLikeToArray6(r, a);
942
- var t = {}.toString.call(r).slice(8, -1);
943
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray6(r, a) : void 0;
944
- }
945
- }
946
- function _arrayLikeToArray6(r, a) {
947
- (null == a || a > r.length) && (a = r.length);
948
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
949
- return n;
950
- }
951
- var __defProp6 = Object.defineProperty;
952
- var __defProps4 = Object.defineProperties;
953
- var __getOwnPropDescs4 = Object.getOwnPropertyDescriptors;
954
- var __getOwnPropSymbols5 = Object.getOwnPropertySymbols;
955
- var __hasOwnProp6 = Object.prototype.hasOwnProperty;
956
- var __propIsEnum5 = Object.prototype.propertyIsEnumerable;
957
- var __defNormalProp9 = function __defNormalProp10(obj, key, value) {
958
- return key in obj ? __defProp6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
959
- };
960
- var __spreadValues9 = function __spreadValues10(a, b) {
961
- for (var prop in b || (b = {})) if (__hasOwnProp6.call(b, prop)) __defNormalProp9(a, prop, b[prop]);
962
- if (__getOwnPropSymbols5) {
963
- var _iterator = _createForOfIteratorHelper6(__getOwnPropSymbols5(b)), _step;
964
- try {
965
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
966
- var prop = _step.value;
967
- if (__propIsEnum5.call(b, prop)) __defNormalProp9(a, prop, b[prop]);
968
- }
969
- } catch (err) {
970
- _iterator.e(err);
971
- } finally {
972
- _iterator.f();
973
- }
974
- }
975
- return a;
976
- };
977
- var __spreadProps7 = function __spreadProps8(a, b) {
978
- return __defProps4(a, __getOwnPropDescs4(b));
598
+ //#endregion
599
+ //#region src/AntDValueSelector.tsx
600
+ const _excluded = [
601
+ "className",
602
+ "handleOnChange",
603
+ "options",
604
+ "value",
605
+ "title",
606
+ "disabled",
607
+ "multiple",
608
+ "listsAsArrays",
609
+ "testID",
610
+ "rule",
611
+ "ruleGroup",
612
+ "rules",
613
+ "level",
614
+ "path",
615
+ "context",
616
+ "validation",
617
+ "operator",
618
+ "field",
619
+ "fieldData",
620
+ "schema"
621
+ ];
622
+ /**
623
+ * @group Components
624
+ */
625
+ const AntDValueSelector = (_ref) => {
626
+ let { className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, ruleGroup: _ruleGroup, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema } = _ref, extraProps = _objectWithoutProperties(_ref, _excluded);
627
+ const { onChange: onChangeNoArrays } = useValueSelector({
628
+ handleOnChange,
629
+ listsAsArrays: false,
630
+ multiple: false,
631
+ value
632
+ });
633
+ const { onChange: onChangeNormal, val } = useValueSelector({
634
+ handleOnChange,
635
+ listsAsArrays: multiple || listsAsArrays,
636
+ multiple,
637
+ value
638
+ });
639
+ const onChange = React.useCallback((v) => {
640
+ if (multiple && !listsAsArrays && Array.isArray(v)) onChangeNoArrays(joinWith(v));
641
+ else onChangeNormal(v);
642
+ }, [
643
+ listsAsArrays,
644
+ multiple,
645
+ onChangeNoArrays,
646
+ onChangeNormal
647
+ ]);
648
+ return /* @__PURE__ */ React.createElement(Select, _objectSpread2(_objectSpread2({}, multiple ? {
649
+ mode: "multiple",
650
+ allowClear: true
651
+ } : {}), {}, {
652
+ title,
653
+ className,
654
+ popupMatchSelectWidth: false,
655
+ disabled,
656
+ value: val,
657
+ onChange,
658
+ optionFilterProp: "label",
659
+ options
660
+ }, extraProps));
979
661
  };
980
- var __objRest9 = function __objRest10(source, exclude) {
981
- var target = {};
982
- for (var prop in source) if (__hasOwnProp6.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
983
- if (source != null && __getOwnPropSymbols5) {
984
- var _iterator2 = _createForOfIteratorHelper6(__getOwnPropSymbols5(source)), _step2;
985
- try {
986
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
987
- var prop = _step2.value;
988
- if (exclude.indexOf(prop) < 0 && __propIsEnum5.call(source, prop)) target[prop] = source[prop];
989
- }
990
- } catch (err) {
991
- _iterator2.e(err);
992
- } finally {
993
- _iterator2.f();
994
- }
995
- }
996
- return target;
662
+
663
+ //#endregion
664
+ //#region src/index.tsx
665
+ /**
666
+ * @group Props
667
+ */
668
+ const antdControlElements = {
669
+ actionElement: AntDActionElement,
670
+ dragHandle: AntDDragHandle,
671
+ notToggle: AntDNotToggle,
672
+ shiftActions: AntDShiftActions,
673
+ valueEditor: AntDValueEditor,
674
+ valueSelector: AntDValueSelector
997
675
  };
998
- var AntDValueSelector = function AntDValueSelector2(_a) {
999
- var _b = _a, className = _b.className, handleOnChange = _b.handleOnChange, options = _b.options, value = _b.value, title = _b.title, disabled = _b.disabled, multiple = _b.multiple, listsAsArrays = _b.listsAsArrays, _testID = _b.testID, _rule = _b.rule, _ruleGroup = _b.ruleGroup, _rules = _b.rules, _level = _b.level, _path = _b.path, _context = _b.context, _validation = _b.validation, _operator = _b.operator, _field = _b.field, _fieldData = _b.fieldData, _schema = _b.schema, extraProps = __objRest9(_b, [
1000
- "className",
1001
- "handleOnChange",
1002
- "options",
1003
- "value",
1004
- "title",
1005
- "disabled",
1006
- "multiple",
1007
- "listsAsArrays",
1008
- // Props that should not be in extraProps
1009
- "testID",
1010
- "rule",
1011
- "ruleGroup",
1012
- "rules",
1013
- "level",
1014
- "path",
1015
- "context",
1016
- "validation",
1017
- "operator",
1018
- "field",
1019
- "fieldData",
1020
- "schema"
1021
- ]);
1022
- var _useValueSelector = useValueSelector({ handleOnChange, listsAsArrays: false, multiple: false, value }), onChangeNoArrays = _useValueSelector.onChange;
1023
- var _useValueSelector2 = useValueSelector({
1024
- handleOnChange,
1025
- // This forces `val` to be an array if `multiple` is true,
1026
- // even if `listsAsArrays` is false
1027
- listsAsArrays: multiple || listsAsArrays,
1028
- multiple,
1029
- value
1030
- }), onChangeNormal = _useValueSelector2.onChange, val = _useValueSelector2.val;
1031
- var onChange = React.useCallback(function(v) {
1032
- if (multiple && !listsAsArrays && Array.isArray(v)) {
1033
- onChangeNoArrays(joinWith2(v));
1034
- } else {
1035
- onChangeNormal(v);
1036
- }
1037
- }, [listsAsArrays, multiple, onChangeNoArrays, onChangeNormal]);
1038
- return /* @__PURE__ */ jsx6(Select, __spreadValues9(__spreadProps7(__spreadValues9({}, multiple ? { mode: "multiple", allowClear: true } : {}), { title, className, popupMatchSelectWidth: false, disabled, value: val, onChange, optionFilterProp: "label", options }), extraProps));
676
+ /**
677
+ * @group Props
678
+ */
679
+ const antdTranslations = {
680
+ removeGroup: { label: /* @__PURE__ */ React.createElement(CloseOutlined, null) },
681
+ removeRule: { label: /* @__PURE__ */ React.createElement(CloseOutlined, null) },
682
+ cloneRule: { label: /* @__PURE__ */ React.createElement(CopyOutlined, null) },
683
+ cloneRuleGroup: { label: /* @__PURE__ */ React.createElement(CopyOutlined, null) },
684
+ lockGroup: { label: /* @__PURE__ */ React.createElement(UnlockOutlined, null) },
685
+ lockRule: { label: /* @__PURE__ */ React.createElement(UnlockOutlined, null) },
686
+ lockGroupDisabled: { label: /* @__PURE__ */ React.createElement(LockOutlined, null) },
687
+ lockRuleDisabled: { label: /* @__PURE__ */ React.createElement(LockOutlined, null) },
688
+ shiftActionUp: { label: /* @__PURE__ */ React.createElement(UpOutlined, null) },
689
+ shiftActionDown: { label: /* @__PURE__ */ React.createElement(DownOutlined, null) }
1039
690
  };
691
+ /**
692
+ * @group Components
693
+ */
694
+ const QueryBuilderAntD = getCompatContextProvider({
695
+ controlElements: antdControlElements,
696
+ translations: antdTranslations
697
+ });
1040
698
 
1041
- // src/index.tsx
1042
- var antdControlElements = { actionElement: AntDActionElement, dragHandle: AntDDragHandle, notToggle: AntDNotToggle, shiftActions: AntDShiftActions, valueEditor: AntDValueEditor, valueSelector: AntDValueSelector };
1043
- var antdTranslations = { removeGroup: { label: /* @__PURE__ */ jsx7(CloseOutlined, {}) }, removeRule: { label: /* @__PURE__ */ jsx7(CloseOutlined, {}) }, cloneRule: { label: /* @__PURE__ */ jsx7(CopyOutlined, {}) }, cloneRuleGroup: { label: /* @__PURE__ */ jsx7(CopyOutlined, {}) }, lockGroup: { label: /* @__PURE__ */ jsx7(UnlockOutlined, {}) }, lockRule: { label: /* @__PURE__ */ jsx7(UnlockOutlined, {}) }, lockGroupDisabled: { label: /* @__PURE__ */ jsx7(LockOutlined, {}) }, lockRuleDisabled: { label: /* @__PURE__ */ jsx7(LockOutlined, {}) }, shiftActionUp: { label: /* @__PURE__ */ jsx7(UpOutlined, {}) }, shiftActionDown: { label: /* @__PURE__ */ jsx7(DownOutlined, {}) } };
1044
- var QueryBuilderAntD = getCompatContextProvider({ controlElements: antdControlElements, translations: antdTranslations });
1045
- export {
1046
- AntDActionElement,
1047
- AntDDragHandle,
1048
- AntDNotToggle,
1049
- AntDShiftActions,
1050
- AntDValueEditor,
1051
- AntDValueSelector,
1052
- QueryBuilderAntD,
1053
- antdControlElements,
1054
- antdTranslations
1055
- };
699
+ //#endregion
700
+ export { AntDActionElement, AntDDragHandle, AntDNotToggle, AntDShiftActions, AntDValueEditor, AntDValueSelector, QueryBuilderAntD, antdControlElements, antdTranslations };
1056
701
  //# sourceMappingURL=react-querybuilder_antd.legacy-esm.js.map