st-comp 0.0.200 → 0.0.202
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/components.d.ts +3 -0
- package/es/ChartLayout.js +4 -4
- package/es/ConfigProvider.cjs +1 -1
- package/es/ConfigProvider.js +1 -1
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +44 -40
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +84 -78
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +21 -19
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +30 -28
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +345 -331
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +20 -18
- package/es/KlinePlus.cjs +4 -4
- package/es/KlinePlus.js +610 -588
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +2 -2
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +74 -72
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +9 -157
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/Table.cjs +1 -1
- package/es/Table.js +56 -52
- package/es/User.cjs +1 -1
- package/es/User.js +1313 -1
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +28 -26
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +19 -18
- package/es/VarietySearch.cjs +8 -8
- package/es/VarietySearch.js +704 -697
- package/es/VarietyTextCopy.cjs +1 -1
- package/es/VarietyTextCopy.js +12 -12
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +80 -79
- package/es/{el-popover-5421d52a.cjs → _initCloneObject-52b6a510.cjs} +1 -1
- package/es/{el-popover-7a1c6412.js → _initCloneObject-eaef9418.js} +9 -9
- package/es/{base-8348063b.js → base-a5af3db3.js} +38 -38
- package/es/{castArray-3f45c3ec.js → castArray-7741a212.js} +1 -1
- package/es/{config-provider-eb0460f1.cjs → config-provider-a584d81e.cjs} +1 -1
- package/es/{config-provider-1a687690.js → config-provider-b16efd62.js} +6 -6
- package/es/debounce-62f5b6e8.cjs +1 -0
- package/es/debounce-8d53f4dd.js +83 -0
- package/es/dropdown-071c5d7e.cjs +1 -0
- package/es/dropdown-a59bba73.js +178 -0
- package/es/el-autocomplete-a07e9439.cjs +1 -0
- package/es/{el-autocomplete-d4cd96cd.js → el-autocomplete-ba808eb6.js} +16 -16
- package/es/{el-button-2e680390.js → el-button-c95adb85.js} +33 -33
- package/es/{el-button-4ccd7122.cjs → el-button-eec58cff.cjs} +1 -1
- package/es/el-checkbox-7421ccd3.js +459 -0
- package/es/el-checkbox-c25236a6.cjs +1 -0
- package/es/el-checkbox-group-0ea8fbf8.cjs +1 -0
- package/es/el-checkbox-group-4ed993c7.js +1 -0
- package/es/{el-dialog-bafc4b2b.js → el-dialog-41ab8417.js} +7 -6
- package/es/{el-dialog-6413b4af.cjs → el-dialog-ae86edb8.cjs} +1 -1
- package/es/{el-divider-93b0ee21.js → el-divider-4e059794.js} +1 -1
- package/es/{el-empty-56783dca.js → el-empty-33cb66f1.js} +3 -3
- package/es/el-form-item-c3fe189b.cjs +12 -0
- package/es/el-form-item-c53c374d.js +1269 -0
- package/es/{el-input-735575f4.js → el-input-2f75c4ba.js} +34 -34
- package/es/{el-input-6c5ac889.cjs → el-input-7fd293af.cjs} +1 -1
- package/es/{el-input-number-d5770776.cjs → el-input-number-22e21d16.cjs} +1 -1
- package/es/{el-input-number-6634a6ea.js → el-input-number-5193fe6d.js} +35 -35
- package/es/{el-loading-98dcebee.cjs → el-loading-cfd86c15.cjs} +1 -1
- package/es/{el-loading-049dacc5.js → el-loading-f6022062.js} +5 -5
- package/es/{el-menu-item-828bc6fa.cjs → el-menu-item-17dc717e.cjs} +1 -1
- package/es/{el-menu-item-8a210e21.js → el-menu-item-7e881203.js} +22 -22
- package/es/{el-message-a1ac37d4.cjs → el-message-5e6a6be9.cjs} +1 -1
- package/es/el-message-box-a93d2f6a.js +489 -0
- package/es/el-message-box-c10adb52.cjs +1 -0
- package/es/{el-message-def216ae.js → el-message-e544a8f5.js} +24 -24
- package/es/{el-overlay-4ea38eab.js → el-overlay-09ad71cd.js} +51 -51
- package/es/{el-overlay-69dfacb6.cjs → el-overlay-9e34965f.cjs} +1 -1
- package/es/{el-popconfirm-bdeceeb7.cjs → el-popconfirm-70a976bf.cjs} +1 -1
- package/es/{el-popconfirm-aace1104.js → el-popconfirm-81dcd202.js} +20 -20
- package/es/el-popover-0ea8fbf8.cjs +1 -0
- package/es/el-popover-4ed993c7.js +1 -0
- package/es/{el-popper-986a8371.js → el-popper-b4f97157.js} +115 -112
- package/es/{el-popper-b962125f.cjs → el-popper-b6c99b28.cjs} +1 -1
- package/es/el-scrollbar-323542e7.js +34 -0
- package/es/el-scrollbar-bc3f790d.cjs +1 -0
- package/es/{el-segmented-f892ec18.js → el-segmented-b868d074.js} +8 -8
- package/es/{el-segmented-6b057ed5.cjs → el-segmented-f8fce9ac.cjs} +1 -1
- package/es/{el-select-2189a8ac.js → el-select-95627997.js} +42 -41
- package/es/el-select-d8d91db1.cjs +1 -0
- package/es/el-table-column-376cd907.js +3432 -0
- package/es/el-table-column-c974cb96.cjs +14 -0
- package/es/{el-tag-75a7573a.js → el-tag-66cab138.js} +16 -16
- package/es/{el-tag-a15520b3.cjs → el-tag-a33c4b22.cjs} +1 -1
- package/es/{el-checkbox-group-e26a4533.js → el-text-ac60d0f2.js} +16 -16
- package/es/{el-checkbox-group-dfdad075.cjs → el-text-c20a9f48.cjs} +1 -1
- package/es/{index-1fb95601.cjs → index-098c2447.cjs} +1 -1
- package/es/{index-16802b35.cjs → index-11547a0c.cjs} +1 -1
- package/es/index-1f7d4f70.js +157 -0
- package/es/{index-680be212.cjs → index-298075cf.cjs} +1 -1
- package/es/index-57672682.js +113 -0
- package/es/{index-9cfb6ccf.js → index-7ed0999e.js} +2 -0
- package/es/{index-f3a86049.js → index-844bdd85.js} +29 -29
- package/es/index-88546436.js +163 -0
- package/es/{index-cc200b99.cjs → index-8901a38c.cjs} +1 -1
- package/es/{index-e00ee015.js → index-960806da.js} +36 -36
- package/es/index-9b9ef5dd.cjs +1 -0
- package/es/{index-847d58bc.js → index-a871c3eb.js} +92 -62
- package/es/{index-780e7fd2.js → index-bc8e277e.js} +2 -2
- package/es/{index-5e0314ac.cjs → index-c108567d.cjs} +1 -1
- package/es/{index-78381381.cjs → index-d725fef6.cjs} +2 -2
- package/es/{index-14c88a1a.js → index-d77a7336.js} +1 -1
- package/es/{index-f45c2897.js → index-d91dc23f.js} +20 -20
- package/es/{index-c94b9543.js → index-e5566b94.js} +43 -43
- package/es/index-f3562b52.cjs +1 -0
- package/es/index-f967d6c1.cjs +1 -0
- package/es/{python-2e916d28.cjs → python-c27ba105.cjs} +1 -1
- package/es/{python-7cf0b6ba.js → python-ecde9ff2.js} +2 -2
- package/es/{raf-8e5f0699.js → raf-80ef0c0a.js} +1 -1
- package/es/{scroll-c43468ab.js → scroll-679bd6bf.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-e6cba60f.js → use-form-common-props-815d48a6.js} +69 -69
- package/es/{use-form-common-props-d8866dc6.cjs → use-form-common-props-fd9b61a0.cjs} +1 -1
- package/es/{use-global-config-72d50e62.cjs → use-global-config-30d7d8ce.cjs} +1 -1
- package/es/{use-global-config-76ff2e3e.js → use-global-config-b5e9d3d5.js} +14 -14
- package/es/{validator-e759d43d.cjs → validator-1b8a6128.cjs} +1 -1
- package/es/{validator-220652c5.js → validator-764a9db0.js} +1 -1
- package/es/vnode-5ddb7ed1.js +14 -0
- package/es/vnode-b906ae6d.cjs +1 -0
- package/es/{zh-cn-33e7aee6.cjs → zh-cn-90317f62.cjs} +1 -1
- package/es/{zh-cn-c7fa42ea.js → zh-cn-e963c628.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +156 -156
- package/lib/{index-410c490f.js → index-a45d1494.js} +11238 -11207
- package/lib/{python-589861d2.js → python-82d17c8d.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineConfig/config.js +2 -0
- package/packages/KlineConfig/index.vue +9 -0
- package/packages/KlinePlus/index.vue +18 -8
- package/packages/KlinePlus/utils.js +41 -5
- package/src/pages/KlinePlus/index.vue +6 -5
- package/es/el-autocomplete-86c0d989.cjs +0 -1
- package/es/el-form-item-41becb31.js +0 -1749
- package/es/el-form-item-95476197.cjs +0 -12
- package/es/el-scrollbar-139aa96d.cjs +0 -1
- package/es/el-scrollbar-cdadd788.js +0 -115
- package/es/el-select-e1046cc6.cjs +0 -1
- package/es/el-table-column-91d69c86.js +0 -3882
- package/es/el-table-column-f1c4af89.cjs +0 -14
- package/es/index-56ea97a9.js +0 -122
- package/es/index-8583c047.cjs +0 -1
- package/es/index-ce63356a.cjs +0 -1
- package/es/index-db1e1861.js +0 -318
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { l as L, i as v, r as M } from "./index-960806da.js";
|
|
2
|
+
var N = /\s/;
|
|
3
|
+
function $(n) {
|
|
4
|
+
for (var r = n.length; r-- && N.test(n.charAt(r)); )
|
|
5
|
+
;
|
|
6
|
+
return r;
|
|
7
|
+
}
|
|
8
|
+
var B = /^\s+/;
|
|
9
|
+
function R(n) {
|
|
10
|
+
return n && n.slice(0, $(n) + 1).replace(B, "");
|
|
11
|
+
}
|
|
12
|
+
var k = 0 / 0, F = /^[-+]0x[0-9a-f]+$/i, _ = /^0b[01]+$/i, j = /^0o[0-7]+$/i, D = parseInt;
|
|
13
|
+
function S(n) {
|
|
14
|
+
if (typeof n == "number")
|
|
15
|
+
return n;
|
|
16
|
+
if (L(n))
|
|
17
|
+
return k;
|
|
18
|
+
if (v(n)) {
|
|
19
|
+
var r = typeof n.valueOf == "function" ? n.valueOf() : n;
|
|
20
|
+
n = v(r) ? r + "" : r;
|
|
21
|
+
}
|
|
22
|
+
if (typeof n != "string")
|
|
23
|
+
return n === 0 ? n : +n;
|
|
24
|
+
n = R(n);
|
|
25
|
+
var t = _.test(n);
|
|
26
|
+
return t || j.test(n) ? D(n.slice(2), t ? 2 : 8) : F.test(n) ? k : +n;
|
|
27
|
+
}
|
|
28
|
+
var H = function() {
|
|
29
|
+
return M.Date.now();
|
|
30
|
+
};
|
|
31
|
+
const h = H;
|
|
32
|
+
var P = "Expected a function", U = Math.max, X = Math.min;
|
|
33
|
+
function z(n, r, t) {
|
|
34
|
+
var u, c, l, s, i, f, o = 0, p = !1, d = !1, T = !0;
|
|
35
|
+
if (typeof n != "function")
|
|
36
|
+
throw new TypeError(P);
|
|
37
|
+
r = S(r) || 0, v(t) && (p = !!t.leading, d = "maxWait" in t, l = d ? U(S(t.maxWait) || 0, r) : l, T = "trailing" in t ? !!t.trailing : T);
|
|
38
|
+
function x(e) {
|
|
39
|
+
var a = u, m = c;
|
|
40
|
+
return u = c = void 0, o = e, s = n.apply(m, a), s;
|
|
41
|
+
}
|
|
42
|
+
function W(e) {
|
|
43
|
+
return o = e, i = setTimeout(g, r), p ? x(e) : s;
|
|
44
|
+
}
|
|
45
|
+
function O(e) {
|
|
46
|
+
var a = e - f, m = e - o, E = r - a;
|
|
47
|
+
return d ? X(E, l - m) : E;
|
|
48
|
+
}
|
|
49
|
+
function y(e) {
|
|
50
|
+
var a = e - f, m = e - o;
|
|
51
|
+
return f === void 0 || a >= r || a < 0 || d && m >= l;
|
|
52
|
+
}
|
|
53
|
+
function g() {
|
|
54
|
+
var e = h();
|
|
55
|
+
if (y(e))
|
|
56
|
+
return b(e);
|
|
57
|
+
i = setTimeout(g, O(e));
|
|
58
|
+
}
|
|
59
|
+
function b(e) {
|
|
60
|
+
return i = void 0, T && u ? x(e) : (u = c = void 0, s);
|
|
61
|
+
}
|
|
62
|
+
function A() {
|
|
63
|
+
i !== void 0 && clearTimeout(i), o = 0, u = f = c = i = void 0;
|
|
64
|
+
}
|
|
65
|
+
function C() {
|
|
66
|
+
return i === void 0 ? s : b(h());
|
|
67
|
+
}
|
|
68
|
+
function I() {
|
|
69
|
+
var e = h(), a = y(e);
|
|
70
|
+
if (u = arguments, c = this, f = e, a) {
|
|
71
|
+
if (i === void 0)
|
|
72
|
+
return W(f);
|
|
73
|
+
if (d)
|
|
74
|
+
return clearTimeout(i), i = setTimeout(g, r), x(f);
|
|
75
|
+
}
|
|
76
|
+
return i === void 0 && (i = setTimeout(g, r)), s;
|
|
77
|
+
}
|
|
78
|
+
return I.cancel = A, I.flush = C, I;
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
z as d,
|
|
82
|
+
S as t
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./el-popper-b6c99b28.cjs"),o=require("./base-ef747d02.cjs"),O=require("./use-form-common-props-fd9b61a0.cjs"),t=require("vue"),N=t.defineComponent({inheritAttrs:!1});function y(r,l,c,i,d,E){return t.renderSlot(r.$slots,"default")}var g=o._export_sfc(N,[["render",y],["__file","collection.vue"]]);const S=t.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function P(r,l,c,i,d,E){return t.renderSlot(r.$slots,"default")}var L=o._export_sfc(S,[["render",P],["__file","collection-item.vue"]]);const f="data-el-collection-item",T=r=>{const l=`El${r}Collection`,c=`${l}Item`,i=Symbol(l),d=Symbol(c),E={...g,name:l,setup(){const a=t.ref(),u=new Map,p=()=>{const s=t.unref(a);if(!s)return[];const n=Array.from(s.querySelectorAll(`[${f}]`));return[...u.values()].sort((m,I)=>n.indexOf(m.ref)-n.indexOf(I.ref))};t.provide(i,{itemMap:u,getItems:p,collectionRef:a})}},C={...L,name:c,setup(a,{attrs:u}){const p=t.ref(),s=t.inject(i,void 0);t.provide(d,{collectionItemRef:p}),t.onMounted(()=>{const n=t.unref(p);n&&s.itemMap.set(n,{ref:n,...u})}),t.onBeforeUnmount(()=>{const n=t.unref(p);s.itemMap.delete(n)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:d,ElCollection:E,ElCollectionItem:C}},b=o.buildProps({trigger:e.useTooltipTriggerProps.trigger,triggerKeys:{type:o.definePropType(Array),default:()=>[e.EVENT_CODE.enter,e.EVENT_CODE.numpadEnter,e.EVENT_CODE.space,e.EVENT_CODE.down]},virtualTriggering:e.useTooltipTriggerProps.virtualTriggering,virtualRef:e.useTooltipTriggerProps.virtualRef,effect:{...e.useTooltipContentProps.effect,default:"light"},type:{type:o.definePropType(String)},placement:{type:o.definePropType(String),default:"bottom"},popperOptions:{type:o.definePropType(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:o.definePropType([Number,String]),default:0},maxHeight:{type:o.definePropType([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,values:e.roleTypes,default:"menu"},buttonProps:{type:o.definePropType(Object)},teleported:e.useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0}}),v=o.buildProps({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:O.iconPropType}}),w=o.buildProps({onKeydown:{type:o.definePropType(Function)}}),M=[e.EVENT_CODE.down,e.EVENT_CODE.pageDown,e.EVENT_CODE.home],_=[e.EVENT_CODE.up,e.EVENT_CODE.pageUp,e.EVENT_CODE.end],$=[...M,..._],{ElCollection:h,ElCollectionItem:K,COLLECTION_INJECTION_KEY:A,COLLECTION_ITEM_INJECTION_KEY:D}=T("Dropdown");exports.COLLECTION_INJECTION_KEY=A;exports.COLLECTION_ITEM_INJECTION_KEY=D;exports.COLLECTION_ITEM_SIGN=f;exports.ElCollection=h;exports.ElCollectionItem=K;exports.FIRST_LAST_KEYS=$;exports.LAST_KEYS=_;exports.createCollectionWithScope=T;exports.dropdownItemProps=v;exports.dropdownMenuProps=w;exports.dropdownProps=b;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { i as f, a as e, g as _, r as b } from "./el-popper-b4f97157.js";
|
|
2
|
+
import { _ as g, b as E, e as o } from "./base-a5af3db3.js";
|
|
3
|
+
import { i as L } from "./use-form-common-props-815d48a6.js";
|
|
4
|
+
import { defineComponent as y, renderSlot as T, ref as I, provide as C, inject as $, onMounted as v, unref as m, onBeforeUnmount as h } from "vue";
|
|
5
|
+
const w = y({
|
|
6
|
+
inheritAttrs: !1
|
|
7
|
+
});
|
|
8
|
+
function M(n, r, s, l, a, d) {
|
|
9
|
+
return T(n.$slots, "default");
|
|
10
|
+
}
|
|
11
|
+
var A = /* @__PURE__ */ g(w, [["render", M], ["__file", "collection.vue"]]);
|
|
12
|
+
const B = y({
|
|
13
|
+
name: "ElCollectionItem",
|
|
14
|
+
inheritAttrs: !1
|
|
15
|
+
});
|
|
16
|
+
function K(n, r, s, l, a, d) {
|
|
17
|
+
return T(n.$slots, "default");
|
|
18
|
+
}
|
|
19
|
+
var P = /* @__PURE__ */ g(B, [["render", K], ["__file", "collection-item.vue"]]);
|
|
20
|
+
const x = "data-el-collection-item", Y = (n) => {
|
|
21
|
+
const r = `El${n}Collection`, s = `${r}Item`, l = Symbol(r), a = Symbol(s), d = {
|
|
22
|
+
...A,
|
|
23
|
+
name: r,
|
|
24
|
+
setup() {
|
|
25
|
+
const u = I(), c = /* @__PURE__ */ new Map();
|
|
26
|
+
C(l, {
|
|
27
|
+
itemMap: c,
|
|
28
|
+
getItems: () => {
|
|
29
|
+
const i = m(u);
|
|
30
|
+
if (!i)
|
|
31
|
+
return [];
|
|
32
|
+
const t = Array.from(i.querySelectorAll(`[${x}]`));
|
|
33
|
+
return [...c.values()].sort((N, S) => t.indexOf(N.ref) - t.indexOf(S.ref));
|
|
34
|
+
},
|
|
35
|
+
collectionRef: u
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, O = {
|
|
39
|
+
...P,
|
|
40
|
+
name: s,
|
|
41
|
+
setup(u, { attrs: c }) {
|
|
42
|
+
const p = I(), i = $(l, void 0);
|
|
43
|
+
C(a, {
|
|
44
|
+
collectionItemRef: p
|
|
45
|
+
}), v(() => {
|
|
46
|
+
const t = m(p);
|
|
47
|
+
t && i.itemMap.set(t, {
|
|
48
|
+
ref: t,
|
|
49
|
+
...c
|
|
50
|
+
});
|
|
51
|
+
}), h(() => {
|
|
52
|
+
const t = m(p);
|
|
53
|
+
i.itemMap.delete(t);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
COLLECTION_INJECTION_KEY: l,
|
|
59
|
+
COLLECTION_ITEM_INJECTION_KEY: a,
|
|
60
|
+
ElCollection: d,
|
|
61
|
+
ElCollectionItem: O
|
|
62
|
+
};
|
|
63
|
+
}, k = E({
|
|
64
|
+
trigger: f.trigger,
|
|
65
|
+
triggerKeys: {
|
|
66
|
+
type: o(Array),
|
|
67
|
+
default: () => [
|
|
68
|
+
e.enter,
|
|
69
|
+
e.numpadEnter,
|
|
70
|
+
e.space,
|
|
71
|
+
e.down
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
virtualTriggering: f.virtualTriggering,
|
|
75
|
+
virtualRef: f.virtualRef,
|
|
76
|
+
effect: {
|
|
77
|
+
..._.effect,
|
|
78
|
+
default: "light"
|
|
79
|
+
},
|
|
80
|
+
type: {
|
|
81
|
+
type: o(String)
|
|
82
|
+
},
|
|
83
|
+
placement: {
|
|
84
|
+
type: o(String),
|
|
85
|
+
default: "bottom"
|
|
86
|
+
},
|
|
87
|
+
popperOptions: {
|
|
88
|
+
type: o(Object),
|
|
89
|
+
default: () => ({})
|
|
90
|
+
},
|
|
91
|
+
id: String,
|
|
92
|
+
size: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ""
|
|
95
|
+
},
|
|
96
|
+
splitButton: Boolean,
|
|
97
|
+
hideOnClick: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: !0
|
|
100
|
+
},
|
|
101
|
+
loop: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: !0
|
|
104
|
+
},
|
|
105
|
+
showArrow: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: !0
|
|
108
|
+
},
|
|
109
|
+
showTimeout: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: 150
|
|
112
|
+
},
|
|
113
|
+
hideTimeout: {
|
|
114
|
+
type: Number,
|
|
115
|
+
default: 150
|
|
116
|
+
},
|
|
117
|
+
tabindex: {
|
|
118
|
+
type: o([Number, String]),
|
|
119
|
+
default: 0
|
|
120
|
+
},
|
|
121
|
+
maxHeight: {
|
|
122
|
+
type: o([Number, String]),
|
|
123
|
+
default: ""
|
|
124
|
+
},
|
|
125
|
+
popperClass: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: ""
|
|
128
|
+
},
|
|
129
|
+
disabled: Boolean,
|
|
130
|
+
role: {
|
|
131
|
+
type: String,
|
|
132
|
+
values: b,
|
|
133
|
+
default: "menu"
|
|
134
|
+
},
|
|
135
|
+
buttonProps: {
|
|
136
|
+
type: o(Object)
|
|
137
|
+
},
|
|
138
|
+
teleported: _.teleported,
|
|
139
|
+
persistent: {
|
|
140
|
+
type: Boolean,
|
|
141
|
+
default: !0
|
|
142
|
+
}
|
|
143
|
+
}), q = E({
|
|
144
|
+
command: {
|
|
145
|
+
type: [Object, String, Number],
|
|
146
|
+
default: () => ({})
|
|
147
|
+
},
|
|
148
|
+
disabled: Boolean,
|
|
149
|
+
divided: Boolean,
|
|
150
|
+
textValue: String,
|
|
151
|
+
icon: {
|
|
152
|
+
type: L
|
|
153
|
+
}
|
|
154
|
+
}), z = E({
|
|
155
|
+
onKeydown: { type: o(Function) }
|
|
156
|
+
}), R = [
|
|
157
|
+
e.down,
|
|
158
|
+
e.pageDown,
|
|
159
|
+
e.home
|
|
160
|
+
], j = [e.up, e.pageUp, e.end], G = [...R, ...j], {
|
|
161
|
+
ElCollection: H,
|
|
162
|
+
ElCollectionItem: W,
|
|
163
|
+
COLLECTION_INJECTION_KEY: Q,
|
|
164
|
+
COLLECTION_ITEM_INJECTION_KEY: X
|
|
165
|
+
} = Y("Dropdown");
|
|
166
|
+
export {
|
|
167
|
+
X as C,
|
|
168
|
+
H as E,
|
|
169
|
+
G as F,
|
|
170
|
+
j as L,
|
|
171
|
+
q as a,
|
|
172
|
+
x as b,
|
|
173
|
+
Y as c,
|
|
174
|
+
k as d,
|
|
175
|
+
W as e,
|
|
176
|
+
z as f,
|
|
177
|
+
Q as g
|
|
178
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),K=require("./use-form-common-props-fd9b61a0.cjs"),M=require("./index-098c2447.cjs"),S=require("./el-input-7fd293af.cjs"),se=require("./index-298075cf.cjs"),u=require("./el-popper-b6c99b28.cjs"),n=require("./base-ef747d02.cjs"),re=require("./index-9780a537.cjs"),ae=require("./debounce-62f5b6e8.cjs"),ue=n.buildProps({...S.inputProps,valueKey:{type:String,default:"value"},modelValue:{type:[String,Number],default:""},debounce:{type:Number,default:300},placement:{type:n.definePropType(String),values:["top","top-start","top-end","bottom","bottom-start","bottom-end"],default:"bottom-start"},fetchSuggestions:{type:n.definePropType([Function,Array]),default:n.NOOP},popperClass:{type:String,default:""},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:Boolean,hideLoading:Boolean,teleported:u.useTooltipContentProps.teleported,appendTo:u.useTooltipContentProps.appendTo,highlightFirstItem:Boolean,fitInputWidth:Boolean}),ie={[u.UPDATE_MODEL_EVENT]:s=>n.isString(s)||n.isNumber(s),[u.INPUT_EVENT]:s=>n.isString(s)||n.isNumber(s),[u.CHANGE_EVENT]:s=>n.isString(s)||n.isNumber(s),focus:s=>s instanceof FocusEvent,blur:s=>s instanceof FocusEvent,clear:()=>!0,select:s=>n.isObject(s)},U="ElAutocomplete",ce=e.defineComponent({name:U,inheritAttrs:!1}),de=e.defineComponent({...ce,props:ue,emits:ie,setup(s,{expose:z,emit:d}){const a=s,L=e.computed(()=>u.pick(a,Object.keys(S.inputProps))),R=e.useAttrs(),T=K.useFormDisabled(),i=n.useNamespace("autocomplete"),f=e.ref(),$=e.ref(),b=e.ref(),A=e.ref();let P=!1,C=!1;const p=e.ref([]),r=e.ref(-1),V=e.ref(""),v=e.ref(!1),E=e.ref(!1),m=e.ref(!1),h=re.useId(),W=e.computed(()=>R.style),g=e.computed(()=>(p.value.length>0||m.value)&&v.value),I=e.computed(()=>!a.hideLoading&&m.value),H=e.computed(()=>f.value?Array.from(f.value.$el.querySelectorAll("input")):[]),x=()=>{g.value&&(V.value=`${f.value.$el.offsetWidth}px`)},G=()=>{r.value=-1},_=async t=>{if(E.value)return;const o=l=>{m.value=!1,!E.value&&(n.isArray(l)?(p.value=l,r.value=a.highlightFirstItem?0:-1):u.throwError(U,"autocomplete suggestions must be an array"))};if(m.value=!0,n.isArray(a.fetchSuggestions))o(a.fetchSuggestions);else{const l=await a.fetchSuggestions(t,o);n.isArray(l)&&o(l)}},B=ae.debounce(_,a.debounce),j=t=>{const o=!!t;if(d(u.INPUT_EVENT,t),d(u.UPDATE_MODEL_EVENT,t),E.value=!1,v.value||(v.value=o),!a.triggerOnFocus&&!t){E.value=!0,p.value=[];return}B(t)},J=t=>{var o;T.value||(((o=t.target)==null?void 0:o.tagName)!=="INPUT"||H.value.includes(document.activeElement))&&(v.value=!0)},Q=t=>{d(u.CHANGE_EVENT,t)},X=t=>{var o;if(C)C=!1;else{v.value=!0,d("focus",t);const l=(o=a.modelValue)!=null?o:"";a.triggerOnFocus&&!P&&B(String(l))}},Y=t=>{setTimeout(()=>{var o;if((o=b.value)!=null&&o.isFocusInsideContent()){C=!0;return}v.value&&y(),d("blur",t)})},Z=()=>{v.value=!1,d(u.UPDATE_MODEL_EVENT,""),d("clear")},D=async()=>{var t;(t=f.value)!=null&&t.isComposing||(g.value&&r.value>=0&&r.value<p.value.length?w(p.value[r.value]):a.selectWhenUnmatched&&(d("select",{value:a.modelValue}),p.value=[],r.value=-1))},ee=t=>{g.value&&(t.preventDefault(),t.stopPropagation(),y())},y=()=>{v.value=!1},te=()=>{var t;(t=f.value)==null||t.focus()},oe=()=>{var t;(t=f.value)==null||t.blur()},w=async t=>{d(u.INPUT_EVENT,t[a.valueKey]),d(u.UPDATE_MODEL_EVENT,t[a.valueKey]),d("select",t),p.value=[],r.value=-1},k=t=>{var o,l;if(!g.value||m.value)return;if(t<0){r.value=-1;return}t>=p.value.length&&(t=p.value.length-1);const c=$.value.querySelector(`.${i.be("suggestion","wrap")}`),ne=c.querySelectorAll(`.${i.be("suggestion","list")} li`)[t],O=c.scrollTop,{offsetTop:q,scrollHeight:N}=ne;q+N>O+c.clientHeight&&(c.scrollTop+=N),q<O&&(c.scrollTop-=N),r.value=t,(l=(o=f.value)==null?void 0:o.ref)==null||l.setAttribute("aria-activedescendant",`${h.value}-item-${r.value}`)},F=K.onClickOutside(A,()=>{var t;(t=b.value)!=null&&t.isFocusInsideContent()||g.value&&y()});return e.onBeforeUnmount(()=>{F==null||F()}),e.onMounted(()=>{var t;const o=(t=f.value)==null?void 0:t.ref;o&&([{key:"role",value:"textbox"},{key:"aria-autocomplete",value:"list"},{key:"aria-controls",value:"id"},{key:"aria-activedescendant",value:`${h.value}-item-${r.value}`}].forEach(({key:l,value:c})=>o.setAttribute(l,c)),P=o.hasAttribute("readonly"))}),z({highlightedIndex:r,activated:v,loading:m,inputRef:f,popperRef:b,suggestions:p,handleSelect:w,handleKeyEnter:D,focus:te,blur:oe,close:y,highlight:k,getData:_}),(t,o)=>(e.openBlock(),e.createBlock(e.unref(u.ElTooltip),{ref_key:"popperRef",ref:b,visible:e.unref(g),placement:t.placement,"fallback-placements":["bottom-start","top-start"],"popper-class":[e.unref(i).e("popper"),t.popperClass],teleported:t.teleported,"append-to":t.appendTo,"gpu-acceleration":!1,pure:"","manual-mode":"",effect:"light",trigger:"click",transition:`${e.unref(i).namespace.value}-zoom-in-top`,persistent:"",role:"listbox",onBeforeShow:x,onHide:G},{content:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"regionRef",ref:$,class:e.normalizeClass([e.unref(i).b("suggestion"),e.unref(i).is("loading",e.unref(I))]),style:e.normalizeStyle({[t.fitInputWidth?"width":"minWidth"]:V.value,outline:"none"}),role:"region"},[t.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i).be("suggestion","header")),onClick:e.withModifiers(()=>{},["stop"])},[e.renderSlot(t.$slots,"header")],10,["onClick"])):e.createCommentVNode("v-if",!0),e.createVNode(e.unref(se.ElScrollbar),{id:e.unref(h),tag:"ul","wrap-class":e.unref(i).be("suggestion","wrap"),"view-class":e.unref(i).be("suggestion","list"),role:"listbox"},{default:e.withCtx(()=>[e.unref(I)?(e.openBlock(),e.createElementBlock("li",{key:0},[e.renderSlot(t.$slots,"loading",{},()=>[e.createVNode(e.unref(M.ElIcon),{class:e.normalizeClass(e.unref(i).is("loading"))},{default:e.withCtx(()=>[e.createVNode(e.unref(M.loading_default))]),_:1},8,["class"])])])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(p.value,(l,c)=>(e.openBlock(),e.createElementBlock("li",{id:`${e.unref(h)}-item-${c}`,key:c,class:e.normalizeClass({highlighted:r.value===c}),role:"option","aria-selected":r.value===c,onClick:le=>w(l)},[e.renderSlot(t.$slots,"default",{item:l},()=>[e.createTextVNode(e.toDisplayString(l[t.valueKey]),1)])],10,["id","aria-selected","onClick"]))),128))]),_:3},8,["id","wrap-class","view-class"]),t.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(i).be("suggestion","footer")),onClick:e.withModifiers(()=>{},["stop"])},[e.renderSlot(t.$slots,"footer")],10,["onClick"])):e.createCommentVNode("v-if",!0)],6)]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"listboxRef",ref:A,class:e.normalizeClass([e.unref(i).b(),t.$attrs.class]),style:e.normalizeStyle(e.unref(W)),role:"combobox","aria-haspopup":"listbox","aria-expanded":e.unref(g),"aria-owns":e.unref(h)},[e.createVNode(e.unref(S.ElInput),e.mergeProps({ref_key:"inputRef",ref:f},e.mergeProps(e.unref(L),t.$attrs),{"model-value":t.modelValue,disabled:e.unref(T),onInput:j,onChange:Q,onFocus:X,onBlur:Y,onClear:Z,onKeydown:[e.withKeys(e.withModifiers(l=>k(r.value-1),["prevent"]),["up"]),e.withKeys(e.withModifiers(l=>k(r.value+1),["prevent"]),["down"]),e.withKeys(D,["enter"]),e.withKeys(y,["tab"]),e.withKeys(ee,["esc"])],onMousedown:J}),e.createSlots({_:2},[t.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prepend")])}:void 0,t.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"append")])}:void 0,t.$slots.prefix?{name:"prefix",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"prefix")])}:void 0,t.$slots.suffix?{name:"suffix",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"suffix")])}:void 0]),1040,["model-value","disabled","onKeydown"])],14,["aria-expanded","aria-owns"])]),_:3},8,["visible","placement","popper-class","teleported","append-to","transition"]))}});var pe=n._export_sfc(de,[["__file","autocomplete.vue"]]);const fe=n.withInstall(pe);exports.ElAutocomplete=fe;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as oe, computed as k, useAttrs as Ce, ref as d, onBeforeUnmount as Se, onMounted as Ie, openBlock as b, createBlock as Ne, unref as t, withCtx as v, createElementVNode as X, normalizeClass as y, normalizeStyle as Y, createElementBlock as w, withModifiers as N, renderSlot as g, createCommentVNode as Z, createVNode as T, Fragment as Te, renderList as Ae, createTextVNode as Fe, toDisplayString as Pe, mergeProps as x, withKeys as C, createSlots as Ve } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import { E as De, l as Oe } from "./index-
|
|
4
|
-
import { i as se, E as Ke } from "./el-input-
|
|
5
|
-
import { E as Re } from "./index-
|
|
6
|
-
import {
|
|
7
|
-
import { b as Le,
|
|
8
|
-
import { u as Je } from "./index-
|
|
9
|
-
import { d as Qe } from "./
|
|
2
|
+
import { g as _e, v as Be } from "./use-form-common-props-815d48a6.js";
|
|
3
|
+
import { E as De, l as Oe } from "./index-a871c3eb.js";
|
|
4
|
+
import { i as se, E as Ke } from "./el-input-2f75c4ba.js";
|
|
5
|
+
import { E as Re } from "./index-844bdd85.js";
|
|
6
|
+
import { g as ee, U as A, I as K, C as le, p as Me, E as Ue, b as We } from "./el-popper-b4f97157.js";
|
|
7
|
+
import { b as Le, e as te, N as He, c as B, p as D, f as qe, u as je, _ as ze, j as O, w as Ge } from "./base-a5af3db3.js";
|
|
8
|
+
import { u as Je } from "./index-960806da.js";
|
|
9
|
+
import { d as Qe } from "./debounce-8d53f4dd.js";
|
|
10
10
|
const Xe = Le({
|
|
11
11
|
...se,
|
|
12
12
|
valueKey: {
|
|
@@ -67,7 +67,7 @@ const Xe = Le({
|
|
|
67
67
|
props: Xe,
|
|
68
68
|
emits: Ye,
|
|
69
69
|
setup(l, { expose: ne, emit: i }) {
|
|
70
|
-
const n = l, re = k(() => Me(n, Object.keys(se))), ue = Ce(), R = _e(), r =
|
|
70
|
+
const n = l, re = k(() => Me(n, Object.keys(se))), ue = Ce(), R = _e(), r = je("autocomplete"), p = d(), M = d(), S = d(), U = d();
|
|
71
71
|
let W = !1, F = !1;
|
|
72
72
|
const c = d([]), a = d(-1), L = d(""), f = d(!1), I = d(!1), h = d(!1), E = Je(), ie = k(() => ue.style), m = k(() => (c.value.length > 0 || h.value) && f.value), H = k(() => !n.hideLoading && h.value), ce = k(() => p.value ? Array.from(p.value.$el.querySelectorAll("input")) : []), pe = () => {
|
|
73
73
|
m.value && (L.value = `${p.value.$el.offsetWidth}px`);
|
|
@@ -85,13 +85,13 @@ const Xe = Le({
|
|
|
85
85
|
const s = await n.fetchSuggestions(e, o);
|
|
86
86
|
O(s) && o(s);
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, j = Qe(q, n.debounce), fe = (e) => {
|
|
89
89
|
const o = !!e;
|
|
90
90
|
if (i(K, e), i(A, e), I.value = !1, f.value || (f.value = o), !n.triggerOnFocus && !e) {
|
|
91
91
|
I.value = !0, c.value = [];
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
j(e);
|
|
95
95
|
}, ve = (e) => {
|
|
96
96
|
var o;
|
|
97
97
|
R.value || (((o = e.target) == null ? void 0 : o.tagName) !== "INPUT" || ce.value.includes(document.activeElement)) && (f.value = !0);
|
|
@@ -104,7 +104,7 @@ const Xe = Le({
|
|
|
104
104
|
else {
|
|
105
105
|
f.value = !0, i("focus", e);
|
|
106
106
|
const s = (o = n.modelValue) != null ? o : "";
|
|
107
|
-
n.triggerOnFocus && !W &&
|
|
107
|
+
n.triggerOnFocus && !W && j(String(s));
|
|
108
108
|
}
|
|
109
109
|
}, he = (e) => {
|
|
110
110
|
setTimeout(() => {
|
|
@@ -117,7 +117,7 @@ const Xe = Le({
|
|
|
117
117
|
});
|
|
118
118
|
}, be = () => {
|
|
119
119
|
f.value = !1, i(A, ""), i("clear");
|
|
120
|
-
},
|
|
120
|
+
}, z = async () => {
|
|
121
121
|
var e;
|
|
122
122
|
(e = p.value) != null && e.isComposing || (m.value && a.value >= 0 && a.value < c.value.length ? P(c.value[a.value]) : n.selectWhenUnmatched && (i("select", { value: n.modelValue }), c.value = [], a.value = -1));
|
|
123
123
|
}, ye = (e) => {
|
|
@@ -169,7 +169,7 @@ const Xe = Le({
|
|
|
169
169
|
popperRef: S,
|
|
170
170
|
suggestions: c,
|
|
171
171
|
handleSelect: P,
|
|
172
|
-
handleKeyEnter:
|
|
172
|
+
handleKeyEnter: z,
|
|
173
173
|
focus: Ee,
|
|
174
174
|
blur: $e,
|
|
175
175
|
close: $,
|
|
@@ -283,7 +283,7 @@ const Xe = Le({
|
|
|
283
283
|
onKeydown: [
|
|
284
284
|
C(N((s) => V(a.value - 1), ["prevent"]), ["up"]),
|
|
285
285
|
C(N((s) => V(a.value + 1), ["prevent"]), ["down"]),
|
|
286
|
-
C(
|
|
286
|
+
C(z, ["enter"]),
|
|
287
287
|
C($, ["tab"]),
|
|
288
288
|
C(ye, ["esc"])
|
|
289
289
|
],
|
|
@@ -322,7 +322,7 @@ const Xe = Le({
|
|
|
322
322
|
}, 8, ["visible", "placement", "popper-class", "teleported", "append-to", "transition"]));
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
|
-
var et = /* @__PURE__ */
|
|
325
|
+
var et = /* @__PURE__ */ ze(xe, [["__file", "autocomplete.vue"]]);
|
|
326
326
|
const ct = Ge(et);
|
|
327
327
|
export {
|
|
328
328
|
ct as E
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed as u, inject as M, ref as O, useSlots as R, Text as q, defineComponent as B, openBlock as m, createBlock as y, resolveDynamicComponent as N, mergeProps as H, unref as d, withCtx as V, createElementBlock as $, Fragment as J, renderSlot as k, normalizeClass as w, createCommentVNode as T, provide as L, reactive as Q, toRef as P } from "vue";
|
|
2
|
-
import { l as W, E as G } from "./index-
|
|
2
|
+
import { l as W, E as G } from "./index-a871c3eb.js";
|
|
3
3
|
import { u as X } from "./index-2e331d74.js";
|
|
4
|
-
import { a as Y } from "./use-global-config-
|
|
5
|
-
import {
|
|
6
|
-
import { b as ot,
|
|
4
|
+
import { a as Y } from "./use-global-config-b5e9d3d5.js";
|
|
5
|
+
import { d as Z, e as tt, g as F, h as et, i as D } from "./use-form-common-props-815d48a6.js";
|
|
6
|
+
import { b as ot, e as lt, u as I, _ as K, w as nt, l as at } from "./base-a5af3db3.js";
|
|
7
7
|
import { T as rt } from "./index-657047bb.js";
|
|
8
8
|
const j = Symbol("buttonGroupContextKey"), st = (t, c) => {
|
|
9
9
|
X({
|
|
@@ -13,21 +13,21 @@ const j = Symbol("buttonGroupContextKey"), st = (t, c) => {
|
|
|
13
13
|
scope: "props",
|
|
14
14
|
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
|
|
15
15
|
}, u(() => t.type === "text"));
|
|
16
|
-
const
|
|
16
|
+
const n = M(j, void 0), l = Y("button"), { form: s } = Z(), a = tt(u(() => n == null ? void 0 : n.size)), o = F(), b = O(), v = R(), p = u(() => {
|
|
17
17
|
var e;
|
|
18
|
-
return t.type || (
|
|
18
|
+
return t.type || (n == null ? void 0 : n.type) || ((e = l.value) == null ? void 0 : e.type) || "";
|
|
19
19
|
}), g = u(() => {
|
|
20
20
|
var e, r, i;
|
|
21
|
-
return (i = (r = t.autoInsertSpace) != null ? r : (e =
|
|
21
|
+
return (i = (r = t.autoInsertSpace) != null ? r : (e = l.value) == null ? void 0 : e.autoInsertSpace) != null ? i : !1;
|
|
22
22
|
}), h = u(() => {
|
|
23
23
|
var e, r, i;
|
|
24
|
-
return (i = (r = t.plain) != null ? r : (e =
|
|
24
|
+
return (i = (r = t.plain) != null ? r : (e = l.value) == null ? void 0 : e.plain) != null ? i : !1;
|
|
25
25
|
}), S = u(() => {
|
|
26
26
|
var e, r, i;
|
|
27
|
-
return (i = (r = t.round) != null ? r : (e =
|
|
27
|
+
return (i = (r = t.round) != null ? r : (e = l.value) == null ? void 0 : e.round) != null ? i : !1;
|
|
28
28
|
}), C = u(() => {
|
|
29
29
|
var e, r, i;
|
|
30
|
-
return (i = (r = t.text) != null ? r : (e =
|
|
30
|
+
return (i = (r = t.text) != null ? r : (e = l.value) == null ? void 0 : e.text) != null ? i : !1;
|
|
31
31
|
}), _ = u(() => t.tag === "button" ? {
|
|
32
32
|
ariaDisabled: o.value || t.loading,
|
|
33
33
|
disabled: o.value || t.loading,
|
|
@@ -116,7 +116,7 @@ const j = Symbol("buttonGroupContextKey"), st = (t, c) => {
|
|
|
116
116
|
default: void 0
|
|
117
117
|
},
|
|
118
118
|
tag: {
|
|
119
|
-
type:
|
|
119
|
+
type: lt([String, Object]),
|
|
120
120
|
default: "button"
|
|
121
121
|
}
|
|
122
122
|
}), ut = {
|
|
@@ -126,28 +126,28 @@ function f(t, c = 20) {
|
|
|
126
126
|
return t.mix("#141414", c).toString();
|
|
127
127
|
}
|
|
128
128
|
function dt(t) {
|
|
129
|
-
const c = F(),
|
|
129
|
+
const c = F(), n = I("button");
|
|
130
130
|
return u(() => {
|
|
131
|
-
let
|
|
131
|
+
let l = {}, s = t.color;
|
|
132
132
|
if (s) {
|
|
133
133
|
const a = s.match(/var\((.*?)\)/);
|
|
134
134
|
a && (s = window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1]));
|
|
135
135
|
const o = new rt(s), b = t.dark ? o.tint(20).toString() : f(o, 20);
|
|
136
136
|
if (t.plain)
|
|
137
|
-
|
|
137
|
+
l = n.cssVarBlock({
|
|
138
138
|
"bg-color": t.dark ? f(o, 90) : o.tint(90).toString(),
|
|
139
139
|
"text-color": s,
|
|
140
140
|
"border-color": t.dark ? f(o, 50) : o.tint(50).toString(),
|
|
141
|
-
"hover-text-color": `var(${
|
|
141
|
+
"hover-text-color": `var(${n.cssVarName("color-white")})`,
|
|
142
142
|
"hover-bg-color": s,
|
|
143
143
|
"hover-border-color": s,
|
|
144
144
|
"active-bg-color": b,
|
|
145
|
-
"active-text-color": `var(${
|
|
145
|
+
"active-text-color": `var(${n.cssVarName("color-white")})`,
|
|
146
146
|
"active-border-color": b
|
|
147
|
-
}), c.value && (n
|
|
147
|
+
}), c.value && (l[n.cssVarBlockName("disabled-bg-color")] = t.dark ? f(o, 90) : o.tint(90).toString(), l[n.cssVarBlockName("disabled-text-color")] = t.dark ? f(o, 50) : o.tint(50).toString(), l[n.cssVarBlockName("disabled-border-color")] = t.dark ? f(o, 80) : o.tint(80).toString());
|
|
148
148
|
else {
|
|
149
|
-
const v = t.dark ? f(o, 30) : o.tint(30).toString(), p = o.isDark() ? `var(${
|
|
150
|
-
if (
|
|
149
|
+
const v = t.dark ? f(o, 30) : o.tint(30).toString(), p = o.isDark() ? `var(${n.cssVarName("color-white")})` : `var(${n.cssVarName("color-black")})`;
|
|
150
|
+
if (l = n.cssVarBlock({
|
|
151
151
|
"bg-color": s,
|
|
152
152
|
"text-color": p,
|
|
153
153
|
"border-color": s,
|
|
@@ -158,11 +158,11 @@ function dt(t) {
|
|
|
158
158
|
"active-border-color": b
|
|
159
159
|
}), c.value) {
|
|
160
160
|
const g = t.dark ? f(o, 50) : o.tint(50).toString();
|
|
161
|
-
n
|
|
161
|
+
l[n.cssVarBlockName("disabled-bg-color")] = g, l[n.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${n.cssVarName("color-white")})`, l[n.cssVarBlockName("disabled-border-color")] = g;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return l;
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
const bt = B({
|
|
@@ -171,8 +171,8 @@ const bt = B({
|
|
|
171
171
|
...bt,
|
|
172
172
|
props: z,
|
|
173
173
|
emits: ut,
|
|
174
|
-
setup(t, { expose: c, emit:
|
|
175
|
-
const
|
|
174
|
+
setup(t, { expose: c, emit: n }) {
|
|
175
|
+
const l = t, s = dt(l), a = I("button"), {
|
|
176
176
|
_ref: o,
|
|
177
177
|
_size: b,
|
|
178
178
|
_type: v,
|
|
@@ -183,18 +183,18 @@ const bt = B({
|
|
|
183
183
|
_text: C,
|
|
184
184
|
shouldAddSpace: _,
|
|
185
185
|
handleClick: x
|
|
186
|
-
} = st(
|
|
186
|
+
} = st(l, n), E = u(() => [
|
|
187
187
|
a.b(),
|
|
188
188
|
a.m(v.value),
|
|
189
189
|
a.m(b.value),
|
|
190
190
|
a.is("disabled", p.value),
|
|
191
|
-
a.is("loading",
|
|
191
|
+
a.is("loading", l.loading),
|
|
192
192
|
a.is("plain", h.value),
|
|
193
193
|
a.is("round", S.value),
|
|
194
|
-
a.is("circle",
|
|
194
|
+
a.is("circle", l.circle),
|
|
195
195
|
a.is("text", C.value),
|
|
196
|
-
a.is("link",
|
|
197
|
-
a.is("has-bg",
|
|
196
|
+
a.is("link", l.link),
|
|
197
|
+
a.is("has-bg", l.bg)
|
|
198
198
|
]);
|
|
199
199
|
return c({
|
|
200
200
|
ref: o,
|
|
@@ -253,16 +253,16 @@ const mt = {
|
|
|
253
253
|
size: P(c, "size"),
|
|
254
254
|
type: P(c, "type")
|
|
255
255
|
}));
|
|
256
|
-
const
|
|
257
|
-
return (
|
|
258
|
-
class: w(d(
|
|
256
|
+
const n = I("button");
|
|
257
|
+
return (l, s) => (m(), $("div", {
|
|
258
|
+
class: w(d(n).b("group"))
|
|
259
259
|
}, [
|
|
260
|
-
k(
|
|
260
|
+
k(l.$slots, "default")
|
|
261
261
|
], 2));
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
var A = /* @__PURE__ */ K(gt, [["__file", "button-group.vue"]]);
|
|
265
|
-
const xt =
|
|
265
|
+
const xt = nt(ft, {
|
|
266
266
|
ButtonGroup: A
|
|
267
267
|
});
|
|
268
268
|
at(A);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),S=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),S=require("./index-098c2447.cjs"),z=require("./index-f1c702f6.cjs"),E=require("./use-global-config-30d7d8ce.cjs"),b=require("./use-form-common-props-fd9b61a0.cjs"),p=require("./base-ef747d02.cjs"),I=require("./index-eea0bcb3.cjs"),N=Symbol("buttonGroupContextKey"),P=(o,u)=>{z.useDeprecated({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},e.computed(()=>o.type==="text"));const r=e.inject(N,void 0),l=E.useGlobalConfig("button"),{form:c}=b.useFormItem(),a=b.useFormSize(e.computed(()=>r==null?void 0:r.size)),n=b.useFormDisabled(),d=e.ref(),m=e.useSlots(),v=e.computed(()=>{var t;return o.type||(r==null?void 0:r.type)||((t=l.value)==null?void 0:t.type)||""}),g=e.computed(()=>{var t,s,i;return(i=(s=o.autoInsertSpace)!=null?s:(t=l.value)==null?void 0:t.autoInsertSpace)!=null?i:!1}),y=e.computed(()=>{var t,s,i;return(i=(s=o.plain)!=null?s:(t=l.value)==null?void 0:t.plain)!=null?i:!1}),_=e.computed(()=>{var t,s,i;return(i=(s=o.round)!=null?s:(t=l.value)==null?void 0:t.round)!=null?i:!1}),B=e.computed(()=>{var t,s,i;return(i=(s=o.text)!=null?s:(t=l.value)==null?void 0:t.text)!=null?i:!1}),k=e.computed(()=>o.tag==="button"?{ariaDisabled:n.value||o.loading,disabled:n.value||o.loading,autofocus:o.autofocus,type:o.nativeType}:{}),C=e.computed(()=>{var t;const s=(t=m.default)==null?void 0:t.call(m);if(g.value&&(s==null?void 0:s.length)===1){const i=s[0];if((i==null?void 0:i.type)===e.Text){const w=i.children;return/^\p{Unified_Ideograph}{2}$/u.test(w.trim())}}return!1});return{_disabled:n,_size:a,_type:v,_ref:d,_props:k,_plain:y,_round:_,_text:B,shouldAddSpace:C,handleClick:t=>{if(n.value||o.loading){t.stopPropagation();return}o.nativeType==="reset"&&(c==null||c.resetFields()),u("click",t)}}},$=["default","primary","success","warning","info","danger","text",""],T=["button","submit","reset"],h=p.buildProps({size:b.useSizeProp,disabled:Boolean,type:{type:String,values:$,default:""},icon:{type:b.iconPropType},nativeType:{type:String,values:T,default:"button"},loading:Boolean,loadingIcon:{type:b.iconPropType,default:()=>S.loading_default},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:p.definePropType([String,Object]),default:"button"}}),D={click:o=>o instanceof MouseEvent};function f(o,u=20){return o.mix("#141414",u).toString()}function G(o){const u=b.useFormDisabled(),r=p.useNamespace("button");return e.computed(()=>{let l={},c=o.color;if(c){const a=c.match(/var\((.*?)\)/);a&&(c=window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1]));const n=new I.TinyColor(c),d=o.dark?n.tint(20).toString():f(n,20);if(o.plain)l=r.cssVarBlock({"bg-color":o.dark?f(n,90):n.tint(90).toString(),"text-color":c,"border-color":o.dark?f(n,50):n.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":c,"hover-border-color":c,"active-bg-color":d,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":d}),u.value&&(l[r.cssVarBlockName("disabled-bg-color")]=o.dark?f(n,90):n.tint(90).toString(),l[r.cssVarBlockName("disabled-text-color")]=o.dark?f(n,50):n.tint(50).toString(),l[r.cssVarBlockName("disabled-border-color")]=o.dark?f(n,80):n.tint(80).toString());else{const m=o.dark?f(n,30):n.tint(30).toString(),v=n.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(l=r.cssVarBlock({"bg-color":c,"text-color":v,"border-color":c,"hover-bg-color":m,"hover-text-color":v,"hover-border-color":m,"active-bg-color":d,"active-border-color":d}),u.value){const g=o.dark?f(n,50):n.tint(50).toString();l[r.cssVarBlockName("disabled-bg-color")]=g,l[r.cssVarBlockName("disabled-text-color")]=o.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,l[r.cssVarBlockName("disabled-border-color")]=g}}}return l})}const q=e.defineComponent({name:"ElButton"}),F=e.defineComponent({...q,props:h,emits:D,setup(o,{expose:u,emit:r}){const l=o,c=G(l),a=p.useNamespace("button"),{_ref:n,_size:d,_type:m,_disabled:v,_props:g,_plain:y,_round:_,_text:B,shouldAddSpace:k,handleClick:C}=P(l,r),x=e.computed(()=>[a.b(),a.m(m.value),a.m(d.value),a.is("disabled",v.value),a.is("loading",l.loading),a.is("plain",y.value),a.is("round",_.value),a.is("circle",l.circle),a.is("text",B.value),a.is("link",l.link),a.is("has-bg",l.bg)]);return u({ref:n,size:d,type:m,disabled:v,shouldAddSpace:k}),(t,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps({ref_key:"_ref",ref:n},e.unref(g),{class:e.unref(x),style:e.unref(c),onClick:e.unref(C)}),{default:e.withCtx(()=>[t.loading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.$slots.loading?e.renderSlot(t.$slots,"loading",{key:0}):(e.openBlock(),e.createBlock(e.unref(S.ElIcon),{key:1,class:e.normalizeClass(e.unref(a).is("loading"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.loadingIcon)))]),_:1},8,["class"]))],64)):t.icon||t.$slots.icon?(e.openBlock(),e.createBlock(e.unref(S.ElIcon),{key:1},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0})):e.renderSlot(t.$slots,"icon",{key:1})]),_:3})):e.createCommentVNode("v-if",!0),t.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass({[e.unref(a).em("text","expand")]:e.unref(k)})},[e.renderSlot(t.$slots,"default")],2)):e.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var K=p._export_sfc(F,[["__file","button.vue"]]);const j={size:h.size,type:h.type},A=e.defineComponent({name:"ElButtonGroup"}),R=e.defineComponent({...A,props:j,setup(o){const u=o;e.provide(N,e.reactive({size:e.toRef(u,"size"),type:e.toRef(u,"type")}));const r=p.useNamespace("button");return(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r).b("group"))},[e.renderSlot(l.$slots,"default")],2))}});var V=p._export_sfc(R,[["__file","button-group.vue"]]);const U=p.withInstall(K,{ButtonGroup:V});p.withNoopInstall(V);exports.ElButton=U;exports.buttonTypes=$;
|