@sdata/web-vue 3.12.0 → 3.14.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 +288 -126
- package/dist/sd.min.css +43 -1
- 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/input-range.vue.d.ts +6 -7
- package/es/_components/picker/input-range.vue_vue_type_script_setup_true_lang.js +63 -46
- package/es/_components/picker/input.vue.d.ts +5 -6
- package/es/_components/picker/input.vue_vue_type_script_setup_true_lang.js +52 -35
- 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 +9 -2
- package/es/_components/select-view/select-view.d.ts +2 -0
- package/es/_components/select-view/select-view.js +5 -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/_hooks/use-readonly-tip.d.ts +11 -0
- package/es/_hooks/use-readonly-tip.js +66 -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 +12 -3
- 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 +2 -0
- package/es/anchor/style/index.css +1 -1
- package/es/anchor/style/index.scss +3 -1
- package/es/auto-complete/auto-complete.d.ts +9 -0
- package/es/auto-complete/auto-complete.js +19 -1
- package/es/auto-complete/index.d.ts +15 -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 +5 -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/breadcrumb/breadcrumb.js +1 -0
- package/es/button/button.vue.d.ts +16 -7
- package/es/button/button.vue_vue_type_script_setup_true_lang.js +62 -31
- package/es/button/index.d.ts +11 -0
- package/es/button/interface.d.ts +2 -0
- package/es/button/style/index.css +15 -6
- package/es/button/style/index.scss +25 -7
- package/es/calendar/style/event.scss +2 -2
- package/es/calendar/style/index.css +2 -2
- package/es/card/card.d.ts +312 -0
- package/es/card/card.js +39 -7
- package/es/card/index.d.ts +616 -0
- package/es/card/style/index.css +26 -3
- package/es/card/style/index.scss +34 -3
- package/es/carousel/carousel-arrow.vue.d.ts +4 -4
- package/es/carousel/carousel-arrow.vue_vue_type_script_setup_true_lang.js +20 -4
- package/es/carousel/carousel-indicator.vue_vue_type_script_setup_true_lang.js +23 -4
- package/es/carousel/carousel-item.vue_vue_type_script_setup_true_lang.js +8 -1
- package/es/carousel/carousel.js +18 -1
- package/es/carousel/style/index.css +1 -1
- package/es/carousel/style/index.scss +1 -1
- package/es/cascader/cascader.vue.d.ts +9 -8
- package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +158 -128
- package/es/cascader/style/index.css +2 -2
- package/es/cascader/style/index.scss +3 -1
- package/es/cascader/types.d.ts +1 -0
- 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.d.ts +9 -0
- package/es/color-picker/color-picker.js +39 -11
- package/es/color-picker/index.d.ts +15 -0
- package/es/config-provider/context.d.ts +9 -9
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +11 -3
- package/es/date-picker/index.d.ts +3 -6
- package/es/date-picker/panels/body.vue_vue_type_script_setup_true_lang.js +14 -1
- package/es/date-picker/picker.vue.d.ts +2 -3
- package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +6 -5
- package/es/date-picker/range-picker.vue.d.ts +2 -3
- package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +4 -4
- 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 +30 -9
- package/es/drawer/index.d.ts +3 -3
- 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 +75 -2
- package/es/dropdown/dropdown-submenu.vue_vue_type_script_setup_true_lang.js +5 -2
- 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/empty/empty.js +1 -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 +7 -3
- 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 +6 -2
- package/es/form/style/index.css +2 -2
- package/es/form/style/index.scss +2 -2
- package/es/image/image.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/preview-action.d.ts +7 -127
- package/es/image/preview.vue.d.ts +1 -1
- package/es/image/preview.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/index.css +288 -126
- package/es/index.js +3 -3
- package/es/input/index.d.ts +6 -6
- package/es/input/input.d.ts +3 -3
- package/es/input/input.js +34 -8
- package/es/input/style/index.css +2 -2
- package/es/input/style/input.scss +4 -4
- package/es/input-number/index.d.ts +9 -9
- package/es/input-number/input-number.d.ts +5 -5
- package/es/input-number/input-number.js +13 -9
- 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 +9 -6
- package/es/input-tag/input-tag.d.ts +5 -3
- package/es/input-tag/input-tag.js +49 -36
- package/es/input-tag/style/index.css +8 -8
- package/es/input-tag/style/index.scss +11 -5
- package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +31 -6
- package/es/layout/style/index.css +2 -2
- package/es/layout/style/index.scss +4 -2
- package/es/link/style/index.css +1 -1
- package/es/link/style/index.scss +3 -1
- package/es/locale/interface.d.ts +1 -0
- package/es/locale/lang/en-us.js +1 -0
- package/es/locale/lang/zh-cn.js +1 -0
- package/es/locale/lang/zh-tw.js +1 -0
- package/es/mention/index.d.ts +15 -0
- package/es/mention/mention.d.ts +9 -0
- package/es/mention/mention.js +20 -1
- package/es/menu/base-menu.vue_vue_type_script_setup_true_lang.js +30 -4
- 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 +30 -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/page-header/page-header.vue.d.ts +6 -6
- package/es/page-header/page-header.vue_vue_type_script_setup_true_lang.js +12 -1
- package/es/pagination/page-item-ellipsis.vue_vue_type_script_setup_true_lang.js +12 -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 +19 -2
- 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 +6 -2
- 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 +4 -2
- package/es/popover/popover.vue_vue_type_script_setup_true_lang.js +3 -1
- 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 +11 -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/index.d.ts +6 -6
- package/es/rate/rate.d.ts +3 -3
- package/es/rate/rate.js +42 -8
- 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/scrollbar/style/index.css +57 -15
- package/es/scrollbar/style/index.scss +63 -15
- package/es/sd-vue.js +3 -3
- package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/select/index.d.ts +139 -0
- package/es/select/select-dropdown.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/select/select.d.ts +71 -0
- package/es/select/select.js +45 -6
- 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/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 +6 -1
- 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/style/normalize.scss +68 -0
- 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/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-tbody.js +4 -1
- package/es/table/table-td.js +2 -1
- package/es/table/table-th.js +6 -4
- package/es/table/table-thead.js +4 -1
- package/es/table/table-tr.js +4 -1
- package/es/table/table.js +6 -2
- package/es/tabs/context.d.ts +3 -0
- package/es/tabs/index.d.ts +32 -0
- package/es/tabs/style/index.css +34 -5
- package/es/tabs/style/index.scss +45 -7
- package/es/tabs/tab-pane.vue.d.ts +4 -2
- package/es/tabs/tab-pane.vue_vue_type_script_setup_true_lang.js +39 -4
- 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.d.ts +19 -0
- package/es/tabs/tabs.js +25 -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 +19 -2
- package/es/textarea/index.d.ts +15 -0
- package/es/textarea/style/index.css +2 -2
- package/es/textarea/textarea.vue.d.ts +11 -2
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +84 -47
- package/es/time-picker/index.d.ts +3 -6
- package/es/time-picker/panel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/time-picker/time-column.vue_vue_type_script_setup_true_lang.js +11 -3
- package/es/time-picker/time-picker.vue.d.ts +2 -3
- package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +12 -6
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/tooltip/index.d.ts +8 -127
- package/es/tooltip/interface.d.ts +17 -0
- package/es/tooltip/tooltip.vue.d.ts +5 -88
- package/es/tooltip/tooltip.vue_vue_type_script_setup_true_lang.js +9 -69
- package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/transfer/style/index.css +1 -1
- package/es/transfer/style/index.scss +1 -1
- package/es/transfer/transfer-list-item.js +16 -2
- package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +27 -7
- package/es/tree/context.d.ts +2 -0
- 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 +82 -3
- package/es/tree-select/tree-select.vue.d.ts +16 -10
- package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +165 -133
- 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/base.js +1 -1
- package/es/typography/edit-content.vue_vue_type_script_setup_true_lang.js +11 -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-button.js +1 -1
- package/es/upload/upload-list-item.js +18 -5
- package/es/upload/upload-picture-item.js +25 -3
- package/es/verification-code/index.d.ts +15 -6
- package/es/verification-code/verification-code.d.ts +9 -3
- package/es/verification-code/verification-code.js +10 -2
- package/json/vetur-attributes.json +63 -7
- package/json/vetur-tags.json +23 -7
- package/json/web-types.json +131 -10
- package/package.json +1 -1
- package/es/style/base.scss +0 -18
|
@@ -3,20 +3,22 @@ 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
8
|
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
8
|
-
import
|
|
9
|
-
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
9
|
+
import { useI18n } from "../locale/index.js";
|
|
10
10
|
import client_only_default from "../_components/client-only.js";
|
|
11
11
|
import usePopupManager from "../_hooks/use-popup-manager.js";
|
|
12
12
|
import { useTeleportContainer } from "../_hooks/use-teleport-container.js";
|
|
13
|
-
import
|
|
13
|
+
import Button from "../button/index.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"];
|
|
20
22
|
var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, {
|
|
21
23
|
name: "Drawer",
|
|
22
24
|
inheritAttrs: false
|
|
@@ -255,6 +257,12 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
255
257
|
const { popupContainer, placement, mask, maskClosable, escToClose, closable, header, footer, hideCancel, okText, cancelText, okButtonProps, cancelButtonProps, titleEllipsisTooltip, width, height } = toRefs(props);
|
|
256
258
|
const prefixCls = getPrefixCls("drawer");
|
|
257
259
|
const { t } = useI18n();
|
|
260
|
+
const slots = useSlots();
|
|
261
|
+
const drawerRef = ref();
|
|
262
|
+
const titleId = `sd-drawer-title-${getCurrentInstance().uid}`;
|
|
263
|
+
const bodyId = `sd-drawer-body-${getCurrentInstance().uid}`;
|
|
264
|
+
const hasTitle = computed(() => mergedHeader.value && !slots.header && (Boolean(props.title) || Boolean(slots.title)));
|
|
265
|
+
const { activate: activateFocusTrap, deactivate: deactivateFocusTrap } = useFocusTrap(drawerRef, { initialFocus: (c) => getFocusableElements(c).find((el) => !el.closest(".sd-drawer-close-btn")) });
|
|
258
266
|
const { mergedValue: mergedPlacement } = useConfigProviderProp(placement, {
|
|
259
267
|
propNames: ["placement"],
|
|
260
268
|
getGlobalValue: (configProviderCtx) => {
|
|
@@ -463,6 +471,7 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
463
471
|
mounted.value = true;
|
|
464
472
|
setOverflowHidden();
|
|
465
473
|
if (mergedEscToClose.value) addGlobalKeyDownListener();
|
|
474
|
+
nextTick(() => activateFocusTrap());
|
|
466
475
|
}
|
|
467
476
|
});
|
|
468
477
|
onBeforeUnmount(() => {
|
|
@@ -476,9 +485,11 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
476
485
|
mounted.value = true;
|
|
477
486
|
setOverflowHidden();
|
|
478
487
|
addGlobalKeyDownListener();
|
|
488
|
+
nextTick(() => activateFocusTrap());
|
|
479
489
|
} else {
|
|
480
490
|
emit("beforeClose");
|
|
481
491
|
removeGlobalKeyDownListener();
|
|
492
|
+
deactivateFocusTrap();
|
|
482
493
|
}
|
|
483
494
|
});
|
|
484
495
|
const style = computed(() => {
|
|
@@ -516,14 +527,22 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
516
527
|
onAfterLeave: handleClose
|
|
517
528
|
}, {
|
|
518
529
|
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
530
|
+
ref_key: "drawerRef",
|
|
531
|
+
ref: drawerRef,
|
|
519
532
|
class: normalizeClass(unref(prefixCls)),
|
|
520
|
-
style: normalizeStyle(style.value)
|
|
533
|
+
style: normalizeStyle(style.value),
|
|
534
|
+
role: "dialog",
|
|
535
|
+
"aria-modal": "true",
|
|
536
|
+
"aria-labelledby": hasTitle.value ? titleId : void 0,
|
|
537
|
+
"aria-describedby": bodyId,
|
|
538
|
+
tabindex: "-1"
|
|
521
539
|
}, [
|
|
522
540
|
unref(mergedHeader) ? (openBlock(), createElementBlock("div", {
|
|
523
541
|
key: 0,
|
|
524
542
|
class: normalizeClass(`${unref(prefixCls)}-header`)
|
|
525
543
|
}, [renderSlot(_ctx.$slots, "header", {}, () => [_ctx.$slots.title || __props.title ? (openBlock(), createElementBlock("div", {
|
|
526
544
|
key: 0,
|
|
545
|
+
id: titleId,
|
|
527
546
|
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
528
547
|
}, [createVNode(unref(Ellipsis), {
|
|
529
548
|
class: normalizeClass(`${unref(prefixCls)}-title-text`),
|
|
@@ -533,16 +552,18 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
533
552
|
_: 3
|
|
534
553
|
}, 8, ["class", "tooltip"])], 2)) : createCommentVNode("", true), unref(mergedClosable) ? (openBlock(), createElementBlock("div", {
|
|
535
554
|
key: 1,
|
|
536
|
-
tabindex: "
|
|
555
|
+
tabindex: "0",
|
|
537
556
|
role: "button",
|
|
538
557
|
"aria-label": "Close",
|
|
539
558
|
class: normalizeClass(`${unref(prefixCls)}-close-btn`),
|
|
540
|
-
onClick: handleCancel
|
|
559
|
+
onClick: handleCancel,
|
|
560
|
+
onKeydown: _cache[0] || (_cache[0] = ($event) => unref(onActivate)(handleCancel))
|
|
541
561
|
}, [createVNode(icon_hover_default, null, {
|
|
542
562
|
default: withCtx(() => [createVNode(unref(IconClose))]),
|
|
543
563
|
_: 1
|
|
544
|
-
})],
|
|
564
|
+
})], 34)) : createCommentVNode("", true)])], 2)) : createCommentVNode("", true),
|
|
545
565
|
createElementVNode("div", {
|
|
566
|
+
id: bodyId,
|
|
546
567
|
class: normalizeClass([`${unref(prefixCls)}-body`, __props.bodyClass]),
|
|
547
568
|
style: normalizeStyle(__props.bodyStyle)
|
|
548
569
|
}, [renderSlot(_ctx.$slots, "default")], 6),
|
|
@@ -559,7 +580,7 @@ var drawer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
559
580
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(mergedOkText) || unref(t)("drawer.okText")), 1)]),
|
|
560
581
|
_: 1
|
|
561
582
|
}, 16, ["loading"])])], 2)) : createCommentVNode("", true)
|
|
562
|
-
],
|
|
583
|
+
], 14, _hoisted_1), [[vShow, computedVisible.value]])]),
|
|
563
584
|
_: 3
|
|
564
585
|
}, 8, ["name"])], 16)), [[vShow, computedVisible.value || mounted.value]]) : createCommentVNode("", true)], 8, ["to", "disabled"]))]),
|
|
565
586
|
_: 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: {
|
|
@@ -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
6
|
import { dropdownInjectionKey } from "./context.js";
|
|
6
7
|
import Empty from "../empty/index.js";
|
|
7
|
-
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
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", {
|
|
@@ -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
|
package/es/empty/empty.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
-
import IconEmpty from "../icon/icon-empty/index.js";
|
|
4
3
|
import { useI18n } from "../locale/index.js";
|
|
4
|
+
import IconEmpty from "../icon/icon-empty/index.js";
|
|
5
5
|
import { createVNode, defineComponent, inject, mergeProps } from "vue";
|
|
6
6
|
//#region components/empty/empty.tsx
|
|
7
7
|
var empty_default = /* @__PURE__ */ defineComponent({
|
|
@@ -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,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 { isServerRendering } from "../_utils/dom.js";
|
|
4
|
+
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
4
5
|
import IconClose from "../icon/icon-close/index.js";
|
|
5
6
|
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
6
7
|
import IconLoading from "../icon/icon-loading/index.js";
|
|
7
|
-
import { KEYBOARD_KEY } from "../_utils/keyboard.js";
|
|
8
8
|
import usePopupManager from "../_hooks/use-popup-manager.js";
|
|
9
9
|
import usePopupContainer from "../_hooks/use-popup-container.js";
|
|
10
10
|
import usePopupOverflowHidden from "../_hooks/use-popup-overflow-hidden.js";
|
|
@@ -528,15 +528,19 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
528
528
|
key: 1,
|
|
529
529
|
type: "button",
|
|
530
530
|
class: normalizeClass(`${unref(prefixCls)}-close-btn`),
|
|
531
|
+
"aria-label": "关闭",
|
|
531
532
|
onClick: close
|
|
532
533
|
}, [createVNode(unref(IconClose))], 2)) : createCommentVNode("", true),
|
|
533
534
|
isLoading.value ? (openBlock(), createElementBlock("div", {
|
|
534
535
|
key: 2,
|
|
535
|
-
class: normalizeClass(`${unref(prefixCls)}-loading`)
|
|
536
|
+
class: normalizeClass(`${unref(prefixCls)}-loading`),
|
|
537
|
+
role: "status",
|
|
538
|
+
"aria-label": "加载中"
|
|
536
539
|
}, [createVNode(unref(IconLoading))], 2)) : createCommentVNode("", true),
|
|
537
540
|
isError.value ? (openBlock(), createElementBlock("div", {
|
|
538
541
|
key: 3,
|
|
539
|
-
class: normalizeClass(`${unref(prefixCls)}-error`)
|
|
542
|
+
class: normalizeClass(`${unref(prefixCls)}-error`),
|
|
543
|
+
role: "alert"
|
|
540
544
|
}, "文件预览加载失败", 2)) : createCommentVNode("", true)
|
|
541
545
|
], 46, _hoisted_1)) : createCommentVNode("", true)], 8, ["to", "disabled"]));
|
|
542
546
|
};
|
|
@@ -114,10 +114,10 @@ declare const FilePreviewer: {
|
|
|
114
114
|
type: import("./types").FilePreviewerType;
|
|
115
115
|
visible: boolean;
|
|
116
116
|
renderToBody: boolean;
|
|
117
|
+
escToClose: boolean;
|
|
117
118
|
defaultVisible: boolean;
|
|
118
119
|
closable: boolean;
|
|
119
120
|
maskClosable: boolean;
|
|
120
|
-
escToClose: boolean;
|
|
121
121
|
fullscreen: boolean;
|
|
122
122
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
123
123
|
P: {};
|
|
@@ -234,10 +234,10 @@ declare const FilePreviewer: {
|
|
|
234
234
|
type: import("./types").FilePreviewerType;
|
|
235
235
|
visible: boolean;
|
|
236
236
|
renderToBody: boolean;
|
|
237
|
+
escToClose: boolean;
|
|
237
238
|
defaultVisible: boolean;
|
|
238
239
|
closable: boolean;
|
|
239
240
|
maskClosable: boolean;
|
|
240
|
-
escToClose: boolean;
|
|
241
241
|
fullscreen: boolean;
|
|
242
242
|
}>;
|
|
243
243
|
__isFragment?: never;
|
|
@@ -313,10 +313,10 @@ declare const FilePreviewer: {
|
|
|
313
313
|
type: import("./types").FilePreviewerType;
|
|
314
314
|
visible: boolean;
|
|
315
315
|
renderToBody: boolean;
|
|
316
|
+
escToClose: boolean;
|
|
316
317
|
defaultVisible: boolean;
|
|
317
318
|
closable: boolean;
|
|
318
319
|
maskClosable: boolean;
|
|
319
|
-
escToClose: boolean;
|
|
320
320
|
fullscreen: boolean;
|
|
321
321
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
322
322
|
$slots: {
|
package/es/form/context.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import form_item_message_default from "./form-item-message.js";
|
|
|
10
10
|
import { getFinalValidateMessage, getFinalValidateStatus, getFormElementId } from "./utils.js";
|
|
11
11
|
import { _objectDestructuringEmpty } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectDestructuringEmpty.js";
|
|
12
12
|
import { _extends } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/extends.js";
|
|
13
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, mergeProps, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderSlot, toDisplayString, toRef, toRefs, unref, withCtx } from "vue";
|
|
13
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeProps, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderSlot, toDisplayString, toRef, toRefs, unref, withCtx } from "vue";
|
|
14
14
|
import { Schema } from "b-validate";
|
|
15
15
|
//#region components/form/form-item.vue?vue&type=script&setup=true&lang.ts
|
|
16
16
|
var form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "FormItem" }), {}, {
|
|
@@ -242,6 +242,8 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
242
242
|
const formCtx = inject(formInjectionKey, {});
|
|
243
243
|
const { autoLabelWidth, layout } = toRefs(formCtx);
|
|
244
244
|
const { i18nMessage } = useI18n();
|
|
245
|
+
const instance = getCurrentInstance();
|
|
246
|
+
const fieldId = computed(() => `sd-form-item-${instance === null || instance === void 0 ? void 0 : instance.uid}`);
|
|
245
247
|
const mergedLabelCol = computed(() => {
|
|
246
248
|
var _props$labelColProps;
|
|
247
249
|
const colProps = _objectSpread2({}, (_props$labelColProps = props.labelColProps) !== null && _props$labelColProps !== void 0 ? _props$labelColProps : formCtx.labelColProps);
|
|
@@ -264,6 +266,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
264
266
|
var _props$wrapperColStyl;
|
|
265
267
|
return (_props$wrapperColStyl = props.wrapperColStyle) !== null && _props$wrapperColStyl !== void 0 ? _props$wrapperColStyl : formCtx.wrapperColStyle;
|
|
266
268
|
});
|
|
269
|
+
const mergedLabelAttrs = computed(() => _objectSpread2({ for: fieldId.value }, props.labelAttrs));
|
|
267
270
|
const initialValue = getValueByPath(formCtx.model, props.field);
|
|
268
271
|
const formValidateStatus = reactive({});
|
|
269
272
|
const validateMessage = reactive({});
|
|
@@ -372,6 +375,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
372
375
|
disabled: computedDisabled,
|
|
373
376
|
error: isError,
|
|
374
377
|
feedback: computedFeedback,
|
|
378
|
+
fieldId,
|
|
375
379
|
updateValidateState
|
|
376
380
|
}));
|
|
377
381
|
const clearValidate = () => {
|
|
@@ -457,7 +461,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
457
461
|
"show-colon": __props.showColon,
|
|
458
462
|
"asterisk-position": __props.asteriskPosition,
|
|
459
463
|
component: __props.labelComponent,
|
|
460
|
-
attrs:
|
|
464
|
+
attrs: mergedLabelAttrs.value,
|
|
461
465
|
tooltip: __props.tooltip
|
|
462
466
|
}, {
|
|
463
467
|
default: withCtx(() => [_ctx.$slots.label || __props.label ? renderSlot(_ctx.$slots, "label", { key: 0 }, () => [createTextVNode(toDisplayString(__props.label), 1)]) : createCommentVNode("", true)]),
|
package/es/form/style/index.css
CHANGED
|
@@ -457,8 +457,8 @@
|
|
|
457
457
|
|
|
458
458
|
.form-blink-enter-active,
|
|
459
459
|
.form-blink-appear-active {
|
|
460
|
-
transition: opacity 0.3s cubic-bezier(0, 0, 1, 1);
|
|
461
|
-
animation: sd-form-blink 0.5s cubic-bezier(0, 0, 1, 1);
|
|
460
|
+
transition: opacity 0.3s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
461
|
+
animation: sd-form-blink 0.5s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
@keyframes sd-form-blink {
|
package/es/form/style/index.scss
CHANGED
|
@@ -237,9 +237,9 @@ $form-item-message-prefix-cls: string.unquote('#{theme.$prefix}-form-item-messag
|
|
|
237
237
|
|
|
238
238
|
.form-blink-enter-active,
|
|
239
239
|
.form-blink-appear-active {
|
|
240
|
-
transition: opacity theme.$transition-duration-3 theme.$transition-timing-function-
|
|
240
|
+
transition: opacity theme.$transition-duration-3 theme.$transition-timing-function-standard;
|
|
241
241
|
animation: #{theme.$prefix}-form-blink theme.$transition-duration-5
|
|
242
|
-
theme.$transition-timing-function-
|
|
242
|
+
theme.$transition-timing-function-standard;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
@keyframes #{theme.$prefix}-form-blink {
|
|
@@ -3,10 +3,10 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
3
3
|
import { isBoolean } from "../_utils/is.js";
|
|
4
4
|
import { isServerRendering } from "../_utils/dom.js";
|
|
5
5
|
import IconLoading from "../icon/icon-loading/index.js";
|
|
6
|
+
import { useI18n } from "../locale/index.js";
|
|
6
7
|
import { omit } from "../_utils/omit.js";
|
|
7
8
|
import useMergeState from "../_hooks/use-merge-state.js";
|
|
8
9
|
import IconImageClose from "../icon/icon-image-close/index.js";
|
|
9
|
-
import { useI18n } from "../locale/index.js";
|
|
10
10
|
import { PreviewGroupInjectionKey } from "./context.js";
|
|
11
11
|
import useImageLoadStatus from "./hooks/use-image-load-status.js";
|
|
12
12
|
import image_footer_default from "./image-footer.js";
|