@mintplayer/web-components 2.2.0 → 2.3.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.
Files changed (107) hide show
  1. package/a11y/index.mjs +26 -2
  2. package/a11y/src/dismiss-stack.d.ts +25 -0
  3. package/a11y/src/error-text.d.ts +41 -0
  4. package/a11y/src/focus-restore.d.ts +116 -0
  5. package/a11y/src/focus-trap.d.ts +69 -0
  6. package/a11y/src/form-associated.d.ts +48 -0
  7. package/a11y/src/host-aria.d.ts +154 -0
  8. package/a11y/src/index.d.ts +16 -0
  9. package/a11y/src/inert-regions.d.ts +52 -0
  10. package/a11y/src/live-announcer.d.ts +8 -0
  11. package/a11y/src/roving-focus.d.ts +118 -0
  12. package/a11y/src/testing/expect-idref-resolves.d.ts +31 -0
  13. package/a11y/src/testing/index.d.ts +1 -0
  14. package/accordion/index.mjs +180 -174
  15. package/accordion/src/components/mp-accordion.d.ts +18 -13
  16. package/calendar/index.mjs +1 -1
  17. package/calendar/src/mp-calendar.element.d.ts +2 -0
  18. package/carousel/index.mjs +211 -164
  19. package/carousel/src/components/mp-carousel.d.ts +1 -0
  20. package/checkbox/index.mjs +1 -1
  21. package/checkbox/src/components/mp-checkbox.d.ts +59 -1
  22. package/chunks/focus-restore-DxuP1Oe2.mjs +94 -0
  23. package/chunks/focus-trap-DTOLJ5bb.mjs +121 -0
  24. package/chunks/form-associated-axmc5sY0.mjs +58 -0
  25. package/chunks/host-aria-WSGs7SPQ.mjs +152 -0
  26. package/chunks/inert-regions-DXCnn1LN.mjs +48 -0
  27. package/chunks/invalid-feedback.styles-he0JYrJm.mjs +11 -0
  28. package/chunks/{live-announcer-CZDTKulf.mjs → live-announcer-Bi0orG4n.mjs} +9 -9
  29. package/chunks/{mp-calendar.element-UC68iDbi.mjs → mp-calendar.element-u6uS31_j.mjs} +136 -105
  30. package/chunks/mp-checkbox-Ph2mMRGz.mjs +312 -0
  31. package/chunks/{mp-datatable-Bfw0KGkV.mjs → mp-datatable-BwTlh9A_.mjs} +265 -103
  32. package/chunks/{mp-pagination-BGxsawFL.mjs → mp-pagination-Dea75mD4.mjs} +25 -22
  33. package/chunks/mp-radio-BjW1HNSc.mjs +300 -0
  34. package/chunks/{mp-select-BDS1-YGn.mjs → mp-select-Ctu-v1-p.mjs} +163 -40
  35. package/chunks/{mp-splitter-C8cGCmac.mjs → mp-splitter-LszuRDbR.mjs} +53 -46
  36. package/chunks/{mp-tab-page-D1b4x-y2.mjs → mp-tab-page-CaCzX1ym.mjs} +46 -45
  37. package/chunks/{mp-timepicker.element-BwEiwX92.mjs → mp-timepicker.element-Bz393NDQ.mjs} +93 -86
  38. package/chunks/{mp-toggle-button-dLZNDUVz.mjs → mp-toggle-button-Kz6sIgBJ.mjs} +131 -37
  39. package/chunks/{mp-treeview-C48F63xb.mjs → mp-treeview-tkWu28iF.mjs} +67 -43
  40. package/chunks/overlay-controller-DPt13i8p.mjs +314 -0
  41. package/chunks/roving-focus-CrL9982a.mjs +129 -0
  42. package/code-snippet/index.mjs +21 -13
  43. package/code-snippet/src/mp-code-snippet.element.d.ts +6 -0
  44. package/datatable/index.mjs +1 -1
  45. package/datatable/src/components/mp-datatable.d.ts +50 -0
  46. package/datatable/src/types/index.d.ts +2 -0
  47. package/datatable/src/types/labels.d.ts +30 -0
  48. package/datepicker/index.mjs +45 -22
  49. package/datepicker/src/mp-datepicker.element.d.ts +30 -0
  50. package/datetime-picker/index.mjs +15 -9
  51. package/dock/index.mjs +365 -209
  52. package/dock/src/components/mint-dock-manager.element.d.ts +63 -3
  53. package/dropdown-menu/index.mjs +135 -90
  54. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +12 -3
  55. package/file-manager/index.mjs +279 -214
  56. package/file-manager/src/components/mp-file-manager.d.ts +22 -0
  57. package/file-manager/src/types/messages.d.ts +9 -0
  58. package/multi-range/index.mjs +26 -10
  59. package/multi-range/src/mint-multi-range.element.d.ts +7 -0
  60. package/navbar/index.mjs +53 -39
  61. package/navbar/src/components/mp-navbar.d.ts +1 -0
  62. package/otp-input/index.mjs +82 -48
  63. package/otp-input/src/mint-otp-input.element.d.ts +31 -3
  64. package/overlay/index.mjs +2 -258
  65. package/overlay/src/overlay-controller.d.ts +64 -4
  66. package/package.json +9 -1
  67. package/pagination/index.mjs +1 -1
  68. package/query-builder/index.mjs +117 -87
  69. package/query-builder/src/model/messages.d.ts +9 -0
  70. package/radio/index.mjs +2 -160
  71. package/radio/src/components/mp-radio.d.ts +58 -3
  72. package/radio-group/index.d.ts +1 -0
  73. package/radio-group/index.mjs +145 -0
  74. package/radio-group/src/components/mp-radio-group.d.ts +52 -0
  75. package/radio-group/src/index.d.ts +1 -0
  76. package/radio-group/src/styles/radio-group.styles.d.ts +2 -0
  77. package/ribbon/index.mjs +316 -304
  78. package/ribbon/src/mp-ribbon.element.d.ts +16 -0
  79. package/scheduler/index.mjs +219 -132
  80. package/scheduler/src/components/mp-scheduler.d.ts +3 -0
  81. package/scheduler/src/views/base-view.d.ts +23 -0
  82. package/select/index.mjs +1 -1
  83. package/select/src/components/mp-select.d.ts +60 -3
  84. package/shell/index.mjs +142 -31
  85. package/shell/src/components/mp-shell.d.ts +1 -0
  86. package/signature-pad/index.d.ts +1 -0
  87. package/signature-pad/index.mjs +230 -0
  88. package/signature-pad/src/index.d.ts +2 -0
  89. package/signature-pad/src/mp-signature-pad.element.d.ts +143 -0
  90. package/signature-pad/src/mp-signature-pad.element.template.d.ts +2 -0
  91. package/signature-pad/src/types/signature.d.ts +12 -0
  92. package/splitter/index.mjs +1 -1
  93. package/splitter/src/components/mp-splitter.d.ts +7 -0
  94. package/tab-control/index.mjs +1 -1
  95. package/tile-manager/index.mjs +110 -93
  96. package/timeline/index.mjs +138 -54
  97. package/timeline/src/components/mp-timeline.d.ts +15 -0
  98. package/timepicker/index.mjs +1 -1
  99. package/timepicker/src/mp-time-list.element.d.ts +13 -4
  100. package/timepicker/src/mp-timepicker.element.d.ts +29 -0
  101. package/toggle-button/index.mjs +1 -1
  102. package/toggle-button/src/components/mp-toggle-button.d.ts +32 -1
  103. package/tree-select/index.mjs +233 -121
  104. package/tree-select/src/components/mp-tree-select.d.ts +37 -0
  105. package/treeview/index.mjs +1 -1
  106. package/treeview/src/components/mp-treeview.d.ts +10 -1
  107. package/chunks/mp-checkbox-BokLL7BS.mjs +0 -211
@@ -57,6 +57,8 @@ export declare class MpTreeview extends LitElement {
57
57
  private _loadingIds;
58
58
  /** Last load error per node id. */
59
59
  private _errorIds;
60
+ /** Lazy loads have no visible focus move; announce start, finish and ERROR. */
61
+ private readonly liveAnnouncer;
60
62
  private _focusedId;
61
63
  private _visibleOrder;
62
64
  private _byId;
@@ -91,7 +93,14 @@ export declare class MpTreeview extends LitElement {
91
93
  get loadChildren(): TreeChildrenLoader | undefined;
92
94
  set loadChildren(value: TreeChildrenLoader | undefined);
93
95
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
94
- connectedCallback(): void;
96
+ private _inputLabel;
97
+ /**
98
+ * Accessible name for the in-shadow role=tree node (tier-2 naming: the
99
+ * host is generic, so a consumer cannot name the tree any other way).
100
+ * A host `aria-label` wins over this, per the B-phase contract.
101
+ */
102
+ get inputLabel(): string | null;
103
+ set inputLabel(value: string | null);
95
104
  render(): TemplateResult;
96
105
  private renderNodes;
97
106
  private renderNode;
@@ -1,211 +0,0 @@
1
- import { LitElement as n, nothing as s, html as h } from "lit";
2
- import { ifDefined as a } from "lit/directives/if-defined.js";
3
- import { createRef as o, ref as c } from "lit/directives/ref.js";
4
- import { f as u } from "./form-check.styles-jBlHetYX.mjs";
5
- import { t as b } from "./mp-toggle-button-dLZNDUVz.mjs";
6
- const d = /* @__PURE__ */ new Set(["checkbox", "switch", "toggle_button"]), l = /* @__PURE__ */ new Set([
7
- "primary",
8
- "secondary",
9
- "success",
10
- "danger",
11
- "warning",
12
- "info",
13
- "light",
14
- "dark",
15
- "outline-primary",
16
- "outline-secondary",
17
- "outline-success",
18
- "outline-danger",
19
- "outline-warning",
20
- "outline-info",
21
- "outline-light",
22
- "outline-dark"
23
- ]);
24
- let p = 0;
25
- class _ extends n {
26
- constructor() {
27
- super(...arguments), this._type = "checkbox", this._checked = !1, this._indeterminate = !1, this._disabled = !1, this._name = null, this._value = null, this._color = "primary", this._inputId = `mp-checkbox-${++p}`, this._inputRef = o(), this.onInputChange = (e) => {
28
- const t = e.target, i = t.checked, r = t.indeterminate;
29
- this._checked = i, this._indeterminate = r, this.reflectBoolean("checked", i), this.reflectBoolean("indeterminate", r), this.dispatchEvent(
30
- new CustomEvent("change", {
31
- detail: {
32
- checked: i,
33
- indeterminate: r,
34
- value: this._value
35
- },
36
- bubbles: !0,
37
- composed: !0
38
- })
39
- );
40
- };
41
- }
42
- static {
43
- this.styles = [u, b];
44
- }
45
- static {
46
- this.shadowRootOptions = {
47
- ...n.shadowRootOptions,
48
- delegatesFocus: !0
49
- };
50
- }
51
- static get observedAttributes() {
52
- return [
53
- ...super.observedAttributes ?? [],
54
- "type",
55
- "checked",
56
- "indeterminate",
57
- "disabled",
58
- "name",
59
- "value",
60
- "color",
61
- // Forwarded to the inner <input> in render() so consumers using the
62
- // WC directly (without the Angular wrapper) can label the control.
63
- "aria-label",
64
- "aria-labelledby",
65
- "aria-describedby"
66
- ];
67
- }
68
- get type() {
69
- return this._type;
70
- }
71
- set type(e) {
72
- !d.has(e) || this._type === e || (this._type = e, this.requestUpdate());
73
- }
74
- get checked() {
75
- return this._checked;
76
- }
77
- set checked(e) {
78
- const t = !!e;
79
- this._checked !== t && (this._checked = t, this.reflectBoolean("checked", t), this.requestUpdate());
80
- }
81
- get indeterminate() {
82
- return this._indeterminate;
83
- }
84
- set indeterminate(e) {
85
- const t = !!e;
86
- this._indeterminate !== t && (this._indeterminate = t, this.reflectBoolean("indeterminate", t), this.requestUpdate());
87
- }
88
- get disabled() {
89
- return this._disabled;
90
- }
91
- set disabled(e) {
92
- const t = !!e;
93
- this._disabled !== t && (this._disabled = t, this.reflectBoolean("disabled", t), this.requestUpdate());
94
- }
95
- get name() {
96
- return this._name;
97
- }
98
- set name(e) {
99
- const t = e ?? null;
100
- this._name !== t && (this._name = t, this.requestUpdate());
101
- }
102
- get value() {
103
- return this._value;
104
- }
105
- set value(e) {
106
- const t = e ?? null;
107
- this._value !== t && (this._value = t, this.requestUpdate());
108
- }
109
- get color() {
110
- return this._color;
111
- }
112
- set color(e) {
113
- !l.has(e) || this._color === e || (this._color = e, this.requestUpdate());
114
- }
115
- attributeChangedCallback(e, t, i) {
116
- switch (super.attributeChangedCallback(e, t, i), e) {
117
- case "type":
118
- i && d.has(i) && (this._type = i, this.requestUpdate());
119
- break;
120
- case "checked":
121
- this._checked = i !== null, this.requestUpdate();
122
- break;
123
- case "indeterminate":
124
- this._indeterminate = i !== null, this.requestUpdate();
125
- break;
126
- case "disabled":
127
- this._disabled = i !== null, this.requestUpdate();
128
- break;
129
- case "name":
130
- this._name = i, this.requestUpdate();
131
- break;
132
- case "value":
133
- this._value = i, this.requestUpdate();
134
- break;
135
- case "color":
136
- i && l.has(i) && (this._color = i, this.requestUpdate());
137
- break;
138
- case "aria-label":
139
- case "aria-labelledby":
140
- case "aria-describedby":
141
- this.requestUpdate();
142
- break;
143
- }
144
- }
145
- render() {
146
- return this._type === "toggle_button" ? this.renderToggleButton() : this.renderCheckOrSwitch();
147
- }
148
- // `indeterminate` is a DOM property only (no HTML attribute), so set it
149
- // after each update from the source-of-truth field. Skipped on the
150
- // toggle_button variant because btn-check + .active doesn't model a
151
- // mixed state visually.
152
- updated() {
153
- const e = this._inputRef.value;
154
- e && (e.indeterminate = this._indeterminate && this._type !== "toggle_button");
155
- }
156
- renderCheckOrSwitch() {
157
- const e = this._type === "switch", t = this.getAttribute("aria-label") ?? void 0, i = this.getAttribute("aria-labelledby") ?? void 0, r = this.getAttribute("aria-describedby") ?? void 0;
158
- return h`
159
- <label class=${e ? "form-check form-switch" : "form-check"}>
160
- <input
161
- ${c(this._inputRef)}
162
- type="checkbox"
163
- class="form-check-input"
164
- id=${this._inputId}
165
- .checked=${this._checked}
166
- ?disabled=${this._disabled}
167
- name=${this._name ?? s}
168
- value=${this._value ?? s}
169
- role=${e ? "switch" : s}
170
- aria-checked=${this._indeterminate ? "mixed" : s}
171
- aria-label=${a(t)}
172
- aria-labelledby=${a(i)}
173
- aria-describedby=${a(r)}
174
- @change=${this.onInputChange}
175
- />
176
- <span class="form-check-label"><slot></slot></span>
177
- </label>
178
- `;
179
- }
180
- renderToggleButton() {
181
- const e = this.getAttribute("aria-label") ?? void 0, t = this.getAttribute("aria-labelledby") ?? void 0, i = this.getAttribute("aria-describedby") ?? void 0;
182
- return h`
183
- <input
184
- ${c(this._inputRef)}
185
- type="checkbox"
186
- class="btn-check"
187
- id=${this._inputId}
188
- .checked=${this._checked}
189
- ?disabled=${this._disabled}
190
- name=${this._name ?? s}
191
- value=${this._value ?? s}
192
- role="button"
193
- aria-pressed=${this._checked ? "true" : "false"}
194
- aria-label=${a(e)}
195
- aria-labelledby=${a(t)}
196
- aria-describedby=${a(i)}
197
- @change=${this.onInputChange}
198
- />
199
- <label class="btn btn-${this._color}" for=${this._inputId}>
200
- <slot></slot>
201
- </label>
202
- `;
203
- }
204
- reflectBoolean(e, t) {
205
- t ? this.setAttribute(e, "") : this.removeAttribute(e);
206
- }
207
- }
208
- typeof customElements < "u" && !customElements.get("mp-checkbox") && customElements.define("mp-checkbox", _);
209
- export {
210
- _ as M
211
- };