@tagplus/components 5.3.8 → 5.3.11

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.
Files changed (69) hide show
  1. package/dist/es/node_modules/@element-plus/icons-vue/dist/index.mjs +20 -29
  2. package/dist/es/node_modules/@popperjs/core/dist/index.mjs +586 -0
  3. package/dist/es/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +0 -5
  4. package/dist/es/node_modules/@vueuse/core/index.mjs +58 -103
  5. package/dist/es/node_modules/@vueuse/shared/index.mjs +16 -47
  6. package/dist/es/node_modules/element-plus/es/constants/size.mjs +6 -1
  7. package/dist/es/node_modules/element-plus/es/hooks/use-focus-controller/index.mjs +14 -39
  8. package/dist/es/node_modules/element-plus/es/hooks/use-id/index.mjs +5 -8
  9. package/dist/es/node_modules/element-plus/es/hooks/use-locale/index.mjs +7 -12
  10. package/dist/es/node_modules/element-plus/es/hooks/use-namespace/index.mjs +7 -22
  11. package/dist/es/node_modules/element-plus/es/hooks/use-prop/index.mjs +1 -4
  12. package/dist/es/node_modules/element-plus/es/hooks/use-size/index.mjs +3 -3
  13. package/dist/es/node_modules/element-plus/es/locale/lang/en.mjs +28 -31
  14. package/dist/es/node_modules/element-plus/es/utils/dom/aria.mjs +6 -14
  15. package/dist/es/node_modules/element-plus/es/utils/error.mjs +4 -3
  16. package/dist/es/node_modules/element-plus/es/utils/vue/props/runtime.mjs +19 -25
  17. package/dist/es/src/components/Autosuggest/Autosuggest.vue.mjs +1 -1
  18. package/dist/es/src/components/Autosuggest/autosuggest-props.mjs +2 -2
  19. package/dist/es/src/components/Autosuggest/option.vue.mjs +2 -2
  20. package/dist/es/src/components/Autosuggest/select-dropdown.vue.mjs +2 -2
  21. package/dist/es/src/components/Autosuggest/useSelect.mjs +1 -1
  22. package/dist/es/src/components/Inline/Inline.vue.mjs +1 -1
  23. package/dist/es/src/components/InputNumber/InputNumber.vue.mjs +25 -9
  24. package/dist/es/src/components/InputNumber/input-number.mjs +10 -2
  25. package/dist/es/src/components/Loader/Loader.vue.mjs +1 -1
  26. package/dist/es/src/components/Money/Money.vue.mjs +1 -1
  27. package/dist/es/src/components/OptionsList/OptionsList.vue.mjs +1 -1
  28. package/dist/es/src/components/OptionsListItem/OptionsListItem.vue.mjs +1 -1
  29. package/dist/es/src/components/Percent/Percent.vue.mjs +3 -3
  30. package/dist/es/src/components/Skeleton/Skeleton.vue.mjs +1 -1
  31. package/dist/es/src/components/Step/Step.vue.mjs +1 -1
  32. package/dist/es/src/components/Tip/Tip.vue.mjs +7 -9
  33. package/dist/es/src/utils/constants.mjs +2 -2
  34. package/dist/es/src/utils/use-derived-namespace.mjs +1 -1
  35. package/dist/es/src/utils/use-form-common-props.mjs +1 -1
  36. package/dist/es/src/utils/use-id.mjs +2 -2
  37. package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +19 -28
  38. package/dist/lib/node_modules/@popperjs/core/dist/index.js +586 -0
  39. package/dist/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -5
  40. package/dist/lib/node_modules/@vueuse/core/index.js +56 -100
  41. package/dist/lib/node_modules/@vueuse/shared/index.js +15 -46
  42. package/dist/lib/node_modules/element-plus/es/constants/size.js +6 -1
  43. package/dist/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +14 -39
  44. package/dist/lib/node_modules/element-plus/es/hooks/use-id/index.js +5 -8
  45. package/dist/lib/node_modules/element-plus/es/hooks/use-locale/index.js +6 -11
  46. package/dist/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +7 -22
  47. package/dist/lib/node_modules/element-plus/es/hooks/use-prop/index.js +1 -4
  48. package/dist/lib/node_modules/element-plus/es/hooks/use-size/index.js +3 -3
  49. package/dist/lib/node_modules/element-plus/es/locale/lang/en.js +28 -31
  50. package/dist/lib/node_modules/element-plus/es/utils/dom/aria.js +6 -14
  51. package/dist/lib/node_modules/element-plus/es/utils/error.js +4 -3
  52. package/dist/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +19 -25
  53. package/dist/lib/src/components/Autosuggest/autosuggest-props.js +2 -2
  54. package/dist/lib/src/components/Autosuggest/option.vue.js +2 -2
  55. package/dist/lib/src/components/Autosuggest/select-dropdown.vue.js +1 -1
  56. package/dist/lib/src/components/Autosuggest/useSelect.js +1 -1
  57. package/dist/lib/src/components/InputNumber/InputNumber.vue.js +24 -8
  58. package/dist/lib/src/components/InputNumber/input-number.js +10 -2
  59. package/dist/lib/src/components/Percent/Percent.vue.js +2 -2
  60. package/dist/lib/src/components/Tip/Tip.vue.js +6 -8
  61. package/dist/lib/src/utils/constants.js +2 -2
  62. package/dist/lib/src/utils/use-derived-namespace.js +1 -1
  63. package/dist/lib/src/utils/use-form-common-props.js +1 -1
  64. package/dist/lib/src/utils/use-id.js +1 -1
  65. package/package.json +1 -1
  66. package/dist/es/node_modules/@popperjs/core/lib/enums.mjs +0 -22
  67. package/dist/es/node_modules/element-plus/es/utils/types.mjs +0 -9
  68. package/dist/lib/node_modules/@popperjs/core/lib/enums.js +0 -22
  69. package/dist/lib/node_modules/element-plus/es/utils/types.js +0 -9
@@ -1,18 +1,18 @@
1
- import { tryOnScopeDispose, isClient, tryOnMounted, resolveUnref, isString, noop, identity } from "../shared/index.mjs";
1
+ import { toValue, tryOnScopeDispose, isClient, noop, isObject } from "../shared/index.mjs";
2
2
  import { computedEager, computedEager as computedEager2 } from "../shared/index.mjs";
3
- import { watch, ref } from "vue";
3
+ import { computed, watch, ref, getCurrentInstance, onMounted } from "vue";
4
+ const defaultWindow = isClient ? window : void 0;
4
5
  function unrefElement(elRef) {
5
6
  var _a;
6
- const plain = resolveUnref(elRef);
7
+ const plain = toValue(elRef);
7
8
  return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
8
9
  }
9
- const defaultWindow = isClient ? window : void 0;
10
10
  function useEventListener(...args) {
11
11
  let target;
12
12
  let events;
13
13
  let listeners;
14
14
  let options;
15
- if (isString(args[0]) || Array.isArray(args[0])) {
15
+ if (typeof args[0] === "string" || Array.isArray(args[0])) {
16
16
  [events, listeners, options] = args;
17
17
  target = defaultWindow;
18
18
  } else {
@@ -33,14 +33,21 @@ function useEventListener(...args) {
33
33
  el.addEventListener(event, listener, options2);
34
34
  return () => el.removeEventListener(event, listener, options2);
35
35
  };
36
- const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
37
- cleanup();
38
- if (!el)
39
- return;
40
- cleanups.push(...events.flatMap((event) => {
41
- return listeners.map((listener) => register(el, event, listener, options2));
42
- }));
43
- }, { immediate: true, flush: "post" });
36
+ const stopWatch = watch(
37
+ () => [unrefElement(target), toValue(options)],
38
+ ([el, options2]) => {
39
+ cleanup();
40
+ if (!el)
41
+ return;
42
+ const optionsClone = isObject(options2) ? { ...options2 } : options2;
43
+ cleanups.push(
44
+ ...events.flatMap((event) => {
45
+ return listeners.map((listener) => register(el, event, listener, optionsClone));
46
+ })
47
+ );
48
+ },
49
+ { immediate: true, flush: "post" }
50
+ );
44
51
  const stop = () => {
45
52
  stopWatch();
46
53
  cleanup();
@@ -48,33 +55,25 @@ function useEventListener(...args) {
48
55
  tryOnScopeDispose(stop);
49
56
  return stop;
50
57
  }
51
- function useSupported(callback, sync = false) {
52
- const isSupported = ref();
53
- const update = () => isSupported.value = Boolean(callback());
54
- update();
55
- tryOnMounted(update, sync);
56
- return isSupported;
58
+ function useMounted() {
59
+ const isMounted = ref(false);
60
+ const instance = getCurrentInstance();
61
+ if (instance) {
62
+ onMounted(() => {
63
+ isMounted.value = true;
64
+ }, instance);
65
+ }
66
+ return isMounted;
67
+ }
68
+ function useSupported(callback) {
69
+ const isMounted = useMounted();
70
+ return computed(() => {
71
+ isMounted.value;
72
+ return Boolean(callback());
73
+ });
57
74
  }
58
- const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
59
- const globalKey = "__vueuse_ssr_handlers__";
60
- _global[globalKey] = _global[globalKey] || {};
61
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
62
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
63
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
64
- var __objRest$2 = (source, exclude) => {
65
- var target = {};
66
- for (var prop in source)
67
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
68
- target[prop] = source[prop];
69
- if (source != null && __getOwnPropSymbols$g)
70
- for (var prop of __getOwnPropSymbols$g(source)) {
71
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
72
- target[prop] = source[prop];
73
- }
74
- return target;
75
- };
76
75
  function useResizeObserver(target, callback, options = {}) {
77
- const _a = options, { window: window2 = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]);
76
+ const { window: window2 = defaultWindow, ...observerOptions } = options;
78
77
  let observer;
79
78
  const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
80
79
  const cleanup = () => {
@@ -83,13 +82,24 @@ function useResizeObserver(target, callback, options = {}) {
83
82
  observer = void 0;
84
83
  }
85
84
  };
86
- const stopWatch = watch(() => unrefElement(target), (el) => {
87
- cleanup();
88
- if (isSupported.value && window2 && el) {
89
- observer = new ResizeObserver(callback);
90
- observer.observe(el, observerOptions);
91
- }
92
- }, { immediate: true, flush: "post" });
85
+ const targets = computed(() => {
86
+ const _targets = toValue(target);
87
+ return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
88
+ });
89
+ const stopWatch = watch(
90
+ targets,
91
+ (els) => {
92
+ cleanup();
93
+ if (isSupported.value && window2) {
94
+ observer = new ResizeObserver(callback);
95
+ for (const _el of els) {
96
+ if (_el)
97
+ observer.observe(_el, observerOptions);
98
+ }
99
+ }
100
+ },
101
+ { immediate: true, flush: "post" }
102
+ );
93
103
  const stop = () => {
94
104
  cleanup();
95
105
  stopWatch();
@@ -100,73 +110,18 @@ function useResizeObserver(target, callback, options = {}) {
100
110
  stop
101
111
  };
102
112
  }
103
- var SwipeDirection;
104
- (function(SwipeDirection2) {
105
- SwipeDirection2["UP"] = "UP";
106
- SwipeDirection2["RIGHT"] = "RIGHT";
107
- SwipeDirection2["DOWN"] = "DOWN";
108
- SwipeDirection2["LEFT"] = "LEFT";
109
- SwipeDirection2["NONE"] = "NONE";
110
- })(SwipeDirection || (SwipeDirection = {}));
111
- var __defProp = Object.defineProperty;
112
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
113
- var __hasOwnProp = Object.prototype.hasOwnProperty;
114
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
115
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
116
- var __spreadValues = (a, b) => {
117
- for (var prop in b || (b = {}))
118
- if (__hasOwnProp.call(b, prop))
119
- __defNormalProp(a, prop, b[prop]);
120
- if (__getOwnPropSymbols)
121
- for (var prop of __getOwnPropSymbols(b)) {
122
- if (__propIsEnum.call(b, prop))
123
- __defNormalProp(a, prop, b[prop]);
124
- }
125
- return a;
126
- };
127
- const _TransitionPresets = {
128
- easeInSine: [0.12, 0, 0.39, 0],
129
- easeOutSine: [0.61, 1, 0.88, 1],
130
- easeInOutSine: [0.37, 0, 0.63, 1],
131
- easeInQuad: [0.11, 0, 0.5, 0],
132
- easeOutQuad: [0.5, 1, 0.89, 1],
133
- easeInOutQuad: [0.45, 0, 0.55, 1],
134
- easeInCubic: [0.32, 0, 0.67, 0],
135
- easeOutCubic: [0.33, 1, 0.68, 1],
136
- easeInOutCubic: [0.65, 0, 0.35, 1],
137
- easeInQuart: [0.5, 0, 0.75, 0],
138
- easeOutQuart: [0.25, 1, 0.5, 1],
139
- easeInOutQuart: [0.76, 0, 0.24, 1],
140
- easeInQuint: [0.64, 0, 0.78, 0],
141
- easeOutQuint: [0.22, 1, 0.36, 1],
142
- easeInOutQuint: [0.83, 0, 0.17, 1],
143
- easeInExpo: [0.7, 0, 0.84, 0],
144
- easeOutExpo: [0.16, 1, 0.3, 1],
145
- easeInOutExpo: [0.87, 0, 0.13, 1],
146
- easeInCirc: [0.55, 0, 1, 0.45],
147
- easeOutCirc: [0, 0.55, 0.45, 1],
148
- easeInOutCirc: [0.85, 0, 0.15, 1],
149
- easeInBack: [0.36, 0, 0.66, -0.56],
150
- easeOutBack: [0.34, 1.56, 0.64, 1],
151
- easeInOutBack: [0.68, -0.6, 0.32, 1.6]
152
- };
153
- __spreadValues({
154
- linear: identity
155
- }, _TransitionPresets);
156
113
  export {
157
- SwipeDirection,
158
114
  computedEager,
159
115
  defaultWindow,
160
116
  computedEager2 as eagerComputed,
161
- identity,
162
117
  isClient,
163
- isString,
118
+ isObject,
164
119
  noop,
165
- resolveUnref,
166
- tryOnMounted,
120
+ toValue,
167
121
  tryOnScopeDispose,
168
122
  unrefElement,
169
123
  useEventListener,
124
+ useMounted,
170
125
  useResizeObserver,
171
126
  useSupported
172
127
  };
@@ -1,45 +1,15 @@
1
- import { getCurrentScope, onScopeDispose, shallowRef, watchEffect, readonly, getCurrentInstance, onMounted, nextTick, unref } from "vue";
2
- var __defProp$9 = Object.defineProperty;
3
- var __defProps$6 = Object.defineProperties;
4
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
6
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
7
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues$9 = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp$b.call(b, prop))
12
- __defNormalProp$9(a, prop, b[prop]);
13
- if (__getOwnPropSymbols$b)
14
- for (var prop of __getOwnPropSymbols$b(b)) {
15
- if (__propIsEnum$b.call(b, prop))
16
- __defNormalProp$9(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1
+ import { unref, getCurrentScope, onScopeDispose, shallowRef, watchEffect, readonly } from "vue";
21
2
  function computedEager(fn, options) {
22
- var _a2;
3
+ var _a;
23
4
  const result = shallowRef();
24
5
  watchEffect(() => {
25
6
  result.value = fn();
26
- }, __spreadProps$6(__spreadValues$9({}, options), {
27
- flush: (_a2 = void 0) != null ? _a2 : "sync"
28
- }));
7
+ }, {
8
+ ...options,
9
+ flush: (_a = void 0) != null ? _a : "sync"
10
+ });
29
11
  return readonly(result);
30
12
  }
31
- var _a;
32
- const isClient = typeof window !== "undefined";
33
- const isString = (val) => typeof val === "string";
34
- const noop = () => {
35
- };
36
- isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
37
- function resolveUnref(r) {
38
- return typeof r === "function" ? r() : unref(r);
39
- }
40
- function identity(arg) {
41
- return arg;
42
- }
43
13
  function tryOnScopeDispose(fn) {
44
14
  if (getCurrentScope()) {
45
15
  onScopeDispose(fn);
@@ -47,22 +17,21 @@ function tryOnScopeDispose(fn) {
47
17
  }
48
18
  return false;
49
19
  }
50
- function tryOnMounted(fn, sync = true) {
51
- if (getCurrentInstance())
52
- onMounted(fn);
53
- else if (sync)
54
- fn();
55
- else
56
- nextTick(fn);
20
+ function toValue(r) {
21
+ return typeof r === "function" ? r() : unref(r);
57
22
  }
23
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
24
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
25
+ const toString = Object.prototype.toString;
26
+ const isObject = (val) => toString.call(val) === "[object Object]";
27
+ const noop = () => {
28
+ };
58
29
  export {
59
30
  computedEager,
60
31
  computedEager as eagerComputed,
61
- identity,
62
32
  isClient,
63
- isString,
33
+ isObject,
64
34
  noop,
65
- resolveUnref,
66
- tryOnMounted,
35
+ toValue,
67
36
  tryOnScopeDispose
68
37
  };
@@ -1,4 +1,9 @@
1
- const componentSizes = ["", "default", "small", "large"];
1
+ const componentSizes = [
2
+ "",
3
+ "default",
4
+ "small",
5
+ "large"
6
+ ];
2
7
  export {
3
8
  componentSizes
4
9
  };
@@ -1,63 +1,38 @@
1
- import { getCurrentInstance, shallowRef, ref, watch, unref, onMounted } from "vue";
2
- import { useEventListener } from "../../../../@vueuse/core/index.mjs";
3
- import { isElement } from "../../utils/types.mjs";
4
1
  import { isFocusable } from "../../utils/dom/aria.mjs";
5
2
  import { isFunction } from "../../../../@vue/shared/dist/shared.esm-bundler.mjs";
6
- function useFocusController(target, {
7
- disabled,
8
- beforeFocus,
9
- afterFocus,
10
- beforeBlur,
11
- afterBlur
12
- } = {}) {
13
- const instance = getCurrentInstance();
14
- const { emit } = instance;
3
+ import "lodash-es";
4
+ import { useEventListener } from "../../../../@vueuse/core/index.mjs";
5
+ import { getCurrentInstance, shallowRef, ref, watch, unref } from "vue";
6
+ function useFocusController(target, { disabled, beforeFocus, afterFocus, beforeBlur, afterBlur } = {}) {
7
+ const { emit } = getCurrentInstance();
15
8
  const wrapperRef = shallowRef();
16
9
  const isFocused = ref(false);
17
10
  const handleFocus = (event) => {
18
11
  const cancelFocus = isFunction(beforeFocus) ? beforeFocus(event) : false;
19
- if (unref(disabled) || isFocused.value || cancelFocus)
20
- return;
12
+ if (unref(disabled) || isFocused.value || cancelFocus) return;
21
13
  isFocused.value = true;
22
14
  emit("focus", event);
23
- afterFocus == null ? void 0 : afterFocus();
15
+ afterFocus?.();
24
16
  };
25
17
  const handleBlur = (event) => {
26
- var _a;
27
18
  const cancelBlur = isFunction(beforeBlur) ? beforeBlur(event) : false;
28
- if (unref(disabled) || event.relatedTarget && ((_a = wrapperRef.value) == null ? void 0 : _a.contains(event.relatedTarget)) || cancelBlur)
29
- return;
19
+ if (unref(disabled) || event.relatedTarget && wrapperRef.value?.contains(event.relatedTarget) || cancelBlur) return;
30
20
  isFocused.value = false;
31
21
  emit("blur", event);
32
- afterBlur == null ? void 0 : afterBlur();
22
+ afterBlur?.();
33
23
  };
34
24
  const handleClick = (event) => {
35
- var _a, _b;
36
- if (unref(disabled) || isFocusable(event.target) || ((_a = wrapperRef.value) == null ? void 0 : _a.contains(document.activeElement)) && wrapperRef.value !== document.activeElement)
37
- return;
38
- (_b = target.value) == null ? void 0 : _b.focus();
25
+ if (unref(disabled) || isFocusable(event.target) || wrapperRef.value?.contains(document.activeElement) && wrapperRef.value !== document.activeElement) return;
26
+ target.value?.focus();
39
27
  };
40
28
  watch([wrapperRef, () => unref(disabled)], ([el, disabled2]) => {
41
- if (!el)
42
- return;
43
- if (disabled2) {
44
- el.removeAttribute("tabindex");
45
- } else {
46
- el.setAttribute("tabindex", "-1");
47
- }
29
+ if (!el) return;
30
+ if (disabled2) el.removeAttribute("tabindex");
31
+ else el.setAttribute("tabindex", "-1");
48
32
  });
49
33
  useEventListener(wrapperRef, "focus", handleFocus, true);
50
34
  useEventListener(wrapperRef, "blur", handleBlur, true);
51
35
  useEventListener(wrapperRef, "click", handleClick, true);
52
- if (process.env.NODE_ENV === "test") {
53
- onMounted(() => {
54
- const targetEl = isElement(target.value) ? target.value : document.querySelector("input,textarea");
55
- if (targetEl) {
56
- useEventListener(targetEl, "focus", handleFocus, true);
57
- useEventListener(targetEl, "blur", handleBlur, true);
58
- }
59
- });
60
- }
61
36
  return {
62
37
  isFocused,
63
38
  wrapperRef,
@@ -1,27 +1,24 @@
1
- import { inject, getCurrentInstance, unref } from "vue";
2
- import { useGetDerivedNamespace } from "../use-namespace/index.mjs";
3
1
  import { debugWarn } from "../../utils/error.mjs";
2
+ import { useGetDerivedNamespace } from "../use-namespace/index.mjs";
3
+ import { getCurrentInstance, inject, unref } from "vue";
4
4
  import { isClient, computedEager } from "../../../../@vueuse/shared/index.mjs";
5
5
  const defaultIdInjection = {
6
6
  prefix: Math.floor(Math.random() * 1e4),
7
7
  current: 0
8
8
  };
9
- const ID_INJECTION_KEY = Symbol("elIdInjection");
9
+ const ID_INJECTION_KEY = /* @__PURE__ */ Symbol("elIdInjection");
10
10
  const useIdInjection = () => {
11
11
  return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
12
12
  };
13
13
  const useId = (deterministicId) => {
14
14
  const idInjection = useIdInjection();
15
- if (!isClient && idInjection === defaultIdInjection) {
16
- debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
15
+ if (!isClient && idInjection === defaultIdInjection) debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
17
16
  usage: app.provide(ID_INJECTION_KEY, {
18
17
  prefix: number,
19
18
  current: number,
20
19
  })`);
21
- }
22
20
  const namespace = useGetDerivedNamespace();
23
- const idRef = computedEager(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
24
- return idRef;
21
+ return computedEager(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
25
22
  };
26
23
  export {
27
24
  ID_INJECTION_KEY,
@@ -1,24 +1,19 @@
1
- import { inject, ref, computed, unref, isRef } from "vue";
1
+ import en_default from "../../locale/lang/en.mjs";
2
2
  import { get } from "lodash-es";
3
- import English from "../../locale/lang/en.mjs";
3
+ import { inject, ref, computed, isRef, unref } from "vue";
4
4
  const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
5
- const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
6
- var _a;
7
- return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
8
- });
5
+ const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => `${option?.[key] ?? `{${key}}`}`);
9
6
  const buildLocaleContext = (locale) => {
10
- const lang = computed(() => unref(locale).name);
11
- const localeRef = isRef(locale) ? locale : ref(locale);
12
7
  return {
13
- lang,
14
- locale: localeRef,
8
+ lang: computed(() => unref(locale).name),
9
+ locale: isRef(locale) ? locale : ref(locale),
15
10
  t: buildTranslator(locale)
16
11
  };
17
12
  };
18
- const localeContextKey = Symbol("localeContextKey");
13
+ const localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
19
14
  const useLocale = (localeOverrides) => {
20
15
  const locale = inject(localeContextKey, ref());
21
- return buildLocaleContext(computed(() => locale.value || English));
16
+ return buildLocaleContext(computed(() => locale.value || en_default));
22
17
  };
23
18
  export {
24
19
  buildLocaleContext,
@@ -3,24 +3,17 @@ const defaultNamespace = "el";
3
3
  const statePrefix = "is-";
4
4
  const _bem = (namespace, block, blockSuffix, element, modifier) => {
5
5
  let cls = `${namespace}-${block}`;
6
- if (blockSuffix) {
7
- cls += `-${blockSuffix}`;
8
- }
9
- if (element) {
10
- cls += `__${element}`;
11
- }
12
- if (modifier) {
13
- cls += `--${modifier}`;
14
- }
6
+ if (blockSuffix) cls += `-${blockSuffix}`;
7
+ if (element) cls += `__${element}`;
8
+ if (modifier) cls += `--${modifier}`;
15
9
  return cls;
16
10
  };
17
- const namespaceContextKey = Symbol("namespaceContextKey");
11
+ const namespaceContextKey = /* @__PURE__ */ Symbol("namespaceContextKey");
18
12
  const useGetDerivedNamespace = (namespaceOverrides) => {
19
13
  const derivedNamespace = getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace);
20
- const namespace = computed(() => {
14
+ return computed(() => {
21
15
  return unref(derivedNamespace) || defaultNamespace;
22
16
  });
23
- return namespace;
24
17
  };
25
18
  const useNamespace = (block, namespaceOverrides) => {
26
19
  const namespace = useGetDerivedNamespace();
@@ -37,20 +30,12 @@ const useNamespace = (block, namespaceOverrides) => {
37
30
  };
38
31
  const cssVar = (object) => {
39
32
  const styles = {};
40
- for (const key in object) {
41
- if (object[key]) {
42
- styles[`--${namespace.value}-${key}`] = object[key];
43
- }
44
- }
33
+ for (const key in object) if (object[key]) styles[`--${namespace.value}-${key}`] = object[key];
45
34
  return styles;
46
35
  };
47
36
  const cssVarBlock = (object) => {
48
37
  const styles = {};
49
- for (const key in object) {
50
- if (object[key]) {
51
- styles[`--${namespace.value}-${block}-${key}`] = object[key];
52
- }
53
- }
38
+ for (const key in object) if (object[key]) styles[`--${namespace.value}-${block}-${key}`] = object[key];
54
39
  return styles;
55
40
  };
56
41
  const cssVarName = (name) => `--${namespace.value}-${name}`;
@@ -1,10 +1,7 @@
1
1
  import { getCurrentInstance, computed } from "vue";
2
2
  const useProp = (name) => {
3
3
  const vm = getCurrentInstance();
4
- return computed(() => {
5
- var _a, _b;
6
- return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name];
7
- });
4
+ return computed(() => vm?.proxy?.$props?.[name]);
8
5
  };
9
6
  export {
10
7
  useProp
@@ -1,12 +1,12 @@
1
- import { inject, computed, unref } from "vue";
2
- import { buildProp } from "../../utils/vue/props/runtime.mjs";
3
1
  import { componentSizes } from "../../constants/size.mjs";
2
+ import { buildProp } from "../../utils/vue/props/runtime.mjs";
3
+ import { inject, computed, unref } from "vue";
4
4
  const useSizeProp = buildProp({
5
5
  type: String,
6
6
  values: componentSizes,
7
7
  required: false
8
8
  });
9
- const SIZE_INJECTION_KEY = Symbol("size");
9
+ const SIZE_INJECTION_KEY = /* @__PURE__ */ Symbol("size");
10
10
  const useGlobalSize = () => {
11
11
  const injectedSize = inject(SIZE_INJECTION_KEY, {});
12
12
  return computed(() => {
@@ -1,15 +1,19 @@
1
- var English = {
1
+ var en_default = {
2
2
  name: "en",
3
3
  el: {
4
- breadcrumb: {
5
- label: "Breadcrumb"
6
- },
4
+ breadcrumb: { label: "Breadcrumb" },
7
5
  colorpicker: {
8
6
  confirm: "OK",
9
7
  clear: "Clear",
10
8
  defaultLabel: "color picker",
11
9
  description: "current color is {color}. press enter to select a new color.",
12
- alphaLabel: "pick alpha value"
10
+ alphaLabel: "pick alpha value",
11
+ alphaDescription: "alpha {alpha}, current color is {color}",
12
+ hueLabel: "pick hue value",
13
+ hueDescription: "hue {hue}, current color is {color}",
14
+ svLabel: "pick saturation and brightness value",
15
+ svDescription: "saturation {saturation}, brightness {brightness}, current color is {color}",
16
+ predefineDescription: "select {value} as the color"
13
17
  },
14
18
  datepicker: {
15
19
  now: "Now",
@@ -44,7 +48,6 @@ var English = {
44
48
  month10: "October",
45
49
  month11: "November",
46
50
  month12: "December",
47
- week: "week",
48
51
  weeks: {
49
52
  sun: "Sun",
50
53
  mon: "Mon",
@@ -88,12 +91,8 @@ var English = {
88
91
  noData: "No data",
89
92
  placeholder: "Select"
90
93
  },
91
- mention: {
92
- loading: "Loading"
93
- },
94
- dropdown: {
95
- toggleDropdown: "Toggle Dropdown"
96
- },
94
+ mention: { loading: "Loading" },
95
+ dropdown: { toggleDropdown: "Toggle Dropdown" },
97
96
  cascader: {
98
97
  noMatch: "No matching data",
99
98
  loading: "Loading",
@@ -113,12 +112,8 @@ var English = {
113
112
  nextPages: "Next {pager} pages",
114
113
  deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
115
114
  },
116
- dialog: {
117
- close: "Close this dialog"
118
- },
119
- drawer: {
120
- close: "Close this dialog"
121
- },
115
+ dialog: { close: "Close this dialog" },
116
+ drawer: { close: "Close this dialog" },
122
117
  messagebox: {
123
118
  title: "Message",
124
119
  confirm: "OK",
@@ -142,16 +137,22 @@ var English = {
142
137
  confirmFilter: "Confirm",
143
138
  resetFilter: "Reset",
144
139
  clearFilter: "All",
145
- sumText: "Sum"
146
- },
140
+ sumText: "Sum",
141
+ selectAllLabel: "Select all rows",
142
+ selectRowLabel: "Select this row",
143
+ expandRowLabel: "Expand this row",
144
+ collapseRowLabel: "Collapse this row",
145
+ sortLabel: "Sort by {column}",
146
+ filterLabel: "Filter by {column}"
147
+ },
148
+ tag: { close: "Close this tag" },
147
149
  tour: {
148
150
  next: "Next",
149
151
  previous: "Previous",
150
- finish: "Finish"
151
- },
152
- tree: {
153
- emptyText: "No Data"
152
+ finish: "Finish",
153
+ close: "Close this dialog"
154
154
  },
155
+ tree: { emptyText: "No Data" },
155
156
  transfer: {
156
157
  noMatch: "No matching data",
157
158
  noData: "No data",
@@ -160,12 +161,8 @@ var English = {
160
161
  noCheckedFormat: "{total} items",
161
162
  hasCheckedFormat: "{checked}/{total} checked"
162
163
  },
163
- image: {
164
- error: "FAILED"
165
- },
166
- pageHeader: {
167
- title: "Back"
168
- },
164
+ image: { error: "FAILED" },
165
+ pageHeader: { title: "Back" },
169
166
  popconfirm: {
170
167
  confirmButtonText: "Yes",
171
168
  cancelButtonText: "No"
@@ -178,5 +175,5 @@ var English = {
178
175
  }
179
176
  };
180
177
  export {
181
- English as default
178
+ en_default as default
182
179
  };