@sdata/web-vue 3.13.0 → 3.15.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/dist/sd.css +167 -114
- package/dist/sd.min.css +2 -2
- package/es/_components/input-label/input-label.d.ts +2 -0
- package/es/_components/input-label/input-label.js +4 -2
- package/es/_components/input-label/style/index.css +2 -2
- package/es/_components/picker/style/index.scss +8 -2
- package/es/_components/resize-observer.js +1 -1
- package/es/_components/resize-trigger.vue_vue_type_script_setup_true_lang.js +13 -3
- package/es/_components/select-view/select-view.d.ts +2 -0
- package/es/_components/select-view/select-view.js +7 -1
- package/es/_components/select-view/style/index.css +5 -5
- package/es/_hooks/use-focus-trap.d.ts +10 -0
- package/es/_hooks/use-focus-trap.js +115 -0
- package/es/_utils/dom.js +1 -10
- package/es/_utils/keyboard.d.ts +4 -0
- package/es/_utils/keyboard.js +21 -2
- package/es/alert/alert.vue.d.ts +2 -2
- package/es/alert/alert.vue_vue_type_script_setup_true_lang.js +16 -4
- package/es/alert/index.d.ts +5 -5
- package/es/alert/style/index.css +1 -1
- package/es/alert/style/index.scss +1 -1
- package/es/anchor/anchor-link.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +6 -1
- package/es/anchor/style/index.css +1 -1
- package/es/anchor/style/index.scss +3 -1
- package/es/auto-complete/auto-complete.js +8 -0
- package/es/avatar/avatar.vue_vue_type_script_setup_true_lang.js +8 -2
- package/es/avatar/style/index.css +2 -2
- package/es/avatar/style/index.scss +2 -2
- package/es/back-top/back-top.vue_vue_type_script_setup_true_lang.js +8 -1
- package/es/back-top/style/index.css +1 -1
- package/es/back-top/style/index.scss +2 -1
- package/es/badge/badge.js +4 -1
- package/es/badge/style/index.css +3 -3
- package/es/badge/style/index.scss +3 -3
- package/es/basic-crud-table/basic-crud-modal.js +5 -0
- package/es/basic-crud-table/basic-crud-modal.vue.d.ts +264 -0
- package/es/basic-crud-table/basic-crud-modal.vue_vue_type_script_setup_true_lang.js +139 -0
- package/es/basic-crud-table/basic-crud-table.js +5 -0
- package/es/basic-crud-table/basic-crud-table.vue.d.ts +935 -0
- package/es/basic-crud-table/basic-crud-table.vue_vue_type_script_setup_true_lang.js +510 -0
- package/es/basic-crud-table/index.d.ts +2722 -0
- package/es/basic-crud-table/index.js +9 -0
- package/es/basic-crud-table/style/css.js +2 -0
- package/es/basic-crud-table/style/index.css +42 -0
- package/es/basic-crud-table/style/index.d.ts +2 -0
- package/es/basic-crud-table/style/index.js +2 -0
- package/es/basic-crud-table/style/index.scss +33 -0
- package/es/basic-crud-table/style/token.scss +8 -0
- package/es/basic-crud-table/types.d.ts +69 -0
- package/es/breadcrumb/breadcrumb-item.js +4 -2
- package/es/breadcrumb/breadcrumb.js +3 -0
- package/es/button/button.vue_vue_type_script_setup_true_lang.js +10 -5
- package/es/button/style/index.css +15 -6
- package/es/button/style/index.scss +25 -7
- package/es/calendar/components/event.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/calendar/components/headings-bar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/calendar/style/event.scss +2 -2
- package/es/calendar/style/index.css +2 -2
- package/es/card/style/index.css +3 -3
- package/es/card/style/index.scss +3 -3
- package/es/carousel/carousel-arrow.vue.d.ts +4 -4
- package/es/carousel/carousel-arrow.vue_vue_type_script_setup_true_lang.js +25 -5
- package/es/carousel/carousel-indicator.vue_vue_type_script_setup_true_lang.js +25 -4
- package/es/carousel/carousel-item.vue_vue_type_script_setup_true_lang.js +11 -2
- package/es/carousel/carousel.js +20 -1
- package/es/carousel/style/index.css +1 -1
- package/es/carousel/style/index.scss +1 -1
- package/es/cascader/cascader-option.js +1 -1
- package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +13 -4
- package/es/cascader/style/index.css +2 -2
- package/es/cascader/style/index.scss +3 -1
- package/es/checkbox/checkbox-group.js +4 -1
- package/es/checkbox/checkbox.d.ts +9 -0
- package/es/checkbox/checkbox.js +14 -0
- package/es/checkbox/index.d.ts +15 -0
- package/es/checkbox/style/index.css +1 -1
- package/es/checkbox/style/index.scss +1 -1
- package/es/collapse/collapse-item.js +21 -3
- package/es/collapse/context.d.ts +1 -1
- package/es/color-picker/color-picker.js +6 -0
- package/es/color-picker/panel.js +5 -3
- package/es/components.d.ts +1 -0
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +11 -3
- package/es/date-picker/hooks/use-provide-datepicker-transform.js +1 -1
- package/es/date-picker/panels/body.vue_vue_type_script_setup_true_lang.js +14 -1
- package/es/date-picker/panels/header.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +4 -3
- package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/date-picker/style/index.css +5 -5
- package/es/date-picker/style/index.scss +4 -3
- package/es/drawer/drawer.vue.d.ts +1 -1
- package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +31 -9
- package/es/drawer/index.d.ts +3 -3
- package/es/dropdown/dropdown-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/dropdown/dropdown-option.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/dropdown/dropdown-panel.vue.d.ts +9 -0
- package/es/dropdown/dropdown-panel.vue_vue_type_script_setup_true_lang.js +76 -3
- package/es/dropdown/dropdown-submenu.vue_vue_type_script_setup_true_lang.js +6 -3
- package/es/dropdown/dropdown.vue_vue_type_script_setup_true_lang.js +4 -2
- package/es/dropdown/style/index.css +1 -1
- package/es/dropdown/style/index.scss +3 -1
- package/es/file-previewer/file-previewer.vue.d.ts +1 -1
- package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +18 -10
- package/es/file-previewer/index.d.ts +3 -3
- package/es/form/context.d.ts +1 -0
- package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +7 -3
- package/es/form/index.js +1 -1
- package/es/form/style/index.css +2 -2
- package/es/form/style/index.scss +2 -2
- package/es/grid/grid-col.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/grid/grid-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/grid/grid-row.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/grid/grid.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/image.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/preview-arrow.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/preview.vue.d.ts +1 -1
- package/es/image/preview.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/index.css +167 -114
- package/es/index.d.ts +2 -0
- package/es/index.js +55 -54
- package/es/index.scss +1 -0
- package/es/input/input.js +18 -2
- package/es/input/style/index.css +2 -2
- package/es/input/style/input.scss +4 -4
- package/es/input-number/input-number.js +9 -3
- package/es/input-number/style/index.css +3 -3
- package/es/input-number/style/index.scss +5 -1
- package/es/input-tag/index.d.ts +3 -0
- package/es/input-tag/input-tag.d.ts +2 -0
- package/es/input-tag/input-tag.js +34 -30
- package/es/input-tag/style/index.css +8 -8
- package/es/input-tag/style/index.scss +11 -5
- package/es/json-form/style/index.css +0 -3
- package/es/json-form/style/index.scss +4 -3
- package/es/json-form/utils.js +4 -4
- package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +34 -7
- package/es/layout/style/index.css +2 -2
- package/es/layout/style/index.scss +4 -2
- package/es/link/link.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/link/style/index.css +1 -1
- package/es/link/style/index.scss +3 -1
- package/es/list/list.js +1 -1
- package/es/locale/interface.d.ts +39 -0
- package/es/locale/lang/ar-eg.js +38 -0
- package/es/locale/lang/de-de.js +38 -0
- package/es/locale/lang/en-us.js +38 -0
- package/es/locale/lang/es-es.js +38 -0
- package/es/locale/lang/fr-fr.js +38 -0
- package/es/locale/lang/id-id.js +38 -0
- package/es/locale/lang/it-it.js +38 -0
- package/es/locale/lang/ja-jp.js +38 -0
- package/es/locale/lang/km-kh.js +38 -0
- package/es/locale/lang/ko-kr.js +38 -0
- package/es/locale/lang/ms-my.js +38 -0
- package/es/locale/lang/nl-nl.js +38 -0
- package/es/locale/lang/pt-pt.js +38 -0
- package/es/locale/lang/ru-ru.js +38 -0
- package/es/locale/lang/th-th.js +38 -0
- package/es/locale/lang/vi-vn.js +38 -0
- package/es/locale/lang/zh-cn.js +38 -0
- package/es/locale/lang/zh-tw.js +38 -0
- package/es/mention/mention.js +8 -0
- package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +29 -3
- package/es/menu/item.d.ts +1 -1
- package/es/menu/item.js +14 -1
- package/es/menu/style/index.css +6 -6
- package/es/menu/style/index.scss +5 -3
- package/es/message/style/index.css +3 -3
- package/es/message/style/index.scss +5 -3
- package/es/modal/index.d.ts +3 -3
- package/es/modal/modal.vue.d.ts +1 -1
- package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +31 -15
- package/es/modal/style/index.css +2 -2
- package/es/modal/style/index.scss +3 -2
- package/es/notification/style/index.css +3 -3
- package/es/notification/style/index.scss +11 -3
- package/es/overflow-list/overflow-list.js +1 -1
- package/es/page-header/page-header.vue.d.ts +6 -6
- package/es/page-header/page-header.vue_vue_type_script_setup_true_lang.js +19 -2
- package/es/pagination/page-item-ellipsis.vue_vue_type_script_setup_true_lang.js +15 -2
- package/es/pagination/page-item-step.vue.d.ts +2 -2
- package/es/pagination/page-item-step.vue_vue_type_script_setup_true_lang.js +23 -4
- package/es/pagination/page-item.vue.d.ts +2 -2
- package/es/pagination/page-item.vue_vue_type_script_setup_true_lang.js +21 -3
- package/es/pagination/pagination.js +5 -1
- package/es/pagination/style/index.css +6 -1
- package/es/pagination/style/index.scss +9 -3
- package/es/popconfirm/popconfirm.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/popover/popover.vue_vue_type_script_setup_true_lang.js +2 -0
- package/es/progress/style/index.css +2 -2
- package/es/progress/style/index.scss +5 -3
- package/es/qr-code/qr-code-status.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +13 -6
- package/es/radio/context.d.ts +1 -0
- package/es/radio/radio-group.js +6 -2
- package/es/radio/radio.js +1 -0
- package/es/radio/style/index.css +2 -2
- package/es/radio/style/index.scss +4 -2
- package/es/rate/rate.js +27 -1
- package/es/resize-box/resize-box.vue.d.ts +4 -4
- package/es/resize-box/resize-box.vue_vue_type_script_setup_true_lang.js +30 -1
- package/es/result/result.vue_vue_type_script_setup_true_lang.js +7 -4
- package/es/sd-vue.js +54 -52
- package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/select/index.d.ts +124 -0
- package/es/select/select-dropdown.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/select/select.d.ts +62 -0
- package/es/select/select.js +20 -4
- package/es/select/style/index.css +1 -1
- package/es/select/style/index.scss +3 -1
- package/es/selectable-card/style/index.css +2 -2
- package/es/selectable-card/style/index.scss +5 -5
- package/es/skeleton/skeleton.vue_vue_type_script_setup_true_lang.js +5 -1
- package/es/slider/slider-button.vue.d.ts +2 -0
- package/es/slider/slider-button.vue_vue_type_script_setup_true_lang.js +7 -2
- package/es/slider/slider.vue_vue_type_script_setup_true_lang.js +23 -2
- package/es/slider/style/index.css +1 -1
- package/es/slider/style/index.scss +3 -1
- package/es/spin/spin.js +7 -2
- package/es/spin/style/index.css +1 -1
- package/es/spin/style/index.scss +1 -1
- package/es/split/split.vue.d.ts +4 -4
- package/es/split/split.vue_vue_type_script_setup_true_lang.js +27 -3
- package/es/statistic/statistic.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/steps/context.d.ts +1 -0
- package/es/steps/step.vue_vue_type_script_setup_true_lang.js +15 -2
- package/es/steps/steps.vue_vue_type_script_setup_true_lang.js +10 -2
- package/es/steps/style/index.css +1 -1
- package/es/steps/style/index.scss +1 -1
- package/es/style/animation/index.scss +1 -0
- package/es/style/animation/reduced-motion.scss +22 -0
- package/es/style/animation/zoom.scss +7 -6
- package/es/style/icon.scss +9 -1
- package/es/switch/style/index.css +1 -1
- package/es/switch/style/index.scss +4 -1
- package/es/switch/switch.vue_vue_type_script_setup_true_lang.js +6 -1
- package/es/table/index.d.ts +4 -4
- package/es/table/style/index.css +8 -8
- package/es/table/style/index.scss +11 -8
- package/es/table/table-operation-td.d.ts +15 -0
- package/es/table/table-operation-td.js +3 -3
- package/es/table/table-operation-th.js +1 -1
- package/es/table/table-tbody.js +4 -1
- package/es/table/table-td.js +2 -1
- package/es/table/table-th.d.ts +1 -1
- package/es/table/table-th.js +7 -5
- package/es/table/table-thead.js +4 -1
- package/es/table/table-tr.js +4 -1
- package/es/table/table.d.ts +1 -1
- package/es/table/table.js +8 -4
- package/es/tabs/context.d.ts +1 -0
- package/es/tabs/style/index.css +5 -5
- package/es/tabs/style/index.scss +7 -7
- package/es/tabs/tab-pane.vue_vue_type_script_setup_true_lang.js +21 -2
- package/es/tabs/tabs-button.js +1 -1
- package/es/tabs/tabs-nav.js +34 -1
- package/es/tabs/tabs-tab.vue_vue_type_script_setup_true_lang.js +27 -4
- package/es/tabs/tabs.js +4 -2
- package/es/tag/index.d.ts +5 -5
- package/es/tag/style/index.css +1 -1
- package/es/tag/style/index.scss +3 -1
- package/es/tag/tag.vue.d.ts +2 -2
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +27 -4
- package/es/tag-group/tag-group.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/textarea/style/index.css +2 -2
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +18 -3
- package/es/time-picker/time-column.vue_vue_type_script_setup_true_lang.js +11 -3
- package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +6 -3
- package/es/toolbar/index.d.ts +3 -3
- package/es/toolbar/toolbar.vue.d.ts +2 -2
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +5 -5
- package/es/tooltip/tooltip.vue_vue_type_script_setup_true_lang.js +1 -0
- package/es/transfer/style/index.css +1 -1
- package/es/transfer/style/index.scss +1 -1
- package/es/transfer/transfer-list-item.js +18 -2
- package/es/transfer/transfer.vue_vue_type_script_setup_true_lang.js +7 -5
- package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +28 -8
- package/es/tree/context.d.ts +2 -0
- package/es/tree/node-switcher.vue_vue_type_script_lang.js +1 -1
- package/es/tree/style/index.css +1 -1
- package/es/tree/style/index.scss +1 -1
- package/es/tree/tree.vue_vue_type_script_setup_true_lang.js +81 -2
- package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +10 -1
- package/es/trigger/index.d.ts +45 -0
- package/es/trigger/trigger.d.ts +27 -0
- package/es/trigger/trigger.js +47 -5
- package/es/typography/edit-content.vue_vue_type_script_setup_true_lang.js +17 -8
- package/es/typography/operations.vue_vue_type_script_setup_true_lang.js +38 -6
- package/es/typography/style/index.css +2 -2
- package/es/typography/style/index.scss +2 -2
- package/es/upload/style/index.css +9 -9
- package/es/upload/style/index.scss +15 -9
- package/es/upload/upload-list-item.js +18 -5
- package/es/upload/upload-picture-item.js +27 -3
- package/es/verification-code/verification-code.js +8 -1
- package/json/vetur-attributes.json +15 -0
- package/json/vetur-tags.json +9 -2
- package/json/web-types.json +39 -1
- package/package.json +1 -1
|
@@ -3,15 +3,15 @@ import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
|
3
3
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
5
5
|
import { isArray, isBoolean } from "../_utils/is.js";
|
|
6
|
-
import { useAllowClear } from "../_hooks/use-allow-clear.js";
|
|
7
6
|
import { useI18n } from "../locale/index.js";
|
|
7
|
+
import { useAllowClear } from "../_hooks/use-allow-clear.js";
|
|
8
8
|
import { omit } from "../_utils/omit.js";
|
|
9
9
|
import pick from "../_utils/pick.js";
|
|
10
10
|
import Trigger from "../trigger/index.js";
|
|
11
11
|
import useState from "../_hooks/use-state.js";
|
|
12
12
|
import useMergeState from "../_hooks/use-merge-state.js";
|
|
13
|
-
import { getDateValue, getDayjsValue, getNow, getSortedDayjsArray, initializeDateLocale, isValueChange, toLocal } from "../_utils/date.js";
|
|
14
13
|
import { useConfigProviderProp } from "../_hooks/use-config-provider-prop.js";
|
|
14
|
+
import { getDateValue, getDayjsValue, getNow, getSortedDayjsArray, initializeDateLocale, isValueChange, toLocal } from "../_utils/date.js";
|
|
15
15
|
import IconCalendar from "../icon/icon-calendar/index.js";
|
|
16
16
|
import { getFormattedValue, isValidInputValue } from "../time-picker/utils/index.js";
|
|
17
17
|
import useFormat from "./hooks/use-format.js";
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
background-color: var(--sd-color-fill-2);
|
|
31
31
|
border: 1px solid transparent;
|
|
32
32
|
border-radius: var(--sd-border-radius-small);
|
|
33
|
-
transition:
|
|
33
|
+
transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), border-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), box-shadow 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
34
34
|
}
|
|
35
35
|
.sd-picker-input {
|
|
36
36
|
display: inline-flex;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
background-color: transparent;
|
|
47
47
|
border: none;
|
|
48
48
|
outline: none;
|
|
49
|
-
transition:
|
|
49
|
+
transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
50
50
|
}
|
|
51
51
|
.sd-picker input::placeholder {
|
|
52
52
|
color: var(--sd-color-text-3);
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
text-align: center;
|
|
262
262
|
background-color: var(--sd-color-bg-popup);
|
|
263
263
|
border-radius: 50%;
|
|
264
|
-
transition:
|
|
264
|
+
transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
265
265
|
user-select: none;
|
|
266
266
|
}
|
|
267
267
|
.sd-picker-header-icon:not(.sd-picker-header-icon-hidden) {
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
padding: 2px;
|
|
275
275
|
border-radius: 2px;
|
|
276
276
|
cursor: pointer;
|
|
277
|
-
transition:
|
|
277
|
+
transition: background-color 0.1s;
|
|
278
278
|
}
|
|
279
279
|
.sd-picker-header-label:hover {
|
|
280
280
|
background-color: var(--sd-color-fill-3);
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
.sd-picker-cell-selected .sd-picker-date-value {
|
|
331
331
|
color: var(--sd-color-white);
|
|
332
332
|
background-color: rgb(var(--sd-primary-6));
|
|
333
|
-
transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
|
|
333
|
+
transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
334
334
|
}
|
|
335
335
|
.sd-picker-cell-in-view:not(.sd-picker-cell-selected, .sd-picker-cell-range-start, .sd-picker-cell-range-end, .sd-picker-cell-disabled, .sd-picker-cell-week) .sd-picker-date-value:hover {
|
|
336
336
|
color: var(--sd-color-text-1);
|
|
@@ -88,7 +88,8 @@ $picker-prefix-cls: string.unquote('#{theme.$prefix}-picker');
|
|
|
88
88
|
text-align: center;
|
|
89
89
|
background-color: $picker-color-bg-switch-icon;
|
|
90
90
|
border-radius: 50%;
|
|
91
|
-
transition:
|
|
91
|
+
transition: background-color theme.$transition-duration-1
|
|
92
|
+
theme.$transition-timing-function-standard;
|
|
92
93
|
user-select: none;
|
|
93
94
|
}
|
|
94
95
|
|
|
@@ -104,7 +105,7 @@ $picker-prefix-cls: string.unquote('#{theme.$prefix}-picker');
|
|
|
104
105
|
padding: 2px;
|
|
105
106
|
border-radius: 2px;
|
|
106
107
|
cursor: pointer;
|
|
107
|
-
transition:
|
|
108
|
+
transition: background-color theme.$transition-duration-1;
|
|
108
109
|
|
|
109
110
|
&:hover {
|
|
110
111
|
background-color: $picker-panel-color-bg-label_hover;
|
|
@@ -172,7 +173,7 @@ $picker-prefix-cls: string.unquote('#{theme.$prefix}-picker');
|
|
|
172
173
|
color: $picker-panel-color-text-cell_selected;
|
|
173
174
|
background-color: $picker-panel-color-bg-cell_selected;
|
|
174
175
|
transition: background-color theme.$transition-duration-1
|
|
175
|
-
theme.$transition-timing-function-
|
|
176
|
+
theme.$transition-timing-function-standard;
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
&-cell-in-view:not(
|
|
@@ -218,6 +218,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
218
218
|
visible: boolean;
|
|
219
219
|
unmountOnClose: boolean;
|
|
220
220
|
renderToBody: boolean;
|
|
221
|
+
escToClose: boolean;
|
|
221
222
|
height: string | number;
|
|
222
223
|
defaultVisible: boolean;
|
|
223
224
|
closable: boolean;
|
|
@@ -226,7 +227,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
226
227
|
titleEllipsisTooltip: boolean | EllipsisTooltipProps;
|
|
227
228
|
maskClosable: boolean;
|
|
228
229
|
okLoading: boolean;
|
|
229
|
-
escToClose: boolean;
|
|
230
230
|
hideCancel: boolean;
|
|
231
231
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
232
232
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -3,20 +3,23 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
3
3
|
import { isBoolean, isFunction, isNumber, isPromise } from "../_utils/is.js";
|
|
4
4
|
import { off, on } from "../_utils/dom.js";
|
|
5
5
|
import icon_hover_default from "../_components/icon-hover.js";
|
|
6
|
+
import { KEYBOARD_KEY, onActivate } from "../_utils/keyboard.js";
|
|
6
7
|
import IconClose from "../icon/icon-close/index.js";
|
|
7
|
-
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
8
8
|
import { useI18n } from "../locale/index.js";
|
|
9
|
+
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
9
10
|
import client_only_default from "../_components/client-only.js";
|
|
10
11
|
import usePopupManager from "../_hooks/use-popup-manager.js";
|
|
11
12
|
import { useTeleportContainer } from "../_hooks/use-teleport-container.js";
|
|
12
13
|
import Button from "../button/index.js";
|
|
13
|
-
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
14
14
|
import Ellipsis from "../ellipsis/index.js";
|
|
15
15
|
import { useConfigProviderProp } from "../_hooks/use-config-provider-prop.js";
|
|
16
|
+
import { getFocusableElements, useFocusTrap } from "../_hooks/use-focus-trap.js";
|
|
16
17
|
import { useOverflow } from "../_hooks/use-overflow.js";
|
|
17
18
|
import { DRAWER_PLACEMENTS } from "./utils.js";
|
|
18
|
-
import { Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, toDisplayString, toRefs, unref, vShow, watch, withCtx, withDirectives } from "vue";
|
|
19
|
+
import { Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, toDisplayString, toRefs, unref, useSlots, vShow, watch, withCtx, withDirectives } from "vue";
|
|
19
20
|
//#region components/drawer/drawer.vue?vue&type=script&setup=true&lang.ts
|
|
21
|
+
var _hoisted_1 = ["aria-labelledby"];
|
|
22
|
+
var _hoisted_2 = ["aria-label"];
|
|
20
23
|
var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, {
|
|
21
24
|
name: "Drawer",
|
|
22
25
|
inheritAttrs: false
|
|
@@ -255,6 +258,12 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
255
258
|
const { popupContainer, placement, mask, maskClosable, escToClose, closable, header, footer, hideCancel, okText, cancelText, okButtonProps, cancelButtonProps, titleEllipsisTooltip, width, height } = toRefs(props);
|
|
256
259
|
const prefixCls = getPrefixCls("drawer");
|
|
257
260
|
const { t } = useI18n();
|
|
261
|
+
const slots = useSlots();
|
|
262
|
+
const drawerRef = ref();
|
|
263
|
+
const titleId = `sd-drawer-title-${getCurrentInstance().uid}`;
|
|
264
|
+
const bodyId = `sd-drawer-body-${getCurrentInstance().uid}`;
|
|
265
|
+
const hasTitle = computed(() => mergedHeader.value && !slots.header && (Boolean(props.title) || Boolean(slots.title)));
|
|
266
|
+
const { activate: activateFocusTrap, deactivate: deactivateFocusTrap } = useFocusTrap(drawerRef, { initialFocus: (c) => getFocusableElements(c).find((el) => !el.closest(".sd-drawer-close-btn")) });
|
|
258
267
|
const { mergedValue: mergedPlacement } = useConfigProviderProp(placement, {
|
|
259
268
|
propNames: ["placement"],
|
|
260
269
|
getGlobalValue: (configProviderCtx) => {
|
|
@@ -463,6 +472,7 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
463
472
|
mounted.value = true;
|
|
464
473
|
setOverflowHidden();
|
|
465
474
|
if (mergedEscToClose.value) addGlobalKeyDownListener();
|
|
475
|
+
nextTick(() => activateFocusTrap());
|
|
466
476
|
}
|
|
467
477
|
});
|
|
468
478
|
onBeforeUnmount(() => {
|
|
@@ -476,9 +486,11 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
476
486
|
mounted.value = true;
|
|
477
487
|
setOverflowHidden();
|
|
478
488
|
addGlobalKeyDownListener();
|
|
489
|
+
nextTick(() => activateFocusTrap());
|
|
479
490
|
} else {
|
|
480
491
|
emit("beforeClose");
|
|
481
492
|
removeGlobalKeyDownListener();
|
|
493
|
+
deactivateFocusTrap();
|
|
482
494
|
}
|
|
483
495
|
});
|
|
484
496
|
const style = computed(() => {
|
|
@@ -516,14 +528,22 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
516
528
|
onAfterLeave: handleClose
|
|
517
529
|
}, {
|
|
518
530
|
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
531
|
+
ref_key: "drawerRef",
|
|
532
|
+
ref: drawerRef,
|
|
519
533
|
class: normalizeClass(unref(prefixCls)),
|
|
520
|
-
style: normalizeStyle(style.value)
|
|
534
|
+
style: normalizeStyle(style.value),
|
|
535
|
+
role: "dialog",
|
|
536
|
+
"aria-modal": "true",
|
|
537
|
+
"aria-labelledby": hasTitle.value ? titleId : void 0,
|
|
538
|
+
"aria-describedby": bodyId,
|
|
539
|
+
tabindex: "-1"
|
|
521
540
|
}, [
|
|
522
541
|
unref(mergedHeader) ? (openBlock(), createElementBlock("div", {
|
|
523
542
|
key: 0,
|
|
524
543
|
class: normalizeClass(`${unref(prefixCls)}-header`)
|
|
525
544
|
}, [renderSlot(_ctx.$slots, "header", {}, () => [_ctx.$slots.title || __props.title ? (openBlock(), createElementBlock("div", {
|
|
526
545
|
key: 0,
|
|
546
|
+
id: titleId,
|
|
527
547
|
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
528
548
|
}, [createVNode(unref(Ellipsis), {
|
|
529
549
|
class: normalizeClass(`${unref(prefixCls)}-title-text`),
|
|
@@ -533,16 +553,18 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
533
553
|
_: 3
|
|
534
554
|
}, 8, ["class", "tooltip"])], 2)) : createCommentVNode("", true), unref(mergedClosable) ? (openBlock(), createElementBlock("div", {
|
|
535
555
|
key: 1,
|
|
536
|
-
tabindex: "
|
|
556
|
+
tabindex: "0",
|
|
537
557
|
role: "button",
|
|
538
|
-
"aria-label": "
|
|
558
|
+
"aria-label": unref(t)("a11y.close"),
|
|
539
559
|
class: normalizeClass(`${unref(prefixCls)}-close-btn`),
|
|
540
|
-
onClick: handleCancel
|
|
560
|
+
onClick: handleCancel,
|
|
561
|
+
onKeydown: _cache[0] || (_cache[0] = ($event) => unref(onActivate)(handleCancel))
|
|
541
562
|
}, [createVNode(icon_hover_default, null, {
|
|
542
563
|
default: withCtx(() => [createVNode(unref(IconClose))]),
|
|
543
564
|
_: 1
|
|
544
|
-
})],
|
|
565
|
+
})], 42, _hoisted_2)) : createCommentVNode("", true)])], 2)) : createCommentVNode("", true),
|
|
545
566
|
createElementVNode("div", {
|
|
567
|
+
id: bodyId,
|
|
546
568
|
class: normalizeClass([`${unref(prefixCls)}-body`, __props.bodyClass]),
|
|
547
569
|
style: normalizeStyle(__props.bodyStyle)
|
|
548
570
|
}, [renderSlot(_ctx.$slots, "default")], 6),
|
|
@@ -559,7 +581,7 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
559
581
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(mergedOkText) || unref(t)("drawer.okText")), 1)]),
|
|
560
582
|
_: 1
|
|
561
583
|
}, 16, ["loading"])])], 2)) : createCommentVNode("", true)
|
|
562
|
-
],
|
|
584
|
+
], 14, _hoisted_1), [[vShow, computedVisible.value]])]),
|
|
563
585
|
_: 3
|
|
564
586
|
}, 8, ["name"])], 16)), [[vShow, computedVisible.value || mounted.value]]) : createCommentVNode("", true)], 8, ["to", "disabled"]))]),
|
|
565
587
|
_: 3
|
package/es/drawer/index.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ declare const Drawer: {
|
|
|
118
118
|
visible: boolean;
|
|
119
119
|
unmountOnClose: boolean;
|
|
120
120
|
renderToBody: boolean;
|
|
121
|
+
escToClose: boolean;
|
|
121
122
|
height: string | number;
|
|
122
123
|
defaultVisible: boolean;
|
|
123
124
|
closable: boolean;
|
|
@@ -126,7 +127,6 @@ declare const Drawer: {
|
|
|
126
127
|
titleEllipsisTooltip: boolean | import("../index.ts").EllipsisTooltipProps;
|
|
127
128
|
maskClosable: boolean;
|
|
128
129
|
okLoading: boolean;
|
|
129
|
-
escToClose: boolean;
|
|
130
130
|
hideCancel: boolean;
|
|
131
131
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
132
132
|
P: {};
|
|
@@ -242,6 +242,7 @@ declare const Drawer: {
|
|
|
242
242
|
visible: boolean;
|
|
243
243
|
unmountOnClose: boolean;
|
|
244
244
|
renderToBody: boolean;
|
|
245
|
+
escToClose: boolean;
|
|
245
246
|
height: string | number;
|
|
246
247
|
defaultVisible: boolean;
|
|
247
248
|
closable: boolean;
|
|
@@ -250,7 +251,6 @@ declare const Drawer: {
|
|
|
250
251
|
titleEllipsisTooltip: boolean | import("../index.ts").EllipsisTooltipProps;
|
|
251
252
|
maskClosable: boolean;
|
|
252
253
|
okLoading: boolean;
|
|
253
|
-
escToClose: boolean;
|
|
254
254
|
hideCancel: boolean;
|
|
255
255
|
}>;
|
|
256
256
|
__isFragment?: never;
|
|
@@ -371,6 +371,7 @@ declare const Drawer: {
|
|
|
371
371
|
visible: boolean;
|
|
372
372
|
unmountOnClose: boolean;
|
|
373
373
|
renderToBody: boolean;
|
|
374
|
+
escToClose: boolean;
|
|
374
375
|
height: string | number;
|
|
375
376
|
defaultVisible: boolean;
|
|
376
377
|
closable: boolean;
|
|
@@ -379,7 +380,6 @@ declare const Drawer: {
|
|
|
379
380
|
titleEllipsisTooltip: boolean | import("../index.ts").EllipsisTooltipProps;
|
|
380
381
|
maskClosable: boolean;
|
|
381
382
|
okLoading: boolean;
|
|
382
|
-
escToClose: boolean;
|
|
383
383
|
hideCancel: boolean;
|
|
384
384
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
385
385
|
$slots: {
|
|
@@ -2,8 +2,8 @@ import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helper
|
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import button_group_default from "../button/button-group.js";
|
|
4
4
|
import Button from "../button/index.js";
|
|
5
|
-
import { useTrigger } from "../_hooks/use-trigger.js";
|
|
6
5
|
import IconMore from "../icon/icon-more/index.js";
|
|
6
|
+
import { useTrigger } from "../_hooks/use-trigger.js";
|
|
7
7
|
import dropdown_default from "./dropdown.js";
|
|
8
8
|
import { createBlock, createVNode, defineComponent, mergeProps, openBlock, renderSlot, toRefs, unref, withCtx } from "vue";
|
|
9
9
|
//#region components/dropdown/dropdown-button.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -3,6 +3,7 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
3
3
|
import { dropdownInjectionKey } from "./context.js";
|
|
4
4
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, inject, normalizeClass, openBlock, ref, renderSlot, unref } from "vue";
|
|
5
5
|
//#region components/dropdown/dropdown-option.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var _hoisted_1 = ["aria-disabled", "tabindex"];
|
|
6
7
|
var dropdown_option_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "Doption" }), {}, {
|
|
7
8
|
__name: "dropdown-option",
|
|
8
9
|
props: {
|
|
@@ -57,6 +58,9 @@ var dropdown_option_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
57
58
|
ref_key: "liRef",
|
|
58
59
|
ref: liRef,
|
|
59
60
|
class: normalizeClass([cls.value, { [`${unref(prefixCls)}-has-suffix`]: Boolean(_ctx.$slots.suffix) }]),
|
|
61
|
+
role: "menuitem",
|
|
62
|
+
"aria-disabled": __props.disabled || void 0,
|
|
63
|
+
tabindex: __props.disabled ? void 0 : -1,
|
|
60
64
|
onClick: handleClick
|
|
61
65
|
}, [
|
|
62
66
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", {
|
|
@@ -68,7 +72,7 @@ var dropdown_option_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
68
72
|
key: 1,
|
|
69
73
|
class: normalizeClass(`${unref(prefixCls)}-suffix`)
|
|
70
74
|
}, [renderSlot(_ctx.$slots, "suffix")], 2)) : createCommentVNode("", true)
|
|
71
|
-
],
|
|
75
|
+
], 10, _hoisted_1);
|
|
72
76
|
};
|
|
73
77
|
}
|
|
74
78
|
}));
|
|
@@ -21,6 +21,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
21
21
|
type: NumberConstructor;
|
|
22
22
|
default: number;
|
|
23
23
|
};
|
|
24
|
+
trigger: {
|
|
25
|
+
type: PropType<string | string[]>;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
24
28
|
onScroll: {
|
|
25
29
|
type: PropType<EmitType<(ev: Event) => void>>;
|
|
26
30
|
};
|
|
@@ -43,6 +47,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
43
47
|
type: NumberConstructor;
|
|
44
48
|
default: number;
|
|
45
49
|
};
|
|
50
|
+
trigger: {
|
|
51
|
+
type: PropType<string | string[]>;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
46
54
|
onScroll: {
|
|
47
55
|
type: PropType<EmitType<(ev: Event) => void>>;
|
|
48
56
|
};
|
|
@@ -53,6 +61,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
53
61
|
onScroll?: ((_e: Event) => any) | undefined;
|
|
54
62
|
onReachBottom?: ((_e: Event) => any) | undefined;
|
|
55
63
|
}>, {
|
|
64
|
+
trigger: string | string[];
|
|
56
65
|
isEmpty: boolean;
|
|
57
66
|
loading: boolean;
|
|
58
67
|
bottomOffset: number;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import { isNumber } from "../_utils/is.js";
|
|
4
|
+
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
4
5
|
import Scrollbar from "../scrollbar/index.js";
|
|
5
|
-
import { dropdownInjectionKey } from "./context.js";
|
|
6
6
|
import Empty from "../empty/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { dropdownInjectionKey } from "./context.js";
|
|
8
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
8
9
|
//#region components/dropdown/dropdown-panel.vue?vue&type=script&setup=true&lang.ts
|
|
9
10
|
var dropdown_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "DropdownPanel" }), {}, {
|
|
10
11
|
__name: "dropdown-panel",
|
|
@@ -21,6 +22,14 @@ var dropdown_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
21
22
|
type: Number,
|
|
22
23
|
default: 0
|
|
23
24
|
},
|
|
25
|
+
/**
|
|
26
|
+
* @zh 触发方式(仅用于判断打开时是否把焦点移入首个 menuitem:hover 触发不抢焦点)
|
|
27
|
+
* @en Trigger method (only used to decide whether to move focus into the first menuitem on open: hover does not steal focus)
|
|
28
|
+
*/
|
|
29
|
+
trigger: {
|
|
30
|
+
type: [String, Array],
|
|
31
|
+
default: "click"
|
|
32
|
+
},
|
|
24
33
|
onScroll: { type: [Function, Array] },
|
|
25
34
|
onReachBottom: { type: [Function, Array] }
|
|
26
35
|
},
|
|
@@ -32,11 +41,68 @@ var dropdown_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
32
41
|
const prefixCls = getPrefixCls("dropdown");
|
|
33
42
|
const dropdownCtx = inject(dropdownInjectionKey, {});
|
|
34
43
|
const wrapperRef = ref();
|
|
44
|
+
const listRef = ref();
|
|
35
45
|
const handleScroll = (e) => {
|
|
36
46
|
const { scrollTop, scrollHeight, offsetHeight } = e.target;
|
|
37
47
|
if (scrollHeight - (scrollTop + offsetHeight) <= props.bottomOffset) emit("reachBottom", e);
|
|
38
48
|
emit("scroll", e);
|
|
39
49
|
};
|
|
50
|
+
const getMenuitems = () => {
|
|
51
|
+
if (!listRef.value) return [];
|
|
52
|
+
return Array.from(listRef.value.querySelectorAll("[role=\"menuitem\"]")).filter((el) => el.getAttribute("aria-disabled") !== "true");
|
|
53
|
+
};
|
|
54
|
+
const focusMenuitem = (dir) => {
|
|
55
|
+
var _items$target;
|
|
56
|
+
const items = getMenuitems();
|
|
57
|
+
if (items.length === 0) return;
|
|
58
|
+
const current = items.findIndex((el) => el === document.activeElement);
|
|
59
|
+
let target = 0;
|
|
60
|
+
if (dir === "first") target = 0;
|
|
61
|
+
else if (dir === "last") target = items.length - 1;
|
|
62
|
+
else if (dir === "next") target = current < 0 ? 0 : (current + 1) % items.length;
|
|
63
|
+
else target = current <= 0 ? items.length - 1 : current - 1;
|
|
64
|
+
(_items$target = items[target]) === null || _items$target === void 0 || _items$target.focus();
|
|
65
|
+
};
|
|
66
|
+
const handleKeydown = (ev) => {
|
|
67
|
+
switch (ev.key) {
|
|
68
|
+
case KEYBOARD_KEY.ARROW_DOWN:
|
|
69
|
+
ev.preventDefault();
|
|
70
|
+
focusMenuitem("next");
|
|
71
|
+
break;
|
|
72
|
+
case KEYBOARD_KEY.ARROW_UP:
|
|
73
|
+
ev.preventDefault();
|
|
74
|
+
focusMenuitem("prev");
|
|
75
|
+
break;
|
|
76
|
+
case KEYBOARD_KEY.HOME:
|
|
77
|
+
ev.preventDefault();
|
|
78
|
+
focusMenuitem("first");
|
|
79
|
+
break;
|
|
80
|
+
case KEYBOARD_KEY.END:
|
|
81
|
+
ev.preventDefault();
|
|
82
|
+
focusMenuitem("last");
|
|
83
|
+
break;
|
|
84
|
+
case KEYBOARD_KEY.ENTER:
|
|
85
|
+
case KEYBOARD_KEY.SPACE:
|
|
86
|
+
ev.preventDefault();
|
|
87
|
+
if (document.activeElement instanceof HTMLElement) document.activeElement.click();
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const isHoverTrigger = computed(() => {
|
|
92
|
+
const trigger = props.trigger;
|
|
93
|
+
return Array.isArray(trigger) ? trigger.includes("hover") : trigger === "hover";
|
|
94
|
+
});
|
|
95
|
+
onMounted(() => {
|
|
96
|
+
if (isHoverTrigger.value) return;
|
|
97
|
+
nextTick(() => {
|
|
98
|
+
const items = getMenuitems();
|
|
99
|
+
if (items.length > 0) items[0].focus();
|
|
100
|
+
else {
|
|
101
|
+
var _listRef$value;
|
|
102
|
+
(_listRef$value = listRef.value) === null || _listRef$value === void 0 || _listRef$value.focus();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
40
106
|
const style = computed(() => {
|
|
41
107
|
if (isNumber(dropdownCtx.popupMaxHeight)) return { maxHeight: `${dropdownCtx.popupMaxHeight}px` };
|
|
42
108
|
if (!dropdownCtx.popupMaxHeight) return {
|
|
@@ -59,7 +125,14 @@ var dropdown_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
59
125
|
"disable-horizontal": "",
|
|
60
126
|
onScroll: handleScroll
|
|
61
127
|
}, {
|
|
62
|
-
default: withCtx(() => [createElementVNode("ul", {
|
|
128
|
+
default: withCtx(() => [createElementVNode("ul", {
|
|
129
|
+
ref_key: "listRef",
|
|
130
|
+
ref: listRef,
|
|
131
|
+
role: "menu",
|
|
132
|
+
tabindex: "-1",
|
|
133
|
+
class: normalizeClass(`${unref(prefixCls)}-list`),
|
|
134
|
+
onKeydown: handleKeydown
|
|
135
|
+
}, [renderSlot(_ctx.$slots, "default")], 34)]),
|
|
63
136
|
_: 3
|
|
64
137
|
}, 8, ["class", "style"]),
|
|
65
138
|
_ctx.$slots.footer && !__props.isEmpty ? (openBlock(), createElementBlock("div", {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import Trigger from "../trigger/index.js";
|
|
4
|
+
import IconRight from "../icon/icon-right/index.js";
|
|
4
5
|
import { useTrigger } from "../_hooks/use-trigger.js";
|
|
5
6
|
import dropdown_panel_default from "./dropdown-panel.js";
|
|
6
7
|
import dropdown_option_default from "./dropdown-option.js";
|
|
7
|
-
import IconRight from "../icon/icon-right/index.js";
|
|
8
8
|
import { createBlock, createSlots, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderSlot, toRefs, unref, withCtx } from "vue";
|
|
9
9
|
//#region components/dropdown/dropdown-submenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var dropdown_submenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "Dsubmenu" }), {}, {
|
|
@@ -109,14 +109,17 @@ var dropdown_submenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
109
109
|
"popup-offset": 4,
|
|
110
110
|
onPopupVisibleChange: unref(handlePopupVisibleChange)
|
|
111
111
|
}, {
|
|
112
|
-
content: withCtx(() => [createVNode(dropdown_panel_default, {
|
|
112
|
+
content: withCtx(() => [createVNode(dropdown_panel_default, {
|
|
113
|
+
class: normalizeClass(`${unref(prefixCls)}-submenu`),
|
|
114
|
+
trigger: __props.trigger
|
|
115
|
+
}, createSlots({
|
|
113
116
|
default: withCtx(() => [renderSlot(_ctx.$slots, "content")]),
|
|
114
117
|
_: 2
|
|
115
118
|
}, [_ctx.$slots.footer ? {
|
|
116
119
|
name: "footer",
|
|
117
120
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "footer")]),
|
|
118
121
|
key: "0"
|
|
119
|
-
} : void 0]), 1032, ["class"])]),
|
|
122
|
+
} : void 0]), 1032, ["class", "trigger"])]),
|
|
120
123
|
default: withCtx(() => [createVNode(dropdown_option_default, mergeProps(__props.optionProps, {
|
|
121
124
|
active: unref(computedPopupVisible),
|
|
122
125
|
"uninject-context": ""
|
|
@@ -116,16 +116,18 @@ var dropdown_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
116
116
|
"popup-offset": 4,
|
|
117
117
|
"popup-container": __props.popupContainer,
|
|
118
118
|
"opened-class": `${unref(prefixCls)}-open`,
|
|
119
|
+
"esc-to-close": "",
|
|
120
|
+
"aria-has-popup": "menu",
|
|
119
121
|
onPopupVisibleChange: unref(handlePopupVisibleChange)
|
|
120
122
|
}, {
|
|
121
|
-
content: withCtx(() => [createVNode(dropdown_panel_default,
|
|
123
|
+
content: withCtx(() => [createVNode(dropdown_panel_default, { trigger: __props.trigger }, createSlots({
|
|
122
124
|
default: withCtx(() => [renderSlot(_ctx.$slots, "content")]),
|
|
123
125
|
_: 2
|
|
124
126
|
}, [_ctx.$slots.footer ? {
|
|
125
127
|
name: "footer",
|
|
126
128
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "footer")]),
|
|
127
129
|
key: "0"
|
|
128
|
-
} : void 0]),
|
|
130
|
+
} : void 0]), 1032, ["trigger"])]),
|
|
129
131
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
130
132
|
_: 3
|
|
131
133
|
}, 8, [
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
.sd-dropdown-option-active, .sd-dropdown-option:not(.sd-dropdown-option-disabled):hover {
|
|
67
67
|
color: var(--sd-color-text-1);
|
|
68
68
|
background-color: var(--sd-color-fill-2);
|
|
69
|
-
transition:
|
|
69
|
+
transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
70
70
|
}
|
|
71
71
|
.sd-dropdown-option-disabled {
|
|
72
72
|
color: var(--sd-color-text-4);
|
|
@@ -56,7 +56,9 @@ $dropdown-prefix-cls: string.unquote('#{theme.$prefix}-dropdown');
|
|
|
56
56
|
&:not(#{&}-disabled):hover {
|
|
57
57
|
color: $dropdown-option-color-text_hover;
|
|
58
58
|
background-color: $dropdown-option-color-bg_hover;
|
|
59
|
-
transition:
|
|
59
|
+
transition:
|
|
60
|
+
color theme.$transition-duration-1 theme.$transition-timing-function-standard,
|
|
61
|
+
background-color theme.$transition-duration-1 theme.$transition-timing-function-standard;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
// disabled
|
|
@@ -132,10 +132,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
132
132
|
type: FilePreviewerType;
|
|
133
133
|
visible: boolean;
|
|
134
134
|
renderToBody: boolean;
|
|
135
|
+
escToClose: boolean;
|
|
135
136
|
defaultVisible: boolean;
|
|
136
137
|
closable: boolean;
|
|
137
138
|
maskClosable: boolean;
|
|
138
|
-
escToClose: boolean;
|
|
139
139
|
fullscreen: boolean;
|
|
140
140
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
141
141
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import { isServerRendering } from "../_utils/dom.js";
|
|
4
|
+
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
4
5
|
import IconClose from "../icon/icon-close/index.js";
|
|
6
|
+
import { useI18n } from "../locale/index.js";
|
|
5
7
|
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
6
8
|
import IconLoading from "../icon/icon-loading/index.js";
|
|
7
9
|
import usePopupManager from "../_hooks/use-popup-manager.js";
|
|
8
|
-
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
9
10
|
import usePopupContainer from "../_hooks/use-popup-container.js";
|
|
10
11
|
import usePopupOverflowHidden from "../_hooks/use-popup-overflow-hidden.js";
|
|
11
12
|
import Image from "../image/index.js";
|
|
@@ -18,8 +19,10 @@ var _hoisted_2 = [
|
|
|
18
19
|
"aria-modal",
|
|
19
20
|
"aria-label"
|
|
20
21
|
];
|
|
21
|
-
var _hoisted_3 = ["disabled"];
|
|
22
|
-
var _hoisted_4 = ["disabled"];
|
|
22
|
+
var _hoisted_3 = ["disabled", "aria-label"];
|
|
23
|
+
var _hoisted_4 = ["disabled", "aria-label"];
|
|
24
|
+
var _hoisted_5 = ["aria-label"];
|
|
25
|
+
var _hoisted_6 = ["aria-label"];
|
|
23
26
|
var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "FilePreviewer" }), {}, {
|
|
24
27
|
__name: "file-previewer",
|
|
25
28
|
props: {
|
|
@@ -129,6 +132,7 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
129
132
|
const props = __props;
|
|
130
133
|
const emit = __emit;
|
|
131
134
|
const { src, type, visible, defaultVisible, fullscreen, popupContainer, renderToBody, maskClosable, closable, escToClose, title, imageProps, mediaProps, pdfProps } = toRefs(props);
|
|
135
|
+
const { t } = useI18n();
|
|
132
136
|
const prefixCls = getPrefixCls("file-previewer");
|
|
133
137
|
const wrapperRef = shallowRef();
|
|
134
138
|
const status = shallowRef("beforeLoad");
|
|
@@ -481,7 +485,7 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
481
485
|
class: normalizeClass(contentClassNames.value),
|
|
482
486
|
role: unref(fullscreen) ? "dialog" : "region",
|
|
483
487
|
"aria-modal": unref(fullscreen) ? "true" : void 0,
|
|
484
|
-
"aria-label": unref(title) || "
|
|
488
|
+
"aria-label": unref(title) || unref(t)("a11y.filePreview")
|
|
485
489
|
}, [unref(title) || _ctx.$slots.title ? (openBlock(), createElementBlock("header", {
|
|
486
490
|
key: 0,
|
|
487
491
|
class: normalizeClass(`${unref(prefixCls)}-header`)
|
|
@@ -512,7 +516,7 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
512
516
|
type: "button",
|
|
513
517
|
class: normalizeClass(`${unref(prefixCls)}-pdf-btn`),
|
|
514
518
|
disabled: unref(pdfCurrentPage) <= 1,
|
|
515
|
-
"aria-label": "
|
|
519
|
+
"aria-label": unref(t)("a11y.prevPage"),
|
|
516
520
|
onClick: _cache[0] || (_cache[0] = (...args) => unref(pdfPrev) && unref(pdfPrev)(...args))
|
|
517
521
|
}, " ‹ ", 10, _hoisted_3),
|
|
518
522
|
createElementVNode("span", { class: normalizeClass(`${unref(prefixCls)}-pdf-page`) }, toDisplayString(unref(pdfCurrentPage)) + " / " + toDisplayString(unref(pdfNumPages)), 3),
|
|
@@ -520,7 +524,7 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
520
524
|
type: "button",
|
|
521
525
|
class: normalizeClass(`${unref(prefixCls)}-pdf-btn`),
|
|
522
526
|
disabled: unref(pdfCurrentPage) >= unref(pdfNumPages),
|
|
523
|
-
"aria-label": "
|
|
527
|
+
"aria-label": unref(t)("a11y.nextPage"),
|
|
524
528
|
onClick: _cache[1] || (_cache[1] = (...args) => unref(pdfNext) && unref(pdfNext)(...args))
|
|
525
529
|
}, " › ", 10, _hoisted_4)
|
|
526
530
|
], 2)) : createCommentVNode("", true)], 2)]) : createCommentVNode("", true)])], 2)], 10, _hoisted_2),
|
|
@@ -528,15 +532,19 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
528
532
|
key: 1,
|
|
529
533
|
type: "button",
|
|
530
534
|
class: normalizeClass(`${unref(prefixCls)}-close-btn`),
|
|
535
|
+
"aria-label": unref(t)("a11y.close"),
|
|
531
536
|
onClick: close
|
|
532
|
-
}, [createVNode(unref(IconClose))],
|
|
537
|
+
}, [createVNode(unref(IconClose))], 10, _hoisted_5)) : createCommentVNode("", true),
|
|
533
538
|
isLoading.value ? (openBlock(), createElementBlock("div", {
|
|
534
539
|
key: 2,
|
|
535
|
-
class: normalizeClass(`${unref(prefixCls)}-loading`)
|
|
536
|
-
|
|
540
|
+
class: normalizeClass(`${unref(prefixCls)}-loading`),
|
|
541
|
+
role: "status",
|
|
542
|
+
"aria-label": unref(t)("a11y.loading")
|
|
543
|
+
}, [createVNode(unref(IconLoading))], 10, _hoisted_6)) : createCommentVNode("", true),
|
|
537
544
|
isError.value ? (openBlock(), createElementBlock("div", {
|
|
538
545
|
key: 3,
|
|
539
|
-
class: normalizeClass(`${unref(prefixCls)}-error`)
|
|
546
|
+
class: normalizeClass(`${unref(prefixCls)}-error`),
|
|
547
|
+
role: "alert"
|
|
540
548
|
}, "文件预览加载失败", 2)) : createCommentVNode("", true)
|
|
541
549
|
], 46, _hoisted_1)) : createCommentVNode("", true)], 8, ["to", "disabled"]));
|
|
542
550
|
};
|