@react-querybuilder/antd 7.0.0-alpha.0 → 7.0.0-alpha.2
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/README.md +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.development.d.ts +116 -22
- package/dist/cjs/react-querybuilder_antd.cjs.development.js +99 -82
- package/dist/cjs/react-querybuilder_antd.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.d.ts +116 -22
- 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.mts +116 -22
- package/dist/react-querybuilder_antd.legacy-esm.d.mts +116 -22
- package/dist/react-querybuilder_antd.legacy-esm.js +97 -79
- package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_antd.mjs +94 -76
- package/dist/react-querybuilder_antd.mjs.map +1 -1
- package/dist/react-querybuilder_antd.production.d.mts +116 -22
- package/dist/react-querybuilder_antd.production.mjs +1 -1
- package/dist/react-querybuilder_antd.production.mjs.map +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import * as react_querybuilder from 'react-querybuilder';
|
|
2
|
-
import { ActionWithRulesProps, DragHandleProps, NotToggleProps, ShiftActionsProps, ValueEditorProps, VersatileSelectorProps, Controls } from 'react-querybuilder';
|
|
3
|
-
import { Button, Switch, Select } from 'antd';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
|
|
6
1
|
import { HolderOutlined } from '@ant-design/icons';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
declare const AntDActionElement: {
|
|
13
|
-
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
};
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ComponentPropsWithRef, ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import * as react_querybuilder from 'react-querybuilder';
|
|
5
|
+
import { DragHandleProps, NotToggleProps, VersatileSelectorProps, ActionWithRulesProps, ShiftActionsProps, ValueEditorProps, Field } from 'react-querybuilder';
|
|
6
|
+
import { Switch, Select, Button } from 'antd';
|
|
16
7
|
|
|
17
8
|
type AntDDragHandleProps = DragHandleProps & {
|
|
18
9
|
label?: any;
|
|
@@ -25,8 +16,23 @@ declare const AntDNotToggle: {
|
|
|
25
16
|
displayName: string;
|
|
26
17
|
};
|
|
27
18
|
|
|
19
|
+
type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;
|
|
20
|
+
declare const AntDValueSelector: {
|
|
21
|
+
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps): React.JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type RemoveDataIndexKeys<T> = {
|
|
26
|
+
[K in keyof T as `data-${string}` extends K ? never : K]: T[K];
|
|
27
|
+
};
|
|
28
|
+
type AntDActionProps = ActionWithRulesProps & RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>>;
|
|
29
|
+
declare const AntDActionElement: {
|
|
30
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
28
34
|
declare const AntDShiftActions: {
|
|
29
|
-
({
|
|
35
|
+
({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabled, disabled, className, labels, titles, testID, }: ShiftActionsProps): React.JSX.Element;
|
|
30
36
|
displayName: string;
|
|
31
37
|
};
|
|
32
38
|
|
|
@@ -35,13 +41,101 @@ declare const AntDValueEditor: {
|
|
|
35
41
|
displayName: string;
|
|
36
42
|
};
|
|
37
43
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
declare const antdControlElements: {
|
|
45
|
+
addGroupAction: {
|
|
46
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
addRuleAction: {
|
|
50
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
cloneGroupAction: {
|
|
54
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
cloneRuleAction: {
|
|
58
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
59
|
+
displayName: string;
|
|
60
|
+
};
|
|
61
|
+
lockGroupAction: {
|
|
62
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
lockRuleAction: {
|
|
66
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
combinatorSelector: {
|
|
70
|
+
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps): React.JSX.Element;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
fieldSelector: {
|
|
74
|
+
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps): React.JSX.Element;
|
|
75
|
+
displayName: string;
|
|
76
|
+
};
|
|
77
|
+
notToggle: {
|
|
78
|
+
({ className, handleOnChange, label, checked, title, disabled, path: _path, context: _context, validation: _validation, testID: _testID, schema: _schema, ruleGroup: _ruleGroup, ...extraProps }: AntDNotToggleProps): React.JSX.Element;
|
|
79
|
+
displayName: string;
|
|
80
|
+
};
|
|
81
|
+
operatorSelector: {
|
|
82
|
+
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps): React.JSX.Element;
|
|
83
|
+
displayName: string;
|
|
84
|
+
};
|
|
85
|
+
removeGroupAction: {
|
|
86
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
87
|
+
displayName: string;
|
|
88
|
+
};
|
|
89
|
+
removeRuleAction: {
|
|
90
|
+
({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps): React.JSX.Element;
|
|
91
|
+
displayName: string;
|
|
92
|
+
};
|
|
93
|
+
valueEditor: {
|
|
94
|
+
({ fieldData, operator, value, handleOnChange, title, className, type, inputType, values, listsAsArrays, parseNumbers, separator, valueSource: _vs, disabled, testID, selectorComponent: SelectorComponent, ...props }: react_querybuilder.ValueEditorProps<Field<string, string, string, react_querybuilder.Option<string>, react_querybuilder.Option<string>>, string>): React.JSX.Element | null;
|
|
95
|
+
displayName: string;
|
|
96
|
+
};
|
|
97
|
+
dragHandle: React.ForwardRefExoticComponent<Omit<AntDDragHandleProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
98
|
+
valueSourceSelector: {
|
|
99
|
+
({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps): React.JSX.Element;
|
|
100
|
+
displayName: string;
|
|
101
|
+
};
|
|
102
|
+
shiftActions: {
|
|
103
|
+
({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabled, disabled, className, labels, titles, testID, }: react_querybuilder.ShiftActionsProps): React.JSX.Element;
|
|
104
|
+
displayName: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
declare const antdTranslations: {
|
|
108
|
+
removeGroup: {
|
|
109
|
+
label: React.JSX.Element;
|
|
110
|
+
};
|
|
111
|
+
removeRule: {
|
|
112
|
+
label: React.JSX.Element;
|
|
113
|
+
};
|
|
114
|
+
cloneRule: {
|
|
115
|
+
label: React.JSX.Element;
|
|
116
|
+
};
|
|
117
|
+
cloneRuleGroup: {
|
|
118
|
+
label: React.JSX.Element;
|
|
119
|
+
};
|
|
120
|
+
lockGroup: {
|
|
121
|
+
label: React.JSX.Element;
|
|
122
|
+
};
|
|
123
|
+
lockRule: {
|
|
124
|
+
label: React.JSX.Element;
|
|
125
|
+
};
|
|
126
|
+
lockGroupDisabled: {
|
|
127
|
+
label: React.JSX.Element;
|
|
128
|
+
};
|
|
129
|
+
lockRuleDisabled: {
|
|
130
|
+
label: React.JSX.Element;
|
|
131
|
+
};
|
|
132
|
+
shiftActionUp: {
|
|
133
|
+
label: React.JSX.Element;
|
|
134
|
+
};
|
|
135
|
+
shiftActionDown: {
|
|
136
|
+
label: React.JSX.Element;
|
|
137
|
+
};
|
|
42
138
|
};
|
|
43
|
-
|
|
44
|
-
declare const antdControlElements: Partial<Controls>;
|
|
45
139
|
declare const QueryBuilderAntD: react_querybuilder.QueryBuilderContextProvider<Record<string, any>>;
|
|
46
140
|
|
|
47
|
-
export { AntDActionElement, AntDActionProps, AntDDragHandle, AntDDragHandleProps, AntDNotToggle, AntDNotToggleProps, AntDShiftActions, AntDValueEditor, AntDValueSelector, AntDValueSelectorProps, QueryBuilderAntD, antdControlElements };
|
|
141
|
+
export { AntDActionElement, AntDActionProps, AntDDragHandle, AntDDragHandleProps, AntDNotToggle, AntDNotToggleProps, AntDShiftActions, AntDValueEditor, AntDValueSelector, AntDValueSelectorProps, QueryBuilderAntD, antdControlElements, antdTranslations };
|
|
@@ -965,12 +965,11 @@ var require_dayjs = __commonJS({
|
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
};
|
|
968
|
-
var _default = generateConfig;
|
|
969
|
-
exports.default = _default;
|
|
968
|
+
var _default = exports.default = generateConfig;
|
|
970
969
|
}
|
|
971
970
|
});
|
|
972
971
|
|
|
973
|
-
// src/index.
|
|
972
|
+
// src/index.tsx
|
|
974
973
|
var src_exports = {};
|
|
975
974
|
__export(src_exports, {
|
|
976
975
|
AntDActionElement: () => AntDActionElement,
|
|
@@ -980,10 +979,13 @@ __export(src_exports, {
|
|
|
980
979
|
AntDValueEditor: () => AntDValueEditor,
|
|
981
980
|
AntDValueSelector: () => AntDValueSelector,
|
|
982
981
|
QueryBuilderAntD: () => QueryBuilderAntD,
|
|
983
|
-
antdControlElements: () => antdControlElements
|
|
982
|
+
antdControlElements: () => antdControlElements,
|
|
983
|
+
antdTranslations: () => antdTranslations
|
|
984
984
|
});
|
|
985
985
|
module.exports = __toCommonJS(src_exports);
|
|
986
|
-
var
|
|
986
|
+
var import_icons2 = require("@ant-design/icons");
|
|
987
|
+
var React8 = __toESM(require("react"));
|
|
988
|
+
var import_react_querybuilder4 = require("react-querybuilder");
|
|
987
989
|
|
|
988
990
|
// src/AntDActionElement.tsx
|
|
989
991
|
var import_antd = require("antd");
|
|
@@ -1076,70 +1078,60 @@ var AntDNotToggle = ({
|
|
|
1076
1078
|
AntDNotToggle.displayName = "AntDNotToggle";
|
|
1077
1079
|
|
|
1078
1080
|
// src/AntDShiftActions.tsx
|
|
1079
|
-
var import_icons2 = require("@ant-design/icons");
|
|
1080
1081
|
var import_antd3 = require("antd");
|
|
1081
1082
|
var React4 = __toESM(require("react"));
|
|
1082
|
-
var import_react_querybuilder = require("react-querybuilder");
|
|
1083
1083
|
var AntDShiftActions = ({
|
|
1084
|
-
|
|
1084
|
+
shiftUp,
|
|
1085
|
+
shiftDown,
|
|
1086
|
+
shiftUpDisabled,
|
|
1087
|
+
shiftDownDisabled,
|
|
1085
1088
|
disabled,
|
|
1086
1089
|
className,
|
|
1087
|
-
|
|
1090
|
+
labels,
|
|
1088
1091
|
titles,
|
|
1089
|
-
testID
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
), /* @__PURE__ */ React4.createElement(
|
|
1112
|
-
import_antd3.Button,
|
|
1113
|
-
{
|
|
1114
|
-
type: "primary",
|
|
1115
|
-
size: "small",
|
|
1116
|
-
title: titles?.shiftDown,
|
|
1117
|
-
onClick: shiftDown,
|
|
1118
|
-
disabled: shiftDownDisabled
|
|
1119
|
-
},
|
|
1120
|
-
/* @__PURE__ */ React4.createElement(import_icons2.CaretDownOutlined, null)
|
|
1121
|
-
));
|
|
1122
|
-
};
|
|
1092
|
+
testID
|
|
1093
|
+
}) => /* @__PURE__ */ React4.createElement("div", { "data-testid": testID, className }, /* @__PURE__ */ React4.createElement(
|
|
1094
|
+
import_antd3.Button,
|
|
1095
|
+
{
|
|
1096
|
+
type: "primary",
|
|
1097
|
+
size: "small",
|
|
1098
|
+
title: titles?.shiftUp,
|
|
1099
|
+
onClick: shiftUp,
|
|
1100
|
+
disabled: disabled || shiftUpDisabled
|
|
1101
|
+
},
|
|
1102
|
+
labels?.shiftUp
|
|
1103
|
+
), /* @__PURE__ */ React4.createElement(
|
|
1104
|
+
import_antd3.Button,
|
|
1105
|
+
{
|
|
1106
|
+
type: "primary",
|
|
1107
|
+
size: "small",
|
|
1108
|
+
title: titles?.shiftDown,
|
|
1109
|
+
onClick: shiftDown,
|
|
1110
|
+
disabled: disabled || shiftDownDisabled
|
|
1111
|
+
},
|
|
1112
|
+
labels?.shiftDown
|
|
1113
|
+
));
|
|
1123
1114
|
AntDShiftActions.displayName = "AntDShiftActions";
|
|
1124
1115
|
|
|
1125
1116
|
// src/AntDValueEditor.tsx
|
|
1126
1117
|
var import_antd6 = require("antd");
|
|
1118
|
+
var import_generatePicker = __toESM(require("antd/es/date-picker/generatePicker/index.js"));
|
|
1127
1119
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
1128
1120
|
var import_dayjs2 = __toESM(require_dayjs());
|
|
1129
1121
|
var React7 = __toESM(require("react"));
|
|
1130
|
-
var
|
|
1122
|
+
var import_react_querybuilder3 = require("react-querybuilder");
|
|
1131
1123
|
|
|
1132
1124
|
// src/AntDValueSelector.tsx
|
|
1133
1125
|
var import_antd5 = require("antd");
|
|
1134
1126
|
var React6 = __toESM(require("react"));
|
|
1135
|
-
var
|
|
1127
|
+
var import_react_querybuilder2 = require("react-querybuilder");
|
|
1136
1128
|
|
|
1137
1129
|
// src/utils.tsx
|
|
1138
1130
|
var import_antd4 = require("antd");
|
|
1139
1131
|
var React5 = __toESM(require("react"));
|
|
1140
|
-
var
|
|
1132
|
+
var import_react_querybuilder = require("react-querybuilder");
|
|
1141
1133
|
var { OptGroup, Option } = import_antd4.Select;
|
|
1142
|
-
var toOptions = (arr) => (0,
|
|
1134
|
+
var toOptions = (arr) => (0, import_react_querybuilder.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)) : (
|
|
1143
1135
|
/* istanbul ignore next */
|
|
1144
1136
|
null
|
|
1145
1137
|
);
|
|
@@ -1168,7 +1160,7 @@ var AntDValueSelector = ({
|
|
|
1168
1160
|
schema: _schema,
|
|
1169
1161
|
...extraProps
|
|
1170
1162
|
}) => {
|
|
1171
|
-
const { onChange, val } = (0,
|
|
1163
|
+
const { onChange, val } = (0, import_react_querybuilder2.useValueSelector)({ handleOnChange, listsAsArrays, multiple, value });
|
|
1172
1164
|
const modeObj = multiple ? { mode: "multiple" } : {};
|
|
1173
1165
|
return /* @__PURE__ */ React6.createElement("span", { title, className }, /* @__PURE__ */ React6.createElement(
|
|
1174
1166
|
import_antd5.Select,
|
|
@@ -1186,7 +1178,7 @@ var AntDValueSelector = ({
|
|
|
1186
1178
|
AntDValueSelector.displayName = "AntDValueSelector";
|
|
1187
1179
|
|
|
1188
1180
|
// src/AntDValueEditor.tsx
|
|
1189
|
-
var DatePicker =
|
|
1181
|
+
var DatePicker = (0, import_generatePicker.default)(import_dayjs2.default);
|
|
1190
1182
|
var AntDValueEditor = ({
|
|
1191
1183
|
fieldData,
|
|
1192
1184
|
operator,
|
|
@@ -1206,7 +1198,7 @@ var AntDValueEditor = ({
|
|
|
1206
1198
|
selectorComponent: SelectorComponent = AntDValueSelector,
|
|
1207
1199
|
...props
|
|
1208
1200
|
}) => {
|
|
1209
|
-
const { valueAsArray, multiValueHandler } = (0,
|
|
1201
|
+
const { valueAsArray, multiValueHandler } = (0, import_react_querybuilder3.useValueEditor)({
|
|
1210
1202
|
handleOnChange,
|
|
1211
1203
|
inputType,
|
|
1212
1204
|
operator,
|
|
@@ -1227,11 +1219,11 @@ var AntDValueEditor = ({
|
|
|
1227
1219
|
if (type === "text") {
|
|
1228
1220
|
if (inputTypeCoerced === "time") {
|
|
1229
1221
|
return /* @__PURE__ */ React7.createElement(
|
|
1230
|
-
|
|
1222
|
+
DatePicker.TimePicker,
|
|
1231
1223
|
{
|
|
1232
1224
|
key,
|
|
1233
1225
|
value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
|
|
1234
|
-
className:
|
|
1226
|
+
className: import_react_querybuilder3.standardClassnames.valueListItem,
|
|
1235
1227
|
disabled,
|
|
1236
1228
|
placeholder: placeHolderText,
|
|
1237
1229
|
onChange: (d) => multiValueHandler(d?.format("HH:mm:ss") ?? "", i)
|
|
@@ -1244,7 +1236,7 @@ var AntDValueEditor = ({
|
|
|
1244
1236
|
key,
|
|
1245
1237
|
type: inputTypeCoerced,
|
|
1246
1238
|
value: valueAsArray[i] ?? "",
|
|
1247
|
-
className:
|
|
1239
|
+
className: import_react_querybuilder3.standardClassnames.valueListItem,
|
|
1248
1240
|
disabled,
|
|
1249
1241
|
placeholder: placeHolderText,
|
|
1250
1242
|
onChange: (e) => multiValueHandler(e.target.value, i)
|
|
@@ -1256,10 +1248,10 @@ var AntDValueEditor = ({
|
|
|
1256
1248
|
{
|
|
1257
1249
|
...props,
|
|
1258
1250
|
key,
|
|
1259
|
-
className:
|
|
1251
|
+
className: import_react_querybuilder3.standardClassnames.valueListItem,
|
|
1260
1252
|
handleOnChange: (v) => multiValueHandler(v, i),
|
|
1261
1253
|
disabled,
|
|
1262
|
-
value: valueAsArray[i] ?? (0,
|
|
1254
|
+
value: valueAsArray[i] ?? (0, import_react_querybuilder3.getFirstOption)(values),
|
|
1263
1255
|
options: values,
|
|
1264
1256
|
listsAsArrays
|
|
1265
1257
|
}
|
|
@@ -1332,28 +1324,36 @@ var AntDValueEditor = ({
|
|
|
1332
1324
|
}
|
|
1333
1325
|
switch (inputTypeCoerced) {
|
|
1334
1326
|
case "date":
|
|
1335
|
-
case "datetime-local":
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
(
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1327
|
+
case "datetime-local": {
|
|
1328
|
+
if (operator === "between" || operator === "notBetween") {
|
|
1329
|
+
const dayjsArray = valueAsArray.slice(0, 2).map(import_dayjs.default);
|
|
1330
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1331
|
+
DatePicker.RangePicker,
|
|
1332
|
+
{
|
|
1333
|
+
value: dayjsArray.every((d) => d.isValid()) ? dayjsArray : void 0,
|
|
1334
|
+
showTime: inputTypeCoerced === "datetime-local",
|
|
1335
|
+
className,
|
|
1336
|
+
disabled,
|
|
1337
|
+
placeholder: [placeHolderText, placeHolderText],
|
|
1338
|
+
onChange: (
|
|
1339
|
+
/* istanbul ignore next */
|
|
1340
|
+
(dates) => {
|
|
1341
|
+
const timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
|
|
1342
|
+
const format = `YYYY-MM-DD${timeFormat}`;
|
|
1343
|
+
const dateArray = dates?.map((d) => d?.isValid() ? d.format(format) : void 0);
|
|
1344
|
+
handleOnChange(
|
|
1345
|
+
dateArray ? listsAsArrays ? dateArray : (0, import_react_querybuilder3.joinWith)(dateArray, ",") : dates
|
|
1346
|
+
);
|
|
1347
|
+
}
|
|
1348
|
+
)
|
|
1349
|
+
}
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
const dateValue = (0, import_dayjs.default)(value);
|
|
1353
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1354
1354
|
DatePicker,
|
|
1355
1355
|
{
|
|
1356
|
-
value:
|
|
1356
|
+
value: dateValue.isValid() ? dateValue : void 0,
|
|
1357
1357
|
showTime: inputTypeCoerced === "datetime-local",
|
|
1358
1358
|
className,
|
|
1359
1359
|
disabled,
|
|
@@ -1361,17 +1361,20 @@ var AntDValueEditor = ({
|
|
|
1361
1361
|
onChange: (_d, dateString) => handleOnChange(dateString)
|
|
1362
1362
|
}
|
|
1363
1363
|
);
|
|
1364
|
-
|
|
1364
|
+
}
|
|
1365
|
+
case "time": {
|
|
1366
|
+
const dateValue = (0, import_dayjs.default)(value, "HH:mm:ss");
|
|
1365
1367
|
return /* @__PURE__ */ React7.createElement(
|
|
1366
|
-
|
|
1368
|
+
DatePicker.TimePicker,
|
|
1367
1369
|
{
|
|
1368
|
-
value:
|
|
1370
|
+
value: dateValue.isValid() ? dateValue : void 0,
|
|
1369
1371
|
className,
|
|
1370
1372
|
disabled,
|
|
1371
1373
|
placeholder: placeHolderText,
|
|
1372
1374
|
onChange: (d) => handleOnChange(d?.format("HH:mm:ss") ?? "")
|
|
1373
1375
|
}
|
|
1374
1376
|
);
|
|
1377
|
+
}
|
|
1375
1378
|
}
|
|
1376
1379
|
return /* @__PURE__ */ React7.createElement(
|
|
1377
1380
|
import_antd6.Input,
|
|
@@ -1388,7 +1391,7 @@ var AntDValueEditor = ({
|
|
|
1388
1391
|
};
|
|
1389
1392
|
AntDValueEditor.displayName = "AntDValueEditor";
|
|
1390
1393
|
|
|
1391
|
-
// src/index.
|
|
1394
|
+
// src/index.tsx
|
|
1392
1395
|
var antdControlElements = {
|
|
1393
1396
|
addGroupAction: AntDActionElement,
|
|
1394
1397
|
addRuleAction: AntDActionElement,
|
|
@@ -1407,9 +1410,22 @@ var antdControlElements = {
|
|
|
1407
1410
|
valueSourceSelector: AntDValueSelector,
|
|
1408
1411
|
shiftActions: AntDShiftActions
|
|
1409
1412
|
};
|
|
1410
|
-
var
|
|
1413
|
+
var antdTranslations = {
|
|
1414
|
+
removeGroup: { label: /* @__PURE__ */ React8.createElement(import_icons2.CloseOutlined, null) },
|
|
1415
|
+
removeRule: { label: /* @__PURE__ */ React8.createElement(import_icons2.CloseOutlined, null) },
|
|
1416
|
+
cloneRule: { label: /* @__PURE__ */ React8.createElement(import_icons2.CopyOutlined, null) },
|
|
1417
|
+
cloneRuleGroup: { label: /* @__PURE__ */ React8.createElement(import_icons2.CopyOutlined, null) },
|
|
1418
|
+
lockGroup: { label: /* @__PURE__ */ React8.createElement(import_icons2.UnlockOutlined, null) },
|
|
1419
|
+
lockRule: { label: /* @__PURE__ */ React8.createElement(import_icons2.UnlockOutlined, null) },
|
|
1420
|
+
lockGroupDisabled: { label: /* @__PURE__ */ React8.createElement(import_icons2.LockOutlined, null) },
|
|
1421
|
+
lockRuleDisabled: { label: /* @__PURE__ */ React8.createElement(import_icons2.LockOutlined, null) },
|
|
1422
|
+
shiftActionUp: { label: /* @__PURE__ */ React8.createElement(import_icons2.UpOutlined, null) },
|
|
1423
|
+
shiftActionDown: { label: /* @__PURE__ */ React8.createElement(import_icons2.DownOutlined, null) }
|
|
1424
|
+
};
|
|
1425
|
+
var QueryBuilderAntD = (0, import_react_querybuilder4.getCompatContextProvider)({
|
|
1411
1426
|
key: "antd",
|
|
1412
|
-
controlElements: antdControlElements
|
|
1427
|
+
controlElements: antdControlElements,
|
|
1428
|
+
translations: antdTranslations
|
|
1413
1429
|
});
|
|
1414
1430
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1415
1431
|
0 && (module.exports = {
|
|
@@ -1420,6 +1436,7 @@ var QueryBuilderAntD = (0, import_react_querybuilder5.getCompatContextProvider)(
|
|
|
1420
1436
|
AntDValueEditor,
|
|
1421
1437
|
AntDValueSelector,
|
|
1422
1438
|
QueryBuilderAntD,
|
|
1423
|
-
antdControlElements
|
|
1439
|
+
antdControlElements,
|
|
1440
|
+
antdTranslations
|
|
1424
1441
|
});
|
|
1425
1442
|
//# sourceMappingURL=react-querybuilder_antd.cjs.development.js.map
|