@plasmicpkgs/antd 2.0.37 → 2.0.39
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/package.json +3 -13
- package/skinny/{customControls-82aa5d0c.js → customControls-fb0b7e5f.js} +4 -2
- package/skinny/{customControls-82aa5d0c.js.map → customControls-fb0b7e5f.js.map} +1 -1
- package/skinny/registerButton.js +13 -5
- package/skinny/registerButton.js.map +1 -1
- package/skinny/registerCarousel.js +13 -5
- package/skinny/registerCarousel.js.map +1 -1
- package/skinny/registerCheckbox.js +25 -12
- package/skinny/registerCheckbox.js.map +1 -1
- package/skinny/registerCollapse.js +25 -12
- package/skinny/registerCollapse.js.map +1 -1
- package/skinny/registerDropdown.js +24 -11
- package/skinny/registerDropdown.js.map +1 -1
- package/skinny/registerInput.js +38 -17
- package/skinny/registerInput.js.map +1 -1
- package/skinny/registerMenu.js +41 -22
- package/skinny/registerMenu.js.map +1 -1
- package/skinny/registerOption.js +16 -7
- package/skinny/registerOption.js.map +1 -1
- package/skinny/registerRate.js +13 -5
- package/skinny/registerRate.js.map +1 -1
- package/skinny/registerSelect.js +17 -9
- package/skinny/registerSelect.js.map +1 -1
- package/skinny/registerSlider.js +17 -7
- package/skinny/registerSlider.js.map +1 -1
- package/skinny/registerSwitch.js +13 -5
- package/skinny/registerSwitch.js.map +1 -1
- package/skinny/registerTable.js +31 -16
- package/skinny/registerTable.js.map +1 -1
- package/skinny/registerTabs.js +31 -18
- package/skinny/registerTabs.js.map +1 -1
- package/skinny/registerable.js +1 -0
- package/skinny/registerable.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
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 states: {\n value: {\n onChangeArgsToValue: (\n e: Parameters<NonNullable<InputProps[\"onChange\"]>>[0]\n ) => e.target.value,\n },\n },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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 },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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 },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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 },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAA,cAAA,CAAsC,GAAW,EAAA;AAC/C,EAAA,OAAO,OAAO,WAAY,CAAA,MAAA,CAAO,QAAQ,GAAG,CAAA,CA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AA,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 states: {\n value: {\n onChangeArgsToValue: (\n e: Parameters<NonNullable<InputProps[\"onChange\"]>>[0]\n ) => e.target.value,\n },\n },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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 },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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 },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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 },\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: {\n helpers: inputHelpers,\n importName: \"inputHelpers\",\n importPath: \"@plasmicpkgs/antd/skinny/registerInput\",\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":["registerComponent","Input","TextArea","Search","Password","InputGroup"],"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,WAAa,EAAA,+BAAA;AAAA,GACf;AAAA,EACA,iBAAmB,EAAA;AAAA,IACjB,IAAM,EAAA,QAAA;AAAA,IACN,WAAa,EAAA,kDAAA;AAAA,GACf;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,QAAA;AAAA,IACN,WAAa,EAAA,4BAAA;AAAA,GACf;AACF,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA;AAAA,EAC1B,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA;AAAA,MACL,mBAAqB,EAAA,CACnB,CACG,KAAA,CAAA,CAAE,MAAO,CAAA,KAAA;AAAA,KAChB;AAAA,GACF;AACF,EAAA;AAEO,MAAM,SAAuC,GAAA;AAAA,EAClD,IAAM,EAAA,WAAA;AAAA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AAA,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,GAAIJ,kCAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAAK,2BAAA,EAAY,sDAAwB,cAAc,CAAA,CAAA;AACxE;;;;;;;;;;;;;;"}
|
package/skinny/registerMenu.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
4
|
+
var Menu = require('antd/lib/menu/index');
|
|
5
|
+
var MenuDivider = require('antd/lib/menu/MenuDivider');
|
|
6
|
+
var MenuItem = require('antd/lib/menu/MenuItem');
|
|
7
|
+
var SubMenu = require('antd/lib/menu/SubMenu');
|
|
8
|
+
var rcMenu = require('rc-menu');
|
|
9
|
+
var customControls = require('./customControls-fb0b7e5f.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
|
|
14
|
+
var Menu__default = /*#__PURE__*/_interopDefault(Menu);
|
|
15
|
+
var MenuDivider__default = /*#__PURE__*/_interopDefault(MenuDivider);
|
|
16
|
+
var MenuItem__default = /*#__PURE__*/_interopDefault(MenuItem);
|
|
17
|
+
var SubMenu__default = /*#__PURE__*/_interopDefault(SubMenu);
|
|
8
18
|
|
|
9
19
|
const menuDividerMeta = {
|
|
10
20
|
name: "AntdMenuDivider",
|
|
@@ -22,8 +32,8 @@ const menuDividerMeta = {
|
|
|
22
32
|
parentComponentName: "AntdMenu"
|
|
23
33
|
};
|
|
24
34
|
function registerMenuDivider(loader, customMenuDividerMeta) {
|
|
25
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
26
|
-
doRegisterComponent(
|
|
35
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
36
|
+
doRegisterComponent(MenuDivider__default.default, customMenuDividerMeta != null ? customMenuDividerMeta : menuDividerMeta);
|
|
27
37
|
}
|
|
28
38
|
const menuItemMeta = {
|
|
29
39
|
name: "AntdMenuItem",
|
|
@@ -64,8 +74,8 @@ const menuItemMeta = {
|
|
|
64
74
|
parentComponentName: "AntdMenu"
|
|
65
75
|
};
|
|
66
76
|
function registerMenuItem(loader, customMenuItemMeta) {
|
|
67
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
68
|
-
doRegisterComponent(
|
|
77
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
78
|
+
doRegisterComponent(MenuItem__default.default, customMenuItemMeta != null ? customMenuItemMeta : menuItemMeta);
|
|
69
79
|
}
|
|
70
80
|
const menuItemGroupMeta = {
|
|
71
81
|
name: "AntdMenuItemGroup",
|
|
@@ -100,8 +110,8 @@ const menuItemGroupMeta = {
|
|
|
100
110
|
parentComponentName: "AntdMenu"
|
|
101
111
|
};
|
|
102
112
|
function registerMenuItemGroup(loader, customMenuItemGroupMeta) {
|
|
103
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
104
|
-
doRegisterComponent(ItemGroup, customMenuItemGroupMeta != null ? customMenuItemGroupMeta : menuItemGroupMeta);
|
|
113
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
114
|
+
doRegisterComponent(rcMenu.ItemGroup, customMenuItemGroupMeta != null ? customMenuItemGroupMeta : menuItemGroupMeta);
|
|
105
115
|
}
|
|
106
116
|
const subMenuMeta = {
|
|
107
117
|
name: "AntdSubMenu",
|
|
@@ -155,8 +165,8 @@ const subMenuMeta = {
|
|
|
155
165
|
parentComponentName: "AntdMenu"
|
|
156
166
|
};
|
|
157
167
|
function registerSubMenu(loader, customSubMenuMeta) {
|
|
158
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
159
|
-
doRegisterComponent(
|
|
168
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
169
|
+
doRegisterComponent(SubMenu__default.default, customSubMenuMeta != null ? customSubMenuMeta : subMenuMeta);
|
|
160
170
|
}
|
|
161
171
|
const menuMeta = {
|
|
162
172
|
name: "AntdMenu",
|
|
@@ -195,8 +205,8 @@ const menuMeta = {
|
|
|
195
205
|
multiSelect: true,
|
|
196
206
|
options: (componentProps) => {
|
|
197
207
|
const options = /* @__PURE__ */ new Set();
|
|
198
|
-
traverseReactEltTree(componentProps.children, (elt) => {
|
|
199
|
-
if ((elt == null ? void 0 : elt.type) ===
|
|
208
|
+
customControls.traverseReactEltTree(componentProps.children, (elt) => {
|
|
209
|
+
if ((elt == null ? void 0 : elt.type) === SubMenu__default.default && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
200
210
|
options.add(elt.key);
|
|
201
211
|
}
|
|
202
212
|
});
|
|
@@ -220,8 +230,8 @@ const menuMeta = {
|
|
|
220
230
|
multiSelect: true,
|
|
221
231
|
options: (componentProps) => {
|
|
222
232
|
const options = /* @__PURE__ */ new Set();
|
|
223
|
-
traverseReactEltTree(componentProps.children, (elt) => {
|
|
224
|
-
if ([
|
|
233
|
+
customControls.traverseReactEltTree(componentProps.children, (elt) => {
|
|
234
|
+
if ([SubMenu__default.default, MenuItem__default.default].includes(elt == null ? void 0 : elt.type) && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
225
235
|
options.add(elt.key);
|
|
226
236
|
}
|
|
227
237
|
});
|
|
@@ -270,9 +280,18 @@ const menuMeta = {
|
|
|
270
280
|
isDefaultExport: true
|
|
271
281
|
};
|
|
272
282
|
function registerMenu(loader, customMenuMeta) {
|
|
273
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
274
|
-
doRegisterComponent(
|
|
283
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
284
|
+
doRegisterComponent(Menu__default.default, customMenuMeta != null ? customMenuMeta : menuMeta);
|
|
275
285
|
}
|
|
276
286
|
|
|
277
|
-
|
|
287
|
+
exports.menuDividerMeta = menuDividerMeta;
|
|
288
|
+
exports.menuItemGroupMeta = menuItemGroupMeta;
|
|
289
|
+
exports.menuItemMeta = menuItemMeta;
|
|
290
|
+
exports.menuMeta = menuMeta;
|
|
291
|
+
exports.registerMenu = registerMenu;
|
|
292
|
+
exports.registerMenuDivider = registerMenuDivider;
|
|
293
|
+
exports.registerMenuItem = registerMenuItem;
|
|
294
|
+
exports.registerMenuItemGroup = registerMenuItemGroup;
|
|
295
|
+
exports.registerSubMenu = registerSubMenu;
|
|
296
|
+
exports.subMenuMeta = subMenuMeta;
|
|
278
297
|
//# sourceMappingURL=registerMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerMenu.js","sources":["../src/registerMenu.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { MenuItemProps, MenuProps, SubMenuProps } from \"antd/lib/menu\";\nimport { MenuDividerProps } from \"antd/lib/menu\";\nimport Menu from \"antd/lib/menu/index\";\nimport MenuDivider from \"antd/lib/menu/MenuDivider\";\nimport MenuItem from \"antd/lib/menu/MenuItem\";\nimport SubMenu from \"antd/lib/menu/SubMenu\";\nimport { ItemGroup, MenuItemGroupProps } from \"rc-menu\";\nimport { traverseReactEltTree } from \"./customControls\";\nimport { Registerable } from \"./registerable\";\n\nexport const menuDividerMeta: ComponentMeta<MenuDividerProps> = {\n name: \"AntdMenuDivider\",\n displayName: \"Antd Menu Divider\",\n props: {\n dashed: {\n type: \"boolean\",\n description: \"Whether line is dashed\",\n defaultValueHint: false,\n },\n },\n importPath: \"antd/lib/menu/MenuDivider\",\n importName: \"MenuDivider\",\n isDefaultExport: true,\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerMenuDivider(\n loader?: Registerable,\n customMenuDividerMeta?: ComponentMeta<MenuDividerProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(MenuDivider, customMenuDividerMeta ?? menuDividerMeta);\n}\n\nexport const menuItemMeta: ComponentMeta<MenuItemProps> = {\n name: \"AntdMenuItem\",\n displayName: \"Antd Menu Item\",\n props: {\n danger: {\n type: \"boolean\",\n description: \"Display the danger style\",\n defaultValueHint: false,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether disabled select\",\n defaultValueHint: false,\n },\n key: {\n type: \"string\",\n description: \"Unique ID of the menu item\",\n defaultValue: \"menuItemKey\",\n },\n title: {\n type: \"string\",\n description: \"Set display title for collapsed item\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Option\",\n },\n ],\n },\n },\n importPath: \"antd/lib/menu/MenuItem\",\n importName: \"MenuItem\",\n isDefaultExport: true,\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerMenuItem(\n loader?: Registerable,\n customMenuItemMeta?: ComponentMeta<MenuItemProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(MenuItem, customMenuItemMeta ?? menuItemMeta);\n}\n\nexport const menuItemGroupMeta: ComponentMeta<MenuItemGroupProps> = {\n name: \"AntdMenuItemGroup\",\n displayName: \"Antd Menu Item Group\",\n props: {\n title: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Group\",\n },\n ],\n },\n children: {\n type: \"slot\",\n allowedComponents: [\n \"AntdMenuItem\",\n \"AntdMenuDivider\",\n \"AntdMenuItemGroup\",\n ],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdMenuItem\",\n },\n ],\n },\n },\n importPath: \"rc-menu\",\n importName: \"ItemGroup\",\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerMenuItemGroup(\n loader?: Registerable,\n customMenuItemGroupMeta?: ComponentMeta<MenuItemProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(ItemGroup, customMenuItemGroupMeta ?? menuItemGroupMeta);\n}\n\nexport const subMenuMeta: ComponentMeta<SubMenuProps> = {\n name: \"AntdSubMenu\",\n displayName: \"Antd SubMenu\",\n props: {\n disabled: {\n type: \"boolean\",\n description: \"Whether sub-menu is disabled\",\n defaultValueHint: false,\n },\n key: {\n type: \"string\",\n description: \"Unique ID of the sub-menu\",\n defaultValue: \"subMenuKey\",\n },\n title: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Sub-menu\",\n },\n ],\n },\n children: {\n type: \"slot\",\n allowedComponents: [\n \"AntdMenuItem\",\n \"AntdMenuDivider\",\n \"AntdMenuItemGroup\",\n \"AntdSubMenu\",\n ],\n defaultValue: [1, 2].map((i) => ({\n type: \"component\",\n name: \"AntdMenuItem\",\n props: {\n key: `subMenuItemKey${i}`,\n children: [\n {\n type: \"text\",\n value: `Sub-menu item ${i}`,\n },\n ],\n },\n })),\n },\n },\n importPath: \"antd/lib/menu/SubMenu\",\n importName: \"SubMenu\",\n isDefaultExport: true,\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerSubMenu(\n loader?: Registerable,\n customSubMenuMeta?: ComponentMeta<SubMenuProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(SubMenu, customSubMenuMeta ?? subMenuMeta);\n}\n\nexport const menuMeta: ComponentMeta<MenuProps> = {\n name: \"AntdMenu\",\n displayName: \"Antd Menu\",\n props: {\n expandIcon: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n forceSubMenuRender: {\n type: \"boolean\",\n description: \"Render submenu into DOM before it becomes visible\",\n defaultValueHint: false,\n },\n inlineIndent: {\n type: \"number\",\n description: \"Indent (in pixels) of inline menu items on each level\",\n defaultValueHint: 24,\n },\n mode: {\n type: \"choice\",\n options: [\"horizontal\", \"vertical\", \"inline\"],\n description: \"Type of menu\",\n defaultValueHint: \"vertical\",\n },\n multiple: {\n type: \"boolean\",\n description: \"Allows selection of multiple items\",\n defaultValueHint: false,\n },\n openKeys: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultOpenKeys\",\n description: \"Array with the keys of default opened sub menus\",\n multiSelect: true,\n options: componentProps => {\n const options = new Set<string>();\n traverseReactEltTree(componentProps.children, elt => {\n if (elt?.type === SubMenu && typeof elt?.key === \"string\") {\n options.add(elt.key);\n }\n });\n return Array.from(options.keys());\n },\n },\n overflowedIndicator: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n selectable: {\n type: \"boolean\",\n description: \"Allows selecting menu items\",\n defaultValueHint: true,\n },\n selectedKeys: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultSelectedKeys\",\n description: \"Array with the keys of default selected menu items\",\n multiSelect: true,\n options: componentProps => {\n const options = new Set<string>();\n traverseReactEltTree(componentProps.children, elt => {\n if (\n [SubMenu, MenuItem as any].includes(elt?.type) &&\n typeof elt?.key === \"string\"\n ) {\n options.add(elt.key);\n }\n });\n return Array.from(options.keys());\n },\n },\n subMenuCloseDelay: {\n type: \"number\",\n description: \"Delay time to hide submenu when mouse leaves (in seconds)\",\n defaultValueHint: 0.1,\n },\n subMenuOpenDelay: {\n type: \"number\",\n description: \"Delay time to show submenu when mouse enters, (in seconds)\",\n defaultValueHint: 0,\n },\n theme: {\n type: \"choice\",\n options: [\"light\", \"dark\"],\n description: \"Color theme of the menu\",\n defaultValueHint: \"light\",\n },\n triggerSubMenuAction: {\n type: \"choice\",\n options: [\"hover\", \"click\"],\n description: \"Which action can trigger submenu open/close\",\n defaultValueHint: \"hover\",\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"AntdMenuItem\", \"AntdMenuDivider\", \"AntdSubMenu\"],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdMenuItem\",\n },\n {\n type: \"component\",\n name: \"AntdSubMenu\",\n },\n ],\n },\n },\n importPath: \"antd/lib/menu/index\",\n importName: \"Menu\",\n isDefaultExport: true,\n};\n\nexport function registerMenu(\n loader?: Registerable,\n customMenuMeta?: ComponentMeta<MenuProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Menu, customMenuMeta ?? menuMeta);\n}\n"],"names":[],"mappings":";;;;;;;;AAaO,MAAM,eAAmD,GAAA;AAAA,EAC9D,IAAM,EAAA,iBAAA;AAAA,EACN,WAAa,EAAA,mBAAA;AAAA,EACb,KAAO,EAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,E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WAAA;AAAA,UACN,IAAM,EAAA,aAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAAA,EACA,UAAY,EAAA,qBAAA;AAAA,EACZ,UAAY,EAAA,MAAA;AAAA,EACZ,eAAiB,EAAA,IAAA;AACnB,EAAA;AAEO,SAAA,YAAA,CACL,QACA,cACA,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,IAAA,EAAM,0CAAkB,QAAQ,CAAA,CAAA;AACtD;;;;"}
|
|
1
|
+
{"version":3,"file":"registerMenu.js","sources":["../src/registerMenu.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { MenuItemProps, MenuProps, SubMenuProps } from \"antd/lib/menu\";\nimport { MenuDividerProps } from \"antd/lib/menu\";\nimport Menu from \"antd/lib/menu/index\";\nimport MenuDivider from \"antd/lib/menu/MenuDivider\";\nimport MenuItem from \"antd/lib/menu/MenuItem\";\nimport SubMenu from \"antd/lib/menu/SubMenu\";\nimport { ItemGroup, MenuItemGroupProps } from \"rc-menu\";\nimport { traverseReactEltTree } from \"./customControls\";\nimport { Registerable } from \"./registerable\";\n\nexport const menuDividerMeta: ComponentMeta<MenuDividerProps> = {\n name: \"AntdMenuDivider\",\n displayName: \"Antd Menu Divider\",\n props: {\n dashed: {\n type: \"boolean\",\n description: \"Whether line is dashed\",\n defaultValueHint: false,\n },\n },\n importPath: \"antd/lib/menu/MenuDivider\",\n importName: \"MenuDivider\",\n isDefaultExport: true,\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerMenuDivider(\n loader?: Registerable,\n customMenuDividerMeta?: ComponentMeta<MenuDividerProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(MenuDivider, customMenuDividerMeta ?? menuDividerMeta);\n}\n\nexport const menuItemMeta: ComponentMeta<MenuItemProps> = {\n name: \"AntdMenuItem\",\n displayName: \"Antd Menu Item\",\n props: {\n danger: {\n type: \"boolean\",\n description: \"Display the danger style\",\n defaultValueHint: false,\n },\n disabled: {\n type: \"boolean\",\n description: \"Whether disabled select\",\n defaultValueHint: false,\n },\n key: {\n type: \"string\",\n description: \"Unique ID of the menu item\",\n defaultValue: \"menuItemKey\",\n },\n title: {\n type: \"string\",\n description: \"Set display title for collapsed item\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Option\",\n },\n ],\n },\n },\n importPath: \"antd/lib/menu/MenuItem\",\n importName: \"MenuItem\",\n isDefaultExport: true,\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerMenuItem(\n loader?: Registerable,\n customMenuItemMeta?: ComponentMeta<MenuItemProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(MenuItem, customMenuItemMeta ?? menuItemMeta);\n}\n\nexport const menuItemGroupMeta: ComponentMeta<MenuItemGroupProps> = {\n name: \"AntdMenuItemGroup\",\n displayName: \"Antd Menu Item Group\",\n props: {\n title: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Group\",\n },\n ],\n },\n children: {\n type: \"slot\",\n allowedComponents: [\n \"AntdMenuItem\",\n \"AntdMenuDivider\",\n \"AntdMenuItemGroup\",\n ],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdMenuItem\",\n },\n ],\n },\n },\n importPath: \"rc-menu\",\n importName: \"ItemGroup\",\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerMenuItemGroup(\n loader?: Registerable,\n customMenuItemGroupMeta?: ComponentMeta<MenuItemProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(ItemGroup, customMenuItemGroupMeta ?? menuItemGroupMeta);\n}\n\nexport const subMenuMeta: ComponentMeta<SubMenuProps> = {\n name: \"AntdSubMenu\",\n displayName: \"Antd SubMenu\",\n props: {\n disabled: {\n type: \"boolean\",\n description: \"Whether sub-menu is disabled\",\n defaultValueHint: false,\n },\n key: {\n type: \"string\",\n description: \"Unique ID of the sub-menu\",\n defaultValue: \"subMenuKey\",\n },\n title: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Sub-menu\",\n },\n ],\n },\n children: {\n type: \"slot\",\n allowedComponents: [\n \"AntdMenuItem\",\n \"AntdMenuDivider\",\n \"AntdMenuItemGroup\",\n \"AntdSubMenu\",\n ],\n defaultValue: [1, 2].map((i) => ({\n type: \"component\",\n name: \"AntdMenuItem\",\n props: {\n key: `subMenuItemKey${i}`,\n children: [\n {\n type: \"text\",\n value: `Sub-menu item ${i}`,\n },\n ],\n },\n })),\n },\n },\n importPath: \"antd/lib/menu/SubMenu\",\n importName: \"SubMenu\",\n isDefaultExport: true,\n parentComponentName: \"AntdMenu\",\n};\n\nexport function registerSubMenu(\n loader?: Registerable,\n customSubMenuMeta?: ComponentMeta<SubMenuProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(SubMenu, customSubMenuMeta ?? subMenuMeta);\n}\n\nexport const menuMeta: ComponentMeta<MenuProps> = {\n name: \"AntdMenu\",\n displayName: \"Antd Menu\",\n props: {\n expandIcon: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n forceSubMenuRender: {\n type: \"boolean\",\n description: \"Render submenu into DOM before it becomes visible\",\n defaultValueHint: false,\n },\n inlineIndent: {\n type: \"number\",\n description: \"Indent (in pixels) of inline menu items on each level\",\n defaultValueHint: 24,\n },\n mode: {\n type: \"choice\",\n options: [\"horizontal\", \"vertical\", \"inline\"],\n description: \"Type of menu\",\n defaultValueHint: \"vertical\",\n },\n multiple: {\n type: \"boolean\",\n description: \"Allows selection of multiple items\",\n defaultValueHint: false,\n },\n openKeys: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultOpenKeys\",\n description: \"Array with the keys of default opened sub menus\",\n multiSelect: true,\n options: componentProps => {\n const options = new Set<string>();\n traverseReactEltTree(componentProps.children, elt => {\n if (elt?.type === SubMenu && typeof elt?.key === \"string\") {\n options.add(elt.key);\n }\n });\n return Array.from(options.keys());\n },\n },\n overflowedIndicator: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n selectable: {\n type: \"boolean\",\n description: \"Allows selecting menu items\",\n defaultValueHint: true,\n },\n selectedKeys: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultSelectedKeys\",\n description: \"Array with the keys of default selected menu items\",\n multiSelect: true,\n options: componentProps => {\n const options = new Set<string>();\n traverseReactEltTree(componentProps.children, elt => {\n if (\n [SubMenu, MenuItem as any].includes(elt?.type) &&\n typeof elt?.key === \"string\"\n ) {\n options.add(elt.key);\n }\n });\n return Array.from(options.keys());\n },\n },\n subMenuCloseDelay: {\n type: \"number\",\n description: \"Delay time to hide submenu when mouse leaves (in seconds)\",\n defaultValueHint: 0.1,\n },\n subMenuOpenDelay: {\n type: \"number\",\n description: \"Delay time to show submenu when mouse enters, (in seconds)\",\n defaultValueHint: 0,\n },\n theme: {\n type: \"choice\",\n options: [\"light\", \"dark\"],\n description: \"Color theme of the menu\",\n defaultValueHint: \"light\",\n },\n triggerSubMenuAction: {\n type: \"choice\",\n options: [\"hover\", \"click\"],\n description: \"Which action can trigger submenu open/close\",\n defaultValueHint: \"hover\",\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"AntdMenuItem\", \"AntdMenuDivider\", \"AntdSubMenu\"],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdMenuItem\",\n },\n {\n type: \"component\",\n name: \"AntdSubMenu\",\n },\n ],\n },\n },\n importPath: \"antd/lib/menu/index\",\n importName: \"Menu\",\n isDefaultExport: true,\n};\n\nexport function registerMenu(\n loader?: Registerable,\n customMenuMeta?: ComponentMeta<MenuProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Menu, customMenuMeta ?? menuMeta);\n}\n"],"names":["registerComponent","MenuDivider","MenuItem","ItemGroup","SubMenu","traverseReactEltTree","Menu"],"mappings":";;;;;;;;;;;;;;;;;;AAaO,MAAM,eAAmD,GAAA;AAAA,EAC9D,IAAM,EAAA,iBAAA;AAAA,EACN,WAAa,EAAA,mBAAA;AAAA,EACb,KAAO,EAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,wBAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,GACF;AAAA,EACA,UAAY,EAAA,2BAAA;AAAA,EACZ,UAAY,EAAA,aAAA;AAAA,EACZ,eAAiB,EAAA,IAAA;AAAA,EACjB,mBAAqB,EAAA,UAAA;AACvB,EAAA;AAEO,SAAA,mBAAA,CACL,QACA,qBACA,EAAA;AACA,EAAM,MAAA,mBAAA,GAAgD,CAAI,GAAA,IAAA,KACxD,MAAS,GAAA,MAAA,CAAO,iBAAkB,CAAA,GAAG,IAAI,CAAA,GAAIA,kCAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAAC,4BAAA,EAAa,wDAAyB,eAAe,CAAA,CAAA;AAC3E,CAAA;AAEO,MAAM,YAA6C,GAAA;AAAA,EACxD,IAAM,EAAA,cAAA;AAAA,EACN,WAAa,EAAA,gBAAA;AAAA,EACb,KAAO,EAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,0BAAA;AAAA,MACb,gBAAkB,EAAA,KAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,E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,yBAAA;AAAA,MACb,gBAAkB,EAAA,OAAA;AAAA,KACpB;AAAA,IACA,oBAAsB,EAAA;AAAA,MACpB,IAAM,EAAA,QAAA;AAAA,MACN,OAAA,EAAS,CAAC,OAAA,EAAS,OAAO,CAAA;AAAA,MAC1B,WAAa,EAAA,6CAAA;AAAA,MACb,gBAAkB,EAAA,OAAA;AAAA,KACpB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,MAAA;AAAA,MACN,iBAAmB,EAAA,CAAC,cAAgB,EAAA,iBAAA,EAAmB,aAAa,CAAA;AAAA,MACpE,YAAc,EAAA;AAAA,QACZ;AAAA,UACE,IAAM,EAAA,WAAA;AAAA,UACN,IAAM,EAAA,cAAA;AAAA,SACR;AAAA,QACA;AAAA,UACE,IAAM,EAAA,WAAA;AAAA,UACN,IAAM,EAAA,aAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAAA,EACA,UAAY,EAAA,qBAAA;AAAA,EACZ,UAAY,EAAA,MAAA;AAAA,EACZ,eAAiB,EAAA,IAAA;AACnB,EAAA;AAEO,SAAA,YAAA,CACL,QACA,cACA,EAAA;AACA,EAAM,MAAA,mBAAA,GAAgD,CAAI,GAAA,IAAA,KACxD,MAAS,GAAA,MAAA,CAAO,iBAAkB,CAAA,GAAG,IAAI,CAAA,GAAIF,kCAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAAM,qBAAA,EAAM,0CAAkB,QAAQ,CAAA,CAAA;AACtD;;;;;;;;;;;;;"}
|
package/skinny/registerOption.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
4
|
+
var rcSelect = require('rc-select');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
|
|
3
9
|
|
|
4
10
|
const optionMeta = {
|
|
5
11
|
name: "AntdOption",
|
|
@@ -37,8 +43,8 @@ const optionMeta = {
|
|
|
37
43
|
parentComponentName: "AntdSelect"
|
|
38
44
|
};
|
|
39
45
|
function registerOption(loader, customOptionMeta) {
|
|
40
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
41
|
-
doRegisterComponent(Option, customOptionMeta != null ? customOptionMeta : optionMeta);
|
|
46
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
47
|
+
doRegisterComponent(rcSelect.Option, customOptionMeta != null ? customOptionMeta : optionMeta);
|
|
42
48
|
}
|
|
43
49
|
const optGroupMeta = {
|
|
44
50
|
name: "AntdOptionGroup",
|
|
@@ -68,9 +74,12 @@ const optGroupMeta = {
|
|
|
68
74
|
parentComponentName: "AntdSelect"
|
|
69
75
|
};
|
|
70
76
|
function registerOptGroup(loader, customOptGroupMeta) {
|
|
71
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
72
|
-
doRegisterComponent(OptGroup, customOptGroupMeta != null ? customOptGroupMeta : optGroupMeta);
|
|
77
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
78
|
+
doRegisterComponent(rcSelect.OptGroup, customOptGroupMeta != null ? customOptGroupMeta : optGroupMeta);
|
|
73
79
|
}
|
|
74
80
|
|
|
75
|
-
|
|
81
|
+
exports.optGroupMeta = optGroupMeta;
|
|
82
|
+
exports.optionMeta = optionMeta;
|
|
83
|
+
exports.registerOptGroup = registerOptGroup;
|
|
84
|
+
exports.registerOption = registerOption;
|
|
76
85
|
//# sourceMappingURL=registerOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerOption.js","sources":["../src/registerOption.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { OptGroup, Option } from \"rc-select\";\nimport { OptGroupProps } from \"rc-select/lib/OptGroup\";\nimport { OptionProps } from \"rc-select/lib/Option\";\nimport { Registerable } from \"./registerable\";\n\nexport const optionMeta: ComponentMeta<OptionProps> = {\n name: \"AntdOption\",\n displayName: \"Antd Option\",\n props: {\n disabled: {\n type: \"boolean\",\n description: \"Disable this option\",\n defaultValueHint: false,\n },\n title: {\n type: \"string\",\n description: \"title of Select after select this Option\",\n },\n value: {\n type: \"string\",\n description: \"Default to filter with this property\",\n },\n key: {\n type: \"string\",\n description: \"Option key\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Option\",\n },\n ],\n },\n },\n importPath: \"rc-select\",\n importName: \"Option\",\n parentComponentName: \"AntdSelect\",\n};\n\nexport function registerOption(\n loader?: Registerable,\n customOptionMeta?: ComponentMeta<OptionProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Option, customOptionMeta ?? optionMeta);\n}\n\nexport const optGroupMeta: ComponentMeta<OptGroupProps> = {\n name: \"AntdOptionGroup\",\n displayName: \"Antd Option Group\",\n props: {\n key: {\n type: \"string\",\n description: \"Group key\",\n },\n label: {\n type: \"string\",\n description: \"Group label\",\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"AntdOption\"],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdOption\",\n },\n ],\n },\n },\n importPath: \"rc-select\",\n importName: \"OptGroup\",\n parentComponentName: \"AntdSelect\",\n};\n\nexport function registerOptGroup(\n loader?: Registerable,\n customOptGroupMeta?: ComponentMeta<OptGroupProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(OptGroup, customOptGroupMeta ?? optGroupMeta);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerOption.js","sources":["../src/registerOption.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { OptGroup, Option } from \"rc-select\";\nimport { OptGroupProps } from \"rc-select/lib/OptGroup\";\nimport { OptionProps } from \"rc-select/lib/Option\";\nimport { Registerable } from \"./registerable\";\n\nexport const optionMeta: ComponentMeta<OptionProps> = {\n name: \"AntdOption\",\n displayName: \"Antd Option\",\n props: {\n disabled: {\n type: \"boolean\",\n description: \"Disable this option\",\n defaultValueHint: false,\n },\n title: {\n type: \"string\",\n description: \"title of Select after select this Option\",\n },\n value: {\n type: \"string\",\n description: \"Default to filter with this property\",\n },\n key: {\n type: \"string\",\n description: \"Option key\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"text\",\n value: \"Option\",\n },\n ],\n },\n },\n importPath: \"rc-select\",\n importName: \"Option\",\n parentComponentName: \"AntdSelect\",\n};\n\nexport function registerOption(\n loader?: Registerable,\n customOptionMeta?: ComponentMeta<OptionProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Option, customOptionMeta ?? optionMeta);\n}\n\nexport const optGroupMeta: ComponentMeta<OptGroupProps> = {\n name: \"AntdOptionGroup\",\n displayName: \"Antd Option Group\",\n props: {\n key: {\n type: \"string\",\n description: \"Group key\",\n },\n label: {\n type: \"string\",\n description: \"Group label\",\n },\n children: {\n type: \"slot\",\n allowedComponents: [\"AntdOption\"],\n defaultValue: [\n {\n type: \"component\",\n name: \"AntdOption\",\n },\n ],\n },\n },\n importPath: \"rc-select\",\n importName: \"OptGroup\",\n parentComponentName: \"AntdSelect\",\n};\n\nexport function registerOptGroup(\n loader?: Registerable,\n customOptGroupMeta?: ComponentMeta<OptGroupProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(OptGroup, customOptGroupMeta ?? optGroupM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O,EAAA;AAAA,IACL,GAAK,EAAA;AAAA,MACH,IAAM,EAAA,QAAA;AAAA,MACN,WAAa,EAAA,WAAA;AAAA,KACf;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,QAAA;AAAA,MACN,WAAa,EAAA,aAAA;AAAA,KACf;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,MAAA;AAAA,MACN,iBAAA,EAAmB,CAAC,YAAY,CAAA;AAAA,MAChC,YAAc,EAAA;AAAA,QACZ;AAAA,UACE,IAAM,EAAA,WAAA;AAAA,UACN,IAAM,EAAA,YAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAAA,EACA,UAAY,EAAA,WAAA;AAAA,EACZ,UAAY,EAAA,UAAA;AAAA,EACZ,mBAAqB,EAAA,YAAA;AACvB,EAAA;AAEO,SAAA,gBAAA,CACL,QACA,kBACA,EAAA;AACA,EAAM,MAAA,mBAAA,GAAgD,CAAI,GAAA,IAAA,KACxD,MAAS,GAAA,MAAA,CAAO,iBAAkB,CAAA,GAAG,IAAI,CAAA,GAAID,kCAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAAE,iBAAA,EAAU,kDAAsB,YAAY,CAAA,CAAA;AAClE;;;;;;;"}
|
package/skinny/registerRate.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
4
|
+
var Rate = require('antd/lib/rate');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
|
|
9
|
+
var Rate__default = /*#__PURE__*/_interopDefault(Rate);
|
|
3
10
|
|
|
4
11
|
const rateMeta = {
|
|
5
12
|
name: "AntdRate",
|
|
@@ -50,9 +57,10 @@ const rateMeta = {
|
|
|
50
57
|
isDefaultExport: true
|
|
51
58
|
};
|
|
52
59
|
function registerRate(loader, customRateMeta) {
|
|
53
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
54
|
-
doRegisterComponent(
|
|
60
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
61
|
+
doRegisterComponent(Rate__default.default, customRateMeta != null ? customRateMeta : rateMeta);
|
|
55
62
|
}
|
|
56
63
|
|
|
57
|
-
|
|
64
|
+
exports.rateMeta = rateMeta;
|
|
65
|
+
exports.registerRate = registerRate;
|
|
58
66
|
//# sourceMappingURL=registerRate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerRate.js","sources":["../src/registerRate.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Rate, { RateProps } from \"antd/lib/rate\";\nimport { Registerable } from \"./registerable\";\n\nexport const rateMeta: ComponentMeta<RateProps> = {\n name: \"AntdRate\",\n displayName: \"Antd Rate\",\n props: {\n allowClear: {\n type: \"boolean\",\n description: \"Whether to allow clear when clicking again\",\n defaultValueHint: true,\n },\n allowHalf: {\n type: \"boolean\",\n description: \"Whether to allow semi selection\",\n defaultValueHint: false,\n },\n autoFocus: {\n type: \"boolean\",\n description: \"If componet is focused when mounted\",\n defaultValueHint: false,\n },\n count: {\n type: \"number\",\n description: \"Star count\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Disabled state of component\",\n defaultValueHint: false,\n },\n tooltips: {\n type: \"array\",\n description: \"Array to customize tooltip for each icon\",\n },\n value: {\n type: \"number\",\n description: \"The default value\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n defaultValueHint: 0,\n },\n character: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n },\n importPath: \"antd/lib/rate\",\n importName: \"Rate\",\n isDefaultExport: true,\n};\n\nexport function registerRate(\n loader?: Registerable,\n customRateMeta?: ComponentMeta<RateProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Rate, customRateMeta ?? rateMeta);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerRate.js","sources":["../src/registerRate.ts"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport Rate, { RateProps } from \"antd/lib/rate\";\nimport { Registerable } from \"./registerable\";\n\nexport const rateMeta: ComponentMeta<RateProps> = {\n name: \"AntdRate\",\n displayName: \"Antd Rate\",\n props: {\n allowClear: {\n type: \"boolean\",\n description: \"Whether to allow clear when clicking again\",\n defaultValueHint: true,\n },\n allowHalf: {\n type: \"boolean\",\n description: \"Whether to allow semi selection\",\n defaultValueHint: false,\n },\n autoFocus: {\n type: \"boolean\",\n description: \"If componet is focused when mounted\",\n defaultValueHint: false,\n },\n count: {\n type: \"number\",\n description: \"Star count\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Disabled state of component\",\n defaultValueHint: false,\n },\n tooltips: {\n type: \"array\",\n description: \"Array to customize tooltip for each icon\",\n },\n value: {\n type: \"number\",\n description: \"The default value\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n defaultValueHint: 0,\n },\n character: {\n type: \"slot\",\n hidePlaceholder: true,\n },\n },\n importPath: \"antd/lib/rate\",\n importName: \"Rate\",\n isDefaultExport: true,\n};\n\nexport function registerRate(\n loader?: Registerable,\n customRateMeta?: ComponentMeta<RateProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Rate, customRateMeta ?? rateMeta);\n}\n"],"names":["registerComponent","Rate"],"mappings":";;;;;;;;;;AAMO,MAAM,QAAqC,GAAA;AAAA,EAChD,IAAM,EAAA,UAAA;AAAA,EACN,WAAa,EAAA,WAAA;AAAA,EACb,KAAO,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A,GAAIA,kCAAkB,CAAA,GAAG,IAAI,CAAA,CAAA;AACxE,EAAoB,mBAAA,CAAAC,qBAAA,EAAM,0CAAkB,QAAQ,CAAA,CAAA;AACtD;;;;;"}
|
package/skinny/registerSelect.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
4
|
+
var Select = require('antd/lib/select');
|
|
5
|
+
var rcSelect = require('rc-select');
|
|
6
|
+
var customControls = require('./customControls-fb0b7e5f.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
|
|
11
|
+
var Select__default = /*#__PURE__*/_interopDefault(Select);
|
|
5
12
|
|
|
6
13
|
const selectMeta = {
|
|
7
14
|
name: "AntdSelect",
|
|
@@ -85,9 +92,9 @@ const selectMeta = {
|
|
|
85
92
|
description: "Initial selected option",
|
|
86
93
|
options: (componentProps) => {
|
|
87
94
|
const options = /* @__PURE__ */ new Set();
|
|
88
|
-
traverseReactEltTree(componentProps.children, (elt) => {
|
|
95
|
+
customControls.traverseReactEltTree(componentProps.children, (elt) => {
|
|
89
96
|
var _a;
|
|
90
|
-
if ((elt == null ? void 0 : elt.type) === Option && typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
|
|
97
|
+
if ((elt == null ? void 0 : elt.type) === rcSelect.Option && typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
|
|
91
98
|
options.add(elt.props.value);
|
|
92
99
|
}
|
|
93
100
|
});
|
|
@@ -143,9 +150,10 @@ const selectMeta = {
|
|
|
143
150
|
isDefaultExport: true
|
|
144
151
|
};
|
|
145
152
|
function registerSelect(loader, customSelectMeta) {
|
|
146
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
147
|
-
doRegisterComponent(
|
|
153
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
154
|
+
doRegisterComponent(Select__default.default, customSelectMeta != null ? customSelectMeta : selectMeta);
|
|
148
155
|
}
|
|
149
156
|
|
|
150
|
-
|
|
157
|
+
exports.registerSelect = registerSelect;
|
|
158
|
+
exports.selectMeta = selectMeta;
|
|
151
159
|
//# sourceMappingURL=registerSelect.js.map
|
|
@@ -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 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":"
|
|
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":["traverseReactEltTree","Option","registerComponent","Select"],"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,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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
4
|
+
var AntdSlider = require('antd/lib/slider');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
|
|
10
|
+
var AntdSlider__default = /*#__PURE__*/_interopDefault(AntdSlider);
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
4
12
|
|
|
5
13
|
var __defProp = Object.defineProperty;
|
|
6
14
|
var __defProps = Object.defineProperties;
|
|
@@ -33,7 +41,7 @@ var __objRest = (source, exclude) => {
|
|
|
33
41
|
}
|
|
34
42
|
return target;
|
|
35
43
|
};
|
|
36
|
-
const Slider =
|
|
44
|
+
const Slider = React__default.default.forwardRef((_a, ref) => {
|
|
37
45
|
var _b = _a, { value, defaultValue, value2, defaultValue2 } = _b, props = __objRest(_b, ["value", "defaultValue", "value2", "defaultValue2"]);
|
|
38
46
|
const newProps = __spreadValues({}, props);
|
|
39
47
|
if (props.range) {
|
|
@@ -51,7 +59,7 @@ const Slider = React.forwardRef((_a, ref) => {
|
|
|
51
59
|
newProps.defaultValue = defaultValue;
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ React__default.default.createElement(AntdSlider__default.default, __spreadProps(__spreadValues({}, newProps), {
|
|
55
63
|
ref
|
|
56
64
|
}));
|
|
57
65
|
});
|
|
@@ -126,9 +134,11 @@ const sliderMeta = {
|
|
|
126
134
|
importName: "Slider"
|
|
127
135
|
};
|
|
128
136
|
function registerSlider(loader, customSliderMeta) {
|
|
129
|
-
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) :
|
|
137
|
+
const doRegisterComponent = (...args) => loader ? loader.registerComponent(...args) : registerComponent__default.default(...args);
|
|
130
138
|
doRegisterComponent(Slider, customSliderMeta != null ? customSliderMeta : sliderMeta);
|
|
131
139
|
}
|
|
132
140
|
|
|
133
|
-
|
|
141
|
+
exports.Slider = Slider;
|
|
142
|
+
exports.registerSlider = registerSlider;
|
|
143
|
+
exports.sliderMeta = sliderMeta;
|
|
134
144
|
//# sourceMappingURL=registerSlider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerSlider.js","sources":["../src/registerSlider.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { default as AntdSlider } from \"antd/lib/slider\";\nimport type { SliderRangeProps, SliderSingleProps } from \"antd/lib/slider\";\nimport React from \"react\";\nimport { Registerable } from \"./registerable\";\n\ntype SliderProps = Omit<\n SliderSingleProps | SliderRangeProps,\n \"value\" | \"defaultValue\"\n> & {\n value?: number;\n defaultValue?: number;\n value2?: number;\n defaultValue2?: number;\n};\n\nexport const Slider = React.forwardRef<unknown, SliderProps>(\n ({ value, defaultValue, value2, defaultValue2, ...props }, ref) => {\n const newProps = { ...props } as SliderSingleProps | SliderRangeProps;\n if (props.range) {\n if (typeof value === \"number\" || typeof value2 === \"number\") {\n newProps.value = [value ?? 0, value2 ?? 0];\n }\n if (\n typeof defaultValue === \"number\" ||\n typeof defaultValue2 === \"number\"\n ) {\n newProps.defaultValue = [defaultValue ?? 0, defaultValue2 ?? 0];\n }\n } else {\n if (typeof value === \"number\") {\n newProps.value = value;\n }\n if(typeof defaultValue === \"number\") {\n newProps.defaultValue = defaultValue;\n }\n }\n return <AntdSlider {...newProps} ref={ref} />;\n }\n);\n\nexport const sliderMeta: ComponentMeta<SliderProps> = {\n name: \"AntdSlider\",\n displayName: \"Antd Slider\",\n props: {\n max: {\n type: \"number\",\n description: \"The maximum value the slider can slide to\",\n defaultValueHint: 100,\n },\n min: {\n type: \"number\",\n description: \"The minimum value the slider can slide to\",\n defaultValueHint: 0,\n },\n included: {\n type: \"boolean\",\n description:\n \"Make effect when marks not null, true means containment and false means coordinative\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"If true, the slider will not be interactable\",\n defaultValueHint: false,\n },\n range: {\n type: \"boolean\",\n description: \"Dual thumb mode\",\n defaultValueHint: false,\n },\n reverse: {\n type: \"boolean\",\n description: \"Reverse the component\",\n defaultValueHint: false,\n },\n vertical: {\n type: \"boolean\",\n description: \"If true, the slider will be vertical\",\n defaultValueHint: false,\n },\n value: {\n type: \"number\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The default value of slider\",\n },\n value2: {\n type: \"number\",\n displayName: \"value 2\",\n editOnly: true,\n uncontrolledProp: \"defaultValue2\",\n description: \"The default value for the second value of the slider\",\n hidden: (props) => !props.range,\n },\n step: {\n type: \"number\",\n description:\n \"The granularity the slider can step through values. Must greater than 0, and be divided by (max - min).\" +\n \" When marks no null, step can be null\",\n defaultValueHint: 1,\n },\n marks: {\n type: \"object\",\n description:\n \"Tick mark of Slider, type of key must be number, and must in closed interval [min, max],\" +\n \" each mark can declare its own style\",\n },\n },\n defaultStyles: {\n width: \"200px\",\n maxWidth: \"100%\",\n },\n importPath: \"@plasmicpkgs/antd/skinny/registerSlider\",\n importName: \"Slider\",\n};\n\nexport function registerSlider(\n loader?: Registerable,\n customSliderMeta?: ComponentMeta<SliderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Slider, customSliderMeta ?? sliderMeta);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerSlider.js","sources":["../src/registerSlider.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { default as AntdSlider } from \"antd/lib/slider\";\nimport type { SliderRangeProps, SliderSingleProps } from \"antd/lib/slider\";\nimport React from \"react\";\nimport { Registerable } from \"./registerable\";\n\ntype SliderProps = Omit<\n SliderSingleProps | SliderRangeProps,\n \"value\" | \"defaultValue\"\n> & {\n value?: number;\n defaultValue?: number;\n value2?: number;\n defaultValue2?: number;\n};\n\nexport const Slider = React.forwardRef<unknown, SliderProps>(\n ({ value, defaultValue, value2, defaultValue2, ...props }, ref) => {\n const newProps = { ...props } as SliderSingleProps | SliderRangeProps;\n if (props.range) {\n if (typeof value === \"number\" || typeof value2 === \"number\") {\n newProps.value = [value ?? 0, value2 ?? 0];\n }\n if (\n typeof defaultValue === \"number\" ||\n typeof defaultValue2 === \"number\"\n ) {\n newProps.defaultValue = [defaultValue ?? 0, defaultValue2 ?? 0];\n }\n } else {\n if (typeof value === \"number\") {\n newProps.value = value;\n }\n if(typeof defaultValue === \"number\") {\n newProps.defaultValue = defaultValue;\n }\n }\n return <AntdSlider {...newProps} ref={ref} />;\n }\n);\n\nexport const sliderMeta: ComponentMeta<SliderProps> = {\n name: \"AntdSlider\",\n displayName: \"Antd Slider\",\n props: {\n max: {\n type: \"number\",\n description: \"The maximum value the slider can slide to\",\n defaultValueHint: 100,\n },\n min: {\n type: \"number\",\n description: \"The minimum value the slider can slide to\",\n defaultValueHint: 0,\n },\n included: {\n type: \"boolean\",\n description:\n \"Make effect when marks not null, true means containment and false means coordinative\",\n defaultValueHint: true,\n },\n disabled: {\n type: \"boolean\",\n description: \"If true, the slider will not be interactable\",\n defaultValueHint: false,\n },\n range: {\n type: \"boolean\",\n description: \"Dual thumb mode\",\n defaultValueHint: false,\n },\n reverse: {\n type: \"boolean\",\n description: \"Reverse the component\",\n defaultValueHint: false,\n },\n vertical: {\n type: \"boolean\",\n description: \"If true, the slider will be vertical\",\n defaultValueHint: false,\n },\n value: {\n type: \"number\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The default value of slider\",\n },\n value2: {\n type: \"number\",\n displayName: \"value 2\",\n editOnly: true,\n uncontrolledProp: \"defaultValue2\",\n description: \"The default value for the second value of the slider\",\n hidden: (props) => !props.range,\n },\n step: {\n type: \"number\",\n description:\n \"The granularity the slider can step through values. Must greater than 0, and be divided by (max - min).\" +\n \" When marks no null, step can be null\",\n defaultValueHint: 1,\n },\n marks: {\n type: \"object\",\n description:\n \"Tick mark of Slider, type of key must be number, and must in closed interval [min, max],\" +\n \" each mark can declare its own style\",\n },\n },\n defaultStyles: {\n width: \"200px\",\n maxWidth: \"100%\",\n },\n importPath: \"@plasmicpkgs/antd/skinny/registerSlider\",\n importName: \"Slider\",\n};\n\nexport function registerSlider(\n loader?: Registerable,\n customSliderMeta?: ComponentMeta<SliderProps>\n) {\n const doRegisterComponent: typeof registerComponent = (...args) =>\n loader ? loader.registerComponent(...args) : registerComponent(...args);\n doRegisterComponent(Slider, customSliderMeta ?? sliderMeta);\n}\n"],"names":["React","AntdSlider","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,MAAS,GAAAA,sBAAA,CAAM,UAC1B,CAAA,CAAC,IAA0D,GAAQ,KAAA;AAAlE,EAAE,IAAA,EAAA,GAAA,EAAA,EAAA,EAAA,KAAA,EAAO,YAAc,EAAA,MAAA,EAAQ,aAA/B,EAAA,GAAA,EAAA,EAAiD,kBAAjD,EAAiD,EAAA,CAA/C,OAAO,EAAA,cAAA,EAAc,QAAQ,EAAA,eAAA,CAAA,CAAA,CAAA;AAC9B,EAAA,MAAM,WAAW,cAAK,CAAA,EAAA,EAAA,KAAA,CAAA,CAAA;AACtB,EAAA,IAAI,MAAM,KAAO,EAAA;AACf,IAAA,IAAI,OAAO,KAAA,KAAU,QAAY,IAAA,OAAO,WAAW,QAAU,EAAA;AAC3D,MAAA,QAAA,CAAS,KAAQ,GAAA,CAAC,KAAS,IAAA,IAAA,GAAA,KAAA,GAAA,CAAA,EAAG,0BAAU,CAAC,CAAA,CAAA;AAAA,KAC3C;AACA,IAAA,IACE,OAAO,YAAA,KAAiB,QACxB,IAAA,OAAO,kBAAkB,QACzB,EAAA;AACA,MA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