@mlightcad/ui-components 0.1.0 → 0.1.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.
@@ -1,81 +1,83 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-d6a59cf0]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;background-color:var(--el-fill-color);box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-d6a59cf0],.ml-status-bar-right[data-v-d6a59cf0]{display:flex;align-items:center}.ml-status-bar-left[data-v-d6a59cf0]>*{margin-right:10px}.ml-status-bar-right[data-v-d6a59cf0]>*{margin-left:10px}.ml-toggle-button[data-v-b676e93b]{border:none;padding:0;cursor:pointer;width:var(--0547f26d);height:var(--0547f26d)}.ml-vertical-toolbar-button-group[data-v-5261c686]{display:flex;flex-direction:column}.ml-horizontal-toolbar-button-group[data-v-5261c686]{display:flex;flex-direction:row}.ml-toolbar-button[data-v-5261c686]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-5261c686]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-8645db4f]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-tool-palette-dialog-icon[data-v-8645db4f]{border-bottom:1px solid var(--el-border-color);cursor:default}.ml-tool-palette-dialog-icon[data-v-8645db4f]:hover{color:var(--el-color-primary)}.ml-tool-palette-dialog-layout[data-v-8645db4f]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-8645db4f]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center;background-color:var(--el-fill-color)}.ml-tool-palette-title[data-v-8645db4f]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-8645db4f]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;justify-content:space-around;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-8645db4f]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-8645db4f],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-8645db4f]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-8645db4f]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { ElIcon as H, ElDropdownItem as ue, ElDropdownMenu as ae, ElDropdown as ce, ElButton as Q, ElTooltip as Z, ElButtonGroup as re } from "element-plus/es";
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ml-dropdown-icon[data-v-3fc33b5d],.ml-dropdown-icon[data-v-3fc33b5d]:hover{outline:none;border:none}.ml-status-bar[data-v-d6a59cf0]{position:fixed;bottom:0;left:0;right:0;height:30px;display:flex;justify-content:space-between;align-items:center;background-color:var(--el-fill-color);box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-status-bar-left[data-v-d6a59cf0],.ml-status-bar-right[data-v-d6a59cf0]{display:flex;align-items:center}.ml-status-bar-left[data-v-d6a59cf0]>*{margin-right:10px}.ml-status-bar-right[data-v-d6a59cf0]>*{margin-left:10px}.ml-toggle-button[data-v-b676e93b]{border:none;padding:0;cursor:pointer;width:var(--0547f26d);height:var(--0547f26d)}.ml-vertical-toolbar-button-group[data-v-c6504e33]{display:flex;flex-direction:column;background-color:var(--el-fill-color)}.ml-horizontal-toolbar-button-group[data-v-c6504e33]{display:flex;flex-direction:row;background-color:var(--el-fill-color)}.ml-toolbar-button[data-v-c6504e33]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px}.ml-toolbar-button-text[data-v-c6504e33]{margin-left:0;margin-top:5px}.ml-tool-palette-dialog[data-v-43098ce9]{cursor:default;width:300px;min-width:var(--collapsed-width);position:fixed;box-sizing:border-box;border:1px solid var(--el-border-color)}.ml-tool-palette-dialog-icon[data-v-43098ce9]{border-bottom:1px solid var(--el-border-color);cursor:default}.ml-tool-palette-dialog-icon[data-v-43098ce9]:hover{color:var(--el-color-primary)}.ml-tool-palette-dialog-layout[data-v-43098ce9]{display:flex;height:100%}.ml-tool-palette-title-bar[data-v-43098ce9]{width:var(--collapsed-width);display:flex;justify-content:left;align-items:center;cursor:move;writing-mode:vertical-rl;text-align:center;background-color:var(--el-fill-color)}.ml-tool-palette-title[data-v-43098ce9]{pointer-events:none;margin-top:10px;margin-bottom:10px;font-size:small;-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-tool-palette-content[data-v-43098ce9]{-webkit-user-select:none;user-select:none;flex-grow:1;display:flex;flex-direction:column;background-color:var(--el-fill-color);overflow:hidden}.ml-tool-palette-tabs[data-v-43098ce9]{display:flex;flex-direction:column;height:100%;flex:1}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs{display:flex;flex-direction:column;height:100%}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs__header{margin:0;border-bottom:none;order:1;flex-shrink:0;position:relative}.ml-tool-palette-tabs[data-v-43098ce9] .el-tabs__content{flex:1;overflow:auto;padding:0;order:2;min-height:0;position:relative}.ml-tool-palette-tabs[data-v-43098ce9] .el-tab-pane{height:100%;overflow:auto}.ml-tool-palette-default-content[data-v-43098ce9]{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-tool-palette-dialog-layout.left .ml-tool-palette-title-bar[data-v-43098ce9]{order:1}.ml-tool-palette-dialog-layout.left .ml-tool-palette-content[data-v-43098ce9],.ml-tool-palette-dialog-layout.right .ml-tool-palette-title-bar[data-v-43098ce9]{order:2}.ml-tool-palette-dialog-layout.right .ml-tool-palette-content[data-v-43098ce9]{order:1}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { ElIcon as U, ElDropdownItem as ae, ElDropdownMenu as ue, ElDropdown as ce, ElButton as P, ElTooltip as R, ElButtonGroup as re, ElTabPane as ve, ElTabs as de } from "element-plus/es";
3
3
  import "element-plus/es/components/base/style/css";
4
4
  import "element-plus/es/components/icon/style/css";
5
- import { openBlock as M, createElementBlock as I, createElementVNode as E, defineComponent as S, mergeModels as V, useModel as U, computed as p, createBlock as $, withCtx as B, resolveDynamicComponent as P, createVNode as D, Fragment as R, renderList as ee, createTextVNode as ve, toDisplayString as F, pushScopeId as te, popScopeId as ne, renderSlot as O, useCssVars as de, normalizeClass as le, normalizeStyle as X, createCommentVNode as oe, ref as m, onMounted as Y, onUnmounted as G, watch as L, onBeforeUnmount as se, unref as j } from "vue";
5
+ import { openBlock as b, createElementBlock as V, createElementVNode as B, defineComponent as Y, mergeModels as D, useModel as H, computed as p, createBlock as $, withCtx as C, resolveDynamicComponent as ee, createVNode as S, Fragment as G, renderList as j, createTextVNode as me, toDisplayString as O, pushScopeId as te, popScopeId as ne, renderSlot as X, useCssVars as he, normalizeClass as le, normalizeStyle as N, createCommentVNode as oe, ref as f, onMounted as W, onUnmounted as q, watch as y, onBeforeUnmount as se, unref as J } from "vue";
6
6
  import "element-plus/es/components/dropdown/style/css";
7
7
  import "element-plus/es/components/dropdown-menu/style/css";
8
8
  import "element-plus/es/components/dropdown-item/style/css";
9
9
  import "element-plus/es/components/tooltip/style/css";
10
10
  import "element-plus/es/components/button/style/css";
11
11
  import "element-plus/es/components/button-group/style/css";
12
- const me = {
12
+ import "element-plus/es/components/tabs/style/css";
13
+ import "element-plus/es/components/tab-pane/style/css";
14
+ const fe = {
13
15
  xmlns: "http://www.w3.org/2000/svg",
14
16
  width: "1em",
15
17
  height: "1em",
16
18
  viewBox: "0 0 1024 1024"
17
- }, he = /* @__PURE__ */ E("path", {
19
+ }, pe = /* @__PURE__ */ B("path", {
18
20
  fill: "currentColor",
19
21
  d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"
20
- }, null, -1), fe = [
21
- he
22
+ }, null, -1), _e = [
23
+ pe
22
24
  ];
23
- function pe(e, s) {
24
- return M(), I("svg", me, [...fe]);
25
+ function we(e, a) {
26
+ return b(), V("svg", fe, [..._e]);
25
27
  }
26
- const q = { render: pe }, _e = {
28
+ const K = { render: we }, ge = {
27
29
  xmlns: "http://www.w3.org/2000/svg",
28
30
  width: "1em",
29
31
  height: "1em",
30
32
  viewBox: "0 0 1024 1024"
31
- }, we = /* @__PURE__ */ E("path", {
33
+ }, be = /* @__PURE__ */ B("path", {
32
34
  fill: "currentColor",
33
35
  d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
34
- }, null, -1), ge = [
35
- we
36
+ }, null, -1), Le = [
37
+ be
36
38
  ];
37
- function Le(e, s) {
38
- return M(), I("svg", _e, [...ge]);
39
+ function xe(e, a) {
40
+ return b(), V("svg", ge, [...Le]);
39
41
  }
40
- const J = { render: Le }, xe = /* @__PURE__ */ S({
42
+ const Q = { render: xe }, ye = /* @__PURE__ */ Y({
41
43
  __name: "MlCollapse",
42
- props: /* @__PURE__ */ V({
44
+ props: /* @__PURE__ */ D({
43
45
  size: { default: 18 },
44
46
  reverse: { type: Boolean, default: !1 }
45
47
  }, {
46
48
  modelValue: { default: !0 },
47
49
  modelModifiers: {}
48
50
  }),
49
- emits: /* @__PURE__ */ V(["change"], ["update:modelValue"]),
50
- setup(e, { emit: s }) {
51
- const t = e, o = U(e, "modelValue"), l = s, n = p(() => t.reverse ? o.value ? q : J : o.value ? J : q), u = p(() => `${t.size}px`), d = () => {
51
+ emits: /* @__PURE__ */ D(["change"], ["update:modelValue"]),
52
+ setup(e, { emit: a }) {
53
+ const t = e, o = H(e, "modelValue"), l = a, n = p(() => t.reverse ? o.value ? K : Q : o.value ? Q : K), u = p(() => `${t.size}px`), m = () => {
52
54
  l("change", o.value), o.value = !o.value;
53
55
  };
54
- return (i, a) => {
55
- const r = H;
56
- return M(), $(r, {
56
+ return (s, c) => {
57
+ const v = U;
58
+ return b(), $(v, {
57
59
  size: u.value,
58
- onClick: d
60
+ onClick: m
59
61
  }, {
60
- default: B(() => [
61
- (M(), $(P(n.value)))
62
+ default: C(() => [
63
+ (b(), $(ee(n.value)))
62
64
  ]),
63
65
  _: 1
64
66
  }, 8, ["size"]);
65
67
  };
66
68
  }
67
- }), Me = (e) => (te("data-v-3fc33b5d"), e = e(), ne(), e), be = /* @__PURE__ */ Me(() => /* @__PURE__ */ E("svg", {
69
+ }), Me = (e) => (te("data-v-3fc33b5d"), e = e(), ne(), e), Ee = /* @__PURE__ */ Me(() => /* @__PURE__ */ B("svg", {
68
70
  preserveAspectRatio: "xMidYMid meet",
69
71
  viewBox: "0 0 24 24",
70
72
  width: "1.2em",
71
73
  height: "1.2em",
72
74
  "data-v-63d067da": ""
73
75
  }, [
74
- /* @__PURE__ */ E("path", {
76
+ /* @__PURE__ */ B("path", {
75
77
  fill: "currentColor",
76
78
  d: "m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"
77
79
  })
78
- ], -1)), ye = /* @__PURE__ */ S({
80
+ ], -1)), ze = /* @__PURE__ */ Y({
79
81
  __name: "MlDropdown",
80
82
  props: {
81
83
  icon: {},
@@ -85,22 +87,22 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
85
87
  emits: {
86
88
  click: null
87
89
  },
88
- setup(e, { emit: s }) {
89
- const t = e, o = s, l = p(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
90
+ setup(e, { emit: a }) {
91
+ const t = e, o = a, l = p(() => t.items.filter((u) => u.name !== t.current)), n = (u) => {
90
92
  o("click", u);
91
93
  };
92
- return (u, d) => {
93
- const i = H, a = ue, r = ae, _ = ce;
94
- return M(), $(_, { onCommand: n }, {
95
- dropdown: B(() => [
96
- D(r, null, {
97
- default: B(() => [
98
- (M(!0), I(R, null, ee(l.value, (c) => (M(), $(a, {
99
- key: c.text,
100
- command: c.name
94
+ return (u, m) => {
95
+ const s = U, c = ae, v = ue, _ = ce;
96
+ return b(), $(_, { onCommand: n }, {
97
+ dropdown: C(() => [
98
+ S(v, null, {
99
+ default: C(() => [
100
+ (b(!0), V(G, null, j(l.value, (r) => (b(), $(c, {
101
+ key: r.text,
102
+ command: r.name
101
103
  }, {
102
- default: B(() => [
103
- ve(F(c.text), 1)
104
+ default: C(() => [
105
+ me(O(r.text), 1)
104
106
  ]),
105
107
  _: 2
106
108
  }, 1032, ["command"]))), 128))
@@ -108,13 +110,13 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
108
110
  _: 1
109
111
  })
110
112
  ]),
111
- default: B(() => [
112
- D(i, {
113
+ default: C(() => [
114
+ S(s, {
113
115
  size: "30",
114
116
  class: "ml-dropdown-icon"
115
117
  }, {
116
- default: B(() => [
117
- be
118
+ default: C(() => [
119
+ Ee
118
120
  ]),
119
121
  _: 1
120
122
  })
@@ -123,12 +125,12 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
123
125
  });
124
126
  };
125
127
  }
126
- }), A = (e, s) => {
128
+ }), A = (e, a) => {
127
129
  const t = e.__vccOpts || e;
128
- for (const [o, l] of s)
130
+ for (const [o, l] of a)
129
131
  t[o] = l;
130
132
  return t;
131
- }, N = /* @__PURE__ */ A(ye, [["__scopeId", "data-v-3fc33b5d"]]), ze = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>', Ee = /* @__PURE__ */ S({
133
+ }, F = /* @__PURE__ */ A(ze, [["__scopeId", "data-v-3fc33b5d"]]), Te = '<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-63d067da=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>', Ce = /* @__PURE__ */ Y({
132
134
  __name: "MlLanguage",
133
135
  props: {
134
136
  languages: {},
@@ -137,66 +139,66 @@ const J = { render: Le }, xe = /* @__PURE__ */ S({
137
139
  emits: {
138
140
  click: null
139
141
  },
140
- setup(e, { emit: s }) {
141
- const t = e, o = s, l = (n) => {
142
+ setup(e, { emit: a }) {
143
+ const t = e, o = a, l = (n) => {
142
144
  o("click", n);
143
145
  };
144
- return (n, u) => (M(), $(N, {
145
- icon: ze,
146
+ return (n, u) => (b(), $(F, {
147
+ icon: Te,
146
148
  items: t.languages,
147
149
  current: t.current,
148
150
  onClick: l
149
151
  }, null, 8, ["items", "current"]));
150
152
  }
151
- }), Ce = {}, Be = { class: "ml-status-bar" }, ke = { class: "ml-status-bar-left" }, Te = { class: "ml-status-bar-right" };
152
- function $e(e, s) {
153
- return M(), I("div", Be, [
154
- E("div", ke, [
155
- O(e.$slots, "left", {}, void 0, !0)
153
+ }), Be = {}, ke = { class: "ml-status-bar" }, $e = { class: "ml-status-bar-left" }, Ie = { class: "ml-status-bar-right" };
154
+ function Ve(e, a) {
155
+ return b(), V("div", ke, [
156
+ B("div", $e, [
157
+ X(e.$slots, "left", {}, void 0, !0)
156
158
  ]),
157
- E("div", Te, [
158
- O(e.$slots, "right", {}, void 0, !0)
159
+ B("div", Ie, [
160
+ X(e.$slots, "right", {}, void 0, !0)
159
161
  ])
160
162
  ]);
161
163
  }
162
- const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0"]]), Ie = /* @__PURE__ */ S({
164
+ const We = /* @__PURE__ */ A(Be, [["render", Ve], ["__scopeId", "data-v-d6a59cf0"]]), De = /* @__PURE__ */ Y({
163
165
  __name: "MlToggleButton",
164
- props: /* @__PURE__ */ V({
166
+ props: /* @__PURE__ */ D({
165
167
  size: { default: 30 },
166
168
  data: {}
167
169
  }, {
168
170
  modelValue: { default: !1 },
169
171
  modelModifiers: {}
170
172
  }),
171
- emits: /* @__PURE__ */ V(["click"], ["update:modelValue"]),
172
- setup(e, { emit: s }) {
173
- de((a) => ({
173
+ emits: /* @__PURE__ */ D(["click"], ["update:modelValue"]),
174
+ setup(e, { emit: a }) {
175
+ he((c) => ({
174
176
  "0547f26d": u.value
175
177
  }));
176
- const t = e, o = U(e, "modelValue"), l = s, n = p(() => o.value ? t.data.onIcon : t.data.offIcon), u = p(() => t.size + "px"), d = p(() => o.value ? t.data.onTooltip : t.data.offTooltip), i = () => {
178
+ const t = e, o = H(e, "modelValue"), l = a, n = p(() => o.value ? t.data.onIcon : t.data.offIcon), u = p(() => t.size + "px"), m = p(() => o.value ? t.data.onTooltip : t.data.offTooltip), s = () => {
177
179
  o.value = !o.value, l("click", o.value);
178
180
  };
179
- return (a, r) => {
180
- const _ = Q, c = Z;
181
- return M(), $(c, {
182
- content: d.value,
181
+ return (c, v) => {
182
+ const _ = P, r = R;
183
+ return b(), $(r, {
184
+ content: m.value,
183
185
  "hide-after": 0
184
186
  }, {
185
- default: B(() => [
186
- D(_, {
187
+ default: C(() => [
188
+ S(_, {
187
189
  class: "ml-toggle-button",
188
190
  icon: n.value,
189
- onClick: i
191
+ onClick: s
190
192
  }, null, 8, ["icon"])
191
193
  ]),
192
194
  _: 1
193
195
  }, 8, ["content"]);
194
196
  };
195
197
  }
196
- }), Ve = /* @__PURE__ */ A(Ie, [["__scopeId", "data-v-b676e93b"]]), De = {
198
+ }), Se = /* @__PURE__ */ A(De, [["__scopeId", "data-v-b676e93b"]]), Ye = {
197
199
  key: 0,
198
200
  class: "ml-toolbar-button-text"
199
- }, Se = /* @__PURE__ */ S({
201
+ }, Ae = /* @__PURE__ */ Y({
200
202
  __name: "MlToolBar",
201
203
  props: {
202
204
  items: {},
@@ -206,8 +208,8 @@ const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0
206
208
  emits: {
207
209
  click: null
208
210
  },
209
- setup(e, { emit: s }) {
210
- const t = e, o = s, l = p(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = p(() => t.size === "small" ? 20 : 30), u = p(() => {
211
+ setup(e, { emit: a }) {
212
+ const t = e, o = a, l = p(() => t.direction === "vertical" ? "ml-vertical-toolbar-button-group" : "ml-horizontal-toolbar-button-group"), n = p(() => t.size === "small" ? 20 : 30), u = p(() => {
211
213
  switch (t.size) {
212
214
  case "small":
213
215
  return 30;
@@ -215,36 +217,36 @@ const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0
215
217
  return 50;
216
218
  }
217
219
  return 70;
218
- }), d = (r) => r.description ? r.description : r.text, i = p(() => t.size === "large"), a = (r) => {
219
- o("click", r);
220
+ }), m = (v) => v.description ? v.description : v.text, s = p(() => t.size === "large"), c = (v) => {
221
+ o("click", v);
220
222
  };
221
- return (r, _) => {
222
- const c = H, h = Q, v = Z, f = re;
223
- return M(), $(f, {
223
+ return (v, _) => {
224
+ const r = U, h = P, d = R, M = re;
225
+ return b(), $(M, {
224
226
  class: le(l.value)
225
227
  }, {
226
- default: B(() => [
227
- (M(!0), I(R, null, ee(r.items, (x, C) => (M(), $(v, {
228
- key: x.text,
229
- content: d(x),
228
+ default: C(() => [
229
+ (b(!0), V(G, null, j(v.items, (E, k) => (b(), $(d, {
230
+ key: E.text,
231
+ content: m(E),
230
232
  "hide-after": 0
231
233
  }, {
232
- default: B(() => [
233
- (M(), $(h, {
234
+ default: C(() => [
235
+ (b(), $(h, {
234
236
  class: "ml-toolbar-button",
235
- style: X({ width: u.value + "px", height: u.value + "px" }),
236
- key: C,
237
- onClick: (k) => a(x.command)
237
+ style: N({ width: u.value + "px", height: u.value + "px" }),
238
+ key: k,
239
+ onClick: (I) => c(E.command)
238
240
  }, {
239
- default: B(() => [
240
- E("div", null, [
241
- D(c, { size: n.value }, {
242
- default: B(() => [
243
- (M(), $(P(x.icon)))
241
+ default: C(() => [
242
+ B("div", null, [
243
+ S(r, { size: n.value }, {
244
+ default: C(() => [
245
+ (b(), $(ee(E.icon)))
244
246
  ]),
245
247
  _: 2
246
248
  }, 1032, ["size"]),
247
- i.value ? (M(), I("div", De, F(x.text), 1)) : oe("", !0)
249
+ s.value ? (b(), V("div", Ye, O(E.text), 1)) : oe("", !0)
248
250
  ])
249
251
  ]),
250
252
  _: 2
@@ -257,391 +259,447 @@ const We = /* @__PURE__ */ A(Ce, [["render", $e], ["__scopeId", "data-v-d6a59cf0
257
259
  }, 8, ["class"]);
258
260
  };
259
261
  }
260
- }), Ye = /* @__PURE__ */ A(Se, [["__scopeId", "data-v-5261c686"]]), K = 20;
261
- function Ae(e, s, t) {
262
- const o = m(!1), l = (i) => {
262
+ }), He = /* @__PURE__ */ A(Ae, [["__scopeId", "data-v-c6504e33"]]), Z = 20;
263
+ function Oe(e, a, t) {
264
+ const o = f(!1), l = (s) => {
263
265
  if (t.value && e.value) {
264
- const a = e.value.getBoundingClientRect(), r = i.clientX < a.left || i.clientX > a.right || i.clientY < a.top || i.clientY > a.bottom;
265
- o.value = !r;
266
+ const c = e.value.getBoundingClientRect(), v = s.clientX < c.left || s.clientX > c.right || s.clientY < c.top || s.clientY > c.bottom;
267
+ o.value = !v;
266
268
  }
267
269
  }, n = () => {
268
270
  t.value && (o.value = !0);
269
271
  }, u = () => {
270
- s.value && s.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
271
- }, d = () => {
272
- s.value && s.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
272
+ a.value && a.value.addEventListener("mousemove", n), e.value && e.value.addEventListener("mousemove", n);
273
+ }, m = () => {
274
+ a.value && a.value.removeEventListener("mousemove", n), e.value && e.value.removeEventListener("mousemove", n);
273
275
  };
274
- return Y(() => {
276
+ return W(() => {
275
277
  window.addEventListener("mousemove", l);
276
- }), G(() => {
278
+ }), q(() => {
277
279
  window.removeEventListener("mousemove", l);
278
- }), L(t, (i) => {
279
- i && (o.value = !1);
280
- }), L(e, (i) => {
281
- i ? u() : d();
280
+ }), y(t, (s) => {
281
+ s && (o.value = !1);
282
+ }), y(e, (s) => {
283
+ s ? u() : m();
282
284
  }), { autoOpened: o };
283
285
  }
284
- function He(e, s, t) {
285
- const o = m(!1), l = m(null), n = m(null), u = { x: 0, y: 0 }, d = p(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
286
+ function Xe(e, a, t) {
287
+ const o = f(!1), l = f(null), n = f(null), u = { x: 0, y: 0 }, m = p(() => l.value == null || n.value == null ? { x: 0, y: 0 } : {
286
288
  x: l.value.x - n.value.x,
287
289
  y: l.value.y - n.value.y
288
- }), i = () => {
290
+ }), s = () => {
289
291
  if (e.value) {
290
- const v = e.value.getBoundingClientRect();
292
+ const d = e.value.getBoundingClientRect();
291
293
  n.value = {
292
- x: v.left,
293
- y: v.top
294
+ x: d.left,
295
+ y: d.top
294
296
  }, l.value = {
295
- x: v.left,
296
- y: v.top
297
+ x: d.left,
298
+ y: d.top
297
299
  };
298
300
  }
299
- }, a = () => {
301
+ }, c = () => {
300
302
  e.value && e.value.addEventListener("mousedown", _);
301
- }, r = () => {
303
+ }, v = () => {
302
304
  e.value && e.value.removeEventListener("mousedown", _);
303
- }, _ = (v) => {
305
+ }, _ = (d) => {
304
306
  if (e.value != null) {
305
- if (s && s.value) {
306
- const f = s.value.getBoundingClientRect();
307
- if (v.clientX < f.left || v.clientX > f.right || v.clientY < f.top || v.clientY > f.bottom) return;
307
+ if (a && a.value) {
308
+ const M = a.value.getBoundingClientRect();
309
+ if (d.clientX < M.left || d.clientX > M.right || d.clientY < M.top || d.clientY > M.bottom) return;
308
310
  }
309
- o.value = !0, u.x = v.clientX, u.y = v.clientY, i(), document.addEventListener("mousemove", c), document.addEventListener("mouseup", h);
311
+ o.value = !0, u.x = d.clientX, u.y = d.clientY, s(), document.addEventListener("mousemove", r), document.addEventListener("mouseup", h);
310
312
  }
311
- }, c = (v) => {
313
+ }, r = (d) => {
312
314
  if (o.value && n.value && l.value) {
313
- const f = window.innerWidth, x = window.innerHeight, C = e.value, k = C.getBoundingClientRect(), z = k.width, w = k.height, W = n.value.x + (v.clientX - u.x), y = n.value.y + (v.clientY - u.y);
315
+ const M = window.innerWidth, E = window.innerHeight, k = e.value, I = k.getBoundingClientRect(), T = I.width, i = I.height, L = n.value.x + (d.clientX - u.x), w = n.value.y + (d.clientY - u.y);
314
316
  l.value.x = Math.max(
315
317
  t ? t.value.offset.value.left : 0,
316
- W
318
+ L
317
319
  );
318
- const g = f - z;
320
+ const g = M - T;
319
321
  l.value.x = Math.min(
320
322
  t ? g - t.value.offset.value.right : g,
321
323
  l.value.x
322
324
  ), l.value.y = Math.max(
323
325
  t ? t.value.offset.value.top : 0,
324
- Math.min(y, x - w)
326
+ Math.min(w, E - i)
325
327
  );
326
- const b = x - w;
328
+ const z = E - i;
327
329
  l.value.y = Math.min(
328
- t ? b - t.value.offset.value.bottom : b,
330
+ t ? z - t.value.offset.value.bottom : z,
329
331
  l.value.y
330
- ), C.style.left = l.value.x + "px", C.style.top = l.value.y + "px";
332
+ ), k.style.left = l.value.x + "px", k.style.top = l.value.y + "px";
331
333
  }
332
334
  }, h = () => {
333
- o.value = !1, document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", h);
335
+ o.value = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", h);
334
336
  };
335
- return Y(() => {
336
- e.value && (i(), a());
337
- }), G(() => {
337
+ return W(() => {
338
+ e.value && (s(), c());
339
+ }), q(() => {
338
340
  e.value && e.value.removeEventListener("mousedown", _);
339
- }), L(e, (v) => {
340
- v ? (i(), a()) : r();
341
+ }), y(e, (d) => {
342
+ d ? (s(), c()) : v();
341
343
  }), {
342
344
  isDragging: o,
343
- movement: d,
345
+ movement: m,
344
346
  position: l
345
347
  };
346
348
  }
347
- function Oe(e, s, t) {
348
- const o = m(!1), l = m("left"), { isDragging: n, movement: u, position: d } = He(
349
+ function Ue(e, a, t) {
350
+ const o = f(!1), l = f("left"), { isDragging: n, movement: u, position: m } = Xe(
349
351
  e,
350
- s,
352
+ a,
351
353
  t
352
354
  );
353
- return L(u, (i) => {
354
- if (i && e.value) {
355
- const r = e.value.getBoundingClientRect();
356
- r.left <= t.value.offset.value.left ? (l.value = "left", o.value = !0) : window.innerWidth - r.left - r.width <= t.value.offset.value.right ? (l.value = "right", o.value = !0) : o.value = !1;
355
+ return y(u, (s) => {
356
+ if (s && e.value) {
357
+ const v = e.value.getBoundingClientRect();
358
+ v.left <= t.value.offset.value.left ? (l.value = "left", o.value = !0) : window.innerWidth - v.left - v.width <= t.value.offset.value.right ? (l.value = "right", o.value = !0) : o.value = !1;
357
359
  }
358
360
  }), {
359
361
  docked: o,
360
362
  orientation: l,
361
363
  isDragging: n,
362
364
  movement: u,
363
- position: d
365
+ position: m
364
366
  };
365
367
  }
366
- function Xe(e, s, t, o) {
367
- const l = m(null), n = m(null), u = m(null), d = m(null);
368
- return L(e, (i, a) => {
369
- l.value = a;
370
- }), L(s, (i, a) => {
371
- n.value = a;
372
- }), L(t, (i, a) => {
373
- u.value = a;
374
- }), L(o, (i, a) => {
375
- d.value = a;
368
+ function Ne(e, a, t, o) {
369
+ const l = f(null), n = f(null), u = f(null), m = f(null);
370
+ return y(e, (s, c) => {
371
+ l.value = c;
372
+ }), y(a, (s, c) => {
373
+ n.value = c;
374
+ }), y(t, (s, c) => {
375
+ u.value = c;
376
+ }), y(o, (s, c) => {
377
+ m.value = c;
376
378
  }), {
377
379
  lastLeft: l,
378
380
  lastTop: n,
379
381
  lastWidth: u,
380
- lastHeight: d
382
+ lastHeight: m
381
383
  };
382
384
  }
383
- function Ne(e, s, t, o) {
384
- const l = m(e.value.width), n = m(e.value.left), u = p(() => e.value.width), d = p(() => e.value.left), i = p(() => t.value ? t.value.x : null);
385
- return L([u, d], ([a, r]) => {
386
- (l.value == null || n.value == null || s.value) && (l.value = a, n.value = r);
387
- }), L(i, (a) => {
388
- o.value && t.value && (n.value = a);
385
+ function Fe(e, a, t, o) {
386
+ const l = f(e.value.width), n = f(e.value.left), u = p(() => e.value.width), m = p(() => e.value.left), s = p(() => t.value ? t.value.x : null);
387
+ return y([u, m], ([c, v]) => {
388
+ (l.value == null || n.value == null || a.value) && (l.value = c, n.value = v);
389
+ }), y(s, (c) => {
390
+ o.value && t.value && (n.value = c);
389
391
  }), { left: n, width: l };
390
392
  }
391
- function Ue(e, s = m({ left: 0, right: 0, top: 0, bottom: 0 })) {
392
- const t = m({});
393
+ function Ge(e, a = f({ left: 0, right: 0, top: 0, bottom: 0 })) {
394
+ const t = f({});
393
395
  let o = !1;
394
396
  const l = () => {
395
397
  if (!o && e.value) {
396
398
  const n = e.value.getBoundingClientRect();
397
- t.value.left = Math.max(n.left, s.value.left), t.value.top = Math.max(n.top, s.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
399
+ t.value.left = Math.max(n.left, a.value.left), t.value.top = Math.max(n.top, a.value.top), t.value.width = n.width, t.value.height = n.height, o = !0;
398
400
  }
399
401
  };
400
- return Y(() => {
402
+ return W(() => {
401
403
  e.value && l();
402
- }), L(e, (n) => {
404
+ }), y(e, (n) => {
403
405
  n && l();
404
406
  }), {
405
407
  isIntialized: o,
406
408
  initialRect: t
407
409
  };
408
410
  }
409
- function Fe(e, s = m(!1), t = m(!1), o = m({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
410
- const { initialRect: n } = Ue(e, o), u = m(!1);
411
- let d = 0, i = 0, a = 0, r = 0, _ = 0;
412
- const c = 5, h = m(null), v = (z) => {
413
- if (!(!e.value || s.value))
411
+ function je(e, a = f(!1), t = f(!1), o = f({ left: 0, right: 0, top: 0, bottom: 0 }), l = { width: 20, height: 40 }) {
412
+ const { initialRect: n } = Ge(e, o), u = f(!1);
413
+ let m = 0, s = 0, c = 0, v = 0, _ = 0;
414
+ const r = 5, h = f(null), d = (T) => {
415
+ if (!(!e.value || a.value))
414
416
  if (u.value) {
415
- const w = z.clientX - r, W = z.clientY - _;
417
+ const i = T.clientX - v, L = T.clientY - _;
416
418
  if (h.value === "left" || h.value === "left-bottom-corner") {
417
- const y = i - w;
418
- y > l.width && (n.value.width = y, n.value.left = d + w, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
419
+ const w = s - i;
420
+ w > l.width && (n.value.width = w, n.value.left = m + i, e.value.style.left = n.value.left + "px", e.value.style.width = n.value.width + "px");
419
421
  }
420
422
  if (h.value === "right" || h.value === "right-bottom-corner") {
421
- const y = i + w;
422
- y > l.width && (n.value.width = y, e.value.style.width = n.value.width + "px");
423
+ const w = s + i;
424
+ w > l.width && (n.value.width = w, e.value.style.width = n.value.width + "px");
423
425
  }
424
426
  if (h.value === "bottom" || h.value === "left-bottom-corner" || h.value === "right-bottom-corner") {
425
- const y = a + W;
426
- y > l.height && (n.value.height = y, e.value.style.height = n.value.height + "px");
427
+ const w = c + L;
428
+ w > l.height && (n.value.height = w, e.value.style.height = n.value.height + "px");
427
429
  }
428
430
  } else {
429
- const w = e.value.getBoundingClientRect(), W = z.clientX - w.left, y = z.clientY - w.top, g = W <= c, b = W >= w.width - c, T = y >= w.height - c;
430
- g && T && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : b && T && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : g && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : b && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : T ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
431
+ const i = e.value.getBoundingClientRect(), L = T.clientX - i.left, w = T.clientY - i.top, g = L <= r, z = L >= i.width - r, x = w >= i.height - r;
432
+ g && x && t.value ? (e.value.style.cursor = "nesw-resize", h.value = "left-bottom-corner") : z && x && !t.value ? (e.value.style.cursor = "nwse-resize", h.value = "right-bottom-corner") : g && t.value ? (e.value.style.cursor = "ew-resize", h.value = "left") : z && !t.value ? (e.value.style.cursor = "ew-resize", h.value = "right") : x ? (e.value.style.cursor = "ns-resize", h.value = "bottom") : (e.value.style.cursor = "", h.value = null);
431
433
  }
432
- }, f = (z) => {
434
+ }, M = (T) => {
433
435
  if (!e.value || !h.value) return;
434
- const w = e.value.getBoundingClientRect();
435
- r = z.clientX, _ = z.clientY, i = w.width, a = w.height, d = w.left, n.value.width = i, n.value.height = a, n.value.left = w.left, n.value.top = w.top, u.value = !0, document.addEventListener("mousemove", v), document.addEventListener("mouseup", x);
436
- }, x = () => {
437
- u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", x);
438
- }, C = () => {
439
- e.value && (e.value.removeEventListener("mousedown", f), e.value.removeEventListener("mousemove", v)), document.removeEventListener("mouseup", x);
436
+ const i = e.value.getBoundingClientRect();
437
+ v = T.clientX, _ = T.clientY, s = i.width, c = i.height, m = i.left, n.value.width = s, n.value.height = c, n.value.left = i.left, n.value.top = i.top, u.value = !0, document.addEventListener("mousemove", d), document.addEventListener("mouseup", E);
438
+ }, E = () => {
439
+ u.value = !1, h.value = null, e.value && (e.value.style.cursor = ""), document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", E);
440
440
  }, k = () => {
441
- e.value && (e.value.addEventListener("mousedown", f), e.value.addEventListener("mousemove", v));
441
+ e.value && (e.value.removeEventListener("mousedown", M), e.value.removeEventListener("mousemove", d)), document.removeEventListener("mouseup", E);
442
+ }, I = () => {
443
+ e.value && (e.value.addEventListener("mousedown", M), e.value.addEventListener("mousemove", d));
442
444
  };
443
- return Y(() => {
444
- e.value && k();
445
+ return W(() => {
446
+ e.value && I();
445
447
  }), se(() => {
446
- C();
447
- }), L(e, (z) => {
448
- z ? k() : C();
448
+ k();
449
+ }), y(e, (T) => {
450
+ T ? I() : k();
449
451
  }), { rect: n, isResizing: u };
450
452
  }
451
- function Ge(e, s, t, o) {
453
+ function qe(e, a, t, o) {
452
454
  const l = () => {
453
455
  if (e.value) {
454
- const i = e.value;
455
- s.value ? i.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : i.style.transition = "width 0.3s ease";
456
+ const s = e.value;
457
+ a.value ? s.style.transition = "width 0.3s ease-out, left 0.3s ease-out" : s.style.transition = "width 0.3s ease";
456
458
  }
457
459
  }, n = () => {
458
460
  e.value && (e.value.style.transition = "");
459
461
  }, u = () => {
460
462
  e.value && e.value.removeEventListener("transitionend", n);
461
- }, d = () => {
463
+ }, m = () => {
462
464
  e.value && e.value.addEventListener("transitionend", n);
463
465
  };
464
- Y(() => {
466
+ W(() => {
465
467
  e.value && e.value.addEventListener("transitionend", n);
466
468
  }), se(() => {
467
469
  e.value && e.value.removeEventListener("transitionend", n);
468
- }), L(e, (i) => {
469
- i ? d() : u();
470
- }), L(t, () => {
470
+ }), y(e, (s) => {
471
+ s ? m() : u();
472
+ }), y(t, () => {
471
473
  l();
472
- }), L(o, () => {
474
+ }), y(o, () => {
473
475
  l();
474
476
  });
475
477
  }
476
- function je(e, s, t, o) {
477
- const l = m(window.innerWidth), n = m(window.innerHeight), { docked: u, orientation: d, movement: i, position: a, isDragging: r } = Oe(
478
+ function Je(e, a, t, o) {
479
+ const l = f(window.innerWidth), n = f(window.innerHeight), { docked: u, orientation: m, movement: s, position: c, isDragging: v } = Ue(
478
480
  e,
479
- s,
481
+ a,
480
482
  o
481
- ), _ = p(() => d.value === "right"), { rect: c, isResizing: h } = Fe(
483
+ ), _ = p(() => m.value === "right"), { rect: r, isResizing: h } = je(
482
484
  e,
483
485
  t,
484
486
  _,
485
487
  o.value.offset
486
- ), { width: v, left: f } = Ne(
487
- c,
488
+ ), { width: d, left: M } = Fe(
489
+ r,
488
490
  h,
489
- a,
490
- r
491
- ), { lastTop: x, lastHeight: C } = Xe(
492
- p(() => c.value.left),
493
- p(() => c.value.top),
494
- p(() => c.value.width),
495
- p(() => c.value.height)
496
- ), { autoOpened: k } = Ae(e, s, t);
497
- Ge(e, _, t, k);
498
- const z = (g) => {
491
+ c,
492
+ v
493
+ ), { lastTop: E, lastHeight: k } = Ne(
494
+ p(() => r.value.left),
495
+ p(() => r.value.top),
496
+ p(() => r.value.width),
497
+ p(() => r.value.height)
498
+ ), { autoOpened: I } = Oe(e, a, t);
499
+ qe(e, _, t, I);
500
+ const T = (g) => {
499
501
  if (e.value) {
500
- const b = e.value.getBoundingClientRect(), T = b.left + g;
502
+ const z = e.value.getBoundingClientRect(), x = z.left + g;
501
503
  if (_.value) {
502
- c.value.left = T;
503
- const ie = window.innerWidth - b.width - b.left;
504
- b.left <= 0 && ie >= 0 && g < 0 && (c.value.left = Math.max(0, T)), window.innerWidth - b.width <= 0 && (c.value.left = window.innerWidth - b.width);
504
+ r.value.left = x;
505
+ const ie = window.innerWidth - z.width - z.left;
506
+ z.left <= 0 && ie >= 0 && g < 0 && (r.value.left = Math.max(0, x)), window.innerWidth - z.width <= 0 && (r.value.left = window.innerWidth - z.width);
505
507
  } else
506
- b.left + b.width >= window.innerWidth && g < 0 && (c.value.left = Math.max(0, T));
508
+ z.left + z.width >= window.innerWidth && g < 0 && (r.value.left = Math.max(0, x));
507
509
  }
508
- }, w = () => {
510
+ }, i = () => {
509
511
  const g = window.innerWidth - l.value;
510
- l.value = window.innerWidth, n.value = window.innerHeight, z(g);
512
+ l.value = window.innerWidth, n.value = window.innerHeight, T(g);
511
513
  };
512
- Y(() => {
513
- window.addEventListener("resize", w);
514
- }), G(() => {
515
- window.removeEventListener("resize", w);
514
+ W(() => {
515
+ window.addEventListener("resize", i);
516
+ }), q(() => {
517
+ window.removeEventListener("resize", i);
516
518
  });
517
- const W = (g) => {
518
- g ? (c.value.width = K, _.value && f.value && v.value && (c.value.left = f.value + v.value - K)) : (c.value.width = v.value, _.value && f.value && v.value && (c.value.left = f.value));
519
- }, y = () => {
520
- u.value ? (c.value.top = o.value.offset.value.top, c.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom) : (c.value.top = x.value, c.value.height = C.value);
519
+ const L = (g) => {
520
+ g ? (r.value.width = Z, _.value && M.value && d.value && (r.value.left = M.value + d.value - Z)) : (r.value.width = d.value, _.value && M.value && d.value && (r.value.left = M.value));
521
+ }, w = () => {
522
+ u.value ? (r.value.top = o.value.offset.value.top, r.value.height = window.innerHeight - o.value.offset.value.top - o.value.offset.value.bottom) : (r.value.top = E.value, r.value.height = k.value);
521
523
  };
522
- return L(u, () => {
523
- y();
524
- }), L(t, (g) => {
525
- W(g);
526
- }), L(k, (g) => {
527
- t.value && !r.value && W(!g);
528
- }), L(i, (g) => {
524
+ return y(u, () => {
525
+ w();
526
+ }), y(t, (g) => {
527
+ L(g);
528
+ }), y(I, (g) => {
529
+ t.value && !v.value && L(!g);
530
+ }), y(s, (g) => {
529
531
  if (g && e.value) {
530
- const T = e.value.getBoundingClientRect();
531
- c.value.left = T.left, c.value.top = T.top;
532
+ const x = e.value.getBoundingClientRect();
533
+ r.value.left = x.left, r.value.top = x.top;
532
534
  }
533
- }), { rect: c, orientation: d, reversed: _ };
535
+ }), { rect: r, orientation: m, reversed: _ };
534
536
  }
535
- const qe = (e) => (te("data-v-8645db4f"), e = e(), ne(), e), Je = /* @__PURE__ */ qe(() => /* @__PURE__ */ E("svg", {
537
+ const Ke = (e) => (te("data-v-43098ce9"), e = e(), ne(), e), Qe = /* @__PURE__ */ Ke(() => /* @__PURE__ */ B("svg", {
536
538
  xmlns: "http://www.w3.org/2000/svg",
537
539
  width: "1em",
538
540
  height: "1em",
539
541
  viewBox: "0 0 1024 1024"
540
542
  }, [
541
- /* @__PURE__ */ E("path", {
543
+ /* @__PURE__ */ B("path", {
542
544
  fill: "currentColor",
543
545
  d: "M764.288 214.592L512 466.88L259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512L214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
544
546
  })
545
- ], -1)), Ke = { class: "ml-tool-palette-title" }, Qe = { class: "ml-tool-palette-content" }, Ze = /* @__PURE__ */ S({
547
+ ], -1)), Ze = { class: "ml-tool-palette-title" }, Pe = { class: "ml-tool-palette-content" }, Re = {
548
+ key: 1,
549
+ class: "ml-tool-palette-default-content"
550
+ }, et = /* @__PURE__ */ Y({
546
551
  __name: "MlToolPalette",
547
- props: /* @__PURE__ */ V({
552
+ props: /* @__PURE__ */ D({
548
553
  title: { default: "" },
554
+ tabs: { default: void 0 },
549
555
  leftOffset: { default: 0 },
550
556
  rightOffset: { default: 0 },
551
557
  topOffset: { default: 0 },
552
558
  bottomOffset: { default: 0 }
553
559
  }, {
554
560
  modelValue: { default: !0 },
555
- modelModifiers: {}
561
+ modelModifiers: {},
562
+ activeTab: { default: "" },
563
+ activeTabModifiers: {}
556
564
  }),
557
- emits: /* @__PURE__ */ V(["close"], ["update:modelValue"]),
558
- setup(e, { emit: s }) {
559
- const t = e, o = U(e, "modelValue"), l = s, n = m(!1), u = m(null), d = m(null), i = p(() => ({
560
- offset: m({
565
+ emits: /* @__PURE__ */ D(["close", "tab-change", "tab-close"], ["update:modelValue", "update:activeTab"]),
566
+ setup(e, { emit: a }) {
567
+ const t = e, o = H(e, "modelValue"), l = H(e, "activeTab"), n = a, u = p(() => t.tabs && t.tabs.length > 0);
568
+ W(() => {
569
+ u.value && !l.value && t.tabs && t.tabs.length > 0 && (l.value = t.tabs[0].name);
570
+ }), y(() => t.tabs, (i) => {
571
+ i && i.length > 0 && !l.value && (l.value = i[0].name);
572
+ }, { immediate: !0 });
573
+ const m = f(!1), s = f(null), c = f(null), v = p(() => ({
574
+ offset: f({
561
575
  left: t.leftOffset,
562
576
  right: t.rightOffset,
563
577
  top: t.topOffset,
564
578
  bottom: t.bottomOffset
565
579
  })
566
580
  })), {
567
- rect: a,
581
+ rect: _,
568
582
  orientation: r,
569
- reversed: _
570
- } = je(d, u, n, i), c = p(() => ({
571
- left: `${a.value.left}px`,
572
- top: `${a.value.top}px`,
573
- width: `${a.value.width}px`,
574
- height: `${a.value.height}px`
575
- })), h = p(() => _.value ? {
583
+ reversed: h
584
+ } = Je(c, s, m, v), d = p(() => ({
585
+ left: `${_.value.left}px`,
586
+ top: `${_.value.top}px`,
587
+ width: `${_.value.width}px`,
588
+ height: `${_.value.height}px`
589
+ })), M = p(() => h.value ? {
576
590
  borderLeft: "1px solid var(--el-border-color)",
577
591
  borderRight: null
578
592
  } : {
579
593
  borderLeft: null,
580
594
  borderRight: "1px solid var(--el-border-color)"
581
- }), v = () => {
595
+ }), E = p(() => {
596
+ if (u.value && l.value && t.tabs) {
597
+ const i = t.tabs.find((L) => L.name === l.value);
598
+ if (i && i.title)
599
+ return i.title;
600
+ }
601
+ return t.title;
602
+ }), k = () => {
582
603
  o.value = !1;
583
- const f = d.value;
584
- l("close", {
585
- x: f ? f.clientLeft : 0,
586
- y: f ? f.clientTop : 0
604
+ const i = c.value;
605
+ n("close", {
606
+ x: i ? i.clientLeft : 0,
607
+ y: i ? i.clientTop : 0
587
608
  });
609
+ }, I = (i) => {
610
+ n("tab-change", i);
611
+ }, T = (i) => {
612
+ if (n("tab-close", i), l.value === i && t.tabs) {
613
+ const L = t.tabs.findIndex((w) => w.name === i);
614
+ if (L >= 0) {
615
+ const w = t.tabs[L + 1] || t.tabs[L - 1];
616
+ w && (l.value = w.name);
617
+ }
618
+ }
588
619
  };
589
- return (f, x) => {
590
- const C = H;
591
- return o.value ? (M(), I("div", {
620
+ return (i, L) => {
621
+ const w = U, g = ve, z = de;
622
+ return o.value ? (b(), V("div", {
592
623
  key: 0,
593
624
  ref_key: "toolPaletteElement",
594
- ref: d,
595
- style: X([c.value]),
625
+ ref: c,
626
+ style: N([d.value]),
596
627
  class: "ml-tool-palette-dialog"
597
628
  }, [
598
- E("div", {
599
- class: le(["ml-tool-palette-dialog-layout", j(r)])
629
+ B("div", {
630
+ class: le(["ml-tool-palette-dialog-layout", J(r)])
600
631
  }, [
601
- E("div", {
632
+ B("div", {
602
633
  ref_key: "titleBarElement",
603
- ref: u,
634
+ ref: s,
604
635
  class: "ml-tool-palette-title-bar",
605
- style: X(h.value)
636
+ style: N(M.value)
606
637
  }, [
607
- D(C, {
638
+ S(w, {
608
639
  size: 18,
609
640
  class: "ml-tool-palette-dialog-icon",
610
- onClick: v
641
+ onClick: k
611
642
  }, {
612
- default: B(() => [
613
- Je
643
+ default: C(() => [
644
+ Qe
614
645
  ]),
615
646
  _: 1
616
647
  }),
617
- D(xe, {
648
+ S(ye, {
618
649
  class: "ml-tool-palette-dialog-icon",
619
- modelValue: n.value,
620
- "onUpdate:modelValue": x[0] || (x[0] = (k) => n.value = k),
621
- reverse: j(_)
650
+ modelValue: m.value,
651
+ "onUpdate:modelValue": L[0] || (L[0] = (x) => m.value = x),
652
+ reverse: J(h)
622
653
  }, null, 8, ["modelValue", "reverse"]),
623
- E("span", Ke, F(t.title), 1)
654
+ B("span", Ze, O(E.value), 1)
624
655
  ], 4),
625
- E("div", Qe, [
626
- O(f.$slots, "default", {}, void 0, !0)
656
+ B("div", Pe, [
657
+ u.value ? (b(), $(z, {
658
+ key: 0,
659
+ modelValue: l.value,
660
+ "onUpdate:modelValue": L[1] || (L[1] = (x) => l.value = x),
661
+ type: "border-card",
662
+ class: "ml-tool-palette-tabs",
663
+ onTabRemove: T,
664
+ onTabChange: I
665
+ }, {
666
+ default: C(() => [
667
+ (b(!0), V(G, null, j(t.tabs, (x) => (b(), $(g, {
668
+ key: x.name,
669
+ name: x.name,
670
+ label: x.label
671
+ }, {
672
+ label: C(() => [
673
+ B("span", null, O(x.label), 1)
674
+ ]),
675
+ default: C(() => [
676
+ X(i.$slots, `tab-${x.name}`, {}, void 0, !0)
677
+ ]),
678
+ _: 2
679
+ }, 1032, ["name", "label"]))), 128))
680
+ ]),
681
+ _: 3
682
+ }, 8, ["modelValue"])) : (b(), V("div", Re, [
683
+ X(i.$slots, "default", {}, void 0, !0)
684
+ ]))
627
685
  ])
628
686
  ], 2)
629
687
  ], 4)) : oe("", !0);
630
688
  };
631
689
  }
632
- }), Pe = /* @__PURE__ */ A(Ze, [["__scopeId", "data-v-8645db4f"]]), ct = {
690
+ }), tt = /* @__PURE__ */ A(et, [["__scopeId", "data-v-43098ce9"]]), ht = {
633
691
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
634
692
  install(e) {
635
- e.component("MlCollapse", N), e.component("MlDropdown", N), e.component("MlLanguage", Ee), e.component("MlStatusBar", We), e.component("MlToggleButton", Ve), e.component("MlToolBar", Ye), e.component("MlToolPalette", Pe);
693
+ e.component("MlCollapse", F), e.component("MlDropdown", F), e.component("MlLanguage", Ce), e.component("MlStatusBar", We), e.component("MlToggleButton", Se), e.component("MlToolBar", He), e.component("MlToolPalette", tt);
636
694
  }
637
695
  };
638
696
  export {
639
- xe as MlCollapse,
640
- N as MlDropdown,
641
- Ee as MlLanguage,
697
+ ye as MlCollapse,
698
+ F as MlDropdown,
699
+ Ce as MlLanguage,
642
700
  We as MlStatusBar,
643
- Ve as MlToggleButton,
644
- Ye as MlToolBar,
645
- Pe as MlToolPalette,
646
- ct as default
701
+ Se as MlToggleButton,
702
+ He as MlToolBar,
703
+ tt as MlToolPalette,
704
+ ht as default
647
705
  };