@mlightcad/ribbon 0.0.4 → 0.0.5
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 +10 -3
- package/dist/components/Ribbon.vue.d.ts +4 -0
- package/dist/components/RibbonItemHost.vue.d.ts +3 -2
- package/dist/components/RibbonTabs.vue.d.ts +1 -0
- package/dist/composables/useRibbonState.d.ts +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/items/{RibbonGroupButton.vue.d.ts → RibbonButtonGroup.vue.d.ts} +9 -12
- package/dist/items/RibbonSegmented.vue.d.ts +65 -0
- package/dist/items/RibbonTemplateItem.vue.d.ts +4 -1
- package/dist/ml-ribbon.css +1 -1
- package/dist/ml-ribbon.es.js +724 -490
- package/dist/ml-ribbon.umd.js +1 -1
- package/dist/modules/RibbonContextualTabs.vue.d.ts +1 -0
- package/dist/modules/RibbonFileMenu.vue.d.ts +1 -0
- package/dist/types.d.ts +2 -1
- package/package.json +1 -1
package/dist/ml-ribbon.es.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, createVNode as c, defineComponent as l, inject as u, markRaw as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, provide as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, toRaw as w, unref as T, watch as E, withCtx as D, withModifiers as
|
|
2
|
-
import { ElButton as
|
|
3
|
-
import { ArrowDown as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, createVNode as c, defineComponent as l, inject as u, markRaw as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, provide as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, toRaw as w, unref as T, watch as E, withCtx as D, withModifiers as ee } from "vue";
|
|
2
|
+
import { ElButton as O, ElButtonGroup as k, ElCheckbox as A, ElColorPicker as j, ElConfigProvider as te, ElDrawer as M, ElDropdown as N, ElDropdownItem as P, ElDropdownMenu as F, ElIcon as I, ElOption as ne, ElPopover as re, ElSegmented as L, ElSelect as R, ElSwitch as z, ElTooltip as B, useGlobalConfig as ie } from "element-plus";
|
|
3
|
+
import { ArrowDown as V, ArrowDownBold as ae, ArrowUp as H, ArrowUpBold as U, Grid as oe, Menu as W, Promotion as G } from "@element-plus/icons-vue";
|
|
4
4
|
//#region src/ribbon/context.ts
|
|
5
5
|
var se = Symbol("RibbonContext");
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/ribbon/composables/useRibbonState.ts
|
|
8
|
-
function
|
|
8
|
+
function K(e) {
|
|
9
9
|
return e == null || typeof e == "string" ? e : typeof e == "object" || typeof e == "function" ? d(w(e)) : e;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function q(e) {
|
|
12
12
|
if (!e) return;
|
|
13
13
|
let t = { ...e };
|
|
14
|
-
return "icon" in t && (t.icon =
|
|
14
|
+
return "icon" in t && (t.icon = K(t.icon)), Array.isArray(t.options) && (t.options = t.options.map((e) => {
|
|
15
15
|
if (!e || typeof e != "object") return e;
|
|
16
16
|
let t = e;
|
|
17
17
|
return "icon" in t ? {
|
|
18
18
|
...t,
|
|
19
|
-
icon:
|
|
19
|
+
icon: K(t.icon)
|
|
20
20
|
} : t;
|
|
21
21
|
})), t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function J(e) {
|
|
24
24
|
return {
|
|
25
25
|
...e,
|
|
26
|
-
icon:
|
|
27
|
-
props:
|
|
26
|
+
icon: K(e.icon),
|
|
27
|
+
props: q(e.props)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function ce(e) {
|
|
31
31
|
return {
|
|
32
32
|
...e,
|
|
33
|
-
icon:
|
|
34
|
-
footerMenuItems: e.footerMenuItems?.map(
|
|
33
|
+
icon: K(e.icon),
|
|
34
|
+
footerMenuItems: e.footerMenuItems?.map(J),
|
|
35
35
|
collections: e.collections?.map((e) => ({
|
|
36
36
|
...e,
|
|
37
|
-
items: e.items.map(
|
|
37
|
+
items: e.items.map(J)
|
|
38
38
|
}))
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Y(e) {
|
|
42
42
|
return {
|
|
43
43
|
...e,
|
|
44
|
-
groups: e.groups?.map(
|
|
44
|
+
groups: e.groups?.map(ce)
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function Y(e) {
|
|
48
|
-
return e.map(J);
|
|
49
|
-
}
|
|
50
47
|
function le(e) {
|
|
48
|
+
return e.map(Y);
|
|
49
|
+
}
|
|
50
|
+
function X(e) {
|
|
51
51
|
(!e.collections || e.collections.length === 0) && (e.collections = [{
|
|
52
52
|
id: `${e.id}-collection-1`,
|
|
53
53
|
items: []
|
|
54
54
|
}]);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Z(e, t, n, r, i) {
|
|
57
57
|
let a = e.find((e) => e.id === t);
|
|
58
58
|
if (!a?.groups) return;
|
|
59
59
|
let o = a.groups.find((e) => e.id === n);
|
|
@@ -61,98 +61,99 @@ function X(e, t, n, r, i) {
|
|
|
61
61
|
let s = o.collections.find((e) => e.id === r);
|
|
62
62
|
s && i(s.items);
|
|
63
63
|
}
|
|
64
|
-
function ue(e, n, r, i, a) {
|
|
65
|
-
let
|
|
64
|
+
function ue(e, n, r, i, a, o) {
|
|
65
|
+
let s = y(r), c = y(i), l = y(a), u = y(o), d = y(le(n)), f = y(!1), p = y(!1), m = y(!1), h = y([]), g = y(""), _ = t(() => d.value.filter((e) => e.visible !== !1)), v = {
|
|
66
66
|
addTab(e) {
|
|
67
|
-
|
|
67
|
+
d.value.push(Y(e)), u.value ||= e.id;
|
|
68
68
|
},
|
|
69
69
|
removeTab(e) {
|
|
70
|
-
|
|
70
|
+
d.value = d.value.filter((t) => t.id !== e), u.value === e && (u.value = _.value[0]?.id ?? "");
|
|
71
71
|
},
|
|
72
72
|
showTab(e) {
|
|
73
|
-
let t =
|
|
73
|
+
let t = d.value.find((t) => t.id === e);
|
|
74
74
|
t && (t.visible = !0);
|
|
75
75
|
},
|
|
76
76
|
hideTab(e) {
|
|
77
|
-
let t =
|
|
77
|
+
let t = d.value.find((t) => t.id === e);
|
|
78
78
|
t && (t.visible = !1);
|
|
79
79
|
},
|
|
80
80
|
selectTab(e) {
|
|
81
|
-
|
|
81
|
+
u.value = e;
|
|
82
82
|
},
|
|
83
83
|
addGroup(e, t) {
|
|
84
|
-
let n =
|
|
85
|
-
n && (n.groups ??= [],
|
|
84
|
+
let n = d.value.find((t) => t.id === e);
|
|
85
|
+
n && (n.groups ??= [], X(t), n.groups.push(ce(t)));
|
|
86
86
|
},
|
|
87
87
|
removeGroup(e, t) {
|
|
88
|
-
let n =
|
|
88
|
+
let n = d.value.find((t) => t.id === e);
|
|
89
89
|
n?.groups && (n.groups = n.groups.filter((e) => e.id !== t));
|
|
90
90
|
},
|
|
91
91
|
showGroup(e, t) {
|
|
92
|
-
let n =
|
|
92
|
+
let n = d.value.find((t) => t.id === e)?.groups?.find((e) => e.id === t);
|
|
93
93
|
n && (n.visible = !0);
|
|
94
94
|
},
|
|
95
95
|
hideGroup(e, t) {
|
|
96
|
-
let n =
|
|
96
|
+
let n = d.value.find((t) => t.id === e)?.groups?.find((e) => e.id === t);
|
|
97
97
|
n && (n.visible = !1);
|
|
98
98
|
},
|
|
99
99
|
addItem(e, t, n, r) {
|
|
100
|
-
|
|
100
|
+
Z(d.value, e, t, n, (e) => e.push(J(r)));
|
|
101
101
|
},
|
|
102
102
|
removeItem(e, t, n, r) {
|
|
103
|
-
|
|
103
|
+
Z(d.value, e, t, n, (e) => {
|
|
104
104
|
let t = e.findIndex((e) => e.id === r);
|
|
105
105
|
t >= 0 && e.splice(t, 1);
|
|
106
106
|
});
|
|
107
107
|
},
|
|
108
108
|
updateItem(e, t, n, r, i) {
|
|
109
|
-
|
|
109
|
+
Z(d.value, e, t, n, (e) => {
|
|
110
110
|
let t = e.find((e) => e.id === r);
|
|
111
111
|
t && Object.assign(t, i);
|
|
112
112
|
});
|
|
113
113
|
},
|
|
114
114
|
enableItem(e, t, n, r) {
|
|
115
|
-
|
|
115
|
+
v.updateItem(e, t, n, r, { disabled: !1 });
|
|
116
116
|
},
|
|
117
117
|
disableItem(e, t, n, r) {
|
|
118
|
-
|
|
118
|
+
v.updateItem(e, t, n, r, { disabled: !0 });
|
|
119
119
|
},
|
|
120
120
|
refreshLayout() {
|
|
121
|
-
|
|
121
|
+
f.value = !1;
|
|
122
122
|
},
|
|
123
123
|
minimize(e) {
|
|
124
|
-
|
|
124
|
+
l.value = e;
|
|
125
125
|
},
|
|
126
126
|
toggleSimplified() {
|
|
127
|
-
|
|
127
|
+
c.value = c.value === "classic" ? "simplified" : "classic";
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
return {
|
|
131
131
|
context: {
|
|
132
132
|
id: e,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
disabled: s,
|
|
134
|
+
layout: c,
|
|
135
|
+
minimized: l,
|
|
136
|
+
activeTab: u,
|
|
137
|
+
tabs: d,
|
|
138
|
+
overflowOpen: f,
|
|
139
|
+
backdropOpen: p,
|
|
140
|
+
keyTipsOpen: m,
|
|
141
|
+
keyTips: h,
|
|
142
|
+
keyTipsSequence: g,
|
|
142
143
|
registerKeyTip: (e) => {
|
|
143
|
-
|
|
144
|
+
h.value.some((t) => t.id === e.id) || h.value.push(e);
|
|
144
145
|
},
|
|
145
146
|
unregisterKeyTip: (e) => {
|
|
146
|
-
|
|
147
|
+
h.value = h.value.filter((t) => t.id !== e);
|
|
147
148
|
},
|
|
148
|
-
api:
|
|
149
|
+
api: v
|
|
149
150
|
},
|
|
150
|
-
visibleTabs:
|
|
151
|
+
visibleTabs: _
|
|
151
152
|
};
|
|
152
153
|
}
|
|
153
154
|
//#endregion
|
|
154
155
|
//#region src/ribbon/modules/RibbonBackstage.vue?vue&type=script&setup=true&lang.ts
|
|
155
|
-
var
|
|
156
|
+
var de = { class: "ml-ribbon-backstage__nav" }, fe = { class: "ml-ribbon-backstage__content" }, pe = { key: 0 }, me = { key: 1 }, he = /* @__PURE__ */ l({
|
|
156
157
|
__name: "RibbonBackstage",
|
|
157
158
|
props: {
|
|
158
159
|
open: { type: Boolean },
|
|
@@ -167,7 +168,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
167
168
|
function d() {
|
|
168
169
|
u("close");
|
|
169
170
|
}
|
|
170
|
-
return (t, o) => (_(), n(T(
|
|
171
|
+
return (t, o) => (_(), n(T(M), {
|
|
171
172
|
"model-value": l.open,
|
|
172
173
|
size: "100%",
|
|
173
174
|
"with-header": !1,
|
|
@@ -181,98 +182,119 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
181
182
|
title: l.title,
|
|
182
183
|
description: l.description,
|
|
183
184
|
size: l.size
|
|
184
|
-
}) : (_(), i(e, { key: 1 }, [a("aside",
|
|
185
|
+
}) : (_(), i(e, { key: 1 }, [a("aside", de, [c(T(O), {
|
|
185
186
|
type: "primary",
|
|
186
187
|
onClick: d
|
|
187
188
|
}, {
|
|
188
189
|
default: D(() => [s(C(l.backLabel), 1)]),
|
|
189
190
|
_: 1
|
|
190
|
-
})]), a("section",
|
|
191
|
+
})]), a("section", fe, [l.title ? (_(), i("h2", pe, C(l.title), 1)) : r("", !0), l.description ? (_(), i("p", me, C(l.description), 1)) : r("", !0)])], 64))], 2)]),
|
|
191
192
|
_: 3
|
|
192
193
|
}, 8, ["model-value"]));
|
|
193
194
|
}
|
|
194
|
-
}),
|
|
195
|
+
}), ge = {
|
|
195
196
|
class: "ml-ribbon-tabs",
|
|
196
197
|
role: "tablist"
|
|
197
|
-
},
|
|
198
|
+
}, _e = [
|
|
199
|
+
"aria-selected",
|
|
200
|
+
"disabled",
|
|
201
|
+
"onClick"
|
|
202
|
+
], ve = /* @__PURE__ */ l({
|
|
198
203
|
__name: "RibbonTabs",
|
|
199
204
|
props: {
|
|
200
205
|
tabs: {},
|
|
201
|
-
activeTab: {}
|
|
206
|
+
activeTab: {},
|
|
207
|
+
disabled: { type: Boolean }
|
|
202
208
|
},
|
|
203
209
|
emits: ["select"],
|
|
204
210
|
setup(n, { emit: r }) {
|
|
205
211
|
let a = n, o = r, s = t(() => a.tabs.filter((e) => e.visible !== !1));
|
|
206
|
-
return (t, r) => (_(), i("div",
|
|
212
|
+
return (t, r) => (_(), i("div", ge, [(_(!0), i(e, null, b(s.value, (e) => (_(), i("button", {
|
|
207
213
|
key: e.id,
|
|
208
214
|
type: "button",
|
|
209
215
|
class: p(["ml-ribbon-tab", { "is-active": n.activeTab === e.id }]),
|
|
210
216
|
role: "tab",
|
|
211
217
|
"aria-selected": n.activeTab === e.id,
|
|
218
|
+
disabled: a.disabled,
|
|
212
219
|
onClick: (t) => o("select", e.id)
|
|
213
|
-
}, C(e.title), 11,
|
|
220
|
+
}, C(e.title), 11, _e))), 128))]));
|
|
214
221
|
}
|
|
215
|
-
}),
|
|
222
|
+
}), ye = { class: "ml-ribbon-contextual-tabs" }, be = { class: "ml-ribbon-contextual-tabs__normal" }, xe = { class: "ml-ribbon-contextual-tabs__ctx" }, Se = /* @__PURE__ */ l({
|
|
216
223
|
__name: "RibbonContextualTabs",
|
|
217
224
|
props: {
|
|
218
225
|
tabs: {},
|
|
219
226
|
activeTab: {},
|
|
227
|
+
disabled: { type: Boolean },
|
|
220
228
|
defaultContextualTitle: {}
|
|
221
229
|
},
|
|
222
230
|
emits: ["select"],
|
|
223
231
|
setup(t, { emit: n }) {
|
|
224
232
|
let r = t, o = n;
|
|
225
|
-
return (n, s) => (_(), i("div",
|
|
233
|
+
return (n, s) => (_(), i("div", ye, [a("div", be, [c(ve, {
|
|
226
234
|
tabs: r.tabs.filter((e) => !e.contextual),
|
|
227
235
|
"active-tab": t.activeTab,
|
|
236
|
+
disabled: r.disabled,
|
|
228
237
|
onSelect: s[0] ||= (e) => o("select", e)
|
|
229
|
-
}, null, 8, [
|
|
238
|
+
}, null, 8, [
|
|
239
|
+
"tabs",
|
|
240
|
+
"active-tab",
|
|
241
|
+
"disabled"
|
|
242
|
+
])]), a("div", xe, [(_(!0), i(e, null, b(r.tabs.filter((e) => e.contextual), (e) => (_(), i("section", {
|
|
230
243
|
key: e.id,
|
|
231
244
|
class: "ml-ribbon-contextual-tabs__block",
|
|
232
245
|
style: m({ "--ctx-color": e.contextualColor || "#67c23a" })
|
|
233
|
-
}, [a("small", null, C(e.contextualTitle || r.defaultContextualTitle), 1), c(
|
|
246
|
+
}, [a("small", null, C(e.contextualTitle || r.defaultContextualTitle), 1), c(ve, {
|
|
234
247
|
tabs: [e],
|
|
235
248
|
"active-tab": t.activeTab,
|
|
249
|
+
disabled: r.disabled,
|
|
236
250
|
onSelect: s[1] ||= (e) => o("select", e)
|
|
237
|
-
}, null, 8, [
|
|
251
|
+
}, null, 8, [
|
|
252
|
+
"tabs",
|
|
253
|
+
"active-tab",
|
|
254
|
+
"disabled"
|
|
255
|
+
])], 4))), 128))])]));
|
|
238
256
|
}
|
|
239
|
-
}),
|
|
257
|
+
}), Ce = ["disabled"], we = /* @__PURE__ */ l({
|
|
240
258
|
__name: "RibbonFileMenu",
|
|
241
259
|
props: {
|
|
242
260
|
items: {},
|
|
243
261
|
label: {},
|
|
244
262
|
openBackstageLabel: {},
|
|
245
|
-
showOpenBackstage: { type: Boolean }
|
|
263
|
+
showOpenBackstage: { type: Boolean },
|
|
264
|
+
disabled: { type: Boolean }
|
|
246
265
|
},
|
|
247
266
|
emits: ["select", "open-backstage"],
|
|
248
267
|
setup(o, { emit: l }) {
|
|
249
|
-
let u =
|
|
250
|
-
function g(e) {
|
|
251
|
-
d.value = e;
|
|
252
|
-
}
|
|
268
|
+
let u = o, d = l, f = y(!1), m = ie("size", ""), h = t(() => m.value || "default"), g = t(() => `ml-ribbon-file-menu-dropdown ml-ribbon-popper ml-ribbon-popper--size-${h.value}`);
|
|
253
269
|
function v(e) {
|
|
270
|
+
f.value = e;
|
|
271
|
+
}
|
|
272
|
+
function x(e) {
|
|
254
273
|
if (e === "__backstage") {
|
|
255
|
-
|
|
274
|
+
d("open-backstage");
|
|
256
275
|
return;
|
|
257
276
|
}
|
|
258
|
-
|
|
277
|
+
d("select", e);
|
|
259
278
|
}
|
|
260
|
-
return (
|
|
279
|
+
return E(() => u.disabled, (e) => {
|
|
280
|
+
e && (f.value = !1);
|
|
281
|
+
}), (t, o) => (_(), n(T(N), {
|
|
261
282
|
trigger: "click",
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
283
|
+
disabled: u.disabled,
|
|
284
|
+
"popper-class": g.value,
|
|
285
|
+
onCommand: x,
|
|
286
|
+
onVisibleChange: v
|
|
265
287
|
}, {
|
|
266
|
-
dropdown: D(() => [c(T(
|
|
267
|
-
default: D(() => [
|
|
288
|
+
dropdown: D(() => [c(T(F), null, {
|
|
289
|
+
default: D(() => [u.showOpenBackstage === !1 ? r("", !0) : (_(), n(T(P), {
|
|
268
290
|
key: 0,
|
|
269
291
|
command: "__backstage"
|
|
270
292
|
}, {
|
|
271
|
-
default: D(() => [s(C(
|
|
293
|
+
default: D(() => [s(C(u.openBackstageLabel), 1)]),
|
|
272
294
|
_: 1
|
|
273
|
-
})), (_(!0), i(e, null, b(
|
|
295
|
+
})), (_(!0), i(e, null, b(u.items, (e, t) => (_(), n(T(P), {
|
|
274
296
|
key: e.id,
|
|
275
|
-
divided:
|
|
297
|
+
divided: u.showOpenBackstage !== !1 && t === 0,
|
|
276
298
|
command: e.id,
|
|
277
299
|
disabled: e.disabled
|
|
278
300
|
}, {
|
|
@@ -287,12 +309,13 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
287
309
|
})]),
|
|
288
310
|
default: D(() => [a("button", {
|
|
289
311
|
type: "button",
|
|
290
|
-
class: p(["ml-ribbon-tab ml-ribbon-tab--file", { "is-active":
|
|
291
|
-
|
|
312
|
+
class: p(["ml-ribbon-tab ml-ribbon-tab--file", { "is-active": f.value }]),
|
|
313
|
+
disabled: u.disabled
|
|
314
|
+
}, C(u.label), 11, Ce)]),
|
|
292
315
|
_: 1
|
|
293
|
-
}, 8, ["popper-class"]));
|
|
316
|
+
}, 8, ["disabled", "popper-class"]));
|
|
294
317
|
}
|
|
295
|
-
}),
|
|
318
|
+
}), Te = /* @__PURE__ */ l({
|
|
296
319
|
__name: "RibbonCollection",
|
|
297
320
|
props: {
|
|
298
321
|
id: {},
|
|
@@ -306,10 +329,10 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
306
329
|
style: m(r.value)
|
|
307
330
|
}, [x(e.$slots, "default")], 6));
|
|
308
331
|
}
|
|
309
|
-
}),
|
|
332
|
+
}), Ee = {
|
|
310
333
|
key: 0,
|
|
311
334
|
class: "ml-ribbon-gallery__title"
|
|
312
|
-
},
|
|
335
|
+
}, De = { class: "ml-ribbon-gallery__categories" }, Oe = { class: "ml-ribbon-gallery__category-title" }, ke = { class: "ml-ribbon-gallery__grid" }, Ae = ["disabled", "onClick"], je = { class: "ml-ribbon-gallery__preview" }, Q = { class: "ml-ribbon-gallery__label" }, Me = /* @__PURE__ */ l({
|
|
313
336
|
__name: "RibbonGallery",
|
|
314
337
|
props: {
|
|
315
338
|
id: {},
|
|
@@ -327,27 +350,23 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
327
350
|
function l(e) {
|
|
328
351
|
o.disabled || (c.value = e, s("select", e));
|
|
329
352
|
}
|
|
330
|
-
return (n, s) => (_(), i("div", { class: p(["ml-ribbon-gallery", { "is-disabled": t.disabled }]) }, [t.label ? (_(), i("div",
|
|
353
|
+
return (n, s) => (_(), i("div", { class: p(["ml-ribbon-gallery", { "is-disabled": t.disabled }]) }, [t.label ? (_(), i("div", Ee, C(t.label), 1)) : r("", !0), a("div", De, [(_(!0), i(e, null, b(t.categories, (n) => (_(), i("section", {
|
|
331
354
|
key: n.id,
|
|
332
355
|
class: "ml-ribbon-gallery__category"
|
|
333
|
-
}, [a("h4",
|
|
356
|
+
}, [a("h4", Oe, C(n.title), 1), a("div", ke, [(_(!0), i(e, null, b(n.items, (e) => (_(), i("button", {
|
|
334
357
|
key: e.id,
|
|
335
358
|
type: "button",
|
|
336
359
|
class: p(["ml-ribbon-gallery__item", { "is-selected": c.value === e.id }]),
|
|
337
360
|
disabled: t.disabled,
|
|
338
361
|
onClick: (t) => l(e.id)
|
|
339
|
-
}, [a("div",
|
|
362
|
+
}, [a("div", je, C(e.preview ?? o.previewFallback), 1), a("div", Q, C(e.label), 1)], 10, Ae))), 128))])]))), 128))])], 2));
|
|
340
363
|
}
|
|
341
|
-
}),
|
|
342
|
-
__name: "
|
|
364
|
+
}), Ne = ["data-id"], $ = { class: "ml-ribbon-button-group__label" }, Pe = /* @__PURE__ */ l({
|
|
365
|
+
__name: "RibbonButtonGroup",
|
|
343
366
|
props: {
|
|
344
367
|
id: {},
|
|
345
368
|
label: {},
|
|
346
369
|
options: {},
|
|
347
|
-
multiple: {
|
|
348
|
-
type: Boolean,
|
|
349
|
-
default: !1
|
|
350
|
-
},
|
|
351
370
|
disabled: {
|
|
352
371
|
type: Boolean,
|
|
353
372
|
default: !1
|
|
@@ -355,27 +374,21 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
355
374
|
},
|
|
356
375
|
emits: ["change"],
|
|
357
376
|
setup(t, { emit: o }) {
|
|
358
|
-
let l = t, u = o
|
|
359
|
-
function
|
|
360
|
-
|
|
361
|
-
if (l.multiple) {
|
|
362
|
-
d.value.includes(e) ? d.value = d.value.filter((t) => t !== e) : d.value = [...d.value, e], u("change", d.value);
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
d.value = [e], u("change", e);
|
|
366
|
-
}
|
|
377
|
+
let l = t, u = o;
|
|
378
|
+
function d(e) {
|
|
379
|
+
l.disabled || u("change", e);
|
|
367
380
|
}
|
|
368
381
|
return (o, l) => (_(), i("div", {
|
|
369
|
-
class: "ml-ribbon-group
|
|
382
|
+
class: "ml-ribbon-button-group",
|
|
370
383
|
"data-id": t.id
|
|
371
|
-
}, [a("div",
|
|
372
|
-
default: D(() => [(_(!0), i(e, null, b(t.options, (e) => (_(), n(T(
|
|
384
|
+
}, [a("div", $, C(t.label), 1), c(T(k), null, {
|
|
385
|
+
default: D(() => [(_(!0), i(e, null, b(t.options, (e) => (_(), n(T(O), {
|
|
373
386
|
key: e.value,
|
|
374
387
|
disabled: t.disabled,
|
|
375
|
-
type:
|
|
376
|
-
onClick: (t) =>
|
|
388
|
+
type: "default",
|
|
389
|
+
onClick: (t) => d(e.value)
|
|
377
390
|
}, {
|
|
378
|
-
default: D(() => [e.icon ? (_(), n(T(
|
|
391
|
+
default: D(() => [e.icon ? (_(), n(T(I), {
|
|
379
392
|
key: 0,
|
|
380
393
|
class: "ml-ribbon-item-host__icon"
|
|
381
394
|
}, {
|
|
@@ -383,36 +396,137 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
383
396
|
_: 2
|
|
384
397
|
}, 1024)) : r("", !0), s(" " + C(e.label), 1)]),
|
|
385
398
|
_: 2
|
|
386
|
-
}, 1032, [
|
|
387
|
-
"disabled",
|
|
388
|
-
"type",
|
|
389
|
-
"onClick"
|
|
390
|
-
]))), 128))]),
|
|
399
|
+
}, 1032, ["disabled", "onClick"]))), 128))]),
|
|
391
400
|
_: 1
|
|
392
|
-
})], 8,
|
|
401
|
+
})], 8, Ne));
|
|
393
402
|
}
|
|
394
|
-
}),
|
|
403
|
+
}), Fe = ["data-id"], Ie = {
|
|
404
|
+
key: 0,
|
|
405
|
+
class: "ml-ribbon-segmented__label"
|
|
406
|
+
}, Le = ["data-option-value"], Re = {
|
|
407
|
+
key: 2,
|
|
408
|
+
class: "ml-ribbon-segmented__option-label"
|
|
409
|
+
}, ze = {
|
|
410
|
+
key: 3,
|
|
411
|
+
class: "ml-ribbon-segmented__option-sr-label"
|
|
412
|
+
}, Be = /* @__PURE__ */ l({
|
|
413
|
+
__name: "RibbonSegmented",
|
|
414
|
+
props: {
|
|
415
|
+
id: {},
|
|
416
|
+
label: { default: "" },
|
|
417
|
+
options: {},
|
|
418
|
+
modelValue: {
|
|
419
|
+
type: [
|
|
420
|
+
String,
|
|
421
|
+
Number,
|
|
422
|
+
Boolean
|
|
423
|
+
],
|
|
424
|
+
default: void 0
|
|
425
|
+
},
|
|
426
|
+
direction: { default: "horizontal" },
|
|
427
|
+
block: {
|
|
428
|
+
type: Boolean,
|
|
429
|
+
default: !1
|
|
430
|
+
},
|
|
431
|
+
disabled: {
|
|
432
|
+
type: Boolean,
|
|
433
|
+
default: !1
|
|
434
|
+
},
|
|
435
|
+
hideLabel: {
|
|
436
|
+
type: Boolean,
|
|
437
|
+
default: !1
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
emits: ["change"],
|
|
441
|
+
setup(e, { emit: o }) {
|
|
442
|
+
let s = e, l = o, u = t(() => s.label?.trim() ?? ""), d = t(() => !s.hideLabel && u.value.length > 0);
|
|
443
|
+
function f(e) {
|
|
444
|
+
return e;
|
|
445
|
+
}
|
|
446
|
+
function m(e) {
|
|
447
|
+
let t = f(e);
|
|
448
|
+
return t.label?.trim() || String(t.value);
|
|
449
|
+
}
|
|
450
|
+
function h(e) {
|
|
451
|
+
return f(e).icon ?? null;
|
|
452
|
+
}
|
|
453
|
+
function g(e) {
|
|
454
|
+
return f(e).iconClass ?? null;
|
|
455
|
+
}
|
|
456
|
+
function v(e) {
|
|
457
|
+
return !h(e) && !g(e);
|
|
458
|
+
}
|
|
459
|
+
function y(e) {
|
|
460
|
+
return String(f(e).value);
|
|
461
|
+
}
|
|
462
|
+
function b(e) {
|
|
463
|
+
l("change", e);
|
|
464
|
+
}
|
|
465
|
+
return (t, o) => (_(), i("div", {
|
|
466
|
+
class: "ml-ribbon-segmented",
|
|
467
|
+
"data-id": e.id
|
|
468
|
+
}, [d.value ? (_(), i("div", Ie, C(u.value), 1)) : r("", !0), c(T(L), {
|
|
469
|
+
class: "ml-ribbon-segmented__control",
|
|
470
|
+
options: e.options,
|
|
471
|
+
"model-value": e.modelValue,
|
|
472
|
+
direction: e.direction,
|
|
473
|
+
block: e.block,
|
|
474
|
+
disabled: e.disabled,
|
|
475
|
+
"aria-label": u.value || e.id,
|
|
476
|
+
onChange: b
|
|
477
|
+
}, {
|
|
478
|
+
default: D(({ item: e }) => [a("span", {
|
|
479
|
+
class: "ml-ribbon-segmented__option",
|
|
480
|
+
"data-option-value": y(e)
|
|
481
|
+
}, [h(e) ? (_(), n(T(I), {
|
|
482
|
+
key: 0,
|
|
483
|
+
class: "ml-ribbon-segmented__option-icon",
|
|
484
|
+
"aria-hidden": "true"
|
|
485
|
+
}, {
|
|
486
|
+
default: D(() => [(_(), n(S(h(e))))]),
|
|
487
|
+
_: 2
|
|
488
|
+
}, 1024)) : g(e) ? (_(), i("i", {
|
|
489
|
+
key: 1,
|
|
490
|
+
class: p(["ml-ribbon-segmented__option-icon ml-ribbon-item-host__icon--class", g(e)]),
|
|
491
|
+
"aria-hidden": "true"
|
|
492
|
+
}, null, 2)) : r("", !0), v(e) ? (_(), i("span", Re, C(m(e)), 1)) : (_(), i("span", ze, C(m(e)), 1))], 8, Le)]),
|
|
493
|
+
_: 1
|
|
494
|
+
}, 8, [
|
|
495
|
+
"options",
|
|
496
|
+
"model-value",
|
|
497
|
+
"direction",
|
|
498
|
+
"block",
|
|
499
|
+
"disabled",
|
|
500
|
+
"aria-label"
|
|
501
|
+
])], 8, Fe));
|
|
502
|
+
}
|
|
503
|
+
}), Ve = ["data-template-id", "aria-disabled"], He = /* @__PURE__ */ l({
|
|
395
504
|
__name: "RibbonTemplateItem",
|
|
396
505
|
props: {
|
|
397
506
|
id: {},
|
|
398
|
-
item: {}
|
|
507
|
+
item: {},
|
|
508
|
+
disabled: { type: Boolean }
|
|
399
509
|
},
|
|
400
510
|
setup(e) {
|
|
401
511
|
return (t, n) => (_(), i("div", {
|
|
402
512
|
class: "ml-ribbon-template-item",
|
|
403
|
-
"data-template-id": e.id
|
|
404
|
-
|
|
513
|
+
"data-template-id": e.id,
|
|
514
|
+
"aria-disabled": e.disabled
|
|
515
|
+
}, [x(t.$slots, "default", {
|
|
516
|
+
item: e.item,
|
|
517
|
+
disabled: e.disabled
|
|
518
|
+
}, () => [a("span", null, C(e.item.label ?? e.item.id), 1)])], 8, Ve));
|
|
405
519
|
}
|
|
406
|
-
}),
|
|
520
|
+
}), Ue = ["data-item-id"], We = {
|
|
407
521
|
key: 0,
|
|
408
522
|
class: "ml-ribbon-item-host__keytip"
|
|
409
|
-
},
|
|
523
|
+
}, Ge = { class: "ml-ribbon-item-host__content" }, Ke = { class: "ml-ribbon-item-host__text-row" }, qe = {
|
|
410
524
|
key: 0,
|
|
411
525
|
class: "ml-ribbon-item-host__label"
|
|
412
|
-
},
|
|
526
|
+
}, Je = { class: "ml-ribbon-dropdown-item__content" }, Ye = { class: "ml-ribbon-dropdown-item__label" }, Xe = {
|
|
413
527
|
key: 2,
|
|
414
528
|
class: "ml-ribbon-item-host__label"
|
|
415
|
-
},
|
|
529
|
+
}, Ze = /* @__PURE__ */ l({
|
|
416
530
|
__name: "RibbonItemHost",
|
|
417
531
|
props: {
|
|
418
532
|
id: {},
|
|
@@ -422,74 +536,97 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
422
536
|
},
|
|
423
537
|
emits: ["item-click"],
|
|
424
538
|
setup(o, { emit: l }) {
|
|
425
|
-
let d = o, f = l, m = u(se, null), h = t(() => Array.isArray(d.item.props?.options) ? d.item.props.options : []), g = ie("size", ""), v = t(() => g.value || "default"), w = t(() => `ml-ribbon-dropdown-menu ml-ribbon-popper ml-ribbon-popper--size-${v.value}`), E = t(() => `ml-ribbon-select-dropdown ml-ribbon-popper ml-ribbon-popper--size-${v.value}`),
|
|
539
|
+
let d = o, f = l, m = u(se, null), h = t(() => Array.isArray(d.item.props?.options) ? d.item.props.options : []), g = ie("size", ""), v = t(() => g.value || "default"), w = t(() => `ml-ribbon-dropdown-menu ml-ribbon-popper ml-ribbon-popper--size-${v.value}`), E = t(() => `ml-ribbon-select-dropdown ml-ribbon-popper ml-ribbon-popper--size-${v.value}`), k = t(() => d.item.props?.icon || (typeof d.item.icon == "string" || !d.item.icon ? null : d.item.icon)), te = t(() => {
|
|
426
540
|
let e = d.item.props?.icon;
|
|
427
541
|
return typeof e == "string" && e.trim().length > 0 ? e : typeof d.item.icon == "string" && d.item.icon.trim().length > 0 ? d.item.icon : null;
|
|
428
|
-
}),
|
|
542
|
+
}), M = t(() => d.item.hideLabel !== !0), re = t(() => d.item.label || d.item.id), L = t(() => d.item.keyTip?.trim().toUpperCase() ?? ""), z = t(() => d.item.props?.syncLabelWithSelection === !0), B = y(!1), ae = y(void 0), U = t(() => h.value.find((e) => me(e) === ae.value) ?? null), oe = t(() => {
|
|
429
543
|
let e = U.value;
|
|
430
|
-
if (e &&
|
|
431
|
-
let t =
|
|
544
|
+
if (e && z.value) {
|
|
545
|
+
let t = he(e);
|
|
432
546
|
if (t) return t;
|
|
433
547
|
}
|
|
434
548
|
return d.item.label ?? d.item.id;
|
|
435
549
|
}), W = t(() => {
|
|
436
550
|
if (U.value) {
|
|
437
|
-
let e =
|
|
551
|
+
let e = fe(U.value);
|
|
438
552
|
if (e) return e;
|
|
439
553
|
}
|
|
440
|
-
return
|
|
554
|
+
return k.value;
|
|
441
555
|
}), G = t(() => {
|
|
442
556
|
if (U.value) {
|
|
443
|
-
let e =
|
|
557
|
+
let e = pe(U.value);
|
|
444
558
|
if (e) return e;
|
|
445
559
|
}
|
|
446
|
-
return W.value ? null :
|
|
447
|
-
}),
|
|
448
|
-
if (!m?.keyTipsOpen.value || !
|
|
560
|
+
return W.value ? null : te.value;
|
|
561
|
+
}), K = t(() => {
|
|
562
|
+
if (!m?.keyTipsOpen.value || m?.disabled.value || !L.value) return !1;
|
|
449
563
|
let e = m.keyTipsSequence.value.toLowerCase();
|
|
450
|
-
return e ?
|
|
451
|
-
});
|
|
452
|
-
function
|
|
453
|
-
f("item-click", d.id);
|
|
454
|
-
}
|
|
455
|
-
function q(e) {
|
|
456
|
-
V.value = e;
|
|
564
|
+
return e ? L.value.toLowerCase().startsWith(e) : !0;
|
|
565
|
+
}), q = t(() => d.item.disabled === !0 || m?.disabled.value === !0);
|
|
566
|
+
function J() {
|
|
567
|
+
q.value || f("item-click", d.id);
|
|
457
568
|
}
|
|
458
|
-
function
|
|
459
|
-
|
|
569
|
+
function ce(e) {
|
|
570
|
+
if (q.value) {
|
|
571
|
+
B.value = !1;
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
B.value = e;
|
|
460
575
|
}
|
|
461
|
-
function Y() {
|
|
462
|
-
|
|
576
|
+
function Y(e) {
|
|
577
|
+
q.value || (ae.value = e, Z(e), B.value = !1);
|
|
463
578
|
}
|
|
464
579
|
function le() {
|
|
580
|
+
q.value || (B.value = !B.value);
|
|
581
|
+
}
|
|
582
|
+
function X() {
|
|
583
|
+
if (q.value) return;
|
|
465
584
|
let e = U.value;
|
|
466
585
|
if (!e) {
|
|
467
|
-
|
|
586
|
+
J();
|
|
468
587
|
return;
|
|
469
588
|
}
|
|
470
|
-
|
|
589
|
+
Z(me(e));
|
|
471
590
|
}
|
|
472
|
-
function
|
|
591
|
+
function Z(e) {
|
|
473
592
|
if (typeof e == "string" || typeof e == "number") {
|
|
474
593
|
f("item-click", String(e));
|
|
475
594
|
return;
|
|
476
595
|
}
|
|
477
|
-
|
|
596
|
+
J();
|
|
478
597
|
}
|
|
479
598
|
function ue(e) {
|
|
599
|
+
if (!q.value) {
|
|
600
|
+
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") {
|
|
601
|
+
f("item-click", String(e));
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
J();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function de(e) {
|
|
608
|
+
if (!q.value) {
|
|
609
|
+
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") {
|
|
610
|
+
f("item-click", String(e));
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
J();
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function fe(e) {
|
|
480
617
|
if (!e || typeof e != "object") return null;
|
|
481
618
|
let t = e.icon;
|
|
482
619
|
return !t || typeof t == "string" ? null : t;
|
|
483
620
|
}
|
|
484
|
-
function
|
|
621
|
+
function pe(e) {
|
|
485
622
|
if (!e || typeof e != "object") return null;
|
|
486
623
|
let t = e.icon;
|
|
487
624
|
return typeof t != "string" || t.trim().length === 0 ? null : t;
|
|
488
625
|
}
|
|
489
|
-
function
|
|
626
|
+
function me(e) {
|
|
490
627
|
if (!(!e || typeof e != "object")) return e.value;
|
|
491
628
|
}
|
|
492
|
-
function
|
|
629
|
+
function he(e) {
|
|
493
630
|
if (!e || typeof e != "object") return;
|
|
494
631
|
let t = e.label;
|
|
495
632
|
return typeof t == "string" ? t : void 0;
|
|
@@ -502,140 +639,167 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
502
639
|
]]),
|
|
503
640
|
"data-item-id": o.id,
|
|
504
641
|
role: "group"
|
|
505
|
-
}, [
|
|
642
|
+
}, [K.value ? (_(), i("span", We, C(L.value), 1)) : r("", !0), o.item.type === "buttonGroup" ? (_(), n(Pe, {
|
|
506
643
|
key: 1,
|
|
507
644
|
id: o.item.id,
|
|
508
645
|
label: o.item.label ?? "",
|
|
509
646
|
options: o.item.props?.options ?? [],
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
onChange: K
|
|
647
|
+
disabled: q.value,
|
|
648
|
+
onChange: de
|
|
513
649
|
}, null, 8, [
|
|
514
650
|
"id",
|
|
515
651
|
"label",
|
|
516
652
|
"options",
|
|
517
|
-
"multiple",
|
|
518
653
|
"disabled"
|
|
519
|
-
])) : o.item.type === "
|
|
654
|
+
])) : o.item.type === "segmented" ? (_(), n(Be, {
|
|
520
655
|
key: 2,
|
|
521
656
|
id: o.item.id,
|
|
657
|
+
label: o.item.label ?? o.item.id,
|
|
658
|
+
options: o.item.props?.options ?? [],
|
|
659
|
+
"model-value": o.item.props?.modelValue,
|
|
660
|
+
direction: o.item.props?.direction ?? "horizontal",
|
|
661
|
+
block: o.item.props?.block === !0,
|
|
662
|
+
disabled: q.value,
|
|
663
|
+
"hide-label": o.item.hideLabel === !0,
|
|
664
|
+
onChange: ue
|
|
665
|
+
}, null, 8, [
|
|
666
|
+
"id",
|
|
667
|
+
"label",
|
|
668
|
+
"options",
|
|
669
|
+
"model-value",
|
|
670
|
+
"direction",
|
|
671
|
+
"block",
|
|
672
|
+
"disabled",
|
|
673
|
+
"hide-label"
|
|
674
|
+
])) : o.item.type === "gallery" ? (_(), n(Me, {
|
|
675
|
+
key: 3,
|
|
676
|
+
id: o.item.id,
|
|
522
677
|
label: o.item.label ?? "",
|
|
523
678
|
categories: o.item.props?.categories ?? [],
|
|
524
679
|
"preview-fallback": d.galleryPreviewFallback,
|
|
525
|
-
disabled:
|
|
526
|
-
onSelect:
|
|
680
|
+
disabled: q.value,
|
|
681
|
+
onSelect: J
|
|
527
682
|
}, null, 8, [
|
|
528
683
|
"id",
|
|
529
684
|
"label",
|
|
530
685
|
"categories",
|
|
531
686
|
"preview-fallback",
|
|
532
687
|
"disabled"
|
|
533
|
-
])) : o.item.type === "template" ? (_(), n(
|
|
534
|
-
key:
|
|
688
|
+
])) : o.item.type === "template" ? (_(), n(He, {
|
|
689
|
+
key: 4,
|
|
535
690
|
id: o.item.id,
|
|
536
|
-
item: o.item
|
|
691
|
+
item: o.item,
|
|
692
|
+
disabled: q.value
|
|
537
693
|
}, {
|
|
538
|
-
default: D(() => [x(t.$slots, "template", {
|
|
694
|
+
default: D(() => [x(t.$slots, "template", {
|
|
695
|
+
item: o.item,
|
|
696
|
+
disabled: q.value
|
|
697
|
+
})]),
|
|
539
698
|
_: 3
|
|
540
|
-
}, 8, [
|
|
541
|
-
|
|
699
|
+
}, 8, [
|
|
700
|
+
"id",
|
|
701
|
+
"item",
|
|
702
|
+
"disabled"
|
|
703
|
+
])) : o.item.type === "dropdown" ? (_(), n(T(N), {
|
|
704
|
+
key: 5,
|
|
542
705
|
trigger: "click",
|
|
543
|
-
disabled:
|
|
706
|
+
disabled: q.value,
|
|
544
707
|
"popper-class": w.value,
|
|
545
|
-
onVisibleChange:
|
|
546
|
-
onCommand:
|
|
708
|
+
onVisibleChange: ce,
|
|
709
|
+
onCommand: Y
|
|
547
710
|
}, {
|
|
548
|
-
dropdown: D(() => [c(T(
|
|
549
|
-
default: D(() => [(_(!0), i(e, null, b(h.value, (e) => (_(), n(T(
|
|
711
|
+
dropdown: D(() => [c(T(F), null, {
|
|
712
|
+
default: D(() => [(_(!0), i(e, null, b(h.value, (e) => (_(), n(T(P), {
|
|
550
713
|
key: String(e.value),
|
|
551
714
|
command: e.value
|
|
552
715
|
}, {
|
|
553
|
-
default: D(() => [a("span",
|
|
716
|
+
default: D(() => [a("span", Je, [fe(e) ? (_(), n(T(I), {
|
|
554
717
|
key: 0,
|
|
555
718
|
class: "ml-ribbon-dropdown-item__icon"
|
|
556
719
|
}, {
|
|
557
|
-
default: D(() => [(_(), n(S(
|
|
720
|
+
default: D(() => [(_(), n(S(fe(e))))]),
|
|
558
721
|
_: 2
|
|
559
|
-
}, 1024)) :
|
|
722
|
+
}, 1024)) : pe(e) ? (_(), i("i", {
|
|
560
723
|
key: 1,
|
|
561
|
-
class: p(["ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class",
|
|
724
|
+
class: p(["ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class", pe(e)]),
|
|
562
725
|
"aria-hidden": "true"
|
|
563
|
-
}, null, 2)) : r("", !0), a("span",
|
|
726
|
+
}, null, 2)) : r("", !0), a("span", Ye, C(e.label), 1)])]),
|
|
564
727
|
_: 2
|
|
565
728
|
}, 1032, ["command"]))), 128))]),
|
|
566
729
|
_: 1
|
|
567
730
|
})]),
|
|
568
|
-
default: D(() => [c(T(
|
|
731
|
+
default: D(() => [c(T(O), {
|
|
569
732
|
type: "default",
|
|
570
|
-
|
|
571
|
-
|
|
733
|
+
disabled: q.value,
|
|
734
|
+
"aria-label": re.value,
|
|
735
|
+
onClick: le
|
|
572
736
|
}, {
|
|
573
|
-
default: D(() => [a("span",
|
|
737
|
+
default: D(() => [a("span", Ge, [W.value ? (_(), i("span", {
|
|
574
738
|
key: 0,
|
|
575
739
|
class: "ml-ribbon-item-host__icon ml-ribbon-item-host__icon--dropdown-primary",
|
|
576
|
-
onClick:
|
|
577
|
-
}, [c(T(
|
|
740
|
+
onClick: ee(X, ["stop"])
|
|
741
|
+
}, [c(T(I), null, {
|
|
578
742
|
default: D(() => [(_(), n(S(W.value)))]),
|
|
579
743
|
_: 1
|
|
580
744
|
})])) : G.value ? (_(), i("span", {
|
|
581
745
|
key: 1,
|
|
582
746
|
class: "ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class ml-ribbon-item-host__icon--dropdown-primary",
|
|
583
|
-
onClick:
|
|
747
|
+
onClick: ee(X, ["stop"])
|
|
584
748
|
}, [a("i", {
|
|
585
749
|
class: p(G.value),
|
|
586
750
|
"aria-hidden": "true"
|
|
587
|
-
}, null, 2)])) : r("", !0), a("span",
|
|
588
|
-
default: D(() => [(_(), n(S(
|
|
751
|
+
}, null, 2)])) : r("", !0), a("span", Ke, [M.value ? (_(), i("span", qe, C(oe.value), 1)) : r("", !0), c(T(I), { class: p(["ml-ribbon-item-host__dropdown-arrow", { "is-open": B.value }]) }, {
|
|
752
|
+
default: D(() => [(_(), n(S(B.value ? T(H) : T(V))))]),
|
|
589
753
|
_: 1
|
|
590
754
|
}, 8, ["class"])])])]),
|
|
591
755
|
_: 1
|
|
592
|
-
}, 8, ["aria-label"])]),
|
|
756
|
+
}, 8, ["disabled", "aria-label"])]),
|
|
593
757
|
_: 1
|
|
594
|
-
}, 8, ["disabled", "popper-class"])) : o.item.type === "checkbox" ? (_(), n(T(
|
|
595
|
-
key:
|
|
596
|
-
disabled:
|
|
597
|
-
onChange:
|
|
758
|
+
}, 8, ["disabled", "popper-class"])) : o.item.type === "checkbox" ? (_(), n(T(A), {
|
|
759
|
+
key: 6,
|
|
760
|
+
disabled: q.value,
|
|
761
|
+
onChange: J
|
|
598
762
|
}, {
|
|
599
763
|
default: D(() => [s(C(o.item.label), 1)]),
|
|
600
764
|
_: 1
|
|
601
|
-
}, 8, ["disabled"])) : o.item.type === "colorPicker" ? (_(), n(T(
|
|
602
|
-
key: 6,
|
|
603
|
-
disabled: o.item.disabled,
|
|
604
|
-
onChange: K
|
|
605
|
-
}, null, 8, ["disabled"])) : o.item.type === "comboBox" ? (_(), n(T(R), {
|
|
765
|
+
}, 8, ["disabled"])) : o.item.type === "colorPicker" ? (_(), n(T(j), {
|
|
606
766
|
key: 7,
|
|
607
|
-
disabled:
|
|
767
|
+
disabled: q.value,
|
|
768
|
+
onChange: J
|
|
769
|
+
}, null, 8, ["disabled"])) : o.item.type === "comboBox" ? (_(), n(T(R), {
|
|
770
|
+
key: 8,
|
|
771
|
+
disabled: q.value,
|
|
608
772
|
"popper-class": E.value,
|
|
609
773
|
style: { width: "92px" },
|
|
610
|
-
onChange:
|
|
774
|
+
onChange: J
|
|
611
775
|
}, {
|
|
612
|
-
default: D(() => [(_(!0), i(e, null, b(h.value, (e) => (_(), n(T(
|
|
776
|
+
default: D(() => [(_(!0), i(e, null, b(h.value, (e) => (_(), n(T(ne), {
|
|
613
777
|
key: String(e.value),
|
|
614
778
|
label: String(e.label),
|
|
615
779
|
value: e.value
|
|
616
780
|
}, null, 8, ["label", "value"]))), 128))]),
|
|
617
781
|
_: 1
|
|
618
|
-
}, 8, ["disabled", "popper-class"])) : (_(), n(T(
|
|
619
|
-
key:
|
|
620
|
-
disabled:
|
|
621
|
-
"aria-label":
|
|
622
|
-
onClick:
|
|
782
|
+
}, 8, ["disabled", "popper-class"])) : (_(), n(T(O), {
|
|
783
|
+
key: 9,
|
|
784
|
+
disabled: q.value,
|
|
785
|
+
"aria-label": re.value,
|
|
786
|
+
onClick: J
|
|
623
787
|
}, {
|
|
624
|
-
default: D(() => [
|
|
788
|
+
default: D(() => [k.value ? (_(), n(T(I), {
|
|
625
789
|
key: 0,
|
|
626
790
|
class: "ml-ribbon-item-host__icon"
|
|
627
791
|
}, {
|
|
628
|
-
default: D(() => [(_(), n(S(
|
|
792
|
+
default: D(() => [(_(), n(S(k.value)))]),
|
|
629
793
|
_: 1
|
|
630
|
-
})) :
|
|
794
|
+
})) : te.value ? (_(), i("i", {
|
|
631
795
|
key: 1,
|
|
632
|
-
class: p(["ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class",
|
|
796
|
+
class: p(["ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class", te.value]),
|
|
633
797
|
"aria-hidden": "true"
|
|
634
|
-
}, null, 2)) : r("", !0),
|
|
798
|
+
}, null, 2)) : r("", !0), M.value ? (_(), i("span", Xe, C(o.item.label ?? o.item.id), 1)) : r("", !0)]),
|
|
635
799
|
_: 1
|
|
636
|
-
}, 8, ["disabled", "aria-label"]))], 10,
|
|
800
|
+
}, 8, ["disabled", "aria-label"]))], 10, Ue));
|
|
637
801
|
}
|
|
638
|
-
}),
|
|
802
|
+
}), Qe = /* @__PURE__ */ l({
|
|
639
803
|
__name: "RibbonGroupContent",
|
|
640
804
|
props: {
|
|
641
805
|
group: {},
|
|
@@ -644,28 +808,27 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
644
808
|
emits: ["item-click"],
|
|
645
809
|
setup(t, { emit: r }) {
|
|
646
810
|
let a = t, o = r;
|
|
647
|
-
return (t, r) => (_(), i("div", { class: p(["ml-ribbon-group__content", [`ml-ribbon-group__content--${a.group.orientation ?? "column"}`]]) }, [(_(!0), i(e, null, b(a.group.collections ?? [], (t) => (_(), n(
|
|
811
|
+
return (t, r) => (_(), i("div", { class: p(["ml-ribbon-group__content", [`ml-ribbon-group__content--${a.group.orientation ?? "column"}`]]) }, [(_(!0), i(e, null, b(a.group.collections ?? [], (t) => (_(), n(Te, {
|
|
648
812
|
id: t.id,
|
|
649
813
|
key: t.id,
|
|
650
814
|
layout: t.layout ?? (a.group.orientation === "row" ? "row" : "column"),
|
|
651
815
|
rows: t.rows
|
|
652
816
|
}, {
|
|
653
|
-
default: D(() => [(_(!0), i(e, null, b(t.items, (e) => (_(), n(
|
|
817
|
+
default: D(() => [(_(!0), i(e, null, b(t.items, (e) => (_(), n(Ze, {
|
|
654
818
|
id: e.id,
|
|
655
819
|
key: e.id,
|
|
656
820
|
item: e,
|
|
657
821
|
"group-id": a.group.id,
|
|
658
822
|
"gallery-preview-fallback": a.galleryPreviewFallback,
|
|
659
|
-
onItemClick: (
|
|
823
|
+
onItemClick: r[0] ||= (e) => o("item-click", {
|
|
660
824
|
groupId: a.group.id,
|
|
661
|
-
itemId: e
|
|
825
|
+
itemId: e
|
|
662
826
|
})
|
|
663
827
|
}, null, 8, [
|
|
664
828
|
"id",
|
|
665
829
|
"item",
|
|
666
830
|
"group-id",
|
|
667
|
-
"gallery-preview-fallback"
|
|
668
|
-
"onItemClick"
|
|
831
|
+
"gallery-preview-fallback"
|
|
669
832
|
]))), 128))]),
|
|
670
833
|
_: 2
|
|
671
834
|
}, 1032, [
|
|
@@ -674,7 +837,15 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
674
837
|
"rows"
|
|
675
838
|
]))), 128))], 2));
|
|
676
839
|
}
|
|
677
|
-
}),
|
|
840
|
+
}), $e = ["data-priority"], et = { class: "ml-ribbon-group__body" }, tt = { class: "ml-ribbon-group__footer" }, nt = { class: "ml-ribbon-group__title" }, rt = [
|
|
841
|
+
"aria-label",
|
|
842
|
+
"aria-expanded",
|
|
843
|
+
"disabled"
|
|
844
|
+
], it = { class: "ml-ribbon-group__overflow-content" }, at = [
|
|
845
|
+
"aria-label",
|
|
846
|
+
"aria-expanded",
|
|
847
|
+
"disabled"
|
|
848
|
+
], ot = { class: "ml-ribbon-group__overflow-content" }, st = /* @__PURE__ */ l({
|
|
678
849
|
__name: "RibbonGroup",
|
|
679
850
|
props: {
|
|
680
851
|
id: {},
|
|
@@ -692,15 +863,15 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
692
863
|
},
|
|
693
864
|
emits: ["item-click"],
|
|
694
865
|
setup(e, { emit: o }) {
|
|
695
|
-
let s = e, l = o, u = t(() => s.autoWidth !== !1), d = y(null),
|
|
866
|
+
let s = e, l = o, d = u(se, null), m = t(() => s.autoWidth !== !1), v = t(() => d?.disabled.value === !0), b = y(null), w = y([]), ee = y(null), k = y(null), A = y(0), j = y(0), te = ie("size", ""), M = t(() => te.value || "default"), N = t(() => `ml-ribbon-group__overflow-popover ml-ribbon-group__overflow-popover--size-${M.value}`), P = t(() => ({ modifiers: [{
|
|
696
867
|
name: "offset",
|
|
697
|
-
options: { offset: [
|
|
698
|
-
}] })),
|
|
868
|
+
options: { offset: [A.value, 8] }
|
|
869
|
+
}] })), F = t(() => ({ modifiers: [{
|
|
699
870
|
name: "offset",
|
|
700
|
-
options: { offset: [
|
|
701
|
-
}] })),
|
|
702
|
-
if (!s.groupModel || !
|
|
703
|
-
let e = new Set(
|
|
871
|
+
options: { offset: [j.value, 8] }
|
|
872
|
+
}] })), ne = t(() => !s.icon || typeof s.icon == "string" ? null : s.icon), L = t(() => w.value.length > 0), R = t(() => (s.groupModel?.footerMenuItems?.length ?? 0) > 0), z = y(!1), B = y(!1), ae = t(() => {
|
|
873
|
+
if (!s.groupModel || !w.value.length) return null;
|
|
874
|
+
let e = new Set(w.value), t = s.groupModel.collections?.map((t) => ({
|
|
704
875
|
...t,
|
|
705
876
|
items: t.items.filter((t) => e.has(t.id))
|
|
706
877
|
})).filter((e) => e.items.length > 0) ?? [];
|
|
@@ -708,7 +879,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
708
879
|
...s.groupModel,
|
|
709
880
|
collections: t
|
|
710
881
|
} : null;
|
|
711
|
-
}),
|
|
882
|
+
}), U = t(() => s.groupModel?.footerMenuItems?.length ? {
|
|
712
883
|
id: `${s.groupModel.id}-footer-menu`,
|
|
713
884
|
title: "",
|
|
714
885
|
orientation: "row",
|
|
@@ -718,15 +889,15 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
718
889
|
items: s.groupModel.footerMenuItems
|
|
719
890
|
}]
|
|
720
891
|
} : null);
|
|
721
|
-
function
|
|
722
|
-
let e =
|
|
892
|
+
function oe() {
|
|
893
|
+
let e = b.value?.querySelector(".ml-ribbon-group__content");
|
|
723
894
|
if (!e) {
|
|
724
|
-
|
|
895
|
+
w.value.length > 0 && (w.value = []);
|
|
725
896
|
return;
|
|
726
897
|
}
|
|
727
898
|
let t = e.getBoundingClientRect();
|
|
728
899
|
if (t.width <= 0 || t.height <= 0) {
|
|
729
|
-
|
|
900
|
+
w.value.length > 0 && (w.value = []);
|
|
730
901
|
return;
|
|
731
902
|
}
|
|
732
903
|
let n = [];
|
|
@@ -735,150 +906,162 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
735
906
|
if (!r) return;
|
|
736
907
|
let i = e.getBoundingClientRect();
|
|
737
908
|
(i.right - t.right > .5 || i.bottom - t.bottom > .5 || t.left - i.left > .5 || t.top - i.top > .5) && n.push(r);
|
|
738
|
-
}),
|
|
909
|
+
}), w.value.length === n.length && w.value.every((e, t) => e === n[t]) || (w.value = n);
|
|
739
910
|
}
|
|
740
|
-
function
|
|
911
|
+
function W() {
|
|
741
912
|
f(() => {
|
|
742
|
-
|
|
913
|
+
ue(), K(), q(), oe();
|
|
743
914
|
});
|
|
744
915
|
}
|
|
745
|
-
function
|
|
746
|
-
let e =
|
|
916
|
+
function K() {
|
|
917
|
+
let e = b.value?.getBoundingClientRect(), t = ee.value?.getBoundingClientRect();
|
|
747
918
|
if (!e || !t) {
|
|
748
|
-
|
|
919
|
+
A.value !== 0 && (A.value = 0);
|
|
749
920
|
return;
|
|
750
921
|
}
|
|
751
922
|
let n = Math.round(e.left - t.left);
|
|
752
|
-
|
|
923
|
+
A.value !== n && (A.value = n);
|
|
753
924
|
}
|
|
754
|
-
function
|
|
755
|
-
let e =
|
|
925
|
+
function q() {
|
|
926
|
+
let e = b.value?.getBoundingClientRect(), t = k.value?.getBoundingClientRect();
|
|
756
927
|
if (!e || !t) {
|
|
757
|
-
|
|
928
|
+
j.value !== 0 && (j.value = 0);
|
|
758
929
|
return;
|
|
759
930
|
}
|
|
760
931
|
let n = Math.round(e.left - t.left);
|
|
761
|
-
|
|
932
|
+
j.value !== n && (j.value = n);
|
|
762
933
|
}
|
|
763
|
-
function
|
|
764
|
-
|
|
934
|
+
function J(e) {
|
|
935
|
+
z.value = e;
|
|
765
936
|
}
|
|
766
|
-
function
|
|
767
|
-
|
|
937
|
+
function ce(e) {
|
|
938
|
+
B.value = e;
|
|
768
939
|
}
|
|
769
|
-
function
|
|
770
|
-
|
|
940
|
+
function Y() {
|
|
941
|
+
v.value || (z.value = !z.value);
|
|
771
942
|
}
|
|
772
|
-
function
|
|
773
|
-
|
|
943
|
+
function le() {
|
|
944
|
+
v.value || (B.value = !B.value);
|
|
774
945
|
}
|
|
775
|
-
let
|
|
776
|
-
function
|
|
777
|
-
if (!
|
|
778
|
-
let e =
|
|
779
|
-
|
|
946
|
+
let X = null, Z = null;
|
|
947
|
+
function ue() {
|
|
948
|
+
if (!X) return;
|
|
949
|
+
let e = b.value?.querySelector(".ml-ribbon-group__content") ?? null;
|
|
950
|
+
Z !== e && (Z && X.unobserve(Z), e && X.observe(e), Z = e);
|
|
780
951
|
}
|
|
781
952
|
return E(() => s.groupModel, () => {
|
|
782
|
-
|
|
783
|
-
}, { deep: !0 }),
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
953
|
+
W();
|
|
954
|
+
}, { deep: !0 }), E(v, (e) => {
|
|
955
|
+
e && (z.value = !1, B.value = !1);
|
|
956
|
+
}), h(() => {
|
|
957
|
+
typeof ResizeObserver < "u" && (X = new ResizeObserver(() => {
|
|
958
|
+
K(), q(), oe();
|
|
959
|
+
}), b.value && X.observe(b.value), ue()), W();
|
|
787
960
|
}), g(() => {
|
|
788
|
-
|
|
961
|
+
X?.disconnect();
|
|
789
962
|
}), (t, o) => (_(), i("section", {
|
|
790
963
|
ref_key: "groupSectionRef",
|
|
791
|
-
ref:
|
|
792
|
-
class: p(["ml-ribbon-group", { "ml-ribbon-group--auto-width":
|
|
964
|
+
ref: b,
|
|
965
|
+
class: p(["ml-ribbon-group", { "ml-ribbon-group--auto-width": m.value }]),
|
|
793
966
|
"data-priority": e.priority ?? 100
|
|
794
|
-
}, [a("div",
|
|
795
|
-
|
|
967
|
+
}, [a("div", et, [x(t.$slots, "default")]), a("footer", tt, [
|
|
968
|
+
ne.value ? (_(), n(T(I), {
|
|
796
969
|
key: 0,
|
|
797
970
|
class: "ml-ribbon-group__icon"
|
|
798
971
|
}, {
|
|
799
|
-
default: D(() => [(_(), n(S(
|
|
972
|
+
default: D(() => [(_(), n(S(ne.value)))]),
|
|
800
973
|
_: 1
|
|
801
974
|
})) : r("", !0),
|
|
802
|
-
a("span",
|
|
803
|
-
|
|
975
|
+
a("span", nt, C(e.title), 1),
|
|
976
|
+
R.value && U.value ? (_(), n(T(re), {
|
|
804
977
|
key: 1,
|
|
805
978
|
trigger: "click",
|
|
806
979
|
placement: "bottom-start",
|
|
807
|
-
|
|
808
|
-
"popper-
|
|
809
|
-
|
|
810
|
-
|
|
980
|
+
disabled: v.value,
|
|
981
|
+
"popper-class": N.value,
|
|
982
|
+
"popper-options": F.value,
|
|
983
|
+
onShow: o[1] ||= (e) => J(!0),
|
|
984
|
+
onHide: o[2] ||= (e) => J(!1)
|
|
811
985
|
}, {
|
|
812
986
|
reference: D(() => [a("button", {
|
|
813
987
|
ref_key: "footerTriggerRef",
|
|
814
|
-
ref:
|
|
988
|
+
ref: k,
|
|
815
989
|
type: "button",
|
|
816
|
-
class: p(["ml-ribbon-group__footer-trigger", { "is-open":
|
|
990
|
+
class: p(["ml-ribbon-group__footer-trigger", { "is-open": z.value }]),
|
|
817
991
|
"aria-label": e.overflowTriggerAriaLabel,
|
|
818
|
-
"aria-expanded":
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
992
|
+
"aria-expanded": z.value,
|
|
993
|
+
disabled: v.value,
|
|
994
|
+
onClick: Y
|
|
995
|
+
}, [c(T(I), null, {
|
|
996
|
+
default: D(() => [(_(), n(S(z.value ? T(H) : T(V))))]),
|
|
822
997
|
_: 1
|
|
823
|
-
})], 10,
|
|
824
|
-
default: D(() => [a("div",
|
|
825
|
-
group:
|
|
998
|
+
})], 10, rt)]),
|
|
999
|
+
default: D(() => [a("div", it, [c(Qe, {
|
|
1000
|
+
group: U.value,
|
|
826
1001
|
"gallery-preview-fallback": e.galleryPreviewFallback,
|
|
827
1002
|
onItemClick: o[0] ||= (e) => l("item-click", e)
|
|
828
1003
|
}, null, 8, ["group", "gallery-preview-fallback"])])]),
|
|
829
1004
|
_: 1
|
|
830
|
-
}, 8, [
|
|
831
|
-
|
|
1005
|
+
}, 8, [
|
|
1006
|
+
"disabled",
|
|
1007
|
+
"popper-class",
|
|
1008
|
+
"popper-options"
|
|
1009
|
+
])) : r("", !0),
|
|
1010
|
+
L.value && ae.value ? (_(), n(T(re), {
|
|
832
1011
|
key: 2,
|
|
833
1012
|
trigger: "click",
|
|
834
1013
|
placement: "bottom-start",
|
|
835
|
-
|
|
836
|
-
"popper-
|
|
837
|
-
|
|
838
|
-
|
|
1014
|
+
disabled: v.value,
|
|
1015
|
+
"popper-class": N.value,
|
|
1016
|
+
"popper-options": P.value,
|
|
1017
|
+
onShow: o[4] ||= (e) => ce(!0),
|
|
1018
|
+
onHide: o[5] ||= (e) => ce(!1)
|
|
839
1019
|
}, {
|
|
840
1020
|
reference: D(() => [a("button", {
|
|
841
1021
|
ref_key: "overflowTriggerRef",
|
|
842
|
-
ref:
|
|
1022
|
+
ref: ee,
|
|
843
1023
|
type: "button",
|
|
844
|
-
class: p(["ml-ribbon-group__overflow-trigger", { "is-open":
|
|
1024
|
+
class: p(["ml-ribbon-group__overflow-trigger", { "is-open": B.value }]),
|
|
845
1025
|
"aria-label": e.overflowTriggerAriaLabel,
|
|
846
|
-
"aria-expanded":
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
1026
|
+
"aria-expanded": B.value,
|
|
1027
|
+
disabled: v.value,
|
|
1028
|
+
onClick: le
|
|
1029
|
+
}, [c(T(I), null, {
|
|
1030
|
+
default: D(() => [(_(), n(S(B.value ? T(H) : T(V))))]),
|
|
850
1031
|
_: 1
|
|
851
|
-
})], 10,
|
|
852
|
-
default: D(() => [a("div",
|
|
853
|
-
group:
|
|
1032
|
+
})], 10, at)]),
|
|
1033
|
+
default: D(() => [a("div", ot, [c(Qe, {
|
|
1034
|
+
group: ae.value,
|
|
854
1035
|
"gallery-preview-fallback": e.galleryPreviewFallback,
|
|
855
1036
|
onItemClick: o[3] ||= (e) => l("item-click", e)
|
|
856
1037
|
}, null, 8, ["group", "gallery-preview-fallback"])])]),
|
|
857
1038
|
_: 1
|
|
858
|
-
}, 8, [
|
|
859
|
-
|
|
1039
|
+
}, 8, [
|
|
1040
|
+
"disabled",
|
|
1041
|
+
"popper-class",
|
|
1042
|
+
"popper-options"
|
|
1043
|
+
])) : r("", !0),
|
|
1044
|
+
e.showLauncherIcon ?? e.launcher ? (_(), n(T(O), {
|
|
860
1045
|
key: 3,
|
|
861
1046
|
link: "",
|
|
862
|
-
class: "ml-ribbon-group__launcher"
|
|
1047
|
+
class: "ml-ribbon-group__launcher",
|
|
1048
|
+
disabled: v.value
|
|
863
1049
|
}, {
|
|
864
|
-
default: D(() => [c(T(
|
|
865
|
-
default: D(() => [c(T(
|
|
1050
|
+
default: D(() => [c(T(I), null, {
|
|
1051
|
+
default: D(() => [c(T(G))]),
|
|
866
1052
|
_: 1
|
|
867
1053
|
})]),
|
|
868
1054
|
_: 1
|
|
869
|
-
})) : r("", !0)
|
|
870
|
-
])], 10,
|
|
1055
|
+
}, 8, ["disabled"])) : r("", !0)
|
|
1056
|
+
])], 10, $e));
|
|
871
1057
|
}
|
|
872
|
-
}),
|
|
1058
|
+
}), ct = ["inert", "aria-disabled"], lt = { class: "ml-ribbon__header" }, ut = { class: "ml-ribbon__head-left" }, dt = { class: "ml-ribbon__head-right" }, ft = {
|
|
873
1059
|
key: 2,
|
|
874
1060
|
class: "ml-ribbon__tabs-extra"
|
|
875
|
-
},
|
|
1061
|
+
}, pt = ["data-active-tab"], mt = {
|
|
876
1062
|
key: 0,
|
|
877
1063
|
class: "ml-ribbon-group ml-ribbon-group--overflow"
|
|
878
|
-
},
|
|
879
|
-
class: "ml-ribbon-simplified-group",
|
|
880
|
-
type: "button"
|
|
881
|
-
}, ft = { class: "ml-ribbon-simplified-group__panel" }, pt = 40, mt = /* @__PURE__ */ l({
|
|
1064
|
+
}, ht = { class: "ml-ribbon-group__body ml-ribbon-group__body--overflow" }, gt = ["aria-label", "disabled"], _t = { class: "ml-ribbon-overflow-list" }, vt = { class: "ml-ribbon-overflow-group__header" }, yt = ["data-active-tab"], bt = ["disabled"], xt = { class: "ml-ribbon-simplified-group__panel" }, St = 40, Ct = /* @__PURE__ */ l({
|
|
882
1065
|
__name: "Ribbon",
|
|
883
1066
|
props: {
|
|
884
1067
|
id: { default: "ml-ribbon-root" },
|
|
@@ -891,6 +1074,10 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
891
1074
|
type: Boolean,
|
|
892
1075
|
default: !1
|
|
893
1076
|
},
|
|
1077
|
+
disabled: {
|
|
1078
|
+
type: Boolean,
|
|
1079
|
+
default: !1
|
|
1080
|
+
},
|
|
894
1081
|
hideLayoutSwitcher: {
|
|
895
1082
|
type: Boolean,
|
|
896
1083
|
default: !1
|
|
@@ -931,7 +1118,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
931
1118
|
function m(e) {
|
|
932
1119
|
return e == null || typeof e == "string" ? e : typeof e == "object" || typeof e == "function" ? d(w(e)) : e;
|
|
933
1120
|
}
|
|
934
|
-
function
|
|
1121
|
+
function ee(e) {
|
|
935
1122
|
if (!e) return;
|
|
936
1123
|
let t = { ...e };
|
|
937
1124
|
return "icon" in t && (t.icon = m(t.icon)), Array.isArray(t.options) && (t.options = t.options.map((e) => {
|
|
@@ -943,31 +1130,31 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
943
1130
|
} : t;
|
|
944
1131
|
})), t;
|
|
945
1132
|
}
|
|
946
|
-
function
|
|
1133
|
+
function k(e) {
|
|
947
1134
|
return {
|
|
948
1135
|
...e,
|
|
949
1136
|
icon: m(e.icon),
|
|
950
|
-
props:
|
|
1137
|
+
props: ee(e.props)
|
|
951
1138
|
};
|
|
952
1139
|
}
|
|
953
|
-
function
|
|
1140
|
+
function A(e) {
|
|
954
1141
|
return {
|
|
955
1142
|
...e,
|
|
956
1143
|
icon: m(e.icon),
|
|
957
|
-
footerMenuItems: e.footerMenuItems?.map(
|
|
1144
|
+
footerMenuItems: e.footerMenuItems?.map(k),
|
|
958
1145
|
collections: e.collections?.map((e) => ({
|
|
959
1146
|
...e,
|
|
960
|
-
items: e.items?.map(
|
|
1147
|
+
items: e.items?.map(k)
|
|
961
1148
|
}))
|
|
962
1149
|
};
|
|
963
1150
|
}
|
|
964
|
-
function
|
|
1151
|
+
function j(e) {
|
|
965
1152
|
return e.map((e) => ({
|
|
966
1153
|
...e,
|
|
967
|
-
groups: e.groups?.map(
|
|
1154
|
+
groups: e.groups?.map(A)
|
|
968
1155
|
}));
|
|
969
1156
|
}
|
|
970
|
-
let
|
|
1157
|
+
let M = {
|
|
971
1158
|
layoutSwitcherTooltip: "Switch ribbon layout",
|
|
972
1159
|
minimizeTooltip: "Minimize ribbon",
|
|
973
1160
|
keyTipsToggleText: "Key Tips",
|
|
@@ -982,56 +1169,58 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
982
1169
|
keyTipsEmptySequence: "No key sequence",
|
|
983
1170
|
contextualTabDefaultTitle: "Contextual",
|
|
984
1171
|
galleryPreviewFallback: "Preview unavailable"
|
|
985
|
-
},
|
|
986
|
-
v(se,
|
|
987
|
-
|
|
988
|
-
}, { deep: !0 }), E(() =>
|
|
989
|
-
e !==
|
|
990
|
-
}), E(() =>
|
|
1172
|
+
}, N = s, P = u, { context: F, visibleTabs: ne } = ue(N.id, N.tabs, N.disabled, N.activeLayout ? String(N.activeLayout).toLowerCase() === "simplified" ? "simplified" : "classic" : N.layout, N.minimized, N.activeTab || N.tabs[0]?.id || "");
|
|
1173
|
+
v(se, F), E(() => N.tabs, (e) => {
|
|
1174
|
+
F.tabs.value = j(e), F.tabs.value.some((e) => e.id === F.activeTab.value) || (F.activeTab.value = F.tabs.value[0]?.id || "");
|
|
1175
|
+
}, { deep: !0 }), E(() => N.layout, (e) => {
|
|
1176
|
+
e !== F.layout.value && (F.layout.value = e);
|
|
1177
|
+
}), E(() => N.activeLayout, (e) => {
|
|
991
1178
|
if (!e) return;
|
|
992
1179
|
let t = String(e).toLowerCase() === "simplified" ? "simplified" : "classic";
|
|
993
|
-
t !==
|
|
994
|
-
}), E(() =>
|
|
995
|
-
e !==
|
|
996
|
-
}), E(() =>
|
|
997
|
-
e
|
|
998
|
-
}), E(
|
|
999
|
-
|
|
1000
|
-
}), E(
|
|
1001
|
-
|
|
1002
|
-
}), E(
|
|
1003
|
-
|
|
1004
|
-
}), E(
|
|
1005
|
-
|
|
1006
|
-
}), E(
|
|
1007
|
-
|
|
1180
|
+
t !== F.layout.value && (F.layout.value = t);
|
|
1181
|
+
}), E(() => N.minimized, (e) => {
|
|
1182
|
+
e !== F.minimized.value && (F.minimized.value = e);
|
|
1183
|
+
}), E(() => N.disabled, (e) => {
|
|
1184
|
+
e !== F.disabled.value && (F.disabled.value = e);
|
|
1185
|
+
}), E(() => N.activeTab, (e) => {
|
|
1186
|
+
e && e !== F.activeTab.value && (F.activeTab.value = e);
|
|
1187
|
+
}), E(F.activeTab, (e) => {
|
|
1188
|
+
P("update:activeTab", e), P("tabChange", e);
|
|
1189
|
+
}), E(F.layout, (e) => {
|
|
1190
|
+
P("update:layout", e), P("layoutChange", e);
|
|
1191
|
+
}), E(F.minimized, (e) => {
|
|
1192
|
+
P("update:minimized", e);
|
|
1193
|
+
}), E(F.overflowOpen, (e) => {
|
|
1194
|
+
P(e ? "overflowOpen" : "overflowClose");
|
|
1195
|
+
}), E(F.backdropOpen, (e) => {
|
|
1196
|
+
P(e ? "backstageOpen" : "backstageClose");
|
|
1008
1197
|
});
|
|
1009
|
-
let
|
|
1010
|
-
layoutSwitcherTooltip:
|
|
1011
|
-
minimizeTooltip:
|
|
1012
|
-
keyTipsToggleText:
|
|
1013
|
-
overflowTriggerAriaLabel:
|
|
1014
|
-
groupOverflowTriggerAriaLabel:
|
|
1015
|
-
fileMenuLabel:
|
|
1016
|
-
fileMenuOpenBackstageLabel:
|
|
1017
|
-
backstageBackLabel:
|
|
1018
|
-
backstageTitle:
|
|
1019
|
-
backstageDescription:
|
|
1020
|
-
keyTipsSequencePrefix:
|
|
1021
|
-
keyTipsEmptySequence:
|
|
1022
|
-
contextualTabDefaultTitle:
|
|
1023
|
-
galleryPreviewFallback:
|
|
1024
|
-
})), le = t(() =>
|
|
1198
|
+
let L = t(() => ne.value.find((e) => e.id === F.activeTab.value)), R = t(() => L.value?.groups?.filter((e) => e.visible !== !1) ?? []), V = y(null), H = y(/* @__PURE__ */ new Set()), G = y({}), K = ie("size", ""), q = t(() => N.size || K.value || "default"), J = t(() => `ml-ribbon-group-popover ml-ribbon-group-popover--size-${q.value}`), ce = t(() => `ml-ribbon-overflow-popover ml-ribbon-overflow-popover--size-${q.value}`), Y = t(() => ({
|
|
1199
|
+
layoutSwitcherTooltip: N.texts.layoutSwitcherTooltip || M.layoutSwitcherTooltip,
|
|
1200
|
+
minimizeTooltip: N.texts.minimizeTooltip || M.minimizeTooltip,
|
|
1201
|
+
keyTipsToggleText: N.texts.keyTipsToggleText || M.keyTipsToggleText,
|
|
1202
|
+
overflowTriggerAriaLabel: N.texts.overflowTriggerAriaLabel || M.overflowTriggerAriaLabel,
|
|
1203
|
+
groupOverflowTriggerAriaLabel: N.texts.groupOverflowTriggerAriaLabel || M.groupOverflowTriggerAriaLabel,
|
|
1204
|
+
fileMenuLabel: N.texts.fileMenuLabel || M.fileMenuLabel,
|
|
1205
|
+
fileMenuOpenBackstageLabel: N.texts.fileMenuOpenBackstageLabel || M.fileMenuOpenBackstageLabel,
|
|
1206
|
+
backstageBackLabel: N.texts.backstageBackLabel || M.backstageBackLabel,
|
|
1207
|
+
backstageTitle: N.texts.backstageTitle || M.backstageTitle,
|
|
1208
|
+
backstageDescription: N.texts.backstageDescription || M.backstageDescription,
|
|
1209
|
+
keyTipsSequencePrefix: N.texts.keyTipsSequencePrefix || M.keyTipsSequencePrefix,
|
|
1210
|
+
keyTipsEmptySequence: N.texts.keyTipsEmptySequence || M.keyTipsEmptySequence,
|
|
1211
|
+
contextualTabDefaultTitle: N.texts.contextualTabDefaultTitle || M.contextualTabDefaultTitle,
|
|
1212
|
+
galleryPreviewFallback: N.texts.galleryPreviewFallback || M.galleryPreviewFallback
|
|
1213
|
+
})), le = t(() => F.minimized.value ? U : ae), X = t(() => R.value.filter((e) => !H.value.has(e.id))), Z = t(() => R.value.filter((e) => H.value.has(e.id))), de = t(() => {
|
|
1025
1214
|
if (!Z.value.length) return 220;
|
|
1026
1215
|
let e = Z.value.reduce((e, t) => {
|
|
1027
|
-
let n = G.value[t.id] ??
|
|
1216
|
+
let n = G.value[t.id] ?? me(t);
|
|
1028
1217
|
return Math.max(e, n);
|
|
1029
1218
|
}, 0), t = Math.ceil(e + 40);
|
|
1030
1219
|
return Math.max(220, Math.min(720, t));
|
|
1031
1220
|
});
|
|
1032
1221
|
function fe(e) {
|
|
1033
1222
|
let t = (e.collections ?? []).flatMap((e) => (e.items ?? []).map((e) => ({
|
|
1034
|
-
...
|
|
1223
|
+
...k(e),
|
|
1035
1224
|
size: "medium"
|
|
1036
1225
|
})));
|
|
1037
1226
|
return {
|
|
@@ -1047,7 +1236,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1047
1236
|
function pe(e) {
|
|
1048
1237
|
return e.priority ?? 100;
|
|
1049
1238
|
}
|
|
1050
|
-
function
|
|
1239
|
+
function me(e) {
|
|
1051
1240
|
return e.autoWidth === !1 ? 190 : 140;
|
|
1052
1241
|
}
|
|
1053
1242
|
function ge(e) {
|
|
@@ -1061,18 +1250,18 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1061
1250
|
}
|
|
1062
1251
|
function _e(e) {
|
|
1063
1252
|
let t = Number.parseFloat(getComputedStyle(e).getPropertyValue("--ml-rb-overflow-slot-width"));
|
|
1064
|
-
return Number.isFinite(t) && t > 0 ? t :
|
|
1253
|
+
return Number.isFinite(t) && t > 0 ? t : St;
|
|
1065
1254
|
}
|
|
1066
1255
|
function ve() {
|
|
1067
|
-
if (
|
|
1068
|
-
|
|
1256
|
+
if (F.layout.value !== "classic") {
|
|
1257
|
+
H.value = /* @__PURE__ */ new Set();
|
|
1069
1258
|
return;
|
|
1070
1259
|
}
|
|
1071
|
-
let e =
|
|
1260
|
+
let e = V.value;
|
|
1072
1261
|
if (!e) return;
|
|
1073
|
-
let t =
|
|
1262
|
+
let t = R.value;
|
|
1074
1263
|
if (!t.length) {
|
|
1075
|
-
|
|
1264
|
+
H.value = /* @__PURE__ */ new Set();
|
|
1076
1265
|
return;
|
|
1077
1266
|
}
|
|
1078
1267
|
let n = Math.round(e.getBoundingClientRect().width), r = _e(e), i = ge(e);
|
|
@@ -1086,60 +1275,67 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1086
1275
|
})), s = /* @__PURE__ */ new Set(), c = [...o].sort((e, t) => {
|
|
1087
1276
|
let n = pe(t.group) - pe(e.group);
|
|
1088
1277
|
return n === 0 ? t.index - e.index : n;
|
|
1089
|
-
}), l = (e) => i[e.id] ??
|
|
1278
|
+
}), l = (e) => i[e.id] ?? me(e), u = a.reduce((e, t) => e + l(t), 0), d = (e) => o.filter(({ group: t }) => !e.has(t.id)).reduce((e, { group: t }) => e + l(t), 0), f = (e) => u + d(e) + (e.size > 0 ? r : 0), p = 0;
|
|
1090
1279
|
for (; f(s) > n && p < c.length;) {
|
|
1091
1280
|
let e = c[p].group;
|
|
1092
1281
|
s.add(e.id), p += 1;
|
|
1093
1282
|
}
|
|
1094
|
-
|
|
1283
|
+
H.value = s;
|
|
1095
1284
|
}
|
|
1096
1285
|
function ye() {
|
|
1097
1286
|
f(() => {
|
|
1098
|
-
if (
|
|
1287
|
+
if (F.layout.value !== "classic" || F.minimized.value) {
|
|
1099
1288
|
ve();
|
|
1100
1289
|
return;
|
|
1101
1290
|
}
|
|
1102
|
-
if (
|
|
1291
|
+
if (H.value.size === 0) {
|
|
1103
1292
|
ve();
|
|
1104
1293
|
return;
|
|
1105
1294
|
}
|
|
1106
|
-
|
|
1295
|
+
H.value = /* @__PURE__ */ new Set(), f(() => {
|
|
1107
1296
|
ve();
|
|
1108
1297
|
});
|
|
1109
1298
|
});
|
|
1110
1299
|
}
|
|
1111
1300
|
function be(e) {
|
|
1112
|
-
|
|
1301
|
+
F.disabled.value || (F.activeTab.value = e);
|
|
1113
1302
|
}
|
|
1114
|
-
function
|
|
1115
|
-
|
|
1303
|
+
function xe() {
|
|
1304
|
+
F.disabled.value || F.api.toggleSimplified();
|
|
1116
1305
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1306
|
+
function Ce() {
|
|
1307
|
+
F.disabled.value || (F.minimized.value = !F.minimized.value);
|
|
1119
1308
|
}
|
|
1120
1309
|
function Te(e) {
|
|
1121
|
-
|
|
1310
|
+
F.disabled.value || P("fileMenuSelect", e);
|
|
1122
1311
|
}
|
|
1123
1312
|
function Ee() {
|
|
1124
|
-
|
|
1313
|
+
F.disabled.value || (F.backdropOpen.value = !0);
|
|
1314
|
+
}
|
|
1315
|
+
function De() {
|
|
1316
|
+
F.disabled.value || (F.backdropOpen.value = !1);
|
|
1125
1317
|
}
|
|
1126
|
-
function
|
|
1127
|
-
|
|
1128
|
-
tabId:
|
|
1318
|
+
function Oe(e, t) {
|
|
1319
|
+
F.disabled.value || P("itemClick", {
|
|
1320
|
+
tabId: F.activeTab.value,
|
|
1129
1321
|
groupId: e,
|
|
1130
1322
|
itemId: t
|
|
1131
1323
|
});
|
|
1132
1324
|
}
|
|
1133
|
-
function
|
|
1325
|
+
function ke(e) {
|
|
1134
1326
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1135
1327
|
if (e.isContentEditable) return !0;
|
|
1136
1328
|
let t = e.tagName;
|
|
1137
1329
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT";
|
|
1138
1330
|
}
|
|
1139
|
-
function
|
|
1140
|
-
|
|
1331
|
+
function Ae() {
|
|
1332
|
+
if (F.disabled.value) {
|
|
1333
|
+
F.keyTips.value = [];
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
let e = L.value;
|
|
1141
1337
|
if (!e?.groups?.length) {
|
|
1142
|
-
|
|
1338
|
+
F.keyTips.value = [];
|
|
1143
1339
|
return;
|
|
1144
1340
|
}
|
|
1145
1341
|
let t = e.groups.filter((e) => e.visible !== !1).flatMap((t) => (t.collections ?? []).flatMap((n) => n.items.filter((e) => e.keyTip && e.disabled !== !0).map((n) => {
|
|
@@ -1152,166 +1348,192 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1152
1348
|
scope: "item"
|
|
1153
1349
|
} : null;
|
|
1154
1350
|
}).filter((e) => !!e)));
|
|
1155
|
-
|
|
1351
|
+
F.keyTips.value = t;
|
|
1156
1352
|
}
|
|
1157
|
-
function
|
|
1158
|
-
|
|
1353
|
+
function je(e) {
|
|
1354
|
+
if (F.disabled.value) return;
|
|
1355
|
+
let t = L.value;
|
|
1159
1356
|
if (t?.groups?.length) {
|
|
1160
1357
|
for (let n of t.groups) if (n.visible !== !1) for (let t of n.collections ?? []) {
|
|
1161
1358
|
let r = t.items.find((t) => t.id === e.targetId && t.disabled !== !0);
|
|
1162
1359
|
if (r) {
|
|
1163
|
-
|
|
1360
|
+
Oe(n.id, r.id), F.keyTipsOpen.value = !1, F.keyTipsSequence.value = "";
|
|
1164
1361
|
return;
|
|
1165
1362
|
}
|
|
1166
1363
|
}
|
|
1167
1364
|
}
|
|
1168
1365
|
}
|
|
1169
1366
|
function Q() {
|
|
1170
|
-
|
|
1367
|
+
F.keyTipsSequence.value = "";
|
|
1171
1368
|
}
|
|
1172
|
-
function
|
|
1173
|
-
if (!
|
|
1369
|
+
function Me(e) {
|
|
1370
|
+
if (!F.disabled.value && !ke(e.target)) {
|
|
1174
1371
|
if (e.altKey && !e.ctrlKey && !e.metaKey && e.key === "Alt") {
|
|
1175
|
-
e.preventDefault(),
|
|
1372
|
+
e.preventDefault(), F.keyTipsOpen.value = !F.keyTipsOpen.value, F.keyTipsOpen.value || Q();
|
|
1176
1373
|
return;
|
|
1177
1374
|
}
|
|
1178
|
-
if (
|
|
1375
|
+
if (F.keyTipsOpen.value && !(e.altKey || e.ctrlKey || e.metaKey)) {
|
|
1179
1376
|
if (e.key === "Escape") {
|
|
1180
|
-
e.preventDefault(),
|
|
1377
|
+
e.preventDefault(), F.keyTipsOpen.value = !1, Q();
|
|
1181
1378
|
return;
|
|
1182
1379
|
}
|
|
1183
1380
|
if (e.key === "Backspace") {
|
|
1184
|
-
e.preventDefault(),
|
|
1381
|
+
e.preventDefault(), F.keyTipsSequence.value = F.keyTipsSequence.value.slice(0, -1);
|
|
1185
1382
|
return;
|
|
1186
1383
|
}
|
|
1187
1384
|
if (/^[a-z0-9]$/i.test(e.key)) {
|
|
1188
1385
|
e.preventDefault();
|
|
1189
|
-
let t = `${
|
|
1190
|
-
|
|
1191
|
-
let n = t.toLowerCase(), r =
|
|
1386
|
+
let t = `${F.keyTipsSequence.value}${e.key.toUpperCase()}`;
|
|
1387
|
+
F.keyTipsSequence.value = t;
|
|
1388
|
+
let n = t.toLowerCase(), r = F.keyTips.value.find((e) => e.key.toLowerCase() === n);
|
|
1192
1389
|
if (r) {
|
|
1193
|
-
|
|
1390
|
+
je(r);
|
|
1194
1391
|
return;
|
|
1195
1392
|
}
|
|
1196
|
-
|
|
1393
|
+
F.keyTips.value.some((e) => e.key.toLowerCase().startsWith(n)) || Q();
|
|
1197
1394
|
}
|
|
1198
1395
|
}
|
|
1199
1396
|
}
|
|
1200
1397
|
}
|
|
1201
|
-
function
|
|
1202
|
-
return e.icon && typeof e.icon != "string" ? e.icon : e.groupIconCss ?
|
|
1398
|
+
function Ne(e) {
|
|
1399
|
+
return e.icon && typeof e.icon != "string" ? e.icon : e.groupIconCss ? oe : null;
|
|
1203
1400
|
}
|
|
1204
1401
|
E([
|
|
1205
|
-
|
|
1206
|
-
() =>
|
|
1207
|
-
() =>
|
|
1402
|
+
R,
|
|
1403
|
+
() => F.layout.value,
|
|
1404
|
+
() => F.minimized.value
|
|
1208
1405
|
], () => {
|
|
1209
1406
|
ye();
|
|
1210
|
-
}), E([
|
|
1211
|
-
|
|
1407
|
+
}), E([
|
|
1408
|
+
L,
|
|
1409
|
+
() => F.tabs.value,
|
|
1410
|
+
() => F.disabled.value
|
|
1411
|
+
], () => {
|
|
1412
|
+
Ae(), Q();
|
|
1212
1413
|
}, {
|
|
1213
1414
|
deep: !0,
|
|
1214
1415
|
immediate: !0
|
|
1215
|
-
}), E(() =>
|
|
1416
|
+
}), E(() => F.keyTipsOpen.value, (e) => {
|
|
1216
1417
|
e || Q();
|
|
1217
|
-
}), E(
|
|
1418
|
+
}), E(() => F.disabled.value, (e) => {
|
|
1419
|
+
e && (F.overflowOpen.value = !1, F.backdropOpen.value = !1, F.keyTipsOpen.value = !1, Q());
|
|
1420
|
+
}), E(V, (e, t) => {
|
|
1218
1421
|
t && $ && $.unobserve(t), e && $ && $.observe(e);
|
|
1219
1422
|
}, { flush: "post" });
|
|
1220
1423
|
let $ = null;
|
|
1221
1424
|
return h(() => {
|
|
1222
|
-
window.addEventListener("keydown",
|
|
1425
|
+
window.addEventListener("keydown", Me), typeof ResizeObserver < "u" && ($ = new ResizeObserver(() => {
|
|
1223
1426
|
ye();
|
|
1224
|
-
}),
|
|
1427
|
+
}), V.value && $.observe(V.value)), ye();
|
|
1225
1428
|
}), g(() => {
|
|
1226
|
-
window.removeEventListener("keydown",
|
|
1227
|
-
}), l(
|
|
1228
|
-
default: D(() => [
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1429
|
+
window.removeEventListener("keydown", Me), $?.disconnect();
|
|
1430
|
+
}), l(F.api), (t, l) => (_(), n(T(te), { size: N.size }, {
|
|
1431
|
+
default: D(() => [(_(), i("section", {
|
|
1432
|
+
key: T(F).disabled.value ? "ml-ribbon-disabled" : "ml-ribbon-enabled",
|
|
1433
|
+
class: p(["ml-ribbon", [
|
|
1434
|
+
`ml-ribbon--${T(F).layout.value}`,
|
|
1435
|
+
`ml-ribbon--size-${q.value}`,
|
|
1436
|
+
{
|
|
1437
|
+
"ml-ribbon--disabled": T(F).disabled.value,
|
|
1438
|
+
"ml-ribbon--minimized": T(F).minimized.value,
|
|
1439
|
+
"ml-ribbon--keytips-open": T(F).keyTipsOpen.value
|
|
1440
|
+
}
|
|
1441
|
+
]]),
|
|
1442
|
+
inert: T(F).disabled.value,
|
|
1443
|
+
"aria-disabled": T(F).disabled.value
|
|
1444
|
+
}, [
|
|
1445
|
+
a("header", lt, [a("div", ut, [
|
|
1446
|
+
s.showFileMenu ? (_(), n(we, {
|
|
1238
1447
|
key: 0,
|
|
1239
1448
|
items: s.fileMenuItems,
|
|
1449
|
+
disabled: T(F).disabled.value,
|
|
1240
1450
|
label: Y.value.fileMenuLabel,
|
|
1241
1451
|
"open-backstage-label": Y.value.fileMenuOpenBackstageLabel,
|
|
1242
1452
|
"show-open-backstage": s.showOpenBackstage,
|
|
1243
1453
|
onSelect: Te,
|
|
1244
|
-
onOpenBackstage:
|
|
1454
|
+
onOpenBackstage: Ee
|
|
1245
1455
|
}, null, 8, [
|
|
1246
1456
|
"items",
|
|
1457
|
+
"disabled",
|
|
1247
1458
|
"label",
|
|
1248
1459
|
"open-backstage-label",
|
|
1249
1460
|
"show-open-backstage"
|
|
1250
1461
|
])) : r("", !0),
|
|
1251
|
-
c(
|
|
1252
|
-
tabs: T(
|
|
1253
|
-
"active-tab": T(
|
|
1462
|
+
c(Se, {
|
|
1463
|
+
tabs: T(ne),
|
|
1464
|
+
"active-tab": T(F).activeTab.value,
|
|
1465
|
+
disabled: T(F).disabled.value,
|
|
1254
1466
|
"default-contextual-title": Y.value.contextualTabDefaultTitle,
|
|
1255
1467
|
onSelect: be
|
|
1256
1468
|
}, null, 8, [
|
|
1257
1469
|
"tabs",
|
|
1258
1470
|
"active-tab",
|
|
1471
|
+
"disabled",
|
|
1259
1472
|
"default-contextual-title"
|
|
1260
1473
|
]),
|
|
1261
|
-
|
|
1474
|
+
N.hideMinimizeButton ? r("", !0) : (_(), n(T(B), {
|
|
1262
1475
|
key: 1,
|
|
1263
1476
|
content: Y.value.minimizeTooltip
|
|
1264
1477
|
}, {
|
|
1265
|
-
default: D(() => [c(T(
|
|
1478
|
+
default: D(() => [c(T(O), {
|
|
1266
1479
|
class: p([
|
|
1267
1480
|
"ml-ribbon__control",
|
|
1268
1481
|
"ml-ribbon__control--minimize",
|
|
1269
|
-
T(
|
|
1482
|
+
T(F).minimized.value ? "ml-ribbon__control--minimize-up" : "ml-ribbon__control--minimize-down"
|
|
1270
1483
|
]),
|
|
1271
1484
|
icon: le.value,
|
|
1272
|
-
|
|
1273
|
-
|
|
1485
|
+
disabled: T(F).disabled.value,
|
|
1486
|
+
onClick: Ce
|
|
1487
|
+
}, null, 8, [
|
|
1488
|
+
"class",
|
|
1489
|
+
"icon",
|
|
1490
|
+
"disabled"
|
|
1491
|
+
])]),
|
|
1274
1492
|
_: 1
|
|
1275
1493
|
}, 8, ["content"]))
|
|
1276
|
-
]), a("div",
|
|
1277
|
-
|
|
1494
|
+
]), a("div", dt, [
|
|
1495
|
+
N.hideLayoutSwitcher ? r("", !0) : (_(), n(T(B), {
|
|
1278
1496
|
key: 0,
|
|
1279
1497
|
content: Y.value.layoutSwitcherTooltip
|
|
1280
1498
|
}, {
|
|
1281
|
-
default: D(() => [c(T(
|
|
1499
|
+
default: D(() => [c(T(O), {
|
|
1282
1500
|
circle: "",
|
|
1283
1501
|
class: "ml-ribbon__control ml-ribbon__control--layout",
|
|
1284
|
-
icon: T(
|
|
1285
|
-
|
|
1286
|
-
|
|
1502
|
+
icon: T(W),
|
|
1503
|
+
disabled: T(F).disabled.value,
|
|
1504
|
+
onClick: xe
|
|
1505
|
+
}, null, 8, ["icon", "disabled"])]),
|
|
1287
1506
|
_: 1
|
|
1288
1507
|
}, 8, ["content"])),
|
|
1289
|
-
|
|
1508
|
+
N.hideKeyTipsToggle ? r("", !0) : (_(), n(T(z), {
|
|
1290
1509
|
key: 1,
|
|
1291
1510
|
"inline-prompt": "",
|
|
1292
1511
|
class: "ml-ribbon__control ml-ribbon__control--keytips",
|
|
1293
1512
|
"active-text": Y.value.keyTipsToggleText,
|
|
1294
1513
|
"inactive-text": Y.value.keyTipsToggleText,
|
|
1295
|
-
"model-value": T(
|
|
1296
|
-
|
|
1514
|
+
"model-value": T(F).keyTipsOpen.value,
|
|
1515
|
+
disabled: T(F).disabled.value,
|
|
1516
|
+
onChange: l[0] ||= (e) => T(F).keyTipsOpen.value = !T(F).keyTipsOpen.value
|
|
1297
1517
|
}, null, 8, [
|
|
1298
1518
|
"active-text",
|
|
1299
1519
|
"inactive-text",
|
|
1300
|
-
"model-value"
|
|
1520
|
+
"model-value",
|
|
1521
|
+
"disabled"
|
|
1301
1522
|
])),
|
|
1302
|
-
t.$slots["tabs-extra"] ? (_(), i("div",
|
|
1303
|
-
activeTab: T(
|
|
1304
|
-
layout: T(
|
|
1305
|
-
minimized: T(
|
|
1523
|
+
t.$slots["tabs-extra"] ? (_(), i("div", ft, [x(t.$slots, "tabs-extra", {
|
|
1524
|
+
activeTab: T(F).activeTab.value,
|
|
1525
|
+
layout: T(F).layout.value,
|
|
1526
|
+
minimized: T(F).minimized.value,
|
|
1527
|
+
disabled: T(F).disabled.value
|
|
1306
1528
|
})])) : r("", !0)
|
|
1307
1529
|
])]),
|
|
1308
|
-
!T(
|
|
1530
|
+
!T(F).minimized.value && L.value && T(F).layout.value === "classic" ? (_(), i("main", {
|
|
1309
1531
|
key: 0,
|
|
1310
1532
|
class: "ml-ribbon__panel",
|
|
1311
|
-
"data-active-tab":
|
|
1533
|
+
"data-active-tab": L.value.id,
|
|
1312
1534
|
ref_key: "classicPanelRef",
|
|
1313
|
-
ref:
|
|
1314
|
-
}, [(_(!0), i(e, null, b(X.value, (e) => (_(), n(
|
|
1535
|
+
ref: V
|
|
1536
|
+
}, [(_(!0), i(e, null, b(X.value, (e) => (_(), n(st, {
|
|
1315
1537
|
id: e.id,
|
|
1316
1538
|
key: e.id,
|
|
1317
1539
|
"data-group-id": e.id,
|
|
@@ -1326,12 +1548,12 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1326
1548
|
"group-model": e,
|
|
1327
1549
|
"overflow-trigger-aria-label": Y.value.groupOverflowTriggerAriaLabel,
|
|
1328
1550
|
"gallery-preview-fallback": Y.value.galleryPreviewFallback,
|
|
1329
|
-
onItemClick: l[
|
|
1551
|
+
onItemClick: l[2] ||= (e) => Oe(e.groupId, e.itemId)
|
|
1330
1552
|
}, {
|
|
1331
|
-
default: D(() => [c(
|
|
1553
|
+
default: D(() => [c(Qe, {
|
|
1332
1554
|
group: e,
|
|
1333
1555
|
"gallery-preview-fallback": Y.value.galleryPreviewFallback,
|
|
1334
|
-
onItemClick: l[
|
|
1556
|
+
onItemClick: l[1] ||= (e) => Oe(e.groupId, e.itemId)
|
|
1335
1557
|
}, null, 8, ["group", "gallery-preview-fallback"])]),
|
|
1336
1558
|
_: 2
|
|
1337
1559
|
}, 1032, [
|
|
@@ -1348,70 +1570,82 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1348
1570
|
"group-model",
|
|
1349
1571
|
"overflow-trigger-aria-label",
|
|
1350
1572
|
"gallery-preview-fallback"
|
|
1351
|
-
]))), 128)), Z.value.length ? (_(), i("section",
|
|
1573
|
+
]))), 128)), Z.value.length ? (_(), i("section", mt, [a("div", ht, [c(T(re), {
|
|
1352
1574
|
trigger: "click",
|
|
1353
1575
|
placement: "bottom-end",
|
|
1354
1576
|
width: de.value,
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1577
|
+
disabled: T(F).disabled.value,
|
|
1578
|
+
"popper-class": ce.value,
|
|
1579
|
+
onShow: l[4] ||= (e) => T(F).overflowOpen.value = !0,
|
|
1580
|
+
onHide: l[5] ||= (e) => T(F).overflowOpen.value = !1
|
|
1358
1581
|
}, {
|
|
1359
1582
|
reference: D(() => [a("button", {
|
|
1360
1583
|
type: "button",
|
|
1361
1584
|
class: "ml-ribbon-overflow-trigger",
|
|
1362
|
-
"aria-label": Y.value.overflowTriggerAriaLabel
|
|
1363
|
-
|
|
1364
|
-
|
|
1585
|
+
"aria-label": Y.value.overflowTriggerAriaLabel,
|
|
1586
|
+
disabled: T(F).disabled.value
|
|
1587
|
+
}, [...l[7] ||= [a("span", { class: "ml-ribbon-overflow-trigger__dots" }, "...", -1)]], 8, gt)]),
|
|
1588
|
+
default: D(() => [a("div", _t, [(_(!0), i(e, null, b(Z.value, (e) => (_(), i("section", {
|
|
1365
1589
|
key: e.id,
|
|
1366
1590
|
class: "ml-ribbon-overflow-group"
|
|
1367
|
-
}, [a("header",
|
|
1591
|
+
}, [a("header", vt, C(e.title), 1), c(Qe, {
|
|
1368
1592
|
group: e,
|
|
1369
1593
|
"gallery-preview-fallback": Y.value.galleryPreviewFallback,
|
|
1370
|
-
onItemClick: l[
|
|
1594
|
+
onItemClick: l[3] ||= (e) => Oe(e.groupId, e.itemId)
|
|
1371
1595
|
}, null, 8, ["group", "gallery-preview-fallback"])]))), 128))])]),
|
|
1372
1596
|
_: 1
|
|
1373
|
-
}, 8, [
|
|
1374
|
-
|
|
1597
|
+
}, 8, [
|
|
1598
|
+
"width",
|
|
1599
|
+
"disabled",
|
|
1600
|
+
"popper-class"
|
|
1601
|
+
])]), l[8] ||= a("footer", { class: "ml-ribbon-group__footer ml-ribbon-group__footer--overflow" }, null, -1)])) : r("", !0)], 8, pt)) : r("", !0),
|
|
1602
|
+
!T(F).minimized.value && L.value && T(F).layout.value === "simplified" ? (_(), i("main", {
|
|
1375
1603
|
key: 1,
|
|
1376
1604
|
class: "ml-ribbon__panel ml-ribbon__panel--simplified",
|
|
1377
|
-
"data-active-tab":
|
|
1378
|
-
}, [(_(!0), i(e, null, b(
|
|
1605
|
+
"data-active-tab": L.value.id
|
|
1606
|
+
}, [(_(!0), i(e, null, b(R.value, (e) => (_(), n(T(re), {
|
|
1379
1607
|
key: e.id,
|
|
1380
1608
|
trigger: "click",
|
|
1381
1609
|
placement: "bottom-start",
|
|
1382
1610
|
width: 340,
|
|
1383
|
-
|
|
1611
|
+
disabled: T(F).disabled.value,
|
|
1612
|
+
"popper-class": J.value
|
|
1384
1613
|
}, {
|
|
1385
|
-
reference: D(() => [a("button",
|
|
1614
|
+
reference: D(() => [a("button", {
|
|
1615
|
+
class: "ml-ribbon-simplified-group",
|
|
1616
|
+
type: "button",
|
|
1617
|
+
disabled: T(F).disabled.value
|
|
1618
|
+
}, [Ne(e) ? (_(), n(T(I), {
|
|
1386
1619
|
key: 0,
|
|
1387
1620
|
class: "ml-ribbon-simplified-group__icon"
|
|
1388
1621
|
}, {
|
|
1389
|
-
default: D(() => [(_(), n(S(
|
|
1622
|
+
default: D(() => [(_(), n(S(Ne(e))))]),
|
|
1390
1623
|
_: 2
|
|
1391
|
-
}, 1024)) : r("", !0), a("span", null, C(e.title), 1)])]),
|
|
1392
|
-
default: D(() => [a("div",
|
|
1624
|
+
}, 1024)) : r("", !0), a("span", null, C(e.title), 1)], 8, bt)]),
|
|
1625
|
+
default: D(() => [a("div", xt, [c(Qe, {
|
|
1393
1626
|
group: fe(e),
|
|
1394
1627
|
"gallery-preview-fallback": Y.value.galleryPreviewFallback,
|
|
1395
|
-
onItemClick: l[
|
|
1628
|
+
onItemClick: l[6] ||= (e) => Oe(e.groupId, e.itemId)
|
|
1396
1629
|
}, null, 8, ["group", "gallery-preview-fallback"])])]),
|
|
1397
1630
|
_: 2
|
|
1398
|
-
}, 1032, ["popper-class"]))), 128))], 8,
|
|
1399
|
-
c(
|
|
1400
|
-
open: T(
|
|
1401
|
-
size:
|
|
1631
|
+
}, 1032, ["disabled", "popper-class"]))), 128))], 8, yt)) : r("", !0),
|
|
1632
|
+
c(he, {
|
|
1633
|
+
open: T(F).backdropOpen.value,
|
|
1634
|
+
size: q.value,
|
|
1402
1635
|
"back-label": Y.value.backstageBackLabel,
|
|
1403
1636
|
title: Y.value.backstageTitle,
|
|
1404
1637
|
description: Y.value.backstageDescription,
|
|
1405
|
-
onClose:
|
|
1638
|
+
onClose: De
|
|
1406
1639
|
}, o({ _: 2 }, [t.$slots.backstage ? {
|
|
1407
1640
|
name: "default",
|
|
1408
1641
|
fn: D(() => [x(t.$slots, "backstage", {
|
|
1409
|
-
close:
|
|
1410
|
-
open: T(
|
|
1411
|
-
size:
|
|
1642
|
+
close: De,
|
|
1643
|
+
open: T(F).backdropOpen.value,
|
|
1644
|
+
size: q.value,
|
|
1412
1645
|
backLabel: Y.value.backstageBackLabel,
|
|
1413
1646
|
title: Y.value.backstageTitle,
|
|
1414
|
-
description: Y.value.backstageDescription
|
|
1647
|
+
description: Y.value.backstageDescription,
|
|
1648
|
+
disabled: T(F).disabled.value
|
|
1415
1649
|
})]),
|
|
1416
1650
|
key: "0"
|
|
1417
1651
|
} : void 0]), 1032, [
|
|
@@ -1421,14 +1655,14 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1421
1655
|
"title",
|
|
1422
1656
|
"description"
|
|
1423
1657
|
])
|
|
1424
|
-
],
|
|
1658
|
+
], 10, ct))]),
|
|
1425
1659
|
_: 3
|
|
1426
1660
|
}, 8, ["size"]));
|
|
1427
1661
|
}
|
|
1428
|
-
}),
|
|
1662
|
+
}), wt = {
|
|
1429
1663
|
class: "ml-ribbon-tab-definition",
|
|
1430
1664
|
hidden: ""
|
|
1431
|
-
},
|
|
1665
|
+
}, Tt = /* @__PURE__ */ l({
|
|
1432
1666
|
__name: "RibbonTab",
|
|
1433
1667
|
props: {
|
|
1434
1668
|
id: {},
|
|
@@ -1439,13 +1673,13 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1439
1673
|
contextualTitle: {}
|
|
1440
1674
|
},
|
|
1441
1675
|
setup(e) {
|
|
1442
|
-
return (e, t) => (_(), i("div",
|
|
1676
|
+
return (e, t) => (_(), i("div", wt, [x(e.$slots, "default")]));
|
|
1443
1677
|
}
|
|
1444
|
-
}),
|
|
1678
|
+
}), Et = {
|
|
1445
1679
|
key: 0,
|
|
1446
1680
|
class: "ml-ribbon-keytips",
|
|
1447
1681
|
"aria-live": "polite"
|
|
1448
|
-
},
|
|
1682
|
+
}, Dt = { class: "ml-ribbon-keytips__hint" }, Ot = /* @__PURE__ */ l({
|
|
1449
1683
|
__name: "RibbonKeyTips",
|
|
1450
1684
|
props: {
|
|
1451
1685
|
open: { type: Boolean },
|
|
@@ -1480,11 +1714,11 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1480
1714
|
}
|
|
1481
1715
|
return h(() => window.addEventListener("keydown", S)), g(() => window.removeEventListener("keydown", S)), E(() => s.open, (e) => {
|
|
1482
1716
|
e || x();
|
|
1483
|
-
}), (t, o) => n.open ? (_(), i("div",
|
|
1717
|
+
}), (t, o) => n.open ? (_(), i("div", Et, [a("div", Dt, C(f.value), 1), (_(!0), i(e, null, b(u.value, (e) => (_(), i("span", {
|
|
1484
1718
|
key: e.id,
|
|
1485
1719
|
class: "ml-ribbon-keytip"
|
|
1486
1720
|
}, C(e.key), 1))), 128))])) : r("", !0);
|
|
1487
1721
|
}
|
|
1488
1722
|
});
|
|
1489
1723
|
//#endregion
|
|
1490
|
-
export {
|
|
1724
|
+
export { Ct as MlRibbon, he as MlRibbonBackstage, Pe as MlRibbonButtonGroup, Te as MlRibbonCollection, Se as MlRibbonContextualTabs, we as MlRibbonFileMenu, Me as MlRibbonGallery, st as MlRibbonGroup, Ze as MlRibbonItemHost, Ot as MlRibbonKeyTips, Be as MlRibbonSegmented, Tt as MlRibbonTab, ve as MlRibbonTabs, He as MlRibbonTemplateItem };
|