@agentscope-ai/design 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +85 -0
- package/dist/antd/styles/button.style.d.ts +47 -0
- package/dist/antd/styles/button.style.js +32 -0
- package/dist/antd/styles/dropdown.style.d.ts +15 -0
- package/dist/antd/styles/dropdown.style.js +16 -0
- package/dist/antd/styles/index.style.d.ts +19 -0
- package/dist/antd/styles/index.style.js +50 -0
- package/dist/antd/styles/message.style.d.ts +5 -0
- package/dist/antd/styles/message.style.js +10 -0
- package/dist/antd/styles/notification.style.d.ts +46 -0
- package/dist/antd/styles/notification.style.js +29 -0
- package/dist/antd/styles/popover.style.d.ts +13 -0
- package/dist/antd/styles/popover.style.js +14 -0
- package/dist/antd/styles/radio.style.d.ts +7 -0
- package/dist/antd/styles/radio.style.js +10 -0
- package/dist/antd/styles/segment.style.d.ts +7 -0
- package/dist/antd/styles/segment.style.js +12 -0
- package/dist/antd/styles/select.style.d.ts +6 -0
- package/dist/antd/styles/select.style.js +11 -0
- package/dist/antd/styles/slider.style.d.ts +22 -0
- package/dist/antd/styles/slider.style.js +21 -0
- package/dist/antd/styles/table.style.d.ts +5 -0
- package/dist/antd/styles/table.style.js +10 -0
- package/dist/antd/styles/tooltip.style.d.ts +8 -0
- package/dist/antd/styles/tooltip.style.js +11 -0
- package/dist/antd/themes/bailianDarkTheme.json +173 -0
- package/dist/antd/themes/bailianTheme.json +170 -0
- package/dist/antd/themes/blackTheme.json +12 -0
- package/dist/antd/themes/carbonDarkTheme.json +172 -0
- package/dist/antd/themes/carbonTheme.json +170 -0
- package/dist/antd/themes/xConsoleTheme.json +26 -0
- package/dist/components/CComponents/Alert/demo/index.d.ts +2 -0
- package/dist/components/CComponents/Alert/demo/index.js +99 -0
- package/dist/components/commonComponents/Alert/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/Alert/demo/index.js +87 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo1.js +86 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo2.js +70 -0
- package/dist/components/commonComponents/AlertDialog/index.d.ts +25 -0
- package/dist/components/commonComponents/AlertDialog/index.js +143 -0
- package/dist/components/commonComponents/Avatar/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Avatar/demo/index.js +25 -0
- package/dist/components/commonComponents/Avatar/index.d.ts +4 -0
- package/dist/components/commonComponents/Avatar/index.js +39 -0
- package/dist/components/commonComponents/Badge/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Badge/demo/index.js +24 -0
- package/dist/components/commonComponents/Button/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Button/demo/demo1.js +103 -0
- package/dist/components/commonComponents/Button/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Button/demo/demo2.js +17 -0
- package/dist/components/commonComponents/Button/index.d.ts +18 -0
- package/dist/components/commonComponents/Button/index.js +78 -0
- package/dist/components/commonComponents/Card/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Card/demo/demo1.js +31 -0
- package/dist/components/commonComponents/Card/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Card/demo/demo2.js +46 -0
- package/dist/components/commonComponents/Card/index.d.ts +11 -0
- package/dist/components/commonComponents/Card/index.js +40 -0
- package/dist/components/commonComponents/Card/index.style.d.ts +58 -0
- package/dist/components/commonComponents/Card/index.style.js +44 -0
- package/dist/components/commonComponents/Checkbox/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Checkbox/demo/demo1.js +21 -0
- package/dist/components/commonComponents/Checkbox/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Checkbox/demo/demo2.js +25 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo1.js +34 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo2.js +14 -0
- package/dist/components/commonComponents/CodeBlock/index.d.ts +11 -0
- package/dist/components/commonComponents/CodeBlock/index.js +88 -0
- package/dist/components/commonComponents/CodeBlock/index.style.d.ts +46 -0
- package/dist/components/commonComponents/CodeBlock/index.style.js +59 -0
- package/dist/components/commonComponents/CollapsePanel/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/CollapsePanel/demo/demo1.js +27 -0
- package/dist/components/commonComponents/CollapsePanel/index.d.ts +38 -0
- package/dist/components/commonComponents/CollapsePanel/index.js +116 -0
- package/dist/components/commonComponents/CollapsePanel/index.style.d.ts +329 -0
- package/dist/components/commonComponents/CollapsePanel/index.style.js +96 -0
- package/dist/components/commonComponents/ConfigProvider/index.d.ts +25 -0
- package/dist/components/commonComponents/ConfigProvider/index.js +152 -0
- package/dist/components/commonComponents/Drawer/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Drawer/demo/demo1.js +106 -0
- package/dist/components/commonComponents/Drawer/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Drawer/demo/demo2.js +66 -0
- package/dist/components/commonComponents/Drawer/index.d.ts +3 -0
- package/dist/components/commonComponents/Drawer/index.js +30 -0
- package/dist/components/commonComponents/Drawer/index.style.d.ts +38 -0
- package/dist/components/commonComponents/Drawer/index.style.js +40 -0
- package/dist/components/commonComponents/Dropdown/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Dropdown/demo/demo1.js +33 -0
- package/dist/components/commonComponents/Dropdown/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Dropdown/demo/demo2.js +38 -0
- package/dist/components/commonComponents/Dropdown/index.d.ts +5 -0
- package/dist/components/commonComponents/Dropdown/index.js +20 -0
- package/dist/components/commonComponents/Dropdown/index.style.d.ts +7 -0
- package/dist/components/commonComponents/Dropdown/index.style.js +21 -0
- package/dist/components/commonComponents/Ellipsis/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/Ellipsis/demo/index.js +11 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo1.js +25 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo2.js +35 -0
- package/dist/components/commonComponents/EllipsisTip/index.d.ts +13 -0
- package/dist/components/commonComponents/EllipsisTip/index.js +30 -0
- package/dist/components/commonComponents/EllipsisTip/index.style.d.ts +10 -0
- package/dist/components/commonComponents/EllipsisTip/index.style.js +24 -0
- package/dist/components/commonComponents/Empty/demo/index.css +11 -0
- package/dist/components/commonComponents/Empty/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Empty/demo/index.js +186 -0
- package/dist/components/commonComponents/Empty/index.d.ts +57 -0
- package/dist/components/commonComponents/Empty/index.js +112 -0
- package/dist/components/commonComponents/Empty/index.style.d.ts +80 -0
- package/dist/components/commonComponents/Empty/index.style.js +43 -0
- package/dist/components/commonComponents/FileIcon/demo/index.d.ts +1 -0
- package/dist/components/commonComponents/FileIcon/demo/index.js +42 -0
- package/dist/components/commonComponents/FileIcon/icons/common.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/epub.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/excel.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/html.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/image.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/md.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/mobi.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/pdf.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/ppt.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/txt.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/web.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/word.svg +1 -0
- package/dist/components/commonComponents/FileIcon/index.d.ts +19 -0
- package/dist/components/commonComponents/FileIcon/index.js +89 -0
- package/dist/components/commonComponents/FileIcon/index.style.d.ts +61 -0
- package/dist/components/commonComponents/FileIcon/index.style.js +42 -0
- package/dist/components/commonComponents/Form/demo/api.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/api.js +22 -0
- package/dist/components/commonComponents/Form/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo1.js +107 -0
- package/dist/components/commonComponents/Form/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo2.js +52 -0
- package/dist/components/commonComponents/Form/demo/demo3.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo3.js +28 -0
- package/dist/components/commonComponents/Form/demo/demo4.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo4.js +29 -0
- package/dist/components/commonComponents/Form/demo/index.module.less +0 -0
- package/dist/components/commonComponents/Form/index.d.ts +27 -0
- package/dist/components/commonComponents/Form/index.js +84 -0
- package/dist/components/commonComponents/Form/index.style.d.ts +49 -0
- package/dist/components/commonComponents/Form/index.style.js +37 -0
- package/dist/components/commonComponents/HelpIcon/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/HelpIcon/demo/index.js +17 -0
- package/dist/components/commonComponents/HelpIcon/index.d.ts +9 -0
- package/dist/components/commonComponents/HelpIcon/index.js +35 -0
- package/dist/components/commonComponents/HelpIcon/index.style.d.ts +12 -0
- package/dist/components/commonComponents/HelpIcon/index.style.js +26 -0
- package/dist/components/commonComponents/IconButton/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo1.js +66 -0
- package/dist/components/commonComponents/IconButton/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo2.js +61 -0
- package/dist/components/commonComponents/IconButton/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo3.js +53 -0
- package/dist/components/commonComponents/IconButton/demo/demo4.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo4.js +55 -0
- package/dist/components/commonComponents/IconButton/index.d.ts +22 -0
- package/dist/components/commonComponents/IconButton/index.js +43 -0
- package/dist/components/commonComponents/IconFont/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo1.js +49 -0
- package/dist/components/commonComponents/IconFont/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo2.js +17 -0
- package/dist/components/commonComponents/IconFont/demo/demo3.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo3.js +17 -0
- package/dist/components/commonComponents/IconFont/demo/demo4.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo4.js +23 -0
- package/dist/components/commonComponents/IconFont/index.d.ts +29 -0
- package/dist/components/commonComponents/IconFont/index.js +57 -0
- package/dist/components/commonComponents/IconFont/index.style.d.ts +67 -0
- package/dist/components/commonComponents/IconFont/index.style.js +44 -0
- package/dist/components/commonComponents/Image/demo/demo1.d.ts +1 -0
- package/dist/components/commonComponents/Image/demo/demo1.js +8 -0
- package/dist/components/commonComponents/Image/index.d.ts +8 -0
- package/dist/components/commonComponents/Image/index.js +37 -0
- package/dist/components/commonComponents/Input/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/Input/demo/index.js +117 -0
- package/dist/components/commonComponents/Input/index.d.ts +13 -0
- package/dist/components/commonComponents/Input/index.js +34 -0
- package/dist/components/commonComponents/Input/index.style.d.ts +36 -0
- package/dist/components/commonComponents/Input/index.style.js +32 -0
- package/dist/components/commonComponents/InputNumber/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/InputNumber/demo/index.js +38 -0
- package/dist/components/commonComponents/InputSearch/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/InputSearch/demo/index.js +43 -0
- package/dist/components/commonComponents/Message/demo.d.ts +2 -0
- package/dist/components/commonComponents/Message/demo.js +53 -0
- package/dist/components/commonComponents/Message/index.d.ts +20 -0
- package/dist/components/commonComponents/Message/index.js +66 -0
- package/dist/components/commonComponents/Modal/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Modal/demo/demo1.js +137 -0
- package/dist/components/commonComponents/Modal/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Modal/demo/demo2.js +77 -0
- package/dist/components/commonComponents/Modal/demo/demo3.d.ts +2 -0
- package/dist/components/commonComponents/Modal/demo/demo3.js +57 -0
- package/dist/components/commonComponents/Modal/demo/demo4.d.ts +3 -0
- package/dist/components/commonComponents/Modal/demo/demo4.js +65 -0
- package/dist/components/commonComponents/Modal/index.css +1 -0
- package/dist/components/commonComponents/Modal/index.d.ts +15 -0
- package/dist/components/commonComponents/Modal/index.js +46 -0
- package/dist/components/commonComponents/Modal/index.style.d.ts +80 -0
- package/dist/components/commonComponents/Modal/index.style.js +58 -0
- package/dist/components/commonComponents/Notification/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Notification/demo/demo1.js +76 -0
- package/dist/components/commonComponents/Notification/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Notification/demo/demo2.js +50 -0
- package/dist/components/commonComponents/Notification/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Notification/demo/demo3.js +46 -0
- package/dist/components/commonComponents/Notification/index.d.ts +20 -0
- package/dist/components/commonComponents/Notification/index.js +106 -0
- package/dist/components/commonComponents/Pagination/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Pagination/demo/demo1.js +14 -0
- package/dist/components/commonComponents/Pagination/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Pagination/demo/demo2.js +16 -0
- package/dist/components/commonComponents/Pagination/index.d.ts +12 -0
- package/dist/components/commonComponents/Pagination/index.js +59 -0
- package/dist/components/commonComponents/Pagination/index.style.d.ts +12 -0
- package/dist/components/commonComponents/Pagination/index.style.js +24 -0
- package/dist/components/commonComponents/Popconfirm/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Popconfirm/demo/index.js +155 -0
- package/dist/components/commonComponents/Popconfirm/index.d.ts +5 -0
- package/dist/components/commonComponents/Popconfirm/index.js +29 -0
- package/dist/components/commonComponents/Popover/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Popover/demo/demo1.js +34 -0
- package/dist/components/commonComponents/Popover/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Popover/demo/demo2.js +183 -0
- package/dist/components/commonComponents/Popover/index.d.ts +4 -0
- package/dist/components/commonComponents/Popover/index.js +27 -0
- package/dist/components/commonComponents/Progress/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Progress/demo/demo1.js +15 -0
- package/dist/components/commonComponents/Radio/demo.d.ts +3 -0
- package/dist/components/commonComponents/Radio/demo.js +20 -0
- package/dist/components/commonComponents/Radio/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Radio/demo2.js +115 -0
- package/dist/components/commonComponents/RadioButton/demo/demo.d.ts +3 -0
- package/dist/components/commonComponents/RadioButton/demo/demo.js +166 -0
- package/dist/components/commonComponents/RadioButton/index.d.ts +21 -0
- package/dist/components/commonComponents/RadioButton/index.js +32 -0
- package/dist/components/commonComponents/RadioButton/index.style.d.ts +62 -0
- package/dist/components/commonComponents/RadioButton/index.style.js +49 -0
- package/dist/components/commonComponents/Select/demo/demo.d.ts +3 -0
- package/dist/components/commonComponents/Select/demo/demo.js +29 -0
- package/dist/components/commonComponents/Select/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Select/demo/demo2.js +30 -0
- package/dist/components/commonComponents/Skeleton/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Skeleton/demo/demo1.js +9 -0
- package/dist/components/commonComponents/SlateEditor/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/demo/index.js +21 -0
- package/dist/components/commonComponents/SlateEditor/elements/S.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/elements/S.js +18 -0
- package/dist/components/commonComponents/SlateEditor/elements/Var.d.ts +3 -0
- package/dist/components/commonComponents/SlateEditor/elements/Var.js +20 -0
- package/dist/components/commonComponents/SlateEditor/elements/index.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/elements/index.js +2 -0
- package/dist/components/commonComponents/SlateEditor/elements/index.less +10 -0
- package/dist/components/commonComponents/SlateEditor/index.d.ts +39 -0
- package/dist/components/commonComponents/SlateEditor/index.js +272 -0
- package/dist/components/commonComponents/SlateEditor/index.style.d.ts +28 -0
- package/dist/components/commonComponents/SlateEditor/index.style.js +36 -0
- package/dist/components/commonComponents/SlateEditor/types.d.ts +56 -0
- package/dist/components/commonComponents/SlateEditor/types.js +1 -0
- package/dist/components/commonComponents/SlateEditor/utils/constant.d.ts +7 -0
- package/dist/components/commonComponents/SlateEditor/utils/constant.js +36 -0
- package/dist/components/commonComponents/SlateEditor/utils/editor.d.ts +68 -0
- package/dist/components/commonComponents/SlateEditor/utils/editor.js +558 -0
- package/dist/components/commonComponents/SlateEditor/utils/functions.d.ts +41 -0
- package/dist/components/commonComponents/SlateEditor/utils/functions.js +179 -0
- package/dist/components/commonComponents/SlateEditor/utils/index.d.ts +4 -0
- package/dist/components/commonComponents/SlateEditor/utils/index.js +4 -0
- package/dist/components/commonComponents/SlateEditor/utils/withEditor.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/utils/withEditor.js +109 -0
- package/dist/components/commonComponents/Slider/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Slider/demo/demo1.js +35 -0
- package/dist/components/commonComponents/Slider/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Slider/demo/demo2.js +48 -0
- package/dist/components/commonComponents/SliderSelector/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/SliderSelector/demo/index.js +41 -0
- package/dist/components/commonComponents/SliderSelector/index.d.ts +16 -0
- package/dist/components/commonComponents/SliderSelector/index.js +67 -0
- package/dist/components/commonComponents/SliderSelector/index.style.d.ts +38 -0
- package/dist/components/commonComponents/SliderSelector/index.style.js +37 -0
- package/dist/components/commonComponents/Spin/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Spin/demo1.js +30 -0
- package/dist/components/commonComponents/Spinner/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Spinner/demo/demo1.js +46 -0
- package/dist/components/commonComponents/Spinner/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Spinner/demo/demo2.js +69 -0
- package/dist/components/commonComponents/Spinner/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Spinner/demo/demo3.js +59 -0
- package/dist/components/commonComponents/Spinner/index.d.ts +16 -0
- package/dist/components/commonComponents/Spinner/index.js +77 -0
- package/dist/components/commonComponents/Spinner/index.style.d.ts +82 -0
- package/dist/components/commonComponents/Spinner/index.style.js +60 -0
- package/dist/components/commonComponents/Switch/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Switch/demo/demo1.js +26 -0
- package/dist/components/commonComponents/Switch/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Switch/demo/demo2.js +27 -0
- package/dist/components/commonComponents/Switch/index.d.ts +11 -0
- package/dist/components/commonComponents/Switch/index.js +29 -0
- package/dist/components/commonComponents/Switch/index.style.d.ts +8 -0
- package/dist/components/commonComponents/Switch/index.style.js +23 -0
- package/dist/components/commonComponents/Table/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Table/demo/demo1.js +87 -0
- package/dist/components/commonComponents/Table/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Table/demo/demo2.js +98 -0
- package/dist/components/commonComponents/Table/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Table/demo/demo3.js +378 -0
- package/dist/components/commonComponents/Tabs/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Tabs/demo/demo1.js +45 -0
- package/dist/components/commonComponents/Tabs/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Tabs/demo/demo2.js +43 -0
- package/dist/components/commonComponents/Tabs/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Tabs/demo/demo3.js +32 -0
- package/dist/components/commonComponents/Tabs/index.d.ts +14 -0
- package/dist/components/commonComponents/Tabs/index.js +67 -0
- package/dist/components/commonComponents/Tabs/index.style.d.ts +23 -0
- package/dist/components/commonComponents/Tabs/index.style.js +30 -0
- package/dist/components/commonComponents/Tag/demo.d.ts +2 -0
- package/dist/components/commonComponents/Tag/demo.js +30 -0
- package/dist/components/commonComponents/Tag/index.d.ts +7 -0
- package/dist/components/commonComponents/Tag/index.js +36 -0
- package/dist/components/commonComponents/Tag/index.style.d.ts +26 -0
- package/dist/components/commonComponents/Tag/index.style.js +48 -0
- package/dist/components/commonComponents/Textarea/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Textarea/demo/demo1.js +36 -0
- package/dist/components/commonComponents/Tooltip/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Tooltip/demo/index.js +254 -0
- package/dist/components/commonComponents/Tooltip/index.d.ts +11 -0
- package/dist/components/commonComponents/Tooltip/index.js +35 -0
- package/dist/components/commonComponents/Tooltip/index.style.d.ts +24 -0
- package/dist/components/commonComponents/Tooltip/index.style.js +32 -0
- package/dist/components/commonComponents/Upload/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Upload/demo/demo1.js +43 -0
- package/dist/components/commonComponents/Upload/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Upload/demo/demo2.js +15 -0
- package/dist/components/commonComponents/Upload/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Upload/demo/demo3.js +145 -0
- package/dist/components/commonComponents/spark.style.d.ts +45 -0
- package/dist/components/commonComponents/spark.style.js +62 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +56 -0
- package/dist/hooks/useGlobalStyle/demo/demo.d.ts +2 -0
- package/dist/hooks/useGlobalStyle/demo/demo.js +47 -0
- package/dist/hooks/useGlobalStyle/index.d.ts +8 -0
- package/dist/hooks/useGlobalStyle/index.js +51 -0
- package/dist/i18n/index.d.ts +33 -0
- package/dist/i18n/index.js +62 -0
- package/dist/i18n/strings/en-US.json +13 -0
- package/dist/i18n/strings/index.js +12 -0
- package/dist/i18n/strings/zh-CN.json +13 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +70 -0
- package/dist/libs/cookie.d.ts +9 -0
- package/dist/libs/cookie.js +19 -0
- package/dist/libs/createStyle/index.d.ts +1 -0
- package/dist/libs/createStyle/index.js +76 -0
- package/dist/libs/data/index.d.ts +15 -0
- package/dist/libs/data/index.js +76 -0
- package/dist/libs/delay/index.d.ts +6 -0
- package/dist/libs/delay/index.js +31 -0
- package/dist/libs/dom.d.ts +8 -0
- package/dist/libs/dom.js +37 -0
- package/dist/libs/env/index.d.ts +10 -0
- package/dist/libs/env/index.js +16 -0
- package/dist/libs/generateCssVars/index.d.ts +19 -0
- package/dist/libs/generateCssVars/index.js +39 -0
- package/dist/libs/loadStyle.d.ts +7 -0
- package/dist/libs/loadStyle.js +41 -0
- package/dist/libs/region/constant.d.ts +6 -0
- package/dist/libs/region/constant.js +154 -0
- package/dist/libs/region/index.d.ts +2 -0
- package/dist/libs/region/index.js +18 -0
- package/dist/libs/requestPop/index.d.ts +52 -0
- package/dist/libs/requestPop/index.js +89 -0
- package/dist/libs/requestPopSse/index.d.ts +35 -0
- package/dist/libs/requestPopSse/index.js +159 -0
- package/dist/libs/requestSse/index.d.ts +47 -0
- package/dist/libs/requestSse/index.js +196 -0
- package/dist/libs/requestSse/parse.d.ts +36 -0
- package/dist/libs/requestSse/parse.js +190 -0
- package/dist/libs/staticRenderer/index.d.ts +8 -0
- package/dist/libs/staticRenderer/index.js +58 -0
- package/dist/libs/string/index.d.ts +19 -0
- package/dist/libs/string/index.js +63 -0
- package/dist/libs/tokens.json +3 -0
- package/dist/libs/utils/index.d.ts +7 -0
- package/dist/libs/utils/index.js +69 -0
- package/dist/libs/waitFor/index.d.ts +25 -0
- package/dist/libs/waitFor/index.js +39 -0
- package/dist/typings.d.ts +14 -0
- package/package.json +173 -0
- package/scripts/init-migrate-config.js +68 -0
- package/scripts/migrate-from-bl.js +78 -0
package/dist/libs/dom.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
8
|
+
* @file dom操作公共方法
|
|
9
|
+
*/
|
|
10
|
+
import createDOMPurify from 'dompurify';
|
|
11
|
+
var DOMPurify = createDOMPurify(window);
|
|
12
|
+
|
|
13
|
+
// 保留a标签的target属性
|
|
14
|
+
var defaultOptions = {
|
|
15
|
+
ADD_ATTR: ['target']
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @function safeHtml(html) 过滤非法html内容
|
|
20
|
+
* @param {string} html 要过滤的html内容
|
|
21
|
+
* @param {object} [options] 过滤时的配置项, 参考https://www.npmjs.com/package/dompurify
|
|
22
|
+
* @returns {string} 返回过滤后的html
|
|
23
|
+
*/
|
|
24
|
+
export function safeHtml(html) {
|
|
25
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
26
|
+
return DOMPurify.sanitize(html || '', _objectSpread(_objectSpread({}, defaultOptions), options));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 查找离triggerNode最近的符合selector的元素
|
|
30
|
+
export var findClosestBySelector = function findClosestBySelector(element, selector) {
|
|
31
|
+
// 从元素本身开始,向上查找最近的符合selector的祖先元素
|
|
32
|
+
var closest = element.closest(selector);
|
|
33
|
+
if (closest) return closest;
|
|
34
|
+
|
|
35
|
+
// 如果没有找到,则尝试document全局查找,退化为原来的逻辑
|
|
36
|
+
return document.querySelector(selector);
|
|
37
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取当前环境语言,例如zh-CN或者en-US
|
|
3
|
+
* @returns {string}
|
|
4
|
+
*/
|
|
5
|
+
export function getLang() {
|
|
6
|
+
var _window$ALIYUN_CONSOL, _window$g_config;
|
|
7
|
+
return ((_window$ALIYUN_CONSOL = window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.LOCALE) || ((_window$g_config = window.g_config) === null || _window$g_config === void 0 || (_window$g_config = _window$g_config.userPreference) === null || _window$g_config === void 0 ? void 0 : _window$g_config.language) || 'zh-CN';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 当前是否是中文语言环境
|
|
12
|
+
* @returns {boolean}
|
|
13
|
+
*/
|
|
14
|
+
export function isCN() {
|
|
15
|
+
return getLang() === 'zh-CN';
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const generateCssVars: (tokens: Array<{
|
|
2
|
+
code: string;
|
|
3
|
+
value: string;
|
|
4
|
+
aliasCode?: string;
|
|
5
|
+
}>) => {
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const generateCssVarsByMap: (tokens: Record<string, string | number>) => {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string | number;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const insertMetaCssVars: (tokens: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
value: string | number;
|
|
16
|
+
}>, { isReload, styleType }?: {
|
|
17
|
+
isReload?: boolean;
|
|
18
|
+
styleType?: string;
|
|
19
|
+
}) => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export var generateCssVars = function generateCssVars(tokens) {
|
|
2
|
+
return tokens.map(function (item) {
|
|
3
|
+
return {
|
|
4
|
+
name: item.aliasCode || "--".concat(item.code.replace(/([A-Z])/g, '-$1').toLowerCase()),
|
|
5
|
+
value: item.value
|
|
6
|
+
};
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
export var generateCssVarsByMap = function generateCssVarsByMap(tokens) {
|
|
10
|
+
return Object.keys(tokens).map(function (key) {
|
|
11
|
+
return {
|
|
12
|
+
name: key,
|
|
13
|
+
value: tokens[key]
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export var insertMetaCssVars = function insertMetaCssVars(tokens) {
|
|
18
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
19
|
+
_ref$isReload = _ref.isReload,
|
|
20
|
+
isReload = _ref$isReload === void 0 ? false : _ref$isReload,
|
|
21
|
+
_ref$styleType = _ref.styleType,
|
|
22
|
+
styleType = _ref$styleType === void 0 ? 'global_bailian_new' : _ref$styleType;
|
|
23
|
+
var oldStyleEle = document.querySelector("style[styleType=".concat(styleType, "]"));
|
|
24
|
+
if (oldStyleEle) {
|
|
25
|
+
if (!isReload) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
document.head.removeChild(oldStyleEle);
|
|
29
|
+
}
|
|
30
|
+
var styleContent = '';
|
|
31
|
+
tokens.forEach(function (item, index) {
|
|
32
|
+
styleContent += " ".concat(item.name, ": ").concat(typeof item.value === 'string' ? item.value : "".concat(item.value, "px"), ";").concat(index < tokens.length - 1 ? '\n' : '');
|
|
33
|
+
});
|
|
34
|
+
styleContent = ":root{\n".concat(styleContent, "\n}");
|
|
35
|
+
var styleEle = document.createElement('style');
|
|
36
|
+
styleEle.setAttribute('styleType', styleType);
|
|
37
|
+
styleEle.textContent = styleContent;
|
|
38
|
+
document.head.appendChild(styleEle);
|
|
39
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @function loadStyle(url, options) 加载style方法
|
|
3
|
+
* @param url 样式文件地址
|
|
4
|
+
* @param options 参数
|
|
5
|
+
* @param options.head 是否插入head标签中,默认false则插入body标签中
|
|
6
|
+
*/
|
|
7
|
+
export function loadStyle(url, opts) {
|
|
8
|
+
if (Array.isArray(url)) {
|
|
9
|
+
return Promise.all(url.map(function (link) {
|
|
10
|
+
return loadStyle(link, opts);
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
if (!url) {
|
|
14
|
+
return Promise.resolve();
|
|
15
|
+
}
|
|
16
|
+
return new Promise(function (resolve) {
|
|
17
|
+
var link = document.createElement('link');
|
|
18
|
+
link.setAttribute('rel', 'stylesheet');
|
|
19
|
+
link.onload = resolve;
|
|
20
|
+
link.onerror = resolve;
|
|
21
|
+
link.href = addExtVersion(url, '.css');
|
|
22
|
+
append(link, opts);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function addExtVersion(url, ext) {
|
|
26
|
+
var src = url.includes(ext) ? url : "".concat(url).concat(ext);
|
|
27
|
+
return src;
|
|
28
|
+
}
|
|
29
|
+
function append(node) {
|
|
30
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
31
|
+
_ref$head = _ref.head,
|
|
32
|
+
head = _ref$head === void 0 ? false : _ref$head;
|
|
33
|
+
if (head === 'after') {
|
|
34
|
+
var first = document.body.firstChild || document.body.childNodes[0];
|
|
35
|
+
document.body.insertBefore(node, first);
|
|
36
|
+
} else if (head) {
|
|
37
|
+
document.head.appendChild(node);
|
|
38
|
+
} else {
|
|
39
|
+
document.body.appendChild(node);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// 中文文档: https://www.alibabacloud.com/help/zh/vpc/developer-reference/api-vpcipam-2023-02-28-endpoint
|
|
2
|
+
// 英文文档: https://www.alibabacloud.com/help/en/vpc/developer-reference/api-vpcipam-2023-02-28-endpoint
|
|
3
|
+
|
|
4
|
+
import { reduce } from 'lodash-es';
|
|
5
|
+
|
|
6
|
+
// 亚太-中国
|
|
7
|
+
var ASIA_CHINA_REGION_ITEMS = [{
|
|
8
|
+
value: 'cn-qingdao',
|
|
9
|
+
label: '华北1(青岛)',
|
|
10
|
+
labelEn: 'China (Qingdao)'
|
|
11
|
+
}, {
|
|
12
|
+
value: 'cn-beijing',
|
|
13
|
+
label: '华北2(北京)',
|
|
14
|
+
labelEn: 'China (Beijing)'
|
|
15
|
+
}, {
|
|
16
|
+
value: 'cn-zhangjiakou',
|
|
17
|
+
label: '华北3(张家口)',
|
|
18
|
+
labelEn: 'China (Zhangjiakou)'
|
|
19
|
+
}, {
|
|
20
|
+
value: 'cn-huhehaote',
|
|
21
|
+
label: '华北5(呼和浩特)',
|
|
22
|
+
labelEn: 'China (Hohhot)'
|
|
23
|
+
}, {
|
|
24
|
+
value: 'cn-wulanchabu',
|
|
25
|
+
label: '华北6(乌兰察布)',
|
|
26
|
+
labelEn: 'China (Ulanqab)'
|
|
27
|
+
}, {
|
|
28
|
+
value: 'cn-hangzhou',
|
|
29
|
+
label: '华东1(杭州)',
|
|
30
|
+
labelEn: 'China (Hangzhou)'
|
|
31
|
+
}, {
|
|
32
|
+
value: 'cn-shanghai',
|
|
33
|
+
label: '华东2(上海)',
|
|
34
|
+
labelEn: 'China (Shanghai)'
|
|
35
|
+
}, {
|
|
36
|
+
value: 'cn-nanjing',
|
|
37
|
+
label: '华东5(南京-本地地域)',
|
|
38
|
+
labelEn: 'China (Nanjing - Local Region)'
|
|
39
|
+
}, {
|
|
40
|
+
value: 'cn-fuzhou',
|
|
41
|
+
label: '华东6(福州-本地地域)',
|
|
42
|
+
labelEn: 'China (Fuzhou - Local Region)'
|
|
43
|
+
}, {
|
|
44
|
+
value: 'cn-shenzhen',
|
|
45
|
+
label: '华南1(深圳)',
|
|
46
|
+
labelEn: 'China (Shenzhen)'
|
|
47
|
+
}, {
|
|
48
|
+
value: 'cn-heyuan',
|
|
49
|
+
label: '华南2(河源)',
|
|
50
|
+
labelEn: 'China (Heyuan)'
|
|
51
|
+
}, {
|
|
52
|
+
value: 'cn-guangzhou',
|
|
53
|
+
label: '华南3(广州)',
|
|
54
|
+
labelEn: 'China (Guangzhou)'
|
|
55
|
+
}, {
|
|
56
|
+
value: 'cn-wuhan-lr',
|
|
57
|
+
label: '华中1(武汉-本地地域)',
|
|
58
|
+
labelEn: 'China (Wuhan - Local Region)'
|
|
59
|
+
}, {
|
|
60
|
+
value: 'cn-chengdu',
|
|
61
|
+
label: '西南1(成都)',
|
|
62
|
+
labelEn: 'China (Chengdu)'
|
|
63
|
+
}, {
|
|
64
|
+
value: 'cn-hongkong',
|
|
65
|
+
label: '中国香港',
|
|
66
|
+
labelEn: 'China (Hong Kong)'
|
|
67
|
+
}];
|
|
68
|
+
// 亚太-其他
|
|
69
|
+
var ASIA_OTHER_REGION_ITEMS = [
|
|
70
|
+
// 澳大利亚(悉尼)已关停
|
|
71
|
+
{
|
|
72
|
+
value: 'ap-southeast-2',
|
|
73
|
+
label: '澳大利亚(悉尼)已关停',
|
|
74
|
+
labelEn: 'Australia (Sydney) Closed'
|
|
75
|
+
}, {
|
|
76
|
+
value: 'ap-southeast-6',
|
|
77
|
+
label: '菲律宾(马尼拉)',
|
|
78
|
+
labelEn: 'Philippines (Manila)'
|
|
79
|
+
}, {
|
|
80
|
+
value: 'ap-northeast-2',
|
|
81
|
+
label: '韩国(首尔)',
|
|
82
|
+
labelEn: 'South Korea (Seoul)'
|
|
83
|
+
}, {
|
|
84
|
+
value: 'ap-southeast-3',
|
|
85
|
+
label: '马来西亚(吉隆坡)',
|
|
86
|
+
labelEn: 'Malaysia (Kuala Lumpur)'
|
|
87
|
+
}, {
|
|
88
|
+
value: 'ap-northeast-1',
|
|
89
|
+
label: '日本(东京)',
|
|
90
|
+
labelEn: 'Japan (Tokyo)'
|
|
91
|
+
}, {
|
|
92
|
+
value: 'ap-southeast-7',
|
|
93
|
+
label: '泰国(曼谷)',
|
|
94
|
+
labelEn: 'Thailand (Bangkok)'
|
|
95
|
+
}, {
|
|
96
|
+
value: 'ap-southeast-1',
|
|
97
|
+
label: '新加坡',
|
|
98
|
+
labelEn: 'Singapore'
|
|
99
|
+
}, {
|
|
100
|
+
value: 'ap-southeast-5',
|
|
101
|
+
label: '印度尼西亚(雅加达)',
|
|
102
|
+
labelEn: 'Indonesia (Jakarta)'
|
|
103
|
+
}];
|
|
104
|
+
// 欧洲与美洲
|
|
105
|
+
var EUROPE_AND_AMERICA_REGION_ITEMS = [{
|
|
106
|
+
value: 'eu-central-1',
|
|
107
|
+
label: '德国(法兰克福)',
|
|
108
|
+
labelEn: 'Germany (Frankfurt)'
|
|
109
|
+
}, {
|
|
110
|
+
value: 'us-east-1',
|
|
111
|
+
label: '美国(弗吉尼亚)',
|
|
112
|
+
labelEn: 'US (Virginia)'
|
|
113
|
+
}, {
|
|
114
|
+
value: 'us-west-1',
|
|
115
|
+
label: '美国(硅谷)',
|
|
116
|
+
labelEn: 'US (Silicon Valley)'
|
|
117
|
+
}, {
|
|
118
|
+
value: 'eu-west-1',
|
|
119
|
+
label: '英国(伦敦)',
|
|
120
|
+
labelEn: 'UK (London)'
|
|
121
|
+
}];
|
|
122
|
+
// 中东
|
|
123
|
+
var MIDDLE_EAST_REGION_ITEMS = [{
|
|
124
|
+
value: 'me-east-1',
|
|
125
|
+
label: '阿联酋(迪拜)',
|
|
126
|
+
labelEn: 'UAE (Dubai)'
|
|
127
|
+
}, {
|
|
128
|
+
value: 'me-central-1',
|
|
129
|
+
label: '沙特(利雅得)',
|
|
130
|
+
labelEn: 'Saudi Arabia (Riyadh)'
|
|
131
|
+
}];
|
|
132
|
+
// 金融云
|
|
133
|
+
var FINANCE_REGION_ITEMS = [{
|
|
134
|
+
value: 'cn-beijing-finance-1',
|
|
135
|
+
label: '华北2 金融云(邀测)',
|
|
136
|
+
labelEn: 'China North 2 Finance (Preview)'
|
|
137
|
+
}, {
|
|
138
|
+
value: 'cn-hangzhou-finance',
|
|
139
|
+
label: '华东1 金融云',
|
|
140
|
+
labelEn: 'China East 1 Finance'
|
|
141
|
+
}, {
|
|
142
|
+
value: 'cn-shanghai-finance-1',
|
|
143
|
+
label: '华东2 金融云',
|
|
144
|
+
labelEn: 'China East 2 Finance'
|
|
145
|
+
}, {
|
|
146
|
+
value: 'cn-shenzhen-finance-1',
|
|
147
|
+
label: '华南1 金融云',
|
|
148
|
+
labelEn: 'China South 1 Finance'
|
|
149
|
+
}];
|
|
150
|
+
export var REGION_ITEMS = [].concat(ASIA_CHINA_REGION_ITEMS, ASIA_OTHER_REGION_ITEMS, EUROPE_AND_AMERICA_REGION_ITEMS, MIDDLE_EAST_REGION_ITEMS, FINANCE_REGION_ITEMS);
|
|
151
|
+
export var REGION_ID_ITEM_MAP = reduce(REGION_ITEMS, function (res, item) {
|
|
152
|
+
res[item.value] = item;
|
|
153
|
+
return res;
|
|
154
|
+
}, {});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { getLang } from "../env";
|
|
8
|
+
import { REGION_ID_ITEM_MAP } from "./constant";
|
|
9
|
+
|
|
10
|
+
/** 获取regionId对应的名称 */
|
|
11
|
+
export function getRegionName(regionId) {
|
|
12
|
+
var _window$ALIYUN_CONSOL;
|
|
13
|
+
var lang = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getLang();
|
|
14
|
+
var regionIdItemMap = _objectSpread(_objectSpread({}, REGION_ID_ITEM_MAP), (_window$ALIYUN_CONSOL = window.ALIYUN_CONSOLE_GLOBAL) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.regionIdItemMap);
|
|
15
|
+
var regionItem = regionIdItemMap[regionId];
|
|
16
|
+
var labelKey = lang === 'zh-CN' ? 'label' : 'labelEn';
|
|
17
|
+
return (regionItem === null || regionItem === void 0 ? void 0 : regionItem[labelKey]) || '';
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface BaseResponse<T> {
|
|
2
|
+
/**
|
|
3
|
+
* 状态码
|
|
4
|
+
*/
|
|
5
|
+
code: string;
|
|
6
|
+
/**
|
|
7
|
+
* 请求结果
|
|
8
|
+
*/
|
|
9
|
+
data: T;
|
|
10
|
+
/**
|
|
11
|
+
* 请求id
|
|
12
|
+
*/
|
|
13
|
+
requestId: string;
|
|
14
|
+
/**
|
|
15
|
+
* 是否成功的response
|
|
16
|
+
*/
|
|
17
|
+
successResponse: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type RequestOptions = AliyunPopOptions & Omit<RequestInit, 'method'>;
|
|
20
|
+
/**
|
|
21
|
+
* 阿里云pop请求配置参数
|
|
22
|
+
*/
|
|
23
|
+
export interface AliyunPopOptions {
|
|
24
|
+
/**
|
|
25
|
+
* 请求action
|
|
26
|
+
*/
|
|
27
|
+
action: string;
|
|
28
|
+
/**
|
|
29
|
+
* 产品名称如sfm_bailian
|
|
30
|
+
*/
|
|
31
|
+
product: string;
|
|
32
|
+
/**
|
|
33
|
+
* 区域如cn-hangzhou
|
|
34
|
+
*/
|
|
35
|
+
region?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 请求地址, 默认/data/api.json
|
|
38
|
+
*/
|
|
39
|
+
url?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 版本号
|
|
42
|
+
*/
|
|
43
|
+
version?: string;
|
|
44
|
+
}
|
|
45
|
+
interface Request {
|
|
46
|
+
<T = any, D = any>(options: RequestOptions, data?: D, extraParams?: Record<string, any>): Promise<T>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 阿里云pop请求
|
|
50
|
+
*/
|
|
51
|
+
declare const requestPop: Request;
|
|
52
|
+
export default requestPop;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["product", "action", "url", "version", "region", "headers"];
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
import { stringify } from 'query-string';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 阿里云pop请求配置参数
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 阿里云pop请求
|
|
21
|
+
*/
|
|
22
|
+
var requestPop = /*#__PURE__*/function () {
|
|
23
|
+
var _requestPop = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options,
|
|
24
|
+
/**
|
|
25
|
+
* 请求参数
|
|
26
|
+
*/
|
|
27
|
+
data,
|
|
28
|
+
/**
|
|
29
|
+
* 其他参数
|
|
30
|
+
* 如{content: "xxx"}
|
|
31
|
+
*/
|
|
32
|
+
extraParams) {
|
|
33
|
+
var _window$ALIYUN_CONSOL;
|
|
34
|
+
var product, action, url, version, region, _options$headers, headers, rest, currentUrl, newData, postOptions, params, response, json;
|
|
35
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
36
|
+
while (1) switch (_context.prev = _context.next) {
|
|
37
|
+
case 0:
|
|
38
|
+
product = options.product, action = options.action, url = options.url, version = options.version, region = options.region, _options$headers = options.headers, headers = _options$headers === void 0 ? {} : _options$headers, rest = _objectWithoutProperties(options, _excluded);
|
|
39
|
+
currentUrl = "".concat(url || '/data/api.json', "?action=").concat(action, "&product=").concat(product);
|
|
40
|
+
if (version) {
|
|
41
|
+
currentUrl += "&version=".concat(version);
|
|
42
|
+
}
|
|
43
|
+
newData = {
|
|
44
|
+
sec_token: ((_window$ALIYUN_CONSOL = window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.SEC_TOKEN) || '',
|
|
45
|
+
region: region
|
|
46
|
+
};
|
|
47
|
+
if (data) {
|
|
48
|
+
newData.params = JSON.stringify(data);
|
|
49
|
+
}
|
|
50
|
+
if (extraParams) {
|
|
51
|
+
Object.assign(newData, extraParams);
|
|
52
|
+
}
|
|
53
|
+
postOptions = _objectSpread({
|
|
54
|
+
method: 'post',
|
|
55
|
+
credentials: 'same-origin',
|
|
56
|
+
headers: _objectSpread({
|
|
57
|
+
Accept: 'application/json',
|
|
58
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
59
|
+
}, headers)
|
|
60
|
+
}, rest);
|
|
61
|
+
params = Object.assign({}, postOptions);
|
|
62
|
+
params.body = stringify(newData);
|
|
63
|
+
_context.next = 11;
|
|
64
|
+
return fetch(currentUrl, params);
|
|
65
|
+
case 11:
|
|
66
|
+
response = _context.sent;
|
|
67
|
+
_context.next = 14;
|
|
68
|
+
return response.json();
|
|
69
|
+
case 14:
|
|
70
|
+
json = _context.sent;
|
|
71
|
+
if (!(json.code !== '200' && !json.successResponse)) {
|
|
72
|
+
_context.next = 17;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return _context.abrupt("return", Promise.reject(json));
|
|
76
|
+
case 17:
|
|
77
|
+
return _context.abrupt("return", json);
|
|
78
|
+
case 18:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context.stop();
|
|
81
|
+
}
|
|
82
|
+
}, _callee);
|
|
83
|
+
}));
|
|
84
|
+
function requestPop(_x, _x2, _x3) {
|
|
85
|
+
return _requestPop.apply(this, arguments);
|
|
86
|
+
}
|
|
87
|
+
return requestPop;
|
|
88
|
+
}();
|
|
89
|
+
export default requestPop;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AliyunPopOptions } from '../requestPop';
|
|
2
|
+
export interface SseResponse {
|
|
3
|
+
dispose: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface SseOptions<T> extends Omit<AliyunPopOptions, 'url'> {
|
|
6
|
+
/**
|
|
7
|
+
* sse请求参数
|
|
8
|
+
*/
|
|
9
|
+
body: any;
|
|
10
|
+
/**
|
|
11
|
+
* 请求token的时候的参数
|
|
12
|
+
*/
|
|
13
|
+
params?: Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* 超时时长
|
|
16
|
+
*/
|
|
17
|
+
timeout?: number;
|
|
18
|
+
/**
|
|
19
|
+
* 发生错误时候的回掉函数
|
|
20
|
+
* @param error 错误信息
|
|
21
|
+
*/
|
|
22
|
+
onError?: (error: any) => void;
|
|
23
|
+
/**
|
|
24
|
+
* 发生消息时候的回调函数
|
|
25
|
+
*/
|
|
26
|
+
onMessage?: (data: T) => void;
|
|
27
|
+
/**
|
|
28
|
+
* 关闭时候的回调函数
|
|
29
|
+
*/
|
|
30
|
+
onClose?: () => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* pop sse请求
|
|
34
|
+
*/
|
|
35
|
+
export default function requestPopSse<T = any>(options: SseOptions<T>): Promise<SseResponse>;
|