tutor-pro-ui-vue 1.0.31-beta → 1.0.32-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.d.ts +0 -5
- package/dist/index.js +58 -55
- package/dist/index.umd.cjs +1 -1
- package/dist/src/components/CommonButton/index.d.ts +1 -1
- package/dist/src/components/CommonButton/src/index.vue.d.ts +41 -0
- package/dist/src/components/CommonButton/src/types.d.ts +4 -2
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/options/index.d.ts +4 -0
- package/package.json +2 -2
- package/dist/src/components/CommonButton/src/index.d.ts +0 -27
- package/dist/src/components/index.d.ts +0 -10
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { unref as
|
|
2
|
-
function
|
|
3
|
-
return typeof e == "function" ? e() :
|
|
1
|
+
import { unref as b, defineComponent as k, resolveComponent as h, openBlock as s, createBlock as y, withCtx as x, createElementBlock as T, Fragment as w, createTextVNode as B, toDisplayString as F, renderSlot as g } from "vue";
|
|
2
|
+
function m(e) {
|
|
3
|
+
return typeof e == "function" ? e() : b(e);
|
|
4
4
|
}
|
|
5
5
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
6
6
|
const f = () => {
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
function
|
|
10
|
-
return new Promise((
|
|
11
|
-
Promise.resolve(e(() =>
|
|
8
|
+
function P(e, n) {
|
|
9
|
+
function o(...t) {
|
|
10
|
+
return new Promise((l, c) => {
|
|
11
|
+
Promise.resolve(e(() => n.apply(this, t), { fn: n, thisArg: this, args: t })).then(l).catch(c);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
return
|
|
14
|
+
return o;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
let
|
|
18
|
-
const
|
|
19
|
-
clearTimeout(
|
|
16
|
+
function S(e, n = {}) {
|
|
17
|
+
let o, t, l = f;
|
|
18
|
+
const c = (r) => {
|
|
19
|
+
clearTimeout(r), l(), l = f;
|
|
20
20
|
};
|
|
21
|
-
return (
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
21
|
+
return (r) => {
|
|
22
|
+
const u = m(e), i = m(n.maxWait);
|
|
23
|
+
return o && c(o), u <= 0 || i !== void 0 && i <= 0 ? (t && (c(t), t = null), Promise.resolve(r())) : new Promise((a, C) => {
|
|
24
|
+
l = n.rejectOnCancel ? C : a, i && !t && (t = setTimeout(() => {
|
|
25
|
+
o && c(o), t = null, a(r());
|
|
26
|
+
}, i)), o = setTimeout(() => {
|
|
27
|
+
t && c(t), t = null, a(r());
|
|
28
|
+
}, u);
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
-
|
|
32
|
+
function W(e, n = 200, o = {}) {
|
|
33
|
+
return P(
|
|
34
|
+
S(n, o),
|
|
35
35
|
e
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
name: "CommonButton"
|
|
38
|
+
const j = k({
|
|
39
|
+
name: "CommonButton"
|
|
40
|
+
}), D = /* @__PURE__ */ k({
|
|
41
|
+
...j,
|
|
40
42
|
props: {
|
|
41
43
|
debounce: {
|
|
42
44
|
type: Number,
|
|
@@ -48,37 +50,38 @@ const T = /* @__PURE__ */ b({
|
|
|
48
50
|
}
|
|
49
51
|
},
|
|
50
52
|
emits: ["click"],
|
|
51
|
-
setup(e, {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
setup(e, { emit: n }) {
|
|
54
|
+
const o = e, t = n, l = W(() => {
|
|
55
|
+
t == null || t("click");
|
|
56
|
+
}, Number(o.debounce));
|
|
57
|
+
return (c, p) => {
|
|
58
|
+
const r = h("el-button");
|
|
59
|
+
return s(), y(r, { onClick: b(l) }, {
|
|
60
|
+
default: x(() => {
|
|
61
|
+
var u, i;
|
|
62
|
+
return [
|
|
63
|
+
(u = e.label) != null && u.call(e) ? (s(), T(w, { key: 0 }, [
|
|
64
|
+
B(F((i = e.label) == null ? void 0 : i.call(e)), 1)
|
|
65
|
+
], 64)) : g(c.$slots, "default", { key: 1 })
|
|
66
|
+
];
|
|
67
|
+
}),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 8, ["onClick"]);
|
|
58
70
|
};
|
|
59
|
-
},
|
|
60
|
-
render() {
|
|
61
|
-
return h(C("el-button"), {
|
|
62
|
-
onClick: this.debounceClick
|
|
63
|
-
}, {
|
|
64
|
-
default: () => {
|
|
65
|
-
var e, t, n;
|
|
66
|
-
return ((e = this.label) == null ? void 0 : e.call(this)) || ((n = (t = this.$slots).default) == null ? void 0 : n.call(t));
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
71
|
}
|
|
70
|
-
}),
|
|
71
|
-
for (const
|
|
72
|
-
|
|
73
|
-
}, e),
|
|
74
|
-
CommonButton:
|
|
75
|
-
},
|
|
76
|
-
for (const
|
|
77
|
-
e.component(
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
72
|
+
}), N = (e, n) => (e.install = (o) => {
|
|
73
|
+
for (const t of [e, ...Object.values({})])
|
|
74
|
+
o.component(t.name, t);
|
|
75
|
+
}, e), O = N(D), A = (e) => e, d = {
|
|
76
|
+
CommonButton: O
|
|
77
|
+
}, G = (e) => {
|
|
78
|
+
for (const n in d)
|
|
79
|
+
e.component(n, d[n]);
|
|
80
|
+
}, V = (e) => {
|
|
81
|
+
G(e);
|
|
82
|
+
}, E = { install: V };
|
|
81
83
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
O as CommonButton,
|
|
85
|
+
E as default,
|
|
86
|
+
A as getOptionsLabel
|
|
84
87
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(i,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(i=typeof globalThis<"u"?globalThis:i||self,n(i["tutor-pro-ui-vue"]={},i.Vue))})(this,function(i,n){"use strict";function m(e){return typeof e=="function"?e():n.unref(e)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const d=()=>{};function h(e,o){function l(...t){return new Promise((r,c)=>{Promise.resolve(e(()=>o.apply(this,t),{fn:o,thisArg:this,args:t})).then(r).catch(c)})}return l}function k(e,o={}){let l,t,r=d;const c=u=>{clearTimeout(u),r(),r=d};return u=>{const a=m(e),s=m(o.maxWait);return l&&c(l),a<=0||s!==void 0&&s<=0?(t&&(c(t),t=null),Promise.resolve(u())):new Promise((f,S)=>{r=o.rejectOnCancel?S:f,s&&!t&&(t=setTimeout(()=>{l&&c(l),t=null,f(u())},s)),l=setTimeout(()=>{t&&c(t),t=null,f(u())},a)})}}function y(e,o=200,l={}){return h(k(o,l),e)}const C=n.defineComponent({name:"CommonButton"}),T=n.defineComponent({...C,props:{debounce:{type:Number,default:300},label:{type:Function,default:()=>""}},emits:["click"],setup(e,{emit:o}){const l=e,t=o,r=y(()=>{t==null||t("click")},Number(l.debounce));return(c,w)=>{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=e.label)==null?void 0:s.call(e)),1)],64)):n.renderSlot(c.$slots,"default",{key:1})]}),_:3},8,["onClick"])}}}),b=((e,o)=>(e.install=l=>{for(const t of[e,...Object.values({})])l.component(t.name,t)},e))(T),x=e=>e,p={CommonButton:b},B=e=>{for(const o in p)e.component(o,p[o])},g={install:e=>{B(e)}};i.CommonButton=b,i.default=g,i.getOptionsLabel=x,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../typescript';
|
|
2
|
-
import { default as Button } from './src/index';
|
|
2
|
+
import { default as Button } from './src/index.vue';
|
|
3
3
|
declare const CommonButton: SFCWithInstall<typeof Button>;
|
|
4
4
|
export default CommonButton;
|
|
5
5
|
export * from './src/types';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
slots: {
|
|
3
|
+
default?(_: {}): any;
|
|
4
|
+
};
|
|
5
|
+
refs: {};
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
10
|
+
debounce: {
|
|
11
|
+
type: NumberConstructor;
|
|
12
|
+
default: number;
|
|
13
|
+
};
|
|
14
|
+
label: {
|
|
15
|
+
type: FunctionConstructor;
|
|
16
|
+
default: () => string;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
click: (...args: any[]) => void;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
|
+
debounce: {
|
|
22
|
+
type: NumberConstructor;
|
|
23
|
+
default: number;
|
|
24
|
+
};
|
|
25
|
+
label: {
|
|
26
|
+
type: FunctionConstructor;
|
|
27
|
+
default: () => string;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{
|
|
30
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
debounce: number;
|
|
33
|
+
label: Function;
|
|
34
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ButtonProps } from 'element-plus';
|
|
2
|
-
import { VNode } from 'vue';
|
|
3
|
-
|
|
2
|
+
import { ExtractPropTypes, VNode } from 'vue';
|
|
3
|
+
interface Props {
|
|
4
4
|
debounce?: number;
|
|
5
5
|
label?: () => VNode;
|
|
6
6
|
}
|
|
7
|
+
export type CommonButtonProps = ExtractPropTypes<Props & ButtonProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './options';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tutor-pro-ui-vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.32-beta",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"dev": "
|
|
17
|
+
"dev": "vitepress dev docs",
|
|
18
18
|
"build": "vue-tsc -b && vite build",
|
|
19
19
|
"preview": "vite preview",
|
|
20
20
|
"eslint": "npx eslint src/**",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
-
debounce: {
|
|
3
|
-
type: NumberConstructor;
|
|
4
|
-
default: number;
|
|
5
|
-
};
|
|
6
|
-
label: {
|
|
7
|
-
type: FunctionConstructor;
|
|
8
|
-
default: () => string;
|
|
9
|
-
};
|
|
10
|
-
}>, {
|
|
11
|
-
debounceClick: import('@vueuse/core').PromisifyFn<() => void>;
|
|
12
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], "click", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
-
debounce: {
|
|
14
|
-
type: NumberConstructor;
|
|
15
|
-
default: number;
|
|
16
|
-
};
|
|
17
|
-
label: {
|
|
18
|
-
type: FunctionConstructor;
|
|
19
|
-
default: () => string;
|
|
20
|
-
};
|
|
21
|
-
}>> & Readonly<{
|
|
22
|
-
onClick?: ((...args: any[]) => any) | undefined;
|
|
23
|
-
}>, {
|
|
24
|
-
debounce: number;
|
|
25
|
-
label: Function;
|
|
26
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
27
|
-
export default _default;
|