@react-querybuilder/antd 6.5.3 → 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
|
@@ -32,7 +32,7 @@ var require_dayjs_min = __commonJS({
|
|
|
32
32
|
"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();
|
|
33
33
|
}(exports, function() {
|
|
34
34
|
"use strict";
|
|
35
|
-
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week",
|
|
35
|
+
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) {
|
|
36
36
|
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
37
37
|
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
38
38
|
} }, m = function(t2, e2, n2) {
|
|
@@ -44,19 +44,19 @@ var require_dayjs_min = __commonJS({
|
|
|
44
44
|
}, m: function t2(e2, n2) {
|
|
45
45
|
if (e2.date() < n2.date())
|
|
46
46
|
return -t2(n2, e2);
|
|
47
|
-
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2,
|
|
47
|
+
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);
|
|
48
48
|
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
49
49
|
}, a: function(t2) {
|
|
50
50
|
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
51
51
|
}, p: function(t2) {
|
|
52
|
-
return { M:
|
|
52
|
+
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$/, "");
|
|
53
53
|
}, u: function(t2) {
|
|
54
54
|
return void 0 === t2;
|
|
55
55
|
} }, g = "en", D = {};
|
|
56
56
|
D[g] = M;
|
|
57
|
-
var p = function(t2) {
|
|
58
|
-
return t2 instanceof _;
|
|
59
|
-
},
|
|
57
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
58
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
59
|
+
}, w = function t2(e2, n2, r2) {
|
|
60
60
|
var i2;
|
|
61
61
|
if (!e2)
|
|
62
62
|
return g;
|
|
@@ -71,18 +71,18 @@ var require_dayjs_min = __commonJS({
|
|
|
71
71
|
D[a2] = e2, i2 = a2;
|
|
72
72
|
}
|
|
73
73
|
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
74
|
-
},
|
|
75
|
-
if (
|
|
74
|
+
}, O = function(t2, e2) {
|
|
75
|
+
if (S(t2))
|
|
76
76
|
return t2.clone();
|
|
77
77
|
var n2 = "object" == typeof e2 ? e2 : {};
|
|
78
78
|
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
return
|
|
79
|
+
}, b = v;
|
|
80
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
81
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
82
82
|
};
|
|
83
83
|
var _ = function() {
|
|
84
84
|
function M2(t2) {
|
|
85
|
-
this.$L =
|
|
85
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
86
86
|
}
|
|
87
87
|
var m2 = M2.prototype;
|
|
88
88
|
return m2.parse = function(t2) {
|
|
@@ -90,7 +90,7 @@ var require_dayjs_min = __commonJS({
|
|
|
90
90
|
var e2 = t3.date, n2 = t3.utc;
|
|
91
91
|
if (null === e2)
|
|
92
92
|
return /* @__PURE__ */ new Date(NaN);
|
|
93
|
-
if (
|
|
93
|
+
if (b.u(e2))
|
|
94
94
|
return /* @__PURE__ */ new Date();
|
|
95
95
|
if (e2 instanceof Date)
|
|
96
96
|
return new Date(e2);
|
|
@@ -102,38 +102,38 @@ var require_dayjs_min = __commonJS({
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return new Date(e2);
|
|
105
|
-
}(t2), this
|
|
105
|
+
}(t2), this.init();
|
|
106
106
|
}, m2.init = function() {
|
|
107
107
|
var t2 = this.$d;
|
|
108
108
|
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();
|
|
109
109
|
}, m2.$utils = function() {
|
|
110
|
-
return
|
|
110
|
+
return b;
|
|
111
111
|
}, m2.isValid = function() {
|
|
112
112
|
return !(this.$d.toString() === l);
|
|
113
113
|
}, m2.isSame = function(t2, e2) {
|
|
114
|
-
var n2 =
|
|
114
|
+
var n2 = O(t2);
|
|
115
115
|
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
116
116
|
}, m2.isAfter = function(t2, e2) {
|
|
117
|
-
return
|
|
117
|
+
return O(t2) < this.startOf(e2);
|
|
118
118
|
}, m2.isBefore = function(t2, e2) {
|
|
119
|
-
return this.endOf(e2) <
|
|
119
|
+
return this.endOf(e2) < O(t2);
|
|
120
120
|
}, m2.$g = function(t2, e2, n2) {
|
|
121
|
-
return
|
|
121
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
122
122
|
}, m2.unix = function() {
|
|
123
123
|
return Math.floor(this.valueOf() / 1e3);
|
|
124
124
|
}, m2.valueOf = function() {
|
|
125
125
|
return this.$d.getTime();
|
|
126
126
|
}, m2.startOf = function(t2, e2) {
|
|
127
|
-
var n2 = this, r2 = !!
|
|
128
|
-
var i2 =
|
|
127
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
128
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
129
129
|
return r2 ? i2 : i2.endOf(a);
|
|
130
130
|
}, $2 = function(t3, e3) {
|
|
131
|
-
return
|
|
131
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
132
132
|
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
133
|
-
switch (
|
|
134
|
-
case
|
|
133
|
+
switch (f2) {
|
|
134
|
+
case h:
|
|
135
135
|
return r2 ? l2(1, 0) : l2(31, 11);
|
|
136
|
-
case
|
|
136
|
+
case c:
|
|
137
137
|
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
138
138
|
case o:
|
|
139
139
|
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
@@ -153,8 +153,8 @@ var require_dayjs_min = __commonJS({
|
|
|
153
153
|
}, m2.endOf = function(t2) {
|
|
154
154
|
return this.startOf(t2, false);
|
|
155
155
|
}, m2.$set = function(t2, e2) {
|
|
156
|
-
var n2, o2 =
|
|
157
|
-
if (o2 ===
|
|
156
|
+
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;
|
|
157
|
+
if (o2 === c || o2 === h) {
|
|
158
158
|
var y2 = this.clone().set(d, 1);
|
|
159
159
|
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
160
160
|
} else
|
|
@@ -163,57 +163,139 @@ var require_dayjs_min = __commonJS({
|
|
|
163
163
|
}, m2.set = function(t2, e2) {
|
|
164
164
|
return this.clone().$set(t2, e2);
|
|
165
165
|
}, m2.get = function(t2) {
|
|
166
|
-
return this[
|
|
167
|
-
}, m2.add = function(r2,
|
|
166
|
+
return this[b.p(t2)]();
|
|
167
|
+
}, m2.add = function(r2, f2) {
|
|
168
168
|
var d2, l2 = this;
|
|
169
169
|
r2 = Number(r2);
|
|
170
|
-
var $2 =
|
|
171
|
-
var e2 =
|
|
172
|
-
return
|
|
170
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
171
|
+
var e2 = O(l2);
|
|
172
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
173
173
|
};
|
|
174
|
-
if ($2 === f)
|
|
175
|
-
return this.set(f, this.$M + r2);
|
|
176
174
|
if ($2 === c)
|
|
177
|
-
return this.set(c, this.$
|
|
175
|
+
return this.set(c, this.$M + r2);
|
|
176
|
+
if ($2 === h)
|
|
177
|
+
return this.set(h, this.$y + r2);
|
|
178
178
|
if ($2 === a)
|
|
179
179
|
return y2(1);
|
|
180
180
|
if ($2 === o)
|
|
181
181
|
return y2(7);
|
|
182
182
|
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
183
|
-
return
|
|
183
|
+
return b.w(m3, this);
|
|
184
184
|
}, m2.subtract = function(t2, e2) {
|
|
185
185
|
return this.add(-1 * t2, e2);
|
|
186
186
|
}, m2.format = function(t2) {
|
|
187
187
|
var e2 = this, n2 = this.$locale();
|
|
188
188
|
if (!this.isValid())
|
|
189
189
|
return n2.invalidDate || l;
|
|
190
|
-
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 =
|
|
190
|
+
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) {
|
|
191
191
|
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
192
|
-
},
|
|
193
|
-
return
|
|
194
|
-
},
|
|
192
|
+
}, d2 = function(t3) {
|
|
193
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
194
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
195
195
|
var r3 = t3 < 12 ? "AM" : "PM";
|
|
196
196
|
return n3 ? r3.toLowerCase() : r3;
|
|
197
|
-
}
|
|
198
|
-
return r2.replace(y, function(t3,
|
|
199
|
-
return
|
|
197
|
+
};
|
|
198
|
+
return r2.replace(y, function(t3, r3) {
|
|
199
|
+
return r3 || function(t4) {
|
|
200
|
+
switch (t4) {
|
|
201
|
+
case "YY":
|
|
202
|
+
return String(e2.$y).slice(-2);
|
|
203
|
+
case "YYYY":
|
|
204
|
+
return b.s(e2.$y, 4, "0");
|
|
205
|
+
case "M":
|
|
206
|
+
return a2 + 1;
|
|
207
|
+
case "MM":
|
|
208
|
+
return b.s(a2 + 1, 2, "0");
|
|
209
|
+
case "MMM":
|
|
210
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
211
|
+
case "MMMM":
|
|
212
|
+
return h2(c2, a2);
|
|
213
|
+
case "D":
|
|
214
|
+
return e2.$D;
|
|
215
|
+
case "DD":
|
|
216
|
+
return b.s(e2.$D, 2, "0");
|
|
217
|
+
case "d":
|
|
218
|
+
return String(e2.$W);
|
|
219
|
+
case "dd":
|
|
220
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
221
|
+
case "ddd":
|
|
222
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
223
|
+
case "dddd":
|
|
224
|
+
return o2[e2.$W];
|
|
225
|
+
case "H":
|
|
226
|
+
return String(s2);
|
|
227
|
+
case "HH":
|
|
228
|
+
return b.s(s2, 2, "0");
|
|
229
|
+
case "h":
|
|
230
|
+
return d2(1);
|
|
231
|
+
case "hh":
|
|
232
|
+
return d2(2);
|
|
233
|
+
case "a":
|
|
234
|
+
return $2(s2, u2, true);
|
|
235
|
+
case "A":
|
|
236
|
+
return $2(s2, u2, false);
|
|
237
|
+
case "m":
|
|
238
|
+
return String(u2);
|
|
239
|
+
case "mm":
|
|
240
|
+
return b.s(u2, 2, "0");
|
|
241
|
+
case "s":
|
|
242
|
+
return String(e2.$s);
|
|
243
|
+
case "ss":
|
|
244
|
+
return b.s(e2.$s, 2, "0");
|
|
245
|
+
case "SSS":
|
|
246
|
+
return b.s(e2.$ms, 3, "0");
|
|
247
|
+
case "Z":
|
|
248
|
+
return i2;
|
|
249
|
+
}
|
|
250
|
+
return null;
|
|
251
|
+
}(t3) || i2.replace(":", "");
|
|
200
252
|
});
|
|
201
253
|
}, m2.utcOffset = function() {
|
|
202
254
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
203
255
|
}, m2.diff = function(r2, d2, l2) {
|
|
204
|
-
var $2, y2 =
|
|
205
|
-
|
|
256
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
257
|
+
return b.m(y2, m3);
|
|
258
|
+
};
|
|
259
|
+
switch (M3) {
|
|
260
|
+
case h:
|
|
261
|
+
$2 = D2() / 12;
|
|
262
|
+
break;
|
|
263
|
+
case c:
|
|
264
|
+
$2 = D2();
|
|
265
|
+
break;
|
|
266
|
+
case f:
|
|
267
|
+
$2 = D2() / 3;
|
|
268
|
+
break;
|
|
269
|
+
case o:
|
|
270
|
+
$2 = (g2 - v2) / 6048e5;
|
|
271
|
+
break;
|
|
272
|
+
case a:
|
|
273
|
+
$2 = (g2 - v2) / 864e5;
|
|
274
|
+
break;
|
|
275
|
+
case u:
|
|
276
|
+
$2 = g2 / n;
|
|
277
|
+
break;
|
|
278
|
+
case s:
|
|
279
|
+
$2 = g2 / e;
|
|
280
|
+
break;
|
|
281
|
+
case i:
|
|
282
|
+
$2 = g2 / t;
|
|
283
|
+
break;
|
|
284
|
+
default:
|
|
285
|
+
$2 = g2;
|
|
286
|
+
}
|
|
287
|
+
return l2 ? $2 : b.a($2);
|
|
206
288
|
}, m2.daysInMonth = function() {
|
|
207
|
-
return this.endOf(
|
|
289
|
+
return this.endOf(c).$D;
|
|
208
290
|
}, m2.$locale = function() {
|
|
209
291
|
return D[this.$L];
|
|
210
292
|
}, m2.locale = function(t2, e2) {
|
|
211
293
|
if (!t2)
|
|
212
294
|
return this.$L;
|
|
213
|
-
var n2 = this.clone(), r2 =
|
|
295
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
214
296
|
return r2 && (n2.$L = r2), n2;
|
|
215
297
|
}, m2.clone = function() {
|
|
216
|
-
return
|
|
298
|
+
return b.w(this.$d, this);
|
|
217
299
|
}, m2.toDate = function() {
|
|
218
300
|
return new Date(this.valueOf());
|
|
219
301
|
}, m2.toJSON = function() {
|
|
@@ -223,16 +305,16 @@ var require_dayjs_min = __commonJS({
|
|
|
223
305
|
}, m2.toString = function() {
|
|
224
306
|
return this.$d.toUTCString();
|
|
225
307
|
}, M2;
|
|
226
|
-
}(),
|
|
227
|
-
return
|
|
228
|
-
|
|
308
|
+
}(), k = _.prototype;
|
|
309
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
310
|
+
k[t2[1]] = function(e2) {
|
|
229
311
|
return this.$g(e2, t2[0], t2[1]);
|
|
230
312
|
};
|
|
231
|
-
}),
|
|
232
|
-
return t2.$i || (t2(e2, _,
|
|
233
|
-
},
|
|
234
|
-
return
|
|
235
|
-
},
|
|
313
|
+
}), O.extend = function(t2, e2) {
|
|
314
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
315
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
316
|
+
return O(1e3 * t2);
|
|
317
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
236
318
|
});
|
|
237
319
|
}
|
|
238
320
|
});
|
|
@@ -877,8 +959,7 @@ var require_dayjs = __commonJS({
|
|
|
877
959
|
}
|
|
878
960
|
}
|
|
879
961
|
};
|
|
880
|
-
var _default = generateConfig;
|
|
881
|
-
exports.default = _default;
|
|
962
|
+
var _default = exports.default = generateConfig;
|
|
882
963
|
}
|
|
883
964
|
});
|
|
884
965
|
|
|
@@ -978,14 +1059,10 @@ AntDNotToggle.displayName = "AntDNotToggle";
|
|
|
978
1059
|
// src/AntDValueEditor.tsx
|
|
979
1060
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
980
1061
|
var import_dayjs2 = __toESM(require_dayjs());
|
|
981
|
-
import {
|
|
1062
|
+
import { Checkbox, Input, Radio, Switch as Switch2 } from "antd";
|
|
1063
|
+
import generatePicker from "antd/es/date-picker/generatePicker/index.js";
|
|
982
1064
|
import * as React6 from "react";
|
|
983
|
-
import {
|
|
984
|
-
getFirstOption,
|
|
985
|
-
standardClassnames,
|
|
986
|
-
toArray,
|
|
987
|
-
useValueEditor
|
|
988
|
-
} from "react-querybuilder";
|
|
1065
|
+
import { getFirstOption, joinWith, standardClassnames, useValueEditor } from "react-querybuilder";
|
|
989
1066
|
|
|
990
1067
|
// src/AntDValueSelector.tsx
|
|
991
1068
|
import { Select as Select2 } from "antd";
|
|
@@ -1031,7 +1108,7 @@ var AntDValueSelector = ({
|
|
|
1031
1108
|
Select2,
|
|
1032
1109
|
{
|
|
1033
1110
|
...modeObj,
|
|
1034
|
-
|
|
1111
|
+
popupMatchSelectWidth: false,
|
|
1035
1112
|
disabled,
|
|
1036
1113
|
value: val,
|
|
1037
1114
|
onChange,
|
|
@@ -1043,7 +1120,7 @@ var AntDValueSelector = ({
|
|
|
1043
1120
|
AntDValueSelector.displayName = "AntDValueSelector";
|
|
1044
1121
|
|
|
1045
1122
|
// src/AntDValueEditor.tsx
|
|
1046
|
-
var DatePicker =
|
|
1123
|
+
var DatePicker = generatePicker(import_dayjs2.default);
|
|
1047
1124
|
var AntDValueEditor = ({
|
|
1048
1125
|
fieldData,
|
|
1049
1126
|
operator,
|
|
@@ -1084,7 +1161,7 @@ var AntDValueEditor = ({
|
|
|
1084
1161
|
if (type === "text") {
|
|
1085
1162
|
if (inputTypeCoerced === "time") {
|
|
1086
1163
|
return /* @__PURE__ */ React6.createElement(
|
|
1087
|
-
TimePicker,
|
|
1164
|
+
DatePicker.TimePicker,
|
|
1088
1165
|
{
|
|
1089
1166
|
key,
|
|
1090
1167
|
value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
|
|
@@ -1189,28 +1266,36 @@ var AntDValueEditor = ({
|
|
|
1189
1266
|
}
|
|
1190
1267
|
switch (inputTypeCoerced) {
|
|
1191
1268
|
case "date":
|
|
1192
|
-
case "datetime-local":
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
(
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1269
|
+
case "datetime-local": {
|
|
1270
|
+
if (operator === "between" || operator === "notBetween") {
|
|
1271
|
+
const dayjsArray = valueAsArray.slice(0, 2).map(import_dayjs.default);
|
|
1272
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1273
|
+
DatePicker.RangePicker,
|
|
1274
|
+
{
|
|
1275
|
+
value: dayjsArray.every((d) => d.isValid()) ? dayjsArray : void 0,
|
|
1276
|
+
showTime: inputTypeCoerced === "datetime-local",
|
|
1277
|
+
className,
|
|
1278
|
+
disabled,
|
|
1279
|
+
placeholder: [placeHolderText, placeHolderText],
|
|
1280
|
+
onChange: (
|
|
1281
|
+
/* istanbul ignore next */
|
|
1282
|
+
(dates) => {
|
|
1283
|
+
const timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
|
|
1284
|
+
const format = `YYYY-MM-DD${timeFormat}`;
|
|
1285
|
+
const dateArray = dates?.map((d) => d?.isValid() ? d.format(format) : void 0);
|
|
1286
|
+
handleOnChange(
|
|
1287
|
+
dateArray ? listsAsArrays ? dateArray : joinWith(dateArray, ",") : dates
|
|
1288
|
+
);
|
|
1289
|
+
}
|
|
1290
|
+
)
|
|
1291
|
+
}
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
const dateValue = (0, import_dayjs.default)(value);
|
|
1295
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1211
1296
|
DatePicker,
|
|
1212
1297
|
{
|
|
1213
|
-
value:
|
|
1298
|
+
value: dateValue.isValid() ? dateValue : void 0,
|
|
1214
1299
|
showTime: inputTypeCoerced === "datetime-local",
|
|
1215
1300
|
className,
|
|
1216
1301
|
disabled,
|
|
@@ -1218,17 +1303,20 @@ var AntDValueEditor = ({
|
|
|
1218
1303
|
onChange: (_d, dateString) => handleOnChange(dateString)
|
|
1219
1304
|
}
|
|
1220
1305
|
);
|
|
1221
|
-
|
|
1306
|
+
}
|
|
1307
|
+
case "time": {
|
|
1308
|
+
const dateValue = (0, import_dayjs.default)(value, "HH:mm:ss");
|
|
1222
1309
|
return /* @__PURE__ */ React6.createElement(
|
|
1223
|
-
TimePicker,
|
|
1310
|
+
DatePicker.TimePicker,
|
|
1224
1311
|
{
|
|
1225
|
-
value:
|
|
1312
|
+
value: dateValue.isValid() ? dateValue : void 0,
|
|
1226
1313
|
className,
|
|
1227
1314
|
disabled,
|
|
1228
1315
|
placeholder: placeHolderText,
|
|
1229
1316
|
onChange: (d) => handleOnChange(d?.format("HH:mm:ss") ?? "")
|
|
1230
1317
|
}
|
|
1231
1318
|
);
|
|
1319
|
+
}
|
|
1232
1320
|
}
|
|
1233
1321
|
return /* @__PURE__ */ React6.createElement(
|
|
1234
1322
|
Input,
|