@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
package/es/tree/context.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type TreeContext = Readonly<{
|
|
|
19
19
|
expandedKeys: TreeNodeKey[];
|
|
20
20
|
loadingKeys: TreeNodeKey[];
|
|
21
21
|
currentExpandKeys: TreeNodeKey[];
|
|
22
|
+
activeKey?: TreeNodeKey;
|
|
22
23
|
onLoadMore?: (key: TreeNodeKey) => void;
|
|
23
24
|
onCheck: (checked: boolean, key: TreeNodeKey, e?: Event) => void;
|
|
24
25
|
onSelect: (key: TreeNodeKey, e: Event) => void;
|
|
@@ -31,6 +32,7 @@ export type TreeContext = Readonly<{
|
|
|
31
32
|
onDrop?: (key: TreeNodeKey, dropPosition: DropPosition, e: DragEvent) => void;
|
|
32
33
|
allowDrop?: (key: TreeNodeKey, dropPosition: DropPosition) => boolean;
|
|
33
34
|
onNodeEvent?: (eventName: TreeNodeDomEventName, key: TreeNodeKey, e: Event) => void;
|
|
35
|
+
onNodeKeydown?: (key: TreeNodeKey, e: KeyboardEvent) => void;
|
|
34
36
|
onNodeLongPress?: (key: TreeNodeKey, e: PointerEvent) => void;
|
|
35
37
|
onNodeSwipe?: (eventName: TreeNodeSwipeEventName, key: TreeNodeKey, e: TouchEvent, data: TreeNodeSwipeEventData) => void;
|
|
36
38
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import icon_hover_default from "../_components/icon-hover.js";
|
|
2
2
|
import IconLoading from "../icon/icon-loading/index.js";
|
|
3
3
|
import usePickSlots from "../_hooks/use-pick-slots.js";
|
|
4
|
-
import useTreeContext from "./hooks/use-tree-context.js";
|
|
5
4
|
import IconCaretDown from "../icon/icon-caret-down/index.js";
|
|
5
|
+
import useTreeContext from "./hooks/use-tree-context.js";
|
|
6
6
|
import IconFile from "../icon/icon-file/index.js";
|
|
7
7
|
import { defineComponent, h, toRefs } from "vue";
|
|
8
8
|
//#region components/tree/node-switcher.vue?vue&type=script&lang.tsx
|
package/es/tree/style/index.css
CHANGED
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
}
|
|
121
121
|
.sd-tree-node-selected .sd-tree-node-title, .sd-tree-node-selected .sd-tree-node-title:hover {
|
|
122
122
|
color: rgb(var(--sd-primary-6));
|
|
123
|
-
transition: color 0.2s cubic-bezier(0, 0, 1, 1);
|
|
123
|
+
transition: color 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
124
124
|
}
|
|
125
125
|
.sd-tree-node-disabled-selectable .sd-tree-node-title,
|
|
126
126
|
.sd-tree-node-disabled-selectable .sd-tree-node-title:hover, .sd-tree-node-disabled .sd-tree-node-title,
|
package/es/tree/style/index.scss
CHANGED
|
@@ -157,7 +157,7 @@ $tree-node-prefix-cls: string.unquote('#{theme.$prefix}-tree-node');
|
|
|
157
157
|
&-selected &-title,
|
|
158
158
|
&-selected &-title:hover {
|
|
159
159
|
color: $tree-color-title-text_active;
|
|
160
|
-
transition: color theme.$transition-duration-2 theme.$transition-timing-function-
|
|
160
|
+
transition: color theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
&-disabled-selectable,
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { isArray, isFunction, isUndefined } from "../_utils/is.js";
|
|
4
|
+
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
4
5
|
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
5
6
|
import virtual_list_default from "../_components/virtual-list/index.js";
|
|
6
7
|
import usePickSlots from "../_hooks/use-pick-slots.js";
|
|
@@ -11,7 +12,7 @@ import { getCheckedStateByCheck, isNodeCheckable } from "./utils/check-utils.js"
|
|
|
11
12
|
import { TreeInjectionKey } from "./context.js";
|
|
12
13
|
import useCheckedState from "./hooks/use-checked-state.js";
|
|
13
14
|
import node_default from "./node.js";
|
|
14
|
-
import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, provide, reactive, ref, renderList, toRefs, unref, useSlots, watch, withCtx } from "vue";
|
|
15
|
+
import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, openBlock, provide, reactive, ref, renderList, toRefs, unref, useSlots, watch, withCtx } from "vue";
|
|
15
16
|
//#region components/tree/tree.vue?vue&type=script&setup=true&lang.ts
|
|
16
17
|
var tree_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "Tree" }), {}, {
|
|
17
18
|
__name: "tree",
|
|
@@ -340,6 +341,7 @@ var tree_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
340
341
|
};
|
|
341
342
|
});
|
|
342
343
|
const virtualListRef = ref(null);
|
|
344
|
+
const rootEl = ref(null);
|
|
343
345
|
const virtualListVersion = ref(0);
|
|
344
346
|
const virtualListKey = computed(() => `tree-virtual-list-${virtualListVersion.value}`);
|
|
345
347
|
const switcherIcon = usePickSlots(slots, "switcher-icon");
|
|
@@ -421,6 +423,78 @@ var tree_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
421
423
|
});
|
|
422
424
|
return uniqueNodeList;
|
|
423
425
|
});
|
|
426
|
+
const activeKey = ref(void 0);
|
|
427
|
+
const effectiveActiveKey = computed(() => {
|
|
428
|
+
var _visibleTreeNodeList$;
|
|
429
|
+
if (activeKey.value !== void 0) return activeKey.value;
|
|
430
|
+
const selected = mergedSelectedKeys.value.find((k) => key2TreeNode.value.has(k));
|
|
431
|
+
if (selected !== void 0) return selected;
|
|
432
|
+
return (_visibleTreeNodeList$ = visibleTreeNodeList.value[0]) === null || _visibleTreeNodeList$ === void 0 ? void 0 : _visibleTreeNodeList$.key;
|
|
433
|
+
});
|
|
434
|
+
function focusNodeKey(targetKey) {
|
|
435
|
+
activeKey.value = targetKey;
|
|
436
|
+
nextTick(() => {
|
|
437
|
+
var _rootEl$value;
|
|
438
|
+
const el = (_rootEl$value = rootEl.value) === null || _rootEl$value === void 0 ? void 0 : _rootEl$value.querySelector(`[data-key="${CSS.escape(String(targetKey))}"]`);
|
|
439
|
+
el === null || el === void 0 || el.focus();
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
function onNodeKeydown(key, e) {
|
|
443
|
+
var _node$children;
|
|
444
|
+
const list = visibleTreeNodeList.value;
|
|
445
|
+
const idx = list.findIndex((n) => n.key === key);
|
|
446
|
+
if (idx === -1) return;
|
|
447
|
+
const node = list[idx];
|
|
448
|
+
const hasChildren = !node.isLeaf && Boolean((_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children.length);
|
|
449
|
+
const isExpanded = mergedExpandedKeys.value.includes(key);
|
|
450
|
+
switch (e.key) {
|
|
451
|
+
case KEYBOARD_KEY.ARROW_DOWN:
|
|
452
|
+
e.preventDefault();
|
|
453
|
+
if (list[idx + 1]) focusNodeKey(list[idx + 1].key);
|
|
454
|
+
break;
|
|
455
|
+
case KEYBOARD_KEY.ARROW_UP:
|
|
456
|
+
e.preventDefault();
|
|
457
|
+
if (list[idx - 1]) focusNodeKey(list[idx - 1].key);
|
|
458
|
+
break;
|
|
459
|
+
case KEYBOARD_KEY.HOME:
|
|
460
|
+
e.preventDefault();
|
|
461
|
+
if (list[0]) focusNodeKey(list[0].key);
|
|
462
|
+
break;
|
|
463
|
+
case KEYBOARD_KEY.END:
|
|
464
|
+
e.preventDefault();
|
|
465
|
+
if (list.length) focusNodeKey(list[list.length - 1].key);
|
|
466
|
+
break;
|
|
467
|
+
case KEYBOARD_KEY.ARROW_RIGHT:
|
|
468
|
+
e.preventDefault();
|
|
469
|
+
if (hasChildren && !isExpanded) onExpand(true, key, e);
|
|
470
|
+
else if (hasChildren && isExpanded) {
|
|
471
|
+
var _node$children2;
|
|
472
|
+
const firstChild = (_node$children2 = node.children) === null || _node$children2 === void 0 ? void 0 : _node$children2[0];
|
|
473
|
+
if (firstChild) focusNodeKey(firstChild.key);
|
|
474
|
+
}
|
|
475
|
+
break;
|
|
476
|
+
case KEYBOARD_KEY.ARROW_LEFT:
|
|
477
|
+
e.preventDefault();
|
|
478
|
+
if (hasChildren && isExpanded) onExpand(false, key, e);
|
|
479
|
+
else {
|
|
480
|
+
const parents = node.pathParentKeys;
|
|
481
|
+
if (parents.length) focusNodeKey(parents[parents.length - 1]);
|
|
482
|
+
}
|
|
483
|
+
break;
|
|
484
|
+
case KEYBOARD_KEY.ENTER:
|
|
485
|
+
case KEYBOARD_KEY.SPACE:
|
|
486
|
+
if (node.checkable && !node.disableCheckbox && !node.disabled) {
|
|
487
|
+
e.preventDefault();
|
|
488
|
+
onCheck(!mergedCheckedKeys.value.includes(key), key, e);
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
if (node.selectable && !node.disabled) {
|
|
492
|
+
e.preventDefault();
|
|
493
|
+
onSelect(key, e);
|
|
494
|
+
}
|
|
495
|
+
break;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
424
498
|
function getPublicCheckedKeys(rawCheckedKeys, rawCheckedStrategy = checkedStrategy.value) {
|
|
425
499
|
let publicCheckedKeys = [...rawCheckedKeys];
|
|
426
500
|
if (rawCheckedStrategy === "parent") publicCheckedKeys = rawCheckedKeys.filter((_key) => {
|
|
@@ -717,6 +791,7 @@ var tree_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
717
791
|
expandedKeys: mergedExpandedKeys,
|
|
718
792
|
loadingKeys,
|
|
719
793
|
currentExpandKeys,
|
|
794
|
+
activeKey: effectiveActiveKey,
|
|
720
795
|
onLoadMore: computed(() => (loadMore === null || loadMore === void 0 ? void 0 : loadMore.value) ? function() {
|
|
721
796
|
var _ref = _asyncToGenerator(function* (key) {
|
|
722
797
|
if (!isFunction(loadMore.value)) return;
|
|
@@ -744,6 +819,7 @@ var tree_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
744
819
|
onExpand,
|
|
745
820
|
onExpandEnd,
|
|
746
821
|
onNodeEvent,
|
|
822
|
+
onNodeKeydown,
|
|
747
823
|
onNodeLongPress,
|
|
748
824
|
onNodeSwipe,
|
|
749
825
|
allowDrop(key, dropPosition) {
|
|
@@ -947,8 +1023,11 @@ var tree_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
947
1023
|
});
|
|
948
1024
|
return (_ctx, _cache) => {
|
|
949
1025
|
return openBlock(), createElementBlock("div", {
|
|
1026
|
+
ref_key: "rootEl",
|
|
1027
|
+
ref: rootEl,
|
|
950
1028
|
class: normalizeClass(classNames.value),
|
|
951
|
-
style: normalizeStyle(treeStyle.value)
|
|
1029
|
+
style: normalizeStyle(treeStyle.value),
|
|
1030
|
+
role: "tree"
|
|
952
1031
|
}, [unref(virtualListProps) ? (openBlock(), createBlock(unref(virtual_list_default), mergeProps({
|
|
953
1032
|
key: virtualListKey.value,
|
|
954
1033
|
ref_key: "virtualListRef",
|
|
@@ -525,6 +525,12 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
525
525
|
};
|
|
526
526
|
const { tipVisible, show: showReadonlyTip } = useReadonlyTip(toRef(props, "readonly"), mergedDisabled);
|
|
527
527
|
const readonlyTipText = useReadonlyTipText(toRef(props, "readonly"));
|
|
528
|
+
const triggerInputAttrs = computed(() => ({
|
|
529
|
+
"role": "combobox",
|
|
530
|
+
"aria-expanded": panelVisible.value,
|
|
531
|
+
"aria-haspopup": "listbox",
|
|
532
|
+
"aria-autocomplete": mergedAllowSearch.value ? "list" : "none"
|
|
533
|
+
}));
|
|
528
534
|
const setPanelVisible = (visible) => {
|
|
529
535
|
if (visible && props.readonly && !mergedDisabled.value) {
|
|
530
536
|
showReadonlyTip();
|
|
@@ -603,6 +609,7 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
603
609
|
"popup-container": __props.popupContainer,
|
|
604
610
|
"click-to-close": !Boolean(unref(mergedAllowSearch)),
|
|
605
611
|
"auto-fit-transform-origin": "",
|
|
612
|
+
"aria-has-popup": "listbox",
|
|
606
613
|
onPopupVisibleChange: unref(onVisibleChange)
|
|
607
614
|
}), {
|
|
608
615
|
content: withCtx(() => [createElementVNode("div", {
|
|
@@ -671,7 +678,8 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
671
678
|
error: __props.error,
|
|
672
679
|
bordered: __props.border,
|
|
673
680
|
placeholder: __props.placeholder,
|
|
674
|
-
multiple: isMultiple.value
|
|
681
|
+
multiple: isMultiple.value,
|
|
682
|
+
"input-attrs": triggerInputAttrs.value
|
|
675
683
|
}, _ctx.$attrs, {
|
|
676
684
|
onInputValueChange: unref(onSearchValueChange),
|
|
677
685
|
onClear: onInnerClear,
|
|
@@ -711,6 +719,7 @@ var tree_select_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
711
719
|
"bordered",
|
|
712
720
|
"placeholder",
|
|
713
721
|
"multiple",
|
|
722
|
+
"input-attrs",
|
|
714
723
|
"onInputValueChange"
|
|
715
724
|
])])]),
|
|
716
725
|
_: 3
|
package/es/trigger/index.d.ts
CHANGED
|
@@ -145,6 +145,18 @@ declare const Trigger: {
|
|
|
145
145
|
type: NumberConstructor;
|
|
146
146
|
default: number;
|
|
147
147
|
};
|
|
148
|
+
escToClose: {
|
|
149
|
+
type: BooleanConstructor;
|
|
150
|
+
default: boolean;
|
|
151
|
+
};
|
|
152
|
+
ariaHasPopup: {
|
|
153
|
+
type: import("vue").PropType<boolean | "menu" | "listbox" | "tree" | "grid" | "dialog">;
|
|
154
|
+
default: undefined;
|
|
155
|
+
};
|
|
156
|
+
ariaDescribedbyPopup: {
|
|
157
|
+
type: BooleanConstructor;
|
|
158
|
+
default: boolean;
|
|
159
|
+
};
|
|
148
160
|
}>> & Readonly<{
|
|
149
161
|
onHide?: (() => any) | undefined;
|
|
150
162
|
onResize?: (() => any) | undefined;
|
|
@@ -186,6 +198,9 @@ declare const Trigger: {
|
|
|
186
198
|
preventFocus: boolean;
|
|
187
199
|
scrollToClose: boolean;
|
|
188
200
|
scrollToCloseDistance: number;
|
|
201
|
+
escToClose: boolean;
|
|
202
|
+
ariaHasPopup: boolean | "dialog" | "menu" | "listbox" | "tree" | "grid";
|
|
203
|
+
ariaDescribedbyPopup: boolean;
|
|
189
204
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
190
205
|
P: {};
|
|
191
206
|
B: {};
|
|
@@ -336,6 +351,18 @@ declare const Trigger: {
|
|
|
336
351
|
type: NumberConstructor;
|
|
337
352
|
default: number;
|
|
338
353
|
};
|
|
354
|
+
escToClose: {
|
|
355
|
+
type: BooleanConstructor;
|
|
356
|
+
default: boolean;
|
|
357
|
+
};
|
|
358
|
+
ariaHasPopup: {
|
|
359
|
+
type: import("vue").PropType<boolean | "menu" | "listbox" | "tree" | "grid" | "dialog">;
|
|
360
|
+
default: undefined;
|
|
361
|
+
};
|
|
362
|
+
ariaDescribedbyPopup: {
|
|
363
|
+
type: BooleanConstructor;
|
|
364
|
+
default: boolean;
|
|
365
|
+
};
|
|
339
366
|
}>> & Readonly<{
|
|
340
367
|
onHide?: (() => any) | undefined;
|
|
341
368
|
onResize?: (() => any) | undefined;
|
|
@@ -371,6 +398,9 @@ declare const Trigger: {
|
|
|
371
398
|
preventFocus: boolean;
|
|
372
399
|
scrollToClose: boolean;
|
|
373
400
|
scrollToCloseDistance: number;
|
|
401
|
+
escToClose: boolean;
|
|
402
|
+
ariaHasPopup: boolean | "dialog" | "menu" | "listbox" | "tree" | "grid";
|
|
403
|
+
ariaDescribedbyPopup: boolean;
|
|
374
404
|
}>;
|
|
375
405
|
__isFragment?: never;
|
|
376
406
|
__isTeleport?: never;
|
|
@@ -518,6 +548,18 @@ declare const Trigger: {
|
|
|
518
548
|
type: NumberConstructor;
|
|
519
549
|
default: number;
|
|
520
550
|
};
|
|
551
|
+
escToClose: {
|
|
552
|
+
type: BooleanConstructor;
|
|
553
|
+
default: boolean;
|
|
554
|
+
};
|
|
555
|
+
ariaHasPopup: {
|
|
556
|
+
type: import("vue").PropType<boolean | "menu" | "listbox" | "tree" | "grid" | "dialog">;
|
|
557
|
+
default: undefined;
|
|
558
|
+
};
|
|
559
|
+
ariaDescribedbyPopup: {
|
|
560
|
+
type: BooleanConstructor;
|
|
561
|
+
default: boolean;
|
|
562
|
+
};
|
|
521
563
|
}>> & Readonly<{
|
|
522
564
|
onHide?: (() => any) | undefined;
|
|
523
565
|
onResize?: (() => any) | undefined;
|
|
@@ -559,6 +601,9 @@ declare const Trigger: {
|
|
|
559
601
|
preventFocus: boolean;
|
|
560
602
|
scrollToClose: boolean;
|
|
561
603
|
scrollToCloseDistance: number;
|
|
604
|
+
escToClose: boolean;
|
|
605
|
+
ariaHasPopup: boolean | "dialog" | "menu" | "listbox" | "tree" | "grid";
|
|
606
|
+
ariaDescribedbyPopup: boolean;
|
|
562
607
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
563
608
|
install: (app: App, options?: SDOptions) => void;
|
|
564
609
|
};
|
package/es/trigger/trigger.d.ts
CHANGED
|
@@ -144,6 +144,18 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
144
144
|
type: NumberConstructor;
|
|
145
145
|
default: number;
|
|
146
146
|
};
|
|
147
|
+
escToClose: {
|
|
148
|
+
type: BooleanConstructor;
|
|
149
|
+
default: boolean;
|
|
150
|
+
};
|
|
151
|
+
ariaHasPopup: {
|
|
152
|
+
type: PropType<boolean | "menu" | "listbox" | "tree" | "grid" | "dialog">;
|
|
153
|
+
default: undefined;
|
|
154
|
+
};
|
|
155
|
+
ariaDescribedbyPopup: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
default: boolean;
|
|
158
|
+
};
|
|
147
159
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
148
160
|
'update:popupVisible': (_visible: boolean) => true;
|
|
149
161
|
popupVisibleChange: (_visible: boolean) => true;
|
|
@@ -293,6 +305,18 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
293
305
|
type: NumberConstructor;
|
|
294
306
|
default: number;
|
|
295
307
|
};
|
|
308
|
+
escToClose: {
|
|
309
|
+
type: BooleanConstructor;
|
|
310
|
+
default: boolean;
|
|
311
|
+
};
|
|
312
|
+
ariaHasPopup: {
|
|
313
|
+
type: PropType<boolean | "menu" | "listbox" | "tree" | "grid" | "dialog">;
|
|
314
|
+
default: undefined;
|
|
315
|
+
};
|
|
316
|
+
ariaDescribedbyPopup: {
|
|
317
|
+
type: BooleanConstructor;
|
|
318
|
+
default: boolean;
|
|
319
|
+
};
|
|
296
320
|
}>> & Readonly<{
|
|
297
321
|
onHide?: (() => any) | undefined;
|
|
298
322
|
onResize?: (() => any) | undefined;
|
|
@@ -328,5 +352,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
328
352
|
preventFocus: boolean;
|
|
329
353
|
scrollToClose: boolean;
|
|
330
354
|
scrollToCloseDistance: number;
|
|
355
|
+
escToClose: boolean;
|
|
356
|
+
ariaHasPopup: boolean | "dialog" | "menu" | "listbox" | "tree" | "grid";
|
|
357
|
+
ariaDescribedbyPopup: boolean;
|
|
331
358
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
332
359
|
export default _default;
|
package/es/trigger/trigger.js
CHANGED
|
@@ -4,6 +4,7 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
4
4
|
import { isEmptyChildren, mergeFirstChild } from "../_utils/vue-utils.js";
|
|
5
5
|
import { off, on } from "../_utils/dom.js";
|
|
6
6
|
import { throttleByRaf } from "../_utils/throttle-by-raf.js";
|
|
7
|
+
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
7
8
|
import { omit } from "../_utils/omit.js";
|
|
8
9
|
import client_only_default from "../_components/client-only.js";
|
|
9
10
|
import { useFirstElement } from "../_hooks/use-first-element.js";
|
|
@@ -14,7 +15,7 @@ import { useResizeObserver as useResizeObserver$1 } from "../_hooks/use-resize-o
|
|
|
14
15
|
import { useTeleportContainer } from "../_hooks/use-teleport-container.js";
|
|
15
16
|
import { triggerInjectionKey } from "./context.js";
|
|
16
17
|
import { getArrowStyle, getElementScrollRect, getPopupStyle, getScrollElements, getTransformOrigin } from "./utils.js";
|
|
17
|
-
import { Fragment, Teleport, Transition, computed, createVNode, defineComponent, inject, mergeProps, nextTick, onBeforeUnmount, onDeactivated, onMounted, onUpdated, provide, reactive, ref, vShow, watch, withDirectives } from "vue";
|
|
18
|
+
import { Fragment, Teleport, Transition, computed, createVNode, defineComponent, getCurrentInstance, inject, mergeProps, nextTick, onBeforeUnmount, onDeactivated, onMounted, onUpdated, provide, reactive, ref, vShow, watch, withDirectives } from "vue";
|
|
18
19
|
import { onClickOutside, useEventListener } from "@vueuse/core";
|
|
19
20
|
//#region components/trigger/trigger.tsx
|
|
20
21
|
var TRIGGER_EVENTS = [
|
|
@@ -301,6 +302,31 @@ var trigger_default = /* @__PURE__ */ defineComponent({
|
|
|
301
302
|
scrollToCloseDistance: {
|
|
302
303
|
type: Number,
|
|
303
304
|
default: 0
|
|
305
|
+
},
|
|
306
|
+
/**
|
|
307
|
+
* @zh 是否支持 ESC 键关闭弹出层
|
|
308
|
+
* @en Whether to close the popup with the ESC key
|
|
309
|
+
*/
|
|
310
|
+
escToClose: {
|
|
311
|
+
type: Boolean,
|
|
312
|
+
default: false
|
|
313
|
+
},
|
|
314
|
+
/**
|
|
315
|
+
* @zh 弹出层类型,用于触发器的 `aria-haspopup`。设置后会自动给触发器加 `aria-haspopup` / `aria-expanded` / `aria-controls`,并给弹出层加 id。
|
|
316
|
+
* @en Popup type for the trigger's `aria-haspopup`. When set, the trigger automatically gets `aria-haspopup` / `aria-expanded` / `aria-controls`, and the popup gets an id.
|
|
317
|
+
* @values true, 'menu', 'listbox', 'tree', 'grid', 'dialog'
|
|
318
|
+
*/
|
|
319
|
+
ariaHasPopup: {
|
|
320
|
+
type: [Boolean, String],
|
|
321
|
+
default: void 0
|
|
322
|
+
},
|
|
323
|
+
/**
|
|
324
|
+
* @zh 是否给触发器加 `aria-describedby` 指向弹出层(tooltip 模式用)。弹出层显示时才挂。
|
|
325
|
+
* @en Whether to add `aria-describedby` on the trigger pointing to the popup (tooltip pattern). Only applied while the popup is visible.
|
|
326
|
+
*/
|
|
327
|
+
ariaDescribedbyPopup: {
|
|
328
|
+
type: Boolean,
|
|
329
|
+
default: false
|
|
304
330
|
}
|
|
305
331
|
},
|
|
306
332
|
emits: {
|
|
@@ -333,6 +359,7 @@ var trigger_default = /* @__PURE__ */ defineComponent({
|
|
|
333
359
|
setup(props, { emit, slots, attrs }) {
|
|
334
360
|
const triggerEventAttrs = attrs;
|
|
335
361
|
const prefixCls = getPrefixCls("trigger");
|
|
362
|
+
const popupId = `${prefixCls}-popup-${getCurrentInstance().uid}`;
|
|
336
363
|
const popupAttrs = computed(() => omit(attrs, TRIGGER_EVENTS));
|
|
337
364
|
const configCtx = inject(configProviderInjectionKey, void 0);
|
|
338
365
|
const themePopupContainer = inject(themePopupContainerInjectionKey, void 0);
|
|
@@ -361,6 +388,16 @@ var trigger_default = /* @__PURE__ */ defineComponent({
|
|
|
361
388
|
var _props$popupVisible;
|
|
362
389
|
return (_props$popupVisible = props.popupVisible) !== null && _props$popupVisible !== void 0 ? _props$popupVisible : popupVisible.value;
|
|
363
390
|
});
|
|
391
|
+
const firstChildAria = computed(() => {
|
|
392
|
+
const aria = {};
|
|
393
|
+
if (props.ariaHasPopup !== void 0) {
|
|
394
|
+
aria["aria-haspopup"] = props.ariaHasPopup === true ? "true" : props.ariaHasPopup;
|
|
395
|
+
aria["aria-expanded"] = computedVisible.value;
|
|
396
|
+
aria["aria-controls"] = computedVisible.value ? popupId : void 0;
|
|
397
|
+
}
|
|
398
|
+
if (props.ariaDescribedbyPopup) aria["aria-describedby"] = computedVisible.value ? popupId : void 0;
|
|
399
|
+
return aria;
|
|
400
|
+
});
|
|
364
401
|
const { teleportContainer, containerRef } = useTeleportContainer({
|
|
365
402
|
popupContainer: mergedPopupContainer,
|
|
366
403
|
visible: computedVisible,
|
|
@@ -551,7 +588,12 @@ var trigger_default = /* @__PURE__ */ defineComponent({
|
|
|
551
588
|
if (getChildElements().some((element) => element.contains(target))) return;
|
|
552
589
|
changeVisible(false);
|
|
553
590
|
};
|
|
554
|
-
|
|
591
|
+
const documentRef = computed(() => typeof document === "undefined" ? void 0 : document);
|
|
592
|
+
useEventListener(documentRef, "contextmenu", handleOutsideContextmenu, { capture: true });
|
|
593
|
+
const handleKeydown = (ev) => {
|
|
594
|
+
if (props.escToClose && computedVisible.value && ev.key === KEYBOARD_KEY.ESC) changeVisible(false);
|
|
595
|
+
};
|
|
596
|
+
useEventListener(documentRef, "keydown", handleKeydown);
|
|
555
597
|
const isExceedThreshold = (oldPosition, element) => {
|
|
556
598
|
const [scrollTop, scrollLeft] = oldPosition;
|
|
557
599
|
const { scrollTop: newScrollTop, scrollLeft: newScrollLeft } = element;
|
|
@@ -663,19 +705,19 @@ var trigger_default = /* @__PURE__ */ defineComponent({
|
|
|
663
705
|
return () => {
|
|
664
706
|
var _slots$default, _slots$default2;
|
|
665
707
|
children.value = (_slots$default = (_slots$default2 = slots.default) === null || _slots$default2 === void 0 ? void 0 : _slots$default2.call(slots)) !== null && _slots$default !== void 0 ? _slots$default : [];
|
|
666
|
-
mergeFirstChild(children.value, {
|
|
667
|
-
class: triggerCls.value,
|
|
708
|
+
mergeFirstChild(children.value, _objectSpread2(_objectSpread2({ class: triggerCls.value }, firstChildAria.value), {}, {
|
|
668
709
|
onClick: handleClick,
|
|
669
710
|
onMouseenter: handleMouseEnter,
|
|
670
711
|
onMouseleave: handleMouseLeave,
|
|
671
712
|
onFocusin: handleFocusin,
|
|
672
713
|
onFocusout: handleFocusout,
|
|
673
714
|
onContextmenu: handleContextmenuWithContext
|
|
674
|
-
});
|
|
715
|
+
}));
|
|
675
716
|
return createVNode(Fragment, null, [props.autoFixPosition ? createVNode(resize_observer_v2_default, { "onResize": onTargetResize }, { default: () => [children.value] }) : children.value, createVNode(client_only_default, null, { default: () => [createVNode(Teleport, {
|
|
676
717
|
"to": teleportContainer.value,
|
|
677
718
|
"disabled": !props.renderToBody
|
|
678
719
|
}, { default: () => [(!props.unmountOnClose || computedVisible.value || mounted.value) && !hidePopup.value && createVNode(resize_observer_v2_default, { "onResize": handleResize }, { default: () => [createVNode("div", mergeProps({
|
|
720
|
+
"id": popupId,
|
|
679
721
|
"ref": popupRef,
|
|
680
722
|
"class": [`${prefixCls}-popup`, `${prefixCls}-position-${popupPosition.value}`],
|
|
681
723
|
"style": _objectSpread2(_objectSpread2({}, popupStyle.value), {}, {
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
+
import { useI18n } from "../locale/index.js";
|
|
3
4
|
import Input from "../input/index.js";
|
|
4
5
|
import { createElementBlock, createVNode, defineComponent, normalizeClass, onMounted, openBlock, ref, unref, withKeys } from "vue";
|
|
5
6
|
//#region components/typography/edit-content.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -16,8 +17,9 @@ var edit_content_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
16
17
|
],
|
|
17
18
|
setup(__props, { emit: __emit }) {
|
|
18
19
|
const emit = __emit;
|
|
20
|
+
const { t } = useI18n();
|
|
19
21
|
const classNames = [`${getPrefixCls("typography")}-edit-content`];
|
|
20
|
-
const
|
|
22
|
+
const rootRef = ref();
|
|
21
23
|
function onChange(value) {
|
|
22
24
|
emit("update:text", value);
|
|
23
25
|
emit("change", value);
|
|
@@ -26,24 +28,31 @@ var edit_content_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
26
28
|
emit("end");
|
|
27
29
|
}
|
|
28
30
|
onMounted(() => {
|
|
29
|
-
|
|
30
|
-
const inputEl =
|
|
31
|
+
var _rootRef$value;
|
|
32
|
+
const inputEl = (_rootRef$value = rootRef.value) === null || _rootRef$value === void 0 ? void 0 : _rootRef$value.querySelector("input");
|
|
31
33
|
if (!inputEl) return;
|
|
32
|
-
inputEl.focus
|
|
34
|
+
inputEl.focus();
|
|
33
35
|
const { length } = inputEl.value;
|
|
34
36
|
inputEl.setSelectionRange(length, length);
|
|
35
37
|
});
|
|
36
38
|
const onBlur = onEnd;
|
|
37
39
|
return (_ctx, _cache) => {
|
|
38
|
-
return openBlock(), createElementBlock("div", {
|
|
39
|
-
ref_key: "
|
|
40
|
-
ref:
|
|
40
|
+
return openBlock(), createElementBlock("div", {
|
|
41
|
+
ref_key: "rootRef",
|
|
42
|
+
ref: rootRef,
|
|
43
|
+
class: normalizeClass(classNames)
|
|
44
|
+
}, [createVNode(unref(Input), {
|
|
41
45
|
"auto-size": "",
|
|
46
|
+
"input-attrs": { "aria-label": unref(t)("a11y.editText") },
|
|
42
47
|
"model-value": __props.text,
|
|
43
48
|
onBlur: unref(onBlur),
|
|
44
49
|
onInput: onChange,
|
|
45
50
|
onKeydown: withKeys(onEnd, ["enter"])
|
|
46
|
-
}, null, 8, [
|
|
51
|
+
}, null, 8, [
|
|
52
|
+
"input-attrs",
|
|
53
|
+
"model-value",
|
|
54
|
+
"onBlur"
|
|
55
|
+
])], 512);
|
|
47
56
|
};
|
|
48
57
|
}
|
|
49
58
|
}));
|
|
@@ -1,5 +1,6 @@
|
|
|
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
|
+
import { isActivationKey } from "../_utils/keyboard.js";
|
|
3
4
|
import IconCheckCircleFill from "../icon/icon-check-circle-fill/index.js";
|
|
4
5
|
import { useI18n } from "../locale/index.js";
|
|
5
6
|
import Tooltip from "../tooltip/index.js";
|
|
@@ -7,6 +8,8 @@ import IconCopy from "../icon/icon-copy/index.js";
|
|
|
7
8
|
import IconEdit from "../icon/icon-edit/index.js";
|
|
8
9
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeProps, openBlock, renderSlot, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
9
10
|
//#region components/typography/operations.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var _hoisted_1 = ["aria-label"];
|
|
12
|
+
var _hoisted_2 = ["aria-label"];
|
|
10
13
|
var operations_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "TypographyOperations" }), {}, {
|
|
11
14
|
__name: "operations",
|
|
12
15
|
props: {
|
|
@@ -58,6 +61,24 @@ var operations_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
58
61
|
function onExpandClick() {
|
|
59
62
|
emit("expand");
|
|
60
63
|
}
|
|
64
|
+
function onEditKeydown(ev) {
|
|
65
|
+
if (isActivationKey(ev)) {
|
|
66
|
+
ev.preventDefault();
|
|
67
|
+
onEditClick();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function onCopyKeydown(ev) {
|
|
71
|
+
if (isActivationKey(ev)) {
|
|
72
|
+
ev.preventDefault();
|
|
73
|
+
onCopyClick();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function onExpandKeydown(ev) {
|
|
77
|
+
if (isActivationKey(ev)) {
|
|
78
|
+
ev.preventDefault();
|
|
79
|
+
onExpandClick();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
61
82
|
return (_ctx, _cache) => {
|
|
62
83
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
63
84
|
__props.editable ? (openBlock(), createBlock(unref(Tooltip), mergeProps({
|
|
@@ -66,8 +87,12 @@ var operations_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
66
87
|
}, __props.editTooltipProps), {
|
|
67
88
|
default: withCtx(() => [createElementVNode("span", {
|
|
68
89
|
class: normalizeClass(`${unref(prefixCls)}-operation-edit`),
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
role: "button",
|
|
91
|
+
tabindex: "0",
|
|
92
|
+
"aria-label": unref(t)("typography.edit"),
|
|
93
|
+
onClick: withModifiers(onEditClick, ["stop"]),
|
|
94
|
+
onKeydown: onEditKeydown
|
|
95
|
+
}, [createVNode(unref(IconEdit))], 42, _hoisted_1)]),
|
|
71
96
|
_: 1
|
|
72
97
|
}, 16, ["content"])) : createCommentVNode("", true),
|
|
73
98
|
__props.copyable ? (openBlock(), createBlock(unref(Tooltip), normalizeProps(mergeProps({ key: 1 }, __props.copyTooltipProps)), {
|
|
@@ -77,15 +102,22 @@ var operations_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
77
102
|
[`${unref(prefixCls)}-operation-copied`]: __props.isCopied,
|
|
78
103
|
[`${unref(prefixCls)}-operation-copy`]: !__props.isCopied
|
|
79
104
|
}),
|
|
80
|
-
|
|
81
|
-
|
|
105
|
+
role: "button",
|
|
106
|
+
tabindex: "0",
|
|
107
|
+
"aria-label": __props.isCopied ? unref(t)("typography.copied") : unref(t)("typography.copy"),
|
|
108
|
+
onClick: withModifiers(onCopyClick, ["stop"]),
|
|
109
|
+
onKeydown: onCopyKeydown
|
|
110
|
+
}, [renderSlot(_ctx.$slots, "copy-icon", { copied: __props.isCopied }, () => [__props.isCopied ? (openBlock(), createBlock(unref(IconCheckCircleFill), { key: 0 })) : (openBlock(), createBlock(unref(IconCopy), { key: 1 }))])], 42, _hoisted_2)]),
|
|
82
111
|
_: 3
|
|
83
112
|
}, 16)) : createCommentVNode("", true),
|
|
84
113
|
showExpand.value ? (openBlock(), createElementBlock("a", {
|
|
85
114
|
key: 2,
|
|
86
115
|
class: normalizeClass(`${unref(prefixCls)}-operation-expand`),
|
|
87
|
-
|
|
88
|
-
|
|
116
|
+
role: "button",
|
|
117
|
+
tabindex: "0",
|
|
118
|
+
onClick: withModifiers(onExpandClick, ["stop"]),
|
|
119
|
+
onKeydown: onExpandKeydown
|
|
120
|
+
}, [renderSlot(_ctx.$slots, "expand-node", { expanded: __props.expanded }, () => [createTextVNode(toDisplayString(__props.expanded ? unref(t)("typography.collapse") : unref(t)("typography.expand")), 1)])], 34)) : createCommentVNode("", true)
|
|
89
121
|
], 64);
|
|
90
122
|
};
|
|
91
123
|
}
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
background-color: transparent;
|
|
135
135
|
border-radius: 2px;
|
|
136
136
|
cursor: pointer;
|
|
137
|
-
transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
|
|
137
|
+
transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
138
138
|
}
|
|
139
139
|
.sd-typography-operation-copy:hover {
|
|
140
140
|
color: var(--sd-color-text-2);
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
background-color: transparent;
|
|
151
151
|
border-radius: 2px;
|
|
152
152
|
cursor: pointer;
|
|
153
|
-
transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
|
|
153
|
+
transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
154
154
|
}
|
|
155
155
|
.sd-typography-operation-edit:hover {
|
|
156
156
|
color: var(--sd-color-text-2);
|
|
@@ -152,7 +152,7 @@ $typography-prefix-cls: string.unquote('#{theme.$prefix}-typography');
|
|
|
152
152
|
border-radius: 2px;
|
|
153
153
|
cursor: pointer;
|
|
154
154
|
transition: background-color theme.$transition-duration-1
|
|
155
|
-
theme.$transition-timing-function-
|
|
155
|
+
theme.$transition-timing-function-standard;
|
|
156
156
|
|
|
157
157
|
&:hover {
|
|
158
158
|
color: $typography-color-icon-copy_hover;
|
|
@@ -172,7 +172,7 @@ $typography-prefix-cls: string.unquote('#{theme.$prefix}-typography');
|
|
|
172
172
|
border-radius: 2px;
|
|
173
173
|
cursor: pointer;
|
|
174
174
|
transition: background-color theme.$transition-duration-1
|
|
175
|
-
theme.$transition-timing-function-
|
|
175
|
+
theme.$transition-timing-function-standard;
|
|
176
176
|
|
|
177
177
|
&:hover {
|
|
178
178
|
color: $typography-color-icon-edit_hover;
|