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