@plasmicpkgs/antd 2.0.32 → 2.0.34
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/.tsbuildinfo +1 -1
- package/dist/antd.esm.js +159 -19
- package/dist/index.js +160 -18
- package/dist/index.js.map +1 -1
- package/dist/registerCheckbox.d.ts +11 -0
- package/dist/registerInput.d.ts +12 -2
- package/package.json +3 -3
- package/skinny/registerCheckbox.d.ts +11 -0
- package/skinny/registerCheckbox.js +30 -3
- package/skinny/registerCheckbox.js.map +1 -1
- package/skinny/registerInput.d.ts +12 -2
- package/skinny/registerInput.js +88 -13
- package/skinny/registerInput.js.map +1 -1
- package/skinny/registerSelect.js +21 -2
- package/skinny/registerSelect.js.map +1 -1
- package/skinny/registerSwitch.js +21 -2
- package/skinny/registerSwitch.js.map +1 -1
|
@@ -2,6 +2,17 @@ import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
|
2
2
|
import { CheckboxProps } from "antd/lib/checkbox/Checkbox";
|
|
3
3
|
import { CheckboxGroupProps } from "antd/lib/checkbox/Group";
|
|
4
4
|
import { Registerable } from "./registerable";
|
|
5
|
+
export declare const checkboxHelpers: {
|
|
6
|
+
helpers: {
|
|
7
|
+
states: {
|
|
8
|
+
value: {
|
|
9
|
+
onChangeArgsToValue: (e: Parameters<NonNullable<CheckboxProps["onChange"]>>[0]) => boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
importName: string;
|
|
14
|
+
importPath: string;
|
|
15
|
+
};
|
|
5
16
|
export declare const checkboxMeta: ComponentMeta<CheckboxProps>;
|
|
6
17
|
export declare function registerCheckbox(loader?: Registerable, customCheckboxMeta?: ComponentMeta<CheckboxProps>): void;
|
|
7
18
|
export declare const checkboxGroupMeta: ComponentMeta<CheckboxGroupProps>;
|
package/dist/registerInput.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
-
import { InputProps } from "antd/lib/input";
|
|
3
|
-
import { GroupProps, PasswordProps, SearchProps, TextAreaProps } from "antd/lib/input";
|
|
2
|
+
import { GroupProps, InputProps, PasswordProps, SearchProps, TextAreaProps } from "antd/lib/input";
|
|
4
3
|
import { Registerable } from "./registerable";
|
|
4
|
+
export declare const inputHelpers: {
|
|
5
|
+
helpers: {
|
|
6
|
+
states: {
|
|
7
|
+
value: {
|
|
8
|
+
onChangeArgsToValue: (e: Parameters<NonNullable<InputProps["onChange"]>>[0]) => string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
importName: string;
|
|
13
|
+
importPath: string;
|
|
14
|
+
};
|
|
5
15
|
export declare const inputMeta: ComponentMeta<InputProps>;
|
|
6
16
|
export declare function registerInput(loader?: Registerable, customInputMeta?: ComponentMeta<InputProps>): void;
|
|
7
17
|
export declare const inputTextAreaMeta: ComponentMeta<TextAreaProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/antd",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.34",
|
|
4
4
|
"description": "Plasmic registration calls for antd components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"antd": "^4.19.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@plasmicapp/host": "1.0.
|
|
44
|
+
"@plasmicapp/host": "1.0.118",
|
|
45
45
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
46
46
|
"@types/node": "^14.0.26",
|
|
47
47
|
"react": "^18.2.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"@plasmicapp/host": "^1.0.0",
|
|
57
57
|
"react": ">=16.8.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "f5d0cd2ad8930d509f48d608bda4829c5158dc00"
|
|
60
60
|
}
|
|
@@ -2,6 +2,17 @@ import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
|
2
2
|
import { CheckboxProps } from "antd/lib/checkbox/Checkbox";
|
|
3
3
|
import { CheckboxGroupProps } from "antd/lib/checkbox/Group";
|
|
4
4
|
import { Registerable } from "./registerable";
|
|
5
|
+
export declare const checkboxHelpers: {
|
|
6
|
+
helpers: {
|
|
7
|
+
states: {
|
|
8
|
+
value: {
|
|
9
|
+
onChangeArgsToValue: (e: Parameters<NonNullable<CheckboxProps["onChange"]>>[0]) => boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
importName: string;
|
|
14
|
+
importPath: string;
|
|
15
|
+
};
|
|
5
16
|
export declare const checkboxMeta: ComponentMeta<CheckboxProps>;
|
|
6
17
|
export declare function registerCheckbox(loader?: Registerable, customCheckboxMeta?: ComponentMeta<CheckboxProps>): void;
|
|
7
18
|
export declare const checkboxGroupMeta: ComponentMeta<CheckboxGroupProps>;
|
|
@@ -25,6 +25,17 @@ class CheckboxWrapper extends React.Component {
|
|
|
25
25
|
return /* @__PURE__ */ React.createElement(Checkbox, __spreadValues({}, this.props));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
const checkboxHelpers = {
|
|
29
|
+
helpers: {
|
|
30
|
+
states: {
|
|
31
|
+
value: {
|
|
32
|
+
onChangeArgsToValue: (e) => e.target.checked
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
importName: "checkboxHelpers",
|
|
37
|
+
importPath: "@plasmicpkgs/plasmic-antd/registerCheckbox"
|
|
38
|
+
};
|
|
28
39
|
const checkboxMeta = {
|
|
29
40
|
name: "AntdCheckbox",
|
|
30
41
|
displayName: "Antd Checkbox",
|
|
@@ -36,8 +47,6 @@ const checkboxMeta = {
|
|
|
36
47
|
},
|
|
37
48
|
checked: {
|
|
38
49
|
type: "boolean",
|
|
39
|
-
editOnly: true,
|
|
40
|
-
uncontrolledProp: "defaultChecked",
|
|
41
50
|
description: "Specifies the initial state: whether or not the checkbox is selected",
|
|
42
51
|
defaultValueHint: false
|
|
43
52
|
},
|
|
@@ -63,8 +72,26 @@ const checkboxMeta = {
|
|
|
63
72
|
value: "Checkbox"
|
|
64
73
|
}
|
|
65
74
|
]
|
|
75
|
+
},
|
|
76
|
+
onChange: {
|
|
77
|
+
type: "eventHandler",
|
|
78
|
+
argTypes: [
|
|
79
|
+
{
|
|
80
|
+
name: "event",
|
|
81
|
+
type: "object"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
states: {
|
|
87
|
+
value: {
|
|
88
|
+
type: "writable",
|
|
89
|
+
variableType: "boolean",
|
|
90
|
+
onChangeProp: "onChange",
|
|
91
|
+
valueProp: "checked"
|
|
66
92
|
}
|
|
67
93
|
},
|
|
94
|
+
componentHelpers: checkboxHelpers,
|
|
68
95
|
importPath: "antd/lib/checkbox/Checkbox",
|
|
69
96
|
importName: "Checkbox",
|
|
70
97
|
defaultStyles: {
|
|
@@ -123,5 +150,5 @@ function registerCheckboxGroup(loader, customCheckboxGroupMeta) {
|
|
|
123
150
|
doRegisterComponent(CheckboxGroup, customCheckboxGroupMeta != null ? customCheckboxGroupMeta : checkboxGroupMeta);
|
|
124
151
|
}
|
|
125
152
|
|
|
126
|
-
export { checkboxGroupMeta, checkboxMeta, registerCheckbox, registerCheckboxGroup };
|
|
153
|
+
export { checkboxGroupMeta, checkboxHelpers, checkboxMeta, registerCheckbox, registerCheckboxGroup };
|
|
127
154
|
//# sourceMappingURL=registerCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerCheckbox.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Checkbox, { CheckboxProps } from \"antd/lib/checkbox/Checkbox\";\nimport CheckboxGroup, { CheckboxGroupProps } from \"antd/lib/checkbox/Group\";\nimport React from \"react\";\nimport { traverseReactEltTree } from \"./customControls\";\nimport { Registerable } from \"./registerable\";\n\nclass CheckboxWrapper extends React.Component<CheckboxProps> {\n render() {\n return <Checkbox {...this.props} />;\n }\n}\n\nexport const checkboxMeta: ComponentMeta<CheckboxProps> = {\n name: \"AntdCheckbox\",\n displayName: \"Antd Checkbox\",\n props: {\n autoFocus: {\n type: \"boolean\",\n description: \"If get focus when component mounted\",\n defaultValueHint: false,\n },\n checked: {\n type: \"boolean\",\n
|
|
1
|
+
{"version":3,"file":"registerCheckbox.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Checkbox, { CheckboxProps } from \"antd/lib/checkbox/Checkbox\";\nimport CheckboxGroup, { CheckboxGroupProps } from \"antd/lib/checkbox/Group\";\nimport React from \"react\";\nimport { traverseReactEltTree } from \"./customControls\";\nimport { Registerable } from \"./registerable\";\n\nclass CheckboxWrapper extends React.Component<CheckboxProps> {\n render() {\n return <Checkbox {...this.props} />;\n }\n}\n\nexport const checkboxHelpers = {\n helpers: {\n states: {\n value: {\n onChangeArgsToValue: (\n e: Parameters<NonNullable<CheckboxProps[\"onChange\"]>>[0]\n ) => e.target.checked,\n },\n },\n },\n importName: \"checkboxHelpers\",\n importPath: \"@plasmicpkgs/plasmic-antd/registerCheckbox\",\n};\n\nexport const checkboxMeta: ComponentMeta<CheckboxProps> = {\n name: \"AntdCheckbox\",\n displayName: \"Antd Checkbox\",\n props: {\n autoFocus: {\n type: \"boolean\",\n description: \"If get focus when component mounted\",\n defaultValueHint: false,\n },\n checked: {\n type: \"boolean\",\n description:\n \"Specifies the initial state: whether or not the checkbox is selected\",\n defaultValueHint: false,\n },\n disabled: {\n type: \"boolean\",\n description: \"If disable checkbox\",\n defaultValueHint: false,\n },\n indeterminate: {\n type: \"boolean\",\n description: \"The indeterminate checked state of checkbox\",\n defaultValueHint: false,\n },\n value: {\n type: \"string\",\n description: \"The checkbox value\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Checkbox\",\n },\n ],\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [\n {\n name: \"event\",\n type: \"object\",\n },\n ],\n },\n },\n states: {\n value: {\n type: \"writable\",\n variableType: \"boolean\",\n onChangeProp: \"onChange\",\n valueProp: \"checked\",\n },\n },\n componentHelpers: checkboxHelpers,\n importPath: \"antd/lib/checkbox/Checkbox\",\n importName: \"Checkbox\",\n defaultStyles: {\n marginLeft: 0,\n },\n isDefaultExport: true,\n};\n\nexport function registerCheckbox(\n loader?: Registerable,\n customCheckboxMeta?: ComponentMeta<CheckboxProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(CheckboxWrapper, customCheckboxMeta ?? checkboxMeta);\n}\n\nexport const checkboxGroupMeta: ComponentMeta<CheckboxGroupProps> = {\n name: \"AntdCheckboxGroup\",\n displayName: \"Antd Checkbox Group\",\n props: {\n disabled: {\n type: \"boolean\",\n description: \"If disable all checkboxes\",\n defaultValueHint: false,\n },\n value: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"Default selected value\",\n multiSelect: true,\n options: (componentProps) => {\n const options = new Set<string>();\n traverseReactEltTree(componentProps.children, (elt) => {\n if (\n elt?.type === CheckboxWrapper &&\n typeof elt?.props?.value === \"string\"\n ) {\n options.add(elt.props.value);\n }\n });\n return Array.from(options.keys());\n },\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"AntdCheckbox\"],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdCheckbox\",\n },\n ],\n },\n },\n importPath: \"antd/lib/checkbox/Group\",\n importName: \"CheckboxGroup\",\n parentComponentName: \"AntdCheckbox\",\n isDefaultExport: true,\n};\n\nexport function registerCheckboxGroup(\n loader?: Registerable,\n customCheckboxGroupMeta?: ComponentMeta<CheckboxGroupProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(\n CheckboxGroup,\n customCheckboxGroupMeta ?? checkboxGroupMeta\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,eAAA,SAAwB,MAAM,SAAyB,CAAA;AAAA,EAC3D,MAAS,GAAA;AACP,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAa,EAAA,cAAA,CAAA,EAAA,EAAA,IAAA,CAAK,KAAO,CAAA,CAAA,CAAA;AAAA,GACnC;AACF,CAAA;AAEO,MAAM,eAAkB,GAAA;AAAA,EAC7B,OAAS,EAAA;AAAA,IACP,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,mBAAqB,EAAA,CACnB,CACG,KAAA,CAAA,CAAE,MAAO,CAAA,OAAA;AAAA,OAChB;AAAA,KACF;AAAA,GACF;AAAA,EACA,UAAY,EAAA,iBAAA;AAAA,EACZ,UAAY,EAAA,4CAAA;AACd,EAAA;AAEO,MAAM,YAA6C,GAAA;AAAA,EACxD,IAAM,EAAA,cAAA;AAAA,EACN,WAAa,EAAA,eAAA;AAAA,EACb,KAAO,EAAA;AAAA,IACL,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,qCAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,WACE,EAAA,sEAAA;AAAA,MACF,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,qBAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,aAAe,EAAA;AAAA,MACb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AAA,EACZ,UAAY,EAAA,eAAA;AAAA,EACZ,mBAAqB,EAAA,cAAA;AAAA,EACrB,eAAiB,EAAA,IAAA;AACnB,EAAA;AAEO,SAAA,qBAAA,CACL,QACA,uBACA,EAAA;AACA,EAAM,MAAA,mBAAA,GAAgD,CAAI,GAAA,IAAA,KACxD,MAAS,GAAA,MAAA,CAAO,iBAAkB,CAAA,GAAG,IAAI,CAAA,GAAI,iBAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EACE,mBAAA,CAAA,aAAA,EACA,4DAA2B,iBAC7B,CAAA,CAAA;AACF;;;;"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
-
import { InputProps } from "antd/lib/input";
|
|
3
|
-
import { GroupProps, PasswordProps, SearchProps, TextAreaProps } from "antd/lib/input";
|
|
2
|
+
import { GroupProps, InputProps, PasswordProps, SearchProps, TextAreaProps } from "antd/lib/input";
|
|
4
3
|
import { Registerable } from "./registerable";
|
|
4
|
+
export declare const inputHelpers: {
|
|
5
|
+
helpers: {
|
|
6
|
+
states: {
|
|
7
|
+
value: {
|
|
8
|
+
onChangeArgsToValue: (e: Parameters<NonNullable<InputProps["onChange"]>>[0]) => string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
importName: string;
|
|
13
|
+
importPath: string;
|
|
14
|
+
};
|
|
5
15
|
export declare const inputMeta: ComponentMeta<InputProps>;
|
|
6
16
|
export declare function registerInput(loader?: Registerable, customInputMeta?: ComponentMeta<InputProps>): void;
|
|
7
17
|
export declare const inputTextAreaMeta: ComponentMeta<TextAreaProps>;
|
package/skinny/registerInput.js
CHANGED
|
@@ -44,6 +44,17 @@ const commonHtmlAttributes = {
|
|
|
44
44
|
description: "The HTML name of the input"
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
+
const inputHelpers = {
|
|
48
|
+
helpers: {
|
|
49
|
+
states: {
|
|
50
|
+
value: {
|
|
51
|
+
onChangeArgsToValue: (e) => e.target.value
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
importName: "inputHelpers",
|
|
56
|
+
importPath: "@plasmicpkgs/plasmic-antd/registerInput"
|
|
57
|
+
};
|
|
47
58
|
const inputMeta = {
|
|
48
59
|
name: "AntdInput",
|
|
49
60
|
displayName: "Antd Input",
|
|
@@ -103,11 +114,27 @@ const inputMeta = {
|
|
|
103
114
|
defaultValueHint: "text"
|
|
104
115
|
},
|
|
105
116
|
value: {
|
|
106
|
-
type: "string"
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
type: "string"
|
|
118
|
+
},
|
|
119
|
+
onChange: {
|
|
120
|
+
type: "eventHandler",
|
|
121
|
+
argTypes: [
|
|
122
|
+
{
|
|
123
|
+
name: "event",
|
|
124
|
+
type: "object"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
109
127
|
}
|
|
110
128
|
})),
|
|
129
|
+
states: {
|
|
130
|
+
value: {
|
|
131
|
+
type: "writable",
|
|
132
|
+
variableType: "text",
|
|
133
|
+
onChangeProp: "onChange",
|
|
134
|
+
valueProp: "value"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
componentHelpers: inputHelpers,
|
|
111
138
|
importPath: "antd/lib/input",
|
|
112
139
|
importName: "Input",
|
|
113
140
|
isDefaultExport: true
|
|
@@ -157,11 +184,27 @@ const inputTextAreaMeta = {
|
|
|
157
184
|
description: "Placeholder for the input"
|
|
158
185
|
},
|
|
159
186
|
value: {
|
|
160
|
-
type: "string"
|
|
161
|
-
|
|
162
|
-
|
|
187
|
+
type: "string"
|
|
188
|
+
},
|
|
189
|
+
onChange: {
|
|
190
|
+
type: "eventHandler",
|
|
191
|
+
argTypes: [
|
|
192
|
+
{
|
|
193
|
+
name: "event",
|
|
194
|
+
type: "object"
|
|
195
|
+
}
|
|
196
|
+
]
|
|
163
197
|
}
|
|
164
198
|
})),
|
|
199
|
+
states: {
|
|
200
|
+
value: {
|
|
201
|
+
type: "writable",
|
|
202
|
+
variableType: "text",
|
|
203
|
+
onChangeProp: "onChange",
|
|
204
|
+
valueProp: "value"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
componentHelpers: inputHelpers,
|
|
165
208
|
importPath: "antd/lib/input/TextArea",
|
|
166
209
|
importName: "TextArea",
|
|
167
210
|
isDefaultExport: true,
|
|
@@ -234,11 +277,27 @@ const inputSearchMeta = {
|
|
|
234
277
|
description: "The type of input"
|
|
235
278
|
},
|
|
236
279
|
value: {
|
|
237
|
-
type: "string"
|
|
238
|
-
|
|
239
|
-
|
|
280
|
+
type: "string"
|
|
281
|
+
},
|
|
282
|
+
onChange: {
|
|
283
|
+
type: "eventHandler",
|
|
284
|
+
argTypes: [
|
|
285
|
+
{
|
|
286
|
+
name: "event",
|
|
287
|
+
type: "object"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
240
290
|
}
|
|
241
291
|
})),
|
|
292
|
+
states: {
|
|
293
|
+
value: {
|
|
294
|
+
type: "writable",
|
|
295
|
+
variableType: "text",
|
|
296
|
+
onChangeProp: "onChange",
|
|
297
|
+
valueProp: "value"
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
componentHelpers: inputHelpers,
|
|
242
301
|
importPath: "antd/lib/input/Search",
|
|
243
302
|
importName: "Search",
|
|
244
303
|
isDefaultExport: true,
|
|
@@ -302,16 +361,32 @@ const inputPasswordMeta = {
|
|
|
302
361
|
description: "The type of input"
|
|
303
362
|
},
|
|
304
363
|
value: {
|
|
305
|
-
type: "string"
|
|
306
|
-
editOnly: true,
|
|
307
|
-
uncontrolledProp: "defaultValue"
|
|
364
|
+
type: "string"
|
|
308
365
|
},
|
|
309
366
|
visibilityToggle: {
|
|
310
367
|
type: "boolean",
|
|
311
368
|
description: "Whether show toggle button",
|
|
312
369
|
defaultValueHint: true
|
|
370
|
+
},
|
|
371
|
+
onChange: {
|
|
372
|
+
type: "eventHandler",
|
|
373
|
+
argTypes: [
|
|
374
|
+
{
|
|
375
|
+
name: "event",
|
|
376
|
+
type: "object"
|
|
377
|
+
}
|
|
378
|
+
]
|
|
313
379
|
}
|
|
314
380
|
})),
|
|
381
|
+
states: {
|
|
382
|
+
value: {
|
|
383
|
+
type: "writable",
|
|
384
|
+
variableType: "text",
|
|
385
|
+
onChangeProp: "onChange",
|
|
386
|
+
valueProp: "value"
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
componentHelpers: inputHelpers,
|
|
315
390
|
importPath: "antd/lib/input/Password",
|
|
316
391
|
importName: "Password",
|
|
317
392
|
isDefaultExport: true,
|
|
@@ -360,5 +435,5 @@ function registerInputGroup(loader, customInputGroupMeta) {
|
|
|
360
435
|
doRegisterComponent(InputGroup, customInputGroupMeta != null ? customInputGroupMeta : inputGroupMeta);
|
|
361
436
|
}
|
|
362
437
|
|
|
363
|
-
export { inputGroupMeta, inputMeta, inputPasswordMeta, inputSearchMeta, inputTextAreaMeta, registerInput, registerInputGroup, registerInputPassword, registerInputSearch, registerInputTextArea };
|
|
438
|
+
export { inputGroupMeta, inputHelpers, inputMeta, inputPasswordMeta, inputSearchMeta, inputTextAreaMeta, registerInput, registerInputGroup, registerInputPassword, registerInputSearch, registerInputTextArea };
|
|
364
439
|
//# sourceMappingURL=registerInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerInput.js","sources":["../src/registerInput.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Input, { InputProps } from \"antd/lib/input\";\nimport {\n GroupProps,\n PasswordProps,\n SearchProps,\n TextAreaProps,\n} from \"antd/lib/input\";\nimport InputGroup from \"antd/lib/input/Group\";\nimport Password from \"antd/lib/input/Password\";\nimport Search from \"antd/lib/input/Search\";\nimport TextArea from \"antd/lib/input/TextArea\";\nimport { Registerable } from \"./registerable\";\n\nfunction sortObjectKeys<T extends {}>(obj: T): T {\n return Object.fromEntries(Object.entries(obj).sort()) as T;\n}\n\ntype PropSpec<T> = ComponentMeta<T>[\"props\"];\n\nfunction sortProps<T>(props: PropSpec<T>): PropSpec<T> {\n return sortObjectKeys(props);\n}\n\nconst commonHtmlAttributes = {\n \"aria-label\": {\n type: \"string\",\n description: \"The ARIA label for this input\",\n },\n \"aria-labelledby\": {\n type: \"string\",\n description: \"Identifies the element(s) that labels this input\",\n },\n name: {\n type: \"string\",\n description: \"The HTML name of the input\",\n },\n} as const;\n\nexport const inputMeta: ComponentMeta<InputProps> = {\n name: \"AntdInput\",\n displayName: \"Antd Input\",\n props: sortProps<InputProps>({\n ...commonHtmlAttributes,\n addonAfter: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n addonBefore: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n prefix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"middle\", \"large\"],\n description: \"The size of the input box\",\n defaultValueHint: \"middle,\",\n },\n suffix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n type: {\n type: \"string\",\n description: \"The type of input\",\n defaultValueHint: \"text\",\n },\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n },\n }),\n importPath: \"antd/lib/input\",\n importName: \"Input\",\n isDefaultExport: true,\n};\n\nexport function registerInput(\n loader?: Registerable,\n customInputMeta?: ComponentMeta<InputProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Input, customInputMeta ?? inputMeta);\n}\n\nexport const inputTextAreaMeta: ComponentMeta<TextAreaProps> = {\n name: \"AntdInputTextArea\",\n displayName: \"Antd Input Text Area\",\n props: sortProps<TextAreaProps>({\n ...commonHtmlAttributes,\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n autoSize: {\n type: \"object\",\n description:\n \"Height autosize feature, can be set to true | false or an object { minRows: 2, maxRows: 6 }\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n showCount: {\n type: \"boolean\",\n description: \"Whether show text count\",\n defaultValueHint: false,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n },\n }),\n importPath: \"antd/lib/input/TextArea\",\n importName: \"TextArea\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputTextArea(\n loader?: Registerable,\n customInputTextAreaMeta?: ComponentMeta<TextAreaProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(TextArea, customInputTextAreaMeta ?? inputTextAreaMeta);\n}\n\nexport const inputSearchMeta: ComponentMeta<SearchProps> = {\n name: \"AntdInputSearch\",\n displayName: \"Antd Input Search\",\n props: sortProps<SearchProps>({\n ...commonHtmlAttributes,\n addonBefore: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n enterButton: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n loading: {\n type: \"boolean\",\n description: \"Search box with loading\",\n defaultValueHint: false,\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n prefix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"middle\", \"large\"],\n description: \"The size of the input box\",\n defaultValueHint: \"middle\",\n },\n suffix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n type: {\n type: \"string\",\n description: \"The type of input\",\n },\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n },\n }),\n importPath: \"antd/lib/input/Search\",\n importName: \"Search\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputSearch(\n loader?: Registerable,\n customInputSearchMeta?: ComponentMeta<SearchProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Search, customInputSearchMeta ?? inputSearchMeta);\n}\n\nexport const inputPasswordMeta: ComponentMeta<PasswordProps> = {\n name: \"AntdInputPassword\",\n displayName: \"Antd Input Password\",\n props: sortProps<PasswordProps>({\n ...commonHtmlAttributes,\n addonAfter: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n addonBefore: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n prefix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"middle\", \"large\"],\n description: \"The size of the input box\",\n defaultValueHint: \"middle\",\n },\n type: {\n type: \"string\",\n description: \"The type of input\",\n },\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n },\n visibilityToggle: {\n type: \"boolean\",\n description: \"Whether show toggle button\",\n defaultValueHint: true,\n },\n }),\n importPath: \"antd/lib/input/Password\",\n importName: \"Password\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputPassword(\n loader?: Registerable,\n customInputPasswordMeta?: ComponentMeta<PasswordProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Password, customInputPasswordMeta ?? inputPasswordMeta);\n}\n\nexport const inputGroupMeta: ComponentMeta<GroupProps> = {\n name: \"AntdInputGroup\",\n displayName: \"Antd Input Group\",\n props: {\n compact: {\n type: \"boolean\",\n description: \"Whether use compact style\",\n defaultValueHint: false,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"default\", \"large\"],\n description:\n \"The size of Input.Group specifies the size of the included Input fields\",\n defaultValueHint: \"default\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdInput\",\n },\n {\n type: \"component\",\n name: \"AntdInput\",\n },\n ],\n },\n },\n importPath: \"antd/lib/input/Group\",\n importName: \"InputGroup\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputGroup(\n loader?: Registerable,\n customInputGroupMeta?: ComponentMeta<GroupProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(InputGroup, customInputGroupMeta ?? inputGroupMeta);\n}\n"],"names":[],"mappings":";;;;;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AAAA,EACb,KAAO,EAAA;AAAA,IACL,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,2BAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,IAAM,EAAA,QAAA;AAAA,MACN,OAAS,EAAA,CAAC,OAAS,EAAA,SAAA,EAAW,OAAO,CAAA;AAAA,MACrC,WACE,EAAA,yEAAA;AAAA,MACF,gBAAkB,EAAA,SAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,MAAA;AAAA,MACN,YAAc,EAAA;AAAA,QACZ;AAAA,UACE,IAAM,EAAA,WAAA;AAAA,UACN,IAAM,EAAA,WAAA;AAAA,SACR;AAAA,QACA;AAAA,UACE,IAAM,EAAA,WAAA;AAAA,UACN,IAAM,EAAA,WAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAAA,EACA,UAAY,EAAA,sBAAA;AAAA,EACZ,UAAY,EAAA,YAAA;AAAA,EACZ,eAAiB,EAAA,IAAA;AAAA,EACjB,mBAAqB,EAAA,WAAA;AACvB,EAAA;AAEO,SAAA,kBAAA,CACL,QACA,oBACA,EAAA;AACA,EAAM,MAAA,mBAAA,GAAgD,CAAI,GAAA,IAAA,KACxD,MAAS,GAAA,MAAA,CAAO,iBAAkB,CAAA,GAAG,IAAI,CAAA,GAAI,iBAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAA,UAAA,EAAY,sDAAwB,cAAc,CAAA,CAAA;AACxE;;;;"}
|
|
1
|
+
{"version":3,"file":"registerInput.js","sources":["../src/registerInput.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Input, {\n GroupProps,\n InputProps,\n PasswordProps,\n SearchProps,\n TextAreaProps,\n} from \"antd/lib/input\";\nimport InputGroup from \"antd/lib/input/Group\";\nimport Password from \"antd/lib/input/Password\";\nimport Search from \"antd/lib/input/Search\";\nimport TextArea from \"antd/lib/input/TextArea\";\nimport { Registerable } from \"./registerable\";\n\nfunction sortObjectKeys<T extends {}>(obj: T): T {\n return Object.fromEntries(Object.entries(obj).sort()) as T;\n}\n\ntype PropSpec<T> = ComponentMeta<T>[\"props\"];\n\nfunction sortProps<T>(props: PropSpec<T>): PropSpec<T> {\n return sortObjectKeys(props);\n}\n\nconst commonHtmlAttributes = {\n \"aria-label\": {\n type: \"string\",\n description: \"The ARIA label for this input\",\n },\n \"aria-labelledby\": {\n type: \"string\",\n description: \"Identifies the element(s) that labels this input\",\n },\n name: {\n type: \"string\",\n description: \"The HTML name of the input\",\n },\n} as const;\n\nexport const inputHelpers = {\n helpers: {\n states: {\n value: {\n onChangeArgsToValue: (\n e: Parameters<NonNullable<InputProps[\"onChange\"]>>[0]\n ) => e.target.value,\n },\n },\n },\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/plasmic-antd/registerInput\",\n};\n\nexport const inputMeta: ComponentMeta<InputProps> = {\n name: \"AntdInput\",\n displayName: \"Antd Input\",\n props: sortProps<InputProps>({\n ...commonHtmlAttributes,\n addonAfter: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n addonBefore: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n prefix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"middle\", \"large\"],\n description: \"The size of the input box\",\n defaultValueHint: \"middle,\",\n },\n suffix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n type: {\n type: \"string\",\n description: \"The type of input\",\n defaultValueHint: \"text\",\n },\n value: {\n type: \"string\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [\n {\n name: \"event\",\n type: \"object\",\n },\n ],\n },\n }),\n states: {\n value: {\n type: \"writable\",\n variableType: \"text\",\n onChangeProp: \"onChange\",\n valueProp: \"value\",\n },\n },\n componentHelpers: inputHelpers,\n importPath: \"antd/lib/input\",\n importName: \"Input\",\n isDefaultExport: true,\n};\n\nexport function registerInput(\n loader?: Registerable,\n customInputMeta?: ComponentMeta<InputProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Input, customInputMeta ?? inputMeta);\n}\n\nexport const inputTextAreaMeta: ComponentMeta<TextAreaProps> = {\n name: \"AntdInputTextArea\",\n displayName: \"Antd Input Text Area\",\n props: sortProps<TextAreaProps>({\n ...commonHtmlAttributes,\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n autoSize: {\n type: \"object\",\n description:\n \"Height autosize feature, can be set to true | false or an object { minRows: 2, maxRows: 6 }\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n showCount: {\n type: \"boolean\",\n description: \"Whether show text count\",\n defaultValueHint: false,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n value: {\n type: \"string\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [\n {\n name: \"event\",\n type: \"object\",\n },\n ],\n },\n }),\n states: {\n value: {\n type: \"writable\",\n variableType: \"text\",\n onChangeProp: \"onChange\",\n valueProp: \"value\",\n },\n },\n componentHelpers: inputHelpers,\n importPath: \"antd/lib/input/TextArea\",\n importName: \"TextArea\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputTextArea(\n loader?: Registerable,\n customInputTextAreaMeta?: ComponentMeta<TextAreaProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(TextArea, customInputTextAreaMeta ?? inputTextAreaMeta);\n}\n\nexport const inputSearchMeta: ComponentMeta<SearchProps> = {\n name: \"AntdInputSearch\",\n displayName: \"Antd Input Search\",\n props: sortProps<SearchProps>({\n ...commonHtmlAttributes,\n addonBefore: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n enterButton: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n loading: {\n type: \"boolean\",\n description: \"Search box with loading\",\n defaultValueHint: false,\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n prefix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"middle\", \"large\"],\n description: \"The size of the input box\",\n defaultValueHint: \"middle\",\n },\n suffix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n type: {\n type: \"string\",\n description: \"The type of input\",\n },\n value: {\n type: \"string\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [\n {\n name: \"event\",\n type: \"object\",\n },\n ],\n },\n }),\n states: {\n value: {\n type: \"writable\",\n variableType: \"text\",\n onChangeProp: \"onChange\",\n valueProp: \"value\",\n },\n },\n componentHelpers: inputHelpers,\n importPath: \"antd/lib/input/Search\",\n importName: \"Search\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputSearch(\n loader?: Registerable,\n customInputSearchMeta?: ComponentMeta<SearchProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Search, customInputSearchMeta ?? inputSearchMeta);\n}\n\nexport const inputPasswordMeta: ComponentMeta<PasswordProps> = {\n name: \"AntdInputPassword\",\n displayName: \"Antd Input Password\",\n props: sortProps<PasswordProps>({\n ...commonHtmlAttributes,\n addonAfter: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n addonBefore: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n allowClear: {\n type: \"boolean\",\n description: \"If allow to remove input content with clear icon\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the input is disabled\",\n defaultValueHint: false,\n },\n id: {\n type: \"string\",\n description: \"The ID for input\",\n },\n maxLength: {\n type: \"number\",\n description: \"The max length\",\n },\n placeholder: {\n type: \"string\",\n description: \"Placeholder for the input\",\n },\n prefix: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"middle\", \"large\"],\n description: \"The size of the input box\",\n defaultValueHint: \"middle\",\n },\n type: {\n type: \"string\",\n description: \"The type of input\",\n },\n value: {\n type: \"string\",\n },\n visibilityToggle: {\n type: \"boolean\",\n description: \"Whether show toggle button\",\n defaultValueHint: true,\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [\n {\n name: \"event\",\n type: \"object\",\n },\n ],\n },\n }),\n states: {\n value: {\n type: \"writable\",\n variableType: \"text\",\n onChangeProp: \"onChange\",\n valueProp: \"value\",\n },\n },\n componentHelpers: inputHelpers,\n importPath: \"antd/lib/input/Password\",\n importName: \"Password\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputPassword(\n loader?: Registerable,\n customInputPasswordMeta?: ComponentMeta<PasswordProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Password, customInputPasswordMeta ?? inputPasswordMeta);\n}\n\nexport const inputGroupMeta: ComponentMeta<GroupProps> = {\n name: \"AntdInputGroup\",\n displayName: \"Antd Input Group\",\n props: {\n compact: {\n type: \"boolean\",\n description: \"Whether use compact style\",\n defaultValueHint: false,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"default\", \"large\"],\n description:\n \"The size of Input.Group specifies the size of the included Input fields\",\n defaultValueHint: \"default\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdInput\",\n },\n {\n type: \"component\",\n name: \"AntdInput\",\n },\n ],\n },\n },\n importPath: \"antd/lib/input/Group\",\n importName: \"InputGroup\",\n isDefaultExport: true,\n parentComponentName: \"AntdInput\",\n};\n\nexport function registerInputGroup(\n loader?: Registerable,\n customInputGroupMeta?: ComponentMeta<GroupProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(InputGroup, customInputGroupMeta ?? inputGroupMeta);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAA,cAAA,CAAsC,GAAW,EAAA;AAC/C,EAAA,OAAO,OAAO,WAAY,CAAA,MAAA,CAAO,QAAQ,GAAG,CAAA,CAAE,MAAM,CAAA,CAAA;AACtD,CAAA;AAIA,SAAA,SAAA,CAAsB,KAAiC,EAAA;AACrD,EAAA,OAAO,eAAe,KAAK,CAAA,CAAA;AAC7B,CAAA;AAEA,MAAM,oBAAuB,GAAA;AAAA,EAC3B,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,QAAA;AAAA,IACN,W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,kBAAA;AAAA,EACb,KAAO,EAAA;AAAA,IACL,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,2BAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,IAAM,EAAA,QAAA;AAAA,MACN,OAAS,EAAA,CAAC,OAAS,EAAA,SAAA,EAAW,OAAO,CAAA;AAAA,MACrC,WACE,EAAA,yEAAA;AAAA,MACF,gBAAkB,EAAA,SAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,MAAA;AAAA,MACN,YAAc,EAAA;AAAA,QACZ;AAAA,UACE,IAAM,EAAA,WAAA;AAAA,UACN,IAAM,EAAA,WAAA;AAAA,SACR;AAAA,QACA;AAAA,UACE,IAAM,EAAA,WAAA;AAAA,UACN,IAAM,EAAA,WAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAAA,EACA,UAAY,EAAA,sBAAA;AAAA,EACZ,UAAY,EAAA,YAAA;AAAA,EACZ,eAAiB,EAAA,IAAA;AAAA,EACjB,mBAAqB,EAAA,WAAA;AACvB,EAAA;AAEO,SAAA,kBAAA,CACL,QACA,oBACA,EAAA;AACA,EAAM,MAAA,mBAAA,GAAgD,CAAI,GAAA,IAAA,KACxD,MAAS,GAAA,MAAA,CAAO,iBAAkB,CAAA,GAAG,IAAI,CAAA,GAAI,iBAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAA,UAAA,EAAY,sDAAwB,cAAc,CAAA,CAAA;AACxE;;;;"}
|
package/skinny/registerSelect.js
CHANGED
|
@@ -82,8 +82,6 @@ const selectMeta = {
|
|
|
82
82
|
},
|
|
83
83
|
value: {
|
|
84
84
|
type: "choice",
|
|
85
|
-
editOnly: true,
|
|
86
|
-
uncontrolledProp: "defaultValue",
|
|
87
85
|
description: "Initial selected option",
|
|
88
86
|
options: (componentProps) => {
|
|
89
87
|
const options = /* @__PURE__ */ new Set();
|
|
@@ -117,6 +115,27 @@ const selectMeta = {
|
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
]
|
|
118
|
+
},
|
|
119
|
+
onChange: {
|
|
120
|
+
type: "eventHandler",
|
|
121
|
+
argTypes: [
|
|
122
|
+
{
|
|
123
|
+
name: "value",
|
|
124
|
+
type: "string"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "option",
|
|
128
|
+
type: "object"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
states: {
|
|
134
|
+
value: {
|
|
135
|
+
type: "writable",
|
|
136
|
+
variableType: "text",
|
|
137
|
+
onChangeProp: "onChange",
|
|
138
|
+
valueProp: "value"
|
|
120
139
|
}
|
|
121
140
|
},
|
|
122
141
|
importPath: "antd/lib/select",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerSelect.js","sources":["../src/registerSelect.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Select from \"antd/lib/select\";\nimport { Option } from \"rc-select\";\nimport React from \"react\";\nimport { traverseReactEltTree } from \"./customControls\";\nimport { Registerable } from \"./registerable\";\n\ntype SelectProps = React.ComponentProps<typeof Select>;\n\nexport const selectMeta: ComponentMeta<SelectProps> = {\n name: \"AntdSelect\",\n displayName: \"Antd Select\",\n props: {\n allowClear: {\n type: \"boolean\",\n description: \"Show clear button\",\n defaultValueHint: false,\n },\n autoClearSearchValue: {\n type: \"boolean\",\n description:\n \"Whether the current search will be cleared on selecting an item\",\n defaultValueHint: true,\n hidden: props => props.mode !== \"multiple\" && props.mode !== \"tags\",\n },\n autoFocus: {\n type: \"boolean\",\n description: \"Get focus by default\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether disabled select\",\n defaultValueHint: false,\n },\n listHeight: {\n type: \"number\",\n description: \"Config popup height\",\n defaultValueHint: 256,\n },\n loading: {\n type: \"boolean\",\n description: \"Indicate loading state\",\n defaultValueHint: false,\n },\n mode: {\n type: \"choice\",\n options: [\"multiple\", \"tags\"],\n description: \"Set mode of Select\",\n },\n open: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultOpen\",\n description: \"Initial open state of dropdown\",\n defaultValueHint: false,\n },\n placeholder: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Select\",\n },\n ],\n },\n showArrow: {\n type: \"boolean\",\n description: \"Whether to show the drop-down arrow\",\n defaultValueHint: true,\n },\n showSearch: {\n type: \"boolean\",\n description: \"Whether show search input in single mode\",\n defaultValueHint: false,\n },\n size: {\n type: \"choice\",\n options: [\"large\", \"middle\", \"small\"],\n description: \"Set mode of Select\",\n defaultValueHint: \"middle\",\n },\n value: {\n type: \"choice\",\n
|
|
1
|
+
{"version":3,"file":"registerSelect.js","sources":["../src/registerSelect.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Select from \"antd/lib/select\";\nimport { Option } from \"rc-select\";\nimport React from \"react\";\nimport { traverseReactEltTree } from \"./customControls\";\nimport { Registerable } from \"./registerable\";\n\ntype SelectProps = React.ComponentProps<typeof Select>;\n\nexport const selectMeta: ComponentMeta<SelectProps> = {\n name: \"AntdSelect\",\n displayName: \"Antd Select\",\n props: {\n allowClear: {\n type: \"boolean\",\n description: \"Show clear button\",\n defaultValueHint: false,\n },\n autoClearSearchValue: {\n type: \"boolean\",\n description:\n \"Whether the current search will be cleared on selecting an item\",\n defaultValueHint: true,\n hidden: (props) => props.mode !== \"multiple\" && props.mode !== \"tags\",\n },\n autoFocus: {\n type: \"boolean\",\n description: \"Get focus by default\",\n defaultValueHint: false,\n },\n bordered: {\n type: \"boolean\",\n description: \"Whether has border style\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether disabled select\",\n defaultValueHint: false,\n },\n listHeight: {\n type: \"number\",\n description: \"Config popup height\",\n defaultValueHint: 256,\n },\n loading: {\n type: \"boolean\",\n description: \"Indicate loading state\",\n defaultValueHint: false,\n },\n mode: {\n type: \"choice\",\n options: [\"multiple\", \"tags\"],\n description: \"Set mode of Select\",\n },\n open: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultOpen\",\n description: \"Initial open state of dropdown\",\n defaultValueHint: false,\n },\n placeholder: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Select\",\n },\n ],\n },\n showArrow: {\n type: \"boolean\",\n description: \"Whether to show the drop-down arrow\",\n defaultValueHint: true,\n },\n showSearch: {\n type: \"boolean\",\n description: \"Whether show search input in single mode\",\n defaultValueHint: false,\n },\n size: {\n type: \"choice\",\n options: [\"large\", \"middle\", \"small\"],\n description: \"Set mode of Select\",\n defaultValueHint: \"middle\",\n },\n value: {\n type: \"choice\",\n description: \"Initial selected option\",\n options: (componentProps) => {\n const options = new Set<string>();\n traverseReactEltTree(componentProps.children, (elt) => {\n if (elt?.type === Option && typeof elt?.props?.value === \"string\") {\n options.add(elt.props.value);\n }\n });\n return Array.from(options.keys());\n },\n },\n virtual: {\n type: \"boolean\",\n description: \"Disable virtual scroll when set to false\",\n defaultValueHint: true,\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"AntdOption, AntdOptionGroup\"],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdOption\",\n props: {\n value: \"Option\",\n children: {\n type: \"text\",\n value: \"Option\",\n },\n },\n },\n ],\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [\n {\n name: \"value\",\n type: \"string\",\n },\n {\n name: \"option\",\n type: \"object\",\n },\n ],\n },\n },\n states: {\n value: {\n type: \"writable\",\n variableType: \"text\",\n onChangeProp: \"onChange\",\n valueProp: \"value\",\n },\n },\n importPath: \"antd/lib/select\",\n importName: \"Select\",\n isDefaultExport: true,\n};\n\nexport function registerSelect(\n loader?: Registerable,\n customSelectMeta?: ComponentMeta<SelectProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Select, customSelectMeta ?? selectMeta);\n}\n"],"names":[],"mappings":";;;;;AAWO,MAAM,UAAyC,GAAA;AAAA,EACpD,IAAM,EAAA,YAAA;AAAA,EACN,WAAa,EAAA,aAAA;AAAA,EACb,KAAO,EAAA;AAAA,IACL,UAAY,EAAA;AAAA,MACV,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,mBAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,oBAAsB,EAAA;AAAA,MACpB,IAAM,EAAA,SAAA;AAAA,MACN,WACE,EAAA,iEAAA;AAAA,MACF,gBAAkB,EAAA,IAAA;AAAA,MAClB,QAAQ,CAAC,KAAA,KAAU,MAAM,IAAS,KAAA,UAAA,IAAc,MAAM,IAAS,KAAA,MAAA;AAAA,KACjE;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,sBAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,0BAAA;AAAA,MACb,gBAAkB,EAAA,IAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,yBAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,UAAY,EAAA;AAAA,MACV,IAAM,EAAA,QAAA;AAAA,MACN,WAAa,EAAA,qBAAA;AAAA,MACb,gBAAkB,EAAA,GAAA;AAAA,KACpB;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MAC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A,EACA,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,UAAA;AAAA,MACN,YAAc,EAAA,MAAA;AAAA,MACd,YAAc,EAAA,UAAA;AAAA,MACd,SAAW,EAAA,OAAA;AAAA,KACb;AAAA,GACF;AAAA,EACA,UAAY,EAAA,iBAAA;AAAA,EACZ,UAAY,EAAA,QAAA;AAAA,EACZ,eAAiB,EAAA,IAAA;AACnB,EAAA;AAEO,SAAA,cAAA,CACL,QACA,gBACA,EAAA;AACA,EAAM,MAAA,mBAAA,GAAgD,CAAI,GAAA,IAAA,KACxD,MAAS,GAAA,MAAA,CAAO,iBAAkB,CAAA,GAAG,IAAI,CAAA,GAAI,iBAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAA,MAAA,EAAQ,8CAAoB,UAAU,CAAA,CAAA;AAC5D;;;;"}
|
package/skinny/registerSwitch.js
CHANGED
|
@@ -12,8 +12,6 @@ const switchMeta = {
|
|
|
12
12
|
},
|
|
13
13
|
checked: {
|
|
14
14
|
type: "boolean",
|
|
15
|
-
editOnly: true,
|
|
16
|
-
uncontrolledProp: "defaultChecked",
|
|
17
15
|
description: "Whether to set the initial state",
|
|
18
16
|
defaultValueHint: false
|
|
19
17
|
},
|
|
@@ -42,6 +40,27 @@ const switchMeta = {
|
|
|
42
40
|
options: ["small", "default"],
|
|
43
41
|
description: "The size of the Switch",
|
|
44
42
|
defaultValueHint: "default"
|
|
43
|
+
},
|
|
44
|
+
onChange: {
|
|
45
|
+
type: "eventHandler",
|
|
46
|
+
argTypes: [
|
|
47
|
+
{
|
|
48
|
+
name: "checked",
|
|
49
|
+
type: "boolean"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "event",
|
|
53
|
+
type: "object"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
states: {
|
|
59
|
+
value: {
|
|
60
|
+
type: "writable",
|
|
61
|
+
variableType: "boolean",
|
|
62
|
+
onChangeProp: "onChange",
|
|
63
|
+
valueProp: "checked"
|
|
45
64
|
}
|
|
46
65
|
},
|
|
47
66
|
importPath: "antd/lib/switch",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerSwitch.js","sources":["../src/registerSwitch.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Switch, { SwitchProps } from \"antd/lib/switch\";\nimport { Registerable } from \"./registerable\";\n\nexport const switchMeta: ComponentMeta<SwitchProps> = {\n name: \"AntdSwitch\",\n displayName: \"Antd Switch\",\n props: {\n autoFocus: {\n type: \"boolean\",\n description: \"Whether get focus when component mounted\",\n defaultValueHint: false,\n },\n checked: {\n type: \"boolean\",\n
|
|
1
|
+
{"version":3,"file":"registerSwitch.js","sources":["../src/registerSwitch.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Switch, { SwitchProps } from \"antd/lib/switch\";\nimport { Registerable } from \"./registerable\";\n\nexport const switchMeta: ComponentMeta<SwitchProps> = {\n name: \"AntdSwitch\",\n displayName: \"Antd Switch\",\n props: {\n autoFocus: {\n type: \"boolean\",\n description: \"Whether get focus when component mounted\",\n defaultValueHint: false,\n },\n checked: {\n type: \"boolean\",\n description: \"Whether to set the initial state\",\n defaultValueHint: false,\n },\n disabled: {\n type: \"boolean\",\n description: \"Disable switch\",\n defaultValueHint: false,\n },\n loading: {\n type: \"boolean\",\n description: \"Loading state of switch\",\n defaultValueHint: false,\n },\n checkedChildren: {\n type: \"slot\",\n defaultValue: [],\n hidePlaceholder: true,\n },\n unCheckedChildren: {\n type: \"slot\",\n defaultValue: [],\n hidePlaceholder: true,\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"default\"],\n description: \"The size of the Switch\",\n defaultValueHint: \"default\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [\n {\n name: \"checked\",\n type: \"boolean\",\n },\n {\n name: \"event\",\n type: \"object\",\n },\n ],\n },\n },\n states: {\n value: {\n type: \"writable\",\n variableType: \"boolean\",\n onChangeProp: \"onChange\",\n valueProp: \"checked\",\n },\n },\n importPath: \"antd/lib/switch\",\n importName: \"Switch\",\n isDefaultExport: true,\n};\n\nexport function registerSwitch(\n loader?: Registerable,\n customSwitchMeta?: ComponentMeta<SwitchProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Switch, customSwitchMeta ?? switchMeta);\n}\n"],"names":[],"mappings":";;;AAMO,MAAM,UAAyC,GAAA;AAAA,EACpD,IAAM,EAAA,YAAA;AAAA,EACN,WAAa,EAAA,aAAA;AAAA,EACb,KAAO,EAAA;AAAA,IACL,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,0CAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,kCAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,gBAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,yBAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,eAAiB,EAAA;AAAA,MACf,IAAM,EAAA,MAAA;AAAA,MACN,cAAc,EAAC;AAAA,MACf,eAAiB,EAAA,IAAA;AAAA,KACnB;AAAA,IACA,iBAAmB,EAAA;AAAA,MACjB,IAAM,EAAA,MAAA;AAAA,MACN,cAAc,EAAC;AAAA,MACf,eAAiB,EAAA,IAAA;AAAA,KACnB;AA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