mortise-tenon-design 0.0.10 → 0.0.12
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/es/_virtual/_plugin-vue_export-helper.mjs +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs.map +1 -0
- package/es/components/button/index.d.ts +1 -3
- package/es/components/button/index.mjs +8 -4
- package/es/components/button/index.mjs.map +1 -0
- package/es/components/button/src/button.css +1 -0
- package/es/components/button/src/button.vue.mjs +3 -2
- package/es/components/button/src/button.vue.mjs.map +1 -0
- package/es/components/button/src/button.vue2.mjs +15 -12
- package/es/components/button/src/button.vue2.mjs.map +1 -0
- package/es/components/button/src/buttons.css +1 -0
- package/es/index.mjs +1 -0
- package/es/index.mjs.map +1 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +1 -0
- package/lib/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/lib/components/button/index.d.ts +1 -3
- package/lib/components/button/index.js +4 -1
- package/lib/components/button/index.js.map +1 -0
- package/lib/components/button/src/button.css +1 -0
- package/lib/components/button/src/button.vue.js +2 -1
- package/lib/components/button/src/button.vue.js.map +1 -0
- package/lib/components/button/src/button.vue2.js +2 -1
- package/lib/components/button/src/button.vue2.js.map +1 -0
- package/lib/components/button/src/buttons.css +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -0
- package/package.json +5 -2
- package/es/core/index.d.ts +0 -1
- package/es/style.css +0 -1
- package/lib/core/index.d.ts +0 -1
- package/lib/style.css +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"_plugin-vue_export-helper.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
@@ -3,9 +3,7 @@ export declare const MtButton: {
|
|
3
3
|
onClick?: ((...args: any[]) => any) | undefined;
|
4
4
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
5
5
|
click: (...args: any[]) => void;
|
6
|
-
}, import('vue').
|
7
|
-
onClick?: ((...args: any[]) => any) | undefined;
|
8
|
-
}>, {
|
6
|
+
}, import('vue').PublicProps, {
|
9
7
|
time: string;
|
10
8
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
11
9
|
P: {};
|
@@ -1,8 +1,12 @@
|
|
1
1
|
import t from "./src/button.vue.mjs";
|
2
|
-
|
3
|
-
|
2
|
+
/* empty css */
|
3
|
+
t.install = (o) => {
|
4
|
+
t.name && o.component(t.name, t);
|
4
5
|
};
|
5
|
-
const
|
6
|
+
const e = t;
|
6
7
|
export {
|
7
|
-
|
8
|
+
e as MtButton
|
8
9
|
};
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
11
|
+
import './src/buttons.css';
|
12
|
+
import './src/button.css';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/button/index.ts"],"sourcesContent":["import type { App } from 'vue';\nimport Button from './src/button.vue';\n\nimport './src/buttons.scss';\n\nButton.install = (app: App): void => {\n if (Button.name) {\n app.component(Button.name, Button);\n }\n};\n\nexport const MtButton = Button;\n\nexport * from './src/types';\n"],"names":["Button","app","MtButton"],"mappings":";;AAKAA,EAAO,UAAU,CAACC,MAAmB;AACnC,EAAID,EAAO,QACLC,EAAA,UAAUD,EAAO,MAAMA,CAAM;AAErC;AAEO,MAAME,IAAWF;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.mt-button[data-v-4be6bc18]{display:flex;padding:4px 8px;cursor:pointer;background-color:#fff;border:#2d2d2d solid 1px;border-radius:5px}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import o from "./button.vue2.mjs";
|
2
2
|
/* empty css */
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
4
|
-
const
|
4
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4be6bc18"]]);
|
5
5
|
export {
|
6
|
-
|
6
|
+
_ as default
|
7
7
|
};
|
8
|
+
//# sourceMappingURL=button.vue.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"button.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
@@ -1,5 +1,6 @@
|
|
1
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
|
-
|
2
|
+
/* empty css */
|
3
|
+
const y = ["disabled"], S = /* @__PURE__ */ c({
|
3
4
|
name: "MtButton",
|
4
5
|
__name: "button",
|
5
6
|
props: {
|
@@ -9,27 +10,29 @@ const y = ["disabled"], M = /* @__PURE__ */ c({
|
|
9
10
|
},
|
10
11
|
emits: ["click"],
|
11
12
|
setup(s, { emit: u }) {
|
12
|
-
const
|
13
|
+
const t = s, r = u, n = i(!1), l = m(() => t.disabled ? !0 : t.mode === "throttle" && n.value), o = t.mode && ["throttle", "debounce"].includes(t.mode), a = i();
|
13
14
|
f(() => {
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
var e;
|
16
|
+
o && ((e = a.value) == null || e.addEventListener("animationend", () => {
|
17
|
+
n.value = !1;
|
18
|
+
}));
|
17
19
|
});
|
18
|
-
function d(
|
19
|
-
|
20
|
+
function d(e) {
|
21
|
+
n.value || (r("click", e), o && (n.value = !0));
|
20
22
|
}
|
21
|
-
return (
|
23
|
+
return (e, B) => (b(), p("button", {
|
22
24
|
ref_key: "buttonRef",
|
23
25
|
ref: a,
|
24
26
|
disabled: l.value,
|
25
|
-
class: v({ "ex-button": k(o) }),
|
26
|
-
style: _({ "animation-duration":
|
27
|
+
class: v(["mt-button", { "ex-button": k(o) }]),
|
28
|
+
style: _({ "animation-duration": e.time, "pointer-events": l.value ? "none" : "all" }),
|
27
29
|
onClick: d
|
28
30
|
}, [
|
29
|
-
h(
|
31
|
+
h(e.$slots, "default", {}, void 0, !0)
|
30
32
|
], 14, y));
|
31
33
|
}
|
32
34
|
});
|
33
35
|
export {
|
34
|
-
|
36
|
+
S as default
|
35
37
|
};
|
38
|
+
//# sourceMappingURL=button.vue2.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"button.vue2.mjs","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ButtonProps } from './types';\nimport { computed, onMounted, ref } from 'vue';\nimport './buttons.scss';\n\ndefineOptions({ name: 'MtButton' });\n\nconst props = withDefaults(defineProps<ButtonProps>(), { time: '1s' });\nconst emit = defineEmits(['click']);\n\n/** 禁止点击状态 */\nconst forbidStatus = ref(false);\nconst buttonDisabled = computed(() => {\n if (props.disabled) {\n return true;\n }\n return props.mode === 'throttle' && forbidStatus.value;\n});\n\nconst hasMode = props.mode && ['throttle', 'debounce'].includes(props.mode);\nconst buttonRef = ref<Element>();\n\nonMounted(() => {\n if (hasMode) {\n // 监听动画执行结束\n buttonRef.value?.addEventListener('animationend', () => {\n forbidStatus.value = false;\n });\n }\n});\n\nfunction handleClick(e: MouseEvent) {\n if (forbidStatus.value) {\n return;\n }\n emit('click', e);\n if (hasMode) {\n forbidStatus.value = true;\n }\n}\n</script>\n\n<template>\n <button\n ref=\"buttonRef\"\n :disabled=\"buttonDisabled\"\n class=\"mt-button\"\n :class=\"{ 'ex-button': hasMode }\"\n :style=\"{ 'animation-duration': time, 'pointer-events': buttonDisabled ? 'none' : 'all' }\"\n @click=\"handleClick\"\n >\n <slot />\n </button>\n</template>\n\n<style scoped>\n.mt-button {\n display: flex;\n padding: 4px 8px;\n cursor: pointer;\n background-color: #fff;\n border: #2d2d2d solid 1px;\n border-radius: 5px;\n}\n</style>\n"],"names":["props","__props","emit","__emit","forbidStatus","ref","buttonDisabled","computed","hasMode","buttonRef","onMounted","_a","handleClick"],"mappings":";;;;;;;;;;;;AAOA,UAAMA,IAAQC,GACRC,IAAOC,GAGPC,IAAeC,EAAI,EAAK,GACxBC,IAAiBC,EAAS,MAC1BP,EAAM,WACD,KAEFA,EAAM,SAAS,cAAcI,EAAa,KAClD,GAEKI,IAAUR,EAAM,QAAQ,CAAC,YAAY,UAAU,EAAE,SAASA,EAAM,IAAI,GACpES,IAAYJ;AAElB,IAAAK,EAAU,MAAM;;AACd,MAAIF,OAEQG,IAAAF,EAAA,UAAA,QAAAE,EAAO,iBAAiB,gBAAgB,MAAM;AACtD,QAAAP,EAAa,QAAQ;AAAA,MAAA;AAAA,IAEzB,CACD;AAED,aAASQ,EAAY,GAAe;AAClC,MAAIR,EAAa,UAGjBF,EAAK,SAAS,CAAC,GACXM,MACFJ,EAAa,QAAQ;AAAA,IAEzB;;;;;;;;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
@charset "UTF-8";.ex-button{display:flex;animation:temp-animation step-end forwards}.ex-button:active{animation:none}@keyframes temp-animation{}
|
package/es/index.mjs
CHANGED
package/es/index.mjs.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"_plugin-vue_export-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -3,9 +3,7 @@ export declare const MtButton: {
|
|
3
3
|
onClick?: ((...args: any[]) => any) | undefined;
|
4
4
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
5
5
|
click: (...args: any[]) => void;
|
6
|
-
}, import('vue').
|
7
|
-
onClick?: ((...args: any[]) => any) | undefined;
|
8
|
-
}>, {
|
6
|
+
}, import('vue').PublicProps, {
|
9
7
|
time: string;
|
10
8
|
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
11
9
|
P: {};
|
@@ -1 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./src/button.vue.js")
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./src/button.vue.js");;/* empty css */t.default.install=e=>{t.default.name&&e.component(t.default.name,t.default)};const u=t.default;exports.MtButton=u;
|
2
|
+
//# sourceMappingURL=index.js.map
|
3
|
+
require('./src/buttons.css');
|
4
|
+
require('./src/button.css');
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/button/index.ts"],"sourcesContent":["import type { App } from 'vue';\nimport Button from './src/button.vue';\n\nimport './src/buttons.scss';\n\nButton.install = (app: App): void => {\n if (Button.name) {\n app.component(Button.name, Button);\n }\n};\n\nexport const MtButton = Button;\n\nexport * from './src/types';\n"],"names":["Button","app","MtButton"],"mappings":"wJAKAA,EAAAA,QAAO,QAAWC,GAAmB,CAC/BD,EAAAA,QAAO,MACLC,EAAA,UAAUD,EAAAA,QAAO,KAAMA,EAAM,OAAA,CAErC,EAEO,MAAME,EAAWF,EAAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.mt-button[data-v-4be6bc18]{display:flex;padding:4px 8px;cursor:pointer;background-color:#fff;border:#2d2d2d solid 1px;border-radius:5px}
|
@@ -1 +1,2 @@
|
|
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-
|
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-4be6bc18"]]);exports.default=u;
|
2
|
+
//# sourceMappingURL=button.vue.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"button.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -1 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue")
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */const c=["disabled"],f=e.defineComponent({name:"MtButton",__name:"button",props:{mode:{},time:{default:"1s"},disabled:{type:Boolean}},emits:["click"],setup(i,{emit:r}){const n=i,s=r,o=e.ref(!1),u=e.computed(()=>n.disabled?!0:n.mode==="throttle"&&o.value),l=n.mode&&["throttle","debounce"].includes(n.mode),a=e.ref();e.onMounted(()=>{var t;l&&((t=a.value)==null||t.addEventListener("animationend",()=>{o.value=!1}))});function d(t){o.value||(s("click",t),l&&(o.value=!0))}return(t,m)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonRef",ref:a,disabled:u.value,class:e.normalizeClass(["mt-button",{"ex-button":e.unref(l)}]),style:e.normalizeStyle({"animation-duration":t.time,"pointer-events":u.value?"none":"all"}),onClick:d},[e.renderSlot(t.$slots,"default",{},void 0,!0)],14,c))}});exports.default=f;
|
2
|
+
//# sourceMappingURL=button.vue2.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"button.vue2.js","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ButtonProps } from './types';\nimport { computed, onMounted, ref } from 'vue';\nimport './buttons.scss';\n\ndefineOptions({ name: 'MtButton' });\n\nconst props = withDefaults(defineProps<ButtonProps>(), { time: '1s' });\nconst emit = defineEmits(['click']);\n\n/** 禁止点击状态 */\nconst forbidStatus = ref(false);\nconst buttonDisabled = computed(() => {\n if (props.disabled) {\n return true;\n }\n return props.mode === 'throttle' && forbidStatus.value;\n});\n\nconst hasMode = props.mode && ['throttle', 'debounce'].includes(props.mode);\nconst buttonRef = ref<Element>();\n\nonMounted(() => {\n if (hasMode) {\n // 监听动画执行结束\n buttonRef.value?.addEventListener('animationend', () => {\n forbidStatus.value = false;\n });\n }\n});\n\nfunction handleClick(e: MouseEvent) {\n if (forbidStatus.value) {\n return;\n }\n emit('click', e);\n if (hasMode) {\n forbidStatus.value = true;\n }\n}\n</script>\n\n<template>\n <button\n ref=\"buttonRef\"\n :disabled=\"buttonDisabled\"\n class=\"mt-button\"\n :class=\"{ 'ex-button': hasMode }\"\n :style=\"{ 'animation-duration': time, 'pointer-events': buttonDisabled ? 'none' : 'all' }\"\n @click=\"handleClick\"\n >\n <slot />\n </button>\n</template>\n\n<style scoped>\n.mt-button {\n display: flex;\n padding: 4px 8px;\n cursor: pointer;\n background-color: #fff;\n border: #2d2d2d solid 1px;\n border-radius: 5px;\n}\n</style>\n"],"names":["props","__props","emit","__emit","forbidStatus","ref","buttonDisabled","computed","hasMode","buttonRef","onMounted","_a","handleClick","e"],"mappings":"wUAOA,MAAMA,EAAQC,EACRC,EAAOC,EAGPC,EAAeC,MAAI,EAAK,EACxBC,EAAiBC,EAAAA,SAAS,IAC1BP,EAAM,SACD,GAEFA,EAAM,OAAS,YAAcI,EAAa,KAClD,EAEKI,EAAUR,EAAM,MAAQ,CAAC,WAAY,UAAU,EAAE,SAASA,EAAM,IAAI,EACpES,EAAYJ,EAAAA,MAElBK,EAAAA,UAAU,IAAM,OACVF,KAEQG,EAAAF,EAAA,QAAA,MAAAE,EAAO,iBAAiB,eAAgB,IAAM,CACtDP,EAAa,MAAQ,EAAA,GAEzB,CACD,EAED,SAASQ,EAAYC,EAAe,CAC9BT,EAAa,QAGjBF,EAAK,QAASW,CAAC,EACXL,IACFJ,EAAa,MAAQ,IAEzB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
@charset "UTF-8";.ex-button{display:flex;animation:temp-animation step-end forwards}.ex-button:active{animation:none}@keyframes temp-animation{}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "mortise-tenon-design",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.12",
|
5
5
|
"description": "榫卯组件库",
|
6
6
|
"author": "nixwai",
|
7
7
|
"license": "ISC",
|
@@ -11,7 +11,10 @@
|
|
11
11
|
},
|
12
12
|
"main": "lib/index.js",
|
13
13
|
"module": "es/index.mjs",
|
14
|
-
"types": "es/
|
14
|
+
"types": "es/components/index.d.ts",
|
15
|
+
"scripts": {
|
16
|
+
"build": "vite build"
|
17
|
+
},
|
15
18
|
"peerDependencies": {
|
16
19
|
"vue": "^3.4.0"
|
17
20
|
}
|
package/es/core/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from '../components';
|
package/es/style.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
.ex-button[data-v-aa934c60]{animation:temp-animation-aa934c60 step-end forwards}.ex-button[data-v-aa934c60]:active{animation:none}@keyframes temp-animation-aa934c60{}
|
package/lib/core/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from '../components';
|
package/lib/style.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
.ex-button[data-v-aa934c60]{animation:temp-animation-aa934c60 step-end forwards}.ex-button[data-v-aa934c60]:active{animation:none}@keyframes temp-animation-aa934c60{}
|