naive-ui 2.25.0 → 2.25.3
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/es/_internal/clear/src/Clear.d.ts +0 -1
- package/es/_internal/clear/src/Clear.js +1 -3
- package/es/_internal/icons/replaceable.d.ts +1 -1
- package/es/_internal/icons/replaceable.js +5 -4
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +13 -1
- package/es/_internal/scrollbar/src/ScrollBar.js +35 -16
- package/es/_internal/select-menu/src/SelectMenu.d.ts +22 -18
- package/es/_internal/select-menu/src/SelectMenu.js +13 -10
- package/es/_internal/selection/src/Selection.d.ts +31 -26
- package/es/_internal/selection/src/Selection.js +79 -68
- package/es/_internal/selection/styles/dark.js +3 -3
- package/es/_internal/selection/styles/light.d.ts +6 -6
- package/es/_internal/selection/styles/light.js +3 -3
- package/es/_mixins/index.d.ts +1 -1
- package/es/_mixins/index.js +1 -1
- package/es/_mixins/use-config.d.ts +6 -3
- package/es/_mixins/use-config.js +5 -1
- package/es/_mixins/use-css-vars-class.d.ts +6 -2
- package/es/_mixins/use-css-vars-class.js +31 -15
- package/es/_mixins/use-form-item.d.ts +1 -1
- package/es/_utils/css/color-to-class.d.ts +1 -0
- package/es/_utils/css/color-to-class.js +3 -0
- package/es/_utils/css/format-length.d.ts +2 -2
- package/es/_utils/css/format-length.js +1 -2
- package/es/_utils/css/index.d.ts +2 -1
- package/es/_utils/css/index.js +2 -1
- package/es/_utils/index.d.ts +1 -1
- package/es/_utils/index.js +1 -1
- package/es/_utils/vue/resolve-slot.d.ts +5 -2
- package/es/_utils/vue/resolve-slot.js +4 -4
- package/es/alert/src/Alert.d.ts +7 -5
- package/es/alert/src/Alert.js +36 -21
- package/es/anchor/src/AnchorAdapter.js +9 -3
- package/es/auto-complete/src/AutoComplete.d.ts +4 -2
- package/es/auto-complete/src/AutoComplete.js +28 -15
- package/es/avatar/src/Avatar.d.ts +3 -1
- package/es/avatar/src/Avatar.js +70 -35
- package/es/back-top/src/BackTop.d.ts +12 -49
- package/es/back-top/src/BackTop.js +60 -58
- package/es/badge/src/Badge.d.ts +16 -41
- package/es/badge/src/Badge.js +41 -31
- package/es/breadcrumb/src/Breadcrumb.d.ts +3 -1
- package/es/breadcrumb/src/Breadcrumb.js +24 -16
- package/es/button/src/Button.d.ts +8 -6
- package/es/button/src/Button.js +20 -21
- package/es/button/styles/index.d.ts +1 -1
- package/es/button/styles/index.js +1 -1
- package/es/button/styles/rtl.d.ts +2 -5
- package/es/button/styles/rtl.js +1 -1
- package/es/calendar/src/Calendar.d.ts +3 -1
- package/es/calendar/src/Calendar.js +37 -30
- package/es/card/src/Card.d.ts +3 -1
- package/es/card/src/Card.js +57 -43
- package/es/card/styles/index.d.ts +1 -1
- package/es/card/styles/index.js +1 -1
- package/es/card/styles/rtl.d.ts +2 -5
- package/es/card/styles/rtl.js +1 -1
- package/es/carousel/src/Carousel.d.ts +3 -1
- package/es/carousel/src/Carousel.js +29 -20
- package/es/cascader/src/Cascader.d.ts +46 -31
- package/es/cascader/src/Cascader.js +53 -31
- package/es/cascader/src/CascaderMenu.d.ts +3 -3
- package/es/cascader/src/CascaderMenu.js +7 -6
- package/es/cascader/src/CascaderOption.d.ts +3 -3
- package/es/cascader/src/CascaderSelectMenu.d.ts +3 -3
- package/es/cascader/src/CascaderSelectMenu.js +2 -1
- package/es/cascader/src/CascaderSubmenu.d.ts +4 -3
- package/es/cascader/src/interface.d.ts +1 -0
- package/es/cascader/styles/light.d.ts +3 -3
- package/es/checkbox/src/Checkbox.d.ts +6 -4
- package/es/checkbox/src/Checkbox.js +41 -32
- package/es/checkbox/src/styles/index.cssr.js +17 -17
- package/es/code/src/Code.d.ts +3 -1
- package/es/code/src/Code.js +33 -27
- package/es/collapse/src/Collapse.d.ts +3 -1
- package/es/collapse/src/Collapse.js +24 -16
- package/es/color-picker/src/ColorPicker.d.ts +3 -1
- package/es/color-picker/src/ColorPicker.js +20 -7
- package/es/components.d.ts +1 -0
- package/es/components.js +1 -0
- package/es/config-provider/src/ConfigProvider.d.ts +4 -4
- package/es/config-provider/src/ConfigProvider.js +3 -3
- package/es/config-provider/src/internal-interface.d.ts +3 -1
- package/es/countdown/src/Countdown.d.ts +0 -3
- package/es/countdown/src/Countdown.js +0 -1
- package/es/data-table/src/DataTable.d.ts +77 -75
- package/es/data-table/src/DataTable.js +54 -48
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +6 -6
- package/es/data-table/src/HeaderButton/FilterButton.js +3 -2
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +6 -6
- package/es/data-table/src/HeaderButton/SortButton.js +3 -2
- package/es/data-table/src/TableParts/Body.d.ts +7 -6
- package/es/data-table/src/TableParts/Body.js +4 -2
- package/es/data-table/src/TableParts/Cell.d.ts +12 -12
- package/es/data-table/src/TableParts/Header.d.ts +6 -6
- package/es/data-table/src/interface.d.ts +1 -1
- package/es/data-table/src/use-table-data.js +19 -7
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/date-picker/src/DatePicker.d.ts +1 -0
- package/es/date-picker/src/DatePicker.js +2 -2
- package/es/date-picker/src/panel/date.d.ts +2 -0
- package/es/date-picker/src/panel/datetime.d.ts +2 -0
- package/es/date-picker/src/panel/month.d.ts +2 -0
- package/es/date-picker/src/panel/panelHeader.d.ts +4 -0
- package/es/date-picker/src/panel/use-calendar.d.ts +2 -0
- package/es/descriptions/src/Descriptions.d.ts +15 -2
- package/es/descriptions/src/Descriptions.js +45 -28
- package/es/descriptions/src/styles/index.cssr.js +2 -1
- package/es/descriptions/styles/light.d.ts +1 -0
- package/es/descriptions/styles/light.js +2 -2
- package/es/dialog/src/Dialog.d.ts +7 -5
- package/es/dialog/src/Dialog.js +57 -56
- package/es/dialog/src/DialogEnvironment.d.ts +5 -5
- package/es/dialog/src/DialogEnvironment.js +1 -1
- package/es/dialog/src/DialogProvider.d.ts +2 -2
- package/es/dialog/src/dialogProps.d.ts +2 -2
- package/es/divider/src/Divider.d.ts +3 -1
- package/es/divider/src/Divider.js +20 -11
- package/es/dynamic-input/src/DynamicInput.js +2 -2
- package/es/dynamic-tags/src/DynamicTags.d.ts +7 -5
- package/es/dynamic-tags/src/DynamicTags.js +17 -10
- package/es/element/src/Element.d.ts +3 -1
- package/es/element/src/Element.js +18 -11
- package/es/empty/src/Empty.d.ts +3 -1
- package/es/empty/src/Empty.js +28 -16
- package/es/form/src/FormItem.d.ts +4 -4
- package/es/form/src/FormItem.js +1 -2
- package/es/form/src/FormItemCol.d.ts +3 -3
- package/es/form/src/FormItemGridItem.d.ts +5 -5
- package/es/form/src/FormItemRow.d.ts +3 -3
- package/es/form/src/utils.d.ts +1 -1
- package/es/gradient-text/src/GradientText.d.ts +5 -5
- package/es/grid/src/Grid.js +2 -2
- package/es/icon-wrapper/src/IconWrapper.js +6 -6
- package/es/image/src/Image.d.ts +1 -1
- package/es/input/src/Input.d.ts +7 -4
- package/es/input/src/Input.js +96 -84
- package/es/input/src/styles/input.cssr.js +2 -2
- package/es/input-number/src/InputNumber.d.ts +7 -18
- package/es/input-number/src/InputNumber.js +79 -20
- package/es/layout/src/Layout.d.ts +8 -2
- package/es/layout/src/Layout.js +17 -10
- package/es/layout/src/LayoutContent.d.ts +4 -1
- package/es/layout/src/LayoutFooter.d.ts +3 -1
- package/es/layout/src/LayoutFooter.js +28 -19
- package/es/layout/src/LayoutHeader.d.ts +3 -1
- package/es/layout/src/LayoutHeader.js +28 -19
- package/es/layout/src/LayoutSider.d.ts +4 -0
- package/es/layout/src/LayoutSider.js +37 -29
- package/es/locales/common/deDE.js +13 -15
- package/es/locales/common/enGB.d.ts +109 -0
- package/es/locales/common/enGB.js +109 -0
- package/es/locales/common/eo.d.ts +109 -0
- package/es/locales/common/eo.js +109 -0
- package/es/locales/common/esAR.js +2 -2
- package/es/locales/common/frFR.js +8 -9
- package/es/locales/common/plPL.d.ts +3 -0
- package/es/locales/common/plPL.js +109 -0
- package/es/locales/common/skSK.d.ts +3 -0
- package/es/locales/common/skSK.js +110 -0
- package/es/locales/date/enGB.d.ts +3 -0
- package/es/locales/date/enGB.js +6 -0
- package/es/locales/date/eo.d.ts +3 -0
- package/es/locales/date/eo.js +6 -0
- package/es/locales/date/plPL.d.ts +3 -0
- package/es/locales/date/plPL.js +6 -0
- package/es/locales/date/skSK.d.ts +3 -0
- package/es/locales/date/skSK.js +6 -0
- package/es/locales/index.d.ts +8 -0
- package/es/locales/index.js +8 -0
- package/es/log/src/Log.d.ts +4 -1
- package/es/log/src/Log.js +20 -15
- package/es/mention/index.d.ts +1 -1
- package/es/mention/src/Mention.d.ts +1 -1
- package/es/mention/src/interface.d.ts +4 -0
- package/es/menu/src/Menu.d.ts +4 -2
- package/es/menu/src/Menu.js +68 -63
- package/es/modal/src/BodyWrapper.d.ts +7 -6
- package/es/modal/src/Modal.d.ts +19 -22
- package/es/modal/src/Modal.js +41 -32
- package/es/modal/src/presetProps.d.ts +2 -2
- package/es/notification/src/Notification.d.ts +4 -4
- package/es/notification/src/NotificationEnvironment.d.ts +4 -4
- package/es/notification/src/NotificationProvider.d.ts +1 -1
- package/es/notification/src/styles/index.cssr.js +6 -5
- package/es/page-header/src/PageHeader.d.ts +3 -1
- package/es/page-header/src/PageHeader.js +27 -18
- package/es/pagination/src/Pagination.d.ts +46 -34
- package/es/pagination/src/Pagination.js +59 -52
- package/es/pagination/styles/light.d.ts +3 -3
- package/es/popover/src/PopoverBody.js +10 -4
- package/es/progress/src/Circle.d.ts +19 -3
- package/es/progress/src/Circle.js +41 -22
- package/es/progress/src/Progress.d.ts +14 -5
- package/es/progress/src/Progress.js +45 -25
- package/es/progress/src/styles/index.cssr.js +1 -1
- package/es/radio/src/Radio.d.ts +3 -1
- package/es/radio/src/Radio.js +32 -23
- package/es/radio/src/RadioGroup.d.ts +3 -1
- package/es/radio/src/RadioGroup.js +31 -22
- package/es/rate/src/Rate.d.ts +3 -1
- package/es/rate/src/Rate.js +44 -23
- package/es/result/src/Result.d.ts +8 -6
- package/es/result/src/Result.js +36 -19
- package/es/scrollbar/src/ScrollBar.d.ts +12 -1
- package/es/scrollbar/src/ScrollBar.js +4 -0
- package/es/select/src/Select.d.ts +45 -31
- package/es/select/src/Select.js +14 -8
- package/es/select/styles/light.d.ts +3 -3
- package/es/spin/src/Spin.d.ts +3 -1
- package/es/spin/src/Spin.js +31 -21
- package/es/statistic/src/Statistic.d.ts +3 -1
- package/es/statistic/src/Statistic.js +29 -21
- package/es/styles.d.ts +1 -0
- package/es/styles.js +1 -0
- package/es/switch/src/Switch.d.ts +13 -1
- package/es/switch/src/Switch.js +85 -60
- package/es/switch/src/styles/index.cssr.js +21 -8
- package/es/switch/styles/dark.js +2 -2
- package/es/switch/styles/light.d.ts +1 -0
- package/es/switch/styles/light.js +2 -2
- package/es/table/src/Table.d.ts +3 -1
- package/es/table/src/Table.js +40 -29
- package/es/table/src/styles/index.cssr.js +1 -1
- package/es/tabs/src/Tabs.d.ts +25 -23
- package/es/tabs/src/Tabs.js +50 -44
- package/es/tabs/src/styles/index.cssr.js +77 -77
- package/es/tag/src/Tag.d.ts +7 -5
- package/es/tag/src/Tag.js +59 -42
- package/es/tag/src/common-props.d.ts +1 -1
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/tag/styles/index.d.ts +1 -1
- package/es/tag/styles/index.js +1 -1
- package/es/tag/styles/rtl.d.ts +2 -5
- package/es/tag/styles/rtl.js +1 -1
- package/es/theme-editor/src/ThemeEditor.js +4 -3
- package/es/themes/dark.js +3 -1
- package/es/themes/light.js +3 -1
- package/es/thing/src/Thing.js +10 -3
- package/es/time-picker/src/TimePicker.d.ts +4 -0
- package/es/timeline/src/TimelineItem.d.ts +4 -4
- package/es/transfer/src/TransferList.d.ts +1 -0
- package/es/tree/src/Tree.d.ts +1 -0
- package/es/tree/src/Tree.js +8 -4
- package/es/tree/src/utils.js +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +43 -30
- package/es/tree-select/src/TreeSelect.js +6 -2
- package/es/tree-select/styles/light.d.ts +3 -3
- package/es/typography/src/a.d.ts +3 -1
- package/es/typography/src/a.js +18 -10
- package/es/typography/src/blockquote.d.ts +3 -1
- package/es/typography/src/blockquote.js +21 -12
- package/es/typography/src/create-header.d.ts +7 -5
- package/es/typography/src/create-header.js +25 -16
- package/es/typography/src/headers.d.ts +36 -24
- package/es/typography/src/hr.d.ts +3 -1
- package/es/typography/src/hr.js +18 -10
- package/es/typography/src/ol.d.ts +3 -1
- package/es/typography/src/ol.js +23 -14
- package/es/typography/src/p.d.ts +3 -1
- package/es/typography/src/p.js +23 -15
- package/es/typography/src/text.d.ts +3 -1
- package/es/typography/src/text.js +31 -23
- package/es/typography/src/ul.d.ts +3 -1
- package/es/typography/src/ul.js +23 -14
- package/es/upload/src/UploadFile.d.ts +1 -1
- package/es/upload/src/UploadProgress.d.ts +2 -2
- package/es/upload/src/interface.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/es/watermark/index.d.ts +2 -0
- package/es/watermark/index.js +1 -0
- package/es/watermark/src/Watermark.d.ts +285 -0
- package/es/watermark/src/Watermark.js +159 -0
- package/es/watermark/src/styles/index.cssr.d.ts +2 -0
- package/es/watermark/src/styles/index.cssr.js +14 -0
- package/es/watermark/styles/dark.d.ts +3 -0
- package/es/watermark/styles/dark.js +12 -0
- package/es/watermark/styles/index.d.ts +3 -0
- package/es/watermark/styles/index.js +2 -0
- package/es/watermark/styles/light.d.ts +5 -0
- package/es/watermark/styles/light.js +13 -0
- package/lib/_internal/clear/src/Clear.d.ts +0 -1
- package/lib/_internal/clear/src/Clear.js +0 -2
- package/lib/_internal/icons/replaceable.d.ts +1 -1
- package/lib/_internal/icons/replaceable.js +4 -3
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +13 -1
- package/lib/_internal/scrollbar/src/ScrollBar.js +34 -15
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +22 -18
- package/lib/_internal/select-menu/src/SelectMenu.js +12 -9
- package/lib/_internal/selection/src/Selection.d.ts +31 -26
- package/lib/_internal/selection/src/Selection.js +78 -67
- package/lib/_internal/selection/styles/dark.js +3 -3
- package/lib/_internal/selection/styles/light.d.ts +6 -6
- package/lib/_internal/selection/styles/light.js +3 -3
- package/lib/_mixins/index.d.ts +1 -1
- package/lib/_mixins/index.js +2 -2
- package/lib/_mixins/use-config.d.ts +6 -3
- package/lib/_mixins/use-config.js +5 -1
- package/lib/_mixins/use-css-vars-class.d.ts +6 -2
- package/lib/_mixins/use-css-vars-class.js +33 -17
- package/lib/_mixins/use-form-item.d.ts +1 -1
- package/lib/_utils/css/color-to-class.d.ts +1 -0
- package/lib/_utils/css/color-to-class.js +7 -0
- package/lib/_utils/css/format-length.d.ts +2 -2
- package/lib/_utils/css/format-length.js +2 -1
- package/lib/_utils/css/index.d.ts +2 -1
- package/lib/_utils/css/index.js +4 -5
- package/lib/_utils/index.d.ts +1 -1
- package/lib/_utils/index.js +2 -1
- package/lib/_utils/vue/resolve-slot.d.ts +5 -2
- package/lib/_utils/vue/resolve-slot.js +4 -4
- package/lib/alert/src/Alert.d.ts +7 -5
- package/lib/alert/src/Alert.js +34 -19
- package/lib/anchor/src/AnchorAdapter.js +8 -2
- package/lib/auto-complete/src/AutoComplete.d.ts +4 -2
- package/lib/auto-complete/src/AutoComplete.js +27 -14
- package/lib/avatar/src/Avatar.d.ts +3 -1
- package/lib/avatar/src/Avatar.js +68 -33
- package/lib/back-top/src/BackTop.d.ts +12 -49
- package/lib/back-top/src/BackTop.js +57 -55
- package/lib/badge/src/Badge.d.ts +16 -41
- package/lib/badge/src/Badge.js +39 -29
- package/lib/breadcrumb/src/Breadcrumb.d.ts +3 -1
- package/lib/breadcrumb/src/Breadcrumb.js +23 -15
- package/lib/button/src/Button.d.ts +8 -6
- package/lib/button/src/Button.js +18 -19
- package/lib/button/styles/index.d.ts +1 -1
- package/lib/button/styles/index.js +1 -1
- package/lib/button/styles/rtl.d.ts +2 -5
- package/lib/button/styles/rtl.js +2 -1
- package/lib/calendar/src/Calendar.d.ts +3 -1
- package/lib/calendar/src/Calendar.js +36 -29
- package/lib/card/src/Card.d.ts +3 -1
- package/lib/card/src/Card.js +55 -41
- package/lib/card/styles/index.d.ts +1 -1
- package/lib/card/styles/index.js +1 -1
- package/lib/card/styles/rtl.d.ts +2 -5
- package/lib/card/styles/rtl.js +2 -1
- package/lib/carousel/src/Carousel.d.ts +3 -1
- package/lib/carousel/src/Carousel.js +27 -18
- package/lib/cascader/src/Cascader.d.ts +46 -31
- package/lib/cascader/src/Cascader.js +52 -30
- package/lib/cascader/src/CascaderMenu.d.ts +3 -3
- package/lib/cascader/src/CascaderMenu.js +7 -6
- package/lib/cascader/src/CascaderOption.d.ts +3 -3
- package/lib/cascader/src/CascaderSelectMenu.d.ts +3 -3
- package/lib/cascader/src/CascaderSelectMenu.js +2 -1
- package/lib/cascader/src/CascaderSubmenu.d.ts +4 -3
- package/lib/cascader/src/interface.d.ts +1 -0
- package/lib/cascader/styles/light.d.ts +3 -3
- package/lib/checkbox/src/Checkbox.d.ts +6 -4
- package/lib/checkbox/src/Checkbox.js +40 -31
- package/lib/checkbox/src/styles/index.cssr.js +17 -17
- package/lib/code/src/Code.d.ts +3 -1
- package/lib/code/src/Code.js +32 -26
- package/lib/collapse/src/Collapse.d.ts +3 -1
- package/lib/collapse/src/Collapse.js +23 -15
- package/lib/color-picker/src/ColorPicker.d.ts +3 -1
- package/lib/color-picker/src/ColorPicker.js +19 -6
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/ConfigProvider.d.ts +4 -4
- package/lib/config-provider/src/ConfigProvider.js +3 -3
- package/lib/config-provider/src/internal-interface.d.ts +3 -1
- package/lib/countdown/src/Countdown.d.ts +0 -3
- package/lib/countdown/src/Countdown.js +0 -1
- package/lib/data-table/src/DataTable.d.ts +77 -75
- package/lib/data-table/src/DataTable.js +53 -47
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +6 -6
- package/lib/data-table/src/HeaderButton/FilterButton.js +3 -2
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +6 -6
- package/lib/data-table/src/HeaderButton/SortButton.js +3 -2
- package/lib/data-table/src/TableParts/Body.d.ts +7 -6
- package/lib/data-table/src/TableParts/Body.js +3 -1
- package/lib/data-table/src/TableParts/Cell.d.ts +12 -12
- package/lib/data-table/src/TableParts/Header.d.ts +6 -6
- package/lib/data-table/src/interface.d.ts +1 -1
- package/lib/data-table/src/use-table-data.js +19 -7
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +1 -0
- package/lib/date-picker/src/DatePicker.js +2 -2
- package/lib/date-picker/src/panel/date.d.ts +2 -0
- package/lib/date-picker/src/panel/datetime.d.ts +2 -0
- package/lib/date-picker/src/panel/month.d.ts +2 -0
- package/lib/date-picker/src/panel/panelHeader.d.ts +4 -0
- package/lib/date-picker/src/panel/use-calendar.d.ts +2 -0
- package/lib/descriptions/src/Descriptions.d.ts +15 -2
- package/lib/descriptions/src/Descriptions.js +44 -27
- package/lib/descriptions/src/styles/index.cssr.js +2 -1
- package/lib/descriptions/styles/light.d.ts +1 -0
- package/lib/descriptions/styles/light.js +2 -2
- package/lib/dialog/src/Dialog.d.ts +7 -5
- package/lib/dialog/src/Dialog.js +55 -54
- package/lib/dialog/src/DialogEnvironment.d.ts +5 -5
- package/lib/dialog/src/DialogEnvironment.js +1 -1
- package/lib/dialog/src/DialogProvider.d.ts +2 -2
- package/lib/dialog/src/dialogProps.d.ts +2 -2
- package/lib/divider/src/Divider.d.ts +3 -1
- package/lib/divider/src/Divider.js +19 -10
- package/lib/dynamic-input/src/DynamicInput.js +2 -2
- package/lib/dynamic-tags/src/DynamicTags.d.ts +7 -5
- package/lib/dynamic-tags/src/DynamicTags.js +16 -9
- package/lib/element/src/Element.d.ts +3 -1
- package/lib/element/src/Element.js +17 -10
- package/lib/empty/src/Empty.d.ts +3 -1
- package/lib/empty/src/Empty.js +27 -15
- package/lib/form/src/FormItem.d.ts +4 -4
- package/lib/form/src/FormItem.js +1 -2
- package/lib/form/src/FormItemCol.d.ts +3 -3
- package/lib/form/src/FormItemGridItem.d.ts +5 -5
- package/lib/form/src/FormItemRow.d.ts +3 -3
- package/lib/form/src/utils.d.ts +1 -1
- package/lib/gradient-text/src/GradientText.d.ts +5 -5
- package/lib/grid/src/Grid.js +2 -2
- package/lib/icon-wrapper/src/IconWrapper.js +5 -5
- package/lib/image/src/Image.d.ts +1 -1
- package/lib/input/src/Input.d.ts +7 -4
- package/lib/input/src/Input.js +95 -83
- package/lib/input/src/styles/input.cssr.js +2 -2
- package/lib/input-number/src/InputNumber.d.ts +7 -18
- package/lib/input-number/src/InputNumber.js +76 -17
- package/lib/layout/src/Layout.d.ts +8 -2
- package/lib/layout/src/Layout.js +16 -9
- package/lib/layout/src/LayoutContent.d.ts +4 -1
- package/lib/layout/src/LayoutFooter.d.ts +3 -1
- package/lib/layout/src/LayoutFooter.js +27 -18
- package/lib/layout/src/LayoutHeader.d.ts +3 -1
- package/lib/layout/src/LayoutHeader.js +27 -18
- package/lib/layout/src/LayoutSider.d.ts +4 -0
- package/lib/layout/src/LayoutSider.js +36 -28
- package/lib/locales/common/deDE.js +13 -15
- package/lib/locales/common/enGB.d.ts +109 -0
- package/lib/locales/common/enGB.js +111 -0
- package/lib/locales/common/eo.d.ts +109 -0
- package/lib/locales/common/eo.js +111 -0
- package/lib/locales/common/esAR.js +2 -2
- package/lib/locales/common/frFR.js +8 -9
- package/lib/locales/common/plPL.d.ts +3 -0
- package/lib/locales/common/plPL.js +111 -0
- package/lib/locales/common/skSK.d.ts +3 -0
- package/lib/locales/common/skSK.js +112 -0
- package/lib/locales/date/enGB.d.ts +3 -0
- package/lib/locales/date/enGB.js +11 -0
- package/lib/locales/date/eo.d.ts +3 -0
- package/lib/locales/date/eo.js +11 -0
- package/lib/locales/date/plPL.d.ts +3 -0
- package/lib/locales/date/plPL.js +11 -0
- package/lib/locales/date/skSK.d.ts +3 -0
- package/lib/locales/date/skSK.js +11 -0
- package/lib/locales/index.d.ts +8 -0
- package/lib/locales/index.js +17 -1
- package/lib/log/src/Log.d.ts +4 -1
- package/lib/log/src/Log.js +19 -14
- package/lib/mention/index.d.ts +1 -1
- package/lib/mention/src/Mention.d.ts +1 -1
- package/lib/mention/src/interface.d.ts +4 -0
- package/lib/menu/src/Menu.d.ts +4 -2
- package/lib/menu/src/Menu.js +67 -62
- package/lib/modal/src/BodyWrapper.d.ts +7 -6
- package/lib/modal/src/Modal.d.ts +19 -22
- package/lib/modal/src/Modal.js +40 -31
- package/lib/modal/src/presetProps.d.ts +2 -2
- package/lib/notification/src/Notification.d.ts +4 -4
- package/lib/notification/src/NotificationEnvironment.d.ts +4 -4
- package/lib/notification/src/NotificationProvider.d.ts +1 -1
- package/lib/notification/src/styles/index.cssr.js +6 -5
- package/lib/page-header/src/PageHeader.d.ts +3 -1
- package/lib/page-header/src/PageHeader.js +26 -17
- package/lib/pagination/src/Pagination.d.ts +46 -34
- package/lib/pagination/src/Pagination.js +58 -51
- package/lib/pagination/styles/light.d.ts +3 -3
- package/lib/popover/src/PopoverBody.js +9 -3
- package/lib/progress/src/Circle.d.ts +19 -3
- package/lib/progress/src/Circle.js +40 -21
- package/lib/progress/src/Progress.d.ts +14 -5
- package/lib/progress/src/Progress.js +44 -24
- package/lib/progress/src/styles/index.cssr.js +1 -1
- package/lib/radio/src/Radio.d.ts +3 -1
- package/lib/radio/src/Radio.js +31 -22
- package/lib/radio/src/RadioGroup.d.ts +3 -1
- package/lib/radio/src/RadioGroup.js +30 -21
- package/lib/rate/src/Rate.d.ts +3 -1
- package/lib/rate/src/Rate.js +42 -21
- package/lib/result/src/Result.d.ts +8 -6
- package/lib/result/src/Result.js +35 -18
- package/lib/scrollbar/src/ScrollBar.d.ts +12 -1
- package/lib/scrollbar/src/ScrollBar.js +4 -0
- package/lib/select/src/Select.d.ts +45 -31
- package/lib/select/src/Select.js +14 -8
- package/lib/select/styles/light.d.ts +3 -3
- package/lib/spin/src/Spin.d.ts +3 -1
- package/lib/spin/src/Spin.js +30 -20
- package/lib/statistic/src/Statistic.d.ts +3 -1
- package/lib/statistic/src/Statistic.js +28 -20
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +9 -7
- package/lib/switch/src/Switch.d.ts +13 -1
- package/lib/switch/src/Switch.js +81 -56
- package/lib/switch/src/styles/index.cssr.js +21 -8
- package/lib/switch/styles/dark.js +2 -2
- package/lib/switch/styles/light.d.ts +1 -0
- package/lib/switch/styles/light.js +2 -2
- package/lib/table/src/Table.d.ts +3 -1
- package/lib/table/src/Table.js +39 -28
- package/lib/table/src/styles/index.cssr.js +1 -1
- package/lib/tabs/src/Tabs.d.ts +25 -23
- package/lib/tabs/src/Tabs.js +48 -42
- package/lib/tabs/src/styles/index.cssr.js +77 -77
- package/lib/tag/src/Tag.d.ts +7 -5
- package/lib/tag/src/Tag.js +57 -40
- package/lib/tag/src/common-props.d.ts +1 -1
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/tag/styles/index.d.ts +1 -1
- package/lib/tag/styles/index.js +1 -1
- package/lib/tag/styles/rtl.d.ts +2 -5
- package/lib/tag/styles/rtl.js +2 -1
- package/lib/theme-editor/src/ThemeEditor.js +2 -1
- package/lib/themes/dark.js +3 -1
- package/lib/themes/light.js +3 -1
- package/lib/thing/src/Thing.js +9 -2
- package/lib/time-picker/src/TimePicker.d.ts +4 -0
- package/lib/timeline/src/TimelineItem.d.ts +4 -4
- package/lib/transfer/src/TransferList.d.ts +1 -0
- package/lib/tree/src/Tree.d.ts +1 -0
- package/lib/tree/src/Tree.js +8 -4
- package/lib/tree/src/utils.js +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +43 -30
- package/lib/tree-select/src/TreeSelect.js +6 -2
- package/lib/tree-select/styles/light.d.ts +3 -3
- package/lib/typography/src/a.d.ts +3 -1
- package/lib/typography/src/a.js +17 -9
- package/lib/typography/src/blockquote.d.ts +3 -1
- package/lib/typography/src/blockquote.js +20 -11
- package/lib/typography/src/create-header.d.ts +7 -5
- package/lib/typography/src/create-header.js +24 -15
- package/lib/typography/src/headers.d.ts +36 -24
- package/lib/typography/src/hr.d.ts +3 -1
- package/lib/typography/src/hr.js +17 -9
- package/lib/typography/src/ol.d.ts +3 -1
- package/lib/typography/src/ol.js +22 -13
- package/lib/typography/src/p.d.ts +3 -1
- package/lib/typography/src/p.js +22 -14
- package/lib/typography/src/text.d.ts +3 -1
- package/lib/typography/src/text.js +30 -22
- package/lib/typography/src/ul.d.ts +3 -1
- package/lib/typography/src/ul.js +22 -13
- package/lib/upload/src/UploadFile.d.ts +1 -1
- package/lib/upload/src/UploadProgress.d.ts +2 -2
- package/lib/upload/src/interface.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/watermark/index.d.ts +2 -0
- package/lib/watermark/index.js +8 -0
- package/lib/watermark/src/Watermark.d.ts +285 -0
- package/lib/watermark/src/Watermark.js +164 -0
- package/lib/watermark/src/styles/index.cssr.d.ts +2 -0
- package/lib/watermark/src/styles/index.cssr.js +21 -0
- package/lib/watermark/styles/dark.d.ts +3 -0
- package/lib/watermark/styles/dark.js +14 -0
- package/lib/watermark/styles/index.d.ts +3 -0
- package/lib/watermark/styles/index.js +10 -0
- package/lib/watermark/styles/light.d.ts +5 -0
- package/lib/watermark/styles/light.js +15 -0
- package/package.json +9 -10
- package/volar.d.ts +1 -0
- package/web-types.json +279 -29
|
@@ -26,7 +26,7 @@ declare const selectLight: import("../../_mixins").Theme<"Select", {
|
|
|
26
26
|
borderHover: string;
|
|
27
27
|
borderActive: string;
|
|
28
28
|
borderFocus: string;
|
|
29
|
-
boxShadowHover:
|
|
29
|
+
boxShadowHover: string;
|
|
30
30
|
boxShadowActive: string;
|
|
31
31
|
boxShadowFocus: string;
|
|
32
32
|
caretColor: string;
|
|
@@ -37,7 +37,7 @@ declare const selectLight: import("../../_mixins").Theme<"Select", {
|
|
|
37
37
|
borderHoverWarning: string;
|
|
38
38
|
borderActiveWarning: string;
|
|
39
39
|
borderFocusWarning: string;
|
|
40
|
-
boxShadowHoverWarning:
|
|
40
|
+
boxShadowHoverWarning: string;
|
|
41
41
|
boxShadowActiveWarning: string;
|
|
42
42
|
boxShadowFocusWarning: string;
|
|
43
43
|
colorActiveWarning: string;
|
|
@@ -46,7 +46,7 @@ declare const selectLight: import("../../_mixins").Theme<"Select", {
|
|
|
46
46
|
borderHoverError: string;
|
|
47
47
|
borderActiveError: string;
|
|
48
48
|
borderFocusError: string;
|
|
49
|
-
boxShadowHoverError:
|
|
49
|
+
boxShadowHoverError: string;
|
|
50
50
|
boxShadowActiveError: string;
|
|
51
51
|
boxShadowFocusError: string;
|
|
52
52
|
colorActiveError: string;
|
package/lib/spin/src/Spin.d.ts
CHANGED
|
@@ -120,7 +120,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
120
120
|
'--n-size': string;
|
|
121
121
|
'--n-color': string;
|
|
122
122
|
'--n-text-color': string;
|
|
123
|
-
}
|
|
123
|
+
}> | undefined;
|
|
124
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
125
|
+
onRender: (() => void) | undefined;
|
|
124
126
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
125
127
|
description: StringConstructor;
|
|
126
128
|
stroke: StringConstructor;
|
package/lib/spin/src/Spin.js
CHANGED
|
@@ -43,8 +43,29 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
46
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
47
47
|
const themeRef = (0, _mixins_1.useTheme)('Spin', '-spin', index_cssr_1.default, styles_1.spinLight, props, mergedClsPrefixRef);
|
|
48
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
49
|
+
const { size: spinSize } = props;
|
|
50
|
+
const { common: { cubicBezierEaseInOut }, self } = themeRef.value;
|
|
51
|
+
const { opacitySpinning, color, textColor } = self;
|
|
52
|
+
const size = typeof spinSize === 'number'
|
|
53
|
+
? (0, seemly_1.pxfy)(spinSize)
|
|
54
|
+
: self[(0, _utils_1.createKey)('size', spinSize)];
|
|
55
|
+
return {
|
|
56
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
57
|
+
'--n-opacity-spinning': opacitySpinning,
|
|
58
|
+
'--n-size': size,
|
|
59
|
+
'--n-color': color,
|
|
60
|
+
'--n-text-color': textColor
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
const themeClassHandle = inlineThemeDisabled
|
|
64
|
+
? (0, _mixins_1.useThemeClass)('spin', (0, vue_1.computed)(() => {
|
|
65
|
+
const { size } = props;
|
|
66
|
+
return typeof size === 'number' ? String(size) : size[0];
|
|
67
|
+
}), cssVarsRef, props)
|
|
68
|
+
: undefined;
|
|
48
69
|
return {
|
|
49
70
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
50
71
|
compitableShow: (0, vooks_1.useCompitable)(props, ['spinning', 'show']),
|
|
@@ -55,37 +76,26 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
55
76
|
const { size } = props;
|
|
56
77
|
return STROKE_WIDTH[typeof size === 'number' ? 'medium' : size];
|
|
57
78
|
}),
|
|
58
|
-
cssVars:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const { opacitySpinning, color, textColor } = self;
|
|
62
|
-
const size = typeof spinSize === 'number'
|
|
63
|
-
? (0, seemly_1.pxfy)(spinSize)
|
|
64
|
-
: self[(0, _utils_1.createKey)('size', spinSize)];
|
|
65
|
-
return {
|
|
66
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
67
|
-
'--n-opacity-spinning': opacitySpinning,
|
|
68
|
-
'--n-size': size,
|
|
69
|
-
'--n-color': color,
|
|
70
|
-
'--n-text-color': textColor
|
|
71
|
-
};
|
|
72
|
-
})
|
|
79
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
80
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
81
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
73
82
|
};
|
|
74
83
|
},
|
|
75
84
|
render() {
|
|
76
|
-
var _a;
|
|
85
|
+
var _a, _b;
|
|
77
86
|
const { $slots, mergedClsPrefix, description } = this;
|
|
78
87
|
const rotate = $slots.icon && this.rotate;
|
|
79
88
|
const descriptionNode = (description || $slots.description) && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-spin-description` }, description || ((_a = $slots.description) === null || _a === void 0 ? void 0 : _a.call($slots))));
|
|
80
|
-
const icon = $slots.icon ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-spin-body
|
|
89
|
+
const icon = $slots.icon ? ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-spin-body`, this.themeClass] },
|
|
81
90
|
(0, vue_1.h)("div", { class: [
|
|
82
91
|
`${mergedClsPrefix}-spin`,
|
|
83
92
|
rotate && `${mergedClsPrefix}-spin--rotate`
|
|
84
93
|
], style: $slots.default ? '' : this.cssVars }, $slots.icon()),
|
|
85
|
-
descriptionNode)) : ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-spin-body
|
|
94
|
+
descriptionNode)) : ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-spin-body`, this.themeClass] },
|
|
86
95
|
(0, vue_1.h)(_internal_1.NBaseLoading, { clsPrefix: mergedClsPrefix, style: $slots.default ? '' : this.cssVars, stroke: this.stroke, "stroke-width": this.mergedStrokeWidth, class: `${mergedClsPrefix}-spin` }),
|
|
87
96
|
descriptionNode));
|
|
88
|
-
|
|
97
|
+
(_b = this.onRender) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
98
|
+
return $slots.default ? ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-spin-container`, this.themeClass], style: this.cssVars },
|
|
89
99
|
(0, vue_1.h)("div", { class: [
|
|
90
100
|
`${mergedClsPrefix}-spin-content`,
|
|
91
101
|
this.compitableShow && `${mergedClsPrefix}-spin-content--spinning`
|
|
@@ -74,7 +74,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
74
74
|
'--n-value-prefix-text-color': string;
|
|
75
75
|
'--n-value-suffix-text-color': string;
|
|
76
76
|
'--n-value-text-color': string;
|
|
77
|
-
}
|
|
77
|
+
}> | undefined;
|
|
78
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
79
|
+
onRender: (() => void) | undefined;
|
|
78
80
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
79
81
|
tabularNums: BooleanConstructor;
|
|
80
82
|
label: StringConstructor;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const vue_1 = require("vue");
|
|
7
7
|
const _mixins_1 = require("../../_mixins");
|
|
8
|
+
const _utils_1 = require("../../_utils");
|
|
8
9
|
const styles_1 = require("../styles");
|
|
9
10
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
10
11
|
const statisticProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { tabularNums: Boolean, label: String, value: [String, Number] });
|
|
@@ -12,35 +13,42 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
12
13
|
name: 'Statistic',
|
|
13
14
|
props: statisticProps,
|
|
14
15
|
setup(props) {
|
|
15
|
-
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
16
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
16
17
|
const themeRef = (0, _mixins_1.useTheme)('Statistic', '-statistic', index_cssr_1.default, styles_1.statisticLight, props, mergedClsPrefixRef);
|
|
18
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
19
|
+
const { self: { labelFontWeight, valueFontWeight, valuePrefixTextColor, labelTextColor, valueSuffixTextColor, valueTextColor, labelFontSize }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
20
|
+
return {
|
|
21
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
22
|
+
'--n-label-font-size': labelFontSize,
|
|
23
|
+
'--n-label-font-weight': labelFontWeight,
|
|
24
|
+
'--n-label-text-color': labelTextColor,
|
|
25
|
+
'--n-value-font-weight': valueFontWeight,
|
|
26
|
+
'--n-value-prefix-text-color': valuePrefixTextColor,
|
|
27
|
+
'--n-value-suffix-text-color': valueSuffixTextColor,
|
|
28
|
+
'--n-value-text-color': valueTextColor
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
const themeClassHandle = inlineThemeDisabled
|
|
32
|
+
? (0, _mixins_1.useThemeClass)('statistic', undefined, cssVarsRef, props)
|
|
33
|
+
: undefined;
|
|
17
34
|
return {
|
|
18
35
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
19
|
-
cssVars:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
23
|
-
'--n-label-font-size': labelFontSize,
|
|
24
|
-
'--n-label-font-weight': labelFontWeight,
|
|
25
|
-
'--n-label-text-color': labelTextColor,
|
|
26
|
-
'--n-value-font-weight': valueFontWeight,
|
|
27
|
-
'--n-value-prefix-text-color': valuePrefixTextColor,
|
|
28
|
-
'--n-value-suffix-text-color': valueSuffixTextColor,
|
|
29
|
-
'--n-value-text-color': valueTextColor
|
|
30
|
-
};
|
|
31
|
-
})
|
|
36
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
37
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
38
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
32
39
|
};
|
|
33
40
|
},
|
|
34
41
|
render() {
|
|
35
42
|
var _a;
|
|
36
|
-
const { $slots,
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
const { mergedClsPrefix, $slots: { default: defaultSlot, label: labelSlot, prefix: prefixSlot, suffix: suffixSlot } } = this;
|
|
44
|
+
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
45
|
+
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-statistic`, this.themeClass], style: this.cssVars },
|
|
46
|
+
(0, _utils_1.resolveWrappedSlot)(labelSlot, (children) => ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-statistic__label` }, this.label || children))),
|
|
39
47
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-statistic-value`, style: {
|
|
40
48
|
fontVariantNumeric: this.tabularNums ? 'tabular-nums' : ''
|
|
41
49
|
} },
|
|
42
|
-
|
|
43
|
-
this.value !== undefined ? ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-statistic-value__content` }, this.value)) : ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-statistic-value__content` },
|
|
44
|
-
|
|
50
|
+
(0, _utils_1.resolveWrappedSlot)(prefixSlot, (children) => children && ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-statistic-value__prefix` }, children))),
|
|
51
|
+
this.value !== undefined ? ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-statistic-value__content` }, this.value)) : ((0, _utils_1.resolveWrappedSlot)(defaultSlot, (children) => children && ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-statistic-value__content` }, children)))),
|
|
52
|
+
(0, _utils_1.resolveWrappedSlot)(suffixSlot, (children) => children && ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-statistic-value__suffix` }, children))))));
|
|
45
53
|
}
|
|
46
54
|
});
|
package/lib/styles.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export { treeDark } from './tree/styles';
|
|
|
65
65
|
export { treeSelectDark } from './tree-select/styles';
|
|
66
66
|
export { typographyDark } from './typography/styles';
|
|
67
67
|
export { uploadDark } from './upload/styles';
|
|
68
|
+
export { watermarkDark } from './watermark/styles';
|
|
68
69
|
export { scrollbarDark } from './_internal/scrollbar/styles';
|
|
69
70
|
export { internalSelectMenuDark } from './_internal/select-menu/styles';
|
|
70
71
|
export { internalSelectionDark } from './_internal/selection/styles';
|
package/lib/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rateDark = exports.radioDark = exports.progressDark = exports.popselectDark = exports.popoverDark = exports.popconfirmDark = exports.unstablePageHeaderRtl = exports.paginationDark = exports.notificationDark = exports.modalDark = exports.messageDark = exports.menuDark = exports.mentionDark = exports.logDark = exports.loadingBarDark = exports.listDark = exports.layoutDark = exports.inputNumberDark = exports.inputDark = exports.iconDark = exports.gradientTextDark = exports.formDark = exports.emptyDark = exports.elementDark = exports.dynamicTagsDark = exports.dynamicInputDark = exports.dropdownDark = exports.drawerDark = exports.dividerDark = exports.dialogDark = exports.descriptionsDark = exports.datePickerDark = exports.dataTableDark = exports.collapseDark = exports.codeDark = exports.checkboxDark = exports.cascaderDark = exports.unstableCardRtl = exports.cardDark = exports.unstableButtonRtl = exports.buttonDark = exports.breadcrumbDark = exports.badgeDark = exports.backTopDark = exports.avatarDark = exports.autoCompleteDark = exports.anchorDark = exports.alertDark = exports.commonLight = exports.commonDark = void 0;
|
|
4
|
-
exports.internalSelectionDark = exports.internalSelectMenuDark = exports.scrollbarDark = exports.uploadDark = exports.typographyDark = exports.treeSelectDark = exports.treeDark = exports.transferDark = exports.tooltipDark = exports.timelineDark = exports.timePickerDark = exports.thingDark = exports.unstableTagRtl = exports.tagDark = exports.tabsDark = exports.tableDark = exports.switchDark = exports.stepsDark = exports.statisticDark = exports.spinDark = exports.spaceDark = exports.sliderDark = exports.selectDark = exports.resultDark = void 0;
|
|
4
|
+
exports.internalSelectionDark = exports.internalSelectMenuDark = exports.scrollbarDark = exports.watermarkDark = exports.uploadDark = exports.typographyDark = exports.treeSelectDark = exports.treeDark = exports.transferDark = exports.tooltipDark = exports.timelineDark = exports.timePickerDark = exports.thingDark = exports.unstableTagRtl = exports.tagDark = exports.tabsDark = exports.tableDark = exports.switchDark = exports.stepsDark = exports.statisticDark = exports.spinDark = exports.spaceDark = exports.sliderDark = exports.selectDark = exports.resultDark = void 0;
|
|
5
5
|
var common_1 = require("./_styles/common");
|
|
6
6
|
Object.defineProperty(exports, "commonDark", { enumerable: true, get: function () { return common_1.commonDark; } });
|
|
7
7
|
Object.defineProperty(exports, "commonLight", { enumerable: true, get: function () { return common_1.commonLight; } });
|
|
@@ -140,10 +140,12 @@ var styles_65 = require("./typography/styles");
|
|
|
140
140
|
Object.defineProperty(exports, "typographyDark", { enumerable: true, get: function () { return styles_65.typographyDark; } });
|
|
141
141
|
var styles_66 = require("./upload/styles");
|
|
142
142
|
Object.defineProperty(exports, "uploadDark", { enumerable: true, get: function () { return styles_66.uploadDark; } });
|
|
143
|
+
var styles_67 = require("./watermark/styles");
|
|
144
|
+
Object.defineProperty(exports, "watermarkDark", { enumerable: true, get: function () { return styles_67.watermarkDark; } });
|
|
143
145
|
// danger zone, internal styles
|
|
144
|
-
var
|
|
145
|
-
Object.defineProperty(exports, "scrollbarDark", { enumerable: true, get: function () { return
|
|
146
|
-
var
|
|
147
|
-
Object.defineProperty(exports, "internalSelectMenuDark", { enumerable: true, get: function () { return
|
|
148
|
-
var
|
|
149
|
-
Object.defineProperty(exports, "internalSelectionDark", { enumerable: true, get: function () { return
|
|
146
|
+
var styles_68 = require("./_internal/scrollbar/styles");
|
|
147
|
+
Object.defineProperty(exports, "scrollbarDark", { enumerable: true, get: function () { return styles_68.scrollbarDark; } });
|
|
148
|
+
var styles_69 = require("./_internal/select-menu/styles");
|
|
149
|
+
Object.defineProperty(exports, "internalSelectMenuDark", { enumerable: true, get: function () { return styles_69.internalSelectMenuDark; } });
|
|
150
|
+
var styles_70 = require("./_internal/selection/styles");
|
|
151
|
+
Object.defineProperty(exports, "internalSelectionDark", { enumerable: true, get: function () { return styles_70.internalSelectionDark; } });
|
|
@@ -40,6 +40,7 @@ declare const switchProps: {
|
|
|
40
40
|
/** @deprecated */
|
|
41
41
|
readonly onChange: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
42
42
|
readonly theme: PropType<import("../../_mixins").Theme<"Switch", {
|
|
43
|
+
iconColor: string;
|
|
43
44
|
textColor: string;
|
|
44
45
|
loadingColor: string;
|
|
45
46
|
opacityDisabled: string;
|
|
@@ -71,6 +72,7 @@ declare const switchProps: {
|
|
|
71
72
|
railWidthLarge: string;
|
|
72
73
|
}, any>>;
|
|
73
74
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Switch", {
|
|
75
|
+
iconColor: string;
|
|
74
76
|
textColor: string;
|
|
75
77
|
loadingColor: string;
|
|
76
78
|
opacityDisabled: string;
|
|
@@ -102,6 +104,7 @@ declare const switchProps: {
|
|
|
102
104
|
railWidthLarge: string;
|
|
103
105
|
}, any>>>;
|
|
104
106
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Switch", {
|
|
107
|
+
iconColor: string;
|
|
105
108
|
textColor: string;
|
|
106
109
|
loadingColor: string;
|
|
107
110
|
opacityDisabled: string;
|
|
@@ -173,6 +176,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
173
176
|
/** @deprecated */
|
|
174
177
|
readonly onChange: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
175
178
|
readonly theme: PropType<import("../../_mixins").Theme<"Switch", {
|
|
179
|
+
iconColor: string;
|
|
176
180
|
textColor: string;
|
|
177
181
|
loadingColor: string;
|
|
178
182
|
opacityDisabled: string;
|
|
@@ -204,6 +208,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
204
208
|
railWidthLarge: string;
|
|
205
209
|
}, any>>;
|
|
206
210
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Switch", {
|
|
211
|
+
iconColor: string;
|
|
207
212
|
textColor: string;
|
|
208
213
|
loadingColor: string;
|
|
209
214
|
opacityDisabled: string;
|
|
@@ -235,6 +240,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
235
240
|
railWidthLarge: string;
|
|
236
241
|
}, any>>>;
|
|
237
242
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Switch", {
|
|
243
|
+
iconColor: string;
|
|
238
244
|
textColor: string;
|
|
239
245
|
loadingColor: string;
|
|
240
246
|
opacityDisabled: string;
|
|
@@ -297,7 +303,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
297
303
|
'--n-box-shadow-focus': string;
|
|
298
304
|
'--n-loading-color': string;
|
|
299
305
|
'--n-text-color': string;
|
|
300
|
-
|
|
306
|
+
'--n-icon-color': string;
|
|
307
|
+
}> | undefined;
|
|
308
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
309
|
+
onRender: (() => void) | undefined;
|
|
301
310
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
302
311
|
readonly size: {
|
|
303
312
|
readonly type: PropType<"small" | "medium" | "large">;
|
|
@@ -337,6 +346,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
337
346
|
/** @deprecated */
|
|
338
347
|
readonly onChange: PropType<MaybeArray<OnUpdateValue> | undefined>;
|
|
339
348
|
readonly theme: PropType<import("../../_mixins").Theme<"Switch", {
|
|
349
|
+
iconColor: string;
|
|
340
350
|
textColor: string;
|
|
341
351
|
loadingColor: string;
|
|
342
352
|
opacityDisabled: string;
|
|
@@ -368,6 +378,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
368
378
|
railWidthLarge: string;
|
|
369
379
|
}, any>>;
|
|
370
380
|
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Switch", {
|
|
381
|
+
iconColor: string;
|
|
371
382
|
textColor: string;
|
|
372
383
|
loadingColor: string;
|
|
373
384
|
opacityDisabled: string;
|
|
@@ -399,6 +410,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
399
410
|
railWidthLarge: string;
|
|
400
411
|
}, any>>>;
|
|
401
412
|
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Switch", {
|
|
413
|
+
iconColor: string;
|
|
402
414
|
textColor: string;
|
|
403
415
|
loadingColor: string;
|
|
404
416
|
opacityDisabled: string;
|
package/lib/switch/src/Switch.js
CHANGED
|
@@ -46,7 +46,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
|
|
49
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
50
50
|
const themeRef = (0, _mixins_1.useTheme)('Switch', '-switch', index_cssr_1.default, styles_1.switchLight, props, mergedClsPrefixRef);
|
|
51
51
|
const formItem = (0, _mixins_1.useFormItem)(props);
|
|
52
52
|
const { mergedSizeRef, mergedDisabledRef } = formItem;
|
|
@@ -86,15 +86,13 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
86
86
|
nTriggerFormBlur();
|
|
87
87
|
}
|
|
88
88
|
function handleClick() {
|
|
89
|
-
if (props.loading)
|
|
89
|
+
if (props.loading || mergedDisabledRef.value)
|
|
90
90
|
return;
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
doUpdateValue(props.uncheckedValue);
|
|
97
|
-
}
|
|
91
|
+
if (mergedValueRef.value !== props.checkedValue) {
|
|
92
|
+
doUpdateValue(props.checkedValue);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
doUpdateValue(props.uncheckedValue);
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
function handleFocus() {
|
|
@@ -107,21 +105,62 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
107
105
|
pressedRef.value = false;
|
|
108
106
|
}
|
|
109
107
|
function handleKeyup(e) {
|
|
110
|
-
if (props.loading)
|
|
108
|
+
if (props.loading || mergedDisabledRef.value)
|
|
111
109
|
return;
|
|
112
110
|
if (e.code === 'Space') {
|
|
113
|
-
|
|
111
|
+
if (mergedValueRef.value !== props.checkedValue) {
|
|
112
|
+
doUpdateValue(props.checkedValue);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
doUpdateValue(props.uncheckedValue);
|
|
116
|
+
}
|
|
114
117
|
pressedRef.value = false;
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
function handleKeydown(e) {
|
|
118
|
-
if (props.loading)
|
|
121
|
+
if (props.loading || mergedDisabledRef.value)
|
|
119
122
|
return;
|
|
120
123
|
if (e.code === 'Space') {
|
|
121
124
|
e.preventDefault();
|
|
122
125
|
pressedRef.value = true;
|
|
123
126
|
}
|
|
124
127
|
}
|
|
128
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
129
|
+
const { value: size } = mergedSizeRef;
|
|
130
|
+
const { self: { opacityDisabled, railColor, railColorActive, buttonBoxShadow, buttonColor, boxShadowFocus, loadingColor, textColor, iconColor, [(0, _utils_1.createKey)('buttonHeight', size)]: buttonHeight, [(0, _utils_1.createKey)('buttonWidth', size)]: buttonWidth, [(0, _utils_1.createKey)('buttonWidthPressed', size)]: buttonWidthPressed, [(0, _utils_1.createKey)('railHeight', size)]: railHeight, [(0, _utils_1.createKey)('railWidth', size)]: railWidth, [(0, _utils_1.createKey)('railBorderRadius', size)]: railBorderRadius, [(0, _utils_1.createKey)('buttonBorderRadius', size)]: buttonBorderRadius }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
131
|
+
const offset = (0, seemly_1.pxfy)(((0, seemly_1.depx)(railHeight) - (0, seemly_1.depx)(buttonHeight)) / 2);
|
|
132
|
+
const height = (0, seemly_1.pxfy)(Math.max((0, seemly_1.depx)(railHeight), (0, seemly_1.depx)(buttonHeight)));
|
|
133
|
+
const width = (0, seemly_1.depx)(railHeight) > (0, seemly_1.depx)(buttonHeight)
|
|
134
|
+
? railWidth
|
|
135
|
+
: (0, seemly_1.pxfy)((0, seemly_1.depx)(railWidth) + (0, seemly_1.depx)(buttonHeight) - (0, seemly_1.depx)(railHeight));
|
|
136
|
+
return {
|
|
137
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
138
|
+
'--n-button-border-radius': buttonBorderRadius,
|
|
139
|
+
'--n-button-box-shadow': buttonBoxShadow,
|
|
140
|
+
'--n-button-color': buttonColor,
|
|
141
|
+
'--n-button-width': buttonWidth,
|
|
142
|
+
'--n-button-width-pressed': buttonWidthPressed,
|
|
143
|
+
'--n-button-height': buttonHeight,
|
|
144
|
+
'--n-height': height,
|
|
145
|
+
'--n-offset': offset,
|
|
146
|
+
'--n-opacity-disabled': opacityDisabled,
|
|
147
|
+
'--n-rail-border-radius': railBorderRadius,
|
|
148
|
+
'--n-rail-color': railColor,
|
|
149
|
+
'--n-rail-color-active': railColorActive,
|
|
150
|
+
'--n-rail-height': railHeight,
|
|
151
|
+
'--n-rail-width': railWidth,
|
|
152
|
+
'--n-width': width,
|
|
153
|
+
'--n-box-shadow-focus': boxShadowFocus,
|
|
154
|
+
'--n-loading-color': loadingColor,
|
|
155
|
+
'--n-text-color': textColor,
|
|
156
|
+
'--n-icon-color': iconColor
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
const themeClassHandle = inlineThemeDisabled
|
|
160
|
+
? (0, _mixins_1.useThemeClass)('switch', (0, vue_1.computed)(() => {
|
|
161
|
+
return mergedSizeRef.value[0];
|
|
162
|
+
}), cssVarsRef, props)
|
|
163
|
+
: undefined;
|
|
125
164
|
return {
|
|
126
165
|
handleClick,
|
|
127
166
|
handleBlur,
|
|
@@ -134,43 +173,22 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
134
173
|
mergedValue: mergedValueRef,
|
|
135
174
|
checked: checkedRef,
|
|
136
175
|
mergedDisabled: mergedDisabledRef,
|
|
137
|
-
cssVars:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const offset = (0, seemly_1.pxfy)(((0, seemly_1.depx)(railHeight) - (0, seemly_1.depx)(buttonHeight)) / 2);
|
|
141
|
-
const height = (0, seemly_1.pxfy)(Math.max((0, seemly_1.depx)(railHeight), (0, seemly_1.depx)(buttonHeight)));
|
|
142
|
-
const width = (0, seemly_1.depx)(railHeight) > (0, seemly_1.depx)(buttonHeight)
|
|
143
|
-
? railWidth
|
|
144
|
-
: (0, seemly_1.pxfy)((0, seemly_1.depx)(railWidth) + (0, seemly_1.depx)(buttonHeight) - (0, seemly_1.depx)(railHeight));
|
|
145
|
-
return {
|
|
146
|
-
'--n-bezier': cubicBezierEaseInOut,
|
|
147
|
-
'--n-button-border-radius': buttonBorderRadius,
|
|
148
|
-
'--n-button-box-shadow': buttonBoxShadow,
|
|
149
|
-
'--n-button-color': buttonColor,
|
|
150
|
-
'--n-button-width': buttonWidth,
|
|
151
|
-
'--n-button-width-pressed': buttonWidthPressed,
|
|
152
|
-
'--n-button-height': buttonHeight,
|
|
153
|
-
'--n-height': height,
|
|
154
|
-
'--n-offset': offset,
|
|
155
|
-
'--n-opacity-disabled': opacityDisabled,
|
|
156
|
-
'--n-rail-border-radius': railBorderRadius,
|
|
157
|
-
'--n-rail-color': railColor,
|
|
158
|
-
'--n-rail-color-active': railColorActive,
|
|
159
|
-
'--n-rail-height': railHeight,
|
|
160
|
-
'--n-rail-width': railWidth,
|
|
161
|
-
'--n-width': width,
|
|
162
|
-
'--n-box-shadow-focus': boxShadowFocus,
|
|
163
|
-
'--n-loading-color': loadingColor,
|
|
164
|
-
'--n-text-color': textColor
|
|
165
|
-
};
|
|
166
|
-
})
|
|
176
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
177
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
178
|
+
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
167
179
|
};
|
|
168
180
|
},
|
|
169
181
|
render() {
|
|
170
|
-
const { mergedClsPrefix, mergedDisabled, checked, mergedRailStyle, $slots } = this;
|
|
171
|
-
|
|
182
|
+
const { mergedClsPrefix, mergedDisabled, checked, mergedRailStyle, onRender, $slots } = this;
|
|
183
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
184
|
+
const { checked: checkedSlot, unchecked: uncheckedSlot, icon: iconSlot, 'checked-icon': checkedIconSlot, 'unchecked-icon': uncheckedIconSlot } = $slots;
|
|
185
|
+
const hasIcon = !((0, _utils_1.isSlotEmpty)(iconSlot) &&
|
|
186
|
+
(0, _utils_1.isSlotEmpty)(checkedIconSlot) &&
|
|
187
|
+
(0, _utils_1.isSlotEmpty)(uncheckedIconSlot));
|
|
172
188
|
return ((0, vue_1.h)("div", { role: "switch", "aria-checked": checked, class: [
|
|
173
189
|
`${mergedClsPrefix}-switch`,
|
|
190
|
+
this.themeClass,
|
|
191
|
+
hasIcon && `${mergedClsPrefix}-switch--icon`,
|
|
174
192
|
checked && `${mergedClsPrefix}-switch--active`,
|
|
175
193
|
mergedDisabled && `${mergedClsPrefix}-switch--disabled`,
|
|
176
194
|
this.round && `${mergedClsPrefix}-switch--round`,
|
|
@@ -178,18 +196,25 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
178
196
|
this.pressed && `${mergedClsPrefix}-switch--pressed`
|
|
179
197
|
], tabindex: !this.mergedDisabled ? 0 : undefined, style: this.cssVars, onClick: this.handleClick, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown },
|
|
180
198
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__rail`, "aria-hidden": "true", style: mergedRailStyle },
|
|
181
|
-
(checkedSlot
|
|
182
|
-
|
|
183
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
199
|
+
(0, _utils_1.resolveWrappedSlot)(checkedSlot, (checkedSlotChildren) => (0, _utils_1.resolveWrappedSlot)(uncheckedSlot, (uncheckedSlotChildren) => {
|
|
200
|
+
if (checkedSlotChildren || uncheckedSlotChildren) {
|
|
201
|
+
return ((0, vue_1.h)("div", { "aria-hidden": true, class: `${mergedClsPrefix}-switch__children-placeholder` },
|
|
202
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__rail-placeholder` },
|
|
203
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__button-placeholder` }),
|
|
204
|
+
checkedSlotChildren),
|
|
205
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__rail-placeholder` },
|
|
206
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__button-placeholder` }),
|
|
207
|
+
uncheckedSlotChildren)));
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
})),
|
|
188
211
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__button` },
|
|
189
|
-
(0,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
212
|
+
(0, _utils_1.resolveWrappedSlot)(iconSlot, (icon) => (0, _utils_1.resolveWrappedSlot)(checkedIconSlot, (checkedIcon) => (0, _utils_1.resolveWrappedSlot)(uncheckedIconSlot, (uncheckedIcon) => {
|
|
213
|
+
return ((0, vue_1.h)(_internal_1.NIconSwitchTransition, null, {
|
|
214
|
+
default: () => this.loading ? ((0, vue_1.h)(_internal_1.NBaseLoading, { key: "loading", clsPrefix: mergedClsPrefix, strokeWidth: 20 })) : this.checked && (checkedIcon || icon) ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__button-icon`, key: checkedIcon ? 'checked-icon' : 'icon' }, checkedIcon || icon)) : !this.checked && (uncheckedIcon || icon) ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-switch__button-icon`, key: uncheckedIcon ? 'unchecked-icon' : 'icon' }, uncheckedIcon || icon)) : null
|
|
215
|
+
}));
|
|
216
|
+
}))),
|
|
217
|
+
(0, _utils_1.resolveWrappedSlot)(checkedSlot, (children) => children && ((0, vue_1.h)("div", { key: "checked", class: `${mergedClsPrefix}-switch__checked` }, children))),
|
|
218
|
+
(0, _utils_1.resolveWrappedSlot)(uncheckedSlot, (children) => children && ((0, vue_1.h)("div", { key: "unchecked", class: `${mergedClsPrefix}-switch__unchecked` }, children)))))));
|
|
194
219
|
}
|
|
195
220
|
});
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10
10
|
value: true
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const icon_switch_cssr_1 = __importDefault(require("../../../_styles/transitions/icon-switch.cssr"));
|
|
14
14
|
|
|
15
15
|
const cssr_1 = require("../../../_utils/cssr"); // vars:
|
|
16
16
|
// --n-bezier
|
|
@@ -30,6 +30,7 @@ const cssr_1 = require("../../../_utils/cssr"); // vars:
|
|
|
30
30
|
// --n-box-shadow-focus
|
|
31
31
|
// --n-loading-color
|
|
32
32
|
// --n-text-color
|
|
33
|
+
// --n-icon-color
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
exports.default = (0, cssr_1.cB)('switch', `
|
|
@@ -62,7 +63,7 @@ exports.default = (0, cssr_1.cB)('switch', `
|
|
|
62
63
|
font-size: calc(var(--n-button-width) - 4px);
|
|
63
64
|
color: var(--n-loading-color);
|
|
64
65
|
transition: color .3s var(--n-bezier);
|
|
65
|
-
`, [(0,
|
|
66
|
+
`, [(0, icon_switch_cssr_1.default)({
|
|
66
67
|
originalTransform: 'translateX(-50%) translateY(-50%)'
|
|
67
68
|
})]), (0, cssr_1.cE)('checked, unchecked', `
|
|
68
69
|
transition: color .3s var(--n-bezier);
|
|
@@ -88,7 +89,7 @@ exports.default = (0, cssr_1.cB)('switch', `
|
|
|
88
89
|
borderRadius: 'calc(var(--n-rail-height) / 2)'
|
|
89
90
|
}, [(0, cssr_1.cE)('button', {
|
|
90
91
|
borderRadius: 'calc(var(--n-button-height) / 2)'
|
|
91
|
-
})])]), (0, cssr_1.cNotM)('disabled', [(0, cssr_1.cM)('pressed', [(0, cssr_1.cE)('rail', [(0, cssr_1.cE)('button', {
|
|
92
|
+
})])]), (0, cssr_1.cNotM)('disabled', [(0, cssr_1.cNotM)('icon', [(0, cssr_1.cM)('pressed', [(0, cssr_1.cE)('rail', [(0, cssr_1.cE)('button', {
|
|
92
93
|
maxWidth: 'var(--n-button-width-pressed)'
|
|
93
94
|
})])]), (0, cssr_1.cE)('rail', [(0, cssr_1.c)('&:active', [(0, cssr_1.cE)('button', {
|
|
94
95
|
maxWidth: 'var(--n-button-width-pressed)'
|
|
@@ -96,7 +97,7 @@ exports.default = (0, cssr_1.cB)('switch', `
|
|
|
96
97
|
left: 'calc(100% - var(--n-offset) - var(--n-button-width-pressed))'
|
|
97
98
|
})])]), (0, cssr_1.cE)('rail', [(0, cssr_1.c)('&:active', [(0, cssr_1.cE)('button', {
|
|
98
99
|
left: 'calc(100% - var(--n-offset) - var(--n-button-width-pressed))'
|
|
99
|
-
})])])])]), (0, cssr_1.cM)('active', [(0, cssr_1.cE)('rail', [(0, cssr_1.cE)('button', {
|
|
100
|
+
})])])])])]), (0, cssr_1.cM)('active', [(0, cssr_1.cE)('rail', [(0, cssr_1.cE)('button', {
|
|
100
101
|
left: 'calc(100% - (var(--n-rail-height) + var(--n-button-width)) / 2)'
|
|
101
102
|
})])]), (0, cssr_1.cE)('rail', `
|
|
102
103
|
overflow: hidden;
|
|
@@ -109,7 +110,21 @@ exports.default = (0, cssr_1.cB)('switch', `
|
|
|
109
110
|
background .3s var(--n-bezier),
|
|
110
111
|
box-shadow .3s var(--n-bezier);
|
|
111
112
|
background-color: var(--n-rail-color);
|
|
112
|
-
`, [(0, cssr_1.cE)('button', `
|
|
113
|
+
`, [(0, cssr_1.cE)('button-icon', `
|
|
114
|
+
color: var(--n-icon-color);
|
|
115
|
+
transition: color .3s var(--n-bezier);
|
|
116
|
+
font-size: calc(var(--n-button-height) - 4px);
|
|
117
|
+
position: absolute;
|
|
118
|
+
left: 0;
|
|
119
|
+
right: 0;
|
|
120
|
+
top: 0;
|
|
121
|
+
bottom: 0;
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: center;
|
|
124
|
+
align-items: center;
|
|
125
|
+
line-height: 1;
|
|
126
|
+
`, [(0, icon_switch_cssr_1.default)()]), (0, cssr_1.cE)('button', `
|
|
127
|
+
align-items: center;
|
|
113
128
|
top: var(--n-offset);
|
|
114
129
|
left: var(--n-offset);
|
|
115
130
|
height: var(--n-button-width);
|
|
@@ -128,9 +143,7 @@ exports.default = (0, cssr_1.cB)('switch', `
|
|
|
128
143
|
opacity .3s var(--n-bezier),
|
|
129
144
|
max-width .3s var(--n-bezier),
|
|
130
145
|
box-shadow .3s var(--n-bezier);
|
|
131
|
-
`)]), (0, cssr_1.cM)('active', [(0, cssr_1.cE)('rail',
|
|
132
|
-
backgroundColor: 'var(--n-rail-color-active)'
|
|
133
|
-
})]), (0, cssr_1.cM)('disabled', [(0, cssr_1.cE)('rail', `
|
|
146
|
+
`)]), (0, cssr_1.cM)('active', [(0, cssr_1.cE)('rail', 'background-color: var(--n-rail-color-active);')]), (0, cssr_1.cM)('disabled', [(0, cssr_1.cE)('rail', `
|
|
134
147
|
cursor: not-allowed;
|
|
135
148
|
opacity: .5;
|
|
136
149
|
`)]), (0, cssr_1.cM)('loading', [(0, cssr_1.cE)('rail', `
|
|
@@ -10,9 +10,9 @@ const switchDark = {
|
|
|
10
10
|
name: 'Switch',
|
|
11
11
|
common: common_1.commonDark,
|
|
12
12
|
self(vars) {
|
|
13
|
-
const { primaryColorSuppl, opacityDisabled, borderRadius, primaryColor, textColor2 } = vars;
|
|
13
|
+
const { primaryColorSuppl, opacityDisabled, borderRadius, primaryColor, textColor2, baseColor } = vars;
|
|
14
14
|
const railOverlayColor = 'rgba(255, 255, 255, .20)';
|
|
15
|
-
return Object.assign(Object.assign({}, _common_1.default), { textColor: textColor2, loadingColor: primaryColorSuppl, opacityDisabled, railColor: railOverlayColor, railColorActive: primaryColorSuppl, buttonBoxShadow: '0px 2px 4px 0 rgba(0, 0, 0, 0.4)', buttonColor: '#FFF', railBorderRadiusSmall: borderRadius, railBorderRadiusMedium: borderRadius, railBorderRadiusLarge: borderRadius, buttonBorderRadiusSmall: borderRadius, buttonBorderRadiusMedium: borderRadius, buttonBorderRadiusLarge: borderRadius, boxShadowFocus: `0 0 8px 0 ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}` });
|
|
15
|
+
return Object.assign(Object.assign({}, _common_1.default), { iconColor: baseColor, textColor: textColor2, loadingColor: primaryColorSuppl, opacityDisabled, railColor: railOverlayColor, railColorActive: primaryColorSuppl, buttonBoxShadow: '0px 2px 4px 0 rgba(0, 0, 0, 0.4)', buttonColor: '#FFF', railBorderRadiusSmall: borderRadius, railBorderRadiusMedium: borderRadius, railBorderRadiusLarge: borderRadius, buttonBorderRadiusSmall: borderRadius, buttonBorderRadiusMedium: borderRadius, buttonBorderRadiusLarge: borderRadius, boxShadowFocus: `0 0 8px 0 ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}` });
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
exports.default = switchDark;
|