@mintplayer/web-components 2.16.0 → 2.17.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-eRpl7-2V.mjs} +173 -173
- 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 +65750 -0
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/column-resize.d.ts +11 -0
- package/datatable/src/components/mp-datatable.d.ts +5 -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
|
@@ -220,9 +220,7 @@ export declare class MpHierarchyChart extends LitElement {
|
|
|
220
220
|
* stays crisp and nothing re-rasterizes. Click/Enter/breadcrumb keep the
|
|
221
221
|
* SEMANTIC re-root, which resets the view (the subtree fills the chart).
|
|
222
222
|
*/
|
|
223
|
-
private
|
|
224
|
-
private _viewX;
|
|
225
|
-
private _viewY;
|
|
223
|
+
private _view;
|
|
226
224
|
private static readonly MAX_ZOOM;
|
|
227
225
|
/** Current geometric magnification (1 = fitted). Read-only state for consumers/tests. */
|
|
228
226
|
get zoomLevel(): number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
2
|
-
import { l as
|
|
3
|
-
|
|
1
|
+
import { unsafeCSS as v, LitElement as M, html as u, nothing as c, svg as b } from "lit";
|
|
2
|
+
import { l as d } from "../../chunks/scale-B0bRUdc7.mjs";
|
|
3
|
+
import { o as g, b as y } from "../../chunks/attributes-L3eKsbdy.mjs";
|
|
4
|
+
const L = v(`:host {
|
|
4
5
|
display: inline-block;
|
|
5
6
|
width: 8rem;
|
|
6
7
|
height: 2rem;
|
|
@@ -32,13 +33,13 @@ svg {
|
|
|
32
33
|
|
|
33
34
|
.dot {
|
|
34
35
|
fill: var(--mp-sparkline-dot-color);
|
|
35
|
-
}`),
|
|
36
|
-
class
|
|
36
|
+
}`), f = 100, o = 28, n = 3;
|
|
37
|
+
class $ extends M {
|
|
37
38
|
constructor() {
|
|
38
39
|
super(...arguments), this._points = [], this._area = !1, this._showLastDot = !0, this._inputLabel = null;
|
|
39
40
|
}
|
|
40
41
|
static {
|
|
41
|
-
this.styles = [
|
|
42
|
+
this.styles = [L];
|
|
42
43
|
}
|
|
43
44
|
static get observedAttributes() {
|
|
44
45
|
return [
|
|
@@ -104,16 +105,16 @@ class M extends v {
|
|
|
104
105
|
attributeChangedCallback(t, i, e) {
|
|
105
106
|
switch (super.attributeChangedCallback(t, i, e), t) {
|
|
106
107
|
case "area":
|
|
107
|
-
this.area = e
|
|
108
|
+
this.area = y(e, !1);
|
|
108
109
|
break;
|
|
109
110
|
case "show-last-dot":
|
|
110
|
-
this.showLastDot = e
|
|
111
|
+
this.showLastDot = y(e, !0);
|
|
111
112
|
break;
|
|
112
113
|
case "y-min":
|
|
113
|
-
this.yMin =
|
|
114
|
+
this.yMin = g(e);
|
|
114
115
|
break;
|
|
115
116
|
case "y-max":
|
|
116
|
-
this.yMax =
|
|
117
|
+
this.yMax = g(e);
|
|
117
118
|
break;
|
|
118
119
|
case "locale":
|
|
119
120
|
this.locale = e ?? void 0;
|
|
@@ -133,30 +134,30 @@ class M extends v {
|
|
|
133
134
|
if (i !== void 0) return i;
|
|
134
135
|
const e = this._points.filter((h) => h !== null);
|
|
135
136
|
if (!e.length) return "";
|
|
136
|
-
const
|
|
137
|
+
const r = new Intl.NumberFormat(this._locale || this.closest("[lang]")?.getAttribute("lang") || void 0);
|
|
137
138
|
return [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
r.format(e[0]),
|
|
140
|
+
r.format(e[e.length - 1]),
|
|
141
|
+
r.format(Math.min(...e)),
|
|
142
|
+
r.format(Math.max(...e))
|
|
142
143
|
].join(", ");
|
|
143
144
|
}
|
|
144
145
|
render() {
|
|
145
146
|
const t = this._points.filter((s) => s !== null);
|
|
146
147
|
if (!t.length) return u``;
|
|
147
|
-
const i = this._yMin ?? Math.min(...t), e = this._yMax ?? Math.max(...t),
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
return [...s.slice(0, -1), [...
|
|
151
|
-
}, [[]]).filter((s) => s.length > 0),
|
|
152
|
-
return u`<svg viewBox="0 0 ${
|
|
153
|
-
${this._area ?
|
|
154
|
-
<path class="line" d=${
|
|
155
|
-
${this._showLastDot && p ?
|
|
148
|
+
const i = this._yMin ?? Math.min(...t), e = this._yMax ?? Math.max(...t), r = d([0, Math.max(1, this._points.length - 1)], [n, f - n]), h = d(i === e ? [i - 1, e + 1] : [i, e], [o - n, n]), l = this._points.reduce((s, a, m) => {
|
|
149
|
+
if (a === null) return [...s, []];
|
|
150
|
+
const x = s[s.length - 1] ?? [];
|
|
151
|
+
return [...s.slice(0, -1), [...x, { px: r(m), py: h(a) }]];
|
|
152
|
+
}, [[]]).filter((s) => s.length > 0), _ = l.map((s) => s.map((a, m) => `${m === 0 ? "M" : "L"} ${a.px} ${a.py}`).join(" ")).join(" "), k = l.filter((s) => s.length > 1).map((s) => `M ${s[0].px} ${o - n} ` + s.map((a) => `L ${a.px} ${a.py}`).join(" ") + ` L ${s[s.length - 1].px} ${o - n} Z`).join(" "), p = l[l.length - 1]?.[l[l.length - 1].length - 1];
|
|
153
|
+
return u`<svg viewBox="0 0 ${f} ${o}" role="img" aria-label=${this.accessibleName() || c} preserveAspectRatio="none">
|
|
154
|
+
${this._area ? b`<path class="fill" d=${k}></path>` : c}
|
|
155
|
+
<path class="line" d=${_}></path>
|
|
156
|
+
${this._showLastDot && p ? b`<circle class="dot" cx=${p.px} cy=${p.py} r="3"></circle>` : c}
|
|
156
157
|
</svg>`;
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
|
-
typeof customElements < "u" && !customElements.get("mp-sparkline") && customElements.define("mp-sparkline",
|
|
160
|
+
typeof customElements < "u" && !customElements.get("mp-sparkline") && customElements.define("mp-sparkline", $);
|
|
160
161
|
export {
|
|
161
|
-
|
|
162
|
+
$ as MpSparkline
|
|
162
163
|
};
|
package/charts/trend/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { unsafeCSS as
|
|
1
|
+
import { unsafeCSS as q, LitElement as O, nothing as b, svg as y, html as L } from "lit";
|
|
2
2
|
import { repeat as k } from "lit/directives/repeat.js";
|
|
3
|
-
import { l as
|
|
4
|
-
|
|
3
|
+
import { l as v, a as K, t as U, n as S } from "../../chunks/scale-B0bRUdc7.mjs";
|
|
4
|
+
import { o as w, b as A } from "../../chunks/attributes-L3eKsbdy.mjs";
|
|
5
|
+
const P = q(`:host {
|
|
5
6
|
display: block;
|
|
6
7
|
width: 100%;
|
|
7
8
|
aspect-ratio: 16/9;
|
|
@@ -127,12 +128,12 @@ svg {
|
|
|
127
128
|
clip-path: inset(50%);
|
|
128
129
|
white-space: nowrap;
|
|
129
130
|
}`), M = ["#0d6efd", "#21b577", "#fd7e14", "#6f42c1", "#d63384", "#20c997", "#dc3545", "#6c757d"], g = 1e3, x = 562, l = { top: 20, right: 20, bottom: 48, left: 72 };
|
|
130
|
-
class _ extends
|
|
131
|
+
class _ extends O {
|
|
131
132
|
constructor() {
|
|
132
133
|
super(...arguments), this._series = [], this._area = !0, this._stacked = !1, this._inputLabel = null, this._placed = [], this._focusedKey = null, this._restoreFocus = !1, this._hoveredKey = null;
|
|
133
134
|
}
|
|
134
135
|
static {
|
|
135
|
-
this.styles = [
|
|
136
|
+
this.styles = [P];
|
|
136
137
|
}
|
|
137
138
|
static get observedAttributes() {
|
|
138
139
|
return [
|
|
@@ -224,19 +225,19 @@ class _ extends F {
|
|
|
224
225
|
attributeChangedCallback(t, i, e) {
|
|
225
226
|
switch (super.attributeChangedCallback(t, i, e), t) {
|
|
226
227
|
case "area":
|
|
227
|
-
this.area = e
|
|
228
|
+
this.area = A(e, !0);
|
|
228
229
|
break;
|
|
229
230
|
case "stacked":
|
|
230
|
-
this.stacked = e
|
|
231
|
+
this.stacked = A(e, !1);
|
|
231
232
|
break;
|
|
232
233
|
case "y-min":
|
|
233
|
-
this.yMin =
|
|
234
|
+
this.yMin = w(e);
|
|
234
235
|
break;
|
|
235
236
|
case "y-max":
|
|
236
|
-
this.yMax =
|
|
237
|
+
this.yMax = w(e);
|
|
237
238
|
break;
|
|
238
239
|
case "goal":
|
|
239
|
-
this.goal =
|
|
240
|
+
this.goal = w(e);
|
|
240
241
|
break;
|
|
241
242
|
case "goal-label":
|
|
242
243
|
this.goalLabel = e ?? void 0;
|
|
@@ -270,22 +271,22 @@ class _ extends F {
|
|
|
270
271
|
/** Plot every non-gap point; stacked series plot the running sum per x. */
|
|
271
272
|
place() {
|
|
272
273
|
const t = /* @__PURE__ */ new Map(), i = this._series.flatMap(
|
|
273
|
-
(n,
|
|
274
|
+
(n, $) => n.points.map((p, s) => ({ point: p, pi: s })).filter((p) => p.point.y !== null).map((p) => {
|
|
274
275
|
const s = _.toMs(p.point.x), f = (this._stacked ? t.get(s) ?? 0 : 0) + p.point.y;
|
|
275
276
|
return this._stacked && t.set(s, f), {
|
|
276
277
|
seriesId: n.id,
|
|
277
278
|
seriesLabel: n.label,
|
|
278
|
-
color: n.color ?? M[
|
|
279
|
+
color: n.color ?? M[$ % M.length],
|
|
279
280
|
point: p.point,
|
|
280
281
|
xMs: s,
|
|
281
282
|
yPlot: f,
|
|
282
283
|
px: 0,
|
|
283
284
|
py: 0,
|
|
284
|
-
seriesIndex:
|
|
285
|
+
seriesIndex: $,
|
|
285
286
|
pointIndex: p.pi
|
|
286
287
|
};
|
|
287
288
|
})
|
|
288
|
-
), e = i.map((n) => n.xMs), r = i.map((n) => n.yPlot), h = e.length ? [Math.min(...e), Math.max(...e)] : [0, 1], u = Math.min(...r.length ? r : [0], this._goal ?? 1 / 0, this._stacked ? 0 : 1 / 0), m = Math.max(...r.length ? r : [1], this._goal ?? -1 / 0), c =
|
|
289
|
+
), e = i.map((n) => n.xMs), r = i.map((n) => n.yPlot), h = e.length ? [Math.min(...e), Math.max(...e)] : [0, 1], u = Math.min(...r.length ? r : [0], this._goal ?? 1 / 0, this._stacked ? 0 : 1 / 0), m = Math.max(...r.length ? r : [1], this._goal ?? -1 / 0), c = S(Math.min(u, m), Math.max(u, m)), o = [this._yMin ?? c[0], this._yMax ?? c[1]], a = v(h, [l.left, g - l.right]), d = v(o, [x - l.bottom, l.top]);
|
|
289
290
|
return i.map((n) => (n.px = a(n.xMs), n.py = d(n.yPlot), n)), { placed: i, xd: h, yd: o };
|
|
290
291
|
}
|
|
291
292
|
/**
|
|
@@ -374,12 +375,12 @@ class _ extends F {
|
|
|
374
375
|
render() {
|
|
375
376
|
const { placed: t, xd: i, yd: e } = this.place();
|
|
376
377
|
this._placed = t, this._focusedKey && t.some((s) => this.keyOf(s) === this._focusedKey) || (this._focusedKey = t.length ? this.keyOf(t[0]) : null);
|
|
377
|
-
const h =
|
|
378
|
+
const h = v(e, [x - l.bottom, l.top]), u = v(i, [l.left, g - l.right]), m = this.numberFormat(), c = K(e[0], e[1]).filter((s) => s >= e[0] && s <= e[1]), o = U(i[0], i[1], 6, this._locale), a = this._summaryFormatter?.(this._series) ?? this._summary, d = this.groupLabel(), n = h(Math.max(e[0], Math.min(e[1], this._stacked ? 0 : e[0]))), $ = this._series.map((s, I) => ({
|
|
378
379
|
series: s,
|
|
379
|
-
color: s.color ?? M[
|
|
380
|
-
points: t.filter((f) => f.seriesId === s.id).sort((f,
|
|
380
|
+
color: s.color ?? M[I % M.length],
|
|
381
|
+
points: t.filter((f) => f.seriesId === s.id).sort((f, F) => f.xMs - F.xMs)
|
|
381
382
|
})), p = t.find((s) => this.keyOf(s) === this._hoveredKey);
|
|
382
|
-
return
|
|
383
|
+
return L`<div
|
|
383
384
|
class="chart"
|
|
384
385
|
@click=${this.onClick}
|
|
385
386
|
@keydown=${this.onKeyDown}
|
|
@@ -404,7 +405,7 @@ class _ extends F {
|
|
|
404
405
|
${this._goalLabel ? y`<text class="goal-label" x=${g - l.right} y=${h(this._goal) - 8}>${this._goalLabel}</text>` : b}
|
|
405
406
|
</g>` : b}
|
|
406
407
|
${p ? y`<line class="crosshair" x1=${p.px} x2=${p.px} y1=${l.top} y2=${x - l.bottom}></line>` : b}
|
|
407
|
-
${k(
|
|
408
|
+
${k($, (s) => s.series.id, (s) => y`<g aria-hidden="true">
|
|
408
409
|
${this._area ? y`<path class="series-area" fill=${s.color} d=${this.areaPath(s.points, n)}></path>` : b}
|
|
409
410
|
<path class="series-line" stroke=${s.color} d=${this.linePath(s.points)}></path>
|
|
410
411
|
</g>`)}
|
|
@@ -421,7 +422,7 @@ class _ extends F {
|
|
|
421
422
|
aria-label=${this.pointName(s)}
|
|
422
423
|
></circle>`)}
|
|
423
424
|
</svg>
|
|
424
|
-
${a ?
|
|
425
|
+
${a ? L`<div id="trend-summary" class="visually-hidden">${a}</div>` : b}
|
|
425
426
|
<div class="chart-tooltip" aria-hidden="true"></div>
|
|
426
427
|
</div>`;
|
|
427
428
|
}
|
package/checkbox/index.mjs
CHANGED
|
@@ -111,6 +111,7 @@ export declare class MpCheckbox extends MpCheckbox_base {
|
|
|
111
111
|
set value(value: string | null);
|
|
112
112
|
get color(): ToggleButtonColor;
|
|
113
113
|
set color(value: ToggleButtonColor);
|
|
114
|
+
connectedCallback(): void;
|
|
114
115
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
115
116
|
render(): TemplateResult;
|
|
116
117
|
protected updated(): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function u(n, t) {
|
|
2
|
+
const r = n === null ? NaN : Number(n);
|
|
3
|
+
return Number.isFinite(r) ? r : t;
|
|
4
|
+
}
|
|
5
|
+
function e(n) {
|
|
6
|
+
const t = n === null ? NaN : Number(n);
|
|
7
|
+
return Number.isFinite(t) ? t : void 0;
|
|
8
|
+
}
|
|
9
|
+
function i(n, t) {
|
|
10
|
+
return n === null ? t : n !== "false";
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
i as b,
|
|
14
|
+
u as n,
|
|
15
|
+
e as o
|
|
16
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const o = Symbol.for("mintplayer.color-mode-warning");
|
|
2
|
+
function t() {
|
|
3
|
+
getComputedStyle(document.documentElement).getPropertyValue("--mp-color-mode").trim() === "" && console.warn(
|
|
4
|
+
'[@mintplayer/web-components] The --mp-color-mode token is not set on <html>, so component icons will not follow dark mode. Import "@mintplayer/web-components/theming/color-mode.css" next to your Bootstrap CSS (custom themes declare --mp-color-mode: light|dark themselves).'
|
|
5
|
+
);
|
|
6
|
+
}
|
|
7
|
+
function n() {
|
|
8
|
+
const e = globalThis;
|
|
9
|
+
e[o] || typeof document > "u" || !document.head || typeof getComputedStyle != "function" || typeof navigator < "u" && navigator.userAgent.includes("jsdom") || (e[o] = !0, document.readyState === "complete" ? t() : window.addEventListener("load", t, { once: !0 }));
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
n as w
|
|
13
|
+
};
|
|
@@ -125,10 +125,31 @@ const c = e(`.form-check {
|
|
|
125
125
|
opacity: 0.65;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
@container style(--mp-color-mode: dark) {
|
|
129
|
+
.form-switch .form-check-input:not(:checked):not(:focus) {
|
|
130
|
+
--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
@media (forced-colors: active) {
|
|
134
|
+
.form-check.form-switch .form-check-input {
|
|
135
|
+
forced-color-adjust: none;
|
|
136
|
+
background-color: Canvas;
|
|
137
|
+
background-size: 50% 100%;
|
|
138
|
+
border-color: CanvasText;
|
|
139
|
+
}
|
|
140
|
+
.form-check.form-switch .form-check-input:not(:checked) {
|
|
141
|
+
--bs-form-switch-bg: radial-gradient(circle closest-side, CanvasText 75%, transparent 76%);
|
|
142
|
+
}
|
|
143
|
+
.form-check.form-switch .form-check-input:checked {
|
|
144
|
+
--bs-form-switch-bg: radial-gradient(circle closest-side, HighlightText 75%, transparent 76%);
|
|
145
|
+
background-color: Highlight;
|
|
146
|
+
border-color: Highlight;
|
|
147
|
+
}
|
|
148
|
+
.form-check.form-switch .form-check-input:focus-visible {
|
|
149
|
+
outline: 2px solid Highlight;
|
|
150
|
+
outline-offset: 2px;
|
|
151
|
+
}
|
|
130
152
|
}
|
|
131
|
-
|
|
132
153
|
.form-check {
|
|
133
154
|
display: flex;
|
|
134
155
|
align-items: center;
|
|
@@ -61,12 +61,17 @@ table tr:not(:first-child) > th:nth-of-type(1) {
|
|
|
61
61
|
.calendar-nav {
|
|
62
62
|
display: flex;
|
|
63
63
|
align-items: center;
|
|
64
|
-
|
|
64
|
+
min-height: 40px;
|
|
65
|
+
padding: 0 0.25rem;
|
|
66
|
+
background-color: var(--bs-body-bg);
|
|
67
|
+
border: 1px solid var(--bs-border-color);
|
|
68
|
+
border-bottom: 0;
|
|
65
69
|
}
|
|
66
70
|
.calendar-nav .chevron-btn {
|
|
67
|
-
flex: 0 0
|
|
68
|
-
width:
|
|
69
|
-
|
|
71
|
+
flex: 0 0 40px;
|
|
72
|
+
width: 40px;
|
|
73
|
+
height: 40px;
|
|
74
|
+
padding: 0;
|
|
70
75
|
}
|
|
71
76
|
.calendar-nav .month-label {
|
|
72
77
|
flex: 1 1 auto;
|
|
@@ -174,9 +179,9 @@ class y extends p {
|
|
|
174
179
|
}
|
|
175
180
|
const a = [];
|
|
176
181
|
for (let i = 0; i < l.length; i += 7) {
|
|
177
|
-
const h = l.slice(i, i + 7), d = h.find((
|
|
182
|
+
const h = l.slice(i, i + 7), d = h.find((f) => f.isInMonth), g = d ? d.date : h[0].date;
|
|
178
183
|
a.push({
|
|
179
|
-
number: this.weekOfYear(
|
|
184
|
+
number: this.weekOfYear(g),
|
|
180
185
|
days: h
|
|
181
186
|
});
|
|
182
187
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { LitElement as a, nothing as
|
|
1
|
+
import { LitElement as a, nothing as r, html as n } from "lit";
|
|
2
2
|
import { ifDefined as h } from "lit/directives/if-defined.js";
|
|
3
|
-
import { createRef as u, ref as
|
|
4
|
-
import { f as b } from "./form-check.styles-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
3
|
+
import { createRef as u, ref as o } from "lit/directives/ref.js";
|
|
4
|
+
import { f as b } from "./form-check.styles-DqvBnspm.mjs";
|
|
5
|
+
import { w as p } from "./color-mode-warning-71FmlzWX.mjs";
|
|
6
|
+
import { i as _ } from "./invalid-feedback.styles-he0JYrJm.mjs";
|
|
7
|
+
import { H as m } from "./host-aria-WSGs7SPQ.mjs";
|
|
8
|
+
import { a as f, e as k } from "./error-text-B45eDAt1.mjs";
|
|
9
|
+
import { F as g } from "./form-associated-BR-fUvZ1.mjs";
|
|
10
|
+
import { t as y } from "./mp-toggle-button-CaS9uYLE.mjs";
|
|
11
|
+
const c = /* @__PURE__ */ new Set(["checkbox", "switch", "toggle_button"]), l = /* @__PURE__ */ new Set([
|
|
11
12
|
"primary",
|
|
12
13
|
"secondary",
|
|
13
14
|
"success",
|
|
@@ -26,18 +27,18 @@ const o = /* @__PURE__ */ new Set(["checkbox", "switch", "toggle_button"]), l =
|
|
|
26
27
|
"outline-dark"
|
|
27
28
|
]);
|
|
28
29
|
let d = 0;
|
|
29
|
-
class
|
|
30
|
+
class x extends g(a) {
|
|
30
31
|
constructor() {
|
|
31
|
-
super(...arguments), this._type = "checkbox", this._checked = !1, this._indeterminate = !1, this._disabled = !1, this._name = null, this._value = null, this._color = "primary", this._inputLabel = null, this._errorText = null, this.hostAria = new
|
|
32
|
+
super(...arguments), this._type = "checkbox", this._checked = !1, this._indeterminate = !1, this._disabled = !1, this._name = null, this._value = null, this._color = "primary", this._inputLabel = null, this._errorText = null, this.hostAria = new m(this, {
|
|
32
33
|
referenceTarget: () => this._inputRef.value ?? null,
|
|
33
|
-
describedByExtras: () =>
|
|
34
|
+
describedByExtras: () => f(this.renderRoot)
|
|
34
35
|
}), this._inputId = `mp-checkbox-${++d}`, this._errorId = `mp-checkbox-${d}-error`, this._inputRef = u(), this.onInputChange = (e) => {
|
|
35
|
-
const t = e.target, i = t.checked,
|
|
36
|
-
this._checked = i, this._indeterminate =
|
|
36
|
+
const t = e.target, i = t.checked, s = t.indeterminate;
|
|
37
|
+
this._checked = i, this._indeterminate = s, this.reflectBoolean("checked", i), this.reflectBoolean("indeterminate", s), this.dispatchEvent(
|
|
37
38
|
new CustomEvent("change", {
|
|
38
39
|
detail: {
|
|
39
40
|
checked: i,
|
|
40
|
-
indeterminate:
|
|
41
|
+
indeterminate: s,
|
|
41
42
|
value: this._value
|
|
42
43
|
},
|
|
43
44
|
bubbles: !0,
|
|
@@ -47,7 +48,7 @@ class y extends k(a) {
|
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
static {
|
|
50
|
-
this.styles = [b,
|
|
51
|
+
this.styles = [b, y, _];
|
|
51
52
|
}
|
|
52
53
|
static {
|
|
53
54
|
this.shadowRootOptions = {
|
|
@@ -129,7 +130,7 @@ class y extends k(a) {
|
|
|
129
130
|
return this._type;
|
|
130
131
|
}
|
|
131
132
|
set type(e) {
|
|
132
|
-
!
|
|
133
|
+
!c.has(e) || this._type === e || (this._type = e, this.requestUpdate());
|
|
133
134
|
}
|
|
134
135
|
get checked() {
|
|
135
136
|
return this._checked;
|
|
@@ -172,6 +173,9 @@ class y extends k(a) {
|
|
|
172
173
|
set color(e) {
|
|
173
174
|
!l.has(e) || this._color === e || (this._color = e, this.requestUpdate());
|
|
174
175
|
}
|
|
176
|
+
connectedCallback() {
|
|
177
|
+
super.connectedCallback(), p();
|
|
178
|
+
}
|
|
175
179
|
attributeChangedCallback(e, t, i) {
|
|
176
180
|
switch (super.attributeChangedCallback(e, t, i), e) {
|
|
177
181
|
// Both are read straight from the host in render(), so a change has to ask
|
|
@@ -186,9 +190,11 @@ class y extends k(a) {
|
|
|
186
190
|
case "error-text":
|
|
187
191
|
this._errorText = i, this.requestUpdate();
|
|
188
192
|
break;
|
|
189
|
-
case "type":
|
|
190
|
-
|
|
193
|
+
case "type": {
|
|
194
|
+
const s = i ?? "checkbox";
|
|
195
|
+
c.has(s) && (this._type = s, this.requestUpdate());
|
|
191
196
|
break;
|
|
197
|
+
}
|
|
192
198
|
case "checked":
|
|
193
199
|
this._checked = i !== null, this.requestUpdate();
|
|
194
200
|
break;
|
|
@@ -204,9 +210,11 @@ class y extends k(a) {
|
|
|
204
210
|
case "value":
|
|
205
211
|
this._value = i, this.requestUpdate();
|
|
206
212
|
break;
|
|
207
|
-
case "color":
|
|
208
|
-
|
|
213
|
+
case "color": {
|
|
214
|
+
const s = i ?? "primary";
|
|
215
|
+
l.has(s) && (this._color = s, this.requestUpdate());
|
|
209
216
|
break;
|
|
217
|
+
}
|
|
210
218
|
case "aria-label":
|
|
211
219
|
this.requestUpdate();
|
|
212
220
|
break;
|
|
@@ -238,20 +246,20 @@ class y extends k(a) {
|
|
|
238
246
|
return n`
|
|
239
247
|
<label class=${e ? "form-check form-switch" : "form-check"}>
|
|
240
248
|
<input
|
|
241
|
-
${
|
|
249
|
+
${o(this._inputRef)}
|
|
242
250
|
type="checkbox"
|
|
243
251
|
class="form-check-input"
|
|
244
252
|
id=${this._inputId}
|
|
245
253
|
.checked=${this._checked}
|
|
246
254
|
?disabled=${this._disabled}
|
|
247
|
-
aria-invalid=${this.hasAttribute("invalid") ? "true" :
|
|
248
|
-
aria-required=${this.hasAttribute("required") ? "true" :
|
|
255
|
+
aria-invalid=${this.hasAttribute("invalid") ? "true" : r}
|
|
256
|
+
aria-required=${this.hasAttribute("required") ? "true" : r}
|
|
249
257
|
aria-errormessage=${i.id}
|
|
250
258
|
aria-describedby=${i.id}
|
|
251
|
-
name=${this._name ??
|
|
252
|
-
value=${this._value ??
|
|
253
|
-
role=${e ? "switch" :
|
|
254
|
-
aria-checked=${this._indeterminate ? "mixed" :
|
|
259
|
+
name=${this._name ?? r}
|
|
260
|
+
value=${this._value ?? r}
|
|
261
|
+
role=${e ? "switch" : r}
|
|
262
|
+
aria-checked=${this._indeterminate ? "mixed" : r}
|
|
255
263
|
aria-label=${h(t)}
|
|
256
264
|
@change=${this.onInputChange}
|
|
257
265
|
/>
|
|
@@ -261,24 +269,24 @@ class y extends k(a) {
|
|
|
261
269
|
`;
|
|
262
270
|
}
|
|
263
271
|
errorFeedback() {
|
|
264
|
-
return
|
|
272
|
+
return k(this._errorId, this._errorText, this.hasAttribute("invalid"));
|
|
265
273
|
}
|
|
266
274
|
renderToggleButton() {
|
|
267
275
|
const e = this.getAttribute("aria-label") ?? this._inputLabel ?? void 0, t = this.errorFeedback();
|
|
268
276
|
return n`
|
|
269
277
|
<input
|
|
270
|
-
${
|
|
278
|
+
${o(this._inputRef)}
|
|
271
279
|
type="checkbox"
|
|
272
280
|
class="btn-check"
|
|
273
281
|
id=${this._inputId}
|
|
274
282
|
.checked=${this._checked}
|
|
275
283
|
?disabled=${this._disabled}
|
|
276
|
-
aria-invalid=${this.hasAttribute("invalid") ? "true" :
|
|
277
|
-
aria-required=${this.hasAttribute("required") ? "true" :
|
|
284
|
+
aria-invalid=${this.hasAttribute("invalid") ? "true" : r}
|
|
285
|
+
aria-required=${this.hasAttribute("required") ? "true" : r}
|
|
278
286
|
aria-errormessage=${t.id}
|
|
279
287
|
aria-describedby=${t.id}
|
|
280
|
-
name=${this._name ??
|
|
281
|
-
value=${this._value ??
|
|
288
|
+
name=${this._name ?? r}
|
|
289
|
+
value=${this._value ?? r}
|
|
282
290
|
role="button"
|
|
283
291
|
aria-pressed=${this._checked ? "true" : "false"}
|
|
284
292
|
aria-label=${h(e)}
|
|
@@ -307,7 +315,7 @@ class y extends k(a) {
|
|
|
307
315
|
return this._inputRef.value ?? null;
|
|
308
316
|
}
|
|
309
317
|
}
|
|
310
|
-
typeof customElements < "u" && !customElements.get("mp-checkbox") && customElements.define("mp-checkbox",
|
|
318
|
+
typeof customElements < "u" && !customElements.get("mp-checkbox") && customElements.define("mp-checkbox", x);
|
|
311
319
|
export {
|
|
312
|
-
|
|
320
|
+
x as M
|
|
313
321
|
};
|