@react-querybuilder/antd 6.6.0-alpha.0 → 7.0.0-alpha.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.
@@ -54,9 +54,9 @@ var require_dayjs_min = __commonJS({
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 b;
59
- }, S = function t2(e2, n2, r2) {
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
- }, w = function(t2, e2) {
75
- if (p(t2))
74
+ }, O = function(t2, e2) {
75
+ if (S(t2))
76
76
  return t2.clone();
77
77
  var n2 = "object" == typeof e2 ? e2 : {};
78
- return n2.date = t2, n2.args = arguments, new b(n2);
79
- }, O = v;
80
- O.l = S, O.i = p, O.w = function(t2, e2) {
81
- return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
78
+ return n2.date = t2, n2.args = arguments, new _(n2);
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
- var b = function() {
83
+ var _ = function() {
84
84
  function M2(t2) {
85
- this.$L = S(t2.locale, null, true), this.parse(t2);
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 (O.u(e2))
93
+ if (b.u(e2))
94
94
  return /* @__PURE__ */ new Date();
95
95
  if (e2 instanceof Date)
96
96
  return new Date(e2);
@@ -102,33 +102,33 @@ var require_dayjs_min = __commonJS({
102
102
  }
103
103
  }
104
104
  return new Date(e2);
105
- }(t2), this.$x = t2.x || {}, this.init();
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 O;
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 = w(t2);
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 w(t2) < this.startOf(e2);
117
+ return O(t2) < this.startOf(e2);
118
118
  }, m2.isBefore = function(t2, e2) {
119
- return this.endOf(e2) < w(t2);
119
+ return this.endOf(e2) < O(t2);
120
120
  }, m2.$g = function(t2, e2, n2) {
121
- return O.u(t2) ? this[e2] : this.set(n2, t2);
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 = !!O.u(e2) || e2, f2 = O.p(t2), l2 = function(t3, e3) {
128
- var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
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 O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
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
133
  switch (f2) {
134
134
  case h:
@@ -153,7 +153,7 @@ 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 = O.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;
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
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;
@@ -163,13 +163,13 @@ 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[O.p(t2)]();
166
+ return this[b.p(t2)]();
167
167
  }, m2.add = function(r2, f2) {
168
168
  var d2, l2 = this;
169
169
  r2 = Number(r2);
170
- var $2 = O.p(f2), y2 = function(t2) {
171
- var e2 = w(l2);
172
- return O.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
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
174
  if ($2 === c)
175
175
  return this.set(c, this.$M + r2);
@@ -180,17 +180,17 @@ var require_dayjs_min = __commonJS({
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 O.w(m3, this);
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 = O.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) {
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
192
  }, d2 = function(t3) {
193
- return O.s(s2 % 12 || 12, t3, "0");
193
+ return b.s(s2 % 12 || 12, t3, "0");
194
194
  }, $2 = f2 || function(t3, e3, n3) {
195
195
  var r3 = t3 < 12 ? "AM" : "PM";
196
196
  return n3 ? r3.toLowerCase() : r3;
@@ -201,11 +201,11 @@ var require_dayjs_min = __commonJS({
201
201
  case "YY":
202
202
  return String(e2.$y).slice(-2);
203
203
  case "YYYY":
204
- return O.s(e2.$y, 4, "0");
204
+ return b.s(e2.$y, 4, "0");
205
205
  case "M":
206
206
  return a2 + 1;
207
207
  case "MM":
208
- return O.s(a2 + 1, 2, "0");
208
+ return b.s(a2 + 1, 2, "0");
209
209
  case "MMM":
210
210
  return h2(n2.monthsShort, a2, c2, 3);
211
211
  case "MMMM":
@@ -213,7 +213,7 @@ var require_dayjs_min = __commonJS({
213
213
  case "D":
214
214
  return e2.$D;
215
215
  case "DD":
216
- return O.s(e2.$D, 2, "0");
216
+ return b.s(e2.$D, 2, "0");
217
217
  case "d":
218
218
  return String(e2.$W);
219
219
  case "dd":
@@ -225,7 +225,7 @@ var require_dayjs_min = __commonJS({
225
225
  case "H":
226
226
  return String(s2);
227
227
  case "HH":
228
- return O.s(s2, 2, "0");
228
+ return b.s(s2, 2, "0");
229
229
  case "h":
230
230
  return d2(1);
231
231
  case "hh":
@@ -237,13 +237,13 @@ var require_dayjs_min = __commonJS({
237
237
  case "m":
238
238
  return String(u2);
239
239
  case "mm":
240
- return O.s(u2, 2, "0");
240
+ return b.s(u2, 2, "0");
241
241
  case "s":
242
242
  return String(e2.$s);
243
243
  case "ss":
244
- return O.s(e2.$s, 2, "0");
244
+ return b.s(e2.$s, 2, "0");
245
245
  case "SSS":
246
- return O.s(e2.$ms, 3, "0");
246
+ return b.s(e2.$ms, 3, "0");
247
247
  case "Z":
248
248
  return i2;
249
249
  }
@@ -253,8 +253,8 @@ var require_dayjs_min = __commonJS({
253
253
  }, m2.utcOffset = function() {
254
254
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
255
255
  }, m2.diff = function(r2, d2, l2) {
256
- var $2, y2 = this, M3 = O.p(d2), m3 = w(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
257
- return O.m(y2, m3);
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
258
  };
259
259
  switch (M3) {
260
260
  case h:
@@ -284,7 +284,7 @@ var require_dayjs_min = __commonJS({
284
284
  default:
285
285
  $2 = g2;
286
286
  }
287
- return l2 ? $2 : O.a($2);
287
+ return l2 ? $2 : b.a($2);
288
288
  }, m2.daysInMonth = function() {
289
289
  return this.endOf(c).$D;
290
290
  }, m2.$locale = function() {
@@ -292,10 +292,10 @@ var require_dayjs_min = __commonJS({
292
292
  }, m2.locale = function(t2, e2) {
293
293
  if (!t2)
294
294
  return this.$L;
295
- var n2 = this.clone(), r2 = S(t2, e2, true);
295
+ var n2 = this.clone(), r2 = w(t2, e2, true);
296
296
  return r2 && (n2.$L = r2), n2;
297
297
  }, m2.clone = function() {
298
- return O.w(this.$d, this);
298
+ return b.w(this.$d, this);
299
299
  }, m2.toDate = function() {
300
300
  return new Date(this.valueOf());
301
301
  }, m2.toJSON = function() {
@@ -305,16 +305,16 @@ var require_dayjs_min = __commonJS({
305
305
  }, m2.toString = function() {
306
306
  return this.$d.toUTCString();
307
307
  }, M2;
308
- }(), _ = b.prototype;
309
- return w.prototype = _, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
310
- _[t2[1]] = function(e2) {
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) {
311
311
  return this.$g(e2, t2[0], t2[1]);
312
312
  };
313
- }), w.extend = function(t2, e2) {
314
- return t2.$i || (t2(e2, b, w), t2.$i = true), w;
315
- }, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
316
- return w(1e3 * t2);
317
- }, w.en = D[g], w.Ls = D, w.p = {}, w;
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;
318
318
  });
319
319
  }
320
320
  });
@@ -332,9 +332,9 @@ var require_interopRequireDefault = __commonJS({
332
332
  }
333
333
  });
334
334
 
335
- // ../../node_modules/rc-util/lib/warning.js
335
+ // ../../node_modules/rc-picker/node_modules/rc-util/lib/warning.js
336
336
  var require_warning = __commonJS({
337
- "../../node_modules/rc-util/lib/warning.js"(exports) {
337
+ "../../node_modules/rc-picker/node_modules/rc-util/lib/warning.js"(exports) {
338
338
  "use strict";
339
339
  Object.defineProperty(exports, "__esModule", {
340
340
  value: true
@@ -959,12 +959,20 @@ var require_dayjs = __commonJS({
959
959
  }
960
960
  }
961
961
  };
962
- var _default = generateConfig;
963
- exports.default = _default;
962
+ var _default = exports.default = generateConfig;
964
963
  }
965
964
  });
966
965
 
967
- // src/index.ts
966
+ // src/index.tsx
967
+ import {
968
+ CloseOutlined,
969
+ CopyOutlined,
970
+ DownOutlined,
971
+ LockOutlined,
972
+ UnlockOutlined,
973
+ UpOutlined
974
+ } from "@ant-design/icons";
975
+ import * as React8 from "react";
968
976
  import { getCompatContextProvider } from "react-querybuilder";
969
977
 
970
978
  // src/AntDActionElement.tsx
@@ -1057,29 +1065,71 @@ var AntDNotToggle = ({
1057
1065
  );
1058
1066
  AntDNotToggle.displayName = "AntDNotToggle";
1059
1067
 
1068
+ // src/AntDShiftActions.tsx
1069
+ import { Button as Button2 } from "antd";
1070
+ import * as React4 from "react";
1071
+ import { useShiftActions } from "react-querybuilder";
1072
+ var AntDShiftActions = ({
1073
+ path,
1074
+ disabled,
1075
+ className,
1076
+ labels,
1077
+ titles,
1078
+ testID,
1079
+ lastInGroup,
1080
+ schema: { combinators, dispatchQuery, getQuery }
1081
+ }) => {
1082
+ const { shiftUp, shiftUpDisabled, shiftDown, shiftDownDisabled } = useShiftActions({
1083
+ combinators,
1084
+ disabled,
1085
+ dispatchQuery,
1086
+ getQuery,
1087
+ lastInGroup,
1088
+ path
1089
+ });
1090
+ return /* @__PURE__ */ React4.createElement("div", { "data-testid": testID, className }, /* @__PURE__ */ React4.createElement(
1091
+ Button2,
1092
+ {
1093
+ type: "primary",
1094
+ size: "small",
1095
+ title: titles?.shiftUp,
1096
+ onClick: shiftUp,
1097
+ disabled: shiftUpDisabled
1098
+ },
1099
+ labels?.shiftUp
1100
+ ), /* @__PURE__ */ React4.createElement(
1101
+ Button2,
1102
+ {
1103
+ type: "primary",
1104
+ size: "small",
1105
+ title: titles?.shiftDown,
1106
+ onClick: shiftDown,
1107
+ disabled: shiftDownDisabled
1108
+ },
1109
+ labels?.shiftDown
1110
+ ));
1111
+ };
1112
+ AntDShiftActions.displayName = "AntDShiftActions";
1113
+
1060
1114
  // src/AntDValueEditor.tsx
1061
1115
  var import_dayjs = __toESM(require_dayjs_min());
1062
1116
  var import_dayjs2 = __toESM(require_dayjs());
1063
- import { DatePicker as AntdDatePicker, Checkbox, Input, Radio, Switch as Switch2, TimePicker } from "antd";
1064
- import * as React6 from "react";
1065
- import {
1066
- getFirstOption,
1067
- standardClassnames,
1068
- toArray,
1069
- useValueEditor
1070
- } from "react-querybuilder";
1117
+ import { Checkbox, Input, Radio, Switch as Switch2 } from "antd";
1118
+ import generatePicker from "antd/es/date-picker/generatePicker/index.js";
1119
+ import * as React7 from "react";
1120
+ import { getFirstOption, joinWith, standardClassnames, useValueEditor } from "react-querybuilder";
1071
1121
 
1072
1122
  // src/AntDValueSelector.tsx
1073
1123
  import { Select as Select2 } from "antd";
1074
- import * as React5 from "react";
1124
+ import * as React6 from "react";
1075
1125
  import { useValueSelector } from "react-querybuilder";
1076
1126
 
1077
1127
  // src/utils.tsx
1078
1128
  import { Select } from "antd";
1079
- import * as React4 from "react";
1129
+ import * as React5 from "react";
1080
1130
  import { isOptionGroupArray } from "react-querybuilder";
1081
1131
  var { OptGroup, Option } = Select;
1082
- var toOptions = (arr) => 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)) : (
1132
+ var toOptions = (arr) => 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)) : (
1083
1133
  /* istanbul ignore next */
1084
1134
  null
1085
1135
  );
@@ -1096,6 +1146,7 @@ var AntDValueSelector = ({
1096
1146
  listsAsArrays,
1097
1147
  // Props that should not be in extraProps
1098
1148
  testID: _testID,
1149
+ rule: _rule,
1099
1150
  rules: _rules,
1100
1151
  level: _level,
1101
1152
  path: _path,
@@ -1109,7 +1160,7 @@ var AntDValueSelector = ({
1109
1160
  }) => {
1110
1161
  const { onChange, val } = useValueSelector({ handleOnChange, listsAsArrays, multiple, value });
1111
1162
  const modeObj = multiple ? { mode: "multiple" } : {};
1112
- return /* @__PURE__ */ React5.createElement("span", { title, className }, /* @__PURE__ */ React5.createElement(
1163
+ return /* @__PURE__ */ React6.createElement("span", { title, className }, /* @__PURE__ */ React6.createElement(
1113
1164
  Select2,
1114
1165
  {
1115
1166
  ...modeObj,
@@ -1125,7 +1176,7 @@ var AntDValueSelector = ({
1125
1176
  AntDValueSelector.displayName = "AntDValueSelector";
1126
1177
 
1127
1178
  // src/AntDValueEditor.tsx
1128
- var DatePicker = AntdDatePicker.generatePicker(import_dayjs2.default);
1179
+ var DatePicker = generatePicker(import_dayjs2.default);
1129
1180
  var AntDValueEditor = ({
1130
1181
  fieldData,
1131
1182
  operator,
@@ -1165,8 +1216,8 @@ var AntDValueEditor = ({
1165
1216
  const editors = ["from", "to"].map((key, i) => {
1166
1217
  if (type === "text") {
1167
1218
  if (inputTypeCoerced === "time") {
1168
- return /* @__PURE__ */ React6.createElement(
1169
- TimePicker,
1219
+ return /* @__PURE__ */ React7.createElement(
1220
+ DatePicker.TimePicker,
1170
1221
  {
1171
1222
  key,
1172
1223
  value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
@@ -1177,7 +1228,7 @@ var AntDValueEditor = ({
1177
1228
  }
1178
1229
  );
1179
1230
  }
1180
- return /* @__PURE__ */ React6.createElement(
1231
+ return /* @__PURE__ */ React7.createElement(
1181
1232
  Input,
1182
1233
  {
1183
1234
  key,
@@ -1190,7 +1241,7 @@ var AntDValueEditor = ({
1190
1241
  }
1191
1242
  );
1192
1243
  }
1193
- return /* @__PURE__ */ React6.createElement(
1244
+ return /* @__PURE__ */ React7.createElement(
1194
1245
  SelectorComponent,
1195
1246
  {
1196
1247
  ...props,
@@ -1204,12 +1255,12 @@ var AntDValueEditor = ({
1204
1255
  }
1205
1256
  );
1206
1257
  });
1207
- return /* @__PURE__ */ React6.createElement("span", { "data-testid": testID, className, title }, editors[0], separator, editors[1]);
1258
+ return /* @__PURE__ */ React7.createElement("span", { "data-testid": testID, className, title }, editors[0], separator, editors[1]);
1208
1259
  }
1209
1260
  switch (type) {
1210
1261
  case "select":
1211
1262
  case "multiselect":
1212
- return /* @__PURE__ */ React6.createElement(
1263
+ return /* @__PURE__ */ React7.createElement(
1213
1264
  SelectorComponent,
1214
1265
  {
1215
1266
  ...props,
@@ -1224,7 +1275,7 @@ var AntDValueEditor = ({
1224
1275
  }
1225
1276
  );
1226
1277
  case "textarea":
1227
- return /* @__PURE__ */ React6.createElement(
1278
+ return /* @__PURE__ */ React7.createElement(
1228
1279
  Input.TextArea,
1229
1280
  {
1230
1281
  value,
@@ -1236,7 +1287,7 @@ var AntDValueEditor = ({
1236
1287
  }
1237
1288
  );
1238
1289
  case "switch":
1239
- return /* @__PURE__ */ React6.createElement(
1290
+ return /* @__PURE__ */ React7.createElement(
1240
1291
  Switch2,
1241
1292
  {
1242
1293
  checked: !!value,
@@ -1247,7 +1298,7 @@ var AntDValueEditor = ({
1247
1298
  }
1248
1299
  );
1249
1300
  case "checkbox":
1250
- return /* @__PURE__ */ React6.createElement("span", { title, className }, /* @__PURE__ */ React6.createElement(
1301
+ return /* @__PURE__ */ React7.createElement("span", { title, className }, /* @__PURE__ */ React7.createElement(
1251
1302
  Checkbox,
1252
1303
  {
1253
1304
  type: "checkbox",
@@ -1257,7 +1308,7 @@ var AntDValueEditor = ({
1257
1308
  }
1258
1309
  ));
1259
1310
  case "radio":
1260
- return /* @__PURE__ */ React6.createElement("span", { className, title }, values.map((v) => /* @__PURE__ */ React6.createElement(
1311
+ return /* @__PURE__ */ React7.createElement("span", { className, title }, values.map((v) => /* @__PURE__ */ React7.createElement(
1261
1312
  Radio,
1262
1313
  {
1263
1314
  key: v.name,
@@ -1271,28 +1322,36 @@ var AntDValueEditor = ({
1271
1322
  }
1272
1323
  switch (inputTypeCoerced) {
1273
1324
  case "date":
1274
- case "datetime-local":
1275
- return operator === "between" || operator === "notBetween" ? /* @__PURE__ */ React6.createElement(
1276
- DatePicker.RangePicker,
1277
- {
1278
- value: toArray(value)?.length >= 2 ? toArray(value).map((v) => (0, import_dayjs.default)(v)) : void 0,
1279
- showTime: inputTypeCoerced === "datetime-local",
1280
- className,
1281
- disabled,
1282
- placeholder: [placeHolderText, placeHolderText],
1283
- onChange: (
1284
- /* istanbul ignore next */
1285
- (dates) => {
1286
- const format = `YYYY-MM-DD${inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : ""}`;
1287
- const dateArray = dates?.map((d) => d?.format(format));
1288
- handleOnChange(dateArray ? listsAsArrays ? dateArray : dateArray.join(",") : dates);
1289
- }
1290
- )
1291
- }
1292
- ) : /* @__PURE__ */ React6.createElement(
1325
+ case "datetime-local": {
1326
+ if (operator === "between" || operator === "notBetween") {
1327
+ const dayjsArray = valueAsArray.slice(0, 2).map(import_dayjs.default);
1328
+ return /* @__PURE__ */ React7.createElement(
1329
+ DatePicker.RangePicker,
1330
+ {
1331
+ value: dayjsArray.every((d) => d.isValid()) ? dayjsArray : void 0,
1332
+ showTime: inputTypeCoerced === "datetime-local",
1333
+ className,
1334
+ disabled,
1335
+ placeholder: [placeHolderText, placeHolderText],
1336
+ onChange: (
1337
+ /* istanbul ignore next */
1338
+ (dates) => {
1339
+ const timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
1340
+ const format = `YYYY-MM-DD${timeFormat}`;
1341
+ const dateArray = dates?.map((d) => d?.isValid() ? d.format(format) : void 0);
1342
+ handleOnChange(
1343
+ dateArray ? listsAsArrays ? dateArray : joinWith(dateArray, ",") : dates
1344
+ );
1345
+ }
1346
+ )
1347
+ }
1348
+ );
1349
+ }
1350
+ const dateValue = (0, import_dayjs.default)(value);
1351
+ return /* @__PURE__ */ React7.createElement(
1293
1352
  DatePicker,
1294
1353
  {
1295
- value: value ? (0, import_dayjs.default)(value) : null,
1354
+ value: dateValue.isValid() ? dateValue : void 0,
1296
1355
  showTime: inputTypeCoerced === "datetime-local",
1297
1356
  className,
1298
1357
  disabled,
@@ -1300,19 +1359,22 @@ var AntDValueEditor = ({
1300
1359
  onChange: (_d, dateString) => handleOnChange(dateString)
1301
1360
  }
1302
1361
  );
1303
- case "time":
1304
- return /* @__PURE__ */ React6.createElement(
1305
- TimePicker,
1362
+ }
1363
+ case "time": {
1364
+ const dateValue = (0, import_dayjs.default)(value, "HH:mm:ss");
1365
+ return /* @__PURE__ */ React7.createElement(
1366
+ DatePicker.TimePicker,
1306
1367
  {
1307
- value: value ? (0, import_dayjs.default)(value, "HH:mm:ss") : null,
1368
+ value: dateValue.isValid() ? dateValue : void 0,
1308
1369
  className,
1309
1370
  disabled,
1310
1371
  placeholder: placeHolderText,
1311
1372
  onChange: (d) => handleOnChange(d?.format("HH:mm:ss") ?? "")
1312
1373
  }
1313
1374
  );
1375
+ }
1314
1376
  }
1315
- return /* @__PURE__ */ React6.createElement(
1377
+ return /* @__PURE__ */ React7.createElement(
1316
1378
  Input,
1317
1379
  {
1318
1380
  type: inputTypeCoerced,
@@ -1327,7 +1389,7 @@ var AntDValueEditor = ({
1327
1389
  };
1328
1390
  AntDValueEditor.displayName = "AntDValueEditor";
1329
1391
 
1330
- // src/index.ts
1392
+ // src/index.tsx
1331
1393
  var antdControlElements = {
1332
1394
  addGroupAction: AntDActionElement,
1333
1395
  addRuleAction: AntDActionElement,
@@ -1343,19 +1405,35 @@ var antdControlElements = {
1343
1405
  removeRuleAction: AntDActionElement,
1344
1406
  valueEditor: AntDValueEditor,
1345
1407
  dragHandle: AntDDragHandle,
1346
- valueSourceSelector: AntDValueSelector
1408
+ valueSourceSelector: AntDValueSelector,
1409
+ shiftActions: AntDShiftActions
1410
+ };
1411
+ var antdTranslations = {
1412
+ removeGroup: { label: /* @__PURE__ */ React8.createElement(CloseOutlined, null) },
1413
+ removeRule: { label: /* @__PURE__ */ React8.createElement(CloseOutlined, null) },
1414
+ cloneRule: { label: /* @__PURE__ */ React8.createElement(CopyOutlined, null) },
1415
+ cloneRuleGroup: { label: /* @__PURE__ */ React8.createElement(CopyOutlined, null) },
1416
+ lockGroup: { label: /* @__PURE__ */ React8.createElement(UnlockOutlined, null) },
1417
+ lockRule: { label: /* @__PURE__ */ React8.createElement(UnlockOutlined, null) },
1418
+ lockGroupDisabled: { label: /* @__PURE__ */ React8.createElement(LockOutlined, null) },
1419
+ lockRuleDisabled: { label: /* @__PURE__ */ React8.createElement(LockOutlined, null) },
1420
+ shiftActionUp: { label: /* @__PURE__ */ React8.createElement(UpOutlined, null) },
1421
+ shiftActionDown: { label: /* @__PURE__ */ React8.createElement(DownOutlined, null) }
1347
1422
  };
1348
1423
  var QueryBuilderAntD = getCompatContextProvider({
1349
1424
  key: "antd",
1350
- controlElements: antdControlElements
1425
+ controlElements: antdControlElements,
1426
+ translations: antdTranslations
1351
1427
  });
1352
1428
  export {
1353
1429
  AntDActionElement,
1354
1430
  AntDDragHandle,
1355
1431
  AntDNotToggle,
1432
+ AntDShiftActions,
1356
1433
  AntDValueEditor,
1357
1434
  AntDValueSelector,
1358
1435
  QueryBuilderAntD,
1359
- antdControlElements
1436
+ antdControlElements,
1437
+ antdTranslations
1360
1438
  };
1361
1439
  //# sourceMappingURL=react-querybuilder_antd.mjs.map