@melodicdev/components 1.6.9 → 2.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/assets/melodic-components.css +1 -1
- package/assets/melodic-components.js +507 -337
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.css +1 -1
- package/assets/melodic-components.min.js +2114 -1981
- package/lib/components/data-display/data-grid/data-grid.component.d.ts +3 -0
- package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.component.js +42 -0
- package/lib/components/data-display/data-grid/data-grid.styles.js +8 -8
- package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.template.js +17 -5
- package/lib/components/data-display/table/table.component.d.ts +6 -3
- package/lib/components/data-display/table/table.component.d.ts.map +1 -1
- package/lib/components/data-display/table/table.component.js +7 -17
- package/lib/components/data-display/table/table.template.js +1 -1
- package/lib/components/forms/radio/radio-group.component.d.ts +2 -0
- package/lib/components/forms/radio/radio-group.component.d.ts.map +1 -1
- package/lib/components/forms/radio/radio-group.component.js +10 -1
- package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts +1 -0
- package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts.map +1 -1
- package/lib/components/forms/radio-card-group/radio-card-group.component.js +7 -0
- package/lib/components/overlays/dropdown/dropdown.component.d.ts +1 -0
- package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown.component.js +13 -0
- package/lib/components/overlays/popover/popover.component.d.ts +1 -0
- package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.component.js +11 -0
- package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.styles.js +4 -2
- package/lib/theme/functions/apply-theme.function.d.ts.map +1 -1
- package/lib/theme/functions/apply-theme.function.js +8 -0
- package/lib/theme/functions/create-theme.function.d.ts +3 -2
- package/lib/theme/functions/create-theme.function.d.ts.map +1 -1
- package/lib/theme/functions/create-theme.function.js +22 -7
- package/lib/theme/presets/dark.preset.js +1 -1
- package/lib/utils/virtual-scroll/index.d.ts.map +1 -1
- package/lib/utils/virtual-scroll/index.js +10 -9
- package/package.json +2 -2
|
@@ -88,6 +88,9 @@ export declare class DataGridComponent implements IElementRef, OnCreate, OnDestr
|
|
|
88
88
|
get totalGridWidth(): number;
|
|
89
89
|
get gridTemplateColumns(): string;
|
|
90
90
|
getPinnedLeftOffset(key: string): number;
|
|
91
|
+
getPinnedRightOffset(key: string): number;
|
|
92
|
+
get lastLeftPinnedKey(): string | null;
|
|
93
|
+
get firstRightPinnedKey(): string | null;
|
|
91
94
|
get topSpacerHeight(): number;
|
|
92
95
|
get bottomSpacerHeight(): number;
|
|
93
96
|
get allSelected(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAiBa,iBAAkB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IAC9F,UAAU,EAAG,WAAW,CAAC;IAIhC,0CAA0C;IACnC,UAAU,UAAS;IAE1B,kCAAkC;IAC3B,OAAO,UAAS;IAEvB,8BAA8B;IACvB,SAAS,UAAQ;IAExB,wBAAwB;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,2CAA2C;IACpC,SAAS,SAAM;IAEtB,iDAAiD;IAC1C,WAAW,SAAM;IAExB,kFAAkF;IAC3E,UAAU,UAAS;IAE1B,8BAA8B;IACvB,QAAQ,SAAM;IAErB,2DAA2D;IACpD,OAAO,UAAQ;IAEtB,yDAAyD;IAClD,aAAa,UAAS;IAI7B,yBAAyB;IAClB,OAAO,EAAE,cAAc,EAAE,CAAM;IAEtC,eAAe;IACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAM;IAIrC,OAAO,SAAM;IACb,aAAa,EAAE,aAAa,CAAS;IAIrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAIrC,eAAe,EAAE,MAAM,EAAE,CAAM;IAI/B,WAAW,SAAK;IAIhB,UAAU,SAAK;IACf,QAAQ,SAAM;IAId,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IACvC,QAAQ,EAAE,MAAM,EAAE,CAAM;IAIxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAIlC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAKzC,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,iBAAiB,CAAK;IAI9B,IAAW,SAAS,IAAI,MAAM,CAE7B;IAIM,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"data-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,cAAc,EAAE,aA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YAAY,IAAI,OAAO,CAEjC;IAEM,aAAa,GAAI,OAAO,MAAM,KAAG,OAAO,CAAyC;IAIjF,UAAU,GAAI,KAAK,cAAc,KAAG,IAAI,CAoB7C;IAEK,iBAAiB,GAAI,KAAK,MAAM,EAAE,GAAG,KAAK,KAAG,IAAI,CActD;IAEK,eAAe,QAAO,IAAI,CAG/B;IAEK,eAAe,GAAI,OAAO,MAAM,EAAE,GAAG,KAAK,KAAG,IAAI,CAMtD;IAEK,cAAc,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,IAAI,CAQzE;IAEK,iBAAiB,GAAI,KAAK,MAAM,EAAE,GAAG,YAAY,KAAG,IAAI,CAO7D;IAEK,gBAAgB,GAAI,KAAK,MAAM,EAAE,GAAG,YAAY,KAAG,IAAI,CAS5D;IAEK,eAAe,QAAO,IAAI,CAU/B;IAEK,eAAe,GAAI,KAAK,MAAM,EAAE,GAAG,SAAS,KAAG,IAAI,CAGxD;IAEK,cAAc,GAAI,KAAK,MAAM,EAAE,GAAG,SAAS,KAAG,IAAI,CAGvD;IAEK,aAAa,QAAO,IAAI,CAG7B;IAEK,UAAU,GAAI,WAAW,MAAM,KAAG,IAAI,CAwB3C;IAEK,QAAQ,GAAI,MAAM,MAAM,KAAG,IAAI,CAepC;IAEF,OAAO,CAAC,WAAW;CASnB"}
|
|
@@ -102,6 +102,9 @@ let DataGridComponent = class DataGridComponent {
|
|
|
102
102
|
this.sortDirection = 'asc';
|
|
103
103
|
}
|
|
104
104
|
this.currentPage = 1;
|
|
105
|
+
// Selection is positional; sorting reorders rows, so clear it (otherwise
|
|
106
|
+
// the same indices would point at different rows).
|
|
107
|
+
this.selectedIndices = [];
|
|
105
108
|
this._scroller.invalidate();
|
|
106
109
|
this.elementRef.dispatchEvent(new CustomEvent('ml:sort', {
|
|
107
110
|
bubbles: true,
|
|
@@ -113,6 +116,8 @@ let DataGridComponent = class DataGridComponent {
|
|
|
113
116
|
const val = e.target.value;
|
|
114
117
|
this.filters = { ...this.filters, [key]: val };
|
|
115
118
|
this.currentPage = 1;
|
|
119
|
+
// Filtering changes which rows are present; positional selection no longer applies.
|
|
120
|
+
this.selectedIndices = [];
|
|
116
121
|
this._scroller.invalidate();
|
|
117
122
|
this.elementRef.dispatchEvent(new CustomEvent('ml:filter', {
|
|
118
123
|
bubbles: true,
|
|
@@ -208,6 +213,9 @@ let DataGridComponent = class DataGridComponent {
|
|
|
208
213
|
if (page < 1 || page > this.totalPages)
|
|
209
214
|
return;
|
|
210
215
|
this.currentPage = page;
|
|
216
|
+
// Selection indices are page-relative; clear on page change so the header
|
|
217
|
+
// checkbox and ml:select don't report rows from the previous page.
|
|
218
|
+
this.selectedIndices = [];
|
|
211
219
|
if (this._viewport)
|
|
212
220
|
this._viewport.scrollTop = 0;
|
|
213
221
|
this._scroller.invalidate();
|
|
@@ -227,6 +235,13 @@ let DataGridComponent = class DataGridComponent {
|
|
|
227
235
|
if (name === 'columns' && Array.isArray(newVal)) {
|
|
228
236
|
this._syncColumnState(newVal);
|
|
229
237
|
}
|
|
238
|
+
if (name === 'rows') {
|
|
239
|
+
// Selection is positional; a new dataset invalidates it. Recompute the
|
|
240
|
+
// virtual window after the new value commits (onPropertyChange fires
|
|
241
|
+
// before the assignment), matching ml-table's behavior.
|
|
242
|
+
this.selectedIndices = [];
|
|
243
|
+
queueMicrotask(() => this._scroller.invalidate());
|
|
244
|
+
}
|
|
230
245
|
}
|
|
231
246
|
onCreate() {
|
|
232
247
|
this._syncColumnState(this.columns);
|
|
@@ -370,6 +385,33 @@ let DataGridComponent = class DataGridComponent {
|
|
|
370
385
|
}
|
|
371
386
|
return 0;
|
|
372
387
|
}
|
|
388
|
+
getPinnedRightOffset(key) {
|
|
389
|
+
let offset = 0;
|
|
390
|
+
for (let i = this.orderedColumns.length - 1; i >= 0; i--) {
|
|
391
|
+
const col = this.orderedColumns[i];
|
|
392
|
+
if (col.key === key)
|
|
393
|
+
return offset;
|
|
394
|
+
if (col.pinned === 'right') {
|
|
395
|
+
offset += this.columnWidths[col.key] ?? 150;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return 0;
|
|
399
|
+
}
|
|
400
|
+
get lastLeftPinnedKey() {
|
|
401
|
+
let key = null;
|
|
402
|
+
for (const col of this.orderedColumns) {
|
|
403
|
+
if (col.pinned === 'left')
|
|
404
|
+
key = col.key;
|
|
405
|
+
}
|
|
406
|
+
return key;
|
|
407
|
+
}
|
|
408
|
+
get firstRightPinnedKey() {
|
|
409
|
+
for (const col of this.orderedColumns) {
|
|
410
|
+
if (col.pinned === 'right')
|
|
411
|
+
return col.key;
|
|
412
|
+
}
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
373
415
|
get topSpacerHeight() {
|
|
374
416
|
return this.virtual ? this.startIndex * this.rowHeight : 0;
|
|
375
417
|
}
|
|
@@ -259,7 +259,8 @@ export const dataGridStyles = () => css `
|
|
|
259
259
|
position: relative;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
.ml-data-grid__filter-cell--pinned-left
|
|
262
|
+
.ml-data-grid__filter-cell--pinned-left,
|
|
263
|
+
.ml-data-grid__filter-cell--pinned-right {
|
|
263
264
|
position: sticky;
|
|
264
265
|
z-index: 3;
|
|
265
266
|
background: var(--ml-data-grid-bg);
|
|
@@ -394,9 +395,9 @@ export const dataGridStyles = () => css `
|
|
|
394
395
|
background: var(--ml-data-grid-header-bg);
|
|
395
396
|
}
|
|
396
397
|
|
|
397
|
-
/* Pinned left shadow */
|
|
398
|
-
.ml-data-grid__th--pinned-left::after,
|
|
399
|
-
.ml-data-grid__td--pinned-left::after {
|
|
398
|
+
/* Pinned left shadow — renders only on the rightmost (boundary) left-pinned cell */
|
|
399
|
+
.ml-data-grid__th--pinned-left-edge::after,
|
|
400
|
+
.ml-data-grid__td--pinned-left-edge::after {
|
|
400
401
|
content: '';
|
|
401
402
|
position: absolute;
|
|
402
403
|
top: 0;
|
|
@@ -410,7 +411,6 @@ export const dataGridStyles = () => css `
|
|
|
410
411
|
.ml-data-grid__th--pinned-right,
|
|
411
412
|
.ml-data-grid__td--pinned-right {
|
|
412
413
|
position: sticky;
|
|
413
|
-
right: 0;
|
|
414
414
|
z-index: 1;
|
|
415
415
|
background: var(--ml-data-grid-bg);
|
|
416
416
|
}
|
|
@@ -420,9 +420,9 @@ export const dataGridStyles = () => css `
|
|
|
420
420
|
background: var(--ml-data-grid-header-bg);
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
/* Pinned right shadow */
|
|
424
|
-
.ml-data-grid__th--pinned-right::before,
|
|
425
|
-
.ml-data-grid__td--pinned-right::before {
|
|
423
|
+
/* Pinned right shadow — renders only on the leftmost (boundary) right-pinned cell */
|
|
424
|
+
.ml-data-grid__th--pinned-right-edge::before,
|
|
425
|
+
.ml-data-grid__td--pinned-right-edge::before {
|
|
426
426
|
content: '';
|
|
427
427
|
position: absolute;
|
|
428
428
|
top: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"data-grid.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/data-grid/data-grid.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAelE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CA+NpD"}
|
|
@@ -5,6 +5,13 @@ function renderCell(col, row, index) {
|
|
|
5
5
|
const val = row[col.key];
|
|
6
6
|
return val == null ? '' : val;
|
|
7
7
|
}
|
|
8
|
+
function pinStyle(c, col) {
|
|
9
|
+
if (col.pinned === 'left')
|
|
10
|
+
return `left: ${c.getPinnedLeftOffset(col.key)}px`;
|
|
11
|
+
if (col.pinned === 'right')
|
|
12
|
+
return `right: ${c.getPinnedRightOffset(col.key)}px`;
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
8
15
|
export function dataGridTemplate(c) {
|
|
9
16
|
const gtc = c.gridTemplateColumns;
|
|
10
17
|
const totalW = c.totalGridWidth;
|
|
@@ -54,11 +61,13 @@ export function dataGridTemplate(c) {
|
|
|
54
61
|
'ml-data-grid__th--sorted': c.sortKey === col.key,
|
|
55
62
|
'ml-data-grid__th--pinned-left': col.pinned === 'left',
|
|
56
63
|
'ml-data-grid__th--pinned-right': col.pinned === 'right',
|
|
64
|
+
'ml-data-grid__th--pinned-left-edge': col.key === c.lastLeftPinnedKey,
|
|
65
|
+
'ml-data-grid__th--pinned-right-edge': col.key === c.firstRightPinnedKey,
|
|
57
66
|
'ml-data-grid__th--drag-over': c.dragOverKey === col.key,
|
|
58
67
|
'ml-data-grid__th--dragging': c.draggingKey === col.key,
|
|
59
68
|
'ml-data-grid__th--resizing': c.resizingKey === col.key
|
|
60
69
|
})}
|
|
61
|
-
style=${
|
|
70
|
+
style=${pinStyle(c, col)}
|
|
62
71
|
draggable=${col.reorderable !== false ? 'true' : 'false'}
|
|
63
72
|
@dragstart=${(e) => c.handleDragStart(col.key, e)}
|
|
64
73
|
@dragover=${(e) => c.handleDragOver(col.key, e)}
|
|
@@ -103,9 +112,10 @@ export function dataGridTemplate(c) {
|
|
|
103
112
|
<div
|
|
104
113
|
class=${classMap({
|
|
105
114
|
'ml-data-grid__filter-cell': true,
|
|
106
|
-
'ml-data-grid__filter-cell--pinned-left': col.pinned === 'left'
|
|
115
|
+
'ml-data-grid__filter-cell--pinned-left': col.pinned === 'left',
|
|
116
|
+
'ml-data-grid__filter-cell--pinned-right': col.pinned === 'right'
|
|
107
117
|
})}
|
|
108
|
-
style=${
|
|
118
|
+
style=${pinStyle(c, col)}
|
|
109
119
|
>
|
|
110
120
|
${when(!!col.filterable, () => html `
|
|
111
121
|
<input
|
|
@@ -155,9 +165,11 @@ export function dataGridTemplate(c) {
|
|
|
155
165
|
'ml-data-grid__td': true,
|
|
156
166
|
[`ml-data-grid__td--${col.align ?? 'left'}`]: true,
|
|
157
167
|
'ml-data-grid__td--pinned-left': col.pinned === 'left',
|
|
158
|
-
'ml-data-grid__td--pinned-right': col.pinned === 'right'
|
|
168
|
+
'ml-data-grid__td--pinned-right': col.pinned === 'right',
|
|
169
|
+
'ml-data-grid__td--pinned-left-edge': col.key === c.lastLeftPinnedKey,
|
|
170
|
+
'ml-data-grid__td--pinned-right-edge': col.key === c.firstRightPinnedKey
|
|
159
171
|
})}
|
|
160
|
-
style=${
|
|
172
|
+
style=${pinStyle(c, col)}
|
|
161
173
|
>
|
|
162
174
|
${renderCell(col, row, c.startIndex + i)}
|
|
163
175
|
</div>
|
|
@@ -27,8 +27,12 @@ import type { TableColumn, SortDirection } from './table.types.js';
|
|
|
27
27
|
*/
|
|
28
28
|
export declare class TableComponent implements IElementRef, OnCreate, OnDestroy, OnRender, OnPropertyChange {
|
|
29
29
|
elementRef: HTMLElement;
|
|
30
|
-
/**
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Apply the clickable-row affordance (pointer cursor + hover highlight).
|
|
32
|
+
* Set this when you also listen for `ml:row-click`. Replaces the previous
|
|
33
|
+
* auto-detection that globally patched EventTarget.prototype.addEventListener.
|
|
34
|
+
*/
|
|
35
|
+
clickableRows: boolean;
|
|
32
36
|
/** Whether the footer slot has content */
|
|
33
37
|
hasFooter: boolean;
|
|
34
38
|
/** Whether the header-actions slot has content */
|
|
@@ -72,7 +76,6 @@ export declare class TableComponent implements IElementRef, OnCreate, OnDestroy,
|
|
|
72
76
|
private _viewport;
|
|
73
77
|
get rowHeight(): number;
|
|
74
78
|
onPropertyChange(name: string, _oldVal: unknown, _newVal: unknown): void;
|
|
75
|
-
onInit(): void;
|
|
76
79
|
onCreate(): void;
|
|
77
80
|
onRender(): void;
|
|
78
81
|
onDestroy(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKnE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAMa,cAAe,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IAC3F,UAAU,EAAG,WAAW,CAAC;IAEhC;;;;OAIG;IACI,aAAa,UAAS;IAE7B,0CAA0C;IACnC,SAAS,UAAS;IAEzB,kDAAkD;IAC3C,gBAAgB,UAAS;IAEhC,0CAA0C;IACnC,UAAU,UAAS;IAE1B,kCAAkC;IAC3B,OAAO,UAAS;IAEvB,8BAA8B;IACvB,SAAS,UAAQ;IAExB,0BAA0B;IACnB,YAAY,UAAS;IAE5B,iBAAiB;IACV,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,yBAAyB;IAClB,UAAU,SAAM;IAEvB,+BAA+B;IACxB,WAAW,SAAM;IAExB,2DAA2D;IACpD,OAAO,UAAS;IAEvB;;;;;OAKG;IACI,UAAU,UAAS;IAE1B,yBAAyB;IAClB,OAAO,EAAE,WAAW,EAAE,CAAM;IAEnC,eAAe;IACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,E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{ tableTemplate } from './table.template.js';
|
|
9
9
|
import { tableStyles } from './table.styles.js';
|
|
10
10
|
import { VirtualScroller } from '../../../utils/virtual-scroll/index.js';
|
|
11
|
-
// Track elements that receive ml:row-click listeners before custom element upgrade.
|
|
12
|
-
// The template engine adds event listeners via addEventListener on un-upgraded elements
|
|
13
|
-
// (before the constructor runs), so we intercept at the prototype level to catch them.
|
|
14
|
-
const _rowClickTargets = new WeakSet();
|
|
15
|
-
const _origAddEventListener = EventTarget.prototype.addEventListener;
|
|
16
|
-
EventTarget.prototype.addEventListener = function (type, listener, options) {
|
|
17
|
-
if (type === 'ml:row-click') {
|
|
18
|
-
_rowClickTargets.add(this);
|
|
19
|
-
}
|
|
20
|
-
_origAddEventListener.call(this, type, listener, options);
|
|
21
|
-
};
|
|
22
11
|
/**
|
|
23
12
|
* ml-table - Data table with sorting, selection, and custom cell rendering
|
|
24
13
|
*
|
|
@@ -46,8 +35,12 @@ EventTarget.prototype.addEventListener = function (type, listener, options) {
|
|
|
46
35
|
*/
|
|
47
36
|
let TableComponent = class TableComponent {
|
|
48
37
|
constructor() {
|
|
49
|
-
/**
|
|
50
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Apply the clickable-row affordance (pointer cursor + hover highlight).
|
|
40
|
+
* Set this when you also listen for `ml:row-click`. Replaces the previous
|
|
41
|
+
* auto-detection that globally patched EventTarget.prototype.addEventListener.
|
|
42
|
+
*/
|
|
43
|
+
this.clickableRows = false;
|
|
51
44
|
/** Whether the footer slot has content */
|
|
52
45
|
this.hasFooter = false;
|
|
53
46
|
/** Whether the header-actions slot has content */
|
|
@@ -150,9 +143,6 @@ let TableComponent = class TableComponent {
|
|
|
150
143
|
this._scroller.invalidate();
|
|
151
144
|
}
|
|
152
145
|
}
|
|
153
|
-
onInit() {
|
|
154
|
-
this._rowClickable = _rowClickTargets.has(this.elementRef);
|
|
155
|
-
}
|
|
156
146
|
onCreate() {
|
|
157
147
|
const shadow = this.elementRef.shadowRoot;
|
|
158
148
|
if (!shadow)
|
|
@@ -261,7 +251,7 @@ TableComponent = __decorate([
|
|
|
261
251
|
selector: 'ml-table',
|
|
262
252
|
template: tableTemplate,
|
|
263
253
|
styles: tableStyles,
|
|
264
|
-
attributes: ['selectable', 'striped', 'hoverable', 'size', 'table-title', 'description', 'sticky-header', 'virtual', 'manual-sort']
|
|
254
|
+
attributes: ['selectable', 'striped', 'hoverable', 'size', 'table-title', 'description', 'sticky-header', 'virtual', 'manual-sort', 'clickable-rows']
|
|
265
255
|
})
|
|
266
256
|
], TableComponent);
|
|
267
257
|
export { TableComponent };
|
|
@@ -12,7 +12,7 @@ export function tableTemplate(c) {
|
|
|
12
12
|
[`ml-table--${c.size}`]: true,
|
|
13
13
|
'ml-table--striped': c.striped,
|
|
14
14
|
'ml-table--hoverable': c.hoverable,
|
|
15
|
-
'ml-table--row-clickable': c.
|
|
15
|
+
'ml-table--row-clickable': c.clickableRows,
|
|
16
16
|
'ml-table--sticky-header': c.stickyHeader,
|
|
17
17
|
'ml-table--virtual': c.virtual
|
|
18
18
|
})}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio/radio-group.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAY3D;;;;;;;;;;;;GAYG;AACH,qBAMa,mBAAoB,YAAW,WAAW,EAAE,MAAM;IACvD,UAAU,EAAG,WAAW,CAAC;IAEhC,kBAAkB;IACX,KAAK,SAAM;IAElB,sBAAsB;IACf,IAAI,SAAM;IAEjB,6BAA6B;IACtB,KAAK,SAAM;IAElB,gBAAgB;IACT,IAAI,SAAM;IAEjB,oBAAoB;IACb,KAAK,SAAM;IAElB,yBAAyB;IAClB,WAAW,EAAE,WAAW,CAAc;IAE7C,qBAAqB;IACd,QAAQ,UAAS;IAExB,qBAAqB;IACd,QAAQ,UAAS;IAEjB,MAAM,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"radio-group.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio/radio-group.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAY3D;;;;;;;;;;;;GAYG;AACH,qBAMa,mBAAoB,YAAW,WAAW,EAAE,MAAM;IACvD,UAAU,EAAG,WAAW,CAAC;IAEhC,kBAAkB;IACX,KAAK,SAAM;IAElB,sBAAsB;IACf,IAAI,SAAM;IAEjB,6BAA6B;IACtB,KAAK,SAAM;IAElB,gBAAgB;IACT,IAAI,SAAM;IAEjB,oBAAoB;IACb,KAAK,SAAM;IAElB,yBAAyB;IAClB,WAAW,EAAE,WAAW,CAAc;IAE7C,qBAAqB;IACd,QAAQ,UAAS;IAExB,qBAAqB;IACd,QAAQ,UAAS;IAEjB,MAAM,IAAI,IAAI;IAKd,QAAQ,IAAI,IAAI;IAMhB,QAAQ,IAAI,IAAI;IAOvB,OAAO,CAAC,iBAAiB,CAmBvB;IAEF,OAAO,CAAC,iBAAiB;CAuBzB"}
|
|
@@ -65,7 +65,16 @@ let RadioGroupComponent = class RadioGroupComponent {
|
|
|
65
65
|
onInit() {
|
|
66
66
|
// Listen for changes from child radios
|
|
67
67
|
this.elementRef.addEventListener('ml:change', this.handleChildChange);
|
|
68
|
-
|
|
68
|
+
}
|
|
69
|
+
onCreate() {
|
|
70
|
+
// Re-sync when slotted radios are added/removed.
|
|
71
|
+
const slot = this.elementRef.shadowRoot?.querySelector('slot');
|
|
72
|
+
slot?.addEventListener('slotchange', () => this.updateChildRadios());
|
|
73
|
+
}
|
|
74
|
+
onRender() {
|
|
75
|
+
// Sync child radios after every render (post-commit), so programmatic
|
|
76
|
+
// value/disabled changes — e.g. from a :formControl binding, setValue, or
|
|
77
|
+
// reset — are reflected on the slotted radios.
|
|
69
78
|
this.updateChildRadios();
|
|
70
79
|
}
|
|
71
80
|
updateChildRadios() {
|
|
@@ -29,6 +29,7 @@ export declare class RadioCardGroupComponent implements IElementRef, OnCreate, O
|
|
|
29
29
|
/** Required state */
|
|
30
30
|
required: boolean;
|
|
31
31
|
onCreate(): void;
|
|
32
|
+
onRender(): void;
|
|
32
33
|
onDestroy(): void;
|
|
33
34
|
handleSlotChange: () => void;
|
|
34
35
|
private readonly _handleCardSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-card-group.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio-card-group/radio-card-group.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAazE;;;;;;;;;;;;GAYG;AACH,qBAMa,uBAAwB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IACxE,UAAU,EAAG,WAAW,CAAC;IAEhC,+BAA+B;IACxB,KAAK,SAAM;IAElB,kBAAkB;IACX,KAAK,SAAM;IAElB,gBAAgB;IACT,IAAI,SAAM;IAEjB,oBAAoB;IACb,KAAK,SAAM;IAElB,yBAAyB;IAClB,WAAW,EAAE,UAAU,GAAG,YAAY,CAAc;IAE3D,qBAAqB;IACd,QAAQ,UAAS;IAExB,qBAAqB;IACd,QAAQ,UAAS;IAEjB,QAAQ,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"radio-card-group.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/radio-card-group/radio-card-group.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAazE;;;;;;;;;;;;GAYG;AACH,qBAMa,uBAAwB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IACxE,UAAU,EAAG,WAAW,CAAC;IAEhC,+BAA+B;IACxB,KAAK,SAAM;IAElB,kBAAkB;IACX,KAAK,SAAM;IAElB,gBAAgB;IACT,IAAI,SAAM;IAEjB,oBAAoB;IACb,KAAK,SAAM;IAElB,yBAAyB;IAClB,WAAW,EAAE,UAAU,GAAG,YAAY,CAAc;IAE3D,qBAAqB;IACd,QAAQ,UAAS;IAExB,qBAAqB;IACd,QAAQ,UAAS;IAEjB,QAAQ,IAAI,IAAI;IAMhB,QAAQ,IAAI,IAAI;IAOhB,SAAS,IAAI,IAAI;IAIjB,gBAAgB,QAAO,IAAI,CAEhC;IAEF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAYhC;IAEF,OAAO,CAAC,SAAS;CAoBjB"}
|
|
@@ -60,6 +60,13 @@ let RadioCardGroupComponent = class RadioCardGroupComponent {
|
|
|
60
60
|
}
|
|
61
61
|
onCreate() {
|
|
62
62
|
this.elementRef.addEventListener('ml:card-select', this._handleCardSelect);
|
|
63
|
+
// Re-sync when slotted cards are added/removed.
|
|
64
|
+
this.elementRef.shadowRoot?.querySelector('slot')?.addEventListener('slotchange', this.handleSlotChange);
|
|
65
|
+
}
|
|
66
|
+
onRender() {
|
|
67
|
+
// Sync cards after every render (post-commit), so programmatic value/
|
|
68
|
+
// disabled changes — e.g. from a :formControl binding, setValue, or reset —
|
|
69
|
+
// are reflected on the slotted cards.
|
|
63
70
|
this.syncCards();
|
|
64
71
|
}
|
|
65
72
|
onDestroy() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.component.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dropdown/dropdown.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMzD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAMa,iBAAkB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IAClE,UAAU,EAAG,WAAW,CAAC;IAEhC,yCAAyC;IAClC,SAAS,EAAE,SAAS,CAAkB;IAE7C,yCAAyC;IAClC,MAAM,SAAK;IAElB,qCAAqC;IAC9B,KAAK,UAAS;IAErB,yBAAyB;IAClB,MAAM,UAAS;IAEtB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,kBAAkB,CAA6B;
|
|
1
|
+
{"version":3,"file":"dropdown.component.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dropdown/dropdown.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMzD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAMa,iBAAkB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IAClE,UAAU,EAAG,WAAW,CAAC;IAEhC,yCAAyC;IAClC,SAAS,EAAE,SAAS,CAAkB;IAE7C,yCAAyC;IAClC,MAAM,SAAK;IAElB,qCAAqC;IAC9B,KAAK,UAAS;IAErB,yBAAyB;IAClB,MAAM,UAAS;IAEtB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,kBAAkB,CAA6B;IAGvD,OAAO,CAAC,cAAc,CAAS;IAExB,QAAQ,IAAI,IAAI;IAUhB,SAAS,IAAI,IAAI;IAUxB,oBAAoB;IACb,IAAI,IAAI,IAAI;IAOnB,qBAAqB;IACd,KAAK,IAAI,IAAI;IAOpB,sBAAsB;IACf,MAAM,QAAO,IAAI,CAWtB;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAuB3B;IAEF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAW/B;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAwD5B;IAEF,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,SAAS;CAGjB"}
|
|
@@ -38,8 +38,17 @@ let DropdownComponent = class DropdownComponent {
|
|
|
38
38
|
this.isOpen = false;
|
|
39
39
|
this._focusedIndex = -1;
|
|
40
40
|
this._cleanupAutoUpdate = null;
|
|
41
|
+
// Set when the popover light-dismisses, consumed by the next toggle() so a
|
|
42
|
+
// click on the trigger that just dismissed the menu doesn't immediately reopen it.
|
|
43
|
+
this._justDismissed = false;
|
|
41
44
|
/** Toggle the menu */
|
|
42
45
|
this.toggle = () => {
|
|
46
|
+
// A click on the trigger that just light-dismissed the open menu would
|
|
47
|
+
// otherwise reopen it. Swallow that one toggle.
|
|
48
|
+
if (this._justDismissed) {
|
|
49
|
+
this._justDismissed = false;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
43
52
|
const menuEl = this.getMenuEl();
|
|
44
53
|
if (menuEl) {
|
|
45
54
|
menuEl.togglePopover();
|
|
@@ -55,6 +64,10 @@ let DropdownComponent = class DropdownComponent {
|
|
|
55
64
|
}
|
|
56
65
|
else {
|
|
57
66
|
this.isOpen = false;
|
|
67
|
+
// Guard the immediately-following trigger click (if this dismiss was
|
|
68
|
+
// caused by clicking the trigger). Cleared next macrotask otherwise.
|
|
69
|
+
this._justDismissed = true;
|
|
70
|
+
setTimeout(() => { this._justDismissed = false; }, 0);
|
|
58
71
|
this.clearFocus();
|
|
59
72
|
this._cleanupAutoUpdate?.();
|
|
60
73
|
this._cleanupAutoUpdate = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.component.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/popover/popover.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKzD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAMa,gBAAiB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IACjE,UAAU,EAAG,WAAW,CAAC;IAEhC,4CAA4C;IACrC,SAAS,EAAE,SAAS,CAAY;IAEvC,4CAA4C;IACrC,MAAM,SAAK;IAElB,0DAA0D;IACnD,MAAM,UAAS;IAEtB,wDAAwD;IACjD,KAAK,UAAS;IAErB,yBAAyB;IAClB,MAAM,UAAS;IAEtB,OAAO,CAAC,kBAAkB,CAA6B;
|
|
1
|
+
{"version":3,"file":"popover.component.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/popover/popover.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKzD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAMa,gBAAiB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IACjE,UAAU,EAAG,WAAW,CAAC;IAEhC,4CAA4C;IACrC,SAAS,EAAE,SAAS,CAAY;IAEvC,4CAA4C;IACrC,MAAM,SAAK;IAElB,0DAA0D;IACnD,MAAM,UAAS;IAEtB,wDAAwD;IACjD,KAAK,UAAS;IAErB,yBAAyB;IAClB,MAAM,UAAS;IAEtB,OAAO,CAAC,kBAAkB,CAA6B;IAGvD,OAAO,CAAC,cAAc,CAAS;IAExB,QAAQ,IAAI,IAAI;IAOhB,SAAS,IAAI,IAAI;IAQxB,uBAAuB;IAChB,IAAI,IAAI,IAAI;IAOnB,wBAAwB;IACjB,KAAK,IAAI,IAAI;IAOpB,yBAAyB;IAClB,MAAM,QAAO,IAAI,CAWtB;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAY3B;IAEF,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;CAGpB"}
|
|
@@ -43,8 +43,17 @@ let PopoverComponent = class PopoverComponent {
|
|
|
43
43
|
/** Current open state */
|
|
44
44
|
this.isOpen = false;
|
|
45
45
|
this._cleanupAutoUpdate = null;
|
|
46
|
+
// Set when the popover light-dismisses, consumed by the next toggle() so a
|
|
47
|
+
// click on the trigger that just dismissed it doesn't immediately reopen it.
|
|
48
|
+
this._justDismissed = false;
|
|
46
49
|
/** Toggle the popover */
|
|
47
50
|
this.toggle = () => {
|
|
51
|
+
// Swallow the click that just light-dismissed the open popover, so the
|
|
52
|
+
// trigger doesn't immediately reopen it.
|
|
53
|
+
if (this._justDismissed) {
|
|
54
|
+
this._justDismissed = false;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
48
57
|
const popoverEl = this.getPopoverEl();
|
|
49
58
|
if (popoverEl) {
|
|
50
59
|
popoverEl.togglePopover();
|
|
@@ -58,6 +67,8 @@ let PopoverComponent = class PopoverComponent {
|
|
|
58
67
|
}
|
|
59
68
|
else {
|
|
60
69
|
this.isOpen = false;
|
|
70
|
+
this._justDismissed = true;
|
|
71
|
+
setTimeout(() => { this._justDismissed = false; }, 0);
|
|
61
72
|
this._cleanupAutoUpdate?.();
|
|
62
73
|
this._cleanupAutoUpdate = null;
|
|
63
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/tooltip/tooltip.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"tooltip.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/tooltip/tooltip.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,iDAkFzB,CAAC"}
|
|
@@ -5,8 +5,10 @@ export const tooltipStyles = () => css `
|
|
|
5
5
|
--ml-tooltip-max-width: 320px;
|
|
6
6
|
--ml-tooltip-padding-y: var(--ml-space-2);
|
|
7
7
|
--ml-tooltip-padding-x: var(--ml-space-3);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/* bg/color derive from the global tooltip theme tokens; referencing
|
|
9
|
+
--ml-tooltip-bg here would be self-referential (invalid → transparent). */
|
|
10
|
+
--ml-tooltip-bg: var(--ml-color-neutral-900, var(--ml-gray-900));
|
|
11
|
+
--ml-tooltip-color: var(--ml-tooltip-text, var(--ml-white));
|
|
10
12
|
--ml-tooltip-font-size: var(--ml-text-xs);
|
|
11
13
|
--ml-tooltip-font-weight: var(--ml-font-medium);
|
|
12
14
|
--ml-tooltip-line-height: var(--ml-leading-snug);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-theme.function.d.ts","sourceRoot":"","sources":["../../../src/theme/functions/apply-theme.function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AAMvF;;GAEG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAEpC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"apply-theme.function.d.ts","sourceRoot":"","sources":["../../../src/theme/functions/apply-theme.function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AAMvF;;GAEG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAEpC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,GAAG,MAAM,CAQnD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAmCjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,IAAI,CAGvE;AAMD;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAGlC"}
|
|
@@ -12,6 +12,9 @@ export function getTheme() {
|
|
|
12
12
|
*/
|
|
13
13
|
export function getResolvedTheme() {
|
|
14
14
|
if (currentTheme === 'system') {
|
|
15
|
+
if (typeof window === 'undefined' || !window.matchMedia) {
|
|
16
|
+
return 'light';
|
|
17
|
+
}
|
|
15
18
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
16
19
|
}
|
|
17
20
|
return currentTheme;
|
|
@@ -27,6 +30,11 @@ export function applyTheme(theme) {
|
|
|
27
30
|
mediaQueryCleanup = null;
|
|
28
31
|
}
|
|
29
32
|
currentTheme = theme;
|
|
33
|
+
// No-op in non-browser environments (SSR / tests without a DOM).
|
|
34
|
+
if (typeof document === 'undefined' || typeof window === 'undefined' || !window.matchMedia) {
|
|
35
|
+
notifyListeners(theme, theme === 'dark' ? 'dark' : 'light');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
30
38
|
if (theme === 'system') {
|
|
31
39
|
// Listen for system preference changes
|
|
32
40
|
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
@@ -14,8 +14,9 @@ export declare function createTheme(name: string, overrides: TokenOverrides): st
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function injectTheme(name: string, overrides: TokenOverrides): HTMLStyleElement;
|
|
16
16
|
/**
|
|
17
|
-
* Create a brand theme
|
|
18
|
-
*
|
|
17
|
+
* Create a brand theme from semantic colors. Each color also generates matching
|
|
18
|
+
* hover/active/subtle variants so interaction states aren't left at the default
|
|
19
|
+
* (e.g. a purple primary no longer hovers blue).
|
|
19
20
|
*/
|
|
20
21
|
export declare function createBrandTheme(name: string, options: {
|
|
21
22
|
primary?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-theme.function.d.ts","sourceRoot":"","sources":["../../../src/theme/functions/create-theme.function.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,MAAM,CAM3E;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"create-theme.function.d.ts","sourceRoot":"","sources":["../../../src/theme/functions/create-theme.function.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,MAAM,CAM3E;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,gBAAgB,CAkBrF;AAcD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,GACC,MAAM,CAoBR"}
|
|
@@ -17,6 +17,9 @@ export function createTheme(name, overrides) {
|
|
|
17
17
|
* @returns Style element that was injected (can be removed to unload theme)
|
|
18
18
|
*/
|
|
19
19
|
export function injectTheme(name, overrides) {
|
|
20
|
+
if (typeof document === 'undefined') {
|
|
21
|
+
throw new Error('injectTheme requires a DOM (document is undefined).');
|
|
22
|
+
}
|
|
20
23
|
const css = createTheme(name, overrides);
|
|
21
24
|
const style = document.createElement('style');
|
|
22
25
|
style.id = `ml-theme-${name}`;
|
|
@@ -30,25 +33,37 @@ export function injectTheme(name, overrides) {
|
|
|
30
33
|
return style;
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
36
|
+
* Emit a base semantic color plus its -hover / -active / -subtle variants, so a
|
|
37
|
+
* brand theme stays visually consistent (components reference the variants for
|
|
38
|
+
* interaction states, not just the base).
|
|
39
|
+
*/
|
|
40
|
+
function setColorWithVariants(overrides, token, color) {
|
|
41
|
+
overrides[token] = color;
|
|
42
|
+
overrides[`${token}-hover`] = `color-mix(in srgb, ${color}, black 12%)`;
|
|
43
|
+
overrides[`${token}-active`] = `color-mix(in srgb, ${color}, black 22%)`;
|
|
44
|
+
overrides[`${token}-subtle`] = `color-mix(in srgb, ${color}, white 88%)`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a brand theme from semantic colors. Each color also generates matching
|
|
48
|
+
* hover/active/subtle variants so interaction states aren't left at the default
|
|
49
|
+
* (e.g. a purple primary no longer hovers blue).
|
|
35
50
|
*/
|
|
36
51
|
export function createBrandTheme(name, options) {
|
|
37
52
|
const overrides = {};
|
|
38
53
|
if (options.primary) {
|
|
39
|
-
overrides
|
|
54
|
+
setColorWithVariants(overrides, '--ml-color-primary', options.primary);
|
|
40
55
|
}
|
|
41
56
|
if (options.secondary) {
|
|
42
|
-
overrides
|
|
57
|
+
setColorWithVariants(overrides, '--ml-color-secondary', options.secondary);
|
|
43
58
|
}
|
|
44
59
|
if (options.success) {
|
|
45
|
-
overrides
|
|
60
|
+
setColorWithVariants(overrides, '--ml-color-success', options.success);
|
|
46
61
|
}
|
|
47
62
|
if (options.warning) {
|
|
48
|
-
overrides
|
|
63
|
+
setColorWithVariants(overrides, '--ml-color-warning', options.warning);
|
|
49
64
|
}
|
|
50
65
|
if (options.danger) {
|
|
51
|
-
overrides
|
|
66
|
+
setColorWithVariants(overrides, '--ml-color-danger', options.danger);
|
|
52
67
|
}
|
|
53
68
|
return createTheme(name, overrides);
|
|
54
69
|
}
|
|
@@ -94,7 +94,7 @@ export const darkThemeCss = `[data-theme="dark"] {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
@media (prefers-color-scheme: dark) {
|
|
97
|
-
:root:not([data-theme
|
|
97
|
+
:root:not([data-theme]) {
|
|
98
98
|
${Object.entries(darkTheme)
|
|
99
99
|
.map(([key, value]) => `${key}: ${value};`)
|
|
100
100
|
.join('\n\t\t')}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/virtual-scroll/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACpC,uGAAuG;IACvG,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,gDAAgD;IAChD,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;IACxB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,eAAe;IAC3B,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,eAAe,CAA+B;IACtD,OAAO,CAAC,QAAQ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