@mintplayer/web-components 2.16.0 → 2.18.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/accordion/index.mjs +5 -5
- package/calendar/index.mjs +1 -1
- package/carousel/index.mjs +57 -143
- package/charts/core/index.mjs +30 -20
- package/charts/core/src/attributes.d.ts +18 -0
- package/charts/core/src/index.d.ts +2 -0
- package/charts/core/src/view-window.d.ts +46 -0
- package/charts/hierarchy/index.mjs +245 -256
- package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +1 -3
- package/charts/sparkline/index.mjs +27 -26
- package/charts/trend/index.mjs +21 -20
- package/checkbox/index.mjs +1 -1
- package/checkbox/src/components/mp-checkbox.d.ts +1 -0
- package/chunks/attributes-L3eKsbdy.mjs +16 -0
- package/chunks/color-mode-warning-71FmlzWX.mjs +13 -0
- package/chunks/{form-check.styles-B0pxJ6YC.mjs → form-check.styles-DqvBnspm.mjs} +24 -3
- package/chunks/{mp-calendar.element-CJ8-t-Zn.mjs → mp-calendar.element-BIHS9SZZ.mjs} +11 -6
- package/chunks/{mp-checkbox-CzwS7Y_t.mjs → mp-checkbox-zV83gILn.mjs} +44 -36
- package/chunks/{mp-datatable-B7st6G-I.mjs → mp-datatable-CEpSxlkd.mjs} +660 -357
- package/chunks/{mp-datetime-picker.element-DsWA1AFs.mjs → mp-datetime-picker.element-Cxu5-qRE.mjs} +29 -32
- package/chunks/{mp-pagination-Dea75mD4.mjs → mp-pagination-hGy4dL7p.mjs} +9 -4
- package/chunks/{mp-radio-cL46sUA0.mjs → mp-radio-BhRVNdKp.mjs} +32 -28
- package/chunks/{mp-select-BNrbPwN4.mjs → mp-select-CgqYFvUj.mjs} +41 -26
- package/chunks/{mp-splitter-Ckn1kN4v.mjs → mp-splitter-DLehrw3Y.mjs} +144 -120
- package/chunks/{mp-timepicker.element-CwaAAOcm.mjs → mp-timepicker.element-BiB9lkgc.mjs} +58 -45
- package/chunks/{mp-toggle-button-eo_aTQtu.mjs → mp-toggle-button-CaS9uYLE.mjs} +26 -24
- package/chunks/{mp-treeview-C8iltDbq.mjs → mp-treeview-CaMTDrvY.mjs} +51 -50
- package/chunks/{overlay-controller-DifgO6jT.mjs → overlay-controller-BHDagokg.mjs} +96 -92
- package/chunks/{id-DNZVAnGC.mjs → resource.service--lqLwEqk.mjs} +144 -206
- package/chunks/view-window-DGvFiDnW.mjs +263 -0
- package/code-snippet/index.mjs +70 -66
- package/code-snippet/src/hljs-loaders.generated.d.ts +1 -1
- package/custom-elements.json +66193 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/column-resize.d.ts +11 -0
- package/datatable/src/components/index.d.ts +1 -1
- package/datatable/src/components/mp-datatable.d.ts +264 -20
- package/datatable/src/index.d.ts +1 -1
- package/datatable/src/types/labels.d.ts +11 -0
- package/datepicker/index.mjs +10 -9
- package/datetime-picker/index.mjs +1 -1
- package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
- package/dock/index.mjs +430 -463
- package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
- package/dock/src/core/resize.d.ts +60 -0
- package/dropdown-menu/index.mjs +4 -2
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
- package/dropdown-menu/src/index.d.ts +1 -1
- package/dropdown-menu/src/types/dropdown.d.ts +14 -1
- package/dropdown-menu/src/types/index.d.ts +1 -1
- package/file-manager/index.mjs +63 -61
- package/file-manager/src/components/mp-file-manager.d.ts +4 -3
- package/multi-range/index.mjs +56 -50
- package/multi-range/src/mint-multi-range.element.d.ts +4 -10
- package/multi-range/src/pointer-geometry.d.ts +31 -0
- package/navbar/index.mjs +89 -439
- package/overlay/index.mjs +1 -1
- package/overlay/src/overlay-controller.d.ts +0 -14
- package/overlay/src/placement.d.ts +48 -0
- package/package.json +7 -1
- package/pagination/index.mjs +1 -1
- package/phone-input/index.mjs +44 -40
- package/phone-input/src/components/stack.d.ts +8 -0
- package/query-builder/index.mjs +418 -466
- package/query-builder/src/dnd/drag-controller.d.ts +12 -8
- package/query-builder/src/mp-query-builder.element.d.ts +5 -1
- package/query-builder/src/mp-query-condition.element.d.ts +1 -0
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +1 -1
- package/ribbon/index.mjs +477 -498
- package/ribbon/src/core/band-text-color.d.ts +10 -0
- package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
- package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
- package/ribbon/src/mp-ribbon.element.d.ts +0 -27
- package/scheduler/index.mjs +726 -711
- package/scheduler/src/components/mp-scheduler.d.ts +19 -3
- package/scheduler/src/drag/drag-manager.d.ts +1 -9
- package/scheduler/src/input/input-handler.d.ts +12 -2
- package/scheduler/src/utils/geometry.d.ts +39 -0
- package/scheduler/src/views/timeline-view.d.ts +0 -1
- package/scheduler-core/index.mjs +84 -71
- package/scheduler-core/src/services/resource.service.d.ts +0 -12
- package/scheduler-core/src/services/timeline.service.d.ts +0 -9
- package/select/index.mjs +1 -1
- package/select/src/components/mp-select.d.ts +1 -0
- package/signature-pad/index.mjs +21 -23
- package/signature-pad/src/canvas-point.d.ts +26 -0
- package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
- package/splitter/index.mjs +1 -1
- package/splitter/src/components/mp-splitter.d.ts +16 -0
- package/splitter/src/managers/index.d.ts +1 -0
- package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
- package/swiper-core/index.mjs +2 -2
- package/theming/bs-theme-preboot.js +1 -0
- package/theming/color-mode.css +36 -0
- package/theming/index.d.ts +1 -0
- package/theming/index.mjs +327 -0
- package/theming/src/components/mp-theme-toggle.d.ts +71 -0
- package/theming/src/cookie.d.ts +31 -0
- package/theming/src/index.d.ts +5 -0
- package/theming/src/preboot.d.ts +1 -0
- package/theming/src/resolve.d.ts +36 -0
- package/theming/src/store.d.ts +27 -0
- package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
- package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
- package/theming/src/toggle-modes.d.ts +23 -0
- package/tile-manager/index.mjs +252 -211
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
- package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
- package/timeline/index.mjs +156 -164
- package/timeline/src/components/mp-timeline.d.ts +41 -7
- package/timepicker/index.mjs +7 -4
- package/timepicker/src/mp-time-list.element.d.ts +26 -0
- package/timepicker/src/mp-timepicker.element.d.ts +3 -0
- package/toggle-button/index.mjs +1 -1
- package/tree-select/index.mjs +21 -9
- package/treeview/index.mjs +1 -1
- package/treeview/src/components/mp-treeview.d.ts +6 -4
- package/chunks/color-DIeST-IS.mjs +0 -224
- package/query-builder/src/mp-query-condition.element.template.d.ts +0 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { html as l, unsafeCSS as
|
|
1
|
+
import { html as l, unsafeCSS as m, LitElement as b, nothing as c } from "lit";
|
|
2
2
|
import { query as u } from "lit/decorators.js";
|
|
3
|
-
import { O as
|
|
3
|
+
import { O as y } from "./overlay-controller-BHDagokg.mjs";
|
|
4
4
|
import "lit/directives/ref.js";
|
|
5
|
-
import { H as
|
|
6
|
-
import { R as
|
|
5
|
+
import { H as v } from "./host-aria-WSGs7SPQ.mjs";
|
|
6
|
+
import { R as w } from "./roving-focus-CrL9982a.mjs";
|
|
7
7
|
l`<!-- Time-slot listbox rendered dynamically by render(). This file exists only
|
|
8
8
|
so the codegen-wc target emits a \`styles\` export from the sibling .scss;
|
|
9
9
|
the \`template\` export is intentionally unused. -->`;
|
|
10
|
-
const
|
|
10
|
+
const x = m(`:host {
|
|
11
11
|
display: block;
|
|
12
12
|
box-sizing: border-box;
|
|
13
13
|
max-height: 250px;
|
|
@@ -57,13 +57,22 @@ ul {
|
|
|
57
57
|
min-height: 44px;
|
|
58
58
|
}
|
|
59
59
|
}`);
|
|
60
|
-
let
|
|
61
|
-
function h(
|
|
62
|
-
return
|
|
60
|
+
let T = 0;
|
|
61
|
+
function h(i) {
|
|
62
|
+
return i ? i.getHours() * 60 + i.getMinutes() : null;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
const M = 15;
|
|
65
|
+
function p(i) {
|
|
66
|
+
return typeof i == "number" && Number.isFinite(i) && i > 0 && i <= 1440 ? i : M;
|
|
67
|
+
}
|
|
68
|
+
const f = {
|
|
69
|
+
fromAttribute(i) {
|
|
70
|
+
return i === "" || i === "true" ? !0 : i === "false" ? !1 : "auto";
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
class E extends b {
|
|
65
74
|
constructor() {
|
|
66
|
-
super(...arguments), this.selectedTime = null, this.step = 15, this.minMinutes = null, this.maxMinutes = null, this.hour12 = "auto", this.locale = void 0, this._focusedMinutes = null, this.instanceId = `mp-tl-${++
|
|
75
|
+
super(...arguments), this.selectedTime = null, this.step = 15, this.minMinutes = null, this.maxMinutes = null, this.hour12 = "auto", this.locale = void 0, this._focusedMinutes = null, this.instanceId = `mp-tl-${++T}`, this.roving = new w({
|
|
67
76
|
items: () => Array.from(this.renderRoot?.querySelectorAll("button.slot") ?? []),
|
|
68
77
|
orientation: "vertical",
|
|
69
78
|
isDisabled: () => !1,
|
|
@@ -75,7 +84,7 @@ class x extends m {
|
|
|
75
84
|
const t = e.key;
|
|
76
85
|
if (t === "PageUp" || t === "PageDown") {
|
|
77
86
|
e.preventDefault();
|
|
78
|
-
const
|
|
87
|
+
const r = this.slots(), s = this.focusableMinutes(), o = t === "PageUp" ? Math.max(r[0].minutes, s - 60) : Math.min(r[r.length - 1].minutes, s + 60), n = r.findIndex((g) => g.minutes === o);
|
|
79
88
|
n >= 0 && this.roving.moveTo(n);
|
|
80
89
|
return;
|
|
81
90
|
}
|
|
@@ -83,7 +92,7 @@ class x extends m {
|
|
|
83
92
|
};
|
|
84
93
|
}
|
|
85
94
|
static {
|
|
86
|
-
this.styles = [
|
|
95
|
+
this.styles = [x];
|
|
87
96
|
}
|
|
88
97
|
static {
|
|
89
98
|
this.properties = {
|
|
@@ -91,7 +100,7 @@ class x extends m {
|
|
|
91
100
|
step: { attribute: "step", type: Number, reflect: !0 },
|
|
92
101
|
minMinutes: { attribute: "min-minutes", type: Number },
|
|
93
102
|
maxMinutes: { attribute: "max-minutes", type: Number },
|
|
94
|
-
hour12: { attribute: "hour12" },
|
|
103
|
+
hour12: { attribute: "hour12", converter: f },
|
|
95
104
|
locale: { attribute: "locale", type: String, reflect: !0 },
|
|
96
105
|
_focusedMinutes: { state: !0 }
|
|
97
106
|
};
|
|
@@ -117,12 +126,11 @@ class x extends m {
|
|
|
117
126
|
slots() {
|
|
118
127
|
const e = /* @__PURE__ */ new Date();
|
|
119
128
|
e.setHours(0, 0, 0, 0);
|
|
120
|
-
const t =
|
|
121
|
-
|
|
122
|
-
const o = s *
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
return i;
|
|
129
|
+
const t = p(this.step);
|
|
130
|
+
return Array.from({ length: Math.floor(1440 / t) }, (r, s) => {
|
|
131
|
+
const o = s * t, n = new Date(e.getTime() + o * 6e4);
|
|
132
|
+
return { minutes: o, date: n, label: this.formatTime(n) };
|
|
133
|
+
});
|
|
126
134
|
}
|
|
127
135
|
formatTime(e) {
|
|
128
136
|
const t = this.resolvedHour12();
|
|
@@ -150,8 +158,8 @@ class x extends m {
|
|
|
150
158
|
focusableMinutes() {
|
|
151
159
|
if (this._focusedMinutes !== null) return this._focusedMinutes;
|
|
152
160
|
if (this.selectedTime) {
|
|
153
|
-
const e = this.timeMinutes(this.selectedTime);
|
|
154
|
-
return Math.floor(e /
|
|
161
|
+
const e = this.timeMinutes(this.selectedTime), t = p(this.step);
|
|
162
|
+
return Math.floor(e / t) * t;
|
|
155
163
|
}
|
|
156
164
|
return 0;
|
|
157
165
|
}
|
|
@@ -164,10 +172,10 @@ class x extends m {
|
|
|
164
172
|
if (this.isDisabledMinutes(e)) return;
|
|
165
173
|
const t = /* @__PURE__ */ new Date();
|
|
166
174
|
t.setHours(0, 0, 0, 0);
|
|
167
|
-
const
|
|
168
|
-
this.selectedTime =
|
|
175
|
+
const r = new Date(t.getTime() + e * 6e4);
|
|
176
|
+
this.selectedTime = r, this._focusedMinutes = e, this.requestUpdate(), this.dispatchEvent(
|
|
169
177
|
new CustomEvent("selected-time-change", {
|
|
170
|
-
detail: new Date(
|
|
178
|
+
detail: new Date(r.getTime()),
|
|
171
179
|
bubbles: !0,
|
|
172
180
|
composed: !0
|
|
173
181
|
})
|
|
@@ -178,12 +186,12 @@ class x extends m {
|
|
|
178
186
|
const e = this.slots(), t = this.focusableMinutes();
|
|
179
187
|
return l`
|
|
180
188
|
<ul role="presentation">
|
|
181
|
-
${e.map((
|
|
189
|
+
${e.map((r) => this.renderSlot(r, t))}
|
|
182
190
|
</ul>
|
|
183
191
|
`;
|
|
184
192
|
}
|
|
185
193
|
renderSlot(e, t) {
|
|
186
|
-
const
|
|
194
|
+
const r = this.isSelected(e.minutes), s = this.isDisabledMinutes(e.minutes);
|
|
187
195
|
return l`<li role="presentation">
|
|
188
196
|
<button
|
|
189
197
|
type="button"
|
|
@@ -191,7 +199,7 @@ class x extends m {
|
|
|
191
199
|
role="option"
|
|
192
200
|
id="${this.slotId(e.minutes)}"
|
|
193
201
|
data-minutes="${e.minutes}"
|
|
194
|
-
aria-selected="${
|
|
202
|
+
aria-selected="${r ? "true" : "false"}"
|
|
195
203
|
aria-disabled="${s ? "true" : c}"
|
|
196
204
|
data-focused="${e.minutes === t ? "true" : c}"
|
|
197
205
|
@click="${() => this.selectMinutes(e.minutes)}"
|
|
@@ -199,10 +207,10 @@ class x extends m {
|
|
|
199
207
|
</li>`;
|
|
200
208
|
}
|
|
201
209
|
}
|
|
202
|
-
typeof customElements < "u" && !customElements.get("mp-time-list") && customElements.define("mp-time-list",
|
|
210
|
+
typeof customElements < "u" && !customElements.get("mp-time-list") && customElements.define("mp-time-list", E);
|
|
203
211
|
l`<!-- Rendered dynamically by render(). This file exists only so the codegen-wc
|
|
204
212
|
target emits a \`styles\` export from the sibling .scss. -->`;
|
|
205
|
-
const
|
|
213
|
+
const $ = m(`:host {
|
|
206
214
|
display: inline-block;
|
|
207
215
|
position: relative;
|
|
208
216
|
box-sizing: border-box;
|
|
@@ -292,18 +300,18 @@ button.trigger svg {
|
|
|
292
300
|
transition: none !important;
|
|
293
301
|
}
|
|
294
302
|
}`);
|
|
295
|
-
var
|
|
296
|
-
for (var s = void 0, o =
|
|
297
|
-
(n =
|
|
298
|
-
return s &&
|
|
303
|
+
var k = Object.defineProperty, d = (i, e, t, r) => {
|
|
304
|
+
for (var s = void 0, o = i.length - 1, n; o >= 0; o--)
|
|
305
|
+
(n = i[o]) && (s = n(e, t, s) || s);
|
|
306
|
+
return s && k(e, t, s), s;
|
|
299
307
|
};
|
|
300
|
-
const
|
|
301
|
-
let
|
|
302
|
-
class a extends
|
|
308
|
+
const S = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/><path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z"/></svg>';
|
|
309
|
+
let D = 0;
|
|
310
|
+
class a extends b {
|
|
303
311
|
constructor() {
|
|
304
|
-
super(...arguments), this.selectedTime = null, this.step = 15, this.min = null, this.max = null, this.hour12 = "auto", this.locale = void 0, this.disabled = !1, this.placeholder = "", this.triggerLabel = "Choose time", this.inputLabel = "Selected time", this.ariaLabelForRender = null, this.ariaLabelledByForSync = null, this.ariaDescribedByForSync = null, this.instanceId = `mp-tp-${++
|
|
312
|
+
super(...arguments), this.selectedTime = null, this.step = 15, this.min = null, this.max = null, this.hour12 = "auto", this.locale = void 0, this.disabled = !1, this.placeholder = "", this.triggerLabel = "Choose time", this.inputLabel = "Selected time", this.ariaLabelForRender = null, this.ariaLabelledByForSync = null, this.ariaDescribedByForSync = null, this.instanceId = `mp-tp-${++D}`, this.popupId = `${this.instanceId}-popup`, this.hostAria = new v(this, {
|
|
305
313
|
referenceTarget: () => this.displayInputEl ?? null
|
|
306
|
-
}), this.overlay = new
|
|
314
|
+
}), this.overlay = new y(this, {
|
|
307
315
|
anchor: () => this.inputGroupEl ?? this.triggerEl ?? null,
|
|
308
316
|
trigger: () => this.triggerEl ?? null,
|
|
309
317
|
panel: () => this.popupEl ?? null,
|
|
@@ -319,7 +327,7 @@ class a extends m {
|
|
|
319
327
|
this.disabled || (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.overlay.isOpen || await this.overlay.open());
|
|
320
328
|
}, this.onSelectedTimeChange = (e) => {
|
|
321
329
|
const t = e.detail;
|
|
322
|
-
t instanceof Date && (this.selectedTime = t, this.requestUpdate(), this.dispatchEvent(
|
|
330
|
+
t instanceof Date && (e.stopPropagation(), this.selectedTime = t, this.requestUpdate(), this.dispatchEvent(
|
|
323
331
|
new CustomEvent("selected-time-change", {
|
|
324
332
|
detail: new Date(t.getTime()),
|
|
325
333
|
bubbles: !0,
|
|
@@ -329,7 +337,7 @@ class a extends m {
|
|
|
329
337
|
};
|
|
330
338
|
}
|
|
331
339
|
static {
|
|
332
|
-
this.styles = [
|
|
340
|
+
this.styles = [$];
|
|
333
341
|
}
|
|
334
342
|
static {
|
|
335
343
|
this.properties = {
|
|
@@ -337,7 +345,7 @@ class a extends m {
|
|
|
337
345
|
step: { attribute: "step", type: Number, reflect: !0 },
|
|
338
346
|
min: { attribute: !1 },
|
|
339
347
|
max: { attribute: !1 },
|
|
340
|
-
hour12: { attribute: "hour12" },
|
|
348
|
+
hour12: { attribute: "hour12", converter: f },
|
|
341
349
|
locale: { attribute: "locale", type: String, reflect: !0 },
|
|
342
350
|
disabled: { attribute: "disabled", type: Boolean, reflect: !0 },
|
|
343
351
|
placeholder: { attribute: "placeholder", type: String, reflect: !0 },
|
|
@@ -398,10 +406,13 @@ class a extends m {
|
|
|
398
406
|
?disabled="${this.disabled}"
|
|
399
407
|
@click="${this.onTriggerClick}"
|
|
400
408
|
@keydown="${this.onTriggerKeyDown}"
|
|
401
|
-
.innerHTML="${
|
|
409
|
+
.innerHTML="${S}"
|
|
402
410
|
></button>
|
|
403
411
|
</div>
|
|
404
412
|
<div class="popup" id="${this.popupId}">
|
|
413
|
+
<!-- The one listener for both the default list (fallback content is a
|
|
414
|
+
child of the slot) and a slotted consumer list. The inner event is
|
|
415
|
+
stopped here and re-emitted once from the host. -->
|
|
405
416
|
<slot name="time-list"
|
|
406
417
|
@selected-time-change="${this.onSelectedTimeChange}"
|
|
407
418
|
>
|
|
@@ -412,7 +423,6 @@ class a extends m {
|
|
|
412
423
|
.maxMinutes="${h(this.max)}"
|
|
413
424
|
.hour12="${this.hour12}"
|
|
414
425
|
.locale="${this.locale}"
|
|
415
|
-
@selected-time-change="${this.onSelectedTimeChange}"
|
|
416
426
|
></mp-time-list>
|
|
417
427
|
</slot>
|
|
418
428
|
</div>
|
|
@@ -433,7 +443,10 @@ d([
|
|
|
433
443
|
], a.prototype, "popupEl");
|
|
434
444
|
typeof customElements < "u" && !customElements.get("mp-timepicker") && customElements.define("mp-timepicker", a);
|
|
435
445
|
export {
|
|
436
|
-
|
|
446
|
+
M as D,
|
|
447
|
+
E as M,
|
|
437
448
|
a,
|
|
438
|
-
|
|
449
|
+
f as h,
|
|
450
|
+
h as m,
|
|
451
|
+
p as r
|
|
439
452
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
2
|
-
import { createRef as d, ref as
|
|
3
|
-
import { H as
|
|
4
|
-
import { a as
|
|
5
|
-
import { F as
|
|
6
|
-
import { i as
|
|
7
|
-
const
|
|
1
|
+
import { unsafeCSS as c, LitElement as s, nothing as e, html as i } from "lit";
|
|
2
|
+
import { createRef as d, ref as l } from "lit/directives/ref.js";
|
|
3
|
+
import { H as h } from "./host-aria-WSGs7SPQ.mjs";
|
|
4
|
+
import { a as f, e as v } from "./error-text-B45eDAt1.mjs";
|
|
5
|
+
import { F as g } from "./form-associated-BR-fUvZ1.mjs";
|
|
6
|
+
import { i as u } from "./invalid-feedback.styles-he0JYrJm.mjs";
|
|
7
|
+
const p = c(`.btn {
|
|
8
8
|
--bs-btn-padding-x: 0.75rem;
|
|
9
9
|
--bs-btn-padding-y: 0.375rem;
|
|
10
10
|
--bs-btn-font-family: ;
|
|
@@ -407,7 +407,7 @@ const u = a(`.btn {
|
|
|
407
407
|
:host {
|
|
408
408
|
display: inline-block;
|
|
409
409
|
vertical-align: middle;
|
|
410
|
-
}`),
|
|
410
|
+
}`), n = /* @__PURE__ */ new Set([
|
|
411
411
|
"primary",
|
|
412
412
|
"secondary",
|
|
413
413
|
"success",
|
|
@@ -425,13 +425,13 @@ const u = a(`.btn {
|
|
|
425
425
|
"outline-light",
|
|
426
426
|
"outline-dark"
|
|
427
427
|
]);
|
|
428
|
-
let
|
|
429
|
-
class
|
|
428
|
+
let a = 0;
|
|
429
|
+
class x extends g(s) {
|
|
430
430
|
constructor() {
|
|
431
|
-
super(...arguments), this._checked = !1, this._disabled = !1, this._name = null, this._value = null, this._color = "primary", this._inputLabel = null, this._errorText = null, this.hostAria = new
|
|
431
|
+
super(...arguments), this._checked = !1, this._disabled = !1, this._name = null, this._value = null, this._color = "primary", this._inputLabel = null, this._errorText = null, this.hostAria = new h(this, {
|
|
432
432
|
referenceTarget: () => this._inputRef.value ?? null,
|
|
433
|
-
describedByExtras: () =>
|
|
434
|
-
}), this._inputId = `mp-toggle-button-${++
|
|
433
|
+
describedByExtras: () => f(this.renderRoot)
|
|
434
|
+
}), this._inputId = `mp-toggle-button-${++a}`, this._errorId = `mp-toggle-button-${a}-error`, this._inputRef = d(), this.onInputChange = (b) => {
|
|
435
435
|
const t = b.target.checked;
|
|
436
436
|
this._checked = t, this.reflectBoolean("checked", t), this.dispatchEvent(
|
|
437
437
|
new CustomEvent("change", {
|
|
@@ -443,11 +443,11 @@ class p extends v(o) {
|
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
445
|
static {
|
|
446
|
-
this.styles = [
|
|
446
|
+
this.styles = [p, u];
|
|
447
447
|
}
|
|
448
448
|
static {
|
|
449
449
|
this.shadowRootOptions = {
|
|
450
|
-
...
|
|
450
|
+
...s.shadowRootOptions,
|
|
451
451
|
delegatesFocus: !0
|
|
452
452
|
};
|
|
453
453
|
}
|
|
@@ -534,7 +534,7 @@ class p extends v(o) {
|
|
|
534
534
|
return this._color;
|
|
535
535
|
}
|
|
536
536
|
set color(b) {
|
|
537
|
-
!
|
|
537
|
+
!n.has(b) || this._color === b || (this._color = b, this.requestUpdate());
|
|
538
538
|
}
|
|
539
539
|
attributeChangedCallback(b, t, r) {
|
|
540
540
|
switch (super.attributeChangedCallback(b, t, r), b) {
|
|
@@ -560,9 +560,11 @@ class p extends v(o) {
|
|
|
560
560
|
case "value":
|
|
561
561
|
this._value = r, this.requestUpdate();
|
|
562
562
|
break;
|
|
563
|
-
case "color":
|
|
564
|
-
|
|
563
|
+
case "color": {
|
|
564
|
+
const o = r ?? "primary";
|
|
565
|
+
n.has(o) && (this._color = o, this.requestUpdate());
|
|
565
566
|
break;
|
|
567
|
+
}
|
|
566
568
|
case "aria-label":
|
|
567
569
|
this.requestUpdate();
|
|
568
570
|
break;
|
|
@@ -581,10 +583,10 @@ class p extends v(o) {
|
|
|
581
583
|
this.syncFormValue(), this.hostAria.syncReferences();
|
|
582
584
|
}
|
|
583
585
|
render() {
|
|
584
|
-
const b =
|
|
585
|
-
return
|
|
586
|
+
const b = v(this._errorId, this._errorText, this.hasAttribute("invalid"));
|
|
587
|
+
return i`
|
|
586
588
|
<input
|
|
587
|
-
${
|
|
589
|
+
${l(this._inputRef)}
|
|
588
590
|
type="checkbox"
|
|
589
591
|
class="btn-check"
|
|
590
592
|
id=${this._inputId}
|
|
@@ -622,8 +624,8 @@ class p extends v(o) {
|
|
|
622
624
|
return this._inputRef.value ?? null;
|
|
623
625
|
}
|
|
624
626
|
}
|
|
625
|
-
typeof customElements < "u" && !customElements.get("mp-toggle-button") && customElements.define("mp-toggle-button",
|
|
627
|
+
typeof customElements < "u" && !customElements.get("mp-toggle-button") && customElements.define("mp-toggle-button", x);
|
|
626
628
|
export {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
+
x as M,
|
|
630
|
+
p as t
|
|
629
631
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { unsafeCSS as I, LitElement as y, nothing as d } from "lit";
|
|
2
2
|
import { s as $, i as C } from "./install-light-styles-DbCAGFOC.mjs";
|
|
3
3
|
import { L as S } from "./live-announcer-Bi0orG4n.mjs";
|
|
4
|
-
import { repeat as
|
|
4
|
+
import { repeat as R } from "lit/directives/repeat.js";
|
|
5
5
|
import { unsafeHTML as g } from "lit/directives/unsafe-html.js";
|
|
6
|
-
const
|
|
6
|
+
const E = I(`mp-treeview {
|
|
7
7
|
display: block;
|
|
8
8
|
width: 100%;
|
|
9
9
|
--mp-treeview-indent: 20px;
|
|
10
10
|
--mp-treeview-row-padding-y: 0.5rem;
|
|
11
11
|
--mp-treeview-row-padding-x: 0.75rem;
|
|
12
|
-
--mp-treeview-row-hover-bg: var(--bs-list-group-action-hover-bg, rgba(
|
|
12
|
+
--mp-treeview-row-hover-bg: var(--bs-list-group-action-hover-bg, rgba(var(--bs-emphasis-color-rgb), 0.04));
|
|
13
13
|
--mp-treeview-row-selected-bg: var(--bs-list-group-active-bg, var(--bs-primary));
|
|
14
14
|
--mp-treeview-row-selected-color: var(--bs-list-group-active-color, #fff);
|
|
15
15
|
--mp-treeview-row-focus-outline: 2px solid var(--bs-primary, #1389fd);
|
|
@@ -151,11 +151,11 @@ mp-treeview[hide-borders] .treeview-row[data-mps=treeview] {
|
|
|
151
151
|
.treeview-chevron[data-mps=treeview] {
|
|
152
152
|
transition: none !important;
|
|
153
153
|
}
|
|
154
|
-
}`), n = $("treeview"),
|
|
155
|
-
let
|
|
154
|
+
}`), n = $("treeview"), q = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>';
|
|
155
|
+
let U = 0;
|
|
156
156
|
class L extends y {
|
|
157
157
|
constructor() {
|
|
158
|
-
super(...arguments), this.instanceId = `mp-treeview-${++
|
|
158
|
+
super(...arguments), this.instanceId = `mp-treeview-${++U}`, this._items = [], this._expandedIds = /* @__PURE__ */ new Set(), this._selectedIds = /* @__PURE__ */ new Set(), this._selectionMode = "single", this._hideBorders = !1, this._loadingIds = /* @__PURE__ */ new Set(), this._errorIds = /* @__PURE__ */ new Map(), this.liveAnnouncer = new S(this, { omitRole: !0 }), this._focusedId = null, this._visibleOrder = [], this._byId = /* @__PURE__ */ new Map(), this._parentById = /* @__PURE__ */ new Map(), this._inputLabel = null;
|
|
159
159
|
}
|
|
160
160
|
createRenderRoot() {
|
|
161
161
|
return this;
|
|
@@ -180,9 +180,9 @@ class L extends y {
|
|
|
180
180
|
}
|
|
181
181
|
rebuildIndex() {
|
|
182
182
|
this._byId.clear(), this._parentById.clear();
|
|
183
|
-
const e = (t,
|
|
183
|
+
const e = (t, r) => {
|
|
184
184
|
for (const i of t)
|
|
185
|
-
this._byId.set(i.id, i), this._parentById.set(i.id,
|
|
185
|
+
this._byId.set(i.id, i), this._parentById.set(i.id, r), i.children && i.children.length > 0 && e(i.children, i);
|
|
186
186
|
};
|
|
187
187
|
e(this._items, null);
|
|
188
188
|
}
|
|
@@ -246,11 +246,11 @@ class L extends y {
|
|
|
246
246
|
set loadChildren(e) {
|
|
247
247
|
this._loadChildren = e;
|
|
248
248
|
}
|
|
249
|
-
attributeChangedCallback(e, t,
|
|
250
|
-
if (super.attributeChangedCallback(e, t,
|
|
251
|
-
const i =
|
|
249
|
+
attributeChangedCallback(e, t, r) {
|
|
250
|
+
if (super.attributeChangedCallback(e, t, r), e === "selection-mode") {
|
|
251
|
+
const i = r ?? "single";
|
|
252
252
|
(i === "none" || i === "single" || i === "multiple") && (this.selectionMode = i);
|
|
253
|
-
} else e === "hide-borders" ? (this._hideBorders =
|
|
253
|
+
} else e === "hide-borders" ? (this._hideBorders = r !== null, this.requestUpdate()) : e === "aria-label" ? this.requestUpdate() : e === "input-label" && (this._inputLabel = r, this.requestUpdate());
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
256
|
* Accessible name for the in-shadow role=tree node (tier-2 naming: the
|
|
@@ -280,15 +280,15 @@ class L extends y {
|
|
|
280
280
|
}
|
|
281
281
|
renderNodes(e, t) {
|
|
282
282
|
return n`
|
|
283
|
-
${
|
|
283
|
+
${R(
|
|
284
284
|
e,
|
|
285
|
-
(
|
|
286
|
-
(
|
|
285
|
+
(r) => r.id,
|
|
286
|
+
(r, i) => this.renderNode(r, t, i, e.length)
|
|
287
287
|
)}
|
|
288
288
|
`;
|
|
289
289
|
}
|
|
290
|
-
renderNode(e, t,
|
|
291
|
-
const
|
|
290
|
+
renderNode(e, t, r, i) {
|
|
291
|
+
const s = !!(e.children && e.children.length > 0), p = !!e.lazy && !s, u = s || p, o = this._loadingIds.has(e.id), l = this._errorIds.get(e.id), h = this._expandedIds.has(e.id), v = this._selectedIds.has(e.id), m = this._focusedId === e.id, _ = m ? 0 : -1, f = e.iconKey && this._iconResolver ? this._iconResolver(e.iconKey, e) : void 0, x = (t - 1) * 20, w = `${this.instanceId}-row-${e.id}`, b = this._nodeRenderer ? this._nodeRenderer(e, {
|
|
292
292
|
level: t,
|
|
293
293
|
expanded: h,
|
|
294
294
|
selected: v,
|
|
@@ -307,7 +307,7 @@ class L extends y {
|
|
|
307
307
|
data-error=${l ? "true" : "false"}
|
|
308
308
|
aria-level=${t}
|
|
309
309
|
aria-setsize=${i}
|
|
310
|
-
aria-posinset=${
|
|
310
|
+
aria-posinset=${r + 1}
|
|
311
311
|
aria-expanded=${u ? h ? "true" : "false" : d}
|
|
312
312
|
aria-busy=${o ? "true" : d}
|
|
313
313
|
aria-selected=${this._selectionMode !== "none" ? v ? "true" : "false" : d}
|
|
@@ -323,33 +323,34 @@ class L extends y {
|
|
|
323
323
|
data-expanded=${h ? "true" : "false"}
|
|
324
324
|
@click=${(a) => this.onChevronClick(e, a)}
|
|
325
325
|
aria-hidden="true"
|
|
326
|
-
>${o ? n`<span class="treeview-spinner" aria-hidden="true"></span>` : g(
|
|
326
|
+
>${o ? n`<span class="treeview-spinner" aria-hidden="true"></span>` : g(q)}</span>
|
|
327
327
|
${b ? n`<span class="treeview-body">${b}</span>` : n`
|
|
328
328
|
${f ? n`<span class="treeview-icon" aria-hidden="true">${g(f)}</span>` : d}
|
|
329
329
|
<span class="treeview-label">${e.label}</span>
|
|
330
330
|
`}
|
|
331
331
|
</div>
|
|
332
|
-
${
|
|
332
|
+
${s && h ? n`<ul role="group">${this.renderNodes(e.children, t + 1)}</ul>` : d}
|
|
333
333
|
</li>
|
|
334
334
|
`;
|
|
335
335
|
}
|
|
336
336
|
computeVisibleOrder(e) {
|
|
337
|
-
const t = [],
|
|
338
|
-
for (const
|
|
339
|
-
t.push(
|
|
337
|
+
const t = [], r = (i) => {
|
|
338
|
+
for (const s of i)
|
|
339
|
+
t.push(s), s.children && s.children.length > 0 && this._expandedIds.has(s.id) && r(s.children);
|
|
340
340
|
};
|
|
341
|
-
return
|
|
341
|
+
return r(e), t;
|
|
342
342
|
}
|
|
343
343
|
syncFocusAfterUpdate() {
|
|
344
344
|
this._focusedId !== null && !this._byId.has(this._focusedId) && (this._focusedId = null);
|
|
345
345
|
}
|
|
346
|
-
/**
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
346
|
+
/**
|
|
347
|
+
* The host is generic and not itself focusable (light tier, no
|
|
348
|
+
* delegatesFocus), so a bare host focus() would be a silent no-op. Hand it
|
|
349
|
+
* to the roving tab stop instead — the row a Tab would have reached.
|
|
350
|
+
*/
|
|
351
|
+
focus(e) {
|
|
352
|
+
const t = this.renderRoot?.querySelector('[role="treeitem"][tabindex="0"]');
|
|
353
|
+
t ? t.focus(e) : super.focus(e);
|
|
353
354
|
}
|
|
354
355
|
onRowClick(e, t) {
|
|
355
356
|
t.stopPropagation(), this.focusNode(e.id), this.toggleSelection(e, t.ctrlKey || t.metaKey), e.children && e.children.length > 0 && this.toggleExpansion(e);
|
|
@@ -359,7 +360,7 @@ class L extends y {
|
|
|
359
360
|
}
|
|
360
361
|
onRowKeydown(e, t) {
|
|
361
362
|
if (t.composedPath()[0] !== t.currentTarget) return;
|
|
362
|
-
const
|
|
363
|
+
const r = !!(e.children && e.children.length > 0), i = this._expandedIds.has(e.id);
|
|
363
364
|
switch (t.key) {
|
|
364
365
|
case "ArrowDown": {
|
|
365
366
|
t.preventDefault(), this.focusRelative(e, 1);
|
|
@@ -370,15 +371,15 @@ class L extends y {
|
|
|
370
371
|
return;
|
|
371
372
|
}
|
|
372
373
|
case "ArrowRight": {
|
|
373
|
-
t.preventDefault(), (
|
|
374
|
+
t.preventDefault(), (r || e.lazy) && !i ? this.expand(e) : r && i && this.focusNode(e.children[0].id);
|
|
374
375
|
return;
|
|
375
376
|
}
|
|
376
377
|
case "ArrowLeft": {
|
|
377
|
-
if (t.preventDefault(), (
|
|
378
|
+
if (t.preventDefault(), (r || e.lazy) && i)
|
|
378
379
|
this.collapse(e);
|
|
379
380
|
else {
|
|
380
|
-
const
|
|
381
|
-
|
|
381
|
+
const s = this._parentById.get(e.id);
|
|
382
|
+
s && this.focusNode(s.id);
|
|
382
383
|
}
|
|
383
384
|
return;
|
|
384
385
|
}
|
|
@@ -391,7 +392,7 @@ class L extends y {
|
|
|
391
392
|
return;
|
|
392
393
|
}
|
|
393
394
|
case "Enter": {
|
|
394
|
-
t.preventDefault(), this.toggleSelection(e, !1), (
|
|
395
|
+
t.preventDefault(), this.toggleSelection(e, !1), (r || e.lazy) && this.toggleExpansion(e);
|
|
395
396
|
return;
|
|
396
397
|
}
|
|
397
398
|
case " ":
|
|
@@ -403,10 +404,10 @@ class L extends y {
|
|
|
403
404
|
}
|
|
404
405
|
}
|
|
405
406
|
focusRelative(e, t) {
|
|
406
|
-
const
|
|
407
|
+
const r = this._visibleOrder, i = r.findIndex((p) => p.id === e.id);
|
|
407
408
|
if (i === -1) return;
|
|
408
|
-
const
|
|
409
|
-
|
|
409
|
+
const s = Math.max(0, Math.min(r.length - 1, i + t));
|
|
410
|
+
s !== i && this.focusNode(r[s].id);
|
|
410
411
|
}
|
|
411
412
|
focusNode(e) {
|
|
412
413
|
this._focusedId = e, this.requestUpdate(), requestAnimationFrame(() => {
|
|
@@ -418,8 +419,8 @@ class L extends y {
|
|
|
418
419
|
if (this._selectionMode === "single")
|
|
419
420
|
this._selectedIds = /* @__PURE__ */ new Set([e.id]);
|
|
420
421
|
else if (t) {
|
|
421
|
-
const
|
|
422
|
-
|
|
422
|
+
const r = new Set(this._selectedIds);
|
|
423
|
+
r.has(e.id) ? r.delete(e.id) : r.add(e.id), this._selectedIds = r;
|
|
423
424
|
} else
|
|
424
425
|
this._selectedIds = /* @__PURE__ */ new Set([e.id]);
|
|
425
426
|
this.requestUpdate(), this.dispatchEvent(
|
|
@@ -436,15 +437,15 @@ class L extends y {
|
|
|
436
437
|
}
|
|
437
438
|
expand(e) {
|
|
438
439
|
const t = !!(e.children && e.children.length > 0);
|
|
439
|
-
if (!t && !e.lazy || this._expandedIds.has(e.id)) return;
|
|
440
|
-
if (!t && e.lazy && this._loadChildren
|
|
440
|
+
if (!t && !e.lazy || this._expandedIds.has(e.id) || this._loadingIds.has(e.id)) return;
|
|
441
|
+
if (!t && e.lazy && this._loadChildren) {
|
|
441
442
|
this._loadingIds.add(e.id), this._errorIds.delete(e.id), this.liveAnnouncer.announce(`Loading ${e.label}.`), this.requestUpdate(), this._loadChildren(e.id).then(
|
|
442
443
|
(i) => {
|
|
443
444
|
this._loadingIds.delete(e.id), this.liveAnnouncer.announce(
|
|
444
445
|
`${e.label} loaded, ${i?.length ?? 0} item${(i?.length ?? 0) === 1 ? "" : "s"}.`
|
|
445
446
|
);
|
|
446
|
-
const
|
|
447
|
-
|
|
447
|
+
const s = new Set(this._expandedIds);
|
|
448
|
+
s.add(e.id), this._expandedIds = s, this.requestUpdate(), this.dispatchEvent(
|
|
448
449
|
new CustomEvent("tree-node-expand", {
|
|
449
450
|
detail: { node: e, expandedIds: [...this._expandedIds], loadedChildren: i },
|
|
450
451
|
bubbles: !0,
|
|
@@ -464,8 +465,8 @@ class L extends y {
|
|
|
464
465
|
);
|
|
465
466
|
return;
|
|
466
467
|
}
|
|
467
|
-
const
|
|
468
|
-
|
|
468
|
+
const r = new Set(this._expandedIds);
|
|
469
|
+
r.add(e.id), this._expandedIds = r, this.requestUpdate(), this.dispatchEvent(
|
|
469
470
|
new CustomEvent("tree-node-expand", {
|
|
470
471
|
detail: { node: e, expandedIds: [...this._expandedIds] },
|
|
471
472
|
bubbles: !0,
|
|
@@ -488,9 +489,9 @@ class L extends y {
|
|
|
488
489
|
function M(c) {
|
|
489
490
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(c) : c.replace(/["\\]/g, "\\$&");
|
|
490
491
|
}
|
|
491
|
-
C("treeview",
|
|
492
|
+
C("treeview", E);
|
|
492
493
|
typeof customElements < "u" && !customElements.get("mp-treeview") && customElements.define("mp-treeview", L);
|
|
493
494
|
export {
|
|
494
495
|
L as M,
|
|
495
|
-
|
|
496
|
+
E as t
|
|
496
497
|
};
|