@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
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), {}, {
|
package/es/typography/base.js
CHANGED
|
@@ -4,9 +4,9 @@ import { isObject } from "../_utils/is.js";
|
|
|
4
4
|
import resize_observer_default from "../_components/resize-observer.js";
|
|
5
5
|
import { caf, raf } from "../_utils/raf.js";
|
|
6
6
|
import { omit } from "../_utils/omit.js";
|
|
7
|
+
import Tooltip from "../tooltip/index.js";
|
|
7
8
|
import useMergeState from "../_hooks/use-merge-state.js";
|
|
8
9
|
import Popover from "../popover/index.js";
|
|
9
|
-
import Tooltip from "../tooltip/index.js";
|
|
10
10
|
import edit_content_default from "./edit-content.js";
|
|
11
11
|
import operations_default from "./operations.js";
|
|
12
12
|
import getInnerText from "./utils/getInnerText.js";
|
|
@@ -17,7 +17,7 @@ var edit_content_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
17
17
|
setup(__props, { emit: __emit }) {
|
|
18
18
|
const emit = __emit;
|
|
19
19
|
const classNames = [`${getPrefixCls("typography")}-edit-content`];
|
|
20
|
-
const
|
|
20
|
+
const rootRef = ref();
|
|
21
21
|
function onChange(value) {
|
|
22
22
|
emit("update:text", value);
|
|
23
23
|
emit("change", value);
|
|
@@ -26,24 +26,27 @@ var edit_content_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
26
26
|
emit("end");
|
|
27
27
|
}
|
|
28
28
|
onMounted(() => {
|
|
29
|
-
|
|
30
|
-
const inputEl =
|
|
29
|
+
var _rootRef$value;
|
|
30
|
+
const inputEl = (_rootRef$value = rootRef.value) === null || _rootRef$value === void 0 ? void 0 : _rootRef$value.querySelector("input");
|
|
31
31
|
if (!inputEl) return;
|
|
32
|
-
inputEl.focus
|
|
32
|
+
inputEl.focus();
|
|
33
33
|
const { length } = inputEl.value;
|
|
34
34
|
inputEl.setSelectionRange(length, length);
|
|
35
35
|
});
|
|
36
36
|
const onBlur = onEnd;
|
|
37
37
|
return (_ctx, _cache) => {
|
|
38
|
-
return openBlock(), createElementBlock("div", {
|
|
39
|
-
ref_key: "
|
|
40
|
-
ref:
|
|
38
|
+
return openBlock(), createElementBlock("div", {
|
|
39
|
+
ref_key: "rootRef",
|
|
40
|
+
ref: rootRef,
|
|
41
|
+
class: normalizeClass(classNames)
|
|
42
|
+
}, [createVNode(unref(Input), {
|
|
41
43
|
"auto-size": "",
|
|
44
|
+
"input-attrs": { "aria-label": "Edit text" },
|
|
42
45
|
"model-value": __props.text,
|
|
43
46
|
onBlur: unref(onBlur),
|
|
44
47
|
onInput: onChange,
|
|
45
48
|
onKeydown: withKeys(onEnd, ["enter"])
|
|
46
|
-
}, null, 8, ["model-value", "onBlur"])]);
|
|
49
|
+
}, null, 8, ["model-value", "onBlur"])], 512);
|
|
47
50
|
};
|
|
48
51
|
}
|
|
49
52
|
}));
|
|
@@ -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;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
background: var(--sd-color-fill-2);
|
|
45
45
|
border: 1px dashed var(--sd-color-neutral-3);
|
|
46
46
|
border-radius: var(--sd-border-radius-small);
|
|
47
|
-
transition:
|
|
47
|
+
transition: color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), border-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
48
48
|
}
|
|
49
49
|
.sd-upload-picture-card:hover {
|
|
50
50
|
color: var(--sd-color-text-2);
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
background-color: var(--sd-color-fill-1);
|
|
60
60
|
border: 1px dashed var(--sd-color-neutral-3);
|
|
61
61
|
border-radius: var(--sd-border-radius-small);
|
|
62
|
-
transition:
|
|
62
|
+
transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
|
|
63
63
|
}
|
|
64
64
|
.sd-upload-drag .sd-icon-plus {
|
|
65
65
|
margin-bottom: 24px;
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
color: rgb(var(--sd-primary-6));
|
|
160
160
|
font-size: 14px;
|
|
161
161
|
cursor: pointer;
|
|
162
|
-
transition:
|
|
162
|
+
transition: color 0.2s ease;
|
|
163
163
|
}
|
|
164
164
|
.sd-upload-icon-upload:active, .sd-upload-icon-upload:hover {
|
|
165
165
|
color: rgb(var(--sd-primary-7));
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
font-size: 14px;
|
|
206
206
|
background-color: var(--sd-color-fill-1);
|
|
207
207
|
border-radius: var(--sd-border-radius-small);
|
|
208
|
-
transition: background-color 0.1s cubic-bezier(0, 0, 1, 1);
|
|
208
|
+
transition: background-color 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
209
209
|
}
|
|
210
210
|
.sd-upload-list-item-file-icon {
|
|
211
211
|
margin-right: 12px;
|
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
padding-right: 0;
|
|
295
295
|
overflow: hidden;
|
|
296
296
|
vertical-align: top;
|
|
297
|
-
transition:
|
|
297
|
+
transition: opacity 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
298
298
|
}
|
|
299
299
|
.sd-upload-list-picture-status-error .sd-upload-list-picture-mask {
|
|
300
300
|
opacity: 1;
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
background: rgba(0, 0, 0, 0.5);
|
|
325
325
|
cursor: pointer;
|
|
326
326
|
opacity: 0;
|
|
327
|
-
transition: opacity 0.1s cubic-bezier(0, 0, 1, 1);
|
|
327
|
+
transition: opacity 0.1s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
328
328
|
}
|
|
329
329
|
.sd-upload-list-picture-operation {
|
|
330
330
|
display: none;
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
margin: 0;
|
|
381
381
|
overflow: hidden;
|
|
382
382
|
opacity: 0;
|
|
383
|
-
transition: opacity 0.1s cubic-bezier(0, 0, 1, 1), height 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s, margin 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s;
|
|
383
|
+
transition: opacity 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), height 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s, margin 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
.sd-upload-list-item.sd-upload-slide-inline-enter {
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
}
|
|
389
389
|
.sd-upload-list-item.sd-upload-slide-inline-enter-active {
|
|
390
390
|
opacity: 1;
|
|
391
|
-
transition: opacity 0.2s cubic-bezier(0, 0, 1, 1);
|
|
391
|
+
transition: opacity 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
|
|
392
392
|
}
|
|
393
393
|
.sd-upload-list-item.sd-upload-slide-inline-exit {
|
|
394
394
|
opacity: 1;
|
|
@@ -397,5 +397,5 @@
|
|
|
397
397
|
margin: 0;
|
|
398
398
|
overflow: hidden;
|
|
399
399
|
opacity: 0;
|
|
400
|
-
transition: opacity 0.1s cubic-bezier(0, 0, 1, 1), width 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s, margin 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s;
|
|
400
|
+
transition: opacity 0.1s cubic-bezier(0.34, 0.69, 0.1, 1), width 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s, margin 0.3s cubic-bezier(0.34, 0.69, 0.1, 1) 0.1s;
|
|
401
401
|
}
|
|
@@ -35,7 +35,10 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
35
35
|
background: $upload-picture-color-bg;
|
|
36
36
|
border: $upload-picture-border-width $upload-picture-border-style $upload-picture-color-border;
|
|
37
37
|
border-radius: $upload-picture-border-radius;
|
|
38
|
-
transition:
|
|
38
|
+
transition:
|
|
39
|
+
color theme.$transition-duration-1 theme.$transition-timing-function-standard,
|
|
40
|
+
background-color theme.$transition-duration-1 theme.$transition-timing-function-standard,
|
|
41
|
+
border-color theme.$transition-duration-1 theme.$transition-timing-function-standard;
|
|
39
42
|
|
|
40
43
|
&:hover {
|
|
41
44
|
color: $upload-picture-color-text_hover;
|
|
@@ -52,7 +55,10 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
52
55
|
background-color: $upload-drag-color-bg;
|
|
53
56
|
border: $upload-drag-border-width $upload-drag-border-style $upload-drag-color-border;
|
|
54
57
|
border-radius: $upload-drag-border-radius;
|
|
55
|
-
transition:
|
|
58
|
+
transition:
|
|
59
|
+
color theme.$transition-duration-2 ease,
|
|
60
|
+
background-color theme.$transition-duration-2 ease,
|
|
61
|
+
border-color theme.$transition-duration-2 ease;
|
|
56
62
|
|
|
57
63
|
.#{theme.$prefix}-icon-plus {
|
|
58
64
|
margin-bottom: $upload-drag-margin-icon-bottom;
|
|
@@ -175,7 +181,7 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
175
181
|
color: $upload-text-item-color-reupload-icon;
|
|
176
182
|
font-size: $upload-text-item-size-reupload-icon;
|
|
177
183
|
cursor: pointer;
|
|
178
|
-
transition:
|
|
184
|
+
transition: color theme.$transition-duration-2 ease;
|
|
179
185
|
|
|
180
186
|
&:active,
|
|
181
187
|
&:hover {
|
|
@@ -225,7 +231,7 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
225
231
|
background-color: $upload-text-item-color-bg;
|
|
226
232
|
border-radius: $upload-text-item-border-radius;
|
|
227
233
|
transition: background-color theme.$transition-duration-1
|
|
228
|
-
theme.$transition-timing-function-
|
|
234
|
+
theme.$transition-timing-function-standard;
|
|
229
235
|
}
|
|
230
236
|
|
|
231
237
|
&-file-icon {
|
|
@@ -348,7 +354,7 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
348
354
|
padding-right: 0;
|
|
349
355
|
overflow: hidden;
|
|
350
356
|
vertical-align: top;
|
|
351
|
-
transition:
|
|
357
|
+
transition: opacity theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
352
358
|
}
|
|
353
359
|
|
|
354
360
|
&-picture-status-error &-picture-mask {
|
|
@@ -381,7 +387,7 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
381
387
|
background: $upload-picture-item-color-operation_bg;
|
|
382
388
|
cursor: pointer;
|
|
383
389
|
opacity: 0;
|
|
384
|
-
transition: opacity theme.$transition-duration-1 theme.$transition-timing-function-
|
|
390
|
+
transition: opacity theme.$transition-duration-1 theme.$transition-timing-function-standard;
|
|
385
391
|
}
|
|
386
392
|
|
|
387
393
|
&-operation {
|
|
@@ -468,7 +474,7 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
468
474
|
overflow: hidden;
|
|
469
475
|
opacity: 0;
|
|
470
476
|
transition:
|
|
471
|
-
opacity theme.$transition-duration-1 theme.$transition-timing-function-
|
|
477
|
+
opacity theme.$transition-duration-1 theme.$transition-timing-function-standard,
|
|
472
478
|
height theme.$transition-duration-3 theme.$transition-timing-function-standard
|
|
473
479
|
theme.$transition-duration-1,
|
|
474
480
|
margin theme.$transition-duration-3 theme.$transition-timing-function-standard
|
|
@@ -482,7 +488,7 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
482
488
|
|
|
483
489
|
&.#{$upload-prefix-cls}-slide-inline-enter-active {
|
|
484
490
|
opacity: 1;
|
|
485
|
-
transition: opacity theme.$transition-duration-2 theme.$transition-timing-function-
|
|
491
|
+
transition: opacity theme.$transition-duration-2 theme.$transition-timing-function-standard;
|
|
486
492
|
}
|
|
487
493
|
|
|
488
494
|
&.#{$upload-prefix-cls}-slide-inline-exit {
|
|
@@ -494,7 +500,7 @@ $upload-prefix-cls: string.unquote('#{theme.$prefix}-upload');
|
|
|
494
500
|
overflow: hidden;
|
|
495
501
|
opacity: 0;
|
|
496
502
|
transition:
|
|
497
|
-
opacity theme.$transition-duration-1 theme.$transition-timing-function-
|
|
503
|
+
opacity theme.$transition-duration-1 theme.$transition-timing-function-standard,
|
|
498
504
|
width theme.$transition-duration-3 theme.$transition-timing-function-standard
|
|
499
505
|
theme.$transition-duration-1,
|
|
500
506
|
margin theme.$transition-duration-3 theme.$transition-timing-function-standard
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
2
2
|
import { isFunction, isPromise } from "../_utils/is.js";
|
|
3
|
-
import Button from "../button/index.js";
|
|
4
3
|
import { useI18n } from "../locale/index.js";
|
|
4
|
+
import Button from "../button/index.js";
|
|
5
5
|
import IconPlus from "../icon/icon-plus/index.js";
|
|
6
6
|
import IconUpload from "../icon/icon-upload/index.js";
|
|
7
7
|
import { getFiles, loopDirectory } from "./utils.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
2
2
|
import icon_hover_default from "../_components/icon-hover.js";
|
|
3
|
+
import { isActivationKey } from "../_utils/keyboard.js";
|
|
3
4
|
import IconExclamationCircleFill from "../icon/icon-exclamation-circle-fill/index.js";
|
|
4
5
|
import { useI18n } from "../locale/index.js";
|
|
5
6
|
import Tooltip from "../tooltip/index.js";
|
|
@@ -93,13 +94,25 @@ var upload_list_item_default = /* @__PURE__ */ defineComponent({
|
|
|
93
94
|
"listType": props.listType
|
|
94
95
|
}, null)
|
|
95
96
|
]),
|
|
96
|
-
(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRemoveButton) && createVNode("span", { "class": `${itemCls}-operation` }, [createVNode(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRemoveButton) && createVNode("span", { "class": `${itemCls}-operation` }, [createVNode("span", {
|
|
98
|
+
"role": "button",
|
|
99
|
+
"tabindex": "0",
|
|
100
|
+
"aria-label": "Remove",
|
|
101
|
+
"onClick": () => {
|
|
102
|
+
var _uploadCtx$onRemove;
|
|
103
|
+
return uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$onRemove = uploadCtx.onRemove) === null || _uploadCtx$onRemove === void 0 ? void 0 : _uploadCtx$onRemove.call(uploadCtx, props.file);
|
|
104
|
+
},
|
|
105
|
+
"onKeydown": (e) => {
|
|
106
|
+
if (isActivationKey(e)) {
|
|
107
|
+
var _uploadCtx$onRemove2;
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$onRemove2 = uploadCtx.onRemove) === null || _uploadCtx$onRemove2 === void 0 || _uploadCtx$onRemove2.call(uploadCtx, props.file);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}, [createVNode(icon_hover_default, null, { default: () => {
|
|
100
113
|
var _ref5, _uploadCtx$slots$remo, _uploadCtx$slots6, _uploadCtx$slots6$rem, _uploadCtx$customIcon9, _uploadCtx$customIcon10;
|
|
101
114
|
return [createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-remove`] }, [(_ref5 = (_uploadCtx$slots$remo = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots6$rem = (_uploadCtx$slots6 = uploadCtx.slots)["remove-icon"]) === null || _uploadCtx$slots6$rem === void 0 ? void 0 : _uploadCtx$slots6$rem.call(_uploadCtx$slots6)) !== null && _uploadCtx$slots$remo !== void 0 ? _uploadCtx$slots$remo : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon9 = uploadCtx.customIcon) === null || _uploadCtx$customIcon9 === void 0 || (_uploadCtx$customIcon10 = _uploadCtx$customIcon9.removeIcon) === null || _uploadCtx$customIcon10 === void 0 ? void 0 : _uploadCtx$customIcon10.call(_uploadCtx$customIcon9)) !== null && _ref5 !== void 0 ? _ref5 : createVNode(IconDelete, null, null)])];
|
|
102
|
-
} })]),
|
|
115
|
+
} })])]),
|
|
103
116
|
uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots7$ext = (_uploadCtx$slots7 = uploadCtx.slots)["extra-button"]) === null || _uploadCtx$slots7$ext === void 0 ? void 0 : _uploadCtx$slots7$ext.call(_uploadCtx$slots7, { fileItem: props.file })
|
|
104
117
|
]);
|
|
105
118
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
2
|
+
import { isActivationKey } from "../_utils/keyboard.js";
|
|
2
3
|
import IconEye from "../icon/icon-eye/index.js";
|
|
3
4
|
import IconImageClose from "../icon/icon-image-close/index.js";
|
|
4
5
|
import IconDelete from "../icon/icon-delete/index.js";
|
|
@@ -23,6 +24,12 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
23
24
|
const itemCls = `${getPrefixCls("upload-list")}-picture`;
|
|
24
25
|
const cls = computed(() => [itemCls, { [`${itemCls}-status-error`]: props.file.status === "error" }]);
|
|
25
26
|
const uploadCtx = inject(uploadInjectionKey, void 0);
|
|
27
|
+
const onActionKeydown = (fn) => (e) => {
|
|
28
|
+
if (fn && isActivationKey(e)) {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
fn();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
26
33
|
const renderCard = () => {
|
|
27
34
|
var _uploadCtx$slots$imag, _uploadCtx$slots, _uploadCtx$slots$imag2, _ref, _uploadCtx$slots$erro, _uploadCtx$slots2, _uploadCtx$slots2$err, _uploadCtx$customIcon, _uploadCtx$customIcon2, _ref2, _uploadCtx$slots$prev, _uploadCtx$slots3, _uploadCtx$slots3$pre, _uploadCtx$customIcon3, _uploadCtx$customIcon4, _ref3, _uploadCtx$slots$retr, _uploadCtx$slots4, _uploadCtx$slots4$ret, _uploadCtx$customIcon5, _uploadCtx$customIcon6, _ref4, _uploadCtx$slots$remo, _uploadCtx$slots5, _uploadCtx$slots5$rem, _uploadCtx$customIcon7, _uploadCtx$customIcon8, _uploadCtx$slots6, _uploadCtx$slots6$ext;
|
|
28
35
|
if (props.file.status === "uploading") return createVNode(upload_progress_default, {
|
|
@@ -35,15 +42,30 @@ var upload_picture_item_default = /* @__PURE__ */ defineComponent({
|
|
|
35
42
|
}, (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.imageLoading) ? { loading: uploadCtx.imageLoading } : void 0), null), createVNode("div", { "class": `${itemCls}-mask` }, [props.file.status === "error" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showCancelButton) && createVNode("div", { "class": `${itemCls}-error-tip` }, [createVNode("span", { "class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-error`] }, [(_ref = (_uploadCtx$slots$erro = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots2$err = (_uploadCtx$slots2 = uploadCtx.slots)["error-icon"]) === null || _uploadCtx$slots2$err === void 0 ? void 0 : _uploadCtx$slots2$err.call(_uploadCtx$slots2)) !== null && _uploadCtx$slots$erro !== void 0 ? _uploadCtx$slots$erro : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon = uploadCtx.customIcon) === null || _uploadCtx$customIcon === void 0 || (_uploadCtx$customIcon2 = _uploadCtx$customIcon.errorIcon) === null || _uploadCtx$customIcon2 === void 0 ? void 0 : _uploadCtx$customIcon2.call(_uploadCtx$customIcon)) !== null && _ref !== void 0 ? _ref : createVNode(IconImageClose, null, null)])]), createVNode("div", { "class": `${itemCls}-operation` }, [
|
|
36
43
|
props.file.status !== "error" && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showPreviewButton) && createVNode("span", {
|
|
37
44
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-preview`],
|
|
38
|
-
"
|
|
45
|
+
"role": "button",
|
|
46
|
+
"tabindex": "0",
|
|
47
|
+
"aria-label": "Preview",
|
|
48
|
+
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onPreview(props.file),
|
|
49
|
+
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onPreview(props.file))
|
|
39
50
|
}, [(_ref2 = (_uploadCtx$slots$prev = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots3$pre = (_uploadCtx$slots3 = uploadCtx.slots)["preview-icon"]) === null || _uploadCtx$slots3$pre === void 0 ? void 0 : _uploadCtx$slots3$pre.call(_uploadCtx$slots3)) !== null && _uploadCtx$slots$prev !== void 0 ? _uploadCtx$slots$prev : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon3 = uploadCtx.customIcon) === null || _uploadCtx$customIcon3 === void 0 || (_uploadCtx$customIcon4 = _uploadCtx$customIcon3.previewIcon) === null || _uploadCtx$customIcon4 === void 0 ? void 0 : _uploadCtx$customIcon4.call(_uploadCtx$customIcon3)) !== null && _ref2 !== void 0 ? _ref2 : createVNode(IconEye, null, null)]),
|
|
40
51
|
["init", "error"].includes(props.file.status) && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRetryButton) && createVNode("span", {
|
|
41
52
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-upload`],
|
|
42
|
-
"
|
|
53
|
+
"role": "button",
|
|
54
|
+
"tabindex": "0",
|
|
55
|
+
"aria-label": "Retry upload",
|
|
56
|
+
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file),
|
|
57
|
+
"onKeydown": onActionKeydown(() => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onUpload(props.file))
|
|
43
58
|
}, [(_ref3 = (_uploadCtx$slots$retr = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots4$ret = (_uploadCtx$slots4 = uploadCtx.slots)["retry-icon"]) === null || _uploadCtx$slots4$ret === void 0 ? void 0 : _uploadCtx$slots4$ret.call(_uploadCtx$slots4)) !== null && _uploadCtx$slots$retr !== void 0 ? _uploadCtx$slots$retr : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon5 = uploadCtx.customIcon) === null || _uploadCtx$customIcon5 === void 0 || (_uploadCtx$customIcon6 = _uploadCtx$customIcon5.retryIcon) === null || _uploadCtx$customIcon6 === void 0 ? void 0 : _uploadCtx$customIcon6.call(_uploadCtx$customIcon5)) !== null && _ref3 !== void 0 ? _ref3 : createVNode(IconUpload, null, null)]),
|
|
44
59
|
!(uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.disabled) && (uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.showRemoveButton) && createVNode("span", {
|
|
45
60
|
"class": [uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls, `${uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.iconCls}-remove`],
|
|
46
|
-
"
|
|
61
|
+
"role": "button",
|
|
62
|
+
"tabindex": "0",
|
|
63
|
+
"aria-label": "Remove",
|
|
64
|
+
"onClick": () => uploadCtx === null || uploadCtx === void 0 ? void 0 : uploadCtx.onRemove(props.file),
|
|
65
|
+
"onKeydown": onActionKeydown(() => {
|
|
66
|
+
var _uploadCtx$onRemove;
|
|
67
|
+
return uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$onRemove = uploadCtx.onRemove) === null || _uploadCtx$onRemove === void 0 ? void 0 : _uploadCtx$onRemove.call(uploadCtx, props.file);
|
|
68
|
+
})
|
|
47
69
|
}, [(_ref4 = (_uploadCtx$slots$remo = uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots5$rem = (_uploadCtx$slots5 = uploadCtx.slots)["remove-icon"]) === null || _uploadCtx$slots5$rem === void 0 ? void 0 : _uploadCtx$slots5$rem.call(_uploadCtx$slots5)) !== null && _uploadCtx$slots$remo !== void 0 ? _uploadCtx$slots$remo : uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$customIcon7 = uploadCtx.customIcon) === null || _uploadCtx$customIcon7 === void 0 || (_uploadCtx$customIcon8 = _uploadCtx$customIcon7.removeIcon) === null || _uploadCtx$customIcon8 === void 0 ? void 0 : _uploadCtx$customIcon8.call(_uploadCtx$customIcon7)) !== null && _ref4 !== void 0 ? _ref4 : createVNode(IconDelete, null, null)]),
|
|
48
70
|
uploadCtx === null || uploadCtx === void 0 || (_uploadCtx$slots6$ext = (_uploadCtx$slots6 = uploadCtx.slots)["extra-button"]) === null || _uploadCtx$slots6$ext === void 0 ? void 0 : _uploadCtx$slots6$ext.call(_uploadCtx$slots6, props.file)
|
|
49
71
|
])])]);
|
|
@@ -17,7 +17,10 @@ declare const VerificationCode: {
|
|
|
17
17
|
};
|
|
18
18
|
disabled: BooleanConstructor;
|
|
19
19
|
masked: BooleanConstructor;
|
|
20
|
-
readonly:
|
|
20
|
+
readonly: {
|
|
21
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
21
24
|
error: {
|
|
22
25
|
type: BooleanConstructor;
|
|
23
26
|
default: boolean;
|
|
@@ -41,7 +44,7 @@ declare const VerificationCode: {
|
|
|
41
44
|
}, import("vue").PublicProps, {
|
|
42
45
|
length: number;
|
|
43
46
|
error: boolean;
|
|
44
|
-
readonly: boolean;
|
|
47
|
+
readonly: string | boolean;
|
|
45
48
|
disabled: boolean;
|
|
46
49
|
defaultValue: string;
|
|
47
50
|
masked: boolean;
|
|
@@ -67,7 +70,10 @@ declare const VerificationCode: {
|
|
|
67
70
|
};
|
|
68
71
|
disabled: BooleanConstructor;
|
|
69
72
|
masked: BooleanConstructor;
|
|
70
|
-
readonly:
|
|
73
|
+
readonly: {
|
|
74
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
71
77
|
error: {
|
|
72
78
|
type: BooleanConstructor;
|
|
73
79
|
default: boolean;
|
|
@@ -86,7 +92,7 @@ declare const VerificationCode: {
|
|
|
86
92
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
87
93
|
length: number;
|
|
88
94
|
error: boolean;
|
|
89
|
-
readonly: boolean;
|
|
95
|
+
readonly: string | boolean;
|
|
90
96
|
disabled: boolean;
|
|
91
97
|
defaultValue: string;
|
|
92
98
|
masked: boolean;
|
|
@@ -109,7 +115,10 @@ declare const VerificationCode: {
|
|
|
109
115
|
};
|
|
110
116
|
disabled: BooleanConstructor;
|
|
111
117
|
masked: BooleanConstructor;
|
|
112
|
-
readonly:
|
|
118
|
+
readonly: {
|
|
119
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
120
|
+
default: boolean;
|
|
121
|
+
};
|
|
113
122
|
error: {
|
|
114
123
|
type: BooleanConstructor;
|
|
115
124
|
default: boolean;
|
|
@@ -133,7 +142,7 @@ declare const VerificationCode: {
|
|
|
133
142
|
}, string, {
|
|
134
143
|
length: number;
|
|
135
144
|
error: boolean;
|
|
136
|
-
readonly: boolean;
|
|
145
|
+
readonly: string | boolean;
|
|
137
146
|
disabled: boolean;
|
|
138
147
|
defaultValue: string;
|
|
139
148
|
masked: boolean;
|
|
@@ -15,7 +15,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
15
15
|
};
|
|
16
16
|
disabled: BooleanConstructor;
|
|
17
17
|
masked: BooleanConstructor;
|
|
18
|
-
readonly:
|
|
18
|
+
readonly: {
|
|
19
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
19
22
|
error: {
|
|
20
23
|
type: BooleanConstructor;
|
|
21
24
|
default: boolean;
|
|
@@ -46,7 +49,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
46
49
|
};
|
|
47
50
|
disabled: BooleanConstructor;
|
|
48
51
|
masked: BooleanConstructor;
|
|
49
|
-
readonly:
|
|
52
|
+
readonly: {
|
|
53
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
50
56
|
error: {
|
|
51
57
|
type: BooleanConstructor;
|
|
52
58
|
default: boolean;
|
|
@@ -65,7 +71,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
65
71
|
}>, {
|
|
66
72
|
length: number;
|
|
67
73
|
error: boolean;
|
|
68
|
-
readonly: boolean;
|
|
74
|
+
readonly: string | boolean;
|
|
69
75
|
disabled: boolean;
|
|
70
76
|
defaultValue: string;
|
|
71
77
|
masked: boolean;
|