@tagplus/components 5.3.11 → 5.3.12

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 +29 -20
  2. package/dist/es/node_modules/@popperjs/core/lib/enums.mjs +22 -0
  3. package/dist/es/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +5 -0
  4. package/dist/es/node_modules/@vueuse/core/index.mjs +103 -58
  5. package/dist/es/node_modules/@vueuse/shared/index.mjs +47 -16
  6. package/dist/es/node_modules/element-plus/es/constants/size.mjs +1 -6
  7. package/dist/es/node_modules/element-plus/es/hooks/use-focus-controller/index.mjs +39 -14
  8. package/dist/es/node_modules/element-plus/es/hooks/use-id/index.mjs +8 -5
  9. package/dist/es/node_modules/element-plus/es/hooks/use-locale/index.mjs +12 -7
  10. package/dist/es/node_modules/element-plus/es/hooks/use-namespace/index.mjs +22 -7
  11. package/dist/es/node_modules/element-plus/es/hooks/use-prop/index.mjs +4 -1
  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 +31 -28
  14. package/dist/es/node_modules/element-plus/es/utils/dom/aria.mjs +14 -6
  15. package/dist/es/node_modules/element-plus/es/utils/error.mjs +3 -4
  16. package/dist/es/node_modules/element-plus/es/utils/types.mjs +9 -0
  17. package/dist/es/node_modules/element-plus/es/utils/vue/props/runtime.mjs +25 -19
  18. package/dist/es/src/components/Autosuggest/Autosuggest.vue.mjs +1 -1
  19. package/dist/es/src/components/Autosuggest/autosuggest-props.mjs +2 -2
  20. package/dist/es/src/components/Autosuggest/option.vue.mjs +2 -2
  21. package/dist/es/src/components/Autosuggest/select-dropdown.vue.mjs +2 -2
  22. package/dist/es/src/components/Autosuggest/useSelect.mjs +1 -1
  23. package/dist/es/src/components/Inline/Inline.vue.mjs +1 -1
  24. package/dist/es/src/components/InputNumber/InputNumber.vue.mjs +2 -2
  25. package/dist/es/src/components/InputNumber/input-number.mjs +1 -1
  26. package/dist/es/src/components/Loader/Loader.vue.mjs +1 -1
  27. package/dist/es/src/components/Money/Money.vue.mjs +1 -1
  28. package/dist/es/src/components/OptionsList/OptionsList.vue.mjs +1 -1
  29. package/dist/es/src/components/OptionsListItem/OptionsListItem.vue.mjs +1 -1
  30. package/dist/es/src/components/Percent/Percent.vue.mjs +3 -3
  31. package/dist/es/src/components/Skeleton/Skeleton.vue.mjs +1 -1
  32. package/dist/es/src/components/Step/Step.vue.mjs +1 -1
  33. package/dist/es/src/components/Tip/Tip.vue.mjs +9 -7
  34. package/dist/es/src/utils/constants.mjs +2 -2
  35. package/dist/es/src/utils/use-derived-namespace.mjs +1 -1
  36. package/dist/es/src/utils/use-form-common-props.mjs +1 -1
  37. package/dist/es/src/utils/use-id.mjs +2 -2
  38. package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +28 -19
  39. package/dist/lib/node_modules/@popperjs/core/lib/enums.js +22 -0
  40. package/dist/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +5 -0
  41. package/dist/lib/node_modules/@vueuse/core/index.js +100 -56
  42. package/dist/lib/node_modules/@vueuse/shared/index.js +46 -15
  43. package/dist/lib/node_modules/element-plus/es/constants/size.js +1 -6
  44. package/dist/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +39 -14
  45. package/dist/lib/node_modules/element-plus/es/hooks/use-id/index.js +8 -5
  46. package/dist/lib/node_modules/element-plus/es/hooks/use-locale/index.js +11 -6
  47. package/dist/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +22 -7
  48. package/dist/lib/node_modules/element-plus/es/hooks/use-prop/index.js +4 -1
  49. package/dist/lib/node_modules/element-plus/es/hooks/use-size/index.js +3 -3
  50. package/dist/lib/node_modules/element-plus/es/locale/lang/en.js +31 -28
  51. package/dist/lib/node_modules/element-plus/es/utils/dom/aria.js +14 -6
  52. package/dist/lib/node_modules/element-plus/es/utils/error.js +3 -4
  53. package/dist/lib/node_modules/element-plus/es/utils/types.js +9 -0
  54. package/dist/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +25 -19
  55. package/dist/lib/src/components/Autosuggest/autosuggest-props.js +2 -2
  56. package/dist/lib/src/components/Autosuggest/option.vue.js +2 -2
  57. package/dist/lib/src/components/Autosuggest/select-dropdown.vue.js +1 -1
  58. package/dist/lib/src/components/Autosuggest/useSelect.js +1 -1
  59. package/dist/lib/src/components/InputNumber/InputNumber.vue.js +1 -1
  60. package/dist/lib/src/components/InputNumber/input-number.js +1 -1
  61. package/dist/lib/src/components/Percent/Percent.vue.js +2 -2
  62. package/dist/lib/src/components/Tip/Tip.vue.js +8 -6
  63. package/dist/lib/src/utils/constants.js +2 -2
  64. package/dist/lib/src/utils/use-derived-namespace.js +1 -1
  65. package/dist/lib/src/utils/use-form-common-props.js +1 -1
  66. package/dist/lib/src/utils/use-id.js +1 -1
  67. package/package.json +1 -2
  68. package/dist/es/node_modules/@popperjs/core/dist/index.mjs +0 -586
  69. package/dist/lib/node_modules/@popperjs/core/dist/index.js +0 -586
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var top = "top";
4
+ var bottom = "bottom";
5
+ var right = "right";
6
+ var left = "left";
7
+ var auto = "auto";
8
+ var basePlacements = [top, bottom, right, left];
9
+ var start = "start";
10
+ var end = "end";
11
+ var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
12
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
13
+ }, []);
14
+ exports.auto = auto;
15
+ exports.basePlacements = basePlacements;
16
+ exports.bottom = bottom;
17
+ exports.end = end;
18
+ exports.left = left;
19
+ exports.placements = placements;
20
+ exports.right = right;
21
+ exports.start = start;
22
+ exports.top = top;
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ /**
4
+ * @vue/shared v3.5.13
5
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
6
+ * @license MIT
7
+ **/
3
8
  !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
4
9
  !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
5
10
  const hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -2,18 +2,18 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("../shared/index.js");
4
4
  const vue = require("vue");
5
- const defaultWindow = index.isClient ? window : void 0;
6
5
  function unrefElement(elRef) {
7
6
  var _a;
8
- const plain = index.toValue(elRef);
7
+ const plain = index.resolveUnref(elRef);
9
8
  return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
10
9
  }
10
+ const defaultWindow = index.isClient ? window : void 0;
11
11
  function useEventListener(...args) {
12
12
  let target;
13
13
  let events;
14
14
  let listeners;
15
15
  let options;
16
- if (typeof args[0] === "string" || Array.isArray(args[0])) {
16
+ if (index.isString(args[0]) || Array.isArray(args[0])) {
17
17
  [events, listeners, options] = args;
18
18
  target = defaultWindow;
19
19
  } else {
@@ -34,21 +34,14 @@ function useEventListener(...args) {
34
34
  el.addEventListener(event, listener, options2);
35
35
  return () => el.removeEventListener(event, listener, options2);
36
36
  };
37
- const stopWatch = vue.watch(
38
- () => [unrefElement(target), index.toValue(options)],
39
- ([el, options2]) => {
40
- cleanup();
41
- if (!el)
42
- return;
43
- const optionsClone = index.isObject(options2) ? { ...options2 } : options2;
44
- cleanups.push(
45
- ...events.flatMap((event) => {
46
- return listeners.map((listener) => register(el, event, listener, optionsClone));
47
- })
48
- );
49
- },
50
- { immediate: true, flush: "post" }
51
- );
37
+ const stopWatch = vue.watch(() => [unrefElement(target), index.resolveUnref(options)], ([el, options2]) => {
38
+ cleanup();
39
+ if (!el)
40
+ return;
41
+ cleanups.push(...events.flatMap((event) => {
42
+ return listeners.map((listener) => register(el, event, listener, options2));
43
+ }));
44
+ }, { immediate: true, flush: "post" });
52
45
  const stop = () => {
53
46
  stopWatch();
54
47
  cleanup();
@@ -56,25 +49,33 @@ function useEventListener(...args) {
56
49
  index.tryOnScopeDispose(stop);
57
50
  return stop;
58
51
  }
59
- function useMounted() {
60
- const isMounted = vue.ref(false);
61
- const instance = vue.getCurrentInstance();
62
- if (instance) {
63
- vue.onMounted(() => {
64
- isMounted.value = true;
65
- }, instance);
66
- }
67
- return isMounted;
68
- }
69
- function useSupported(callback) {
70
- const isMounted = useMounted();
71
- return vue.computed(() => {
72
- isMounted.value;
73
- return Boolean(callback());
74
- });
52
+ function useSupported(callback, sync = false) {
53
+ const isSupported = vue.ref();
54
+ const update = () => isSupported.value = Boolean(callback());
55
+ update();
56
+ index.tryOnMounted(update, sync);
57
+ return isSupported;
75
58
  }
59
+ const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
60
+ const globalKey = "__vueuse_ssr_handlers__";
61
+ _global[globalKey] = _global[globalKey] || {};
62
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
63
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
64
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
65
+ var __objRest$2 = (source, exclude) => {
66
+ var target = {};
67
+ for (var prop in source)
68
+ if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
69
+ target[prop] = source[prop];
70
+ if (source != null && __getOwnPropSymbols$g)
71
+ for (var prop of __getOwnPropSymbols$g(source)) {
72
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
73
+ target[prop] = source[prop];
74
+ }
75
+ return target;
76
+ };
76
77
  function useResizeObserver(target, callback, options = {}) {
77
- const { window: window2 = defaultWindow, ...observerOptions } = options;
78
+ const _a = options, { window: window2 = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]);
78
79
  let observer;
79
80
  const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
80
81
  const cleanup = () => {
@@ -83,24 +84,13 @@ function useResizeObserver(target, callback, options = {}) {
83
84
  observer = void 0;
84
85
  }
85
86
  };
86
- const targets = vue.computed(() => {
87
- const _targets = index.toValue(target);
88
- return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
89
- });
90
- const stopWatch = vue.watch(
91
- targets,
92
- (els) => {
93
- cleanup();
94
- if (isSupported.value && window2) {
95
- observer = new ResizeObserver(callback);
96
- for (const _el of els) {
97
- if (_el)
98
- observer.observe(_el, observerOptions);
99
- }
100
- }
101
- },
102
- { immediate: true, flush: "post" }
103
- );
87
+ const stopWatch = vue.watch(() => unrefElement(target), (el) => {
88
+ cleanup();
89
+ if (isSupported.value && window2 && el) {
90
+ observer = new ResizeObserver(callback);
91
+ observer.observe(el, observerOptions);
92
+ }
93
+ }, { immediate: true, flush: "post" });
104
94
  const stop = () => {
105
95
  cleanup();
106
96
  stopWatch();
@@ -111,16 +101,70 @@ function useResizeObserver(target, callback, options = {}) {
111
101
  stop
112
102
  };
113
103
  }
104
+ exports.SwipeDirection = void 0;
105
+ (function(SwipeDirection2) {
106
+ SwipeDirection2["UP"] = "UP";
107
+ SwipeDirection2["RIGHT"] = "RIGHT";
108
+ SwipeDirection2["DOWN"] = "DOWN";
109
+ SwipeDirection2["LEFT"] = "LEFT";
110
+ SwipeDirection2["NONE"] = "NONE";
111
+ })(exports.SwipeDirection || (exports.SwipeDirection = {}));
112
+ var __defProp = Object.defineProperty;
113
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
114
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
115
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
116
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
117
+ var __spreadValues = (a, b) => {
118
+ for (var prop in b || (b = {}))
119
+ if (__hasOwnProp.call(b, prop))
120
+ __defNormalProp(a, prop, b[prop]);
121
+ if (__getOwnPropSymbols)
122
+ for (var prop of __getOwnPropSymbols(b)) {
123
+ if (__propIsEnum.call(b, prop))
124
+ __defNormalProp(a, prop, b[prop]);
125
+ }
126
+ return a;
127
+ };
128
+ const _TransitionPresets = {
129
+ easeInSine: [0.12, 0, 0.39, 0],
130
+ easeOutSine: [0.61, 1, 0.88, 1],
131
+ easeInOutSine: [0.37, 0, 0.63, 1],
132
+ easeInQuad: [0.11, 0, 0.5, 0],
133
+ easeOutQuad: [0.5, 1, 0.89, 1],
134
+ easeInOutQuad: [0.45, 0, 0.55, 1],
135
+ easeInCubic: [0.32, 0, 0.67, 0],
136
+ easeOutCubic: [0.33, 1, 0.68, 1],
137
+ easeInOutCubic: [0.65, 0, 0.35, 1],
138
+ easeInQuart: [0.5, 0, 0.75, 0],
139
+ easeOutQuart: [0.25, 1, 0.5, 1],
140
+ easeInOutQuart: [0.76, 0, 0.24, 1],
141
+ easeInQuint: [0.64, 0, 0.78, 0],
142
+ easeOutQuint: [0.22, 1, 0.36, 1],
143
+ easeInOutQuint: [0.83, 0, 0.17, 1],
144
+ easeInExpo: [0.7, 0, 0.84, 0],
145
+ easeOutExpo: [0.16, 1, 0.3, 1],
146
+ easeInOutExpo: [0.87, 0, 0.13, 1],
147
+ easeInCirc: [0.55, 0, 1, 0.45],
148
+ easeOutCirc: [0, 0.55, 0.45, 1],
149
+ easeInOutCirc: [0.85, 0, 0.15, 1],
150
+ easeInBack: [0.36, 0, 0.66, -0.56],
151
+ easeOutBack: [0.34, 1.56, 0.64, 1],
152
+ easeInOutBack: [0.68, -0.6, 0.32, 1.6]
153
+ };
154
+ __spreadValues({
155
+ linear: index.identity
156
+ }, _TransitionPresets);
114
157
  exports.computedEager = index.computedEager;
115
158
  exports.eagerComputed = index.computedEager;
159
+ exports.identity = index.identity;
116
160
  exports.isClient = index.isClient;
117
- exports.isObject = index.isObject;
161
+ exports.isString = index.isString;
118
162
  exports.noop = index.noop;
119
- exports.toValue = index.toValue;
163
+ exports.resolveUnref = index.resolveUnref;
164
+ exports.tryOnMounted = index.tryOnMounted;
120
165
  exports.tryOnScopeDispose = index.tryOnScopeDispose;
121
166
  exports.defaultWindow = defaultWindow;
122
167
  exports.unrefElement = unrefElement;
123
168
  exports.useEventListener = useEventListener;
124
- exports.useMounted = useMounted;
125
169
  exports.useResizeObserver = useResizeObserver;
126
170
  exports.useSupported = useSupported;
@@ -1,17 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
+ var __defProp$9 = Object.defineProperty;
5
+ var __defProps$6 = Object.defineProperties;
6
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues$9 = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp$b.call(b, prop))
14
+ __defNormalProp$9(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols$b)
16
+ for (var prop of __getOwnPropSymbols$b(b)) {
17
+ if (__propIsEnum$b.call(b, prop))
18
+ __defNormalProp$9(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
4
23
  function computedEager(fn, options) {
5
- var _a;
24
+ var _a2;
6
25
  const result = vue.shallowRef();
7
26
  vue.watchEffect(() => {
8
27
  result.value = fn();
9
- }, {
10
- ...options,
11
- flush: (_a = void 0) != null ? _a : "sync"
12
- });
28
+ }, __spreadProps$6(__spreadValues$9({}, options), {
29
+ flush: (_a2 = void 0) != null ? _a2 : "sync"
30
+ }));
13
31
  return vue.readonly(result);
14
32
  }
33
+ var _a;
34
+ const isClient = typeof window !== "undefined";
35
+ const isString = (val) => typeof val === "string";
36
+ const noop = () => {
37
+ };
38
+ isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
39
+ function resolveUnref(r) {
40
+ return typeof r === "function" ? r() : vue.unref(r);
41
+ }
42
+ function identity(arg) {
43
+ return arg;
44
+ }
15
45
  function tryOnScopeDispose(fn) {
16
46
  if (vue.getCurrentScope()) {
17
47
  vue.onScopeDispose(fn);
@@ -19,19 +49,20 @@ function tryOnScopeDispose(fn) {
19
49
  }
20
50
  return false;
21
51
  }
22
- function toValue(r) {
23
- return typeof r === "function" ? r() : vue.unref(r);
52
+ function tryOnMounted(fn, sync = true) {
53
+ if (vue.getCurrentInstance())
54
+ vue.onMounted(fn);
55
+ else if (sync)
56
+ fn();
57
+ else
58
+ vue.nextTick(fn);
24
59
  }
25
- const isClient = typeof window !== "undefined" && typeof document !== "undefined";
26
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
27
- const toString = Object.prototype.toString;
28
- const isObject = (val) => toString.call(val) === "[object Object]";
29
- const noop = () => {
30
- };
31
60
  exports.computedEager = computedEager;
32
61
  exports.eagerComputed = computedEager;
62
+ exports.identity = identity;
33
63
  exports.isClient = isClient;
34
- exports.isObject = isObject;
64
+ exports.isString = isString;
35
65
  exports.noop = noop;
36
- exports.toValue = toValue;
66
+ exports.resolveUnref = resolveUnref;
67
+ exports.tryOnMounted = tryOnMounted;
37
68
  exports.tryOnScopeDispose = tryOnScopeDispose;
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const componentSizes = [
4
- "",
5
- "default",
6
- "small",
7
- "large"
8
- ];
3
+ const componentSizes = ["", "default", "small", "large"];
9
4
  exports.componentSizes = componentSizes;
@@ -1,40 +1,65 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const index = require("../../../../@vueuse/core/index.js");
5
+ const types = require("../../utils/types.js");
3
6
  const aria = require("../../utils/dom/aria.js");
4
7
  const shared_esmBundler = require("../../../../@vue/shared/dist/shared.esm-bundler.js");
5
- require("lodash-es");
6
- const index = require("../../../../@vueuse/core/index.js");
7
- const vue = require("vue");
8
- function useFocusController(target, { disabled, beforeFocus, afterFocus, beforeBlur, afterBlur } = {}) {
9
- const { emit } = vue.getCurrentInstance();
8
+ function useFocusController(target, {
9
+ disabled,
10
+ beforeFocus,
11
+ afterFocus,
12
+ beforeBlur,
13
+ afterBlur
14
+ } = {}) {
15
+ const instance = vue.getCurrentInstance();
16
+ const { emit } = instance;
10
17
  const wrapperRef = vue.shallowRef();
11
18
  const isFocused = vue.ref(false);
12
19
  const handleFocus = (event) => {
13
20
  const cancelFocus = shared_esmBundler.isFunction(beforeFocus) ? beforeFocus(event) : false;
14
- if (vue.unref(disabled) || isFocused.value || cancelFocus) return;
21
+ if (vue.unref(disabled) || isFocused.value || cancelFocus)
22
+ return;
15
23
  isFocused.value = true;
16
24
  emit("focus", event);
17
- afterFocus?.();
25
+ afterFocus == null ? void 0 : afterFocus();
18
26
  };
19
27
  const handleBlur = (event) => {
28
+ var _a;
20
29
  const cancelBlur = shared_esmBundler.isFunction(beforeBlur) ? beforeBlur(event) : false;
21
- if (vue.unref(disabled) || event.relatedTarget && wrapperRef.value?.contains(event.relatedTarget) || cancelBlur) return;
30
+ if (vue.unref(disabled) || event.relatedTarget && ((_a = wrapperRef.value) == null ? void 0 : _a.contains(event.relatedTarget)) || cancelBlur)
31
+ return;
22
32
  isFocused.value = false;
23
33
  emit("blur", event);
24
- afterBlur?.();
34
+ afterBlur == null ? void 0 : afterBlur();
25
35
  };
26
36
  const handleClick = (event) => {
27
- if (vue.unref(disabled) || aria.isFocusable(event.target) || wrapperRef.value?.contains(document.activeElement) && wrapperRef.value !== document.activeElement) return;
28
- target.value?.focus();
37
+ var _a, _b;
38
+ if (vue.unref(disabled) || aria.isFocusable(event.target) || ((_a = wrapperRef.value) == null ? void 0 : _a.contains(document.activeElement)) && wrapperRef.value !== document.activeElement)
39
+ return;
40
+ (_b = target.value) == null ? void 0 : _b.focus();
29
41
  };
30
42
  vue.watch([wrapperRef, () => vue.unref(disabled)], ([el, disabled2]) => {
31
- if (!el) return;
32
- if (disabled2) el.removeAttribute("tabindex");
33
- else el.setAttribute("tabindex", "-1");
43
+ if (!el)
44
+ return;
45
+ if (disabled2) {
46
+ el.removeAttribute("tabindex");
47
+ } else {
48
+ el.setAttribute("tabindex", "-1");
49
+ }
34
50
  });
35
51
  index.useEventListener(wrapperRef, "focus", handleFocus, true);
36
52
  index.useEventListener(wrapperRef, "blur", handleBlur, true);
37
53
  index.useEventListener(wrapperRef, "click", handleClick, true);
54
+ if (process.env.NODE_ENV === "test") {
55
+ vue.onMounted(() => {
56
+ const targetEl = types.isElement(target.value) ? target.value : document.querySelector("input,textarea");
57
+ if (targetEl) {
58
+ index.useEventListener(targetEl, "focus", handleFocus, true);
59
+ index.useEventListener(targetEl, "blur", handleBlur, true);
60
+ }
61
+ });
62
+ }
38
63
  return {
39
64
  isFocused,
40
65
  wrapperRef,
@@ -1,26 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const error = require("../../utils/error.js");
4
- const index$1 = require("../use-namespace/index.js");
5
3
  const vue = require("vue");
4
+ const index$1 = require("../use-namespace/index.js");
5
+ const error = require("../../utils/error.js");
6
6
  const index = require("../../../../@vueuse/shared/index.js");
7
7
  const defaultIdInjection = {
8
8
  prefix: Math.floor(Math.random() * 1e4),
9
9
  current: 0
10
10
  };
11
- const ID_INJECTION_KEY = /* @__PURE__ */ Symbol("elIdInjection");
11
+ const ID_INJECTION_KEY = Symbol("elIdInjection");
12
12
  const useIdInjection = () => {
13
13
  return vue.getCurrentInstance() ? vue.inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
14
14
  };
15
15
  const useId = (deterministicId) => {
16
16
  const idInjection = useIdInjection();
17
- if (!index.isClient && idInjection === defaultIdInjection) error.debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
17
+ if (!index.isClient && idInjection === defaultIdInjection) {
18
+ error.debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
18
19
  usage: app.provide(ID_INJECTION_KEY, {
19
20
  prefix: number,
20
21
  current: number,
21
22
  })`);
23
+ }
22
24
  const namespace = index$1.useGetDerivedNamespace();
23
- return index.computedEager(() => vue.unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
25
+ const idRef = index.computedEager(() => vue.unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
26
+ return idRef;
24
27
  };
25
28
  exports.ID_INJECTION_KEY = ID_INJECTION_KEY;
26
29
  exports.useId = useId;
@@ -1,18 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const en = require("../../locale/lang/en.js");
4
- const lodashEs = require("lodash-es");
5
3
  const vue = require("vue");
4
+ const lodashEs = require("lodash-es");
5
+ const en = require("../../locale/lang/en.js");
6
6
  const buildTranslator = (locale) => (path, option) => translate(path, option, vue.unref(locale));
7
- const translate = (path, option, locale) => lodashEs.get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => `${option?.[key] ?? `{${key}}`}`);
7
+ const translate = (path, option, locale) => lodashEs.get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
8
+ var _a;
9
+ return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
10
+ });
8
11
  const buildLocaleContext = (locale) => {
12
+ const lang = vue.computed(() => vue.unref(locale).name);
13
+ const localeRef = vue.isRef(locale) ? locale : vue.ref(locale);
9
14
  return {
10
- lang: vue.computed(() => vue.unref(locale).name),
11
- locale: vue.isRef(locale) ? locale : vue.ref(locale),
15
+ lang,
16
+ locale: localeRef,
12
17
  t: buildTranslator(locale)
13
18
  };
14
19
  };
15
- const localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
20
+ const localeContextKey = Symbol("localeContextKey");
16
21
  const useLocale = (localeOverrides) => {
17
22
  const locale = vue.inject(localeContextKey, vue.ref());
18
23
  return buildLocaleContext(vue.computed(() => locale.value || en.default));
@@ -5,17 +5,24 @@ const defaultNamespace = "el";
5
5
  const statePrefix = "is-";
6
6
  const _bem = (namespace, block, blockSuffix, element, modifier) => {
7
7
  let cls = `${namespace}-${block}`;
8
- if (blockSuffix) cls += `-${blockSuffix}`;
9
- if (element) cls += `__${element}`;
10
- if (modifier) cls += `--${modifier}`;
8
+ if (blockSuffix) {
9
+ cls += `-${blockSuffix}`;
10
+ }
11
+ if (element) {
12
+ cls += `__${element}`;
13
+ }
14
+ if (modifier) {
15
+ cls += `--${modifier}`;
16
+ }
11
17
  return cls;
12
18
  };
13
- const namespaceContextKey = /* @__PURE__ */ Symbol("namespaceContextKey");
19
+ const namespaceContextKey = Symbol("namespaceContextKey");
14
20
  const useGetDerivedNamespace = (namespaceOverrides) => {
15
21
  const derivedNamespace = vue.getCurrentInstance() ? vue.inject(namespaceContextKey, vue.ref(defaultNamespace)) : vue.ref(defaultNamespace);
16
- return vue.computed(() => {
22
+ const namespace = vue.computed(() => {
17
23
  return vue.unref(derivedNamespace) || defaultNamespace;
18
24
  });
25
+ return namespace;
19
26
  };
20
27
  const useNamespace = (block, namespaceOverrides) => {
21
28
  const namespace = useGetDerivedNamespace();
@@ -32,12 +39,20 @@ const useNamespace = (block, namespaceOverrides) => {
32
39
  };
33
40
  const cssVar = (object) => {
34
41
  const styles = {};
35
- for (const key in object) if (object[key]) styles[`--${namespace.value}-${key}`] = object[key];
42
+ for (const key in object) {
43
+ if (object[key]) {
44
+ styles[`--${namespace.value}-${key}`] = object[key];
45
+ }
46
+ }
36
47
  return styles;
37
48
  };
38
49
  const cssVarBlock = (object) => {
39
50
  const styles = {};
40
- for (const key in object) if (object[key]) styles[`--${namespace.value}-${block}-${key}`] = object[key];
51
+ for (const key in object) {
52
+ if (object[key]) {
53
+ styles[`--${namespace.value}-${block}-${key}`] = object[key];
54
+ }
55
+ }
41
56
  return styles;
42
57
  };
43
58
  const cssVarName = (name) => `--${namespace.value}-${name}`;
@@ -3,6 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
4
  const useProp = (name) => {
5
5
  const vm = vue.getCurrentInstance();
6
- return vue.computed(() => vm?.proxy?.$props?.[name]);
6
+ return vue.computed(() => {
7
+ var _a, _b;
8
+ return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name];
9
+ });
7
10
  };
8
11
  exports.useProp = useProp;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const size = require("../../constants/size.js");
4
- const runtime = require("../../utils/vue/props/runtime.js");
5
3
  const vue = require("vue");
4
+ const runtime = require("../../utils/vue/props/runtime.js");
5
+ const size = require("../../constants/size.js");
6
6
  const useSizeProp = runtime.buildProp({
7
7
  type: String,
8
8
  values: size.componentSizes,
9
9
  required: false
10
10
  });
11
- const SIZE_INJECTION_KEY = /* @__PURE__ */ Symbol("size");
11
+ const SIZE_INJECTION_KEY = Symbol("size");
12
12
  const useGlobalSize = () => {
13
13
  const injectedSize = vue.inject(SIZE_INJECTION_KEY, {});
14
14
  return vue.computed(() => {