mortise-tenon-design 0.0.12 → 0.0.13
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/components/button/index.mjs +4 -6
- package/es/components/button/index.mjs.map +1 -1
- package/es/components/button/src/button.css +1 -1
- package/es/components/button/src/button.vue.mjs +2 -2
- package/es/components/button/src/button.vue2.mjs +2 -3
- package/es/components/button/src/button.vue2.mjs.map +1 -1
- package/lib/components/button/index.js +1 -2
- package/lib/components/button/index.js.map +1 -1
- package/lib/components/button/src/button.css +1 -1
- package/lib/components/button/src/button.vue.js +1 -1
- package/lib/components/button/src/button.vue2.js +1 -1
- package/lib/components/button/src/button.vue2.js.map +1 -1
- package/package.json +7 -2
- package/es/components/button/src/buttons.css +0 -1
- package/lib/components/button/src/buttons.css +0 -1
@@ -1,12 +1,10 @@
|
|
1
1
|
import t from "./src/button.vue.mjs";
|
2
|
-
|
3
|
-
t.
|
4
|
-
t.name && o.component(t.name, t);
|
2
|
+
t.install = (n) => {
|
3
|
+
t.name && n.component(t.name, t);
|
5
4
|
};
|
6
|
-
const
|
5
|
+
const m = t;
|
7
6
|
export {
|
8
|
-
|
7
|
+
m as MtButton
|
9
8
|
};
|
10
9
|
//# sourceMappingURL=index.mjs.map
|
11
|
-
import './src/buttons.css';
|
12
10
|
import './src/button.css';
|
@@ -1 +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\
|
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\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":";AAGAA,EAAO,UAAU,CAACC,MAAmB;AACnC,EAAID,EAAO,QACLC,EAAA,UAAUD,EAAO,MAAMA,CAAM;AAErC;AAEO,MAAME,IAAWF;"}
|
@@ -1 +1 @@
|
|
1
|
-
.mt-button[data-v-
|
1
|
+
@charset "UTF-8";.ex-button[data-v-c52e631f]{display:flex;animation:temp-animation-c52e631f step-end forwards}.ex-button[data-v-c52e631f]:active{animation:none}@keyframes temp-animation-c52e631f{}.mt-button[data-v-c52e631f]{display:flex;padding:4px 8px;cursor:pointer;background-color:#fff;border:#2d2d2d solid 1px;border-radius:5px}
|
@@ -1,8 +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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c52e631f"]]);
|
5
5
|
export {
|
6
|
-
|
6
|
+
p as default
|
7
7
|
};
|
8
8
|
//# sourceMappingURL=button.vue.mjs.map
|
@@ -1,6 +1,5 @@
|
|
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
|
-
/*
|
3
|
-
const y = ["disabled"], S = /* @__PURE__ */ c({
|
2
|
+
const y = ["disabled"], M = /* @__PURE__ */ c({
|
4
3
|
name: "MtButton",
|
5
4
|
__name: "button",
|
6
5
|
props: {
|
@@ -33,6 +32,6 @@ const y = ["disabled"], S = /* @__PURE__ */ c({
|
|
33
32
|
}
|
34
33
|
});
|
35
34
|
export {
|
36
|
-
|
35
|
+
M as default
|
37
36
|
};
|
38
37
|
//# sourceMappingURL=button.vue2.mjs.map
|
@@ -1 +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';\
|
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';\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 lang=\"scss\">\n@import url('./style/index.scss');\n\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":";;;;;;;;;;;AAMA,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;;;;;;;;;;;;;"}
|
@@ -1,4 +1,3 @@
|
|
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");t.default.install=e=>{t.default.name&&e.component(t.default.name,t.default)};const n=t.default;exports.MtButton=n;
|
2
2
|
//# sourceMappingURL=index.js.map
|
3
|
-
require('./src/buttons.css');
|
4
3
|
require('./src/button.css');
|
@@ -1 +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\
|
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\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":"uHAGAA,EAAAA,QAAO,QAAWC,GAAmB,CAC/BD,EAAAA,QAAO,MACLC,EAAA,UAAUD,EAAAA,QAAO,KAAMA,EAAM,OAAA,CAErC,EAEO,MAAME,EAAWF,EAAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
.mt-button[data-v-
|
1
|
+
@charset "UTF-8";.ex-button[data-v-c52e631f]{display:flex;animation:temp-animation-c52e631f step-end forwards}.ex-button[data-v-c52e631f]:active{animation:none}@keyframes temp-animation-c52e631f{}.mt-button[data-v-c52e631f]{display:flex;padding:4px 8px;cursor:pointer;background-color:#fff;border:#2d2d2d solid 1px;border-radius:5px}
|
@@ -1,2 +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-c52e631f"]]);exports.default=u;
|
2
2
|
//# sourceMappingURL=button.vue.js.map
|
@@ -1,2 +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"),c=["disabled"],f=e.defineComponent({name:"MtButton",__name:"button",props:{mode:{},time:{default:"1s"},disabled:{type:Boolean}},emits:["click"],setup(i,{emit:s}){const n=i,r=s,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||(r("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
2
|
//# sourceMappingURL=button.vue2.js.map
|
@@ -1 +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';\
|
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';\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 lang=\"scss\">\n@import url('./style/index.scss');\n\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":"qSAMA,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"}
|
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.13",
|
5
5
|
"description": "榫卯组件库",
|
6
6
|
"author": "nixwai",
|
7
7
|
"license": "ISC",
|
@@ -12,8 +12,13 @@
|
|
12
12
|
"main": "lib/index.js",
|
13
13
|
"module": "es/index.mjs",
|
14
14
|
"types": "es/components/index.d.ts",
|
15
|
+
"files": [
|
16
|
+
"es",
|
17
|
+
"lib"
|
18
|
+
],
|
15
19
|
"scripts": {
|
16
|
-
"build": "vite build"
|
20
|
+
"build": "vite build",
|
21
|
+
"release": "release-it"
|
17
22
|
},
|
18
23
|
"peerDependencies": {
|
19
24
|
"vue": "^3.4.0"
|
@@ -1 +0,0 @@
|
|
1
|
-
@charset "UTF-8";.ex-button{display:flex;animation:temp-animation step-end forwards}.ex-button:active{animation:none}@keyframes temp-animation{}
|
@@ -1 +0,0 @@
|
|
1
|
-
@charset "UTF-8";.ex-button{display:flex;animation:temp-animation step-end forwards}.ex-button:active{animation:none}@keyframes temp-animation{}
|