@react-querybuilder/antd 8.8.2 → 8.8.4

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