├── src ├── config │ ├── attributes │ │ ├── index.js │ │ ├── tag │ │ │ ├── checkableTag.json │ │ │ └── tag.json │ │ ├── timeline │ │ │ ├── timelineItem.json │ │ │ └── timeline.json │ │ ├── input │ │ │ ├── group.json │ │ │ ├── textarea.json │ │ │ └── input.json │ │ ├── backtop │ │ │ └── backtop.json │ │ ├── card │ │ │ ├── cardMeta.json │ │ │ └── card.json │ │ ├── menu │ │ │ ├── menuItem.json │ │ │ ├── menuSub.json │ │ │ └── menu.json │ │ ├── list │ │ │ ├── listItemMeta.json │ │ │ ├── listItem.json │ │ │ └── list.json │ │ ├── tabs │ │ │ ├── tabpane.json │ │ │ └── tabs.json │ │ ├── layout │ │ │ ├── layout.json │ │ │ └── layoutSider.json │ │ ├── affix │ │ │ └── affix.json │ │ ├── divider │ │ │ └── divider.json │ │ ├── breadcrumb │ │ │ └── breadcrumb.json │ │ ├── steps │ │ │ ├── steps.json │ │ │ └── step.json │ │ ├── grid │ │ │ ├── row.json │ │ │ └── col.json │ │ ├── checkbox │ │ │ ├── checkboxGroup.json │ │ │ └── checkbox.json │ │ ├── comment │ │ │ └── comment.json │ │ ├── skeleton │ │ │ └── skeleton.json │ │ ├── radio │ │ │ ├── radio.json │ │ │ └── radioGroup.json │ │ ├── popconfirm │ │ │ └── popconfirm.json │ │ ├── select │ │ │ ├── selectOption.json │ │ │ └── select.json │ │ ├── collapse │ │ │ ├── collapsePanel.json │ │ │ └── collapse.json │ │ ├── spin │ │ │ └── spin.json │ │ ├── icon │ │ │ └── icon.json │ │ ├── rate │ │ │ └── rate.json │ │ ├── avatar │ │ │ └── avatar.json │ │ ├── form │ │ │ ├── form.json │ │ │ └── formItem.json │ │ ├── carousel │ │ │ └── carousel.json │ │ ├── anchor │ │ │ └── anchor.json │ │ ├── switch │ │ │ └── switch.json │ │ ├── dropdown │ │ │ ├── dropdownButton.json │ │ │ └── dropdown.json │ │ ├── treeSelect │ │ │ ├── treeSelectNode.json │ │ │ └── treeSelect.json │ │ ├── alert │ │ │ └── alert.json │ │ ├── badge │ │ │ └── badge.json │ │ ├── button │ │ │ └── button.json │ │ ├── inputNumber │ │ │ └── number.json │ │ ├── calendar │ │ │ └── calendar.json │ │ ├── pagination │ │ │ └── pagination.json │ │ ├── tree │ │ │ ├── treeNode.json │ │ │ └── tree.json │ │ ├── date-picker │ │ │ ├── date.json │ │ │ ├── week.json │ │ │ ├── month.json │ │ │ └── range.json │ │ ├── progress │ │ │ └── progress.json │ │ ├── tooltip │ │ │ └── tooltip.json │ │ ├── drawer │ │ │ └── drawer.json │ │ ├── autoComplete │ │ │ └── autoComplete.json │ │ ├── popover │ │ │ └── popover.json │ │ ├── slider │ │ │ └── slider.json │ │ ├── transfer │ │ │ └── transfer.json │ │ ├── modal │ │ │ └── modal.json │ │ ├── upload │ │ │ └── upload.json │ │ ├── cascader │ │ │ └── cascader.json │ │ ├── timePicker │ │ │ └── timePicker.json │ │ └── table │ │ │ └── table.json │ ├── ui-attributes.json │ ├── bash.js │ ├── ui-attributes.js │ ├── components.js │ └── ui-tags.json ├── typings.d.ts ├── test │ ├── extension.test.ts │ └── index.ts ├── extension.ts └── app.ts ├── .gitignore ├── .DS_Store ├── antdv.png ├── .vscode ├── .DS_Store ├── extensions.json ├── tasks.json ├── settings.json └── launch.json ├── .vscodeignore ├── tslint.json ├── CHANGELOG.md ├── tsconfig.json ├── README.md ├── vsc-extension-quickstart.md ├── package.json └── snippets └── antdv.json /src/config/attributes/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/config/ui-attributes.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | scripts -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vueComponent/ant-design-vue-helper/HEAD/.DS_Store -------------------------------------------------------------------------------- /antdv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vueComponent/ant-design-vue-helper/HEAD/antdv.png -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.json" { 2 | const value: any; 3 | export default value; 4 | } -------------------------------------------------------------------------------- /.vscode/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vueComponent/ant-design-vue-helper/HEAD/.vscode/.DS_Store -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | src/** 5 | .gitignore 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/tslint.json 9 | **/*.map 10 | **/*.ts -------------------------------------------------------------------------------- /src/config/attributes/tag/checkableTag.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-checkable-tag/checked": { 3 | "description": "Checked status of Tag", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | } 7 | } -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "eg2.tslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [ 9 | true, 10 | "always" 11 | ], 12 | "triple-equals": true 13 | }, 14 | "defaultSeverity": "warning" 15 | } 16 | -------------------------------------------------------------------------------- /src/config/attributes/timeline/timelineItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-timeline-item/color": { 3 | "description": "Set the circle's color to blue, red, green or other custom colors", 4 | "optionType": "string", 5 | "defaultValue": "blue" 6 | }, 7 | "a-timeline-item/dot": { 8 | "description": "Customize timeline dot", 9 | "optionType": "string|slot", 10 | "defaultValue": "-" 11 | } 12 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.1.1] 2 | - Initial release 3 | 4 | ## [1.0.0] 5 | - add components(comment configProvider) 6 | - add type and default prompts 7 | 8 | ## [1.0.1] 9 | - fix table prompts 10 | 11 | ## [1.0.2] 12 | - switch shortcuts mac(ctrl + shift + z => shift + cmd + i) win(ctrl + shift + z => shift + win + i) 13 | - fix Comment and ConfigProvider prompts 14 | 15 | ## [1.0.3] 16 | - fix: a-layout-sider misspell -------------------------------------------------------------------------------- /src/config/attributes/input/group.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-input-group/compact": { 3 | "description": "Whether use compact style", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-input-group/size": { 8 | "description": "The size of Input.Group specifies the size of the included Input fields. Available: large default small", 9 | "optionType": "string", 10 | "defaultValue": "default" 11 | } 12 | } -------------------------------------------------------------------------------- /src/config/attributes/backtop/backtop.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-back-top/target": { 3 | "description": "specifies the scrollable area dom node", 4 | "optionType": "() => HTMLElement", 5 | "defaultValue": "() => window" 6 | }, 7 | "a-back-top/visibilityHeight": { 8 | "description": "the BackTop button will not show until the scroll height reaches this value", 9 | "optionType": "number", 10 | "defaultValue": "400" 11 | } 12 | } -------------------------------------------------------------------------------- /src/config/attributes/card/cardMeta.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-card-meta/avatar": { 3 | "description": "avatar or icon", 4 | "optionType": "slot", 5 | "defaultValue": "-" 6 | }, 7 | "a-card-meta/description": { 8 | "description": "description content", 9 | "optionType": "string|slot", 10 | "defaultValue": "-" 11 | }, 12 | "a-card-meta/title": { 13 | "description": "title content", 14 | "optionType": "string|slot", 15 | "defaultValue": "-" 16 | } 17 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /src/config/attributes/menu/menuItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-menu-item/disabled": { 3 | "description": "whether menu item is disabled or not", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-menu-item/key": { 8 | "description": "unique id of the menu item", 9 | "optionType": "string", 10 | "defaultValue": "" 11 | }, 12 | "a-menu-item/title": { 13 | "description": "set display title for collapsed item", 14 | "optionType": "string", 15 | "defaultValue": "" 16 | } 17 | } -------------------------------------------------------------------------------- /src/config/attributes/list/listItemMeta.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-list-item-meta/avatar": { 3 | "description": "The avatar of list item", 4 | "optionType": "slot", 5 | "defaultValue": "-" 6 | }, 7 | "a-list-item-meta/description": { 8 | "description": "The description of list item", 9 | "optionType": "string|slot", 10 | "defaultValue": "-" 11 | }, 12 | "a-list-item-meta/title": { 13 | "description": "The title of list item", 14 | "optionType": "string|slot", 15 | "defaultValue": "-" 16 | } 17 | } -------------------------------------------------------------------------------- /src/config/attributes/tabs/tabpane.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tab-pane/forceRender": { 3 | "description": "Forced render of content in tabs, not lazy render after clicking on tabs", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-tab-pane/key": { 8 | "description": "TabPane's key", 9 | "optionType": "string", 10 | "defaultValue": "-" 11 | }, 12 | "a-tab-pane/tab": { 13 | "description": "Show text in TabPane's head", 14 | "optionType": "string|slot", 15 | "defaultValue": "-" 16 | } 17 | } -------------------------------------------------------------------------------- /src/config/attributes/layout/layout.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-layout/class": { 3 | "description": "container className", 4 | "optionType": "string", 5 | "defaultValue": "-" 6 | }, 7 | "a-layout/style": { 8 | "description": "to customize the styles", 9 | "optionType": "object|string", 10 | "defaultValue": "-" 11 | }, 12 | "a-layout/hasSider": { 13 | "description": "whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering", 14 | "optionType": "boolean", 15 | "defaultValue": "-" 16 | } 17 | } -------------------------------------------------------------------------------- /src/config/attributes/input/textarea.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-textarea/autosize": { 3 | "description": "Height autosize feature, can be set to true|false or an object { minRows: 2, maxRows: 6 }", 4 | "optionType": "boolean|object", 5 | "defaultValue": "false" 6 | }, 7 | "a-textarea/defaultValue": { 8 | "description": "The initial input content", 9 | "optionType": "string", 10 | "defaultValue": "" 11 | }, 12 | "a-textarea/value": { 13 | "description": "The input content value", 14 | "optionType": "string", 15 | "defaultValue": "" 16 | } 17 | } -------------------------------------------------------------------------------- /src/config/attributes/list/listItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-list-item/actions": { 3 | "description": "The actions content of list item. If itemLayout is vertical, shows the content on bottom, otherwise shows content on the far right.", 4 | "optionType": "Array|slot", 5 | "defaultValue": "-" 6 | }, 7 | "a-list-item/extra": { 8 | "description": "The extra content of list item. If itemLayout is vertical, shows the content on right, otherwise shows content on the far right.", 9 | "optionType": "string|slot", 10 | "defaultValue": "-" 11 | } 12 | } -------------------------------------------------------------------------------- /src/config/attributes/affix/affix.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-affix/offsetBottom": { 3 | "description": "Pixels to offset from bottom when calculating position of scroll", 4 | "optionType": "number", 5 | "defaultValue": "-" 6 | }, 7 | "a-affix/offsetTop": { 8 | "description": "Pixels to offset from top when calculating position of scroll", 9 | "optionType": "number", 10 | "defaultValue": "0" 11 | }, 12 | "a-affix/target": { 13 | "description": "specifies the scrollable area dom node", 14 | "optionType": "() => HTMLElement", 15 | "defaultValue": "() => window" 16 | } 17 | } -------------------------------------------------------------------------------- /src/config/attributes/divider/divider.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-divider/dashed": { 3 | "description": "whether line is dashed", 4 | "optionType": "Boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-divider/orientation": { 8 | "options": ["left", "right", "center"], 9 | "description": "position of title inside divider", 10 | "optionType": "enum: left right center", 11 | "defaultValue": "center" 12 | }, 13 | "a-divider/type": { 14 | "options": ["horizontal", "vertical"], 15 | "description": "direction type of divider", 16 | "optionType": "enum: horizontal vertical", 17 | "defaultValue": "horizontal" 18 | } 19 | } -------------------------------------------------------------------------------- /src/config/attributes/tag/tag.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tag/afterClose": { 3 | "description": "Callback executed when close animation is completed", 4 | "optionType": "() => void", 5 | "defaultValue": "-" 6 | }, 7 | "a-tag/closable": { 8 | "description": "Whether the Tag can be closed", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-tag/color": { 13 | "description": "Color of the Tag", 14 | "optionType": "string", 15 | "defaultValue": "-" 16 | }, 17 | "a-tag/visible": { 18 | "description": "Whether the Tag is closed or not", 19 | "optionType": "boolean", 20 | "defaultValue": "true" 21 | } 22 | } -------------------------------------------------------------------------------- /src/config/attributes/menu/menuSub.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-sub-menu/children": { 3 | "description": "sub menus or sub menu items", 4 | "optionType": "Array", 5 | "defaultValue": "" 6 | }, 7 | "a-sub-menu/disabled": { 8 | "description": "whether sub menu is disabled or not", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-sub-menu/key": { 13 | "description": "unique id of the sub menu", 14 | "optionType": "string", 15 | "defaultValue": "" 16 | }, 17 | "a-sub-menu/title": { 18 | "description": "title of the sub menu", 19 | "optionType": "string|slot", 20 | "defaultValue": "" 21 | } 22 | } -------------------------------------------------------------------------------- /src/config/attributes/breadcrumb/breadcrumb.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-breadcrumb/itemRender": { 3 | "description": "Custom item renderer, slot=\"itemRender\" and slot-scope=\"{route, params, routes, paths}\"", 4 | "optionType": "({route, params, routes, paths}) => vNode", 5 | "defaultValue": "" 6 | }, 7 | "a-breadcrumb/params": { 8 | "description": "Routing parameters", 9 | "optionType": "object", 10 | "defaultValue": "" 11 | }, 12 | "a-breadcrumb/routes": { 13 | "description": "The routing stack information of router", 14 | "optionType": "object[]", 15 | "defaultValue": "" 16 | }, 17 | "a-breadcrumb/separator": { 18 | "description": "Custom separator", 19 | "optionType": "string|slot", 20 | "defaultValue": "" 21 | } 22 | } -------------------------------------------------------------------------------- /src/config/attributes/steps/steps.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-step/description": { 3 | "description": "description of the step, optional property", 4 | "optionType": "string|slot", 5 | "defaultValue": "-" 6 | }, 7 | "a-step/icon": { 8 | "description": "icon of the step, optional property", 9 | "optionType": "string|slot", 10 | "defaultValue": "-" 11 | }, 12 | "a-step/status": { 13 | "description": "to specify the status. It will be automatically set by current of Steps if not configured. Optional values are: wait process finish error", 14 | "optionType": "string", 15 | "defaultValue": "wait" 16 | }, 17 | "a-step/title": { 18 | "description": "title of the step", 19 | "optionType": "string|slot", 20 | "defaultValue": "-" 21 | } 22 | } -------------------------------------------------------------------------------- /src/config/attributes/grid/row.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-row/align": { 3 | "description": "the vertical alignment of the flex layout: top middle bottom", 4 | "optionType": "string", 5 | "defaultValue": "top" 6 | }, 7 | "a-row/gutter": { 8 | "description": "spacing between grids, could be a number or a object like { xs: 8, sm: 16, md: 24}", 9 | "optionType": "number/object", 10 | "defaultValue": "0" 11 | }, 12 | "a-row/justify": { 13 | "description": "horizontal arrangement of the flex layout: start end center space-around space-between", 14 | "optionType": "string", 15 | "defaultValue": "start" 16 | }, 17 | "a-row/type": { 18 | "description": "layout mode, optional flex, browser support", 19 | "optionType": "string", 20 | "defaultValue": "" 21 | } 22 | } -------------------------------------------------------------------------------- /src/config/attributes/checkbox/checkboxGroup.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-checkbox-group/defaultValue": { 3 | "description": "Default selected value", 4 | "optionType": "string[]", 5 | "defaultValue": "[]" 6 | }, 7 | "a-checkbox-group/disabled": { 8 | "description": "Disable all checkboxes", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-checkbox-group/options": { 13 | "description": "Specifies options, you can customize label with slot = \"label\" slot-scope = \"option\"", 14 | "optionType": "string[] | Array<{ label: string value: string disabled?: boolean, onChange?: function }>", 15 | "defaultValue": "[]" 16 | }, 17 | "a-checkbox-group/value": { 18 | "description": "Used for setting the currently selected value.", 19 | "optionType": "string[]", 20 | "defaultValue": "[]" 21 | } 22 | } -------------------------------------------------------------------------------- /src/test/extension.test.ts: -------------------------------------------------------------------------------- 1 | // 2 | // Note: This example test is leveraging the Mocha test framework. 3 | // Please refer to their documentation on https://mochajs.org/ for help. 4 | // 5 | 6 | // The module 'assert' provides assertion methods from node 7 | import * as assert from 'assert'; 8 | 9 | // You can import and use all API from the 'vscode' module 10 | // as well as import your extension to test it 11 | // import * as vscode from 'vscode'; 12 | // import * as myExtension from '../extension'; 13 | 14 | // Defines a Mocha test suite to group tests of similar kind together 15 | suite("Extension Tests", function () { 16 | 17 | // Defines a Mocha unit test 18 | test("Something 1", function() { 19 | assert.equal(-1, [1, 2, 3].indexOf(5)); 20 | assert.equal(-1, [1, 2, 3].indexOf(0)); 21 | }); 22 | }); -------------------------------------------------------------------------------- /src/config/attributes/comment/comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-comment/actions": { 3 | "description": "List of action items rendered below the comment content", 4 | "optionType": "Array|slot" 5 | }, 6 | "a-comment/author": { 7 | "description": "The element to display as the comment author", 8 | "optionType": "String|slot" 9 | }, 10 | "a-comment/avatar": { 11 | "description": "The element to display as the comment avatar - generally an antd Avatar or src", 12 | "optionType": "String|slot" 13 | }, 14 | "a-comment/content": { 15 | "description": "The main content of the comment", 16 | "optionType": "String|slot" 17 | }, 18 | "a-comment/datetime": { 19 | "description": "A datetime element containing the time to be displayed", 20 | "optionType": "String|slot" 21 | } 22 | } -------------------------------------------------------------------------------- /src/config/attributes/skeleton/skeleton.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-skeleton/active": { 3 | "description": "Show animation effect", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-skeleton/avatar": { 8 | "description": "Show avatar placeholder", 9 | "optionType": "boolean | SkeletonAvatarProps", 10 | "defaultValue": "false" 11 | }, 12 | "a-skeleton/loading": { 13 | "description": "Display the skeleton when true", 14 | "optionType": "boolean", 15 | "defaultValue": "-" 16 | }, 17 | "a-skeleton/paragraph": { 18 | "description": "Show paragraph placeholder", 19 | "optionType": "boolean | SkeletonParagraphProps", 20 | "defaultValue": "true" 21 | }, 22 | "a-skeleton/title": { 23 | "description": "Show title placeholder", 24 | "optionType": "boolean | SkeletonTitleProps", 25 | "defaultValue": "true" 26 | } 27 | } -------------------------------------------------------------------------------- /src/config/attributes/timeline/timeline.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-timeline/pending": { 3 | "description": "Set the last ghost node's existence or its content", 4 | "optionType": "boolean|string|slot", 5 | "defaultValue": "false" 6 | }, 7 | "a-timeline/pendingDot": { 8 | "description": "Set the dot of the last ghost node when pending is true", 9 | "optionType": "string|slot", 10 | "defaultValue": "" 11 | }, 12 | "a-timeline/reverse": { 13 | "description": "reverse nodes or not", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-timeline/mode": { 18 | "options": ["left", "alternate", "right"], 19 | "description": "By sending alternate the timeline will distribute the nodes to the left and right.", 20 | "optionType": "left | alternate | right", 21 | "defaultValue": "left" 22 | } 23 | } -------------------------------------------------------------------------------- /src/config/attributes/radio/radio.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-radio/autoFocus": { 3 | "description": "get focus when component mounted", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-radio/checked": { 8 | "description": "Specifies whether the radio is selected.", 9 | "optionType": "boolean", 10 | "defaultValue": "-" 11 | }, 12 | "a-radio/defaultChecked": { 13 | "description": "Specifies the initial state: whether or not the radio is selected.", 14 | "optionType": "boolean", 15 | "defaultValue": "" 16 | }, 17 | "a-radio/disabled": { 18 | "description": "Disable radio", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-radio/value": { 23 | "description": "According to value for comparison, to determine whether the selected", 24 | "optionType": "any", 25 | "defaultValue": "-" 26 | } 27 | } -------------------------------------------------------------------------------- /src/config/attributes/popconfirm/popconfirm.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-popconfirm/cancelText": { 3 | "description": "text of the Cancel button", 4 | "optionType": "string|slot", 5 | "defaultValue": "Cancel" 6 | }, 7 | "a-popconfirm/okText": { 8 | "description": "text of the Confirm button", 9 | "optionType": "string|slot", 10 | "defaultValue": "Confirm" 11 | }, 12 | "a-popconfirm/okType": { 13 | "description": "Button type of the Confirm button", 14 | "optionType": "string", 15 | "defaultValue": "primary" 16 | }, 17 | "a-popconfirm/title": { 18 | "description": "title of the confirmation box", 19 | "optionType": "string|slot", 20 | "defaultValue": "-" 21 | }, 22 | "a-popconfirm/icon": { 23 | "description": "customize icon of confirmation", 24 | "optionType": "vNode|slot", 25 | "defaultValue": "" 26 | } 27 | } -------------------------------------------------------------------------------- /src/config/attributes/checkbox/checkbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-checkbox/autoFocus": { 3 | "description": "get focus when component mounted", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-checkbox/checked": { 8 | "description": "Specifies whether the checkbox is selected.", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-checkbox/defaultChecked": { 13 | "description": "Specifies the initial state: whether or not the checkbox is selected.", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-checkbox/disabled": { 18 | "description": "Disable checkbox", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-checkbox/indeterminate": { 23 | "description": "indeterminate checked state of checkbox", 24 | "optionType": "boolean", 25 | "defaultValue": "false" 26 | } 27 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es7" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "allowJs": true, 12 | // "strictPropertyInitialization": false, 13 | /* Strict Type-Checking Option */ 14 | // "strict": true, /* enable all strict type-checking options */ 15 | /* Additional Checks */ 16 | // "noUnusedLocals": true /* Report errors on unused locals. */ 17 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 18 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 19 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 20 | }, 21 | "include": [ 22 | "src/**/*" 23 | ], 24 | "exclude": [ 25 | "node_modules", 26 | ".vscode-test" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /src/config/attributes/select/selectOption.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-select-option/disabled": { 3 | "description": "Disable this option", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-select-option/key": { 8 | "description": "Same usage as value. If Vue request you to set this property, you can set it to value of option, and then omit value property.", 9 | "optionType": "string", 10 | "defaultValue": "" 11 | }, 12 | "a-select-option/title": { 13 | "description": "title of Select after select this Option", 14 | "optionType": "string", 15 | "defaultValue": "-" 16 | }, 17 | "a-select-option/value": { 18 | "description": "default to filter with this property", 19 | "optionType": "string|number", 20 | "defaultValue": "-" 21 | }, 22 | "a-select-option/class": { 23 | "description": "additional class to option", 24 | "optionType": "string", 25 | "defaultValue": "-" 26 | } 27 | } -------------------------------------------------------------------------------- /src/config/attributes/collapse/collapsePanel.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-collapse-panel/disabled": { 3 | "description": "If true, panel cannot be opened or closed", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-collapse-panel/forceRender": { 8 | "description": "Forced render of content on panel, instead of lazy rending after clicking on header", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-collapse-panel/header": { 13 | "description": "Title of the panel", 14 | "optionType": "string", 15 | "defaultValue": "-" 16 | }, 17 | "a-collapse-panel/key": { 18 | "description": "Unique key identifying the panel from among its siblings", 19 | "optionType": "string", 20 | "defaultValue": "-" 21 | }, 22 | "a-collapse-panel/showArrow": { 23 | "description": "If false, panel will not show arrow icon", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | } 27 | } -------------------------------------------------------------------------------- /src/config/attributes/spin/spin.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-spin/delay": { 3 | "description": "specifies a delay in milliseconds for loading state (prevent flush)", 4 | "optionType": "number (milliseconds)", 5 | "defaultValue": "-" 6 | }, 7 | "a-spin/indicator": { 8 | "description": "vue node of the spinning indicator", 9 | "optionType": "vNode |slot", 10 | "defaultValue": "-" 11 | }, 12 | "a-spin/size": { 13 | "description": "size of Spin, options: small, default and large", 14 | "optionType": "string", 15 | "defaultValue": "default" 16 | }, 17 | "a-spin/spinning": { 18 | "description": "whether Spin is spinning", 19 | "optionType": "boolean", 20 | "defaultValue": "true" 21 | }, 22 | "a-spin/tip": { 23 | "description": "customize description content when Spin has children", 24 | "optionType": "string", 25 | "defaultValue": "-" 26 | }, 27 | "a-spin/wrapperClassName": { 28 | "description": "className of wrapper when Spin has children", 29 | "optionType": "string", 30 | "defaultValue": "-" 31 | } 32 | } -------------------------------------------------------------------------------- /src/test/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension 9 | // host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | import * as testRunner from 'vscode/lib/testrunner'; 14 | 15 | // You can directly control Mocha options by uncommenting the following lines 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info 17 | testRunner.configure({ 18 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) 19 | useColors: true // colored output from test results 20 | }); 21 | 22 | module.exports = testRunner; -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [{ 8 | "name": "Run Extension", 9 | "type": "extensionHost", 10 | "request": "launch", 11 | "runtimeExecutable": "${execPath}", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "npm: watch" 19 | }, 20 | { 21 | "name": "Extension Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "runtimeExecutable": "${execPath}", 25 | "args": [ 26 | "--extensionDevelopmentPath=${workspaceFolder}", 27 | "--extensionTestsPath=${workspaceFolder}/out/test" 28 | ], 29 | "outFiles": [ 30 | "${workspaceFolder}/out/test/**/*.js" 31 | ], 32 | "preLaunchTask": "npm: watch" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /src/config/attributes/icon/icon.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-icon/type": { 3 | "description": "Type of the ant design icon", 4 | "optionType": "string", 5 | "defaultValue": "-" 6 | }, 7 | "a-icon/style": { 8 | "description": "Style properties of icon, like fontSize and color", 9 | "optionType": "CSSProperties", 10 | "defaultValue": "-" 11 | }, 12 | "a-icon/theme": { 13 | "options": ["filled", "outlined", "twoTone"], 14 | "description": "Theme of the ant design icon", 15 | "optionType": "'filled' | 'outlined' | 'twoTone'", 16 | "defaultValue": "'outlined'" 17 | }, 18 | "a-icon/spin": { 19 | "description": "Rotate icon with animation", 20 | "optionType": "boolean", 21 | "defaultValue": "false" 22 | }, 23 | "a-icon/component": { 24 | "description": "The component used for the root node. This will override the type property.", 25 | "optionType": "ComponentType", 26 | "defaultValue": "-" 27 | }, 28 | "a-icon/twoToneColor": { 29 | "description": "Only support the two-tone icon. Specific the primary color.", 30 | "optionType": "string (hex color)", 31 | "defaultValue": "-" 32 | } 33 | } -------------------------------------------------------------------------------- /src/config/attributes/collapse/collapse.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-collapse/accordion": { 3 | "description": "If true, Collapse renders as Accordion", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-collapse/activeKey": { 8 | "description": "Key of the active panel", 9 | "optionType": "string[]|string", 10 | "defaultValue": "No default value. In accordion mode, it's the key of the first panel." 11 | }, 12 | "a-collapse/bordered": { 13 | "description": "Toggles rendering of the border around the collapse block", 14 | "optionType": "boolean", 15 | "defaultValue": "true" 16 | }, 17 | "a-collapse/defaultActiveKey": { 18 | "description": "Key of the initial active panel", 19 | "optionType": "string", 20 | "defaultValue": "-" 21 | }, 22 | "a-collapse/destroyInactivePanel": { 23 | "description": "Destroy Inactive Panel", 24 | "optionType": "boolean", 25 | "defaultValue": "false" 26 | }, 27 | "a-collapse/expandIcon": { 28 | "description": "allow to customize collapse icon", 29 | "optionType": "Function(props):VNode | slot=\"expandIcon\" slot-scope=\"props\"|v-slot:expandIcon=\"props\"", 30 | "defaultValue": "-" 31 | } 32 | } -------------------------------------------------------------------------------- /src/config/attributes/radio/radioGroup.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-radio-group/defaultValue": { 3 | "description": "Default selected value", 4 | "optionType": "any", 5 | "defaultValue": "-" 6 | }, 7 | "a-radio-group/disabled": { 8 | "description": "Disable all radio buttons", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-radio-group/name": { 13 | "description": "The name property of all input[type=\"radio\"] children", 14 | "optionType": "string", 15 | "defaultValue": "-" 16 | }, 17 | "a-radio-group/options": { 18 | "description": "set children optional", 19 | "optionType": "string[] | Array<{ label: string value: string disabled?: boolean }>", 20 | "defaultValue": "-" 21 | }, 22 | "a-radio-group/size": { 23 | "description": "size for radio button style", 24 | "optionType": "large | default | small", 25 | "defaultValue": "default" 26 | }, 27 | "a-radio-group/value": { 28 | "description": "Used for setting the currently selected value.", 29 | "optionType": "any", 30 | "defaultValue": "-" 31 | }, 32 | "a-radio-group/buttonStyle": { 33 | "description": "style type of radio button", 34 | "optionType": "outline | solid", 35 | "defaultValue": "outline" 36 | } 37 | } -------------------------------------------------------------------------------- /src/config/attributes/rate/rate.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-rate/allowClear": { 3 | "description": "whether to allow clear when click again", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-rate/allowHalf": { 8 | "description": "whether to allow semi selection", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-rate/autoFocus": { 13 | "description": "get focus when component mounted", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-rate/character": { 18 | "description": "custom character of rate", 19 | "optionType": "String or slot=\"character\"", 20 | "defaultValue": "" 21 | }, 22 | "a-rate/count": { 23 | "description": "star count", 24 | "optionType": "number", 25 | "defaultValue": "5" 26 | }, 27 | "a-rate/defaultValue": { 28 | "description": "default value", 29 | "optionType": "number", 30 | "defaultValue": "0" 31 | }, 32 | "a-rate/disabled": { 33 | "description": "read only, unable to interact", 34 | "optionType": "boolean", 35 | "defaultValue": "false" 36 | }, 37 | "a-rate/value": { 38 | "description": "current value", 39 | "optionType": "number", 40 | "defaultValue": "-" 41 | } 42 | } -------------------------------------------------------------------------------- /src/config/attributes/avatar/avatar.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-avatar/icon": { 3 | "description": "the Icon type for an icon avatar, see Icon Component", 4 | "optionType": "string", 5 | "defaultValue": "-" 6 | }, 7 | "a-avatar/shape": { 8 | "description": "the shape of avatar", 9 | "optionType": "circle | square", 10 | "defaultValue": "circle" 11 | }, 12 | "a-avatar/size": { 13 | "description": "the size of the avatar", 14 | "optionType": "number | string: large small default", 15 | "defaultValue": "default" 16 | }, 17 | "a-avatar/src": { 18 | "description": "the address of the image for an image avatar", 19 | "optionType": "string", 20 | "defaultValue": "-" 21 | }, 22 | "a-avatar/srcSet": { 23 | "description": "a list of sources to use for different screen resolutions", 24 | "optionType": "string", 25 | "defaultValue": "-" 26 | }, 27 | "a-avatar/alt": { 28 | "description": "This attribute defines the alternative text describing the image", 29 | "optionType": "string", 30 | "defaultValue": "-" 31 | }, 32 | "a-avatar/loadError": { 33 | "description": "handler when img load error,return false to prevent default fallback behavior", 34 | "optionType": "() => boolean", 35 | "defaultValue": "-" 36 | } 37 | } -------------------------------------------------------------------------------- /src/config/attributes/form/form.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-form/form": { 3 | "description": "Decorated by Form.create() will be automatically set this.form property, so just pass to form. If you use the template syntax, you can use this.$form.createForm(this, options)", 4 | "optionType": "object", 5 | "defaultValue": "n/a" 6 | }, 7 | "a-form/hideRequiredMark": { 8 | "description": "Hide required mark of all form items", 9 | "optionType": "Boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-form/layout": { 13 | "options": ["horizontal", "vertical", "inline"], 14 | "description": "Define form layout", 15 | "optionType": "'horizontal'|'vertical'|'inline'", 16 | "defaultValue": "'horizontal'" 17 | }, 18 | "a-form/autoFormCreate(deprecated)": { 19 | "description": "Automate Form.create, Recommended for use under the template component, and cannot be used with Form.create(). You should use $form.createForm to instead it after 1.1.9.", 20 | "optionType": "Function(form)", 21 | "defaultValue": "" 22 | }, 23 | "a-form/options(deprecated)": { 24 | "description": "The options corresponding to Form.create(options). You should use $form.createForm to instead it after 1.1.9.", 25 | "optionType": "Object", 26 | "defaultValue": "{}" 27 | } 28 | } -------------------------------------------------------------------------------- /src/config/attributes/carousel/carousel.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-carousel/afterChange": { 3 | "description": "Callback function called after the current index changes", 4 | "optionType": "function(current)", 5 | "defaultValue": "-" 6 | }, 7 | "a-carousel/autoplay": { 8 | "description": "Whether to scroll automatically", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-carousel/beforeChange": { 13 | "description": "Callback function called before the current index changes", 14 | "optionType": "function(from, to)", 15 | "defaultValue": "-" 16 | }, 17 | "a-carousel/dots": { 18 | "description": "Whether to show the dots at the bottom of the gallery", 19 | "optionType": "boolean", 20 | "defaultValue": "true" 21 | }, 22 | "a-carousel/easing": { 23 | "description": "Transition interpolation function name", 24 | "optionType": "string", 25 | "defaultValue": "linear" 26 | }, 27 | "a-carousel/effect": { 28 | "options": ["scrollx", "fade"], 29 | "description": "Transition effect", 30 | "optionType": "scrollx | fade", 31 | "defaultValue": "scrollx" 32 | }, 33 | "a-carousel/vertical": { 34 | "description": "Whether to use a vertical display", 35 | "optionType": "boolean", 36 | "defaultValue": "false" 37 | } 38 | } -------------------------------------------------------------------------------- /src/config/bash.js: -------------------------------------------------------------------------------- 1 | var a= [] 2 | $0.querySelectorAll('tr').forEach(item => { 3 | const td = item.querySelector('td') 4 | const text = td.innerText 5 | if (text.indexOf('slot') == -1 && text.indexOf('v-model') > -1) { 6 | a.push('"' + td.innerText.split('(v-model)')[0] + '"') 7 | } else if(text.indexOf('slot') == -1) { 8 | a.push('"' + td.innerText + '"') 9 | } 10 | }) 11 | console.dir(a.toString()) 12 | 13 | function getAttrs(tag) { 14 | var a= {} 15 | $0.querySelectorAll('tr').forEach(item => { 16 | const tdobj = {} 17 | const td = item.querySelector('td:nth-child(1)') 18 | const tdDes = item.querySelector('td:nth-child(2)') 19 | const tdType = item.querySelector('td:nth-child(3)') 20 | const tdDefault = item.querySelector('td:nth-child(4)') 21 | let text = td.innerText 22 | if (text.indexOf('slot') == -1 && text.indexOf('v-model') > -1) { 23 | text = td.innerText.split('(v-model)')[0] 24 | } else if(text.indexOf('slot') == -1) { 25 | text = td.innerText 26 | } 27 | a[`${tag}/${text}`] = { 28 | description: tdDes.innerText, 29 | optionType: tdType.innerText, 30 | defaultValue: tdDefault.innerText, 31 | } 32 | }) 33 | console.dir(JSON.stringify(a)) 34 | } 35 | getAttrs('a-input-number') 36 | -------------------------------------------------------------------------------- /src/config/attributes/anchor/anchor.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-anchor/affix": { 3 | "description": "Fixed mode of Anchor", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-anchor/bounds": { 8 | "description": "Bounding distance of anchor area", 9 | "optionType": "number", 10 | "defaultValue": "5(px)" 11 | }, 12 | "a-anchor/getContainer": { 13 | "description": "Scrolling container", 14 | "optionType": "() => HTMLElement", 15 | "defaultValue": "() => window" 16 | }, 17 | "a-anchor/offsetBottom": { 18 | "description": "Pixels to offset from bottom when calculating position of scroll", 19 | "optionType": "number", 20 | "defaultValue": "-" 21 | }, 22 | "a-anchor/offsetTop": { 23 | "description": "Pixels to offset from top when calculating position of scroll", 24 | "optionType": "number", 25 | "defaultValue": "0" 26 | }, 27 | "a-anchor/showInkInFixed": { 28 | "description": "Whether show ink-balls in Fixed mode", 29 | "optionType": "boolean", 30 | "defaultValue": "false" 31 | }, 32 | "a-anchor-link/href": { 33 | "description": "target of hyperlink", 34 | "optionType": "string", 35 | "defaultValue": "" 36 | }, 37 | "a-anchor-link/title": { 38 | "description": "content of hyperlink", 39 | "optionType": "string|slot", 40 | "defaultValue": "" 41 | } 42 | } -------------------------------------------------------------------------------- /src/config/attributes/switch/switch.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-switch/autoFocus": { 3 | "description": "get focus when component mounted", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-switch/checked": { 8 | "description": "determine whether the Switch is checked", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-switch/checkedChildren": { 13 | "description": "content to be shown when the state is checked", 14 | "optionType": "string|slot", 15 | "defaultValue": "" 16 | }, 17 | "a-switch/defaultChecked": { 18 | "description": "to set the initial state", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-switch/disabled": { 23 | "description": "Disable switch", 24 | "optionType": "boolean", 25 | "defaultValue": "false" 26 | }, 27 | "a-switch/loading": { 28 | "description": "loading state of switch", 29 | "optionType": "boolean", 30 | "defaultValue": "false" 31 | }, 32 | "a-switch/size": { 33 | "description": "the size of the Switch, options: default small", 34 | "optionType": "string", 35 | "defaultValue": "default" 36 | }, 37 | "a-switch/unCheckedChildren": { 38 | "description": "content to be shown when the state is unchecked", 39 | "optionType": "string|slot", 40 | "defaultValue": "" 41 | } 42 | } -------------------------------------------------------------------------------- /src/config/attributes/dropdown/dropdownButton.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-dropdown-button/disabled": { 3 | "description": "whether the dropdown menu is disabled", 4 | "optionType": "boolean", 5 | "defaultValue": "-" 6 | }, 7 | "a-dropdown-button/overlay": { 8 | "description": "the dropdown menu", 9 | "optionType": "Menu", 10 | "defaultValue": "-" 11 | }, 12 | "a-dropdown-button/placement": { 13 | "options": ["bottomLeft", "bottomCenter", "bottomRight", "topLeft", "topCenter", "topRight"], 14 | "description": "placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight", 15 | "optionType": "String", 16 | "defaultValue": "bottomLeft" 17 | }, 18 | "a-dropdown-button/size": { 19 | "description": "size of the button, the same as Button", 20 | "optionType": "string", 21 | "defaultValue": "default" 22 | }, 23 | "a-dropdown-button/trigger": { 24 | "description": "the trigger mode which executes the drop-down action", 25 | "optionType": "Array", 26 | "defaultValue": "['hover']" 27 | }, 28 | "a-dropdown-button/type": { 29 | "description": "type of the button, the same as Button", 30 | "optionType": "string", 31 | "defaultValue": "default" 32 | }, 33 | "a-dropdown-button/visible": { 34 | "description": "whether the dropdown menu is visible", 35 | "optionType": "boolean", 36 | "defaultValue": "-" 37 | } 38 | } -------------------------------------------------------------------------------- /src/config/attributes/treeSelect/treeSelectNode.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tree-select-node/selectable": { 3 | "description": "can be selected", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-tree-select-node/disableCheckbox": { 8 | "description": "Disables the checkbox of the treeNode", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-tree-select-node/disabled": { 13 | "description": "Disabled or not", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-tree-select-node/isLeaf": { 18 | "description": "Leaf node or not", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-tree-select-node/key": { 23 | "description": "Required property, should be unique in the tree", 24 | "optionType": "string | number", 25 | "defaultValue": "-" 26 | }, 27 | "a-tree-select-node/title": { 28 | "description": "Content showed on the treeNodes", 29 | "optionType": "string|slot", 30 | "defaultValue": "'---'" 31 | }, 32 | "a-tree-select-node/value": { 33 | "description": "Will be treated as treeNodeFilterProp by default, should be unique in the tree", 34 | "optionType": "string", 35 | "defaultValue": "-" 36 | }, 37 | "a-tree-select-node/scopedSlots": { 38 | "description": "When using treeNodes, you can use this property to configure the properties that support the slot, such as scopedSlots: { title: 'XXX'}", 39 | "optionType": "object", 40 | "defaultValue": "-" 41 | } 42 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ant-design-vue-helper 2 | 3 | > ant-design-vue-helper is a VS Code extension for Ant Design Vue. 4 | 5 | 6 | ## Feature 7 | 8 | * Document 9 | 10 | * Snippets 11 | 12 | 13 | ## Document 14 | 15 | ### Usage 16 | 17 | * Move cursor to Ant Design Vue tag or select it 18 | 19 | * Press default hot key `shift + cmd + i`(windows: `shift + win + i`) to bring up the Command Palette and then input `antdv-helper.search` 20 | 21 | * Show document view If complete matching, 22 | or you should select tag you want to search 23 | 24 | * Enter and trigger document browser 25 | 26 | ![document](https://user-images.githubusercontent.com/4122593/50880828-ac10d400-141a-11e9-8a43-5b724d3a24e6.gif) 27 | 28 | 29 | ### Keymap 30 | 31 | Default hot key is  `shift + cmd + i`( windows: `shift + win + i`). If it has conflicted with other software's hot key. You can customize it. see [keybindings](https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-shortcuts-editor) 32 | 33 | 34 | ## Autocomplete 35 | 36 | ![autocomplete](https://user-images.githubusercontent.com/4122593/50881037-57218d80-141b-11e9-8390-ddd49740e051.gif) 37 | 38 | * Distinguish and auto complete property and method for every Ant Design Vue tag 39 | 40 | 41 | 42 | ## Snippets 43 | 44 | ![snippets](https://user-images.githubusercontent.com/4122593/50881213-e9299600-141b-11e9-96c9-2e259616e6a2.gif) 45 | 46 | 47 | ## Contribution 48 | 49 | Your pull request will make ant-design-vue-helper better. 50 | 51 | ## LICENSE 52 | 53 | MIT 54 | 55 | -------------------------------------------------------------------------------- /src/config/attributes/alert/alert.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-alert/afterClose": { 3 | "description": "Called when close animation is finished", 4 | "optionType": "() => void", 5 | "defaultValue": "-" 6 | }, 7 | "a-alert/banner": { 8 | "description": "Whether to show as banner", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-alert/closable": { 13 | "description": "Whether Alert can be closed", 14 | "optionType": "boolean", 15 | "defaultValue": "-" 16 | }, 17 | "a-alert/closeText": { 18 | "description": "Close text to show", 19 | "optionType": "string|slot", 20 | "defaultValue": "-" 21 | }, 22 | "a-alert/description": { 23 | "description": "Additional content of Alert", 24 | "optionType": "string|slot", 25 | "defaultValue": "-" 26 | }, 27 | "a-alert/icon": { 28 | "description": "Custom icon, effective when showIcon is true", 29 | "optionType": "vnode | slot", 30 | "defaultValue": "-" 31 | }, 32 | "a-alert/message": { 33 | "description": "Content of Alert", 34 | "optionType": "string|slot", 35 | "defaultValue": "-" 36 | }, 37 | "a-alert/showIcon": { 38 | "description": "Whether to show icon", 39 | "optionType": "boolean", 40 | "defaultValue": "false, in banner mode default is true" 41 | }, 42 | "a-alert/type": { 43 | "options": ["success", "info", "warning", "error"], 44 | "description": "Type of Alert styles, options: success, info, warning, error", 45 | "optionType": "string", 46 | "defaultValue": "info, in banner mode default is warning" 47 | } 48 | } -------------------------------------------------------------------------------- /src/config/attributes/steps/step.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-steps/current": { 3 | "description": "to set the current step, counting from 0. You can overwrite this state by using status of Step", 4 | "optionType": "number", 5 | "defaultValue": "0" 6 | }, 7 | "a-steps/direction": { 8 | "description": "to specify the direction of the step bar, horizontal and vertical are currently supported", 9 | "optionType": "string", 10 | "defaultValue": "horizontal" 11 | }, 12 | "a-steps/labelPlacement": { 13 | "description": "support vertial title and description", 14 | "optionType": "string", 15 | "defaultValue": "horizontal" 16 | }, 17 | "a-steps/progressDot": { 18 | "description": "Steps with progress dot style, customize the progress dot by setting a scoped slot. labelPlacement will be vertical", 19 | "optionType": "Boolean or slot=\"progressDot\" slot-scope=\"{index, status, title, description, prefixCls})\"", 20 | "defaultValue": "false" 21 | }, 22 | "a-steps/size": { 23 | "description": "to specify the size of the step bar, default and small are currently supported", 24 | "optionType": "string", 25 | "defaultValue": "default" 26 | }, 27 | "a-steps/status": { 28 | "description": "to specify the status of current step, can be set to one of the following values: wait process finish error", 29 | "optionType": "string", 30 | "defaultValue": "process" 31 | }, 32 | "a-steps/initial": { 33 | "description": "set the initial step, counting from 0", 34 | "optionType": "number", 35 | "defaultValue": "0" 36 | } 37 | } -------------------------------------------------------------------------------- /src/config/attributes/badge/badge.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-badge/count": { 3 | "description": "Number to show in badge", 4 | "optionType": "number|string | slot", 5 | "defaultValue": "" 6 | }, 7 | "a-badge/dot": { 8 | "description": "Whether to display a red dot instead of count", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-badge/offset": { 13 | "description": "set offset of the badge dot, like [x, y]", 14 | "optionType": "[number|string, number|string]", 15 | "defaultValue": "-" 16 | }, 17 | "a-badge/overflowCount": { 18 | "description": "Max count to show", 19 | "optionType": "number", 20 | "defaultValue": "99" 21 | }, 22 | "a-badge/showZero": { 23 | "description": "Whether to show badge when count is zero", 24 | "optionType": "boolean", 25 | "defaultValue": "false" 26 | }, 27 | "a-badge/status": { 28 | "options": ["success", "processing", "default", "error","warning"], 29 | "description": "Set Badge as a status dot", 30 | "optionType": "success | processing | default | error | warning", 31 | "defaultValue": "''" 32 | }, 33 | "a-badge/text": { 34 | "description": "If status is set, text sets the display text of the status dot", 35 | "optionType": "string", 36 | "defaultValue": "''" 37 | }, 38 | "a-badge/numberStyle": { 39 | "description": "sets the display style of the status dot", 40 | "optionType": "object", 41 | "defaultValue": "''" 42 | }, 43 | "a-badge/title": { 44 | "description": "Text to show when hovering over the badge", 45 | "optionType": "string", 46 | "defaultValue": "count" 47 | } 48 | } -------------------------------------------------------------------------------- /src/config/attributes/dropdown/dropdown.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-dropdown/disabled": { 3 | "description": "whether the dropdown menu is disabled", 4 | "optionType": "boolean", 5 | "defaultValue": "-" 6 | }, 7 | "a-dropdown/getPopupContainer": { 8 | "description": "to set the container of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition. example", 9 | "optionType": "Function(triggerNode)", 10 | "defaultValue": "() => document.body" 11 | }, 12 | "a-dropdown/overlay": { 13 | "description": "the dropdown menu", 14 | "optionType": "Menu", 15 | "defaultValue": "-" 16 | }, 17 | "a-dropdown/overlayClassName": { 18 | "description": "Class name of the dropdown root element", 19 | "optionType": "string", 20 | "defaultValue": "-" 21 | }, 22 | "a-dropdown/overlayStyle": { 23 | "description": "Style of the dropdown root element", 24 | "optionType": "object", 25 | "defaultValue": "-" 26 | }, 27 | "a-dropdown/placement": { 28 | "options": ["bottomLeft", "bottomCenter", "bottomRight", "topLeft", "topCenter", "topRight"], 29 | "description": "placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight", 30 | "optionType": "String", 31 | "defaultValue": "bottomLeft" 32 | }, 33 | "a-dropdown/trigger": { 34 | "description": "the trigger mode which executes the drop-down action", 35 | "optionType": "Array", 36 | "defaultValue": "['hover']" 37 | }, 38 | "a-dropdown/visible": { 39 | "description": "whether the dropdown menu is visible", 40 | "optionType": "boolean", 41 | "defaultValue": "-" 42 | } 43 | } -------------------------------------------------------------------------------- /src/config/attributes/button/button.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-button/disabled": { 3 | "description": "disabled state of button", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-button/ghost": { 8 | "description": "make background transparent and invert text and border colors, added in 2.7", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-button/htmlType": { 13 | "description": "set the original html type of button, see: MDN", 14 | "optionType": "string", 15 | "defaultValue": "button" 16 | }, 17 | "a-button/icon": { 18 | "description": "set the icon of button, see: Icon component", 19 | "optionType": "string", 20 | "defaultValue": "-" 21 | }, 22 | "a-button/loading": { 23 | "description": "set the loading status of button", 24 | "optionType": "boolean | { delay: number }", 25 | "defaultValue": "false" 26 | }, 27 | "a-button/shape": { 28 | "options": ["circle", "round"], 29 | "description": "can be set to circle or omitted", 30 | "optionType": "string", 31 | "defaultValue": "-" 32 | }, 33 | "a-button/size": { 34 | "options": ["small", "large"], 35 | "description": "can be set to small large or omitted", 36 | "optionType": "string", 37 | "defaultValue": "default" 38 | }, 39 | "a-button/type": { 40 | "options": ["primary", "ghost", "dashed", "danger"], 41 | "description": "can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default)", 42 | "optionType": "string", 43 | "defaultValue": "default" 44 | }, 45 | "a-button/block": { 46 | "description": "option to fit button width to its parent width", 47 | "optionType": "boolean", 48 | "defaultValue": "false" 49 | } 50 | } -------------------------------------------------------------------------------- /src/config/attributes/input/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-input/addonAfter": { 3 | "description": "The label text displayed after (on the right side of) the input field.", 4 | "optionType": "string|slot", 5 | "defaultValue": "" 6 | }, 7 | "a-input/addonBefore": { 8 | "description": "The label text displayed before (on the left side of) the input field.", 9 | "optionType": "string|slot", 10 | "defaultValue": "" 11 | }, 12 | "a-input/defaultValue": { 13 | "description": "The initial input content", 14 | "optionType": "string", 15 | "defaultValue": "" 16 | }, 17 | "a-input/disabled": { 18 | "description": "Whether the input is disabled.", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-input/id": { 23 | "description": "The ID for input", 24 | "optionType": "string", 25 | "defaultValue": "" 26 | }, 27 | "a-input/prefix": { 28 | "description": "The prefix icon for the Input.", 29 | "optionType": "string|slot", 30 | "defaultValue": "" 31 | }, 32 | "a-input/size": { 33 | "description": "The size of the input box. Note: in the context of a form, the large size is used. Available: large default small", 34 | "optionType": "string", 35 | "defaultValue": "default" 36 | }, 37 | "a-input/suffix": { 38 | "description": "The suffix icon for the Input.", 39 | "optionType": "string|slot", 40 | "defaultValue": "" 41 | }, 42 | "a-input/type": { 43 | "description": "The type of input, see: MDN(use Input.TextArea instead of type=\"textarea\")", 44 | "optionType": "string", 45 | "defaultValue": "text" 46 | }, 47 | "a-input/value": { 48 | "description": "The input content value", 49 | "optionType": "string", 50 | "defaultValue": "" 51 | } 52 | } -------------------------------------------------------------------------------- /src/config/attributes/tabs/tabs.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tabs/activeKey": { 3 | "description": "Current TabPane's key", 4 | "optionType": "string", 5 | "defaultValue": "-" 6 | }, 7 | "a-tabs/animated": { 8 | "description": "Whether to change tabs with animation. Only works while tabPosition=\"top\"\\|\"bottom\"", 9 | "optionType": "boolean | {inkBar:boolean, tabPane:boolean}", 10 | "defaultValue": "true, false when type=\"card\"" 11 | }, 12 | "a-tabs/defaultActiveKey": { 13 | "description": "Initial active TabPane's key, if activeKey is not set.", 14 | "optionType": "string", 15 | "defaultValue": "-" 16 | }, 17 | "a-tabs/hideAdd": { 18 | "description": "Hide plus icon or not. Only works while type=\"editable-card\"", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-tabs/size": { 23 | "options": ["large", "default", "small"], 24 | "description": "preset tab bar size", 25 | "optionType": "large | default | small", 26 | "defaultValue": "default" 27 | }, 28 | "a-tabs/tabBarExtraContent": { 29 | "description": "Extra content in tab bar", 30 | "optionType": "slot", 31 | "defaultValue": "-" 32 | }, 33 | "a-tabs/tabBarStyle": { 34 | "description": "Tab bar style object", 35 | "optionType": "object", 36 | "defaultValue": "-" 37 | }, 38 | "a-tabs/tabPosition": { 39 | "options": ["top", "right", "bottom", "left"], 40 | "description": "Position of tabs", 41 | "optionType": "top | right | bottom | left", 42 | "defaultValue": "top" 43 | }, 44 | "a-tabs/type": { 45 | "options": ["line", "card", "editable-card"], 46 | "description": "Basic style of tabs", 47 | "optionType": "line | card | editable-card", 48 | "defaultValue": "line" 49 | }, 50 | "a-tabs/tabBarGutter": { 51 | "description": "The gap between tabs", 52 | "optionType": "number", 53 | "defaultValue": "-" 54 | } 55 | } -------------------------------------------------------------------------------- /src/config/attributes/form/formItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-form-item/colon": { 3 | "description": "Used with label, whether to display : after label text.", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-form-item/extra": { 8 | "description": "The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time.", 9 | "optionType": "string|slot", 10 | "defaultValue": "" 11 | }, 12 | "a-form-item/hasFeedback": { 13 | "description": "Used with validateStatus, this option specifies the validation status icon. Recommended to be used only with Input.", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-form-item/help": { 18 | "description": "The prompt message. If not provided, the prompt message will be generated by the validation rule.", 19 | "optionType": "string|slot", 20 | "defaultValue": "" 21 | }, 22 | "a-form-item/label": { 23 | "description": "Label text", 24 | "optionType": "string|slot", 25 | "defaultValue": "" 26 | }, 27 | "a-form-item/labelCol": { 28 | "description": "The layout of label. You can set span offset to something like {span: 3, offset: 12} or sm: {span: 3, offset: 12} same as with ", 29 | "optionType": "object", 30 | "defaultValue": "" 31 | }, 32 | "a-form-item/required": { 33 | "description": "Whether provided or not, it will be generated by the validation rule.", 34 | "optionType": "boolean", 35 | "defaultValue": "false" 36 | }, 37 | "a-form-item/validateStatus": { 38 | "description": "The validation status. If not provided, it will be generated by validation rule. options: 'success' 'warning' 'error' 'validating'", 39 | "optionType": "string", 40 | "defaultValue": "" 41 | }, 42 | "a-form-item/wrapperCol": { 43 | "description": "The layout for input controls, same as labelCol", 44 | "optionType": "object", 45 | "defaultValue": "" 46 | } 47 | } -------------------------------------------------------------------------------- /src/config/attributes/inputNumber/number.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-input-number/autoFocus": { 3 | "description": "get focus when component mounted", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-input-number/defaultValue": { 8 | "description": "initial value", 9 | "optionType": "number", 10 | "defaultValue": "" 11 | }, 12 | "a-input-number/disabled": { 13 | "description": "disable the input", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-input-number/formatter": { 18 | "description": "Specifies the format of the value presented", 19 | "optionType": "function(value: number | string): string", 20 | "defaultValue": "-" 21 | }, 22 | "a-input-number/max": { 23 | "description": "max value", 24 | "optionType": "number", 25 | "defaultValue": "Infinity" 26 | }, 27 | "a-input-number/min": { 28 | "description": "min value", 29 | "optionType": "number", 30 | "defaultValue": "-Infinity" 31 | }, 32 | "a-input-number/parser": { 33 | "description": "Specifies the value extracted from formatter", 34 | "optionType": "function( string): number", 35 | "defaultValue": "-" 36 | }, 37 | "a-input-number/precision": { 38 | "description": "precision of input value", 39 | "optionType": "number", 40 | "defaultValue": "-" 41 | }, 42 | "a-input-number/decimalSeparator": { 43 | "description": "decimal separator", 44 | "optionType": "string", 45 | "defaultValue": "-" 46 | }, 47 | "a-input-number/size": { 48 | "description": "width of input box", 49 | "optionType": "string", 50 | "defaultValue": "-" 51 | }, 52 | "a-input-number/step": { 53 | "description": "The number to which the current value is increased or decreased. It can be an integer or decimal.", 54 | "optionType": "number|string", 55 | "defaultValue": "1" 56 | }, 57 | "a-input-number/value": { 58 | "description": "current value", 59 | "optionType": "number", 60 | "defaultValue": "" 61 | } 62 | } -------------------------------------------------------------------------------- /src/config/attributes/grid/col.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-col/offset": { 3 | "description": "the number of cells to offset Col from the left", 4 | "optionType": "number", 5 | "defaultValue": "0" 6 | }, 7 | "a-col/order": { 8 | "description": "raster order, used in flex layout mode", 9 | "optionType": "number", 10 | "defaultValue": "0" 11 | }, 12 | "a-col/pull": { 13 | "description": "the number of cells that raster is moved to the left", 14 | "optionType": "number", 15 | "defaultValue": "0" 16 | }, 17 | "a-col/push": { 18 | "description": "the number of cells that raster is moved to the right", 19 | "optionType": "number", 20 | "defaultValue": "0" 21 | }, 22 | "a-col/span": { 23 | "description": "raster number of cells to occupy, 0 corresponds to display: none", 24 | "optionType": "number", 25 | "defaultValue": "none" 26 | }, 27 | "a-col/xs": { 28 | "description": "<576px and also default setting, could be a span value or an object containing above props", 29 | "optionType": "number|object", 30 | "defaultValue": "-" 31 | }, 32 | "a-col/sm": { 33 | "description": "≥576px, could be a span value or an object containing above props", 34 | "optionType": "number|object", 35 | "defaultValue": "-" 36 | }, 37 | "a-col/md": { 38 | "description": "≥768px, could be a span value or an object containing above props", 39 | "optionType": "number|object", 40 | "defaultValue": "-" 41 | }, 42 | "a-col/lg": { 43 | "description": "≥992px, could be a span value or an object containing above props", 44 | "optionType": "number|object", 45 | "defaultValue": "-" 46 | }, 47 | "a-col/xl": { 48 | "description": "≥1200px, could be a span value or an object containing above props", 49 | "optionType": "number|object", 50 | "defaultValue": "-" 51 | }, 52 | "a-col/xxl": { 53 | "description": "≥1600px, could be a span value or an object containing above props", 54 | "optionType": "number|object", 55 | "defaultValue": "-" 56 | } 57 | } -------------------------------------------------------------------------------- /src/config/attributes/layout/layoutSider.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-layout-sider/breakpoint": { 3 | "options": ["xs", "sm", "md", "lg", "xl", "xxl"], 4 | "description": "breakpoints of the responsive layout", 5 | "optionType": "Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' }", 6 | "defaultValue": "-" 7 | }, 8 | "a-layout-sider/class": { 9 | "description": "container className", 10 | "optionType": "string", 11 | "defaultValue": "-" 12 | }, 13 | "a-layout-sider/collapsed": { 14 | "description": "to set the current status", 15 | "optionType": "boolean", 16 | "defaultValue": "-" 17 | }, 18 | "a-layout-sider/collapsedWidth": { 19 | "description": "width of the collapsed sidebar, by setting to 0 a special trigger will appear", 20 | "optionType": "number", 21 | "defaultValue": "80" 22 | }, 23 | "a-layout-sider/collapsible": { 24 | "description": "whether can be collapsed", 25 | "optionType": "boolean", 26 | "defaultValue": "false" 27 | }, 28 | "a-layout-sider/defaultCollapsed": { 29 | "description": "to set the initial status", 30 | "optionType": "boolean", 31 | "defaultValue": "false" 32 | }, 33 | "a-layout-sider/reverseArrow": { 34 | "description": "reverse direction of arrow, for a sider that expands from the right", 35 | "optionType": "boolean", 36 | "defaultValue": "false" 37 | }, 38 | "a-layout-sider/style": { 39 | "description": "to customize the styles", 40 | "optionType": "object|string", 41 | "defaultValue": "-" 42 | }, 43 | "a-layout-sider/theme": { 44 | "description": "color theme of the sidebar", 45 | "optionType": "string: light dark", 46 | "defaultValue": "dark" 47 | }, 48 | "a-layout-sider/trigger": { 49 | "description": "specify the customized trigger, set to null to hide the trigger", 50 | "optionType": "string|slot", 51 | "defaultValue": "-" 52 | }, 53 | "a-layout-sider/width": { 54 | "description": "width of the sidebar", 55 | "optionType": "number|string", 56 | "defaultValue": "200" 57 | } 58 | } -------------------------------------------------------------------------------- /src/config/attributes/list/list.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-list/bordered": { 3 | "description": "Toggles rendering of the border around the list", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-list/footer": { 8 | "description": "List footer renderer", 9 | "optionType": "string|slot", 10 | "defaultValue": "-" 11 | }, 12 | "a-list/grid": { 13 | "description": "The grid type of list. You can set grid to something like {gutter: 16, column: 4}", 14 | "optionType": "object", 15 | "defaultValue": "-" 16 | }, 17 | "a-list/header": { 18 | "description": "List header renderer", 19 | "optionType": "string|slot", 20 | "defaultValue": "-" 21 | }, 22 | "a-list/itemLayout": { 23 | "description": "The layout of list, default is horizontal, If a vertical list is desired, set the itemLayout property to vertical", 24 | "optionType": "string", 25 | "defaultValue": "-" 26 | }, 27 | "a-list/loading": { 28 | "description": "Shows a loading indicator while the contents of the list are being fetched", 29 | "optionType": "boolean|object", 30 | "defaultValue": "false" 31 | }, 32 | "a-list/loadMore": { 33 | "description": "Shows a load more content", 34 | "optionType": "string|slot", 35 | "defaultValue": "-" 36 | }, 37 | "a-list/locale": { 38 | "description": "i18n text including empty text", 39 | "optionType": "object", 40 | "defaultValue": "emptyText: 'No Data' \n" 41 | }, 42 | "a-list/pagination": { 43 | "description": "Pagination config, hide it by setting it to false", 44 | "optionType": "boolean | object", 45 | "defaultValue": "false" 46 | }, 47 | "a-list/split": { 48 | "description": "Toggles rendering of the split under the list item", 49 | "optionType": "boolean", 50 | "defaultValue": "true" 51 | }, 52 | "a-list/renderItem": { 53 | "description": "Custom item renderer, slot=\"renderItem\" and slot-scope=\"item, index\"", 54 | "optionType": "(item, index) => vNode", 55 | "defaultValue": "" 56 | }, 57 | "a-list/rowKey": { 58 | "description": "Specify the key that will be used for uniquely identify each element", 59 | "optionType": "item => string|number", 60 | "defaultValue": "" 61 | } 62 | } -------------------------------------------------------------------------------- /src/config/attributes/calendar/calendar.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-calendar/dateCellRender": { 3 | "description": "Customize the display of the date cell by setting a scoped slot, the returned content will be appended to the cell", 4 | "optionType": "function(date: moment)", 5 | "defaultValue": "-" 6 | }, 7 | "a-calendar/dateFullCellRender": { 8 | "description": "Customize the display of the date cell by setting a scoped slot, the returned content will override the cell", 9 | "optionType": "function(date: moment)", 10 | "defaultValue": "-" 11 | }, 12 | "a-calendar/defaultValue": { 13 | "description": "The date selected by default", 14 | "optionType": "moment", 15 | "defaultValue": "default date" 16 | }, 17 | "a-calendar/disabledDate": { 18 | "description": "Function that specifies the dates that cannot be selected", 19 | "optionType": "(currentDate: moment) => boolean", 20 | "defaultValue": "-" 21 | }, 22 | "a-calendar/fullscreen": { 23 | "description": "Whether to display in full-screen", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-calendar/locale": { 28 | "description": "The calendar's locale", 29 | "optionType": "object", 30 | "defaultValue": "default" 31 | }, 32 | "a-calendar/mode": { 33 | "description": "The display mode of the calendar", 34 | "optionType": "month | year", 35 | "defaultValue": "month" 36 | }, 37 | "a-calendar/monthCellRender": { 38 | "description": "Customize the display of the month cell by setting a scoped slot, the returned content will be appended to the cell", 39 | "optionType": "function(date: moment)", 40 | "defaultValue": "-" 41 | }, 42 | "a-calendar/monthFullCellRender": { 43 | "description": "Customize the display of the month cell by setting a scoped slot, the returned content will override the cell", 44 | "optionType": "function(date: moment)", 45 | "defaultValue": "-" 46 | }, 47 | "a-calendar/validRange": { 48 | "description": "to set valid range", 49 | "optionType": "[moment, moment]", 50 | "defaultValue": "-" 51 | }, 52 | "a-calendar/value": { 53 | "description": "The current selected date", 54 | "optionType": "moment", 55 | "defaultValue": "current date" 56 | } 57 | } -------------------------------------------------------------------------------- /vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | * This folder contains all of the files necessary for your extension. 5 | * `package.json` - this is the manifest file in which you declare your extension and command. 6 | The sample plugin registers a command and defines its title and command name. With this information 7 | VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. 8 | * `src/extension.ts` - this is the main file where you will provide the implementation of your command. 9 | The file exports one function, `activate`, which is called the very first time your extension is 10 | activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. 11 | We pass the function containing the implementation of the command as the second parameter to 12 | `registerCommand`. 13 | 14 | ## Get up and running straight away 15 | * Press `F5` to open a new window with your extension loaded. 16 | * Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. 17 | * Set breakpoints in your code inside `src/extension.ts` to debug your extension. 18 | * Find output from your extension in the debug console. 19 | 20 | ## Make changes 21 | * You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`. 22 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. 23 | 24 | ## Explore the API 25 | * You can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts`. 26 | 27 | ## Run tests 28 | * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`. 29 | * Press `F5` to run the tests in a new window with your extension loaded. 30 | * See the output of the test result in the debug console. 31 | * Make changes to `test/extension.test.ts` or create new test files inside the `test` folder. 32 | * By convention, the test runner will only consider files matching the name pattern `**.test.ts`. 33 | * You can create folders inside the `test` folder to structure your tests any way you want. 34 | -------------------------------------------------------------------------------- /src/config/attributes/pagination/pagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-pagination/current": { 3 | "description": "current page number", 4 | "optionType": "number", 5 | "defaultValue": "-" 6 | }, 7 | "a-pagination/defaultCurrent": { 8 | "description": "default initial page number", 9 | "optionType": "number", 10 | "defaultValue": "1" 11 | }, 12 | "a-pagination/defaultPageSize": { 13 | "description": "default number of data items per page", 14 | "optionType": "number", 15 | "defaultValue": "10" 16 | }, 17 | "a-pagination/hideOnSinglePage": { 18 | "description": "Whether to hide pager on single page", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-pagination/itemRender": { 23 | "description": "to customize item innerHTML", 24 | "optionType": "(page, type: 'page' | 'prev' | 'next', originalElement) => vNode", 25 | "defaultValue": "-" 26 | }, 27 | "a-pagination/pageSize": { 28 | "description": "number of data items per page", 29 | "optionType": "number", 30 | "defaultValue": "-" 31 | }, 32 | "a-pagination/pageSizeOptions": { 33 | "description": "specify the sizeChanger options", 34 | "optionType": "string[]", 35 | "defaultValue": "['10', '20', '30', '40']" 36 | }, 37 | "a-pagination/showQuickJumper": { 38 | "description": "determine whether you can jump to pages directly", 39 | "optionType": "boolean", 40 | "defaultValue": "false" 41 | }, 42 | "a-pagination/showSizeChanger": { 43 | "description": "determine whether pageSize can be changed", 44 | "optionType": "boolean", 45 | "defaultValue": "false" 46 | }, 47 | "a-pagination/showTotal": { 48 | "description": "to display the total number and range", 49 | "optionType": "Function(total, range)", 50 | "defaultValue": "-" 51 | }, 52 | "a-pagination/simple": { 53 | "description": "whether to use simple mode", 54 | "optionType": "boolean", 55 | "defaultValue": "-" 56 | }, 57 | "a-pagination/size": { 58 | "options": ["small", "large"], 59 | "description": "specify the size of Pagination, can be set to small", 60 | "optionType": "string", 61 | "defaultValue": "\"\"" 62 | }, 63 | "a-pagination/total": { 64 | "description": "total number of data items", 65 | "optionType": "number", 66 | "defaultValue": "0" 67 | } 68 | } -------------------------------------------------------------------------------- /src/config/attributes/card/card.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-card/actions": { 3 | "description": "The action list, shows at the bottom of the Card.", 4 | "optionType": "slots", 5 | "defaultValue": "-" 6 | }, 7 | "a-card/activeTabKey": { 8 | "description": "Current TabPane's key", 9 | "optionType": "string", 10 | "defaultValue": "-" 11 | }, 12 | "a-card/headStyle": { 13 | "description": "Inline style to apply to the card head", 14 | "optionType": "object", 15 | "defaultValue": "-" 16 | }, 17 | "a-card/bodyStyle": { 18 | "description": "Inline style to apply to the card content", 19 | "optionType": "object", 20 | "defaultValue": "-" 21 | }, 22 | "a-card/bordered": { 23 | "description": "Toggles rendering of the border around the card", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-card/cover": { 28 | "description": "Card cover", 29 | "optionType": "slot", 30 | "defaultValue": "-" 31 | }, 32 | "a-card/defaultActiveTabKey": { 33 | "description": "Initial active TabPane's key, if activeTabKey is not set.", 34 | "optionType": "string", 35 | "defaultValue": "-" 36 | }, 37 | "a-card/extra": { 38 | "description": "Content to render in the top-right corner of the card", 39 | "optionType": "string|slot", 40 | "defaultValue": "-" 41 | }, 42 | "a-card/hoverable": { 43 | "description": "Lift up when hovering card", 44 | "optionType": "boolean", 45 | "defaultValue": "false" 46 | }, 47 | "a-card/loading": { 48 | "description": "Shows a loading indicator while the contents of the card are being fetched", 49 | "optionType": "boolean", 50 | "defaultValue": "false" 51 | }, 52 | "a-card/tabList": { 53 | "description": "List of TabPane's head, Custom tabs can be created with the scopedSlots property", 54 | "optionType": "Array<{key: string, tab: any, scopedSlots: {tab: 'XXX'}}>", 55 | "defaultValue": "-" 56 | }, 57 | "a-card/size": { 58 | "options": ["default", "small"], 59 | "description": "Size of card", 60 | "optionType": "string", 61 | "defaultValue": "default" 62 | }, 63 | "a-card/title": { 64 | "description": "Card title", 65 | "optionType": "string|slot", 66 | "defaultValue": "-" 67 | }, 68 | "a-card/type": { 69 | "description": "Card style type, can be set to inner or not set", 70 | "optionType": "string", 71 | "defaultValue": "-" 72 | } 73 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-ant-design-vue-helper", 3 | "displayName": "Ant Design Vue helper", 4 | "description": "A vscode extension for Ant-Design-Vue", 5 | "version": "1.0.6", 6 | "publisher": "ant-design-vue", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/vueComponent/ant-design-vue-helper" 10 | }, 11 | "engines": { 12 | "vscode": "^1.30.0" 13 | }, 14 | "icon": "antdv.png", 15 | "categories": [ 16 | "Snippets", 17 | "Other" 18 | ], 19 | "activationEvents": [ 20 | "onLanguage:html", 21 | "onLanguage:vue", 22 | "onCommand:antdv-helper.search" 23 | ], 24 | "contributes": { 25 | "commands": [ 26 | { 27 | "command": "antdv-helper.search", 28 | "title": "antdv-helper.search" 29 | } 30 | ], 31 | "keybindings": [ 32 | { 33 | "command": "antdv-helper.search", 34 | "key": "shift+cmd+i", 35 | "when": "editorTextFocus" 36 | } 37 | ], 38 | "snippets": [ 39 | { 40 | "language": "javascript", 41 | "path": "./snippets/antdv.json" 42 | } 43 | ], 44 | "configuration": { 45 | "type": "object", 46 | "title": "Antdv Helper Configuration", 47 | "properties": { 48 | "antdv-helper.indent-size": { 49 | "type": "number", 50 | "default": 2, 51 | "description": "Indentation size of snippets" 52 | }, 53 | "antdv-helper.quotes": { 54 | "type": "string", 55 | "default": "double" 56 | }, 57 | "antdv-helper.link-url": { 58 | "type": "string", 59 | "default": "https://ant-design-vue.gitee.io" 60 | } 61 | } 62 | } 63 | }, 64 | "main": "./out/extension.js", 65 | "scripts": { 66 | "vscode:prepublish": "sh build.sh", 67 | "compile": "sh build.sh", 68 | "watch": "sh build.sh --watch", 69 | "postinstall": "node ./node_modules/vscode/bin/install", 70 | "test": "npm run compile && node ./node_modules/vscode/bin/test" 71 | }, 72 | "devDependencies": { 73 | "typescript": "^3.1.4", 74 | "vscode": "^1.1.25", 75 | "tslint": "^5.8.0", 76 | "@types/node": "^8.10.25", 77 | "@types/mocha": "^2.2.42" 78 | }, 79 | "dependencies": { 80 | "pretty": "^2.0.0", 81 | "shelljs": "^0.8.3" 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/config/attributes/tree/treeNode.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tree-node/class": { 3 | "description": "className", 4 | "optionType": "string", 5 | "defaultValue": "-" 6 | }, 7 | "a-tree-node/style": { 8 | "description": "style", 9 | "optionType": "string|object", 10 | "defaultValue": "-" 11 | }, 12 | "a-tree-node/disableCheckbox": { 13 | "description": "Disables the checkbox of the treeNode", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-tree-node/disabled": { 18 | "description": "Disables the treeNode", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-tree-node/icon": { 23 | "description": "customize icon. When you pass component, whose render will receive full TreeNode props as component props", 24 | "optionType": "slot|slot-scope", 25 | "defaultValue": "-" 26 | }, 27 | "a-tree-node/isLeaf": { 28 | "description": "Determines if this is a leaf node(effective when loadData is specified)", 29 | "optionType": "boolean", 30 | "defaultValue": "false" 31 | }, 32 | "a-tree-node/key": { 33 | "description": "Used with (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys. P.S.: It must be unique in all of treeNodes of the tree!", 34 | "optionType": "string | number", 35 | "defaultValue": "internal calculated position of treeNode" 36 | }, 37 | "a-tree-node/selectable": { 38 | "description": "Set whether the treeNode can be selected", 39 | "optionType": "boolean", 40 | "defaultValue": "true" 41 | }, 42 | "a-tree-node/title": { 43 | "description": "Title", 44 | "optionType": "string|slot|slot-scope", 45 | "defaultValue": "'---'" 46 | }, 47 | "a-tree-node/slots": { 48 | "description": "When using treeNodes, you can use this property to configure the properties that support the slot, such as slots: { title: 'XXX'}", 49 | "optionType": "object", 50 | "defaultValue": "-" 51 | }, 52 | "a-tree-node/scopedSlots": { 53 | "description": "When using treeNodes, you can use this property to configure the properties that support the slot-scope, such as scopedSlots: { title: 'XXX'}", 54 | "optionType": "object", 55 | "defaultValue": "-" 56 | }, 57 | "a-tree-node/on": { 58 | "description": "When using treeNodes, you can use this property to configure the events, such as on: { click: () => {}}", 59 | "optionType": "object", 60 | "defaultValue": "-" 61 | } 62 | } -------------------------------------------------------------------------------- /src/config/attributes/date-picker/date.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-date-picker/allowClear": { 3 | "description": "Whether to show clear button", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-date-picker/autoFocus": { 8 | "description": "get focus when component mounted", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-date-picker/dateRender": { 13 | "description": "custom rendering function for date cells by setting a scoped slot", 14 | "optionType": "slot=\"dateRender\" slot-scope=\"current, today\"", 15 | "defaultValue": "-" 16 | }, 17 | "a-date-picker/disabled": { 18 | "description": "determine whether the DatePicker is disabled", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-date-picker/disabledDate": { 23 | "description": "specify the date that cannot be selected", 24 | "optionType": "(currentDate: moment) => boolean", 25 | "defaultValue": "-" 26 | }, 27 | "a-date-picker/getCalendarContainer": { 28 | "description": "to set the container of the floating layer, while the default is to create a div element in body", 29 | "optionType": "function(trigger)", 30 | "defaultValue": "-" 31 | }, 32 | "a-date-picker/locale": { 33 | "description": "localization configuration", 34 | "optionType": "object", 35 | "defaultValue": "default" 36 | }, 37 | "a-date-picker/open": { 38 | "description": "open state of picker", 39 | "optionType": "boolean", 40 | "defaultValue": "-" 41 | }, 42 | "a-date-picker/placeholder": { 43 | "description": "placeholder of date input", 44 | "optionType": "string|RangePicker[]", 45 | "defaultValue": "-" 46 | }, 47 | "a-date-picker/popupStyle": { 48 | "description": "to customize the style of the popup calendar", 49 | "optionType": "object", 50 | "defaultValue": "{}" 51 | }, 52 | "a-date-picker/dropdownClassName": { 53 | "description": "to customize the className of the popup calendar", 54 | "optionType": "string", 55 | "defaultValue": "-" 56 | }, 57 | "a-date-picker/size": { 58 | "description": "determine the size of the input box, the height of large and small, are 40px and 24px respectively, while default size is 32px", 59 | "optionType": "string", 60 | "defaultValue": "-" 61 | }, 62 | "a-date-picker/suffixIcon": { 63 | "description": "The custom suffix icon", 64 | "optionType": "VNode | slot", 65 | "defaultValue": "-" 66 | } 67 | } -------------------------------------------------------------------------------- /src/config/attributes/progress/progress.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-progress/format": { 3 | "description": "template function of the content", 4 | "optionType": "function(percent, successPercent)", 5 | "defaultValue": "percent => percent + '%'" 6 | }, 7 | "a-progress/gapDegree (type=circle)": { 8 | "description": "the gap degree of half circle, 0 ~ 360", 9 | "optionType": "number", 10 | "defaultValue": "0" 11 | }, 12 | "a-progress/gapPosition (type=circle)": { 13 | "description": "the gap position, options: top bottom left right", 14 | "optionType": "string", 15 | "defaultValue": "top" 16 | }, 17 | "a-progress/percent": { 18 | "description": "to set the completion percentage", 19 | "optionType": "number", 20 | "defaultValue": "0" 21 | }, 22 | "a-progress/showInfo": { 23 | "description": "whether to display the progress value and the status icon", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-progress/status": { 28 | "description": "to set the status of the Progress, options: normal success exception active", 29 | "optionType": "string", 30 | "defaultValue": "normal" 31 | }, 32 | "a-progress/strokeWidth (type=line)": { 33 | "description": "to set the width of the progress bar, unit: px", 34 | "optionType": "number", 35 | "defaultValue": "10" 36 | }, 37 | "a-progress/strokeWidth (type=circle)": { 38 | "description": "to set the width of the circular progress bar, unit: percentage of the canvas width", 39 | "optionType": "number", 40 | "defaultValue": "6" 41 | }, 42 | "a-progress/strokeLinecap": { 43 | "description": "to set the style of the progress linecap", 44 | "optionType": "Enum{ 'round', 'square' }", 45 | "defaultValue": "round" 46 | }, 47 | "a-progress/strokeColor": { 48 | "description": "color of progress bar", 49 | "optionType": "string", 50 | "defaultValue": "-" 51 | }, 52 | "a-progress/successPercent": { 53 | "description": "segmented success percent, works when type=\"line\"", 54 | "optionType": "number", 55 | "defaultValue": "0" 56 | }, 57 | "a-progress/type": { 58 | "description": "to set the type, options: line circle dashboard", 59 | "optionType": "string", 60 | "defaultValue": "line" 61 | }, 62 | "a-progress/width (type=circle)": { 63 | "description": "to set the canvas width of the circular progress bar, unit: px", 64 | "optionType": "number", 65 | "defaultValue": "120" 66 | } 67 | } -------------------------------------------------------------------------------- /src/config/attributes/tooltip/tooltip.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tooltip/arrowPointAtCenter": { 3 | "description": "Whether the arrow is pointed at the center of target", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-tooltip/autoAdjustOverflow": { 8 | "description": "Whether to adjust popup placement automatically when popup is off screen", 9 | "optionType": "boolean", 10 | "defaultValue": "true" 11 | }, 12 | "a-tooltip/defaultVisible": { 13 | "description": "Whether the floating tooltip card is visible by default", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-tooltip/getPopupContainer": { 18 | "description": "The DOM container of the tip, the default behavior is to create a div element in body.", 19 | "optionType": "Function(triggerNode)", 20 | "defaultValue": "() => document.body" 21 | }, 22 | "a-tooltip/mouseEnterDelay": { 23 | "description": "Delay in seconds, before tooltip is shown on mouse enter", 24 | "optionType": "number", 25 | "defaultValue": "0" 26 | }, 27 | "a-tooltip/mouseLeaveDelay": { 28 | "description": "Delay in seconds, before tooltip is hidden on mouse leave", 29 | "optionType": "number", 30 | "defaultValue": "0.1" 31 | }, 32 | "a-tooltip/overlayClassName": { 33 | "description": "Class name of the tooltip card", 34 | "optionType": "string", 35 | "defaultValue": "-" 36 | }, 37 | "a-tooltip/overlayStyle": { 38 | "description": "Style of the tooltip card", 39 | "optionType": "object", 40 | "defaultValue": "-" 41 | }, 42 | "a-tooltip/placement": { 43 | "description": "The position of the tooltip relative to the target, which can be one of top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom", 44 | "optionType": "string", 45 | "defaultValue": "top" 46 | }, 47 | "a-tooltip/trigger": { 48 | "options": ["hover", "focus", "click", "contextmenu"], 49 | "description": "Tooltip trigger mode", 50 | "optionType": "hover | focus | click | contextmenu", 51 | "defaultValue": "hover" 52 | }, 53 | "a-tooltip/visible": { 54 | "description": "Whether the floating tooltip card is visible or not", 55 | "optionType": "boolean", 56 | "defaultValue": "false" 57 | }, 58 | "a-tooltip/align": { 59 | "description": "this value will be merged into placement's config, please refer to the settings dom-align", 60 | "optionType": "Object", 61 | "defaultValue": "-" 62 | } 63 | } -------------------------------------------------------------------------------- /src/config/attributes/menu/menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-menu/defaultOpenKeys": { 3 | "description": "array with the keys of default opened sub menus", 4 | "optionType": "", 5 | "defaultValue": "" 6 | }, 7 | "a-menu/defaultSelectedKeys": { 8 | "description": "array with the keys of default selected menu items", 9 | "optionType": "string[]", 10 | "defaultValue": "" 11 | }, 12 | "a-menu/forceSubMenuRender": { 13 | "description": "render submenu into DOM before it shows", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-menu/inlineCollapsed": { 18 | "description": "specifies the collapsed status when menu is inline mode", 19 | "optionType": "boolean", 20 | "defaultValue": "-" 21 | }, 22 | "a-menu/inlineIndent": { 23 | "description": "indent px of inline menu item on each level", 24 | "optionType": "number", 25 | "defaultValue": "24" 26 | }, 27 | "a-menu/mode": { 28 | "description": "type of the menu; vertical, horizontal, and inline modes are supported", 29 | "optionType": "string: vertical | vertical-right | horizontal | inline", 30 | "defaultValue": "vertical" 31 | }, 32 | "a-menu/multiple": { 33 | "description": "Allow selection of multiple items", 34 | "optionType": "boolean", 35 | "defaultValue": "false" 36 | }, 37 | "a-menu/openKeys": { 38 | "description": "array with the keys of currently opened sub menus", 39 | "optionType": "string[]", 40 | "defaultValue": "" 41 | }, 42 | "a-menu/selectable": { 43 | "description": "allow selecting menu items", 44 | "optionType": "boolean", 45 | "defaultValue": "true" 46 | }, 47 | "a-menu/selectedKeys": { 48 | "description": "array with the keys of currently selected menu items", 49 | "optionType": "string[]", 50 | "defaultValue": "" 51 | }, 52 | "a-menu/style": { 53 | "description": "style of the root node", 54 | "optionType": "object", 55 | "defaultValue": "" 56 | }, 57 | "a-menu/subMenuCloseDelay": { 58 | "description": "delay time to hide submenu when mouse leave, unit: second", 59 | "optionType": "number", 60 | "defaultValue": "0.1" 61 | }, 62 | "a-menu/subMenuOpenDelay": { 63 | "description": "delay time to show submenu when mouse enter, unit: second", 64 | "optionType": "number", 65 | "defaultValue": "0" 66 | }, 67 | "a-menu/theme": { 68 | "options": ["light", "dark"], 69 | "description": "color theme of the menu", 70 | "optionType": "string: light dark", 71 | "defaultValue": "light" 72 | } 73 | } -------------------------------------------------------------------------------- /src/config/attributes/drawer/drawer.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-drawer/closable": { 3 | "description": "Whether a close (x) button is visible on top right of the Drawer dialog or not.", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-drawer/destroyOnClose": { 8 | "description": "Whether to unmount child components on closing drawer or not.", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-drawer/getContainer": { 13 | "description": "Return the mounted node for Drawer.", 14 | "optionType": "HTMLElement | () => HTMLElement | Selectors", 15 | "defaultValue": "'body'" 16 | }, 17 | "a-drawer/mask": { 18 | "description": "Whether to show mask or not.", 19 | "optionType": "Boolean", 20 | "defaultValue": "true" 21 | }, 22 | "a-drawer/maskClosable": { 23 | "description": "Clicking on the mask (area outside the Drawer) to close the Drawer or not.", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-drawer/maskStyle": { 28 | "description": "Style for Drawer's mask element.", 29 | "optionType": "object", 30 | "defaultValue": "{}" 31 | }, 32 | "a-drawer/title": { 33 | "description": "The title for Drawer.", 34 | "optionType": "string|slot", 35 | "defaultValue": "-" 36 | }, 37 | "a-drawer/visible": { 38 | "description": "Whether the Drawer dialog is visible or not.", 39 | "optionType": "boolean", 40 | "defaultValue": "false" 41 | }, 42 | "a-drawer/wrapClassName": { 43 | "description": "The class name of the container of the Drawer dialog.", 44 | "optionType": "string", 45 | "defaultValue": "-" 46 | }, 47 | "a-drawer/wrapStyle": { 48 | "description": "The style of the container of the Drawer dialog.", 49 | "optionType": "object", 50 | "defaultValue": "-" 51 | }, 52 | "a-drawer/width": { 53 | "description": "Width of the Drawer dialog.", 54 | "optionType": "string|number", 55 | "defaultValue": "256" 56 | }, 57 | "a-drawer/height": { 58 | "description": "placement is top or bottom, height of the Drawer dialog.", 59 | "optionType": "string|number", 60 | "defaultValue": "-" 61 | }, 62 | "a-drawer/zIndex": { 63 | "description": "The z-index of the Drawer.", 64 | "optionType": "Number", 65 | "defaultValue": "1000" 66 | }, 67 | "a-drawer/placement": { 68 | "options": ["top", "left", "bottom", "right"], 69 | "description": "The placement of the Drawer.", 70 | "optionType": "'top' | 'right' | 'bottom' | 'left'", 71 | "defaultValue": "'right'" 72 | } 73 | } -------------------------------------------------------------------------------- /src/config/attributes/autoComplete/autoComplete.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-auto-complete/allowClear": { 3 | "description": "Show clear button, effective in multiple mode only.", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-auto-complete/autoFocus": { 8 | "description": "get focus when component mounted", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-auto-complete/backfill": { 13 | "description": "backfill selected item the input when using keyboard", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-auto-complete/dataSource": { 18 | "description": "Data source for autocomplete", 19 | "optionType": "slot | DataSourceItemType[]", 20 | "defaultValue": "" 21 | }, 22 | "a-auto-complete/defaultActiveFirstOption": { 23 | "description": "Whether active first option by default", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-auto-complete/defaultValue": { 28 | "description": "Initial selected option.", 29 | "optionType": "string|string[]| -", 30 | "defaultValue": "" 31 | }, 32 | "a-auto-complete/disabled": { 33 | "description": "Whether disabled select", 34 | "optionType": "boolean", 35 | "defaultValue": "false" 36 | }, 37 | "a-auto-complete/filterOption": { 38 | "description": "If true, filter options by input, if function, filter options against it. The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded.", 39 | "optionType": "boolean or function(inputValue, option)", 40 | "defaultValue": "true" 41 | }, 42 | "a-auto-complete/optionLabelProp": { 43 | "description": "Which prop value of option will render as content of select.", 44 | "optionType": "string", 45 | "defaultValue": "children" 46 | }, 47 | "a-auto-complete/placeholder": { 48 | "description": "placeholder of input", 49 | "optionType": "string", 50 | "defaultValue": "-" 51 | }, 52 | "a-auto-complete/value": { 53 | "description": "selected option", 54 | "optionType": "string|string[]|{ key: string, label: string|vNodes }|Array<{ key: string, label: string|vNodes }>", 55 | "defaultValue": "-" 56 | }, 57 | "a-auto-complete/defaultOpen": { 58 | "description": "Initial open state of dropdown", 59 | "optionType": "boolean", 60 | "defaultValue": "-" 61 | }, 62 | "a-auto-complete/open": { 63 | "description": "Controlled open state of dropdown", 64 | "optionType": "boolean", 65 | "defaultValue": "-" 66 | } 67 | } -------------------------------------------------------------------------------- /src/config/attributes/popover/popover.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-popover/content": { 3 | "description": "Content of the card", 4 | "optionType": "string|slot|vNode", 5 | "defaultValue": "-" 6 | }, 7 | "a-popover/title": { 8 | "description": "Title of the card", 9 | "optionType": "string|slot|VNode", 10 | "defaultValue": "-" 11 | }, 12 | "a-popover/arrowPointAtCenter": { 13 | "description": "Whether the arrow is pointed at the center of target", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-popover/autoAdjustOverflow": { 18 | "description": "Whether to adjust popup placement automatically when popup is off screen", 19 | "optionType": "boolean", 20 | "defaultValue": "true" 21 | }, 22 | "a-popover/defaultVisible": { 23 | "description": "Whether the floating tooltip card is visible by default", 24 | "optionType": "boolean", 25 | "defaultValue": "false" 26 | }, 27 | "a-popover/getPopupContainer": { 28 | "description": "The DOM container of the tip, the default behavior is to create a div element in body.", 29 | "optionType": "Function(triggerNode)", 30 | "defaultValue": "() => document.body" 31 | }, 32 | "a-popover/mouseEnterDelay": { 33 | "description": "Delay in seconds, before tooltip is shown on mouse enter", 34 | "optionType": "number", 35 | "defaultValue": "0" 36 | }, 37 | "a-popover/mouseLeaveDelay": { 38 | "description": "Delay in seconds, before tooltip is hidden on mouse leave", 39 | "optionType": "number", 40 | "defaultValue": "0.1" 41 | }, 42 | "a-popover/overlayClassName": { 43 | "description": "Class name of the tooltip card", 44 | "optionType": "string", 45 | "defaultValue": "-" 46 | }, 47 | "a-popover/overlayStyle": { 48 | "description": "Style of the tooltip card", 49 | "optionType": "object", 50 | "defaultValue": "-" 51 | }, 52 | "a-popover/placement": { 53 | "description": "The position of the tooltip relative to the target, which can be one of top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom", 54 | "optionType": "string", 55 | "defaultValue": "top" 56 | }, 57 | "a-popover/trigger": { 58 | "options": ["hover", "focus", "click", "contextmenu"], 59 | "description": "Tooltip trigger mode", 60 | "optionType": "hover | focus | click | contextmenu", 61 | "defaultValue": "hover" 62 | }, 63 | "a-popover/visible": { 64 | "description": "Whether the floating tooltip card is visible or not", 65 | "optionType": "boolean", 66 | "defaultValue": "false" 67 | }, 68 | "a-popover/align": { 69 | "description": "this value will be merged into placement's config, please refer to the settings dom-align", 70 | "optionType": "Object", 71 | "defaultValue": "-" 72 | } 73 | } -------------------------------------------------------------------------------- /src/config/attributes/slider/slider.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-slider/autoFocus": { 3 | "description": "get focus when component mounted", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-slider/defaultValue": { 8 | "description": "The default value of slider. When range is false, use number, otherwise, use [number, number]", 9 | "optionType": "number|number[]", 10 | "defaultValue": "0 or [0, 0]" 11 | }, 12 | "a-slider/disabled": { 13 | "description": "If true, the slider will not be interactable.", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-slider/dots": { 18 | "description": "Whether the thumb can drag over tick only.", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-slider/included": { 23 | "description": "Make effect when marks not null,true means containment and false means coordinative", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-slider/marks": { 28 | "description": "Tick mark of Slider, type of key must be number, and must in closed interval [min, max] ,each mark can declare its own style.", 29 | "optionType": "object", 30 | "defaultValue": "{ number: string|VNode } or { number: { style: object, label: string|VNode } } or { number: () => VNode }" 31 | }, 32 | "a-slider/max": { 33 | "description": "The maximum value the slider can slide to", 34 | "optionType": "number", 35 | "defaultValue": "100" 36 | }, 37 | "a-slider/min": { 38 | "description": "The minimum value the slider can slide to.", 39 | "optionType": "number", 40 | "defaultValue": "0" 41 | }, 42 | "a-slider/range": { 43 | "description": "dual thumb mode", 44 | "optionType": "boolean", 45 | "defaultValue": "false" 46 | }, 47 | "a-slider/step": { 48 | "description": "The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When marks no null, step can be null.", 49 | "optionType": "number|null", 50 | "defaultValue": "1" 51 | }, 52 | "a-slider/tipFormatter": { 53 | "description": "Slider will pass its value to tipFormatter, and display its value in Tooltip, and hide Tooltip when return value is null.", 54 | "optionType": "Function|null", 55 | "defaultValue": "IDENTITY" 56 | }, 57 | "a-slider/value": { 58 | "description": "The value of slider. When range is false, use number, otherwise, use [number, number]", 59 | "optionType": "number|number[]", 60 | "defaultValue": "" 61 | }, 62 | "a-slider/vertical": { 63 | "description": "If true, the slider will be vertical.", 64 | "optionType": "Boolean", 65 | "defaultValue": "false" 66 | }, 67 | "a-slider/tooltipVisible": { 68 | "description": "If true, Tooltip will show always, or it will not show anyway, even if dragging or hovering.", 69 | "optionType": "Boolean", 70 | "defaultValue": "" 71 | } 72 | } -------------------------------------------------------------------------------- /src/config/attributes/transfer/transfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-transfer/dataSource": { 3 | "description": "Used for setting the source data. The elements that are part of this array will be present the left column. Except the elements whose keys are included in targetKeys prop.", 4 | "optionType": "[{key: string.isRequired,title: string.isRequired,description: string,disabled: bool}]", 5 | "defaultValue": "[]" 6 | }, 7 | "a-transfer/disabled": { 8 | "description": "Whether disabled transfer", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-transfer/filterOption": { 13 | "description": "A function to determine whether an item should show in search result list", 14 | "optionType": "(inputValue, option): boolean", 15 | "defaultValue": "" 16 | }, 17 | "a-transfer/footer": { 18 | "description": "customize the progress dot by setting a scoped slot", 19 | "optionType": "slot=\"footer\" slot-scope=\"props\"", 20 | "defaultValue": "" 21 | }, 22 | "a-transfer/lazy": { 23 | "description": "property of vc-lazy-load for lazy rendering items. Turn off it by set to false.", 24 | "optionType": "object|boolean", 25 | "defaultValue": "{ height: 32, offset: 32 }" 26 | }, 27 | "a-transfer/listStyle": { 28 | "description": "A custom CSS style used for rendering the transfer columns.", 29 | "optionType": "object", 30 | "defaultValue": "" 31 | }, 32 | "a-transfer/locale": { 33 | "description": "i18n text including filter, empty text, item unit, etc", 34 | "optionType": "object", 35 | "defaultValue": "{ itemUnit: 'item', itemsUnit: 'items', notFoundContent: 'The list is empty', searchPlaceholder: 'Search here' }" 36 | }, 37 | "a-transfer/operations": { 38 | "description": "A set of operations that are sorted from top to bottom.", 39 | "optionType": "string[]", 40 | "defaultValue": "['>', '<']" 41 | }, 42 | "a-transfer/render": { 43 | "description": "The function to generate the item shown on a column. Based on an record (element of the dataSource array), this function should return a element which is generated from that record. Also, it can return a plain object with value and label, label is a element and value is for title", 44 | "optionType": "Function(record)", 45 | "defaultValue": "" 46 | }, 47 | "a-transfer/selectedKeys": { 48 | "description": "A set of keys of selected items.", 49 | "optionType": "string[]", 50 | "defaultValue": "[]" 51 | }, 52 | "a-transfer/showSearch": { 53 | "description": "If included, a search box is shown on each column.", 54 | "optionType": "boolean", 55 | "defaultValue": "false" 56 | }, 57 | "a-transfer/targetKeys": { 58 | "description": "A set of keys of elements that are listed on the right column.", 59 | "optionType": "string[]", 60 | "defaultValue": "[]" 61 | }, 62 | "a-transfer/titles": { 63 | "description": "A set of titles that are sorted from left to right.", 64 | "optionType": "string[]", 65 | "defaultValue": "-" 66 | } 67 | } -------------------------------------------------------------------------------- /src/config/attributes/date-picker/week.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-week-picker/allowClear": { 3 | "description": "Whether to show clear button", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-week-picker/autoFocus": { 8 | "description": "get focus when component mounted", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-week-picker/dateRender": { 13 | "description": "custom rendering function for date cells by setting a scoped slot", 14 | "optionType": "slot=\"dateRender\" slot-scope=\"current, today\"", 15 | "defaultValue": "-" 16 | }, 17 | "a-week-picker/disabled": { 18 | "description": "determine whether the DatePicker is disabled", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-week-picker/disabledDate": { 23 | "description": "specify the date that cannot be selected", 24 | "optionType": "(currentDate: moment) => boolean", 25 | "defaultValue": "-" 26 | }, 27 | "a-week-picker/getCalendarContainer": { 28 | "description": "to set the container of the floating layer, while the default is to create a div element in body", 29 | "optionType": "function(trigger)", 30 | "defaultValue": "-" 31 | }, 32 | "a-week-picker/locale": { 33 | "description": "localization configuration", 34 | "optionType": "object", 35 | "defaultValue": "default" 36 | }, 37 | "a-week-picker/open": { 38 | "description": "open state of picker", 39 | "optionType": "boolean", 40 | "defaultValue": "-" 41 | }, 42 | "a-week-picker/placeholder": { 43 | "description": "placeholder of date input", 44 | "optionType": "string|RangePicker[]", 45 | "defaultValue": "-" 46 | }, 47 | "a-week-picker/popupStyle": { 48 | "description": "to customize the style of the popup calendar", 49 | "optionType": "object", 50 | "defaultValue": "{}" 51 | }, 52 | "a-week-picker/dropdownClassName": { 53 | "description": "to customize the className of the popup calendar", 54 | "optionType": "string", 55 | "defaultValue": "-" 56 | }, 57 | "a-week-picker/size": { 58 | "description": "determine the size of the input box, the height of large and small, are 40px and 24px respectively, while default size is 32px", 59 | "optionType": "string", 60 | "defaultValue": "-" 61 | }, 62 | "a-week-picker/suffixIcon": { 63 | "description": "The custom suffix icon", 64 | "optionType": "VNode | slot", 65 | "defaultValue": "-" 66 | }, 67 | "a-week-picker/defaultValue": { 68 | "description": "to set default date", 69 | "optionType": "moment", 70 | "defaultValue": "-" 71 | }, 72 | "a-week-picker/defaultPickerValue": { 73 | "description": "to set default picker date", 74 | "optionType": "moment", 75 | "defaultValue": "-" 76 | }, 77 | "a-week-picker/format": { 78 | "description": "to set the date format, refer to moment.js", 79 | "optionType": "string", 80 | "defaultValue": "\"YYYY-wo\"" 81 | }, 82 | "a-week-picker/value": { 83 | "description": "to set date", 84 | "optionType": "moment", 85 | "defaultValue": "-" 86 | } 87 | } -------------------------------------------------------------------------------- /snippets/antdv.json: -------------------------------------------------------------------------------- 1 | { 2 | "message-success": { 3 | "prefix": "message-success", 4 | "body": [ 5 | "this.\\$message.success('${2:content}', '${3:[duration]}',", 6 | "\t() => {}", 7 | ");" 8 | ], 9 | "description": "message success" 10 | }, 11 | "message-error": { 12 | "prefix": "message-error", 13 | "body": [ 14 | "this.\\$message.error('${2:content}', '${3:[duration]}',", 15 | "\t() => {}", 16 | ");" 17 | ], 18 | "description": "message error" 19 | }, 20 | "message-info": { 21 | "prefix": "message-info", 22 | "body": [ 23 | "this.\\$message.info('${2:content}', '${3:[duration]}',", 24 | "\t() => {}", 25 | ");" 26 | ], 27 | "description": "message info" 28 | }, 29 | "message-warning": { 30 | "prefix": "message-warning", 31 | "body": [ 32 | "this.\\$message.warning('${2:content}', '${3:[duration]}',", 33 | "\t() => {}", 34 | ");" 35 | ], 36 | "description": "message warning" 37 | }, 38 | "message-warn": { 39 | "prefix": "message-warn", 40 | "body": [ 41 | "this.\\$message.warn('${2:content}', '${3:[duration]}',", 42 | "\t() => {}", 43 | ");" 44 | ], 45 | "description": "message alias of warning" 46 | }, 47 | "message-loading": { 48 | "prefix": "message-loading", 49 | "body": [ 50 | "this.\\$message.loading('${2:content}', '${3:[duration]}',", 51 | "\t() => {}", 52 | ");" 53 | ], 54 | "description": "message loading" 55 | }, 56 | "notification": { 57 | "prefix": "notification", 58 | "body": [ 59 | "this.\\$notification['${1:[type]}']({", 60 | "\tmessage: '${2:message}',", 61 | "\tdescription: '${3:string|VNode|function(h)}'", 62 | "});" 63 | ], 64 | "description": "notification" 65 | }, 66 | "modal-success": { 67 | "prefix": "modal-success", 68 | "body": [ 69 | "this.\\$success({", 70 | "\ttitle: '${1:string|vNode}',", 71 | "\tcontent: '${2:string|vNode}'", 72 | "});" 73 | ], 74 | "description": "modal success" 75 | }, 76 | "modal-info": { 77 | "prefix": "modal-info", 78 | "body": [ 79 | "this.\\$info({", 80 | "\ttitle: '${1:string|vNode}',", 81 | "\tcontent: '${2:string|vNode}'", 82 | "});" 83 | ], 84 | "description": "modal info" 85 | }, 86 | "modal-error": { 87 | "prefix": "modal-error", 88 | "body": [ 89 | "this.\\$error({", 90 | "\ttitle: '${1:string|vNode}',", 91 | "\tcontent: '${2:string|vNode}'", 92 | "});" 93 | ], 94 | "description": "modal error" 95 | }, 96 | "modal-warning": { 97 | "prefix": "modal-warning", 98 | "body": [ 99 | "this.\\$warning({", 100 | "\ttitle: '${1:string|vNode}',", 101 | "\tcontent: '${2:string|vNode}'", 102 | "});" 103 | ], 104 | "description": "modal warning" 105 | }, 106 | "modal-confirm": { 107 | "prefix": "modal-confirm", 108 | "body": [ 109 | "this.\\$confirm({", 110 | "\ttitle: '${1:string|vNode}',", 111 | "\tcontent: '${2:string|vNode}',", 112 | "\tokText: '${3:string}',", 113 | "\tcancelText: '${4:string}',", 114 | "\tonCancel: () => {},", 115 | "\tonOk: () => {}", 116 | "});" 117 | ], 118 | "description": "modal confirm" 119 | } 120 | } -------------------------------------------------------------------------------- /src/config/attributes/date-picker/month.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-month-picker/allowClear": { 3 | "description": "Whether to show clear button", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-month-picker/autoFocus": { 8 | "description": "get focus when component mounted", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-month-picker/dateRender": { 13 | "description": "custom rendering function for date cells by setting a scoped slot", 14 | "optionType": "slot=\"dateRender\" slot-scope=\"current, today\"", 15 | "defaultValue": "-" 16 | }, 17 | "a-month-picker/disabled": { 18 | "description": "determine whether the DatePicker is disabled", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-month-picker/disabledDate": { 23 | "description": "specify the date that cannot be selected", 24 | "optionType": "(currentDate: moment) => boolean", 25 | "defaultValue": "-" 26 | }, 27 | "a-month-picker/getCalendarContainer": { 28 | "description": "to set the container of the floating layer, while the default is to create a div element in body", 29 | "optionType": "function(trigger)", 30 | "defaultValue": "-" 31 | }, 32 | "a-month-picker/locale": { 33 | "description": "localization configuration", 34 | "optionType": "object", 35 | "defaultValue": "default" 36 | }, 37 | "a-month-picker/open": { 38 | "description": "open state of picker", 39 | "optionType": "boolean", 40 | "defaultValue": "-" 41 | }, 42 | "a-month-picker/placeholder": { 43 | "description": "placeholder of date input", 44 | "optionType": "string|RangePicker[]", 45 | "defaultValue": "-" 46 | }, 47 | "a-month-picker/popupStyle": { 48 | "description": "to customize the style of the popup calendar", 49 | "optionType": "object", 50 | "defaultValue": "{}" 51 | }, 52 | "a-month-picker/dropdownClassName": { 53 | "description": "to customize the className of the popup calendar", 54 | "optionType": "string", 55 | "defaultValue": "-" 56 | }, 57 | "a-month-picker/size": { 58 | "description": "determine the size of the input box, the height of large and small, are 40px and 24px respectively, while default size is 32px", 59 | "optionType": "string", 60 | "defaultValue": "-" 61 | }, 62 | "a-month-picker/suffixIcon": { 63 | "description": "The custom suffix icon", 64 | "optionType": "VNode | slot", 65 | "defaultValue": "-" 66 | }, 67 | "a-month-picker/defaultValue": { 68 | "description": "to set default date", 69 | "optionType": "moment", 70 | "defaultValue": "-" 71 | }, 72 | "a-month-picker/defaultPickerValue": { 73 | "description": "to set default picker date", 74 | "optionType": "moment", 75 | "defaultValue": "-" 76 | }, 77 | "a-month-picker/format": { 78 | "description": "to set the date format. When an array is provided, all values are used for parsing and first value for display. refer to moment.js", 79 | "optionType": "string | string[]", 80 | "defaultValue": "\"YYYY-MM\"" 81 | }, 82 | "a-month-picker/monthCellContentRender": { 83 | "description": "Custom month cell content render method by setting a scoped slot", 84 | "optionType": "slot=\"monthCellContentRender\" slot-scope=\"date, locale\"", 85 | "defaultValue": "-" 86 | }, 87 | "a-month-picker/renderExtraFooter": { 88 | "description": "render extra footer in panel by setting a scoped slot", 89 | "optionType": "slot=\"renderExtraFooter\"", 90 | "defaultValue": "-" 91 | }, 92 | "a-month-picker/value": { 93 | "description": "to set date", 94 | "optionType": "moment", 95 | "defaultValue": "-" 96 | } 97 | } -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // The module 'vscode' contains the VS Code extensibility API 4 | // Import the module and reference it with the alias vscode in your code below 5 | import * as vscode from 'vscode'; 6 | import {App, AntdvDocsContentProvider, AntdvCompletionItemProvider } from './app'; 7 | 8 | import COMPONENTS from './config/components.js'; 9 | 10 | const components = [] 11 | Object.keys(COMPONENTS).forEach(item => { 12 | components.push({ 13 | ...COMPONENTS[item], 14 | path: item, 15 | }) 16 | }) 17 | 18 | // this method is called when your extension is activated 19 | // your extension is activated the very first time the command is executed 20 | export function activate(context: vscode.ExtensionContext) { 21 | // Use the console to output diagnostic information (console.log) and errors (console.error) 22 | // This line of code will only be executed once when your extension is activated 23 | console.log('Congratulations, your extension "vscode-ant-design-vue-helper" is now active!'); 24 | let app = new App(); 25 | app.setConfig(); 26 | let docs = new AntdvDocsContentProvider(); 27 | let completionItemProvider = new AntdvCompletionItemProvider(); 28 | let registration = vscode.workspace.registerTextDocumentContentProvider('antdv-helper', docs); 29 | 30 | let completion = vscode.languages.registerCompletionItemProvider([{ 31 | language: 'vue', scheme: 'file' 32 | }, { 33 | language: 'html', scheme: 'file' 34 | }], completionItemProvider, '', ' ', ':', '<', '"', "'", '/', '@', '('); 35 | let vueLanguageConfig = vscode.languages.setLanguageConfiguration('vue', {wordPattern: app.WORD_REG}); 36 | 37 | // The command has been defined in the package.json file 38 | // Now provide the implementation of the command with registerCommand 39 | // The commandId parameter must match the command field in package.json 40 | let disposable = vscode.commands.registerCommand('antdv-helper.search', () => { 41 | // if (context.workspaceState.get('antdv-helper.loading', false)) { 42 | // vscode.window.showInformationMessage('Document is initializing, please wait a minute depend on your network.'); 43 | // return; 44 | // } 45 | 46 | switch(vscode.window.activeTextEditor.document.languageId) { 47 | case 'vue': 48 | case 'html': 49 | break; 50 | default: 51 | return; 52 | } 53 | 54 | const selection = app.getSeletedText(); 55 | let items = components.map(item => { 56 | return { 57 | label: item.tag, 58 | detail: item.title.toLocaleLowerCase() + ' ' + item.subtitle, 59 | path: item.path, 60 | description: item.type 61 | }; 62 | }); 63 | 64 | if (items.length < 1) { 65 | vscode.window.showInformationMessage('Initializing。。。, please try again.'); 66 | return; 67 | } 68 | 69 | let find = items.filter(item => item.label === selection); 70 | 71 | if (find.length) { 72 | app.openDocs(find[0], find[0].label); 73 | return; 74 | } 75 | 76 | // cant set default value for this method? angry. 77 | vscode.window.showQuickPick(items).then(selected => { 78 | selected && app.openDocs(selected, selected.label); 79 | }) 80 | }); 81 | 82 | context.subscriptions.push(app, disposable, registration, completion, vueLanguageConfig); 83 | } 84 | 85 | // this method is called when your extension is deactivated 86 | export function deactivate() {} 87 | -------------------------------------------------------------------------------- /src/config/attributes/modal/modal.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-modal/afterClose": { 3 | "description": "Specify a function that will be called when modal is closed completely.", 4 | "optionType": "function", 5 | "defaultValue": "-" 6 | }, 7 | "a-modal/bodyStyle": { 8 | "description": "Body style for modal body element. Such as height, padding etc.", 9 | "optionType": "object", 10 | "defaultValue": "{}" 11 | }, 12 | "a-modal/cancelText": { 13 | "description": "Text of the Cancel button", 14 | "optionType": "string|slot", 15 | "defaultValue": "Cancel" 16 | }, 17 | "a-modal/centered": { 18 | "description": "Centered Modal", 19 | "optionType": "Boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-modal/closable": { 23 | "description": "Whether a close (x) button is visible on top right of the modal dialog or not", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-modal/confirmLoading": { 28 | "description": "Whether to apply loading visual effect for OK button or not", 29 | "optionType": "boolean", 30 | "defaultValue": "false" 31 | }, 32 | "a-modal/destroyOnClose": { 33 | "description": "Whether to unmount child components on onClose", 34 | "optionType": "boolean", 35 | "defaultValue": "false" 36 | }, 37 | "a-modal/footer": { 38 | "description": "Footer content, set as :footer=\"null\" when you don't need default buttons", 39 | "optionType": "string|slot", 40 | "defaultValue": "OK and Cancel buttons" 41 | }, 42 | "a-modal/getContainer": { 43 | "description": "Return the mount node for Modal", 44 | "optionType": "(instance): HTMLElement", 45 | "defaultValue": "() => document.body" 46 | }, 47 | "a-modal/mask": { 48 | "description": "Whether show mask or not.", 49 | "optionType": "Boolean", 50 | "defaultValue": "true" 51 | }, 52 | "a-modal/maskClosable": { 53 | "description": "Whether to close the modal dialog when the mask (area outside the modal) is clicked", 54 | "optionType": "boolean", 55 | "defaultValue": "true" 56 | }, 57 | "a-modal/maskStyle": { 58 | "description": "Style for modal's mask element.", 59 | "optionType": "object", 60 | "defaultValue": "{}" 61 | }, 62 | "a-modal/okText": { 63 | "description": "Text of the OK button", 64 | "optionType": "string|slot", 65 | "defaultValue": "OK" 66 | }, 67 | "a-modal/okType": { 68 | "description": "Button type of the OK button", 69 | "optionType": "string", 70 | "defaultValue": "primary" 71 | }, 72 | "a-modal/okButtonProps": { 73 | "description": "The ok button props, follow jsx rules", 74 | "optionType": "{props: ButtonProps, on: {}}", 75 | "defaultValue": "-" 76 | }, 77 | "a-modal/cancelButtonProps": { 78 | "description": "The cancel button props, follow jsx rules", 79 | "optionType": "{props: ButtonProps, on: {}}", 80 | "defaultValue": "-" 81 | }, 82 | "a-modal/title": { 83 | "description": "The modal dialog's title", 84 | "optionType": "string|slot", 85 | "defaultValue": "-" 86 | }, 87 | "a-modal/visible": { 88 | "description": "Whether the modal dialog is visible or not", 89 | "optionType": "boolean", 90 | "defaultValue": "false" 91 | }, 92 | "a-modal/width": { 93 | "description": "Width of the modal dialog", 94 | "optionType": "string|number", 95 | "defaultValue": "520" 96 | }, 97 | "a-modal/wrapClassName": { 98 | "description": "The class name of the container of the modal dialog", 99 | "optionType": "string", 100 | "defaultValue": "-" 101 | }, 102 | "a-modal/zIndex": { 103 | "description": "The z-index of the Modal", 104 | "optionType": "Number", 105 | "defaultValue": "1000" 106 | } 107 | } -------------------------------------------------------------------------------- /src/config/attributes/upload/upload.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-upload/accept": { 3 | "description": "File types that can be accepted. See input accept Attribute", 4 | "optionType": "string", 5 | "defaultValue": "-" 6 | }, 7 | "a-upload/action": { 8 | "description": "Uploading URL", 9 | "optionType": "string|(file) => Promise", 10 | "defaultValue": "-" 11 | }, 12 | "a-upload/directory": { 13 | "description": "support upload whole directory (caniuse)", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-upload/beforeUpload": { 18 | "description": "Hook function which will be executed before uploading. Uploading will be stopped with false or a rejected Promise returned. Warning:this function is not supported in IE9。", 19 | "optionType": "(file, fileList) => boolean | Promise", 20 | "defaultValue": "-" 21 | }, 22 | "a-upload/customRequest": { 23 | "description": "override for the default xhr behavior allowing for additional customization and ability to implement your own XMLHttpRequest", 24 | "optionType": "Function", 25 | "defaultValue": "-" 26 | }, 27 | "a-upload/data": { 28 | "description": "Uploading params or function which can return uploading params.", 29 | "optionType": "object|function(file)", 30 | "defaultValue": "-" 31 | }, 32 | "a-upload/defaultFileList": { 33 | "description": "Default list of files that have been uploaded.", 34 | "optionType": "object[]", 35 | "defaultValue": "-" 36 | }, 37 | "a-upload/disabled": { 38 | "description": "disable upload button", 39 | "optionType": "boolean", 40 | "defaultValue": "false" 41 | }, 42 | "a-upload/fileList": { 43 | "description": "List of files that have been uploaded (controlled). Here is a common issue #2423 when using it", 44 | "optionType": "object[]", 45 | "defaultValue": "-" 46 | }, 47 | "a-upload/headers": { 48 | "description": "Set request headers, valid above IE10.", 49 | "optionType": "object", 50 | "defaultValue": "-" 51 | }, 52 | "a-upload/listType": { 53 | "description": "Built-in stylesheets, support for three types: text, picture or picture-card", 54 | "optionType": "string", 55 | "defaultValue": "'text'" 56 | }, 57 | "a-upload/multiple": { 58 | "description": "Whether to support selected multiple file. IE10+ supported. You can select multiple files with CTRL holding down while multiple is set to be true", 59 | "optionType": "boolean", 60 | "defaultValue": "false" 61 | }, 62 | "a-upload/name": { 63 | "description": "The name of uploading file", 64 | "optionType": "string", 65 | "defaultValue": "'file'" 66 | }, 67 | "a-upload/showUploadList": { 68 | "description": "Whether to show default upload list, could be an object to specify showPreviewIcon and showRemoveIcon individually", 69 | "optionType": "Boolean or { showPreviewIcon?: boolean, showRemoveIcon?: boolean }", 70 | "defaultValue": "true" 71 | }, 72 | "a-upload/supportServerRender": { 73 | "description": "Need to be turned on while the server side is rendering.", 74 | "optionType": "boolean", 75 | "defaultValue": "false" 76 | }, 77 | "a-upload/withCredentials": { 78 | "description": "ajax upload with cookie sent", 79 | "optionType": "boolean", 80 | "defaultValue": "false" 81 | }, 82 | "a-upload/openFileDialogOnClick": { 83 | "description": "click open file dialog", 84 | "optionType": "boolean", 85 | "defaultValue": "true" 86 | }, 87 | "a-upload/remove": { 88 | "description": "A callback function, will be executed when removing file button is clicked, remove event will be prevented when return value is false or a Promise which resolve(false) or reject.", 89 | "optionType": "Function(file): boolean | Promise", 90 | "defaultValue": "-" 91 | } 92 | } -------------------------------------------------------------------------------- /src/config/attributes/cascader/cascader.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-cascader/allowClear": { 3 | "description": "whether allow clear", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-cascader/autoFocus": { 8 | "description": "get focus when component mounted", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-cascader/changeOnSelect": { 13 | "description": "change value on each selection if set to true, see above demo for details", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-cascader/defaultValue": { 18 | "description": "initial selected value", 19 | "optionType": "string[]", 20 | "defaultValue": "[]" 21 | }, 22 | "a-cascader/disabled": { 23 | "description": "whether disabled select", 24 | "optionType": "boolean", 25 | "defaultValue": "false" 26 | }, 27 | "a-cascader/displayRender": { 28 | "description": "render function of displaying selected options, you can use slot=\"displayRender\" and slot-scope=\"{labels, selectedOptions}\"", 29 | "optionType": "({labels, selectedOptions}) => vNode", 30 | "defaultValue": "labels => labels.join(' / ')" 31 | }, 32 | "a-cascader/expandTrigger": { 33 | "description": "expand current item when click or hover, one of 'click' 'hover'", 34 | "optionType": "string", 35 | "defaultValue": "'click'" 36 | }, 37 | "a-cascader/fieldNames": { 38 | "description": "custom field name for label and value and children", 39 | "optionType": "object", 40 | "defaultValue": "{ label: 'label', value: 'value', children: 'children' }" 41 | }, 42 | "a-cascader/getPopupContainer": { 43 | "description": "Parent Node which the selector should be rendered to. Default to body. When position issues happen, try to modify it into scrollable content and position it relative.", 44 | "optionType": "Function(triggerNode)", 45 | "defaultValue": "() => document.body" 46 | }, 47 | "a-cascader/loadData": { 48 | "description": "To load option lazily, and it cannot work with showSearch", 49 | "optionType": "(selectedOptions) => void", 50 | "defaultValue": "-" 51 | }, 52 | "a-cascader/notFoundContent": { 53 | "description": "Specify content to show when no result matches.", 54 | "optionType": "string", 55 | "defaultValue": "'Not Found'" 56 | }, 57 | "a-cascader/options": { 58 | "description": "data options of cascade", 59 | "optionType": "object", 60 | "defaultValue": "-" 61 | }, 62 | "a-cascader/placeholder": { 63 | "description": "input placeholder", 64 | "optionType": "string", 65 | "defaultValue": "'Please select'" 66 | }, 67 | "a-cascader/popupClassName": { 68 | "description": "additional className of popup overlay", 69 | "optionType": "string", 70 | "defaultValue": "-" 71 | }, 72 | "a-cascader/popupStyle": { 73 | "description": "additional style of popup overlay", 74 | "optionType": "object", 75 | "defaultValue": "{}" 76 | }, 77 | "a-cascader/popupPlacement": { 78 | "description": "use preset popup align config from builtinPlacements:bottomLeft bottomRight topLeft topRight", 79 | "optionType": "string", 80 | "defaultValue": "bottomLeft" 81 | }, 82 | "a-cascader/popupVisible": { 83 | "description": "set visible of cascader popup", 84 | "optionType": "boolean", 85 | "defaultValue": "-" 86 | }, 87 | "a-cascader/showSearch": { 88 | "description": "Whether show search input in single mode.", 89 | "optionType": "boolean|object", 90 | "defaultValue": "false" 91 | }, 92 | "a-cascader/size": { 93 | "description": "input size, one of large default small", 94 | "optionType": "string", 95 | "defaultValue": "default" 96 | }, 97 | "a-cascader/suffixIcon": { 98 | "description": "The custom suffix icon", 99 | "optionType": "string | VNode | slot", 100 | "defaultValue": "-" 101 | }, 102 | "a-cascader/value": { 103 | "description": "selected value", 104 | "optionType": "string[]", 105 | "defaultValue": "-" 106 | } 107 | } -------------------------------------------------------------------------------- /src/config/attributes/timePicker/timePicker.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-time-picker/addon": { 3 | "description": "some addon to timepicker panel bottom", 4 | "optionType": "slot | slot-scope", 5 | "defaultValue": "-" 6 | }, 7 | "a-time-picker/allowEmpty": { 8 | "description": "allow clearing text", 9 | "optionType": "boolean", 10 | "defaultValue": "true" 11 | }, 12 | "a-time-picker/autoFocus": { 13 | "description": "get focus when component mounted", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-time-picker/clearText": { 18 | "description": "clear tooltip of icon", 19 | "optionType": "string", 20 | "defaultValue": "clear" 21 | }, 22 | "a-time-picker/defaultOpenValue": { 23 | "description": "default open panel value, used to set utcOffset,locale if value/defaultValue absent", 24 | "optionType": "moment", 25 | "defaultValue": "moment()" 26 | }, 27 | "a-time-picker/defaultValue": { 28 | "description": "to set default time", 29 | "optionType": "moment", 30 | "defaultValue": "-" 31 | }, 32 | "a-time-picker/disabled": { 33 | "description": "determine whether the TimePicker is disabled", 34 | "optionType": "boolean", 35 | "defaultValue": "false" 36 | }, 37 | "a-time-picker/disabledHours": { 38 | "description": "to specify the hours that cannot be selected", 39 | "optionType": "function()", 40 | "defaultValue": "-" 41 | }, 42 | "a-time-picker/disabledMinutes": { 43 | "description": "to specify the minutes that cannot be selected", 44 | "optionType": "function(selectedHour)", 45 | "defaultValue": "-" 46 | }, 47 | "a-time-picker/disabledSeconds": { 48 | "description": "to specify the seconds that cannot be selected", 49 | "optionType": "function(selectedHour, selectedMinute)", 50 | "defaultValue": "-" 51 | }, 52 | "a-time-picker/format": { 53 | "description": "to set the time format", 54 | "optionType": "string", 55 | "defaultValue": "\"HH:mm:ss\"" 56 | }, 57 | "a-time-picker/getPopupContainer": { 58 | "description": "to set the container of the floating layer, while the default is to create a div element in body", 59 | "optionType": "function(trigger)", 60 | "defaultValue": "-" 61 | }, 62 | "a-time-picker/hideDisabledOptions": { 63 | "description": "hide the options that can not be selected", 64 | "optionType": "boolean", 65 | "defaultValue": "false" 66 | }, 67 | "a-time-picker/hourStep": { 68 | "description": "interval between hours in picker", 69 | "optionType": "number", 70 | "defaultValue": "1" 71 | }, 72 | "a-time-picker/inputReadOnly": { 73 | "description": "Set the readonly attribute of the input tag (avoids virtual keyboard on touch devices)", 74 | "optionType": "boolean", 75 | "defaultValue": "false" 76 | }, 77 | "a-time-picker/minuteStep": { 78 | "description": "interval between minutes in picker", 79 | "optionType": "number", 80 | "defaultValue": "1" 81 | }, 82 | "a-time-picker/open": { 83 | "description": "whether to popup panel", 84 | "optionType": "boolean", 85 | "defaultValue": "false" 86 | }, 87 | "a-time-picker/placeholder": { 88 | "description": "display when there's no value", 89 | "optionType": "string", 90 | "defaultValue": "\"Select a time\"" 91 | }, 92 | "a-time-picker/popupClassName": { 93 | "description": "className of panel", 94 | "optionType": "string", 95 | "defaultValue": "''" 96 | }, 97 | "a-time-picker/secondStep": { 98 | "description": "interval between seconds in picker", 99 | "optionType": "number", 100 | "defaultValue": "1" 101 | }, 102 | "a-time-picker/suffixIcon": { 103 | "description": "The custom suffix icon", 104 | "optionType": "string | VNode | slot", 105 | "defaultValue": "-" 106 | }, 107 | "a-time-picker/use12Hours": { 108 | "description": "display as 12 hours format, with default format h:mm:ss a", 109 | "optionType": "boolean", 110 | "defaultValue": "false" 111 | }, 112 | "a-time-picker/value": { 113 | "description": "to set time", 114 | "optionType": "moment", 115 | "defaultValue": "-" 116 | } 117 | } -------------------------------------------------------------------------------- /src/config/attributes/date-picker/range.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-range-picker/allowClear": { 3 | "description": "Whether to show clear button", 4 | "optionType": "boolean", 5 | "defaultValue": "true" 6 | }, 7 | "a-range-picker/autoFocus": { 8 | "description": "get focus when component mounted", 9 | "optionType": "boolean", 10 | "defaultValue": "false" 11 | }, 12 | "a-range-picker/dateRender": { 13 | "description": "custom rendering function for date cells by setting a scoped slot", 14 | "optionType": "slot=\"dateRender\" slot-scope=\"current, today\"", 15 | "defaultValue": "-" 16 | }, 17 | "a-range-picker/disabled": { 18 | "description": "determine whether the DatePicker is disabled", 19 | "optionType": "boolean", 20 | "defaultValue": "false" 21 | }, 22 | "a-range-picker/disabledDate": { 23 | "description": "specify the date that cannot be selected", 24 | "optionType": "(currentDate: moment) => boolean", 25 | "defaultValue": "-" 26 | }, 27 | "a-range-picker/getCalendarContainer": { 28 | "description": "to set the container of the floating layer, while the default is to create a div element in body", 29 | "optionType": "function(trigger)", 30 | "defaultValue": "-" 31 | }, 32 | "a-range-picker/locale": { 33 | "description": "localization configuration", 34 | "optionType": "object", 35 | "defaultValue": "default" 36 | }, 37 | "a-range-picker/open": { 38 | "description": "open state of picker", 39 | "optionType": "boolean", 40 | "defaultValue": "-" 41 | }, 42 | "a-range-picker/placeholder": { 43 | "description": "placeholder of date input", 44 | "optionType": "string|RangePicker[]", 45 | "defaultValue": "-" 46 | }, 47 | "a-range-picker/popupStyle": { 48 | "description": "to customize the style of the popup calendar", 49 | "optionType": "object", 50 | "defaultValue": "{}" 51 | }, 52 | "a-range-picker/dropdownClassName": { 53 | "description": "to customize the className of the popup calendar", 54 | "optionType": "string", 55 | "defaultValue": "-" 56 | }, 57 | "a-range-picker/size": { 58 | "description": "determine the size of the input box, the height of large and small, are 40px and 24px respectively, while default size is 32px", 59 | "optionType": "string", 60 | "defaultValue": "-" 61 | }, 62 | "a-range-picker/suffixIcon": { 63 | "description": "The custom suffix icon", 64 | "optionType": "VNode | slot", 65 | "defaultValue": "-" 66 | }, 67 | "a-range-picker/defaultValue": { 68 | "description": "to set default date", 69 | "optionType": "moment[]", 70 | "defaultValue": "-" 71 | }, 72 | "a-range-picker/defaultPickerValue": { 73 | "description": "to set default picker date", 74 | "optionType": "moment[]", 75 | "defaultValue": "-" 76 | }, 77 | "a-range-picker/disabledTime": { 78 | "description": "to specify the time that cannot be selected", 79 | "optionType": "function(dates: [moment, moment], partial: 'start'|'end')", 80 | "defaultValue": "-" 81 | }, 82 | "a-range-picker/format": { 83 | "description": "to set the date format", 84 | "optionType": "string", 85 | "defaultValue": "\"YYYY-MM-DD HH:mm:ss\"" 86 | }, 87 | "a-range-picker/ranges": { 88 | "description": "preseted ranges for quick selection", 89 | "optionType": "{ [range: string]: moment[] } | { [range: string]: () => moment[] }", 90 | "defaultValue": "-" 91 | }, 92 | "a-range-picker/renderExtraFooter": { 93 | "description": "render extra footer in panel by setting a scoped slot", 94 | "optionType": "slot=\"renderExtraFooter\"", 95 | "defaultValue": "-" 96 | }, 97 | "a-range-picker/showTime": { 98 | "description": "to provide an additional time selection", 99 | "optionType": "object|boolean", 100 | "defaultValue": "TimePicker Options" 101 | }, 102 | "a-range-picker/showTime.defaultValue": { 103 | "description": "to set default time of selected date, demo", 104 | "optionType": "moment[]", 105 | "defaultValue": "[moment(), moment()]" 106 | }, 107 | "a-range-picker/value": { 108 | "description": "to set date", 109 | "optionType": "[moment, moment]", 110 | "defaultValue": "-" 111 | } 112 | } -------------------------------------------------------------------------------- /src/config/attributes/tree/tree.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tree/treeData": { 3 | "description": "treeNode of tree, please use treeNodes before v1.1.4", 4 | "optionType": "array", 5 | "defaultValue": "-" 6 | }, 7 | "a-tree/autoExpandParent": { 8 | "description": "Whether to automatically expand a parent treeNode", 9 | "optionType": "boolean", 10 | "defaultValue": "true" 11 | }, 12 | "a-tree/checkable": { 13 | "description": "Adds a Checkbox before the treeNodes", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-tree/checkedKeys": { 18 | "description": "(Controlled) Specifies the keys of the checked treeNodes (PS: When this specifies the key of a treeNode which is also a parent treeNode, all the children treeNodes of will be checked; and vice versa, when it specifies the key of a treeNode which is a child treeNode, its parent treeNode will also be checked. When checkable and checkStrictly is true, its object has checked and halfChecked property. Regardless of whether the child or parent treeNode is checked, they won't impact each other.", 19 | "optionType": "string[] | number[] | {checked: string[] | number[], halfChecked: string[] | number[]}", 20 | "defaultValue": "[]" 21 | }, 22 | "a-tree/checkStrictly": { 23 | "description": "Check treeNode precisely; parent treeNode and children treeNodes are not associated", 24 | "optionType": "boolean", 25 | "defaultValue": "false" 26 | }, 27 | "a-tree/defaultCheckedKeys": { 28 | "description": "Specifies the keys of the default checked treeNodes", 29 | "optionType": "string[] | number[]", 30 | "defaultValue": "[]" 31 | }, 32 | "a-tree/defaultExpandAll": { 33 | "description": "Whether to expand all treeNodes by default", 34 | "optionType": "boolean", 35 | "defaultValue": "false" 36 | }, 37 | "a-tree/defaultExpandedKeys": { 38 | "description": "Specify the keys of the default expanded treeNodes", 39 | "optionType": "string[] | number[]", 40 | "defaultValue": "[]" 41 | }, 42 | "a-tree/defaultExpandParent": { 43 | "description": "auto expand parent treeNodes when init", 44 | "optionType": "bool", 45 | "defaultValue": "true" 46 | }, 47 | "a-tree/defaultSelectedKeys": { 48 | "description": "Specifies the keys of the default selected treeNodes", 49 | "optionType": "string[] | number[]", 50 | "defaultValue": "[]" 51 | }, 52 | "a-tree/disabled": { 53 | "description": "whether disabled the tree", 54 | "optionType": "bool", 55 | "defaultValue": "false" 56 | }, 57 | "a-tree/draggable": { 58 | "description": "Specifies whether this Tree is draggable (IE > 8)", 59 | "optionType": "boolean", 60 | "defaultValue": "false" 61 | }, 62 | "a-tree/expandedKeys": { 63 | "description": "(Controlled) Specifies the keys of the expanded treeNodes", 64 | "optionType": "string[] | number[]", 65 | "defaultValue": "[]" 66 | }, 67 | "a-tree/filterTreeNode": { 68 | "description": "Defines a function to filter (highlight) treeNodes. When the function returns true, the corresponding treeNode will be highlighted", 69 | "optionType": "function(node)", 70 | "defaultValue": "-" 71 | }, 72 | "a-tree/loadData": { 73 | "description": "Load data asynchronously", 74 | "optionType": "function(node)", 75 | "defaultValue": "-" 76 | }, 77 | "a-tree/loadedKeys": { 78 | "description": "(Controlled) Set loaded tree nodes. Need work with loadData", 79 | "optionType": "string[] | number[]", 80 | "defaultValue": "[]" 81 | }, 82 | "a-tree/multiple": { 83 | "description": "Allows selecting multiple treeNodes", 84 | "optionType": "boolean", 85 | "defaultValue": "false" 86 | }, 87 | "a-tree/selectedKeys": { 88 | "description": "(Controlled) Specifies the keys of the selected treeNodes", 89 | "optionType": "string[] | number[]", 90 | "defaultValue": "-" 91 | }, 92 | "a-tree/showIcon": { 93 | "description": "Shows the icon before a TreeNode's title. There is no default style; you must set a custom style for it if set to true", 94 | "optionType": "boolean", 95 | "defaultValue": "false" 96 | }, 97 | "a-tree/showLine": { 98 | "description": "Shows a connecting line", 99 | "optionType": "boolean", 100 | "defaultValue": "false" 101 | } 102 | } -------------------------------------------------------------------------------- /src/config/attributes/table/table.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-table/bordered": { 3 | "description": "Whether to show all table borders", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-table/childrenColumnName": { 8 | "description": "The column contains children to display", 9 | "optionType": "string[]", 10 | "defaultValue": "children" 11 | }, 12 | "a-table/columns": { 13 | "description": "Columns of table", 14 | "optionType": "array", 15 | "defaultValue": "-" 16 | }, 17 | "a-table/components": { 18 | "description": "Override default table elements", 19 | "optionType": "object", 20 | "defaultValue": "-" 21 | }, 22 | "a-table/dataSource": { 23 | "description": "Data record array to be displayed", 24 | "optionType": "any[]", 25 | "defaultValue": "-" 26 | }, 27 | "a-table/defaultExpandAllRows": { 28 | "description": "Expand all rows initially", 29 | "optionType": "boolean", 30 | "defaultValue": "false" 31 | }, 32 | "a-table/defaultExpandedRowKeys": { 33 | "description": "Initial expanded row keys", 34 | "optionType": "string[]", 35 | "defaultValue": "-" 36 | }, 37 | "a-table/expandedRowKeys": { 38 | "description": "Current expanded row keys", 39 | "optionType": "string[]", 40 | "defaultValue": "-" 41 | }, 42 | "a-table/expandedRowRender": { 43 | "description": "Expanded container render for each row", 44 | "optionType": "Function(record, index, indent, expanded):VNode|slot-scope", 45 | "defaultValue": "-" 46 | }, 47 | "a-table/expandIcon": { 48 | "description": "Customize row expand Icon.", 49 | "optionType": "Function(props):VNode | slot=\"expandIcon\" slot-scope=\"props\"", 50 | "defaultValue": "-" 51 | }, 52 | "a-table/expandRowByClick": { 53 | "description": "Whether to expand row by clicking anywhere in the whole row", 54 | "optionType": "boolean", 55 | "defaultValue": "false" 56 | }, 57 | "a-table/footer": { 58 | "description": "Table footer renderer", 59 | "optionType": "Function(currentPageData)|slot-scope", 60 | "defaultValue": "" 61 | }, 62 | "a-table/indentSize": { 63 | "description": "Indent size in pixels of tree data", 64 | "optionType": "number", 65 | "defaultValue": "15" 66 | }, 67 | "a-table/loading": { 68 | "description": "Loading status of table", 69 | "optionType": "boolean|object", 70 | "defaultValue": "false" 71 | }, 72 | "a-table/locale": { 73 | "description": "i18n text including filter, sort, empty text, etc", 74 | "optionType": "object", 75 | "defaultValue": "filterConfirm: 'Ok' \nfilterReset: 'Reset' \nemptyText: 'No Data'\n\n" 76 | }, 77 | "a-table/pagination": { 78 | "description": "Pagination config or [Pagination] (/ant-design-vue/components/pagination/), hide it by setting it to false", 79 | "optionType": "object", 80 | "defaultValue": "" 81 | }, 82 | "a-table/rowClassName": { 83 | "description": "Row's className", 84 | "optionType": "Function(record, index):string", 85 | "defaultValue": "-" 86 | }, 87 | "a-table/rowKey": { 88 | "description": "Row's unique key, could be a string or function that returns a string", 89 | "optionType": "string|Function(record):string", 90 | "defaultValue": "key" 91 | }, 92 | "a-table/rowSelection": { 93 | "description": "Row selection config", 94 | "optionType": "object", 95 | "defaultValue": "null" 96 | }, 97 | "a-table/scroll": { 98 | "description": "Set horizontal or vertical scrolling, can also be used to specify the width and height of the scroll area. It is recommended to set a number for x, if you want to set it to true, you need to add style .ant-table td { white-space: nowrap; }.", 99 | "optionType": "{ x: number | true, y: number }", 100 | "defaultValue": "-" 101 | }, 102 | "a-table/showHeader": { 103 | "description": "Whether to show table header", 104 | "optionType": "boolean", 105 | "defaultValue": "true" 106 | }, 107 | "a-table/size": { 108 | "description": "Size of table", 109 | "optionType": "default | middle | small", 110 | "defaultValue": "default" 111 | }, 112 | "a-table/title": { 113 | "description": "Table title renderer", 114 | "optionType": "Function(currentPageData)|slot-scope", 115 | "defaultValue": "" 116 | }, 117 | "a-table/customHeaderRow": { 118 | "description": "Set props on per header row", 119 | "optionType": "Function(column, index)", 120 | "defaultValue": "-" 121 | }, 122 | "a-table/customRow": { 123 | "description": "Set props on per row", 124 | "optionType": "Function(record, index)", 125 | "defaultValue": "-" 126 | } 127 | } -------------------------------------------------------------------------------- /src/config/attributes/treeSelect/treeSelect.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-tree-select/allowClear": { 3 | "description": "Whether allow clear", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-tree-select/defaultValue": { 8 | "description": "To set the initial selected treeNode(s).", 9 | "optionType": "string|string[]", 10 | "defaultValue": "-" 11 | }, 12 | "a-tree-select/disabled": { 13 | "description": "Disabled or not", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-tree-select/dropdownClassName": { 18 | "description": "className of dropdown menu", 19 | "optionType": "string", 20 | "defaultValue": "-" 21 | }, 22 | "a-tree-select/dropdownMatchSelectWidth": { 23 | "description": "Determine whether the dropdown menu and the select input are the same width", 24 | "optionType": "boolean", 25 | "defaultValue": "true" 26 | }, 27 | "a-tree-select/dropdownStyle": { 28 | "description": "To set the style of the dropdown menu", 29 | "optionType": "object", 30 | "defaultValue": "-" 31 | }, 32 | "a-tree-select/filterTreeNode": { 33 | "description": "Whether to filter treeNodes by input value. The value of treeNodeFilterProp is used for filtering by default.", 34 | "optionType": "boolean|Function(inputValue: string, treeNode: TreeNode) (should return boolean)", 35 | "defaultValue": "Function" 36 | }, 37 | "a-tree-select/getPopupContainer": { 38 | "description": "To set the container of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition.", 39 | "optionType": "Function(triggerNode)", 40 | "defaultValue": "() => document.body" 41 | }, 42 | "a-tree-select/labelInValue": { 43 | "description": "whether to embed label in value, turn the format of value from string to {value: string, label: VNode, halfChecked: string[]}", 44 | "optionType": "boolean", 45 | "defaultValue": "false" 46 | }, 47 | "a-tree-select/loadData": { 48 | "description": "Load data asynchronously.", 49 | "optionType": "function(node)", 50 | "defaultValue": "-" 51 | }, 52 | "a-tree-select/multiple": { 53 | "description": "Support multiple or not, will be true when enable treeCheckable.", 54 | "optionType": "boolean", 55 | "defaultValue": "false" 56 | }, 57 | "a-tree-select/placeholder": { 58 | "description": "Placeholder of the select input", 59 | "optionType": "string|slot", 60 | "defaultValue": "-" 61 | }, 62 | "a-tree-select/searchPlaceholder": { 63 | "description": "Placeholder of the search input", 64 | "optionType": "string|slot", 65 | "defaultValue": "-" 66 | }, 67 | "a-tree-select/searchValue(.sync)": { 68 | "description": "work with search event to make search value controlled.", 69 | "optionType": "string", 70 | "defaultValue": "-" 71 | }, 72 | "a-tree-select/showCheckedStrategy": { 73 | "description": "The way show selected item in box. Default: just show child nodes. TreeSelect.SHOW_ALL: show all checked treeNodes (include parent treeNode). TreeSelect.SHOW_PARENT: show checked treeNodes (just show parent treeNode).", 74 | "optionType": "enum { TreeSelect.SHOW_ALL, TreeSelect.SHOW_PARENT, TreeSelect.SHOW_CHILD }", 75 | "defaultValue": "TreeSelect.SHOW_CHILD" 76 | }, 77 | "a-tree-select/showSearch": { 78 | "description": "Whether to display a search input in the dropdown menu(valid only in the single mode)", 79 | "optionType": "boolean", 80 | "defaultValue": "false" 81 | }, 82 | "a-tree-select/size": { 83 | "description": "To set the size of the select input, options: large small", 84 | "optionType": "string", 85 | "defaultValue": "'default'" 86 | }, 87 | "a-tree-select/suffixIcon": { 88 | "description": "The custom suffix icon", 89 | "optionType": "VNode | slot", 90 | "defaultValue": "-" 91 | }, 92 | "a-tree-select/treeCheckable": { 93 | "description": "Whether to show checkbox on the treeNodes", 94 | "optionType": "boolean", 95 | "defaultValue": "false" 96 | }, 97 | "a-tree-select/treeCheckStrictly": { 98 | "description": "Whether to check nodes precisely (in the checkable mode), means parent and child nodes are not associated, and it will make labelInValue be true", 99 | "optionType": "boolean", 100 | "defaultValue": "false" 101 | }, 102 | "a-tree-select/treeData": { 103 | "description": "Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value)", 104 | "optionType": "array<{ value, label, children, [disabled, disableCheckbox, selectable] }>", 105 | "defaultValue": "[]" 106 | }, 107 | "a-tree-select/treeDataSimpleMode": { 108 | "description": "Enable simple mode of treeData.(treeData should like this: [{id:1, pId:0, value:'1', label:\"test1\",...},...], pId is parent node's id)", 109 | "optionType": "false|Array<{ id: string, pId: string, rootPId: null }>", 110 | "defaultValue": "false" 111 | }, 112 | "a-tree-select/treeDefaultExpandAll": { 113 | "description": "Whether to expand all treeNodes by default", 114 | "optionType": "boolean", 115 | "defaultValue": "false" 116 | }, 117 | "a-tree-select/treeDefaultExpandedKeys": { 118 | "description": "Default expanded treeNodes", 119 | "optionType": "string[] | number[]", 120 | "defaultValue": "-" 121 | }, 122 | "a-tree-select/treeExpandedKeys": { 123 | "description": "Set expanded keys", 124 | "optionType": "string[] | number[]", 125 | "defaultValue": "-" 126 | }, 127 | "a-tree-select/treeNodeFilterProp": { 128 | "description": "Will be used for filtering if filterTreeNode returns true", 129 | "optionType": "string", 130 | "defaultValue": "'value'" 131 | }, 132 | "a-tree-select/treeNodeLabelProp": { 133 | "description": "Will render as content of select", 134 | "optionType": "string", 135 | "defaultValue": "'title'" 136 | }, 137 | "a-tree-select/value": { 138 | "description": "To set the current selected treeNode(s).", 139 | "optionType": "string|string[]", 140 | "defaultValue": "-" 141 | } 142 | } -------------------------------------------------------------------------------- /src/config/attributes/select/select.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-select/allowClear": { 3 | "description": "Show clear button.", 4 | "optionType": "boolean", 5 | "defaultValue": "false" 6 | }, 7 | "a-select/autoClearSearchValue": { 8 | "description": "Whether the current search will be cleared on selecting an item. Only applies when mode is set to multiple or tags.", 9 | "optionType": "boolean", 10 | "defaultValue": "true" 11 | }, 12 | "a-select/autoFocus": { 13 | "description": "Get focus by default", 14 | "optionType": "boolean", 15 | "defaultValue": "false" 16 | }, 17 | "a-select/defaultActiveFirstOption": { 18 | "description": "Whether active first option by default", 19 | "optionType": "boolean", 20 | "defaultValue": "true" 21 | }, 22 | "a-select/defaultValue": { 23 | "description": "Initial selected option.", 24 | "optionType": "string|string[]\nnumber|number[]", 25 | "defaultValue": "-" 26 | }, 27 | "a-select/disabled": { 28 | "description": "Whether disabled select", 29 | "optionType": "boolean", 30 | "defaultValue": "false" 31 | }, 32 | "a-select/dropdownClassName": { 33 | "description": "className of dropdown menu", 34 | "optionType": "string", 35 | "defaultValue": "-" 36 | }, 37 | "a-select/dropdownMatchSelectWidth": { 38 | "description": "Whether dropdown's width is same with select.", 39 | "optionType": "boolean", 40 | "defaultValue": "true" 41 | }, 42 | "a-select/dropdownRender": { 43 | "description": "Customize dropdown content", 44 | "optionType": "(menuNode: VNode, props) => VNode", 45 | "defaultValue": "-" 46 | }, 47 | "a-select/dropdownStyle": { 48 | "description": "style of dropdown menu", 49 | "optionType": "object", 50 | "defaultValue": "-" 51 | }, 52 | "a-select/filterOption": { 53 | "description": "If true, filter options by input, if function, filter options against it. The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded.", 54 | "optionType": "boolean or function(inputValue, option)", 55 | "defaultValue": "true" 56 | }, 57 | "a-select/firstActiveValue": { 58 | "description": "Value of action option by default", 59 | "optionType": "string|string[]", 60 | "defaultValue": "-" 61 | }, 62 | "a-select/getPopupContainer": { 63 | "description": "Parent Node which the selector should be rendered to. Default to body. When position issues happen, try to modify it into scrollable content and position it relative.", 64 | "optionType": "function(triggerNode)", 65 | "defaultValue": "() => document.body" 66 | }, 67 | "a-select/labelInValue": { 68 | "description": "whether to embed label in value, turn the format of value from string to {key: string, label: vNodes}", 69 | "optionType": "boolean", 70 | "defaultValue": "false" 71 | }, 72 | "a-select/maxTagCount": { 73 | "description": "Max tag count to show", 74 | "optionType": "number", 75 | "defaultValue": "-" 76 | }, 77 | "a-select/maxTagPlaceholder": { 78 | "description": "Placeholder for not showing tags", 79 | "optionType": "slot/function(omittedValues)", 80 | "defaultValue": "-" 81 | }, 82 | "a-select/mode": { 83 | "options": ["default", "multiple", "tags"], 84 | "description": "Set mode of Select", 85 | "optionType": "'default' | 'multiple' | 'tags'", 86 | "defaultValue": "'default'" 87 | }, 88 | "a-select/notFoundContent": { 89 | "description": "Specify content to show when no result matches..", 90 | "optionType": "string|slot", 91 | "defaultValue": "'Not Found'" 92 | }, 93 | "a-select/optionFilterProp": { 94 | "description": "Which prop value of option will be used for filter if filterOption is true", 95 | "optionType": "string", 96 | "defaultValue": "value" 97 | }, 98 | "a-select/optionLabelProp": { 99 | "description": "Which prop value of option will render as content of select.", 100 | "optionType": "string", 101 | "defaultValue": "value for combobox, children for other modes" 102 | }, 103 | "a-select/placeholder": { 104 | "description": "Placeholder of select", 105 | "optionType": "string|slot", 106 | "defaultValue": "-" 107 | }, 108 | "a-select/showSearch": { 109 | "description": "Whether show search input in single mode.", 110 | "optionType": "boolean", 111 | "defaultValue": "false" 112 | }, 113 | "a-select/showArrow": { 114 | "description": "Whether to show the drop-down arrow", 115 | "optionType": "boolean", 116 | "defaultValue": "true" 117 | }, 118 | "a-select/size": { 119 | "description": "Size of Select input. default large small", 120 | "optionType": "string", 121 | "defaultValue": "default" 122 | }, 123 | "a-select/suffixIcon": { 124 | "description": "The custom suffix icon", 125 | "optionType": "VNode | slot", 126 | "defaultValue": "-" 127 | }, 128 | "a-select/removeIcon": { 129 | "description": "The custom remove icon", 130 | "optionType": "VNode | slot", 131 | "defaultValue": "-" 132 | }, 133 | "a-select/clearIcon": { 134 | "description": "The custom clear icon", 135 | "optionType": "VNode | slot", 136 | "defaultValue": "-" 137 | }, 138 | "a-select/menuItemSelectedIcon": { 139 | "description": "The custom menuItemSelected icon", 140 | "optionType": "VNode | slot", 141 | "defaultValue": "-" 142 | }, 143 | "a-select/tokenSeparators": { 144 | "description": "Separator used to tokenize on tag/multiple mode", 145 | "optionType": "string[]", 146 | "defaultValue": "" 147 | }, 148 | "a-select/value": { 149 | "description": "Current selected option.", 150 | "optionType": "string|number|string[]|number[]", 151 | "defaultValue": "-" 152 | }, 153 | "a-select/options": { 154 | "description": "Data of the selectOption, manual construction work is no longer needed if this property has been set", 155 | "optionType": "array<{value, label, [disabled, key, title]}>", 156 | "defaultValue": "[]" 157 | }, 158 | "a-select/defaultOpen": { 159 | "description": "Initial open state of dropdown", 160 | "optionType": "boolean", 161 | "defaultValue": "-" 162 | }, 163 | "a-select/open": { 164 | "description": "Controlled open state of dropdown", 165 | "optionType": "boolean", 166 | "defaultValue": "-" 167 | }, 168 | "a-select/loading": { 169 | "description": "indicate loading state", 170 | "optionType": "Boolean", 171 | "defaultValue": "false" 172 | } 173 | } -------------------------------------------------------------------------------- /src/config/ui-attributes.js: -------------------------------------------------------------------------------- 1 | import * as form from './attributes/form/form.json' 2 | import * as formItem from './attributes/form/formItem.json' 3 | import * as button from './attributes/button/button.json' 4 | import * as row from './attributes/grid/row.json' 5 | import * as col from './attributes/grid/col.json' 6 | import * as layout from './attributes/layout/layout.json' 7 | import * as layoutSider from './attributes/layout/layoutSider.json' 8 | import * as affix from './attributes/affix/affix.json' 9 | import * as breadcrumb from './attributes/breadcrumb/breadcrumb.json' 10 | import * as dropdown from './attributes/dropdown/dropdown.json' 11 | import * as dropdownButton from './attributes/dropdown/dropdownButton.json' 12 | import * as menu from './attributes/menu/menu.json' 13 | import * as menuItem from './attributes/menu/menuItem.json' 14 | import * as menuSub from './attributes/menu/menuSub.json' 15 | import * as pagination from './attributes/pagination/pagination.json' 16 | import * as steps from './attributes/steps/steps.json' 17 | import * as step from './attributes/steps/step.json' 18 | import * as autoComplete from './attributes/autoComplete/autoComplete.json' 19 | import * as cascader from './attributes/cascader/cascader.json' 20 | import * as checkbox from './attributes/checkbox/checkbox.json' 21 | import * as checkboxGroup from './attributes/checkbox/checkboxGroup.json' 22 | import * as datePicker from './attributes/date-picker/date.json' 23 | import * as monthPicker from './attributes/date-picker/month.json' 24 | import * as rangePicker from './attributes/date-picker/range.json' 25 | import * as weekPicker from './attributes/date-picker/week.json' 26 | 27 | import * as inputGroup from './attributes/input/group.json' 28 | import * as input from './attributes/input/input.json' 29 | import * as inputTextArea from './attributes/input/textarea.json' 30 | 31 | import * as inputNumber from './attributes/inputNumber/number.json' 32 | 33 | import * as radio from './attributes/radio/radio.json' 34 | import * as radioGroup from './attributes/radio/radioGroup.json' 35 | 36 | import * as rate from './attributes/rate/rate.json' 37 | 38 | import * as select from './attributes/select/select.json' 39 | import * as selectOption from './attributes/select/selectOption.json' 40 | 41 | import * as slider from './attributes/slider/slider.json' 42 | 43 | import * as switchJson from './attributes/switch/switch.json' 44 | 45 | import * as timePicker from './attributes/timePicker/timePicker.json' 46 | 47 | import * as transfer from './attributes/transfer/transfer.json' 48 | 49 | import * as treeSelect from './attributes/treeSelect/treeSelect.json' 50 | import * as treeSelectNode from './attributes/treeSelect/treeSelectNode.json' 51 | 52 | import * as upload from './attributes/upload/upload.json' 53 | 54 | import * as avatar from './attributes/avatar/avatar.json' 55 | 56 | import * as badge from './attributes/badge/badge.json' 57 | 58 | import * as calendar from './attributes/calendar/calendar.json' 59 | 60 | import * as card from './attributes/card/card.json' 61 | import * as cardMeta from './attributes/card/cardMeta.json' 62 | 63 | import * as carousel from './attributes/carousel/carousel.json' 64 | 65 | import * as collapse from './attributes/collapse/collapse.json' 66 | import * as collapsePanel from './attributes/collapse/collapsePanel.json' 67 | 68 | import * as list from './attributes/list/list.json' 69 | import * as listItem from './attributes/list/listItem.json' 70 | import * as listItemMeta from './attributes/list/listItemMeta.json' 71 | 72 | import * as popover from './attributes/popover/popover.json' 73 | 74 | import * as tooltip from './attributes/tooltip/tooltip.json' 75 | 76 | import * as table from './attributes/table/table.json' 77 | 78 | import * as tabs from './attributes/tabs/tabs.json' 79 | import * as tabPane from './attributes/tabs/tabpane.json' 80 | 81 | 82 | import * as tag from './attributes/tag/tag.json' 83 | import * as checkableTag from './attributes/tag/checkableTag.json' 84 | 85 | 86 | import * as timeline from './attributes/timeline/timeline.json' 87 | import * as timelineItem from './attributes/timeline/timelineItem.json' 88 | 89 | import * as tree from './attributes/tree/tree.json' 90 | import * as treeNode from './attributes/tree/treeNode.json' 91 | 92 | import * as alert from './attributes/alert/alert.json' 93 | 94 | import * as drawer from './attributes/drawer/drawer.json' 95 | 96 | import * as popconfirm from './attributes/popconfirm/popconfirm.json' 97 | 98 | import * as progress from './attributes/progress/progress.json' 99 | 100 | import * as skeleton from './attributes/skeleton/skeleton.json' 101 | 102 | import * as spin from './attributes/spin/spin.json' 103 | 104 | import * as anchor from './attributes/anchor/anchor.json' 105 | 106 | import * as backtop from './attributes/backtop/backtop.json' 107 | 108 | import * as divider from './attributes/divider/divider.json' 109 | 110 | import * as comment from './attributes/comment/comment.json' 111 | 112 | 113 | export default { 114 | ...form, 115 | ...formItem, 116 | ...button, 117 | ...row, 118 | ...col, 119 | ...layout, 120 | ...layoutSider, 121 | ...affix, 122 | ...breadcrumb, 123 | ...dropdownButton, 124 | ...dropdown, 125 | ...menu, 126 | ...menuItem, 127 | ...menuSub, 128 | ...pagination, 129 | ...steps, 130 | ...step, 131 | ...autoComplete, 132 | ...cascader, 133 | ...checkbox, 134 | ...checkboxGroup, 135 | ...datePicker, 136 | ...monthPicker, 137 | ...rangePicker, 138 | ...weekPicker, 139 | ...input, 140 | ...inputGroup, 141 | ...inputTextArea, 142 | ...inputNumber, 143 | ...radio, 144 | ...radioGroup, 145 | ...rate, 146 | ...select, 147 | ...selectOption, 148 | ...slider, 149 | ...switchJson, 150 | ...timePicker, 151 | ...transfer, 152 | ...treeSelect, 153 | ...treeSelectNode, 154 | ...upload, 155 | ...avatar, 156 | ...badge, 157 | ...calendar, 158 | ...card, 159 | ...cardMeta, 160 | ...carousel, 161 | ...collapse, 162 | ...collapsePanel, 163 | ...list, 164 | ...listItem, 165 | ...listItemMeta, 166 | ...popover, 167 | ...tooltip, 168 | ...table, 169 | ...tabs, 170 | ...tabPane, 171 | ...tag, 172 | ...checkableTag, 173 | ...timeline, 174 | ...timelineItem, 175 | ...tree, 176 | ...treeNode, 177 | ...alert, 178 | ...drawer, 179 | ...popconfirm, 180 | ...progress, 181 | ...skeleton, 182 | ...spin, 183 | ...anchor, 184 | ...backtop, 185 | ...divider, 186 | ...{ 187 | "a-locale-provider/locale": { 188 | "description": "language package setting, you can find the packages in this path: antd/lib/locale-provider/", 189 | "optionType": "object", 190 | "defaultValue": "-" 191 | } 192 | }, 193 | ...{ 194 | "a-config-provider/getPopupContainer": { 195 | "description": "to set the container of the popup element. The default is to create a div element in body.", 196 | "optionType": "Function(triggerNode)", 197 | "defaultValue": "() => document.body" 198 | } 199 | }, 200 | ...comment, 201 | } -------------------------------------------------------------------------------- /src/config/components.js: -------------------------------------------------------------------------------- 1 | export default { 2 | avatar: { 3 | category: 'Components', 4 | subtitle: '头像', 5 | type: 'Data Display', 6 | title: 'Avatar', 7 | tag: 'a-avatar', 8 | }, 9 | badge: { 10 | category: 'Components', 11 | subtitle: '徽标数', 12 | type: 'Data Display', 13 | title: 'Badge', 14 | tag: 'a-badge', 15 | }, 16 | breadcrumb: { 17 | category: 'Components', 18 | subtitle: '面包屑', 19 | type: 'Navigation', 20 | title: 'Breadcrumb', 21 | tag: 'a-breadcrumb', 22 | }, 23 | button: { 24 | category: 'Components', 25 | subtitle: '按钮', 26 | type: 'General', 27 | title: 'Button', 28 | tag: 'a-button', 29 | }, 30 | card: { 31 | category: 'Components', 32 | subtitle: '卡片', 33 | type: 'Data Display', 34 | title: 'Card', 35 | tag: 'a-card', 36 | cols: 1, 37 | }, 38 | checkbox: { 39 | category: 'Components', 40 | subtitle: '多选框', 41 | type: 'Data Entry', 42 | title: 'Checkbox', 43 | tag: 'a-checkbox', 44 | }, 45 | grid: { 46 | category: 'Components', 47 | subtitle: '栅格', 48 | type: 'Layout', 49 | title: 'Grid', 50 | tag: 'a-row', 51 | cols: 1, 52 | }, 53 | icon: { 54 | category: 'Components', 55 | subtitle: '图标', 56 | type: 'General', 57 | title: 'Icon', 58 | tag: 'a-icon', 59 | }, 60 | input: { 61 | category: 'Components', 62 | subtitle: '输入框', 63 | type: 'Data Entry', 64 | title: 'Input', 65 | tag: 'a-input', 66 | }, 67 | select: { 68 | category: 'Components', 69 | subtitle: '选择器', 70 | type: 'Data Entry', 71 | title: 'Select', 72 | tag: 'a-select', 73 | }, 74 | menu: { 75 | category: 'Components', 76 | subtitle: '导航菜单', 77 | type: 'Navigation', 78 | title: 'Menu', 79 | tag: 'a-menu', 80 | cols: 1, 81 | }, 82 | pagination: { 83 | category: 'Components', 84 | subtitle: '分页', 85 | type: 'Navigation', 86 | title: 'Pagination', 87 | tag: 'a-pagination', 88 | cols: 1, 89 | }, 90 | popconfirm: { 91 | category: 'Components', 92 | subtitle: '气泡确认框', 93 | type: 'Feedback', 94 | title: 'Popconfirm', 95 | tag: 'a-popconfirm', 96 | }, 97 | popover: { 98 | category: 'Components', 99 | subtitle: '气泡卡片', 100 | type: 'Data Display', 101 | title: 'Popover', 102 | tag: 'a-popover', 103 | }, 104 | radio: { 105 | category: 'Components', 106 | subtitle: '单选框', 107 | type: 'Data Entry', 108 | title: 'Radio', 109 | tag: 'a-radio', 110 | }, 111 | rate: { 112 | category: 'Components', 113 | subtitle: '评分', 114 | type: 'Data Entry', 115 | title: 'Rate', 116 | tag: 'a-rate', 117 | cols: 1, 118 | }, 119 | tabs: { 120 | category: 'Components', 121 | subtitle: '标签页', 122 | type: 'Data Display', 123 | title: 'Tabs', 124 | tag: 'a-tabs', 125 | cols: 1, 126 | }, 127 | tag: { 128 | category: 'Components', 129 | subtitle: '标签', 130 | type: 'Data Display', 131 | title: 'Tag', 132 | tag: 'a-tag', 133 | }, 134 | tooltip: { 135 | category: 'Components', 136 | subtitle: '文字提示', 137 | type: 'Data Display', 138 | title: 'Tooltip', 139 | tag: 'a-tooltip', 140 | }, 141 | dropdown: { 142 | category: 'Components', 143 | subtitle: '下拉菜单', 144 | type: 'Navigation', 145 | title: 'Dropdown', 146 | tag: 'a-dropdown', 147 | }, 148 | divider: { 149 | category: 'Components', 150 | subtitle: '分割线', 151 | type: 'Other', 152 | title: 'Divider', 153 | tag: 'a-divider', 154 | }, 155 | collapse: { 156 | category: 'Components', 157 | subtitle: '折叠面板', 158 | type: 'Data Display', 159 | title: 'Collapse', 160 | tag: 'a-collapse', 161 | cols: 1, 162 | }, 163 | notification: { 164 | category: 'Components', 165 | subtitle: '通知提醒框', 166 | type: 'Feedback', 167 | title: 'Notification', 168 | tag: 'a-notification', 169 | }, 170 | message: { 171 | category: 'Components', 172 | subtitle: '全局提示', 173 | type: 'Feedback', 174 | title: 'Message', 175 | tag: 'a-message', 176 | }, 177 | spin: { 178 | category: 'Components', 179 | subtitle: '加载中', 180 | type: 'Feedback', 181 | title: 'Spin', 182 | tag: 'a-spin', 183 | }, 184 | switch: { 185 | category: 'Components', 186 | subtitle: '开关', 187 | type: 'Data Entry', 188 | title: 'Switch', 189 | tag: 'a-switch', 190 | }, 191 | "auto-complete": { 192 | category: 'Components', 193 | subtitle: '自动完成', 194 | type: 'Data Entry', 195 | title: 'AutoComplete', 196 | tag: 'a-auto-complete', 197 | cols: 2, 198 | }, 199 | affix: { 200 | category: 'Components', 201 | subtitle: '固钉', 202 | type: 'Navigation', 203 | title: 'Affix', 204 | tag: 'a-affix', 205 | }, 206 | cascader: { 207 | category: 'Components', 208 | subtitle: '级联选择', 209 | type: 'Data Entry', 210 | title: 'Cascader', 211 | tag: 'a-cascader', 212 | }, 213 | "back-top": { 214 | category: 'Components', 215 | subtitle: '回到顶部', 216 | type: 'Other', 217 | title: 'BackTop', 218 | tag: 'a-back-top', 219 | }, 220 | modal: { 221 | category: 'Components', 222 | subtitle: '对话框', 223 | type: 'Feedback', 224 | title: 'Modal', 225 | tag: 'a-modal', 226 | }, 227 | alert: { 228 | category: 'Components', 229 | subtitle: '警告提示', 230 | type: 'Feedback', 231 | title: 'Alert', 232 | tag: 'a-alert', 233 | }, 234 | "time-picker": { 235 | category: 'Components', 236 | subtitle: '时间选择框', 237 | type: 'Data Entry', 238 | title: 'TimePicker', 239 | tag: 'a-time-picker', 240 | }, 241 | steps: { 242 | category: 'Components', 243 | subtitle: '步骤条', 244 | type: 'Navigation', 245 | title: 'Steps', 246 | tag: 'a-steps', 247 | cols: 1, 248 | }, 249 | calendar: { 250 | category: 'Components', 251 | subtitle: '日历', 252 | type: 'Data Display', 253 | title: 'Calendar', 254 | tag: 'a-calendar', 255 | cols: 1, 256 | }, 257 | "date-picker": { 258 | category: 'Components', 259 | subtitle: '日期选择框', 260 | type: 'Data Entry', 261 | title: 'DatePicker', 262 | tag: 'a-date-picker', 263 | }, 264 | "locale-provider": { 265 | category: 'Components', 266 | subtitle: '国际化', 267 | type: 'Other', 268 | title: 'LocaleProvider', 269 | tag: 'a-locale-provider', 270 | cols: 1, 271 | }, 272 | slider: { 273 | category: 'Components', 274 | subtitle: '滑动输入条', 275 | type: 'Data Entry', 276 | title: 'Slider', 277 | tag: 'a-slider', 278 | }, 279 | progress: { 280 | category: 'Components', 281 | subtitle: '进度条', 282 | type: 'Feedback', 283 | title: 'Progress', 284 | tag: 'a-progress', 285 | }, 286 | timeline: { 287 | category: 'Components', 288 | subtitle: '时间轴', 289 | type: 'Data Display', 290 | title: 'Timeline', 291 | tag: 'a-time-line', 292 | }, 293 | table: { 294 | category: 'Components', 295 | subtitle: '表格', 296 | type: 'Data Display', 297 | title: 'Table', 298 | tag: 'a-table', 299 | cols: 1, 300 | }, 301 | "input-number": { 302 | category: 'Components', 303 | subtitle: '数字输入框', 304 | type: 'Data Entry', 305 | title: 'InputNumber', 306 | tag: 'a-input-number', 307 | }, 308 | transfer: { 309 | category: 'Components', 310 | subtitle: '穿梭框', 311 | type: 'Data Entry', 312 | title: 'Transfer', 313 | tag: 'a-transfer', 314 | cols: '1', 315 | }, 316 | upload: { 317 | category: 'Components', 318 | subtitle: '上传', 319 | type: 'Data Entry', 320 | title: 'Upload', 321 | tag: 'a-upload', 322 | }, 323 | carousel: { 324 | category: 'Components', 325 | type: 'Data Display', 326 | title: 'Carousel', 327 | subtitle: '走马灯', 328 | tag: 'a-carousel', 329 | }, 330 | tree: { 331 | category: 'Components', 332 | subtitle: '树形控件', 333 | type: 'Data Display', 334 | title: 'Tree', 335 | tag: 'a-tree', 336 | }, 337 | "tree-select": { 338 | category: 'Components', 339 | subtitle: '树选择', 340 | type: 'Data Entry', 341 | title: 'TreeSelect', 342 | tag: 'a-tree-select', 343 | }, 344 | layout: { 345 | category: 'Components', 346 | subtitle: '布局', 347 | type: 'Layout', 348 | title: 'Layout', 349 | tag: 'a-layout', 350 | cols: 1, 351 | }, 352 | form: { 353 | category: 'Components', 354 | subtitle: '表单', 355 | type: 'Data Entry', 356 | title: 'Form', 357 | tag: 'a-form', 358 | cols: 1, 359 | }, 360 | anchor: { 361 | category: 'Components', 362 | subtitle: '锚点', 363 | type: 'Other', 364 | title: 'Anchor', 365 | tag: 'a-anchor', 366 | cols: 2, 367 | }, 368 | list: { 369 | category: 'Components', 370 | subtitle: '列表', 371 | type: 'Data Display', 372 | title: 'List', 373 | tag: 'a-list', 374 | cols: 1, 375 | }, 376 | drawer: { 377 | category: 'Components', 378 | type: 'Feedback', 379 | title: 'Drawer', 380 | tag: 'a-drawer', 381 | subtitle: '抽屉', 382 | }, 383 | skeleton: { 384 | category: 'Components', 385 | type: 'Feedback', 386 | title: 'Skeleton', 387 | tag: 'a-skeleton', 388 | subtitle: '骨架屏', 389 | }, 390 | "config-provider": { 391 | category: 'Components', 392 | type: 'Other', 393 | title: 'ConfigProvider', 394 | tag: 'a-config-provider', 395 | subtitle: '全局化配置', 396 | }, 397 | comment: { 398 | category: 'Components', 399 | type: 'Data Display', 400 | title: 'Comment', 401 | tag: 'a-comment', 402 | subtitle: '评论', 403 | }, 404 | } 405 | -------------------------------------------------------------------------------- /src/app.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { 4 | window, commands, ViewColumn, Disposable, TextDocumentContentProvider, 5 | Event, Uri, CancellationToken, workspace, CompletionItemProvider, ProviderResult, 6 | TextDocument, Position, CompletionItem, CompletionList, CompletionItemKind, 7 | SnippetString, Range, EventEmitter, 8 | } from 'vscode'; 9 | import * as TAGS from './config/ui-tags.json'; 10 | import ATTRS from './config/ui-attributes.js'; 11 | 12 | const prettyHTML = require('pretty'); 13 | 14 | export interface Query { 15 | path: string, 16 | label: string, 17 | detail: string, 18 | description: string, 19 | }; 20 | 21 | export interface TagObject { 22 | text: string, 23 | offset: number 24 | }; 25 | 26 | export function encodeDocsUri(query?: Query): Uri { 27 | return Uri.parse(`antdv-helper://search?${JSON.stringify(query)}`); 28 | } 29 | 30 | export function decodeDocsUri(uri: Uri): Query { 31 | return JSON.parse(uri.query); 32 | } 33 | 34 | export class App { 35 | private _disposable!: Disposable; 36 | public WORD_REG: RegExp = /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/gi; 37 | 38 | 39 | getSeletedText() { 40 | let editor = window.activeTextEditor; 41 | 42 | if (!editor) {return;} 43 | 44 | let selection = editor.selection; 45 | 46 | if (selection.isEmpty) { 47 | let text = []; 48 | let range = editor.document.getWordRangeAtPosition(selection.start, this.WORD_REG); 49 | 50 | return editor.document.getText(range); 51 | } else { 52 | return editor.document.getText(selection); 53 | } 54 | } 55 | 56 | setConfig() { 57 | // https://github.com/Microsoft/vscode/issues/24464 58 | const config = workspace.getConfiguration('editor'); 59 | const quickSuggestions = config.get('quickSuggestions'); 60 | if(!quickSuggestions["strings"]) { 61 | config.update("quickSuggestions", { "strings": true }, true); 62 | } 63 | } 64 | 65 | openHtml(query, title) { 66 | const { label, detail } = query 67 | const panel = window.createWebviewPanel( 68 | label, 69 | detail, 70 | ViewColumn.One, 71 | { 72 | enableScripts: true, // 启用JS,默认禁用 73 | retainContextWhenHidden: true, // webview被隐藏时保持状态,避免被重置 74 | } 75 | ); 76 | 77 | // And set its HTML content 78 | panel.webview.html = this.getWebviewContent(query); 79 | } 80 | 81 | openDocs(query?: Query, title = 'antdv-helper', editor = window.activeTextEditor){ 82 | this.openHtml(query, title) 83 | } 84 | 85 | dispose() { 86 | this._disposable.dispose(); 87 | } 88 | 89 | getWebviewContent(query: Query) { 90 | const config = workspace.getConfiguration('antdv-helper'); 91 | const linkUrl = config.get('link-url'); 92 | const path = query.path; 93 | const iframeSrc = `${linkUrl}/components/${path}`; 94 | return ` 95 | 96 | 97 | 98 | 99 | 100 | Cat Coding 101 | 102 | 103 | 104 | 105 | `; 106 | } 107 | } 108 | 109 | 110 | const HTML_CONTENT = (query: Query) => { 111 | const config = workspace.getConfiguration('antdv-helper'); 112 | const linkUrl = config.get('link-url'); 113 | const path = query.path; 114 | const iframeSrc = `${linkUrl}/components/${path}`; 115 | return ` 116 | 117 | 118 | `; 119 | }; 120 | 121 | export class AntdvDocsContentProvider implements TextDocumentContentProvider { 122 | private _onDidChange = new EventEmitter(); 123 | 124 | get onDidChange(): Event { 125 | return this._onDidChange.event; 126 | } 127 | 128 | public update(uri: Uri) { 129 | this._onDidChange.fire(uri); 130 | } 131 | 132 | provideTextDocumentContent(uri: Uri, token: CancellationToken): string | Thenable { 133 | return HTML_CONTENT(decodeDocsUri(uri)); 134 | } 135 | } 136 | 137 | export class AntdvCompletionItemProvider implements CompletionItemProvider { 138 | private _document: TextDocument; 139 | private _position: Position; 140 | private tagReg: RegExp = /<([\w-]+)\s+/g; 141 | private attrReg: RegExp = /(?:\(|\s*)(\w+)=['"][^'"]*/; 142 | private tagStartReg: RegExp = /<([\w-]*)$/; 143 | private pugTagStartReg: RegExp = /^\s*[\w-]*$/; 144 | private size: number; 145 | private quotes: string; 146 | 147 | getPreTag(): TagObject | undefined { 148 | let line = this._position.line; 149 | let tag: TagObject | string; 150 | let txt = this.getTextBeforePosition(this._position); 151 | 152 | while (this._position.line - line < 10 && line >= 0) { 153 | if (line !== this._position.line) { 154 | txt = this._document.lineAt(line).text; 155 | } 156 | tag = this.matchTag(this.tagReg, txt, line); 157 | 158 | if (tag === 'break') return; 159 | if (tag) return tag; 160 | line--; 161 | } 162 | return; 163 | } 164 | 165 | getPreAttr(): string | undefined { 166 | let txt = this.getTextBeforePosition(this._position).replace(/"[^'"]*(\s*)[^'"]*$/, ''); 167 | let end = this._position.character; 168 | let start = txt.lastIndexOf(' ', end) + 1; 169 | let parsedTxt = this._document.getText(new Range(this._position.line, start, this._position.line, end)); 170 | 171 | return this.matchAttr(this.attrReg, parsedTxt); 172 | } 173 | 174 | matchAttr(reg: RegExp, txt: string): string { 175 | let match: RegExpExecArray; 176 | match = reg.exec(txt); 177 | return !/"[^"]*"/.test(txt) && match && match[1]; 178 | } 179 | 180 | matchTag(reg: RegExp, txt: string, line: number): TagObject | string { 181 | let match: RegExpExecArray; 182 | let arr: TagObject[] = []; 183 | 184 | if (/<\/?[-\w]+[^<>]*>[\s\w]*[^<\/>]*$/.test(txt) || /[^<>]*<$/.test(txt[txt.length - 1])))) { 185 | return 'break'; 186 | } 187 | while((match = reg.exec(txt))) { 188 | arr.push({ 189 | text: match[1], 190 | offset: this._document.offsetAt(new Position(line, match.index)) 191 | }); 192 | } 193 | return arr.pop(); 194 | } 195 | 196 | getTextBeforePosition(position: Position): string { 197 | var start = new Position(position.line, 0); 198 | var range = new Range(start, position); 199 | return this._document.getText(range); 200 | } 201 | getTagSuggestion() { 202 | let suggestions = []; 203 | 204 | let id = 100; 205 | for (let tag in TAGS) { 206 | suggestions.push(this.buildTagSuggestion(tag, TAGS[tag], id)); 207 | id++; 208 | } 209 | return suggestions; 210 | } 211 | 212 | getAttrValueSuggestion(tag: string, attr: string): CompletionItem[] { 213 | let suggestions = []; 214 | const values = this.getAttrValues(tag, attr); 215 | values.forEach(value => { 216 | suggestions.push({ 217 | label: value, 218 | kind: CompletionItemKind.Value 219 | }); 220 | }); 221 | return suggestions; 222 | } 223 | 224 | getAttrSuggestion(tag: string) { 225 | let suggestions = []; 226 | let tagAttrs = this.getTagAttrs(tag); 227 | let preText = this.getTextBeforePosition(this._position); 228 | let prefix = preText.replace(/['"]([^'"]*)['"]$/, '').split(/\s|\(+/).pop(); 229 | // method attribute 230 | const method = prefix[0] === '@'; 231 | // bind attribute 232 | const bind = prefix[0] === ':'; 233 | 234 | prefix = prefix.replace(/[:@]/, ''); 235 | 236 | if(/[^@:a-zA-z\s]/.test(prefix[0])) { 237 | return suggestions; 238 | } 239 | 240 | tagAttrs.forEach(attr => { 241 | const attrItem = this.getAttrItem(tag, attr); 242 | if (attrItem && (!prefix.trim() || this.firstCharsEqual(attr, prefix))) { 243 | const sug = this.buildAttrSuggestion({attr, tag, bind, method}, attrItem); 244 | sug && suggestions.push(sug); 245 | } 246 | }); 247 | // for (let attr in ATTRS) { 248 | // const attrItem = this.getAttrItem(tag, attr); 249 | // if (attrItem && attrItem.global && (!prefix.trim() || this.firstCharsEqual(attr, prefix))) { 250 | // const sug = this.buildAttrSuggestion({attr, tag: null, bind, method}, attrItem); 251 | // sug && suggestions.push(sug); 252 | // } 253 | // } 254 | 255 | return suggestions; 256 | } 257 | 258 | buildTagSuggestion(tag, tagVal, id) { 259 | const snippets = []; 260 | let index = 0; 261 | let that = this; 262 | function build(tag, {subtags, defaults}, snippets) { 263 | let attrs = ''; 264 | defaults && defaults.forEach((item, i) => { 265 | attrs += ` ${item}=${that.quotes}$${index + i + 1}${that.quotes}`; 266 | }); 267 | snippets.push(`${index > 0 ? '<':''}${tag}${attrs}>`); 268 | index++; 269 | subtags && subtags.forEach(item => build(item, TAGS[item], snippets)); 270 | snippets.push(``); 271 | }; 272 | build(tag, tagVal, snippets); 273 | 274 | return { 275 | label: tag, 276 | sortText: `0${id}${tag}`, 277 | insertText: new SnippetString(prettyHTML('<' + snippets.join(''), {indent_size: this.size}).substr(1)), 278 | kind: CompletionItemKind.Snippet, 279 | detail: 'Ant Design Vue', 280 | documentation: tagVal.description 281 | }; 282 | } 283 | 284 | buildAttrSuggestion({attr, tag, bind, method}, {description, type, optionType, defaultValue}) { 285 | if ((method && type === "method") || (bind && type !== "method") || (!method && !bind)) { 286 | let documentation = description 287 | optionType && (documentation += "\n" + `type: ${optionType}`) 288 | defaultValue && (documentation += "\n" + `default: ${defaultValue}`) 289 | return { 290 | label: attr, 291 | insertText: (type && (type === 'flag')) ? `${attr} ` : new SnippetString(`${attr}=${this.quotes}$1${this.quotes}$0`), 292 | kind: (type && (type === 'method')) ? CompletionItemKind.Method : CompletionItemKind.Property, 293 | detail: 'Ant Design Vue', 294 | documentation, 295 | }; 296 | } else { return; } 297 | } 298 | 299 | getAttrValues(tag, attr) { 300 | let attrItem = this.getAttrItem(tag, attr); 301 | let options = attrItem && attrItem.options; 302 | if (!options && attrItem) { 303 | if (attrItem.type === 'boolean') { 304 | options = ['true', 'false']; 305 | } 306 | } 307 | return options || []; 308 | } 309 | 310 | getTagAttrs(tag: string) { 311 | return (TAGS[tag] && TAGS[tag].attributes) || []; 312 | } 313 | 314 | getAttrItem(tag: string | undefined, attr: string | undefined) { 315 | return ATTRS[`${tag}/${attr}`] || ATTRS[attr]; 316 | } 317 | 318 | isAttrValueStart(tag: Object | string | undefined, attr) { 319 | return tag && attr; 320 | } 321 | 322 | isAttrStart(tag: TagObject | undefined) { 323 | return tag; 324 | } 325 | 326 | isTagStart() { 327 | let txt = this.getTextBeforePosition(this._position); 328 | return this.tagStartReg.test(txt); 329 | } 330 | 331 | firstCharsEqual(str1: string, str2: string) { 332 | if (str2 && str1) { 333 | return str1[0].toLowerCase() === str2[0].toLowerCase(); 334 | } 335 | return false; 336 | } 337 | // tentative plan for vue file 338 | notInTemplate(): boolean { 339 | let line = this._position.line; 340 | while(line) { 341 | if (/^\s*\s*$/.test(this._document.lineAt(line).text)) { 342 | return true; 343 | } 344 | line--; 345 | } 346 | return false; 347 | } 348 | 349 | provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): ProviderResult { 350 | this._document = document; 351 | this._position = position; 352 | 353 | const config = workspace.getConfiguration('antdv-helper'); 354 | this.size = config.get('indent-size'); 355 | const normalQuotes = config.get('quotes') === 'double' ? '"': "'"; 356 | this.quotes = normalQuotes; 357 | 358 | let tag: TagObject | string | undefined = this.getPreTag(); 359 | let attr = this.getPreAttr(); 360 | if (this.isAttrValueStart(tag, attr)) { 361 | return this.getAttrValueSuggestion(tag.text, attr); 362 | } else if(this.isAttrStart(tag)) { 363 | return this.getAttrSuggestion(tag.text); 364 | } else if (this.isTagStart()) { 365 | switch(document.languageId) { 366 | case 'vue': 367 | return this.notInTemplate() ? [] : this.getTagSuggestion(); 368 | case 'html': 369 | // todo 370 | return this.getTagSuggestion(); 371 | } 372 | } else {return [];} 373 | } 374 | 375 | } -------------------------------------------------------------------------------- /src/config/ui-tags.json: -------------------------------------------------------------------------------- 1 | { 2 | "a-button": { 3 | "defaults": ["type"], 4 | "attributes": ["disabled", "ghost", "htmlType", "icon", "loading", "shape", "size", "type", "block"], 5 | "description": "to trigger an operation" 6 | }, 7 | "a-icon": { 8 | "defaults": ["type"], 9 | "attributes": ["type", "style", "theme", "spin", "component", "twoToneColor"], 10 | "description": "semantic vector graphics" 11 | }, 12 | "a-row": { 13 | "attributes": ["align","gutter","justify","type"], 14 | "subtags": ["a-col"], 15 | "description": "a row in grid system" 16 | }, 17 | "a-col": { 18 | "defaults": [":span"], 19 | "attributes": ["offset","order","pull","push","span","xs","sm","md","lg","xl","xxl"], 20 | "description": "a column in grid system" 21 | }, 22 | "a-layout": { 23 | "attributes": ["class","style","hasSider"], 24 | "subtags": ["a-layout-sider", "a-layout-header", "a-layout-content", "a-layout-footer"], 25 | "description": "layout" 26 | }, 27 | "a-layout-sider": { 28 | "attributes": ["breakpoint","class","collapsed","collapsedWidth","collapsible","defaultCollapsed","reverseArrow","style","theme","trigger","width"], 29 | "description": "layout sider" 30 | }, 31 | "a-layout-header": { 32 | "description": "layout header" 33 | }, 34 | "a-layout-content": { 35 | "description": "layout content" 36 | }, 37 | "a-layout-footer": { 38 | "description": "layout footer" 39 | }, 40 | "a-affix": { 41 | "attributes": ["offsetBottom","offsetTop","target"], 42 | "description": "make an element stick to viewport" 43 | }, 44 | "a-breadcrumb": { 45 | "attributes": ["params","routes","separator"], 46 | "subtags": ["a-breadcrumb-item"], 47 | "description": "a breadcrumb displays the current location within a hierarchy. It allows going back to states higher up in the hierarchy." 48 | }, 49 | "a-breadcrumb-item": { 50 | "description": "breadcrumb item" 51 | }, 52 | "a-dropdown": { 53 | "attributes": ["disabled","getPopupContainer","placement","trigger","visible"], 54 | "description": "a dropdown list." 55 | }, 56 | "a-dropdown-button": { 57 | "attributes": ["disabled","placement","size","trigger","type","visible"], 58 | "description": "a dropdown button list." 59 | }, 60 | "a-menu": { 61 | "subtags": ["a-menu-item", "a-sub-menu"], 62 | "attributes": ["defaultOpenKeys","defaultSelectedKeys","forceSubMenuRender","inlineCollapsed","inlineIndent","mode","multiple","openKeys","selectable","selectedKeys","style","subMenuCloseDelay","subMenuOpenDelay","theme"], 63 | "description": "menu list of navigation" 64 | }, 65 | "a-menu-item": { 66 | "attributes": ["disabled","key"], 67 | "description": "menu item of navigation" 68 | }, 69 | "a-sub-menu": { 70 | "subtags": ["a-menu-item"], 71 | "attributes": ["children","disabled","key","title"], 72 | "description": "sub menu of navigation" 73 | }, 74 | "a-pagination": { 75 | "defaults": ["v-model"], 76 | "attributes": [ 77 | "current","defaultCurrent","defaultPageSize","hideOnSinglePage", 78 | "pageSize","pageSizeOptions","showQuickJumper", 79 | "showSizeChanger","showTotal","simple","size","total" 80 | ], 81 | "description": "A long list can be divided into several pages by ‘Pagination’, and only one page will be loaded at a time." 82 | }, 83 | "a-steps": { 84 | "subtags": ["a-step"], 85 | "attributes": [ 86 | "current","direction","labelPlacement", 87 | "progressDot","size","status","initial" 88 | ], 89 | "description": "The whole of the step bar." 90 | }, 91 | "a-step": { 92 | "defaults": ["title", "description"], 93 | "attributes": [ 94 | "description","icon","status","title" 95 | ], 96 | "description": "A single step in the step bar." 97 | }, 98 | "a-auto-complete": { 99 | "defaults": [":dataSource", ":filterOption"], 100 | "attributes": [ 101 | "allowClear","autoFocus","backfill","dataSource", 102 | "defaultActiveFirstOption","defaultValue","disabled", 103 | "filterOption","optionLabelProp","placeholder","value", 104 | "defaultOpen","open" 105 | ], 106 | "description": "Autocomplete function of input field." 107 | }, 108 | "a-cascader" : { 109 | "defaults": [":options"], 110 | "attributes": [ 111 | "allowClear","autoFocus","changeOnSelect","defaultValue", 112 | "disabled","displayRender","expandTrigger","fieldNames", 113 | "getPopupContainer","loadData","notFoundContent", 114 | "options","placeholder","popupClassName","popupStyle", 115 | "popupPlacement","popupVisible","showSearch","size", 116 | "suffixIcon","value" 117 | ], 118 | "description": "Cascade selection box." 119 | }, 120 | "a-checkbox": { 121 | "attributes": [ 122 | "autoFocus","checked","defaultChecked", 123 | "disabled","indeterminate" 124 | ], 125 | "description": "Checkbox component" 126 | }, 127 | "a-checkbox-group": { 128 | "attributes": [ 129 | "defaultValue","disabled","options","value" 130 | ], 131 | "description": "Checkbox group component" 132 | }, 133 | "a-date-picker": { 134 | "attributes": [ 135 | "allowClear","autoFocus","dateRender","disabled", 136 | "disabledDate","getCalendarContainer","locale","open", 137 | "placeholder","popupStyle","dropdownClassName","size", 138 | "suffixIcon","defaultValue","defaultPickerValue","disabledTime", 139 | "format","renderExtraFooter","showTime","showTime.defaultValue", 140 | "showToday","value" 141 | ], 142 | "description": "To select or input a date of day." 143 | }, 144 | "a-month-picker": { 145 | "attributes": [ 146 | "allowClear","autoFocus","dateRender","disabled", 147 | "disabledDate","getCalendarContainer","locale","open", 148 | "placeholder","popupStyle","dropdownClassName","size", 149 | "suffixIcon","defaultValue","defaultPickerValue","format", 150 | "monthCellContentRender","renderExtraFooter","value" 151 | ], 152 | "description": "To select or input a date of month." 153 | }, 154 | "a-range-picker": { 155 | "attributes": [ 156 | "allowClear","autoFocus","dateRender","disabled", 157 | "disabledDate","getCalendarContainer","locale","open", 158 | "placeholder","popupStyle","dropdownClassName","size", 159 | "suffixIcon","defaultValue","defaultPickerValue","disabledTime", 160 | "format","ranges","renderExtraFooter","showTime", 161 | "showTime.defaultValue","value" 162 | ], 163 | "description": "To select or input a range date ." 164 | }, 165 | "a-week-picker": { 166 | "attributes": [ 167 | "allowClear","autoFocus","dateRender","disabled", 168 | "disabledDate","getCalendarContainer","locale","open", 169 | "placeholder","popupStyle","dropdownClassName","size", 170 | "suffixIcon","defaultValue","defaultPickerValue", 171 | "format","value" 172 | ], 173 | "description": "To select or input a date of week" 174 | }, 175 | "a-form": { 176 | "subtags": ["a-form-item"], 177 | "attributes": [ 178 | "form","hideRequiredMark","layout" 179 | ], 180 | "description": "Form is used to collect, validate, and submit the user input, usually contains various form items including checkbox, radio, input, select, and etc." 181 | }, 182 | "a-form-item": { 183 | "attributes": [ 184 | "colon","extra","hasFeedback","help", 185 | "label","labelCol","required","validateStatus","wrapperCol" 186 | ], 187 | "description": "Form is used to collect, validate, and submit the user input, usually contains various form items including checkbox, radio, input, select, and etc." 188 | }, 189 | "a-input": { 190 | "attributes": [ 191 | "addonAfter","addonBefore","defaultValue","disabled", 192 | "id","prefix","size","suffix","type","value" 193 | ], 194 | "description": "A basic widget for getting the user input is a text field." 195 | }, 196 | "a-textarea": { 197 | "attributes": [ 198 | "autosize","defaultValue","value" 199 | ], 200 | "description": "A basic widget for getting the user textarea is a text field." 201 | }, 202 | "a-input-group": { 203 | "subtags": ["a-input"], 204 | "attributes": [ 205 | "compact","size" 206 | ], 207 | "description": "A basic widget for getting the user input is a text field." 208 | }, 209 | "a-input-number": { 210 | "attributes": [ 211 | "autoFocus","defaultValue","disabled","formatter","max","min", 212 | "parser","precision","decimalSeparator","size","step","value" 213 | ], 214 | "description": "Enter a number within certain range with the mouse or keyboard." 215 | }, 216 | "a-radio": { 217 | "attributes": [ 218 | "autoFocus","checked","defaultChecked","disabled","value" 219 | ], 220 | "description": "radio" 221 | }, 222 | "a-radio-group": { 223 | "attributes": [ 224 | "defaultValue","disabled","name","options","size","value","buttonStyle" 225 | ], 226 | "description": "radio of group" 227 | }, 228 | "a-rate": { 229 | "attributes": [ 230 | "allowClear","allowHalf","autoFocus","character", 231 | "count","defaultValue","disabled","value" 232 | ], 233 | "description": "Rate component." 234 | }, 235 | "a-select": { 236 | "subtags": ["a-select-option"], 237 | "attributes": [ 238 | "allowClear","autoClearSearchValue","autoFocus", 239 | "defaultActiveFirstOption","defaultValue","disabled", 240 | "dropdownClassName","dropdownMatchSelectWidth","dropdownStyle", 241 | "filterOption","firstActiveValue","getPopupContainer", 242 | "labelInValue","maxTagCount","maxTagPlaceholder","mode", 243 | "notFoundContent","optionFilterProp","optionLabelProp", 244 | "placeholder","showSearch","showArrow","size","suffixIcon", 245 | "tokenSeparators","value","options","defaultOpen","open" 246 | ], 247 | "description": "Select component to select value from options." 248 | }, 249 | "a-select-option": { 250 | "defaults": ["key", "value"], 251 | "attributes": [ 252 | "disabled","key","title","value","class" 253 | ], 254 | "description": "select option." 255 | }, 256 | "a-slider": { 257 | "attributes": [ 258 | "autoFocus","defaultValue","disabled","dots", 259 | "included","marks","max","min","range","step", 260 | "tipFormatter","value","vertical" 261 | ], 262 | "description": "A Slider component for displaying current value and intervals in range." 263 | }, 264 | "a-switch": { 265 | "attributes": [ 266 | "autoFocus","checked","checkedChildren","defaultChecked", 267 | "disabled","loading","size","unCheckedChildren" 268 | ], 269 | "description": "Switching Selector." 270 | }, 271 | "a-time-picker": { 272 | "attributes": [ 273 | "addon","allowEmpty","autoFocus","clearText", 274 | "defaultOpenValue","defaultValue","disabled", 275 | "disabledHours","disabledMinutes","disabledSeconds", 276 | "format","getPopupContainer","hideDisabledOptions", 277 | "hourStep","inputReadOnly","minuteStep","open", 278 | "placeholder","popupClassName","secondStep", 279 | "suffixIcon","use12Hours","value" 280 | ], 281 | "description": "To select/input a time." 282 | }, 283 | "a-transfer": { 284 | "attributes": [ 285 | "dataSource","disabled","filterOption","lazy", 286 | "listStyle","locale","operations","render", 287 | "selectedKeys","showSearch","targetKeys","titles" 288 | ], 289 | "description": "Transfer the elements between two columns in an intuitive and efficient way." 290 | }, 291 | "a-tree-select": { 292 | "subtags": ["a-tree-select-node"], 293 | "attributes": [ 294 | "allowClear","defaultValue","disabled","dropdownClassName", 295 | "dropdownMatchSelectWidth","dropdownStyle","filterTreeNode", 296 | "getPopupContainer","labelInValue","loadData","multiple", 297 | "placeholder","searchPlaceholder","showCheckedStrategy", 298 | "showSearch","size","suffixIcon","treeCheckable", 299 | "treeCheckStrictly","treeData","treeDataSimpleMode", 300 | "treeDefaultExpandAll","treeDefaultExpandedKeys", 301 | "treeExpandedKeys","treeNodeFilterProp", 302 | "treeNodeLabelProp","value" 303 | ], 304 | "description": "tree select" 305 | }, 306 | "a-tree-select-node": { 307 | "defaults": ["key", "value"], 308 | "attributes": [ 309 | "selectable","disableCheckbox","disabled", 310 | "isLeaf","key","title","value","scopedSlots" 311 | ], 312 | "description": "tree select node" 313 | }, 314 | "a-upload": { 315 | "attributes": [ 316 | "accept","action","directory","beforeUpload", 317 | "customRequest","data","defaultFileList","disabled", 318 | "fileList","headers","listType","multiple","name", 319 | "showUploadList","supportServerRender","withCredentials", 320 | "openFileDialogOnClick","remove" 321 | ], 322 | "description": "Upload file by selecting or dragging." 323 | }, 324 | "a-avatar": { 325 | "attributes": [ 326 | "icon","shape","size","src","alt","loadError" 327 | ], 328 | "description": "Avatars can be used to represent people or objects. It supports images, ‘Icon’s, or letters." 329 | }, 330 | "a-badge": { 331 | "attributes": [ 332 | "count","dot","offset","overflowCount","showZero", 333 | "status","text","numberStyle","title" 334 | ], 335 | "description": "Small numerical value or status descriptor for UI elements." 336 | }, 337 | "a-calendar": { 338 | "attributes": [ 339 | "dateCellRender","dateFullCellRender","defaultValue", 340 | "disabledDate","fullscreen","locale","mode","monthCellRender", 341 | "monthFullCellRender","validRange","value" 342 | ], 343 | "description": "Container for displaying data in calendar form." 344 | }, 345 | "a-card": { 346 | "attributes": [ 347 | "actions","activeTabKey","headStyle","bodyStyle", 348 | "bordered","defaultActiveTabKey","extra","hoverable", 349 | "loading","tabList","title","type" 350 | ], 351 | "description": "Simple rectangular container." 352 | }, 353 | "a-card-meta": { 354 | "attributes": [ 355 | "avatar","description","title" 356 | ], 357 | "description": "use Card.Meta to support more flexible content." 358 | }, 359 | "a-carousel": { 360 | "attributes": [ 361 | "afterChange","autoplay","beforeChange","dots","easing","effect","vertical" 362 | ], 363 | "description": "A carousel component. Scales with its container." 364 | }, 365 | "a-collapse": { 366 | "subtags": ["a-collapse-panel"], 367 | "attributes": [ 368 | "accordion","activeKey","bordered","defaultActiveKey", 369 | "destroyInactivePanel" 370 | ], 371 | "description": "A content area which can be collapsed and expanded." 372 | }, 373 | "a-collapse-panel": { 374 | "defaults": ["key"], 375 | "attributes": [ 376 | "disabled","forceRender","header","key","showArrow" 377 | ], 378 | "description": "A content area which can be collapsed and expanded." 379 | }, 380 | "a-list": { 381 | "subtags": ["a-list-item"], 382 | "attributes": [ 383 | "bordered","footer","grid","header", 384 | "itemLayout","loading","loadMore","locale", 385 | "pagination","size","split","renderItem","rowKey" 386 | ], 387 | "description": "Simple List." 388 | }, 389 | "a-list-item": { 390 | "attributes": [ 391 | "actions","extra" 392 | ], 393 | "description": "List Item" 394 | }, 395 | "a-list-item-meta": { 396 | "attributes": [ 397 | "avatar","description","title" 398 | ], 399 | "description": "List Item Meta" 400 | }, 401 | "a-popover": { 402 | "defaults": ["content","title"], 403 | "attributes": [ 404 | "content","title","arrowPointAtCenter","autoAdjustOverflow", 405 | "defaultVisible","getPopupContainer","mouseEnterDelay", 406 | "mouseLeaveDelay","overlayClassName","overlayStyle", 407 | "placement","trigger","visible","align" 408 | ], 409 | "description": "The floating card popped by clicking or hovering." 410 | }, 411 | "a-tooltip": { 412 | "attributes": [ 413 | "arrowPointAtCenter","autoAdjustOverflow", 414 | "defaultVisible","getPopupContainer","mouseEnterDelay", 415 | "mouseLeaveDelay","overlayClassName","overlayStyle", 416 | "placement","trigger","visible","align" 417 | ], 418 | "description": "A simple text popup tip." 419 | }, 420 | "a-table": { 421 | "attributes": [ 422 | "bordered","childrenColumnName","columns","components","dataSource", 423 | "defaultExpandAllRows","defaultExpandedRowKeys","expandedRowKeys", 424 | "expandedRowRender","expandIcon","expandRowByClick","footer", 425 | "indentSize","loading","locale","pagination","rowClassName","rowKey", 426 | "rowSelection","scroll","showHeader","size","title","customHeaderRow","customRow" 427 | ], 428 | "description": "A table displays rows of data." 429 | }, 430 | "a-tabs": { 431 | "subtags": ["a-tab-pane"], 432 | "attributes": [ 433 | "activeKey","animated","defaultActiveKey", 434 | "hideAdd","size","tabBarExtraContent", 435 | "tabBarStyle","tabPosition","type","tabBarGutter" 436 | ], 437 | "description": "Tabs make it easy to switch between different views." 438 | }, 439 | "a-tab-pane": { 440 | "defaults": ["key"], 441 | "attributes": [ 442 | "forceRender","key","tab" 443 | ], 444 | "description": "tab pane" 445 | }, 446 | "a-tag": { 447 | "attributes": [ 448 | "afterClose","closable","color", "visible" 449 | ], 450 | "description": "Tag for categorizing or markup." 451 | }, 452 | "a-checkable-tag": { 453 | "attributes": [ 454 | "checked" 455 | ], 456 | "description": "checkable tag" 457 | }, 458 | "a-timeline": { 459 | "attributes": [ 460 | "pending","pendingDot","reverse","mode" 461 | ], 462 | "description": "Vertical display timeline." 463 | }, 464 | "a-timeline-item": { 465 | "attributes": [ 466 | "color","dot" 467 | ], 468 | "description": "Vertical display timeline item." 469 | }, 470 | "a-tree": { 471 | "attributes": [ 472 | "treeData","autoExpandParent","checkable","checkedKeys", 473 | "checkStrictly","defaultCheckedKeys","defaultExpandAll", 474 | "defaultExpandedKeys","defaultExpandParent","defaultSelectedKeys", 475 | "disabled","draggable","expandedKeys(.sync)","filterTreeNode", 476 | "loadData","loadedKeys","multiple","selectedKeys","showIcon","showLine" 477 | ], 478 | "description": "tree." 479 | }, 480 | "a-tree-node": { 481 | "attributes": [ 482 | "class","style","disableCheckbox","disabled","icon", 483 | "isLeaf","key","selectable","title","scopedSlots","on" 484 | ], 485 | "description": "tree node." 486 | }, 487 | "a-alert": { 488 | "defaults": ["message"], 489 | "attributes": [ 490 | "afterClose","banner","closable","closeText", 491 | "description","icon","message","showIcon","type" 492 | ], 493 | "description": "Alert component for feedback." 494 | }, 495 | "a-drawer": { 496 | "defaults": ["message"], 497 | "attributes": [ 498 | "closable","destroyOnClose","getContainer","mask", 499 | "maskClosable","maskStyle","title","visible", 500 | "wrapClassName","width","height","className", 501 | "zIndex","placement" 502 | ], 503 | "description": "Panel slides from screen edge." 504 | }, 505 | "a-modal": { 506 | "defaults": ["visible", "title"], 507 | "attributes": [ 508 | "afterClose","bodyStyle","cancelText","centered", 509 | "closable","confirmLoading","destroyOnClose", 510 | "footer","getContainer","mask","maskClosable", 511 | "maskStyle","okText","okType","okButtonProps", 512 | "cancelButtonProps","title","visible","width", 513 | "wrapClassName","zIndex" 514 | ], 515 | "description": "Modal dialogs." 516 | }, 517 | "a-popconfirm": { 518 | "defaults": ["title"], 519 | "attributes": [ 520 | "cancelText","okText","okType","title","icon" 521 | ], 522 | "description": "A simple and compact confirmation dialog of an action." 523 | }, 524 | "a-progress": { 525 | "defaults": ["percent"], 526 | "attributes": [ 527 | "format","percent","showInfo","status", 528 | "strokeLinecap","strokeColor","successPercent", 529 | "type" 530 | ], 531 | "description": "Display the current progress of an operation flow." 532 | }, 533 | "a-skeleton": { 534 | "attributes": [ 535 | "active","avatar","loading","paragraph","title" 536 | ], 537 | "description": "Provide a placeholder at the place which need waiting for loading." 538 | }, 539 | "a-spin": { 540 | "attributes": [ 541 | "delay","indicator","size","spinning","tip","wrapperClassName" 542 | ], 543 | "description": "A spinner for displaying loading state of a page or a section." 544 | }, 545 | "a-anchor": { 546 | "subtags": ["a-anchor-link"], 547 | "attributes": [ 548 | "affix","bounds","getContainer","offsetBottom","offsetTop","showInkInFixed" 549 | ], 550 | "description": "Hyperlinks to scroll on one page." 551 | }, 552 | "a-anchor-link": { 553 | "defaults": ["href", "title"], 554 | "attributes": [ 555 | "href","title" 556 | ], 557 | "description": "anchor link" 558 | }, 559 | "a-back-top": { 560 | "attributes": [ 561 | "target","visibilityHeight" 562 | ], 563 | "description": "BackTop makes it easy to go back to the top of the page." 564 | }, 565 | "a-divider": { 566 | "attributes": [ 567 | "dashed","orientation","type" 568 | ], 569 | "description": "A divider line separates different content." 570 | }, 571 | "a-locale-provider": { 572 | "defaults": [":locale"], 573 | "attributes": [ 574 | "locale" 575 | ], 576 | "description": "LocaleProvider provides a uniform localization support for built-in text of components." 577 | }, 578 | "a-comment": { 579 | "attributes": [ 580 | "actions","author","avatar","content","datetime" 581 | ], 582 | "description": "A comment displays user feedback and discussion to website content." 583 | }, 584 | "a-config-provider": { 585 | "attributes": [ 586 | "getPopupContainer" 587 | ], 588 | "description": "ConfigProvider provides a uniform configuration support for components." 589 | } 590 | } 591 | --------------------------------------------------------------------------------