@mintplayer/web-components 2.1.1 → 2.3.0
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/a11y/index.mjs +26 -2
- package/a11y/src/dismiss-stack.d.ts +25 -0
- package/a11y/src/error-text.d.ts +41 -0
- package/a11y/src/focus-restore.d.ts +116 -0
- package/a11y/src/focus-trap.d.ts +69 -0
- package/a11y/src/form-associated.d.ts +48 -0
- package/a11y/src/host-aria.d.ts +154 -0
- package/a11y/src/index.d.ts +16 -0
- package/a11y/src/inert-regions.d.ts +52 -0
- package/a11y/src/live-announcer.d.ts +8 -0
- package/a11y/src/roving-focus.d.ts +118 -0
- package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
- package/a11y/src/testing/index.d.ts +1 -0
- package/accordion/index.d.ts +1 -0
- package/accordion/index.mjs +549 -0
- package/accordion/src/components/index.d.ts +3 -0
- package/accordion/src/components/mp-accordion-tab.d.ts +30 -0
- package/accordion/src/components/mp-accordion.d.ts +66 -0
- package/accordion/src/index.d.ts +3 -0
- package/accordion/src/styles/index.d.ts +1 -0
- package/calendar/index.mjs +1 -1
- package/calendar/src/mp-calendar.element.d.ts +2 -0
- package/carousel/index.d.ts +1 -0
- package/carousel/index.mjs +994 -0
- package/carousel/src/components/index.d.ts +1 -0
- package/carousel/src/components/mp-carousel.d.ts +58 -0
- package/carousel/src/index.d.ts +3 -0
- package/carousel/src/styles/index.d.ts +1 -0
- package/carousel/src/types/carousel.d.ts +10 -0
- package/carousel/src/types/index.d.ts +1 -0
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +59 -1
- package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
- package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
- package/chunks/form-associated-axmc5sY0.mjs +58 -0
- package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
- package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
- package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
- package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
- package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
- package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
- package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
- package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
- package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
- package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
- package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
- package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
- package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
- package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
- package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
- package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
- package/chunks/roving-focus-CrL9982a.mjs +129 -0
- package/code-snippet/index.mjs +21 -13
- package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/mp-datatable.d.ts +50 -0
- package/datatable/src/types/index.d.ts +2 -0
- package/datatable/src/types/labels.d.ts +30 -0
- package/datepicker/index.mjs +45 -22
- package/datepicker/src/mp-datepicker.element.d.ts +30 -0
- package/datetime-picker/index.mjs +15 -9
- package/dock/index.mjs +365 -209
- package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
- package/dropdown-menu/index.mjs +135 -90
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
- package/file-manager/index.mjs +279 -214
- package/file-manager/src/components/mp-file-manager.d.ts +22 -0
- package/file-manager/src/types/messages.d.ts +9 -0
- package/multi-range/index.mjs +26 -10
- package/multi-range/src/mint-multi-range.element.d.ts +7 -0
- package/navbar/index.mjs +53 -39
- package/navbar/src/components/mp-navbar.d.ts +1 -0
- package/otp-input/index.mjs +82 -48
- package/otp-input/src/mint-otp-input.element.d.ts +31 -3
- package/overlay/index.mjs +2 -258
- package/overlay/src/overlay-controller.d.ts +64 -4
- package/package.json +21 -1
- package/pagination/index.mjs +1 -1
- package/query-builder/index.mjs +117 -87
- package/query-builder/src/model/messages.d.ts +9 -0
- package/radio/index.mjs +2 -160
- package/radio/src/components/mp-radio.d.ts +58 -3
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.mjs +145 -0
- package/radio-group/src/components/mp-radio-group.d.ts +52 -0
- package/radio-group/src/index.d.ts +1 -0
- package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
- package/ribbon/index.mjs +316 -304
- package/ribbon/src/mp-ribbon.element.d.ts +16 -0
- package/scheduler/index.mjs +219 -132
- package/scheduler/src/components/mp-scheduler.d.ts +3 -0
- package/scheduler/src/views/base-view.d.ts +23 -0
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +60 -3
- package/shell/index.mjs +142 -31
- package/shell/src/components/mp-shell.d.ts +1 -0
- package/signature-pad/index.d.ts +1 -0
- package/signature-pad/index.mjs +230 -0
- package/signature-pad/src/index.d.ts +2 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
- package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
- package/signature-pad/src/types/signature.d.ts +12 -0
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +7 -0
- package/splitter/src/index.d.ts +1 -1
- package/swiper-core/index.d.ts +1 -0
- package/swiper-core/index.mjs +184 -0
- package/swiper-core/src/index-machine.d.ts +59 -0
- package/swiper-core/src/index.d.ts +4 -0
- package/swiper-core/src/keymap.d.ts +2 -0
- package/swiper-core/src/models/index.d.ts +1 -0
- package/swiper-core/src/models/types.d.ts +99 -0
- package/swiper-core/src/pointer-arbiter.d.ts +45 -0
- package/tab-control/index.mjs +1 -1
- package/tile-manager/index.mjs +110 -93
- package/timeline/index.mjs +138 -54
- package/timeline/src/components/mp-timeline.d.ts +15 -0
- package/timepicker/index.mjs +1 -1
- package/timepicker/src/mp-time-list.element.d.ts +13 -4
- package/timepicker/src/mp-timepicker.element.d.ts +29 -0
- package/toggle-button/index.mjs +1 -1
- package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
- package/tree-select/index.mjs +233 -121
- package/tree-select/src/components/mp-tree-select.d.ts +37 -0
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +10 -1
- package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
- package/dropdown/src/styles/dropdown.styles.d.ts +0 -2
package/ribbon/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { LitElement as
|
|
1
|
+
import { LitElement as k, css as g, nothing as L, html as d } from "lit";
|
|
2
2
|
import { property as l, state as _, query as S } from "lit/decorators.js";
|
|
3
|
-
import { L as se } from "../chunks/live-announcer-
|
|
4
|
-
import {
|
|
5
|
-
var be = Object.defineProperty,
|
|
6
|
-
for (var t = void 0,
|
|
7
|
-
(n = s[
|
|
8
|
-
return t && be(e,
|
|
3
|
+
import { L as se } from "../chunks/live-announcer-Bi0orG4n.mjs";
|
|
4
|
+
import { O as G } from "../chunks/overlay-controller-DPt13i8p.mjs";
|
|
5
|
+
var be = Object.defineProperty, A = (s, e, i, r) => {
|
|
6
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
7
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
8
|
+
return t && be(e, i, t), t;
|
|
9
9
|
};
|
|
10
|
-
class
|
|
10
|
+
class y extends k {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(), this.activeTabId = "", this.tabsList = [], this.contextualSets = [], this.contentSlot = null, this.layout = "classic", this.minimized = !1, this.version = "office-2016", this.colorScheme = "auto", this.touchMode = "auto", this.keyTips = "on", this.keyTipMode = "off", this.keyTipBadges = [], this.currentTabIndex = 0, this.reflowFrame = 0, this.naturalWidths = /* @__PURE__ */ new WeakMap(), this.liveAnnouncer = new se(this), this.collapsedGroupLabels = /* @__PURE__ */ new WeakMap(), this.previousCollapsedGroups = /* @__PURE__ */ new Set(), this.contextualSetHiddenState = /* @__PURE__ */ new Map(), this.appliedReduceSteps = /* @__PURE__ */ new WeakMap(), this.originalItemSizes = /* @__PURE__ */ new WeakMap(), this.altPressed = !1, this.altUsedForCombo = !1, this.onKeyTipKeyDown = (e) => {
|
|
12
|
+
super(), this.activeTabId = "", this.tabsList = [], this.contextualSets = [], this.contentSlot = null, this.layout = "classic", this.regionLabel = "Ribbon", this.minimized = !1, this.version = "office-2016", this.colorScheme = "auto", this.touchMode = "auto", this.keyTips = "on", this.keyTipMode = "off", this.keyTipBadges = [], this.currentTabIndex = 0, this.reflowFrame = 0, this.naturalWidths = /* @__PURE__ */ new WeakMap(), this.liveAnnouncer = new se(this), this.collapsedGroupLabels = /* @__PURE__ */ new WeakMap(), this.previousCollapsedGroups = /* @__PURE__ */ new Set(), this.contextualSetHiddenState = /* @__PURE__ */ new Map(), this.appliedReduceSteps = /* @__PURE__ */ new WeakMap(), this.originalItemSizes = /* @__PURE__ */ new WeakMap(), this.lastAppliedRegionLabel = null, this.altPressed = !1, this.altUsedForCombo = !1, this.onKeyTipKeyDown = (e) => {
|
|
13
13
|
if (this.keyTips === "on") {
|
|
14
14
|
if (e.key === "Alt" && !e.repeat) {
|
|
15
15
|
this.altPressed = !0, this.altUsedForCombo = !1;
|
|
@@ -25,7 +25,7 @@ class k extends w {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
if (e.key.length === 1) {
|
|
28
|
-
const
|
|
28
|
+
const i = e.key.toUpperCase(), r = this.keyTipBadges.find((t) => t.tip === i);
|
|
29
29
|
if (!r) return;
|
|
30
30
|
if (e.preventDefault(), this.keyTipMode === "tabs") {
|
|
31
31
|
const t = r.target.getAttribute("data-tab-id");
|
|
@@ -49,34 +49,34 @@ class k extends w {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
if (e.ctrlKey && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
52
|
+
const i = e.composedPath();
|
|
53
|
+
if (i.some((t) => t instanceof HTMLElement && t.getAttribute("role") === "tab"))
|
|
54
54
|
return;
|
|
55
|
-
const r =
|
|
55
|
+
const r = i.find(
|
|
56
56
|
(t) => t instanceof HTMLElement && t.tagName === "MP-RIBBON-GROUP"
|
|
57
57
|
);
|
|
58
58
|
if (r) {
|
|
59
|
-
const
|
|
59
|
+
const o = !(getComputedStyle(this).direction === "rtl"), n = e.key === "ArrowRight" === o ? 1 : -1;
|
|
60
60
|
this.moveFocusBetweenGroups(r, n) && e.preventDefault();
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}, this.onContextualVisibilityChange = (e) => {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
const r = this.contextualSetHiddenState.get(
|
|
67
|
-
r !== void 0 && r !==
|
|
68
|
-
|
|
69
|
-
), this.contextualSetHiddenState.set(
|
|
64
|
+
const i = e.detail;
|
|
65
|
+
if (i?.label) {
|
|
66
|
+
const r = this.contextualSetHiddenState.get(i.label);
|
|
67
|
+
r !== void 0 && r !== i.hidden && this.liveAnnouncer.announce(
|
|
68
|
+
i.hidden ? `${i.label}, contextual, hidden` : `${i.label}, contextual, now available`
|
|
69
|
+
), this.contextualSetHiddenState.set(i.label, i.hidden);
|
|
70
70
|
}
|
|
71
71
|
this.contentSlot && this.processSlot(this.contentSlot);
|
|
72
72
|
}, this.onSlotChange = (e) => {
|
|
73
|
-
const
|
|
74
|
-
this.contentSlot =
|
|
73
|
+
const i = e.target;
|
|
74
|
+
this.contentSlot = i, this.processSlot(i);
|
|
75
75
|
}, this.onTabListKeydown = (e) => {
|
|
76
|
-
const { key:
|
|
76
|
+
const { key: i } = e;
|
|
77
77
|
let r = !1;
|
|
78
78
|
const t = getComputedStyle(this).direction === "rtl";
|
|
79
|
-
switch (
|
|
79
|
+
switch (i) {
|
|
80
80
|
case "ArrowLeft":
|
|
81
81
|
t ? this.focusNextTab() : this.focusPreviousTab(), r = !0;
|
|
82
82
|
break;
|
|
@@ -97,9 +97,9 @@ class k extends w {
|
|
|
97
97
|
break;
|
|
98
98
|
case "Enter":
|
|
99
99
|
case " ":
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
const n =
|
|
100
|
+
const o = this.tabElements[this.currentTabIndex];
|
|
101
|
+
if (o) {
|
|
102
|
+
const n = o.getAttribute("data-tab-id");
|
|
103
103
|
n && (this.selectTab(n), r = !0);
|
|
104
104
|
}
|
|
105
105
|
break;
|
|
@@ -607,8 +607,12 @@ class k extends w {
|
|
|
607
607
|
get tabElements() {
|
|
608
608
|
return Array.from(this.renderRoot.querySelectorAll('[role="tab"]'));
|
|
609
609
|
}
|
|
610
|
+
applyRegionLabel() {
|
|
611
|
+
const e = this.getAttribute("aria-label");
|
|
612
|
+
e !== null && e !== this.lastAppliedRegionLabel && e !== this.regionLabel || (this.setAttribute("aria-label", this.regionLabel), this.lastAppliedRegionLabel = this.regionLabel);
|
|
613
|
+
}
|
|
610
614
|
connectedCallback() {
|
|
611
|
-
super.connectedCallback(), this.
|
|
615
|
+
super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "region"), this.applyRegionLabel(), typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(() => this.scheduleReflow()), this.resizeObserver.observe(this)), this.addEventListener(
|
|
612
616
|
"contextual-visibility-change",
|
|
613
617
|
this.onContextualVisibilityChange
|
|
614
618
|
), this.addEventListener("keydown", this.onHostKeyDown), document.addEventListener("keydown", this.onKeyTipKeyDown), document.addEventListener("keyup", this.onKeyTipKeyUp);
|
|
@@ -647,12 +651,12 @@ class k extends w {
|
|
|
647
651
|
* 4. Other letters of the label.
|
|
648
652
|
* 5. Digits 1-9 then 0 (fallback when every letter is taken).
|
|
649
653
|
*/
|
|
650
|
-
allocateKeyTip(e,
|
|
651
|
-
if (
|
|
652
|
-
const n =
|
|
654
|
+
allocateKeyTip(e, i, r) {
|
|
655
|
+
if (i) {
|
|
656
|
+
const n = i.toUpperCase().slice(0, 1);
|
|
653
657
|
return r.add(n), n;
|
|
654
658
|
}
|
|
655
|
-
const t = (e ?? "").toUpperCase(),
|
|
659
|
+
const t = (e ?? "").toUpperCase(), o = (n) => "AEIOU".includes(n);
|
|
656
660
|
if (t.length > 0) {
|
|
657
661
|
const n = t[0];
|
|
658
662
|
if (/[A-Z0-9]/.test(n) && !r.has(n))
|
|
@@ -660,7 +664,7 @@ class k extends w {
|
|
|
660
664
|
}
|
|
661
665
|
for (let n = 1; n < t.length; n++) {
|
|
662
666
|
const b = t[n];
|
|
663
|
-
if (/[A-Z]/.test(b) && !
|
|
667
|
+
if (/[A-Z]/.test(b) && !o(b) && !r.has(b))
|
|
664
668
|
return r.add(b), b;
|
|
665
669
|
}
|
|
666
670
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -675,30 +679,30 @@ class k extends w {
|
|
|
675
679
|
}
|
|
676
680
|
/** Compute key-tip badges anchored under each tab button in the strip. */
|
|
677
681
|
deriveTabBadges() {
|
|
678
|
-
const e = [],
|
|
682
|
+
const e = [], i = /* @__PURE__ */ new Set(), r = this.tabElements;
|
|
679
683
|
for (const t of r) {
|
|
680
|
-
const
|
|
684
|
+
const o = t.getAttribute("data-tab-id") ?? "", n = this.tabsList.find((u) => u.tabId === o)?.element, b = t.getAttribute("data-key-tip") ?? n?.getAttribute("data-key-tip") ?? null, c = t.textContent ?? "", a = this.allocateKeyTip(c, b, i), h = t.getBoundingClientRect();
|
|
681
685
|
e.push({ tip: a, target: t, rect: { left: h.left + 4, top: h.bottom - 4 } });
|
|
682
686
|
}
|
|
683
687
|
return e;
|
|
684
688
|
}
|
|
685
689
|
/** Compute key-tip badges for every item inside the currently active tab. */
|
|
686
690
|
deriveItemBadges() {
|
|
687
|
-
const e = this.tabsList.find((
|
|
691
|
+
const e = this.tabsList.find((o) => o.tabId === this.activeTabId);
|
|
688
692
|
if (!e) return [];
|
|
689
|
-
const
|
|
690
|
-
for (const
|
|
691
|
-
if (
|
|
692
|
-
const b =
|
|
693
|
+
const i = this.collectActiveGroups(e.element), r = /* @__PURE__ */ new Set(), t = [];
|
|
694
|
+
for (const o of i) {
|
|
695
|
+
if (o.getAttribute("data-resolved-size") === "popup") {
|
|
696
|
+
const b = o.shadowRoot?.querySelector(
|
|
693
697
|
".ribbon-popup-trigger"
|
|
694
698
|
);
|
|
695
699
|
if (b) {
|
|
696
|
-
const c =
|
|
700
|
+
const c = o.getAttribute("data-key-tip"), a = o.getAttribute("label") ?? "", h = this.allocateKeyTip(a, c, r), u = b.getBoundingClientRect();
|
|
697
701
|
t.push({ tip: h, target: b, rect: { left: u.left + 4, top: u.bottom - 6 } });
|
|
698
702
|
}
|
|
699
703
|
continue;
|
|
700
704
|
}
|
|
701
|
-
const n = this.collectGroupItems(
|
|
705
|
+
const n = this.collectGroupItems(o);
|
|
702
706
|
for (const b of n) {
|
|
703
707
|
if (b.hasAttribute("disabled")) continue;
|
|
704
708
|
const c = b.getAttribute("data-key-tip"), a = b.getAttribute("label") ?? "", h = this.allocateKeyTip(a, c, r), u = b.getBoundingClientRect();
|
|
@@ -716,33 +720,33 @@ class k extends w {
|
|
|
716
720
|
})
|
|
717
721
|
);
|
|
718
722
|
}
|
|
719
|
-
moveFocusBetweenGroups(e,
|
|
723
|
+
moveFocusBetweenGroups(e, i) {
|
|
720
724
|
const r = this.tabsList.find((c) => c.tabId === this.activeTabId);
|
|
721
725
|
if (!r) return !1;
|
|
722
726
|
const t = this.collectActiveGroups(r.element).filter(
|
|
723
727
|
(c) => c.getAttribute("data-resolved-size") !== "popup" || c.hasAttribute("data-popup-open")
|
|
724
728
|
);
|
|
725
729
|
if (t.length === 0) return !1;
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
728
|
-
const n =
|
|
730
|
+
const o = t.indexOf(e);
|
|
731
|
+
if (o === -1) return !1;
|
|
732
|
+
const n = o + i;
|
|
729
733
|
if (n < 0 || n >= t.length) return !1;
|
|
730
734
|
const b = this.firstFocusableInGroup(t[n]);
|
|
731
735
|
return b ? (b.focus(), !0) : !1;
|
|
732
736
|
}
|
|
733
737
|
firstFocusableInGroup(e) {
|
|
734
|
-
const
|
|
738
|
+
const i = Array.from(
|
|
735
739
|
e.querySelectorAll(
|
|
736
740
|
"mp-ribbon-button, mp-ribbon-toggle-button, mp-ribbon-checkbox, mp-ribbon-combobox, mp-ribbon-color-picker, mp-ribbon-group-button, mp-ribbon-split-button, mp-ribbon-dropdown-button, mp-ribbon-gallery, mp-ribbon-template-item"
|
|
737
741
|
)
|
|
738
742
|
).filter((r) => !r.hasAttribute("disabled"));
|
|
739
|
-
return
|
|
743
|
+
return i.length === 0 ? null : i.find((r) => r.getAttribute("tabindex") === "0") ?? i[0];
|
|
740
744
|
}
|
|
741
745
|
updated(e) {
|
|
742
|
-
if (!this.activeTabId && this.tabsList.length > 0 && (this.activeTabId = this.tabsList[0].tabId), e.has("activeTabId")) {
|
|
746
|
+
if (e.has("regionLabel") && this.applyRegionLabel(), !this.activeTabId && this.tabsList.length > 0 && (this.activeTabId = this.tabsList[0].tabId), e.has("activeTabId")) {
|
|
743
747
|
this.applyActiveAttribute();
|
|
744
|
-
const
|
|
745
|
-
|
|
748
|
+
const i = this.tabsList.findIndex((r) => r.tabId === this.activeTabId);
|
|
749
|
+
i >= 0 && (this.currentTabIndex = i);
|
|
746
750
|
}
|
|
747
751
|
(e.has("activeTabId") || e.has("minimized")) && this.scheduleReflow(), e.has("minimized") && e.get("minimized") !== void 0 && this.liveAnnouncer.announce(
|
|
748
752
|
this.minimized ? "Ribbon minimized" : "Ribbon restored"
|
|
@@ -759,10 +763,10 @@ class k extends w {
|
|
|
759
763
|
* the FR-6 path) when switching back to Classic.
|
|
760
764
|
*/
|
|
761
765
|
applyLayoutPropagation() {
|
|
762
|
-
const e = this.layout === "simplified" ? "simplified" : "classic",
|
|
766
|
+
const e = this.layout === "simplified" ? "simplified" : "classic", i = this.querySelectorAll(
|
|
763
767
|
"mp-ribbon-tab, mp-ribbon-group, mp-ribbon-button, mp-ribbon-toggle-button, mp-ribbon-checkbox, mp-ribbon-combobox, mp-ribbon-color-picker, mp-ribbon-group-button, mp-ribbon-split-button, mp-ribbon-dropdown-button, mp-ribbon-gallery"
|
|
764
768
|
);
|
|
765
|
-
for (const t of Array.from(
|
|
769
|
+
for (const t of Array.from(i))
|
|
766
770
|
t.setAttribute("data-ribbon-layout", e);
|
|
767
771
|
const r = this.querySelectorAll(
|
|
768
772
|
"mp-ribbon-button, mp-ribbon-toggle-button, mp-ribbon-checkbox, mp-ribbon-combobox, mp-ribbon-color-picker, mp-ribbon-group-button, mp-ribbon-split-button, mp-ribbon-dropdown-button, mp-ribbon-gallery"
|
|
@@ -770,15 +774,15 @@ class k extends w {
|
|
|
770
774
|
if (this.layout === "simplified")
|
|
771
775
|
for (const t of Array.from(r)) {
|
|
772
776
|
if (!this.originalItemSizes.has(t)) {
|
|
773
|
-
const
|
|
774
|
-
this.originalItemSizes.set(t,
|
|
777
|
+
const o = t.getAttribute("size") ?? "medium";
|
|
778
|
+
this.originalItemSizes.set(t, o);
|
|
775
779
|
}
|
|
776
780
|
t.getAttribute("size") !== "small" && t.setAttribute("size", "small");
|
|
777
781
|
}
|
|
778
782
|
else
|
|
779
783
|
for (const t of Array.from(r)) {
|
|
780
|
-
const
|
|
781
|
-
|
|
784
|
+
const o = this.originalItemSizes.get(t);
|
|
785
|
+
o && t.getAttribute("size") !== o && t.setAttribute("size", o);
|
|
782
786
|
}
|
|
783
787
|
}
|
|
784
788
|
render() {
|
|
@@ -797,11 +801,16 @@ class k extends w {
|
|
|
797
801
|
</div>
|
|
798
802
|
</div>
|
|
799
803
|
|
|
800
|
-
${this.minimized ? d`<div hidden><slot @slotchange="${this.onSlotChange}"></slot></div>` : d`<div
|
|
804
|
+
${this.minimized ? d`<div hidden><slot @slotchange="${this.onSlotChange}"></slot></div>` : d`<div
|
|
805
|
+
class="ribbon-content"
|
|
806
|
+
role="tabpanel"
|
|
807
|
+
id="ribbon-active-panel"
|
|
808
|
+
aria-labelledby="ribbon-tab-${this.activeTabId}"
|
|
809
|
+
>
|
|
801
810
|
<slot @slotchange="${this.onSlotChange}"></slot>
|
|
802
811
|
</div>`}
|
|
803
812
|
</div>
|
|
804
|
-
${this.keyTipMode !== "off" ? this.renderKeyTipOverlay() :
|
|
813
|
+
${this.keyTipMode !== "off" ? this.renderKeyTipOverlay() : L}
|
|
805
814
|
${this.liveAnnouncer.template()}
|
|
806
815
|
`;
|
|
807
816
|
}
|
|
@@ -820,17 +829,17 @@ class k extends w {
|
|
|
820
829
|
}
|
|
821
830
|
renderTabStripItems() {
|
|
822
831
|
const e = [];
|
|
823
|
-
let
|
|
824
|
-
for (;
|
|
825
|
-
const r = this.tabsList[
|
|
832
|
+
let i = 0;
|
|
833
|
+
for (; i < this.tabsList.length; ) {
|
|
834
|
+
const r = this.tabsList[i];
|
|
826
835
|
if (!r.contextualColor || !r.contextualSetLabel) {
|
|
827
|
-
e.push(this.renderTabButton(r,
|
|
836
|
+
e.push(this.renderTabButton(r, i)), i++;
|
|
828
837
|
continue;
|
|
829
838
|
}
|
|
830
|
-
const t = r.contextualSetLabel,
|
|
831
|
-
for (;
|
|
832
|
-
|
|
833
|
-
const b = this.tabsList.slice(n,
|
|
839
|
+
const t = r.contextualSetLabel, o = r.contextualColor, n = i;
|
|
840
|
+
for (; i < this.tabsList.length && this.tabsList[i].contextualSetLabel === t && this.tabsList[i].contextualColor === o; )
|
|
841
|
+
i++;
|
|
842
|
+
const b = this.tabsList.slice(n, i), c = this.getBandTextColor(o), a = `--bs-ribbon-contextual-color: ${o};--ribbon-contextual-text: ${c};`;
|
|
834
843
|
e.push(d`
|
|
835
844
|
<div class="ribbon-contextual-group" style="${a}">
|
|
836
845
|
<div class="ribbon-contextual-group-band">${t}</div>
|
|
@@ -850,21 +859,21 @@ class k extends w {
|
|
|
850
859
|
* 6-digit hex; falls back to dark on parse failure (safe default).
|
|
851
860
|
*/
|
|
852
861
|
getBandTextColor(e) {
|
|
853
|
-
const
|
|
854
|
-
if (
|
|
855
|
-
const r = parseInt(
|
|
856
|
-
return 0.2126 * r + 0.7152 * t + 0.0722 *
|
|
862
|
+
const i = e.replace("#", "").trim();
|
|
863
|
+
if (i.length !== 6 || !/^[0-9a-fA-F]{6}$/.test(i)) return "#262626";
|
|
864
|
+
const r = parseInt(i.substring(0, 2), 16) / 255, t = parseInt(i.substring(2, 4), 16) / 255, o = parseInt(i.substring(4, 6), 16) / 255;
|
|
865
|
+
return 0.2126 * r + 0.7152 * t + 0.0722 * o >= 0.6 ? "#262626" : "#FFFFFF";
|
|
857
866
|
}
|
|
858
|
-
renderTabButton(e,
|
|
859
|
-
const r = e.tabId === this.activeTabId, t = !!e.contextualColor,
|
|
867
|
+
renderTabButton(e, i) {
|
|
868
|
+
const r = e.tabId === this.activeTabId, t = !!e.contextualColor, o = r ? 0 : -1;
|
|
860
869
|
return d`
|
|
861
870
|
<button
|
|
862
871
|
role="tab"
|
|
863
872
|
id="ribbon-tab-${e.tabId}"
|
|
864
873
|
class="ribbon-tab ${r ? "active" : ""} ${t ? "contextual" : ""}"
|
|
865
874
|
aria-selected="${r}"
|
|
866
|
-
aria-controls="ribbon-panel
|
|
867
|
-
tabindex="${
|
|
875
|
+
aria-controls="ribbon-active-panel"
|
|
876
|
+
tabindex="${o}"
|
|
868
877
|
data-tab-id="${e.tabId}"
|
|
869
878
|
@click="${() => this.selectTab(e.tabId)}"
|
|
870
879
|
@dblclick="${() => this.toggleMinimizedFromUser()}"
|
|
@@ -872,19 +881,19 @@ class k extends w {
|
|
|
872
881
|
`;
|
|
873
882
|
}
|
|
874
883
|
processSlot(e) {
|
|
875
|
-
const
|
|
876
|
-
for (const
|
|
884
|
+
const i = [], r = [];
|
|
885
|
+
for (const o of e.assignedElements()) {
|
|
877
886
|
let n = null;
|
|
878
|
-
if (
|
|
887
|
+
if (o.tagName === "MP-RIBBON-CONTEXTUAL-TAB-SET" ? n = o : n = o.querySelector(
|
|
879
888
|
"mp-ribbon-contextual-tab-set"
|
|
880
889
|
), n) {
|
|
881
|
-
if (n.hasAttribute("hidden") ||
|
|
890
|
+
if (n.hasAttribute("hidden") || o.hasAttribute("hidden")) continue;
|
|
882
891
|
const a = n.getAttribute("color") ?? "#5BAEFF", h = n.getAttribute("label") ?? "", u = Array.from(
|
|
883
892
|
n.querySelectorAll("mp-ribbon-tab")
|
|
884
893
|
), f = [];
|
|
885
894
|
for (const m of u) {
|
|
886
895
|
const x = m.getAttribute("tab-id") ?? "";
|
|
887
|
-
|
|
896
|
+
i.push({
|
|
888
897
|
tabId: x,
|
|
889
898
|
label: m.getAttribute("label") ?? "",
|
|
890
899
|
element: m,
|
|
@@ -896,25 +905,25 @@ class k extends w {
|
|
|
896
905
|
continue;
|
|
897
906
|
}
|
|
898
907
|
let b = null;
|
|
899
|
-
|
|
908
|
+
o.tagName === "MP-RIBBON-TAB" ? b = o : b = o.querySelector("mp-ribbon-tab"), b && i.push({
|
|
900
909
|
tabId: b.getAttribute("tab-id") ?? "",
|
|
901
910
|
label: b.getAttribute("label") ?? "",
|
|
902
911
|
element: b
|
|
903
912
|
});
|
|
904
913
|
}
|
|
905
|
-
this.tabsList =
|
|
914
|
+
this.tabsList = i, this.contextualSets = r, !i.some((o) => o.tabId === this.activeTabId) && i.length > 0 ? this.activeTabId = i[0].tabId : !this.activeTabId && i.length > 0 && (this.activeTabId = i[0].tabId), this.applyActiveAttribute(), this.applyLayoutPropagation(), this.scheduleReflow();
|
|
906
915
|
}
|
|
907
916
|
applyActiveAttribute() {
|
|
908
917
|
for (const e of this.tabsList)
|
|
909
918
|
e.tabId === this.activeTabId ? e.element.setAttribute("active", "") : e.element.removeAttribute("active");
|
|
910
919
|
}
|
|
911
920
|
selectTab(e) {
|
|
912
|
-
const
|
|
921
|
+
const i = this.activeTabId;
|
|
913
922
|
this.activeTabId = e;
|
|
914
923
|
const r = this.tabsList.findIndex((t) => t.tabId === e);
|
|
915
924
|
r !== -1 && (this.currentTabIndex = r), this.dispatchEvent(
|
|
916
925
|
new CustomEvent("tab-change", {
|
|
917
|
-
detail: { previousTabId:
|
|
926
|
+
detail: { previousTabId: i, activeTabId: e },
|
|
918
927
|
bubbles: !0,
|
|
919
928
|
composed: !0
|
|
920
929
|
})
|
|
@@ -948,7 +957,7 @@ class k extends w {
|
|
|
948
957
|
if (this.minimized) return;
|
|
949
958
|
const e = this.tabsList.find((p) => p.tabId === this.activeTabId);
|
|
950
959
|
if (!e) return;
|
|
951
|
-
const
|
|
960
|
+
const i = e.element, r = this.collectActiveGroups(i);
|
|
952
961
|
if (r.length === 0) return;
|
|
953
962
|
if (this.layout === "simplified") {
|
|
954
963
|
for (const p of r)
|
|
@@ -958,13 +967,13 @@ class k extends w {
|
|
|
958
967
|
}
|
|
959
968
|
for (const p of r)
|
|
960
969
|
p.getAttribute("data-resolved-size") !== "popup" && this.naturalWidths.set(p, p.offsetWidth);
|
|
961
|
-
const t =
|
|
970
|
+
const t = i.reduceOrder, o = i.idealSizes;
|
|
962
971
|
if (t && t.length > 0) {
|
|
963
972
|
if (this.applyAuthorReduceOrder(
|
|
964
|
-
|
|
973
|
+
i,
|
|
965
974
|
r,
|
|
966
975
|
t,
|
|
967
|
-
|
|
976
|
+
o ?? {}
|
|
968
977
|
)) {
|
|
969
978
|
this.scheduleReflow();
|
|
970
979
|
return;
|
|
@@ -972,27 +981,27 @@ class k extends w {
|
|
|
972
981
|
this.diffCollapsedGroupsAndAnnounce(r);
|
|
973
982
|
return;
|
|
974
983
|
}
|
|
975
|
-
const n =
|
|
976
|
-
(p,
|
|
984
|
+
const n = i.clientWidth, b = 8, c = () => r.reduce(
|
|
985
|
+
(p, F, C) => p + F.offsetWidth + (C > 0 ? b : 0),
|
|
977
986
|
0
|
|
978
987
|
);
|
|
979
988
|
let a = !1;
|
|
980
989
|
const h = (p) => Number(p.getAttribute("priority") ?? "0"), u = (p) => p.getAttribute("auto-scale") !== "false", f = () => {
|
|
981
|
-
let p = null,
|
|
982
|
-
for (let
|
|
983
|
-
const
|
|
984
|
-
if (
|
|
985
|
-
const z = h(
|
|
986
|
-
(z <
|
|
990
|
+
let p = null, F = 1 / 0, C = -1;
|
|
991
|
+
for (let w = 0; w < r.length; w++) {
|
|
992
|
+
const I = r[w];
|
|
993
|
+
if (I.getAttribute("data-resolved-size") === "popup" || !u(I)) continue;
|
|
994
|
+
const z = h(I);
|
|
995
|
+
(z < F || z === F && w > C) && (p = I, F = z, C = w);
|
|
987
996
|
}
|
|
988
997
|
return p;
|
|
989
998
|
}, m = () => {
|
|
990
|
-
let p = null,
|
|
991
|
-
for (let
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
994
|
-
const z = h(
|
|
995
|
-
(z >
|
|
999
|
+
let p = null, F = -1 / 0, C = 1 / 0;
|
|
1000
|
+
for (let w = 0; w < r.length; w++) {
|
|
1001
|
+
const I = r[w];
|
|
1002
|
+
if (I.getAttribute("data-resolved-size") !== "popup") continue;
|
|
1003
|
+
const z = h(I);
|
|
1004
|
+
(z > F || z === F && w < C) && (p = I, F = z, C = w);
|
|
996
1005
|
}
|
|
997
1006
|
return p;
|
|
998
1007
|
};
|
|
@@ -1005,8 +1014,8 @@ class k extends w {
|
|
|
1005
1014
|
for (x = r.length; c() < n && x-- > 0; ) {
|
|
1006
1015
|
const p = m();
|
|
1007
1016
|
if (!p) break;
|
|
1008
|
-
const
|
|
1009
|
-
if (c() + (
|
|
1017
|
+
const F = this.naturalWidths.get(p) ?? 0, C = p.offsetWidth;
|
|
1018
|
+
if (c() + (F - C) > n) break;
|
|
1010
1019
|
p.removeAttribute("data-resolved-size"), a = !0;
|
|
1011
1020
|
}
|
|
1012
1021
|
if (a) {
|
|
@@ -1021,25 +1030,25 @@ class k extends w {
|
|
|
1021
1030
|
* default + author reduceOrder).
|
|
1022
1031
|
*/
|
|
1023
1032
|
diffCollapsedGroupsAndAnnounce(e) {
|
|
1024
|
-
const
|
|
1033
|
+
const i = /* @__PURE__ */ new Set();
|
|
1025
1034
|
for (const r of e)
|
|
1026
1035
|
if (r.getAttribute("data-resolved-size") === "popup") {
|
|
1027
|
-
|
|
1036
|
+
i.add(r);
|
|
1028
1037
|
const t = r.getAttribute("label") ?? "";
|
|
1029
1038
|
t && this.collapsedGroupLabels.set(r, t);
|
|
1030
1039
|
}
|
|
1031
|
-
for (const r of
|
|
1040
|
+
for (const r of i)
|
|
1032
1041
|
if (!this.previousCollapsedGroups.has(r)) {
|
|
1033
1042
|
const t = this.collapsedGroupLabels.get(r) ?? r.getAttribute("label") ?? "";
|
|
1034
1043
|
t && this.liveAnnouncer.announce(`${t} group collapsed`);
|
|
1035
1044
|
}
|
|
1036
1045
|
for (const r of this.previousCollapsedGroups)
|
|
1037
|
-
if (!
|
|
1046
|
+
if (!i.has(r)) {
|
|
1038
1047
|
const t = this.collapsedGroupLabels.get(r) ?? "";
|
|
1039
1048
|
t && this.liveAnnouncer.announce(`${t} group expanded`);
|
|
1040
1049
|
}
|
|
1041
1050
|
this.previousCollapsedGroups.clear();
|
|
1042
|
-
for (const r of
|
|
1051
|
+
for (const r of i) this.previousCollapsedGroups.add(r);
|
|
1043
1052
|
}
|
|
1044
1053
|
/**
|
|
1045
1054
|
* FR-6: walk an author-declared reduceOrder list. Returns true if any
|
|
@@ -1054,11 +1063,11 @@ class k extends w {
|
|
|
1054
1063
|
* author lists a step for them, we drop a console.warn at validate
|
|
1055
1064
|
* time and the runtime treats it as a no-op.
|
|
1056
1065
|
*/
|
|
1057
|
-
applyAuthorReduceOrder(e,
|
|
1058
|
-
const n = e.clientWidth, b = () =>
|
|
1066
|
+
applyAuthorReduceOrder(e, i, r, t) {
|
|
1067
|
+
const n = e.clientWidth, b = () => i.reduce(
|
|
1059
1068
|
(f, m, x) => f + m.offsetWidth + (x > 0 ? 8 : 0),
|
|
1060
1069
|
0
|
|
1061
|
-
), c = (f) =>
|
|
1070
|
+
), c = (f) => i.find((m) => m.getAttribute("group-id") === f) ?? null;
|
|
1062
1071
|
let a = this.appliedReduceSteps.get(e) ?? 0, h = !1, u = r.length - a;
|
|
1063
1072
|
for (; b() > n && a < r.length && u-- > 0; ) {
|
|
1064
1073
|
const [f, m] = r[a], x = c(f);
|
|
@@ -1088,11 +1097,11 @@ class k extends w {
|
|
|
1088
1097
|
* `steps` have been applied. The starting point is `idealSizes[groupId]`
|
|
1089
1098
|
* or `large` if unset.
|
|
1090
1099
|
*/
|
|
1091
|
-
sizeAtStepIndex(e,
|
|
1092
|
-
let
|
|
1093
|
-
for (let n = 0; n <
|
|
1094
|
-
e[n][0] === r && (
|
|
1095
|
-
return
|
|
1100
|
+
sizeAtStepIndex(e, i, r, t) {
|
|
1101
|
+
let o = t[r] ?? "large";
|
|
1102
|
+
for (let n = 0; n < i; n++)
|
|
1103
|
+
e[n][0] === r && (o = e[n][1]);
|
|
1104
|
+
return o;
|
|
1096
1105
|
}
|
|
1097
1106
|
/**
|
|
1098
1107
|
* Apply a resolved size to a group + mutate slotted item sizes so the
|
|
@@ -1100,20 +1109,20 @@ class k extends w {
|
|
|
1100
1109
|
* each item's original `size` to `originalItemSizes` the first time the
|
|
1101
1110
|
* group downsizes, so going back to `large` restores it.
|
|
1102
1111
|
*/
|
|
1103
|
-
applyGroupSize(e,
|
|
1104
|
-
if (
|
|
1112
|
+
applyGroupSize(e, i, r) {
|
|
1113
|
+
if (i === "popup") {
|
|
1105
1114
|
e.setAttribute("data-resolved-size", "popup");
|
|
1106
1115
|
return;
|
|
1107
1116
|
}
|
|
1108
|
-
|
|
1117
|
+
i === "large" ? e.removeAttribute("data-resolved-size") : e.setAttribute("data-resolved-size", i);
|
|
1109
1118
|
const t = this.collectGroupItems(e);
|
|
1110
|
-
for (const
|
|
1111
|
-
if (!this.originalItemSizes.has(
|
|
1112
|
-
const c =
|
|
1113
|
-
this.originalItemSizes.set(
|
|
1119
|
+
for (const o of t) {
|
|
1120
|
+
if (!this.originalItemSizes.has(o)) {
|
|
1121
|
+
const c = o.getAttribute("size") ?? "medium";
|
|
1122
|
+
this.originalItemSizes.set(o, c);
|
|
1114
1123
|
}
|
|
1115
|
-
const n = this.originalItemSizes.get(
|
|
1116
|
-
|
|
1124
|
+
const n = this.originalItemSizes.get(o), b = this.deriveItemSize(n, i);
|
|
1125
|
+
o.getAttribute("size") !== b && o.setAttribute("size", b);
|
|
1117
1126
|
}
|
|
1118
1127
|
}
|
|
1119
1128
|
/**
|
|
@@ -1121,8 +1130,8 @@ class k extends w {
|
|
|
1121
1130
|
* size and the group's resolved size. Items can only ever shrink, never
|
|
1122
1131
|
* grow above their original.
|
|
1123
1132
|
*/
|
|
1124
|
-
deriveItemSize(e,
|
|
1125
|
-
return
|
|
1133
|
+
deriveItemSize(e, i) {
|
|
1134
|
+
return i === "large" ? e : i === "small" ? "small" : e === "large" ? "medium" : e;
|
|
1126
1135
|
}
|
|
1127
1136
|
collectGroupItems(e) {
|
|
1128
1137
|
return Array.from(
|
|
@@ -1139,70 +1148,73 @@ class k extends w {
|
|
|
1139
1148
|
* root since each tab owns its own default slot.
|
|
1140
1149
|
*/
|
|
1141
1150
|
collectActiveGroups(e) {
|
|
1142
|
-
const
|
|
1143
|
-
if (!
|
|
1151
|
+
const i = e.shadowRoot?.querySelector("slot");
|
|
1152
|
+
if (!i) return [];
|
|
1144
1153
|
const r = [];
|
|
1145
|
-
for (const t of
|
|
1154
|
+
for (const t of i.assignedElements()) {
|
|
1146
1155
|
if (t.tagName === "MP-RIBBON-GROUP") {
|
|
1147
1156
|
r.push(t);
|
|
1148
1157
|
continue;
|
|
1149
1158
|
}
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1159
|
+
const o = t.querySelector("mp-ribbon-group");
|
|
1160
|
+
o && r.push(o);
|
|
1152
1161
|
}
|
|
1153
1162
|
return r;
|
|
1154
1163
|
}
|
|
1155
1164
|
}
|
|
1156
|
-
|
|
1165
|
+
A([
|
|
1157
1166
|
l({ type: String, attribute: "active-tab-id", reflect: !0 })
|
|
1158
|
-
],
|
|
1159
|
-
|
|
1167
|
+
], y.prototype, "activeTabId");
|
|
1168
|
+
A([
|
|
1160
1169
|
_()
|
|
1161
|
-
],
|
|
1162
|
-
|
|
1170
|
+
], y.prototype, "tabsList");
|
|
1171
|
+
A([
|
|
1163
1172
|
_()
|
|
1164
|
-
],
|
|
1165
|
-
|
|
1173
|
+
], y.prototype, "contextualSets");
|
|
1174
|
+
A([
|
|
1166
1175
|
l({ type: String, reflect: !0 })
|
|
1167
|
-
],
|
|
1168
|
-
|
|
1176
|
+
], y.prototype, "layout");
|
|
1177
|
+
A([
|
|
1178
|
+
l({ type: String, attribute: "region-label" })
|
|
1179
|
+
], y.prototype, "regionLabel");
|
|
1180
|
+
A([
|
|
1169
1181
|
l({ type: Boolean })
|
|
1170
|
-
],
|
|
1171
|
-
|
|
1182
|
+
], y.prototype, "minimized");
|
|
1183
|
+
A([
|
|
1172
1184
|
l({ type: String, reflect: !0 })
|
|
1173
|
-
],
|
|
1174
|
-
|
|
1185
|
+
], y.prototype, "version");
|
|
1186
|
+
A([
|
|
1175
1187
|
l({ type: String, attribute: "color-scheme", reflect: !0 })
|
|
1176
|
-
],
|
|
1177
|
-
|
|
1188
|
+
], y.prototype, "colorScheme");
|
|
1189
|
+
A([
|
|
1178
1190
|
l({ type: String, attribute: "touch-mode", reflect: !0 })
|
|
1179
|
-
],
|
|
1180
|
-
|
|
1191
|
+
], y.prototype, "touchMode");
|
|
1192
|
+
A([
|
|
1181
1193
|
l({ type: String, attribute: "key-tips" })
|
|
1182
|
-
],
|
|
1183
|
-
|
|
1194
|
+
], y.prototype, "keyTips");
|
|
1195
|
+
A([
|
|
1184
1196
|
_()
|
|
1185
|
-
],
|
|
1186
|
-
|
|
1197
|
+
], y.prototype, "keyTipMode");
|
|
1198
|
+
A([
|
|
1187
1199
|
_()
|
|
1188
|
-
],
|
|
1189
|
-
typeof customElements < "u" && !customElements.get("mp-ribbon") && customElements.define("mp-ribbon",
|
|
1190
|
-
var ae = Object.defineProperty, Z = (s, e,
|
|
1191
|
-
for (var t = void 0,
|
|
1192
|
-
(n = s[
|
|
1193
|
-
return t && ae(e,
|
|
1200
|
+
], y.prototype, "keyTipBadges");
|
|
1201
|
+
typeof customElements < "u" && !customElements.get("mp-ribbon") && customElements.define("mp-ribbon", y);
|
|
1202
|
+
var ae = Object.defineProperty, Z = (s, e, i, r) => {
|
|
1203
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
1204
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
1205
|
+
return t && ae(e, i, t), t;
|
|
1194
1206
|
};
|
|
1195
|
-
class N extends
|
|
1207
|
+
class N extends k {
|
|
1196
1208
|
constructor() {
|
|
1197
1209
|
super(...arguments), this.label = "Quick Access Toolbar", this.touchMode = "auto", this.onKeyDown = (e) => {
|
|
1198
|
-
const { key:
|
|
1199
|
-
if (
|
|
1210
|
+
const { key: i } = e;
|
|
1211
|
+
if (i !== "ArrowLeft" && i !== "ArrowRight" && i !== "Home" && i !== "End")
|
|
1200
1212
|
return;
|
|
1201
1213
|
const r = this.collectItems();
|
|
1202
1214
|
if (r.length === 0) return;
|
|
1203
|
-
const t = e.composedPath(),
|
|
1204
|
-
let a =
|
|
1205
|
-
c ? a = Math.max(0,
|
|
1215
|
+
const t = e.composedPath(), o = r.findIndex((h) => t.includes(h)), n = getComputedStyle(this).direction === "rtl", b = n ? i === "ArrowLeft" : i === "ArrowRight", c = n ? i === "ArrowRight" : i === "ArrowLeft";
|
|
1216
|
+
let a = o;
|
|
1217
|
+
c ? a = Math.max(0, o - 1) : b ? a = Math.min(r.length - 1, o + 1) : i === "Home" ? a = 0 : i === "End" && (a = r.length - 1), a !== o && a >= 0 && (r[a].focus(), e.preventDefault());
|
|
1206
1218
|
};
|
|
1207
1219
|
}
|
|
1208
1220
|
static {
|
|
@@ -1288,14 +1300,14 @@ class N extends w {
|
|
|
1288
1300
|
collectItems() {
|
|
1289
1301
|
const e = this.renderRoot.querySelector("slot");
|
|
1290
1302
|
if (!e) return [];
|
|
1291
|
-
const
|
|
1303
|
+
const i = [];
|
|
1292
1304
|
for (const r of e.assignedElements()) {
|
|
1293
|
-
const
|
|
1305
|
+
const o = r.querySelector(
|
|
1294
1306
|
"mp-ribbon-button, mp-ribbon-toggle-button, mp-ribbon-checkbox, mp-ribbon-split-button, mp-ribbon-dropdown-button"
|
|
1295
1307
|
) ?? r;
|
|
1296
|
-
|
|
1308
|
+
o.tagName.startsWith("MP-RIBBON-") && !o.hasAttribute("disabled") && i.push(o);
|
|
1297
1309
|
}
|
|
1298
|
-
return
|
|
1310
|
+
return i;
|
|
1299
1311
|
}
|
|
1300
1312
|
}
|
|
1301
1313
|
Z([
|
|
@@ -1305,13 +1317,13 @@ Z([
|
|
|
1305
1317
|
l({ type: String, attribute: "touch-mode", reflect: !0 })
|
|
1306
1318
|
], N.prototype, "touchMode");
|
|
1307
1319
|
typeof customElements < "u" && !customElements.get("mp-quick-access-toolbar") && customElements.define("mp-quick-access-toolbar", N);
|
|
1308
|
-
var le = Object.defineProperty, E = (s, e,
|
|
1309
|
-
for (var t = void 0,
|
|
1310
|
-
(n = s[
|
|
1311
|
-
return t && le(e,
|
|
1320
|
+
var le = Object.defineProperty, E = (s, e, i, r) => {
|
|
1321
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
1322
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
1323
|
+
return t && le(e, i, t), t;
|
|
1312
1324
|
};
|
|
1313
1325
|
const de = "mp-ribbon-button, mp-ribbon-toggle-button, mp-ribbon-checkbox, mp-ribbon-combobox, mp-ribbon-color-picker, mp-ribbon-group-button, mp-ribbon-split-button, mp-ribbon-dropdown-button, mp-ribbon-gallery";
|
|
1314
|
-
class
|
|
1326
|
+
class $ extends k {
|
|
1315
1327
|
constructor() {
|
|
1316
1328
|
super(...arguments), this.tabId = "", this.label = "", this.active = !1, this.idealSizes = {}, this.reduceOrder = [], this.overflowEntries = [], this.overflowOverlay = new G(this, {
|
|
1317
1329
|
anchor: () => this.overflowTriggerEl ?? null,
|
|
@@ -1435,7 +1447,7 @@ class I extends w {
|
|
|
1435
1447
|
`;
|
|
1436
1448
|
}
|
|
1437
1449
|
connectedCallback() {
|
|
1438
|
-
super.connectedCallback(),
|
|
1450
|
+
super.connectedCallback(), typeof ResizeObserver < "u" && (this.overflowResizeObserver = new ResizeObserver(
|
|
1439
1451
|
() => this.scheduleOverflowReflow()
|
|
1440
1452
|
), this.overflowResizeObserver.observe(this));
|
|
1441
1453
|
}
|
|
@@ -1443,7 +1455,7 @@ class I extends w {
|
|
|
1443
1455
|
super.disconnectedCallback(), this.overflowResizeObserver?.disconnect(), this.overflowResizeObserver = void 0, this.overflowReflowFrame && cancelAnimationFrame(this.overflowReflowFrame);
|
|
1444
1456
|
}
|
|
1445
1457
|
updated(e) {
|
|
1446
|
-
|
|
1458
|
+
(e.has("reduceOrder") || e.has("idealSizes")) && this.validateReduceOrder(), e.has("active") && this.active && this.scheduleOverflowReflow();
|
|
1447
1459
|
}
|
|
1448
1460
|
/**
|
|
1449
1461
|
* Validates the author-declared reduceOrder against the FR-6 rules:
|
|
@@ -1462,16 +1474,16 @@ class I extends w {
|
|
|
1462
1474
|
medium: 2,
|
|
1463
1475
|
small: 1,
|
|
1464
1476
|
popup: 0
|
|
1465
|
-
},
|
|
1477
|
+
}, i = (t) => this.idealSizes[t] ?? "large", r = /* @__PURE__ */ new Map();
|
|
1466
1478
|
for (let t = 0; t < this.reduceOrder.length; t++) {
|
|
1467
|
-
const
|
|
1479
|
+
const o = this.reduceOrder[t], [n, b] = o;
|
|
1468
1480
|
if (!(b in e)) {
|
|
1469
1481
|
console.warn(
|
|
1470
1482
|
`[mp-ribbon-tab "${this.tabId}"] reduceOrder[${t}] has invalid size "${b}". Expected large | medium | small | popup.`
|
|
1471
1483
|
);
|
|
1472
1484
|
continue;
|
|
1473
1485
|
}
|
|
1474
|
-
const c = r.get(n) ??
|
|
1486
|
+
const c = r.get(n) ?? i(n);
|
|
1475
1487
|
if (e[b] >= e[c]) {
|
|
1476
1488
|
console.warn(
|
|
1477
1489
|
`[mp-ribbon-tab "${this.tabId}"] reduceOrder[${t}] for "${n}" goes ${c} → ${b}, which is not a reduction. Steps must monotonically decrease size per group.`
|
|
@@ -1506,7 +1518,7 @@ class I extends w {
|
|
|
1506
1518
|
type="button"
|
|
1507
1519
|
@click="${() => this.activateOverflowEntry(e)}"
|
|
1508
1520
|
>
|
|
1509
|
-
${e.icon ? d`<span class="overflow-entry-icon">${e.icon}</span>` :
|
|
1521
|
+
${e.icon ? d`<span class="overflow-entry-icon">${e.icon}</span>` : L}
|
|
1510
1522
|
<span>${e.label || "(unnamed)"}</span>
|
|
1511
1523
|
</button>
|
|
1512
1524
|
`
|
|
@@ -1515,26 +1527,26 @@ class I extends w {
|
|
|
1515
1527
|
`;
|
|
1516
1528
|
}
|
|
1517
1529
|
reflowSimplifiedOverflow() {
|
|
1518
|
-
const e = this.getAttribute("data-ribbon-layout") === "simplified",
|
|
1530
|
+
const e = this.getAttribute("data-ribbon-layout") === "simplified", i = Array.from(
|
|
1519
1531
|
this.querySelectorAll("mp-ribbon-group")
|
|
1520
1532
|
);
|
|
1521
1533
|
if (!e) {
|
|
1522
|
-
for (const a of
|
|
1534
|
+
for (const a of i) a.removeAttribute("data-overflow-hidden");
|
|
1523
1535
|
this.overflowEntries = [], this.removeAttribute("data-has-overflow"), this.overflowOverlay.isOpen && this.overflowOverlay.close(!1);
|
|
1524
1536
|
return;
|
|
1525
1537
|
}
|
|
1526
|
-
for (const a of
|
|
1538
|
+
for (const a of i) a.removeAttribute("data-overflow-hidden");
|
|
1527
1539
|
const r = this.clientWidth;
|
|
1528
|
-
if (r <= 0 ||
|
|
1540
|
+
if (r <= 0 || i.length === 0) {
|
|
1529
1541
|
this.overflowEntries = [], this.removeAttribute("data-has-overflow");
|
|
1530
1542
|
return;
|
|
1531
1543
|
}
|
|
1532
|
-
const t = 40,
|
|
1544
|
+
const t = 40, o = 8;
|
|
1533
1545
|
let n = 0;
|
|
1534
1546
|
const b = [];
|
|
1535
|
-
for (let a = 0; a <
|
|
1536
|
-
const h =
|
|
1537
|
-
n += h.offsetWidth + (a > 0 ?
|
|
1547
|
+
for (let a = 0; a < i.length; a++) {
|
|
1548
|
+
const h = i[a];
|
|
1549
|
+
n += h.offsetWidth + (a > 0 ? o : 0), n > r - t && b.push(h);
|
|
1538
1550
|
}
|
|
1539
1551
|
for (const a of b) a.setAttribute("data-overflow-hidden", "");
|
|
1540
1552
|
const c = [];
|
|
@@ -1556,35 +1568,35 @@ class I extends w {
|
|
|
1556
1568
|
}
|
|
1557
1569
|
E([
|
|
1558
1570
|
l({ type: String, attribute: "tab-id", reflect: !0 })
|
|
1559
|
-
],
|
|
1571
|
+
], $.prototype, "tabId");
|
|
1560
1572
|
E([
|
|
1561
1573
|
l({ type: String, reflect: !0 })
|
|
1562
|
-
],
|
|
1574
|
+
], $.prototype, "label");
|
|
1563
1575
|
E([
|
|
1564
1576
|
l({ type: Boolean, reflect: !0 })
|
|
1565
|
-
],
|
|
1577
|
+
], $.prototype, "active");
|
|
1566
1578
|
E([
|
|
1567
1579
|
l({ attribute: !1 })
|
|
1568
|
-
],
|
|
1580
|
+
], $.prototype, "idealSizes");
|
|
1569
1581
|
E([
|
|
1570
1582
|
l({ attribute: !1 })
|
|
1571
|
-
],
|
|
1583
|
+
], $.prototype, "reduceOrder");
|
|
1572
1584
|
E([
|
|
1573
1585
|
_()
|
|
1574
|
-
],
|
|
1586
|
+
], $.prototype, "overflowEntries");
|
|
1575
1587
|
E([
|
|
1576
1588
|
S(".overflow-trigger")
|
|
1577
|
-
],
|
|
1589
|
+
], $.prototype, "overflowTriggerEl");
|
|
1578
1590
|
E([
|
|
1579
1591
|
S(".overflow-panel")
|
|
1580
|
-
],
|
|
1581
|
-
customElements.define("mp-ribbon-tab",
|
|
1582
|
-
var ce = Object.defineProperty, W = (s, e,
|
|
1583
|
-
for (var t = void 0,
|
|
1584
|
-
(n = s[
|
|
1585
|
-
return t && ce(e,
|
|
1592
|
+
], $.prototype, "overflowPanelEl");
|
|
1593
|
+
customElements.define("mp-ribbon-tab", $);
|
|
1594
|
+
var ce = Object.defineProperty, W = (s, e, i, r) => {
|
|
1595
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
1596
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
1597
|
+
return t && ce(e, i, t), t;
|
|
1586
1598
|
};
|
|
1587
|
-
class j extends
|
|
1599
|
+
class j extends k {
|
|
1588
1600
|
constructor() {
|
|
1589
1601
|
super(...arguments), this.label = "", this.color = "#F0AF84", this.hidden = !1;
|
|
1590
1602
|
}
|
|
@@ -1616,12 +1628,12 @@ W([
|
|
|
1616
1628
|
l({ type: Boolean, reflect: !0 })
|
|
1617
1629
|
], j.prototype, "hidden");
|
|
1618
1630
|
customElements.define("mp-ribbon-contextual-tab-set", j);
|
|
1619
|
-
var pe = Object.defineProperty, O = (s, e,
|
|
1620
|
-
for (var t = void 0,
|
|
1621
|
-
(n = s[
|
|
1622
|
-
return t && pe(e,
|
|
1631
|
+
var pe = Object.defineProperty, O = (s, e, i, r) => {
|
|
1632
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
1633
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
1634
|
+
return t && pe(e, i, t), t;
|
|
1623
1635
|
};
|
|
1624
|
-
const T = class U extends
|
|
1636
|
+
const T = class U extends k {
|
|
1625
1637
|
constructor() {
|
|
1626
1638
|
super(...arguments), this.groupId = "", this.label = "", this.icon = "", this.dialogLauncher = "", this.resolvedSize = "", this.priority = 0, this.autoScale = "true", this.overlay = new G(this, {
|
|
1627
1639
|
anchor: () => this.renderRoot.querySelector(".ribbon-popup-trigger"),
|
|
@@ -1633,15 +1645,15 @@ const T = class U extends w {
|
|
|
1633
1645
|
}), this.onFocusIn = (e) => {
|
|
1634
1646
|
if (!e.target) return;
|
|
1635
1647
|
const t = e.composedPath().find(
|
|
1636
|
-
(
|
|
1648
|
+
(o) => o instanceof HTMLElement && o.matches(U.ITEM_SELECTOR) && this.contains(o)
|
|
1637
1649
|
);
|
|
1638
1650
|
if (t)
|
|
1639
|
-
for (const
|
|
1640
|
-
|
|
1651
|
+
for (const o of this.collectItems())
|
|
1652
|
+
o.setAttribute("tabindex", o === t ? "0" : "-1");
|
|
1641
1653
|
}, this.onGroupKeyDown = (e) => {
|
|
1642
1654
|
if (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) return;
|
|
1643
|
-
const { key:
|
|
1644
|
-
if (
|
|
1655
|
+
const { key: i } = e;
|
|
1656
|
+
if (i !== "ArrowLeft" && i !== "ArrowRight" && i !== "Home" && i !== "End")
|
|
1645
1657
|
return;
|
|
1646
1658
|
const r = e.composedPath(), t = r[0];
|
|
1647
1659
|
if (t && t instanceof HTMLElement) {
|
|
@@ -1650,13 +1662,13 @@ const T = class U extends w {
|
|
|
1650
1662
|
}
|
|
1651
1663
|
if (r.some((f) => f instanceof HTMLElement && f.tagName === "MP-RIBBON-GALLERY"))
|
|
1652
1664
|
return;
|
|
1653
|
-
const
|
|
1654
|
-
if (
|
|
1665
|
+
const o = this.collectItems();
|
|
1666
|
+
if (o.length === 0) return;
|
|
1655
1667
|
const n = r.find(
|
|
1656
|
-
(f) => f instanceof HTMLElement &&
|
|
1657
|
-
), b = n ?
|
|
1668
|
+
(f) => f instanceof HTMLElement && o.includes(f)
|
|
1669
|
+
), b = n ? o.indexOf(n) : -1, c = getComputedStyle(this).direction === "rtl", a = c ? i === "ArrowLeft" : i === "ArrowRight", h = c ? i === "ArrowRight" : i === "ArrowLeft";
|
|
1658
1670
|
let u = b;
|
|
1659
|
-
h ? u = b <= 0 ?
|
|
1671
|
+
h ? u = b <= 0 ? o.length - 1 : b - 1 : a ? u = b >= o.length - 1 ? 0 : b + 1 : i === "Home" ? u = 0 : i === "End" && (u = o.length - 1), u !== b && u >= 0 && (o[u].focus(), e.preventDefault());
|
|
1660
1672
|
}, this.onTriggerClick = async (e) => {
|
|
1661
1673
|
e.stopPropagation(), await this.overlay.toggle();
|
|
1662
1674
|
}, this.onTriggerKeyDown = async (e) => {
|
|
@@ -1852,10 +1864,10 @@ const T = class U extends w {
|
|
|
1852
1864
|
applyRovingTabindex() {
|
|
1853
1865
|
const e = this.collectItems();
|
|
1854
1866
|
if (e.length === 0) return;
|
|
1855
|
-
let
|
|
1856
|
-
|
|
1867
|
+
let i = e.find((r) => r.getAttribute("tabindex") === "0");
|
|
1868
|
+
i || (i = e[0]);
|
|
1857
1869
|
for (const r of e)
|
|
1858
|
-
r.setAttribute("tabindex", r ===
|
|
1870
|
+
r.setAttribute("tabindex", r === i ? "0" : "-1");
|
|
1859
1871
|
}
|
|
1860
1872
|
collectItems() {
|
|
1861
1873
|
return Array.from(
|
|
@@ -1882,7 +1894,7 @@ const T = class U extends w {
|
|
|
1882
1894
|
title="${this.dialogLauncher}"
|
|
1883
1895
|
aria-label="${this.dialogLauncher}"
|
|
1884
1896
|
@click="${this.onDialogLauncherClick}"
|
|
1885
|
-
>⬘</button>` :
|
|
1897
|
+
>⬘</button>` : L}
|
|
1886
1898
|
</div>
|
|
1887
1899
|
</div>
|
|
1888
1900
|
<button
|
|
@@ -1894,7 +1906,7 @@ const T = class U extends w {
|
|
|
1894
1906
|
@click="${this.onTriggerClick}"
|
|
1895
1907
|
@keydown="${this.onTriggerKeyDown}"
|
|
1896
1908
|
>
|
|
1897
|
-
${this.icon ? d`<span class="ribbon-popup-trigger-icon">${this.icon}</span>` :
|
|
1909
|
+
${this.icon ? d`<span class="ribbon-popup-trigger-icon">${this.icon}</span>` : L}
|
|
1898
1910
|
<span class="ribbon-popup-trigger-label">
|
|
1899
1911
|
${this.label}
|
|
1900
1912
|
<span class="ribbon-popup-trigger-chevron">▼</span>
|
|
@@ -1935,10 +1947,10 @@ O([
|
|
|
1935
1947
|
], T.prototype, "autoScale");
|
|
1936
1948
|
let ue = T;
|
|
1937
1949
|
customElements.define("mp-ribbon-group", ue);
|
|
1938
|
-
var he = Object.defineProperty,
|
|
1939
|
-
for (var t = void 0,
|
|
1940
|
-
(n = s[
|
|
1941
|
-
return t && he(e,
|
|
1950
|
+
var he = Object.defineProperty, B = (s, e, i, r) => {
|
|
1951
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
1952
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
1953
|
+
return t && he(e, i, t), t;
|
|
1942
1954
|
};
|
|
1943
1955
|
const P = g`
|
|
1944
1956
|
:host([size="large"]) ::slotted([slot="icon"]) {
|
|
@@ -1978,13 +1990,13 @@ const P = g`
|
|
|
1978
1990
|
line-height: 1 !important;
|
|
1979
1991
|
}
|
|
1980
1992
|
`;
|
|
1981
|
-
class v extends
|
|
1993
|
+
class v extends k {
|
|
1982
1994
|
constructor() {
|
|
1983
1995
|
super(...arguments), this.itemId = "", this.label = "", this.icon = "", this.size = "medium", this.disabled = !1, this.tooltip = "";
|
|
1984
1996
|
}
|
|
1985
1997
|
static {
|
|
1986
1998
|
this.shadowRootOptions = {
|
|
1987
|
-
...
|
|
1999
|
+
...k.shadowRootOptions,
|
|
1988
2000
|
delegatesFocus: !0
|
|
1989
2001
|
};
|
|
1990
2002
|
}
|
|
@@ -2017,22 +2029,22 @@ class v extends w {
|
|
|
2017
2029
|
super.updated(e), e.has("size") && this.setAttribute("data-size", this.size);
|
|
2018
2030
|
}
|
|
2019
2031
|
}
|
|
2020
|
-
|
|
2032
|
+
B([
|
|
2021
2033
|
l({ type: String, attribute: "item-id" })
|
|
2022
2034
|
], v.prototype, "itemId");
|
|
2023
|
-
|
|
2035
|
+
B([
|
|
2024
2036
|
l({ type: String })
|
|
2025
2037
|
], v.prototype, "label");
|
|
2026
|
-
|
|
2038
|
+
B([
|
|
2027
2039
|
l({ type: String })
|
|
2028
2040
|
], v.prototype, "icon");
|
|
2029
|
-
|
|
2041
|
+
B([
|
|
2030
2042
|
l({ type: String, reflect: !0 })
|
|
2031
2043
|
], v.prototype, "size");
|
|
2032
|
-
|
|
2044
|
+
B([
|
|
2033
2045
|
l({ type: Boolean })
|
|
2034
2046
|
], v.prototype, "disabled");
|
|
2035
|
-
|
|
2047
|
+
B([
|
|
2036
2048
|
l({ type: String })
|
|
2037
2049
|
], v.prototype, "tooltip");
|
|
2038
2050
|
class fe extends v {
|
|
@@ -2104,10 +2116,10 @@ class fe extends v {
|
|
|
2104
2116
|
}
|
|
2105
2117
|
}
|
|
2106
2118
|
customElements.define("mp-ribbon-button", fe);
|
|
2107
|
-
var ge = Object.defineProperty, H = (s, e,
|
|
2108
|
-
for (var t = void 0,
|
|
2109
|
-
(n = s[
|
|
2110
|
-
return t && ge(e,
|
|
2119
|
+
var ge = Object.defineProperty, H = (s, e, i, r) => {
|
|
2120
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2121
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2122
|
+
return t && ge(e, i, t), t;
|
|
2111
2123
|
};
|
|
2112
2124
|
class q extends v {
|
|
2113
2125
|
constructor() {
|
|
@@ -2290,10 +2302,10 @@ H([
|
|
|
2290
2302
|
S(".menu-panel")
|
|
2291
2303
|
], q.prototype, "panelEl");
|
|
2292
2304
|
customElements.define("mp-ribbon-split-button", q);
|
|
2293
|
-
var me = Object.defineProperty, X = (s, e,
|
|
2294
|
-
for (var t = void 0,
|
|
2295
|
-
(n = s[
|
|
2296
|
-
return t && me(e,
|
|
2305
|
+
var me = Object.defineProperty, X = (s, e, i, r) => {
|
|
2306
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2307
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2308
|
+
return t && me(e, i, t), t;
|
|
2297
2309
|
};
|
|
2298
2310
|
class V extends v {
|
|
2299
2311
|
constructor() {
|
|
@@ -2431,10 +2443,10 @@ X([
|
|
|
2431
2443
|
S(".menu-panel")
|
|
2432
2444
|
], V.prototype, "panelEl");
|
|
2433
2445
|
customElements.define("mp-ribbon-dropdown-button", V);
|
|
2434
|
-
var ve = Object.defineProperty, xe = (s, e,
|
|
2435
|
-
for (var t = void 0,
|
|
2436
|
-
(n = s[
|
|
2437
|
-
return t && ve(e,
|
|
2446
|
+
var ve = Object.defineProperty, xe = (s, e, i, r) => {
|
|
2447
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2448
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2449
|
+
return t && ve(e, i, t), t;
|
|
2438
2450
|
};
|
|
2439
2451
|
class J extends v {
|
|
2440
2452
|
constructor() {
|
|
@@ -2523,10 +2535,10 @@ xe([
|
|
|
2523
2535
|
l({ type: Boolean, reflect: !0 })
|
|
2524
2536
|
], J.prototype, "pressed");
|
|
2525
2537
|
customElements.define("mp-ribbon-toggle-button", J);
|
|
2526
|
-
var ye = Object.defineProperty, we = (s, e,
|
|
2527
|
-
for (var t = void 0,
|
|
2528
|
-
(n = s[
|
|
2529
|
-
return t && ye(e,
|
|
2538
|
+
var ye = Object.defineProperty, we = (s, e, i, r) => {
|
|
2539
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2540
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2541
|
+
return t && ye(e, i, t), t;
|
|
2530
2542
|
};
|
|
2531
2543
|
class ee extends v {
|
|
2532
2544
|
constructor() {
|
|
@@ -2584,8 +2596,8 @@ class ee extends v {
|
|
|
2584
2596
|
}
|
|
2585
2597
|
onCheckChange(e) {
|
|
2586
2598
|
if (this.disabled) return;
|
|
2587
|
-
const
|
|
2588
|
-
this.checked =
|
|
2599
|
+
const i = e.target;
|
|
2600
|
+
this.checked = i.checked, this.dispatchEvent(
|
|
2589
2601
|
new CustomEvent("check-change", {
|
|
2590
2602
|
detail: { itemId: this.itemId, checked: this.checked },
|
|
2591
2603
|
bubbles: !0,
|
|
@@ -2598,10 +2610,10 @@ we([
|
|
|
2598
2610
|
l({ type: Boolean, reflect: !0 })
|
|
2599
2611
|
], ee.prototype, "checked");
|
|
2600
2612
|
customElements.define("mp-ribbon-checkbox", ee);
|
|
2601
|
-
var ke = Object.defineProperty, te = (s, e,
|
|
2602
|
-
for (var t = void 0,
|
|
2603
|
-
(n = s[
|
|
2604
|
-
return t && ke(e,
|
|
2613
|
+
var ke = Object.defineProperty, te = (s, e, i, r) => {
|
|
2614
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2615
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2616
|
+
return t && ke(e, i, t), t;
|
|
2605
2617
|
};
|
|
2606
2618
|
class Q extends v {
|
|
2607
2619
|
constructor() {
|
|
@@ -2651,8 +2663,8 @@ class Q extends v {
|
|
|
2651
2663
|
}
|
|
2652
2664
|
onComboChange(e) {
|
|
2653
2665
|
if (this.disabled) return;
|
|
2654
|
-
const
|
|
2655
|
-
this.value =
|
|
2666
|
+
const i = e.target;
|
|
2667
|
+
this.value = i.value, this.dispatchEvent(
|
|
2656
2668
|
new CustomEvent("value-change", {
|
|
2657
2669
|
detail: { itemId: this.itemId, value: this.value },
|
|
2658
2670
|
bubbles: !0,
|
|
@@ -2668,12 +2680,12 @@ te([
|
|
|
2668
2680
|
l({ type: Array })
|
|
2669
2681
|
], Q.prototype, "options");
|
|
2670
2682
|
customElements.define("mp-ribbon-combobox", Q);
|
|
2671
|
-
var Ae = Object.defineProperty, Fe = (s, e,
|
|
2672
|
-
for (var t = void 0,
|
|
2673
|
-
(n = s[
|
|
2674
|
-
return t && Ae(e,
|
|
2683
|
+
var Ae = Object.defineProperty, Fe = (s, e, i, r) => {
|
|
2684
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2685
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2686
|
+
return t && Ae(e, i, t), t;
|
|
2675
2687
|
};
|
|
2676
|
-
class
|
|
2688
|
+
class ie extends v {
|
|
2677
2689
|
constructor() {
|
|
2678
2690
|
super(...arguments), this.color = "#000000";
|
|
2679
2691
|
}
|
|
@@ -2744,8 +2756,8 @@ class oe extends v {
|
|
|
2744
2756
|
}
|
|
2745
2757
|
onColorChange(e) {
|
|
2746
2758
|
if (this.disabled) return;
|
|
2747
|
-
const
|
|
2748
|
-
this.color =
|
|
2759
|
+
const i = e.target;
|
|
2760
|
+
this.color = i.value, this.dispatchEvent(
|
|
2749
2761
|
new CustomEvent("color-change", {
|
|
2750
2762
|
detail: { itemId: this.itemId, color: this.color },
|
|
2751
2763
|
bubbles: !0,
|
|
@@ -2756,12 +2768,12 @@ class oe extends v {
|
|
|
2756
2768
|
}
|
|
2757
2769
|
Fe([
|
|
2758
2770
|
l({ type: String, reflect: !0 })
|
|
2759
|
-
],
|
|
2760
|
-
customElements.define("mp-ribbon-color-picker",
|
|
2761
|
-
var Ce = Object.defineProperty,
|
|
2762
|
-
for (var t = void 0,
|
|
2763
|
-
(n = s[
|
|
2764
|
-
return t && Ce(e,
|
|
2771
|
+
], ie.prototype, "color");
|
|
2772
|
+
customElements.define("mp-ribbon-color-picker", ie);
|
|
2773
|
+
var Ce = Object.defineProperty, oe = (s, e, i, r) => {
|
|
2774
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2775
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2776
|
+
return t && Ce(e, i, t), t;
|
|
2765
2777
|
};
|
|
2766
2778
|
class Y extends v {
|
|
2767
2779
|
constructor() {
|
|
@@ -2822,7 +2834,7 @@ class Y extends v {
|
|
|
2822
2834
|
role="radio"
|
|
2823
2835
|
aria-checked="${this.selectedValue === e.value}"
|
|
2824
2836
|
title="${e.label}"
|
|
2825
|
-
@click="${(
|
|
2837
|
+
@click="${(i) => this.onSelect(i, e.value)}"
|
|
2826
2838
|
>
|
|
2827
2839
|
${e.icon ? d`<span class="ribbon-group-button-icon">${e.icon}</span>` : ""}
|
|
2828
2840
|
${e.label ? d`<span class="ribbon-group-button-label">${e.label}</span>` : ""}
|
|
@@ -2832,8 +2844,8 @@ class Y extends v {
|
|
|
2832
2844
|
</div>
|
|
2833
2845
|
`;
|
|
2834
2846
|
}
|
|
2835
|
-
onSelect(e,
|
|
2836
|
-
e.stopPropagation(), !this.disabled && (this.selectedValue =
|
|
2847
|
+
onSelect(e, i) {
|
|
2848
|
+
e.stopPropagation(), !this.disabled && (this.selectedValue = i, this.dispatchEvent(
|
|
2837
2849
|
new CustomEvent("group-select", {
|
|
2838
2850
|
detail: { itemId: this.itemId, value: this.selectedValue },
|
|
2839
2851
|
bubbles: !0,
|
|
@@ -2842,17 +2854,17 @@ class Y extends v {
|
|
|
2842
2854
|
));
|
|
2843
2855
|
}
|
|
2844
2856
|
}
|
|
2845
|
-
|
|
2857
|
+
oe([
|
|
2846
2858
|
l({ type: String, attribute: "selected-value", reflect: !0 })
|
|
2847
2859
|
], Y.prototype, "selectedValue");
|
|
2848
|
-
|
|
2860
|
+
oe([
|
|
2849
2861
|
l({ type: Array })
|
|
2850
2862
|
], Y.prototype, "buttons");
|
|
2851
2863
|
customElements.define("mp-ribbon-group-button", Y);
|
|
2852
|
-
var
|
|
2853
|
-
for (var t = void 0,
|
|
2854
|
-
(n = s[
|
|
2855
|
-
return t &&
|
|
2864
|
+
var $e = Object.defineProperty, Ie = (s, e, i, r) => {
|
|
2865
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2866
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2867
|
+
return t && $e(e, i, t), t;
|
|
2856
2868
|
};
|
|
2857
2869
|
class re extends v {
|
|
2858
2870
|
constructor() {
|
|
@@ -2884,16 +2896,16 @@ class re extends v {
|
|
|
2884
2896
|
`;
|
|
2885
2897
|
}
|
|
2886
2898
|
}
|
|
2887
|
-
|
|
2899
|
+
Ie([
|
|
2888
2900
|
l({ type: Number })
|
|
2889
2901
|
], re.prototype, "columns");
|
|
2890
2902
|
customElements.define("mp-ribbon-gallery", re);
|
|
2891
|
-
var Ee = Object.defineProperty, K = (s, e,
|
|
2892
|
-
for (var t = void 0,
|
|
2893
|
-
(n = s[
|
|
2894
|
-
return t && Ee(e,
|
|
2903
|
+
var Ee = Object.defineProperty, K = (s, e, i, r) => {
|
|
2904
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2905
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2906
|
+
return t && Ee(e, i, t), t;
|
|
2895
2907
|
};
|
|
2896
|
-
class M extends
|
|
2908
|
+
class M extends k {
|
|
2897
2909
|
constructor() {
|
|
2898
2910
|
super(...arguments), this.itemId = "", this.label = "", this.icon = "", this.selected = !1, this.disabled = !1;
|
|
2899
2911
|
}
|
|
@@ -2975,12 +2987,12 @@ K([
|
|
|
2975
2987
|
l({ type: Boolean })
|
|
2976
2988
|
], M.prototype, "disabled");
|
|
2977
2989
|
customElements.define("mp-ribbon-gallery-item", M);
|
|
2978
|
-
var Te = Object.defineProperty, ze = (s, e,
|
|
2979
|
-
for (var t = void 0,
|
|
2980
|
-
(n = s[
|
|
2981
|
-
return t && Te(e,
|
|
2990
|
+
var Te = Object.defineProperty, ze = (s, e, i, r) => {
|
|
2991
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
2992
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
2993
|
+
return t && Te(e, i, t), t;
|
|
2982
2994
|
};
|
|
2983
|
-
class ne extends
|
|
2995
|
+
class ne extends k {
|
|
2984
2996
|
constructor() {
|
|
2985
2997
|
super(...arguments), this.size = "medium";
|
|
2986
2998
|
}
|
|
@@ -2998,18 +3010,18 @@ ze([
|
|
|
2998
3010
|
l({ type: String, reflect: !0 })
|
|
2999
3011
|
], ne.prototype, "size");
|
|
3000
3012
|
customElements.define("mp-ribbon-template-item", ne);
|
|
3001
|
-
var Se = Object.defineProperty, D = (s, e,
|
|
3002
|
-
for (var t = void 0,
|
|
3003
|
-
(n = s[
|
|
3004
|
-
return t && Se(e,
|
|
3013
|
+
var Se = Object.defineProperty, D = (s, e, i, r) => {
|
|
3014
|
+
for (var t = void 0, o = s.length - 1, n; o >= 0; o--)
|
|
3015
|
+
(n = s[o]) && (t = n(e, i, t) || t);
|
|
3016
|
+
return t && Se(e, i, t), t;
|
|
3005
3017
|
};
|
|
3006
|
-
class R extends
|
|
3018
|
+
class R extends k {
|
|
3007
3019
|
constructor() {
|
|
3008
3020
|
super(...arguments), this.itemId = "", this.label = "", this.icon = "", this.kind = "action", this.checked = !1, this.disabled = !1;
|
|
3009
3021
|
}
|
|
3010
3022
|
static {
|
|
3011
3023
|
this.shadowRootOptions = {
|
|
3012
|
-
...
|
|
3024
|
+
...k.shadowRootOptions,
|
|
3013
3025
|
delegatesFocus: !0
|
|
3014
3026
|
};
|
|
3015
3027
|
}
|
|
@@ -3068,11 +3080,11 @@ class R extends w {
|
|
|
3068
3080
|
<button
|
|
3069
3081
|
class="menu-item"
|
|
3070
3082
|
role="${e}"
|
|
3071
|
-
aria-checked="${this.kind === "action" ?
|
|
3083
|
+
aria-checked="${this.kind === "action" ? L : String(this.checked)}"
|
|
3072
3084
|
?disabled="${this.disabled}"
|
|
3073
3085
|
@click="${this.onActivate}"
|
|
3074
3086
|
>
|
|
3075
|
-
${this.kind !== "action" ? d`<span class="menu-item-check">${this.checked ? "✓" : ""}</span>` :
|
|
3087
|
+
${this.kind !== "action" ? d`<span class="menu-item-check">${this.checked ? "✓" : ""}</span>` : L}
|
|
3076
3088
|
<span class="menu-item-icon">
|
|
3077
3089
|
<slot name="icon">${this.icon ? this.icon : ""}</slot>
|
|
3078
3090
|
</span>
|
|
@@ -3109,7 +3121,7 @@ D([
|
|
|
3109
3121
|
l({ type: Boolean })
|
|
3110
3122
|
], R.prototype, "disabled");
|
|
3111
3123
|
customElements.define("mp-ribbon-menu-item", R);
|
|
3112
|
-
class Oe extends
|
|
3124
|
+
class Oe extends k {
|
|
3113
3125
|
static {
|
|
3114
3126
|
this.styles = g`
|
|
3115
3127
|
:host { display: block; }
|
|
@@ -3130,10 +3142,10 @@ class Oe extends w {
|
|
|
3130
3142
|
customElements.define("mp-ribbon-menu-separator", Oe);
|
|
3131
3143
|
export {
|
|
3132
3144
|
N as MpQuickAccessToolbar,
|
|
3133
|
-
|
|
3145
|
+
y as MpRibbon,
|
|
3134
3146
|
fe as MpRibbonButton,
|
|
3135
3147
|
ee as MpRibbonCheckBox,
|
|
3136
|
-
|
|
3148
|
+
ie as MpRibbonColorPicker,
|
|
3137
3149
|
Q as MpRibbonComboBox,
|
|
3138
3150
|
j as MpRibbonContextualTabSet,
|
|
3139
3151
|
V as MpRibbonDropdownButton,
|
|
@@ -3145,7 +3157,7 @@ export {
|
|
|
3145
3157
|
R as MpRibbonMenuItem,
|
|
3146
3158
|
Oe as MpRibbonMenuSeparator,
|
|
3147
3159
|
q as MpRibbonSplitButton,
|
|
3148
|
-
|
|
3160
|
+
$ as MpRibbonTab,
|
|
3149
3161
|
ne as MpRibbonTemplateItem,
|
|
3150
3162
|
J as MpRibbonToggleButton
|
|
3151
3163
|
};
|