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