mortise-tenon-design 0.0.1
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/README.md +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/button/index.mjs +9 -0
- package/es/components/button/src/button.vue.mjs +7 -0
- package/es/components/button/src/button.vue2.mjs +38 -0
- package/es/index.mjs +4 -0
- package/es/style.css +1 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +1 -0
- package/lib/components/button/index.js +1 -0
- package/lib/components/button/src/button.vue.js +1 -0
- package/lib/components/button/src/button.vue2.js +1 -0
- package/lib/index.js +1 -0
- package/lib/style.css +1 -0
- package/package.json +13 -0
- package/type/components/button/index.d.ts +81 -0
- package/type/components/button/src/button.vue.d.ts +40 -0
- package/type/components/button/src/types.d.ts +8 -0
- package/type/components/index.d.ts +1 -0
- package/type/core/index.d.ts +1 -0
- package/type/core/paths/paths.d.ts +0 -0
- package/type/core/vite.config.d.ts +2 -0
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
榫卯组件库
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { defineComponent as c, ref as i, computed as m, onMounted as f, openBlock as b, createElementBlock as p, normalizeClass as v, unref as k, normalizeStyle as _, renderSlot as h } from "vue";
|
2
|
+
const y = ["disabled"], S = /* @__PURE__ */ c({
|
3
|
+
name: "XButton",
|
4
|
+
__name: "button",
|
5
|
+
props: {
|
6
|
+
mode: {},
|
7
|
+
time: { default: "1s" },
|
8
|
+
disabled: { type: Boolean }
|
9
|
+
},
|
10
|
+
emits: ["click"],
|
11
|
+
setup(s, { emit: u }) {
|
12
|
+
const e = s, r = u, t = i(!1), l = m(() => e.disabled ? !0 : e.mode === "throttle" && t.value), o = e.mode && ["throttle", "debounce"].includes(e.mode), a = i();
|
13
|
+
f(() => {
|
14
|
+
o && a.value.$el.addEventListener("animationend", () => {
|
15
|
+
t.value = !1;
|
16
|
+
});
|
17
|
+
});
|
18
|
+
function d(n) {
|
19
|
+
t.value || (r("click", n), o && (t.value = !0));
|
20
|
+
}
|
21
|
+
return (n, B) => (b(), p("button", {
|
22
|
+
ref_key: "buttonRef",
|
23
|
+
ref: a,
|
24
|
+
disabled: l.value,
|
25
|
+
class: v({ "ex-button": k(o) }),
|
26
|
+
style: _({
|
27
|
+
"animation-duration": n.time,
|
28
|
+
"pointer-events": l.value ? "none" : "all"
|
29
|
+
}),
|
30
|
+
onClick: d
|
31
|
+
}, [
|
32
|
+
h(n.$slots, "default", {}, void 0, !0)
|
33
|
+
], 14, y));
|
34
|
+
}
|
35
|
+
});
|
36
|
+
export {
|
37
|
+
S as default
|
38
|
+
};
|
package/es/index.mjs
ADDED
package/es/style.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.ex-button[data-v-66674a10]{animation:temp-animation-66674a10 step-end forwards}.ex-button[data-v-66674a10]:active{animation:none}@keyframes temp-animation-66674a10{}
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=(e,o)=>{const t=e.__vccOpts||e;for(const[r,s]of o)t[r]=s;return t};exports.default=u;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./src/button.vue.js");e.default.install=u=>{e.default.name&&u.component(e.default.name,e.default)};const t=e.default;exports.XButton=t;exports.default=t;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./button.vue2.js");;/* empty css */const t=require("../../../_virtual/_plugin-vue_export-helper.js"),u=t.default(e.default,[["__scopeId","data-v-66674a10"]]);exports.default=u;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=["disabled"],f=e.defineComponent({name:"XButton",__name:"button",props:{mode:{},time:{default:"1s"},disabled:{type:Boolean}},emits:["click"],setup(i,{emit:s}){const t=i,r=s,n=e.ref(!1),u=e.computed(()=>t.disabled?!0:t.mode==="throttle"&&n.value),l=t.mode&&["throttle","debounce"].includes(t.mode),a=e.ref();e.onMounted(()=>{l&&a.value.$el.addEventListener("animationend",()=>{n.value=!1})});function d(o){n.value||(r("click",o),l&&(n.value=!0))}return(o,m)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonRef",ref:a,disabled:u.value,class:e.normalizeClass({"ex-button":e.unref(l)}),style:e.normalizeStyle({"animation-duration":o.time,"pointer-events":u.value?"none":"all"}),onClick:d},[e.renderSlot(o.$slots,"default",{},void 0,!0)],14,c))}});exports.default=f;
|
package/lib/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./components/button/index.js");exports.XButton=t.XButton;
|
package/lib/style.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.ex-button[data-v-66674a10]{animation:temp-animation-66674a10 step-end forwards}.ex-button[data-v-66674a10]:active{animation:none}@keyframes temp-animation-66674a10{}
|
package/package.json
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"name": "mortise-tenon-design",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "榫卯组件库",
|
5
|
+
"author": "nixwai",
|
6
|
+
"license": "ISC",
|
7
|
+
"main": "lib/index.js",
|
8
|
+
"module": "es/index.mjs",
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "https://github.com/nixwai/mortise-tenon-design"
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
export declare const XButton: {
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
3
|
+
mode: {
|
4
|
+
type: import('vue').PropType<"debounce" | "throttle">;
|
5
|
+
};
|
6
|
+
time: {
|
7
|
+
type: import('vue').PropType<string>;
|
8
|
+
default: string;
|
9
|
+
};
|
10
|
+
disabled: {
|
11
|
+
type: import('vue').PropType<boolean>;
|
12
|
+
};
|
13
|
+
}>> & {
|
14
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
15
|
+
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
16
|
+
click: (...args: any[]) => void;
|
17
|
+
}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
18
|
+
mode: {
|
19
|
+
type: import('vue').PropType<"debounce" | "throttle">;
|
20
|
+
};
|
21
|
+
time: {
|
22
|
+
type: import('vue').PropType<string>;
|
23
|
+
default: string;
|
24
|
+
};
|
25
|
+
disabled: {
|
26
|
+
type: import('vue').PropType<boolean>;
|
27
|
+
};
|
28
|
+
}>> & {
|
29
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
30
|
+
}, {
|
31
|
+
time: string;
|
32
|
+
}, true, {}, {}, {
|
33
|
+
P: {};
|
34
|
+
B: {};
|
35
|
+
D: {};
|
36
|
+
C: {};
|
37
|
+
M: {};
|
38
|
+
Defaults: {};
|
39
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
40
|
+
mode: {
|
41
|
+
type: import('vue').PropType<"debounce" | "throttle">;
|
42
|
+
};
|
43
|
+
time: {
|
44
|
+
type: import('vue').PropType<string>;
|
45
|
+
default: string;
|
46
|
+
};
|
47
|
+
disabled: {
|
48
|
+
type: import('vue').PropType<boolean>;
|
49
|
+
};
|
50
|
+
}>> & {
|
51
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
52
|
+
}, {}, {}, {}, {}, {
|
53
|
+
time: string;
|
54
|
+
}>;
|
55
|
+
__isFragment?: never;
|
56
|
+
__isTeleport?: never;
|
57
|
+
__isSuspense?: never;
|
58
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
59
|
+
mode: {
|
60
|
+
type: import('vue').PropType<"debounce" | "throttle">;
|
61
|
+
};
|
62
|
+
time: {
|
63
|
+
type: import('vue').PropType<string>;
|
64
|
+
default: string;
|
65
|
+
};
|
66
|
+
disabled: {
|
67
|
+
type: import('vue').PropType<boolean>;
|
68
|
+
};
|
69
|
+
}>> & {
|
70
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
71
|
+
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
72
|
+
click: (...args: any[]) => void;
|
73
|
+
}, string, {
|
74
|
+
time: string;
|
75
|
+
}, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
76
|
+
$slots: {
|
77
|
+
default?(_: {}): any;
|
78
|
+
};
|
79
|
+
});
|
80
|
+
export * from './src/types';
|
81
|
+
export default XButton;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { ButtonProps } from './types';
|
2
|
+
declare function __VLS_template(): {
|
3
|
+
default?(_: {}): any;
|
4
|
+
};
|
5
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ButtonProps>, {
|
6
|
+
time: string;
|
7
|
+
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
8
|
+
click: (...args: any[]) => void;
|
9
|
+
}, string, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ButtonProps>, {
|
10
|
+
time: string;
|
11
|
+
}>>> & {
|
12
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
13
|
+
}, {
|
14
|
+
time: string;
|
15
|
+
}, {}>;
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
17
|
+
export default _default;
|
18
|
+
|
19
|
+
type __VLS_WithDefaults<P, D> = {
|
20
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
21
|
+
default: D[K];
|
22
|
+
}> : P[K];
|
23
|
+
};
|
24
|
+
type __VLS_Prettify<T> = {
|
25
|
+
[K in keyof T]: T[K];
|
26
|
+
} & {};
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
28
|
+
new (): {
|
29
|
+
$slots: S;
|
30
|
+
};
|
31
|
+
};
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
33
|
+
type __VLS_TypePropsToOption<T> = {
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
36
|
+
} : {
|
37
|
+
type: import('vue').PropType<T[K]>;
|
38
|
+
required: true;
|
39
|
+
};
|
40
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './button';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from '@mortise-tenon-design/components';
|
File without changes
|