@react-querybuilder/antd 6.5.3 → 7.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/react-querybuilder_antd.cjs.development.d.ts +11 -4
- package/dist/cjs/react-querybuilder_antd.cjs.development.js +233 -100
- package/dist/cjs/react-querybuilder_antd.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.d.ts +11 -4
- package/dist/cjs/react-querybuilder_antd.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.js.map +1 -1
- package/dist/react-querybuilder_antd.d.mts +11 -4
- package/dist/react-querybuilder_antd.legacy-esm.d.mts +11 -4
- package/dist/react-querybuilder_antd.legacy-esm.js +209 -76
- package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_antd.mjs +208 -76
- package/dist/react-querybuilder_antd.mjs.map +1 -1
- package/dist/react-querybuilder_antd.production.d.mts +11 -4
- package/dist/react-querybuilder_antd.production.mjs +1 -1
- package/dist/react-querybuilder_antd.production.mjs.map +1 -1
- package/package.json +14 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_querybuilder from 'react-querybuilder';
|
|
2
|
-
import { ActionWithRulesProps, DragHandleProps, NotToggleProps, ValueEditorProps, VersatileSelectorProps, Controls } from 'react-querybuilder';
|
|
2
|
+
import { ActionWithRulesProps, DragHandleProps, NotToggleProps, ShiftActionsProps, ValueEditorProps, VersatileSelectorProps, Controls } from 'react-querybuilder';
|
|
3
3
|
import { Button, Switch, Select } from 'antd';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
|
|
@@ -14,7 +14,9 @@ declare const AntDActionElement: {
|
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
type AntDDragHandleProps = DragHandleProps &
|
|
17
|
+
type AntDDragHandleProps = DragHandleProps & {
|
|
18
|
+
label?: any;
|
|
19
|
+
} & ComponentPropsWithRef<typeof HolderOutlined>;
|
|
18
20
|
declare const AntDDragHandle: React.ForwardRefExoticComponent<Omit<AntDDragHandleProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
19
21
|
|
|
20
22
|
type AntDNotToggleProps = NotToggleProps & ComponentPropsWithoutRef<typeof Switch>;
|
|
@@ -23,6 +25,11 @@ declare const AntDNotToggle: {
|
|
|
23
25
|
displayName: string;
|
|
24
26
|
};
|
|
25
27
|
|
|
28
|
+
declare const AntDShiftActions: {
|
|
29
|
+
({ path, disabled, className, titles, testID, lastInGroup, schema: { combinators, dispatchQuery, getQuery }, }: ShiftActionsProps): React.JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
26
33
|
declare const AntDValueEditor: {
|
|
27
34
|
({ fieldData, operator, value, handleOnChange, title, className, type, inputType, values, listsAsArrays, parseNumbers, separator, valueSource: _vs, disabled, testID, selectorComponent: SelectorComponent, ...props }: ValueEditorProps): React.JSX.Element | null;
|
|
28
35
|
displayName: string;
|
|
@@ -30,11 +37,11 @@ declare const AntDValueEditor: {
|
|
|
30
37
|
|
|
31
38
|
type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;
|
|
32
39
|
declare const AntDValueSelector: {
|
|
33
|
-
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps): React.JSX.Element;
|
|
40
|
+
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps): React.JSX.Element;
|
|
34
41
|
displayName: string;
|
|
35
42
|
};
|
|
36
43
|
|
|
37
44
|
declare const antdControlElements: Partial<Controls>;
|
|
38
45
|
declare const QueryBuilderAntD: react_querybuilder.QueryBuilderContextProvider<Record<string, any>>;
|
|
39
46
|
|
|
40
|
-
export { AntDActionElement, AntDDragHandle, AntDNotToggle, AntDValueEditor, AntDValueSelector, QueryBuilderAntD, antdControlElements };
|
|
47
|
+
export { AntDActionElement, AntDActionProps, AntDDragHandle, AntDDragHandleProps, AntDNotToggle, AntDNotToggleProps, AntDShiftActions, AntDValueEditor, AntDValueSelector, AntDValueSelectorProps, QueryBuilderAntD, antdControlElements };
|
|
@@ -38,7 +38,7 @@ var require_dayjs_min = __commonJS({
|
|
|
38
38
|
"object" == typeof exports && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
39
39
|
}(exports, function() {
|
|
40
40
|
"use strict";
|
|
41
|
-
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week",
|
|
41
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
42
42
|
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
43
43
|
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
44
44
|
} }, m = function(t2, e2, n2) {
|
|
@@ -50,19 +50,19 @@ var require_dayjs_min = __commonJS({
|
|
|
50
50
|
}, m: function t2(e2, n2) {
|
|
51
51
|
if (e2.date() < n2.date())
|
|
52
52
|
return -t2(n2, e2);
|
|
53
|
-
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2,
|
|
53
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
54
54
|
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
55
55
|
}, a: function(t2) {
|
|
56
56
|
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
57
57
|
}, p: function(t2) {
|
|
58
|
-
return { M:
|
|
58
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
59
59
|
}, u: function(t2) {
|
|
60
60
|
return void 0 === t2;
|
|
61
61
|
} }, g = "en", D = {};
|
|
62
62
|
D[g] = M;
|
|
63
|
-
var p = function(t2) {
|
|
64
|
-
return t2 instanceof _;
|
|
65
|
-
},
|
|
63
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
64
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
65
|
+
}, w = function t2(e2, n2, r2) {
|
|
66
66
|
var i2;
|
|
67
67
|
if (!e2)
|
|
68
68
|
return g;
|
|
@@ -77,18 +77,18 @@ var require_dayjs_min = __commonJS({
|
|
|
77
77
|
D[a2] = e2, i2 = a2;
|
|
78
78
|
}
|
|
79
79
|
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
80
|
-
},
|
|
81
|
-
if (
|
|
80
|
+
}, O = function(t2, e2) {
|
|
81
|
+
if (S(t2))
|
|
82
82
|
return t2.clone();
|
|
83
83
|
var n2 = "object" == typeof e2 ? e2 : {};
|
|
84
84
|
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
return
|
|
85
|
+
}, b = v;
|
|
86
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
87
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
88
88
|
};
|
|
89
89
|
var _ = function() {
|
|
90
90
|
function M2(t2) {
|
|
91
|
-
this.$L =
|
|
91
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
92
92
|
}
|
|
93
93
|
var m2 = M2.prototype;
|
|
94
94
|
return m2.parse = function(t2) {
|
|
@@ -96,7 +96,7 @@ var require_dayjs_min = __commonJS({
|
|
|
96
96
|
var e2 = t3.date, n2 = t3.utc;
|
|
97
97
|
if (null === e2)
|
|
98
98
|
return /* @__PURE__ */ new Date(NaN);
|
|
99
|
-
if (
|
|
99
|
+
if (b.u(e2))
|
|
100
100
|
return /* @__PURE__ */ new Date();
|
|
101
101
|
if (e2 instanceof Date)
|
|
102
102
|
return new Date(e2);
|
|
@@ -108,38 +108,38 @@ var require_dayjs_min = __commonJS({
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
return new Date(e2);
|
|
111
|
-
}(t2), this
|
|
111
|
+
}(t2), this.init();
|
|
112
112
|
}, m2.init = function() {
|
|
113
113
|
var t2 = this.$d;
|
|
114
114
|
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
115
115
|
}, m2.$utils = function() {
|
|
116
|
-
return
|
|
116
|
+
return b;
|
|
117
117
|
}, m2.isValid = function() {
|
|
118
118
|
return !(this.$d.toString() === l);
|
|
119
119
|
}, m2.isSame = function(t2, e2) {
|
|
120
|
-
var n2 =
|
|
120
|
+
var n2 = O(t2);
|
|
121
121
|
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
122
122
|
}, m2.isAfter = function(t2, e2) {
|
|
123
|
-
return
|
|
123
|
+
return O(t2) < this.startOf(e2);
|
|
124
124
|
}, m2.isBefore = function(t2, e2) {
|
|
125
|
-
return this.endOf(e2) <
|
|
125
|
+
return this.endOf(e2) < O(t2);
|
|
126
126
|
}, m2.$g = function(t2, e2, n2) {
|
|
127
|
-
return
|
|
127
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
128
128
|
}, m2.unix = function() {
|
|
129
129
|
return Math.floor(this.valueOf() / 1e3);
|
|
130
130
|
}, m2.valueOf = function() {
|
|
131
131
|
return this.$d.getTime();
|
|
132
132
|
}, m2.startOf = function(t2, e2) {
|
|
133
|
-
var n2 = this, r2 = !!
|
|
134
|
-
var i2 =
|
|
133
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
134
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
135
135
|
return r2 ? i2 : i2.endOf(a);
|
|
136
136
|
}, $2 = function(t3, e3) {
|
|
137
|
-
return
|
|
137
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
138
138
|
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
139
|
-
switch (
|
|
140
|
-
case
|
|
139
|
+
switch (f2) {
|
|
140
|
+
case h:
|
|
141
141
|
return r2 ? l2(1, 0) : l2(31, 11);
|
|
142
|
-
case
|
|
142
|
+
case c:
|
|
143
143
|
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
144
144
|
case o:
|
|
145
145
|
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
@@ -159,8 +159,8 @@ var require_dayjs_min = __commonJS({
|
|
|
159
159
|
}, m2.endOf = function(t2) {
|
|
160
160
|
return this.startOf(t2, false);
|
|
161
161
|
}, m2.$set = function(t2, e2) {
|
|
162
|
-
var n2, o2 =
|
|
163
|
-
if (o2 ===
|
|
162
|
+
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
163
|
+
if (o2 === c || o2 === h) {
|
|
164
164
|
var y2 = this.clone().set(d, 1);
|
|
165
165
|
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
166
166
|
} else
|
|
@@ -169,57 +169,139 @@ var require_dayjs_min = __commonJS({
|
|
|
169
169
|
}, m2.set = function(t2, e2) {
|
|
170
170
|
return this.clone().$set(t2, e2);
|
|
171
171
|
}, m2.get = function(t2) {
|
|
172
|
-
return this[
|
|
173
|
-
}, m2.add = function(r2,
|
|
172
|
+
return this[b.p(t2)]();
|
|
173
|
+
}, m2.add = function(r2, f2) {
|
|
174
174
|
var d2, l2 = this;
|
|
175
175
|
r2 = Number(r2);
|
|
176
|
-
var $2 =
|
|
177
|
-
var e2 =
|
|
178
|
-
return
|
|
176
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
177
|
+
var e2 = O(l2);
|
|
178
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
179
179
|
};
|
|
180
|
-
if ($2 === f)
|
|
181
|
-
return this.set(f, this.$M + r2);
|
|
182
180
|
if ($2 === c)
|
|
183
|
-
return this.set(c, this.$
|
|
181
|
+
return this.set(c, this.$M + r2);
|
|
182
|
+
if ($2 === h)
|
|
183
|
+
return this.set(h, this.$y + r2);
|
|
184
184
|
if ($2 === a)
|
|
185
185
|
return y2(1);
|
|
186
186
|
if ($2 === o)
|
|
187
187
|
return y2(7);
|
|
188
188
|
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
189
|
-
return
|
|
189
|
+
return b.w(m3, this);
|
|
190
190
|
}, m2.subtract = function(t2, e2) {
|
|
191
191
|
return this.add(-1 * t2, e2);
|
|
192
192
|
}, m2.format = function(t2) {
|
|
193
193
|
var e2 = this, n2 = this.$locale();
|
|
194
194
|
if (!this.isValid())
|
|
195
195
|
return n2.invalidDate || l;
|
|
196
|
-
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 =
|
|
196
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
197
197
|
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
198
|
-
},
|
|
199
|
-
return
|
|
200
|
-
},
|
|
198
|
+
}, d2 = function(t3) {
|
|
199
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
200
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
201
201
|
var r3 = t3 < 12 ? "AM" : "PM";
|
|
202
202
|
return n3 ? r3.toLowerCase() : r3;
|
|
203
|
-
}
|
|
204
|
-
return r2.replace(y, function(t3,
|
|
205
|
-
return
|
|
203
|
+
};
|
|
204
|
+
return r2.replace(y, function(t3, r3) {
|
|
205
|
+
return r3 || function(t4) {
|
|
206
|
+
switch (t4) {
|
|
207
|
+
case "YY":
|
|
208
|
+
return String(e2.$y).slice(-2);
|
|
209
|
+
case "YYYY":
|
|
210
|
+
return b.s(e2.$y, 4, "0");
|
|
211
|
+
case "M":
|
|
212
|
+
return a2 + 1;
|
|
213
|
+
case "MM":
|
|
214
|
+
return b.s(a2 + 1, 2, "0");
|
|
215
|
+
case "MMM":
|
|
216
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
217
|
+
case "MMMM":
|
|
218
|
+
return h2(c2, a2);
|
|
219
|
+
case "D":
|
|
220
|
+
return e2.$D;
|
|
221
|
+
case "DD":
|
|
222
|
+
return b.s(e2.$D, 2, "0");
|
|
223
|
+
case "d":
|
|
224
|
+
return String(e2.$W);
|
|
225
|
+
case "dd":
|
|
226
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
227
|
+
case "ddd":
|
|
228
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
229
|
+
case "dddd":
|
|
230
|
+
return o2[e2.$W];
|
|
231
|
+
case "H":
|
|
232
|
+
return String(s2);
|
|
233
|
+
case "HH":
|
|
234
|
+
return b.s(s2, 2, "0");
|
|
235
|
+
case "h":
|
|
236
|
+
return d2(1);
|
|
237
|
+
case "hh":
|
|
238
|
+
return d2(2);
|
|
239
|
+
case "a":
|
|
240
|
+
return $2(s2, u2, true);
|
|
241
|
+
case "A":
|
|
242
|
+
return $2(s2, u2, false);
|
|
243
|
+
case "m":
|
|
244
|
+
return String(u2);
|
|
245
|
+
case "mm":
|
|
246
|
+
return b.s(u2, 2, "0");
|
|
247
|
+
case "s":
|
|
248
|
+
return String(e2.$s);
|
|
249
|
+
case "ss":
|
|
250
|
+
return b.s(e2.$s, 2, "0");
|
|
251
|
+
case "SSS":
|
|
252
|
+
return b.s(e2.$ms, 3, "0");
|
|
253
|
+
case "Z":
|
|
254
|
+
return i2;
|
|
255
|
+
}
|
|
256
|
+
return null;
|
|
257
|
+
}(t3) || i2.replace(":", "");
|
|
206
258
|
});
|
|
207
259
|
}, m2.utcOffset = function() {
|
|
208
260
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
209
261
|
}, m2.diff = function(r2, d2, l2) {
|
|
210
|
-
var $2, y2 =
|
|
211
|
-
|
|
262
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
263
|
+
return b.m(y2, m3);
|
|
264
|
+
};
|
|
265
|
+
switch (M3) {
|
|
266
|
+
case h:
|
|
267
|
+
$2 = D2() / 12;
|
|
268
|
+
break;
|
|
269
|
+
case c:
|
|
270
|
+
$2 = D2();
|
|
271
|
+
break;
|
|
272
|
+
case f:
|
|
273
|
+
$2 = D2() / 3;
|
|
274
|
+
break;
|
|
275
|
+
case o:
|
|
276
|
+
$2 = (g2 - v2) / 6048e5;
|
|
277
|
+
break;
|
|
278
|
+
case a:
|
|
279
|
+
$2 = (g2 - v2) / 864e5;
|
|
280
|
+
break;
|
|
281
|
+
case u:
|
|
282
|
+
$2 = g2 / n;
|
|
283
|
+
break;
|
|
284
|
+
case s:
|
|
285
|
+
$2 = g2 / e;
|
|
286
|
+
break;
|
|
287
|
+
case i:
|
|
288
|
+
$2 = g2 / t;
|
|
289
|
+
break;
|
|
290
|
+
default:
|
|
291
|
+
$2 = g2;
|
|
292
|
+
}
|
|
293
|
+
return l2 ? $2 : b.a($2);
|
|
212
294
|
}, m2.daysInMonth = function() {
|
|
213
|
-
return this.endOf(
|
|
295
|
+
return this.endOf(c).$D;
|
|
214
296
|
}, m2.$locale = function() {
|
|
215
297
|
return D[this.$L];
|
|
216
298
|
}, m2.locale = function(t2, e2) {
|
|
217
299
|
if (!t2)
|
|
218
300
|
return this.$L;
|
|
219
|
-
var n2 = this.clone(), r2 =
|
|
301
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
220
302
|
return r2 && (n2.$L = r2), n2;
|
|
221
303
|
}, m2.clone = function() {
|
|
222
|
-
return
|
|
304
|
+
return b.w(this.$d, this);
|
|
223
305
|
}, m2.toDate = function() {
|
|
224
306
|
return new Date(this.valueOf());
|
|
225
307
|
}, m2.toJSON = function() {
|
|
@@ -229,16 +311,16 @@ var require_dayjs_min = __commonJS({
|
|
|
229
311
|
}, m2.toString = function() {
|
|
230
312
|
return this.$d.toUTCString();
|
|
231
313
|
}, M2;
|
|
232
|
-
}(),
|
|
233
|
-
return
|
|
234
|
-
|
|
314
|
+
}(), k = _.prototype;
|
|
315
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
316
|
+
k[t2[1]] = function(e2) {
|
|
235
317
|
return this.$g(e2, t2[0], t2[1]);
|
|
236
318
|
};
|
|
237
|
-
}),
|
|
238
|
-
return t2.$i || (t2(e2, _,
|
|
239
|
-
},
|
|
240
|
-
return
|
|
241
|
-
},
|
|
319
|
+
}), O.extend = function(t2, e2) {
|
|
320
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
321
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
322
|
+
return O(1e3 * t2);
|
|
323
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
242
324
|
});
|
|
243
325
|
}
|
|
244
326
|
});
|
|
@@ -894,13 +976,14 @@ __export(src_exports, {
|
|
|
894
976
|
AntDActionElement: () => AntDActionElement,
|
|
895
977
|
AntDDragHandle: () => AntDDragHandle,
|
|
896
978
|
AntDNotToggle: () => AntDNotToggle,
|
|
979
|
+
AntDShiftActions: () => AntDShiftActions,
|
|
897
980
|
AntDValueEditor: () => AntDValueEditor,
|
|
898
981
|
AntDValueSelector: () => AntDValueSelector,
|
|
899
982
|
QueryBuilderAntD: () => QueryBuilderAntD,
|
|
900
983
|
antdControlElements: () => antdControlElements
|
|
901
984
|
});
|
|
902
985
|
module.exports = __toCommonJS(src_exports);
|
|
903
|
-
var
|
|
986
|
+
var import_react_querybuilder5 = require("react-querybuilder");
|
|
904
987
|
|
|
905
988
|
// src/AntDActionElement.tsx
|
|
906
989
|
var import_antd = require("antd");
|
|
@@ -992,24 +1075,71 @@ var AntDNotToggle = ({
|
|
|
992
1075
|
);
|
|
993
1076
|
AntDNotToggle.displayName = "AntDNotToggle";
|
|
994
1077
|
|
|
1078
|
+
// src/AntDShiftActions.tsx
|
|
1079
|
+
var import_icons2 = require("@ant-design/icons");
|
|
1080
|
+
var import_antd3 = require("antd");
|
|
1081
|
+
var React4 = __toESM(require("react"));
|
|
1082
|
+
var import_react_querybuilder = require("react-querybuilder");
|
|
1083
|
+
var AntDShiftActions = ({
|
|
1084
|
+
path,
|
|
1085
|
+
disabled,
|
|
1086
|
+
className,
|
|
1087
|
+
// labels, // Labels are hard-coded in this component
|
|
1088
|
+
titles,
|
|
1089
|
+
testID,
|
|
1090
|
+
lastInGroup,
|
|
1091
|
+
schema: { combinators, dispatchQuery, getQuery }
|
|
1092
|
+
}) => {
|
|
1093
|
+
const { shiftUp, shiftUpDisabled, shiftDown, shiftDownDisabled } = (0, import_react_querybuilder.useShiftActions)({
|
|
1094
|
+
combinators,
|
|
1095
|
+
disabled,
|
|
1096
|
+
dispatchQuery,
|
|
1097
|
+
getQuery,
|
|
1098
|
+
lastInGroup,
|
|
1099
|
+
path
|
|
1100
|
+
});
|
|
1101
|
+
return /* @__PURE__ */ React4.createElement("div", { "data-testid": testID, className }, /* @__PURE__ */ React4.createElement(
|
|
1102
|
+
import_antd3.Button,
|
|
1103
|
+
{
|
|
1104
|
+
type: "primary",
|
|
1105
|
+
size: "small",
|
|
1106
|
+
title: titles?.shiftUp,
|
|
1107
|
+
onClick: shiftUp,
|
|
1108
|
+
disabled: shiftUpDisabled
|
|
1109
|
+
},
|
|
1110
|
+
/* @__PURE__ */ React4.createElement(import_icons2.CaretUpOutlined, null)
|
|
1111
|
+
), /* @__PURE__ */ React4.createElement(
|
|
1112
|
+
import_antd3.Button,
|
|
1113
|
+
{
|
|
1114
|
+
type: "primary",
|
|
1115
|
+
size: "small",
|
|
1116
|
+
title: titles?.shiftDown,
|
|
1117
|
+
onClick: shiftDown,
|
|
1118
|
+
disabled: shiftDownDisabled
|
|
1119
|
+
},
|
|
1120
|
+
/* @__PURE__ */ React4.createElement(import_icons2.CaretDownOutlined, null)
|
|
1121
|
+
));
|
|
1122
|
+
};
|
|
1123
|
+
AntDShiftActions.displayName = "AntDShiftActions";
|
|
1124
|
+
|
|
995
1125
|
// src/AntDValueEditor.tsx
|
|
996
|
-
var
|
|
1126
|
+
var import_antd6 = require("antd");
|
|
997
1127
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
998
1128
|
var import_dayjs2 = __toESM(require_dayjs());
|
|
1129
|
+
var React7 = __toESM(require("react"));
|
|
1130
|
+
var import_react_querybuilder4 = require("react-querybuilder");
|
|
1131
|
+
|
|
1132
|
+
// src/AntDValueSelector.tsx
|
|
1133
|
+
var import_antd5 = require("antd");
|
|
999
1134
|
var React6 = __toESM(require("react"));
|
|
1000
1135
|
var import_react_querybuilder3 = require("react-querybuilder");
|
|
1001
1136
|
|
|
1002
|
-
// src/
|
|
1137
|
+
// src/utils.tsx
|
|
1003
1138
|
var import_antd4 = require("antd");
|
|
1004
1139
|
var React5 = __toESM(require("react"));
|
|
1005
1140
|
var import_react_querybuilder2 = require("react-querybuilder");
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
var import_antd3 = require("antd");
|
|
1009
|
-
var React4 = __toESM(require("react"));
|
|
1010
|
-
var import_react_querybuilder = require("react-querybuilder");
|
|
1011
|
-
var { OptGroup, Option } = import_antd3.Select;
|
|
1012
|
-
var toOptions = (arr) => (0, import_react_querybuilder.isOptionGroupArray)(arr) ? arr.map((og) => /* @__PURE__ */ React4.createElement(OptGroup, { key: og.label, label: og.label }, og.options.map((opt) => /* @__PURE__ */ React4.createElement(Option, { key: opt.name, value: opt.name }, opt.label)))) : Array.isArray(arr) ? arr.map((opt) => /* @__PURE__ */ React4.createElement(Option, { key: opt.name, value: opt.name }, opt.label)) : (
|
|
1141
|
+
var { OptGroup, Option } = import_antd4.Select;
|
|
1142
|
+
var toOptions = (arr) => (0, import_react_querybuilder2.isOptionGroupArray)(arr) ? arr.map((og) => /* @__PURE__ */ React5.createElement(OptGroup, { key: og.label, label: og.label }, og.options.map((opt) => /* @__PURE__ */ React5.createElement(Option, { key: opt.name, value: opt.name }, opt.label)))) : Array.isArray(arr) ? arr.map((opt) => /* @__PURE__ */ React5.createElement(Option, { key: opt.name, value: opt.name }, opt.label)) : (
|
|
1013
1143
|
/* istanbul ignore next */
|
|
1014
1144
|
null
|
|
1015
1145
|
);
|
|
@@ -1026,6 +1156,7 @@ var AntDValueSelector = ({
|
|
|
1026
1156
|
listsAsArrays,
|
|
1027
1157
|
// Props that should not be in extraProps
|
|
1028
1158
|
testID: _testID,
|
|
1159
|
+
rule: _rule,
|
|
1029
1160
|
rules: _rules,
|
|
1030
1161
|
level: _level,
|
|
1031
1162
|
path: _path,
|
|
@@ -1037,13 +1168,13 @@ var AntDValueSelector = ({
|
|
|
1037
1168
|
schema: _schema,
|
|
1038
1169
|
...extraProps
|
|
1039
1170
|
}) => {
|
|
1040
|
-
const { onChange, val } = (0,
|
|
1171
|
+
const { onChange, val } = (0, import_react_querybuilder3.useValueSelector)({ handleOnChange, listsAsArrays, multiple, value });
|
|
1041
1172
|
const modeObj = multiple ? { mode: "multiple" } : {};
|
|
1042
|
-
return /* @__PURE__ */
|
|
1043
|
-
|
|
1173
|
+
return /* @__PURE__ */ React6.createElement("span", { title, className }, /* @__PURE__ */ React6.createElement(
|
|
1174
|
+
import_antd5.Select,
|
|
1044
1175
|
{
|
|
1045
1176
|
...modeObj,
|
|
1046
|
-
|
|
1177
|
+
popupMatchSelectWidth: false,
|
|
1047
1178
|
disabled,
|
|
1048
1179
|
value: val,
|
|
1049
1180
|
onChange,
|
|
@@ -1055,7 +1186,7 @@ var AntDValueSelector = ({
|
|
|
1055
1186
|
AntDValueSelector.displayName = "AntDValueSelector";
|
|
1056
1187
|
|
|
1057
1188
|
// src/AntDValueEditor.tsx
|
|
1058
|
-
var DatePicker =
|
|
1189
|
+
var DatePicker = import_antd6.DatePicker.generatePicker(import_dayjs2.default);
|
|
1059
1190
|
var AntDValueEditor = ({
|
|
1060
1191
|
fieldData,
|
|
1061
1192
|
operator,
|
|
@@ -1075,7 +1206,7 @@ var AntDValueEditor = ({
|
|
|
1075
1206
|
selectorComponent: SelectorComponent = AntDValueSelector,
|
|
1076
1207
|
...props
|
|
1077
1208
|
}) => {
|
|
1078
|
-
const { valueAsArray, multiValueHandler } = (0,
|
|
1209
|
+
const { valueAsArray, multiValueHandler } = (0, import_react_querybuilder4.useValueEditor)({
|
|
1079
1210
|
handleOnChange,
|
|
1080
1211
|
inputType,
|
|
1081
1212
|
operator,
|
|
@@ -1095,51 +1226,51 @@ var AntDValueEditor = ({
|
|
|
1095
1226
|
const editors = ["from", "to"].map((key, i) => {
|
|
1096
1227
|
if (type === "text") {
|
|
1097
1228
|
if (inputTypeCoerced === "time") {
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
|
|
1229
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1230
|
+
import_antd6.TimePicker,
|
|
1100
1231
|
{
|
|
1101
1232
|
key,
|
|
1102
1233
|
value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
|
|
1103
|
-
className:
|
|
1234
|
+
className: import_react_querybuilder4.standardClassnames.valueListItem,
|
|
1104
1235
|
disabled,
|
|
1105
1236
|
placeholder: placeHolderText,
|
|
1106
1237
|
onChange: (d) => multiValueHandler(d?.format("HH:mm:ss") ?? "", i)
|
|
1107
1238
|
}
|
|
1108
1239
|
);
|
|
1109
1240
|
}
|
|
1110
|
-
return /* @__PURE__ */
|
|
1111
|
-
|
|
1241
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1242
|
+
import_antd6.Input,
|
|
1112
1243
|
{
|
|
1113
1244
|
key,
|
|
1114
1245
|
type: inputTypeCoerced,
|
|
1115
1246
|
value: valueAsArray[i] ?? "",
|
|
1116
|
-
className:
|
|
1247
|
+
className: import_react_querybuilder4.standardClassnames.valueListItem,
|
|
1117
1248
|
disabled,
|
|
1118
1249
|
placeholder: placeHolderText,
|
|
1119
1250
|
onChange: (e) => multiValueHandler(e.target.value, i)
|
|
1120
1251
|
}
|
|
1121
1252
|
);
|
|
1122
1253
|
}
|
|
1123
|
-
return /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1124
1255
|
SelectorComponent,
|
|
1125
1256
|
{
|
|
1126
1257
|
...props,
|
|
1127
1258
|
key,
|
|
1128
|
-
className:
|
|
1259
|
+
className: import_react_querybuilder4.standardClassnames.valueListItem,
|
|
1129
1260
|
handleOnChange: (v) => multiValueHandler(v, i),
|
|
1130
1261
|
disabled,
|
|
1131
|
-
value: valueAsArray[i] ?? (0,
|
|
1262
|
+
value: valueAsArray[i] ?? (0, import_react_querybuilder4.getFirstOption)(values),
|
|
1132
1263
|
options: values,
|
|
1133
1264
|
listsAsArrays
|
|
1134
1265
|
}
|
|
1135
1266
|
);
|
|
1136
1267
|
});
|
|
1137
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ React7.createElement("span", { "data-testid": testID, className, title }, editors[0], separator, editors[1]);
|
|
1138
1269
|
}
|
|
1139
1270
|
switch (type) {
|
|
1140
1271
|
case "select":
|
|
1141
1272
|
case "multiselect":
|
|
1142
|
-
return /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1143
1274
|
SelectorComponent,
|
|
1144
1275
|
{
|
|
1145
1276
|
...props,
|
|
@@ -1154,8 +1285,8 @@ var AntDValueEditor = ({
|
|
|
1154
1285
|
}
|
|
1155
1286
|
);
|
|
1156
1287
|
case "textarea":
|
|
1157
|
-
return /* @__PURE__ */
|
|
1158
|
-
|
|
1288
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1289
|
+
import_antd6.Input.TextArea,
|
|
1159
1290
|
{
|
|
1160
1291
|
value,
|
|
1161
1292
|
title,
|
|
@@ -1166,8 +1297,8 @@ var AntDValueEditor = ({
|
|
|
1166
1297
|
}
|
|
1167
1298
|
);
|
|
1168
1299
|
case "switch":
|
|
1169
|
-
return /* @__PURE__ */
|
|
1170
|
-
|
|
1300
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1301
|
+
import_antd6.Switch,
|
|
1171
1302
|
{
|
|
1172
1303
|
checked: !!value,
|
|
1173
1304
|
title,
|
|
@@ -1177,8 +1308,8 @@ var AntDValueEditor = ({
|
|
|
1177
1308
|
}
|
|
1178
1309
|
);
|
|
1179
1310
|
case "checkbox":
|
|
1180
|
-
return /* @__PURE__ */
|
|
1181
|
-
|
|
1311
|
+
return /* @__PURE__ */ React7.createElement("span", { title, className }, /* @__PURE__ */ React7.createElement(
|
|
1312
|
+
import_antd6.Checkbox,
|
|
1182
1313
|
{
|
|
1183
1314
|
type: "checkbox",
|
|
1184
1315
|
disabled,
|
|
@@ -1187,8 +1318,8 @@ var AntDValueEditor = ({
|
|
|
1187
1318
|
}
|
|
1188
1319
|
));
|
|
1189
1320
|
case "radio":
|
|
1190
|
-
return /* @__PURE__ */
|
|
1191
|
-
|
|
1321
|
+
return /* @__PURE__ */ React7.createElement("span", { className, title }, values.map((v) => /* @__PURE__ */ React7.createElement(
|
|
1322
|
+
import_antd6.Radio,
|
|
1192
1323
|
{
|
|
1193
1324
|
key: v.name,
|
|
1194
1325
|
value: v.name,
|
|
@@ -1202,10 +1333,10 @@ var AntDValueEditor = ({
|
|
|
1202
1333
|
switch (inputTypeCoerced) {
|
|
1203
1334
|
case "date":
|
|
1204
1335
|
case "datetime-local":
|
|
1205
|
-
return operator === "between" || operator === "notBetween" ? /* @__PURE__ */
|
|
1336
|
+
return operator === "between" || operator === "notBetween" ? /* @__PURE__ */ React7.createElement(
|
|
1206
1337
|
DatePicker.RangePicker,
|
|
1207
1338
|
{
|
|
1208
|
-
value: (0,
|
|
1339
|
+
value: (0, import_react_querybuilder4.toArray)(value)?.length >= 2 ? (0, import_react_querybuilder4.toArray)(value).map((v) => (0, import_dayjs.default)(v)) : void 0,
|
|
1209
1340
|
showTime: inputTypeCoerced === "datetime-local",
|
|
1210
1341
|
className,
|
|
1211
1342
|
disabled,
|
|
@@ -1219,7 +1350,7 @@ var AntDValueEditor = ({
|
|
|
1219
1350
|
}
|
|
1220
1351
|
)
|
|
1221
1352
|
}
|
|
1222
|
-
) : /* @__PURE__ */
|
|
1353
|
+
) : /* @__PURE__ */ React7.createElement(
|
|
1223
1354
|
DatePicker,
|
|
1224
1355
|
{
|
|
1225
1356
|
value: value ? (0, import_dayjs.default)(value) : null,
|
|
@@ -1231,8 +1362,8 @@ var AntDValueEditor = ({
|
|
|
1231
1362
|
}
|
|
1232
1363
|
);
|
|
1233
1364
|
case "time":
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
|
|
1365
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1366
|
+
import_antd6.TimePicker,
|
|
1236
1367
|
{
|
|
1237
1368
|
value: value ? (0, import_dayjs.default)(value, "HH:mm:ss") : null,
|
|
1238
1369
|
className,
|
|
@@ -1242,8 +1373,8 @@ var AntDValueEditor = ({
|
|
|
1242
1373
|
}
|
|
1243
1374
|
);
|
|
1244
1375
|
}
|
|
1245
|
-
return /* @__PURE__ */
|
|
1246
|
-
|
|
1376
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1377
|
+
import_antd6.Input,
|
|
1247
1378
|
{
|
|
1248
1379
|
type: inputTypeCoerced,
|
|
1249
1380
|
value,
|
|
@@ -1273,9 +1404,10 @@ var antdControlElements = {
|
|
|
1273
1404
|
removeRuleAction: AntDActionElement,
|
|
1274
1405
|
valueEditor: AntDValueEditor,
|
|
1275
1406
|
dragHandle: AntDDragHandle,
|
|
1276
|
-
valueSourceSelector: AntDValueSelector
|
|
1407
|
+
valueSourceSelector: AntDValueSelector,
|
|
1408
|
+
shiftActions: AntDShiftActions
|
|
1277
1409
|
};
|
|
1278
|
-
var QueryBuilderAntD = (0,
|
|
1410
|
+
var QueryBuilderAntD = (0, import_react_querybuilder5.getCompatContextProvider)({
|
|
1279
1411
|
key: "antd",
|
|
1280
1412
|
controlElements: antdControlElements
|
|
1281
1413
|
});
|
|
@@ -1284,6 +1416,7 @@ var QueryBuilderAntD = (0, import_react_querybuilder4.getCompatContextProvider)(
|
|
|
1284
1416
|
AntDActionElement,
|
|
1285
1417
|
AntDDragHandle,
|
|
1286
1418
|
AntDNotToggle,
|
|
1419
|
+
AntDShiftActions,
|
|
1287
1420
|
AntDValueEditor,
|
|
1288
1421
|
AntDValueSelector,
|
|
1289
1422
|
QueryBuilderAntD,
|