@tagplus/components 5.3.7 → 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.
- package/dist/es/components.css +132 -132
- package/dist/es/node_modules/@element-plus/icons-vue/dist/index.mjs +20 -29
- package/dist/es/node_modules/@popperjs/core/dist/index.mjs +586 -0
- package/dist/es/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +0 -5
- package/dist/es/node_modules/@vueuse/core/index.mjs +58 -103
- package/dist/es/node_modules/@vueuse/shared/index.mjs +16 -47
- package/dist/es/node_modules/element-plus/es/constants/size.mjs +6 -1
- package/dist/es/node_modules/element-plus/es/hooks/use-focus-controller/index.mjs +17 -36
- package/dist/es/node_modules/element-plus/es/hooks/use-id/index.mjs +5 -8
- package/dist/es/node_modules/element-plus/es/hooks/use-locale/index.mjs +7 -12
- package/dist/es/node_modules/element-plus/es/hooks/use-namespace/index.mjs +7 -22
- package/dist/es/node_modules/element-plus/es/hooks/use-prop/index.mjs +1 -4
- package/dist/es/node_modules/element-plus/es/hooks/use-size/index.mjs +3 -3
- package/dist/es/node_modules/element-plus/es/locale/lang/en.mjs +28 -31
- package/dist/es/node_modules/element-plus/es/utils/dom/aria.mjs +19 -0
- package/dist/es/node_modules/element-plus/es/utils/error.mjs +4 -3
- package/dist/es/node_modules/element-plus/es/utils/vue/props/runtime.mjs +19 -25
- package/dist/es/src/components/Autosuggest/Autosuggest.vue.mjs +264 -267
- package/dist/es/src/components/Autosuggest/Multisuggest.vue.mjs +5 -3
- package/dist/es/src/components/Autosuggest/autosuggest-props.mjs +2 -2
- package/dist/es/src/components/Autosuggest/core.mjs +4 -4
- package/dist/es/src/components/Autosuggest/option.vue.mjs +2 -2
- package/dist/es/src/components/Autosuggest/select-dropdown.vue.mjs +3 -4
- package/dist/es/src/components/Autosuggest/useOption.mjs +2 -2
- package/dist/es/src/components/Autosuggest/useSelect.mjs +16 -22
- package/dist/es/src/components/Inline/Inline.vue.mjs +2 -2
- package/dist/es/src/components/InputNumber/InputNumber.vue.mjs +36 -26
- package/dist/es/src/components/InputNumber/input-number.mjs +11 -3
- package/dist/es/src/components/Loader/Loader.vue.mjs +3 -3
- package/dist/es/src/components/Money/Money.vue.mjs +2 -2
- package/dist/es/src/components/OptionsList/OptionsList.vue.mjs +2 -2
- package/dist/es/src/components/OptionsListItem/OptionsListItem.vue.mjs +2 -2
- package/dist/es/src/components/Percent/Percent.vue.mjs +4 -4
- package/dist/es/src/components/Skeleton/Skeleton.vue.mjs +2 -2
- package/dist/es/src/components/Step/Step.vue.mjs +2 -2
- package/dist/es/src/components/Steps/Steps.vue.mjs +1 -1
- package/dist/es/src/components/Tip/Tip.vue.mjs +6 -6
- package/dist/es/src/locale/i18nCreator.mjs +1 -1
- package/dist/es/src/plugins/currency.mjs +4 -6
- package/dist/es/src/utils/constants.mjs +2 -2
- package/dist/es/src/utils/runtime.mjs +3 -3
- package/dist/es/src/utils/use-derived-namespace.mjs +1 -1
- package/dist/es/src/utils/use-form-common-props.mjs +3 -3
- package/dist/es/src/utils/use-form-item.mjs +5 -6
- package/dist/es/src/utils/use-id.mjs +2 -2
- package/dist/es/src/utils/use-input.mjs +2 -2
- package/dist/lib/components.css +132 -132
- package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +19 -28
- package/dist/lib/node_modules/@popperjs/core/dist/index.js +586 -0
- package/dist/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -5
- package/dist/lib/node_modules/@vueuse/core/index.js +56 -100
- package/dist/lib/node_modules/@vueuse/shared/index.js +15 -46
- package/dist/lib/node_modules/element-plus/es/constants/size.js +6 -1
- package/dist/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +17 -36
- package/dist/lib/node_modules/element-plus/es/hooks/use-id/index.js +5 -8
- package/dist/lib/node_modules/element-plus/es/hooks/use-locale/index.js +6 -11
- package/dist/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +7 -22
- package/dist/lib/node_modules/element-plus/es/hooks/use-prop/index.js +1 -4
- package/dist/lib/node_modules/element-plus/es/hooks/use-size/index.js +3 -3
- package/dist/lib/node_modules/element-plus/es/locale/lang/en.js +28 -31
- package/dist/lib/node_modules/element-plus/es/utils/dom/aria.js +19 -0
- package/dist/lib/node_modules/element-plus/es/utils/error.js +4 -3
- package/dist/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +19 -25
- package/dist/lib/src/components/Autosuggest/Autosuggest.vue.js +264 -267
- package/dist/lib/src/components/Autosuggest/Multisuggest.vue.js +5 -3
- package/dist/lib/src/components/Autosuggest/autosuggest-props.js +2 -2
- package/dist/lib/src/components/Autosuggest/core.js +4 -4
- package/dist/lib/src/components/Autosuggest/option.vue.js +2 -2
- package/dist/lib/src/components/Autosuggest/select-dropdown.vue.js +3 -4
- package/dist/lib/src/components/Autosuggest/useOption.js +2 -2
- package/dist/lib/src/components/Autosuggest/useSelect.js +16 -22
- package/dist/lib/src/components/Inline/Inline.vue.js +2 -2
- package/dist/lib/src/components/InputNumber/InputNumber.vue.js +35 -25
- package/dist/lib/src/components/InputNumber/input-number.js +11 -3
- package/dist/lib/src/components/Loader/Loader.vue.js +2 -2
- package/dist/lib/src/components/Money/Money.vue.js +2 -2
- package/dist/lib/src/components/OptionsList/OptionsList.vue.js +1 -1
- package/dist/lib/src/components/OptionsListItem/OptionsListItem.vue.js +1 -1
- package/dist/lib/src/components/Percent/Percent.vue.js +4 -4
- package/dist/lib/src/components/Skeleton/Skeleton.vue.js +1 -1
- package/dist/lib/src/components/Step/Step.vue.js +1 -1
- package/dist/lib/src/components/Steps/Steps.vue.js +1 -1
- package/dist/lib/src/components/Tip/Tip.vue.js +5 -5
- package/dist/lib/src/locale/i18nCreator.js +1 -1
- package/dist/lib/src/plugins/currency.js +4 -6
- package/dist/lib/src/utils/constants.js +2 -2
- package/dist/lib/src/utils/runtime.js +3 -3
- package/dist/lib/src/utils/use-derived-namespace.js +1 -1
- package/dist/lib/src/utils/use-form-common-props.js +3 -3
- package/dist/lib/src/utils/use-form-item.js +5 -6
- package/dist/lib/src/utils/use-id.js +2 -2
- package/dist/lib/src/utils/use-input.js +2 -2
- package/package.json +24 -32
- package/dist/demo.html +0 -1
- package/dist/es/node_modules/@popperjs/core/lib/enums.mjs +0 -22
- package/dist/es/node_modules/element-plus/es/utils/types.mjs +0 -9
- package/dist/fonts/bevi-bold.7e4dcd11.woff +0 -0
- package/dist/fonts/bevi-bold.873def84.woff2 +0 -0
- package/dist/fonts/bevi-medium.6187e050.woff2 +0 -0
- package/dist/fonts/bevi-medium.65b3056d.woff +0 -0
- package/dist/fonts/bevi-regular.c89f126e.woff +0 -0
- package/dist/fonts/bevi-regular.f81e4b8f.woff2 +0 -0
- package/dist/lib/node_modules/@popperjs/core/lib/enums.js +0 -22
- package/dist/lib/node_modules/element-plus/es/utils/types.js +0 -9
- package/dist/tp.common.js +0 -2
- package/dist/tp.common.js.map +0 -1
- package/dist/tp.css +0 -167
- package/dist/tp.umd.js +0 -2
- package/dist/tp.umd.js.map +0 -1
- package/dist/tp.umd.min.js +0 -2
- package/dist/tp.umd.min.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { tryOnScopeDispose, isClient,
|
|
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 =
|
|
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 (
|
|
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(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
|
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
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
118
|
+
isObject,
|
|
164
119
|
noop,
|
|
165
|
-
|
|
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
|
|
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
|
|
3
|
+
var _a;
|
|
23
4
|
const result = shallowRef();
|
|
24
5
|
watchEffect(() => {
|
|
25
6
|
result.value = fn();
|
|
26
|
-
},
|
|
27
|
-
|
|
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
|
|
51
|
-
|
|
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
|
-
|
|
33
|
+
isObject,
|
|
64
34
|
noop,
|
|
65
|
-
|
|
66
|
-
tryOnMounted,
|
|
35
|
+
toValue,
|
|
67
36
|
tryOnScopeDispose
|
|
68
37
|
};
|
|
@@ -1,57 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEventListener } from "../../../../@vueuse/core/index.mjs";
|
|
3
|
-
import { isElement } from "../../utils/types.mjs";
|
|
1
|
+
import { isFocusable } from "../../utils/dom/aria.mjs";
|
|
4
2
|
import { isFunction } from "../../../../@vue/shared/dist/shared.esm-bundler.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = {}) {
|
|
11
|
-
const instance = getCurrentInstance();
|
|
12
|
-
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();
|
|
13
8
|
const wrapperRef = shallowRef();
|
|
14
9
|
const isFocused = ref(false);
|
|
15
10
|
const handleFocus = (event) => {
|
|
16
11
|
const cancelFocus = isFunction(beforeFocus) ? beforeFocus(event) : false;
|
|
17
|
-
if (
|
|
18
|
-
return;
|
|
12
|
+
if (unref(disabled) || isFocused.value || cancelFocus) return;
|
|
19
13
|
isFocused.value = true;
|
|
20
14
|
emit("focus", event);
|
|
21
|
-
afterFocus
|
|
15
|
+
afterFocus?.();
|
|
22
16
|
};
|
|
23
17
|
const handleBlur = (event) => {
|
|
24
|
-
var _a;
|
|
25
18
|
const cancelBlur = isFunction(beforeBlur) ? beforeBlur(event) : false;
|
|
26
|
-
if (
|
|
27
|
-
return;
|
|
19
|
+
if (unref(disabled) || event.relatedTarget && wrapperRef.value?.contains(event.relatedTarget) || cancelBlur) return;
|
|
28
20
|
isFocused.value = false;
|
|
29
21
|
emit("blur", event);
|
|
30
|
-
afterBlur
|
|
22
|
+
afterBlur?.();
|
|
31
23
|
};
|
|
32
|
-
const handleClick = () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return;
|
|
36
|
-
(_b = target.value) == null ? void 0 : _b.focus();
|
|
24
|
+
const handleClick = (event) => {
|
|
25
|
+
if (unref(disabled) || isFocusable(event.target) || wrapperRef.value?.contains(document.activeElement) && wrapperRef.value !== document.activeElement) return;
|
|
26
|
+
target.value?.focus();
|
|
37
27
|
};
|
|
38
|
-
watch(wrapperRef, (el) => {
|
|
39
|
-
if (el)
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
watch([wrapperRef, () => unref(disabled)], ([el, disabled2]) => {
|
|
29
|
+
if (!el) return;
|
|
30
|
+
if (disabled2) el.removeAttribute("tabindex");
|
|
31
|
+
else el.setAttribute("tabindex", "-1");
|
|
42
32
|
});
|
|
43
33
|
useEventListener(wrapperRef, "focus", handleFocus, true);
|
|
44
34
|
useEventListener(wrapperRef, "blur", handleBlur, true);
|
|
45
35
|
useEventListener(wrapperRef, "click", handleClick, true);
|
|
46
|
-
if (process.env.NODE_ENV === "test") {
|
|
47
|
-
onMounted(() => {
|
|
48
|
-
const targetEl = isElement(target.value) ? target.value : document.querySelector("input,textarea");
|
|
49
|
-
if (targetEl) {
|
|
50
|
-
useEventListener(targetEl, "focus", handleFocus, true);
|
|
51
|
-
useEventListener(targetEl, "blur", handleBlur, true);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
36
|
return {
|
|
56
37
|
isFocused,
|
|
57
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
|
-
|
|
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
|
|
1
|
+
import en_default from "../../locale/lang/en.mjs";
|
|
2
2
|
import { get } from "lodash-es";
|
|
3
|
-
import
|
|
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:
|
|
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 ||
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
178
|
+
en_default as default
|
|
182
179
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const isFocusable = (element) => {
|
|
2
|
+
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) return true;
|
|
3
|
+
if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") return false;
|
|
4
|
+
switch (element.nodeName) {
|
|
5
|
+
case "A":
|
|
6
|
+
return !!element.href && element.rel !== "ignore";
|
|
7
|
+
case "INPUT":
|
|
8
|
+
return !(element.type === "hidden" || element.type === "file");
|
|
9
|
+
case "BUTTON":
|
|
10
|
+
case "SELECT":
|
|
11
|
+
case "TEXTAREA":
|
|
12
|
+
return true;
|
|
13
|
+
default:
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
isFocusable
|
|
19
|
+
};
|