@mintplayer/web-components 3.5.0 → 3.7.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.
@@ -1 +1 @@
1
- export { t as DEFAULT_DATATABLE_LABELS, a as MpDatatable, n as cellText, r as computeNextSort, i as sortRows } from "../chunks/datatable-wcZQMo-4.mjs";
1
+ export { t as DEFAULT_DATATABLE_LABELS, a as MpDatatable, n as cellText, r as computeNextSort, i as sortRows } from "../chunks/datatable-DDDM3nf1.mjs";
@@ -8,6 +8,7 @@ import { DatatableHeaderSlotArgs, DatatableCellSlotArgs, DatatableRowSlotArgs, D
8
8
  * Columns are data (`DatatableColumnDef`). Slots: `header {column}` (a header label),
9
9
  * `cell {row, column, rowIndex}` (one cell) and `row {row, rowIndex, ctx}` (all of a
10
10
  * row's data cells) and `filter {column, ctx}` (the panel of a column with `filterMode: 'custom'`). Two-way: `sortColumns`, `page`, `perPage`, `selectedIds`, `expandedIds`, `filters`.
11
+ * The table owns the filter state (#465): bind `filters` two-way, or one-way with `filtersReadonly` (the user sees the filters but cannot edit them).
11
12
  * An `aria-label` names the table. With `fetch`, filters are applied server-side; `stateKey` prefetches
12
13
  * the first page during SSR and hands it to the client (#448).
13
14
  */
@@ -207,6 +208,14 @@ export declare class MpDatatable extends LitElement {
207
208
  filters: {
208
209
  attribute: boolean;
209
210
  };
211
+ filtersReadonly: {
212
+ type: BooleanConstructor;
213
+ converter: {
214
+ fromAttribute: (value: string | null) => boolean;
215
+ toAttribute: (value: unknown) => string | null;
216
+ };
217
+ attribute: string;
218
+ };
210
219
  fetchParams: {
211
220
  attribute: boolean;
212
221
  };
@@ -265,6 +274,7 @@ export declare class MpDatatable extends LitElement {
265
274
  hrefFor: DatatableInputs['hrefFor'];
266
275
  distincts: DatatableInputs['distincts'];
267
276
  filters: DatatableInputs['filters'];
277
+ filtersReadonly: DatatableInputs['filtersReadonly'];
268
278
  fetchParams: DatatableInputs['fetchParams'];
269
279
  stateKey: DatatableInputs['stateKey'];
270
280
  /** Renders the header slot, called per use; wins over slot="header" children. */
@@ -24,9 +24,14 @@ var x = class extends s {
24
24
  type: String,
25
25
  converter: o("bottom")
26
26
  },
27
- shown: {
28
- type: Boolean,
29
- converter: n(!1)
27
+ phase: {
28
+ type: String,
29
+ converter: o("closed", [
30
+ "closed",
31
+ "entering",
32
+ "shown",
33
+ "leaving"
34
+ ])
30
35
  },
31
36
  hasPopup: {
32
37
  type: String,
@@ -47,7 +52,7 @@ var x = class extends s {
47
52
  inputs: () => ({
48
53
  overlayId: this.overlayId,
49
54
  side: this.side,
50
- shown: this.shown,
55
+ phase: this.phase,
51
56
  hasPopup: this.hasPopup,
52
57
  triggerId: this.triggerId
53
58
  }),
@@ -57,7 +62,7 @@ var x = class extends s {
57
62
  })
58
63
  });
59
64
  constructor() {
60
- super(), this.overlayId = "", this.side = "bottom", this.shown = !1, this.hasPopup = "menu", this.triggerId = null;
65
+ super(), this.overlayId = "", this.side = "bottom", this.phase = "closed", this.hasPopup = "menu", this.triggerId = null;
61
66
  }
62
67
  createRenderRoot() {
63
68
  return this;
@@ -128,7 +133,8 @@ var C = class extends s {
128
133
  maxHeight: this.maxHeight,
129
134
  label: this.label,
130
135
  active: this.active
131
- })
136
+ }),
137
+ hostScope: "dropdown"
132
138
  });
133
139
  constructor() {
134
140
  super(), this.maxHeight = null, this.label = null, this.active = !1;
@@ -287,7 +293,7 @@ var A = r(f, {
287
293
  },
288
294
  overlay: (e, t) => {
289
295
  let n = e.overlay;
290
- return n ? c`<mp-dropdown-panel .overlayId=${n.overlayId} .side=${n.side} .shown=${n.shown} .hasPopup=${n.hasPopup} .triggerId=${n.triggerId}>${t?.()}</mp-dropdown-panel>` : null;
296
+ return n ? c`<mp-dropdown-panel .overlayId=${n.overlayId} .side=${n.side} .phase=${n.phase} .hasPopup=${n.hasPopup} .triggerId=${n.triggerId} .defaultRenderer=${t ?? null}></mp-dropdown-panel>` : null;
291
297
  }
292
298
  });
293
299
  //#endregion
@@ -19,10 +19,10 @@ export declare class MpDropdownPanel extends LitElement {
19
19
  toAttribute: (value: unknown) => string | null;
20
20
  };
21
21
  };
22
- shown: {
23
- type: BooleanConstructor;
22
+ phase: {
23
+ type: StringConstructor;
24
24
  converter: {
25
- fromAttribute: (value: string | null) => boolean;
25
+ fromAttribute: (value: string | null) => string;
26
26
  toAttribute: (value: unknown) => string | null;
27
27
  };
28
28
  };
@@ -49,7 +49,8 @@ export declare class MpDropdownPanel extends LitElement {
49
49
  /** The panel's id, which the trigger's `aria-controls` names. */
50
50
  overlayId: DropdownPanelInputs['overlayId'];
51
51
  side: DropdownPanelInputs['side'];
52
- shown: DropdownPanelInputs['shown'];
52
+ /** The overlay phase: `.show` while shown, `hidden` while closed (#465). */
53
+ phase: DropdownPanelInputs['phase'];
53
54
  hasPopup: DropdownPanelInputs['hasPopup'];
54
55
  /** The trigger's id, naming a dialog panel. */
55
56
  triggerId: DropdownPanelInputs['triggerId'];
@@ -1,5 +1,5 @@
1
1
  import { CoreController as e, booleanAttribute as t, props as n, stringAttribute as r } from "../machine/index.mjs";
2
- import "../chunks/datatable-wcZQMo-4.mjs";
2
+ import "../chunks/datatable-DDDM3nf1.mjs";
3
3
  import "../chunks/splitter-EuJmtwjW.mjs";
4
4
  import "../chunks/treeview-CKndcfiq.mjs";
5
5
  import { LitElement as i, html as a, nothing as o } from "lit";
package/machine/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { noChange as e, nothing as t, render as n } from "lit";
2
2
  import { createBodyHost as r, removeBodyHost as i } from "@mintplayer/ui-core/overlay";
3
3
  import { Directive as a, PartType as o, directive as s } from "lit/directive.js";
4
- import { coreRuntime as c, directiveInputs as l, elementCore as u, sameContent as d } from "@mintplayer/ui-core/component";
5
- import { AsyncDirective as f, PartType as p, directive as m } from "lit/async-directive.js";
4
+ import { coreRuntime as c, directiveInputs as l, elementCore as u, sameContent as d, scopedHost as f } from "@mintplayer/ui-core/component";
5
+ import { AsyncDirective as p, PartType as m, directive as h } from "lit/async-directive.js";
6
6
  //#region libs/mintplayer-web-components/machine/src/machine-controller.ts
7
- var h = class {
7
+ var g = class {
8
8
  #e = null;
9
9
  constructor(e, t, n = !0) {
10
10
  this.host = e, this.machine = t, this.ownsMachine = n, e.addController(this);
@@ -21,7 +21,7 @@ var h = class {
21
21
  dispose() {
22
22
  this.hostDisconnected(), this.ownsMachine && this.machine.destroy();
23
23
  }
24
- }, g = /* @__PURE__ */ new Set([
24
+ }, _ = /* @__PURE__ */ new Set([
25
25
  "href",
26
26
  "src",
27
27
  "srcdoc",
@@ -30,7 +30,7 @@ var h = class {
30
30
  "action",
31
31
  "formaction",
32
32
  "data"
33
- ]), _ = s(class extends a {
33
+ ]), v = s(class extends a {
34
34
  #e = {};
35
35
  constructor(e) {
36
36
  if (super(e), e.type !== o.ELEMENT) throw Error("props() must be used in element position");
@@ -41,29 +41,29 @@ var h = class {
41
41
  update(t, [n]) {
42
42
  let r = t.element, i = (e) => e == null || e === !1;
43
43
  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]) => {
44
- if (g.has(e) || e.startsWith("on")) throw Error(`props() refuses to set "${e}"`);
44
+ if (_.has(e) || e.startsWith("on")) throw Error(`props() refuses to set "${e}"`);
45
45
  return !0;
46
46
  }).filter(([e, t]) => !Object.is(this.#e[e], t)).forEach(([e, t]) => r.setAttribute(e, t === !0 ? "" : String(t))), this.#e = { ...n }, e;
47
47
  }
48
- }), v = {
48
+ }), y = {
49
49
  attrs: {},
50
50
  classes: []
51
- }, y = (e) => e == null || e === !1;
52
- function b(e, t, n) {
51
+ }, b = (e) => e == null || e === !1;
52
+ function x(e, t, n) {
53
53
  let { class: r, ...i } = n, a = typeof r == "string" ? r.split(/\s+/).filter(Boolean) : [];
54
- return e.classList.remove(...t.classes.filter((e) => !a.includes(e))), a.length && e.classList.add(...a), Object.keys(t.attrs).filter((e) => y(i[e])).forEach((t) => e.removeAttribute(t)), Object.entries(i).filter(([, e]) => !y(e)).filter(([e, n]) => !Object.is(t.attrs[e], n)).forEach(([t, n]) => e.setAttribute(t, n === !0 ? "" : String(n))), {
54
+ return e.classList.remove(...t.classes.filter((e) => !a.includes(e))), a.length && e.classList.add(...a), Object.keys(t.attrs).filter((e) => b(i[e])).forEach((t) => e.removeAttribute(t)), Object.entries(i).filter(([, e]) => !b(e)).filter(([e, n]) => !Object.is(t.attrs[e], n)).forEach(([t, n]) => e.setAttribute(t, n === !0 ? "" : String(n))), {
55
55
  attrs: i,
56
56
  classes: a
57
57
  };
58
58
  }
59
- function x(e) {
59
+ function S(e) {
60
60
  let t = Object.fromEntries(Array.from(e.attributes).filter(({ name: e }) => e.startsWith("aria-") || e === "id" || e === "tabindex").map(({ name: e, value: t }) => [e, t]));
61
61
  return ["id", "tabindex"].filter((e) => e in t).forEach((t) => e.removeAttribute(t)), {
62
62
  host: e,
63
63
  attrs: t
64
64
  };
65
65
  }
66
- function S(e, t) {
66
+ function C(e, t) {
67
67
  let n = e ?? {};
68
68
  if (!t) return n;
69
69
  let { id: r, ...i } = t.attrs, a = n.id !== null && n.id !== void 0;
@@ -73,7 +73,7 @@ function S(e, t) {
73
73
  ...r && !a ? { id: r } : {}
74
74
  };
75
75
  }
76
- var C = (e) => e.nodeType === Node.COMMENT_NODE || e.nodeType === Node.TEXT_NODE && !e.textContent?.trim() || e instanceof Element && (e.hasAttribute("data-mp-owned") || e.hasAttribute("data-mps") && !e.localName.includes("-")), w = class {
76
+ var w = (e) => e.nodeType === Node.COMMENT_NODE || e.nodeType === Node.TEXT_NODE && !e.textContent?.trim() || e instanceof Element && (e.hasAttribute("data-mp-owned") || e.hasAttribute("data-mps") && !e.localName.includes("-")), T = class {
77
77
  #e = null;
78
78
  #t = null;
79
79
  constructor(e) {
@@ -83,7 +83,7 @@ var C = (e) => e.nodeType === Node.COMMENT_NODE || e.nodeType === Node.TEXT_NODE
83
83
  return this.#e ?? {};
84
84
  }
85
85
  capture() {
86
- this.#e ??= T(this.host);
86
+ this.#e ??= E(this.host);
87
87
  }
88
88
  hostConnected() {
89
89
  this.#t = new MutationObserver((e) => this.#n(e, !0)), this.#t.observe(this.host, { childList: !0 });
@@ -99,11 +99,11 @@ var C = (e) => e.nodeType === Node.COMMENT_NODE || e.nodeType === Node.TEXT_NODE
99
99
  }
100
100
  #n(e, t) {
101
101
  if (!this.#e) return;
102
- let n = new Set(e.flatMap((e) => [...e.addedNodes])), r = new Set(Object.values(this.#e).flat()), i = T(this.host, (e) => !n.has(e) || r.has(e) || C(e));
102
+ let n = new Set(e.flatMap((e) => [...e.addedNodes])), r = new Set(Object.values(this.#e).flat()), i = E(this.host, (e) => !n.has(e) || r.has(e) || w(e));
103
103
  Object.keys(i).length !== 0 && (Object.entries(i).forEach(([e, t]) => this.#e[e] = [...this.#e[e] ?? [], ...t]), t && this.host.requestUpdate());
104
104
  }
105
105
  };
106
- function T(e, t = () => !1) {
106
+ function E(e, t = () => !1) {
107
107
  let n = {};
108
108
  return [...e.childNodes].filter((e) => !t(e)).forEach((e) => {
109
109
  if (e.parentNode?.removeChild(e), e.nodeType === Node.COMMENT_NODE || e.nodeType === Node.TEXT_NODE && !e.textContent?.trim()) return;
@@ -111,36 +111,36 @@ function T(e, t = () => !1) {
111
111
  (n[t ?? "default"] ??= []).push(e);
112
112
  }), n;
113
113
  }
114
- var E = (e) => ({
114
+ var D = (e) => ({
115
115
  fromAttribute: (t) => t === null ? e : t !== "false",
116
116
  toAttribute: (e) => e ? "" : null
117
- }), D = (e, t) => ({
117
+ }), O = (e, t) => ({
118
118
  fromAttribute: (n) => n === null || t && !t.includes(n) ? e : n,
119
119
  toAttribute: (e) => e == null ? null : String(e)
120
- }), O = (e) => ({
120
+ }), k = (e) => ({
121
121
  fromAttribute: (t) => {
122
122
  let n = t === null || t.trim() === "" ? NaN : Number(t);
123
123
  return Number.isFinite(n) ? n : e;
124
124
  },
125
125
  toAttribute: (e) => e == null ? null : String(e)
126
- }), k = /* @__PURE__ */ new WeakMap();
127
- function A(e) {
128
- let t = k.get(e);
129
- return t || (t = Symbol(e.name), k.set(e, t)), t;
126
+ }), A = /* @__PURE__ */ new WeakMap();
127
+ function j(e) {
128
+ let t = A.get(e);
129
+ return t || (t = Symbol(e.name), A.set(e, t)), t;
130
130
  }
131
- var j = /* @__PURE__ */ new WeakMap();
132
- function M(e, t) {
133
- let n = A(t);
131
+ var M = /* @__PURE__ */ new WeakMap();
132
+ function N(e, t) {
133
+ let n = j(t);
134
134
  for (let t = e.parentNode; t; t = t instanceof ShadowRoot ? t.host : t.parentNode) {
135
135
  let r = t[n];
136
136
  if (r) {
137
- let n = j.get(t) ?? /* @__PURE__ */ new Set();
138
- return j.set(t, n.add(e)), r();
137
+ let n = M.get(t) ?? /* @__PURE__ */ new Set();
138
+ return M.set(t, n.add(e)), r();
139
139
  }
140
140
  }
141
141
  return t.defaultValue;
142
142
  }
143
- var N = (e, t) => e === t || !!e && !!t && typeof e == "object" && typeof t == "object" && Object.keys(e).length === Object.keys(t).length && Object.entries(e).every(([e, n]) => t[e] === n), P = 0, F = class {
143
+ var P = (e, t) => e === t || !!e && !!t && typeof e == "object" && typeof t == "object" && Object.keys(e).length === Object.keys(t).length && Object.entries(e).every(([e, n]) => t[e] === n), F = 0, I = class {
144
144
  #e;
145
145
  #t;
146
146
  #n;
@@ -149,11 +149,11 @@ var N = (e, t) => e === t || !!e && !!t && typeof e == "object" && typeof t == "
149
149
  #a;
150
150
  #o;
151
151
  #s = !1;
152
- #c = v;
152
+ #c = y;
153
153
  #l;
154
154
  #u;
155
155
  constructor(e, t, n) {
156
- this.#e = e, this.#t = t, this.#n = n, this.#r = `${n.idPrefix}-${++P}`, this.#i = c(t, {
156
+ this.#e = e, this.#t = t, this.#n = n, this.#r = `${n.idPrefix}-${++F}`, this.#i = c(t, {
157
157
  inputs: n.inputs,
158
158
  state: () => this.#d,
159
159
  setState: (t) => {
@@ -175,7 +175,7 @@ var N = (e, t) => e === t || !!e && !!t && typeof e == "object" && typeof t == "
175
175
  bubbles: !0,
176
176
  composed: !0
177
177
  }))
178
- }), e.addController(this), t.provides && (e[A(t.provides)] = () => t.provide?.(this.#f()));
178
+ }), e.addController(this), t.provides && (e[j(t.provides)] = () => t.provide?.(this.#f()));
179
179
  }
180
180
  get #d() {
181
181
  return this.#a ??= this.#t.state ? this.#t.state(this.#n.inputs()) : {};
@@ -186,7 +186,7 @@ var N = (e, t) => e === t || !!e && !!t && typeof e == "object" && typeof t == "
186
186
  state: this.#d,
187
187
  id: this.#r,
188
188
  hydrated: this.#s,
189
- context: this.#t.consume ? M(this.#e, this.#t.consume) : void 0,
189
+ context: this.#t.consume ? N(this.#e, this.#t.consume) : void 0,
190
190
  label: this.#o ?? null,
191
191
  api: () => this.#i.api
192
192
  };
@@ -213,21 +213,21 @@ var N = (e, t) => e === t || !!e && !!t && typeof e == "object" && typeof t == "
213
213
  e !== null && t != null && t !== !1 && e === String(t) || e === this.#o || (this.#o = e, this.#e.requestUpdate());
214
214
  }
215
215
  #m() {
216
- for (let e = this.#e.parentNode; e; e = e instanceof ShadowRoot ? e.host : e.parentNode) j.get(e)?.delete(this.#e);
216
+ for (let e = this.#e.parentNode; e; e = e instanceof ShadowRoot ? e.host : e.parentNode) M.get(e)?.delete(this.#e);
217
217
  }
218
218
  #h() {
219
219
  if (!this.#t.provides || !this.#t.provide) return;
220
220
  let e = this.#t.provide(this.#f());
221
- N(e, this.#l) || (this.#l = e, j.get(this.#e)?.forEach((e) => e.isConnected ? e.requestUpdate() : j.get(this.#e)?.delete(e)));
221
+ P(e, this.#l) || (this.#l = e, M.get(this.#e)?.forEach((e) => e.isConnected ? e.requestUpdate() : M.get(this.#e)?.delete(e)));
222
222
  }
223
223
  props() {
224
- let e = this.#t.view(this.#f()), t = this.#n.hostBag ?? this.#t.host?.bind(this.#t);
225
- return t && (this.#c = b(this.#e, this.#c, t(e) ?? {})), e;
224
+ let e = this.#t.view(this.#f()), t = this.#n.hostBag ?? f(this.#t.host?.bind(this.#t), this.#n.hostScope);
225
+ return t && (this.#c = x(this.#e, this.#c, t(e) ?? {})), e;
226
226
  }
227
227
  call(e, t) {
228
228
  return this.#i.call(e, t);
229
229
  }
230
- }, I = s(class extends a {
230
+ }, L = s(class extends a {
231
231
  #e = null;
232
232
  constructor(e) {
233
233
  if (super(e), e.type !== o.CHILD) throw Error("teleport() must be used in child position");
@@ -239,11 +239,11 @@ var N = (e, t) => e === t || !!e && !!t && typeof e == "object" && typeof t == "
239
239
  let a = r ?? null;
240
240
  return this.#e && this.#e !== a && n(t, this.#e), this.#e = a, a && n(i, a), t;
241
241
  }
242
- }), L = "mp-content-change";
243
- function R(e) {
244
- e.dispatchEvent(new Event(L, { bubbles: !0 }));
242
+ }), R = "mp-content-change";
243
+ function z(e) {
244
+ e.dispatchEvent(new Event(R, { bubbles: !0 }));
245
245
  }
246
- var z = (e, t) => e.length === t.length && e.every((e, n) => [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t[n])])].every((r) => e[r] === t[n][r])), B = class {
246
+ var B = (e, t) => e.length === t.length && e.every((e, n) => [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t[n])])].every((r) => e[r] === t[n][r])), V = class {
247
247
  #e;
248
248
  constructor(e, t, n) {
249
249
  this.host = e, this.tag = t, this.within = n, this.value = [], this.lent = [], this.#e = null, this.#n = () => {
@@ -256,10 +256,10 @@ var z = (e, t) => e.length === t.length && e.every((e, n) => [.../* @__PURE__ */
256
256
  }), this.#e.observe(this.host, {
257
257
  childList: !0,
258
258
  subtree: !0
259
- }), this.host.addEventListener(L, this.#n);
259
+ }), this.host.addEventListener(R, this.#n);
260
260
  }
261
261
  hostDisconnected() {
262
- this.#e?.disconnect(), this.#e = null, this.host.removeEventListener(L, this.#n);
262
+ this.#e?.disconnect(), this.#e = null, this.host.removeEventListener(R, this.#n);
263
263
  }
264
264
  hostUpdate() {
265
265
  this.#r();
@@ -277,24 +277,24 @@ var z = (e, t) => e.length === t.length && e.every((e, n) => [.../* @__PURE__ */
277
277
  inputs: e.contentInputs ?? {},
278
278
  within: t && this.host.contains(t) ? t.contentInputs ?? {} : null
279
279
  };
280
- }), i = d(this.value, r), a = z(this.lent, n);
280
+ }), i = d(this.value, r), a = B(this.lent, n);
281
281
  return i && a ? !1 : (i || (this.value = r), a || (this.lent = n), !0);
282
282
  }
283
283
  };
284
284
  //#endregion
285
285
  //#region libs/mintplayer-web-components/machine/src/mark-links.ts
286
- function V(e, t) {
286
+ function H(e, t) {
287
287
  e.filter((e) => e instanceof Element).forEach((e) => e.classList.add(t));
288
288
  }
289
289
  //#endregion
290
290
  //#region libs/mintplayer-web-components/machine/src/core-directive.ts
291
- var H = 0;
292
- function U(a, o) {
293
- class s extends f {
291
+ var U = 0;
292
+ function W(a, o) {
293
+ class s extends p {
294
294
  #e = null;
295
295
  #t = null;
296
296
  #n;
297
- #r = `mp-overlay-d${++H}`;
297
+ #r = `mp-overlay-d${++U}`;
298
298
  #i = null;
299
299
  #a(e) {
300
300
  let t = o.overlay?.(e, this.#n) ?? null;
@@ -307,7 +307,7 @@ function U(a, o) {
307
307
  this.#i &&= (n(t, this.#i), i(document, this.#r), null);
308
308
  }
309
309
  constructor(e) {
310
- if (super(e), e.type !== p.ELEMENT) throw Error(`${o.idPrefix} is an element directive: put it in an element's attribute position`);
310
+ if (super(e), e.type !== m.ELEMENT) throw Error(`${o.idPrefix} is an element directive: put it in an element's attribute position`);
311
311
  }
312
312
  render(t, n) {
313
313
  return e;
@@ -333,17 +333,17 @@ function U(a, o) {
333
333
  this.#e?.attach();
334
334
  }
335
335
  }
336
- return m(s);
336
+ return h(s);
337
337
  }
338
338
  //#endregion
339
339
  //#region libs/mintplayer-web-components/machine/src/body-teleport-directive.ts
340
- var W = 0, G = m(class extends f {
341
- #e = `mp-overlay-${++W}`;
340
+ var G = 0, K = h(class extends p {
341
+ #e = `mp-overlay-${++G}`;
342
342
  #t = null;
343
343
  #n = t;
344
344
  #r = null;
345
345
  constructor(e) {
346
- if (super(e), e.type !== p.CHILD) throw Error("bodyTeleport() must be used in child position");
346
+ if (super(e), e.type !== m.CHILD) throw Error("bodyTeleport() must be used in child position");
347
347
  }
348
348
  render(e) {
349
349
  return t;
@@ -360,7 +360,7 @@ var W = 0, G = m(class extends f {
360
360
  reconnected() {
361
361
  this.#i();
362
362
  }
363
- }), K = s(class extends a {
363
+ }), q = s(class extends a {
364
364
  #e = null;
365
365
  constructor(e) {
366
366
  if (super(e), e.type !== o.CHILD) throw Error("instanceStyle() must be used in child position");
@@ -370,4 +370,4 @@ var W = 0, G = m(class extends f {
370
370
  }
371
371
  });
372
372
  //#endregion
373
- export { B as ContentQuery, F as CoreController, v as EMPTY_HOST_PROPS, w as LightChildren, h as MachineController, b as applyHostProps, G as bodyTeleport, E as booleanAttribute, U as coreDirective, S as forwardHostAttrs, K as instanceStyle, V as markLinks, R as notifyContentChange, O as numberAttribute, C as ownedByTemplate, _ as props, D as stringAttribute, x as takeHostAttrs, T as takeLightChildren, I as teleport };
373
+ export { V as ContentQuery, I as CoreController, y as EMPTY_HOST_PROPS, T as LightChildren, g as MachineController, x as applyHostProps, K as bodyTeleport, D as booleanAttribute, W as coreDirective, C as forwardHostAttrs, q as instanceStyle, H as markLinks, z as notifyContentChange, k as numberAttribute, w as ownedByTemplate, v as props, O as stringAttribute, S as takeHostAttrs, E as takeLightChildren, L as teleport };
@@ -6,6 +6,11 @@ export interface CoreControllerOptions<I, P> {
6
6
  readonly idPrefix: string;
7
7
  /** The host element's bag, where the template root is the host (`mp-host`). Default: `core.host`. */
8
8
  readonly hostBag?: (props: P) => CoreBag | null | undefined;
9
+ /**
10
+ * The group's scope, stamped as `data-mps` on the bag `core.host` writes where the template root is
11
+ * NOT the host (#460). Unlike `hostBag`, it does not make the host the core's root.
12
+ */
13
+ readonly hostScope?: string;
9
14
  /** Two-way inputs: properties written back when the core changes the state of the same name. */
10
15
  readonly models?: readonly string[];
11
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/web-components",
3
- "version": "3.5.0",
3
+ "version": "3.7.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": {
@@ -319,7 +319,7 @@
319
319
  "@lit/context": "^1.1.6"
320
320
  },
321
321
  "dependencies": {
322
- "@mintplayer/ui-core": "^1.6.0",
322
+ "@mintplayer/ui-core": "^1.9.0",
323
323
  "tslib": "^2.3.0",
324
324
  "intl-tel-input": "^29.1.2",
325
325
  "libphonenumber-js": "^1.13.10"
package/popover/index.mjs CHANGED
@@ -1,63 +1,68 @@
1
- import { CoreController as e, LightChildren as t, booleanAttribute as n, coreDirective as r, props as i, stringAttribute as a } from "../machine/index.mjs";
2
- import { LitElement as o, html as s, nothing as c } from "lit";
3
- import { installLightStyles as l } from "@mintplayer/ui-core/scoped-styles";
4
- import { bootstrapTransitions as u } from "@mintplayer/ui-core/bootstrap/transitions";
5
- import { popoverCore as d, popoverPanelCore as f, popoverScopedStyles as p } from "@mintplayer/ui-core/popover";
6
- import { bootstrapPopover as m } from "@mintplayer/ui-core/bootstrap/popover";
1
+ import { CoreController as e, LightChildren as t, coreDirective as n, props as r, stringAttribute as i } from "../machine/index.mjs";
2
+ import { LitElement as a, html as o, nothing as s } from "lit";
3
+ import { installLightStyles as c } from "@mintplayer/ui-core/scoped-styles";
4
+ import { bootstrapTransitions as l } from "@mintplayer/ui-core/bootstrap/transitions";
5
+ import { popoverCore as u, popoverPanelCore as d, popoverScopedStyles as f } from "@mintplayer/ui-core/popover";
6
+ import { bootstrapPopover as p } from "@mintplayer/ui-core/bootstrap/popover";
7
7
  //#region libs/mintplayer-web-components/popover/src/generated/popover-panel.view.generated.ts
8
- function h({ view: e, slots: t = {} }) {
9
- return s`
10
- <div data-mps="popover" ${i(e.arrow)}></div>
11
- ${e.header ? s`
12
- <h3 data-mps="popover" ${i(e.header)}>${e.title}</h3>
13
- ` : c}
14
- <div data-mps="popover" ${i(e.body)}>
15
- ${t.default === void 0 ? c : t.default}
8
+ function m({ view: e, slots: t = {} }) {
9
+ return o`
10
+ <div data-mps="popover" ${r(e.arrow)}></div>
11
+ ${e.header ? o`
12
+ <h3 data-mps="popover" ${r(e.header)}>${e.title}</h3>
13
+ ` : s}
14
+ <div data-mps="popover" ${r(e.body)}>
15
+ ${t.default === void 0 ? s : t.default}
16
16
  </div>
17
17
  `;
18
18
  }
19
19
  //#endregion
20
20
  //#region libs/mintplayer-web-components/popover/src/generated/mp-popover-panel.generated.ts
21
- var g = class extends o {
21
+ var h = class extends a {
22
22
  static {
23
23
  this.properties = {
24
24
  overlayId: {
25
25
  type: String,
26
- converter: a(""),
26
+ converter: i(""),
27
27
  attribute: "overlay-id"
28
28
  },
29
29
  side: {
30
30
  type: String,
31
- converter: a("bottom", [
31
+ converter: i("bottom", [
32
32
  "top",
33
33
  "bottom",
34
34
  "start",
35
35
  "end"
36
36
  ])
37
37
  },
38
- shown: {
39
- type: Boolean,
40
- converter: n(!1)
38
+ phase: {
39
+ type: String,
40
+ converter: i("closed", [
41
+ "closed",
42
+ "entering",
43
+ "shown",
44
+ "leaving"
45
+ ])
41
46
  },
42
47
  heading: {
43
48
  type: String,
44
- converter: a(null)
49
+ converter: i(null)
45
50
  },
46
51
  triggerId: {
47
52
  type: String,
48
- converter: a(null),
53
+ converter: i(null),
49
54
  attribute: "trigger-id"
50
55
  },
51
56
  defaultRenderer: { attribute: !1 }
52
57
  };
53
58
  }
54
59
  #e = new t(this);
55
- #t = new e(this, f, {
60
+ #t = new e(this, d, {
56
61
  idPrefix: "mp-popover-panel",
57
62
  inputs: () => ({
58
63
  overlayId: this.overlayId,
59
64
  side: this.side,
60
- shown: this.shown,
65
+ phase: this.phase,
61
66
  heading: this.heading,
62
67
  triggerId: this.triggerId
63
68
  }),
@@ -67,7 +72,7 @@ var g = class extends o {
67
72
  })
68
73
  });
69
74
  constructor() {
70
- super(), this.overlayId = "", this.side = "bottom", this.shown = !1, this.heading = null, this.triggerId = null;
75
+ super(), this.overlayId = "", this.side = "bottom", this.phase = "closed", this.heading = null, this.triggerId = null;
71
76
  }
72
77
  createRenderRoot() {
73
78
  return this;
@@ -76,7 +81,7 @@ var g = class extends o {
76
81
  this.#e.capture();
77
82
  }
78
83
  render() {
79
- return h({
84
+ return m({
80
85
  ...this.#t.props(),
81
86
  slots: {
82
87
  ...this.#e.slots,
@@ -87,8 +92,8 @@ var g = class extends o {
87
92
  };
88
93
  //#endregion
89
94
  //#region libs/mintplayer-web-components/popover/src/generated/popover.directive.generated.ts
90
- typeof document < "u" && document.head && (l(u.key, u.css, { order: u.order }), l(m.key, m.css, { order: m.order }), l("popover", p)), customElements.get("mp-popover-panel") || customElements.define("mp-popover-panel", g), typeof document < "u" && document.head && (l(u.key, u.css, { order: u.order }), l(m.key, m.css, { order: m.order }), l("popover", p));
91
- var _ = r(d, {
95
+ typeof document < "u" && document.head && (c(l.key, l.css, { order: l.order }), c(p.key, p.css, { order: p.order }), c("popover", f)), customElements.get("mp-popover-panel") || customElements.define("mp-popover-panel", h), typeof document < "u" && document.head && (c(l.key, l.css, { order: l.order }), c(p.key, p.css, { order: p.order }), c("popover", f));
96
+ var g = n(u, {
92
97
  idPrefix: "mp-popover",
93
98
  bag: (e) => e.anchor,
94
99
  defaults: {
@@ -97,8 +102,8 @@ var _ = r(d, {
97
102
  },
98
103
  overlay: (e, t) => {
99
104
  let n = e.overlay;
100
- return n ? s`<mp-popover-panel .overlayId=${n.overlayId} .side=${n.side} .shown=${n.shown} .heading=${n.heading} .triggerId=${n.triggerId}>${t?.()}</mp-popover-panel>` : null;
105
+ return n ? o`<mp-popover-panel .overlayId=${n.overlayId} .side=${n.side} .phase=${n.phase} .heading=${n.heading} .triggerId=${n.triggerId} .defaultRenderer=${t ?? null}></mp-popover-panel>` : null;
101
106
  }
102
107
  });
103
108
  //#endregion
104
- export { g as MpPopoverPanel, _ as bsPopover };
109
+ export { h as MpPopoverPanel, g as bsPopover };
@@ -19,10 +19,10 @@ export declare class MpPopoverPanel extends LitElement {
19
19
  toAttribute: (value: unknown) => string | null;
20
20
  };
21
21
  };
22
- shown: {
23
- type: BooleanConstructor;
22
+ phase: {
23
+ type: StringConstructor;
24
24
  converter: {
25
- fromAttribute: (value: string | null) => boolean;
25
+ fromAttribute: (value: string | null) => string;
26
26
  toAttribute: (value: unknown) => string | null;
27
27
  };
28
28
  };
@@ -48,7 +48,8 @@ export declare class MpPopoverPanel extends LitElement {
48
48
  /** The panel's id, which the trigger's `aria-controls` names. */
49
49
  overlayId: PopoverPanelInputs['overlayId'];
50
50
  side: PopoverPanelInputs['side'];
51
- shown: PopoverPanelInputs['shown'];
51
+ /** The overlay phase: `.show` while shown, `hidden` while closed (#465). */
52
+ phase: PopoverPanelInputs['phase'];
52
53
  heading: PopoverPanelInputs['heading'];
53
54
  /** The trigger's id, naming the dialog when there is no title. */
54
55
  triggerId: PopoverPanelInputs['triggerId'];
@@ -130,7 +130,8 @@ var y = class extends o {
130
130
  animated: this.animated,
131
131
  label: this.label,
132
132
  valueText: this.valueText
133
- })
133
+ }),
134
+ hostScope: "progress"
134
135
  });
135
136
  constructor() {
136
137
  super(), this.minimum = 0, this.maximum = 100, this.value = 0, this.color = "primary", this.striped = !1, this.animated = !1, this.label = "Progress", this.valueText = null;