@element-plus/nightly 0.0.20231117 → 0.0.20231118
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 +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- 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.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/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/button/index.mjs +1 -1
- package/es/components/button/src/button-group.mjs +6 -30
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button-group2.mjs +30 -6
- package/es/components/button/src/button-group2.mjs.map +1 -1
- package/es/components/collection/index.mjs +1 -1
- package/es/components/collection/src/collection.mjs +10 -62
- package/es/components/collection/src/collection.mjs.map +1 -1
- package/es/components/collection/src/collection2.mjs +62 -10
- package/es/components/collection/src/collection2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/index.mjs +2 -2
- 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/pagination/src/components/jumper.mjs +9 -60
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +60 -9
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/components/pager.mjs +216 -17
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +17 -216
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +2 -2
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton-item.mjs +23 -18
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +18 -23
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +1 -1
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/button/index.js +1 -1
- package/lib/components/button/src/button-group.js +6 -30
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button-group2.js +30 -6
- package/lib/components/button/src/button-group2.js.map +1 -1
- package/lib/components/collection/index.js +1 -1
- package/lib/components/collection/src/collection.js +9 -62
- package/lib/components/collection/src/collection.js.map +1 -1
- package/lib/components/collection/src/collection2.js +62 -9
- package/lib/components/collection/src/collection2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/index.js +2 -2
- 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/pagination/src/components/jumper.js +9 -60
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +60 -9
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/components/pager.js +216 -17
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +17 -216
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +2 -2
- package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton-item.js +23 -18
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +18 -23
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +1 -1
- package/lib/index.js +2 -2
- 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
|
@@ -3,68 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
var
|
|
7
|
-
var collectionItem = require('./collection-item.js');
|
|
6
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
8
7
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...collection["default"],
|
|
17
|
-
name: COLLECTION_NAME,
|
|
18
|
-
setup() {
|
|
19
|
-
const collectionRef = vue.ref(null);
|
|
20
|
-
const itemMap = /* @__PURE__ */ new Map();
|
|
21
|
-
const getItems = () => {
|
|
22
|
-
const collectionEl = vue.unref(collectionRef);
|
|
23
|
-
if (!collectionEl)
|
|
24
|
-
return [];
|
|
25
|
-
const orderedNodes = Array.from(collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`));
|
|
26
|
-
const items = [...itemMap.values()];
|
|
27
|
-
return items.sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));
|
|
28
|
-
};
|
|
29
|
-
vue.provide(COLLECTION_INJECTION_KEY, {
|
|
30
|
-
itemMap,
|
|
31
|
-
getItems,
|
|
32
|
-
collectionRef
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const ElCollectionItem = {
|
|
37
|
-
...collectionItem["default"],
|
|
38
|
-
name: COLLECTION_ITEM_NAME,
|
|
39
|
-
setup(_, { attrs }) {
|
|
40
|
-
const collectionItemRef = vue.ref(null);
|
|
41
|
-
const collectionInjection = vue.inject(COLLECTION_INJECTION_KEY, void 0);
|
|
42
|
-
vue.provide(COLLECTION_ITEM_INJECTION_KEY, {
|
|
43
|
-
collectionItemRef
|
|
44
|
-
});
|
|
45
|
-
vue.onMounted(() => {
|
|
46
|
-
const collectionItemEl = vue.unref(collectionItemRef);
|
|
47
|
-
if (collectionItemEl) {
|
|
48
|
-
collectionInjection.itemMap.set(collectionItemEl, {
|
|
49
|
-
ref: collectionItemEl,
|
|
50
|
-
...attrs
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
vue.onBeforeUnmount(() => {
|
|
55
|
-
const collectionItemEl = vue.unref(collectionItemRef);
|
|
56
|
-
collectionInjection.itemMap.delete(collectionItemEl);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
return {
|
|
61
|
-
COLLECTION_INJECTION_KEY,
|
|
62
|
-
COLLECTION_ITEM_INJECTION_KEY,
|
|
63
|
-
ElCollection,
|
|
64
|
-
ElCollectionItem
|
|
65
|
-
};
|
|
66
|
-
};
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
inheritAttrs: false
|
|
10
|
+
});
|
|
11
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
12
|
+
return vue.renderSlot(_ctx.$slots, "default");
|
|
13
|
+
}
|
|
14
|
+
var Collection = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/collection/src/collection.vue"]]);
|
|
67
15
|
|
|
68
|
-
exports
|
|
69
|
-
exports.createCollectionWithScope = createCollectionWithScope;
|
|
16
|
+
exports["default"] = Collection;
|
|
70
17
|
//# sourceMappingURL=collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.js","sources":["../../../../../../packages/components/collection/src/collection.
|
|
1
|
+
{"version":3,"file":"collection.js","sources":["../../../../../../packages/components/collection/src/collection.vue"],"sourcesContent":["<template>\n <slot />\n</template>\n\n<script lang=\"ts\" setup>\ndefineOptions({\n inheritAttrs: false,\n})\n</script>\n"],"names":["DO_defineComponent","_renderSlot"],"mappings":";;;;;;;kCAKcA,mBAAA,CAAA;AAAA,EACZ,YAAc,EAAA,KAAA;AAChB,CAAA,CAAA,CAAA;;SANEC,cAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -3,15 +3,68 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
var
|
|
6
|
+
var collection = require('./collection.js');
|
|
7
|
+
var collectionItem = require('./collection-item.js');
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
|
|
10
|
+
const createCollectionWithScope = (name) => {
|
|
11
|
+
const COLLECTION_NAME = `El${name}Collection`;
|
|
12
|
+
const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`;
|
|
13
|
+
const COLLECTION_INJECTION_KEY = Symbol(COLLECTION_NAME);
|
|
14
|
+
const COLLECTION_ITEM_INJECTION_KEY = Symbol(COLLECTION_ITEM_NAME);
|
|
15
|
+
const ElCollection = {
|
|
16
|
+
...collection["default"],
|
|
17
|
+
name: COLLECTION_NAME,
|
|
18
|
+
setup() {
|
|
19
|
+
const collectionRef = vue.ref(null);
|
|
20
|
+
const itemMap = /* @__PURE__ */ new Map();
|
|
21
|
+
const getItems = () => {
|
|
22
|
+
const collectionEl = vue.unref(collectionRef);
|
|
23
|
+
if (!collectionEl)
|
|
24
|
+
return [];
|
|
25
|
+
const orderedNodes = Array.from(collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`));
|
|
26
|
+
const items = [...itemMap.values()];
|
|
27
|
+
return items.sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));
|
|
28
|
+
};
|
|
29
|
+
vue.provide(COLLECTION_INJECTION_KEY, {
|
|
30
|
+
itemMap,
|
|
31
|
+
getItems,
|
|
32
|
+
collectionRef
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const ElCollectionItem = {
|
|
37
|
+
...collectionItem["default"],
|
|
38
|
+
name: COLLECTION_ITEM_NAME,
|
|
39
|
+
setup(_, { attrs }) {
|
|
40
|
+
const collectionItemRef = vue.ref(null);
|
|
41
|
+
const collectionInjection = vue.inject(COLLECTION_INJECTION_KEY, void 0);
|
|
42
|
+
vue.provide(COLLECTION_ITEM_INJECTION_KEY, {
|
|
43
|
+
collectionItemRef
|
|
44
|
+
});
|
|
45
|
+
vue.onMounted(() => {
|
|
46
|
+
const collectionItemEl = vue.unref(collectionItemRef);
|
|
47
|
+
if (collectionItemEl) {
|
|
48
|
+
collectionInjection.itemMap.set(collectionItemEl, {
|
|
49
|
+
ref: collectionItemEl,
|
|
50
|
+
...attrs
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
vue.onBeforeUnmount(() => {
|
|
55
|
+
const collectionItemEl = vue.unref(collectionItemRef);
|
|
56
|
+
collectionInjection.itemMap.delete(collectionItemEl);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
COLLECTION_INJECTION_KEY,
|
|
62
|
+
COLLECTION_ITEM_INJECTION_KEY,
|
|
63
|
+
ElCollection,
|
|
64
|
+
ElCollectionItem
|
|
65
|
+
};
|
|
66
|
+
};
|
|
15
67
|
|
|
16
|
-
exports
|
|
68
|
+
exports.COLLECTION_ITEM_SIGN = COLLECTION_ITEM_SIGN;
|
|
69
|
+
exports.createCollectionWithScope = createCollectionWithScope;
|
|
17
70
|
//# sourceMappingURL=collection2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection2.js","sources":["../../../../../../packages/components/collection/src/collection.
|
|
1
|
+
{"version":3,"file":"collection2.js","sources":["../../../../../../packages/components/collection/src/collection.ts"],"sourcesContent":["import { inject, onBeforeUnmount, onMounted, provide, ref, unref } from 'vue'\nimport Collection from './collection.vue'\nimport CollectionItem from './collection-item.vue'\n\nimport type { InjectionKey } from 'vue'\nimport type { SetupContext } from '@vue/runtime-core'\nimport type {\n ElCollectionInjectionContext,\n ElCollectionItemInjectionContext,\n} from './tokens'\n\nexport const COLLECTION_ITEM_SIGN = `data-el-collection-item`\n\n// Make sure the first letter of name is capitalized\nexport const createCollectionWithScope = (name: string) => {\n const COLLECTION_NAME = `El${name}Collection`\n const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`\n const COLLECTION_INJECTION_KEY: InjectionKey<ElCollectionInjectionContext> =\n Symbol(COLLECTION_NAME)\n const COLLECTION_ITEM_INJECTION_KEY: InjectionKey<ElCollectionItemInjectionContext> =\n Symbol(COLLECTION_ITEM_NAME)\n\n const ElCollection = {\n ...Collection,\n name: COLLECTION_NAME,\n setup() {\n const collectionRef = ref<HTMLElement | null>(null)\n const itemMap: ElCollectionInjectionContext['itemMap'] = new Map()\n const getItems = () => {\n const collectionEl = unref(collectionRef)\n\n if (!collectionEl) return []\n const orderedNodes = Array.from(\n collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`)\n )\n\n const items = [...itemMap.values()]\n\n return items.sort(\n (a, b) => orderedNodes.indexOf(a.ref!) - orderedNodes.indexOf(b.ref!)\n )\n }\n\n provide(COLLECTION_INJECTION_KEY, {\n itemMap,\n getItems,\n collectionRef,\n })\n },\n }\n\n const ElCollectionItem = {\n ...CollectionItem,\n name: COLLECTION_ITEM_NAME,\n setup(_: unknown, { attrs }: SetupContext) {\n const collectionItemRef = ref<HTMLElement | null>(null)\n const collectionInjection = inject(COLLECTION_INJECTION_KEY, undefined)!\n\n provide(COLLECTION_ITEM_INJECTION_KEY, {\n collectionItemRef,\n })\n\n onMounted(() => {\n const collectionItemEl = unref(collectionItemRef)\n if (collectionItemEl) {\n collectionInjection.itemMap.set(collectionItemEl, {\n ref: collectionItemEl,\n ...attrs,\n })\n }\n })\n\n onBeforeUnmount(() => {\n const collectionItemEl = unref(collectionItemRef)!\n collectionInjection.itemMap.delete(collectionItemEl)\n })\n },\n }\n\n return {\n COLLECTION_INJECTION_KEY,\n COLLECTION_ITEM_INJECTION_KEY,\n ElCollection,\n ElCollectionItem,\n }\n}\n"],"names":["Collection","ref","unref","provide","CollectionItem","inject","onMounted","onBeforeUnmount"],"mappings":"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"}
|
|
@@ -18,7 +18,7 @@ var tokens$1 = require('../../roving-focus-group/src/tokens.js');
|
|
|
18
18
|
var refs = require('../../../utils/vue/refs.js');
|
|
19
19
|
var event = require('../../../utils/dom/event.js');
|
|
20
20
|
var aria = require('../../../constants/aria.js');
|
|
21
|
-
var collection = require('../../collection/src/
|
|
21
|
+
var collection = require('../../collection/src/collection2.js');
|
|
22
22
|
|
|
23
23
|
const _sfc_main = vue.defineComponent({
|
|
24
24
|
name: "DropdownItemImpl",
|
|
@@ -11,7 +11,7 @@ var trigger = require('../../tooltip/src/trigger.js');
|
|
|
11
11
|
var content = require('../../tooltip/src/content.js');
|
|
12
12
|
var icon = require('../../../utils/vue/icon.js');
|
|
13
13
|
var aria = require('../../../constants/aria.js');
|
|
14
|
-
var collection = require('../../collection/src/
|
|
14
|
+
var collection = require('../../collection/src/collection2.js');
|
|
15
15
|
|
|
16
16
|
const dropdownProps = runtime.buildProps({
|
|
17
17
|
trigger: trigger.useTooltipTriggerProps.trigger,
|
package/lib/components/index.js
CHANGED
|
@@ -168,7 +168,7 @@ var constants$d = require('./scrollbar/src/constants.js');
|
|
|
168
168
|
var token = require('./select/src/token.js');
|
|
169
169
|
var token$1 = require('./select-v2/src/token.js');
|
|
170
170
|
var skeleton = require('./skeleton/src/skeleton.js');
|
|
171
|
-
var skeletonItem = require('./skeleton/src/skeleton-
|
|
171
|
+
var skeletonItem = require('./skeleton/src/skeleton-item2.js');
|
|
172
172
|
var slider = require('./slider/src/slider.js');
|
|
173
173
|
var constants$e = require('./slider/src/constants.js');
|
|
174
174
|
var space = require('./space/src/space.js');
|
|
@@ -215,7 +215,7 @@ var watermark = require('./watermark/src/watermark.js');
|
|
|
215
215
|
var directive = require('./loading/src/directive.js');
|
|
216
216
|
var service = require('./loading/src/service.js');
|
|
217
217
|
var message = require('./message/src/message.js');
|
|
218
|
-
var notification = require('./notification/src/
|
|
218
|
+
var notification = require('./notification/src/notification2.js');
|
|
219
219
|
var popover = require('./popover/src/popover.js');
|
|
220
220
|
|
|
221
221
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
6
|
var notify = require('./src/notify.js');
|
|
7
|
-
var notification = require('./src/
|
|
7
|
+
var notification = require('./src/notification2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElNotification = install.withInstallFunction(notify["default"], "$notify");
|
|
@@ -2,77 +2,157 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
|
|
8
|
+
require('../../../constants/index.js');
|
|
9
|
+
var index = require('../../icon/index.js');
|
|
10
|
+
require('../../config-provider/index.js');
|
|
11
|
+
var notification = require('./notification2.js');
|
|
12
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
+
var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
|
|
7
14
|
var icon = require('../../../utils/vue/icon.js');
|
|
15
|
+
var aria = require('../../../constants/aria.js');
|
|
8
16
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const notificationProps = runtime.buildProps({
|
|
16
|
-
customClass: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: ""
|
|
19
|
-
},
|
|
20
|
-
dangerouslyUseHTMLString: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
duration: {
|
|
25
|
-
type: Number,
|
|
26
|
-
default: 4500
|
|
27
|
-
},
|
|
28
|
-
icon: {
|
|
29
|
-
type: icon.iconPropType
|
|
30
|
-
},
|
|
31
|
-
id: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: ""
|
|
34
|
-
},
|
|
35
|
-
message: {
|
|
36
|
-
type: runtime.definePropType([String, Object]),
|
|
37
|
-
default: ""
|
|
38
|
-
},
|
|
39
|
-
offset: {
|
|
40
|
-
type: Number,
|
|
41
|
-
default: 0
|
|
42
|
-
},
|
|
43
|
-
onClick: {
|
|
44
|
-
type: runtime.definePropType(Function),
|
|
45
|
-
default: () => void 0
|
|
46
|
-
},
|
|
47
|
-
onClose: {
|
|
48
|
-
type: runtime.definePropType(Function),
|
|
49
|
-
required: true
|
|
50
|
-
},
|
|
51
|
-
position: {
|
|
52
|
-
type: String,
|
|
53
|
-
values: ["top-right", "top-left", "bottom-right", "bottom-left"],
|
|
54
|
-
default: "top-right"
|
|
55
|
-
},
|
|
56
|
-
showClose: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: true
|
|
59
|
-
},
|
|
60
|
-
title: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: ""
|
|
63
|
-
},
|
|
64
|
-
type: {
|
|
65
|
-
type: String,
|
|
66
|
-
values: [...notificationTypes, ""],
|
|
67
|
-
default: ""
|
|
68
|
-
},
|
|
69
|
-
zIndex: Number
|
|
17
|
+
const _hoisted_1 = ["id"];
|
|
18
|
+
const _hoisted_2 = ["textContent"];
|
|
19
|
+
const _hoisted_3 = { key: 0 };
|
|
20
|
+
const _hoisted_4 = ["innerHTML"];
|
|
21
|
+
const __default__ = vue.defineComponent({
|
|
22
|
+
name: "ElNotification"
|
|
70
23
|
});
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
24
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
25
|
+
...__default__,
|
|
26
|
+
props: notification.notificationProps,
|
|
27
|
+
emits: notification.notificationEmits,
|
|
28
|
+
setup(__props, { expose }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const { ns, zIndex } = useGlobalConfig.useGlobalComponentSettings("notification");
|
|
31
|
+
const { nextZIndex, currentZIndex } = zIndex;
|
|
32
|
+
const { Close } = icon.CloseComponents;
|
|
33
|
+
const visible = vue.ref(false);
|
|
34
|
+
let timer = void 0;
|
|
35
|
+
const typeClass = vue.computed(() => {
|
|
36
|
+
const type = props.type;
|
|
37
|
+
return type && icon.TypeComponentsMap[props.type] ? ns.m(type) : "";
|
|
38
|
+
});
|
|
39
|
+
const iconComponent = vue.computed(() => {
|
|
40
|
+
if (!props.type)
|
|
41
|
+
return props.icon;
|
|
42
|
+
return icon.TypeComponentsMap[props.type] || props.icon;
|
|
43
|
+
});
|
|
44
|
+
const horizontalClass = vue.computed(() => props.position.endsWith("right") ? "right" : "left");
|
|
45
|
+
const verticalProperty = vue.computed(() => props.position.startsWith("top") ? "top" : "bottom");
|
|
46
|
+
const positionStyle = vue.computed(() => {
|
|
47
|
+
var _a;
|
|
48
|
+
return {
|
|
49
|
+
[verticalProperty.value]: `${props.offset}px`,
|
|
50
|
+
zIndex: (_a = props.zIndex) != null ? _a : currentZIndex.value
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
function startTimer() {
|
|
54
|
+
if (props.duration > 0) {
|
|
55
|
+
;
|
|
56
|
+
({ stop: timer } = core.useTimeoutFn(() => {
|
|
57
|
+
if (visible.value)
|
|
58
|
+
close();
|
|
59
|
+
}, props.duration));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function clearTimer() {
|
|
63
|
+
timer == null ? void 0 : timer();
|
|
64
|
+
}
|
|
65
|
+
function close() {
|
|
66
|
+
visible.value = false;
|
|
67
|
+
}
|
|
68
|
+
function onKeydown({ code }) {
|
|
69
|
+
if (code === aria.EVENT_CODE.delete || code === aria.EVENT_CODE.backspace) {
|
|
70
|
+
clearTimer();
|
|
71
|
+
} else if (code === aria.EVENT_CODE.esc) {
|
|
72
|
+
if (visible.value) {
|
|
73
|
+
close();
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
startTimer();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
vue.onMounted(() => {
|
|
80
|
+
startTimer();
|
|
81
|
+
nextZIndex();
|
|
82
|
+
visible.value = true;
|
|
83
|
+
});
|
|
84
|
+
core.useEventListener(document, "keydown", onKeydown);
|
|
85
|
+
expose({
|
|
86
|
+
visible,
|
|
87
|
+
close
|
|
88
|
+
});
|
|
89
|
+
return (_ctx, _cache) => {
|
|
90
|
+
return vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
91
|
+
name: vue.unref(ns).b("fade"),
|
|
92
|
+
onBeforeLeave: _ctx.onClose,
|
|
93
|
+
onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
|
|
94
|
+
persisted: ""
|
|
95
|
+
}, {
|
|
96
|
+
default: vue.withCtx(() => [
|
|
97
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
98
|
+
id: _ctx.id,
|
|
99
|
+
class: vue.normalizeClass([vue.unref(ns).b(), _ctx.customClass, vue.unref(horizontalClass)]),
|
|
100
|
+
style: vue.normalizeStyle(vue.unref(positionStyle)),
|
|
101
|
+
role: "alert",
|
|
102
|
+
onMouseenter: clearTimer,
|
|
103
|
+
onMouseleave: startTimer,
|
|
104
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
105
|
+
}, [
|
|
106
|
+
vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
|
|
107
|
+
key: 0,
|
|
108
|
+
class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
|
|
109
|
+
}, {
|
|
110
|
+
default: vue.withCtx(() => [
|
|
111
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
115
|
+
vue.createElementVNode("div", {
|
|
116
|
+
class: vue.normalizeClass(vue.unref(ns).e("group"))
|
|
117
|
+
}, [
|
|
118
|
+
vue.createElementVNode("h2", {
|
|
119
|
+
class: vue.normalizeClass(vue.unref(ns).e("title")),
|
|
120
|
+
textContent: vue.toDisplayString(_ctx.title)
|
|
121
|
+
}, null, 10, _hoisted_2),
|
|
122
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
123
|
+
class: vue.normalizeClass(vue.unref(ns).e("content")),
|
|
124
|
+
style: vue.normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
|
|
125
|
+
}, [
|
|
126
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
127
|
+
!_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
128
|
+
vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
|
|
129
|
+
vue.createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
|
|
130
|
+
], 2112))
|
|
131
|
+
])
|
|
132
|
+
], 6), [
|
|
133
|
+
[vue.vShow, _ctx.message]
|
|
134
|
+
]),
|
|
135
|
+
_ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(index.ElIcon), {
|
|
136
|
+
key: 0,
|
|
137
|
+
class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
|
|
138
|
+
onClick: vue.withModifiers(close, ["stop"])
|
|
139
|
+
}, {
|
|
140
|
+
default: vue.withCtx(() => [
|
|
141
|
+
vue.createVNode(vue.unref(Close))
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
}, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
|
|
145
|
+
], 2)
|
|
146
|
+
], 46, _hoisted_1), [
|
|
147
|
+
[vue.vShow, visible.value]
|
|
148
|
+
])
|
|
149
|
+
]),
|
|
150
|
+
_: 3
|
|
151
|
+
}, 8, ["name", "onBeforeLeave"]);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
var NotificationConstructor = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/notification/src/notification.vue"]]);
|
|
74
156
|
|
|
75
|
-
exports
|
|
76
|
-
exports.notificationProps = notificationProps;
|
|
77
|
-
exports.notificationTypes = notificationTypes;
|
|
157
|
+
exports["default"] = NotificationConstructor;
|
|
78
158
|
//# sourceMappingURL=notification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","sources":["../../../../../../packages/components/notification/src/notification.
|
|
1
|
+
{"version":3,"file":"notification.js","sources":["../../../../../../packages/components/notification/src/notification.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 :class=\"[ns.b(), customClass, horizontalClass]\"\n :style=\"positionStyle\"\n role=\"alert\"\n @mouseenter=\"clearTimer\"\n @mouseleave=\"startTimer\"\n @click=\"onClick\"\n >\n <el-icon v-if=\"iconComponent\" :class=\"[ns.e('icon'), typeClass]\">\n <component :is=\"iconComponent\" />\n </el-icon>\n <div :class=\"ns.e('group')\">\n <h2 :class=\"ns.e('title')\" v-text=\"title\" />\n <div\n v-show=\"message\"\n :class=\"ns.e('content')\"\n :style=\"!!title ? undefined : { margin: 0 }\"\n >\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\">{{ message }}</p>\n <!-- Caution here, message could've been compromised, never use user's input as message -->\n <p v-else v-html=\"message\" />\n </slot>\n </div>\n <el-icon v-if=\"showClose\" :class=\"ns.e('closeBtn')\" @click.stop=\"close\">\n <Close />\n </el-icon>\n </div>\n </div>\n </transition>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref } from 'vue'\nimport { useEventListener, useTimeoutFn } from '@vueuse/core'\nimport { CloseComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\nimport { notificationEmits, notificationProps } from './notification'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElNotification',\n})\n\nconst props = defineProps(notificationProps)\ndefineEmits(notificationEmits)\n\nconst { ns, zIndex } = useGlobalComponentSettings('notification')\nconst { nextZIndex, currentZIndex } = zIndex\n\nconst { Close } = CloseComponents\n\nconst visible = ref(false)\nlet timer: (() => void) | undefined = undefined\n\nconst typeClass = computed(() => {\n const type = props.type\n return type && TypeComponentsMap[props.type] ? ns.m(type) : ''\n})\n\nconst iconComponent = computed(() => {\n if (!props.type) return props.icon\n return TypeComponentsMap[props.type] || props.icon\n})\n\nconst horizontalClass = computed(() =>\n props.position.endsWith('right') ? 'right' : 'left'\n)\n\nconst verticalProperty = computed(() =>\n props.position.startsWith('top') ? 'top' : 'bottom'\n)\n\nconst positionStyle = computed<CSSProperties>(() => {\n return {\n [verticalProperty.value]: `${props.offset}px`,\n zIndex: props.zIndex ?? currentZIndex.value,\n }\n})\n\nfunction startTimer() {\n if (props.duration > 0) {\n ;({ stop: timer } = useTimeoutFn(() => {\n if (visible.value) close()\n }, props.duration))\n }\n}\n\nfunction clearTimer() {\n timer?.()\n}\n\nfunction close() {\n visible.value = false\n}\n\nfunction onKeydown({ code }: KeyboardEvent) {\n if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {\n clearTimer() // press delete/backspace clear timer\n } else if (code === EVENT_CODE.esc) {\n // press esc to close the notification\n if (visible.value) {\n close()\n }\n } else {\n startTimer() // resume timer\n }\n}\n\n// lifecycle\nonMounted(() => {\n startTimer()\n nextZIndex()\n visible.value = true\n})\n\nuseEventListener(document, 'keydown', onKeydown)\n\ndefineExpose({\n visible,\n /** @description close notification */\n close,\n})\n</script>\n"],"names":["useGlobalComponentSettings","CloseComponents","ref","computed","TypeComponentsMap","useTimeoutFn","EVENT_CODE","onMounted","useEventListener"],"mappings":"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"}
|