naive-ui 2.20.3 → 2.21.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/select-menu/src/SelectMenu.d.ts +3 -0
- package/es/_internal/selection/src/Selection.d.ts +3 -0
- package/es/_internal/suffix/src/Suffix.d.ts +4 -1
- package/es/_internal/suffix/src/Suffix.js +4 -1
- package/es/_styles/common/dark.js +1 -1
- package/es/_styles/common/light.d.ts +3 -0
- package/es/_styles/common/light.js +5 -2
- package/es/_styles/global/index.cssr.js +9 -4
- package/es/_styles/transitions/icon-switch.cssr.js +6 -2
- package/es/_utils/naive/extract-public-props.d.ts +1 -1
- package/es/alert/src/Alert.d.ts +3 -0
- package/es/auto-complete/src/AutoComplete.d.ts +8 -1
- package/es/auto-complete/src/AutoComplete.js +2 -2
- package/es/avatar/src/Avatar.d.ts +8 -1
- package/es/avatar/src/Avatar.js +41 -9
- package/es/avatar/src/styles/index.cssr.js +2 -2
- package/es/button/src/Button.d.ts +149 -52
- package/es/button/src/Button.js +128 -56
- package/es/button/src/interface.d.ts +1 -1
- package/es/button/styles/dark.js +3 -0
- package/es/button/styles/light.d.ts +14 -5
- package/es/button/styles/light.js +10 -3
- package/es/calendar/src/Calendar.d.ts +143 -50
- package/es/calendar/styles/light.d.ts +14 -5
- package/es/card/src/Card.d.ts +3 -0
- package/es/cascader/src/Cascader.d.ts +3 -0
- package/es/cascader/src/CascaderOption.d.ts +3 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +3 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +3 -0
- package/es/checkbox/src/Checkbox.d.ts +8 -5
- package/es/checkbox/src/Checkbox.js +3 -3
- package/es/collapse/src/Collapse.d.ts +3 -0
- package/es/color-picker/src/ColorInputUnit.d.ts +17 -5
- package/es/color-picker/src/ColorPicker.d.ts +126 -45
- package/es/color-picker/styles/light.d.ts +14 -5
- package/es/data-table/src/DataTable.d.ts +183 -51
- package/es/data-table/src/DataTable.js +11 -6
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +20 -5
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +20 -5
- package/es/data-table/src/TableParts/Body.d.ts +25 -6
- package/es/data-table/src/TableParts/Body.js +60 -22
- package/es/data-table/src/TableParts/BodyCheckbox.js +1 -1
- package/es/data-table/src/TableParts/Cell.d.ts +40 -10
- package/es/data-table/src/TableParts/Header.d.ts +20 -5
- 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 +8 -9
- package/es/data-table/styles/light.d.ts +20 -5
- package/es/data-table/styles/light.js +3 -3
- package/es/date-picker/src/DatePicker.d.ts +298 -105
- package/es/date-picker/src/panel/date.d.ts +45 -15
- package/es/date-picker/src/panel/daterange.d.ts +45 -15
- package/es/date-picker/src/panel/datetime.d.ts +45 -15
- package/es/date-picker/src/panel/datetimerange.d.ts +45 -15
- package/es/date-picker/src/panel/month.d.ts +45 -15
- package/es/date-picker/src/panel/use-calendar.d.ts +45 -15
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +45 -15
- package/es/date-picker/src/panel/use-panel-common.d.ts +45 -15
- package/es/date-picker/styles/light.d.ts +28 -10
- package/es/dialog/src/Dialog.d.ts +101 -35
- package/es/dialog/styles/light.d.ts +14 -5
- package/es/drawer/src/Drawer.d.ts +3 -0
- package/es/drawer/src/DrawerBodyWrapper.d.ts +3 -0
- package/es/drawer/src/DrawerContent.d.ts +3 -0
- package/es/dropdown/index.d.ts +1 -1
- package/es/dropdown/src/Dropdown.d.ts +5 -2
- package/es/dropdown/src/DropdownGroup.d.ts +2 -3
- package/es/dropdown/src/DropdownMenu.d.ts +3 -4
- package/es/dropdown/src/DropdownMenu.js +5 -4
- package/es/dropdown/src/DropdownOption.d.ts +3 -4
- package/es/dropdown/src/DropdownOption.js +2 -2
- package/es/dropdown/src/DropdownRenderOption.d.ts +2 -3
- package/es/dropdown/src/interface.d.ts +9 -30
- package/es/dropdown/src/utils.d.ts +1 -0
- package/es/dropdown/src/utils.js +10 -0
- package/es/dynamic-input/src/DynamicInput.d.ts +143 -50
- package/es/dynamic-input/src/InputPreset.d.ts +17 -5
- package/es/dynamic-input/src/PairPreset.d.ts +17 -5
- package/es/dynamic-input/styles/light.d.ts +14 -5
- package/es/dynamic-tags/src/DynamicTags.d.ts +144 -50
- package/es/dynamic-tags/styles/light.d.ts +14 -5
- package/es/ellipsis/src/Ellipsis.d.ts +3 -0
- package/es/global-style/src/GlobalStyle.js +2 -0
- package/es/input/src/Input.d.ts +4 -0
- package/es/input/src/Input.js +6 -0
- package/es/input/src/interface.d.ts +1 -0
- package/es/input-number/src/InputNumber.d.ts +144 -50
- package/es/input-number/styles/light.d.ts +14 -5
- package/es/layout/src/Layout.d.ts +6 -0
- package/es/layout/src/LayoutContent.d.ts +3 -0
- package/es/layout/src/LayoutSider.d.ts +3 -0
- package/es/log/src/Log.d.ts +3 -0
- package/es/mention/src/Mention.d.ts +4 -0
- package/es/menu/index.d.ts +1 -1
- package/es/menu/src/Menu.d.ts +19 -6
- package/es/menu/src/Menu.js +2 -1
- package/es/menu/src/MenuDivider.d.ts +2 -0
- package/es/menu/src/MenuDivider.js +11 -0
- package/es/menu/src/MenuOption.d.ts +8 -1
- package/es/menu/src/MenuOptionContent.d.ts +4 -1
- package/es/menu/src/Submenu.d.ts +18 -16
- package/es/menu/src/interface.d.ts +23 -4
- package/es/menu/src/styles/index.cssr.js +6 -1
- package/es/menu/src/utils.d.ts +4 -2
- package/es/menu/src/utils.js +16 -2
- package/es/menu/styles/light.d.ts +2 -0
- package/es/menu/styles/light.js +3 -2
- package/es/modal/src/BodyWrapper.d.ts +31 -10
- package/es/modal/src/Modal.d.ts +168 -60
- package/es/modal/styles/light.d.ts +14 -5
- package/es/notification/src/NotificationContainer.d.ts +3 -0
- package/es/pagination/src/Pagination.d.ts +4 -0
- package/es/popconfirm/src/Popconfirm.d.ts +143 -50
- package/es/popconfirm/styles/light.d.ts +14 -5
- package/es/popselect/src/Popselect.d.ts +3 -0
- package/es/popselect/src/PopselectPanel.d.ts +3 -0
- package/es/radio/src/Radio.d.ts +3 -0
- package/es/radio/src/RadioButton.d.ts +3 -0
- package/es/radio/src/use-radio.d.ts +2 -0
- package/es/radio/src/use-radio.js +6 -3
- package/es/select/src/Select.d.ts +3 -0
- package/es/slider/src/Slider.d.ts +70 -91
- package/es/slider/src/Slider.js +326 -583
- package/es/slider/src/interface.d.ts +1 -1
- package/es/slider/src/styles/index.cssr.js +86 -16
- package/es/slider/src/utils.d.ts +10 -1
- package/es/slider/src/utils.js +9 -0
- package/es/slider/styles/_common.d.ts +1 -0
- package/es/slider/styles/_common.js +1 -0
- package/es/slider/styles/light.d.ts +1 -0
- package/es/space/src/Space.js +2 -0
- package/es/steps/src/Step.js +1 -1
- package/es/table/src/Table.d.ts +35 -0
- package/es/table/src/Table.js +8 -4
- package/es/table/src/styles/index.cssr.js +1 -1
- package/es/table/styles/light.d.ts +3 -0
- package/es/table/styles/light.js +2 -2
- package/es/tabs/index.d.ts +2 -0
- package/es/tabs/index.js +1 -0
- package/es/tabs/src/Tab.d.ts +35 -18
- package/es/tabs/src/Tab.js +11 -12
- package/es/tabs/src/Tabs.js +58 -18
- package/es/tag/src/Tag.d.ts +8 -3
- package/es/tag/src/Tag.js +10 -2
- package/es/tag/src/styles/index.cssr.js +10 -5
- package/es/tag/src/styles/rtl.cssr.js +7 -1
- package/es/theme-editor/src/ThemeEditor.d.ts +3 -0
- package/es/time-picker/src/Panel.d.ts +17 -5
- package/es/time-picker/src/TimePicker.d.ts +144 -50
- package/es/time-picker/styles/light.d.ts +14 -5
- package/es/tooltip/src/Tooltip.d.ts +3 -0
- package/es/transfer/src/Transfer.d.ts +143 -50
- package/es/transfer/src/TransferFilter.d.ts +17 -5
- package/es/transfer/src/TransferList.d.ts +17 -5
- package/es/transfer/src/TransferListItem.d.ts +17 -5
- package/es/transfer/styles/light.d.ts +14 -5
- package/es/tree/src/Tree.d.ts +3 -0
- package/es/tree/src/TreeNodeCheckbox.d.ts +3 -0
- package/es/tree-select/src/TreeSelect.d.ts +3 -0
- package/es/upload/src/Upload.d.ts +143 -50
- package/es/upload/src/UploadFile.d.ts +18 -6
- package/es/upload/src/UploadProgress.d.ts +17 -5
- package/es/upload/styles/light.d.ts +14 -5
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +3 -0
- package/lib/_internal/selection/src/Selection.d.ts +3 -0
- package/lib/_internal/suffix/src/Suffix.d.ts +4 -1
- package/lib/_internal/suffix/src/Suffix.js +4 -1
- package/lib/_styles/common/dark.js +1 -1
- package/lib/_styles/common/light.d.ts +3 -0
- package/lib/_styles/common/light.js +5 -2
- package/lib/_styles/global/index.cssr.js +10 -5
- package/lib/_styles/transitions/icon-switch.cssr.js +7 -2
- package/lib/_utils/naive/extract-public-props.d.ts +1 -1
- package/lib/alert/src/Alert.d.ts +3 -0
- package/lib/auto-complete/src/AutoComplete.d.ts +8 -1
- package/lib/auto-complete/src/AutoComplete.js +2 -2
- package/lib/avatar/src/Avatar.d.ts +8 -1
- package/lib/avatar/src/Avatar.js +40 -8
- package/lib/avatar/src/styles/index.cssr.js +2 -2
- package/lib/button/src/Button.d.ts +149 -52
- package/lib/button/src/Button.js +126 -54
- package/lib/button/src/interface.d.ts +1 -1
- package/lib/button/styles/dark.js +3 -0
- package/lib/button/styles/light.d.ts +14 -5
- package/lib/button/styles/light.js +10 -3
- package/lib/calendar/src/Calendar.d.ts +143 -50
- package/lib/calendar/styles/light.d.ts +14 -5
- package/lib/card/src/Card.d.ts +3 -0
- package/lib/cascader/src/Cascader.d.ts +3 -0
- package/lib/cascader/src/CascaderOption.d.ts +3 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +3 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +3 -0
- package/lib/checkbox/src/Checkbox.d.ts +8 -5
- package/lib/checkbox/src/Checkbox.js +3 -3
- package/lib/collapse/src/Collapse.d.ts +3 -0
- package/lib/color-picker/src/ColorInputUnit.d.ts +17 -5
- package/lib/color-picker/src/ColorPicker.d.ts +126 -45
- package/lib/color-picker/styles/light.d.ts +14 -5
- package/lib/data-table/src/DataTable.d.ts +183 -51
- package/lib/data-table/src/DataTable.js +11 -6
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +20 -5
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +20 -5
- package/lib/data-table/src/TableParts/Body.d.ts +25 -6
- package/lib/data-table/src/TableParts/Body.js +60 -22
- package/lib/data-table/src/TableParts/BodyCheckbox.js +1 -1
- package/lib/data-table/src/TableParts/Cell.d.ts +40 -10
- package/lib/data-table/src/TableParts/Header.d.ts +20 -5
- 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 +8 -9
- package/lib/data-table/styles/light.d.ts +20 -5
- package/lib/data-table/styles/light.js +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +298 -105
- package/lib/date-picker/src/panel/date.d.ts +45 -15
- package/lib/date-picker/src/panel/daterange.d.ts +45 -15
- package/lib/date-picker/src/panel/datetime.d.ts +45 -15
- package/lib/date-picker/src/panel/datetimerange.d.ts +45 -15
- package/lib/date-picker/src/panel/month.d.ts +45 -15
- package/lib/date-picker/src/panel/use-calendar.d.ts +45 -15
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +45 -15
- package/lib/date-picker/src/panel/use-panel-common.d.ts +45 -15
- package/lib/date-picker/styles/light.d.ts +28 -10
- package/lib/dialog/src/Dialog.d.ts +101 -35
- package/lib/dialog/styles/light.d.ts +14 -5
- package/lib/drawer/src/Drawer.d.ts +3 -0
- package/lib/drawer/src/DrawerBodyWrapper.d.ts +3 -0
- package/lib/drawer/src/DrawerContent.d.ts +3 -0
- package/lib/dropdown/index.d.ts +1 -1
- package/lib/dropdown/src/Dropdown.d.ts +5 -2
- package/lib/dropdown/src/DropdownGroup.d.ts +2 -3
- package/lib/dropdown/src/DropdownMenu.d.ts +3 -4
- package/lib/dropdown/src/DropdownMenu.js +5 -4
- package/lib/dropdown/src/DropdownOption.d.ts +3 -4
- package/lib/dropdown/src/DropdownOption.js +1 -1
- package/lib/dropdown/src/DropdownRenderOption.d.ts +2 -3
- package/lib/dropdown/src/interface.d.ts +9 -30
- package/lib/dropdown/src/utils.d.ts +1 -0
- package/lib/dropdown/src/utils.js +12 -1
- package/lib/dynamic-input/src/DynamicInput.d.ts +143 -50
- package/lib/dynamic-input/src/InputPreset.d.ts +17 -5
- package/lib/dynamic-input/src/PairPreset.d.ts +17 -5
- package/lib/dynamic-input/styles/light.d.ts +14 -5
- package/lib/dynamic-tags/src/DynamicTags.d.ts +144 -50
- package/lib/dynamic-tags/styles/light.d.ts +14 -5
- package/lib/ellipsis/src/Ellipsis.d.ts +3 -0
- package/lib/global-style/src/GlobalStyle.js +2 -0
- package/lib/input/src/Input.d.ts +4 -0
- package/lib/input/src/Input.js +6 -0
- package/lib/input/src/interface.d.ts +1 -0
- package/lib/input-number/src/InputNumber.d.ts +144 -50
- package/lib/input-number/styles/light.d.ts +14 -5
- package/lib/layout/src/Layout.d.ts +6 -0
- package/lib/layout/src/LayoutContent.d.ts +3 -0
- package/lib/layout/src/LayoutSider.d.ts +3 -0
- package/lib/log/src/Log.d.ts +3 -0
- package/lib/mention/src/Mention.d.ts +4 -0
- package/lib/menu/index.d.ts +1 -1
- package/lib/menu/src/Menu.d.ts +19 -6
- package/lib/menu/src/Menu.js +2 -1
- package/lib/menu/src/MenuDivider.d.ts +2 -0
- package/lib/menu/src/MenuDivider.js +13 -0
- package/lib/menu/src/MenuOption.d.ts +8 -1
- package/lib/menu/src/MenuOptionContent.d.ts +4 -1
- package/lib/menu/src/Submenu.d.ts +18 -16
- package/lib/menu/src/interface.d.ts +23 -4
- package/lib/menu/src/styles/index.cssr.js +6 -1
- package/lib/menu/src/utils.d.ts +4 -2
- package/lib/menu/src/utils.js +22 -3
- package/lib/menu/styles/light.d.ts +2 -0
- package/lib/menu/styles/light.js +3 -2
- package/lib/modal/src/BodyWrapper.d.ts +31 -10
- package/lib/modal/src/Modal.d.ts +168 -60
- package/lib/modal/styles/light.d.ts +14 -5
- package/lib/notification/src/NotificationContainer.d.ts +3 -0
- package/lib/pagination/src/Pagination.d.ts +4 -0
- package/lib/popconfirm/src/Popconfirm.d.ts +143 -50
- package/lib/popconfirm/styles/light.d.ts +14 -5
- package/lib/popselect/src/Popselect.d.ts +3 -0
- package/lib/popselect/src/PopselectPanel.d.ts +3 -0
- package/lib/radio/src/Radio.d.ts +3 -0
- package/lib/radio/src/RadioButton.d.ts +3 -0
- package/lib/radio/src/use-radio.d.ts +2 -0
- package/lib/radio/src/use-radio.js +6 -3
- package/lib/select/src/Select.d.ts +3 -0
- package/lib/slider/src/Slider.d.ts +70 -91
- package/lib/slider/src/Slider.js +324 -581
- package/lib/slider/src/interface.d.ts +1 -1
- package/lib/slider/src/styles/index.cssr.js +86 -16
- package/lib/slider/src/utils.d.ts +10 -1
- package/lib/slider/src/utils.js +11 -1
- package/lib/slider/styles/_common.d.ts +1 -0
- package/lib/slider/styles/_common.js +1 -0
- package/lib/slider/styles/light.d.ts +1 -0
- package/lib/space/src/Space.js +2 -0
- package/lib/steps/src/Step.js +1 -1
- package/lib/table/src/Table.d.ts +35 -0
- package/lib/table/src/Table.js +8 -4
- package/lib/table/src/styles/index.cssr.js +1 -1
- package/lib/table/styles/light.d.ts +3 -0
- package/lib/table/styles/light.js +2 -2
- package/lib/tabs/index.d.ts +2 -0
- package/lib/tabs/index.js +3 -1
- package/lib/tabs/src/Tab.d.ts +35 -18
- package/lib/tabs/src/Tab.js +10 -11
- package/lib/tabs/src/Tabs.js +57 -17
- package/lib/tag/src/Tag.d.ts +8 -3
- package/lib/tag/src/Tag.js +10 -1
- package/lib/tag/src/styles/index.cssr.js +10 -5
- package/lib/tag/src/styles/rtl.cssr.js +7 -1
- package/lib/theme-editor/src/ThemeEditor.d.ts +3 -0
- package/lib/time-picker/src/Panel.d.ts +17 -5
- package/lib/time-picker/src/TimePicker.d.ts +144 -50
- package/lib/time-picker/styles/light.d.ts +14 -5
- package/lib/tooltip/src/Tooltip.d.ts +3 -0
- package/lib/transfer/src/Transfer.d.ts +143 -50
- package/lib/transfer/src/TransferFilter.d.ts +17 -5
- package/lib/transfer/src/TransferList.d.ts +17 -5
- package/lib/transfer/src/TransferListItem.d.ts +17 -5
- package/lib/transfer/styles/light.d.ts +14 -5
- package/lib/tree/src/Tree.d.ts +3 -0
- package/lib/tree/src/TreeNodeCheckbox.d.ts +3 -0
- package/lib/tree-select/src/TreeSelect.d.ts +3 -0
- package/lib/upload/src/Upload.d.ts +143 -50
- package/lib/upload/src/UploadFile.d.ts +18 -6
- package/lib/upload/src/UploadProgress.d.ts +17 -5
- package/lib/upload/styles/light.d.ts +14 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/web-types.json +146 -9
package/lib/menu/src/Menu.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { PropType, ExtractPropTypes, InjectionKey, VNodeChild } from 'vue';
|
|
|
2
2
|
import { Key } from 'treemate';
|
|
3
3
|
import type { MaybeArray } from '../../_utils';
|
|
4
4
|
import { MenuInjection } from './use-menu-child';
|
|
5
|
-
import { MenuOption, MenuGroupOption, OnUpdateValue, OnUpdateKeys } from './interface';
|
|
5
|
+
import { MenuOption, MenuGroupOption, MenuIgnoredOption, MenuMixedOption, OnUpdateValue, OnUpdateKeys } from './interface';
|
|
6
6
|
import { FollowerPlacement } from 'vueuc';
|
|
7
7
|
import { DropdownProps } from '../../dropdown';
|
|
8
8
|
declare const menuProps: {
|
|
9
9
|
readonly options: {
|
|
10
|
-
readonly type: PropType<
|
|
10
|
+
readonly type: PropType<MenuMixedOption[]>;
|
|
11
11
|
readonly default: () => never[];
|
|
12
12
|
};
|
|
13
13
|
readonly collapsed: {
|
|
@@ -121,6 +121,7 @@ declare const menuProps: {
|
|
|
121
121
|
itemColorActiveCollapsedInverted: string;
|
|
122
122
|
borderColorHorizontal: string;
|
|
123
123
|
fontSize: string;
|
|
124
|
+
dividerColor: string;
|
|
124
125
|
}, {
|
|
125
126
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
126
127
|
borderRadius: string;
|
|
@@ -184,6 +185,7 @@ declare const menuProps: {
|
|
|
184
185
|
itemColorActiveCollapsedInverted: string;
|
|
185
186
|
borderColorHorizontal: string;
|
|
186
187
|
fontSize: string;
|
|
188
|
+
dividerColor: string;
|
|
187
189
|
}, {
|
|
188
190
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
189
191
|
borderRadius: string;
|
|
@@ -247,6 +249,7 @@ declare const menuProps: {
|
|
|
247
249
|
itemColorActiveCollapsedInverted: string;
|
|
248
250
|
borderColorHorizontal: string;
|
|
249
251
|
fontSize: string;
|
|
252
|
+
dividerColor: string;
|
|
250
253
|
}, {
|
|
251
254
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
252
255
|
borderRadius: string;
|
|
@@ -277,7 +280,7 @@ export declare type MenuProps = Partial<MenuSetupProps>;
|
|
|
277
280
|
export declare const menuInjectionKey: InjectionKey<MenuInjection>;
|
|
278
281
|
declare const _default: import("vue").DefineComponent<{
|
|
279
282
|
readonly options: {
|
|
280
|
-
readonly type: PropType<
|
|
283
|
+
readonly type: PropType<MenuMixedOption[]>;
|
|
281
284
|
readonly default: () => never[];
|
|
282
285
|
};
|
|
283
286
|
readonly collapsed: {
|
|
@@ -391,6 +394,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
391
394
|
itemColorActiveCollapsedInverted: string;
|
|
392
395
|
borderColorHorizontal: string;
|
|
393
396
|
fontSize: string;
|
|
397
|
+
dividerColor: string;
|
|
394
398
|
}, {
|
|
395
399
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
396
400
|
borderRadius: string;
|
|
@@ -454,6 +458,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
454
458
|
itemColorActiveCollapsedInverted: string;
|
|
455
459
|
borderColorHorizontal: string;
|
|
456
460
|
fontSize: string;
|
|
461
|
+
dividerColor: string;
|
|
457
462
|
}, {
|
|
458
463
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
459
464
|
borderRadius: string;
|
|
@@ -517,6 +522,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
517
522
|
itemColorActiveCollapsedInverted: string;
|
|
518
523
|
borderColorHorizontal: string;
|
|
519
524
|
fontSize: string;
|
|
525
|
+
dividerColor: string;
|
|
520
526
|
}, {
|
|
521
527
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
522
528
|
borderRadius: string;
|
|
@@ -549,7 +555,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
549
555
|
uncontrolledValue: import("vue").Ref<Key | null>;
|
|
550
556
|
mergedValue: import("vue").ComputedRef<Key | null>;
|
|
551
557
|
activePath: import("vue").ComputedRef<Key[]>;
|
|
552
|
-
tmNodes: import("vue").ComputedRef<import("treemate").TreeNode<MenuOption, MenuGroupOption,
|
|
558
|
+
tmNodes: import("vue").ComputedRef<import("treemate").TreeNode<MenuOption, MenuGroupOption, MenuIgnoredOption>[]>;
|
|
553
559
|
mergedTheme: import("vue").ComputedRef<{
|
|
554
560
|
common: {
|
|
555
561
|
baseColor: string;
|
|
@@ -623,6 +629,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
623
629
|
pressedColor: string;
|
|
624
630
|
opacityDisabled: string;
|
|
625
631
|
inputColorDisabled: string;
|
|
632
|
+
buttonColor2: string;
|
|
633
|
+
buttonColor2Hover: string;
|
|
634
|
+
buttonColor2Pressed: string;
|
|
626
635
|
boxShadow1: string;
|
|
627
636
|
boxShadow2: string;
|
|
628
637
|
boxShadow3: string;
|
|
@@ -689,6 +698,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
689
698
|
itemColorActiveCollapsedInverted: string;
|
|
690
699
|
borderColorHorizontal: string;
|
|
691
700
|
fontSize: string;
|
|
701
|
+
dividerColor: string;
|
|
692
702
|
};
|
|
693
703
|
peers: {
|
|
694
704
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
@@ -782,7 +792,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
782
792
|
disabled: boolean;
|
|
783
793
|
keyField: string;
|
|
784
794
|
iconSize: number;
|
|
785
|
-
options:
|
|
795
|
+
options: MenuMixedOption[];
|
|
786
796
|
defaultValue: Key | null;
|
|
787
797
|
indent: number;
|
|
788
798
|
labelField: string;
|
|
@@ -835,6 +845,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
835
845
|
itemColorActiveCollapsedInverted: string;
|
|
836
846
|
borderColorHorizontal: string;
|
|
837
847
|
fontSize: string;
|
|
848
|
+
dividerColor: string;
|
|
838
849
|
}, {
|
|
839
850
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
840
851
|
borderRadius: string;
|
|
@@ -898,6 +909,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
898
909
|
itemColorActiveCollapsedInverted: string;
|
|
899
910
|
borderColorHorizontal: string;
|
|
900
911
|
fontSize: string;
|
|
912
|
+
dividerColor: string;
|
|
901
913
|
}, {
|
|
902
914
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
903
915
|
borderRadius: string;
|
|
@@ -961,6 +973,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
961
973
|
itemColorActiveCollapsedInverted: string;
|
|
962
974
|
borderColorHorizontal: string;
|
|
963
975
|
fontSize: string;
|
|
976
|
+
dividerColor: string;
|
|
964
977
|
}, {
|
|
965
978
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
966
979
|
borderRadius: string;
|
|
@@ -1009,7 +1022,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1009
1022
|
disabled: boolean;
|
|
1010
1023
|
keyField: string;
|
|
1011
1024
|
iconSize: number;
|
|
1012
|
-
options:
|
|
1025
|
+
options: MenuMixedOption[];
|
|
1013
1026
|
defaultValue: Key | null;
|
|
1014
1027
|
indent: number;
|
|
1015
1028
|
labelField: string;
|
package/lib/menu/src/Menu.js
CHANGED
|
@@ -208,8 +208,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
208
208
|
cssVars: (0, vue_1.computed)(() => {
|
|
209
209
|
const { inverted } = props;
|
|
210
210
|
const { common: { cubicBezierEaseInOut }, self } = themeRef.value;
|
|
211
|
-
const { borderRadius, borderColorHorizontal, fontSize, itemHeight } = self;
|
|
211
|
+
const { borderRadius, borderColorHorizontal, fontSize, itemHeight, dividerColor } = self;
|
|
212
212
|
const vars = {
|
|
213
|
+
'--divider-color': dividerColor,
|
|
213
214
|
'--bezier': cubicBezierEaseInOut,
|
|
214
215
|
'--font-size': fontSize,
|
|
215
216
|
'--border-color-horizontal': borderColorHorizontal,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vue_1 = require("vue");
|
|
4
|
+
const Menu_1 = require("./Menu");
|
|
5
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
6
|
+
name: 'MenuDivider',
|
|
7
|
+
setup() {
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9
|
+
const NMenu = (0, vue_1.inject)(Menu_1.menuInjectionKey);
|
|
10
|
+
const { mergedClsPrefixRef, isHorizontalRef } = NMenu;
|
|
11
|
+
return () => isHorizontalRef.value ? null : ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-menu-divider` }));
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -121,6 +121,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
121
121
|
pressedColor: string;
|
|
122
122
|
opacityDisabled: string;
|
|
123
123
|
inputColorDisabled: string;
|
|
124
|
+
buttonColor2: string;
|
|
125
|
+
buttonColor2Hover: string;
|
|
126
|
+
buttonColor2Pressed: string;
|
|
124
127
|
boxShadow1: string;
|
|
125
128
|
boxShadow2: string;
|
|
126
129
|
boxShadow3: string;
|
|
@@ -187,6 +190,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
187
190
|
itemColorActiveCollapsedInverted: string;
|
|
188
191
|
borderColorHorizontal: string;
|
|
189
192
|
fontSize: string;
|
|
193
|
+
dividerColor: string;
|
|
190
194
|
};
|
|
191
195
|
peers: {
|
|
192
196
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
@@ -278,7 +282,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
278
282
|
disabled: boolean;
|
|
279
283
|
keyField: string;
|
|
280
284
|
iconSize: number;
|
|
281
|
-
options:
|
|
285
|
+
options: import("./interface").MenuMixedOption[];
|
|
282
286
|
defaultValue: import("treemate").Key | null;
|
|
283
287
|
indent: number;
|
|
284
288
|
labelField: string;
|
|
@@ -331,6 +335,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
331
335
|
itemColorActiveCollapsedInverted: string;
|
|
332
336
|
borderColorHorizontal: string;
|
|
333
337
|
fontSize: string;
|
|
338
|
+
dividerColor: string;
|
|
334
339
|
}, {
|
|
335
340
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
336
341
|
borderRadius: string;
|
|
@@ -394,6 +399,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
394
399
|
itemColorActiveCollapsedInverted: string;
|
|
395
400
|
borderColorHorizontal: string;
|
|
396
401
|
fontSize: string;
|
|
402
|
+
dividerColor: string;
|
|
397
403
|
}, {
|
|
398
404
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
399
405
|
borderRadius: string;
|
|
@@ -457,6 +463,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
457
463
|
itemColorActiveCollapsedInverted: string;
|
|
458
464
|
borderColorHorizontal: string;
|
|
459
465
|
fontSize: string;
|
|
466
|
+
dividerColor: string;
|
|
460
467
|
}, {
|
|
461
468
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
462
469
|
borderRadius: string;
|
|
@@ -77,7 +77,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
77
77
|
disabled: boolean;
|
|
78
78
|
keyField: string;
|
|
79
79
|
iconSize: number;
|
|
80
|
-
options:
|
|
80
|
+
options: import("./interface").MenuMixedOption[];
|
|
81
81
|
defaultValue: import("treemate").Key | null;
|
|
82
82
|
indent: number;
|
|
83
83
|
labelField: string;
|
|
@@ -130,6 +130,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
130
130
|
itemColorActiveCollapsedInverted: string;
|
|
131
131
|
borderColorHorizontal: string;
|
|
132
132
|
fontSize: string;
|
|
133
|
+
dividerColor: string;
|
|
133
134
|
}, {
|
|
134
135
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
135
136
|
borderRadius: string;
|
|
@@ -193,6 +194,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
193
194
|
itemColorActiveCollapsedInverted: string;
|
|
194
195
|
borderColorHorizontal: string;
|
|
195
196
|
fontSize: string;
|
|
197
|
+
dividerColor: string;
|
|
196
198
|
}, {
|
|
197
199
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
198
200
|
borderRadius: string;
|
|
@@ -256,6 +258,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
256
258
|
itemColorActiveCollapsedInverted: string;
|
|
257
259
|
borderColorHorizontal: string;
|
|
258
260
|
fontSize: string;
|
|
261
|
+
dividerColor: string;
|
|
259
262
|
}, {
|
|
260
263
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
261
264
|
borderRadius: string;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { PropType, VNodeChild, InjectionKey } from 'vue';
|
|
2
2
|
import type { SubmenuInjection } from './use-menu-child';
|
|
3
|
-
import {
|
|
4
|
-
import { MenuGroupOption, MenuOption, TmNode } from './interface';
|
|
3
|
+
import { MenuMixedOption, TmNode } from './interface';
|
|
5
4
|
export declare const submenuProps: {
|
|
6
5
|
readonly rawNodes: {
|
|
7
|
-
readonly type: PropType<
|
|
6
|
+
readonly type: PropType<MenuMixedOption[]>;
|
|
8
7
|
readonly default: () => never[];
|
|
9
8
|
};
|
|
10
9
|
readonly tmNodes: {
|
|
11
|
-
readonly type: PropType<
|
|
10
|
+
readonly type: PropType<TmNode[]>;
|
|
12
11
|
readonly default: () => never[];
|
|
13
12
|
};
|
|
14
13
|
readonly tmNode: {
|
|
@@ -37,11 +36,11 @@ export declare const submenuProps: {
|
|
|
37
36
|
export declare const submenuInjectionKey: InjectionKey<SubmenuInjection>;
|
|
38
37
|
declare const _default: import("vue").DefineComponent<{
|
|
39
38
|
readonly rawNodes: {
|
|
40
|
-
readonly type: PropType<
|
|
39
|
+
readonly type: PropType<MenuMixedOption[]>;
|
|
41
40
|
readonly default: () => never[];
|
|
42
41
|
};
|
|
43
42
|
readonly tmNodes: {
|
|
44
|
-
readonly type: PropType<
|
|
43
|
+
readonly type: PropType<TmNode[]>;
|
|
45
44
|
readonly default: () => never[];
|
|
46
45
|
};
|
|
47
46
|
readonly tmNode: {
|
|
@@ -112,7 +111,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
111
|
disabled: boolean;
|
|
113
112
|
keyField: string;
|
|
114
113
|
iconSize: number;
|
|
115
|
-
options:
|
|
114
|
+
options: MenuMixedOption[];
|
|
116
115
|
defaultValue: import("treemate").Key | null;
|
|
117
116
|
indent: number;
|
|
118
117
|
labelField: string;
|
|
@@ -165,6 +164,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
165
164
|
itemColorActiveCollapsedInverted: string;
|
|
166
165
|
borderColorHorizontal: string;
|
|
167
166
|
fontSize: string;
|
|
167
|
+
dividerColor: string;
|
|
168
168
|
}, {
|
|
169
169
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
170
170
|
borderRadius: string;
|
|
@@ -228,6 +228,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
228
228
|
itemColorActiveCollapsedInverted: string;
|
|
229
229
|
borderColorHorizontal: string;
|
|
230
230
|
fontSize: string;
|
|
231
|
+
dividerColor: string;
|
|
231
232
|
}, {
|
|
232
233
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
233
234
|
borderRadius: string;
|
|
@@ -291,6 +292,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
291
292
|
itemColorActiveCollapsedInverted: string;
|
|
292
293
|
borderColorHorizontal: string;
|
|
293
294
|
fontSize: string;
|
|
295
|
+
dividerColor: string;
|
|
294
296
|
}, {
|
|
295
297
|
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
296
298
|
borderRadius: string;
|
|
@@ -315,23 +317,23 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
315
317
|
}, any>;
|
|
316
318
|
}>;
|
|
317
319
|
}>> | undefined;
|
|
318
|
-
items?: (MenuOption | MenuGroupOption)[] | undefined;
|
|
319
|
-
renderIcon?: ((option: MenuOption) => VNodeChild) | undefined;
|
|
320
|
-
renderLabel?: ((option: MenuOption | MenuGroupOption) => VNodeChild) | undefined;
|
|
320
|
+
items?: (import("./interface").MenuOption | import("./interface").MenuGroupOption)[] | undefined;
|
|
321
|
+
renderIcon?: ((option: import("./interface").MenuOption) => VNodeChild) | undefined;
|
|
322
|
+
renderLabel?: ((option: import("./interface").MenuOption | import("./interface").MenuGroupOption) => VNodeChild) | undefined;
|
|
321
323
|
"onUpdate:value"?: import("../../_utils").MaybeArray<import("./interface").OnUpdateValue> | undefined;
|
|
322
324
|
onUpdateValue?: import("../../_utils").MaybeArray<import("./interface").OnUpdateValue> | undefined;
|
|
323
325
|
defaultExpandedNames?: import("treemate").Key[] | undefined;
|
|
324
326
|
expandedNames?: import("treemate").Key[] | undefined;
|
|
325
327
|
onExpandedNamesChange?: import("../../_utils").MaybeArray<import("./interface").OnUpdateKeys> | undefined;
|
|
326
328
|
collapsed?: boolean | undefined;
|
|
327
|
-
expandIcon?: ((option: MenuOption) => VNodeChild) | undefined;
|
|
329
|
+
expandIcon?: ((option: import("./interface").MenuOption) => VNodeChild) | undefined;
|
|
328
330
|
defaultExpandedKeys?: import("treemate").Key[] | undefined;
|
|
329
331
|
rootIndent?: number | undefined;
|
|
330
332
|
expandedKeys?: import("treemate").Key[] | undefined;
|
|
331
333
|
watchProps?: ("defaultValue" | "defaultExpandedKeys")[] | undefined;
|
|
332
334
|
"onUpdate:expandedKeys"?: import("../../_utils").MaybeArray<import("./interface").OnUpdateKeys> | undefined;
|
|
333
335
|
onUpdateExpandedKeys?: import("../../_utils").MaybeArray<import("./interface").OnUpdateKeys> | undefined;
|
|
334
|
-
renderExtra?: ((option: MenuOption | MenuGroupOption) => VNodeChild) | undefined;
|
|
336
|
+
renderExtra?: ((option: import("./interface").MenuOption | import("./interface").MenuGroupOption) => VNodeChild) | undefined;
|
|
335
337
|
dropdownProps?: import("../../dropdown").DropdownProps | undefined;
|
|
336
338
|
onOpenNamesChange?: import("../../_utils").MaybeArray<import("./interface").OnUpdateKeys> | undefined;
|
|
337
339
|
};
|
|
@@ -371,9 +373,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
371
373
|
tmNode: TmNode;
|
|
372
374
|
level: number;
|
|
373
375
|
isGroup: boolean;
|
|
374
|
-
tmNodes:
|
|
376
|
+
tmNodes: TmNode[];
|
|
375
377
|
internalKey: import("treemate").Key;
|
|
376
|
-
rawNodes:
|
|
378
|
+
rawNodes: MenuMixedOption[];
|
|
377
379
|
} & {
|
|
378
380
|
extra?: string | (() => VNodeChild) | undefined;
|
|
379
381
|
icon?: (() => VNodeChild) | undefined;
|
|
@@ -383,7 +385,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
383
385
|
root: boolean;
|
|
384
386
|
disabled: boolean;
|
|
385
387
|
isGroup: boolean;
|
|
386
|
-
tmNodes:
|
|
387
|
-
rawNodes:
|
|
388
|
+
tmNodes: TmNode[];
|
|
389
|
+
rawNodes: MenuMixedOption[];
|
|
388
390
|
}>;
|
|
389
391
|
export default _default;
|
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
import { TreeNode } from 'treemate';
|
|
2
|
-
import { VNodeChild } from 'vue';
|
|
2
|
+
import { VNodeChild, HTMLAttributes } from 'vue';
|
|
3
3
|
export declare type Key = string | number;
|
|
4
4
|
export interface MenuOptionSharedPart {
|
|
5
5
|
key?: Key;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
icon?: () => VNodeChild;
|
|
8
|
-
children?: Array<MenuOption | MenuGroupOption>;
|
|
8
|
+
children?: Array<MenuOption | MenuGroupOption | MenuDividerOption>;
|
|
9
9
|
extra?: string | (() => VNodeChild);
|
|
10
|
+
props?: HTMLAttributes;
|
|
10
11
|
[key: string]: unknown;
|
|
11
12
|
/** @deprecated */
|
|
12
13
|
titleExtra?: string | (() => VNodeChild);
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
export declare type MenuIgnoredOption = MenuDividerOption | MenuRenderOption;
|
|
19
|
+
export interface MenuDividerOption {
|
|
20
|
+
type: 'divider';
|
|
21
|
+
key?: Key;
|
|
22
|
+
props?: HTMLAttributes;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface MenuRenderOption {
|
|
26
|
+
type: 'render';
|
|
27
|
+
key?: Key;
|
|
28
|
+
props?: HTMLAttributes;
|
|
29
|
+
render?: () => VNodeChild;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
14
32
|
export interface MenuGroupOptionBase extends MenuOptionSharedPart {
|
|
15
33
|
type: 'group';
|
|
16
|
-
children
|
|
34
|
+
children: Array<MenuOption | MenuDividerOption>;
|
|
17
35
|
}
|
|
18
36
|
export declare type MenuOption = (MenuOptionSharedPart & {
|
|
19
37
|
/** @deprecated */
|
|
@@ -27,7 +45,8 @@ export declare type MenuGroupOption = (MenuGroupOptionBase & {
|
|
|
27
45
|
}) | (MenuGroupOptionBase & {
|
|
28
46
|
label?: string | (() => VNodeChild);
|
|
29
47
|
});
|
|
30
|
-
export declare type
|
|
48
|
+
export declare type MenuMixedOption = MenuDividerOption | MenuOption | MenuGroupOption;
|
|
49
|
+
export declare type TmNode = TreeNode<MenuOption, MenuGroupOption, MenuIgnoredOption>;
|
|
31
50
|
export declare type OnUpdateValue = (value: string & number & (string | number), item: MenuOption) => void;
|
|
32
51
|
export declare type OnUpdateKeys = (keys: string[] & number[] & Array<string | number>) => void;
|
|
33
52
|
export declare type OnUpdateValueImpl = (value: string | number | (string | number), item: MenuOption) => void;
|
|
@@ -207,7 +207,12 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('menu', `
|
|
|
207
207
|
`)])]), (0, cssr_1.cB)('menu-tooltip', [(0, cssr_1.c)('a', `
|
|
208
208
|
color: inherit;
|
|
209
209
|
text-decoration: none;
|
|
210
|
-
`)])
|
|
210
|
+
`)]), (0, cssr_1.cB)('menu-divider', `
|
|
211
|
+
transition: background-color .3s var(--bezier);
|
|
212
|
+
background-color: var(--divider-color);
|
|
213
|
+
height: 1px;
|
|
214
|
+
margin: 6px 18px;
|
|
215
|
+
`)]);
|
|
211
216
|
|
|
212
217
|
function hoverStyle(props, children) {
|
|
213
218
|
return [(0, cssr_1.cM)('hover', props, children), (0, cssr_1.c)('&:hover', props, children)];
|
package/lib/menu/src/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
import type { TreeNode } from 'treemate';
|
|
3
|
-
import { MenuOption, MenuGroupOption } from './interface';
|
|
3
|
+
import { MenuOption, MenuGroupOption, MenuIgnoredOption, MenuMixedOption } from './interface';
|
|
4
4
|
import { MenuSetupProps } from './Menu';
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function isIgnoredNode(rawNode: MenuMixedOption): rawNode is MenuIgnoredOption;
|
|
6
|
+
export declare function isDividerNode(rawNode: MenuMixedOption): rawNode is MenuIgnoredOption;
|
|
7
|
+
export declare function itemRenderer(tmNode: TreeNode<MenuOption, MenuGroupOption, MenuIgnoredOption>, menuProps: MenuSetupProps): VNode | undefined;
|
package/lib/menu/src/utils.js
CHANGED
|
@@ -18,19 +18,38 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
21
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.itemRenderer = void 0;
|
|
25
|
+
exports.itemRenderer = exports.isDividerNode = exports.isIgnoredNode = void 0;
|
|
23
26
|
const vue_1 = require("vue");
|
|
24
27
|
const _utils_1 = require("../../_utils");
|
|
25
28
|
const MenuOptionGroup_1 = __importStar(require("./MenuOptionGroup"));
|
|
26
29
|
const Submenu_1 = __importStar(require("./Submenu"));
|
|
27
30
|
const MenuOption_1 = __importStar(require("./MenuOption"));
|
|
31
|
+
const MenuDivider_1 = __importDefault(require("./MenuDivider"));
|
|
28
32
|
const groupPropKeys = (0, _utils_1.keysOf)(MenuOptionGroup_1.menuItemGroupProps);
|
|
29
33
|
const itemPropKeys = (0, _utils_1.keysOf)(MenuOption_1.menuItemProps);
|
|
30
34
|
const submenuPropKeys = (0, _utils_1.keysOf)(Submenu_1.submenuProps);
|
|
35
|
+
function isIgnoredNode(rawNode) {
|
|
36
|
+
return rawNode.type === 'divider' || rawNode.type === 'render';
|
|
37
|
+
}
|
|
38
|
+
exports.isIgnoredNode = isIgnoredNode;
|
|
39
|
+
function isDividerNode(rawNode) {
|
|
40
|
+
return rawNode.type === 'divider';
|
|
41
|
+
}
|
|
42
|
+
exports.isDividerNode = isDividerNode;
|
|
31
43
|
function itemRenderer(tmNode, menuProps) {
|
|
44
|
+
const { rawNode } = tmNode;
|
|
45
|
+
if (isIgnoredNode(rawNode)) {
|
|
46
|
+
if (isDividerNode(rawNode)) {
|
|
47
|
+
return (0, vue_1.h)(MenuDivider_1.default, Object.assign({ key: tmNode.key }, rawNode.props));
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
32
51
|
const { labelField } = menuProps;
|
|
33
|
-
const {
|
|
52
|
+
const { key, level, isGroup } = tmNode;
|
|
34
53
|
const props = Object.assign(Object.assign({}, rawNode), { title: (rawNode.title || rawNode[labelField]), extra: rawNode.titleExtra || rawNode.extra, key, internalKey: key, // since key can't be used as a prop
|
|
35
54
|
level, root: level === 0, isGroup });
|
|
36
55
|
if (tmNode.children) {
|
|
@@ -39,7 +58,7 @@ function itemRenderer(tmNode, menuProps) {
|
|
|
39
58
|
}
|
|
40
59
|
return (0, vue_1.h)(Submenu_1.default, (0, _utils_1.keep)(props, submenuPropKeys, {
|
|
41
60
|
key,
|
|
42
|
-
rawNodes:
|
|
61
|
+
rawNodes: rawNode[menuProps.childrenField],
|
|
43
62
|
tmNodes: tmNode.children,
|
|
44
63
|
tmNode
|
|
45
64
|
}));
|
|
@@ -54,6 +54,7 @@ export declare const self: (vars: ThemeCommonVars) => {
|
|
|
54
54
|
itemColorActiveCollapsedInverted: string;
|
|
55
55
|
borderColorHorizontal: string;
|
|
56
56
|
fontSize: string;
|
|
57
|
+
dividerColor: string;
|
|
57
58
|
};
|
|
58
59
|
export declare type MenuThemeVars = ReturnType<typeof self>;
|
|
59
60
|
declare const menuLight: import("../../_mixins/use-theme").Theme<"Menu", {
|
|
@@ -95,6 +96,7 @@ declare const menuLight: import("../../_mixins/use-theme").Theme<"Menu", {
|
|
|
95
96
|
itemColorActiveCollapsedInverted: string;
|
|
96
97
|
borderColorHorizontal: string;
|
|
97
98
|
fontSize: string;
|
|
99
|
+
dividerColor: string;
|
|
98
100
|
}, {
|
|
99
101
|
Tooltip: import("../../_mixins/use-theme").Theme<"Tooltip", {
|
|
100
102
|
borderRadius: string;
|
package/lib/menu/styles/light.js
CHANGED
|
@@ -25,8 +25,9 @@ function createPartialInvertedVars(color, activeColor, groupColor) {
|
|
|
25
25
|
}
|
|
26
26
|
exports.createPartialInvertedVars = createPartialInvertedVars;
|
|
27
27
|
const self = (vars) => {
|
|
28
|
-
const { borderRadius, textColor3, primaryColor, textColor2, primaryColorHover, textColor1, fontSize } = vars;
|
|
29
|
-
return Object.assign({ borderRadius: borderRadius, color: '#0000', groupTextColor: textColor3, itemColorActive: (0, seemly_1.changeColor)(primaryColor, { alpha: 0.1 }), itemColorActiveCollapsed: '#0000', itemTextColor: textColor2, itemTextColorHover: primaryColorHover, itemTextColorChildActive: primaryColor, itemTextColorActive: primaryColor, itemIconColor: textColor1, itemIconColorHover: primaryColorHover, itemIconColorActive: primaryColor, itemIconColorChildActive: primaryColor, itemIconColorCollapsed: textColor1, itemHeight: '42px', arrowColor: textColor2, arrowColorHover: primaryColorHover, arrowColorChildActive: primaryColor, arrowColorActive: primaryColor, colorInverted: '#0000', itemColorActiveInverted: primaryColor, itemColorActiveCollapsedInverted: primaryColor, borderColorHorizontal: '#0000', fontSize
|
|
28
|
+
const { borderRadius, textColor3, primaryColor, textColor2, primaryColorHover, textColor1, fontSize, dividerColor } = vars;
|
|
29
|
+
return Object.assign({ borderRadius: borderRadius, color: '#0000', groupTextColor: textColor3, itemColorActive: (0, seemly_1.changeColor)(primaryColor, { alpha: 0.1 }), itemColorActiveCollapsed: '#0000', itemTextColor: textColor2, itemTextColorHover: primaryColorHover, itemTextColorChildActive: primaryColor, itemTextColorActive: primaryColor, itemIconColor: textColor1, itemIconColorHover: primaryColorHover, itemIconColorActive: primaryColor, itemIconColorChildActive: primaryColor, itemIconColorCollapsed: textColor1, itemHeight: '42px', arrowColor: textColor2, arrowColorHover: primaryColorHover, arrowColorChildActive: primaryColor, arrowColorActive: primaryColor, colorInverted: '#0000', itemColorActiveInverted: primaryColor, itemColorActiveCollapsedInverted: primaryColor, borderColorHorizontal: '#0000', fontSize,
|
|
30
|
+
dividerColor }, createPartialInvertedVars('#BBB', '#FFF', '#AAA'));
|
|
30
31
|
};
|
|
31
32
|
exports.self = self;
|
|
32
33
|
const menuLight = (0, use_theme_1.createTheme)({
|
|
@@ -142,6 +142,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
142
142
|
pressedColor: string;
|
|
143
143
|
opacityDisabled: string;
|
|
144
144
|
inputColorDisabled: string;
|
|
145
|
+
buttonColor2: string;
|
|
146
|
+
buttonColor2Hover: string;
|
|
147
|
+
buttonColor2Pressed: string;
|
|
145
148
|
boxShadow1: string;
|
|
146
149
|
boxShadow2: string;
|
|
147
150
|
boxShadow3: string;
|
|
@@ -221,20 +224,30 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
221
224
|
fontSizeMedium: string;
|
|
222
225
|
fontSizeLarge: string;
|
|
223
226
|
opacityDisabled: string;
|
|
227
|
+
colorOpacitySecondary: number;
|
|
228
|
+
colorOpacitySecondaryHover: number;
|
|
229
|
+
colorOpacitySecondaryPressed: number;
|
|
230
|
+
colorSecondary: string;
|
|
231
|
+
colorSecondaryHover: string;
|
|
232
|
+
colorSecondaryPressed: string;
|
|
233
|
+
colorTertiary: string;
|
|
234
|
+
colorTertiaryHover: string;
|
|
235
|
+
colorTertiaryPressed: string;
|
|
236
|
+
colorQuaternary: string;
|
|
237
|
+
colorQuaternaryHover: string;
|
|
238
|
+
colorQuaternaryPressed: string;
|
|
224
239
|
color: string;
|
|
225
240
|
colorHover: string;
|
|
226
241
|
colorPressed: string;
|
|
227
242
|
colorFocus: string;
|
|
228
243
|
colorDisabled: string;
|
|
229
244
|
textColor: string;
|
|
245
|
+
textColorTertiary: string;
|
|
230
246
|
textColorHover: string;
|
|
231
247
|
textColorPressed: string;
|
|
232
248
|
textColorFocus: string;
|
|
233
249
|
textColorDisabled: string;
|
|
234
250
|
textColorText: string;
|
|
235
|
-
textColorTextDepth1: string;
|
|
236
|
-
textColorTextDepth2: string;
|
|
237
|
-
textColorTextDepth3: string;
|
|
238
251
|
textColorTextHover: string;
|
|
239
252
|
textColorTextPressed: string;
|
|
240
253
|
textColorTextFocus: string;
|
|
@@ -381,9 +394,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
381
394
|
borderDisabledError: string;
|
|
382
395
|
rippleColorError: string;
|
|
383
396
|
waveOpacity: string;
|
|
384
|
-
fontWeightText: string;
|
|
385
397
|
fontWeight: string;
|
|
386
|
-
|
|
398
|
+
fontWeightStrong: string;
|
|
387
399
|
paddingTiny: string;
|
|
388
400
|
paddingSmall: string;
|
|
389
401
|
paddingMedium: string;
|
|
@@ -457,20 +469,30 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
457
469
|
fontSizeMedium: string;
|
|
458
470
|
fontSizeLarge: string;
|
|
459
471
|
opacityDisabled: string;
|
|
472
|
+
colorOpacitySecondary: number;
|
|
473
|
+
colorOpacitySecondaryHover: number;
|
|
474
|
+
colorOpacitySecondaryPressed: number;
|
|
475
|
+
colorSecondary: string;
|
|
476
|
+
colorSecondaryHover: string;
|
|
477
|
+
colorSecondaryPressed: string;
|
|
478
|
+
colorTertiary: string;
|
|
479
|
+
colorTertiaryHover: string;
|
|
480
|
+
colorTertiaryPressed: string;
|
|
481
|
+
colorQuaternary: string;
|
|
482
|
+
colorQuaternaryHover: string;
|
|
483
|
+
colorQuaternaryPressed: string;
|
|
460
484
|
color: string;
|
|
461
485
|
colorHover: string;
|
|
462
486
|
colorPressed: string;
|
|
463
487
|
colorFocus: string;
|
|
464
488
|
colorDisabled: string;
|
|
465
489
|
textColor: string;
|
|
490
|
+
textColorTertiary: string;
|
|
466
491
|
textColorHover: string;
|
|
467
492
|
textColorPressed: string;
|
|
468
493
|
textColorFocus: string;
|
|
469
494
|
textColorDisabled: string;
|
|
470
495
|
textColorText: string;
|
|
471
|
-
textColorTextDepth1: string;
|
|
472
|
-
textColorTextDepth2: string;
|
|
473
|
-
textColorTextDepth3: string;
|
|
474
496
|
textColorTextHover: string;
|
|
475
497
|
textColorTextPressed: string;
|
|
476
498
|
textColorTextFocus: string;
|
|
@@ -617,9 +639,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
617
639
|
borderDisabledError: string;
|
|
618
640
|
rippleColorError: string;
|
|
619
641
|
waveOpacity: string;
|
|
620
|
-
fontWeightText: string;
|
|
621
642
|
fontWeight: string;
|
|
622
|
-
|
|
643
|
+
fontWeightStrong: string;
|
|
623
644
|
paddingTiny: string;
|
|
624
645
|
paddingSmall: string;
|
|
625
646
|
paddingMedium: string;
|