@react-querybuilder/antd 6.3.0-alpha.0 → 6.3.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.
- package/dist/cjs/react-querybuilder_antd.cjs.development.js +40 -45
- 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.d.ts +2 -2
- package/dist/react-querybuilder_antd.legacy-esm.js +40 -47
- package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_antd.mjs +40 -45
- 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 +7 -7
|
@@ -860,7 +860,7 @@ import { getCompatContextProvider } from "react-querybuilder";
|
|
|
860
860
|
|
|
861
861
|
// src/AntDActionElement.tsx
|
|
862
862
|
import { Button } from "antd";
|
|
863
|
-
import
|
|
863
|
+
import * as React from "react";
|
|
864
864
|
var AntDActionElement = ({
|
|
865
865
|
className,
|
|
866
866
|
handleOnClick,
|
|
@@ -878,7 +878,7 @@ var AntDActionElement = ({
|
|
|
878
878
|
ruleOrGroup: _ruleOrGroup,
|
|
879
879
|
schema: _schema,
|
|
880
880
|
...extraProps
|
|
881
|
-
}) => /* @__PURE__ */
|
|
881
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
882
882
|
Button,
|
|
883
883
|
{
|
|
884
884
|
type: "primary",
|
|
@@ -886,16 +886,16 @@ var AntDActionElement = ({
|
|
|
886
886
|
title: disabledTranslation && disabled ? disabledTranslation.title : title,
|
|
887
887
|
onClick: (e) => handleOnClick(e),
|
|
888
888
|
disabled: disabled && !disabledTranslation,
|
|
889
|
-
...extraProps
|
|
890
|
-
|
|
891
|
-
|
|
889
|
+
...extraProps
|
|
890
|
+
},
|
|
891
|
+
disabledTranslation && disabled ? disabledTranslation.label : label
|
|
892
892
|
);
|
|
893
893
|
AntDActionElement.displayName = "AntDActionElement";
|
|
894
894
|
|
|
895
895
|
// src/AntDDragHandle.tsx
|
|
896
896
|
import { HolderOutlined } from "@ant-design/icons";
|
|
897
|
+
import * as React2 from "react";
|
|
897
898
|
import { forwardRef } from "react";
|
|
898
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
899
899
|
var AntDDragHandle = forwardRef(
|
|
900
900
|
({
|
|
901
901
|
className,
|
|
@@ -910,13 +910,13 @@ var AntDDragHandle = forwardRef(
|
|
|
910
910
|
validation: _validation,
|
|
911
911
|
schema: _schema,
|
|
912
912
|
...extraProps
|
|
913
|
-
}, dragRef) => /* @__PURE__ */
|
|
913
|
+
}, dragRef) => /* @__PURE__ */ React2.createElement(HolderOutlined, { ref: dragRef, className, title, ...extraProps })
|
|
914
914
|
);
|
|
915
915
|
AntDDragHandle.displayName = "AntDDragHandle";
|
|
916
916
|
|
|
917
917
|
// src/AntDNotToggle.tsx
|
|
918
918
|
import { Switch } from "antd";
|
|
919
|
-
import
|
|
919
|
+
import * as React3 from "react";
|
|
920
920
|
var AntDNotToggle = ({
|
|
921
921
|
className,
|
|
922
922
|
handleOnChange,
|
|
@@ -931,7 +931,7 @@ var AntDNotToggle = ({
|
|
|
931
931
|
testID: _testID,
|
|
932
932
|
schema: _schema,
|
|
933
933
|
...extraProps
|
|
934
|
-
}) => /* @__PURE__ */
|
|
934
|
+
}) => /* @__PURE__ */ React3.createElement(
|
|
935
935
|
Switch,
|
|
936
936
|
{
|
|
937
937
|
title,
|
|
@@ -951,6 +951,7 @@ var import_dayjs = __toESM(require_dayjs_min());
|
|
|
951
951
|
var import_dayjs2 = __toESM(require_dayjs());
|
|
952
952
|
import { Checkbox, Input, Radio, Switch as Switch2, TimePicker } from "antd";
|
|
953
953
|
import generatePicker from "antd/es/date-picker/generatePicker/index.js";
|
|
954
|
+
import * as React6 from "react";
|
|
954
955
|
import {
|
|
955
956
|
getFirstOption,
|
|
956
957
|
standardClassnames,
|
|
@@ -960,20 +961,20 @@ import {
|
|
|
960
961
|
|
|
961
962
|
// src/AntDValueSelector.tsx
|
|
962
963
|
import { Select as Select2 } from "antd";
|
|
964
|
+
import * as React5 from "react";
|
|
963
965
|
import { useValueSelector } from "react-querybuilder";
|
|
964
966
|
|
|
965
967
|
// src/utils.tsx
|
|
966
968
|
import { Select } from "antd";
|
|
969
|
+
import * as React4 from "react";
|
|
967
970
|
import { isOptionGroupArray } from "react-querybuilder";
|
|
968
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
969
971
|
var { OptGroup, Option } = Select;
|
|
970
|
-
var toOptions = (arr) => isOptionGroupArray(arr) ? arr.map((og) => /* @__PURE__ */
|
|
972
|
+
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)) : (
|
|
971
973
|
/* istanbul ignore next */
|
|
972
974
|
null
|
|
973
975
|
);
|
|
974
976
|
|
|
975
977
|
// src/AntDValueSelector.tsx
|
|
976
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
977
978
|
var AntDValueSelector = ({
|
|
978
979
|
className,
|
|
979
980
|
handleOnChange,
|
|
@@ -998,7 +999,7 @@ var AntDValueSelector = ({
|
|
|
998
999
|
}) => {
|
|
999
1000
|
const { onChange, val } = useValueSelector({ handleOnChange, listsAsArrays, multiple, value });
|
|
1000
1001
|
const modeObj = multiple ? { mode: "multiple" } : {};
|
|
1001
|
-
return /* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ React5.createElement("span", { title, className }, /* @__PURE__ */ React5.createElement(
|
|
1002
1003
|
Select2,
|
|
1003
1004
|
{
|
|
1004
1005
|
...modeObj,
|
|
@@ -1006,16 +1007,14 @@ var AntDValueSelector = ({
|
|
|
1006
1007
|
disabled,
|
|
1007
1008
|
value: val,
|
|
1008
1009
|
onChange,
|
|
1009
|
-
...extraProps
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
)
|
|
1010
|
+
...extraProps
|
|
1011
|
+
},
|
|
1012
|
+
toOptions(options)
|
|
1013
|
+
));
|
|
1013
1014
|
};
|
|
1014
1015
|
AntDValueSelector.displayName = "AntDValueSelector";
|
|
1015
1016
|
|
|
1016
1017
|
// src/AntDValueEditor.tsx
|
|
1017
|
-
import { jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
1018
|
-
import { createElement } from "react";
|
|
1019
1018
|
var DatePicker = generatePicker(import_dayjs2.default);
|
|
1020
1019
|
var AntDValueEditor = ({
|
|
1021
1020
|
fieldData,
|
|
@@ -1056,32 +1055,32 @@ var AntDValueEditor = ({
|
|
|
1056
1055
|
const editors = ["from", "to"].map((key, i) => {
|
|
1057
1056
|
if (type === "text") {
|
|
1058
1057
|
if (inputTypeCoerced === "time") {
|
|
1059
|
-
return /* @__PURE__ */
|
|
1058
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1060
1059
|
TimePicker,
|
|
1061
1060
|
{
|
|
1061
|
+
key,
|
|
1062
1062
|
value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
|
|
1063
1063
|
className: standardClassnames.valueListItem,
|
|
1064
1064
|
disabled,
|
|
1065
1065
|
placeholder: placeHolderText,
|
|
1066
1066
|
onChange: (d) => multiValueHandler(d?.format("HH:mm:ss") ?? "", i)
|
|
1067
|
-
}
|
|
1068
|
-
key
|
|
1067
|
+
}
|
|
1069
1068
|
);
|
|
1070
1069
|
}
|
|
1071
|
-
return /* @__PURE__ */
|
|
1070
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1072
1071
|
Input,
|
|
1073
1072
|
{
|
|
1073
|
+
key,
|
|
1074
1074
|
type: inputTypeCoerced,
|
|
1075
1075
|
value: valueAsArray[i] ?? "",
|
|
1076
1076
|
className: standardClassnames.valueListItem,
|
|
1077
1077
|
disabled,
|
|
1078
1078
|
placeholder: placeHolderText,
|
|
1079
1079
|
onChange: (e) => multiValueHandler(e.target.value, i)
|
|
1080
|
-
}
|
|
1081
|
-
key
|
|
1080
|
+
}
|
|
1082
1081
|
);
|
|
1083
1082
|
}
|
|
1084
|
-
return /* @__PURE__ */ createElement(
|
|
1083
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1085
1084
|
SelectorComponent,
|
|
1086
1085
|
{
|
|
1087
1086
|
...props,
|
|
@@ -1095,16 +1094,12 @@ var AntDValueEditor = ({
|
|
|
1095
1094
|
}
|
|
1096
1095
|
);
|
|
1097
1096
|
});
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
editors[0],
|
|
1100
|
-
separator,
|
|
1101
|
-
editors[1]
|
|
1102
|
-
] });
|
|
1097
|
+
return /* @__PURE__ */ React6.createElement("span", { "data-testid": testID, className, title }, editors[0], separator, editors[1]);
|
|
1103
1098
|
}
|
|
1104
1099
|
switch (type) {
|
|
1105
1100
|
case "select":
|
|
1106
1101
|
case "multiselect":
|
|
1107
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1108
1103
|
SelectorComponent,
|
|
1109
1104
|
{
|
|
1110
1105
|
...props,
|
|
@@ -1119,7 +1114,7 @@ var AntDValueEditor = ({
|
|
|
1119
1114
|
}
|
|
1120
1115
|
);
|
|
1121
1116
|
case "textarea":
|
|
1122
|
-
return /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1123
1118
|
Input.TextArea,
|
|
1124
1119
|
{
|
|
1125
1120
|
value,
|
|
@@ -1131,7 +1126,7 @@ var AntDValueEditor = ({
|
|
|
1131
1126
|
}
|
|
1132
1127
|
);
|
|
1133
1128
|
case "switch":
|
|
1134
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1135
1130
|
Switch2,
|
|
1136
1131
|
{
|
|
1137
1132
|
checked: !!value,
|
|
@@ -1142,7 +1137,7 @@ var AntDValueEditor = ({
|
|
|
1142
1137
|
}
|
|
1143
1138
|
);
|
|
1144
1139
|
case "checkbox":
|
|
1145
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ React6.createElement("span", { title, className }, /* @__PURE__ */ React6.createElement(
|
|
1146
1141
|
Checkbox,
|
|
1147
1142
|
{
|
|
1148
1143
|
type: "checkbox",
|
|
@@ -1150,24 +1145,24 @@ var AntDValueEditor = ({
|
|
|
1150
1145
|
onChange: (e) => handleOnChange(e.target.checked),
|
|
1151
1146
|
checked: !!value
|
|
1152
1147
|
}
|
|
1153
|
-
)
|
|
1148
|
+
));
|
|
1154
1149
|
case "radio":
|
|
1155
|
-
return /* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ React6.createElement("span", { className, title }, values.map((v) => /* @__PURE__ */ React6.createElement(
|
|
1156
1151
|
Radio,
|
|
1157
1152
|
{
|
|
1153
|
+
key: v.name,
|
|
1158
1154
|
value: v.name,
|
|
1159
1155
|
checked: value === v.name,
|
|
1160
1156
|
disabled,
|
|
1161
|
-
onChange: (e) => handleOnChange(e.target.value)
|
|
1162
|
-
children: v.label
|
|
1157
|
+
onChange: (e) => handleOnChange(e.target.value)
|
|
1163
1158
|
},
|
|
1164
|
-
v.
|
|
1165
|
-
))
|
|
1159
|
+
v.label
|
|
1160
|
+
)));
|
|
1166
1161
|
}
|
|
1167
1162
|
switch (inputTypeCoerced) {
|
|
1168
1163
|
case "date":
|
|
1169
1164
|
case "datetime-local":
|
|
1170
|
-
return operator === "between" || operator === "notBetween" ? /* @__PURE__ */
|
|
1165
|
+
return operator === "between" || operator === "notBetween" ? /* @__PURE__ */ React6.createElement(
|
|
1171
1166
|
DatePicker.RangePicker,
|
|
1172
1167
|
{
|
|
1173
1168
|
value: toArray(value)?.length >= 2 ? toArray(value).map((v) => (0, import_dayjs.default)(v)) : void 0,
|
|
@@ -1184,7 +1179,7 @@ var AntDValueEditor = ({
|
|
|
1184
1179
|
}
|
|
1185
1180
|
)
|
|
1186
1181
|
}
|
|
1187
|
-
) : /* @__PURE__ */
|
|
1182
|
+
) : /* @__PURE__ */ React6.createElement(
|
|
1188
1183
|
DatePicker,
|
|
1189
1184
|
{
|
|
1190
1185
|
value: value ? (0, import_dayjs.default)(value) : null,
|
|
@@ -1196,7 +1191,7 @@ var AntDValueEditor = ({
|
|
|
1196
1191
|
}
|
|
1197
1192
|
);
|
|
1198
1193
|
case "time":
|
|
1199
|
-
return /* @__PURE__ */
|
|
1194
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1200
1195
|
TimePicker,
|
|
1201
1196
|
{
|
|
1202
1197
|
value: value ? (0, import_dayjs.default)(value, "HH:mm:ss") : null,
|
|
@@ -1207,7 +1202,7 @@ var AntDValueEditor = ({
|
|
|
1207
1202
|
}
|
|
1208
1203
|
);
|
|
1209
1204
|
}
|
|
1210
|
-
return /* @__PURE__ */
|
|
1205
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1211
1206
|
Input,
|
|
1212
1207
|
{
|
|
1213
1208
|
type: inputTypeCoerced,
|