@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.
@@ -102,6 +102,7 @@ var g = class extends i {
102
102
  open: this.open,
103
103
  disabled: this.disabled
104
104
  }),
105
+ hostScope: "accordion",
105
106
  models: ["open"]
106
107
  });
107
108
  constructor() {
@@ -90,53 +90,53 @@ function x({ view: e, slots: t = {} }) {
90
90
  ` : c}
91
91
  ${e.panel ? s`
92
92
  <div data-mps="datatable" ${i(e.panel)}>
93
- ${e.open && e.open.custom ? s`
94
- <div data-mps="datatable" ${i(e.open.body)}>
93
+ ${e.body && e.body.custom ? s`
94
+ <div data-mps="datatable" ${i(e.body.body)}>
95
95
  ${t.filter === void 0 ? c : b(t.filter, {
96
- column: e.open.column,
97
- ctx: e.open.ctx
96
+ column: e.body.column,
97
+ ctx: e.body.ctx
98
98
  })}
99
99
  </div>
100
- ` : e.open ? s`
101
- <div data-mps="datatable" ${i(e.open.body)}>
102
- <button data-mps="datatable" ${i(e.open.clear)}>${e.open.clearText}</button>
103
- ${e.open.comparison ? s`
104
- <div data-mps="datatable" ${i(e.open.comparison.wrap)}>
105
- <select data-mps="datatable" ${i(e.open.comparison.operator)}>
106
- ${u(e.open.comparison.operators, (e) => e.key, (e) => s`
100
+ ` : e.body ? s`
101
+ <div data-mps="datatable" ${i(e.body.body)}>
102
+ <button data-mps="datatable" ${i(e.body.clear)}>${e.body.clearText}</button>
103
+ ${e.body.comparison ? s`
104
+ <div data-mps="datatable" ${i(e.body.comparison.wrap)}>
105
+ <select data-mps="datatable" ${i(e.body.comparison.operator)}>
106
+ ${u(e.body.comparison.operators, (e) => e.key, (e) => s`
107
107
  <option data-mps="datatable" ${i(e.option)}>${e.text}</option>
108
108
  `)}
109
109
  </select>
110
- <input data-mps="datatable" ${i(e.open.comparison.operand)} .value=${e.open.comparison.operandText}>
110
+ <input data-mps="datatable" ${i(e.body.comparison.operand)} .value=${e.body.comparison.operandText}>
111
111
  </div>
112
112
  ` : c}
113
- ${e.open.comparison && e.open.comparison.applied ? s`
114
- <small data-mps="datatable" ${i(e.open.comparison.applied)}>${e.open.comparison.appliedText}</small>
113
+ ${e.body.comparison && e.body.comparison.applied ? s`
114
+ <small data-mps="datatable" ${i(e.body.comparison.applied)}>${e.body.comparison.appliedText}</small>
115
115
  ` : c}
116
- ${e.open.list ? s`
117
- <input data-mps="datatable" ${i(e.open.list.search)} .value=${e.open.list.term}>
116
+ ${e.body.list ? s`
117
+ <input data-mps="datatable" ${i(e.body.list.search)} .value=${e.body.list.term}>
118
118
  ` : c}
119
- ${e.open.list ? s`
120
- <button data-mps="datatable" ${i(e.open.list.invert)}>${e.open.list.invertText}</button>
119
+ ${e.body.list ? s`
120
+ <button data-mps="datatable" ${i(e.body.list.invert)}>${e.body.list.invertText}</button>
121
121
  ` : c}
122
- ${e.open.list ? s`
123
- <div data-mps="datatable" ${i(e.open.list.group)}>
124
- ${e.open.list.loading ? s`
125
- <span data-mps="datatable" ${i(e.open.list.loading)}>${e.open.list.loadingText}</span>
122
+ ${e.body.list ? s`
123
+ <div data-mps="datatable" ${i(e.body.list.group)}>
124
+ ${e.body.list.loading ? s`
125
+ <span data-mps="datatable" ${i(e.body.list.loading)}>${e.body.list.loadingText}</span>
126
126
  ` : c}
127
- ${u(e.open.list.options, (e) => e.key, (e) => s`
127
+ ${u(e.body.list.options, (e) => e.key, (e) => s`
128
128
  <label data-mps="datatable" ${i(e.label)}>
129
129
  <input data-mps="datatable" ${i(e.input)} .checked=${e.checked}>
130
130
  <span data-mps="datatable">${e.text}</span>
131
131
  </label>
132
132
  `)}
133
- ${e.open.list.noValues ? s`
134
- <span data-mps="datatable" ${i(e.open.list.noValues)}>${e.open.list.noValuesText}</span>
133
+ ${e.body.list.noValues ? s`
134
+ <span data-mps="datatable" ${i(e.body.list.noValues)}>${e.body.list.noValuesText}</span>
135
135
  ` : c}
136
136
  </div>
137
137
  ` : c}
138
- ${e.open.list && e.open.list.hasMore ? s`
139
- <span data-mps="datatable" ${i(e.open.list.hasMore)}>${e.open.list.hasMoreText}</span>
138
+ ${e.body.list && e.body.list.hasMore ? s`
139
+ <span data-mps="datatable" ${i(e.body.list.hasMore)}>${e.body.list.hasMoreText}</span>
140
140
  ` : c}
141
141
  </div>
142
142
  ` : c}
@@ -358,6 +358,11 @@ var S = class extends o {
358
358
  hrefFor: { attribute: !1 },
359
359
  distincts: { attribute: !1 },
360
360
  filters: { attribute: !1 },
361
+ filtersReadonly: {
362
+ type: Boolean,
363
+ converter: n(!1),
364
+ attribute: "filters-readonly"
365
+ },
361
366
  fetchParams: { attribute: !1 },
362
367
  stateKey: {
363
368
  type: String,
@@ -408,6 +413,7 @@ var S = class extends o {
408
413
  hrefFor: this.hrefFor,
409
414
  distincts: this.distincts,
410
415
  filters: this.filters,
416
+ filtersReadonly: this.filtersReadonly,
411
417
  fetchParams: this.fetchParams,
412
418
  stateKey: this.stateKey
413
419
  }),
@@ -429,7 +435,7 @@ var S = class extends o {
429
435
  10,
430
436
  20,
431
437
  50
432
- ], this.pagination = !1, this.autoSort = !0, this.selectionMode = "none", this.selectedIds = [], this.cutIds = [], this.focusedRowKey = null, this.rowLabel = null, this.rowKey = null, this.tree = !1, this.idKey = null, this.childCountKey = null, this.treeIndent = 1.25, this.expandedIds = [], this.selectionStrategy = "flat", this.loading = !1, this.emptyMessage = "No data", this.virtualScroll = !1, this.itemSize = 40, this.virtualBuffer = 10, this.fill = !1, this.resizableColumns = !0, this.hrefFor = null, this.distincts = null, this.filters = {}, this.fetchParams = null, this.stateKey = null;
438
+ ], this.pagination = !1, this.autoSort = !0, this.selectionMode = "none", this.selectedIds = [], this.cutIds = [], this.focusedRowKey = null, this.rowLabel = null, this.rowKey = null, this.tree = !1, this.idKey = null, this.childCountKey = null, this.treeIndent = 1.25, this.expandedIds = [], this.selectionStrategy = "flat", this.loading = !1, this.emptyMessage = "No data", this.virtualScroll = !1, this.itemSize = 40, this.virtualBuffer = 10, this.fill = !1, this.resizableColumns = !0, this.hrefFor = null, this.distincts = null, this.filters = {}, this.filtersReadonly = !1, this.fetchParams = null, this.stateKey = null;
433
439
  }
434
440
  createRenderRoot() {
435
441
  return this;
@@ -1,36 +1,41 @@
1
- import { CoreController as e, LightChildren as t, booleanAttribute as n, coreDirective 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 { contextMenuCore as l, contextMenuPanelCore as u, contextMenuScopedStyles as d } from "@mintplayer/ui-core/context-menu";
1
+ import { CoreController as e, LightChildren as t, coreDirective as n, stringAttribute as r } from "../machine/index.mjs";
2
+ import { LitElement as i, html as a, nothing as o } from "lit";
3
+ import { installLightStyles as s } from "@mintplayer/ui-core/scoped-styles";
4
+ import { contextMenuCore as c, contextMenuPanelCore as l, contextMenuScopedStyles as u } from "@mintplayer/ui-core/context-menu";
5
5
  //#region libs/mintplayer-web-components/context-menu/src/generated/context-menu-panel.view.generated.ts
6
- function f({ root: e, slots: t = {} }) {
7
- return o`
8
- ${t.default === void 0 ? s : t.default}
6
+ function d({ root: e, slots: t = {} }) {
7
+ return a`
8
+ ${t.default === void 0 ? o : t.default}
9
9
  `;
10
10
  }
11
11
  //#endregion
12
12
  //#region libs/mintplayer-web-components/context-menu/src/generated/mp-context-menu-panel.generated.ts
13
- var p = class extends a {
13
+ var f = class extends i {
14
14
  static {
15
15
  this.properties = {
16
16
  overlayId: {
17
17
  type: String,
18
- converter: i(""),
18
+ converter: r(""),
19
19
  attribute: "overlay-id"
20
20
  },
21
- shown: {
22
- type: Boolean,
23
- converter: n(!1)
21
+ phase: {
22
+ type: String,
23
+ converter: r("closed", [
24
+ "closed",
25
+ "entering",
26
+ "shown",
27
+ "leaving"
28
+ ])
24
29
  },
25
30
  defaultRenderer: { attribute: !1 }
26
31
  };
27
32
  }
28
33
  #e = new t(this);
29
- #t = new e(this, u, {
34
+ #t = new e(this, l, {
30
35
  idPrefix: "mp-context-menu-panel",
31
36
  inputs: () => ({
32
37
  overlayId: this.overlayId,
33
- shown: this.shown
38
+ phase: this.phase
34
39
  }),
35
40
  hostBag: (e) => ({
36
41
  ...e.root,
@@ -38,7 +43,7 @@ var p = class extends a {
38
43
  })
39
44
  });
40
45
  constructor() {
41
- super(), this.overlayId = "", this.shown = !1;
46
+ super(), this.overlayId = "", this.phase = "closed";
42
47
  }
43
48
  createRenderRoot() {
44
49
  return this;
@@ -47,7 +52,7 @@ var p = class extends a {
47
52
  this.#e.capture();
48
53
  }
49
54
  render() {
50
- return f({
55
+ return d({
51
56
  ...this.#t.props(),
52
57
  slots: {
53
58
  ...this.#e.slots,
@@ -58,8 +63,8 @@ var p = class extends a {
58
63
  };
59
64
  //#endregion
60
65
  //#region libs/mintplayer-web-components/context-menu/src/generated/context-menu.directive.generated.ts
61
- typeof document < "u" && document.head && c("context-menu", d), customElements.get("mp-context-menu-panel") || customElements.define("mp-context-menu-panel", p), typeof document < "u" && document.head && c("context-menu", d);
62
- var m = r(l, {
66
+ typeof document < "u" && document.head && s("context-menu", u), customElements.get("mp-context-menu-panel") || customElements.define("mp-context-menu-panel", f), typeof document < "u" && document.head && s("context-menu", u);
67
+ var p = n(c, {
63
68
  idPrefix: "mp-context-menu",
64
69
  bag: (e) => e.anchor,
65
70
  defaults: {
@@ -68,8 +73,8 @@ var m = r(l, {
68
73
  },
69
74
  overlay: (e, t) => {
70
75
  let n = e.overlay;
71
- return n ? o`<mp-context-menu-panel .overlayId=${n.overlayId} .shown=${n.shown}>${t?.()}</mp-context-menu-panel>` : null;
76
+ return n ? a`<mp-context-menu-panel .overlayId=${n.overlayId} .phase=${n.phase} .defaultRenderer=${t ?? null}></mp-context-menu-panel>` : null;
72
77
  }
73
78
  });
74
79
  //#endregion
75
- export { p as MpContextMenuPanel, m as bsContextMenu };
80
+ export { f as MpContextMenuPanel, p as bsContextMenu };
@@ -12,10 +12,10 @@ export declare class MpContextMenuPanel extends LitElement {
12
12
  };
13
13
  attribute: string;
14
14
  };
15
- shown: {
16
- type: BooleanConstructor;
15
+ phase: {
16
+ type: StringConstructor;
17
17
  converter: {
18
- fromAttribute: (value: string | null) => boolean;
18
+ fromAttribute: (value: string | null) => string;
19
19
  toAttribute: (value: unknown) => string | null;
20
20
  };
21
21
  };
@@ -25,7 +25,8 @@ export declare class MpContextMenuPanel extends LitElement {
25
25
  };
26
26
  /** The panel's id. */
27
27
  overlayId: ContextMenuPanelInputs['overlayId'];
28
- shown: ContextMenuPanelInputs['shown'];
28
+ /** The overlay phase: `.show` while shown, `hidden` while closed (#465). */
29
+ phase: ContextMenuPanelInputs['phase'];
29
30
  /** Renders the default slot; wins over slot="default" children. */
30
31
  defaultRenderer: (() => unknown) | null | undefined;
31
32
  constructor();