tutor-pro-ui-vue 1.0.49-beta → 1.0.53-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
import { unref as d, defineComponent as p, resolveComponent as C, openBlock as s, createBlock as h, withCtx as x, createElementBlock as T, Fragment as B, createTextVNode as F, toDisplayString as w, renderSlot as P } from "vue";
|
|
2
|
+
function m(e) {
|
|
3
|
+
return typeof e == "function" ? e() : d(e);
|
|
4
|
+
}
|
|
5
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
6
|
+
const f = () => {
|
|
7
|
+
};
|
|
8
|
+
function g(e, o) {
|
|
9
|
+
function n(...t) {
|
|
10
|
+
return new Promise((l, c) => {
|
|
11
|
+
Promise.resolve(e(() => o.apply(this, t), { fn: o, thisArg: this, args: t })).then(l).catch(c);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
function N(e, o = {}) {
|
|
17
|
+
let n, t, l = f;
|
|
18
|
+
const c = (r) => {
|
|
19
|
+
clearTimeout(r), l(), l = f;
|
|
20
|
+
};
|
|
21
|
+
return (r) => {
|
|
22
|
+
const i = m(e), u = m(o.maxWait);
|
|
23
|
+
return n && c(n), i <= 0 || u !== void 0 && u <= 0 ? (t && (c(t), t = null), Promise.resolve(r())) : new Promise((a, y) => {
|
|
24
|
+
l = o.rejectOnCancel ? y : a, u && !t && (t = setTimeout(() => {
|
|
25
|
+
n && c(n), t = null, a(r());
|
|
26
|
+
}, u)), n = setTimeout(() => {
|
|
27
|
+
t && c(t), t = null, a(r());
|
|
28
|
+
}, i);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function S(e, o = 200, n = {}) {
|
|
33
|
+
return g(
|
|
34
|
+
N(o, n),
|
|
35
|
+
e
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const W = p({
|
|
39
|
+
name: "CommonButton"
|
|
40
|
+
}), j = /* @__PURE__ */ p({
|
|
41
|
+
...W,
|
|
42
|
+
props: {
|
|
43
|
+
label: {
|
|
44
|
+
default: () => "",
|
|
45
|
+
type: Function
|
|
46
|
+
},
|
|
47
|
+
debounce: {
|
|
48
|
+
default: 300,
|
|
49
|
+
type: Number
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
emits: ["click"],
|
|
53
|
+
setup(e, { emit: o }) {
|
|
54
|
+
const n = e, t = o, l = S(() => {
|
|
55
|
+
t == null || t("click");
|
|
56
|
+
}, Number(n.debounce));
|
|
57
|
+
return (c, k) => {
|
|
58
|
+
const r = C("el-button");
|
|
59
|
+
return s(), h(r, { onClick: d(l) }, {
|
|
60
|
+
default: x(() => {
|
|
61
|
+
var i, u;
|
|
62
|
+
return [
|
|
63
|
+
(i = e.label) != null && i.call(e) ? (s(), T(B, { key: 0 }, [
|
|
64
|
+
F(w((u = n.label) == null ? void 0 : u.call(n)), 1)
|
|
65
|
+
], 64)) : P(c.$slots, "default", { key: 1 })
|
|
66
|
+
];
|
|
67
|
+
}),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 8, ["onClick"]);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}), D = (e, o) => (e.install = (n) => {
|
|
73
|
+
for (const t of [e, ...Object.values({})])
|
|
74
|
+
n.component(t.name, t);
|
|
75
|
+
}, e), _ = {
|
|
76
|
+
label: {
|
|
77
|
+
default: () => "",
|
|
78
|
+
type: Function
|
|
79
|
+
},
|
|
80
|
+
debounce: {
|
|
81
|
+
default: 300,
|
|
82
|
+
type: Number
|
|
83
|
+
}
|
|
84
|
+
}, O = D(j), v = (e) => e, b = {
|
|
85
|
+
CommonButton: O
|
|
86
|
+
}, G = (e) => {
|
|
87
|
+
for (const o in b)
|
|
88
|
+
e.component(o, b[o]);
|
|
89
|
+
}, A = (e) => {
|
|
90
|
+
G(e);
|
|
91
|
+
};
|
|
92
|
+
export {
|
|
93
|
+
O as CommonButton,
|
|
94
|
+
_ as commonButtonProps,
|
|
95
|
+
v as getOptionsLabel,
|
|
96
|
+
A as install
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(l,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(l=typeof globalThis<"u"?globalThis:l||self,n(l["tutor-pro-ui-vue"]={},l.Vue))})(this,function(l,n){"use strict";function m(e){return typeof e=="function"?e():n.unref(e)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const d=()=>{};function y(e,c){function o(...t){return new Promise((r,i)=>{Promise.resolve(e(()=>c.apply(this,t),{fn:c,thisArg:this,args:t})).then(r).catch(i)})}return o}function h(e,c={}){let o,t,r=d;const i=u=>{clearTimeout(u),r(),r=d};return u=>{const a=m(e),s=m(c.maxWait);return o&&i(o),a<=0||s!==void 0&&s<=0?(t&&(i(t),t=null),Promise.resolve(u())):new Promise((f,w)=>{r=c.rejectOnCancel?w:f,s&&!t&&(t=setTimeout(()=>{o&&i(o),t=null,f(u())},s)),o=setTimeout(()=>{t&&i(t),t=null,f(u())},a)})}}function k(e,c=200,o={}){return y(h(c,o),e)}const C=n.defineComponent({name:"CommonButton"}),T=n.defineComponent({...C,props:{label:{default:()=>"",type:Function},debounce:{default:300,type:Number}},emits:["click"],setup(e,{emit:c}){const o=e,t=c,r=k(()=>{t==null||t("click")},Number(o.debounce));return(i,j)=>{const u=n.resolveComponent("el-button");return n.openBlock(),n.createBlock(u,{onClick:n.unref(r)},{default:n.withCtx(()=>{var a,s;return[(a=e.label)!=null&&a.call(e)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString((s=o.label)==null?void 0:s.call(o)),1)],64)):n.renderSlot(i.$slots,"default",{key:1})]}),_:3},8,["onClick"])}}}),B=(e,c)=>(e.install=o=>{for(const t of[e,...Object.values({})])o.component(t.name,t)},e),P={label:{default:()=>"",type:Function},debounce:{default:300,type:Number}},p=B(T),g=e=>e,b={CommonButton:p},F=e=>{for(const c in b)e.component(c,b[c])},S=e=>{F(e)};l.CommonButton=p,l.commonButtonProps=P,l.getOptionsLabel=g,l.install=S,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -7,30 +7,30 @@ declare function __VLS_template(): {
|
|
|
7
7
|
};
|
|
8
8
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
9
|
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
10
|
-
debounce: {
|
|
11
|
-
type: NumberConstructor;
|
|
12
|
-
default: number;
|
|
13
|
-
};
|
|
14
10
|
label: {
|
|
15
|
-
type: FunctionConstructor;
|
|
16
11
|
default: () => string;
|
|
12
|
+
type: FunctionConstructor;
|
|
17
13
|
};
|
|
18
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
-
click: (...args: any[]) => void;
|
|
20
|
-
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
14
|
debounce: {
|
|
22
|
-
type: NumberConstructor;
|
|
23
15
|
default: number;
|
|
16
|
+
type: NumberConstructor;
|
|
24
17
|
};
|
|
18
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
click: (...args: any[]) => void;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
25
21
|
label: {
|
|
26
|
-
type: FunctionConstructor;
|
|
27
22
|
default: () => string;
|
|
23
|
+
type: FunctionConstructor;
|
|
24
|
+
};
|
|
25
|
+
debounce: {
|
|
26
|
+
default: number;
|
|
27
|
+
type: NumberConstructor;
|
|
28
28
|
};
|
|
29
29
|
}>> & Readonly<{
|
|
30
30
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
31
31
|
}>, {
|
|
32
|
-
debounce: number;
|
|
33
32
|
label: Function;
|
|
33
|
+
debounce: number;
|
|
34
34
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
35
35
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
36
|
export default _default;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { ButtonProps } from 'element-plus';
|
|
2
|
-
import { ExtractPropTypes
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { ExtractPropTypes } from 'vue';
|
|
3
|
+
export declare const commonButtonProps: {
|
|
4
|
+
readonly label: {
|
|
5
|
+
readonly default: () => string;
|
|
6
|
+
readonly type: FunctionConstructor;
|
|
7
|
+
};
|
|
8
|
+
readonly debounce: {
|
|
9
|
+
readonly default: 300;
|
|
10
|
+
readonly type: NumberConstructor;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type CommonButtonProps = ExtractPropTypes<typeof commonButtonProps> & ButtonProps;
|
package/dist/src/index.d.ts
CHANGED