@element-plus/nightly 0.0.20240708 → 0.0.20240710
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 +16 -7
- package/dist/index.full.min.js +14 -14
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +14 -14
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +16 -8
- 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 +6 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.js.map +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.min.mjs.map +1 -1
- package/dist/locale/fr.mjs +6 -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/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/config-provider/index.d.ts +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +1 -1
- package/es/components/config-provider/src/hooks/use-global-config.mjs +5 -0
- package/es/components/config-provider/src/hooks/use-global-config.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +149 -67
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +67 -149
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/tree-select/src/tree-select-option.mjs +6 -1
- package/es/components/tree-select/src/tree-select-option.mjs.map +1 -1
- package/es/components/tree-select/src/tree.mjs +2 -1
- package/es/components/tree-select/src/tree.mjs.map +1 -1
- package/es/hooks/index.mjs +1 -1
- package/es/hooks/use-empty-values/index.d.ts +5 -2
- package/es/hooks/use-empty-values/index.mjs +4 -8
- package/es/hooks/use-empty-values/index.mjs.map +1 -1
- package/es/index.mjs +2 -2
- package/es/locale/lang/fr.d.ts +5 -0
- package/es/locale/lang/fr.mjs +5 -0
- package/es/locale/lang/fr.mjs.map +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/config-provider/index.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +1 -1
- package/lib/components/config-provider/src/hooks/use-global-config.js +5 -0
- package/lib/components/config-provider/src/hooks/use-global-config.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +148 -68
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +68 -148
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/tree-select/src/tree-select-option.js +5 -0
- package/lib/components/tree-select/src/tree-select-option.js.map +1 -1
- package/lib/components/tree-select/src/tree.js +2 -1
- package/lib/components/tree-select/src/tree.js.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-empty-values/index.d.ts +5 -2
- package/lib/hooks/use-empty-values/index.js +3 -6
- package/lib/hooks/use-empty-values/index.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/locale/lang/fr.d.ts +5 -0
- package/lib/locale/lang/fr.js +5 -0
- package/lib/locale/lang/fr.js.map +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 +2 -2
- package/web-types.json +1 -1
|
@@ -1,154 +1,72 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, onMounted, openBlock, createBlock, Transition, unref, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, resolveDynamicComponent, createCommentVNode, toDisplayString, renderSlot, createElementBlock, Fragment, vShow, withModifiers, createVNode } from 'vue';
|
|
2
|
-
import { useTimeoutFn, useEventListener } from '@vueuse/core';
|
|
3
1
|
import '../../../utils/index.mjs';
|
|
4
|
-
import '../../../
|
|
5
|
-
import {
|
|
6
|
-
import '../../config-provider/index.mjs';
|
|
7
|
-
import { notificationProps, notificationEmits } from './notification.mjs';
|
|
8
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
-
import { useGlobalComponentSettings } from '../../config-provider/src/hooks/use-global-config.mjs';
|
|
10
|
-
import { CloseComponents, TypeComponentsMap } from '../../../utils/vue/icon.mjs';
|
|
11
|
-
import { EVENT_CODE } from '../../../constants/aria.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
12
4
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
const notificationTypes = [
|
|
6
|
+
"success",
|
|
7
|
+
"info",
|
|
8
|
+
"warning",
|
|
9
|
+
"error"
|
|
10
|
+
];
|
|
11
|
+
const notificationProps = buildProps({
|
|
12
|
+
customClass: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
dangerouslyUseHTMLString: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
duration: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 4500
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
type: iconPropType
|
|
26
|
+
},
|
|
27
|
+
id: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
message: {
|
|
32
|
+
type: definePropType([String, Object]),
|
|
33
|
+
default: ""
|
|
34
|
+
},
|
|
35
|
+
offset: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0
|
|
38
|
+
},
|
|
39
|
+
onClick: {
|
|
40
|
+
type: definePropType(Function),
|
|
41
|
+
default: () => void 0
|
|
42
|
+
},
|
|
43
|
+
onClose: {
|
|
44
|
+
type: definePropType(Function),
|
|
45
|
+
required: true
|
|
46
|
+
},
|
|
47
|
+
position: {
|
|
48
|
+
type: String,
|
|
49
|
+
values: ["top-right", "top-left", "bottom-right", "bottom-left"],
|
|
50
|
+
default: "top-right"
|
|
51
|
+
},
|
|
52
|
+
showClose: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
title: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
type: {
|
|
61
|
+
type: String,
|
|
62
|
+
values: [...notificationTypes, ""],
|
|
63
|
+
default: ""
|
|
64
|
+
},
|
|
65
|
+
zIndex: Number
|
|
19
66
|
});
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
emits: notificationEmits,
|
|
24
|
-
setup(__props, { expose }) {
|
|
25
|
-
const props = __props;
|
|
26
|
-
const { ns, zIndex } = useGlobalComponentSettings("notification");
|
|
27
|
-
const { nextZIndex, currentZIndex } = zIndex;
|
|
28
|
-
const { Close } = CloseComponents;
|
|
29
|
-
const visible = ref(false);
|
|
30
|
-
let timer = void 0;
|
|
31
|
-
const typeClass = computed(() => {
|
|
32
|
-
const type = props.type;
|
|
33
|
-
return type && TypeComponentsMap[props.type] ? ns.m(type) : "";
|
|
34
|
-
});
|
|
35
|
-
const iconComponent = computed(() => {
|
|
36
|
-
if (!props.type)
|
|
37
|
-
return props.icon;
|
|
38
|
-
return TypeComponentsMap[props.type] || props.icon;
|
|
39
|
-
});
|
|
40
|
-
const horizontalClass = computed(() => props.position.endsWith("right") ? "right" : "left");
|
|
41
|
-
const verticalProperty = computed(() => props.position.startsWith("top") ? "top" : "bottom");
|
|
42
|
-
const positionStyle = computed(() => {
|
|
43
|
-
var _a;
|
|
44
|
-
return {
|
|
45
|
-
[verticalProperty.value]: `${props.offset}px`,
|
|
46
|
-
zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
function startTimer() {
|
|
50
|
-
if (props.duration > 0) {
|
|
51
|
-
;
|
|
52
|
-
({ stop: timer } = useTimeoutFn(() => {
|
|
53
|
-
if (visible.value)
|
|
54
|
-
close();
|
|
55
|
-
}, props.duration));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function clearTimer() {
|
|
59
|
-
timer == null ? void 0 : timer();
|
|
60
|
-
}
|
|
61
|
-
function close() {
|
|
62
|
-
visible.value = false;
|
|
63
|
-
}
|
|
64
|
-
function onKeydown({ code }) {
|
|
65
|
-
if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {
|
|
66
|
-
clearTimer();
|
|
67
|
-
} else if (code === EVENT_CODE.esc) {
|
|
68
|
-
if (visible.value) {
|
|
69
|
-
close();
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
startTimer();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
onMounted(() => {
|
|
76
|
-
startTimer();
|
|
77
|
-
nextZIndex();
|
|
78
|
-
visible.value = true;
|
|
79
|
-
});
|
|
80
|
-
useEventListener(document, "keydown", onKeydown);
|
|
81
|
-
expose({
|
|
82
|
-
visible,
|
|
83
|
-
close
|
|
84
|
-
});
|
|
85
|
-
return (_ctx, _cache) => {
|
|
86
|
-
return openBlock(), createBlock(Transition, {
|
|
87
|
-
name: unref(ns).b("fade"),
|
|
88
|
-
onBeforeLeave: _ctx.onClose,
|
|
89
|
-
onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
|
|
90
|
-
persisted: ""
|
|
91
|
-
}, {
|
|
92
|
-
default: withCtx(() => [
|
|
93
|
-
withDirectives(createElementVNode("div", {
|
|
94
|
-
id: _ctx.id,
|
|
95
|
-
class: normalizeClass([unref(ns).b(), _ctx.customClass, unref(horizontalClass)]),
|
|
96
|
-
style: normalizeStyle(unref(positionStyle)),
|
|
97
|
-
role: "alert",
|
|
98
|
-
onMouseenter: clearTimer,
|
|
99
|
-
onMouseleave: startTimer,
|
|
100
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
101
|
-
}, [
|
|
102
|
-
unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
103
|
-
key: 0,
|
|
104
|
-
class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
|
|
105
|
-
}, {
|
|
106
|
-
default: withCtx(() => [
|
|
107
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
|
|
108
|
-
]),
|
|
109
|
-
_: 1
|
|
110
|
-
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
111
|
-
createElementVNode("div", {
|
|
112
|
-
class: normalizeClass(unref(ns).e("group"))
|
|
113
|
-
}, [
|
|
114
|
-
createElementVNode("h2", {
|
|
115
|
-
class: normalizeClass(unref(ns).e("title")),
|
|
116
|
-
textContent: toDisplayString(_ctx.title)
|
|
117
|
-
}, null, 10, _hoisted_2),
|
|
118
|
-
withDirectives(createElementVNode("div", {
|
|
119
|
-
class: normalizeClass(unref(ns).e("content")),
|
|
120
|
-
style: normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
|
|
121
|
-
}, [
|
|
122
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
123
|
-
!_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.message), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
124
|
-
createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
|
|
125
|
-
createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
|
|
126
|
-
], 2112))
|
|
127
|
-
])
|
|
128
|
-
], 6), [
|
|
129
|
-
[vShow, _ctx.message]
|
|
130
|
-
]),
|
|
131
|
-
_ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
|
|
132
|
-
key: 0,
|
|
133
|
-
class: normalizeClass(unref(ns).e("closeBtn")),
|
|
134
|
-
onClick: withModifiers(close, ["stop"])
|
|
135
|
-
}, {
|
|
136
|
-
default: withCtx(() => [
|
|
137
|
-
createVNode(unref(Close))
|
|
138
|
-
]),
|
|
139
|
-
_: 1
|
|
140
|
-
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
|
|
141
|
-
], 2)
|
|
142
|
-
], 46, _hoisted_1), [
|
|
143
|
-
[vShow, visible.value]
|
|
144
|
-
])
|
|
145
|
-
]),
|
|
146
|
-
_: 3
|
|
147
|
-
}, 8, ["name", "onBeforeLeave"]);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
var NotificationConstructor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "notification.vue"]]);
|
|
67
|
+
const notificationEmits = {
|
|
68
|
+
destroy: () => true
|
|
69
|
+
};
|
|
152
70
|
|
|
153
|
-
export {
|
|
71
|
+
export { notificationEmits, notificationProps, notificationTypes };
|
|
154
72
|
//# sourceMappingURL=notification2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification2.mjs","sources":["../../../../../../packages/components/notification/src/notification.
|
|
1
|
+
{"version":3,"file":"notification2.mjs","sources":["../../../../../../packages/components/notification/src/notification.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, VNode } from 'vue'\nimport type Notification from './notification.vue'\n\nexport const notificationTypes = [\n 'success',\n 'info',\n 'warning',\n 'error',\n] as const\n\nexport const notificationProps = buildProps({\n /**\n * @description custom class name for Notification\n */\n customClass: {\n type: String,\n default: '',\n },\n /**\n * @description whether `message` is treated as HTML string\n */\n dangerouslyUseHTMLString: {\n type: Boolean,\n default: false,\n },\n /**\n * @description duration before close. It will not automatically close if set 0\n */\n duration: {\n type: Number,\n default: 4500,\n },\n /**\n * @description custom icon component. It will be overridden by `type`\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description notification dom id\n */\n id: {\n type: String,\n default: '',\n },\n /**\n * @description description text\n */\n message: {\n type: definePropType<string | VNode>([String, Object]),\n default: '',\n },\n /**\n * @description offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset\n */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description callback function when notification clicked\n */\n onClick: {\n type: definePropType<() => void>(Function),\n default: () => undefined,\n },\n /**\n * @description callback function when closed\n */\n onClose: {\n type: definePropType<() => void>(Function),\n required: true,\n },\n /**\n * @description custom position\n */\n position: {\n type: String,\n values: ['top-right', 'top-left', 'bottom-right', 'bottom-left'],\n default: 'top-right',\n },\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n /**\n * @description title\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description notification type\n */\n type: {\n type: String,\n values: [...notificationTypes, ''],\n default: '',\n },\n /**\n * @description initial zIndex\n */\n zIndex: Number,\n} as const)\nexport type NotificationProps = ExtractPropTypes<typeof notificationProps>\n\nexport const notificationEmits = {\n destroy: () => true,\n}\nexport type NotificationEmits = typeof notificationEmits\n\nexport type NotificationInstance = InstanceType<typeof Notification>\n\nexport type NotificationOptions = Omit<NotificationProps, 'id'> & {\n /**\n * @description set the root element for the notification, default to `document.body`\n */\n appendTo?: HTMLElement | string\n}\nexport type NotificationOptionsTyped = Omit<NotificationOptions, 'type'>\n\nexport interface NotificationHandle {\n close: () => void\n}\n\nexport type NotificationParams = Partial<NotificationOptions> | string | VNode\nexport type NotificationParamsTyped =\n | Partial<NotificationOptionsTyped>\n | string\n | VNode\n\nexport type NotifyFn = ((\n options?: NotificationParams\n) => NotificationHandle) & { closeAll: () => void }\n\nexport type NotifyTypedFn = (\n options?: NotificationParamsTyped\n) => NotificationHandle\n\nexport interface Notify extends NotifyFn {\n success: NotifyTypedFn\n warning: NotifyTypedFn\n error: NotifyTypedFn\n info: NotifyTypedFn\n}\n\nexport interface NotificationQueueItem {\n vm: VNode\n}\n\nexport type NotificationQueue = NotificationQueueItem[]\n"],"names":[],"mappings":";;;;AACY,MAAC,iBAAiB,GAAG;AACjC,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,SAAS;AACX,EAAE,OAAO;AACT,EAAE;AACU,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,wBAAwB,EAAE;AAC5B,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AA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MAAC,iBAAiB,GAAG;AACjC,EAAE,OAAO,EAAE,MAAM,IAAI;AACrB;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isVNode, createVNode, render } from 'vue';
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
|
-
import NotificationConstructor from './
|
|
4
|
-
import { notificationTypes } from './
|
|
3
|
+
import NotificationConstructor from './notification.mjs';
|
|
4
|
+
import { notificationTypes } from './notification2.mjs';
|
|
5
5
|
import { isClient } from '@vueuse/core';
|
|
6
6
|
import { isElement } from '../../../utils/types.mjs';
|
|
7
7
|
import { isString } from '@vue/shared';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, getCurrentInstance, nextTick } from 'vue';
|
|
1
|
+
import { defineComponent, getCurrentInstance, nextTick, watch } from 'vue';
|
|
2
2
|
import { ElOption } from '../../select/index.mjs';
|
|
3
3
|
|
|
4
4
|
const component = defineComponent({
|
|
@@ -12,6 +12,11 @@ const component = defineComponent({
|
|
|
12
12
|
result.select.onOptionCreate(vm);
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
+
watch(() => ctx.attrs.visible, (val) => {
|
|
16
|
+
result.states.visible = val;
|
|
17
|
+
}, {
|
|
18
|
+
immediate: true
|
|
19
|
+
});
|
|
15
20
|
return result;
|
|
16
21
|
},
|
|
17
22
|
methods: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-select-option.mjs","sources":["../../../../../../packages/components/tree-select/src/tree-select-option.ts"],"sourcesContent":["import { defineComponent, getCurrentInstance, nextTick } from 'vue'\nimport { ElOption } from '@element-plus/components/select'\n\nconst component = defineComponent({\n extends: ElOption,\n setup(props, ctx) {\n const result = (ElOption.setup as NonNullable<any>)(props, ctx)\n\n // use methods.selectOptionClick\n delete result.selectOptionClick\n\n const vm = (getCurrentInstance() as NonNullable<any>).proxy\n\n // Fix: https://github.com/element-plus/element-plus/issues/7917\n // `el-option` will delete the cache before unmount,\n // This is normal for flat arrays `<el-select><el-option v-for=\"3\"></el-select>`,\n // Because the same node key does not create a difference node,\n // But in tree data, the same key at different levels will create diff nodes,\n // So the destruction of `el-option` in `nextTick` will be slower than\n // the creation of new `el-option`, which will delete the new node,\n // here restore the deleted node.\n // @link https://github.com/element-plus/element-plus/blob/6df6e49db07b38d6cc3b5e9a960782bd30879c11/packages/components/select/src/option.vue#L78\n nextTick(() => {\n if (!result.select.states.cachedOptions.get(vm.value)) {\n result.select.onOptionCreate(vm)\n }\n })\n\n return result\n },\n methods: {\n selectOptionClick() {\n // $el.parentElement => el-tree-node__content\n this.$el.parentElement.click()\n },\n },\n})\n\nexport default component\n"],"names":[],"mappings":";;;AAEK,MAAC,SAAS,GAAG,eAAe,CAAC;AAClC,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE;AACpB,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC9C,IAAI,OAAO,MAAM,CAAC,iBAAiB,CAAC;AACpC,IAAI,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAAC,KAAK,CAAC;AAC1C,IAAI,QAAQ,CAAC,MAAM;AACnB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;AAC7D,QAAQ,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO;AACP,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,iBAAiB,GAAG;AACxB,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACrC,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"tree-select-option.mjs","sources":["../../../../../../packages/components/tree-select/src/tree-select-option.ts"],"sourcesContent":["import { defineComponent, getCurrentInstance, nextTick, watch } from 'vue'\nimport { ElOption } from '@element-plus/components/select'\n\nconst component = defineComponent({\n extends: ElOption,\n setup(props, ctx) {\n const result = (ElOption.setup as NonNullable<any>)(props, ctx)\n\n // use methods.selectOptionClick\n delete result.selectOptionClick\n\n const vm = (getCurrentInstance() as NonNullable<any>).proxy\n\n // Fix: https://github.com/element-plus/element-plus/issues/7917\n // `el-option` will delete the cache before unmount,\n // This is normal for flat arrays `<el-select><el-option v-for=\"3\"></el-select>`,\n // Because the same node key does not create a difference node,\n // But in tree data, the same key at different levels will create diff nodes,\n // So the destruction of `el-option` in `nextTick` will be slower than\n // the creation of new `el-option`, which will delete the new node,\n // here restore the deleted node.\n // @link https://github.com/element-plus/element-plus/blob/6df6e49db07b38d6cc3b5e9a960782bd30879c11/packages/components/select/src/option.vue#L78\n nextTick(() => {\n if (!result.select.states.cachedOptions.get(vm.value)) {\n result.select.onOptionCreate(vm)\n }\n })\n\n watch(\n () => ctx.attrs.visible,\n (val) => {\n result.states.visible = val\n },\n {\n immediate: true,\n }\n )\n\n return result\n },\n methods: {\n selectOptionClick() {\n // $el.parentElement => el-tree-node__content\n this.$el.parentElement.click()\n },\n },\n})\n\nexport default component\n"],"names":[],"mappings":";;;AAEK,MAAC,SAAS,GAAG,eAAe,CAAC;AAClC,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE;AACpB,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC9C,IAAI,OAAO,MAAM,CAAC,iBAAiB,CAAC;AACpC,IAAI,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAAC,KAAK,CAAC;AAC1C,IAAI,QAAQ,CAAC,MAAM;AACnB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;AAC7D,QAAQ,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO;AACP,KAAK,CAAC,CAAC;AACP,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK;AAC5C,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;AAClC,KAAK,EAAE;AACP,MAAM,SAAS,EAAE,IAAI;AACrB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,iBAAiB,GAAG;AACxB,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACrC,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
|
|
@@ -75,7 +75,8 @@ const useTree = (props, { attrs, slots, emit }, {
|
|
|
75
75
|
return h(component, {
|
|
76
76
|
value: getNodeValByProp("value", data),
|
|
77
77
|
label: getNodeValByProp("label", data),
|
|
78
|
-
disabled: getNodeValByProp("disabled", data)
|
|
78
|
+
disabled: getNodeValByProp("disabled", data),
|
|
79
|
+
visible: node.visible
|
|
79
80
|
}, props.renderContent ? () => props.renderContent(h, { node, data, store }) : slots.default ? () => slots.default({ node, data, store }) : void 0);
|
|
80
81
|
},
|
|
81
82
|
filterNodeMethod: (value, data, node) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.mjs","sources":["../../../../../../packages/components/tree-select/src/tree.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, nextTick, toRefs, watch } from 'vue'\nimport { isEqual, pick } from 'lodash-unified'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { escapeStringRegexp, isFunction } from '@element-plus/utils'\nimport ElTree from '@element-plus/components/tree'\nimport TreeSelectOption from './tree-select-option'\nimport {\n isValidArray,\n isValidValue,\n toValidArray,\n treeEach,\n treeFind,\n} from './utils'\nimport type { CacheOption } from './cache-options'\nimport type { Ref } from 'vue'\nimport type ElSelect from '@element-plus/components/select'\nimport type Node from '@element-plus/components/tree/src/model/node'\nimport type { TreeNodeData } from '@element-plus/components/tree/src/tree.type'\nimport type { TreeInstance } from '@element-plus/components/tree'\n\nexport const useTree = (\n props,\n { attrs, slots, emit },\n {\n select,\n tree,\n key,\n }: {\n select: Ref<InstanceType<typeof ElSelect> | undefined>\n tree: Ref<TreeInstance | undefined>\n key: Ref<string>\n }\n) => {\n watch(\n () => props.modelValue,\n () => {\n if (props.showCheckbox) {\n nextTick(() => {\n const treeInstance = tree.value\n if (\n treeInstance &&\n !isEqual(\n treeInstance.getCheckedKeys(),\n toValidArray(props.modelValue)\n )\n ) {\n treeInstance.setCheckedKeys(toValidArray(props.modelValue))\n }\n })\n }\n },\n {\n immediate: true,\n deep: true,\n }\n )\n\n const propsMap = computed(() => ({\n value: key.value,\n label: 'label',\n children: 'children',\n disabled: 'disabled',\n isLeaf: 'isLeaf',\n ...props.props,\n }))\n\n const getNodeValByProp = (\n prop: 'value' | 'label' | 'children' | 'disabled' | 'isLeaf',\n data: TreeNodeData\n ) => {\n const propVal = propsMap.value[prop]\n if (isFunction(propVal)) {\n return propVal(\n data,\n tree.value?.getNode(getNodeValByProp('value', data)) as Node\n )\n } else {\n return data[propVal as string]\n }\n }\n\n const defaultExpandedParentKeys = toValidArray(props.modelValue)\n .map((value) => {\n return treeFind(\n props.data || [],\n (data) => getNodeValByProp('value', data) === value,\n (data) => getNodeValByProp('children', data),\n (data, index, array, parent) =>\n parent && getNodeValByProp('value', parent)\n )\n })\n .filter((item) => isValidValue(item))\n\n const cacheOptions = computed(() => {\n if (!props.renderAfterExpand && !props.lazy) return []\n\n const options: CacheOption[] = []\n\n treeEach(\n props.data.concat(props.cacheData),\n (node) => {\n const value = getNodeValByProp('value', node)\n options.push({\n value,\n currentLabel: getNodeValByProp('label', node),\n isDisabled: getNodeValByProp('disabled', node),\n })\n },\n (data) => getNodeValByProp('children', data)\n )\n\n return options\n })\n\n return {\n ...pick(toRefs(props), Object.keys(ElTree.props)),\n ...attrs,\n nodeKey: key,\n\n // only expand on click node when the `check-strictly` is false\n expandOnClickNode: computed(() => {\n return !props.checkStrictly && props.expandOnClickNode\n }),\n\n // show current selected node only first time,\n // fix the problem of expanding multiple nodes when checking multiple nodes\n defaultExpandedKeys: computed(() => {\n return props.defaultExpandedKeys\n ? props.defaultExpandedKeys.concat(defaultExpandedParentKeys)\n : defaultExpandedParentKeys\n }),\n\n renderContent: (h, { node, data, store }) => {\n return h(\n TreeSelectOption,\n {\n value: getNodeValByProp('value', data),\n label: getNodeValByProp('label', data),\n disabled: getNodeValByProp('disabled', data),\n },\n props.renderContent\n ? () => props.renderContent(h, { node, data, store })\n : slots.default\n ? () => slots.default({ node, data, store })\n : undefined\n )\n },\n filterNodeMethod: (value, data, node) => {\n if (props.filterNodeMethod)\n return props.filterNodeMethod(value, data, node)\n if (!value) return true\n const regexp = new RegExp(escapeStringRegexp(value), 'i')\n return regexp.test(getNodeValByProp('label', data) || '')\n },\n onNodeClick: (data, node, e) => {\n attrs.onNodeClick?.(data, node, e)\n\n // `onCheck` is trigger when `checkOnClickNode`\n if (props.showCheckbox && props.checkOnClickNode) return\n\n // now `checkOnClickNode` is false, only no checkbox and `checkStrictly` or `isLeaf`\n if (!props.showCheckbox && (props.checkStrictly || node.isLeaf)) {\n if (!getNodeValByProp('disabled', data)) {\n const option = select.value?.states.options.get(\n getNodeValByProp('value', data)\n )\n select.value?.handleOptionSelect(option)\n }\n } else if (props.expandOnClickNode) {\n e.proxy.handleExpandIconClick()\n }\n select.value?.focus()\n },\n onCheck: (data, params) => {\n // ignore when no checkbox, like only `checkOnClickNode` is true\n if (!props.showCheckbox) return\n\n const dataValue = getNodeValByProp('value', data)\n const dataMap = {}\n treeEach(\n [tree.value.store.root],\n (node) => (dataMap[node.key] = node),\n (node) => node.childNodes\n )\n\n // fix: checkedKeys has not cached keys\n const uncachedCheckedKeys = params.checkedKeys\n const cachedKeys = props.multiple\n ? toValidArray(props.modelValue).filter(\n (item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)\n )\n : []\n const checkedKeys = cachedKeys.concat(uncachedCheckedKeys)\n\n if (props.checkStrictly) {\n emit(\n UPDATE_MODEL_EVENT,\n // Checking for changes may come from `check-on-node-click`\n props.multiple\n ? checkedKeys\n : checkedKeys.includes(dataValue)\n ? dataValue\n : undefined\n )\n }\n // only can select leaf node\n else {\n if (props.multiple) {\n emit(\n UPDATE_MODEL_EVENT,\n cachedKeys.concat((tree.value as TreeInstance).getCheckedKeys(true))\n )\n } else {\n // select first leaf node when check parent\n const firstLeaf = treeFind(\n [data],\n (data) =>\n !isValidArray(getNodeValByProp('children', data)) &&\n !getNodeValByProp('disabled', data),\n (data) => getNodeValByProp('children', data)\n )\n const firstLeafKey = firstLeaf\n ? getNodeValByProp('value', firstLeaf)\n : undefined\n\n // unselect when any child checked\n const hasCheckedChild =\n isValidValue(props.modelValue) &&\n !!treeFind(\n [data],\n (data) => getNodeValByProp('value', data) === props.modelValue,\n (data) => getNodeValByProp('children', data)\n )\n\n emit(\n UPDATE_MODEL_EVENT,\n firstLeafKey === props.modelValue || hasCheckedChild\n ? undefined\n : firstLeafKey\n )\n }\n }\n\n nextTick(() => {\n const checkedKeys = toValidArray(props.modelValue)\n tree.value.setCheckedKeys(checkedKeys)\n\n attrs.onCheck?.(data, {\n checkedKeys: tree.value.getCheckedKeys(),\n checkedNodes: tree.value.getCheckedNodes(),\n halfCheckedKeys: tree.value.getHalfCheckedKeys(),\n halfCheckedNodes: tree.value.getHalfCheckedNodes(),\n })\n })\n\n select.value?.focus()\n },\n\n // else\n cacheOptions,\n }\n}\n"],"names":["ElTree","TreeSelectOption"],"mappings":";;;;;;;;;;;AAaY,MAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAA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,SAAS;AACT,OAAO;AACP,MAAM,QAAQ,CAAC,MAAM;AACrB,QAAQ,IAAI,GAAG,CAAC;AAChB,QAAQ,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAC5D,QAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAChD,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE;AACvE,UAAU,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;AAClD,UAAU,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;AACpD,UAAU,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE;AAC1D,UAAU,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE;AAC5D,SAAS,CAAC,CAAC;AACX,OAAO,CAAC,CAAC;AACT,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;AACxD,KAAK;AACL,IAAI,YAAY;AAChB,GAAG,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"tree.mjs","sources":["../../../../../../packages/components/tree-select/src/tree.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, nextTick, toRefs, watch } from 'vue'\nimport { isEqual, pick } from 'lodash-unified'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { escapeStringRegexp, isFunction } from '@element-plus/utils'\nimport ElTree from '@element-plus/components/tree'\nimport TreeSelectOption from './tree-select-option'\nimport {\n isValidArray,\n isValidValue,\n toValidArray,\n treeEach,\n treeFind,\n} from './utils'\nimport type { CacheOption } from './cache-options'\nimport type { Ref } from 'vue'\nimport type ElSelect from '@element-plus/components/select'\nimport type Node from '@element-plus/components/tree/src/model/node'\nimport type { TreeNodeData } from '@element-plus/components/tree/src/tree.type'\nimport type { TreeInstance } from '@element-plus/components/tree'\n\nexport const useTree = (\n props,\n { attrs, slots, emit },\n {\n select,\n tree,\n key,\n }: {\n select: Ref<InstanceType<typeof ElSelect> | undefined>\n tree: Ref<TreeInstance | undefined>\n key: Ref<string>\n }\n) => {\n watch(\n () => props.modelValue,\n () => {\n if (props.showCheckbox) {\n nextTick(() => {\n const treeInstance = tree.value\n if (\n treeInstance &&\n !isEqual(\n treeInstance.getCheckedKeys(),\n toValidArray(props.modelValue)\n )\n ) {\n treeInstance.setCheckedKeys(toValidArray(props.modelValue))\n }\n })\n }\n },\n {\n immediate: true,\n deep: true,\n }\n )\n\n const propsMap = computed(() => ({\n value: key.value,\n label: 'label',\n children: 'children',\n disabled: 'disabled',\n isLeaf: 'isLeaf',\n ...props.props,\n }))\n\n const getNodeValByProp = (\n prop: 'value' | 'label' | 'children' | 'disabled' | 'isLeaf',\n data: TreeNodeData\n ) => {\n const propVal = propsMap.value[prop]\n if (isFunction(propVal)) {\n return propVal(\n data,\n tree.value?.getNode(getNodeValByProp('value', data)) as Node\n )\n } else {\n return data[propVal as string]\n }\n }\n\n const defaultExpandedParentKeys = toValidArray(props.modelValue)\n .map((value) => {\n return treeFind(\n props.data || [],\n (data) => getNodeValByProp('value', data) === value,\n (data) => getNodeValByProp('children', data),\n (data, index, array, parent) =>\n parent && getNodeValByProp('value', parent)\n )\n })\n .filter((item) => isValidValue(item))\n\n const cacheOptions = computed(() => {\n if (!props.renderAfterExpand && !props.lazy) return []\n\n const options: CacheOption[] = []\n\n treeEach(\n props.data.concat(props.cacheData),\n (node) => {\n const value = getNodeValByProp('value', node)\n options.push({\n value,\n currentLabel: getNodeValByProp('label', node),\n isDisabled: getNodeValByProp('disabled', node),\n })\n },\n (data) => getNodeValByProp('children', data)\n )\n\n return options\n })\n\n return {\n ...pick(toRefs(props), Object.keys(ElTree.props)),\n ...attrs,\n nodeKey: key,\n\n // only expand on click node when the `check-strictly` is false\n expandOnClickNode: computed(() => {\n return !props.checkStrictly && props.expandOnClickNode\n }),\n\n // show current selected node only first time,\n // fix the problem of expanding multiple nodes when checking multiple nodes\n defaultExpandedKeys: computed(() => {\n return props.defaultExpandedKeys\n ? props.defaultExpandedKeys.concat(defaultExpandedParentKeys)\n : defaultExpandedParentKeys\n }),\n\n renderContent: (h, { node, data, store }) => {\n return h(\n TreeSelectOption,\n {\n value: getNodeValByProp('value', data),\n label: getNodeValByProp('label', data),\n disabled: getNodeValByProp('disabled', data),\n visible: node.visible,\n },\n props.renderContent\n ? () => props.renderContent(h, { node, data, store })\n : slots.default\n ? () => slots.default({ node, data, store })\n : undefined\n )\n },\n filterNodeMethod: (value, data, node) => {\n if (props.filterNodeMethod)\n return props.filterNodeMethod(value, data, node)\n if (!value) return true\n const regexp = new RegExp(escapeStringRegexp(value), 'i')\n return regexp.test(getNodeValByProp('label', data) || '')\n },\n onNodeClick: (data, node, e) => {\n attrs.onNodeClick?.(data, node, e)\n\n // `onCheck` is trigger when `checkOnClickNode`\n if (props.showCheckbox && props.checkOnClickNode) return\n\n // now `checkOnClickNode` is false, only no checkbox and `checkStrictly` or `isLeaf`\n if (!props.showCheckbox && (props.checkStrictly || node.isLeaf)) {\n if (!getNodeValByProp('disabled', data)) {\n const option = select.value?.states.options.get(\n getNodeValByProp('value', data)\n )\n select.value?.handleOptionSelect(option)\n }\n } else if (props.expandOnClickNode) {\n e.proxy.handleExpandIconClick()\n }\n select.value?.focus()\n },\n onCheck: (data, params) => {\n // ignore when no checkbox, like only `checkOnClickNode` is true\n if (!props.showCheckbox) return\n\n const dataValue = getNodeValByProp('value', data)\n const dataMap = {}\n treeEach(\n [tree.value.store.root],\n (node) => (dataMap[node.key] = node),\n (node) => node.childNodes\n )\n\n // fix: checkedKeys has not cached keys\n const uncachedCheckedKeys = params.checkedKeys\n const cachedKeys = props.multiple\n ? toValidArray(props.modelValue).filter(\n (item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)\n )\n : []\n const checkedKeys = cachedKeys.concat(uncachedCheckedKeys)\n\n if (props.checkStrictly) {\n emit(\n UPDATE_MODEL_EVENT,\n // Checking for changes may come from `check-on-node-click`\n props.multiple\n ? checkedKeys\n : checkedKeys.includes(dataValue)\n ? dataValue\n : undefined\n )\n }\n // only can select leaf node\n else {\n if (props.multiple) {\n emit(\n UPDATE_MODEL_EVENT,\n cachedKeys.concat((tree.value as TreeInstance).getCheckedKeys(true))\n )\n } else {\n // select first leaf node when check parent\n const firstLeaf = treeFind(\n [data],\n (data) =>\n !isValidArray(getNodeValByProp('children', data)) &&\n !getNodeValByProp('disabled', data),\n (data) => getNodeValByProp('children', data)\n )\n const firstLeafKey = firstLeaf\n ? getNodeValByProp('value', firstLeaf)\n : undefined\n\n // unselect when any child checked\n const hasCheckedChild =\n isValidValue(props.modelValue) &&\n !!treeFind(\n [data],\n (data) => getNodeValByProp('value', data) === props.modelValue,\n (data) => getNodeValByProp('children', data)\n )\n\n emit(\n UPDATE_MODEL_EVENT,\n firstLeafKey === props.modelValue || hasCheckedChild\n ? undefined\n : firstLeafKey\n )\n }\n }\n\n nextTick(() => {\n const checkedKeys = toValidArray(props.modelValue)\n tree.value.setCheckedKeys(checkedKeys)\n\n attrs.onCheck?.(data, {\n checkedKeys: tree.value.getCheckedKeys(),\n checkedNodes: tree.value.getCheckedNodes(),\n halfCheckedKeys: tree.value.getHalfCheckedKeys(),\n halfCheckedNodes: tree.value.getHalfCheckedNodes(),\n })\n })\n\n select.value?.focus()\n },\n\n // else\n cacheOptions,\n }\n}\n"],"names":["ElTree","TreeSelectOption"],"mappings":";;;;;;;;;;;AAaY,MAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;AACvD,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,GAAG;AACL,CAAC,KAAK;AACN,EAAE,KAAK,CAAC,MAAM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QAAQ,IAAI,GAAG,CAAC;AAChB,QAAQ,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAC5D,QAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAChD,QAAQ,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE;AACvE,UAAU,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;AAClD,UAAU,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;AACpD,UAAU,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE;AAC1D,UAAU,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE;AAC5D,SAAS,CAAC,CAAC;AACX,OAAO,CAAC,CAAC;AACT,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;AACxD,KAAK;AACL,IAAI,YAAY;AAChB,GAAG,CAAC;AACJ;;;;"}
|
package/es/hooks/index.mjs
CHANGED
|
@@ -27,6 +27,6 @@ export { useCursor } from './use-cursor/index.mjs';
|
|
|
27
27
|
export { useOrderedChildren } from './use-ordered-children/index.mjs';
|
|
28
28
|
export { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps } from './use-size/index.mjs';
|
|
29
29
|
export { useFocusController } from './use-focus-controller/index.mjs';
|
|
30
|
-
export { DEFAULT_EMPTY_VALUES, DEFAULT_VALUE_ON_CLEAR, SCOPE, useEmptyValues, useEmptyValuesProps } from './use-empty-values/index.mjs';
|
|
30
|
+
export { DEFAULT_EMPTY_VALUES, DEFAULT_VALUE_ON_CLEAR, SCOPE, emptyValuesContextKey, useEmptyValues, useEmptyValuesProps } from './use-empty-values/index.mjs';
|
|
31
31
|
export { ariaProps, useAriaProps } from './use-aria/index.mjs';
|
|
32
32
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ExtractPropTypes } from 'vue';
|
|
1
|
+
import type { ExtractPropTypes, InjectionKey, Ref } from 'vue';
|
|
2
|
+
declare type EmptyValuesContext = ExtractPropTypes<typeof useEmptyValuesProps>;
|
|
3
|
+
export declare const emptyValuesContextKey: InjectionKey<Ref<EmptyValuesContext>>;
|
|
2
4
|
export declare const SCOPE = "use-empty-values";
|
|
3
5
|
export declare const DEFAULT_EMPTY_VALUES: (string | null | undefined)[];
|
|
4
6
|
export declare const DEFAULT_VALUE_ON_CLEAR: undefined;
|
|
@@ -6,8 +8,9 @@ export declare const useEmptyValuesProps: {
|
|
|
6
8
|
readonly emptyValues: ArrayConstructor;
|
|
7
9
|
readonly valueOnClear: import("@element-plus/nightly/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor, FunctionConstructor], unknown, unknown, undefined, boolean>;
|
|
8
10
|
};
|
|
9
|
-
export declare const useEmptyValues: (props:
|
|
11
|
+
export declare const useEmptyValues: (props: EmptyValuesContext, defaultValue?: null | undefined) => {
|
|
10
12
|
emptyValues: import("vue").ComputedRef<unknown[]>;
|
|
11
13
|
valueOnClear: import("vue").ComputedRef<any>;
|
|
12
14
|
isEmptyValue: (value: any) => boolean;
|
|
13
15
|
};
|
|
16
|
+
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ref, computed } from 'vue';
|
|
2
|
-
import '../../components/config-provider/index.mjs';
|
|
1
|
+
import { getCurrentInstance, inject, ref, computed } from 'vue';
|
|
3
2
|
import '../../utils/index.mjs';
|
|
4
3
|
import { buildProps } from '../../utils/vue/props/runtime.mjs';
|
|
5
4
|
import { isFunction } from '@vue/shared';
|
|
6
|
-
import { useGlobalConfig } from '../../components/config-provider/src/hooks/use-global-config.mjs';
|
|
7
5
|
import { debugWarn } from '../../utils/error.mjs';
|
|
8
6
|
|
|
7
|
+
const emptyValuesContextKey = Symbol("emptyValuesContextKey");
|
|
9
8
|
const SCOPE = "use-empty-values";
|
|
10
9
|
const DEFAULT_EMPTY_VALUES = ["", void 0, null];
|
|
11
10
|
const DEFAULT_VALUE_ON_CLEAR = void 0;
|
|
@@ -18,10 +17,7 @@ const useEmptyValuesProps = buildProps({
|
|
|
18
17
|
}
|
|
19
18
|
});
|
|
20
19
|
const useEmptyValues = (props, defaultValue) => {
|
|
21
|
-
|
|
22
|
-
if (!config.value) {
|
|
23
|
-
config = ref({});
|
|
24
|
-
}
|
|
20
|
+
const config = getCurrentInstance() ? inject(emptyValuesContextKey, ref({})) : ref({});
|
|
25
21
|
const emptyValues = computed(() => props.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES);
|
|
26
22
|
const valueOnClear = computed(() => {
|
|
27
23
|
if (isFunction(props.valueOnClear)) {
|
|
@@ -48,5 +44,5 @@ const useEmptyValues = (props, defaultValue) => {
|
|
|
48
44
|
};
|
|
49
45
|
};
|
|
50
46
|
|
|
51
|
-
export { DEFAULT_EMPTY_VALUES, DEFAULT_VALUE_ON_CLEAR, SCOPE, useEmptyValues, useEmptyValuesProps };
|
|
47
|
+
export { DEFAULT_EMPTY_VALUES, DEFAULT_VALUE_ON_CLEAR, SCOPE, emptyValuesContextKey, useEmptyValues, useEmptyValuesProps };
|
|
52
48
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-empty-values/index.ts"],"sourcesContent":["import { computed, ref } from 'vue'\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-empty-values/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, ref } from 'vue'\nimport { buildProps, debugWarn, isFunction } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, InjectionKey, Ref } from 'vue'\n\ntype EmptyValuesContext = ExtractPropTypes<typeof useEmptyValuesProps>\n\nexport const emptyValuesContextKey: InjectionKey<Ref<EmptyValuesContext>> =\n Symbol('emptyValuesContextKey')\nexport const SCOPE = 'use-empty-values'\nexport const DEFAULT_EMPTY_VALUES = ['', undefined, null]\nexport const DEFAULT_VALUE_ON_CLEAR = undefined\n\nexport const useEmptyValuesProps = buildProps({\n /**\n * @description empty values supported by the component\n */\n emptyValues: Array,\n /**\n * @description return value when cleared, if you want to set `undefined`, use `() => undefined`\n */\n valueOnClear: {\n type: [String, Number, Boolean, Function],\n default: undefined,\n validator: (val: any) => (isFunction(val) ? !val() : !val),\n },\n} as const)\n\nexport const useEmptyValues = (\n props: EmptyValuesContext,\n defaultValue?: null | undefined\n) => {\n const config = getCurrentInstance()\n ? inject(emptyValuesContextKey, ref<EmptyValuesContext>({}))\n : ref<EmptyValuesContext>({})\n\n const emptyValues = computed(\n () => props.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES\n )\n\n const valueOnClear = computed(() => {\n // function is used for undefined cause undefined can't be a value of prop\n if (isFunction(props.valueOnClear)) {\n return props.valueOnClear()\n } else if (props.valueOnClear !== undefined) {\n return props.valueOnClear\n } else if (isFunction(config.value.valueOnClear)) {\n return config.value.valueOnClear()\n } else if (config.value.valueOnClear !== undefined) {\n return config.value.valueOnClear\n }\n return defaultValue !== undefined ? defaultValue : DEFAULT_VALUE_ON_CLEAR\n })\n\n const isEmptyValue = (value: any) => {\n return emptyValues.value.includes(value)\n }\n\n if (!emptyValues.value.includes(valueOnClear.value)) {\n debugWarn(SCOPE, 'value-on-clear should be a value of empty-values')\n }\n\n return {\n emptyValues,\n valueOnClear,\n isEmptyValue,\n }\n}\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,EAAE;AACzD,MAAC,KAAK,GAAG,mBAAmB;AAC5B,MAAC,oBAAoB,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,I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,CAAC,KAAK,CAAC,YAAY,CAAC;AACvC,KAAK;AACL,IAAI,OAAO,YAAY,KAAK,KAAK,CAAC,GAAG,YAAY,GAAG,sBAAsB,CAAC;AAC3E,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,OAAO,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC7C,GAAG,CAAC;AACJ,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;AACvD,IAAI,SAAS,CAAC,KAAK,EAAE,kDAAkD,CAAC,CAAC;AACzE,GAAG;AACH,EAAE,OAAO;AACT,IAAI,WAAW;AACf,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,GAAG,CAAC;AACJ;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -226,7 +226,7 @@ export { Loading as ElLoadingService } from './components/loading/src/service.mj
|
|
|
226
226
|
export { messageDefaults, messageEmits, messageProps, messageTypes } from './components/message/src/message.mjs';
|
|
227
227
|
export { ElMessage } from './components/message/index.mjs';
|
|
228
228
|
export { ElMessageBox } from './components/message-box/index.mjs';
|
|
229
|
-
export { notificationEmits, notificationProps, notificationTypes } from './components/notification/src/
|
|
229
|
+
export { notificationEmits, notificationProps, notificationTypes } from './components/notification/src/notification2.mjs';
|
|
230
230
|
export { ElNotification } from './components/notification/index.mjs';
|
|
231
231
|
export { popoverEmits, popoverProps } from './components/popover/src/popover.mjs';
|
|
232
232
|
export { ElPopover, ElPopoverDirective } from './components/popover/index.mjs';
|
|
@@ -268,7 +268,7 @@ export { useCursor } from './hooks/use-cursor/index.mjs';
|
|
|
268
268
|
export { useOrderedChildren } from './hooks/use-ordered-children/index.mjs';
|
|
269
269
|
export { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps } from './hooks/use-size/index.mjs';
|
|
270
270
|
export { useFocusController } from './hooks/use-focus-controller/index.mjs';
|
|
271
|
-
export { DEFAULT_EMPTY_VALUES, DEFAULT_VALUE_ON_CLEAR, SCOPE, useEmptyValues, useEmptyValuesProps } from './hooks/use-empty-values/index.mjs';
|
|
271
|
+
export { DEFAULT_EMPTY_VALUES, DEFAULT_VALUE_ON_CLEAR, SCOPE, emptyValuesContextKey, useEmptyValues, useEmptyValuesProps } from './hooks/use-empty-values/index.mjs';
|
|
272
272
|
export { ariaProps, useAriaProps } from './hooks/use-aria/index.mjs';
|
|
273
273
|
|
|
274
274
|
const install = installer.install;
|
package/es/locale/lang/fr.d.ts
CHANGED
package/es/locale/lang/fr.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.mjs","sources":["../../../../../packages/locale/lang/fr.ts"],"sourcesContent":["export default {\n name: 'fr',\n el: {\n breadcrumb: {\n label: `Fil d'Ariane`,\n },\n colorpicker: {\n confirm: 'OK',\n clear: 'Effacer',\n defaultLabel: 'color picker',\n description:\n 'La couleur actuelle est {color}. Appuyer sur Entrée pour sélectionner une nouvelle couleur.',\n },\n datepicker: {\n now: 'Maintenant',\n today: 'Auj.',\n cancel: 'Annuler',\n clear: 'Effacer',\n confirm: 'OK',\n dateTablePrompt:\n 'Utiliser les touches fléchées et appuyer sur Entrée pour sélectionner le jour du mois',\n monthTablePrompt:\n 'Utiliser les touches fléchées et appuyer sur Entrée pour sélectionner le mois',\n yearTablePrompt:\n \"Utiliser les touches fléchées et appuyer sur Entrée pour sélectionner l'année\",\n selectedDate: 'Date sélectionnée',\n selectDate: 'Choisir date',\n selectTime: 'Choisir horaire',\n startDate: 'Date début',\n startTime: 'Horaire début',\n endDate: 'Date fin',\n endTime: 'Horaire fin',\n prevYear: 'Année précédente',\n nextYear: 'Année suivante',\n prevMonth: 'Mois précédent',\n nextMonth: 'Mois suivant',\n year: '', // In french, like in english, we don't say \"Année\" after the year number.\n month1: 'Janvier',\n month2: 'Février',\n month3: 'Mars',\n month4: 'Avril',\n month5: 'Mai',\n month6: 'Juin',\n month7: 'Juillet',\n month8: 'Août',\n month9: 'Septembre',\n month10: 'Octobre',\n month11: 'Novembre',\n month12: 'Décembre',\n week: 'Semaine',\n weeks: {\n sun: 'Dim',\n mon: 'Lun',\n tue: 'Mar',\n wed: 'Mer',\n thu: 'Jeu',\n fri: 'Ven',\n sat: 'Sam',\n },\n weeksFull: {\n sun: 'Dimanche',\n mon: 'Lundi',\n tue: 'Mardi',\n wed: 'Mercredi',\n thu: 'Jeudi',\n fri: 'Vendredi',\n sat: 'Samedi',\n },\n months: {\n jan: 'Jan',\n feb: 'Fév',\n mar: 'Mar',\n apr: 'Avr',\n may: 'Mai',\n jun: 'Jun',\n jul: 'Jul',\n aug: 'Aoû',\n sep: 'Sep',\n oct: 'Oct',\n nov: 'Nov',\n dec: 'Déc',\n },\n },\n inputNumber: {\n decrease: 'décrémenter',\n increase: 'incrémenter',\n },\n select: {\n loading: 'Chargement',\n noMatch: 'Aucune correspondance',\n noData: 'Aucune donnée',\n placeholder: 'Choisir',\n },\n cascader: {\n noMatch: 'Aucune correspondance',\n loading: 'Chargement',\n placeholder: 'Choisir',\n noData: 'Aucune donnée',\n },\n pagination: {\n goto: 'Aller à',\n pagesize: '/page',\n total: 'Total {total}',\n pageClassifier: '',\n page: 'Page',\n prev: 'Aller à la page précédente',\n next: 'Aller à la page suivante',\n currentPage: 'page {pager}',\n prevPages: '{pager} pages précédentes',\n nextPages: '{pager} pages suivantes',\n deprecationWarning:\n 'Utilisations obsolètes détectées, veuillez vous référer à la documentation el-pagination pour plus de détails',\n },\n dialog: {\n close: 'Fermer la boîte de dialogue',\n },\n drawer: {\n close: 'Fermer la boîte de dialogue',\n },\n messagebox: {\n title: 'Message',\n confirm: 'Confirmer',\n cancel: 'Annuler',\n error: 'Erreur',\n close: 'Fermer la boîte de dialogue',\n },\n upload: {\n deleteTip: 'Cliquer sur supprimer pour retirer le fichier',\n delete: 'Supprimer',\n preview: 'Aperçu',\n continue: 'Continuer',\n },\n slider: {\n defaultLabel: 'curseur entre {min} et {max}',\n defaultRangeStartLabel: 'choisir la valeur de départ',\n defaultRangeEndLabel: 'sélectionner la valeur finale',\n },\n table: {\n emptyText: 'Aucune donnée',\n confirmFilter: 'Confirmer',\n resetFilter: 'Réinitialiser',\n clearFilter: 'Tous',\n sumText: 'Somme',\n },\n tree: {\n emptyText: 'Aucune donnée',\n },\n transfer: {\n noMatch: 'Aucune correspondance',\n noData: 'Aucune donnée',\n titles: ['Liste 1', 'Liste 2'],\n filterPlaceholder: 'Entrer un mot clef',\n noCheckedFormat: '{total} elements',\n hasCheckedFormat: '{checked}/{total} coché(s)',\n },\n image: {\n error: 'ECHEC',\n },\n pageHeader: {\n title: 'Retour',\n },\n popconfirm: {\n confirmButtonText: 'Oui',\n cancelButtonText: 'Non',\n },\n carousel: {\n leftArrow: 'Flèche du carrousel vers la gauche',\n rightArrow: 'Flèche du carrousel vers la droite',\n indicator: 'Passer au carrousel index {index}',\n },\n },\n}\n"],"names":[],"mappings":"AAAA,SAAe;AACf,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,EAAE,EAAE;AACN,IAAI,UAAU,EAAE;AAChB,MAAM,KAAK,EAAE,CAAC,YAAY,CAAC;AAC3B,KAAK;AACL,IAAI,WAAW,EAAE;AACjB,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,KAAK,EAAE,SAAS;AACtB,MAAM,YAAY,EAAE,cAAc;AAClC,MAAM,WAAW,EAAE,mGAAmG;AACtH,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,MAAM,GAAG,EAAE,YAAY;AACvB,MAAM,KAAK,EAAE,MAAM;AACnB,MAAM,MAAM,EAAE,SAAS;AACvB,MAAM,KAAK,EAAE,SAAS;AACtB,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,eAAe,EAAE,mGAAmG;AAC1H,MAAM,gBAAgB,EAAE,2FAA2F;AACnH,MAAM,eAAe,EAAE,8FAA8F;AACrH,MAAM,YAAY,EAAE,yBAA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AACL,IAAI,UAAU,EAAE;AAChB,MAAM,KAAK,EAAE,QAAQ;AACrB,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,MAAM,iBAAiB,EAAE,KAAK;AAC9B,MAAM,gBAAgB,EAAE,KAAK;AAC7B,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,MAAM,SAAS,EAAE,uCAAuC;AACxD,MAAM,UAAU,EAAE,uCAAuC;AACzD,MAAM,SAAS,EAAE,mCAAmC;AACpD,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"fr.mjs","sources":["../../../../../packages/locale/lang/fr.ts"],"sourcesContent":["export default {\n name: 'fr',\n el: {\n breadcrumb: {\n label: `Fil d'Ariane`,\n },\n colorpicker: {\n confirm: 'OK',\n clear: 'Effacer',\n defaultLabel: 'color picker',\n description:\n 'La couleur actuelle est {color}. Appuyer sur Entrée pour sélectionner une nouvelle couleur.',\n },\n datepicker: {\n now: 'Maintenant',\n today: 'Auj.',\n cancel: 'Annuler',\n clear: 'Effacer',\n confirm: 'OK',\n dateTablePrompt:\n 'Utiliser les touches fléchées et appuyer sur Entrée pour sélectionner le jour du mois',\n monthTablePrompt:\n 'Utiliser les touches fléchées et appuyer sur Entrée pour sélectionner le mois',\n yearTablePrompt:\n \"Utiliser les touches fléchées et appuyer sur Entrée pour sélectionner l'année\",\n selectedDate: 'Date sélectionnée',\n selectDate: 'Choisir date',\n selectTime: 'Choisir horaire',\n startDate: 'Date début',\n startTime: 'Horaire début',\n endDate: 'Date fin',\n endTime: 'Horaire fin',\n prevYear: 'Année précédente',\n nextYear: 'Année suivante',\n prevMonth: 'Mois précédent',\n nextMonth: 'Mois suivant',\n year: '', // In french, like in english, we don't say \"Année\" after the year number.\n month1: 'Janvier',\n month2: 'Février',\n month3: 'Mars',\n month4: 'Avril',\n month5: 'Mai',\n month6: 'Juin',\n month7: 'Juillet',\n month8: 'Août',\n month9: 'Septembre',\n month10: 'Octobre',\n month11: 'Novembre',\n month12: 'Décembre',\n week: 'Semaine',\n weeks: {\n sun: 'Dim',\n mon: 'Lun',\n tue: 'Mar',\n wed: 'Mer',\n thu: 'Jeu',\n fri: 'Ven',\n sat: 'Sam',\n },\n weeksFull: {\n sun: 'Dimanche',\n mon: 'Lundi',\n tue: 'Mardi',\n wed: 'Mercredi',\n thu: 'Jeudi',\n fri: 'Vendredi',\n sat: 'Samedi',\n },\n months: {\n jan: 'Jan',\n feb: 'Fév',\n mar: 'Mar',\n apr: 'Avr',\n may: 'Mai',\n jun: 'Jun',\n jul: 'Jul',\n aug: 'Aoû',\n sep: 'Sep',\n oct: 'Oct',\n nov: 'Nov',\n dec: 'Déc',\n },\n },\n inputNumber: {\n decrease: 'décrémenter',\n increase: 'incrémenter',\n },\n select: {\n loading: 'Chargement',\n noMatch: 'Aucune correspondance',\n noData: 'Aucune donnée',\n placeholder: 'Choisir',\n },\n cascader: {\n noMatch: 'Aucune correspondance',\n loading: 'Chargement',\n placeholder: 'Choisir',\n noData: 'Aucune donnée',\n },\n pagination: {\n goto: 'Aller à',\n pagesize: '/page',\n total: 'Total {total}',\n pageClassifier: '',\n page: 'Page',\n prev: 'Aller à la page précédente',\n next: 'Aller à la page suivante',\n currentPage: 'page {pager}',\n prevPages: '{pager} pages précédentes',\n nextPages: '{pager} pages suivantes',\n deprecationWarning:\n 'Utilisations obsolètes détectées, veuillez vous référer à la documentation el-pagination pour plus de détails',\n },\n dialog: {\n close: 'Fermer la boîte de dialogue',\n },\n drawer: {\n close: 'Fermer la boîte de dialogue',\n },\n messagebox: {\n title: 'Message',\n confirm: 'Confirmer',\n cancel: 'Annuler',\n error: 'Erreur',\n close: 'Fermer la boîte de dialogue',\n },\n upload: {\n deleteTip: 'Cliquer sur supprimer pour retirer le fichier',\n delete: 'Supprimer',\n preview: 'Aperçu',\n continue: 'Continuer',\n },\n slider: {\n defaultLabel: 'curseur entre {min} et {max}',\n defaultRangeStartLabel: 'choisir la valeur de départ',\n defaultRangeEndLabel: 'sélectionner la valeur finale',\n },\n table: {\n emptyText: 'Aucune donnée',\n confirmFilter: 'Confirmer',\n resetFilter: 'Réinitialiser',\n clearFilter: 'Tous',\n sumText: 'Somme',\n },\n tour: {\n next: 'suivant',\n previous: 'précédent',\n finish: 'fin',\n },\n tree: {\n emptyText: 'Aucune donnée',\n },\n transfer: {\n noMatch: 'Aucune correspondance',\n noData: 'Aucune donnée',\n titles: ['Liste 1', 'Liste 2'],\n filterPlaceholder: 'Entrer un mot clef',\n noCheckedFormat: '{total} elements',\n hasCheckedFormat: '{checked}/{total} coché(s)',\n },\n image: {\n error: 'ECHEC',\n },\n pageHeader: {\n title: 'Retour',\n },\n popconfirm: {\n confirmButtonText: 'Oui',\n cancelButtonText: 'Non',\n },\n carousel: {\n leftArrow: 'Flèche du carrousel vers la gauche',\n rightArrow: 'Flèche du carrousel vers la droite',\n indicator: 'Passer au carrousel index {index}',\n },\n },\n}\n"],"names":[],"mappings":"AAAA,SAAe;AACf,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,EAAE,EAAE;AACN,IAAI,UAAU,EAAE;AAChB,MAAM,KAAK,EAAE,CAAC,YAAY,CAAC;AAC3B,KAAK;AACL,IAAI,WAAW,EAAE;AACjB,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,KAAK,EAAE,SAAS;AACtB,MAAM,YAAY,EAAE,cAAc;AAClC,MAAM,WAAW,EAAE,mGAAmG;AACtH,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,MAAM,GAAG,EAAE,YAAY;AACvB,MAAM,KAAK,EAAE,MAAM;AACnB,MAAM,MAAM,EAAE,SAAS;AACvB,MAAM,KAAK,EAAE,SAAS;AACtB,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,eAAe,EAAE,mGAAmG;AAC1H,MAAM,gBAAgB,EAAE,2FAA2F;AACnH,MAAM,eAAe,EAAE,8FAA8F;AACrH,MAAM,YAAY,EAAE,yBAAyB;AAC7C,MAAM,UAAU,EAAE,cAAc;AAChC,MAAM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AA+B;AACvD,KAAK;AACL,IAAI,KAAK,EAAE;AACX,MAAM,KAAK,EAAE,OAAO;AACpB,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,MAAM,KAAK,EAAE,QAAQ;AACrB,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,MAAM,iBAAiB,EAAE,KAAK;AAC9B,MAAM,gBAAgB,EAAE,KAAK;AAC7B,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,MAAM,SAAS,EAAE,uCAAuC;AACxD,MAAM,UAAU,EAAE,uCAAuC;AACzD,MAAM,SAAS,EAAE,mCAAmC;AACpD,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20240710";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20240710'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -76,9 +76,9 @@ export declare const ElConfigProvider: import("@element-plus/nightly/es/utils").
|
|
|
76
76
|
readonly namespace: import("@element-plus/nightly/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "el", boolean>;
|
|
77
77
|
}>>, {
|
|
78
78
|
readonly valueOnClear: import("@element-plus/nightly/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor, FunctionConstructor], unknown, unknown>;
|
|
79
|
+
readonly namespace: string;
|
|
79
80
|
readonly a11y: import("@element-plus/nightly/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
80
81
|
readonly keyboardNavigation: import("@element-plus/nightly/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
81
|
-
readonly namespace: string;
|
|
82
82
|
}>> & Record<string, any>;
|
|
83
83
|
export default ElConfigProvider;
|
|
84
84
|
export * from './src/config-provider';
|