@element-plus/nightly 0.0.20241103 → 0.0.20241105
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/index.full.js +235 -149
- package/dist/index.full.min.js +12 -12
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +12 -12
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +235 -149
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/date-picker/src/composables/use-basic-date-table.d.ts +12 -12
- package/es/components/date-picker/src/composables/use-range-picker.d.ts +6 -6
- package/es/components/index.mjs +1 -1
- package/es/components/mention/src/mention-dropdown.mjs +167 -15
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +15 -167
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/message/index.mjs +1 -1
- package/es/components/message/src/message.mjs +91 -147
- package/es/components/message/src/message.mjs.map +1 -1
- package/es/components/message/src/message2.mjs +147 -91
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/message/src/method.mjs +2 -2
- package/es/components/scrollbar/src/bar.mjs +64 -11
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +11 -64
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/select/src/select.vue.d.ts +0 -1
- package/es/components/select/src/useSelect.d.ts +0 -1
- package/es/components/select/src/useSelect.mjs +7 -5
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.mjs +1 -1
- package/es/components/time-picker/src/common/picker.mjs.map +1 -1
- package/es/components/time-picker/src/composables/use-time-picker.d.ts +12 -12
- package/es/index.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/date-picker/src/composables/use-basic-date-table.d.ts +12 -12
- package/lib/components/date-picker/src/composables/use-range-picker.d.ts +6 -6
- package/lib/components/index.js +1 -1
- package/lib/components/mention/src/mention-dropdown.js +167 -16
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +16 -167
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/message/index.js +1 -1
- package/lib/components/message/src/message.js +93 -146
- package/lib/components/message/src/message.js.map +1 -1
- package/lib/components/message/src/message2.js +146 -93
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/message/src/method.js +2 -2
- package/lib/components/scrollbar/src/bar.js +64 -11
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +11 -64
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/select/src/select.vue.d.ts +0 -1
- package/lib/components/select/src/useSelect.d.ts +0 -1
- package/lib/components/select/src/useSelect.js +7 -5
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.js +1 -1
- package/lib/components/time-picker/src/common/picker.js.map +1 -1
- package/lib/components/time-picker/src/composables/use-time-picker.d.ts +12 -12
- package/lib/index.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/theme-chalk/src/mixins/mixins.scss +4 -1
- package/web-types.json +1 -1
|
@@ -1,98 +1,154 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, onMounted, watch, openBlock, createBlock, Transition, unref, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode, resolveDynamicComponent, renderSlot, createElementBlock, toDisplayString, Fragment, withModifiers, createVNode, vShow } from 'vue';
|
|
2
|
+
import { useTimeoutFn, useEventListener, useResizeObserver } from '@vueuse/core';
|
|
1
3
|
import '../../../utils/index.mjs';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import '../../../constants/index.mjs';
|
|
5
|
+
import { ElBadge } from '../../badge/index.mjs';
|
|
6
|
+
import '../../config-provider/index.mjs';
|
|
7
|
+
import { ElIcon } from '../../icon/index.mjs';
|
|
8
|
+
import { messageProps, messageEmits } from './message.mjs';
|
|
9
|
+
import { getLastOffset, getOffsetOrSpace } from './instance.mjs';
|
|
10
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
11
|
+
import { TypeComponents, TypeComponentsMap } from '../../../utils/vue/icon.mjs';
|
|
12
|
+
import { useGlobalComponentSettings } from '../../config-provider/src/hooks/use-global-config.mjs';
|
|
13
|
+
import { EVENT_CODE } from '../../../constants/aria.mjs';
|
|
6
14
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
customClass: "",
|
|
10
|
-
center: false,
|
|
11
|
-
dangerouslyUseHTMLString: false,
|
|
12
|
-
duration: 3e3,
|
|
13
|
-
icon: void 0,
|
|
14
|
-
id: "",
|
|
15
|
-
message: "",
|
|
16
|
-
onClose: void 0,
|
|
17
|
-
showClose: false,
|
|
18
|
-
type: "info",
|
|
19
|
-
plain: false,
|
|
20
|
-
offset: 16,
|
|
21
|
-
zIndex: 0,
|
|
22
|
-
grouping: false,
|
|
23
|
-
repeatNum: 1,
|
|
24
|
-
appendTo: isClient ? document.body : void 0
|
|
15
|
+
const __default__ = defineComponent({
|
|
16
|
+
name: "ElMessage"
|
|
25
17
|
});
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
type
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
18
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
|
+
...__default__,
|
|
20
|
+
props: messageProps,
|
|
21
|
+
emits: messageEmits,
|
|
22
|
+
setup(__props, { expose }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const { Close } = TypeComponents;
|
|
25
|
+
const { ns, zIndex } = useGlobalComponentSettings("message");
|
|
26
|
+
const { currentZIndex, nextZIndex } = zIndex;
|
|
27
|
+
const messageRef = ref();
|
|
28
|
+
const visible = ref(false);
|
|
29
|
+
const height = ref(0);
|
|
30
|
+
let stopTimer = void 0;
|
|
31
|
+
const badgeType = computed(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
|
|
32
|
+
const typeClass = computed(() => {
|
|
33
|
+
const type = props.type;
|
|
34
|
+
return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
|
|
35
|
+
});
|
|
36
|
+
const iconComponent = computed(() => props.icon || TypeComponentsMap[props.type] || "");
|
|
37
|
+
const lastOffset = computed(() => getLastOffset(props.id));
|
|
38
|
+
const offset = computed(() => getOffsetOrSpace(props.id, props.offset) + lastOffset.value);
|
|
39
|
+
const bottom = computed(() => height.value + offset.value);
|
|
40
|
+
const customStyle = computed(() => ({
|
|
41
|
+
top: `${offset.value}px`,
|
|
42
|
+
zIndex: currentZIndex.value
|
|
43
|
+
}));
|
|
44
|
+
function startTimer() {
|
|
45
|
+
if (props.duration === 0)
|
|
46
|
+
return;
|
|
47
|
+
({ stop: stopTimer } = useTimeoutFn(() => {
|
|
48
|
+
close();
|
|
49
|
+
}, props.duration));
|
|
50
|
+
}
|
|
51
|
+
function clearTimer() {
|
|
52
|
+
stopTimer == null ? void 0 : stopTimer();
|
|
53
|
+
}
|
|
54
|
+
function close() {
|
|
55
|
+
visible.value = false;
|
|
56
|
+
}
|
|
57
|
+
function keydown({ code }) {
|
|
58
|
+
if (code === EVENT_CODE.esc) {
|
|
59
|
+
close();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
onMounted(() => {
|
|
63
|
+
startTimer();
|
|
64
|
+
nextZIndex();
|
|
65
|
+
visible.value = true;
|
|
66
|
+
});
|
|
67
|
+
watch(() => props.repeatNum, () => {
|
|
68
|
+
clearTimer();
|
|
69
|
+
startTimer();
|
|
70
|
+
});
|
|
71
|
+
useEventListener(document, "keydown", keydown);
|
|
72
|
+
useResizeObserver(messageRef, () => {
|
|
73
|
+
height.value = messageRef.value.getBoundingClientRect().height;
|
|
74
|
+
});
|
|
75
|
+
expose({
|
|
76
|
+
visible,
|
|
77
|
+
bottom,
|
|
78
|
+
close
|
|
79
|
+
});
|
|
80
|
+
return (_ctx, _cache) => {
|
|
81
|
+
return openBlock(), createBlock(Transition, {
|
|
82
|
+
name: unref(ns).b("fade"),
|
|
83
|
+
onBeforeLeave: _ctx.onClose,
|
|
84
|
+
onAfterLeave: ($event) => _ctx.$emit("destroy"),
|
|
85
|
+
persisted: ""
|
|
86
|
+
}, {
|
|
87
|
+
default: withCtx(() => [
|
|
88
|
+
withDirectives(createElementVNode("div", {
|
|
89
|
+
id: _ctx.id,
|
|
90
|
+
ref_key: "messageRef",
|
|
91
|
+
ref: messageRef,
|
|
92
|
+
class: normalizeClass([
|
|
93
|
+
unref(ns).b(),
|
|
94
|
+
{ [unref(ns).m(_ctx.type)]: _ctx.type },
|
|
95
|
+
unref(ns).is("center", _ctx.center),
|
|
96
|
+
unref(ns).is("closable", _ctx.showClose),
|
|
97
|
+
unref(ns).is("plain", _ctx.plain),
|
|
98
|
+
_ctx.customClass
|
|
99
|
+
]),
|
|
100
|
+
style: normalizeStyle(unref(customStyle)),
|
|
101
|
+
role: "alert",
|
|
102
|
+
onMouseenter: clearTimer,
|
|
103
|
+
onMouseleave: startTimer
|
|
104
|
+
}, [
|
|
105
|
+
_ctx.repeatNum > 1 ? (openBlock(), createBlock(unref(ElBadge), {
|
|
106
|
+
key: 0,
|
|
107
|
+
value: _ctx.repeatNum,
|
|
108
|
+
type: unref(badgeType),
|
|
109
|
+
class: normalizeClass(unref(ns).e("badge"))
|
|
110
|
+
}, null, 8, ["value", "type", "class"])) : createCommentVNode("v-if", true),
|
|
111
|
+
unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
112
|
+
key: 1,
|
|
113
|
+
class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
|
|
114
|
+
}, {
|
|
115
|
+
default: withCtx(() => [
|
|
116
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
|
|
117
|
+
]),
|
|
118
|
+
_: 1
|
|
119
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
120
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
121
|
+
!_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", {
|
|
122
|
+
key: 0,
|
|
123
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
124
|
+
}, toDisplayString(_ctx.message), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
125
|
+
createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
|
|
126
|
+
createElementVNode("p", {
|
|
127
|
+
class: normalizeClass(unref(ns).e("content")),
|
|
128
|
+
innerHTML: _ctx.message
|
|
129
|
+
}, null, 10, ["innerHTML"])
|
|
130
|
+
], 2112))
|
|
131
|
+
]),
|
|
132
|
+
_ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
|
|
133
|
+
key: 2,
|
|
134
|
+
class: normalizeClass(unref(ns).e("closeBtn")),
|
|
135
|
+
onClick: withModifiers(close, ["stop"])
|
|
136
|
+
}, {
|
|
137
|
+
default: withCtx(() => [
|
|
138
|
+
createVNode(unref(Close))
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
|
|
142
|
+
], 46, ["id"]), [
|
|
143
|
+
[vShow, visible.value]
|
|
144
|
+
])
|
|
145
|
+
]),
|
|
146
|
+
_: 3
|
|
147
|
+
}, 8, ["name", "onBeforeLeave", "onAfterLeave"]);
|
|
148
|
+
};
|
|
91
149
|
}
|
|
92
150
|
});
|
|
93
|
-
|
|
94
|
-
destroy: () => true
|
|
95
|
-
};
|
|
151
|
+
var MessageConstructor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "message.vue"]]);
|
|
96
152
|
|
|
97
|
-
export {
|
|
153
|
+
export { MessageConstructor as default };
|
|
98
154
|
//# sourceMappingURL=message2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message2.mjs","sources":["../../../../../../packages/components/message/src/message.
|
|
1
|
+
{"version":3,"file":"message2.mjs","sources":["../../../../../../packages/components/message/src/message.vue"],"sourcesContent":["<template>\n <transition\n :name=\"ns.b('fade')\"\n @before-leave=\"onClose\"\n @after-leave=\"$emit('destroy')\"\n >\n <div\n v-show=\"visible\"\n :id=\"id\"\n ref=\"messageRef\"\n :class=\"[\n ns.b(),\n { [ns.m(type)]: type },\n ns.is('center', center),\n ns.is('closable', showClose),\n ns.is('plain', plain),\n customClass,\n ]\"\n :style=\"customStyle\"\n role=\"alert\"\n @mouseenter=\"clearTimer\"\n @mouseleave=\"startTimer\"\n >\n <el-badge\n v-if=\"repeatNum > 1\"\n :value=\"repeatNum\"\n :type=\"badgeType\"\n :class=\"ns.e('badge')\"\n />\n <el-icon v-if=\"iconComponent\" :class=\"[ns.e('icon'), typeClass]\">\n <component :is=\"iconComponent\" />\n </el-icon>\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\" :class=\"ns.e('content')\">\n {{ message }}\n </p>\n <!-- Caution here, message could've been compromised, never use user's input as message -->\n <p v-else :class=\"ns.e('content')\" v-html=\"message\" />\n </slot>\n <el-icon v-if=\"showClose\" :class=\"ns.e('closeBtn')\" @click.stop=\"close\">\n <Close />\n </el-icon>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, watch } from 'vue'\nimport { useEventListener, useResizeObserver, useTimeoutFn } from '@vueuse/core'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport ElBadge from '@element-plus/components/badge'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { messageEmits, messageProps } from './message'\nimport { getLastOffset, getOffsetOrSpace } from './instance'\nimport type { BadgeProps } from '@element-plus/components/badge'\nimport type { CSSProperties } from 'vue'\n\nconst { Close } = TypeComponents\n\ndefineOptions({\n name: 'ElMessage',\n})\n\nconst props = defineProps(messageProps)\ndefineEmits(messageEmits)\n\nconst { ns, zIndex } = useGlobalComponentSettings('message')\nconst { currentZIndex, nextZIndex } = zIndex\n\nconst messageRef = ref<HTMLDivElement>()\nconst visible = ref(false)\nconst height = ref(0)\n\nlet stopTimer: (() => void) | undefined = undefined\n\nconst badgeType = computed<BadgeProps['type']>(() =>\n props.type ? (props.type === 'error' ? 'danger' : props.type) : 'info'\n)\nconst typeClass = computed(() => {\n const type = props.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n})\nconst iconComponent = computed(\n () => props.icon || TypeComponentsMap[props.type] || ''\n)\n\nconst lastOffset = computed(() => getLastOffset(props.id))\nconst offset = computed(\n () => getOffsetOrSpace(props.id, props.offset) + lastOffset.value\n)\nconst bottom = computed((): number => height.value + offset.value)\nconst customStyle = computed<CSSProperties>(() => ({\n top: `${offset.value}px`,\n zIndex: currentZIndex.value,\n}))\n\nfunction startTimer() {\n if (props.duration === 0) return\n ;({ stop: stopTimer } = useTimeoutFn(() => {\n close()\n }, props.duration))\n}\n\nfunction clearTimer() {\n stopTimer?.()\n}\n\nfunction close() {\n visible.value = false\n}\n\nfunction keydown({ code }: KeyboardEvent) {\n if (code === EVENT_CODE.esc) {\n // press esc to close the message\n close()\n }\n}\n\nonMounted(() => {\n startTimer()\n nextZIndex()\n visible.value = true\n})\n\nwatch(\n () => props.repeatNum,\n () => {\n clearTimer()\n startTimer()\n }\n)\n\nuseEventListener(document, 'keydown', keydown)\n\nuseResizeObserver(messageRef, () => {\n height.value = messageRef.value!.getBoundingClientRect().height\n})\n\ndefineExpose({\n visible,\n bottom,\n close,\n})\n</script>\n"],"names":["_openBlock","_createBlock","_Transition","_unref","_withCtx"],"mappings":";;;;;;;;;;;;;;mCA6Dc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAJA,IAAM,MAAA,EAAE,OAAU,GAAA,cAAA,CAAA;AASlB,IAAA,MAAM,EAAE,EAAA,EAAI,MAAO,EAAA,GAAI,2BAA2B,SAAS,CAAA,CAAA;AAC3D,IAAM,MAAA,EAAE,aAAe,EAAA,UAAA,EAAe,GAAA,MAAA,CAAA;AAEtC,IAAA,MAAM,aAAa,GAAoB,EAAA,CAAA;AACvC,IAAM,MAAA,OAAA,GAAU,IAAI,KAAK,CAAA,CAAA;AACzB,IAAM,MAAA,MAAA,GAAS,IAAI,CAAC,CAAA,CAAA;AAEpB,IAAA,IAAI,SAAsC,GAAA,KAAA,CAAA,CAAA;AAE1C,IAAA,MAAM,SAAY,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,IAAA,GAAA,KAAA,CAAA,IAAA,KAAA,OAAA,GA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EAAA;AAAA,QACD,OAAA,EAAAC,OAAA,CAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isVNode, render, createVNode } from 'vue';
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
3
|
import '../../config-provider/index.mjs';
|
|
4
|
-
import MessageConstructor from './
|
|
5
|
-
import { messageDefaults, messageTypes } from './
|
|
4
|
+
import MessageConstructor from './message2.mjs';
|
|
5
|
+
import { messageDefaults, messageTypes } from './message.mjs';
|
|
6
6
|
import { instances } from './instance.mjs';
|
|
7
7
|
import { isString, isFunction } from '@vue/shared';
|
|
8
8
|
import { isElement, isBoolean, isNumber } from '../../../utils/types.mjs';
|
|
@@ -1,16 +1,69 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, inject, ref, openBlock, createElementBlock, Fragment, createVNode } from 'vue';
|
|
2
|
+
import { GAP } from './util.mjs';
|
|
3
|
+
import Thumb from './thumb2.mjs';
|
|
4
|
+
import { barProps } from './bar2.mjs';
|
|
5
|
+
import { scrollbarContextKey } from './constants.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
3
7
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "bar",
|
|
10
|
+
props: barProps,
|
|
11
|
+
setup(__props, { expose }) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
const scrollbar = inject(scrollbarContextKey);
|
|
14
|
+
const moveX = ref(0);
|
|
15
|
+
const moveY = ref(0);
|
|
16
|
+
const sizeWidth = ref("");
|
|
17
|
+
const sizeHeight = ref("");
|
|
18
|
+
const ratioY = ref(1);
|
|
19
|
+
const ratioX = ref(1);
|
|
20
|
+
const handleScroll = (wrap) => {
|
|
21
|
+
if (wrap) {
|
|
22
|
+
const offsetHeight = wrap.offsetHeight - GAP;
|
|
23
|
+
const offsetWidth = wrap.offsetWidth - GAP;
|
|
24
|
+
moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
|
|
25
|
+
moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const update = () => {
|
|
29
|
+
const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
|
|
30
|
+
if (!wrap)
|
|
31
|
+
return;
|
|
32
|
+
const offsetHeight = wrap.offsetHeight - GAP;
|
|
33
|
+
const offsetWidth = wrap.offsetWidth - GAP;
|
|
34
|
+
const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
|
|
35
|
+
const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
|
|
36
|
+
const height = Math.max(originalHeight, props.minSize);
|
|
37
|
+
const width = Math.max(originalWidth, props.minSize);
|
|
38
|
+
ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
|
|
39
|
+
ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
|
|
40
|
+
sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
|
|
41
|
+
sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
|
|
42
|
+
};
|
|
43
|
+
expose({
|
|
44
|
+
handleScroll,
|
|
45
|
+
update
|
|
46
|
+
});
|
|
47
|
+
return (_ctx, _cache) => {
|
|
48
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
49
|
+
createVNode(Thumb, {
|
|
50
|
+
move: moveX.value,
|
|
51
|
+
ratio: ratioX.value,
|
|
52
|
+
size: sizeWidth.value,
|
|
53
|
+
always: _ctx.always
|
|
54
|
+
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
55
|
+
createVNode(Thumb, {
|
|
56
|
+
move: moveY.value,
|
|
57
|
+
ratio: ratioY.value,
|
|
58
|
+
size: sizeHeight.value,
|
|
59
|
+
vertical: "",
|
|
60
|
+
always: _ctx.always
|
|
61
|
+
}, null, 8, ["move", "ratio", "size", "always"])
|
|
62
|
+
], 64);
|
|
63
|
+
};
|
|
12
64
|
}
|
|
13
65
|
});
|
|
66
|
+
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "bar.vue"]]);
|
|
14
67
|
|
|
15
|
-
export {
|
|
68
|
+
export { Bar as default };
|
|
16
69
|
//# sourceMappingURL=bar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.
|
|
1
|
+
{"version":3,"file":"bar.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.vue"],"sourcesContent":["<template>\n <thumb :move=\"moveX\" :ratio=\"ratioX\" :size=\"sizeWidth\" :always=\"always\" />\n <thumb\n :move=\"moveY\"\n :ratio=\"ratioY\"\n :size=\"sizeHeight\"\n vertical\n :always=\"always\"\n />\n</template>\n<script lang=\"ts\" setup>\nimport { inject, ref } from 'vue'\nimport { GAP } from './util'\nimport Thumb from './thumb.vue'\nimport { barProps } from './bar'\nimport { scrollbarContextKey } from './constants'\n\nconst props = defineProps(barProps)\n\nconst scrollbar = inject(scrollbarContextKey)\n\nconst moveX = ref(0)\nconst moveY = ref(0)\nconst sizeWidth = ref('')\nconst sizeHeight = ref('')\nconst ratioY = ref(1)\nconst ratioX = ref(1)\n\nconst handleScroll = (wrap: HTMLDivElement) => {\n if (wrap) {\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n moveY.value = ((wrap.scrollTop * 100) / offsetHeight) * ratioY.value\n moveX.value = ((wrap.scrollLeft * 100) / offsetWidth) * ratioX.value\n }\n}\n\nconst update = () => {\n const wrap = scrollbar?.wrapElement\n if (!wrap) return\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap.scrollWidth\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n ratioY.value =\n originalHeight /\n (offsetHeight - originalHeight) /\n (height / (offsetHeight - height))\n ratioX.value =\n originalWidth /\n (offsetWidth - originalWidth) /\n (width / (offsetWidth - width))\n\n sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : ''\n sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : ''\n}\n\ndefineExpose({\n handleScroll,\n update,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;AAmBA,IAAM,MAAA,SAAA,GAAY,OAAO,mBAAmB,CAAA,CAAA;AAE5C,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,KAAA,GAAQ,IAAI,CAAC,CAAA,CAAA;AACnB,IAAM,MAAA,SAAA,GAAY,IAAI,EAAE,CAAA,CAAA;AACxB,IAAM,MAAA,UAAA,GAAa,IAAI,EAAE,CAAA,CAAA;AACzB,IAAM,MAAA,MAAA,GAAS,IAAI,CAAC,CAAA,CAAA;AACpB,IAAM,MAAA,MAAA,GAAS,IAAI,CAAC,CAAA,CAAA;AAEpB,IAAM,MAAA,YAAA,GAAe,CAAC,IAAyB,KAAA;AAC7C,MAAA,IAAI,IAAM,EAAA;AACR,QAAM,MAAA,YAAA,GAAe,KAAK,YAAe,GAAA,GAAA,CAAA;AACzC,QAAM,MAAA,WAAA,GAAc,KAAK,WAAc,GAAA,GAAA,CAAA;AAEvC,QAAA,KAAA,CAAM,KAAU,GAAA,IAAA,CAAK,SAAY,GAAA,GAAA,GAAO,eAAgB,MAAO,CAAA,KAAA,CAAA;AAC/D,QAAA,KAAA,CAAM,KAAU,GAAA,IAAA,CAAK,UAAa,GAAA,GAAA,GAAO,cAAe,MAAO,CAAA,KA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;;;;;;;;;;"}
|
|
@@ -1,69 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import Thumb from './thumb2.mjs';
|
|
4
|
-
import { barProps } from './bar.mjs';
|
|
5
|
-
import { scrollbarContextKey } from './constants.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
7
3
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const sizeWidth = ref("");
|
|
17
|
-
const sizeHeight = ref("");
|
|
18
|
-
const ratioY = ref(1);
|
|
19
|
-
const ratioX = ref(1);
|
|
20
|
-
const handleScroll = (wrap) => {
|
|
21
|
-
if (wrap) {
|
|
22
|
-
const offsetHeight = wrap.offsetHeight - GAP;
|
|
23
|
-
const offsetWidth = wrap.offsetWidth - GAP;
|
|
24
|
-
moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
|
|
25
|
-
moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const update = () => {
|
|
29
|
-
const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
|
|
30
|
-
if (!wrap)
|
|
31
|
-
return;
|
|
32
|
-
const offsetHeight = wrap.offsetHeight - GAP;
|
|
33
|
-
const offsetWidth = wrap.offsetWidth - GAP;
|
|
34
|
-
const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
|
|
35
|
-
const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
|
|
36
|
-
const height = Math.max(originalHeight, props.minSize);
|
|
37
|
-
const width = Math.max(originalWidth, props.minSize);
|
|
38
|
-
ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
|
|
39
|
-
ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
|
|
40
|
-
sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
|
|
41
|
-
sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
|
|
42
|
-
};
|
|
43
|
-
expose({
|
|
44
|
-
handleScroll,
|
|
45
|
-
update
|
|
46
|
-
});
|
|
47
|
-
return (_ctx, _cache) => {
|
|
48
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
49
|
-
createVNode(Thumb, {
|
|
50
|
-
move: moveX.value,
|
|
51
|
-
ratio: ratioX.value,
|
|
52
|
-
size: sizeWidth.value,
|
|
53
|
-
always: _ctx.always
|
|
54
|
-
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
55
|
-
createVNode(Thumb, {
|
|
56
|
-
move: moveY.value,
|
|
57
|
-
ratio: ratioY.value,
|
|
58
|
-
size: sizeHeight.value,
|
|
59
|
-
vertical: "",
|
|
60
|
-
always: _ctx.always
|
|
61
|
-
}, null, 8, ["move", "ratio", "size", "always"])
|
|
62
|
-
], 64);
|
|
63
|
-
};
|
|
4
|
+
const barProps = buildProps({
|
|
5
|
+
always: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: true
|
|
8
|
+
},
|
|
9
|
+
minSize: {
|
|
10
|
+
type: Number,
|
|
11
|
+
required: true
|
|
64
12
|
}
|
|
65
13
|
});
|
|
66
|
-
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "bar.vue"]]);
|
|
67
14
|
|
|
68
|
-
export {
|
|
15
|
+
export { barProps };
|
|
69
16
|
//# sourceMappingURL=bar2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar2.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.
|
|
1
|
+
{"version":3,"file":"bar2.mjs","sources":["../../../../../../packages/components/scrollbar/src/bar.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Bar from './bar.vue'\n\nexport const barProps = buildProps({\n always: {\n type: Boolean,\n default: true,\n },\n minSize: {\n type: Number,\n required: true,\n },\n} as const)\nexport type BarProps = ExtractPropTypes<typeof barProps>\n\nexport type BarInstance = InstanceType<typeof Bar>\n"],"names":[],"mappings":";;;AACY,MAAC,QAAQ,GAAG,UAAU,CAAC;AACnC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import { defineComponent, ref, computed, watch, nextTick, provide, reactive, onA
|
|
|
2
2
|
import { useResizeObserver, useEventListener } from '@vueuse/core';
|
|
3
3
|
import '../../../utils/index.mjs';
|
|
4
4
|
import '../../../hooks/index.mjs';
|
|
5
|
-
import Bar from './
|
|
5
|
+
import Bar from './bar.mjs';
|
|
6
6
|
import { scrollbarContextKey } from './constants.mjs';
|
|
7
7
|
import { scrollbarProps, scrollbarEmits } from './scrollbar.mjs';
|
|
8
8
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
@@ -31,7 +31,6 @@ const useSelect = (props, emit) => {
|
|
|
31
31
|
inputValue: "",
|
|
32
32
|
options: /* @__PURE__ */ new Map(),
|
|
33
33
|
cachedOptions: /* @__PURE__ */ new Map(),
|
|
34
|
-
disabledOptions: /* @__PURE__ */ new Map(),
|
|
35
34
|
optionValues: [],
|
|
36
35
|
selected: [],
|
|
37
36
|
selectionWidth: 0,
|
|
@@ -336,7 +335,10 @@ const useSelect = (props, emit) => {
|
|
|
336
335
|
emit(CHANGE_EVENT, val);
|
|
337
336
|
}
|
|
338
337
|
};
|
|
339
|
-
const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) =>
|
|
338
|
+
const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => {
|
|
339
|
+
const option = states.cachedOptions.get(it);
|
|
340
|
+
return option && !option.disabled && !option.states.groupDisabled;
|
|
341
|
+
});
|
|
340
342
|
const deletePrevTag = (e) => {
|
|
341
343
|
if (!props.multiple)
|
|
342
344
|
return;
|
|
@@ -440,7 +442,6 @@ const useSelect = (props, emit) => {
|
|
|
440
442
|
const onOptionCreate = (vm) => {
|
|
441
443
|
states.options.set(vm.value, vm);
|
|
442
444
|
states.cachedOptions.set(vm.value, vm);
|
|
443
|
-
vm.disabled && states.disabledOptions.set(vm.value, vm);
|
|
444
445
|
};
|
|
445
446
|
const onOptionDestroy = (key, vm) => {
|
|
446
447
|
if (states.options.get(key) === vm) {
|
|
@@ -503,8 +504,9 @@ const useSelect = (props, emit) => {
|
|
|
503
504
|
if (!expanded.value) {
|
|
504
505
|
toggleMenu();
|
|
505
506
|
} else {
|
|
506
|
-
|
|
507
|
-
|
|
507
|
+
const option = optionsArray.value[states.hoveringIndex];
|
|
508
|
+
if (option && !option.disabled && !option.states.groupDisabled) {
|
|
509
|
+
handleOptionSelect(option);
|
|
508
510
|
}
|
|
509
511
|
}
|
|
510
512
|
};
|