element-plus 2.2.33 → 2.2.35
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 +124 -45
- package/dist/index.full.min.js +19 -19
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +19 -19
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +123 -46
- 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/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.mjs +1 -1
- package/es/components/config-provider/src/hooks/use-global-config.d.ts +27 -0
- package/es/components/config-provider/src/hooks/use-global-config.mjs +30 -5
- package/es/components/config-provider/src/hooks/use-global-config.mjs.map +1 -1
- package/es/components/dialog/index.d.ts +12 -0
- package/es/components/dialog/src/dialog.vue.d.ts +12 -0
- package/es/components/index.mjs +1 -1
- package/es/components/loading/src/loading.mjs +13 -6
- package/es/components/loading/src/loading.mjs.map +1 -1
- package/es/components/loading/src/service.mjs +2 -5
- package/es/components/loading/src/service.mjs.map +1 -1
- package/es/components/message/src/message.vue.d.ts +5 -0
- package/es/components/message/src/message2.mjs +4 -5
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/message-box/src/index.mjs +14 -12
- package/es/components/message-box/src/index.mjs.map +1 -1
- package/es/components/message-box/src/index.vue.d.ts +2 -1852
- package/es/components/notification/src/notification.vue.d.ts +7 -0
- package/es/components/notification/src/notification2.mjs +6 -4
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +0 -4
- package/es/components/notification/src/notify.mjs.map +1 -1
- package/es/components/overlay/index.d.ts +12 -0
- package/es/components/overlay/src/overlay.d.ts +18 -0
- package/es/components/overlay/src/overlay.mjs +7 -1
- package/es/components/overlay/src/overlay.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.vue.d.ts +1 -0
- package/es/components/select/index.d.ts +1 -0
- package/es/components/select/src/options.d.ts +7 -0
- package/es/components/select/src/options.mjs +29 -0
- package/es/components/select/src/options.mjs.map +1 -0
- package/es/components/select/src/select.mjs +14 -1
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +1 -0
- package/es/components/select/src/useSelect.d.ts +1 -0
- package/es/components/select/src/useSelect.mjs +2 -10
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs.map +1 -1
- package/es/components/time-select/index.d.ts +4 -0
- package/es/components/time-select/src/time-select.vue.d.ts +2 -0
- package/es/components/tooltip/src/tooltip.vue.d.ts +9 -12
- package/es/components/tree-select/src/cache-options.mjs +6 -2
- package/es/components/tree-select/src/cache-options.mjs.map +1 -1
- package/es/hooks/index.mjs +1 -1
- package/es/hooks/use-locale/index.d.ts +1 -1
- package/es/hooks/use-locale/index.mjs +2 -2
- package/es/hooks/use-locale/index.mjs.map +1 -1
- package/es/hooks/use-lockscreen/index.d.ts +5 -1
- package/es/hooks/use-lockscreen/index.mjs +2 -2
- package/es/hooks/use-lockscreen/index.mjs.map +1 -1
- package/es/hooks/use-namespace/index.d.ts +2 -2
- package/es/hooks/use-namespace/index.mjs +4 -4
- package/es/hooks/use-namespace/index.mjs.map +1 -1
- package/es/hooks/use-popper-container/index.d.ts +4 -1
- package/es/hooks/use-popper-container/index.mjs +5 -1
- package/es/hooks/use-popper-container/index.mjs.map +1 -1
- package/es/hooks/use-z-index/index.d.ts +3 -1
- package/es/hooks/use-z-index/index.mjs +3 -3
- package/es/hooks/use-z-index/index.mjs.map +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/config-provider/index.js +1 -0
- package/lib/components/config-provider/index.js.map +1 -1
- package/lib/components/config-provider/src/hooks/use-global-config.d.ts +27 -0
- package/lib/components/config-provider/src/hooks/use-global-config.js +31 -5
- package/lib/components/config-provider/src/hooks/use-global-config.js.map +1 -1
- package/lib/components/dialog/index.d.ts +12 -0
- package/lib/components/dialog/src/dialog.vue.d.ts +12 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/loading/src/loading.js +12 -5
- package/lib/components/loading/src/loading.js.map +1 -1
- package/lib/components/loading/src/service.js +2 -5
- package/lib/components/loading/src/service.js.map +1 -1
- package/lib/components/message/src/message.vue.d.ts +5 -0
- package/lib/components/message/src/message2.js +9 -10
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/message-box/src/index.js +23 -21
- package/lib/components/message-box/src/index.js.map +1 -1
- package/lib/components/message-box/src/index.vue.d.ts +2 -1852
- package/lib/components/notification/src/notification.vue.d.ts +7 -0
- package/lib/components/notification/src/notification2.js +9 -7
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +0 -4
- package/lib/components/notification/src/notify.js.map +1 -1
- package/lib/components/overlay/index.d.ts +12 -0
- package/lib/components/overlay/src/overlay.d.ts +18 -0
- package/lib/components/overlay/src/overlay.js +7 -1
- package/lib/components/overlay/src/overlay.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.vue.d.ts +1 -0
- package/lib/components/select/index.d.ts +1 -0
- package/lib/components/select/src/options.d.ts +7 -0
- package/lib/components/select/src/options.js +33 -0
- package/lib/components/select/src/options.js.map +1 -0
- package/lib/components/select/src/select.js +14 -1
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +1 -0
- package/lib/components/select/src/useSelect.d.ts +1 -0
- package/lib/components/select/src/useSelect.js +1 -9
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/table-v2/src/renderers/cell.js +1 -1
- package/lib/components/table-v2/src/renderers/cell.js.map +1 -1
- package/lib/components/time-select/index.d.ts +4 -0
- package/lib/components/time-select/src/time-select.vue.d.ts +2 -0
- package/lib/components/tooltip/src/tooltip.vue.d.ts +9 -12
- package/lib/components/tree-select/src/cache-options.js +6 -2
- package/lib/components/tree-select/src/cache-options.js.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-locale/index.d.ts +1 -1
- package/lib/hooks/use-locale/index.js +2 -2
- package/lib/hooks/use-locale/index.js.map +1 -1
- package/lib/hooks/use-lockscreen/index.d.ts +5 -1
- package/lib/hooks/use-lockscreen/index.js +2 -2
- package/lib/hooks/use-lockscreen/index.js.map +1 -1
- package/lib/hooks/use-namespace/index.d.ts +2 -2
- package/lib/hooks/use-namespace/index.js +4 -4
- package/lib/hooks/use-namespace/index.js.map +1 -1
- package/lib/hooks/use-popper-container/index.d.ts +4 -1
- package/lib/hooks/use-popper-container/index.js +5 -1
- package/lib/hooks/use-popper-container/index.js.map +1 -1
- package/lib/hooks/use-z-index/index.d.ts +3 -1
- package/lib/hooks/use-z-index/index.js +3 -2
- package/lib/hooks/use-z-index/index.js.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.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
|
@@ -231,6 +231,7 @@ declare const _TimeSelect: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
231
231
|
default: string;
|
|
232
232
|
};
|
|
233
233
|
}, {
|
|
234
|
+
onOptionsRendered: (v: any) => void;
|
|
234
235
|
tagInMultiLine: import("vue").Ref<boolean>;
|
|
235
236
|
prefixWidth: import("vue").Ref<number>;
|
|
236
237
|
selectSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
@@ -6783,6 +6784,7 @@ declare const _TimeSelect: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6783
6784
|
default: string;
|
|
6784
6785
|
};
|
|
6785
6786
|
}, {
|
|
6787
|
+
onOptionsRendered: (v: any) => void;
|
|
6786
6788
|
tagInMultiLine: import("vue").Ref<boolean>;
|
|
6787
6789
|
prefixWidth: import("vue").Ref<number>;
|
|
6788
6790
|
selectSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
@@ -13554,6 +13556,7 @@ export declare const ElTimeSelect: SFCWithInstall<import("vue").DefineComponent<
|
|
|
13554
13556
|
default: string;
|
|
13555
13557
|
};
|
|
13556
13558
|
}, {
|
|
13559
|
+
onOptionsRendered: (v: any) => void;
|
|
13557
13560
|
tagInMultiLine: import("vue").Ref<boolean>;
|
|
13558
13561
|
prefixWidth: import("vue").Ref<number>;
|
|
13559
13562
|
selectSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
@@ -20106,6 +20109,7 @@ export declare const ElTimeSelect: SFCWithInstall<import("vue").DefineComponent<
|
|
|
20106
20109
|
default: string;
|
|
20107
20110
|
};
|
|
20108
20111
|
}, {
|
|
20112
|
+
onOptionsRendered: (v: any) => void;
|
|
20109
20113
|
tagInMultiLine: import("vue").Ref<boolean>;
|
|
20110
20114
|
prefixWidth: import("vue").Ref<number>;
|
|
20111
20115
|
selectSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
@@ -230,6 +230,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
230
230
|
default: string;
|
|
231
231
|
};
|
|
232
232
|
}, {
|
|
233
|
+
onOptionsRendered: (v: any) => void;
|
|
233
234
|
tagInMultiLine: import("vue").Ref<boolean>;
|
|
234
235
|
prefixWidth: import("vue").Ref<number>;
|
|
235
236
|
selectSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
@@ -6782,6 +6783,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6782
6783
|
default: string;
|
|
6783
6784
|
};
|
|
6784
6785
|
}, {
|
|
6786
|
+
onOptionsRendered: (v: any) => void;
|
|
6785
6787
|
tagInMultiLine: import("vue").Ref<boolean>;
|
|
6786
6788
|
prefixWidth: import("vue").Ref<number>;
|
|
6787
6789
|
selectSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
@@ -690,9 +690,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
690
690
|
b: (blockSuffix?: string) => string;
|
|
691
691
|
e: (element?: string | undefined) => string;
|
|
692
692
|
m: (modifier?: string | undefined) => string;
|
|
693
|
-
/**
|
|
694
|
-
* @description update el-popper component instance
|
|
695
|
-
*/
|
|
696
693
|
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
697
694
|
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
698
695
|
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
@@ -701,7 +698,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
701
698
|
(name: string, state: boolean | undefined): string;
|
|
702
699
|
(name: string): string;
|
|
703
700
|
};
|
|
704
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
701
|
+
cssVar: (object: Record<string, string>) => Record<string, string>; /**
|
|
702
|
+
* @description expose onOpen function to mange el-tooltip open state
|
|
703
|
+
*/
|
|
705
704
|
cssVarName: (name: string) => string;
|
|
706
705
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
707
706
|
cssVarBlockName: (name: string) => string;
|
|
@@ -833,9 +832,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
833
832
|
b: (blockSuffix?: string) => string;
|
|
834
833
|
e: (element?: string | undefined) => string;
|
|
835
834
|
m: (modifier?: string | undefined) => string;
|
|
836
|
-
/**
|
|
837
|
-
* @description update el-popper component instance
|
|
838
|
-
*/
|
|
839
835
|
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
840
836
|
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
841
837
|
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
@@ -844,7 +840,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
844
840
|
(name: string, state: boolean | undefined): string;
|
|
845
841
|
(name: string): string;
|
|
846
842
|
};
|
|
847
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
843
|
+
cssVar: (object: Record<string, string>) => Record<string, string>; /**
|
|
844
|
+
* @description expose onOpen function to mange el-tooltip open state
|
|
845
|
+
*/
|
|
848
846
|
cssVarName: (name: string) => string;
|
|
849
847
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
850
848
|
cssVarBlockName: (name: string) => string;
|
|
@@ -1645,9 +1643,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1645
1643
|
b: (blockSuffix?: string) => string;
|
|
1646
1644
|
e: (element?: string | undefined) => string;
|
|
1647
1645
|
m: (modifier?: string | undefined) => string;
|
|
1648
|
-
/**
|
|
1649
|
-
* @description update el-popper component instance
|
|
1650
|
-
*/
|
|
1651
1646
|
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
1652
1647
|
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
1653
1648
|
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
@@ -1656,7 +1651,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1656
1651
|
(name: string, state: boolean | undefined): string;
|
|
1657
1652
|
(name: string): string;
|
|
1658
1653
|
};
|
|
1659
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
1654
|
+
cssVar: (object: Record<string, string>) => Record<string, string>; /**
|
|
1655
|
+
* @description expose onOpen function to mange el-tooltip open state
|
|
1656
|
+
*/
|
|
1660
1657
|
cssVarName: (name: string) => string;
|
|
1661
1658
|
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
1662
1659
|
cssVarBlockName: (name: string) => string;
|
|
@@ -12,13 +12,17 @@ var CacheOptions = defineComponent({
|
|
|
12
12
|
setup(props) {
|
|
13
13
|
const select = inject(selectKey);
|
|
14
14
|
watch(() => props.data, () => {
|
|
15
|
+
var _a;
|
|
15
16
|
props.data.forEach((item) => {
|
|
16
17
|
if (!select.cachedOptions.has(item.value)) {
|
|
17
18
|
select.cachedOptions.set(item.value, item);
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
|
-
select.
|
|
21
|
-
|
|
21
|
+
const inputs = ((_a = select.selectWrapper) == null ? void 0 : _a.querySelectorAll("input")) || [];
|
|
22
|
+
if (!Array.from(inputs).includes(document.activeElement)) {
|
|
23
|
+
select.setSelected();
|
|
24
|
+
}
|
|
25
|
+
}, { flush: "post", immediate: true });
|
|
22
26
|
return () => void 0;
|
|
23
27
|
}
|
|
24
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-options.mjs","sources":["../../../../../../packages/components/tree-select/src/cache-options.ts"],"sourcesContent":["import { defineComponent, inject, watch } from 'vue'\nimport { selectKey } from '@element-plus/components/select'\nimport type { SelectContext } from '@element-plus/components/select'\nimport type { PropType } from 'vue'\n\n// same as el-option instance,\n// these are required for `cachedOptions`\nexport type CacheOption = {\n value: string | number | boolean | object\n currentLabel: string | number\n isDisabled: boolean\n}\n\nexport default defineComponent({\n props: {\n data: {\n type: Array as PropType<CacheOption[]>,\n default: () => [],\n },\n },\n setup(props) {\n const select = inject(selectKey) as NonNullable<SelectContext>\n\n watch(\n () => props.data,\n () => {\n props.data.forEach((item) => {\n if (!select.cachedOptions.has(item.value)) {\n select.cachedOptions.set(item.value, item)\n }\n })\n select.setSelected()\n },\n {
|
|
1
|
+
{"version":3,"file":"cache-options.mjs","sources":["../../../../../../packages/components/tree-select/src/cache-options.ts"],"sourcesContent":["import { defineComponent, inject, watch } from 'vue'\nimport { selectKey } from '@element-plus/components/select'\nimport type { SelectContext } from '@element-plus/components/select'\nimport type { PropType } from 'vue'\n\n// same as el-option instance,\n// these are required for `cachedOptions`\nexport type CacheOption = {\n value: string | number | boolean | object\n currentLabel: string | number\n isDisabled: boolean\n}\n\nexport default defineComponent({\n props: {\n data: {\n type: Array as PropType<CacheOption[]>,\n default: () => [],\n },\n },\n setup(props) {\n const select = inject(selectKey) as NonNullable<SelectContext>\n\n watch(\n () => props.data,\n () => {\n props.data.forEach((item) => {\n if (!select.cachedOptions.has(item.value)) {\n select.cachedOptions.set(item.value, item)\n }\n })\n\n // fork from packages/select/src/useSelect.ts#330\n const inputs = select.selectWrapper?.querySelectorAll('input') || []\n if (\n !Array.from(inputs).includes(\n document.activeElement as HTMLInputElement\n )\n ) {\n select.setSelected()\n }\n },\n { flush: 'post', immediate: true }\n )\n\n return () => undefined\n },\n})\n"],"names":[],"mappings":";;;;AAEA,mBAAe,eAAe,CAAC;AAC/B,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE;AACV,MAAM,IAAI,EAAE,KAAK;AACjB,MAAM,OAAO,EAAE,MAAM,EAAE;AACvB,KAAK;AACL,GAAG;AACH,EAAE,KAAK,CAAC,KAAK,EAAE;AACf,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACrC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,MAAM;AAClC,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK;AACnC,QAAQ,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AACnD,UAAU,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACrD,SAAS;AACT,OAAO,CAAC,CAAC;AACT,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;AACzG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;AAChE,QAAQ,MAAM,CAAC,WAAW,EAAE,CAAC;AAC7B,OAAO;AACP,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3C,IAAI,OAAO,MAAM,KAAK,CAAC,CAAC;AACxB,GAAG;AACH,CAAC,CAAC;;;;"}
|
package/es/hooks/index.mjs
CHANGED
|
@@ -22,7 +22,7 @@ export { useDelayedRender } from './use-intermediate-render/index.mjs';
|
|
|
22
22
|
export { useDelayedToggle, useDelayedToggleProps } from './use-delayed-toggle/index.mjs';
|
|
23
23
|
export { FORWARD_REF_INJECTION_KEY, useForwardRef, useForwardRefDirective } from './use-forward-ref/index.mjs';
|
|
24
24
|
export { defaultNamespace, namespaceContextKey, useGetDerivedNamespace, useNamespace } from './use-namespace/index.mjs';
|
|
25
|
-
export { useZIndex, zIndexContextKey } from './use-z-index/index.mjs';
|
|
25
|
+
export { defaultInitialZIndex, useZIndex, zIndexContextKey } from './use-z-index/index.mjs';
|
|
26
26
|
export { arrowMiddleware, getPositionDataWithUnit, useFloating, useFloatingProps } from './use-floating/index.mjs';
|
|
27
27
|
export { useCursor } from './use-cursor/index.mjs';
|
|
28
28
|
export { useOrderedChildren } from './use-ordered-children/index.mjs';
|
|
@@ -12,4 +12,4 @@ export declare const buildTranslator: (locale: MaybeRef<Language>) => Translator
|
|
|
12
12
|
export declare const translate: (path: string, option: undefined | TranslatorOption, locale: Language) => string;
|
|
13
13
|
export declare const buildLocaleContext: (locale: MaybeRef<Language>) => LocaleContext;
|
|
14
14
|
export declare const localeContextKey: InjectionKey<Ref<Language | undefined>>;
|
|
15
|
-
export declare const useLocale: () => LocaleContext;
|
|
15
|
+
export declare const useLocale: (localeOverrides?: Ref<Language | undefined> | undefined) => LocaleContext;
|
|
@@ -17,8 +17,8 @@ const buildLocaleContext = (locale) => {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
const localeContextKey = Symbol("localeContextKey");
|
|
20
|
-
const useLocale = () => {
|
|
21
|
-
const locale = inject(localeContextKey, ref());
|
|
20
|
+
const useLocale = (localeOverrides) => {
|
|
21
|
+
const locale = localeOverrides || inject(localeContextKey, ref());
|
|
22
22
|
return buildLocaleContext(computed(() => locale.value || English));
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-locale/index.ts"],"sourcesContent":["import { computed, inject, isRef, ref, unref } from 'vue'\nimport { get } from 'lodash-unified'\nimport English from '@element-plus/locale/lang/en'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { InjectionKey, Ref } from 'vue'\nimport type { Language } from '@element-plus/locale'\n\nexport type TranslatorOption = Record<string, string | number>\nexport type Translator = (path: string, option?: TranslatorOption) => string\nexport type LocaleContext = {\n locale: Ref<Language>\n lang: Ref<string>\n t: Translator\n}\n\nexport const buildTranslator =\n (locale: MaybeRef<Language>): Translator =>\n (path, option) =>\n translate(path, option, unref(locale))\n\nexport const translate = (\n path: string,\n option: undefined | TranslatorOption,\n locale: Language\n): string =>\n (get(locale, path, path) as string).replace(\n /\\{(\\w+)\\}/g,\n (_, key) => `${option?.[key] ?? `{${key}}`}`\n )\n\nexport const buildLocaleContext = (\n locale: MaybeRef<Language>\n): LocaleContext => {\n const lang = computed(() => unref(locale).name)\n const localeRef = isRef(locale) ? locale : ref(locale)\n return {\n lang,\n locale: localeRef,\n t: buildTranslator(locale),\n }\n}\n\nexport const localeContextKey: InjectionKey<Ref<Language | undefined>> =\n Symbol('localeContextKey')\n\nexport const useLocale = () => {\n const locale = inject(localeContextKey, ref())!\n return buildLocaleContext(computed(() => locale.value || English))\n}\n"],"names":[],"mappings":";;;;AAGY,MAAC,eAAe,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE;AACxF,MAAC,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK;AAC7G,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG,CAAC,MAAM,KAAK;AAC9C,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAClD,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AACzD,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC;AAC9B,GAAG,CAAC;AACJ,EAAE;AACU,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE;AAC/C,MAAC,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-locale/index.ts"],"sourcesContent":["import { computed, inject, isRef, ref, unref } from 'vue'\nimport { get } from 'lodash-unified'\nimport English from '@element-plus/locale/lang/en'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { InjectionKey, Ref } from 'vue'\nimport type { Language } from '@element-plus/locale'\n\nexport type TranslatorOption = Record<string, string | number>\nexport type Translator = (path: string, option?: TranslatorOption) => string\nexport type LocaleContext = {\n locale: Ref<Language>\n lang: Ref<string>\n t: Translator\n}\n\nexport const buildTranslator =\n (locale: MaybeRef<Language>): Translator =>\n (path, option) =>\n translate(path, option, unref(locale))\n\nexport const translate = (\n path: string,\n option: undefined | TranslatorOption,\n locale: Language\n): string =>\n (get(locale, path, path) as string).replace(\n /\\{(\\w+)\\}/g,\n (_, key) => `${option?.[key] ?? `{${key}}`}`\n )\n\nexport const buildLocaleContext = (\n locale: MaybeRef<Language>\n): LocaleContext => {\n const lang = computed(() => unref(locale).name)\n const localeRef = isRef(locale) ? locale : ref(locale)\n return {\n lang,\n locale: localeRef,\n t: buildTranslator(locale),\n }\n}\n\nexport const localeContextKey: InjectionKey<Ref<Language | undefined>> =\n Symbol('localeContextKey')\n\nexport const useLocale = (localeOverrides?: Ref<Language | undefined>) => {\n const locale = localeOverrides || inject(localeContextKey, ref())!\n return buildLocaleContext(computed(() => locale.value || English))\n}\n"],"names":[],"mappings":";;;;AAGY,MAAC,eAAe,GAAG,CA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
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
|
+
import type { UseNamespaceReturn } from '../use-namespace';
|
|
3
|
+
export declare type UseLockScreenOptions = {
|
|
4
|
+
ns?: UseNamespaceReturn;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* Hook that monitoring the ref value to lock or unlock the screen.
|
|
4
8
|
* When the trigger became true, it assumes modal is now opened and vice versa.
|
|
5
9
|
* @param trigger {Ref<boolean>}
|
|
6
10
|
*/
|
|
7
|
-
export declare const useLockscreen: (trigger: Ref<boolean
|
|
11
|
+
export declare const useLockscreen: (trigger: Ref<boolean>, options?: UseLockScreenOptions) => void;
|
|
@@ -7,11 +7,11 @@ import { throwError } from '../../utils/error.mjs';
|
|
|
7
7
|
import { hasClass, removeClass, getStyle, addClass } from '../../utils/dom/style.mjs';
|
|
8
8
|
import { getScrollBarWidth } from '../../utils/dom/scroll.mjs';
|
|
9
9
|
|
|
10
|
-
const useLockscreen = (trigger) => {
|
|
10
|
+
const useLockscreen = (trigger, options = {}) => {
|
|
11
11
|
if (!isRef(trigger)) {
|
|
12
12
|
throwError("[useLockscreen]", "You need to pass a ref param to this function");
|
|
13
13
|
}
|
|
14
|
-
const ns = useNamespace("popup");
|
|
14
|
+
const ns = options.ns || useNamespace("popup");
|
|
15
15
|
const hiddenCls = computed(() => ns.bm("parent", "hidden"));
|
|
16
16
|
if (!isClient || hasClass(document.body, hiddenCls.value)) {
|
|
17
17
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-lockscreen/index.ts"],"sourcesContent":["import { isRef, onScopeDispose, watch } from 'vue'\nimport { computed } from '@vue/reactivity'\nimport { isClient } from '@vueuse/core'\nimport {\n addClass,\n getScrollBarWidth,\n getStyle,\n hasClass,\n removeClass,\n throwError,\n} from '@element-plus/utils'\nimport { useNamespace } from '../use-namespace'\n\nimport type { Ref } from 'vue'\n\n/**\n * Hook that monitoring the ref value to lock or unlock the screen.\n * When the trigger became true, it assumes modal is now opened and vice versa.\n * @param trigger {Ref<boolean>}\n */\nexport const useLockscreen = (trigger: Ref<boolean
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-lockscreen/index.ts"],"sourcesContent":["import { isRef, onScopeDispose, watch } from 'vue'\nimport { computed } from '@vue/reactivity'\nimport { isClient } from '@vueuse/core'\nimport {\n addClass,\n getScrollBarWidth,\n getStyle,\n hasClass,\n removeClass,\n throwError,\n} from '@element-plus/utils'\nimport { useNamespace } from '../use-namespace'\n\nimport type { Ref } from 'vue'\nimport type { UseNamespaceReturn } from '../use-namespace'\n\nexport type UseLockScreenOptions = {\n ns?: UseNamespaceReturn\n // shouldLock?: MaybeRef<boolean>\n}\n\n/**\n * Hook that monitoring the ref value to lock or unlock the screen.\n * When the trigger became true, it assumes modal is now opened and vice versa.\n * @param trigger {Ref<boolean>}\n */\nexport const useLockscreen = (\n trigger: Ref<boolean>,\n options: UseLockScreenOptions = {}\n) => {\n if (!isRef(trigger)) {\n throwError(\n '[useLockscreen]',\n 'You need to pass a ref param to this function'\n )\n }\n\n const ns = options.ns || useNamespace('popup')\n\n const hiddenCls = computed(() => ns.bm('parent', 'hidden'))\n\n if (!isClient || hasClass(document.body, hiddenCls.value)) {\n return\n }\n\n let scrollBarWidth = 0\n let withoutHiddenClass = false\n let bodyWidth = '0'\n\n const cleanup = () => {\n setTimeout(() => {\n removeClass(document?.body, hiddenCls.value)\n if (withoutHiddenClass && document) {\n document.body.style.width = bodyWidth\n }\n }, 200)\n }\n watch(trigger, (val) => {\n if (!val) {\n cleanup()\n return\n }\n\n withoutHiddenClass = !hasClass(document.body, hiddenCls.value)\n if (withoutHiddenClass) {\n bodyWidth = document.body.style.width\n }\n scrollBarWidth = getScrollBarWidth(ns.namespace.value)\n const bodyHasOverflow =\n document.documentElement.clientHeight < document.body.scrollHeight\n const bodyOverflowY = getStyle(document.body, 'overflowY')\n if (\n scrollBarWidth > 0 &&\n (bodyHasOverflow || bodyOverflowY === 'scroll') &&\n withoutHiddenClass\n ) {\n document.body.style.width = `calc(100% - ${scrollBarWidth}px)`\n }\n addClass(document.body, hiddenCls.value)\n })\n onScopeDispose(() => cleanup())\n}\n"],"names":[],"mappings":";;;;;;;;;AAYY,MAAC,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,EAAE,KAAK;AACxD,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;AACvB,IAAI,UAAU,CAAC,iBAAiB,EAAE,+CAA+C,CAAC,CAAC;AACnF,GAAG;AACH,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AACjD,EAAE,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC9D,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE;AAC7D,IAAI,OAAO;AACX,GAAG;AACH,EAAE,IAAI,cAAc,GAAG,CAAC,CAAC;AACzB,EAAE,IAAI,kBAAkB,GAAG,KAAK,CAAC;AACjC,EAAE,IAAI,SAAS,GAAG,GAAG,CAAC;AACtB,EAAE,MAAM,OAAO,GAAG,MAAM;AACxB,IAAI,UAAU,CAAC,MAAM;AACrB,MAAM,WAAW,CAAC,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;AAC9E,MAAM,IAAI,kBAAkB,IAAI,QAAQ,EAAE;AAC1C,QAAQ,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;AAC9C,OAAO;AACP,KAAK,EAAE,GAAG,CAAC,CAAC;AACZ,GAAG,CAAC;AACJ,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK;AAC1B,IAAI,IAAI,CAAC,GAAG,EAAE;AACd,MAAM,OAAO,EAAE,CAAC;AAChB,MAAM,OAAO;AACb,KAAK;AACL,IAAI,kBAAkB,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;AACnE,IAAI,IAAI,kBAAkB,EAAE;AAC5B,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AAC5C,KAAK;AACL,IAAI,cAAc,GAAG,iBAAiB,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC3D,IAAI,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;AAC/F,IAAI,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC/D,IAAI,IAAI,cAAc,GAAG,CAAC,KAAK,eAAe,IAAI,aAAa,KAAK,QAAQ,CAAC,IAAI,kBAAkB,EAAE;AACrG,MAAM,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;AACrE,KAAK;AACL,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;AAC7C,GAAG,CAAC,CAAC;AACL,EAAE,cAAc,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;AAClC;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from 'vue';
|
|
2
2
|
export declare const defaultNamespace = "el";
|
|
3
3
|
export declare const namespaceContextKey: InjectionKey<Ref<string | undefined>>;
|
|
4
|
-
export declare const useGetDerivedNamespace: () => import("vue").ComputedRef<string>;
|
|
5
|
-
export declare const useNamespace: (block: string) => {
|
|
4
|
+
export declare const useGetDerivedNamespace: (namespaceOverrides?: Ref<string> | undefined) => import("vue").ComputedRef<string>;
|
|
5
|
+
export declare const useNamespace: (block: string, namespaceOverrides?: Ref<string> | undefined) => {
|
|
6
6
|
namespace: import("vue").ComputedRef<string>;
|
|
7
7
|
b: (blockSuffix?: string) => string;
|
|
8
8
|
e: (element?: string | undefined) => string;
|
|
@@ -16,15 +16,15 @@ const _bem = (namespace, block, blockSuffix, element, modifier) => {
|
|
|
16
16
|
return cls;
|
|
17
17
|
};
|
|
18
18
|
const namespaceContextKey = Symbol("localeContextKey");
|
|
19
|
-
const useGetDerivedNamespace = () => {
|
|
20
|
-
const derivedNamespace = inject(namespaceContextKey, ref(defaultNamespace));
|
|
19
|
+
const useGetDerivedNamespace = (namespaceOverrides) => {
|
|
20
|
+
const derivedNamespace = namespaceOverrides || inject(namespaceContextKey, ref(defaultNamespace));
|
|
21
21
|
const namespace = computed(() => {
|
|
22
22
|
return unref(derivedNamespace) || defaultNamespace;
|
|
23
23
|
});
|
|
24
24
|
return namespace;
|
|
25
25
|
};
|
|
26
|
-
const useNamespace = (block) => {
|
|
27
|
-
const namespace = useGetDerivedNamespace();
|
|
26
|
+
const useNamespace = (block, namespaceOverrides) => {
|
|
27
|
+
const namespace = useGetDerivedNamespace(namespaceOverrides);
|
|
28
28
|
const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
|
|
29
29
|
const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
|
|
30
30
|
const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, inject, ref, unref } from 'vue'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const defaultNamespace = 'el'\nconst statePrefix = 'is-'\n\nconst _bem = (\n namespace: string,\n block: string,\n blockSuffix: string,\n element: string,\n modifier: string\n) => {\n let cls = `${namespace}-${block}`\n if (blockSuffix) {\n cls += `-${blockSuffix}`\n }\n if (element) {\n cls += `__${element}`\n }\n if (modifier) {\n cls += `--${modifier}`\n }\n return cls\n}\n\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\n Symbol('localeContextKey')\n\nexport const useGetDerivedNamespace = () => {\n const derivedNamespace
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, inject, ref, unref } from 'vue'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const defaultNamespace = 'el'\nconst statePrefix = 'is-'\n\nconst _bem = (\n namespace: string,\n block: string,\n blockSuffix: string,\n element: string,\n modifier: string\n) => {\n let cls = `${namespace}-${block}`\n if (blockSuffix) {\n cls += `-${blockSuffix}`\n }\n if (element) {\n cls += `__${element}`\n }\n if (modifier) {\n cls += `--${modifier}`\n }\n return cls\n}\n\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\n Symbol('localeContextKey')\n\nexport const useGetDerivedNamespace = (namespaceOverrides?: Ref<string>) => {\n const derivedNamespace =\n namespaceOverrides || inject(namespaceContextKey, ref(defaultNamespace))\n const namespace = computed(() => {\n return unref(derivedNamespace) || defaultNamespace\n })\n return namespace\n}\n\nexport const useNamespace = (\n block: string,\n namespaceOverrides?: Ref<string>\n) => {\n const namespace = useGetDerivedNamespace(namespaceOverrides)\n const b = (blockSuffix = '') =>\n _bem(namespace.value, block, blockSuffix, '', '')\n const e = (element?: string) =>\n element ? _bem(namespace.value, block, '', element, '') : ''\n const m = (modifier?: string) =>\n modifier ? _bem(namespace.value, block, '', '', modifier) : ''\n const be = (blockSuffix?: string, element?: string) =>\n blockSuffix && element\n ? _bem(namespace.value, block, blockSuffix, element, '')\n : ''\n const em = (element?: string, modifier?: string) =>\n element && modifier\n ? _bem(namespace.value, block, '', element, modifier)\n : ''\n const bm = (blockSuffix?: string, modifier?: string) =>\n blockSuffix && modifier\n ? _bem(namespace.value, block, blockSuffix, '', modifier)\n : ''\n const bem = (blockSuffix?: string, element?: string, modifier?: string) =>\n blockSuffix && element && modifier\n ? _bem(namespace.value, block, blockSuffix, element, modifier)\n : ''\n const is: {\n (name: string, state: boolean | undefined): string\n (name: string): string\n } = (name: string, ...args: [boolean | undefined] | []) => {\n const state = args.length >= 1 ? args[0]! : true\n return name && state ? `${statePrefix}${name}` : ''\n }\n\n // for css var\n // --el-xxx: value;\n const cssVar = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${key}`] = object[key]\n }\n }\n return styles\n }\n // with block\n const cssVarBlock = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${block}-${key}`] = object[key]\n }\n }\n return styles\n }\n\n const cssVarName = (name: string) => `--${namespace.value}-${name}`\n const cssVarBlockName = (name: string) =>\n `--${namespace.value}-${block}-${name}`\n\n return {\n namespace,\n b,\n e,\n m,\n be,\n em,\n bm,\n bem,\n is,\n // css\n cssVar,\n cssVarName,\n cssVarBlock,\n cssVarBlockName,\n }\n}\n\nexport type UseNamespaceReturn = ReturnType<typeof useNamespace>\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG,KAAK;AACrC,MAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,KAAK;AACnE,EAAE,IAAI,GAAG,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACpC,EAAE,IAAI,WAAW,EAAE;AACnB,IAAI,GAAG,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AAC7B,GAAG;AACH,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,GAAG,IAAI,CAAC,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|
|
|
2
2
|
id: import("vue").ComputedRef<string>;
|
|
3
3
|
selector: import("vue").ComputedRef<string>;
|
|
4
4
|
};
|
|
5
|
-
export declare const usePopperContainer: () =>
|
|
5
|
+
export declare const usePopperContainer: () => {
|
|
6
|
+
id: import("vue").ComputedRef<string>;
|
|
7
|
+
selector: import("vue").ComputedRef<string>;
|
|
8
|
+
};
|
|
@@ -23,14 +23,18 @@ const createContainer = (id) => {
|
|
|
23
23
|
return container;
|
|
24
24
|
};
|
|
25
25
|
const usePopperContainer = () => {
|
|
26
|
+
const { id, selector } = usePopperContainerId();
|
|
26
27
|
onBeforeMount(() => {
|
|
27
28
|
if (!isClient)
|
|
28
29
|
return;
|
|
29
|
-
const { id, selector } = usePopperContainerId();
|
|
30
30
|
if (process.env.NODE_ENV === "test" || !cachedContainer && !document.body.querySelector(selector.value)) {
|
|
31
31
|
cachedContainer = createContainer(id.value);
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
+
return {
|
|
35
|
+
id,
|
|
36
|
+
selector
|
|
37
|
+
};
|
|
34
38
|
};
|
|
35
39
|
|
|
36
40
|
export { usePopperContainer, usePopperContainerId };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-popper-container/index.ts"],"sourcesContent":["import { computed, onBeforeMount } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { useGetDerivedNamespace } from '../use-namespace'\nimport { useIdInjection } from '../use-id'\n\nlet cachedContainer: HTMLElement\n\nexport const usePopperContainerId = () => {\n const namespace = useGetDerivedNamespace()\n const idInjection = useIdInjection()\n\n const id = computed(() => {\n return `${namespace.value}-popper-container-${idInjection.prefix}`\n })\n const selector = computed(() => `#${id.value}`)\n\n return {\n id,\n selector,\n }\n}\n\nconst createContainer = (id: string) => {\n const container = document.createElement('div')\n container.id = id\n document.body.appendChild(container)\n return container\n}\n\nexport const usePopperContainer = () => {\n onBeforeMount(() => {\n if (!isClient) return\n\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-popper-container/index.ts"],"sourcesContent":["import { computed, onBeforeMount } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { useGetDerivedNamespace } from '../use-namespace'\nimport { useIdInjection } from '../use-id'\n\nlet cachedContainer: HTMLElement\n\nexport const usePopperContainerId = () => {\n const namespace = useGetDerivedNamespace()\n const idInjection = useIdInjection()\n\n const id = computed(() => {\n return `${namespace.value}-popper-container-${idInjection.prefix}`\n })\n const selector = computed(() => `#${id.value}`)\n\n return {\n id,\n selector,\n }\n}\n\nconst createContainer = (id: string) => {\n const container = document.createElement('div')\n container.id = id\n document.body.appendChild(container)\n return container\n}\n\nexport const usePopperContainer = () => {\n const { id, selector } = usePopperContainerId()\n onBeforeMount(() => {\n if (!isClient) return\n\n // This is for bypassing the error that when under testing env, we often encounter\n // document.body.innerHTML = '' situation\n // for this we need to disable the caching since it's not really needed\n if (\n process.env.NODE_ENV === 'test' ||\n (!cachedContainer && !document.body.querySelector(selector.value))\n ) {\n cachedContainer = createContainer(id.value)\n }\n })\n\n return {\n id,\n selector,\n }\n}\n"],"names":[],"mappings":";;;;;AAIA,IAAI,eAAe,CAAC;AACR,MAAC,oBAAoB,GAAG,MAAM;AAC1C,EAAE,MAAM,SAAS,GAAG,sBAAsB,EAAE,CAAC;AAC7C,EAAE,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;AACvC,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM;AAC5B,IAAI,OAAO,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACvE,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAClD,EAAE,OAAO;AACT,IAAI,EAAE;AACN,IAAI,QAAQ;AACZ,GAAG,CAAC;AACJ,EAAE;AACF,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK;AAChC,EAAE,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAClD,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;AACpB,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;AACvC,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AACU,MAAC,kBAAkB,GAAG,MAAM;AACxC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,oBAAoB,EAAE,CAAC;AAClD,EAAE,aAAa,CAAC,MAAM;AACtB,IAAI,IAAI,CAAC,QAAQ;AACjB,MAAM,OAAO;AACb,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,IAAI,CAAC,eAAe,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC7G,MAAM,eAAe,GAAG,eAAe,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAClD,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,EAAE;AACN,IAAI,QAAQ;AACZ,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
export declare const defaultInitialZIndex = 2000;
|
|
2
3
|
export declare const zIndexContextKey: InjectionKey<Ref<number | undefined>>;
|
|
3
|
-
export declare const useZIndex: () => {
|
|
4
|
+
export declare const useZIndex: (zIndexOverrides?: Ref<number> | undefined) => {
|
|
4
5
|
initialZIndex: import("vue").ComputedRef<number>;
|
|
5
6
|
currentZIndex: import("vue").ComputedRef<number>;
|
|
6
7
|
nextZIndex: () => number;
|
|
7
8
|
};
|
|
9
|
+
export declare type UseZIndexReturn = ReturnType<typeof useZIndex>;
|
|
@@ -5,8 +5,8 @@ import { isNumber } from '@vueuse/core';
|
|
|
5
5
|
const zIndex = ref(0);
|
|
6
6
|
const defaultInitialZIndex = 2e3;
|
|
7
7
|
const zIndexContextKey = Symbol("zIndexContextKey");
|
|
8
|
-
const useZIndex = () => {
|
|
9
|
-
const zIndexInjection = inject(zIndexContextKey, void 0);
|
|
8
|
+
const useZIndex = (zIndexOverrides) => {
|
|
9
|
+
const zIndexInjection = zIndexOverrides || inject(zIndexContextKey, void 0);
|
|
10
10
|
const initialZIndex = computed(() => {
|
|
11
11
|
const zIndexFromInjection = unref(zIndexInjection);
|
|
12
12
|
return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
|
|
@@ -23,5 +23,5 @@ const useZIndex = () => {
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export { useZIndex, zIndexContextKey };
|
|
26
|
+
export { defaultInitialZIndex, useZIndex, zIndexContextKey };
|
|
27
27
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-z-index/index.ts"],"sourcesContent":["import { computed, inject, ref, unref } from 'vue'\nimport { isNumber } from '@element-plus/utils'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nconst zIndex = ref(0)\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-z-index/index.ts"],"sourcesContent":["import { computed, inject, ref, unref } from 'vue'\nimport { isNumber } from '@element-plus/utils'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nconst zIndex = ref(0)\nexport const defaultInitialZIndex = 2000\n\nexport const zIndexContextKey: InjectionKey<Ref<number | undefined>> =\n Symbol('zIndexContextKey')\n\nexport const useZIndex = (zIndexOverrides?: Ref<number>) => {\n const zIndexInjection = zIndexOverrides || inject(zIndexContextKey, undefined)\n const initialZIndex = computed(() => {\n const zIndexFromInjection = unref(zIndexInjection)\n return isNumber(zIndexFromInjection)\n ? zIndexFromInjection\n : defaultInitialZIndex\n })\n const currentZIndex = computed(() => initialZIndex.value + zIndex.value)\n\n const nextZIndex = () => {\n zIndex.value++\n return currentZIndex.value\n }\n\n return {\n initialZIndex,\n currentZIndex,\n nextZIndex,\n }\n}\n\nexport type UseZIndexReturn = ReturnType<typeof useZIndex>\n"],"names":[],"mappings":";;;;AAEA,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACV,MAAC,oBAAoB,GAAG,IAAI;AAC5B,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE;AAC/C,MAAC,SAAS,GAAG,CAAC,eAAe,KAAK;AAC9C,EAAE,MAAM,eAAe,GAAG,eAAe,IAAI,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;AAC9E,EAAE,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM;AACvC,IAAI,MAAM,mBAAmB,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AACvD,IAAI,OAAO,QAAQ,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AACtF,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,aAAa,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3E,EAAE,MAAM,UAAU,GAAG,MAAM;AAC3B,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;AACnB,IAAI,OAAO,aAAa,CAAC,KAAK,CAAC;AAC/B,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,aAAa;AACjB,IAAI,aAAa;AACjB,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -56,7 +56,7 @@ export { ElColorPicker } from './components/color-picker/index.mjs';
|
|
|
56
56
|
export { messageConfig } from './components/config-provider/src/config-provider.mjs';
|
|
57
57
|
export { configProviderProps } from './components/config-provider/src/config-provider-props.mjs';
|
|
58
58
|
export { configProviderContextKey } from './components/config-provider/src/constants.mjs';
|
|
59
|
-
export { provideGlobalConfig, useGlobalConfig } from './components/config-provider/src/hooks/use-global-config.mjs';
|
|
59
|
+
export { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig } from './components/config-provider/src/hooks/use-global-config.mjs';
|
|
60
60
|
export { ElConfigProvider } from './components/config-provider/index.mjs';
|
|
61
61
|
export { ElAside, ElContainer, ElFooter, ElHeader, ElMain } from './components/container/index.mjs';
|
|
62
62
|
export { countdownEmits, countdownProps } from './components/countdown/src/countdown.mjs';
|
|
@@ -248,7 +248,7 @@ export { useDelayedRender } from './hooks/use-intermediate-render/index.mjs';
|
|
|
248
248
|
export { useDelayedToggle, useDelayedToggleProps } from './hooks/use-delayed-toggle/index.mjs';
|
|
249
249
|
export { FORWARD_REF_INJECTION_KEY, useForwardRef, useForwardRefDirective } from './hooks/use-forward-ref/index.mjs';
|
|
250
250
|
export { defaultNamespace, namespaceContextKey, useGetDerivedNamespace, useNamespace } from './hooks/use-namespace/index.mjs';
|
|
251
|
-
export { useZIndex, zIndexContextKey } from './hooks/use-z-index/index.mjs';
|
|
251
|
+
export { defaultInitialZIndex, useZIndex, zIndexContextKey } from './hooks/use-z-index/index.mjs';
|
|
252
252
|
export { arrowMiddleware, getPositionDataWithUnit, useFloating, useFloatingProps } from './hooks/use-floating/index.mjs';
|
|
253
253
|
export { useCursor } from './hooks/use-cursor/index.mjs';
|
|
254
254
|
export { useOrderedChildren } from './hooks/use-ordered-children/index.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.2.
|
|
1
|
+
export declare const version = "2.2.35";
|
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 = '2.2.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '2.2.35'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -15,6 +15,7 @@ exports.messageConfig = configProvider.messageConfig;
|
|
|
15
15
|
exports.configProviderProps = configProviderProps.configProviderProps;
|
|
16
16
|
exports.configProviderContextKey = constants.configProviderContextKey;
|
|
17
17
|
exports.provideGlobalConfig = useGlobalConfig.provideGlobalConfig;
|
|
18
|
+
exports.useGlobalComponentSettings = useGlobalConfig.useGlobalComponentSettings;
|
|
18
19
|
exports.useGlobalConfig = useGlobalConfig.useGlobalConfig;
|
|
19
20
|
exports.ElConfigProvider = ElConfigProvider;
|
|
20
21
|
exports["default"] = ElConfigProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/config-provider/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\n\nimport ConfigProvider from './src/config-provider'\n\nexport const ElConfigProvider = withInstall(ConfigProvider)\nexport default ElConfigProvider\n\nexport * from './src/config-provider'\nexport * from './src/config-provider-props'\nexport * from './src/constants'\nexport * from './src/hooks/use-global-config'\n"],"names":["withInstall","ConfigProvider"],"mappings":";;;;;;;;;;;AAEY,MAAC,gBAAgB,GAAGA,mBAAW,CAACC,yBAAc
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/config-provider/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\n\nimport ConfigProvider from './src/config-provider'\n\nexport const ElConfigProvider = withInstall(ConfigProvider)\nexport default ElConfigProvider\n\nexport * from './src/config-provider'\nexport * from './src/config-provider-props'\nexport * from './src/constants'\nexport * from './src/hooks/use-global-config'\n"],"names":["withInstall","ConfigProvider"],"mappings":";;;;;;;;;;;AAEY,MAAC,gBAAgB,GAAGA,mBAAW,CAACC,yBAAc;;;;;;;;;;;"}
|
|
@@ -3,4 +3,31 @@ import type { App, Ref } from 'vue';
|
|
|
3
3
|
import type { ConfigProviderContext } from '../constants';
|
|
4
4
|
export declare function useGlobalConfig<K extends keyof ConfigProviderContext, D extends ConfigProviderContext[K]>(key: K, defaultValue?: D): Ref<Exclude<ConfigProviderContext[K], undefined> | D>;
|
|
5
5
|
export declare function useGlobalConfig(): Ref<ConfigProviderContext>;
|
|
6
|
+
export declare function useGlobalComponentSettings(block: string, sizeFallback?: MaybeRef<ConfigProviderContext['size']>): {
|
|
7
|
+
ns: {
|
|
8
|
+
namespace: import("vue").ComputedRef<string>;
|
|
9
|
+
b: (blockSuffix?: string) => string;
|
|
10
|
+
e: (element?: string | undefined) => string;
|
|
11
|
+
m: (modifier?: string | undefined) => string;
|
|
12
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
13
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
14
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
15
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
16
|
+
is: {
|
|
17
|
+
(name: string, state: boolean | undefined): string;
|
|
18
|
+
(name: string): string;
|
|
19
|
+
};
|
|
20
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
21
|
+
cssVarName: (name: string) => string;
|
|
22
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
23
|
+
cssVarBlockName: (name: string) => string;
|
|
24
|
+
};
|
|
25
|
+
locale: import("element-plus/es/hooks").LocaleContext;
|
|
26
|
+
zIndex: {
|
|
27
|
+
initialZIndex: import("vue").ComputedRef<number>;
|
|
28
|
+
currentZIndex: import("vue").ComputedRef<number>;
|
|
29
|
+
nextZIndex: () => number;
|
|
30
|
+
};
|
|
31
|
+
size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
32
|
+
};
|
|
6
33
|
export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContext>, app?: App<any> | undefined, global?: boolean) => import("vue").ComputedRef<Partial<import("../config-provider-props").ConfigProviderProps>> | undefined;
|
|
@@ -6,10 +6,10 @@ var vue = require('vue');
|
|
|
6
6
|
require('../../../../utils/index.js');
|
|
7
7
|
require('../../../../hooks/index.js');
|
|
8
8
|
var constants = require('../constants.js');
|
|
9
|
-
var
|
|
10
|
-
var index = require('../../../../hooks/use-locale/index.js');
|
|
11
|
-
var index$1 = require('../../../../hooks/use-namespace/index.js');
|
|
9
|
+
var index = require('../../../../hooks/use-namespace/index.js');
|
|
10
|
+
var index$1 = require('../../../../hooks/use-locale/index.js');
|
|
12
11
|
var index$2 = require('../../../../hooks/use-z-index/index.js');
|
|
12
|
+
var error = require('../../../../utils/error.js');
|
|
13
13
|
var index$3 = require('../../../../hooks/use-size/index.js');
|
|
14
14
|
var objects = require('../../../../utils/objects.js');
|
|
15
15
|
|
|
@@ -25,6 +25,31 @@ function useGlobalConfig(key, defaultValue = void 0) {
|
|
|
25
25
|
return config;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
function useGlobalComponentSettings(block, sizeFallback) {
|
|
29
|
+
const config = useGlobalConfig();
|
|
30
|
+
const ns = index.useNamespace(block, vue.computed(() => {
|
|
31
|
+
var _a;
|
|
32
|
+
return ((_a = config.value) == null ? void 0 : _a.namespace) || index.defaultNamespace;
|
|
33
|
+
}));
|
|
34
|
+
const locale = index$1.useLocale(vue.computed(() => {
|
|
35
|
+
var _a;
|
|
36
|
+
return (_a = config.value) == null ? void 0 : _a.locale;
|
|
37
|
+
}));
|
|
38
|
+
const zIndex = index$2.useZIndex(vue.computed(() => {
|
|
39
|
+
var _a;
|
|
40
|
+
return ((_a = config.value) == null ? void 0 : _a.zIndex) || index$2.defaultInitialZIndex;
|
|
41
|
+
}));
|
|
42
|
+
const size = vue.computed(() => {
|
|
43
|
+
var _a;
|
|
44
|
+
return vue.unref(sizeFallback) || ((_a = config.value) == null ? void 0 : _a.size) || "";
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
ns,
|
|
48
|
+
locale,
|
|
49
|
+
zIndex,
|
|
50
|
+
size
|
|
51
|
+
};
|
|
52
|
+
}
|
|
28
53
|
const provideGlobalConfig = (config, app, global = false) => {
|
|
29
54
|
var _a;
|
|
30
55
|
const inSetup = !!vue.getCurrentInstance();
|
|
@@ -41,8 +66,8 @@ const provideGlobalConfig = (config, app, global = false) => {
|
|
|
41
66
|
return mergeConfig(oldConfig.value, cfg);
|
|
42
67
|
});
|
|
43
68
|
provideFn(constants.configProviderContextKey, context);
|
|
44
|
-
provideFn(index.localeContextKey, vue.computed(() => context.value.locale));
|
|
45
|
-
provideFn(index
|
|
69
|
+
provideFn(index$1.localeContextKey, vue.computed(() => context.value.locale));
|
|
70
|
+
provideFn(index.namespaceContextKey, vue.computed(() => context.value.namespace));
|
|
46
71
|
provideFn(index$2.zIndexContextKey, vue.computed(() => context.value.zIndex));
|
|
47
72
|
provideFn(index$3.SIZE_INJECTION_KEY, {
|
|
48
73
|
size: vue.computed(() => context.value.size || "")
|
|
@@ -63,5 +88,6 @@ const mergeConfig = (a, b) => {
|
|
|
63
88
|
};
|
|
64
89
|
|
|
65
90
|
exports.provideGlobalConfig = provideGlobalConfig;
|
|
91
|
+
exports.useGlobalComponentSettings = useGlobalComponentSettings;
|
|
66
92
|
exports.useGlobalConfig = useGlobalConfig;
|
|
67
93
|
//# sourceMappingURL=use-global-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-global-config.js","sources":["../../../../../../../packages/components/config-provider/src/hooks/use-global-config.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\nimport { debugWarn, keysOf } from '@element-plus/utils'\nimport {\n SIZE_INJECTION_KEY,\n localeContextKey,\n namespaceContextKey,\n zIndexContextKey,\n} from '@element-plus/hooks'\nimport { configProviderContextKey } from '../constants'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { App, Ref } from 'vue'\nimport type { ConfigProviderContext } from '../constants'\n\n// this is meant to fix global methods like `ElMessage(opts)`, this way we can inject current locale\n// into the component as default injection value.\n// refer to: https://github.com/element-plus/element-plus/issues/2610#issuecomment-887965266\nconst globalConfig = ref<ConfigProviderContext>()\n\nexport function useGlobalConfig<\n K extends keyof ConfigProviderContext,\n D extends ConfigProviderContext[K]\n>(\n key: K,\n defaultValue?: D\n): Ref<Exclude<ConfigProviderContext[K], undefined> | D>\nexport function useGlobalConfig(): Ref<ConfigProviderContext>\nexport function useGlobalConfig(\n key?: keyof ConfigProviderContext,\n defaultValue = undefined\n) {\n const config = getCurrentInstance()\n ? inject(configProviderContextKey, globalConfig)\n : globalConfig\n if (key) {\n return computed(() => config.value?.[key] ?? defaultValue)\n } else {\n return config\n }\n}\n\nexport const provideGlobalConfig = (\n config: MaybeRef<ConfigProviderContext>,\n app?: App,\n global = false\n) => {\n const inSetup = !!getCurrentInstance()\n const oldConfig = inSetup ? useGlobalConfig() : undefined\n\n const provideFn = app?.provide ?? (inSetup ? provide : undefined)\n if (!provideFn) {\n debugWarn(\n 'provideGlobalConfig',\n 'provideGlobalConfig() can only be used inside setup().'\n )\n return\n }\n\n const context = computed(() => {\n const cfg = unref(config)\n if (!oldConfig?.value) return cfg\n return mergeConfig(oldConfig.value, cfg)\n })\n provideFn(configProviderContextKey, context)\n provideFn(\n localeContextKey,\n computed(() => context.value.locale)\n )\n provideFn(\n namespaceContextKey,\n computed(() => context.value.namespace)\n )\n provideFn(\n zIndexContextKey,\n computed(() => context.value.zIndex)\n )\n\n provideFn(SIZE_INJECTION_KEY, {\n size: computed(() => context.value.size || ''),\n })\n\n if (global || !globalConfig.value) {\n globalConfig.value = context.value\n }\n return context\n}\n\nconst mergeConfig = (\n a: ConfigProviderContext,\n b: ConfigProviderContext\n): ConfigProviderContext => {\n const keys = [...new Set([...keysOf(a), ...keysOf(b)])]\n const obj: Record<string, any> = {}\n for (const key of keys) {\n obj[key] = b[key] ?? a[key]\n }\n return obj\n}\n"],"names":["ref","getCurrentInstance","inject","configProviderContextKey","computed","
|
|
1
|
+
{"version":3,"file":"use-global-config.js","sources":["../../../../../../../packages/components/config-provider/src/hooks/use-global-config.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\nimport { debugWarn, keysOf } from '@element-plus/utils'\nimport {\n SIZE_INJECTION_KEY,\n defaultInitialZIndex,\n defaultNamespace,\n localeContextKey,\n namespaceContextKey,\n useLocale,\n useNamespace,\n useZIndex,\n zIndexContextKey,\n} from '@element-plus/hooks'\nimport { configProviderContextKey } from '../constants'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { App, Ref } from 'vue'\nimport type { ConfigProviderContext } from '../constants'\n\n// this is meant to fix global methods like `ElMessage(opts)`, this way we can inject current locale\n// into the component as default injection value.\n// refer to: https://github.com/element-plus/element-plus/issues/2610#issuecomment-887965266\nconst globalConfig = ref<ConfigProviderContext>()\n\nexport function useGlobalConfig<\n K extends keyof ConfigProviderContext,\n D extends ConfigProviderContext[K]\n>(\n key: K,\n defaultValue?: D\n): Ref<Exclude<ConfigProviderContext[K], undefined> | D>\nexport function useGlobalConfig(): Ref<ConfigProviderContext>\nexport function useGlobalConfig(\n key?: keyof ConfigProviderContext,\n defaultValue = undefined\n) {\n const config = getCurrentInstance()\n ? inject(configProviderContextKey, globalConfig)\n : globalConfig\n if (key) {\n return computed(() => config.value?.[key] ?? defaultValue)\n } else {\n return config\n }\n}\n\n// for components like `ElMessage` `ElNotification` `ElMessageBox`.\nexport function useGlobalComponentSettings(\n block: string,\n sizeFallback?: MaybeRef<ConfigProviderContext['size']>\n) {\n const config = useGlobalConfig()\n\n const ns = useNamespace(\n block,\n computed(() => config.value?.namespace || defaultNamespace)\n )\n\n const locale = useLocale(computed(() => config.value?.locale))\n const zIndex = useZIndex(\n computed(() => config.value?.zIndex || defaultInitialZIndex)\n )\n const size = computed(() => unref(sizeFallback) || config.value?.size || '')\n\n return {\n ns,\n locale,\n zIndex,\n size,\n }\n}\n\nexport const provideGlobalConfig = (\n config: MaybeRef<ConfigProviderContext>,\n app?: App,\n global = false\n) => {\n const inSetup = !!getCurrentInstance()\n const oldConfig = inSetup ? useGlobalConfig() : undefined\n\n const provideFn = app?.provide ?? (inSetup ? provide : undefined)\n if (!provideFn) {\n debugWarn(\n 'provideGlobalConfig',\n 'provideGlobalConfig() can only be used inside setup().'\n )\n return\n }\n\n const context = computed(() => {\n const cfg = unref(config)\n if (!oldConfig?.value) return cfg\n return mergeConfig(oldConfig.value, cfg)\n })\n provideFn(configProviderContextKey, context)\n provideFn(\n localeContextKey,\n computed(() => context.value.locale)\n )\n provideFn(\n namespaceContextKey,\n computed(() => context.value.namespace)\n )\n provideFn(\n zIndexContextKey,\n computed(() => context.value.zIndex)\n )\n\n provideFn(SIZE_INJECTION_KEY, {\n size: computed(() => context.value.size || ''),\n })\n\n if (global || !globalConfig.value) {\n globalConfig.value = context.value\n }\n return context\n}\n\nconst mergeConfig = (\n a: ConfigProviderContext,\n b: ConfigProviderContext\n): ConfigProviderContext => {\n const keys = [...new Set([...keysOf(a), ...keysOf(b)])]\n const obj: Record<string, any> = {}\n for (const key of keys) {\n obj[key] = b[key] ?? a[key]\n }\n return obj\n}\n"],"names":["ref","getCurrentInstance","inject","configProviderContextKey","computed","useNamespace","defaultNamespace","useLocale","useZIndex","defaultInitialZIndex","unref","provide","debugWarn","localeContextKey","namespaceContextKey","zIndexContextKey","SIZE_INJECTION_KEY","keysOf"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,YAAY,GAAGA,OAAG,EAAE,CAAC;AACpB,SAAS,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,KAAK,CAAC,EAAE;AAC5D,EAAE,MAAM,MAAM,GAAGC,sBAAkB,EAAE,GAAGC,UAAM,CAACC,kCAAwB,EAAE,YAAY,CAAC,GAAG,YAAY,CAAC;AACtG,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,OAAOC,YAAQ,CAAC,MAAM;AAC1B,MAAM,IAAI,EAAE,EAAE,EAAE,CAAC;AACjB,MAAM,OA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