@mlightcad/ui-components 0.0.3 → 0.0.4
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/style.css +1 -1
- package/dist/ui-components.es.js +6 -5
- package/dist/ui-components.umd.js +1 -1
- package/lib/MlToolbar.vue.js +2 -2
- package/package.json +2 -3
- package/src/MlToolbar.vue +3 -2
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ml-vertical-toolbar-button-group[data-v-
|
|
1
|
+
.ml-vertical-toolbar-button-group[data-v-04772114]{display:flex;flex-direction:column;align-items:flex-start}.ml-horizontal-toolbar-button-group[data-v-04772114]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-04772114]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-04772114]{margin-left:0;margin-top:5px}
|
package/dist/ui-components.es.js
CHANGED
|
@@ -31,17 +31,18 @@ const G = {
|
|
|
31
31
|
s("click", o);
|
|
32
32
|
};
|
|
33
33
|
return (o, O) => {
|
|
34
|
-
const v = y,
|
|
34
|
+
const v = y, h = g, z = C, k = T;
|
|
35
35
|
return l(), i(k, {
|
|
36
36
|
class: E(a.value)
|
|
37
37
|
}, {
|
|
38
38
|
default: u(() => [
|
|
39
|
-
(l(!0), m(M, null, S(o.items, (n, x) => (l(), i(
|
|
39
|
+
(l(!0), m(M, null, S(o.items, (n, x) => (l(), i(z, {
|
|
40
40
|
key: n.text,
|
|
41
|
-
content: d(n)
|
|
41
|
+
content: d(n),
|
|
42
|
+
"hide-after": 0
|
|
42
43
|
}, {
|
|
43
44
|
default: u(() => [
|
|
44
|
-
(l(), i(
|
|
45
|
+
(l(), i(h, {
|
|
45
46
|
class: "ml-toolbar-button",
|
|
46
47
|
style: w({ width: p.value + "px", height: p.value + "px" }),
|
|
47
48
|
key: x,
|
|
@@ -71,7 +72,7 @@ const G = {
|
|
|
71
72
|
for (const [s, a] of c)
|
|
72
73
|
t[s] = a;
|
|
73
74
|
return t;
|
|
74
|
-
}, F = /* @__PURE__ */ D(H, [["__scopeId", "data-v-
|
|
75
|
+
}, F = /* @__PURE__ */ D(H, [["__scopeId", "data-v-04772114"]]), R = {
|
|
75
76
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
77
|
install(e) {
|
|
77
78
|
e.component("MlToolbar", F);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/button-group/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css"),require("element-plus/es/components/icon/style/css"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/button-group/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css","element-plus/es/components/icon/style/css","vue"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t.UIComponents={},t.es,null,null,null,null,null,t.Vue))})(this,function(t,o,T,g,C,M,q,e){"use strict";const m={key:0,class:"ml-toolbar-button-text"},p=((l,r)=>{const n=l.__vccOpts||l;for(const[u
|
|
1
|
+
(function(t,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("element-plus/es"),require("element-plus/es/components/base/style/css"),require("element-plus/es/components/button-group/style/css"),require("element-plus/es/components/tooltip/style/css"),require("element-plus/es/components/button/style/css"),require("element-plus/es/components/icon/style/css"),require("vue")):typeof define=="function"&&define.amd?define(["exports","element-plus/es","element-plus/es/components/base/style/css","element-plus/es/components/button-group/style/css","element-plus/es/components/tooltip/style/css","element-plus/es/components/button/style/css","element-plus/es/components/icon/style/css","vue"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t.UIComponents={},t.es,null,null,null,null,null,t.Vue))})(this,function(t,o,T,g,C,M,q,e){"use strict";const m={key:0,class:"ml-toolbar-button-text"},p=((l,r)=>{const n=l.__vccOpts||l;for(const[i,u]of r)n[i]=u;return n})(e.defineComponent({__name:"MlToolbar",props:{items:{},size:{default:"large"},layout:{default:"horizontal"}},emits:{click:null},setup(l,{emit:r}){const n=l,i=r,u=e.computed(()=>n.layout==="vertical"?"ml-vertical-toolbar-button-group":"ml-horizontal-toolbar-button-group"),_=e.computed(()=>n.size==="small"?20:30),a=e.computed(()=>{switch(n.size){case"small":return 30;case"medium":return 50}return 70}),b=s=>s.description?s.description:s.text,f=e.computed(()=>n.size==="large"),y=s=>{i("click",s)};return(s,w)=>{const k=o.ElIcon,h=o.ElButton,x=o.ElTooltip,B=o.ElButtonGroup;return e.openBlock(),e.createBlock(B,{class:e.normalizeClass(u.value)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.items,(c,z)=>(e.openBlock(),e.createBlock(x,{key:c.text,content:b(c),"hide-after":0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(h,{class:"ml-toolbar-button",style:e.normalizeStyle({width:a.value+"px",height:a.value+"px"}),key:z,onClick:$=>y(c.command)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(k,{size:_.value,innerHTML:c.icon},null,8,["size","innerHTML"]),f.value?(e.openBlock(),e.createElementBlock("div",m,e.toDisplayString(c.text),1)):e.createCommentVNode("",!0)])]),_:2},1032,["style","onClick"]))]),_:2},1032,["content"]))),128))]),_:1},8,["class"])}}}),[["__scopeId","data-v-04772114"]]),d={install(l){l.component("MlToolbar",p)}};t.MlToolbar=p,t.default=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/lib/MlToolbar.vue.js
CHANGED
|
@@ -62,8 +62,8 @@ for (const [item, index] of __VLS_getVForSourceType((__VLS_ctx.items))) {
|
|
|
62
62
|
const __VLS_6 = __VLS_resolvedLocalAndGlobalComponents.ElTooltip;
|
|
63
63
|
/** @type { [typeof __VLS_components.ElTooltip, typeof __VLS_components.elTooltip, typeof __VLS_components.ElTooltip, typeof __VLS_components.elTooltip, ] } */
|
|
64
64
|
// @ts-ignore
|
|
65
|
-
const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({ key: ((item.text)), content: ((__VLS_ctx.buttonTooltip(item))), }));
|
|
66
|
-
const __VLS_8 = __VLS_7({ key: ((item.text)), content: ((__VLS_ctx.buttonTooltip(item))), }, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
65
|
+
const __VLS_7 = __VLS_asFunctionalComponent(__VLS_6, new __VLS_6({ key: ((item.text)), content: ((__VLS_ctx.buttonTooltip(item))), hideAfter: ((0)), }));
|
|
66
|
+
const __VLS_8 = __VLS_7({ key: ((item.text)), content: ((__VLS_ctx.buttonTooltip(item))), hideAfter: ((0)), }, ...__VLS_functionalComponentArgsRest(__VLS_7));
|
|
67
67
|
const __VLS_12 = __VLS_resolvedLocalAndGlobalComponents.ElButton;
|
|
68
68
|
/** @type { [typeof __VLS_components.ElButton, typeof __VLS_components.elButton, typeof __VLS_components.ElButton, typeof __VLS_components.elButton, ] } */
|
|
69
69
|
// @ts-ignore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/ui-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "One common UI component library based on Element Plus",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MLight Lee <mlight.lee@outlook.com>",
|
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
"package.json"
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"rollup-plugin-peer-deps-external": "^2.2.4"
|
|
33
|
-
"vite-plugin-css-injected-by-js": "^3.5.1"
|
|
32
|
+
"rollup-plugin-peer-deps-external": "^2.2.4"
|
|
34
33
|
},
|
|
35
34
|
"peerDependencies": {
|
|
36
35
|
"element-plus": "^2.8.1",
|
package/src/MlToolbar.vue
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
v-for="(item, index) in items"
|
|
5
5
|
:key="item.text"
|
|
6
6
|
:content="buttonTooltip(item)"
|
|
7
|
+
:hide-after=0
|
|
7
8
|
>
|
|
8
9
|
<el-button
|
|
9
10
|
class="ml-toolbar-button"
|
|
@@ -126,11 +127,11 @@ const handleCommand = (command: string) => {
|
|
|
126
127
|
flex-direction: column;
|
|
127
128
|
align-items: center;
|
|
128
129
|
justify-content: center;
|
|
129
|
-
padding:
|
|
130
|
+
padding: 5px;
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
.ml-toolbar-button-text {
|
|
133
134
|
margin-left: 0px;
|
|
134
|
-
margin-top:
|
|
135
|
+
margin-top: 5px;
|
|
135
136
|
}
|
|
136
137
|
</style>
|