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