@react-querybuilder/antd 8.1.0 → 8.1.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.
@@ -106,9 +106,9 @@ __export(src_exports, {
106
106
  antdTranslations: () => antdTranslations
107
107
  });
108
108
  module.exports = __toCommonJS(src_exports);
109
- var import_jsx_runtime8 = require("react/jsx-runtime");
109
+ var import_jsx_runtime7 = require("react/jsx-runtime");
110
110
  var import_icons2 = require("@ant-design/icons");
111
- var import_react_querybuilder4 = require("react-querybuilder");
111
+ var import_react_querybuilder3 = require("react-querybuilder");
112
112
 
113
113
  // src/AntDActionElement.tsx
114
114
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -342,24 +342,6 @@ var AntDShiftActions = function AntDShiftActions2(_ref) {
342
342
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-testid": testID, className, children: [/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_antd3.Button, { type: "primary", size: "small", title: titles === null || titles === void 0 ? void 0 : titles.shiftUp, onClick: shiftUp, disabled: disabled || shiftUpDisabled, children: labels === null || labels === void 0 ? void 0 : labels.shiftUp }), /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_antd3.Button, { type: "primary", size: "small", title: titles === null || titles === void 0 ? void 0 : titles.shiftDown, onClick: shiftDown, disabled: disabled || shiftDownDisabled, children: labels === null || labels === void 0 ? void 0 : labels.shiftDown })] });
343
343
  };
344
344
 
345
- // ../../utils/react-compiler/react-compiler-runtime.ts
346
- var React = __toESM(require("react"));
347
- var $empty = Symbol["for"]("react.memo_cache_sentinel");
348
- function c(size) {
349
- return React.useMemo(
350
- function() {
351
- var $ = Array.from({ length: size });
352
- for (var ii = 0; ii < size; ii++) {
353
- $[ii] = $empty;
354
- }
355
- $[$empty] = true;
356
- return $;
357
- },
358
- // eslint-disable-next-line react-hooks/exhaustive-deps
359
- []
360
- );
361
- }
362
-
363
345
  // src/AntDValueEditor.tsx
364
346
  var import_jsx_runtime5 = require("react/jsx-runtime");
365
347
  var import_antd4 = require("antd");
@@ -641,6 +623,7 @@ function _typeof4(o) {
641
623
  return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
642
624
  }, _typeof4(o);
643
625
  }
626
+ var _excluded4 = ["fieldData", "operator", "value", "handleOnChange", "title", "className", "type", "values", "listsAsArrays", "separator", "valueSource", "disabled", "testID", "selectorComponent", "extraProps", "inputType", "parseNumbers"];
644
627
  function ownKeys4(e, r) {
645
628
  var t = Object.keys(e);
646
629
  if (Object.getOwnPropertySymbols) {
@@ -679,377 +662,145 @@ function _toPrimitive4(t, r) {
679
662
  }
680
663
  return ("string" === r ? String : Number)(t);
681
664
  }
665
+ function _objectWithoutProperties4(e, t) {
666
+ if (null == e) return {};
667
+ var o, r, i = _objectWithoutPropertiesLoose4(e, t);
668
+ if (Object.getOwnPropertySymbols) {
669
+ var s = Object.getOwnPropertySymbols(e);
670
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
671
+ }
672
+ return i;
673
+ }
674
+ function _objectWithoutPropertiesLoose4(r, e) {
675
+ if (null == r) return {};
676
+ var t = {};
677
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
678
+ if (e.includes(n)) continue;
679
+ t[n] = r[n];
680
+ }
681
+ return t;
682
+ }
682
683
  var DatePicker = (0, import_generatePicker.default)(dayjs_default);
683
684
  var AntDValueEditor = function AntDValueEditor2(allProps) {
684
685
  var _fieldData$placeholde;
685
- var $ = c(111);
686
- var fieldData = allProps.fieldData, operator = allProps.operator, value = allProps.value, handleOnChange = allProps.handleOnChange, title = allProps.title, className = allProps.className, type = allProps.type, t0 = allProps.values, listsAsArrays = allProps.listsAsArrays, separator = allProps.separator, disabled = allProps.disabled, testID = allProps.testID, extraProps = allProps.extraProps;
687
- var t1;
688
- if ($[0] !== t0) {
689
- t1 = t0 === void 0 ? [] : t0;
690
- $[0] = t0;
691
- $[1] = t1;
692
- } else {
693
- t1 = $[1];
694
- }
695
- var values = t1;
686
+ var fieldData = allProps.fieldData, operator = allProps.operator, value = allProps.value, handleOnChange = allProps.handleOnChange, title = allProps.title, className = allProps.className, type = allProps.type, _allProps$values = allProps.values, values = _allProps$values === void 0 ? [] : _allProps$values, listsAsArrays = allProps.listsAsArrays, separator = allProps.separator, _vs = allProps.valueSource, disabled = allProps.disabled, testID = allProps.testID, _allProps$selectorCom = allProps.selectorComponent, SelectorComponent = _allProps$selectorCom === void 0 ? allProps.schema.controls.valueSelector : _allProps$selectorCom, extraProps = allProps.extraProps, _inputType = allProps.inputType, _parseNumbers = allProps.parseNumbers, propsForValueSelector = _objectWithoutProperties4(allProps, _excluded4);
696
687
  var _useValueEditor = (0, import_react_querybuilder.useValueEditor)(allProps), valueAsArray = _useValueEditor.valueAsArray, multiValueHandler = _useValueEditor.multiValueHandler, valueListItemClassName = _useValueEditor.valueListItemClassName, inputTypeCoerced = _useValueEditor.inputTypeCoerced;
697
688
  if (operator === "null" || operator === "notNull") {
698
689
  return null;
699
690
  }
700
691
  var placeHolderText = (_fieldData$placeholde = fieldData === null || fieldData === void 0 ? void 0 : fieldData.placeholder) !== null && _fieldData$placeholde !== void 0 ? _fieldData$placeholde : "";
701
- if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") && inputTypeCoerced !== "date" && inputTypeCoerced !== "datetime-local") {
692
+ if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") && // Date ranges are handled differently in AntD--see below
693
+ inputTypeCoerced !== "date" && inputTypeCoerced !== "datetime-local") {
702
694
  if (type === "text") {
703
- var _t;
704
- if ($[2] !== className || $[3] !== disabled || $[4] !== extraProps || $[5] !== inputTypeCoerced || $[6] !== multiValueHandler || $[7] !== placeHolderText || $[8] !== separator || $[9] !== testID || $[10] !== title || $[11] !== valueAsArray || $[12] !== valueListItemClassName) {
705
- var editors = ["from", "to"].map(function(key, i) {
706
- var _valueAsArray$i2;
707
- if (inputTypeCoerced === "time") {
708
- return (0, import_jsx_runtime5.jsx)(DatePicker.TimePicker, _objectSpread4({ value: valueAsArray[i] ? (0, import_dayjs2.default)(valueAsArray[i], "HH:mm:ss") : null, className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(d) {
709
- var _d$format;
710
- return multiValueHandler((_d$format = d === null || d === void 0 ? void 0 : d.format("HH:mm:ss")) !== null && _d$format !== void 0 ? _d$format : "", i);
711
- } }, extraProps), key);
712
- } else {
713
- if (inputTypeCoerced === "number") {
714
- var _valueAsArray$i;
715
- return (0, import_jsx_runtime5.jsx)(import_antd4.InputNumber, _objectSpread4({ type: inputTypeCoerced, value: (_valueAsArray$i = valueAsArray[i]) !== null && _valueAsArray$i !== void 0 ? _valueAsArray$i : "", className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(v) {
716
- return multiValueHandler(v, i);
717
- } }, extraProps), key);
718
- }
719
- }
720
- return (0, import_jsx_runtime5.jsx)(import_antd4.Input, _objectSpread4({ type: inputTypeCoerced, value: (_valueAsArray$i2 = valueAsArray[i]) !== null && _valueAsArray$i2 !== void 0 ? _valueAsArray$i2 : "", className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(e) {
721
- return multiValueHandler(e.target.value, i);
695
+ var editors = ["from", "to"].map(function(key, i) {
696
+ var _valueAsArray$i2;
697
+ if (inputTypeCoerced === "time") {
698
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DatePicker.TimePicker, _objectSpread4({ value: valueAsArray[i] ? (0, import_dayjs2.default)(valueAsArray[i], "HH:mm:ss") : null, className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(d) {
699
+ var _d$format;
700
+ return multiValueHandler((_d$format = d === null || d === void 0 ? void 0 : d.format("HH:mm:ss")) !== null && _d$format !== void 0 ? _d$format : "", i);
722
701
  } }, extraProps), key);
723
- });
724
- _t = (0, import_jsx_runtime5.jsxs)("span", { "data-testid": testID, className, title, children: [editors[0], separator, editors[1]] });
725
- $[2] = className;
726
- $[3] = disabled;
727
- $[4] = extraProps;
728
- $[5] = inputTypeCoerced;
729
- $[6] = multiValueHandler;
730
- $[7] = placeHolderText;
731
- $[8] = separator;
732
- $[9] = testID;
733
- $[10] = title;
734
- $[11] = valueAsArray;
735
- $[12] = valueListItemClassName;
736
- $[13] = _t;
737
- } else {
738
- _t = $[13];
739
- }
740
- return _t;
741
- }
742
- var _t2;
743
- if ($[14] !== allProps) {
744
- _t2 = (0, import_jsx_runtime5.jsx)(import_react_querybuilder.ValueEditor, _objectSpread4(_objectSpread4({}, allProps), {}, { skipHook: true }));
745
- $[14] = allProps;
746
- $[15] = _t2;
747
- } else {
748
- _t2 = $[15];
702
+ } else if (inputTypeCoerced === "number") {
703
+ var _valueAsArray$i;
704
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.InputNumber, _objectSpread4({ type: inputTypeCoerced, value: (_valueAsArray$i = valueAsArray[i]) !== null && _valueAsArray$i !== void 0 ? _valueAsArray$i : "", className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(v) {
705
+ return multiValueHandler(v, i);
706
+ } }, extraProps), key);
707
+ }
708
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.Input, _objectSpread4({ type: inputTypeCoerced, value: (_valueAsArray$i2 = valueAsArray[i]) !== null && _valueAsArray$i2 !== void 0 ? _valueAsArray$i2 : "", className: valueListItemClassName, disabled, placeholder: placeHolderText, onChange: function onChange(e) {
709
+ return multiValueHandler(e.target.value, i);
710
+ } }, extraProps), key);
711
+ });
712
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-testid": testID, className, title, children: [editors[0], separator, editors[1]] });
749
713
  }
750
- return _t2;
714
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_querybuilder.ValueEditor, _objectSpread4(_objectSpread4({}, allProps), {}, { skipHook: true }));
751
715
  }
752
716
  switch (type) {
753
- case "select": {
754
- }
755
- case "multiselect": {
756
- var _t3;
757
- if ($[16] !== allProps) {
758
- _t3 = (0, import_jsx_runtime5.jsx)(import_react_querybuilder.ValueEditor, _objectSpread4(_objectSpread4({}, allProps), {}, { skipHook: true }));
759
- $[16] = allProps;
760
- $[17] = _t3;
761
- } else {
762
- _t3 = $[17];
763
- }
764
- return _t3;
765
- }
766
- case "textarea": {
767
- var _t4;
768
- if ($[18] !== handleOnChange) {
769
- _t4 = function _t42(e_2) {
770
- return handleOnChange(e_2.target.value);
771
- };
772
- $[18] = handleOnChange;
773
- $[19] = _t4;
774
- } else {
775
- _t4 = $[19];
776
- }
777
- var _t5;
778
- if ($[20] !== className || $[21] !== disabled || $[22] !== extraProps || $[23] !== placeHolderText || $[24] !== _t4 || $[25] !== title || $[26] !== value) {
779
- _t5 = (0, import_jsx_runtime5.jsx)(import_antd4.Input.TextArea, _objectSpread4({ value, title, className, disabled, placeholder: placeHolderText, onChange: _t4 }, extraProps));
780
- $[20] = className;
781
- $[21] = disabled;
782
- $[22] = extraProps;
783
- $[23] = placeHolderText;
784
- $[24] = _t4;
785
- $[25] = title;
786
- $[26] = value;
787
- $[27] = _t5;
788
- } else {
789
- _t5 = $[27];
790
- }
791
- return _t5;
792
- }
793
- case "switch": {
794
- var _t6 = !!value;
795
- var _t7;
796
- if ($[28] !== handleOnChange) {
797
- _t7 = function _t72(v_1) {
798
- return handleOnChange(v_1);
799
- };
800
- $[28] = handleOnChange;
801
- $[29] = _t7;
802
- } else {
803
- _t7 = $[29];
804
- }
805
- var t4;
806
- if ($[30] !== className || $[31] !== disabled || $[32] !== extraProps || $[33] !== _t6 || $[34] !== _t7 || $[35] !== title) {
807
- t4 = (0, import_jsx_runtime5.jsx)(import_antd4.Switch, _objectSpread4({ checked: _t6, title, className, disabled, onChange: _t7 }, extraProps));
808
- $[30] = className;
809
- $[31] = disabled;
810
- $[32] = extraProps;
811
- $[33] = _t6;
812
- $[34] = _t7;
813
- $[35] = title;
814
- $[36] = t4;
815
- } else {
816
- t4 = $[36];
817
- }
818
- return t4;
819
- }
820
- case "checkbox": {
821
- var _t8;
822
- if ($[37] !== handleOnChange) {
823
- _t8 = function _t82(e_1) {
824
- return handleOnChange(e_1.target.checked);
825
- };
826
- $[37] = handleOnChange;
827
- $[38] = _t8;
828
- } else {
829
- _t8 = $[38];
830
- }
831
- var _t9 = !!value;
832
- var _t10;
833
- if ($[39] !== className || $[40] !== disabled || $[41] !== extraProps || $[42] !== _t8 || $[43] !== _t9 || $[44] !== title) {
834
- _t10 = (0, import_jsx_runtime5.jsx)("span", { title, className, children: (0, import_jsx_runtime5.jsx)(import_antd4.Checkbox, _objectSpread4({ type: "checkbox", disabled, onChange: _t8, checked: _t9 }, extraProps)) });
835
- $[39] = className;
836
- $[40] = disabled;
837
- $[41] = extraProps;
838
- $[42] = _t8;
839
- $[43] = _t9;
840
- $[44] = title;
841
- $[45] = _t10;
842
- } else {
843
- _t10 = $[45];
844
- }
845
- return _t10;
846
- }
847
- case "radio": {
848
- var _t11;
849
- if ($[46] !== className || $[47] !== disabled || $[48] !== extraProps || $[49] !== handleOnChange || $[50] !== title || $[51] !== value || $[52] !== values) {
850
- var _t12;
851
- if ($[54] !== disabled || $[55] !== extraProps || $[56] !== handleOnChange || $[57] !== value) {
852
- _t12 = function _t122(v_0) {
853
- return (0, import_jsx_runtime5.jsx)(import_antd4.Radio, _objectSpread4(_objectSpread4({ value: v_0.name, checked: value === v_0.name, disabled, onChange: function onChange(e_0) {
854
- return handleOnChange(e_0.target.value);
855
- } }, extraProps), {}, { children: v_0.label }), v_0.name);
856
- };
857
- $[54] = disabled;
858
- $[55] = extraProps;
859
- $[56] = handleOnChange;
860
- $[57] = value;
861
- $[58] = _t12;
862
- } else {
863
- _t12 = $[58];
864
- }
865
- _t11 = (0, import_jsx_runtime5.jsx)("span", { className, title, children: values.map(_t12) });
866
- $[46] = className;
867
- $[47] = disabled;
868
- $[48] = extraProps;
869
- $[49] = handleOnChange;
870
- $[50] = title;
871
- $[51] = value;
872
- $[52] = values;
873
- $[53] = _t11;
874
- } else {
875
- _t11 = $[53];
876
- }
877
- return _t11;
878
- }
717
+ case "select":
718
+ case "multiselect":
719
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectorComponent, _objectSpread4(_objectSpread4({}, propsForValueSelector), {}, { className, title, value, disabled, listsAsArrays, multiple: type === "multiselect", handleOnChange, options: values }, extraProps));
720
+ case "textarea":
721
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.Input.TextArea, _objectSpread4({ value, title, className, disabled, placeholder: placeHolderText, onChange: function onChange(e_2) {
722
+ return handleOnChange(e_2.target.value);
723
+ } }, extraProps));
724
+ case "switch":
725
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.Switch, _objectSpread4({ checked: !!value, title, className, disabled, onChange: function onChange(v_1) {
726
+ return handleOnChange(v_1);
727
+ } }, extraProps));
728
+ case "checkbox":
729
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { title, className, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.Checkbox, _objectSpread4({ type: "checkbox", disabled, onChange: function onChange(e_1) {
730
+ return handleOnChange(e_1.target.checked);
731
+ }, checked: !!value }, extraProps)) });
732
+ case "radio":
733
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className, title, children: values.map(function(v_0) {
734
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.Radio, _objectSpread4(_objectSpread4({ value: v_0.name, checked: value === v_0.name, disabled, onChange: function onChange(e_0) {
735
+ return handleOnChange(e_0.target.value);
736
+ } }, extraProps), {}, { children: v_0.label }), v_0.name);
737
+ }) });
879
738
  }
880
739
  switch (inputTypeCoerced) {
881
- case "date": {
882
- }
740
+ case "date":
883
741
  case "datetime-local": {
884
742
  if (operator === "between" || operator === "notBetween") {
885
- var _t13;
886
- if ($[59] !== className || $[60] !== disabled || $[61] !== extraProps || $[62] !== handleOnChange || $[63] !== inputTypeCoerced || $[64] !== listsAsArrays || $[65] !== placeHolderText || $[66] !== valueAsArray) {
887
- var dayjsArray = valueAsArray.slice(0, 2).map(_temp);
888
- var _t14;
889
- if ($[68] !== handleOnChange || $[69] !== inputTypeCoerced || $[70] !== listsAsArrays) {
890
- _t14 = function _t142(dates) {
891
- var timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
892
- var format2 = "YYYY-MM-DD".concat(timeFormat);
893
- var dateArray = dates === null || dates === void 0 ? void 0 : dates.map(function(d_2) {
894
- return d_2 !== null && d_2 !== void 0 && d_2.isValid() ? d_2.format(format2) : void 0;
895
- });
896
- handleOnChange(dateArray ? listsAsArrays ? dateArray : (0, import_react_querybuilder.joinWith)(dateArray, ",") : dates);
897
- };
898
- $[68] = handleOnChange;
899
- $[69] = inputTypeCoerced;
900
- $[70] = listsAsArrays;
901
- $[71] = _t14;
902
- } else {
903
- _t14 = $[71];
743
+ var dayjsArray = valueAsArray.slice(0, 2).map(function(v_2) {
744
+ return (0, import_dayjs2.default)(v_2);
745
+ });
746
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DatePicker.RangePicker, _objectSpread4({ value: dayjsArray.every(function(d_1) {
747
+ return d_1.isValid();
748
+ }) ? dayjsArray : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: [placeHolderText, placeHolderText], onChange: (
749
+ /* istanbul ignore next */
750
+ function onChange(dates) {
751
+ var timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
752
+ var format2 = "YYYY-MM-DD".concat(timeFormat);
753
+ var dateArray = dates === null || dates === void 0 ? void 0 : dates.map(function(d_2) {
754
+ return d_2 !== null && d_2 !== void 0 && d_2.isValid() ? d_2.format(format2) : void 0;
755
+ });
756
+ handleOnChange(dateArray ? listsAsArrays ? dateArray : (0, import_react_querybuilder.joinWith)(dateArray, ",") : dates);
904
757
  }
905
- _t13 = (0, import_jsx_runtime5.jsx)(DatePicker.RangePicker, _objectSpread4({ value: dayjsArray.every(_temp2) ? dayjsArray : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: [placeHolderText, placeHolderText], onChange: _t14 }, extraProps));
906
- $[59] = className;
907
- $[60] = disabled;
908
- $[61] = extraProps;
909
- $[62] = handleOnChange;
910
- $[63] = inputTypeCoerced;
911
- $[64] = listsAsArrays;
912
- $[65] = placeHolderText;
913
- $[66] = valueAsArray;
914
- $[67] = _t13;
915
- } else {
916
- _t13 = $[67];
917
- }
918
- return _t13;
758
+ ) }, extraProps));
919
759
  }
920
- var _t15;
921
- if ($[72] !== className || $[73] !== disabled || $[74] !== extraProps || $[75] !== handleOnChange || $[76] !== inputTypeCoerced || $[77] !== placeHolderText || $[78] !== value) {
922
- var dateValue_0 = (0, import_dayjs2.default)(value);
923
- var _t16;
924
- if ($[80] !== handleOnChange) {
925
- _t16 = function _t162(_d, dateString) {
926
- return handleOnChange(dateString);
927
- };
928
- $[80] = handleOnChange;
929
- $[81] = _t16;
930
- } else {
931
- _t16 = $[81];
932
- }
933
- _t15 = (0, import_jsx_runtime5.jsx)(DatePicker, _objectSpread4({ value: dateValue_0.isValid() ? dateValue_0 : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: placeHolderText, onChange: _t16 }, extraProps));
934
- $[72] = className;
935
- $[73] = disabled;
936
- $[74] = extraProps;
937
- $[75] = handleOnChange;
938
- $[76] = inputTypeCoerced;
939
- $[77] = placeHolderText;
940
- $[78] = value;
941
- $[79] = _t15;
942
- } else {
943
- _t15 = $[79];
944
- }
945
- return _t15;
760
+ var dateValue_0 = (0, import_dayjs2.default)(value);
761
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DatePicker, _objectSpread4({ value: dateValue_0.isValid() ? dateValue_0 : void 0, showTime: inputTypeCoerced === "datetime-local", className, disabled, placeholder: placeHolderText, onChange: function onChange(_d, dateString) {
762
+ return handleOnChange(dateString);
763
+ } }, extraProps));
946
764
  }
947
765
  case "time": {
948
- var _t17;
949
- if ($[82] !== className || $[83] !== disabled || $[84] !== extraProps || $[85] !== handleOnChange || $[86] !== placeHolderText || $[87] !== value) {
950
- var dateValue = (0, import_dayjs2.default)(value, "HH:mm:ss");
951
- var _t18;
952
- if ($[89] !== handleOnChange) {
953
- _t18 = function _t182(d_0) {
954
- var _d_0$format;
955
- return handleOnChange((_d_0$format = d_0 === null || d_0 === void 0 ? void 0 : d_0.format("HH:mm:ss")) !== null && _d_0$format !== void 0 ? _d_0$format : "");
956
- };
957
- $[89] = handleOnChange;
958
- $[90] = _t18;
959
- } else {
960
- _t18 = $[90];
961
- }
962
- _t17 = (0, import_jsx_runtime5.jsx)(DatePicker.TimePicker, _objectSpread4({ value: dateValue.isValid() ? dateValue : void 0, className, disabled, placeholder: placeHolderText, onChange: _t18 }, extraProps));
963
- $[82] = className;
964
- $[83] = disabled;
965
- $[84] = extraProps;
966
- $[85] = handleOnChange;
967
- $[86] = placeHolderText;
968
- $[87] = value;
969
- $[88] = _t17;
970
- } else {
971
- _t17 = $[88];
972
- }
973
- return _t17;
766
+ var dateValue = (0, import_dayjs2.default)(value, "HH:mm:ss");
767
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DatePicker.TimePicker, _objectSpread4({ value: dateValue.isValid() ? dateValue : void 0, className, disabled, placeholder: placeHolderText, onChange: function onChange(d_0) {
768
+ var _d_0$format;
769
+ return handleOnChange((_d_0$format = d_0 === null || d_0 === void 0 ? void 0 : d_0.format("HH:mm:ss")) !== null && _d_0$format !== void 0 ? _d_0$format : "");
770
+ } }, extraProps));
974
771
  }
975
772
  case "number": {
976
- var _t19;
977
- if ($[91] !== className || $[92] !== disabled || $[93] !== extraProps || $[94] !== handleOnChange || $[95] !== inputTypeCoerced || $[96] !== placeHolderText || $[97] !== title || $[98] !== value) {
978
- _t19 = (0, import_jsx_runtime5.jsx)(import_antd4.InputNumber, _objectSpread4({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: handleOnChange }, extraProps));
979
- $[91] = className;
980
- $[92] = disabled;
981
- $[93] = extraProps;
982
- $[94] = handleOnChange;
983
- $[95] = inputTypeCoerced;
984
- $[96] = placeHolderText;
985
- $[97] = title;
986
- $[98] = value;
987
- $[99] = _t19;
988
- } else {
989
- _t19 = $[99];
990
- }
991
- return _t19;
773
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.InputNumber, _objectSpread4({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: handleOnChange }, extraProps));
992
774
  }
993
775
  }
994
- var t2;
995
- if ($[100] !== handleOnChange) {
996
- t2 = function t22(e_3) {
997
- return handleOnChange(e_3.target.value);
998
- };
999
- $[100] = handleOnChange;
1000
- $[101] = t2;
1001
- } else {
1002
- t2 = $[101];
1003
- }
1004
- var t3;
1005
- if ($[102] !== className || $[103] !== disabled || $[104] !== extraProps || $[105] !== inputTypeCoerced || $[106] !== placeHolderText || $[107] !== t2 || $[108] !== title || $[109] !== value) {
1006
- t3 = (0, import_jsx_runtime5.jsx)(import_antd4.Input, _objectSpread4({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: t2 }, extraProps));
1007
- $[102] = className;
1008
- $[103] = disabled;
1009
- $[104] = extraProps;
1010
- $[105] = inputTypeCoerced;
1011
- $[106] = placeHolderText;
1012
- $[107] = t2;
1013
- $[108] = title;
1014
- $[109] = value;
1015
- $[110] = t3;
1016
- } else {
1017
- t3 = $[110];
1018
- }
1019
- return t3;
776
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.Input, _objectSpread4({ type: inputTypeCoerced, value, title, className, disabled, placeholder: placeHolderText, onChange: function onChange(e_3) {
777
+ return handleOnChange(e_3.target.value);
778
+ } }, extraProps));
1020
779
  };
1021
- function _temp(v_2) {
1022
- return (0, import_dayjs2.default)(v_2);
1023
- }
1024
- function _temp2(d_1) {
1025
- return d_1.isValid();
780
+
781
+ // ../../utils/react-compiler/react-compiler-runtime.ts
782
+ var React = __toESM(require("react"));
783
+ var $empty = Symbol["for"]("react.memo_cache_sentinel");
784
+ function c(size) {
785
+ return React.useMemo(
786
+ function() {
787
+ var $ = Array.from({ length: size });
788
+ for (var ii = 0; ii < size; ii++) {
789
+ $[ii] = $empty;
790
+ }
791
+ $[$empty] = true;
792
+ return $;
793
+ },
794
+ // eslint-disable-next-line react-hooks/exhaustive-deps
795
+ []
796
+ );
1026
797
  }
1027
798
 
1028
799
  // src/AntDValueSelector.tsx
1029
- var import_jsx_runtime7 = require("react/jsx-runtime");
1030
- var import_antd6 = require("antd");
1031
- var import_react_querybuilder3 = require("react-querybuilder");
1032
-
1033
- // src/utils.tsx
1034
800
  var import_jsx_runtime6 = require("react/jsx-runtime");
1035
801
  var import_antd5 = require("antd");
802
+ var React2 = __toESM(require("react"));
1036
803
  var import_react_querybuilder2 = require("react-querybuilder");
1037
- var OptGroup = import_antd5.Select.OptGroup;
1038
- var Option = import_antd5.Select.Option;
1039
- var toOptions = function toOptions2(arr) {
1040
- return (0, import_react_querybuilder2.isOptionGroupArray)(arr) ? arr.map(function(og) {
1041
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(OptGroup, { label: og.label, children: og.options.map(function(opt) {
1042
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Option, { value: opt.name, children: opt.label }, opt.name);
1043
- }) }, og.label);
1044
- }) : Array.isArray(arr) ? arr.map(function(opt) {
1045
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Option, { value: opt.name, children: opt.label }, opt.name);
1046
- }) : (
1047
- /* istanbul ignore next */
1048
- null
1049
- );
1050
- };
1051
-
1052
- // src/AntDValueSelector.tsx
1053
804
  function _typeof5(o) {
1054
805
  "@babel/helpers - typeof";
1055
806
  return _typeof5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
@@ -1058,7 +809,7 @@ function _typeof5(o) {
1058
809
  return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
1059
810
  }, _typeof5(o);
1060
811
  }
1061
- var _excluded4 = ["className", "handleOnChange", "options", "value", "title", "disabled", "multiple", "listsAsArrays", "testID", "rule", "rules", "level", "path", "context", "validation", "operator", "field", "fieldData", "schema"];
812
+ var _excluded5 = ["className", "handleOnChange", "options", "value", "title", "disabled", "multiple", "listsAsArrays", "testID", "rule", "rules", "level", "path", "context", "validation", "operator", "field", "fieldData", "schema"];
1062
813
  function ownKeys5(e, r) {
1063
814
  var t = Object.keys(e);
1064
815
  if (Object.getOwnPropertySymbols) {
@@ -1097,16 +848,16 @@ function _toPrimitive5(t, r) {
1097
848
  }
1098
849
  return ("string" === r ? String : Number)(t);
1099
850
  }
1100
- function _objectWithoutProperties4(e, t) {
851
+ function _objectWithoutProperties5(e, t) {
1101
852
  if (null == e) return {};
1102
- var o, r, i = _objectWithoutPropertiesLoose4(e, t);
853
+ var o, r, i = _objectWithoutPropertiesLoose5(e, t);
1103
854
  if (Object.getOwnPropertySymbols) {
1104
855
  var s = Object.getOwnPropertySymbols(e);
1105
856
  for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
1106
857
  }
1107
858
  return i;
1108
859
  }
1109
- function _objectWithoutPropertiesLoose4(r, e) {
860
+ function _objectWithoutPropertiesLoose5(r, e) {
1110
861
  if (null == r) return {};
1111
862
  var t = {};
1112
863
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
@@ -1116,7 +867,7 @@ function _objectWithoutPropertiesLoose4(r, e) {
1116
867
  return t;
1117
868
  }
1118
869
  var AntDValueSelector = function AntDValueSelector2(t0) {
1119
- var $ = c(24);
870
+ var $ = c(32);
1120
871
  var className;
1121
872
  var disabled;
1122
873
  var extraProps;
@@ -1127,12 +878,12 @@ var AntDValueSelector = function AntDValueSelector2(t0) {
1127
878
  var title;
1128
879
  var value;
1129
880
  if ($[0] !== t0) {
1130
- var _t = t0.className, _t2 = t0.handleOnChange, t3 = t0.options, t4 = t0.value, t5 = t0.title, t6 = t0.disabled, t7 = t0.multiple, t8 = t0.listsAsArrays, _testID = t0.testID, _rule = t0.rule, _rules = t0.rules, _level = t0.level, _path = t0.path, _context = t0.context, _validation = t0.validation, _operator = t0.operator, _field = t0.field, _fieldData = t0.fieldData, _schema = t0.schema, t9 = _objectWithoutProperties4(t0, _excluded4);
881
+ var _t = t0.className, _t2 = t0.handleOnChange, _t3 = t0.options, _t4 = t0.value, _t5 = t0.title, t6 = t0.disabled, t7 = t0.multiple, t8 = t0.listsAsArrays, _testID = t0.testID, _rule = t0.rule, _rules = t0.rules, _level = t0.level, _path = t0.path, _context = t0.context, _validation = t0.validation, _operator = t0.operator, _field = t0.field, _fieldData = t0.fieldData, _schema = t0.schema, t9 = _objectWithoutProperties5(t0, _excluded5);
1131
882
  className = _t;
1132
883
  handleOnChange = _t2;
1133
- options = t3;
1134
- value = t4;
1135
- title = t5;
884
+ options = _t3;
885
+ value = _t4;
886
+ title = _t5;
1136
887
  disabled = t6;
1137
888
  multiple = t7;
1138
889
  listsAsArrays = t8;
@@ -1159,40 +910,68 @@ var AntDValueSelector = function AntDValueSelector2(t0) {
1159
910
  value = $[9];
1160
911
  }
1161
912
  var t1;
1162
- if ($[10] !== handleOnChange || $[11] !== listsAsArrays || $[12] !== multiple || $[13] !== value) {
1163
- t1 = { handleOnChange, listsAsArrays, multiple, value };
913
+ if ($[10] !== handleOnChange || $[11] !== value) {
914
+ t1 = { handleOnChange, listsAsArrays: false, multiple: false, value };
1164
915
  $[10] = handleOnChange;
1165
- $[11] = listsAsArrays;
1166
- $[12] = multiple;
1167
- $[13] = value;
1168
- $[14] = t1;
916
+ $[11] = value;
917
+ $[12] = t1;
1169
918
  } else {
1170
- t1 = $[14];
919
+ t1 = $[12];
1171
920
  }
1172
- var _useValueSelector = (0, import_react_querybuilder3.useValueSelector)(t1), onChange = _useValueSelector.onChange, val = _useValueSelector.val;
1173
- var t2;
1174
- if ($[15] !== className || $[16] !== disabled || $[17] !== extraProps || $[18] !== multiple || $[19] !== onChange || $[20] !== options || $[21] !== title || $[22] !== val) {
1175
- var modeObj = multiple ? { mode: "multiple" } : {};
1176
- t2 = (0, import_jsx_runtime7.jsx)("span", { title, className, children: (0, import_jsx_runtime7.jsx)(import_antd6.Select, _objectSpread5(_objectSpread5(_objectSpread5({}, modeObj), {}, { popupMatchSelectWidth: false, disabled, value: val, onChange }, extraProps), {}, { children: toOptions(options) })) });
1177
- $[15] = className;
1178
- $[16] = disabled;
1179
- $[17] = extraProps;
1180
- $[18] = multiple;
1181
- $[19] = onChange;
1182
- $[20] = options;
1183
- $[21] = title;
1184
- $[22] = val;
1185
- $[23] = t2;
921
+ var _useValueSelector = (0, import_react_querybuilder2.useValueSelector)(t1), onChangeNoArrays = _useValueSelector.onChange;
922
+ var t2 = multiple || listsAsArrays;
923
+ var t3;
924
+ if ($[13] !== handleOnChange || $[14] !== multiple || $[15] !== t2 || $[16] !== value) {
925
+ t3 = { handleOnChange, listsAsArrays: t2, multiple, value };
926
+ $[13] = handleOnChange;
927
+ $[14] = multiple;
928
+ $[15] = t2;
929
+ $[16] = value;
930
+ $[17] = t3;
931
+ } else {
932
+ t3 = $[17];
933
+ }
934
+ var _useValueSelector2 = (0, import_react_querybuilder2.useValueSelector)(t3), onChangeNormal = _useValueSelector2.onChange, val = _useValueSelector2.val;
935
+ var t4;
936
+ if ($[18] !== listsAsArrays || $[19] !== multiple || $[20] !== onChangeNoArrays || $[21] !== onChangeNormal) {
937
+ t4 = function t42(v) {
938
+ if (multiple && !listsAsArrays && Array.isArray(v)) {
939
+ onChangeNoArrays((0, import_react_querybuilder2.joinWith)(v));
940
+ } else {
941
+ onChangeNormal(v);
942
+ }
943
+ };
944
+ $[18] = listsAsArrays;
945
+ $[19] = multiple;
946
+ $[20] = onChangeNoArrays;
947
+ $[21] = onChangeNormal;
948
+ $[22] = t4;
949
+ } else {
950
+ t4 = $[22];
951
+ }
952
+ var onChange = t4;
953
+ var t5;
954
+ if ($[23] !== className || $[24] !== disabled || $[25] !== extraProps || $[26] !== multiple || $[27] !== onChange || $[28] !== options || $[29] !== title || $[30] !== val) {
955
+ t5 = (0, import_jsx_runtime6.jsx)(import_antd5.Select, _objectSpread5(_objectSpread5({}, multiple ? { mode: "multiple", allowClear: true } : {}), {}, { title, className, popupMatchSelectWidth: false, disabled, value: val, onChange, optionFilterProp: "label", options }, extraProps));
956
+ $[23] = className;
957
+ $[24] = disabled;
958
+ $[25] = extraProps;
959
+ $[26] = multiple;
960
+ $[27] = onChange;
961
+ $[28] = options;
962
+ $[29] = title;
963
+ $[30] = val;
964
+ $[31] = t5;
1186
965
  } else {
1187
- t2 = $[23];
966
+ t5 = $[31];
1188
967
  }
1189
- return t2;
968
+ return t5;
1190
969
  };
1191
970
 
1192
971
  // src/index.tsx
1193
972
  var antdControlElements = { actionElement: AntDActionElement, dragHandle: AntDDragHandle, notToggle: AntDNotToggle, shiftActions: AntDShiftActions, valueEditor: AntDValueEditor, valueSelector: AntDValueSelector };
1194
- var antdTranslations = { removeGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.CloseOutlined, {}) }, removeRule: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.CloseOutlined, {}) }, cloneRule: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.CopyOutlined, {}) }, cloneRuleGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.CopyOutlined, {}) }, lockGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.UnlockOutlined, {}) }, lockRule: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.UnlockOutlined, {}) }, lockGroupDisabled: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.LockOutlined, {}) }, lockRuleDisabled: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.LockOutlined, {}) }, shiftActionUp: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.UpOutlined, {}) }, shiftActionDown: { label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons2.DownOutlined, {}) } };
1195
- var QueryBuilderAntD = (0, import_react_querybuilder4.getCompatContextProvider)({ controlElements: antdControlElements, translations: antdTranslations });
973
+ var antdTranslations = { removeGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.CloseOutlined, {}) }, removeRule: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.CloseOutlined, {}) }, cloneRule: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.CopyOutlined, {}) }, cloneRuleGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.CopyOutlined, {}) }, lockGroup: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.UnlockOutlined, {}) }, lockRule: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.UnlockOutlined, {}) }, lockGroupDisabled: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.LockOutlined, {}) }, lockRuleDisabled: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.LockOutlined, {}) }, shiftActionUp: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.UpOutlined, {}) }, shiftActionDown: { label: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons2.DownOutlined, {}) } };
974
+ var QueryBuilderAntD = (0, import_react_querybuilder3.getCompatContextProvider)({ controlElements: antdControlElements, translations: antdTranslations });
1196
975
  // Annotate the CommonJS export names for ESM import in node:
1197
976
  0 && (module.exports = {
1198
977
  AntDActionElement,