@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.
@@ -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
- type RemoveDataIndexKeys<T> = {
9
- [K in keyof T as `data-${string}` extends K ? never : K]: T[K];
10
- };
11
- type AntDActionProps = ActionWithRulesProps & RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>>;
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
- ({ path, disabled, className, titles, testID, lastInGroup, schema: { combinators, dispatchQuery, getQuery }, }: ShiftActionsProps): React.JSX.Element;
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
- type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;
39
- declare const AntDValueSelector: {
40
- ({ 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;
41
- displayName: string;
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 };
@@ -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
- type RemoveDataIndexKeys<T> = {
9
- [K in keyof T as `data-${string}` extends K ? never : K]: T[K];
10
- };
11
- type AntDActionProps = ActionWithRulesProps & RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>>;
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
- ({ path, disabled, className, titles, testID, lastInGroup, schema: { combinators, dispatchQuery, getQuery }, }: ShiftActionsProps): React.JSX.Element;
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
- type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;
39
- declare const AntDValueSelector: {
40
- ({ 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;
41
- displayName: string;
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 };
@@ -988,12 +988,20 @@ var require_dayjs = __commonJS({
988
988
  }
989
989
  }
990
990
  };
991
- var _default = generateConfig;
992
- exports.default = _default;
991
+ var _default = exports.default = generateConfig;
993
992
  }
994
993
  });
995
994
 
996
- // src/index.ts
995
+ // src/index.tsx
996
+ import {
997
+ CloseOutlined,
998
+ CopyOutlined,
999
+ DownOutlined,
1000
+ LockOutlined,
1001
+ UnlockOutlined,
1002
+ UpOutlined
1003
+ } from "@ant-design/icons";
1004
+ import * as React8 from "react";
997
1005
  import { getCompatContextProvider } from "react-querybuilder";
998
1006
 
999
1007
  // src/AntDActionElement.tsx
@@ -1131,63 +1139,48 @@ var AntDNotToggle = (_a) => {
1131
1139
  AntDNotToggle.displayName = "AntDNotToggle";
1132
1140
 
1133
1141
  // src/AntDShiftActions.tsx
1134
- import { CaretDownOutlined, CaretUpOutlined } from "@ant-design/icons";
1135
1142
  import { Button as Button2 } from "antd";
1136
1143
  import * as React4 from "react";
1137
- import { useShiftActions } from "react-querybuilder";
1138
1144
  var AntDShiftActions = ({
1139
- path,
1145
+ shiftUp,
1146
+ shiftDown,
1147
+ shiftUpDisabled,
1148
+ shiftDownDisabled,
1140
1149
  disabled,
1141
1150
  className,
1142
- // labels, // Labels are hard-coded in this component
1151
+ labels,
1143
1152
  titles,
1144
- testID,
1145
- lastInGroup,
1146
- schema: { combinators, dispatchQuery, getQuery }
1147
- }) => {
1148
- const { shiftUp, shiftUpDisabled, shiftDown, shiftDownDisabled } = useShiftActions({
1149
- combinators,
1150
- disabled,
1151
- dispatchQuery,
1152
- getQuery,
1153
- lastInGroup,
1154
- path
1155
- });
1156
- return /* @__PURE__ */ React4.createElement("div", { "data-testid": testID, className }, /* @__PURE__ */ React4.createElement(
1157
- Button2,
1158
- {
1159
- type: "primary",
1160
- size: "small",
1161
- title: titles == null ? void 0 : titles.shiftUp,
1162
- onClick: shiftUp,
1163
- disabled: shiftUpDisabled
1164
- },
1165
- /* @__PURE__ */ React4.createElement(CaretUpOutlined, null)
1166
- ), /* @__PURE__ */ React4.createElement(
1167
- Button2,
1168
- {
1169
- type: "primary",
1170
- size: "small",
1171
- title: titles == null ? void 0 : titles.shiftDown,
1172
- onClick: shiftDown,
1173
- disabled: shiftDownDisabled
1174
- },
1175
- /* @__PURE__ */ React4.createElement(CaretDownOutlined, null)
1176
- ));
1177
- };
1153
+ testID
1154
+ }) => /* @__PURE__ */ React4.createElement("div", { "data-testid": testID, className }, /* @__PURE__ */ React4.createElement(
1155
+ Button2,
1156
+ {
1157
+ type: "primary",
1158
+ size: "small",
1159
+ title: titles == null ? void 0 : titles.shiftUp,
1160
+ onClick: shiftUp,
1161
+ disabled: disabled || shiftUpDisabled
1162
+ },
1163
+ labels == null ? void 0 : labels.shiftUp
1164
+ ), /* @__PURE__ */ React4.createElement(
1165
+ Button2,
1166
+ {
1167
+ type: "primary",
1168
+ size: "small",
1169
+ title: titles == null ? void 0 : titles.shiftDown,
1170
+ onClick: shiftDown,
1171
+ disabled: disabled || shiftDownDisabled
1172
+ },
1173
+ labels == null ? void 0 : labels.shiftDown
1174
+ ));
1178
1175
  AntDShiftActions.displayName = "AntDShiftActions";
1179
1176
 
1180
1177
  // src/AntDValueEditor.tsx
1181
1178
  var import_dayjs = __toESM(require_dayjs_min());
1182
1179
  var import_dayjs2 = __toESM(require_dayjs());
1183
- import { DatePicker as AntdDatePicker, Checkbox, Input, Radio, Switch as Switch2, TimePicker } from "antd";
1180
+ import { Checkbox, Input, Radio, Switch as Switch2 } from "antd";
1181
+ import generatePicker from "antd/es/date-picker/generatePicker/index.js";
1184
1182
  import * as React7 from "react";
1185
- import {
1186
- getFirstOption,
1187
- standardClassnames,
1188
- toArray,
1189
- useValueEditor
1190
- } from "react-querybuilder";
1183
+ import { getFirstOption, joinWith, standardClassnames, useValueEditor } from "react-querybuilder";
1191
1184
 
1192
1185
  // src/AntDValueSelector.tsx
1193
1186
  import { Select as Select2 } from "antd";
@@ -1264,7 +1257,7 @@ var AntDValueSelector = (_a) => {
1264
1257
  AntDValueSelector.displayName = "AntDValueSelector";
1265
1258
 
1266
1259
  // src/AntDValueEditor.tsx
1267
- var DatePicker = AntdDatePicker.generatePicker(import_dayjs2.default);
1260
+ var DatePicker = generatePicker(import_dayjs2.default);
1268
1261
  var AntDValueEditor = (_a) => {
1269
1262
  var _b = _a, {
1270
1263
  fieldData,
@@ -1301,7 +1294,7 @@ var AntDValueEditor = (_a) => {
1301
1294
  "testID",
1302
1295
  "selectorComponent"
1303
1296
  ]);
1304
- var _a2, _b2;
1297
+ var _a2;
1305
1298
  const { valueAsArray, multiValueHandler } = useValueEditor({
1306
1299
  handleOnChange,
1307
1300
  inputType,
@@ -1320,11 +1313,11 @@ var AntDValueEditor = (_a) => {
1320
1313
  if ((operator === "between" || operator === "notBetween") && (type === "select" || type === "text") && // Date ranges are handled differently in AntD--see below
1321
1314
  inputTypeCoerced !== "date" && inputTypeCoerced !== "datetime-local") {
1322
1315
  const editors = ["from", "to"].map((key, i) => {
1323
- var _a3, _b3;
1316
+ var _a3, _b2;
1324
1317
  if (type === "text") {
1325
1318
  if (inputTypeCoerced === "time") {
1326
1319
  return /* @__PURE__ */ React7.createElement(
1327
- TimePicker,
1320
+ DatePicker.TimePicker,
1328
1321
  {
1329
1322
  key,
1330
1323
  value: valueAsArray[i] ? (0, import_dayjs.default)(valueAsArray[i], "HH:mm:ss") : null,
@@ -1358,7 +1351,7 @@ var AntDValueEditor = (_a) => {
1358
1351
  className: standardClassnames.valueListItem,
1359
1352
  handleOnChange: (v) => multiValueHandler(v, i),
1360
1353
  disabled,
1361
- value: (_b3 = valueAsArray[i]) != null ? _b3 : getFirstOption(values),
1354
+ value: (_b2 = valueAsArray[i]) != null ? _b2 : getFirstOption(values),
1362
1355
  options: values,
1363
1356
  listsAsArrays
1364
1357
  })
@@ -1430,28 +1423,36 @@ var AntDValueEditor = (_a) => {
1430
1423
  }
1431
1424
  switch (inputTypeCoerced) {
1432
1425
  case "date":
1433
- case "datetime-local":
1434
- return operator === "between" || operator === "notBetween" ? /* @__PURE__ */ React7.createElement(
1435
- DatePicker.RangePicker,
1436
- {
1437
- value: ((_b2 = toArray(value)) == null ? void 0 : _b2.length) >= 2 ? toArray(value).map((v) => (0, import_dayjs.default)(v)) : void 0,
1438
- showTime: inputTypeCoerced === "datetime-local",
1439
- className,
1440
- disabled,
1441
- placeholder: [placeHolderText, placeHolderText],
1442
- onChange: (
1443
- /* istanbul ignore next */
1444
- (dates) => {
1445
- const format = `YYYY-MM-DD${inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : ""}`;
1446
- const dateArray = dates == null ? void 0 : dates.map((d) => d == null ? void 0 : d.format(format));
1447
- handleOnChange(dateArray ? listsAsArrays ? dateArray : dateArray.join(",") : dates);
1448
- }
1449
- )
1450
- }
1451
- ) : /* @__PURE__ */ React7.createElement(
1426
+ case "datetime-local": {
1427
+ if (operator === "between" || operator === "notBetween") {
1428
+ const dayjsArray = valueAsArray.slice(0, 2).map(import_dayjs.default);
1429
+ return /* @__PURE__ */ React7.createElement(
1430
+ DatePicker.RangePicker,
1431
+ {
1432
+ value: dayjsArray.every((d) => d.isValid()) ? dayjsArray : void 0,
1433
+ showTime: inputTypeCoerced === "datetime-local",
1434
+ className,
1435
+ disabled,
1436
+ placeholder: [placeHolderText, placeHolderText],
1437
+ onChange: (
1438
+ /* istanbul ignore next */
1439
+ (dates) => {
1440
+ const timeFormat = inputTypeCoerced === "datetime-local" ? "THH:mm:ss" : "";
1441
+ const format = `YYYY-MM-DD${timeFormat}`;
1442
+ const dateArray = dates == null ? void 0 : dates.map((d) => (d == null ? void 0 : d.isValid()) ? d.format(format) : void 0);
1443
+ handleOnChange(
1444
+ dateArray ? listsAsArrays ? dateArray : joinWith(dateArray, ",") : dates
1445
+ );
1446
+ }
1447
+ )
1448
+ }
1449
+ );
1450
+ }
1451
+ const dateValue = (0, import_dayjs.default)(value);
1452
+ return /* @__PURE__ */ React7.createElement(
1452
1453
  DatePicker,
1453
1454
  {
1454
- value: value ? (0, import_dayjs.default)(value) : null,
1455
+ value: dateValue.isValid() ? dateValue : void 0,
1455
1456
  showTime: inputTypeCoerced === "datetime-local",
1456
1457
  className,
1457
1458
  disabled,
@@ -1459,11 +1460,13 @@ var AntDValueEditor = (_a) => {
1459
1460
  onChange: (_d, dateString) => handleOnChange(dateString)
1460
1461
  }
1461
1462
  );
1462
- case "time":
1463
+ }
1464
+ case "time": {
1465
+ const dateValue = (0, import_dayjs.default)(value, "HH:mm:ss");
1463
1466
  return /* @__PURE__ */ React7.createElement(
1464
- TimePicker,
1467
+ DatePicker.TimePicker,
1465
1468
  {
1466
- value: value ? (0, import_dayjs.default)(value, "HH:mm:ss") : null,
1469
+ value: dateValue.isValid() ? dateValue : void 0,
1467
1470
  className,
1468
1471
  disabled,
1469
1472
  placeholder: placeHolderText,
@@ -1473,6 +1476,7 @@ var AntDValueEditor = (_a) => {
1473
1476
  }
1474
1477
  }
1475
1478
  );
1479
+ }
1476
1480
  }
1477
1481
  return /* @__PURE__ */ React7.createElement(
1478
1482
  Input,
@@ -1489,7 +1493,7 @@ var AntDValueEditor = (_a) => {
1489
1493
  };
1490
1494
  AntDValueEditor.displayName = "AntDValueEditor";
1491
1495
 
1492
- // src/index.ts
1496
+ // src/index.tsx
1493
1497
  var antdControlElements = {
1494
1498
  addGroupAction: AntDActionElement,
1495
1499
  addRuleAction: AntDActionElement,
@@ -1508,9 +1512,22 @@ var antdControlElements = {
1508
1512
  valueSourceSelector: AntDValueSelector,
1509
1513
  shiftActions: AntDShiftActions
1510
1514
  };
1515
+ var antdTranslations = {
1516
+ removeGroup: { label: /* @__PURE__ */ React8.createElement(CloseOutlined, null) },
1517
+ removeRule: { label: /* @__PURE__ */ React8.createElement(CloseOutlined, null) },
1518
+ cloneRule: { label: /* @__PURE__ */ React8.createElement(CopyOutlined, null) },
1519
+ cloneRuleGroup: { label: /* @__PURE__ */ React8.createElement(CopyOutlined, null) },
1520
+ lockGroup: { label: /* @__PURE__ */ React8.createElement(UnlockOutlined, null) },
1521
+ lockRule: { label: /* @__PURE__ */ React8.createElement(UnlockOutlined, null) },
1522
+ lockGroupDisabled: { label: /* @__PURE__ */ React8.createElement(LockOutlined, null) },
1523
+ lockRuleDisabled: { label: /* @__PURE__ */ React8.createElement(LockOutlined, null) },
1524
+ shiftActionUp: { label: /* @__PURE__ */ React8.createElement(UpOutlined, null) },
1525
+ shiftActionDown: { label: /* @__PURE__ */ React8.createElement(DownOutlined, null) }
1526
+ };
1511
1527
  var QueryBuilderAntD = getCompatContextProvider({
1512
1528
  key: "antd",
1513
- controlElements: antdControlElements
1529
+ controlElements: antdControlElements,
1530
+ translations: antdTranslations
1514
1531
  });
1515
1532
  export {
1516
1533
  AntDActionElement,
@@ -1520,6 +1537,7 @@ export {
1520
1537
  AntDValueEditor,
1521
1538
  AntDValueSelector,
1522
1539
  QueryBuilderAntD,
1523
- antdControlElements
1540
+ antdControlElements,
1541
+ antdTranslations
1524
1542
  };
1525
1543
  //# sourceMappingURL=react-querybuilder_antd.legacy-esm.js.map