naive-ui 2.21.2 → 2.22.0
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/close/src/styles/index.cssr.js +6 -5
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/es/_internal/selection/src/Selection.js +11 -9
- package/es/_internal/selection/src/styles/index.cssr.js +6 -2
- package/es/alert/src/Alert.d.ts +20 -20
- package/es/alert/src/Alert.js +22 -22
- package/es/alert/src/styles/index.cssr.js +45 -45
- package/es/anchor/src/AnchorAdapter.js +12 -12
- package/es/anchor/src/styles/index.cssr.js +41 -41
- package/es/avatar/src/Avatar.d.ts +5 -3
- package/es/avatar/src/Avatar.js +7 -5
- package/es/avatar/src/styles/index.cssr.js +3 -5
- package/es/button/src/Button.d.ts +60 -60
- package/es/button/src/Button.js +107 -106
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/dark.js +3 -3
- package/es/button/styles/light.d.ts +3 -3
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +37 -30
- package/es/calendar/styles/light.d.ts +3 -3
- package/es/cascader/src/Cascader.d.ts +135 -0
- package/es/cascader/src/Cascader.js +2 -4
- package/es/cascader/src/CascaderMenu.d.ts +345 -0
- package/es/cascader/src/CascaderMenu.js +6 -5
- package/es/cascader/src/CascaderOption.d.ts +18 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/es/cascader/styles/dark.js +3 -1
- package/es/cascader/styles/light.d.ts +13 -0
- package/es/cascader/styles/light.js +3 -1
- package/es/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/es/color-picker/src/ColorPicker.d.ts +27 -27
- package/es/color-picker/styles/light.d.ts +3 -3
- package/es/config-provider/src/ConfigProvider.d.ts +21 -0
- package/es/data-table/src/DataTable.d.ts +30 -30
- package/es/data-table/src/DataTable.js +7 -14
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +18 -7
- package/es/data-table/src/TableParts/Body.js +80 -28
- package/es/data-table/src/TableParts/Cell.d.ts +6 -6
- package/es/data-table/src/TableParts/Header.d.ts +3 -3
- package/es/data-table/src/TableParts/Header.js +1 -1
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +9 -12
- package/es/data-table/src/use-check.js +6 -2
- package/es/data-table/src/use-scroll.d.ts +2 -0
- package/es/data-table/src/use-scroll.js +34 -4
- package/es/data-table/src/use-table-data.js +4 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/date-picker/src/DatePicker.d.ts +94 -69
- package/es/date-picker/src/DatePicker.js +47 -20
- package/es/date-picker/src/config.d.ts +1 -9
- package/es/date-picker/src/config.js +0 -8
- package/es/date-picker/src/interface.d.ts +2 -1
- package/es/date-picker/src/panel/date.d.ts +23 -10
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +21 -9
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +23 -16
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +27 -20
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/es/date-picker/src/panel/use-calendar.js +35 -18
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/es/date-picker/src/panel/use-dual-calendar.js +23 -8
- package/es/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/es/date-picker/src/panel/use-panel-common.js +2 -2
- package/es/date-picker/src/utils.d.ts +19 -3
- package/es/date-picker/src/utils.js +40 -5
- package/es/date-picker/styles/_common.d.ts +2 -0
- package/es/date-picker/styles/_common.js +3 -1
- package/es/date-picker/styles/light.d.ts +10 -6
- package/es/dialog/src/Dialog.d.ts +21 -21
- package/es/dialog/src/styles/index.cssr.js +1 -0
- package/es/dialog/styles/light.d.ts +3 -3
- package/es/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/es/dynamic-input/src/InputPreset.d.ts +3 -3
- package/es/dynamic-input/src/PairPreset.d.ts +3 -3
- package/es/dynamic-input/styles/light.d.ts +3 -3
- package/es/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/es/dynamic-tags/styles/light.d.ts +3 -3
- package/es/element/index.d.ts +1 -0
- package/es/element/index.js +1 -0
- package/es/form/src/interface.d.ts +5 -4
- package/es/image/src/Image.d.ts +25 -16
- package/es/image/src/Image.js +35 -11
- package/es/image/src/ImageGroup.js +2 -2
- package/es/image/src/styles/index.cssr.js +4 -3
- package/es/input/src/Input.js +2 -0
- package/es/input/src/styles/input.cssr.js +2 -1
- package/es/input-number/src/InputNumber.d.ts +30 -30
- package/es/input-number/src/InputNumber.js +10 -5
- package/es/input-number/src/utils.d.ts +1 -0
- package/es/input-number/src/utils.js +4 -0
- package/es/input-number/styles/light.d.ts +3 -3
- package/es/locales/common/deDE.js +8 -0
- package/es/locales/common/enUS.d.ts +7 -0
- package/es/locales/common/enUS.js +8 -1
- package/es/locales/common/frFR.d.ts +3 -0
- package/es/locales/common/frFR.js +101 -0
- package/es/locales/common/idID.d.ts +2 -93
- package/es/locales/common/idID.js +8 -0
- package/es/locales/common/jaJP.js +8 -0
- package/es/locales/common/nbNO.js +8 -0
- package/es/locales/common/ruRU.js +8 -0
- package/es/locales/common/ukUA.js +8 -0
- package/es/locales/common/zhCN.js +7 -0
- package/es/locales/common/zhTW.d.ts +3 -0
- package/es/locales/common/zhTW.js +100 -0
- package/es/locales/date/frFR.d.ts +3 -0
- package/es/locales/date/frFR.js +6 -0
- package/es/locales/date/idID.d.ts +1 -6
- package/es/locales/date/zhTW.d.ts +3 -0
- package/es/locales/date/zhTW.js +6 -0
- package/es/locales/index.d.ts +4 -0
- package/es/locales/index.js +4 -0
- package/es/modal/src/BodyWrapper.d.ts +6 -6
- package/es/modal/src/Modal.d.ts +36 -36
- package/es/modal/styles/light.d.ts +3 -3
- package/es/page-header/src/PageHeader.js +3 -3
- package/es/page-header/src/styles/index.cssr.js +2 -4
- package/es/popconfirm/src/Popconfirm.d.ts +30 -30
- package/es/popconfirm/styles/light.d.ts +3 -3
- package/es/popover/src/Popover.js +4 -1
- package/es/popover/src/PopoverBody.js +3 -3
- package/es/popselect/src/Popselect.d.ts +2 -11
- package/es/popselect/src/Popselect.js +2 -2
- package/es/popselect/src/PopselectPanel.d.ts +3 -11
- package/es/popselect/src/PopselectPanel.js +17 -11
- package/es/radio/src/Radio.js +3 -3
- package/es/radio/src/RadioButton.js +4 -5
- package/es/radio/src/styles/radio-group.cssr.js +8 -4
- package/es/radio/src/styles/radio.cssr.js +8 -4
- package/es/radio/src/use-radio.d.ts +0 -3
- package/es/radio/src/use-radio.js +1 -26
- package/es/switch/src/Switch.d.ts +16 -1
- package/es/switch/src/Switch.js +17 -4
- package/es/switch/src/styles/index.cssr.js +1 -1
- package/es/tabs/src/styles/index.cssr.js +1 -0
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/theme-editor/src/ThemeEditor.js +9 -2
- package/es/time-picker/src/Panel.d.ts +3 -3
- package/es/time-picker/src/TimePicker.d.ts +30 -30
- package/es/time-picker/styles/light.d.ts +3 -3
- package/es/transfer/src/Transfer.d.ts +30 -30
- package/es/transfer/src/TransferFilter.d.ts +3 -3
- package/es/transfer/src/TransferList.d.ts +3 -3
- package/es/transfer/src/TransferListItem.d.ts +3 -3
- package/es/transfer/styles/light.d.ts +3 -3
- package/es/tree/src/Tree.d.ts +8 -4
- package/es/tree/src/Tree.js +32 -6
- package/es/tree-select/src/TreeSelect.d.ts +38 -1
- package/es/tree-select/src/TreeSelect.js +25 -10
- package/es/tree-select/src/styles/index.cssr.js +11 -2
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/upload/src/Upload.d.ts +41 -30
- package/es/upload/src/Upload.js +33 -23
- package/es/upload/src/UploadFile.d.ts +4 -4
- package/es/upload/src/UploadFileList.js +4 -2
- package/es/upload/src/UploadProgress.d.ts +3 -3
- package/es/upload/src/interface.d.ts +1 -0
- package/es/upload/src/styles/index.cssr.js +2 -3
- package/es/upload/styles/light.d.ts +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/close/src/styles/index.cssr.js +6 -5
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/lib/_internal/selection/src/Selection.js +11 -9
- package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
- package/lib/alert/src/Alert.d.ts +20 -20
- package/lib/alert/src/Alert.js +22 -22
- package/lib/alert/src/styles/index.cssr.js +45 -45
- package/lib/anchor/src/AnchorAdapter.js +12 -12
- package/lib/anchor/src/styles/index.cssr.js +41 -41
- package/lib/avatar/src/Avatar.d.ts +5 -3
- package/lib/avatar/src/Avatar.js +7 -5
- package/lib/avatar/src/styles/index.cssr.js +3 -5
- package/lib/button/src/Button.d.ts +60 -60
- package/lib/button/src/Button.js +107 -106
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/dark.js +3 -3
- package/lib/button/styles/light.d.ts +3 -3
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +37 -30
- package/lib/calendar/styles/light.d.ts +3 -3
- package/lib/cascader/src/Cascader.d.ts +135 -0
- package/lib/cascader/src/Cascader.js +2 -4
- package/lib/cascader/src/CascaderMenu.d.ts +345 -0
- package/lib/cascader/src/CascaderMenu.js +6 -5
- package/lib/cascader/src/CascaderOption.d.ts +18 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/lib/cascader/styles/dark.js +3 -1
- package/lib/cascader/styles/light.d.ts +13 -0
- package/lib/cascader/styles/light.js +3 -1
- package/lib/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/lib/color-picker/src/ColorPicker.d.ts +27 -27
- package/lib/color-picker/styles/light.d.ts +3 -3
- package/lib/config-provider/src/ConfigProvider.d.ts +21 -0
- package/lib/data-table/src/DataTable.d.ts +30 -30
- package/lib/data-table/src/DataTable.js +6 -13
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +18 -7
- package/lib/data-table/src/TableParts/Body.js +78 -26
- package/lib/data-table/src/TableParts/Cell.d.ts +6 -6
- package/lib/data-table/src/TableParts/Header.d.ts +3 -3
- package/lib/data-table/src/TableParts/Header.js +1 -1
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +9 -12
- package/lib/data-table/src/use-check.js +6 -2
- package/lib/data-table/src/use-scroll.d.ts +2 -0
- package/lib/data-table/src/use-scroll.js +34 -4
- package/lib/data-table/src/use-table-data.js +4 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +94 -69
- package/lib/date-picker/src/DatePicker.js +46 -19
- package/lib/date-picker/src/config.d.ts +1 -9
- package/lib/date-picker/src/config.js +1 -9
- package/lib/date-picker/src/interface.d.ts +2 -1
- package/lib/date-picker/src/panel/date.d.ts +23 -10
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +21 -9
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +23 -16
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +27 -20
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/lib/date-picker/src/panel/use-calendar.js +34 -16
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/lib/date-picker/src/panel/use-dual-calendar.js +22 -6
- package/lib/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/lib/date-picker/src/panel/use-panel-common.js +3 -2
- package/lib/date-picker/src/utils.d.ts +19 -3
- package/lib/date-picker/src/utils.js +41 -4
- package/lib/date-picker/styles/_common.d.ts +2 -0
- package/lib/date-picker/styles/_common.js +3 -1
- package/lib/date-picker/styles/light.d.ts +10 -6
- package/lib/dialog/src/Dialog.d.ts +21 -21
- package/lib/dialog/src/styles/index.cssr.js +1 -0
- package/lib/dialog/styles/light.d.ts +3 -3
- package/lib/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/lib/dynamic-input/src/InputPreset.d.ts +3 -3
- package/lib/dynamic-input/src/PairPreset.d.ts +3 -3
- package/lib/dynamic-input/styles/light.d.ts +3 -3
- package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/lib/dynamic-tags/styles/light.d.ts +3 -3
- package/lib/element/index.d.ts +1 -0
- package/lib/element/index.js +3 -1
- package/lib/form/src/interface.d.ts +5 -4
- package/lib/image/src/Image.d.ts +25 -16
- package/lib/image/src/Image.js +34 -10
- package/lib/image/src/ImageGroup.js +2 -2
- package/lib/image/src/styles/index.cssr.js +3 -2
- package/lib/input/src/Input.js +2 -0
- package/lib/input/src/styles/input.cssr.js +2 -1
- package/lib/input-number/src/InputNumber.d.ts +30 -30
- package/lib/input-number/src/InputNumber.js +9 -4
- package/lib/input-number/src/utils.d.ts +1 -0
- package/lib/input-number/src/utils.js +6 -1
- package/lib/input-number/styles/light.d.ts +3 -3
- package/lib/locales/common/deDE.js +8 -0
- package/lib/locales/common/enUS.d.ts +7 -0
- package/lib/locales/common/enUS.js +8 -1
- package/lib/locales/common/frFR.d.ts +3 -0
- package/lib/locales/common/frFR.js +103 -0
- package/lib/locales/common/idID.d.ts +2 -93
- package/lib/locales/common/idID.js +8 -0
- package/lib/locales/common/jaJP.js +8 -0
- package/lib/locales/common/nbNO.js +8 -0
- package/lib/locales/common/ruRU.js +8 -0
- package/lib/locales/common/ukUA.js +8 -0
- package/lib/locales/common/zhCN.js +7 -0
- package/lib/locales/common/zhTW.d.ts +3 -0
- package/lib/locales/common/zhTW.js +102 -0
- package/lib/locales/date/frFR.d.ts +3 -0
- package/lib/locales/date/frFR.js +11 -0
- package/lib/locales/date/idID.d.ts +1 -6
- package/lib/locales/date/zhTW.d.ts +3 -0
- package/lib/locales/date/zhTW.js +11 -0
- package/lib/locales/index.d.ts +4 -0
- package/lib/locales/index.js +9 -1
- package/lib/modal/src/BodyWrapper.d.ts +6 -6
- package/lib/modal/src/Modal.d.ts +36 -36
- package/lib/modal/styles/light.d.ts +3 -3
- package/lib/page-header/src/PageHeader.js +3 -3
- package/lib/page-header/src/styles/index.cssr.js +2 -4
- package/lib/popconfirm/src/Popconfirm.d.ts +30 -30
- package/lib/popconfirm/styles/light.d.ts +3 -3
- package/lib/popover/src/Popover.js +4 -1
- package/lib/popover/src/PopoverBody.js +3 -3
- package/lib/popselect/src/Popselect.d.ts +2 -11
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/popselect/src/PopselectPanel.d.ts +3 -11
- package/lib/popselect/src/PopselectPanel.js +16 -10
- package/lib/radio/src/Radio.js +3 -3
- package/lib/radio/src/RadioButton.js +4 -5
- package/lib/radio/src/styles/radio-group.cssr.js +8 -4
- package/lib/radio/src/styles/radio.cssr.js +8 -4
- package/lib/radio/src/use-radio.d.ts +0 -3
- package/lib/radio/src/use-radio.js +1 -26
- package/lib/switch/src/Switch.d.ts +16 -1
- package/lib/switch/src/Switch.js +17 -4
- package/lib/switch/src/styles/index.cssr.js +1 -1
- package/lib/tabs/src/styles/index.cssr.js +1 -0
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/theme-editor/src/ThemeEditor.js +9 -2
- package/lib/time-picker/src/Panel.d.ts +3 -3
- package/lib/time-picker/src/TimePicker.d.ts +30 -30
- package/lib/time-picker/styles/light.d.ts +3 -3
- package/lib/transfer/src/Transfer.d.ts +30 -30
- package/lib/transfer/src/TransferFilter.d.ts +3 -3
- package/lib/transfer/src/TransferList.d.ts +3 -3
- package/lib/transfer/src/TransferListItem.d.ts +3 -3
- package/lib/transfer/styles/light.d.ts +3 -3
- package/lib/tree/src/Tree.d.ts +8 -4
- package/lib/tree/src/Tree.js +32 -6
- package/lib/tree-select/src/TreeSelect.d.ts +38 -1
- package/lib/tree-select/src/TreeSelect.js +24 -9
- package/lib/tree-select/src/styles/index.cssr.js +11 -2
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/upload/src/Upload.d.ts +41 -30
- package/lib/upload/src/Upload.js +33 -23
- package/lib/upload/src/UploadFile.d.ts +4 -4
- package/lib/upload/src/UploadFileList.js +4 -2
- package/lib/upload/src/UploadProgress.d.ts +3 -3
- package/lib/upload/src/interface.d.ts +1 -0
- package/lib/upload/src/styles/index.cssr.js +2 -3
- package/lib/upload/styles/light.d.ts +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -4
- package/web-types.json +99 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TreeNode } from 'treemate';
|
|
2
|
-
import { CSSProperties, InjectionKey, Ref, VNodeChild, HTMLAttributes } from 'vue';
|
|
2
|
+
import { CSSProperties, InjectionKey, Ref, VNodeChild, HTMLAttributes, Slots } from 'vue';
|
|
3
3
|
import { EllipsisProps } from '../../ellipsis/src/Ellipsis';
|
|
4
4
|
import { NLocale } from '../../locales';
|
|
5
5
|
import { MergedTheme } from '../../_mixins';
|
|
@@ -100,6 +100,7 @@ export declare type DataTableSelectionOptions = Array<DataTableSelectionOption |
|
|
|
100
100
|
onSelect: () => void;
|
|
101
101
|
}>;
|
|
102
102
|
export interface DataTableInjection {
|
|
103
|
+
slots: Slots;
|
|
103
104
|
indentRef: Ref<number>;
|
|
104
105
|
hasChildrenRef: Ref<boolean>;
|
|
105
106
|
firstContentfulColIndexRef: Ref<number>;
|
|
@@ -115,7 +116,9 @@ export interface DataTableInjection {
|
|
|
115
116
|
leftFixedColumnsRef: Ref<TableColumns>;
|
|
116
117
|
rightFixedColumnsRef: Ref<TableColumns>;
|
|
117
118
|
leftActiveFixedColKeyRef: Ref<ColumnKey | null>;
|
|
119
|
+
leftActiveFixedChildrenColKeysRef: Ref<ColumnKey[]>;
|
|
118
120
|
rightActiveFixedColKeyRef: Ref<ColumnKey | null>;
|
|
121
|
+
rightActiveFixedChildrenColKeysRef: Ref<ColumnKey[]>;
|
|
119
122
|
fixedColumnLeftMapRef: Ref<Record<ColumnKey, {
|
|
120
123
|
start: number;
|
|
121
124
|
end: number;
|
|
@@ -67,11 +67,11 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('data-table', `
|
|
|
67
67
|
--merged-th-color-hover: var(--th-color-hover);
|
|
68
68
|
--merged-td-color-hover: var(--td-color-hover);
|
|
69
69
|
--merged-td-color-striped: var(--td-color-striped);
|
|
70
|
-
`, [(0, cssr_1.
|
|
70
|
+
`, [(0, cssr_1.cB)('data-table-wrapper', `
|
|
71
71
|
flex-grow: 1;
|
|
72
72
|
display: flex;
|
|
73
73
|
flex-direction: column;
|
|
74
|
-
|
|
74
|
+
`), (0, cssr_1.cM)('flex-height', [(0, cssr_1.c)('>', [(0, cssr_1.cB)('data-table-wrapper', [(0, cssr_1.c)('>', [(0, cssr_1.cB)('data-table-base-table', `
|
|
75
75
|
display: flex;
|
|
76
76
|
flex-direction: column;
|
|
77
77
|
flex-grow: 1;
|
|
@@ -107,7 +107,7 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('data-table', `
|
|
|
107
107
|
box-sizing: border-box;
|
|
108
108
|
background-clip: padding-box;
|
|
109
109
|
transition: background-color .3s var(--bezier);
|
|
110
|
-
`, [(0, cssr_1.cM)('striped', 'background-color: var(--merged-td-color-striped);', [(0, cssr_1.cB)('data-table-td', 'background-color: var(--merged-td-color-striped);')]), (0, cssr_1.c)('&:hover', 'background-color: var(--merged-td-color-hover);', [(0, cssr_1.cB)('data-table-td', 'background-color: var(--merged-td-color-hover);')])]), (0, cssr_1.cB)('data-table-th', `
|
|
110
|
+
`, [(0, cssr_1.cM)('striped', 'background-color: var(--merged-td-color-striped);', [(0, cssr_1.cB)('data-table-td', 'background-color: var(--merged-td-color-striped);')]), (0, cssr_1.cNotM)('summary', [(0, cssr_1.c)('&:hover', 'background-color: var(--merged-td-color-hover);', [(0, cssr_1.cB)('data-table-td', 'background-color: var(--merged-td-color-hover);')])])]), (0, cssr_1.cB)('data-table-th', `
|
|
111
111
|
padding: var(--th-padding);
|
|
112
112
|
position: relative;
|
|
113
113
|
text-align: start;
|
|
@@ -217,6 +217,7 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('data-table', `
|
|
|
217
217
|
padding: 0;
|
|
218
218
|
line-height: 0;
|
|
219
219
|
`), fixedColumnStyle]), (0, cssr_1.cB)('data-table-empty', `
|
|
220
|
+
box-sizing: border-box;
|
|
220
221
|
padding: var(--empty-padding);
|
|
221
222
|
flex-grow: 1;
|
|
222
223
|
flex-shrink: 0;
|
|
@@ -250,15 +251,11 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('data-table', `
|
|
|
250
251
|
borderRight: '1px solid var(--merged-border-color)'
|
|
251
252
|
}, [(0, cssr_1.cM)('last-col', {
|
|
252
253
|
borderRight: '0 solid var(--merged-border-color)'
|
|
253
|
-
})])]), (0, cssr_1.cM)('bordered', [(0, cssr_1.cB)('data-table-wrapper',
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
borderBottom: '0 solid var(--merged-border-color)'
|
|
259
|
-
})]), (0, cssr_1.cB)('data-table-base-table-body', `
|
|
260
|
-
border-bottom-left-radius: calc(var(--border-radius) - 1px);
|
|
261
|
-
border-bottom-right-radius: calc(var(--border-radius) - 1px);
|
|
254
|
+
})])]), (0, cssr_1.cM)('bordered', [(0, cssr_1.cB)('data-table-wrapper', `
|
|
255
|
+
border: 1px solid var(--merged-border-color);
|
|
256
|
+
border-bottom-left-radius: var(--border-radius);
|
|
257
|
+
border-bottom-right-radius: var(--border-radius);
|
|
258
|
+
overflow: hidden;
|
|
262
259
|
`)]), (0, cssr_1.cB)('data-table-base-table', [(0, cssr_1.cM)('transition-disabled', [(0, cssr_1.cB)('data-table-th', [(0, cssr_1.c)('&::after, &::before', {
|
|
263
260
|
transition: 'none'
|
|
264
261
|
})]), (0, cssr_1.cB)('data-table-td', [(0, cssr_1.c)('&::after, &::before', {
|
|
@@ -61,18 +61,22 @@ function useCheck(props, data) {
|
|
|
61
61
|
uncontrolledCheckedRowKeysRef.value = keys;
|
|
62
62
|
}
|
|
63
63
|
function doCheck(rowKey) {
|
|
64
|
+
if (props.loading)
|
|
65
|
+
return;
|
|
64
66
|
doUpdateCheckedRowKeys(treeMateRef.value.check(rowKey, mergedCheckedRowKeysRef.value, {
|
|
65
67
|
cascade: props.cascade
|
|
66
68
|
}).checkedKeys);
|
|
67
69
|
}
|
|
68
70
|
function doUncheck(rowKey) {
|
|
71
|
+
if (props.loading)
|
|
72
|
+
return;
|
|
69
73
|
doUpdateCheckedRowKeys(treeMateRef.value.uncheck(rowKey, mergedCheckedRowKeysRef.value, {
|
|
70
74
|
cascade: props.cascade
|
|
71
75
|
}).checkedKeys);
|
|
72
76
|
}
|
|
73
77
|
function doCheckAll(checkWholeTable = false) {
|
|
74
78
|
const { value: column } = selectionColumnRef;
|
|
75
|
-
if (!column)
|
|
79
|
+
if (!column || props.loading)
|
|
76
80
|
return;
|
|
77
81
|
const rowKeysToCheck = [];
|
|
78
82
|
(checkWholeTable
|
|
@@ -89,7 +93,7 @@ function useCheck(props, data) {
|
|
|
89
93
|
}
|
|
90
94
|
function doUncheckAll(checkWholeTable = false) {
|
|
91
95
|
const { value: column } = selectionColumnRef;
|
|
92
|
-
if (!column)
|
|
96
|
+
if (!column || props.loading)
|
|
93
97
|
return;
|
|
94
98
|
const rowKeysToUncheck = [];
|
|
95
99
|
(checkWholeTable
|
|
@@ -19,7 +19,9 @@ export declare function useScroll(props: DataTableSetupProps, { mainTableInstRef
|
|
|
19
19
|
leftFixedColumnsRef: ComputedRef<TableColumn<any>[]>;
|
|
20
20
|
rightFixedColumnsRef: ComputedRef<TableColumn<any>[]>;
|
|
21
21
|
leftActiveFixedColKeyRef: Ref<ColumnKey | null>;
|
|
22
|
+
leftActiveFixedChildrenColKeysRef: Ref<ColumnKey[]>;
|
|
22
23
|
rightActiveFixedColKeyRef: Ref<ColumnKey | null>;
|
|
24
|
+
rightActiveFixedChildrenColKeysRef: Ref<ColumnKey[]>;
|
|
23
25
|
syncScrollState: () => void;
|
|
24
26
|
handleTableBodyScroll: () => void;
|
|
25
27
|
handleTableHeaderScroll: () => void;
|
|
@@ -9,7 +9,9 @@ const utils_1 = require("./utils");
|
|
|
9
9
|
function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef, scrollPartRef }) {
|
|
10
10
|
let scrollLeft = 0;
|
|
11
11
|
const leftActiveFixedColKeyRef = (0, vue_1.ref)(null);
|
|
12
|
+
const leftActiveFixedChildrenColKeysRef = (0, vue_1.ref)([]);
|
|
12
13
|
const rightActiveFixedColKeyRef = (0, vue_1.ref)(null);
|
|
14
|
+
const rightActiveFixedChildrenColKeysRef = (0, vue_1.ref)([]);
|
|
13
15
|
const styleScrollXRef = (0, vue_1.computed)(() => {
|
|
14
16
|
return (0, _utils_1.formatLength)(props.scrollX);
|
|
15
17
|
});
|
|
@@ -43,7 +45,8 @@ function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef
|
|
|
43
45
|
const columns = {};
|
|
44
46
|
let right = 0;
|
|
45
47
|
function traverse(cols) {
|
|
46
|
-
cols.
|
|
48
|
+
for (let i = cols.length - 1; i >= 0; --i) {
|
|
49
|
+
const col = cols[i];
|
|
47
50
|
const positionInfo = { start: right, end: 0 };
|
|
48
51
|
columns[(0, utils_1.getColKey)(col)] = positionInfo;
|
|
49
52
|
if ('children' in col) {
|
|
@@ -54,9 +57,9 @@ function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef
|
|
|
54
57
|
right += (0, utils_1.getColWidth)(col) || 0;
|
|
55
58
|
positionInfo.end = right;
|
|
56
59
|
}
|
|
57
|
-
}
|
|
60
|
+
}
|
|
58
61
|
}
|
|
59
|
-
traverse(rightFixedColumnsRef.value
|
|
62
|
+
traverse(rightFixedColumnsRef.value);
|
|
60
63
|
return columns;
|
|
61
64
|
});
|
|
62
65
|
function deriveActiveLeftFixedColumn() {
|
|
@@ -78,6 +81,18 @@ function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef
|
|
|
78
81
|
}
|
|
79
82
|
leftActiveFixedColKeyRef.value = leftActiveFixedColKey;
|
|
80
83
|
}
|
|
84
|
+
function deriveActiveLeftFixedChildrenColumns() {
|
|
85
|
+
leftActiveFixedChildrenColKeysRef.value = [];
|
|
86
|
+
let activeLeftFixedColumn = props.columns.find((col) => (0, utils_1.getColKey)(col) === leftActiveFixedColKeyRef.value);
|
|
87
|
+
while (activeLeftFixedColumn && 'children' in activeLeftFixedColumn) {
|
|
88
|
+
const length = activeLeftFixedColumn.children.length;
|
|
89
|
+
if (length === 0)
|
|
90
|
+
break;
|
|
91
|
+
const nextActiveLeftFixedColumn = activeLeftFixedColumn.children[length - 1];
|
|
92
|
+
leftActiveFixedChildrenColKeysRef.value.push((0, utils_1.getColKey)(nextActiveLeftFixedColumn));
|
|
93
|
+
activeLeftFixedColumn = nextActiveLeftFixedColumn;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
81
96
|
function deriveActiveRightFixedColumn() {
|
|
82
97
|
var _a, _b;
|
|
83
98
|
// target is header element
|
|
@@ -89,7 +104,7 @@ function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef
|
|
|
89
104
|
let rightWidth = 0;
|
|
90
105
|
let rightActiveFixedColKey = null;
|
|
91
106
|
const { value: fixedColumnRightMap } = fixedColumnRightMapRef;
|
|
92
|
-
for (let i =
|
|
107
|
+
for (let i = rightFixedColumns.length - 1; i >= 0; --i) {
|
|
93
108
|
const key = (0, utils_1.getColKey)(rightFixedColumns[i]);
|
|
94
109
|
if (Math.round(scrollLeft +
|
|
95
110
|
(((_a = fixedColumnRightMap[key]) === null || _a === void 0 ? void 0 : _a.start) || 0) +
|
|
@@ -104,6 +119,17 @@ function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef
|
|
|
104
119
|
}
|
|
105
120
|
rightActiveFixedColKeyRef.value = rightActiveFixedColKey;
|
|
106
121
|
}
|
|
122
|
+
function deriveActiveRightFixedChildrenColumns() {
|
|
123
|
+
rightActiveFixedChildrenColKeysRef.value = [];
|
|
124
|
+
let activeRightFixedColumn = props.columns.find((col) => (0, utils_1.getColKey)(col) === rightActiveFixedColKeyRef.value);
|
|
125
|
+
while (activeRightFixedColumn &&
|
|
126
|
+
'children' in activeRightFixedColumn &&
|
|
127
|
+
activeRightFixedColumn.children.length) {
|
|
128
|
+
const nextActiveRightFixedColumn = activeRightFixedColumn.children[0];
|
|
129
|
+
rightActiveFixedChildrenColKeysRef.value.push((0, utils_1.getColKey)(nextActiveRightFixedColumn));
|
|
130
|
+
activeRightFixedColumn = nextActiveRightFixedColumn;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
107
133
|
function getScrollElements() {
|
|
108
134
|
const header = mainTableInstRef.value
|
|
109
135
|
? mainTableInstRef.value.getHeaderElement()
|
|
@@ -160,7 +186,9 @@ function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef
|
|
|
160
186
|
scrollLeft = body.scrollLeft;
|
|
161
187
|
}
|
|
162
188
|
deriveActiveLeftFixedColumn();
|
|
189
|
+
deriveActiveLeftFixedChildrenColumns();
|
|
163
190
|
deriveActiveRightFixedColumn();
|
|
191
|
+
deriveActiveRightFixedChildrenColumns();
|
|
164
192
|
}
|
|
165
193
|
function setHeaderScrollLeft(left) {
|
|
166
194
|
const { header } = getScrollElements();
|
|
@@ -179,7 +207,9 @@ function useScroll(props, { mainTableInstRef, mergedCurrentPageRef, bodyWidthRef
|
|
|
179
207
|
leftFixedColumnsRef,
|
|
180
208
|
rightFixedColumnsRef,
|
|
181
209
|
leftActiveFixedColKeyRef,
|
|
210
|
+
leftActiveFixedChildrenColKeysRef,
|
|
182
211
|
rightActiveFixedColKeyRef,
|
|
212
|
+
rightActiveFixedChildrenColKeysRef,
|
|
183
213
|
syncScrollState,
|
|
184
214
|
handleTableBodyScroll,
|
|
185
215
|
handleTableHeaderScroll,
|
|
@@ -21,6 +21,7 @@ function useTableData(props, { dataRelatedColsRef }) {
|
|
|
21
21
|
const treeMateRef = (0, vue_1.computed)(() => {
|
|
22
22
|
const { childrenKey } = props;
|
|
23
23
|
return (0, treemate_1.createTreeMate)(props.data, {
|
|
24
|
+
ignoreEmptyChildren: true,
|
|
24
25
|
getKey: props.rowKey,
|
|
25
26
|
getChildren: (rowData) => rowData[childrenKey],
|
|
26
27
|
getDisabled: (rowData) => {
|
|
@@ -188,11 +189,13 @@ function useTableData(props, { dataRelatedColsRef }) {
|
|
|
188
189
|
function mergedOnUpdatePageSize(pageSize) {
|
|
189
190
|
const { pagination } = props;
|
|
190
191
|
if (pagination) {
|
|
191
|
-
const { onPageSizeChange, 'onUpdate:pageSize': onUpdatePageSize } = pagination;
|
|
192
|
+
const { onPageSizeChange, 'onUpdate:pageSize': _onUpdatePageSize, onUpdatePageSize } = pagination;
|
|
192
193
|
if (onPageSizeChange)
|
|
193
194
|
(0, _utils_1.call)(onPageSizeChange, pageSize);
|
|
194
195
|
if (onUpdatePageSize)
|
|
195
196
|
(0, _utils_1.call)(onUpdatePageSize, pageSize);
|
|
197
|
+
if (_onUpdatePageSize)
|
|
198
|
+
(0, _utils_1.call)(_onUpdatePageSize, pageSize);
|
|
196
199
|
doUpdatePageSize(pageSize);
|
|
197
200
|
}
|
|
198
201
|
}
|
|
@@ -112,9 +112,9 @@ declare const dataTableLight: import("../../_mixins").Theme<"DataTable", {
|
|
|
112
112
|
fontSizeMedium: string;
|
|
113
113
|
fontSizeLarge: string;
|
|
114
114
|
opacityDisabled: string;
|
|
115
|
-
colorOpacitySecondary:
|
|
116
|
-
colorOpacitySecondaryHover:
|
|
117
|
-
colorOpacitySecondaryPressed:
|
|
115
|
+
colorOpacitySecondary: string;
|
|
116
|
+
colorOpacitySecondaryHover: string;
|
|
117
|
+
colorOpacitySecondaryPressed: string;
|
|
118
118
|
colorSecondary: string;
|
|
119
119
|
colorSecondaryHover: string;
|
|
120
120
|
colorSecondaryPressed: string;
|