@react-querybuilder/antd 6.5.2 → 6.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/react-querybuilder_antd.cjs.development.js +177 -84
- package/dist/cjs/react-querybuilder_antd.cjs.development.js.map +1 -1
- 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.legacy-esm.js +182 -94
- package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_antd.mjs +179 -91
- package/dist/react-querybuilder_antd.mjs.map +1 -1
- package/dist/react-querybuilder_antd.production.mjs +1 -1
- package/dist/react-querybuilder_antd.production.mjs.map +1 -1
- package/package.json +13 -13
|
@@ -61,7 +61,7 @@ var require_dayjs_min = __commonJS({
|
|
|
61
61
|
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
62
62
|
}(exports, function() {
|
|
63
63
|
"use strict";
|
|
64
|
-
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week",
|
|
64
|
+
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) {
|
|
65
65
|
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
66
66
|
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
67
67
|
} }, m = function(t2, e2, n2) {
|
|
@@ -73,19 +73,19 @@ var require_dayjs_min = __commonJS({
|
|
|
73
73
|
}, m: function t2(e2, n2) {
|
|
74
74
|
if (e2.date() < n2.date())
|
|
75
75
|
return -t2(n2, e2);
|
|
76
|
-
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2,
|
|
76
|
+
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);
|
|
77
77
|
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
78
78
|
}, a: function(t2) {
|
|
79
79
|
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
80
80
|
}, p: function(t2) {
|
|
81
|
-
return { M:
|
|
81
|
+
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$/, "");
|
|
82
82
|
}, u: function(t2) {
|
|
83
83
|
return void 0 === t2;
|
|
84
84
|
} }, g = "en", D = {};
|
|
85
85
|
D[g] = M;
|
|
86
|
-
var p = function(t2) {
|
|
87
|
-
return t2 instanceof _;
|
|
88
|
-
},
|
|
86
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
87
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
88
|
+
}, w = function t2(e2, n2, r2) {
|
|
89
89
|
var i2;
|
|
90
90
|
if (!e2)
|
|
91
91
|
return g;
|
|
@@ -100,18 +100,18 @@ var require_dayjs_min = __commonJS({
|
|
|
100
100
|
D[a2] = e2, i2 = a2;
|
|
101
101
|
}
|
|
102
102
|
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
103
|
-
},
|
|
104
|
-
if (
|
|
103
|
+
}, O = function(t2, e2) {
|
|
104
|
+
if (S(t2))
|
|
105
105
|
return t2.clone();
|
|
106
106
|
var n2 = "object" == typeof e2 ? e2 : {};
|
|
107
107
|
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
return
|
|
108
|
+
}, b = v;
|
|
109
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
110
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
111
111
|
};
|
|
112
112
|
var _ = function() {
|
|
113
113
|
function M2(t2) {
|
|
114
|
-
this.$L =
|
|
114
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
115
115
|
}
|
|
116
116
|
var m2 = M2.prototype;
|
|
117
117
|
return m2.parse = function(t2) {
|
|
@@ -119,7 +119,7 @@ var require_dayjs_min = __commonJS({
|
|
|
119
119
|
var e2 = t3.date, n2 = t3.utc;
|
|
120
120
|
if (null === e2)
|
|
121
121
|
return /* @__PURE__ */ new Date(NaN);
|
|
122
|
-
if (
|
|
122
|
+
if (b.u(e2))
|
|
123
123
|
return /* @__PURE__ */ new Date();
|
|
124
124
|
if (e2 instanceof Date)
|
|
125
125
|
return new Date(e2);
|
|
@@ -131,38 +131,38 @@ var require_dayjs_min = __commonJS({
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
return new Date(e2);
|
|
134
|
-
}(t2), this
|
|
134
|
+
}(t2), this.init();
|
|
135
135
|
}, m2.init = function() {
|
|
136
136
|
var t2 = this.$d;
|
|
137
137
|
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();
|
|
138
138
|
}, m2.$utils = function() {
|
|
139
|
-
return
|
|
139
|
+
return b;
|
|
140
140
|
}, m2.isValid = function() {
|
|
141
141
|
return !(this.$d.toString() === l);
|
|
142
142
|
}, m2.isSame = function(t2, e2) {
|
|
143
|
-
var n2 =
|
|
143
|
+
var n2 = O(t2);
|
|
144
144
|
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
145
145
|
}, m2.isAfter = function(t2, e2) {
|
|
146
|
-
return
|
|
146
|
+
return O(t2) < this.startOf(e2);
|
|
147
147
|
}, m2.isBefore = function(t2, e2) {
|
|
148
|
-
return this.endOf(e2) <
|
|
148
|
+
return this.endOf(e2) < O(t2);
|
|
149
149
|
}, m2.$g = function(t2, e2, n2) {
|
|
150
|
-
return
|
|
150
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
151
151
|
}, m2.unix = function() {
|
|
152
152
|
return Math.floor(this.valueOf() / 1e3);
|
|
153
153
|
}, m2.valueOf = function() {
|
|
154
154
|
return this.$d.getTime();
|
|
155
155
|
}, m2.startOf = function(t2, e2) {
|
|
156
|
-
var n2 = this, r2 = !!
|
|
157
|
-
var i2 =
|
|
156
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
157
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
158
158
|
return r2 ? i2 : i2.endOf(a);
|
|
159
159
|
}, $2 = function(t3, e3) {
|
|
160
|
-
return
|
|
160
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
161
161
|
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
162
|
-
switch (
|
|
163
|
-
case
|
|
162
|
+
switch (f2) {
|
|
163
|
+
case h:
|
|
164
164
|
return r2 ? l2(1, 0) : l2(31, 11);
|
|
165
|
-
case
|
|
165
|
+
case c:
|
|
166
166
|
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
167
167
|
case o:
|
|
168
168
|
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
@@ -182,8 +182,8 @@ var require_dayjs_min = __commonJS({
|
|
|
182
182
|
}, m2.endOf = function(t2) {
|
|
183
183
|
return this.startOf(t2, false);
|
|
184
184
|
}, m2.$set = function(t2, e2) {
|
|
185
|
-
var n2, o2 =
|
|
186
|
-
if (o2 ===
|
|
185
|
+
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;
|
|
186
|
+
if (o2 === c || o2 === h) {
|
|
187
187
|
var y2 = this.clone().set(d, 1);
|
|
188
188
|
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
189
189
|
} else
|
|
@@ -192,57 +192,139 @@ var require_dayjs_min = __commonJS({
|
|
|
192
192
|
}, m2.set = function(t2, e2) {
|
|
193
193
|
return this.clone().$set(t2, e2);
|
|
194
194
|
}, m2.get = function(t2) {
|
|
195
|
-
return this[
|
|
196
|
-
}, m2.add = function(r2,
|
|
195
|
+
return this[b.p(t2)]();
|
|
196
|
+
}, m2.add = function(r2, f2) {
|
|
197
197
|
var d2, l2 = this;
|
|
198
198
|
r2 = Number(r2);
|
|
199
|
-
var $2 =
|
|
200
|
-
var e2 =
|
|
201
|
-
return
|
|
199
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
200
|
+
var e2 = O(l2);
|
|
201
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
202
202
|
};
|
|
203
|
-
if ($2 === f)
|
|
204
|
-
return this.set(f, this.$M + r2);
|
|
205
203
|
if ($2 === c)
|
|
206
|
-
return this.set(c, this.$
|
|
204
|
+
return this.set(c, this.$M + r2);
|
|
205
|
+
if ($2 === h)
|
|
206
|
+
return this.set(h, this.$y + r2);
|
|
207
207
|
if ($2 === a)
|
|
208
208
|
return y2(1);
|
|
209
209
|
if ($2 === o)
|
|
210
210
|
return y2(7);
|
|
211
211
|
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
212
|
-
return
|
|
212
|
+
return b.w(m3, this);
|
|
213
213
|
}, m2.subtract = function(t2, e2) {
|
|
214
214
|
return this.add(-1 * t2, e2);
|
|
215
215
|
}, m2.format = function(t2) {
|
|
216
216
|
var e2 = this, n2 = this.$locale();
|
|
217
217
|
if (!this.isValid())
|
|
218
218
|
return n2.invalidDate || l;
|
|
219
|
-
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 =
|
|
219
|
+
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) {
|
|
220
220
|
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
221
|
-
},
|
|
222
|
-
return
|
|
223
|
-
},
|
|
221
|
+
}, d2 = function(t3) {
|
|
222
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
223
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
224
224
|
var r3 = t3 < 12 ? "AM" : "PM";
|
|
225
225
|
return n3 ? r3.toLowerCase() : r3;
|
|
226
|
-
}
|
|
227
|
-
return r2.replace(y, function(t3,
|
|
228
|
-
return
|
|
226
|
+
};
|
|
227
|
+
return r2.replace(y, function(t3, r3) {
|
|
228
|
+
return r3 || function(t4) {
|
|
229
|
+
switch (t4) {
|
|
230
|
+
case "YY":
|
|
231
|
+
return String(e2.$y).slice(-2);
|
|
232
|
+
case "YYYY":
|
|
233
|
+
return b.s(e2.$y, 4, "0");
|
|
234
|
+
case "M":
|
|
235
|
+
return a2 + 1;
|
|
236
|
+
case "MM":
|
|
237
|
+
return b.s(a2 + 1, 2, "0");
|
|
238
|
+
case "MMM":
|
|
239
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
240
|
+
case "MMMM":
|
|
241
|
+
return h2(c2, a2);
|
|
242
|
+
case "D":
|
|
243
|
+
return e2.$D;
|
|
244
|
+
case "DD":
|
|
245
|
+
return b.s(e2.$D, 2, "0");
|
|
246
|
+
case "d":
|
|
247
|
+
return String(e2.$W);
|
|
248
|
+
case "dd":
|
|
249
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
250
|
+
case "ddd":
|
|
251
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
252
|
+
case "dddd":
|
|
253
|
+
return o2[e2.$W];
|
|
254
|
+
case "H":
|
|
255
|
+
return String(s2);
|
|
256
|
+
case "HH":
|
|
257
|
+
return b.s(s2, 2, "0");
|
|
258
|
+
case "h":
|
|
259
|
+
return d2(1);
|
|
260
|
+
case "hh":
|
|
261
|
+
return d2(2);
|
|
262
|
+
case "a":
|
|
263
|
+
return $2(s2, u2, true);
|
|
264
|
+
case "A":
|
|
265
|
+
return $2(s2, u2, false);
|
|
266
|
+
case "m":
|
|
267
|
+
return String(u2);
|
|
268
|
+
case "mm":
|
|
269
|
+
return b.s(u2, 2, "0");
|
|
270
|
+
case "s":
|
|
271
|
+
return String(e2.$s);
|
|
272
|
+
case "ss":
|
|
273
|
+
return b.s(e2.$s, 2, "0");
|
|
274
|
+
case "SSS":
|
|
275
|
+
return b.s(e2.$ms, 3, "0");
|
|
276
|
+
case "Z":
|
|
277
|
+
return i2;
|
|
278
|
+
}
|
|
279
|
+
return null;
|
|
280
|
+
}(t3) || i2.replace(":", "");
|
|
229
281
|
});
|
|
230
282
|
}, m2.utcOffset = function() {
|
|
231
283
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
232
284
|
}, m2.diff = function(r2, d2, l2) {
|
|
233
|
-
var $2, y2 =
|
|
234
|
-
|
|
285
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
286
|
+
return b.m(y2, m3);
|
|
287
|
+
};
|
|
288
|
+
switch (M3) {
|
|
289
|
+
case h:
|
|
290
|
+
$2 = D2() / 12;
|
|
291
|
+
break;
|
|
292
|
+
case c:
|
|
293
|
+
$2 = D2();
|
|
294
|
+
break;
|
|
295
|
+
case f:
|
|
296
|
+
$2 = D2() / 3;
|
|
297
|
+
break;
|
|
298
|
+
case o:
|
|
299
|
+
$2 = (g2 - v2) / 6048e5;
|
|
300
|
+
break;
|
|
301
|
+
case a:
|
|
302
|
+
$2 = (g2 - v2) / 864e5;
|
|
303
|
+
break;
|
|
304
|
+
case u:
|
|
305
|
+
$2 = g2 / n;
|
|
306
|
+
break;
|
|
307
|
+
case s:
|
|
308
|
+
$2 = g2 / e;
|
|
309
|
+
break;
|
|
310
|
+
case i:
|
|
311
|
+
$2 = g2 / t;
|
|
312
|
+
break;
|
|
313
|
+
default:
|
|
314
|
+
$2 = g2;
|
|
315
|
+
}
|
|
316
|
+
return l2 ? $2 : b.a($2);
|
|
235
317
|
}, m2.daysInMonth = function() {
|
|
236
|
-
return this.endOf(
|
|
318
|
+
return this.endOf(c).$D;
|
|
237
319
|
}, m2.$locale = function() {
|
|
238
320
|
return D[this.$L];
|
|
239
321
|
}, m2.locale = function(t2, e2) {
|
|
240
322
|
if (!t2)
|
|
241
323
|
return this.$L;
|
|
242
|
-
var n2 = this.clone(), r2 =
|
|
324
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
243
325
|
return r2 && (n2.$L = r2), n2;
|
|
244
326
|
}, m2.clone = function() {
|
|
245
|
-
return
|
|
327
|
+
return b.w(this.$d, this);
|
|
246
328
|
}, m2.toDate = function() {
|
|
247
329
|
return new Date(this.valueOf());
|
|
248
330
|
}, m2.toJSON = function() {
|
|
@@ -252,16 +334,16 @@ var require_dayjs_min = __commonJS({
|
|
|
252
334
|
}, m2.toString = function() {
|
|
253
335
|
return this.$d.toUTCString();
|
|
254
336
|
}, M2;
|
|
255
|
-
}(),
|
|
256
|
-
return
|
|
257
|
-
|
|
337
|
+
}(), k = _.prototype;
|
|
338
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
339
|
+
k[t2[1]] = function(e2) {
|
|
258
340
|
return this.$g(e2, t2[0], t2[1]);
|
|
259
341
|
};
|
|
260
|
-
}),
|
|
261
|
-
return t2.$i || (t2(e2, _,
|
|
262
|
-
},
|
|
263
|
-
return
|
|
264
|
-
},
|
|
342
|
+
}), O.extend = function(t2, e2) {
|
|
343
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
344
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
345
|
+
return O(1e3 * t2);
|
|
346
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
265
347
|
});
|
|
266
348
|
}
|
|
267
349
|
});
|
|
@@ -906,8 +988,7 @@ var require_dayjs = __commonJS({
|
|
|
906
988
|
}
|
|
907
989
|
}
|
|
908
990
|
};
|
|
909
|
-
var _default = generateConfig;
|
|
910
|
-
exports.default = _default;
|
|
991
|
+
var _default = exports.default = generateConfig;
|
|
911
992
|
}
|
|
912
993
|
});
|
|
913
994
|
|
|
@@ -1051,14 +1132,10 @@ AntDNotToggle.displayName = "AntDNotToggle";
|
|
|
1051
1132
|
// src/AntDValueEditor.tsx
|
|
1052
1133
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
1053
1134
|
var import_dayjs2 = __toESM(require_dayjs());
|
|
1054
|
-
import {
|
|
1135
|
+
import { Checkbox, Input, Radio, Switch as Switch2 } from "antd";
|
|
1136
|
+
import generatePicker from "antd/es/date-picker/generatePicker/index.js";
|
|
1055
1137
|
import * as React6 from "react";
|
|
1056
|
-
import {
|
|
1057
|
-
getFirstOption,
|
|
1058
|
-
standardClassnames,
|
|
1059
|
-
toArray,
|
|
1060
|
-
useValueEditor
|
|
1061
|
-
} from "react-querybuilder";
|
|
1138
|
+
import { getFirstOption, joinWith, standardClassnames, useValueEditor } from "react-querybuilder";
|
|
1062
1139
|
|
|
1063
1140
|
// src/AntDValueSelector.tsx
|
|
1064
1141
|
import { Select as Select2 } from "antd";
|
|
@@ -1122,7 +1199,7 @@ var AntDValueSelector = (_a) => {
|
|
|
1122
1199
|
return /* @__PURE__ */ React5.createElement("span", { title, className }, /* @__PURE__ */ React5.createElement(
|
|
1123
1200
|
Select2,
|
|
1124
1201
|
__spreadValues(__spreadProps(__spreadValues({}, modeObj), {
|
|
1125
|
-
|
|
1202
|
+
popupMatchSelectWidth: false,
|
|
1126
1203
|
disabled,
|
|
1127
1204
|
value: val,
|
|
1128
1205
|
onChange
|
|
@@ -1133,7 +1210,7 @@ var AntDValueSelector = (_a) => {
|
|
|
1133
1210
|
AntDValueSelector.displayName = "AntDValueSelector";
|
|
1134
1211
|
|
|
1135
1212
|
// src/AntDValueEditor.tsx
|
|
1136
|
-
var DatePicker =
|
|
1213
|
+
var DatePicker = generatePicker(import_dayjs2.default);
|
|
1137
1214
|
var AntDValueEditor = (_a) => {
|
|
1138
1215
|
var _b = _a, {
|
|
1139
1216
|
fieldData,
|
|
@@ -1170,7 +1247,7 @@ var AntDValueEditor = (_a) => {
|
|
|
1170
1247
|
"testID",
|
|
1171
1248
|
"selectorComponent"
|
|
1172
1249
|
]);
|
|
1173
|
-
var _a2
|
|
1250
|
+
var _a2;
|
|
1174
1251
|
const { valueAsArray, multiValueHandler } = useValueEditor({
|
|
1175
1252
|
handleOnChange,
|
|
1176
1253
|
inputType,
|
|
@@ -1189,11 +1266,11 @@ var AntDValueEditor = (_a) => {
|
|
|
1189
1266
|
if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") && // Date ranges are handled differently in AntD--see below
|
|
1190
1267
|
inputTypeCoerced !== "date" && inputTypeCoerced !== "datetime-local") {
|
|
1191
1268
|
const editors = ["from", "to"].map((key, i) => {
|
|
1192
|
-
var _a3,
|
|
1269
|
+
var _a3, _b2;
|
|
1193
1270
|
if (type === "text") {
|
|
1194
1271
|
if (inputTypeCoerced === "time") {
|
|
1195
1272
|
return /* @__PURE__ */ React6.createElement(
|
|
1196
|
-
TimePicker,
|
|
1273
|
+
DatePicker.TimePicker,
|
|
1197
1274
|
{
|
|
1198
1275
|
key,
|
|
1199
1276
|
value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
|
|
@@ -1227,7 +1304,7 @@ var AntDValueEditor = (_a) => {
|
|
|
1227
1304
|
className: standardClassnames.valueListItem,
|
|
1228
1305
|
handleOnChange: (v) => multiValueHandler(v, i),
|
|
1229
1306
|
disabled,
|
|
1230
|
-
value: (
|
|
1307
|
+
value: (_b2 = valueAsArray[i]) != null ? _b2 : getFirstOption(values),
|
|
1231
1308
|
options: values,
|
|
1232
1309
|
listsAsArrays
|
|
1233
1310
|
})
|
|
@@ -1299,28 +1376,36 @@ var AntDValueEditor = (_a) => {
|
|
|
1299
1376
|
}
|
|
1300
1377
|
switch (inputTypeCoerced) {
|
|
1301
1378
|
case "date":
|
|
1302
|
-
case "datetime-local":
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
(
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1379
|
+
case "datetime-local": {
|
|
1380
|
+
if (operator === "between" || operator === "notBetween") {
|
|
1381
|
+
const dayjsArray = valueAsArray.slice(0, 2).map(import_dayjs.default);
|
|
1382
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1383
|
+
DatePicker.RangePicker,
|
|
1384
|
+
{
|
|
1385
|
+
value: dayjsArray.every((d) => d.isValid()) ? dayjsArray : void 0,
|
|
1386
|
+
showTime: inputTypeCoerced === "datetime-local",
|
|
1387
|
+
className,
|
|
1388
|
+
disabled,
|
|
1389
|
+
placeholder: [placeHolderText, placeHolderText],
|
|
1390
|
+
onChange: (
|
|
1391
|
+
/* istanbul ignore next */
|
|
1392
|
+
(dates) => {
|
|
1393
|
+
const timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
|
|
1394
|
+
const format = `YYYY-MM-DD${timeFormat}`;
|
|
1395
|
+
const dateArray = dates == null ? void 0 : dates.map((d) => (d == null ? void 0 : d.isValid()) ? d.format(format) : void 0);
|
|
1396
|
+
handleOnChange(
|
|
1397
|
+
dateArray ? listsAsArrays ? dateArray : joinWith(dateArray, ",") : dates
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
)
|
|
1401
|
+
}
|
|
1402
|
+
);
|
|
1403
|
+
}
|
|
1404
|
+
const dateValue = (0, import_dayjs.default)(value);
|
|
1405
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1321
1406
|
DatePicker,
|
|
1322
1407
|
{
|
|
1323
|
-
value:
|
|
1408
|
+
value: dateValue.isValid() ? dateValue : void 0,
|
|
1324
1409
|
showTime: inputTypeCoerced === "datetime-local",
|
|
1325
1410
|
className,
|
|
1326
1411
|
disabled,
|
|
@@ -1328,11 +1413,13 @@ var AntDValueEditor = (_a) => {
|
|
|
1328
1413
|
onChange: (_d, dateString) => handleOnChange(dateString)
|
|
1329
1414
|
}
|
|
1330
1415
|
);
|
|
1331
|
-
|
|
1416
|
+
}
|
|
1417
|
+
case "time": {
|
|
1418
|
+
const dateValue = (0, import_dayjs.default)(value, "HH:mm:ss");
|
|
1332
1419
|
return /* @__PURE__ */ React6.createElement(
|
|
1333
|
-
TimePicker,
|
|
1420
|
+
DatePicker.TimePicker,
|
|
1334
1421
|
{
|
|
1335
|
-
value:
|
|
1422
|
+
value: dateValue.isValid() ? dateValue : void 0,
|
|
1336
1423
|
className,
|
|
1337
1424
|
disabled,
|
|
1338
1425
|
placeholder: placeHolderText,
|
|
@@ -1342,6 +1429,7 @@ var AntDValueEditor = (_a) => {
|
|
|
1342
1429
|
}
|
|
1343
1430
|
}
|
|
1344
1431
|
);
|
|
1432
|
+
}
|
|
1345
1433
|
}
|
|
1346
1434
|
return /* @__PURE__ */ React6.createElement(
|
|
1347
1435
|
Input,
|