@react-querybuilder/antd 6.3.0-alpha.0 → 6.3.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.
@@ -889,7 +889,7 @@ import { getCompatContextProvider } from "react-querybuilder";
889
889
 
890
890
  // src/AntDActionElement.tsx
891
891
  import { Button } from "antd";
892
- import { jsx } from "react/jsx-runtime";
892
+ import * as React from "react";
893
893
  var AntDActionElement = (_a) => {
894
894
  var _b = _a, {
895
895
  className,
@@ -923,25 +923,24 @@ var AntDActionElement = (_a) => {
923
923
  "ruleOrGroup",
924
924
  "schema"
925
925
  ]);
926
- return /* @__PURE__ */ jsx(
926
+ return /* @__PURE__ */ React.createElement(
927
927
  Button,
928
- __spreadProps(__spreadValues({
928
+ __spreadValues({
929
929
  type: "primary",
930
930
  className,
931
931
  title: disabledTranslation && disabled ? disabledTranslation.title : title,
932
932
  onClick: (e) => handleOnClick(e),
933
933
  disabled: disabled && !disabledTranslation
934
- }, extraProps), {
935
- children: disabledTranslation && disabled ? disabledTranslation.label : label
936
- })
934
+ }, extraProps),
935
+ disabledTranslation && disabled ? disabledTranslation.label : label
937
936
  );
938
937
  };
939
938
  AntDActionElement.displayName = "AntDActionElement";
940
939
 
941
940
  // src/AntDDragHandle.tsx
942
941
  import { HolderOutlined } from "@ant-design/icons";
942
+ import * as React2 from "react";
943
943
  import { forwardRef } from "react";
944
- import { jsx as jsx2 } from "react/jsx-runtime";
945
944
  var AntDDragHandle = forwardRef(
946
945
  (_a, dragRef) => {
947
946
  var _b = _a, {
@@ -968,14 +967,14 @@ var AntDDragHandle = forwardRef(
968
967
  "validation",
969
968
  "schema"
970
969
  ]);
971
- return /* @__PURE__ */ jsx2(HolderOutlined, __spreadValues({ ref: dragRef, className, title }, extraProps));
970
+ return /* @__PURE__ */ React2.createElement(HolderOutlined, __spreadValues({ ref: dragRef, className, title }, extraProps));
972
971
  }
973
972
  );
974
973
  AntDDragHandle.displayName = "AntDDragHandle";
975
974
 
976
975
  // src/AntDNotToggle.tsx
977
976
  import { Switch } from "antd";
978
- import { jsx as jsx3 } from "react/jsx-runtime";
977
+ import * as React3 from "react";
979
978
  var AntDNotToggle = (_a) => {
980
979
  var _b = _a, {
981
980
  className,
@@ -1003,7 +1002,7 @@ var AntDNotToggle = (_a) => {
1003
1002
  "testID",
1004
1003
  "schema"
1005
1004
  ]);
1006
- return /* @__PURE__ */ jsx3(
1005
+ return /* @__PURE__ */ React3.createElement(
1007
1006
  Switch,
1008
1007
  __spreadValues({
1009
1008
  title,
@@ -1023,6 +1022,7 @@ var import_dayjs = __toESM(require_dayjs_min());
1023
1022
  var import_dayjs2 = __toESM(require_dayjs());
1024
1023
  import { Checkbox, Input, Radio, Switch as Switch2, TimePicker } from "antd";
1025
1024
  import generatePicker from "antd/es/date-picker/generatePicker/index.js";
1025
+ import * as React6 from "react";
1026
1026
  import {
1027
1027
  getFirstOption,
1028
1028
  standardClassnames,
@@ -1032,20 +1032,20 @@ import {
1032
1032
 
1033
1033
  // src/AntDValueSelector.tsx
1034
1034
  import { Select as Select2 } from "antd";
1035
+ import * as React5 from "react";
1035
1036
  import { useValueSelector } from "react-querybuilder";
1036
1037
 
1037
1038
  // src/utils.tsx
1038
1039
  import { Select } from "antd";
1040
+ import * as React4 from "react";
1039
1041
  import { isOptionGroupArray } from "react-querybuilder";
1040
- import { jsx as jsx4 } from "react/jsx-runtime";
1041
1042
  var { OptGroup, Option } = Select;
1042
- var toOptions = (arr) => isOptionGroupArray(arr) ? arr.map((og) => /* @__PURE__ */ jsx4(OptGroup, { label: og.label, children: og.options.map((opt) => /* @__PURE__ */ jsx4(Option, { value: opt.name, children: opt.label }, opt.name)) }, og.label)) : Array.isArray(arr) ? arr.map((opt) => /* @__PURE__ */ jsx4(Option, { value: opt.name, children: opt.label }, opt.name)) : (
1043
+ 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)) : (
1043
1044
  /* istanbul ignore next */
1044
1045
  null
1045
1046
  );
1046
1047
 
1047
1048
  // src/AntDValueSelector.tsx
1048
- import { jsx as jsx5 } from "react/jsx-runtime";
1049
1049
  var AntDValueSelector = (_a) => {
1050
1050
  var _b = _a, {
1051
1051
  className,
@@ -1089,23 +1089,20 @@ var AntDValueSelector = (_a) => {
1089
1089
  ]);
1090
1090
  const { onChange, val } = useValueSelector({ handleOnChange, listsAsArrays, multiple, value });
1091
1091
  const modeObj = multiple ? { mode: "multiple" } : {};
1092
- return /* @__PURE__ */ jsx5("span", { title, className, children: /* @__PURE__ */ jsx5(
1092
+ return /* @__PURE__ */ React5.createElement("span", { title, className }, /* @__PURE__ */ React5.createElement(
1093
1093
  Select2,
1094
- __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, modeObj), {
1094
+ __spreadValues(__spreadProps(__spreadValues({}, modeObj), {
1095
1095
  dropdownMatchSelectWidth: false,
1096
1096
  disabled,
1097
1097
  value: val,
1098
1098
  onChange
1099
- }), extraProps), {
1100
- children: toOptions(options)
1101
- })
1102
- ) });
1099
+ }), extraProps),
1100
+ toOptions(options)
1101
+ ));
1103
1102
  };
1104
1103
  AntDValueSelector.displayName = "AntDValueSelector";
1105
1104
 
1106
1105
  // src/AntDValueEditor.tsx
1107
- import { jsx as jsx6, jsxs } from "react/jsx-runtime";
1108
- import { createElement } from "react";
1109
1106
  var DatePicker = generatePicker(import_dayjs2.default);
1110
1107
  var AntDValueEditor = (_a) => {
1111
1108
  var _b = _a, {
@@ -1165,9 +1162,10 @@ var AntDValueEditor = (_a) => {
1165
1162
  var _a3, _b3;
1166
1163
  if (type === "text") {
1167
1164
  if (inputTypeCoerced === "time") {
1168
- return /* @__PURE__ */ jsx6(
1165
+ return /* @__PURE__ */ React6.createElement(
1169
1166
  TimePicker,
1170
1167
  {
1168
+ key,
1171
1169
  value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
1172
1170
  className: standardClassnames.valueListItem,
1173
1171
  disabled,
@@ -1176,24 +1174,23 @@ var AntDValueEditor = (_a) => {
1176
1174
  var _a4;
1177
1175
  return multiValueHandler((_a4 = d == null ? void 0 : d.format("HH:mm:ss")) != null ? _a4 : "", i);
1178
1176
  }
1179
- },
1180
- key
1177
+ }
1181
1178
  );
1182
1179
  }
1183
- return /* @__PURE__ */ jsx6(
1180
+ return /* @__PURE__ */ React6.createElement(
1184
1181
  Input,
1185
1182
  {
1183
+ key,
1186
1184
  type: inputTypeCoerced,
1187
1185
  value: (_a3 = valueAsArray[i]) != null ? _a3 : "",
1188
1186
  className: standardClassnames.valueListItem,
1189
1187
  disabled,
1190
1188
  placeholder: placeHolderText,
1191
1189
  onChange: (e) => multiValueHandler(e.target.value, i)
1192
- },
1193
- key
1190
+ }
1194
1191
  );
1195
1192
  }
1196
- return /* @__PURE__ */ createElement(
1193
+ return /* @__PURE__ */ React6.createElement(
1197
1194
  SelectorComponent,
1198
1195
  __spreadProps(__spreadValues({}, props), {
1199
1196
  key,
@@ -1206,16 +1203,12 @@ var AntDValueEditor = (_a) => {
1206
1203
  })
1207
1204
  );
1208
1205
  });
1209
- return /* @__PURE__ */ jsxs("span", { "data-testid": testID, className, title, children: [
1210
- editors[0],
1211
- separator,
1212
- editors[1]
1213
- ] });
1206
+ return /* @__PURE__ */ React6.createElement("span", { "data-testid": testID, className, title }, editors[0], separator, editors[1]);
1214
1207
  }
1215
1208
  switch (type) {
1216
1209
  case "select":
1217
1210
  case "multiselect":
1218
- return /* @__PURE__ */ jsx6(
1211
+ return /* @__PURE__ */ React6.createElement(
1219
1212
  SelectorComponent,
1220
1213
  __spreadProps(__spreadValues({}, props), {
1221
1214
  className,
@@ -1229,7 +1222,7 @@ var AntDValueEditor = (_a) => {
1229
1222
  })
1230
1223
  );
1231
1224
  case "textarea":
1232
- return /* @__PURE__ */ jsx6(
1225
+ return /* @__PURE__ */ React6.createElement(
1233
1226
  Input.TextArea,
1234
1227
  {
1235
1228
  value,
@@ -1241,7 +1234,7 @@ var AntDValueEditor = (_a) => {
1241
1234
  }
1242
1235
  );
1243
1236
  case "switch":
1244
- return /* @__PURE__ */ jsx6(
1237
+ return /* @__PURE__ */ React6.createElement(
1245
1238
  Switch2,
1246
1239
  {
1247
1240
  checked: !!value,
@@ -1252,7 +1245,7 @@ var AntDValueEditor = (_a) => {
1252
1245
  }
1253
1246
  );
1254
1247
  case "checkbox":
1255
- return /* @__PURE__ */ jsx6("span", { title, className, children: /* @__PURE__ */ jsx6(
1248
+ return /* @__PURE__ */ React6.createElement("span", { title, className }, /* @__PURE__ */ React6.createElement(
1256
1249
  Checkbox,
1257
1250
  {
1258
1251
  type: "checkbox",
@@ -1260,24 +1253,24 @@ var AntDValueEditor = (_a) => {
1260
1253
  onChange: (e) => handleOnChange(e.target.checked),
1261
1254
  checked: !!value
1262
1255
  }
1263
- ) });
1256
+ ));
1264
1257
  case "radio":
1265
- return /* @__PURE__ */ jsx6("span", { className, title, children: values.map((v) => /* @__PURE__ */ jsx6(
1258
+ return /* @__PURE__ */ React6.createElement("span", { className, title }, values.map((v) => /* @__PURE__ */ React6.createElement(
1266
1259
  Radio,
1267
1260
  {
1261
+ key: v.name,
1268
1262
  value: v.name,
1269
1263
  checked: value === v.name,
1270
1264
  disabled,
1271
- onChange: (e) => handleOnChange(e.target.value),
1272
- children: v.label
1265
+ onChange: (e) => handleOnChange(e.target.value)
1273
1266
  },
1274
- v.name
1275
- )) });
1267
+ v.label
1268
+ )));
1276
1269
  }
1277
1270
  switch (inputTypeCoerced) {
1278
1271
  case "date":
1279
1272
  case "datetime-local":
1280
- return operator === "between" || operator === "notBetween" ? /* @__PURE__ */ jsx6(
1273
+ return operator === "between" || operator === "notBetween" ? /* @__PURE__ */ React6.createElement(
1281
1274
  DatePicker.RangePicker,
1282
1275
  {
1283
1276
  value: ((_b2 = toArray(value)) == null ? void 0 : _b2.length) >= 2 ? toArray(value).map((v) => (0, import_dayjs.default)(v)) : void 0,
@@ -1294,7 +1287,7 @@ var AntDValueEditor = (_a) => {
1294
1287
  }
1295
1288
  )
1296
1289
  }
1297
- ) : /* @__PURE__ */ jsx6(
1290
+ ) : /* @__PURE__ */ React6.createElement(
1298
1291
  DatePicker,
1299
1292
  {
1300
1293
  value: value ? (0, import_dayjs.default)(value) : null,
@@ -1306,7 +1299,7 @@ var AntDValueEditor = (_a) => {
1306
1299
  }
1307
1300
  );
1308
1301
  case "time":
1309
- return /* @__PURE__ */ jsx6(
1302
+ return /* @__PURE__ */ React6.createElement(
1310
1303
  TimePicker,
1311
1304
  {
1312
1305
  value: value ? (0, import_dayjs.default)(value, "HH:mm:ss") : null,
@@ -1320,7 +1313,7 @@ var AntDValueEditor = (_a) => {
1320
1313
  }
1321
1314
  );
1322
1315
  }
1323
- return /* @__PURE__ */ jsx6(
1316
+ return /* @__PURE__ */ React6.createElement(
1324
1317
  Input,
1325
1318
  {
1326
1319
  type: inputTypeCoerced,