@react-querybuilder/antd 7.7.1 → 8.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/react-querybuilder_antd.cjs.development.js +915 -451
- package/dist/cjs/react-querybuilder_antd.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.js +2 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.js.map +1 -1
- package/dist/react-querybuilder_antd.legacy-esm.js +721 -501
- package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_antd.mjs +917 -460
- package/dist/react-querybuilder_antd.mjs.map +1 -1
- package/dist/react-querybuilder_antd.production.mjs +2 -1
- package/dist/react-querybuilder_antd.production.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -87,145 +87,266 @@ var require_warning = __commonJS({
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
// src/index.tsx
|
|
90
|
-
import {
|
|
91
|
-
|
|
92
|
-
CopyOutlined,
|
|
93
|
-
DownOutlined,
|
|
94
|
-
LockOutlined,
|
|
95
|
-
UnlockOutlined,
|
|
96
|
-
UpOutlined
|
|
97
|
-
} from "@ant-design/icons";
|
|
98
|
-
import * as React8 from "react";
|
|
90
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
91
|
+
import { CloseOutlined, CopyOutlined, DownOutlined, LockOutlined, UnlockOutlined, UpOutlined } from "@ant-design/icons";
|
|
99
92
|
import { getCompatContextProvider } from "react-querybuilder";
|
|
100
93
|
|
|
101
94
|
// src/AntDActionElement.tsx
|
|
95
|
+
import { jsx } from "react/jsx-runtime";
|
|
102
96
|
import { Button } from "antd";
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
97
|
+
function _typeof(o) {
|
|
98
|
+
"@babel/helpers - typeof";
|
|
99
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
100
|
+
return typeof o2;
|
|
101
|
+
} : function(o2) {
|
|
102
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
103
|
+
}, _typeof(o);
|
|
104
|
+
}
|
|
105
|
+
var _excluded = ["className", "handleOnClick", "label", "title", "disabled", "disabledTranslation", "testID", "rules", "level", "path", "context", "validation", "ruleOrGroup", "schema"];
|
|
106
|
+
function ownKeys(e, r) {
|
|
107
|
+
var t = Object.keys(e);
|
|
108
|
+
if (Object.getOwnPropertySymbols) {
|
|
109
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
110
|
+
r && (o = o.filter(function(r2) {
|
|
111
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
112
|
+
})), t.push.apply(t, o);
|
|
113
|
+
}
|
|
114
|
+
return t;
|
|
115
|
+
}
|
|
116
|
+
function _objectSpread(e) {
|
|
117
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
118
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
119
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
120
|
+
_defineProperty(e, r2, t[r2]);
|
|
121
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
122
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return e;
|
|
126
|
+
}
|
|
127
|
+
function _defineProperty(e, r, t) {
|
|
128
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
129
|
+
}
|
|
130
|
+
function _toPropertyKey(t) {
|
|
131
|
+
var i = _toPrimitive(t, "string");
|
|
132
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
133
|
+
}
|
|
134
|
+
function _toPrimitive(t, r) {
|
|
135
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
136
|
+
var e = t[Symbol.toPrimitive];
|
|
137
|
+
if (void 0 !== e) {
|
|
138
|
+
var i = e.call(t, r || "default");
|
|
139
|
+
if ("object" != _typeof(i)) return i;
|
|
140
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
141
|
+
}
|
|
142
|
+
return ("string" === r ? String : Number)(t);
|
|
143
|
+
}
|
|
144
|
+
function _objectWithoutProperties(e, t) {
|
|
145
|
+
if (null == e) return {};
|
|
146
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
147
|
+
if (Object.getOwnPropertySymbols) {
|
|
148
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
149
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
150
|
+
}
|
|
151
|
+
return i;
|
|
152
|
+
}
|
|
153
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
154
|
+
if (null == r) return {};
|
|
155
|
+
var t = {};
|
|
156
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
157
|
+
if (e.includes(n)) continue;
|
|
158
|
+
t[n] = r[n];
|
|
159
|
+
}
|
|
160
|
+
return t;
|
|
161
|
+
}
|
|
162
|
+
var AntDActionElement = function AntDActionElement2(_ref) {
|
|
163
|
+
var className = _ref.className, handleOnClick = _ref.handleOnClick, label = _ref.label, title = _ref.title, disabled = _ref.disabled, disabledTranslation = _ref.disabledTranslation, _testID = _ref.testID, _rules = _ref.rules, _level = _ref.level, _path = _ref.path, _context = _ref.context, _validation = _ref.validation, _ruleOrGroup = _ref.ruleOrGroup, _schema = _ref.schema, extraProps = _objectWithoutProperties(_ref, _excluded);
|
|
164
|
+
return /* @__PURE__ */ jsx(Button, _objectSpread(_objectSpread({ type: "primary", className, title: disabledTranslation && disabled ? disabledTranslation.title : title, onClick: function onClick(e) {
|
|
165
|
+
return handleOnClick(e);
|
|
166
|
+
}, disabled: disabled && !disabledTranslation }, extraProps), {}, { children: disabledTranslation && disabled ? disabledTranslation.label : label }));
|
|
167
|
+
};
|
|
133
168
|
|
|
134
169
|
// src/AntDDragHandle.tsx
|
|
170
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
135
171
|
import { HolderOutlined } from "@ant-design/icons";
|
|
136
|
-
import * as React2 from "react";
|
|
137
172
|
import { forwardRef } from "react";
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
173
|
+
function _typeof2(o) {
|
|
174
|
+
"@babel/helpers - typeof";
|
|
175
|
+
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
176
|
+
return typeof o2;
|
|
177
|
+
} : function(o2) {
|
|
178
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
179
|
+
}, _typeof2(o);
|
|
180
|
+
}
|
|
181
|
+
var _excluded2 = ["className", "title", "testID", "level", "path", "label", "disabled", "context", "validation", "schema", "ruleOrGroup"];
|
|
182
|
+
function ownKeys2(e, r) {
|
|
183
|
+
var t = Object.keys(e);
|
|
184
|
+
if (Object.getOwnPropertySymbols) {
|
|
185
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
186
|
+
r && (o = o.filter(function(r2) {
|
|
187
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
188
|
+
})), t.push.apply(t, o);
|
|
189
|
+
}
|
|
190
|
+
return t;
|
|
191
|
+
}
|
|
192
|
+
function _objectSpread2(e) {
|
|
193
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
194
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
195
|
+
r % 2 ? ownKeys2(Object(t), true).forEach(function(r2) {
|
|
196
|
+
_defineProperty2(e, r2, t[r2]);
|
|
197
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys2(Object(t)).forEach(function(r2) {
|
|
198
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
return e;
|
|
202
|
+
}
|
|
203
|
+
function _defineProperty2(e, r, t) {
|
|
204
|
+
return (r = _toPropertyKey2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
205
|
+
}
|
|
206
|
+
function _toPropertyKey2(t) {
|
|
207
|
+
var i = _toPrimitive2(t, "string");
|
|
208
|
+
return "symbol" == _typeof2(i) ? i : i + "";
|
|
209
|
+
}
|
|
210
|
+
function _toPrimitive2(t, r) {
|
|
211
|
+
if ("object" != _typeof2(t) || !t) return t;
|
|
212
|
+
var e = t[Symbol.toPrimitive];
|
|
213
|
+
if (void 0 !== e) {
|
|
214
|
+
var i = e.call(t, r || "default");
|
|
215
|
+
if ("object" != _typeof2(i)) return i;
|
|
216
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
217
|
+
}
|
|
218
|
+
return ("string" === r ? String : Number)(t);
|
|
219
|
+
}
|
|
220
|
+
function _objectWithoutProperties2(e, t) {
|
|
221
|
+
if (null == e) return {};
|
|
222
|
+
var o, r, i = _objectWithoutPropertiesLoose2(e, t);
|
|
223
|
+
if (Object.getOwnPropertySymbols) {
|
|
224
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
225
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
226
|
+
}
|
|
227
|
+
return i;
|
|
228
|
+
}
|
|
229
|
+
function _objectWithoutPropertiesLoose2(r, e) {
|
|
230
|
+
if (null == r) return {};
|
|
231
|
+
var t = {};
|
|
232
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
233
|
+
if (e.includes(n)) continue;
|
|
234
|
+
t[n] = r[n];
|
|
235
|
+
}
|
|
236
|
+
return t;
|
|
237
|
+
}
|
|
238
|
+
var AntDDragHandle = /* @__PURE__ */ forwardRef(function(_ref, dragRef) {
|
|
239
|
+
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);
|
|
240
|
+
return /* @__PURE__ */ jsx2(HolderOutlined, _objectSpread2({ ref: dragRef, className, title }, extraProps));
|
|
241
|
+
});
|
|
155
242
|
|
|
156
243
|
// src/AntDNotToggle.tsx
|
|
244
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
157
245
|
import { Switch } from "antd";
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
246
|
+
function _typeof3(o) {
|
|
247
|
+
"@babel/helpers - typeof";
|
|
248
|
+
return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
249
|
+
return typeof o2;
|
|
250
|
+
} : function(o2) {
|
|
251
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
252
|
+
}, _typeof3(o);
|
|
253
|
+
}
|
|
254
|
+
var _excluded3 = ["className", "handleOnChange", "label", "checked", "title", "disabled", "path", "context", "validation", "testID", "schema", "ruleGroup"];
|
|
255
|
+
function ownKeys3(e, r) {
|
|
256
|
+
var t = Object.keys(e);
|
|
257
|
+
if (Object.getOwnPropertySymbols) {
|
|
258
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
259
|
+
r && (o = o.filter(function(r2) {
|
|
260
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
261
|
+
})), t.push.apply(t, o);
|
|
262
|
+
}
|
|
263
|
+
return t;
|
|
264
|
+
}
|
|
265
|
+
function _objectSpread3(e) {
|
|
266
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
267
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
268
|
+
r % 2 ? ownKeys3(Object(t), true).forEach(function(r2) {
|
|
269
|
+
_defineProperty3(e, r2, t[r2]);
|
|
270
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys3(Object(t)).forEach(function(r2) {
|
|
271
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
return e;
|
|
275
|
+
}
|
|
276
|
+
function _defineProperty3(e, r, t) {
|
|
277
|
+
return (r = _toPropertyKey3(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
278
|
+
}
|
|
279
|
+
function _toPropertyKey3(t) {
|
|
280
|
+
var i = _toPrimitive3(t, "string");
|
|
281
|
+
return "symbol" == _typeof3(i) ? i : i + "";
|
|
282
|
+
}
|
|
283
|
+
function _toPrimitive3(t, r) {
|
|
284
|
+
if ("object" != _typeof3(t) || !t) return t;
|
|
285
|
+
var e = t[Symbol.toPrimitive];
|
|
286
|
+
if (void 0 !== e) {
|
|
287
|
+
var i = e.call(t, r || "default");
|
|
288
|
+
if ("object" != _typeof3(i)) return i;
|
|
289
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
290
|
+
}
|
|
291
|
+
return ("string" === r ? String : Number)(t);
|
|
292
|
+
}
|
|
293
|
+
function _objectWithoutProperties3(e, t) {
|
|
294
|
+
if (null == e) return {};
|
|
295
|
+
var o, r, i = _objectWithoutPropertiesLoose3(e, t);
|
|
296
|
+
if (Object.getOwnPropertySymbols) {
|
|
297
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
298
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
299
|
+
}
|
|
300
|
+
return i;
|
|
301
|
+
}
|
|
302
|
+
function _objectWithoutPropertiesLoose3(r, e) {
|
|
303
|
+
if (null == r) return {};
|
|
304
|
+
var t = {};
|
|
305
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
306
|
+
if (e.includes(n)) continue;
|
|
307
|
+
t[n] = r[n];
|
|
308
|
+
}
|
|
309
|
+
return t;
|
|
310
|
+
}
|
|
311
|
+
var AntDNotToggle = function AntDNotToggle2(_ref) {
|
|
312
|
+
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);
|
|
313
|
+
return /* @__PURE__ */ jsx3(Switch, _objectSpread3({ title, className, onChange: function onChange(v) {
|
|
314
|
+
return handleOnChange(v);
|
|
315
|
+
}, checked: !!checked, disabled, checkedChildren: label, unCheckedChildren: "=" }, extraProps));
|
|
316
|
+
};
|
|
187
317
|
|
|
188
318
|
// src/AntDShiftActions.tsx
|
|
319
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
189
320
|
import { Button as Button2 } from "antd";
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
shiftUp,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
Button2,
|
|
213
|
-
{
|
|
214
|
-
type: "primary",
|
|
215
|
-
size: "small",
|
|
216
|
-
title: titles?.shiftDown,
|
|
217
|
-
onClick: shiftDown,
|
|
218
|
-
disabled: disabled || shiftDownDisabled
|
|
219
|
-
},
|
|
220
|
-
labels?.shiftDown
|
|
221
|
-
));
|
|
321
|
+
var AntDShiftActions = function AntDShiftActions2(_ref) {
|
|
322
|
+
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;
|
|
323
|
+
return /* @__PURE__ */ jsxs("div", { "data-testid": testID, className, children: [/* @__PURE__ */ jsx4(Button2, { 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__ */ jsx4(Button2, { 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 })] });
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
// ../../utils/react-compiler/react-compiler-runtime.ts
|
|
327
|
+
import * as React from "react";
|
|
328
|
+
var $empty = Symbol["for"]("react.memo_cache_sentinel");
|
|
329
|
+
function c(size) {
|
|
330
|
+
return React.useMemo(
|
|
331
|
+
function() {
|
|
332
|
+
var $ = Array.from({ length: size });
|
|
333
|
+
for (var ii = 0; ii < size; ii++) {
|
|
334
|
+
$[ii] = $empty;
|
|
335
|
+
}
|
|
336
|
+
$[$empty] = true;
|
|
337
|
+
return $;
|
|
338
|
+
},
|
|
339
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
340
|
+
[]
|
|
341
|
+
);
|
|
342
|
+
}
|
|
222
343
|
|
|
223
344
|
// src/AntDValueEditor.tsx
|
|
345
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
224
346
|
import { Checkbox, Input, InputNumber, Radio, Switch as Switch2 } from "antd";
|
|
225
347
|
import generatePicker from "antd/es/date-picker/generatePicker/index.js";
|
|
226
348
|
import dayjs2 from "dayjs";
|
|
227
|
-
import
|
|
228
|
-
import { getFirstOption, joinWith, useValueEditor } from "react-querybuilder";
|
|
349
|
+
import { joinWith, useValueEditor, ValueEditor } from "react-querybuilder";
|
|
229
350
|
|
|
230
351
|
// src/dayjs.ts
|
|
231
352
|
var import_warning = __toESM(require_warning());
|
|
@@ -236,17 +357,60 @@ import localeData from "dayjs/plugin/localeData.js";
|
|
|
236
357
|
import weekOfYear from "dayjs/plugin/weekOfYear.js";
|
|
237
358
|
import weekYear from "dayjs/plugin/weekYear.js";
|
|
238
359
|
import weekday from "dayjs/plugin/weekday.js";
|
|
360
|
+
function _createForOfIteratorHelper(r, e) {
|
|
361
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
362
|
+
if (!t) {
|
|
363
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
364
|
+
t && (r = t);
|
|
365
|
+
var _n = 0, F = function F2() {
|
|
366
|
+
};
|
|
367
|
+
return { s: F, n: function n() {
|
|
368
|
+
return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
|
|
369
|
+
}, e: function e2(r2) {
|
|
370
|
+
throw r2;
|
|
371
|
+
}, f: F };
|
|
372
|
+
}
|
|
373
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
374
|
+
}
|
|
375
|
+
var o, a = true, u = false;
|
|
376
|
+
return { s: function s() {
|
|
377
|
+
t = t.call(r);
|
|
378
|
+
}, n: function n() {
|
|
379
|
+
var r2 = t.next();
|
|
380
|
+
return a = r2.done, r2;
|
|
381
|
+
}, e: function e2(r2) {
|
|
382
|
+
u = true, o = r2;
|
|
383
|
+
}, f: function f() {
|
|
384
|
+
try {
|
|
385
|
+
a || null == t["return"] || t["return"]();
|
|
386
|
+
} finally {
|
|
387
|
+
if (u) throw o;
|
|
388
|
+
}
|
|
389
|
+
} };
|
|
390
|
+
}
|
|
391
|
+
function _unsupportedIterableToArray(r, a) {
|
|
392
|
+
if (r) {
|
|
393
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
394
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
395
|
+
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;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function _arrayLikeToArray(r, a) {
|
|
399
|
+
(null == a || a > r.length) && (a = r.length);
|
|
400
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
401
|
+
return n;
|
|
402
|
+
}
|
|
239
403
|
dayjs.extend(customParseFormat);
|
|
240
404
|
dayjs.extend(advancedFormat);
|
|
241
405
|
dayjs.extend(weekday);
|
|
242
406
|
dayjs.extend(localeData);
|
|
243
407
|
dayjs.extend(weekOfYear);
|
|
244
408
|
dayjs.extend(weekYear);
|
|
245
|
-
dayjs.extend((o,
|
|
246
|
-
|
|
247
|
-
|
|
409
|
+
dayjs.extend(function(o, c2) {
|
|
410
|
+
var proto = c2.prototype;
|
|
411
|
+
var oldFormat = proto.format;
|
|
248
412
|
proto.format = function f(formatStr) {
|
|
249
|
-
|
|
413
|
+
var str = (formatStr || "").replace("Wo", "wo");
|
|
250
414
|
return oldFormat.bind(this)(str);
|
|
251
415
|
};
|
|
252
416
|
});
|
|
@@ -318,60 +482,112 @@ var localeMap = {
|
|
|
318
482
|
zh_HK: "zh-hk",
|
|
319
483
|
zh_TW: "zh-tw"
|
|
320
484
|
};
|
|
321
|
-
var parseLocale = (locale)
|
|
322
|
-
|
|
485
|
+
var parseLocale = function parseLocale2(locale) {
|
|
486
|
+
var mapLocale = localeMap[locale];
|
|
323
487
|
return mapLocale || locale.split("_")[0];
|
|
324
488
|
};
|
|
325
|
-
var parseNoMatchNotice = ()
|
|
489
|
+
var parseNoMatchNotice = function parseNoMatchNotice2() {
|
|
326
490
|
(0, import_warning.noteOnce)(false, "Not match any format. Please help to fire a issue about this.");
|
|
327
491
|
};
|
|
328
492
|
var generateConfig = {
|
|
329
493
|
// get
|
|
330
|
-
getNow: ()
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
494
|
+
getNow: function getNow() {
|
|
495
|
+
return dayjs();
|
|
496
|
+
},
|
|
497
|
+
getFixedDate: function getFixedDate(string) {
|
|
498
|
+
return dayjs(string, ["YYYY-M-DD", "YYYY-MM-DD"]);
|
|
499
|
+
},
|
|
500
|
+
getEndDate: function getEndDate(date) {
|
|
501
|
+
return date.endOf("month");
|
|
502
|
+
},
|
|
503
|
+
getWeekDay: function getWeekDay(date) {
|
|
504
|
+
var clone = date.locale("en");
|
|
335
505
|
return clone.weekday() + clone.localeData().firstDayOfWeek();
|
|
336
506
|
},
|
|
337
|
-
getYear: (date)
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
507
|
+
getYear: function getYear(date) {
|
|
508
|
+
return date.year();
|
|
509
|
+
},
|
|
510
|
+
getMonth: function getMonth(date) {
|
|
511
|
+
return date.month();
|
|
512
|
+
},
|
|
513
|
+
getDate: function getDate(date) {
|
|
514
|
+
return date.date();
|
|
515
|
+
},
|
|
516
|
+
getHour: function getHour(date) {
|
|
517
|
+
return date.hour();
|
|
518
|
+
},
|
|
519
|
+
getMinute: function getMinute(date) {
|
|
520
|
+
return date.minute();
|
|
521
|
+
},
|
|
522
|
+
getSecond: function getSecond(date) {
|
|
523
|
+
return date.second();
|
|
524
|
+
},
|
|
525
|
+
getMillisecond: function getMillisecond(date) {
|
|
526
|
+
return date.millisecond();
|
|
527
|
+
},
|
|
344
528
|
// set
|
|
345
|
-
addYear: (date, diff)
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
529
|
+
addYear: function addYear(date, diff) {
|
|
530
|
+
return date.add(diff, "year");
|
|
531
|
+
},
|
|
532
|
+
addMonth: function addMonth(date, diff) {
|
|
533
|
+
return date.add(diff, "month");
|
|
534
|
+
},
|
|
535
|
+
addDate: function addDate(date, diff) {
|
|
536
|
+
return date.add(diff, "day");
|
|
537
|
+
},
|
|
538
|
+
setYear: function setYear(date, year) {
|
|
539
|
+
return date.year(year);
|
|
540
|
+
},
|
|
541
|
+
setMonth: function setMonth(date, month) {
|
|
542
|
+
return date.month(month);
|
|
543
|
+
},
|
|
544
|
+
setDate: function setDate(date, num) {
|
|
545
|
+
return date.date(num);
|
|
546
|
+
},
|
|
547
|
+
setHour: function setHour(date, hour) {
|
|
548
|
+
return date.hour(hour);
|
|
549
|
+
},
|
|
550
|
+
setMinute: function setMinute(date, minute) {
|
|
551
|
+
return date.minute(minute);
|
|
552
|
+
},
|
|
553
|
+
setSecond: function setSecond(date, second) {
|
|
554
|
+
return date.second(second);
|
|
555
|
+
},
|
|
556
|
+
setMillisecond: function setMillisecond(date, milliseconds) {
|
|
557
|
+
return date.millisecond(milliseconds);
|
|
558
|
+
},
|
|
355
559
|
// Compare
|
|
356
|
-
isAfter: (date1, date2)
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
560
|
+
isAfter: function isAfter(date1, date2) {
|
|
561
|
+
return date1.isAfter(date2);
|
|
562
|
+
},
|
|
563
|
+
isValidate: function isValidate(date) {
|
|
564
|
+
return date.isValid();
|
|
565
|
+
},
|
|
566
|
+
locale: { getWeekFirstDay: function getWeekFirstDay(locale) {
|
|
567
|
+
return dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek();
|
|
568
|
+
}, getWeekFirstDate: function getWeekFirstDate(locale, date) {
|
|
569
|
+
return date.locale(parseLocale(locale)).weekday(0);
|
|
570
|
+
}, getWeek: function getWeek(locale, date) {
|
|
571
|
+
return date.locale(parseLocale(locale)).week();
|
|
572
|
+
}, getShortWeekDays: function getShortWeekDays(locale) {
|
|
573
|
+
return dayjs().locale(parseLocale(locale)).localeData().weekdaysMin();
|
|
574
|
+
}, getShortMonths: function getShortMonths(locale) {
|
|
575
|
+
return dayjs().locale(parseLocale(locale)).localeData().monthsShort();
|
|
576
|
+
}, format: function format(locale, date, _format) {
|
|
577
|
+
return date.locale(parseLocale(locale)).format(_format);
|
|
578
|
+
}, parse: function parse(locale, text, formats) {
|
|
579
|
+
var localeStr = parseLocale(locale);
|
|
580
|
+
var _iterator = _createForOfIteratorHelper(formats), _step;
|
|
581
|
+
try {
|
|
582
|
+
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
583
|
+
var format2 = _step.value;
|
|
584
|
+
var formatText = text;
|
|
585
|
+
if (format2.includes("wo") || format2.includes("Wo")) {
|
|
586
|
+
var year = formatText.split("-")[0];
|
|
587
|
+
var weekStr = formatText.split("-")[1];
|
|
588
|
+
var firstWeek = dayjs(year, "YYYY").startOf("year").locale(localeStr);
|
|
589
|
+
for (var j = 0; j <= 52; j += 1) {
|
|
590
|
+
var nextWeek = firstWeek.add(j, "week");
|
|
375
591
|
if (nextWeek.format("Wo") === weekStr) {
|
|
376
592
|
return nextWeek;
|
|
377
593
|
}
|
|
@@ -379,345 +595,586 @@ var generateConfig = {
|
|
|
379
595
|
parseNoMatchNotice();
|
|
380
596
|
return null;
|
|
381
597
|
}
|
|
382
|
-
|
|
598
|
+
var date = dayjs(formatText, format2, true).locale(localeStr);
|
|
383
599
|
if (date.isValid()) {
|
|
384
600
|
return date;
|
|
385
601
|
}
|
|
386
602
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
603
|
+
} catch (err) {
|
|
604
|
+
_iterator.e(err);
|
|
605
|
+
} finally {
|
|
606
|
+
_iterator.f();
|
|
391
607
|
}
|
|
392
|
-
|
|
608
|
+
if (text) {
|
|
609
|
+
parseNoMatchNotice();
|
|
610
|
+
}
|
|
611
|
+
return null;
|
|
612
|
+
} }
|
|
393
613
|
};
|
|
394
614
|
var dayjs_default = generateConfig;
|
|
395
615
|
|
|
396
616
|
// src/AntDValueEditor.tsx
|
|
617
|
+
function _typeof4(o) {
|
|
618
|
+
"@babel/helpers - typeof";
|
|
619
|
+
return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
620
|
+
return typeof o2;
|
|
621
|
+
} : function(o2) {
|
|
622
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
623
|
+
}, _typeof4(o);
|
|
624
|
+
}
|
|
625
|
+
function ownKeys4(e, r) {
|
|
626
|
+
var t = Object.keys(e);
|
|
627
|
+
if (Object.getOwnPropertySymbols) {
|
|
628
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
629
|
+
r && (o = o.filter(function(r2) {
|
|
630
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
631
|
+
})), t.push.apply(t, o);
|
|
632
|
+
}
|
|
633
|
+
return t;
|
|
634
|
+
}
|
|
635
|
+
function _objectSpread4(e) {
|
|
636
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
637
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
638
|
+
r % 2 ? ownKeys4(Object(t), true).forEach(function(r2) {
|
|
639
|
+
_defineProperty4(e, r2, t[r2]);
|
|
640
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys4(Object(t)).forEach(function(r2) {
|
|
641
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
return e;
|
|
645
|
+
}
|
|
646
|
+
function _defineProperty4(e, r, t) {
|
|
647
|
+
return (r = _toPropertyKey4(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
648
|
+
}
|
|
649
|
+
function _toPropertyKey4(t) {
|
|
650
|
+
var i = _toPrimitive4(t, "string");
|
|
651
|
+
return "symbol" == _typeof4(i) ? i : i + "";
|
|
652
|
+
}
|
|
653
|
+
function _toPrimitive4(t, r) {
|
|
654
|
+
if ("object" != _typeof4(t) || !t) return t;
|
|
655
|
+
var e = t[Symbol.toPrimitive];
|
|
656
|
+
if (void 0 !== e) {
|
|
657
|
+
var i = e.call(t, r || "default");
|
|
658
|
+
if ("object" != _typeof4(i)) return i;
|
|
659
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
660
|
+
}
|
|
661
|
+
return ("string" === r ? String : Number)(t);
|
|
662
|
+
}
|
|
397
663
|
var DatePicker = generatePicker(dayjs_default);
|
|
398
|
-
var AntDValueEditor = (allProps)
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
disabled,
|
|
413
|
-
testID,
|
|
414
|
-
selectorComponent: SelectorComponent = allProps.schema.controls.valueSelector,
|
|
415
|
-
extraProps,
|
|
416
|
-
...props
|
|
417
|
-
} = allProps;
|
|
418
|
-
const { valueAsArray, multiValueHandler, valueListItemClassName } = useValueEditor(allProps);
|
|
664
|
+
var AntDValueEditor = function AntDValueEditor2(allProps) {
|
|
665
|
+
var _fieldData$placeholde;
|
|
666
|
+
var $ = c(111);
|
|
667
|
+
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, t0 = allProps.values, listsAsArrays = allProps.listsAsArrays, separator = allProps.separator, disabled = allProps.disabled, testID = allProps.testID, extraProps = allProps.extraProps;
|
|
668
|
+
var t1;
|
|
669
|
+
if ($[0] !== t0) {
|
|
670
|
+
t1 = t0 === void 0 ? [] : t0;
|
|
671
|
+
$[0] = t0;
|
|
672
|
+
$[1] = t1;
|
|
673
|
+
} else {
|
|
674
|
+
t1 = $[1];
|
|
675
|
+
}
|
|
676
|
+
var values = t1;
|
|
677
|
+
var _useValueEditor = useValueEditor(allProps), valueAsArray = _useValueEditor.valueAsArray, multiValueHandler = _useValueEditor.multiValueHandler, valueListItemClassName = _useValueEditor.valueListItemClassName;
|
|
419
678
|
if (operator === "null" || operator === "notNull") {
|
|
420
679
|
return null;
|
|
421
680
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") &&
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
if (
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
} else if (inputTypeCoerced === "number") {
|
|
442
|
-
return /* @__PURE__ */ React5.createElement(
|
|
443
|
-
InputNumber,
|
|
444
|
-
{
|
|
445
|
-
key,
|
|
446
|
-
type: inputTypeCoerced,
|
|
447
|
-
value: valueAsArray[i] ?? "",
|
|
448
|
-
className: valueListItemClassName,
|
|
449
|
-
disabled,
|
|
450
|
-
placeholder: placeHolderText,
|
|
451
|
-
onChange: (v) => multiValueHandler(v, i),
|
|
452
|
-
...extraProps
|
|
681
|
+
var placeHolderText = (_fieldData$placeholde = fieldData === null || fieldData === void 0 ? void 0 : fieldData.placeholder) !== null && _fieldData$placeholde !== void 0 ? _fieldData$placeholde : "";
|
|
682
|
+
var inputTypeCoerced = ["in", "notIn"].includes(operator) ? "text" : inputType || "text";
|
|
683
|
+
if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") && inputTypeCoerced !== "date" && inputTypeCoerced !== "datetime-local") {
|
|
684
|
+
if (type === "text") {
|
|
685
|
+
var _t;
|
|
686
|
+
if ($[2] !== inputTypeCoerced || $[3] !== valueAsArray || $[4] !== valueListItemClassName || $[5] !== disabled || $[6] !== placeHolderText || $[7] !== multiValueHandler || $[8] !== extraProps || $[9] !== separator || $[10] !== testID || $[11] !== className || $[12] !== title) {
|
|
687
|
+
var editors = ["from", "to"].map(function(key, i) {
|
|
688
|
+
var _valueAsArray$i2;
|
|
689
|
+
if (inputTypeCoerced === "time") {
|
|
690
|
+
return jsx5(DatePicker.TimePicker, _objectSpread4({ value: valueAsArray[i] ? dayjs2(valueAsArray[i], "HH:mm:ss") : null, className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(d) {
|
|
691
|
+
var _d$format;
|
|
692
|
+
return multiValueHandler((_d$format = d === null || d === void 0 ? void 0 : d.format("HH:mm:ss")) !== null && _d$format !== void 0 ? _d$format : "", i);
|
|
693
|
+
} }, extraProps), key);
|
|
694
|
+
} else {
|
|
695
|
+
if (inputTypeCoerced === "number") {
|
|
696
|
+
var _valueAsArray$i;
|
|
697
|
+
return jsx5(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) {
|
|
698
|
+
return multiValueHandler(v, i);
|
|
699
|
+
} }, extraProps), key);
|
|
453
700
|
}
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
return /* @__PURE__ */ React5.createElement(
|
|
457
|
-
Input,
|
|
458
|
-
{
|
|
459
|
-
key,
|
|
460
|
-
type: inputTypeCoerced,
|
|
461
|
-
value: valueAsArray[i] ?? "",
|
|
462
|
-
className: valueListItemClassName,
|
|
463
|
-
disabled,
|
|
464
|
-
placeholder: placeHolderText,
|
|
465
|
-
onChange: (e) => multiValueHandler(e.target.value, i),
|
|
466
|
-
...extraProps
|
|
467
701
|
}
|
|
468
|
-
|
|
702
|
+
return jsx5(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) {
|
|
703
|
+
return multiValueHandler(e.target.value, i);
|
|
704
|
+
} }, extraProps), key);
|
|
705
|
+
});
|
|
706
|
+
_t = jsxs2("span", { "data-testid": testID, className, title, children: [editors[0], separator, editors[1]] });
|
|
707
|
+
$[2] = inputTypeCoerced;
|
|
708
|
+
$[3] = valueAsArray;
|
|
709
|
+
$[4] = valueListItemClassName;
|
|
710
|
+
$[5] = disabled;
|
|
711
|
+
$[6] = placeHolderText;
|
|
712
|
+
$[7] = multiValueHandler;
|
|
713
|
+
$[8] = extraProps;
|
|
714
|
+
$[9] = separator;
|
|
715
|
+
$[10] = testID;
|
|
716
|
+
$[11] = className;
|
|
717
|
+
$[12] = title;
|
|
718
|
+
$[13] = _t;
|
|
719
|
+
} else {
|
|
720
|
+
_t = $[13];
|
|
469
721
|
}
|
|
470
|
-
return
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
);
|
|
483
|
-
});
|
|
484
|
-
return /* @__PURE__ */ React5.createElement("span", { "data-testid": testID, className, title }, editors[0], separator, editors[1]);
|
|
722
|
+
return _t;
|
|
723
|
+
}
|
|
724
|
+
var _t2;
|
|
725
|
+
if ($[14] !== allProps) {
|
|
726
|
+
_t2 = jsx5(ValueEditor, _objectSpread4(_objectSpread4({}, allProps), {}, { skipHook: true }));
|
|
727
|
+
$[14] = allProps;
|
|
728
|
+
$[15] = _t2;
|
|
729
|
+
} else {
|
|
730
|
+
_t2 = $[15];
|
|
731
|
+
}
|
|
732
|
+
return _t2;
|
|
485
733
|
}
|
|
486
734
|
switch (type) {
|
|
487
|
-
case "select":
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
735
|
+
case "select": {
|
|
736
|
+
}
|
|
737
|
+
case "multiselect": {
|
|
738
|
+
var _t3;
|
|
739
|
+
if ($[16] !== allProps) {
|
|
740
|
+
_t3 = jsx5(ValueEditor, _objectSpread4(_objectSpread4({}, allProps), {}, { skipHook: true }));
|
|
741
|
+
$[16] = allProps;
|
|
742
|
+
$[17] = _t3;
|
|
743
|
+
} else {
|
|
744
|
+
_t3 = $[17];
|
|
745
|
+
}
|
|
746
|
+
return _t3;
|
|
747
|
+
}
|
|
748
|
+
case "textarea": {
|
|
749
|
+
var _t4;
|
|
750
|
+
if ($[18] !== handleOnChange) {
|
|
751
|
+
_t4 = function _t42(e_2) {
|
|
752
|
+
return handleOnChange(e_2.target.value);
|
|
753
|
+
};
|
|
754
|
+
$[18] = handleOnChange;
|
|
755
|
+
$[19] = _t4;
|
|
756
|
+
} else {
|
|
757
|
+
_t4 = $[19];
|
|
758
|
+
}
|
|
759
|
+
var _t5;
|
|
760
|
+
if ($[20] !== value || $[21] !== title || $[22] !== className || $[23] !== disabled || $[24] !== placeHolderText || $[25] !== _t4 || $[26] !== extraProps) {
|
|
761
|
+
_t5 = jsx5(Input.TextArea, _objectSpread4({ value, title, className, disabled, placeholder: placeHolderText, onChange: _t4 }, extraProps));
|
|
762
|
+
$[20] = value;
|
|
763
|
+
$[21] = title;
|
|
764
|
+
$[22] = className;
|
|
765
|
+
$[23] = disabled;
|
|
766
|
+
$[24] = placeHolderText;
|
|
767
|
+
$[25] = _t4;
|
|
768
|
+
$[26] = extraProps;
|
|
769
|
+
$[27] = _t5;
|
|
770
|
+
} else {
|
|
771
|
+
_t5 = $[27];
|
|
772
|
+
}
|
|
773
|
+
return _t5;
|
|
774
|
+
}
|
|
775
|
+
case "switch": {
|
|
776
|
+
var _t6 = !!value;
|
|
777
|
+
var _t7;
|
|
778
|
+
if ($[28] !== handleOnChange) {
|
|
779
|
+
_t7 = function _t72(v_1) {
|
|
780
|
+
return handleOnChange(v_1);
|
|
781
|
+
};
|
|
782
|
+
$[28] = handleOnChange;
|
|
783
|
+
$[29] = _t7;
|
|
784
|
+
} else {
|
|
785
|
+
_t7 = $[29];
|
|
786
|
+
}
|
|
787
|
+
var t4;
|
|
788
|
+
if ($[30] !== _t6 || $[31] !== title || $[32] !== className || $[33] !== disabled || $[34] !== _t7 || $[35] !== extraProps) {
|
|
789
|
+
t4 = jsx5(Switch2, _objectSpread4({ checked: _t6, title, className, disabled, onChange: _t7 }, extraProps));
|
|
790
|
+
$[30] = _t6;
|
|
791
|
+
$[31] = title;
|
|
792
|
+
$[32] = className;
|
|
793
|
+
$[33] = disabled;
|
|
794
|
+
$[34] = _t7;
|
|
795
|
+
$[35] = extraProps;
|
|
796
|
+
$[36] = t4;
|
|
797
|
+
} else {
|
|
798
|
+
t4 = $[36];
|
|
799
|
+
}
|
|
800
|
+
return t4;
|
|
801
|
+
}
|
|
802
|
+
case "checkbox": {
|
|
803
|
+
var _t8;
|
|
804
|
+
if ($[37] !== handleOnChange) {
|
|
805
|
+
_t8 = function _t82(e_1) {
|
|
806
|
+
return handleOnChange(e_1.target.checked);
|
|
807
|
+
};
|
|
808
|
+
$[37] = handleOnChange;
|
|
809
|
+
$[38] = _t8;
|
|
810
|
+
} else {
|
|
811
|
+
_t8 = $[38];
|
|
812
|
+
}
|
|
813
|
+
var _t9 = !!value;
|
|
814
|
+
var _t10;
|
|
815
|
+
if ($[39] !== disabled || $[40] !== _t8 || $[41] !== _t9 || $[42] !== extraProps || $[43] !== title || $[44] !== className) {
|
|
816
|
+
_t10 = jsx5("span", { title, className, children: jsx5(Checkbox, _objectSpread4({ type: "checkbox", disabled, onChange: _t8, checked: _t9 }, extraProps)) });
|
|
817
|
+
$[39] = disabled;
|
|
818
|
+
$[40] = _t8;
|
|
819
|
+
$[41] = _t9;
|
|
820
|
+
$[42] = extraProps;
|
|
821
|
+
$[43] = title;
|
|
822
|
+
$[44] = className;
|
|
823
|
+
$[45] = _t10;
|
|
824
|
+
} else {
|
|
825
|
+
_t10 = $[45];
|
|
826
|
+
}
|
|
827
|
+
return _t10;
|
|
828
|
+
}
|
|
829
|
+
case "radio": {
|
|
830
|
+
var _t11;
|
|
831
|
+
if ($[46] !== value || $[47] !== disabled || $[48] !== handleOnChange || $[49] !== extraProps || $[50] !== values || $[51] !== className || $[52] !== title) {
|
|
832
|
+
var _t12;
|
|
833
|
+
if ($[54] !== value || $[55] !== disabled || $[56] !== handleOnChange || $[57] !== extraProps) {
|
|
834
|
+
_t12 = function _t122(v_0) {
|
|
835
|
+
return jsx5(Radio, _objectSpread4(_objectSpread4({ value: v_0.name, checked: value === v_0.name, disabled, onChange: function onChange(e_0) {
|
|
836
|
+
return handleOnChange(e_0.target.value);
|
|
837
|
+
} }, extraProps), {}, { children: v_0.label }), v_0.name);
|
|
838
|
+
};
|
|
839
|
+
$[54] = value;
|
|
840
|
+
$[55] = disabled;
|
|
841
|
+
$[56] = handleOnChange;
|
|
842
|
+
$[57] = extraProps;
|
|
843
|
+
$[58] = _t12;
|
|
844
|
+
} else {
|
|
845
|
+
_t12 = $[58];
|
|
538
846
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
847
|
+
_t11 = jsx5("span", { className, title, children: values.map(_t12) });
|
|
848
|
+
$[46] = value;
|
|
849
|
+
$[47] = disabled;
|
|
850
|
+
$[48] = handleOnChange;
|
|
851
|
+
$[49] = extraProps;
|
|
852
|
+
$[50] = values;
|
|
853
|
+
$[51] = className;
|
|
854
|
+
$[52] = title;
|
|
855
|
+
$[53] = _t11;
|
|
856
|
+
} else {
|
|
857
|
+
_t11 = $[53];
|
|
858
|
+
}
|
|
859
|
+
return _t11;
|
|
860
|
+
}
|
|
553
861
|
}
|
|
554
862
|
switch (inputTypeCoerced) {
|
|
555
|
-
case "date":
|
|
863
|
+
case "date": {
|
|
864
|
+
}
|
|
556
865
|
case "datetime-local": {
|
|
557
866
|
if (operator === "between" || operator === "notBetween") {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
(
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
),
|
|
578
|
-
...extraProps
|
|
867
|
+
var _t13;
|
|
868
|
+
if ($[59] !== valueAsArray || $[60] !== inputTypeCoerced || $[61] !== placeHolderText || $[62] !== handleOnChange || $[63] !== listsAsArrays || $[64] !== className || $[65] !== disabled || $[66] !== extraProps) {
|
|
869
|
+
var dayjsArray = valueAsArray.slice(0, 2).map(_temp);
|
|
870
|
+
var _t14;
|
|
871
|
+
if ($[68] !== inputTypeCoerced || $[69] !== handleOnChange || $[70] !== listsAsArrays) {
|
|
872
|
+
_t14 = function _t142(dates) {
|
|
873
|
+
var timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
|
|
874
|
+
var format2 = "YYYY-MM-DD".concat(timeFormat);
|
|
875
|
+
var dateArray = dates === null || dates === void 0 ? void 0 : dates.map(function(d_2) {
|
|
876
|
+
return d_2 !== null && d_2 !== void 0 && d_2.isValid() ? d_2.format(format2) : void 0;
|
|
877
|
+
});
|
|
878
|
+
handleOnChange(dateArray ? listsAsArrays ? dateArray : joinWith(dateArray, ",") : dates);
|
|
879
|
+
};
|
|
880
|
+
$[68] = inputTypeCoerced;
|
|
881
|
+
$[69] = handleOnChange;
|
|
882
|
+
$[70] = listsAsArrays;
|
|
883
|
+
$[71] = _t14;
|
|
884
|
+
} else {
|
|
885
|
+
_t14 = $[71];
|
|
579
886
|
}
|
|
580
|
-
|
|
887
|
+
_t13 = jsx5(DatePicker.RangePicker, _objectSpread4({ value: dayjsArray.every(_temp2) ? dayjsArray : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: [placeHolderText, placeHolderText], onChange: _t14 }, extraProps));
|
|
888
|
+
$[59] = valueAsArray;
|
|
889
|
+
$[60] = inputTypeCoerced;
|
|
890
|
+
$[61] = placeHolderText;
|
|
891
|
+
$[62] = handleOnChange;
|
|
892
|
+
$[63] = listsAsArrays;
|
|
893
|
+
$[64] = className;
|
|
894
|
+
$[65] = disabled;
|
|
895
|
+
$[66] = extraProps;
|
|
896
|
+
$[67] = _t13;
|
|
897
|
+
} else {
|
|
898
|
+
_t13 = $[67];
|
|
899
|
+
}
|
|
900
|
+
return _t13;
|
|
581
901
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
902
|
+
var _t15;
|
|
903
|
+
if ($[72] !== value || $[73] !== inputTypeCoerced || $[74] !== handleOnChange || $[75] !== className || $[76] !== disabled || $[77] !== placeHolderText || $[78] !== extraProps) {
|
|
904
|
+
var dateValue_0 = dayjs2(value);
|
|
905
|
+
var _t16;
|
|
906
|
+
if ($[80] !== handleOnChange) {
|
|
907
|
+
_t16 = function _t162(_d, dateString) {
|
|
908
|
+
return handleOnChange(dateString);
|
|
909
|
+
};
|
|
910
|
+
$[80] = handleOnChange;
|
|
911
|
+
$[81] = _t16;
|
|
912
|
+
} else {
|
|
913
|
+
_t16 = $[81];
|
|
593
914
|
}
|
|
594
|
-
|
|
915
|
+
_t15 = jsx5(DatePicker, _objectSpread4({ value: dateValue_0.isValid() ? dateValue_0 : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: placeHolderText, onChange: _t16 }, extraProps));
|
|
916
|
+
$[72] = value;
|
|
917
|
+
$[73] = inputTypeCoerced;
|
|
918
|
+
$[74] = handleOnChange;
|
|
919
|
+
$[75] = className;
|
|
920
|
+
$[76] = disabled;
|
|
921
|
+
$[77] = placeHolderText;
|
|
922
|
+
$[78] = extraProps;
|
|
923
|
+
$[79] = _t15;
|
|
924
|
+
} else {
|
|
925
|
+
_t15 = $[79];
|
|
926
|
+
}
|
|
927
|
+
return _t15;
|
|
595
928
|
}
|
|
596
929
|
case "time": {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
930
|
+
var _t17;
|
|
931
|
+
if ($[82] !== value || $[83] !== handleOnChange || $[84] !== className || $[85] !== disabled || $[86] !== placeHolderText || $[87] !== extraProps) {
|
|
932
|
+
var dateValue = dayjs2(value, "HH:mm:ss");
|
|
933
|
+
var _t18;
|
|
934
|
+
if ($[89] !== handleOnChange) {
|
|
935
|
+
_t18 = function _t182(d_0) {
|
|
936
|
+
var _d_0$format;
|
|
937
|
+
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 : "");
|
|
938
|
+
};
|
|
939
|
+
$[89] = handleOnChange;
|
|
940
|
+
$[90] = _t18;
|
|
941
|
+
} else {
|
|
942
|
+
_t18 = $[90];
|
|
607
943
|
}
|
|
608
|
-
|
|
944
|
+
_t17 = jsx5(DatePicker.TimePicker, _objectSpread4({ value: dateValue.isValid() ? dateValue : void 0, className, disabled, placeholder: placeHolderText, onChange: _t18 }, extraProps));
|
|
945
|
+
$[82] = value;
|
|
946
|
+
$[83] = handleOnChange;
|
|
947
|
+
$[84] = className;
|
|
948
|
+
$[85] = disabled;
|
|
949
|
+
$[86] = placeHolderText;
|
|
950
|
+
$[87] = extraProps;
|
|
951
|
+
$[88] = _t17;
|
|
952
|
+
} else {
|
|
953
|
+
_t17 = $[88];
|
|
954
|
+
}
|
|
955
|
+
return _t17;
|
|
609
956
|
}
|
|
610
957
|
case "number": {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
{
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
958
|
+
var _t19;
|
|
959
|
+
if ($[91] !== inputTypeCoerced || $[92] !== value || $[93] !== title || $[94] !== className || $[95] !== disabled || $[96] !== placeHolderText || $[97] !== handleOnChange || $[98] !== extraProps) {
|
|
960
|
+
_t19 = jsx5(InputNumber, _objectSpread4({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: handleOnChange }, extraProps));
|
|
961
|
+
$[91] = inputTypeCoerced;
|
|
962
|
+
$[92] = value;
|
|
963
|
+
$[93] = title;
|
|
964
|
+
$[94] = className;
|
|
965
|
+
$[95] = disabled;
|
|
966
|
+
$[96] = placeHolderText;
|
|
967
|
+
$[97] = handleOnChange;
|
|
968
|
+
$[98] = extraProps;
|
|
969
|
+
$[99] = _t19;
|
|
970
|
+
} else {
|
|
971
|
+
_t19 = $[99];
|
|
972
|
+
}
|
|
973
|
+
return _t19;
|
|
624
974
|
}
|
|
625
975
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
{
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
976
|
+
var t2;
|
|
977
|
+
if ($[100] !== handleOnChange) {
|
|
978
|
+
t2 = function t22(e_3) {
|
|
979
|
+
return handleOnChange(e_3.target.value);
|
|
980
|
+
};
|
|
981
|
+
$[100] = handleOnChange;
|
|
982
|
+
$[101] = t2;
|
|
983
|
+
} else {
|
|
984
|
+
t2 = $[101];
|
|
985
|
+
}
|
|
986
|
+
var t3;
|
|
987
|
+
if ($[102] !== inputTypeCoerced || $[103] !== value || $[104] !== title || $[105] !== className || $[106] !== disabled || $[107] !== placeHolderText || $[108] !== t2 || $[109] !== extraProps) {
|
|
988
|
+
t3 = jsx5(Input, _objectSpread4({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: t2 }, extraProps));
|
|
989
|
+
$[102] = inputTypeCoerced;
|
|
990
|
+
$[103] = value;
|
|
991
|
+
$[104] = title;
|
|
992
|
+
$[105] = className;
|
|
993
|
+
$[106] = disabled;
|
|
994
|
+
$[107] = placeHolderText;
|
|
995
|
+
$[108] = t2;
|
|
996
|
+
$[109] = extraProps;
|
|
997
|
+
$[110] = t3;
|
|
998
|
+
} else {
|
|
999
|
+
t3 = $[110];
|
|
1000
|
+
}
|
|
1001
|
+
return t3;
|
|
639
1002
|
};
|
|
1003
|
+
function _temp(v_2) {
|
|
1004
|
+
return dayjs2(v_2);
|
|
1005
|
+
}
|
|
1006
|
+
function _temp2(d_1) {
|
|
1007
|
+
return d_1.isValid();
|
|
1008
|
+
}
|
|
640
1009
|
|
|
641
1010
|
// src/AntDValueSelector.tsx
|
|
1011
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
642
1012
|
import { Select as Select2 } from "antd";
|
|
643
|
-
import * as React7 from "react";
|
|
644
1013
|
import { useValueSelector } from "react-querybuilder";
|
|
645
1014
|
|
|
646
1015
|
// src/utils.tsx
|
|
1016
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
647
1017
|
import { Select } from "antd";
|
|
648
|
-
import * as React6 from "react";
|
|
649
1018
|
import { isOptionGroupArray } from "react-querybuilder";
|
|
650
|
-
var
|
|
651
|
-
var
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
)
|
|
1019
|
+
var OptGroup = Select.OptGroup;
|
|
1020
|
+
var Option = Select.Option;
|
|
1021
|
+
var toOptions = function toOptions2(arr) {
|
|
1022
|
+
return isOptionGroupArray(arr) ? arr.map(function(og) {
|
|
1023
|
+
return /* @__PURE__ */ jsx6(OptGroup, { label: og.label, children: og.options.map(function(opt) {
|
|
1024
|
+
return /* @__PURE__ */ jsx6(Option, { value: opt.name, children: opt.label }, opt.name);
|
|
1025
|
+
}) }, og.label);
|
|
1026
|
+
}) : Array.isArray(arr) ? arr.map(function(opt) {
|
|
1027
|
+
return /* @__PURE__ */ jsx6(Option, { value: opt.name, children: opt.label }, opt.name);
|
|
1028
|
+
}) : (
|
|
1029
|
+
/* istanbul ignore next */
|
|
1030
|
+
null
|
|
1031
|
+
);
|
|
1032
|
+
};
|
|
655
1033
|
|
|
656
1034
|
// src/AntDValueSelector.tsx
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
1035
|
+
function _typeof5(o) {
|
|
1036
|
+
"@babel/helpers - typeof";
|
|
1037
|
+
return _typeof5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
1038
|
+
return typeof o2;
|
|
1039
|
+
} : function(o2) {
|
|
1040
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
1041
|
+
}, _typeof5(o);
|
|
1042
|
+
}
|
|
1043
|
+
var _excluded4 = ["className", "handleOnChange", "options", "value", "title", "disabled", "multiple", "listsAsArrays", "testID", "rule", "rules", "level", "path", "context", "validation", "operator", "field", "fieldData", "schema"];
|
|
1044
|
+
function ownKeys5(e, r) {
|
|
1045
|
+
var t = Object.keys(e);
|
|
1046
|
+
if (Object.getOwnPropertySymbols) {
|
|
1047
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
1048
|
+
r && (o = o.filter(function(r2) {
|
|
1049
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
1050
|
+
})), t.push.apply(t, o);
|
|
1051
|
+
}
|
|
1052
|
+
return t;
|
|
1053
|
+
}
|
|
1054
|
+
function _objectSpread5(e) {
|
|
1055
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
1056
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
1057
|
+
r % 2 ? ownKeys5(Object(t), true).forEach(function(r2) {
|
|
1058
|
+
_defineProperty5(e, r2, t[r2]);
|
|
1059
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys5(Object(t)).forEach(function(r2) {
|
|
1060
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
return e;
|
|
1064
|
+
}
|
|
1065
|
+
function _defineProperty5(e, r, t) {
|
|
1066
|
+
return (r = _toPropertyKey5(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e;
|
|
1067
|
+
}
|
|
1068
|
+
function _toPropertyKey5(t) {
|
|
1069
|
+
var i = _toPrimitive5(t, "string");
|
|
1070
|
+
return "symbol" == _typeof5(i) ? i : i + "";
|
|
1071
|
+
}
|
|
1072
|
+
function _toPrimitive5(t, r) {
|
|
1073
|
+
if ("object" != _typeof5(t) || !t) return t;
|
|
1074
|
+
var e = t[Symbol.toPrimitive];
|
|
1075
|
+
if (void 0 !== e) {
|
|
1076
|
+
var i = e.call(t, r || "default");
|
|
1077
|
+
if ("object" != _typeof5(i)) return i;
|
|
1078
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1079
|
+
}
|
|
1080
|
+
return ("string" === r ? String : Number)(t);
|
|
1081
|
+
}
|
|
1082
|
+
function _objectWithoutProperties4(e, t) {
|
|
1083
|
+
if (null == e) return {};
|
|
1084
|
+
var o, r, i = _objectWithoutPropertiesLoose4(e, t);
|
|
1085
|
+
if (Object.getOwnPropertySymbols) {
|
|
1086
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
1087
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
1088
|
+
}
|
|
1089
|
+
return i;
|
|
1090
|
+
}
|
|
1091
|
+
function _objectWithoutPropertiesLoose4(r, e) {
|
|
1092
|
+
if (null == r) return {};
|
|
1093
|
+
var t = {};
|
|
1094
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
1095
|
+
if (e.includes(n)) continue;
|
|
1096
|
+
t[n] = r[n];
|
|
1097
|
+
}
|
|
1098
|
+
return t;
|
|
1099
|
+
}
|
|
1100
|
+
var AntDValueSelector = function AntDValueSelector2(t0) {
|
|
1101
|
+
var $ = c(24);
|
|
1102
|
+
var handleOnChange;
|
|
1103
|
+
var listsAsArrays;
|
|
1104
|
+
var multiple;
|
|
1105
|
+
var value;
|
|
1106
|
+
var options;
|
|
1107
|
+
var disabled;
|
|
1108
|
+
var extraProps;
|
|
1109
|
+
var title;
|
|
1110
|
+
var className;
|
|
1111
|
+
if ($[0] !== t0) {
|
|
1112
|
+
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, _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 = _objectWithoutProperties4(t0, _excluded4);
|
|
1113
|
+
className = _t;
|
|
1114
|
+
handleOnChange = _t2;
|
|
1115
|
+
options = t3;
|
|
1116
|
+
value = t4;
|
|
1117
|
+
title = t5;
|
|
1118
|
+
disabled = t6;
|
|
1119
|
+
multiple = t7;
|
|
1120
|
+
listsAsArrays = t8;
|
|
1121
|
+
extraProps = t9;
|
|
1122
|
+
$[0] = t0;
|
|
1123
|
+
$[1] = handleOnChange;
|
|
1124
|
+
$[2] = listsAsArrays;
|
|
1125
|
+
$[3] = multiple;
|
|
1126
|
+
$[4] = value;
|
|
1127
|
+
$[5] = options;
|
|
1128
|
+
$[6] = disabled;
|
|
1129
|
+
$[7] = extraProps;
|
|
1130
|
+
$[8] = title;
|
|
1131
|
+
$[9] = className;
|
|
1132
|
+
} else {
|
|
1133
|
+
handleOnChange = $[1];
|
|
1134
|
+
listsAsArrays = $[2];
|
|
1135
|
+
multiple = $[3];
|
|
1136
|
+
value = $[4];
|
|
1137
|
+
options = $[5];
|
|
1138
|
+
disabled = $[6];
|
|
1139
|
+
extraProps = $[7];
|
|
1140
|
+
title = $[8];
|
|
1141
|
+
className = $[9];
|
|
1142
|
+
}
|
|
1143
|
+
var t1;
|
|
1144
|
+
if ($[10] !== handleOnChange || $[11] !== listsAsArrays || $[12] !== multiple || $[13] !== value) {
|
|
1145
|
+
t1 = { handleOnChange, listsAsArrays, multiple, value };
|
|
1146
|
+
$[10] = handleOnChange;
|
|
1147
|
+
$[11] = listsAsArrays;
|
|
1148
|
+
$[12] = multiple;
|
|
1149
|
+
$[13] = value;
|
|
1150
|
+
$[14] = t1;
|
|
1151
|
+
} else {
|
|
1152
|
+
t1 = $[14];
|
|
1153
|
+
}
|
|
1154
|
+
var _useValueSelector = useValueSelector(t1), onChange = _useValueSelector.onChange, val = _useValueSelector.val;
|
|
1155
|
+
var t2;
|
|
1156
|
+
if ($[15] !== multiple || $[16] !== options || $[17] !== disabled || $[18] !== val || $[19] !== onChange || $[20] !== extraProps || $[21] !== title || $[22] !== className) {
|
|
1157
|
+
var modeObj = multiple ? { mode: "multiple" } : {};
|
|
1158
|
+
t2 = jsx7("span", { title, className, children: jsx7(Select2, _objectSpread5(_objectSpread5(_objectSpread5({}, modeObj), {}, { popupMatchSelectWidth: false, disabled, value: val, onChange }, extraProps), {}, { children: toOptions(options) })) });
|
|
1159
|
+
$[15] = multiple;
|
|
1160
|
+
$[16] = options;
|
|
1161
|
+
$[17] = disabled;
|
|
1162
|
+
$[18] = val;
|
|
1163
|
+
$[19] = onChange;
|
|
1164
|
+
$[20] = extraProps;
|
|
1165
|
+
$[21] = title;
|
|
1166
|
+
$[22] = className;
|
|
1167
|
+
$[23] = t2;
|
|
1168
|
+
} else {
|
|
1169
|
+
t2 = $[23];
|
|
1170
|
+
}
|
|
1171
|
+
return t2;
|
|
694
1172
|
};
|
|
695
1173
|
|
|
696
1174
|
// src/index.tsx
|
|
697
|
-
var antdControlElements = {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
notToggle: AntDNotToggle,
|
|
701
|
-
shiftActions: AntDShiftActions,
|
|
702
|
-
valueEditor: AntDValueEditor,
|
|
703
|
-
valueSelector: AntDValueSelector
|
|
704
|
-
};
|
|
705
|
-
var antdTranslations = {
|
|
706
|
-
removeGroup: { label: /* @__PURE__ */ React8.createElement(CloseOutlined, null) },
|
|
707
|
-
removeRule: { label: /* @__PURE__ */ React8.createElement(CloseOutlined, null) },
|
|
708
|
-
cloneRule: { label: /* @__PURE__ */ React8.createElement(CopyOutlined, null) },
|
|
709
|
-
cloneRuleGroup: { label: /* @__PURE__ */ React8.createElement(CopyOutlined, null) },
|
|
710
|
-
lockGroup: { label: /* @__PURE__ */ React8.createElement(UnlockOutlined, null) },
|
|
711
|
-
lockRule: { label: /* @__PURE__ */ React8.createElement(UnlockOutlined, null) },
|
|
712
|
-
lockGroupDisabled: { label: /* @__PURE__ */ React8.createElement(LockOutlined, null) },
|
|
713
|
-
lockRuleDisabled: { label: /* @__PURE__ */ React8.createElement(LockOutlined, null) },
|
|
714
|
-
shiftActionUp: { label: /* @__PURE__ */ React8.createElement(UpOutlined, null) },
|
|
715
|
-
shiftActionDown: { label: /* @__PURE__ */ React8.createElement(DownOutlined, null) }
|
|
716
|
-
};
|
|
717
|
-
var QueryBuilderAntD = getCompatContextProvider({
|
|
718
|
-
controlElements: antdControlElements,
|
|
719
|
-
translations: antdTranslations
|
|
720
|
-
});
|
|
1175
|
+
var antdControlElements = { actionElement: AntDActionElement, dragHandle: AntDDragHandle, notToggle: AntDNotToggle, shiftActions: AntDShiftActions, valueEditor: AntDValueEditor, valueSelector: AntDValueSelector };
|
|
1176
|
+
var antdTranslations = { removeGroup: { label: /* @__PURE__ */ jsx8(CloseOutlined, {}) }, removeRule: { label: /* @__PURE__ */ jsx8(CloseOutlined, {}) }, cloneRule: { label: /* @__PURE__ */ jsx8(CopyOutlined, {}) }, cloneRuleGroup: { label: /* @__PURE__ */ jsx8(CopyOutlined, {}) }, lockGroup: { label: /* @__PURE__ */ jsx8(UnlockOutlined, {}) }, lockRule: { label: /* @__PURE__ */ jsx8(UnlockOutlined, {}) }, lockGroupDisabled: { label: /* @__PURE__ */ jsx8(LockOutlined, {}) }, lockRuleDisabled: { label: /* @__PURE__ */ jsx8(LockOutlined, {}) }, shiftActionUp: { label: /* @__PURE__ */ jsx8(UpOutlined, {}) }, shiftActionDown: { label: /* @__PURE__ */ jsx8(DownOutlined, {}) } };
|
|
1177
|
+
var QueryBuilderAntD = getCompatContextProvider({ controlElements: antdControlElements, translations: antdTranslations });
|
|
721
1178
|
export {
|
|
722
1179
|
AntDActionElement,
|
|
723
1180
|
AntDDragHandle,
|