@plasmicpkgs/antd5 0.0.55 → 0.0.59

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.
Files changed (67) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/antd.esm.js +2423 -1981
  3. package/dist/antd.esm.js.map +1 -1
  4. package/dist/index.d.ts +19 -0
  5. package/dist/index.js +2429 -1979
  6. package/dist/index.js.map +1 -1
  7. package/dist/registerButton.d.ts +1 -0
  8. package/dist/registerCheckbox.d.ts +7 -0
  9. package/dist/registerDropdown.d.ts +4 -1
  10. package/dist/registerForm.d.ts +34 -0
  11. package/dist/registerInput.d.ts +4 -0
  12. package/dist/registerMenu.d.ts +76 -0
  13. package/dist/registerRadio.d.ts +4 -0
  14. package/dist/registerSelect.d.ts +3 -0
  15. package/dist/registerSwitch.d.ts +11 -0
  16. package/package.json +4 -4
  17. package/skinny/registerButton.cjs.js +5 -3
  18. package/skinny/registerButton.cjs.js.map +1 -1
  19. package/skinny/registerButton.d.ts +1 -0
  20. package/skinny/registerButton.esm.js +5 -4
  21. package/skinny/registerButton.esm.js.map +1 -1
  22. package/skinny/registerCheckbox.cjs.js +13 -12
  23. package/skinny/registerCheckbox.cjs.js.map +1 -1
  24. package/skinny/registerCheckbox.d.ts +7 -0
  25. package/skinny/registerCheckbox.esm.js +12 -13
  26. package/skinny/registerCheckbox.esm.js.map +1 -1
  27. package/skinny/registerConfigProvider.cjs.js.map +1 -1
  28. package/skinny/registerConfigProvider.esm.js.map +1 -1
  29. package/skinny/registerDropdown.cjs.js +85 -38
  30. package/skinny/registerDropdown.cjs.js.map +1 -1
  31. package/skinny/registerDropdown.d.ts +4 -1
  32. package/skinny/registerDropdown.esm.js +85 -38
  33. package/skinny/registerDropdown.esm.js.map +1 -1
  34. package/skinny/registerForm.cjs.js +317 -158
  35. package/skinny/registerForm.cjs.js.map +1 -1
  36. package/skinny/registerForm.d.ts +34 -0
  37. package/skinny/registerForm.esm.js +314 -160
  38. package/skinny/registerForm.esm.js.map +1 -1
  39. package/skinny/registerInput.cjs.js +35 -21
  40. package/skinny/registerInput.cjs.js.map +1 -1
  41. package/skinny/registerInput.d.ts +4 -0
  42. package/skinny/registerInput.esm.js +32 -22
  43. package/skinny/registerInput.esm.js.map +1 -1
  44. package/skinny/registerMenu.cjs.js +74 -2
  45. package/skinny/registerMenu.cjs.js.map +1 -1
  46. package/skinny/registerMenu.d.ts +76 -0
  47. package/skinny/registerMenu.esm.js +73 -3
  48. package/skinny/registerMenu.esm.js.map +1 -1
  49. package/skinny/registerRadio.cjs.js +85 -24
  50. package/skinny/registerRadio.cjs.js.map +1 -1
  51. package/skinny/registerRadio.d.ts +4 -0
  52. package/skinny/registerRadio.esm.js +83 -25
  53. package/skinny/registerRadio.esm.js.map +1 -1
  54. package/skinny/registerSelect.cjs.js +60 -27
  55. package/skinny/registerSelect.cjs.js.map +1 -1
  56. package/skinny/registerSelect.d.ts +3 -0
  57. package/skinny/registerSelect.esm.js +58 -28
  58. package/skinny/registerSelect.esm.js.map +1 -1
  59. package/skinny/registerSwitch.cjs.js +79 -0
  60. package/skinny/registerSwitch.cjs.js.map +1 -0
  61. package/skinny/registerSwitch.d.ts +11 -0
  62. package/skinny/registerSwitch.esm.js +71 -0
  63. package/skinny/registerSwitch.esm.js.map +1 -0
  64. package/skinny/registerUpload.cjs.js +4 -3
  65. package/skinny/registerUpload.cjs.js.map +1 -1
  66. package/skinny/registerUpload.esm.js +4 -3
  67. package/skinny/registerUpload.esm.js.map +1 -1
@@ -5,4 +5,5 @@ export declare function AntdButton(props: Omit<React.ComponentProps<typeof Butto
5
5
  submitsForm?: boolean;
6
6
  target?: React.ComponentProps<typeof Button>["target"] | boolean;
7
7
  }): JSX.Element;
8
+ export declare const buttonComponentName = "plasmic-antd5-button";
8
9
  export declare function registerButton(loader?: Registerable): void;
@@ -4,5 +4,12 @@ import { Registerable } from "./utils";
4
4
  export declare function AntdCheckbox(props: Omit<React.ComponentProps<typeof Checkbox>, "onChange"> & {
5
5
  onChange?: (checked: boolean) => void;
6
6
  }): JSX.Element;
7
+ export declare namespace AntdCheckbox {
8
+ var __plasmicFormFieldMeta: {
9
+ valueProp: string;
10
+ };
11
+ }
7
12
  export declare const AntdCheckboxGroup: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("antd/es/checkbox").CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>>;
13
+ export declare const checkboxComponentName = "plasmic-antd5-checkbox";
14
+ export declare const checkboxGroupComponentName = "plasmic-antd5-checkbox";
8
15
  export declare function registerCheckbox(loader?: Registerable): void;
@@ -1,9 +1,12 @@
1
- import { Dropdown } from "antd";
1
+ import { Dropdown, Menu } from "antd";
2
2
  import React from "react";
3
3
  import { Registerable } from "./utils";
4
4
  export declare function AntdDropdown(props: Omit<React.ComponentProps<typeof Dropdown>, "menu" | "overlay"> & {
5
5
  onAction?: (key: string) => void;
6
6
  menuItems?: () => React.ReactNode;
7
+ useMenuItemsSlot?: boolean;
8
+ menuItemsJson?: React.ComponentProps<typeof Menu>["items"];
9
+ trigger?: "click" | "hover" | "contextMenu";
7
10
  }): JSX.Element;
8
11
  /**
9
12
  * Note that we don't yet support the simpler `items` prop for configuration.
@@ -1,9 +1,36 @@
1
+ import { CodeComponentMode } from "@plasmicapp/host";
1
2
  import { Form } from "antd";
2
3
  import type { FormProps } from "antd/es/form";
3
4
  import type { FormItemProps } from "antd/es/form/FormItem";
4
5
  import type { FormListOperation, FormListProps } from "antd/es/form/FormList";
5
6
  import React from "react";
6
7
  import { Registerable } from "./utils";
8
+ interface InternalFormItemProps extends Omit<FormItemProps, "rules"> {
9
+ rules?: PlasmicRule[];
10
+ noLabel?: boolean;
11
+ customizeProps?: (fieldData: CuratedFieldData, props: InternalFormItemProps) => FormItemProps;
12
+ setControlContextData?: (data: FormControlContextData) => void;
13
+ }
14
+ export declare enum InputType {
15
+ Text = "Text",
16
+ TextArea = "Text Area",
17
+ Password = "Password",
18
+ Number = "Number",
19
+ Select = "Select",
20
+ Option = "Option",
21
+ OptionGroup = "Option Group",
22
+ Radio = "Radio",
23
+ RadioGroup = "Radio Group",
24
+ Checkbox = "Checkbox"
25
+ }
26
+ export interface SimplifiedFormItemsProp extends InternalFormItemProps {
27
+ inputType: InputType;
28
+ options?: {
29
+ label: string;
30
+ value: string;
31
+ }[];
32
+ optionType?: "default" | "button";
33
+ }
7
34
  interface FormWrapperProps extends FormProps {
8
35
  /**
9
36
  * https://ant.design/components/form#setfieldsvalue-do-not-trigger-onfieldschange-or-onvalueschange
@@ -13,6 +40,9 @@ interface FormWrapperProps extends FormProps {
13
40
  * overridden this function in their codebase
14
41
  **/
15
42
  extendedOnValuesChange?: (values: Parameters<NonNullable<FormProps["onValuesChange"]>>[1]) => void;
43
+ formItems: SimplifiedFormItemsProp[];
44
+ mode?: CodeComponentMode;
45
+ submitSlot?: boolean;
16
46
  }
17
47
  interface InternalFormInstanceContextData {
18
48
  fireOnValuesChange: () => void;
@@ -24,6 +54,7 @@ interface FormLayoutContextValue {
24
54
  labelSpan?: number;
25
55
  }
26
56
  export declare function FormWrapper(props: FormWrapperProps): JSX.Element;
57
+ export declare const formComponentName = "plasmic-antd5-form";
27
58
  export declare function registerForm(loader?: Registerable): void;
28
59
  interface FormControlContextData {
29
60
  internalFormCtx?: InternalFormInstanceContextData;
@@ -51,15 +82,18 @@ interface PlasmicRule {
51
82
  message?: string;
52
83
  }
53
84
  export declare function FormItemWrapper(props: InternalFormItemProps): JSX.Element;
85
+ export declare const formItemComponentName = "plasmic-antd5-form-item";
54
86
  export declare function registerFormItem(loader?: Registerable): void;
55
87
  export interface FormGroupProps {
56
88
  name: string;
57
89
  children: React.ReactNode;
58
90
  }
59
91
  export declare function FormGroup(props: FormGroupProps): JSX.Element;
92
+ export declare const formGroupComponentName = "plasmic-antd5-form-group";
60
93
  export declare function registerFormGroup(loader?: Registerable): void;
61
94
  export declare const FormListWrapper: React.ForwardRefExoticComponent<FormListProps & {
62
95
  children: React.ReactNode;
63
96
  } & React.RefAttributes<FormListOperation>>;
97
+ export declare const formListComponentName = "plasmic-antd5-form-list";
64
98
  export declare function registerFormList(loader?: Registerable): void;
65
99
  export {};
@@ -24,7 +24,11 @@ export declare const inputHelpers: {
24
24
  };
25
25
  };
26
26
  };
27
+ export declare const inputComponentName = "plasmic-antd5-input";
27
28
  export declare function registerInput(loader?: Registerable): void;
29
+ export declare const textAreaComponentName = "plasmic-antd5-textarea";
28
30
  export declare function registerTextArea(loader?: Registerable): void;
31
+ export declare const passwordComponentName = "plasmic-antd5-input-password";
29
32
  export declare function registerPasswordInput(loader?: Registerable): void;
33
+ export declare const inputNumberComponentName = "plasmic-antd5-input-number";
30
34
  export declare function registerNumberInput(loader?: Registerable): void;
@@ -10,6 +10,82 @@ export declare const AntdMenuDivider: import("react").FC<import("antd/es/menu").
10
10
  export declare const AntdMenuItem: import("react").FC<import("antd").MenuItemProps>;
11
11
  export declare const AntdMenuItemGroup: typeof import("rc-menu").MenuItemGroup;
12
12
  export declare const AntdSubMenu: import("react").FC<import("antd").SubMenuProps>;
13
+ export declare const MENU_ITEM_TYPE: {
14
+ type: string;
15
+ nameFunc: (item: any) => any;
16
+ fields: {
17
+ type: {
18
+ type: string;
19
+ options: {
20
+ value: string;
21
+ label: string;
22
+ }[];
23
+ defaultValue: string;
24
+ };
25
+ key: {
26
+ type: string;
27
+ displayName: string;
28
+ description: string;
29
+ hidden: (ps: any) => boolean;
30
+ };
31
+ label: {
32
+ type: string;
33
+ description: string;
34
+ hidden: (ps: any) => boolean;
35
+ };
36
+ children: {
37
+ type: string;
38
+ displayName: string;
39
+ hidden: (ps: any) => boolean;
40
+ };
41
+ onClick: {
42
+ type: string;
43
+ displayName: string;
44
+ description: string;
45
+ argTypes: {
46
+ name: string;
47
+ type: string;
48
+ }[];
49
+ hidden: (ps: any) => boolean;
50
+ };
51
+ };
52
+ };
53
+ export declare const UNKEYED_MENU_ITEM_TYPE: {
54
+ fields: {
55
+ [k: string]: {
56
+ type: string;
57
+ options: {
58
+ value: string;
59
+ label: string;
60
+ }[];
61
+ defaultValue: string;
62
+ } | {
63
+ type: string;
64
+ displayName: string;
65
+ description: string;
66
+ hidden: (ps: any) => boolean;
67
+ } | {
68
+ type: string;
69
+ description: string;
70
+ hidden: (ps: any) => boolean;
71
+ } | {
72
+ type: string;
73
+ displayName: string;
74
+ hidden: (ps: any) => boolean;
75
+ } | {
76
+ type: string;
77
+ displayName: string;
78
+ description: string;
79
+ argTypes: {
80
+ name: string;
81
+ type: string;
82
+ }[];
83
+ hidden: (ps: any) => boolean;
84
+ };
85
+ };
86
+ type: string;
87
+ nameFunc: (item: any) => any;
88
+ };
13
89
  /**
14
90
  * Note that the Menu component by itself isn't that useful.
15
91
  * It is supposed to be a stateful component, but we don't have state yet (for selected, open, etc.).
@@ -8,6 +8,10 @@ export declare const AntdRadio: React.ForwardRefExoticComponent<import("antd").R
8
8
  export declare const AntdRadioButton: React.ForwardRefExoticComponent<import("antd/es/radio/radioButton").RadioButtonProps & React.RefAttributes<any>>;
9
9
  export declare function AntdRadioGroup(props: Omit<React.ComponentProps<typeof RadioGroup>, "onChange"> & {
10
10
  onChange?: (value?: string) => void;
11
+ useChildren?: boolean;
11
12
  }): JSX.Element;
13
+ export declare const radioComponentName = "plasmic-antd5-radio";
14
+ export declare const radioButtonComponentName = "plasmic-antd5-radio-button";
15
+ export declare const radioGroupComponentName = "plasmic-antd5-radio-group";
12
16
  export declare function registerRadio(loader?: Registerable): void;
13
17
  export {};
@@ -9,4 +9,7 @@ export declare function AntdSelect(props: ComponentProps<typeof Select> & {
9
9
  defaultStylesClassName?: string;
10
10
  useChildren?: boolean;
11
11
  }): JSX.Element;
12
+ export declare const selectComponentName = "plasmic-antd5-select";
13
+ export declare const optionComponentName = "plasmic-antd5-option";
14
+ export declare const optionGroupComponentName = "plasmic-antd5-option-group";
12
15
  export declare function registerSelect(loader?: Registerable): void;
@@ -0,0 +1,11 @@
1
+ import { Switch } from "antd";
2
+ import React from "react";
3
+ import { Registerable } from "./utils";
4
+ export declare function AntdSwitch(props: React.ComponentProps<typeof Switch>): JSX.Element;
5
+ export declare namespace AntdSwitch {
6
+ var __plasmicFormFieldMeta: {
7
+ valueProp: string;
8
+ };
9
+ }
10
+ export declare const switchComponentName = "plasmic-antd5-switch";
11
+ export declare function registerSwitch(loader?: Registerable): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/antd5",
3
- "version": "0.0.55",
3
+ "version": "0.0.59",
4
4
  "description": "Plasmic registration calls for antd components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,8 +55,8 @@
55
55
  "antd": "^5.1.6"
56
56
  },
57
57
  "devDependencies": {
58
- "@plasmicapp/host": "1.0.133",
59
- "@plasmicapp/query": "0.1.63",
58
+ "@plasmicapp/host": "1.0.136",
59
+ "@plasmicapp/query": "0.1.64",
60
60
  "@types/node": "^14.0.26",
61
61
  "@types/react": "^18.0.27",
62
62
  "@types/react-dom": "^18.0.10",
@@ -76,5 +76,5 @@
76
76
  "publishConfig": {
77
77
  "access": "public"
78
78
  },
79
- "gitHead": "9046e96d5d51d83325652cfb6b8d160aabdfb201"
79
+ "gitHead": "9f7e1bff70ae5f945027b4718d85d2a17f89501e"
80
80
  }
@@ -53,9 +53,10 @@ function AntdButton(props) {
53
53
  })
54
54
  );
55
55
  }
56
+ const buttonComponentName = "plasmic-antd5-button";
56
57
  function registerButton(loader) {
57
58
  utils.registerComponentHelper(loader, AntdButton, {
58
- name: "plasmic-antd5-button",
59
+ name: buttonComponentName,
59
60
  displayName: "Button",
60
61
  props: {
61
62
  type: {
@@ -116,7 +117,7 @@ function registerButton(loader) {
116
117
  hidden: (props) => !props.href,
117
118
  defaultValueHint: false
118
119
  },
119
- children: {
120
+ children: __spreadValues({
120
121
  type: "slot",
121
122
  defaultValue: [
122
123
  {
@@ -124,7 +125,7 @@ function registerButton(loader) {
124
125
  value: "Button"
125
126
  }
126
127
  ]
127
- },
128
+ }, { mergeWithParent: true }),
128
129
  icon: {
129
130
  type: "slot",
130
131
  hidePlaceholder: true,
@@ -141,5 +142,6 @@ function registerButton(loader) {
141
142
  }
142
143
 
143
144
  exports.AntdButton = AntdButton;
145
+ exports.buttonComponentName = buttonComponentName;
144
146
  exports.registerButton = registerButton;
145
147
  //# sourceMappingURL=registerButton.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerButton.cjs.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"antd\";\nimport { Registerable, registerComponentHelper } from \"./utils\";\n\nexport function AntdButton(\n props: Omit<React.ComponentProps<typeof Button>, \"target\"> & {\n submitsForm?: boolean;\n target?: React.ComponentProps<typeof Button>[\"target\"] | boolean;\n }\n) {\n const { submitsForm = false, ...rest } = props;\n const target =\n props.target === true\n ? \"_blank\"\n : props.target === false\n ? undefined\n : props.target;\n return (\n <Button\n {...rest}\n htmlType={submitsForm ? \"submit\" : \"button\"}\n {...rest}\n target={target}\n />\n );\n}\n\nexport function registerButton(loader?: Registerable) {\n registerComponentHelper(loader, AntdButton, {\n name: \"plasmic-antd5-button\",\n displayName: \"Button\",\n props: {\n type: {\n type: \"choice\",\n options: [\"default\", \"primary\", \"ghost\", \"dashed\", \"link\", \"text\"],\n description:\n \"Can be set to primary, ghost, dashed, link, text, default\",\n defaultValueHint: \"default\",\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"medium\", \"large\"],\n description: \"Set the size of button\",\n defaultValueHint: \"medium\",\n },\n shape: {\n type: \"choice\",\n options: [\"default\", \"circle\", \"round\"],\n description: \"Set the button shape\",\n defaultValueHint: \"default\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the button is disabled\",\n defaultValueHint: false,\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n description:\n \"whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n ghost: {\n type: \"boolean\",\n description:\n \"Make background transparent and invert text and border colors\",\n defaultValueHint: false,\n advanced: true,\n },\n danger: {\n type: \"boolean\",\n description: \"Set the danger status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n loading: {\n type: \"boolean\",\n description: \"Set the loading status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n href: {\n type: \"string\",\n description: \"Redirect url of link button\",\n },\n target: {\n type: \"boolean\",\n description: \"Whether to open the link in a new window\",\n hidden: (props) => !props.href,\n defaultValueHint: false,\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Button\",\n },\n ],\n },\n icon: {\n type: \"slot\",\n hidePlaceholder: true,\n hidden: () => true,\n },\n onClick: {\n type: \"eventHandler\",\n argTypes: [],\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerButton\",\n importName: \"AntdButton\",\n });\n}\n"],"names":["React","Button","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,WACd,KAIA,EAAA;AACA,EAAA,MAAyC,YAAjC,EAAc,WAAA,GAAA,KAAA,KAAmB,EAAT,EAAA,IAAA,GAAA,SAAA,CAAS,IAAT,CAAxB,aAAA,CAAA,CAAA,CAAA;AACR,EAAM,MAAA,MAAA,GACJ,MAAM,MAAW,KAAA,IAAA,GACb,WACA,KAAM,CAAA,MAAA,KAAW,KACjB,GAAA,KAAA,CAAA,GACA,KAAM,CAAA,MAAA,CAAA;AACZ,EACE,uBAAAA,sBAAA,CAAA,aAAA;AAAA,IAACC,WAAA;AAAA,IAAA,aAAA,CAAA,cAAA,CAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACK,IADL,CAAA,EAAA;AAAA,MAEC,QAAA,EAAU,cAAc,QAAW,GAAA,QAAA;AAAA,KAAA,CAAA,EAC/B,IAHL,CAAA,EAAA;AAAA,MAIC,MAAA;AAAA,KAAA,CAAA;AAAA,GACF,CAAA;AAEJ,CAAA;AAEO,SAAS,eAAe,MAAuB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AM,EAAA,SAAA;AAAA,QACN,WAAa,EAAA,iCAAA;AAAA,QACb,gBAAkB,EAAA,KAAA;AAAA,QAClB,QAAU,EAAA,IAAA;AAAA,OACZ;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,SAAA;AAAA,QACN,WAAa,EAAA,kCAAA;AAAA,QACb,gBAAkB,EAAA,KAAA;AAAA,QAClB,QAAU,EAAA,IAAA;AAAA,OACZ;AAAA,MACA,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,QAAA;AAAA,QACN,WAAa,EAAA,6BAAA;AAAA,OACf;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,IAAM,EAAA,SAAA;AAAA,QACN,WAAa,EAAA,0CAAA;AAAA,QACb,MAAQ,EAAA,CAAC,KAAU,KAAA,CAAC,KAAM,CAAA,IAAA;AAAA,QAC1B,gBAAkB,EAAA,KAAA;AAAA,OACpB;AAAA,MACA,QAAU,EAAA;AAAA,QACR,IAAM,EAAA,MAAA;AAAA,QACN,YAAc,EAAA;AAAA,UACZ;AAAA,YACE,IAAM,EAAA,MAAA;AAAA,YACN,KAAO,EAAA,QAAA;AAAA,WACT;AAAA,SACF;AAAA,OACF;AAAA,MACA,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,MAAA;AAAA,QACN,eAAiB,EAAA,IAAA;AAAA,QACjB,QAAQ,MAAM,IAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,cAAA;AAAA,QACN,UAAU,EAAC;AAAA,OACb;AAAA,KACF;AAAA,IACA,UAAY,EAAA,0CAAA;AAAA,IACZ,UAAY,EAAA,YAAA;AAAA,GACb,CAAA,CAAA;AACH;;;;;"}
1
+ {"version":3,"file":"registerButton.cjs.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"antd\";\nimport { Registerable, registerComponentHelper } from \"./utils\";\n\nexport function AntdButton(\n props: Omit<React.ComponentProps<typeof Button>, \"target\"> & {\n submitsForm?: boolean;\n target?: React.ComponentProps<typeof Button>[\"target\"] | boolean;\n }\n) {\n const { submitsForm = false, ...rest } = props;\n const target =\n props.target === true\n ? \"_blank\"\n : props.target === false\n ? undefined\n : props.target;\n return (\n <Button\n {...rest}\n htmlType={submitsForm ? \"submit\" : \"button\"}\n {...rest}\n target={target}\n />\n );\n}\n\nexport const buttonComponentName = \"plasmic-antd5-button\";\n\nexport function registerButton(loader?: Registerable) {\n registerComponentHelper(loader, AntdButton, {\n name: buttonComponentName,\n displayName: \"Button\",\n props: {\n type: {\n type: \"choice\",\n options: [\"default\", \"primary\", \"ghost\", \"dashed\", \"link\", \"text\"],\n description:\n \"Can be set to primary, ghost, dashed, link, text, default\",\n defaultValueHint: \"default\",\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"medium\", \"large\"],\n description: \"Set the size of button\",\n defaultValueHint: \"medium\",\n },\n shape: {\n type: \"choice\",\n options: [\"default\", \"circle\", \"round\"],\n description: \"Set the button shape\",\n defaultValueHint: \"default\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the button is disabled\",\n defaultValueHint: false,\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n description:\n \"whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n ghost: {\n type: \"boolean\",\n description:\n \"Make background transparent and invert text and border colors\",\n defaultValueHint: false,\n advanced: true,\n },\n danger: {\n type: \"boolean\",\n description: \"Set the danger status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n loading: {\n type: \"boolean\",\n description: \"Set the loading status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n href: {\n type: \"string\",\n description: \"Redirect url of link button\",\n },\n target: {\n type: \"boolean\",\n description: \"Whether to open the link in a new window\",\n hidden: (props) => !props.href,\n defaultValueHint: false,\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Button\",\n },\n ],\n ...({ mergeWithParent: true } as any),\n },\n icon: {\n type: \"slot\",\n hidePlaceholder: true,\n hidden: () => true,\n },\n onClick: {\n type: \"eventHandler\",\n argTypes: [],\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerButton\",\n importName: \"AntdButton\",\n });\n}\n"],"names":["React","Button","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,WACd,KAIA,EAAA;AACA,EAAA,MAAyC,YAAjC,EAAc,WAAA,GAAA,KAAA,KAAmB,EAAT,EAAA,IAAA,GAAA,SAAA,CAAS,IAAT,CAAxB,aAAA,CAAA,CAAA,CAAA;AACR,EAAM,MAAA,MAAA,GACJ,MAAM,MAAW,KAAA,IAAA,GACb,WACA,KAAM,CAAA,MAAA,KAAW,KACjB,GAAA,KAAA,CAAA,GACA,KAAM,CAAA,MAAA,CAAA;AACZ,EACE,uBAAAA,sBAAA,CAAA,aAAA;AAAA,IAACC,WAAA;AAAA,IAAA,aAAA,CAAA,cAAA,CAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACK,IADL,CAAA,EAAA;AAAA,MAEC,QAAA,EAAU,cAAc,QAAW,GAAA,QAAA;AAAA,KAAA,CAAA,EAC/B,IAHL,CAAA,EAAA;AAAA,MAIC,MAAA;AAAA,KAAA,CAAA;AAAA,GACF,CAAA;AAEJ,CAAA;AAEO,MAAM,mBAAsB,GAAA,uBAAA;AAE5B,SAAS,eAAe,MAAuB,EAAA;AACpD,EAAAC,6BAAA,CAAwB,QAAQ,UAAY,EAAA;AAAA,IAC1C,IAAM,EAAA,mBAAA;AAAA,IACN,WAAa,EAAA,QAAA;AAAA,IACb,KAAO,EAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,QAAA;AAAA,QACN,SAAS,CAAC,SAAA,EAAW,WAAW,OAAS,EAAA,QAAA,EAAU,QAAQ,MAAM,CAAA;AAAA,QACjE,WACE,EAAA,2DAAA;AAAA,QACF,gBAAkB,EAAA,SAAA;AAAA,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,EAAA,6BAAA;AAAA,OACf;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,IAAM,EAAA,SAAA;AAAA,QACN,WAAa,EAAA,0CAAA;AAAA,QACb,MAAQ,EAAA,CAAC,KAAU,KAAA,CAAC,KAAM,CAAA,IAAA;AAAA,QAC1B,gBAAkB,EAAA,KAAA;AAAA,OACpB;AAAA,MACA,QAAU,EAAA,cAAA,CAAA;AAAA,QACR,IAAM,EAAA,MAAA;AAAA,QACN,YAAc,EAAA;AAAA,UACZ;AAAA,YACE,IAAM,EAAA,MAAA;AAAA,YACN,KAAO,EAAA,QAAA;AAAA,WACT;AAAA,SACF;AAAA,OACI,EAAA,EAAE,iBAAiB,IAAK,EAAA,CAAA;AAAA,MAE9B,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,MAAA;AAAA,QACN,eAAiB,EAAA,IAAA;AAAA,QACjB,QAAQ,MAAM,IAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,cAAA;AAAA,QACN,UAAU,EAAC;AAAA,OACb;AAAA,KACF;AAAA,IACA,UAAY,EAAA,0CAAA;AAAA,IACZ,UAAY,EAAA,YAAA;AAAA,GACb,CAAA,CAAA;AACH;;;;;;"}
@@ -5,4 +5,5 @@ export declare function AntdButton(props: Omit<React.ComponentProps<typeof Butto
5
5
  submitsForm?: boolean;
6
6
  target?: React.ComponentProps<typeof Button>["target"] | boolean;
7
7
  }): JSX.Element;
8
+ export declare const buttonComponentName = "plasmic-antd5-button";
8
9
  export declare function registerButton(loader?: Registerable): void;
@@ -47,9 +47,10 @@ function AntdButton(props) {
47
47
  })
48
48
  );
49
49
  }
50
+ const buttonComponentName = "plasmic-antd5-button";
50
51
  function registerButton(loader) {
51
52
  registerComponentHelper(loader, AntdButton, {
52
- name: "plasmic-antd5-button",
53
+ name: buttonComponentName,
53
54
  displayName: "Button",
54
55
  props: {
55
56
  type: {
@@ -110,7 +111,7 @@ function registerButton(loader) {
110
111
  hidden: (props) => !props.href,
111
112
  defaultValueHint: false
112
113
  },
113
- children: {
114
+ children: __spreadValues({
114
115
  type: "slot",
115
116
  defaultValue: [
116
117
  {
@@ -118,7 +119,7 @@ function registerButton(loader) {
118
119
  value: "Button"
119
120
  }
120
121
  ]
121
- },
122
+ }, { mergeWithParent: true }),
122
123
  icon: {
123
124
  type: "slot",
124
125
  hidePlaceholder: true,
@@ -134,5 +135,5 @@ function registerButton(loader) {
134
135
  });
135
136
  }
136
137
 
137
- export { AntdButton, registerButton };
138
+ export { AntdButton, buttonComponentName, registerButton };
138
139
  //# sourceMappingURL=registerButton.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerButton.esm.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"antd\";\nimport { Registerable, registerComponentHelper } from \"./utils\";\n\nexport function AntdButton(\n props: Omit<React.ComponentProps<typeof Button>, \"target\"> & {\n submitsForm?: boolean;\n target?: React.ComponentProps<typeof Button>[\"target\"] | boolean;\n }\n) {\n const { submitsForm = false, ...rest } = props;\n const target =\n props.target === true\n ? \"_blank\"\n : props.target === false\n ? undefined\n : props.target;\n return (\n <Button\n {...rest}\n htmlType={submitsForm ? \"submit\" : \"button\"}\n {...rest}\n target={target}\n />\n );\n}\n\nexport function registerButton(loader?: Registerable) {\n registerComponentHelper(loader, AntdButton, {\n name: \"plasmic-antd5-button\",\n displayName: \"Button\",\n props: {\n type: {\n type: \"choice\",\n options: [\"default\", \"primary\", \"ghost\", \"dashed\", \"link\", \"text\"],\n description:\n \"Can be set to primary, ghost, dashed, link, text, default\",\n defaultValueHint: \"default\",\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"medium\", \"large\"],\n description: \"Set the size of button\",\n defaultValueHint: \"medium\",\n },\n shape: {\n type: \"choice\",\n options: [\"default\", \"circle\", \"round\"],\n description: \"Set the button shape\",\n defaultValueHint: \"default\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the button is disabled\",\n defaultValueHint: false,\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n description:\n \"whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n ghost: {\n type: \"boolean\",\n description:\n \"Make background transparent and invert text and border colors\",\n defaultValueHint: false,\n advanced: true,\n },\n danger: {\n type: \"boolean\",\n description: \"Set the danger status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n loading: {\n type: \"boolean\",\n description: \"Set the loading status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n href: {\n type: \"string\",\n description: \"Redirect url of link button\",\n },\n target: {\n type: \"boolean\",\n description: \"Whether to open the link in a new window\",\n hidden: (props) => !props.href,\n defaultValueHint: false,\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Button\",\n },\n ],\n },\n icon: {\n type: \"slot\",\n hidePlaceholder: true,\n hidden: () => true,\n },\n onClick: {\n type: \"eventHandler\",\n argTypes: [],\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerButton\",\n importName: \"AntdButton\",\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,WACd,KAIA,EAAA;AACA,EAAA,MAAyC,YAAjC,EAAc,WAAA,GAAA,KAAA,KAAmB,EAAT,EAAA,IAAA,GAAA,SAAA,CAAS,IAAT,CAAxB,aAAA,CAAA,CAAA,CAAA;AACR,EAAM,MAAA,MAAA,GACJ,MAAM,MAAW,KAAA,IAAA,GACb,WACA,KAAM,CAAA,MAAA,KAAW,KACjB,GAAA,KAAA,CAAA,GACA,KAAM,CAAA,MAAA,CAAA;AACZ,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA,aAAA,CAAA,cAAA,CAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACK,IADL,CAAA,EAAA;AAAA,MAEC,QAAA,EAAU,cAAc,QAAW,GAAA,QAAA;AAAA,KAAA,CAAA,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import React from \"react\";\nimport { Button } from \"antd\";\nimport { Registerable, registerComponentHelper } from \"./utils\";\n\nexport function AntdButton(\n props: Omit<React.ComponentProps<typeof Button>, \"target\"> & {\n submitsForm?: boolean;\n target?: React.ComponentProps<typeof Button>[\"target\"] | boolean;\n }\n) {\n const { submitsForm = false, ...rest } = props;\n const target =\n props.target === true\n ? \"_blank\"\n : props.target === false\n ? undefined\n : props.target;\n return (\n <Button\n {...rest}\n htmlType={submitsForm ? \"submit\" : \"button\"}\n {...rest}\n target={target}\n />\n );\n}\n\nexport const buttonComponentName = \"plasmic-antd5-button\";\n\nexport function registerButton(loader?: Registerable) {\n registerComponentHelper(loader, AntdButton, {\n name: buttonComponentName,\n displayName: \"Button\",\n props: {\n type: {\n type: \"choice\",\n options: [\"default\", \"primary\", \"ghost\", \"dashed\", \"link\", \"text\"],\n description:\n \"Can be set to primary, ghost, dashed, link, text, default\",\n defaultValueHint: \"default\",\n },\n size: {\n type: \"choice\",\n options: [\"small\", \"medium\", \"large\"],\n description: \"Set the size of button\",\n defaultValueHint: \"medium\",\n },\n shape: {\n type: \"choice\",\n options: [\"default\", \"circle\", \"round\"],\n description: \"Set the button shape\",\n defaultValueHint: \"default\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether the button is disabled\",\n defaultValueHint: false,\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n description:\n \"whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n ghost: {\n type: \"boolean\",\n description:\n \"Make background transparent and invert text and border colors\",\n defaultValueHint: false,\n advanced: true,\n },\n danger: {\n type: \"boolean\",\n description: \"Set the danger status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n loading: {\n type: \"boolean\",\n description: \"Set the loading status of button\",\n defaultValueHint: false,\n advanced: true,\n },\n href: {\n type: \"string\",\n description: \"Redirect url of link button\",\n },\n target: {\n type: \"boolean\",\n description: \"Whether to open the link in a new window\",\n hidden: (props) => !props.href,\n defaultValueHint: false,\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Button\",\n },\n ],\n ...({ mergeWithParent: true } as any),\n },\n icon: {\n type: \"slot\",\n hidePlaceholder: true,\n hidden: () => true,\n },\n onClick: {\n type: \"eventHandler\",\n argTypes: [],\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerButton\",\n importName: \"AntdButton\",\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,WACd,KAIA,EAAA;AACA,EAAA,MAAyC,YAAjC,EAAc,WAAA,GAAA,KAAA,KAAmB,EAAT,EAAA,IAAA,GAAA,SAAA,CAAS,IAAT,CAAxB,aAAA,CAAA,CAAA,CAAA;AACR,EAAM,MAAA,MAAA,GACJ,MAAM,MAAW,KAAA,IAAA,GACb,WACA,KAAM,CAAA,MAAA,KAAW,KACjB,GAAA,KAAA,CAAA,GACA,KAAM,CAAA,MAAA,CAAA;AACZ,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA,aAAA,CAAA,cAAA,CAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACK,IADL,CAAA,EAAA;AAAA,MAEC,QAAA,EAAU,cAAc,QAAW,GAAA,QAAA;AAAA,KAAA,CAAA,EAC/B,IAHL,CAAA,EAAA;AAAA,MAIC,MAAA;AAAA,KAAA,CAAA;AAAA,GACF,CAAA;AAEJ,CAAA;AAEO,MAAM,mBAAsB,GAAA,uBAAA;AAE5B,SAAS,eAAe,MAAuB,EAAA;AACpD,EAAA,uBAAA,CAAwB,QAAQ,UAAY,EAAA;AAAA,IAC1C,IAAM,EAAA,mBAAA;AAAA,IACN,WAAa,EAAA,QAAA;AAAA,IACb,KAAO,EAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,QAAA;AAAA,QACN,SAAS,CAAC,SAAA,EAAW,WAAW,OAAS,EAAA,QAAA,EAAU,QA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AA;AAAA,OACZ;AAAA,MACA,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,QAAA;AAAA,QACN,WAAa,EAAA,6BAAA;AAAA,OACf;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,IAAM,EAAA,SAAA;AAAA,QACN,WAAa,EAAA,0CAAA;AAAA,QACb,MAAQ,EAAA,CAAC,KAAU,KAAA,CAAC,KAAM,CAAA,IAAA;AAAA,QAC1B,gBAAkB,EAAA,KAAA;AAAA,OACpB;AAAA,MACA,QAAU,EAAA,cAAA,CAAA;AAAA,QACR,IAAM,EAAA,MAAA;AAAA,QACN,YAAc,EAAA;AAAA,UACZ;AAAA,YACE,IAAM,EAAA,MAAA;AAAA,YACN,KAAO,EAAA,QAAA;AAAA,WACT;AAAA,SACF;AAAA,OACI,EAAA,EAAE,iBAAiB,IAAK,EAAA,CAAA;AAAA,MAE9B,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,MAAA;AAAA,QACN,eAAiB,EAAA,IAAA;AAAA,QACjB,QAAQ,MAAM,IAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,cAAA;AAAA,QACN,UAAU,EAAC;AAAA,OACb;AAAA,KACF;AAAA,IACA,UAAY,EAAA,0CAAA;AAAA,IACZ,UAAY,EAAA,YAAA;AAAA,GACb,CAAA,CAAA;AACH;;;;"}
@@ -52,10 +52,13 @@ function AntdCheckbox(props) {
52
52
  }, [onChange]);
53
53
  return /* @__PURE__ */ React__default.default.createElement(antd.Checkbox, __spreadProps(__spreadValues({}, rest), { onChange: wrappedOnChange }));
54
54
  }
55
+ AntdCheckbox.__plasmicFormFieldMeta = { valueProp: "checked" };
55
56
  const AntdCheckboxGroup = antd.Checkbox.Group;
57
+ const checkboxComponentName = "plasmic-antd5-checkbox";
58
+ const checkboxGroupComponentName = "plasmic-antd5-checkbox";
56
59
  function registerCheckbox(loader) {
57
60
  utils.registerComponentHelper(loader, AntdCheckbox, {
58
- name: "plasmic-antd5-checkbox",
61
+ name: checkboxComponentName,
59
62
  displayName: "Checkbox",
60
63
  props: {
61
64
  checked: {
@@ -63,11 +66,12 @@ function registerCheckbox(loader) {
63
66
  editOnly: true,
64
67
  uncontrolledProp: "defaultChecked",
65
68
  description: "Specifies the initial state: whether or not the checkbox is selected",
66
- defaultValueHint: false
69
+ defaultValueHint: false,
70
+ hidden: (ps) => !!ps.__plasmicFormField
67
71
  },
68
72
  disabled: {
69
73
  type: "boolean",
70
- description: "If disable checkbox",
74
+ description: "If checkbox is disabled",
71
75
  defaultValueHint: false
72
76
  },
73
77
  indeterminate: {
@@ -75,18 +79,13 @@ function registerCheckbox(loader) {
75
79
  description: "The indeterminate checked state of checkbox",
76
80
  defaultValueHint: false
77
81
  },
78
- value: {
79
- type: "string",
80
- description: "The checkbox value",
81
- advanced: true
82
- },
83
82
  autoFocus: {
84
83
  type: "boolean",
85
84
  description: "If get focus when component mounted",
86
85
  defaultValueHint: false,
87
86
  advanced: true
88
87
  },
89
- children: {
88
+ children: __spreadValues({
90
89
  type: "slot",
91
90
  defaultValue: [
92
91
  {
@@ -94,7 +93,7 @@ function registerCheckbox(loader) {
94
93
  value: "Checkbox"
95
94
  }
96
95
  ]
97
- },
96
+ }, { mergeWithParent: true }),
98
97
  onChange: {
99
98
  type: "eventHandler",
100
99
  argTypes: [{ name: "checked", type: "boolean" }]
@@ -112,7 +111,7 @@ function registerCheckbox(loader) {
112
111
  importName: "AntdCheckbox"
113
112
  });
114
113
  utils.registerComponentHelper(loader, AntdCheckboxGroup, {
115
- name: "plasmic-antd5-checkbox-group",
114
+ name: checkboxGroupComponentName,
116
115
  displayName: "Checkbox Group",
117
116
  props: {
118
117
  value: {
@@ -163,11 +162,13 @@ function registerCheckbox(loader) {
163
162
  },
164
163
  importPath: "@plasmicpkgs/antd5/skinny/registerCheckbox",
165
164
  importName: "AntdCheckboxGroup",
166
- parentComponentName: "plasmic-antd5-checkbox"
165
+ parentComponentName: checkboxComponentName
167
166
  });
168
167
  }
169
168
 
170
169
  exports.AntdCheckbox = AntdCheckbox;
171
170
  exports.AntdCheckboxGroup = AntdCheckboxGroup;
171
+ exports.checkboxComponentName = checkboxComponentName;
172
+ exports.checkboxGroupComponentName = checkboxGroupComponentName;
172
173
  exports.registerCheckbox = registerCheckbox;
173
174
  //# sourceMappingURL=registerCheckbox.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerCheckbox.cjs.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import { Checkbox } from \"antd\";\nimport type { CheckboxChangeEvent } from \"antd/es/checkbox\";\nimport React from \"react\";\nimport {\n Registerable,\n registerComponentHelper,\n traverseReactEltTree,\n} from \"./utils\";\n\nexport function AntdCheckbox(\n props: Omit<React.ComponentProps<typeof Checkbox>, \"onChange\"> & {\n onChange?: (checked: boolean) => void;\n }\n) {\n const { onChange, ...rest } = props;\n const wrappedOnChange = React.useMemo(() => {\n if (onChange) {\n return (event: CheckboxChangeEvent) => onChange(event.target.checked);\n } else {\n return undefined;\n }\n }, [onChange]);\n return <Checkbox {...rest} onChange={wrappedOnChange} />;\n}\nexport const AntdCheckboxGroup = Checkbox.Group;\n\nexport function registerCheckbox(loader?: Registerable) {\n registerComponentHelper(loader, AntdCheckbox, {\n name: \"plasmic-antd5-checkbox\",\n displayName: \"Checkbox\",\n props: {\n checked: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultChecked\",\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 advanced: true,\n },\n autoFocus: {\n type: \"boolean\",\n description: \"If get focus when component mounted\",\n defaultValueHint: false,\n advanced: true,\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: [{ name: \"checked\", type: \"boolean\" }],\n } as any,\n },\n states: {\n checked: {\n type: \"writable\",\n valueProp: \"checked\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerCheckbox\",\n importName: \"AntdCheckbox\",\n });\n\n registerComponentHelper(loader, AntdCheckboxGroup, {\n name: \"plasmic-antd5-checkbox-group\",\n displayName: \"Checkbox Group\",\n props: {\n value: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"Default selected value\",\n multiSelect: true,\n options: (ps: any) => {\n const options = new Set<string>();\n traverseReactEltTree(ps.children, (elt) => {\n if (\n elt?.type === AntdCheckbox &&\n typeof elt?.props?.value === \"string\"\n ) {\n options.add(elt.props.value);\n }\n });\n return Array.from(options.keys());\n },\n },\n disabled: {\n type: \"boolean\",\n description: \"Disables all checkboxes\",\n defaultValueHint: false,\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"plasmic-antd5-checkbox\"],\n // Error right now when using default slot content with stateful instances\n // defaultValue: [\n // {\n // type: \"component\",\n // name: \"plasmic-antd5-checkbox\",\n // },\n // ],\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"object\" }],\n } as any,\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerCheckbox\",\n importName: \"AntdCheckboxGroup\",\n parentComponentName: \"plasmic-antd5-checkbox\",\n });\n}\n"],"names":["React","Checkbox","registerComponentHelper","traverseReactEltTree"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,SAAS,aACd,KAGA,EAAA;AACA,EAAA,MAA8B,YAAtB,EAdV,QAAA,EAAA,GAcgC,EAAT,EAAA,IAAA,GAAA,SAAA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ources":["../src/registerCheckbox.tsx"],"sourcesContent":["import { Checkbox } from \"antd\";\nimport type { CheckboxChangeEvent } from \"antd/es/checkbox\";\nimport React from \"react\";\nimport {\n Registerable,\n registerComponentHelper,\n traverseReactEltTree,\n} from \"./utils\";\n\nexport function AntdCheckbox(\n props: Omit<React.ComponentProps<typeof Checkbox>, \"onChange\"> & {\n onChange?: (checked: boolean) => void;\n }\n) {\n const { onChange, ...rest } = props;\n const wrappedOnChange = React.useMemo(() => {\n if (onChange) {\n return (event: CheckboxChangeEvent) => onChange(event.target.checked);\n } else {\n return undefined;\n }\n }, [onChange]);\n return <Checkbox {...rest} onChange={wrappedOnChange} />;\n}\nAntdCheckbox.__plasmicFormFieldMeta = { valueProp: \"checked\" };\n\nexport const AntdCheckboxGroup = Checkbox.Group;\n\nexport const checkboxComponentName = \"plasmic-antd5-checkbox\";\nexport const checkboxGroupComponentName = \"plasmic-antd5-checkbox\";\n\nexport function registerCheckbox(loader?: Registerable) {\n registerComponentHelper(loader, AntdCheckbox, {\n name: checkboxComponentName,\n displayName: \"Checkbox\",\n props: {\n checked: {\n type: \"boolean\",\n editOnly: true,\n uncontrolledProp: \"defaultChecked\",\n description:\n \"Specifies the initial state: whether or not the checkbox is selected\",\n defaultValueHint: false,\n hidden: (ps: any) => !!ps.__plasmicFormField,\n },\n disabled: {\n type: \"boolean\",\n description: \"If checkbox is disabled\",\n defaultValueHint: false,\n },\n indeterminate: {\n type: \"boolean\",\n description: \"The indeterminate checked state of checkbox\",\n defaultValueHint: false,\n },\n autoFocus: {\n type: \"boolean\",\n description: \"If get focus when component mounted\",\n defaultValueHint: false,\n advanced: true,\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Checkbox\",\n },\n ],\n ...({ mergeWithParent: true } as any),\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"checked\", type: \"boolean\" }],\n } as any,\n },\n states: {\n checked: {\n type: \"writable\",\n valueProp: \"checked\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerCheckbox\",\n importName: \"AntdCheckbox\",\n });\n\n registerComponentHelper(loader, AntdCheckboxGroup, {\n name: checkboxGroupComponentName,\n displayName: \"Checkbox Group\",\n props: {\n value: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"Default selected value\",\n multiSelect: true,\n options: (ps: any) => {\n const options = new Set<string>();\n traverseReactEltTree(ps.children, (elt) => {\n if (\n elt?.type === AntdCheckbox &&\n typeof elt?.props?.value === \"string\"\n ) {\n options.add(elt.props.value);\n }\n });\n return Array.from(options.keys());\n },\n },\n disabled: {\n type: \"boolean\",\n description: \"Disables all checkboxes\",\n defaultValueHint: false,\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"plasmic-antd5-checkbox\"],\n // Error right now when using default slot content with stateful instances\n // defaultValue: [\n // {\n // type: \"component\",\n // name: \"plasmic-antd5-checkbox\",\n // },\n // ],\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"object\" }],\n } as any,\n },\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n },\n },\n importPath: \"@plasmicpkgs/antd5/skinny/registerCheckbox\",\n importName: \"AntdCheckboxGroup\",\n parentComponentName: checkboxComponentName,\n });\n}\n"],"names":["React","Checkbox","registerComponentHelper","traverseReactEltTree"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,SAAS,aACd,KAGA,EAAA;AACA,EAAA,MAA8B,YAAtB,EAdV,QAAA,EAAA,GAcgC,EAAT,EAAA,IAAA,GAAA,SAAA,CAAS,IAAT,CAAb,UAAA,CAAA,CAAA,CAAA;AACR,EAAM,MAAA,eAAA,GAAkBA,sBAAM,CAAA,OAAA,CAAQ,MAAM;AAC1C,IAAA,IAAI,QAAU,EAAA;AACZ,MAAA,OAAO,CAA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ntdCheckbox(props: Omit<React.ComponentProps<typeof Checkbox>, "onChange"> & {
5
5
  onChange?: (checked: boolean) => void;
6
6
  }): JSX.Element;
7
+ export declare namespace AntdCheckbox {
8
+ var __plasmicFormFieldMeta: {
9
+ valueProp: string;
10
+ };
11
+ }
7
12
  export declare const AntdCheckboxGroup: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("antd/es/checkbox").CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>>;
13
+ export declare const checkboxComponentName = "plasmic-antd5-checkbox";
14
+ export declare const checkboxGroupComponentName = "plasmic-antd5-checkbox";
8
15
  export declare function registerCheckbox(loader?: Registerable): void;
@@ -46,10 +46,13 @@ function AntdCheckbox(props) {
46
46
  }, [onChange]);
47
47
  return /* @__PURE__ */ React.createElement(Checkbox, __spreadProps(__spreadValues({}, rest), { onChange: wrappedOnChange }));
48
48
  }
49
+ AntdCheckbox.__plasmicFormFieldMeta = { valueProp: "checked" };
49
50
  const AntdCheckboxGroup = Checkbox.Group;
51
+ const checkboxComponentName = "plasmic-antd5-checkbox";
52
+ const checkboxGroupComponentName = "plasmic-antd5-checkbox";
50
53
  function registerCheckbox(loader) {
51
54
  registerComponentHelper(loader, AntdCheckbox, {
52
- name: "plasmic-antd5-checkbox",
55
+ name: checkboxComponentName,
53
56
  displayName: "Checkbox",
54
57
  props: {
55
58
  checked: {
@@ -57,11 +60,12 @@ function registerCheckbox(loader) {
57
60
  editOnly: true,
58
61
  uncontrolledProp: "defaultChecked",
59
62
  description: "Specifies the initial state: whether or not the checkbox is selected",
60
- defaultValueHint: false
63
+ defaultValueHint: false,
64
+ hidden: (ps) => !!ps.__plasmicFormField
61
65
  },
62
66
  disabled: {
63
67
  type: "boolean",
64
- description: "If disable checkbox",
68
+ description: "If checkbox is disabled",
65
69
  defaultValueHint: false
66
70
  },
67
71
  indeterminate: {
@@ -69,18 +73,13 @@ function registerCheckbox(loader) {
69
73
  description: "The indeterminate checked state of checkbox",
70
74
  defaultValueHint: false
71
75
  },
72
- value: {
73
- type: "string",
74
- description: "The checkbox value",
75
- advanced: true
76
- },
77
76
  autoFocus: {
78
77
  type: "boolean",
79
78
  description: "If get focus when component mounted",
80
79
  defaultValueHint: false,
81
80
  advanced: true
82
81
  },
83
- children: {
82
+ children: __spreadValues({
84
83
  type: "slot",
85
84
  defaultValue: [
86
85
  {
@@ -88,7 +87,7 @@ function registerCheckbox(loader) {
88
87
  value: "Checkbox"
89
88
  }
90
89
  ]
91
- },
90
+ }, { mergeWithParent: true }),
92
91
  onChange: {
93
92
  type: "eventHandler",
94
93
  argTypes: [{ name: "checked", type: "boolean" }]
@@ -106,7 +105,7 @@ function registerCheckbox(loader) {
106
105
  importName: "AntdCheckbox"
107
106
  });
108
107
  registerComponentHelper(loader, AntdCheckboxGroup, {
109
- name: "plasmic-antd5-checkbox-group",
108
+ name: checkboxGroupComponentName,
110
109
  displayName: "Checkbox Group",
111
110
  props: {
112
111
  value: {
@@ -157,9 +156,9 @@ function registerCheckbox(loader) {
157
156
  },
158
157
  importPath: "@plasmicpkgs/antd5/skinny/registerCheckbox",
159
158
  importName: "AntdCheckboxGroup",
160
- parentComponentName: "plasmic-antd5-checkbox"
159
+ parentComponentName: checkboxComponentName
161
160
  });
162
161
  }
163
162
 
164
- export { AntdCheckbox, AntdCheckboxGroup, registerCheckbox };
163
+ export { AntdCheckbox, AntdCheckboxGroup, checkboxComponentName, checkboxGroupComponentName, registerCheckbox };
165
164
  //# sourceMappingURL=registerCheckbox.esm.js.map