@mintplayer/web-components 2.20.0 → 3.0.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/chunks/{datatable-qkYf-N0c.mjs → datatable-CrK1ZNq-.mjs} +132 -130
- package/chunks/{pagination-Bcz1TwlS.mjs → pagination-DgDp3v3u.mjs} +1 -1
- package/custom-elements.json +3119 -3416
- package/datatable/index.mjs +1 -1
- package/datatable/src/components/mp-datatable.d.ts +4 -0
- package/datatable/src/types/tree.d.ts +7 -0
- package/dropdown-menu/index.mjs +16 -23
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +5 -8
- package/dropdown-menu/src/index.d.ts +1 -1
- package/dropdown-menu/src/types/dropdown.d.ts +0 -2
- package/dropdown-menu/src/types/index.d.ts +1 -1
- package/file-manager/index.mjs +1 -1
- package/light-dom/index.mjs +61 -121
- package/light-dom/src/install-light-styles.d.ts +10 -22
- package/light-dom/src/scoped-html.d.ts +0 -6
- package/machine/index.d.ts +1 -0
- package/machine/index.mjs +47 -0
- package/machine/src/index.d.ts +2 -0
- package/machine/src/machine-controller.d.ts +25 -0
- package/machine/src/props-directive.d.ts +21 -0
- package/package.json +10 -1
- package/pagination/index.mjs +1 -1
- package/tile-manager/index.mjs +150 -731
- package/tile-manager/src/components/index.d.ts +1 -2
- package/tile-manager/src/components/mp-tile-manager.d.ts +107 -0
- package/tile-manager/src/index.d.ts +2 -3
- package/tree-select/index.mjs +63 -55
- package/tree-select/src/components/mp-tree-select.d.ts +16 -5
- package/typeahead/index.d.ts +1 -0
- package/typeahead/index.mjs +220 -0
- package/typeahead/src/components/mp-typeahead.d.ts +67 -0
- package/typeahead/src/index.d.ts +3 -0
- package/tile-manager/src/components/mint-tile-manager.element.d.ts +0 -212
- package/tile-manager/src/components/mint-tile-manager.element.template.d.ts +0 -2
- package/tile-manager/src/types/grid-rect.d.ts +0 -12
- package/tile-manager/src/types/index.d.ts +0 -3
- package/tile-manager/src/types/tile-layout-snapshot.d.ts +0 -15
- package/tile-manager/src/types/tile-position.d.ts +0 -10
- package/tile-manager/src/utils/grid-geometry.d.ts +0 -49
- package/tile-manager/src/utils/index.d.ts +0 -1
- package/tile-manager/src/utils/pack.d.ts +0 -24
package/datatable/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as DEFAULT_DATATABLE_LABELS, t as MpDatatable, r as computeNextSort, i as datatableLightStyles, n as sortRows } from "../chunks/datatable-
|
|
1
|
+
export { a as DEFAULT_DATATABLE_LABELS, t as MpDatatable, r as computeNextSort, i as datatableLightStyles, n as sortRows } from "../chunks/datatable-CrK1ZNq-.mjs";
|
|
@@ -231,6 +231,8 @@ export declare class MpDatatable extends LitElement {
|
|
|
231
231
|
private _fetch;
|
|
232
232
|
/** Bumped on invalidation; in-flight responses from an older generation are dropped. */
|
|
233
233
|
private _fetchGeneration;
|
|
234
|
+
/** Aborts every in-flight `fetch` of the current generation; replaced on invalidation (#436 D4). */
|
|
235
|
+
private _fetchAbort;
|
|
234
236
|
/** Guards the one-time initial page-1 load. Reset when the callback changes. */
|
|
235
237
|
private _initialFetchDone;
|
|
236
238
|
/** Coalesces multiple setter calls in one flush into a single reload. */
|
|
@@ -781,6 +783,8 @@ export declare class MpDatatable extends LitElement {
|
|
|
781
783
|
* that echoes a different page number can't deadlock the window.
|
|
782
784
|
* Generation-guarded against responses that land after an invalidation.
|
|
783
785
|
*/
|
|
786
|
+
/** Drop every in-flight fetch response (generation) and abort the requests themselves (signal). */
|
|
787
|
+
private invalidateFetches;
|
|
784
788
|
private fetchWindowPage;
|
|
785
789
|
/**
|
|
786
790
|
* Fetch a node's children into the child cache. Called on expand or when a
|
|
@@ -23,6 +23,13 @@ export interface DatatableFetchRequest {
|
|
|
23
23
|
page: number;
|
|
24
24
|
perPage: number;
|
|
25
25
|
sortColumns: SortColumn[];
|
|
26
|
+
/**
|
|
27
|
+
* Aborts when the table invalidates its pages (sort, page size, a new `fetch`,
|
|
28
|
+
* `reload()`), so a superseded request stops instead of running to completion
|
|
29
|
+
* and being ignored. Pass it to `fetch`; the same shape as every other
|
|
30
|
+
* provider request in the libraries (#436 D4).
|
|
31
|
+
*/
|
|
32
|
+
signal: AbortSignal;
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* Response returned from the `fetch` callback. Only `data` + `totalRecords` are
|
package/dropdown-menu/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ var a = class extends t {
|
|
|
10
10
|
super(...t), this.#e = 0, this._inputLabel = null, this.#t = new e(this, { referenceTarget: () => this.renderRoot?.querySelector("ul") ?? null }), this.#o = () => {
|
|
11
11
|
this.#s();
|
|
12
12
|
}, this.#c = (e) => {
|
|
13
|
-
|
|
13
|
+
switch (e.key) {
|
|
14
14
|
case "ArrowDown":
|
|
15
15
|
this.#l(1), e.preventDefault();
|
|
16
16
|
break;
|
|
@@ -59,7 +59,6 @@ var a = class extends t {
|
|
|
59
59
|
static get observedAttributes() {
|
|
60
60
|
return [
|
|
61
61
|
...super.observedAttributes ?? [],
|
|
62
|
-
"mode",
|
|
63
62
|
"max-height",
|
|
64
63
|
"aria-label",
|
|
65
64
|
"input-label",
|
|
@@ -68,12 +67,6 @@ var a = class extends t {
|
|
|
68
67
|
];
|
|
69
68
|
}
|
|
70
69
|
#e;
|
|
71
|
-
get mode() {
|
|
72
|
-
return this.getAttribute("mode") === "listbox" ? "listbox" : "menu";
|
|
73
|
-
}
|
|
74
|
-
set mode(e) {
|
|
75
|
-
e ? this.setAttribute("mode", e) : this.removeAttribute("mode");
|
|
76
|
-
}
|
|
77
70
|
get inputLabel() {
|
|
78
71
|
return this._inputLabel;
|
|
79
72
|
}
|
|
@@ -89,7 +82,7 @@ var a = class extends t {
|
|
|
89
82
|
super.disconnectedCallback(), this.removeEventListener("click", this.#d), this.removeEventListener("keydown", this.#c);
|
|
90
83
|
}
|
|
91
84
|
attributeChangedCallback(e, t, n) {
|
|
92
|
-
super.attributeChangedCallback(e, t, n), e === "max-height" ? n ? this.style.setProperty("--mp-dropdown-max-height", `${n}px`) : this.style.removeProperty("--mp-dropdown-max-height") : e === "aria-labelledby" || e === "aria-describedby" ? this.#t.syncReferences() : e === "input-label" ? (this._inputLabel = n, this.requestUpdate()) :
|
|
85
|
+
super.attributeChangedCallback(e, t, n), e === "max-height" ? n ? this.style.setProperty("--mp-dropdown-max-height", `${n}px`) : this.style.removeProperty("--mp-dropdown-max-height") : e === "aria-labelledby" || e === "aria-describedby" ? this.#t.syncReferences() : e === "input-label" ? (this._inputLabel = n, this.requestUpdate()) : e === "aria-label" && (this.requestUpdate(), this.#s());
|
|
93
86
|
}
|
|
94
87
|
firstUpdated() {
|
|
95
88
|
this.#s();
|
|
@@ -117,20 +110,20 @@ var a = class extends t {
|
|
|
117
110
|
let e = (e) => [...this.querySelectorAll(e)].filter((e) => e.closest("mp-dropdown-menu") === this && !e.hasAttribute("role"));
|
|
118
111
|
e(".dropdown-header").forEach((e) => e.setAttribute("role", "presentation")), e(".dropdown-divider").forEach((e) => e.setAttribute("role", "separator"));
|
|
119
112
|
let t = this.#n();
|
|
120
|
-
if (t.length
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
113
|
+
if (t.length !== 0) {
|
|
114
|
+
if (!t[this.#e] || this.#i(t[this.#e])) {
|
|
115
|
+
let e = t.findIndex((e) => !this.#i(e));
|
|
116
|
+
this.#e = e >= 0 ? e : 0;
|
|
117
|
+
}
|
|
118
|
+
t.forEach((e, t) => {
|
|
119
|
+
let n = this.#r(e);
|
|
120
|
+
n !== e && e.setAttribute("role", "presentation"), n.setAttribute("role", "menuitem");
|
|
121
|
+
let r = this.#i(e);
|
|
122
|
+
n.removeAttribute("aria-selected"), r ? n.setAttribute("aria-disabled", "true") : n.removeAttribute("aria-disabled");
|
|
123
|
+
let i = t === this.#e && !r;
|
|
124
|
+
n.setAttribute("tabindex", i ? "0" : "-1");
|
|
125
|
+
});
|
|
124
126
|
}
|
|
125
|
-
let n = this.mode === "listbox";
|
|
126
|
-
t.forEach((e, t) => {
|
|
127
|
-
let r = this.#r(e);
|
|
128
|
-
r !== e && e.setAttribute("role", "presentation"), r.setAttribute("role", n ? "option" : "menuitem");
|
|
129
|
-
let i = this.#i(e);
|
|
130
|
-
n ? r.setAttribute("aria-selected", e.classList.contains("active") ? "true" : "false") : r.removeAttribute("aria-selected"), i ? r.setAttribute("aria-disabled", "true") : r.removeAttribute("aria-disabled");
|
|
131
|
-
let a = !n && t === this.#e && !i;
|
|
132
|
-
r.setAttribute("tabindex", a ? "0" : "-1");
|
|
133
|
-
});
|
|
134
127
|
}
|
|
135
128
|
#c;
|
|
136
129
|
#l(e) {
|
|
@@ -151,7 +144,7 @@ var a = class extends t {
|
|
|
151
144
|
return n`
|
|
152
145
|
<ul
|
|
153
146
|
class="dropdown-menu show"
|
|
154
|
-
role
|
|
147
|
+
role="menu"
|
|
155
148
|
part="menu"
|
|
156
149
|
aria-label=${this.getAttribute("aria-label") ?? this._inputLabel ?? r}
|
|
157
150
|
>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MpDropdownElement } from './mp-dropdown-element';
|
|
2
|
-
import { DropdownMode } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* `<mp-dropdown-menu>` — a Bootstrap `.dropdown-menu` rendered inside its shadow
|
|
5
4
|
* root, with theme-aware styling that follows the page theme across the shadow
|
|
@@ -16,13 +15,13 @@ import { DropdownMode } from '../types';
|
|
|
16
15
|
* framework wrapper ships. In Angular the classes come from the `[bsDropdownItem]`
|
|
17
16
|
* / `[bsDropdownDivider]` / `[bsDropdownHeader]` attribute directives.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* The menu provides roving-tabindex keyboard navigation (Arrow keys / Home /
|
|
19
|
+
* End) over the enabled items and assigns `role="menuitem"` to each item's
|
|
20
|
+
* interactive control. It is a menu only: the former `mode="listbox"` existed
|
|
21
|
+
* for the typeahead alone, which now renders its own listbox from its headless
|
|
22
|
+
* core (#436 D10).
|
|
23
23
|
*
|
|
24
24
|
* Attributes:
|
|
25
|
-
* - `mode` — `menu` (default) | `listbox`.
|
|
26
25
|
* - `max-height` — px cap; maps to `--mp-dropdown-max-height` (scrolls beyond).
|
|
27
26
|
* - naming: `aria-label` / `input-label`, or `aria-labelledby` on the host
|
|
28
27
|
* (resolved into cross-root element references). The old `label-id` is gone —
|
|
@@ -41,8 +40,6 @@ export declare class MpDropdownMenu extends MpDropdownElement {
|
|
|
41
40
|
#private;
|
|
42
41
|
static styles: import('lit').CSSResult[];
|
|
43
42
|
static get observedAttributes(): string[];
|
|
44
|
-
get mode(): DropdownMode;
|
|
45
|
-
set mode(v: DropdownMode);
|
|
46
43
|
private _inputLabel;
|
|
47
44
|
/**
|
|
48
45
|
* Optional accessible name for the menu list. A menu has no intrinsic text of
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** How the menu exposes itself to assistive tech (and how items are roled). */
|
|
2
|
-
export type DropdownMode = 'menu' | 'listbox';
|
|
3
1
|
/**
|
|
4
2
|
* A `.dropdown-item` carrying an opaque value for the menu's `select` event.
|
|
5
3
|
* Assign any value (object, string, number) to `dropdownValue`; the menu reports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { DropdownItemElement,
|
|
1
|
+
export type { DropdownItemElement, DropdownSelectEventDetail } from './dropdown';
|
package/file-manager/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as e, v as t, y as n } from "../chunks/a11y-C6aX-lsZ.mjs";
|
|
2
2
|
import { adoptLightStyles as r } from "../light-dom/index.mjs";
|
|
3
|
-
import "../chunks/datatable-
|
|
3
|
+
import "../chunks/datatable-CrK1ZNq-.mjs";
|
|
4
4
|
import "../chunks/splitter-ByLyrd5H.mjs";
|
|
5
5
|
import "../chunks/treeview-BuznGbcj.mjs";
|
|
6
6
|
import { LitElement as i, html as a, nothing as o, unsafeCSS as s } from "lit";
|
package/light-dom/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { html as e, svg as t } from "lit";
|
|
2
|
+
import { SCOPED_STYLE_MARKER as n, SCOPE_ATTRIBUTE as r, SCOPE_ATTRIBUTE as i, adoptLightStyles as a, getLightStyleEntries as o, installLightStyles as s, installScopedStyles as c, stampScope as l, validateScope as u, validateScope as d, writeScopedStyleTag as f } from "@mintplayer/ui-core/scoped-styles";
|
|
2
3
|
//#region libs/mintplayer-web-components/light-dom/src/scoped-html.ts
|
|
3
|
-
var
|
|
4
|
+
var p = /* @__PURE__ */ new Set([
|
|
4
5
|
"script",
|
|
5
6
|
"style",
|
|
6
7
|
"textarea",
|
|
7
8
|
"title"
|
|
8
|
-
]),
|
|
9
|
+
]), m = {
|
|
9
10
|
Text: 0,
|
|
10
11
|
TagOpen: 1,
|
|
11
12
|
MarkupDecl: 2,
|
|
@@ -20,85 +21,85 @@ var n = "data-mps", r = /* @__PURE__ */ new Set([
|
|
|
20
21
|
Comment: 11,
|
|
21
22
|
Bogus: 12,
|
|
22
23
|
RawText: 13
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
let
|
|
26
|
-
!t.sawSlash &&
|
|
24
|
+
}, h = (e) => /[a-zA-Z0-9-]/.test(e), g = (e) => e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
25
|
+
function _(e, t, n) {
|
|
26
|
+
let r = "", i = 0, a = e.length, o = () => {
|
|
27
|
+
!t.sawSlash && p.has(t.tagName) ? (t.state = m.RawText, t.rawMatch = 0) : t.state = m.Text, t.sawSlash = !1;
|
|
27
28
|
};
|
|
28
|
-
for (;
|
|
29
|
-
let
|
|
29
|
+
for (; i < a;) {
|
|
30
|
+
let a = e[i];
|
|
30
31
|
switch (t.state) {
|
|
31
|
-
case
|
|
32
|
-
|
|
32
|
+
case m.Text:
|
|
33
|
+
a === "<" && (t.state = m.TagOpen), r += a, i++;
|
|
33
34
|
break;
|
|
34
|
-
case
|
|
35
|
-
/[a-zA-Z]/.test(
|
|
35
|
+
case m.TagOpen:
|
|
36
|
+
/[a-zA-Z]/.test(a) ? (t.state = m.TagName, t.tagName = a.toLowerCase()) : t.state = a === "/" ? m.Closing : a === "!" ? m.MarkupDecl : a === "?" ? m.Bogus : m.Text, r += a, i++;
|
|
36
37
|
break;
|
|
37
|
-
case
|
|
38
|
-
t.state =
|
|
38
|
+
case m.MarkupDecl:
|
|
39
|
+
t.state = a === "-" ? m.CommentDash : m.Bogus, r += a, i++;
|
|
39
40
|
break;
|
|
40
|
-
case
|
|
41
|
-
|
|
41
|
+
case m.CommentDash:
|
|
42
|
+
a === "-" ? (t.state = m.Comment, t.commentDashes = 0) : t.state = m.Bogus, r += a, i++;
|
|
42
43
|
break;
|
|
43
|
-
case
|
|
44
|
-
a
|
|
44
|
+
case m.TagName:
|
|
45
|
+
h(a) ? (t.tagName += a.toLowerCase(), r += a, i++) : (r += n, t.state = m.InTag, t.sawSlash = !1);
|
|
45
46
|
break;
|
|
46
|
-
case
|
|
47
|
-
|
|
47
|
+
case m.InTag:
|
|
48
|
+
a === ">" ? (r += a, i++, o()) : a === "/" ? (t.sawSlash = !0, r += a, i++) : a === "=" ? (t.sawSlash = !1, t.state = m.AfterEq, r += a, i++) : a === "\"" ? (t.sawSlash = !1, t.state = m.ValueDq, r += a, i++) : a === "'" ? (t.sawSlash = !1, t.state = m.ValueSq, r += a, i++) : (g(a) || (t.sawSlash = !1), r += a, i++);
|
|
48
49
|
break;
|
|
49
|
-
case
|
|
50
|
-
|
|
50
|
+
case m.AfterEq:
|
|
51
|
+
g(a) ? (r += a, i++) : a === "\"" ? (t.state = m.ValueDq, r += a, i++) : a === "'" ? (t.state = m.ValueSq, r += a, i++) : a === ">" ? (r += a, i++, o()) : (t.state = m.ValueUnq, r += a, i++);
|
|
51
52
|
break;
|
|
52
|
-
case
|
|
53
|
-
|
|
53
|
+
case m.ValueDq:
|
|
54
|
+
a === "\"" && (t.state = m.InTag), r += a, i++;
|
|
54
55
|
break;
|
|
55
|
-
case
|
|
56
|
-
|
|
56
|
+
case m.ValueSq:
|
|
57
|
+
a === "'" && (t.state = m.InTag), r += a, i++;
|
|
57
58
|
break;
|
|
58
|
-
case
|
|
59
|
-
|
|
59
|
+
case m.ValueUnq:
|
|
60
|
+
g(a) ? (t.state = m.InTag, r += a, i++) : a === ">" ? (r += a, i++, o()) : (r += a, i++);
|
|
60
61
|
break;
|
|
61
|
-
case
|
|
62
|
-
case
|
|
63
|
-
|
|
62
|
+
case m.Closing:
|
|
63
|
+
case m.Bogus:
|
|
64
|
+
a === ">" && (t.state = m.Text), r += a, i++;
|
|
64
65
|
break;
|
|
65
|
-
case
|
|
66
|
-
|
|
66
|
+
case m.Comment:
|
|
67
|
+
a === "-" ? t.commentDashes++ : a === ">" && t.commentDashes >= 2 ? t.state = m.Text : t.commentDashes = 0, r += a, i++;
|
|
67
68
|
break;
|
|
68
|
-
case
|
|
69
|
+
case m.RawText: {
|
|
69
70
|
let e = "</" + t.tagName;
|
|
70
|
-
|
|
71
|
+
a.toLowerCase() === e[t.rawMatch] ? (t.rawMatch++, t.rawMatch === e.length && (t.state = m.Closing, t.rawMatch = 0)) : t.rawMatch = +(a === "<"), r += a, i++;
|
|
71
72
|
break;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
return t.state ===
|
|
76
|
+
return t.state === m.TagName && (r += n, t.state = m.InTag, t.sawSlash = !1), r;
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
e.state ===
|
|
78
|
+
function v(e) {
|
|
79
|
+
e.state === m.AfterEq && (e.state = m.ValueUnq);
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
e.state ===
|
|
81
|
+
function y(e) {
|
|
82
|
+
e.state === m.ValueUnq && (e.state = m.InTag);
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
let
|
|
84
|
+
function b(e, t) {
|
|
85
|
+
let n = ` ${i}="${t}"`, r = (e) => {
|
|
85
86
|
let t = {
|
|
86
|
-
state:
|
|
87
|
+
state: m.Text,
|
|
87
88
|
tagName: "",
|
|
88
89
|
commentDashes: 0,
|
|
89
90
|
rawMatch: 0,
|
|
90
91
|
sawSlash: !1
|
|
91
|
-
},
|
|
92
|
-
for (let i = 0; i < e.length; i++) i > 0 &&
|
|
93
|
-
return
|
|
94
|
-
},
|
|
95
|
-
return Object.defineProperty(
|
|
92
|
+
}, r = [];
|
|
93
|
+
for (let i = 0; i < e.length; i++) i > 0 && y(t), r.push(_(e[i], t, n)), i < e.length - 1 && v(t);
|
|
94
|
+
return r;
|
|
95
|
+
}, a = r(e), o = r(e.raw), s = a;
|
|
96
|
+
return Object.defineProperty(s, "raw", { value: Object.freeze(o) }), Object.freeze(s);
|
|
96
97
|
}
|
|
97
|
-
var
|
|
98
|
-
function
|
|
99
|
-
e.verify !== void 0 && (
|
|
98
|
+
var x = !0;
|
|
99
|
+
function S(e) {
|
|
100
|
+
e.verify !== void 0 && (x = e.verify);
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function C(e, t, n) {
|
|
102
103
|
if (typeof document < "u") try {
|
|
103
104
|
let r = (e) => {
|
|
104
105
|
let t = document.createElement("template");
|
|
@@ -109,80 +110,19 @@ function p(e, t, n) {
|
|
|
109
110
|
if (e instanceof Error && e.message.startsWith("scopedHtml(")) throw e;
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
function h(e, t) {
|
|
116
|
-
m(e);
|
|
113
|
+
function w(e, t) {
|
|
114
|
+
d(e);
|
|
117
115
|
let n = /* @__PURE__ */ new WeakMap();
|
|
118
116
|
return (r, ...i) => {
|
|
119
117
|
let a = n.get(r);
|
|
120
|
-
return a || (a =
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function g(t) {
|
|
124
|
-
return h(t, e);
|
|
125
|
-
}
|
|
126
|
-
function _(e) {
|
|
127
|
-
return h(e, t);
|
|
128
|
-
}
|
|
129
|
-
function v(e, t) {
|
|
130
|
-
m(t);
|
|
131
|
-
let r = e.getAttribute(n);
|
|
132
|
-
if (r === null || r === t) {
|
|
133
|
-
e.setAttribute(n, t);
|
|
134
|
-
for (let n of Array.from(e.children)) v(n, t);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region libs/mintplayer-web-components/light-dom/src/install-light-styles.ts
|
|
139
|
-
var y = Symbol.for("mp.lightStyles");
|
|
140
|
-
function b() {
|
|
141
|
-
let e = globalThis;
|
|
142
|
-
return e[y] ??= {
|
|
143
|
-
entries: /* @__PURE__ */ new Map(),
|
|
144
|
-
listeners: /* @__PURE__ */ new Set()
|
|
118
|
+
return a || (a = b(r, e), x && C(r, a, e), n.set(r, a)), t(a, ...i);
|
|
145
119
|
};
|
|
146
120
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return typeof document < "u" && "adoptedStyleSheets" in Document.prototype && typeof CSSStyleSheet < "u" && "replaceSync" in CSSStyleSheet.prototype;
|
|
121
|
+
function T(t) {
|
|
122
|
+
return w(t, e);
|
|
150
123
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
153
|
-
let n = b();
|
|
154
|
-
if (n.entries.has(e)) return;
|
|
155
|
-
let r = typeof t == "string" ? t : t.cssText, i = {
|
|
156
|
-
key: e,
|
|
157
|
-
cssText: r
|
|
158
|
-
};
|
|
159
|
-
if (S()) {
|
|
160
|
-
let e = typeof t == "string" ? void 0 : t.styleSheet;
|
|
161
|
-
e ? i.sheet = e : (i.sheet = new CSSStyleSheet(), i.sheet.replaceSync(r));
|
|
162
|
-
}
|
|
163
|
-
if (!document.head.querySelector(`style[${x}="${e}"]`)) {
|
|
164
|
-
if (i.sheet) document.adoptedStyleSheets = [...document.adoptedStyleSheets, i.sheet];
|
|
165
|
-
else {
|
|
166
|
-
let t = document.createElement("style");
|
|
167
|
-
t.setAttribute(x, e), t.textContent = r, document.head.appendChild(t);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
n.entries.set(e, i);
|
|
171
|
-
for (let e of n.listeners) e(i);
|
|
172
|
-
}
|
|
173
|
-
function w() {
|
|
174
|
-
return [...b().entries.values()];
|
|
175
|
-
}
|
|
176
|
-
function T(e) {
|
|
177
|
-
let t = (t) => {
|
|
178
|
-
if (t.sheet) e.adoptedStyleSheets.includes(t.sheet) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t.sheet]);
|
|
179
|
-
else if (!e.querySelector(`style[${x}="${t.key}"]`)) {
|
|
180
|
-
let n = e.ownerDocument.createElement("style");
|
|
181
|
-
n.setAttribute(x, t.key), n.textContent = t.cssText, e.appendChild(n);
|
|
182
|
-
}
|
|
183
|
-
}, n = b();
|
|
184
|
-
for (let e of n.entries.values()) t(e);
|
|
185
|
-
return n.listeners.add(t), () => n.listeners.delete(t);
|
|
124
|
+
function E(e) {
|
|
125
|
+
return w(e, t);
|
|
186
126
|
}
|
|
187
127
|
//#endregion
|
|
188
|
-
export {
|
|
128
|
+
export { n as SCOPED_STYLE_MARKER, r as SCOPE_ATTRIBUTE, a as adoptLightStyles, S as configureScopedHtml, o as getLightStyleEntries, s as installLightStyles, c as installScopedStyles, b as rewriteStatics, T as scopedHtml, E as scopedSvg, l as stampScope, u as validateScope, f as writeScopedStyleTag };
|
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
import { CSSResult } from 'lit';
|
|
2
|
-
export interface LightStyleEntry {
|
|
3
|
-
key: string;
|
|
4
|
-
cssText: string;
|
|
5
|
-
/** Present when constructable stylesheets are supported. */
|
|
6
|
-
sheet?: CSSStyleSheet;
|
|
7
|
-
}
|
|
8
1
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
2
|
+
* The registry moved to `@mintplayer/ui-core/scoped-styles` (#436 D8) so the
|
|
3
|
+
* Angular, React and Vue fronts install the same sheets through the same
|
|
4
|
+
* mechanism. This entry re-exports it unchanged for the light-tier elements.
|
|
12
5
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
6
|
+
* The names are listed, not `export *`: ui-core is external to this build, so
|
|
7
|
+
* Rolldown cannot see what a star re-export contains. A chunk importing
|
|
8
|
+
* `installLightStyles` from this entry was compiled to a lookup on a namespace
|
|
9
|
+
* object that holds only the local exports, and threw at load
|
|
10
|
+
* ("installLightStyles is not a function") for every consumer of the dist.
|
|
16
11
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
export declare function getLightStyleEntries(): LightStyleEntry[];
|
|
20
|
-
/**
|
|
21
|
-
* Mirror all light-tier sheets — current and future — into a shadow root, so
|
|
22
|
-
* consumer DOM adopted into it (render callbacks) keeps its light-tier
|
|
23
|
-
* styling. Returns a disposer; call it from `disconnectedCallback`.
|
|
24
|
-
*/
|
|
25
|
-
export declare function adoptLightStyles(root: ShadowRoot): () => void;
|
|
12
|
+
export { SCOPED_STYLE_MARKER, SCOPE_ATTRIBUTE, adoptLightStyles, getLightStyleEntries, installLightStyles, installScopedStyles, stampScope, validateScope, writeScopedStyleTag, } from '@mintplayer/ui-core/scoped-styles';
|
|
13
|
+
export type { LightStyleEntry, ScopedStyleSource } from '@mintplayer/ui-core/scoped-styles';
|
|
@@ -17,10 +17,4 @@ type TemplateTag = (strings: TemplateStringsArray, ...values: unknown[]) => Temp
|
|
|
17
17
|
export declare function scopedHtml(scope: string): TemplateTag;
|
|
18
18
|
/** The `svg` twin (data-* attributes are valid on SVG elements). */
|
|
19
19
|
export declare function scopedSvg(scope: string): TemplateTag;
|
|
20
|
-
/**
|
|
21
|
-
* Imperatively stamp a DOM subtree with a scope — for DOM the rewriter can't
|
|
22
|
-
* see (`unsafeHTML` output, `document.createElement`, an overlay panel built
|
|
23
|
-
* by hand). Skips subtrees that already belong to another scope.
|
|
24
|
-
*/
|
|
25
|
-
export declare function stampScope(root: Element, scope: string): void;
|
|
26
20
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { noChange as e } from "lit";
|
|
2
|
+
import { Directive as t, PartType as n, directive as r } from "lit/directive.js";
|
|
3
|
+
//#region libs/mintplayer-web-components/machine/src/machine-controller.ts
|
|
4
|
+
var i = class {
|
|
5
|
+
#e = null;
|
|
6
|
+
constructor(e, t, n = !0) {
|
|
7
|
+
this.host = e, this.machine = t, this.ownsMachine = n, e.addController(this);
|
|
8
|
+
}
|
|
9
|
+
get state() {
|
|
10
|
+
return this.machine.snapshot;
|
|
11
|
+
}
|
|
12
|
+
hostConnected() {
|
|
13
|
+
this.#e ??= this.machine.subscribe(() => this.host.requestUpdate()), this.host.requestUpdate();
|
|
14
|
+
}
|
|
15
|
+
hostDisconnected() {
|
|
16
|
+
this.#e?.(), this.#e = null;
|
|
17
|
+
}
|
|
18
|
+
dispose() {
|
|
19
|
+
this.hostDisconnected(), this.ownsMachine && this.machine.destroy();
|
|
20
|
+
}
|
|
21
|
+
}, a = /* @__PURE__ */ new Set([
|
|
22
|
+
"href",
|
|
23
|
+
"src",
|
|
24
|
+
"srcdoc",
|
|
25
|
+
"xlink:href",
|
|
26
|
+
"style",
|
|
27
|
+
"action",
|
|
28
|
+
"formaction",
|
|
29
|
+
"data"
|
|
30
|
+
]), o = r(class extends t {
|
|
31
|
+
#e = {};
|
|
32
|
+
constructor(e) {
|
|
33
|
+
if (super(e), e.type !== n.ELEMENT) throw Error("props() must be used in element position");
|
|
34
|
+
}
|
|
35
|
+
render(t) {
|
|
36
|
+
return e;
|
|
37
|
+
}
|
|
38
|
+
update(t, [n]) {
|
|
39
|
+
let r = t.element, i = (e) => e == null || e === !1;
|
|
40
|
+
return Object.keys(this.#e).filter((e) => !(e in n) || i(n[e])).forEach((e) => r.removeAttribute(e)), Object.entries(n).filter(([, e]) => !i(e)).filter(([e]) => {
|
|
41
|
+
if (a.has(e) || e.startsWith("on")) throw Error(`props() refuses to set "${e}"`);
|
|
42
|
+
return !0;
|
|
43
|
+
}).filter(([e, t]) => !Object.is(this.#e[e], t)).forEach(([e, t]) => r.setAttribute(e, t === !0 ? "" : String(t))), this.#e = { ...n }, e;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { i as MachineController, o as props };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import { Machine } from '@mintplayer/ui-core/store';
|
|
3
|
+
/**
|
|
4
|
+
* Bridge a `@mintplayer/ui-core` machine into a Lit element: every committed
|
|
5
|
+
* snapshot requests one host update (Lit coalesces per microtask), the
|
|
6
|
+
* subscription follows the host's connected state, and the machine is
|
|
7
|
+
* destroyed with the host unless `ownsMachine` is false.
|
|
8
|
+
*
|
|
9
|
+
* The element reads `controller.state` in `render()`; it is always the
|
|
10
|
+
* machine's current snapshot (spike S1, `machine-controller.spec.ts`).
|
|
11
|
+
*/
|
|
12
|
+
export declare class MachineController<M extends Machine<S>, S extends object> implements ReactiveController {
|
|
13
|
+
#private;
|
|
14
|
+
private readonly host;
|
|
15
|
+
readonly machine: M;
|
|
16
|
+
private readonly ownsMachine;
|
|
17
|
+
constructor(host: ReactiveControllerHost & {
|
|
18
|
+
isConnected: boolean;
|
|
19
|
+
}, machine: M, ownsMachine?: boolean);
|
|
20
|
+
get state(): S;
|
|
21
|
+
hostConnected(): void;
|
|
22
|
+
hostDisconnected(): void;
|
|
23
|
+
/** Called by the host when it is torn down for good (not merely moved in the DOM). */
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { noChange } from 'lit';
|
|
2
|
+
import { Directive, ElementPart, PartInfo } from 'lit/directive.js';
|
|
3
|
+
/** An attribute bag as a `@mintplayer/ui-core` `connect()` returns it. */
|
|
4
|
+
export type AttrBag = Record<string, string | boolean | null | undefined>;
|
|
5
|
+
/**
|
|
6
|
+
* Apply a core's attribute bag to the element it sits on — Lit's stand-in for
|
|
7
|
+
* JSX/Vue attribute spread, and the twin of Angular's `[mpProps]`. Diffs the
|
|
8
|
+
* previous bag: a key that disappears (or becomes null/false) is removed, so a
|
|
9
|
+
* stale `aria-activedescendant` never survives a close. URL- and
|
|
10
|
+
* script-bearing names are refused, as in the Angular directive.
|
|
11
|
+
*
|
|
12
|
+
* html`<input ${props(api.input)}>`
|
|
13
|
+
*/
|
|
14
|
+
declare class PropsDirective extends Directive {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(partInfo: PartInfo);
|
|
17
|
+
render(_bag: AttrBag): typeof noChange;
|
|
18
|
+
update(part: ElementPart, [bag]: [AttrBag]): typeof noChange;
|
|
19
|
+
}
|
|
20
|
+
export declare const props: (_bag: AttrBag) => import('lit-html/directive.js').DirectiveResult<typeof PropsDirective>;
|
|
21
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/web-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Framework-agnostic Lit web components for the @mintplayer/bootstrap design system. Consumed by @mintplayer/ng-bootstrap, @mintplayer/react-bootstrap, and @mintplayer/vue-bootstrap.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -107,6 +107,10 @@
|
|
|
107
107
|
"types": "./light-dom/index.d.ts",
|
|
108
108
|
"import": "./light-dom/index.mjs"
|
|
109
109
|
},
|
|
110
|
+
"./machine": {
|
|
111
|
+
"types": "./machine/index.d.ts",
|
|
112
|
+
"import": "./machine/index.mjs"
|
|
113
|
+
},
|
|
110
114
|
"./multi-range": {
|
|
111
115
|
"types": "./multi-range/index.d.ts",
|
|
112
116
|
"import": "./multi-range/index.mjs"
|
|
@@ -214,6 +218,10 @@
|
|
|
214
218
|
"./treeview": {
|
|
215
219
|
"types": "./treeview/index.d.ts",
|
|
216
220
|
"import": "./treeview/index.mjs"
|
|
221
|
+
},
|
|
222
|
+
"./typeahead": {
|
|
223
|
+
"types": "./typeahead/index.d.ts",
|
|
224
|
+
"import": "./typeahead/index.mjs"
|
|
217
225
|
}
|
|
218
226
|
},
|
|
219
227
|
"peerDependencies": {
|
|
@@ -227,6 +235,7 @@
|
|
|
227
235
|
}
|
|
228
236
|
},
|
|
229
237
|
"dependencies": {
|
|
238
|
+
"@mintplayer/ui-core": "^1.1.0",
|
|
230
239
|
"tslib": "^2.3.0",
|
|
231
240
|
"intl-tel-input": "^29.1.2",
|
|
232
241
|
"libphonenumber-js": "^1.13.10"
|
package/pagination/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as MpPagination, n as buildPaginationLayout } from "../chunks/pagination-
|
|
1
|
+
export { t as MpPagination, n as buildPaginationLayout } from "../chunks/pagination-DgDp3v3u.mjs";
|