@react-querybuilder/antd 4.0.0-beta.7 → 4.0.0-beta.8
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/index.cjs.js +1 -1
- package/dist/index.es.js +47 -20
- package/dist/types/AntDActionElement.d.ts +1 -1
- package/dist/types/AntDDragHandle.d.ts +2 -2
- package/dist/types/AntDNotToggle.d.ts +1 -1
- package/dist/types/AntDValueEditor.d.ts +1 -1
- package/dist/types/AntDValueSelector.d.ts +1 -1
- package/package.json +5 -4
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var s=require("react"),d=require("antd"),b=require("@ant-design/icons");function w(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var n=w(s);const p=({className:e,handleOnClick:a,label:t,title:c,disabled:r})=>n.default.createElement(d.Button,{type:"primary",className:e,title:c,onClick:u=>a(u),disabled:r},t);p.displayName="AntDActionElement";const g=s.forwardRef(({className:e,title:a},t)=>n.default.createElement("span",{ref:t,className:e,title:a},n.default.createElement(b.HolderOutlined,null)));g.displayName="AntDDragHandle";const A=({className:e,handleOnChange:a,label:t,checked:c,title:r,disabled:u})=>n.default.createElement(d.Switch,{title:r,className:e,onChange:o=>a(o),checked:!!c,disabled:u,checkedChildren:t,unCheckedChildren:"="});A.displayName="AntDNotToggle";const{Option:C}=d.Select,y=({fieldData:e,operator:a,value:t,handleOnChange:c,title:r,className:u,type:o,inputType:m,values:i,disabled:f})=>{var E;if(s.useEffect(()=>{m==="number"&&!["between","notBetween","in","notIn"].includes(a)&&typeof t=="string"&&t.includes(",")&&c("")},[m,a,t,c]),a==="null"||a==="notNull")return null;const k=(E=e==null?void 0:e.placeholder)!=null?E:"",h=["between","notBetween","in","notIn"].includes(a)?"text":m||"text";switch(o){case"select":return n.default.createElement("span",{title:r,className:u},n.default.createElement(d.Select,{onChange:l=>c(l),value:t,disabled:f},i.map(l=>n.default.createElement(C,{key:l.name,value:l.name},l.label))));case"checkbox":return n.default.createElement("span",{title:r},n.default.createElement(d.Checkbox,{type:"checkbox",className:u,disabled:f,onChange:l=>c(l.target.checked),checked:!!t}));case"radio":return n.default.createElement("span",{className:u,title:r},i.map(l=>n.default.createElement(d.Radio,{key:l.name,value:l.name,checked:t===l.name,disabled:f,onChange:S=>c(S.target.value)},l.label)));default:return n.default.createElement(d.Input,{type:h,value:t,title:r,className:u,disabled:f,placeholder:k,onChange:l=>c(l.target.value)})}};y.displayName="AntDValueEditor";const{Option:x}=d.Select,D=({className:e,handleOnChange:a,options:t,value:c,title:r,disabled:u})=>n.default.createElement("span",{title:r,className:e},n.default.createElement(d.Select,{disabled:u,value:c,onChange:o=>a(o)},t.map(o=>{var i;const m=`key-${(i=o.id)!=null?i:o.name}`;return n.default.createElement(x,{key:m,value:o.name},o.label)})));D.displayName="AntDValueSelector";exports.AntDActionElement=p;exports.AntDDragHandle=g;exports.AntDNotToggle=A;exports.AntDValueEditor=y;exports.AntDValueSelector=D;
|
package/dist/index.es.js
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import React, { forwardRef, useEffect } from "react";
|
|
2
2
|
import { Button, Switch, Input, Radio, Checkbox, Select } from "antd";
|
|
3
3
|
import { HolderOutlined } from "@ant-design/icons";
|
|
4
|
-
const AntDActionElement = ({ className, handleOnClick, label, title }) => /* @__PURE__ */ React.createElement(Button, {
|
|
4
|
+
const AntDActionElement = ({ className, handleOnClick, label, title, disabled }) => /* @__PURE__ */ React.createElement(Button, {
|
|
5
5
|
type: "primary",
|
|
6
6
|
className,
|
|
7
7
|
title,
|
|
8
|
-
onClick: (e) => handleOnClick(e)
|
|
8
|
+
onClick: (e) => handleOnClick(e),
|
|
9
|
+
disabled
|
|
9
10
|
}, label);
|
|
10
11
|
AntDActionElement.displayName = "AntDActionElement";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const AntDDragHandle = forwardRef(({ className, title }, dragRef) => /* @__PURE__ */ React.createElement("span", {
|
|
13
|
+
ref: dragRef,
|
|
14
|
+
className,
|
|
15
|
+
title
|
|
16
|
+
}, /* @__PURE__ */ React.createElement(HolderOutlined, null)));
|
|
17
|
+
AntDDragHandle.displayName = "AntDDragHandle";
|
|
18
|
+
const AntDNotToggle = ({
|
|
19
|
+
className,
|
|
20
|
+
handleOnChange,
|
|
21
|
+
label,
|
|
22
|
+
checked,
|
|
23
|
+
title,
|
|
24
|
+
disabled
|
|
25
|
+
}) => /* @__PURE__ */ React.createElement(Switch, {
|
|
19
26
|
title,
|
|
20
27
|
className,
|
|
21
|
-
onChange: (
|
|
28
|
+
onChange: (v) => handleOnChange(v),
|
|
22
29
|
checked: !!checked,
|
|
30
|
+
disabled,
|
|
23
31
|
checkedChildren: label,
|
|
24
32
|
unCheckedChildren: "="
|
|
25
33
|
});
|
|
@@ -34,7 +42,8 @@ const AntDValueEditor = ({
|
|
|
34
42
|
className,
|
|
35
43
|
type,
|
|
36
44
|
inputType,
|
|
37
|
-
values
|
|
45
|
+
values,
|
|
46
|
+
disabled
|
|
38
47
|
}) => {
|
|
39
48
|
var _a;
|
|
40
49
|
useEffect(() => {
|
|
@@ -49,21 +58,27 @@ const AntDValueEditor = ({
|
|
|
49
58
|
const inputTypeCoerced = ["between", "notBetween", "in", "notIn"].includes(operator) ? "text" : inputType || "text";
|
|
50
59
|
switch (type) {
|
|
51
60
|
case "select":
|
|
52
|
-
return /* @__PURE__ */ React.createElement(
|
|
53
|
-
|
|
61
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
62
|
+
title,
|
|
63
|
+
className
|
|
64
|
+
}, /* @__PURE__ */ React.createElement(Select, {
|
|
54
65
|
onChange: (v) => handleOnChange(v),
|
|
55
|
-
value
|
|
66
|
+
value,
|
|
67
|
+
disabled
|
|
56
68
|
}, values.map((v) => /* @__PURE__ */ React.createElement(Option$1, {
|
|
57
69
|
key: v.name,
|
|
58
70
|
value: v.name
|
|
59
|
-
}, v.label)));
|
|
71
|
+
}, v.label))));
|
|
60
72
|
case "checkbox":
|
|
61
|
-
return /* @__PURE__ */ React.createElement(
|
|
73
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
74
|
+
title
|
|
75
|
+
}, /* @__PURE__ */ React.createElement(Checkbox, {
|
|
62
76
|
type: "checkbox",
|
|
63
77
|
className,
|
|
78
|
+
disabled,
|
|
64
79
|
onChange: (e) => handleOnChange(e.target.checked),
|
|
65
80
|
checked: !!value
|
|
66
|
-
});
|
|
81
|
+
}));
|
|
67
82
|
case "radio":
|
|
68
83
|
return /* @__PURE__ */ React.createElement("span", {
|
|
69
84
|
className,
|
|
@@ -72,6 +87,7 @@ const AntDValueEditor = ({
|
|
|
72
87
|
key: v.name,
|
|
73
88
|
value: v.name,
|
|
74
89
|
checked: value === v.name,
|
|
90
|
+
disabled,
|
|
75
91
|
onChange: (e) => handleOnChange(e.target.value)
|
|
76
92
|
}, v.label)));
|
|
77
93
|
default:
|
|
@@ -80,6 +96,7 @@ const AntDValueEditor = ({
|
|
|
80
96
|
value,
|
|
81
97
|
title,
|
|
82
98
|
className,
|
|
99
|
+
disabled,
|
|
83
100
|
placeholder: placeHolderText,
|
|
84
101
|
onChange: (e) => handleOnChange(e.target.value)
|
|
85
102
|
});
|
|
@@ -87,8 +104,18 @@ const AntDValueEditor = ({
|
|
|
87
104
|
};
|
|
88
105
|
AntDValueEditor.displayName = "AntDValueEditor";
|
|
89
106
|
const { Option } = Select;
|
|
90
|
-
const AntDValueSelector = ({
|
|
107
|
+
const AntDValueSelector = ({
|
|
91
108
|
className,
|
|
109
|
+
handleOnChange,
|
|
110
|
+
options,
|
|
111
|
+
value,
|
|
112
|
+
title,
|
|
113
|
+
disabled
|
|
114
|
+
}) => /* @__PURE__ */ React.createElement("span", {
|
|
115
|
+
title,
|
|
116
|
+
className
|
|
117
|
+
}, /* @__PURE__ */ React.createElement(Select, {
|
|
118
|
+
disabled,
|
|
92
119
|
value,
|
|
93
120
|
onChange: (v) => handleOnChange(v)
|
|
94
121
|
}, options.map((option) => {
|
|
@@ -98,6 +125,6 @@ const AntDValueSelector = ({ className, handleOnChange, options, value }) => /*
|
|
|
98
125
|
key,
|
|
99
126
|
value: option.name
|
|
100
127
|
}, option.label);
|
|
101
|
-
}));
|
|
128
|
+
})));
|
|
102
129
|
AntDValueSelector.displayName = "AntDValueSelector";
|
|
103
130
|
export { AntDActionElement, AntDDragHandle, AntDNotToggle, AntDValueEditor, AntDValueSelector };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ActionProps } from 'react-querybuilder';
|
|
3
3
|
declare const AntDActionElement: {
|
|
4
|
-
({ className, handleOnClick, label, title }: ActionProps): JSX.Element;
|
|
4
|
+
({ className, handleOnClick, label, title, disabled }: ActionProps): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default AntDActionElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DragHandleProps } from 'react-querybuilder';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const AntDDragHandle: import("react").ForwardRefExoticComponent<DragHandleProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
export default AntDDragHandle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { NotToggleProps } from 'react-querybuilder';
|
|
3
3
|
declare const AntDNotToggle: {
|
|
4
|
-
({ className, handleOnChange, label, checked, title }: NotToggleProps): JSX.Element;
|
|
4
|
+
({ className, handleOnChange, label, checked, title, disabled, }: NotToggleProps): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default AntDNotToggle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ValueEditorProps } from 'react-querybuilder';
|
|
3
3
|
declare const AntDValueEditor: {
|
|
4
|
-
({ fieldData, operator, value, handleOnChange, title, className, type, inputType, values }: ValueEditorProps): JSX.Element | null;
|
|
4
|
+
({ fieldData, operator, value, handleOnChange, title, className, type, inputType, values, disabled, }: ValueEditorProps): JSX.Element | null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default AntDValueEditor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ValueSelectorProps } from 'react-querybuilder';
|
|
3
3
|
declare const AntDValueSelector: {
|
|
4
|
-
({ className, handleOnChange, options, value }: ValueSelectorProps): JSX.Element;
|
|
4
|
+
({ className, handleOnChange, options, value, title, disabled, }: ValueSelectorProps): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default AntDValueSelector;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-querybuilder/antd",
|
|
3
3
|
"description": "Custom Ant Design components for react-querybuilder",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.8",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -22,17 +22,18 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@ant-design/icons": "^4.7.0",
|
|
25
|
+
"@react-querybuilder/compat": "^4.0.0-beta.8",
|
|
25
26
|
"@types/react": "^17.0.0",
|
|
26
27
|
"antd": "^4.10.3",
|
|
27
28
|
"react": "^17.0.1",
|
|
28
|
-
"react-querybuilder": "^4.0.0-beta.
|
|
29
|
+
"react-querybuilder": "^4.0.0-beta.8",
|
|
29
30
|
"typescript": "^4.5.0"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
32
33
|
"@ant-design/icons": ">=4.7.0",
|
|
33
34
|
"antd": ">=4.10.0",
|
|
34
35
|
"react": ">=16.8.0",
|
|
35
|
-
"react-querybuilder": "4
|
|
36
|
+
"react-querybuilder": ">=4"
|
|
36
37
|
},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "79d0e66c09b058779e90dd5320f386e0e9fdfcd5"
|
|
38
39
|
}
|