@melodicdev/components 1.6.7 → 1.6.9
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.js +6 -3
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +6 -4
- package/lib/components/data-display/table/table.component.d.ts +17 -0
- package/lib/components/data-display/table/table.component.d.ts.map +1 -1
- package/lib/components/data-display/table/table.component.js +19 -2
- package/lib/components/overlays/dialog/dialog.styles.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.styles.js +2 -1
- package/package.json +1 -1
|
@@ -12678,7 +12678,7 @@ EventTarget.prototype.addEventListener = function(e, t, r) {
|
|
|
12678
12678
|
};
|
|
12679
12679
|
var Qt = class {
|
|
12680
12680
|
constructor() {
|
|
12681
|
-
this._rowClickable = !1, this.hasFooter = !1, this.hasHeaderActions = !1, this.selectable = !1, this.striped = !1, this.hoverable = !0, this.stickyHeader = !1, this.size = "md", this.tableTitle = "", this.description = "", this.virtual = !1, this.columns = [], this.rows = [], this.sortKey = "", this.sortDirection = "asc", this.selectedIndices = [], this.startIndex = 0, this.endIndex = 50, this._scroller = new ea(), this._viewport = null, this.isRowSelected = (t) => this.selectedIndices.includes(t), this.handleSort = (t) => {
|
|
12681
|
+
this._rowClickable = !1, this.hasFooter = !1, this.hasHeaderActions = !1, this.selectable = !1, this.striped = !1, this.hoverable = !0, this.stickyHeader = !1, this.size = "md", this.tableTitle = "", this.description = "", this.virtual = !1, this.manualSort = !1, this.columns = [], this.rows = [], this.sortKey = "", this.sortDirection = "asc", this.selectedIndices = [], this.startIndex = 0, this.endIndex = 50, this._scroller = new ea(), this._viewport = null, this.isRowSelected = (t) => this.selectedIndices.includes(t), this.handleSort = (t) => {
|
|
12682
12682
|
t.sortable && (this.sortKey === t.key ? this.sortDirection = this.sortDirection === "asc" ? "desc" : "asc" : (this.sortKey = t.key, this.sortDirection = "asc"), this.selectedIndices = [], this._scroller.invalidate(), this.elementRef.dispatchEvent(new CustomEvent("ml:sort", {
|
|
12683
12683
|
bubbles: !0,
|
|
12684
12684
|
composed: !0,
|
|
@@ -12747,7 +12747,7 @@ var Qt = class {
|
|
|
12747
12747
|
}
|
|
12748
12748
|
/** Rows sorted by current sort key/direction */
|
|
12749
12749
|
get sortedRows() {
|
|
12750
|
-
if (!this.sortKey) return this.rows;
|
|
12750
|
+
if (this.manualSort || !this.sortKey) return this.rows;
|
|
12751
12751
|
const t = this.sortKey, r = this.sortDirection === "asc" ? 1 : -1;
|
|
12752
12752
|
return [...this.rows].sort((a, l) => {
|
|
12753
12753
|
const o = a[t], s = l[t];
|
|
@@ -12795,7 +12795,8 @@ Qt = v([f({
|
|
|
12795
12795
|
"table-title",
|
|
12796
12796
|
"description",
|
|
12797
12797
|
"sticky-header",
|
|
12798
|
-
"virtual"
|
|
12798
|
+
"virtual",
|
|
12799
|
+
"manual-sort"
|
|
12799
12800
|
]
|
|
12800
12801
|
})], Qt);
|
|
12801
12802
|
function ai(e, t, r) {
|
|
@@ -20701,7 +20702,7 @@ const bs = () => i`<dialog class="ml-dialog">
|
|
|
20701
20702
|
/* Dialog base */
|
|
20702
20703
|
dialog.ml-dialog {
|
|
20703
20704
|
position: fixed;
|
|
20704
|
-
display:
|
|
20705
|
+
display: none;
|
|
20705
20706
|
flex-direction: column;
|
|
20706
20707
|
width: 100%;
|
|
20707
20708
|
max-width: var(--ml-dialog-max-width);
|
|
@@ -20724,6 +20725,7 @@ const bs = () => i`<dialog class="ml-dialog">
|
|
|
20724
20725
|
}
|
|
20725
20726
|
|
|
20726
20727
|
dialog.ml-dialog[open] {
|
|
20728
|
+
display: flex;
|
|
20727
20729
|
transform: scale(1) translateY(0);
|
|
20728
20730
|
opacity: 1;
|
|
20729
20731
|
}
|
|
@@ -6,6 +6,16 @@ import type { TableColumn, SortDirection } from './table.types.js';
|
|
|
6
6
|
* @example
|
|
7
7
|
* ```html
|
|
8
8
|
* <ml-table .columns=${columns} .rows=${rows} striped hoverable></ml-table>
|
|
9
|
+
*
|
|
10
|
+
* <!-- Server-paginated: parent handles ordering -->
|
|
11
|
+
* <ml-table
|
|
12
|
+
* manual-sort
|
|
13
|
+
* .columns=${columns}
|
|
14
|
+
* .rows=${pageRows}
|
|
15
|
+
* .sortKey=${sortKey}
|
|
16
|
+
* .sortDirection=${sortDirection}
|
|
17
|
+
* @ml:sort=${handleSort}
|
|
18
|
+
* ></ml-table>
|
|
9
19
|
* ```
|
|
10
20
|
*
|
|
11
21
|
* @fires ml:sort - Emitted when a sortable column header is clicked. Detail: { key, direction }
|
|
@@ -39,6 +49,13 @@ export declare class TableComponent implements IElementRef, OnCreate, OnDestroy,
|
|
|
39
49
|
description: string;
|
|
40
50
|
/** Enable virtual scrolling (renders only visible rows) */
|
|
41
51
|
virtual: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Opt out of client-side row sorting. When true, `rows` is rendered in the
|
|
54
|
+
* order provided and `sortedRows` returns it untouched, but `sortKey` /
|
|
55
|
+
* `sortDirection` still update on header clicks and `ml:sort` still fires
|
|
56
|
+
* so the consumer can re-query the server with the new ordering.
|
|
57
|
+
*/
|
|
58
|
+
manualSort: boolean;
|
|
42
59
|
/** Column definitions */
|
|
43
60
|
columns: TableColumn[];
|
|
44
61
|
/** Row data */
|
|
@@ -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;AAiBnE
|
|
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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AM,IAAI,IAAI;IAId,QAAQ,IAAI,IAAI;IAgBhB,QAAQ,IAAI,IAAI;IAiBhB,SAAS,IAAI,IAAI;IAOxB,OAAO,CAAC,eAAe;IAgBvB,gDAAgD;IAChD,IAAW,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAcjD;IAED,IAAW,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAGlD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAGtC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,aAAa,GAAI,OAAO,MAAM,KAAG,OAAO,CAE7C;IAIK,UAAU,GAAI,QAAQ,WAAW,KAAG,IAAI,CAiB7C;IAEK,eAAe,QAAO,IAAI,CAO/B;IAEK,eAAe,GAAI,OAAO,MAAM,EAAE,OAAO,KAAK,KAAG,IAAI,CAQ1D;IAEK,cAAc,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,IAAI,CAQzE;IAEF,OAAO,CAAC,UAAU;CASlB"}
|
|
@@ -25,6 +25,16 @@ EventTarget.prototype.addEventListener = function (type, listener, options) {
|
|
|
25
25
|
* @example
|
|
26
26
|
* ```html
|
|
27
27
|
* <ml-table .columns=${columns} .rows=${rows} striped hoverable></ml-table>
|
|
28
|
+
*
|
|
29
|
+
* <!-- Server-paginated: parent handles ordering -->
|
|
30
|
+
* <ml-table
|
|
31
|
+
* manual-sort
|
|
32
|
+
* .columns=${columns}
|
|
33
|
+
* .rows=${pageRows}
|
|
34
|
+
* .sortKey=${sortKey}
|
|
35
|
+
* .sortDirection=${sortDirection}
|
|
36
|
+
* @ml:sort=${handleSort}
|
|
37
|
+
* ></ml-table>
|
|
28
38
|
* ```
|
|
29
39
|
*
|
|
30
40
|
* @fires ml:sort - Emitted when a sortable column header is clicked. Detail: { key, direction }
|
|
@@ -58,6 +68,13 @@ let TableComponent = class TableComponent {
|
|
|
58
68
|
this.description = '';
|
|
59
69
|
/** Enable virtual scrolling (renders only visible rows) */
|
|
60
70
|
this.virtual = false;
|
|
71
|
+
/**
|
|
72
|
+
* Opt out of client-side row sorting. When true, `rows` is rendered in the
|
|
73
|
+
* order provided and `sortedRows` returns it untouched, but `sortKey` /
|
|
74
|
+
* `sortDirection` still update on header clicks and `ml:sort` still fires
|
|
75
|
+
* so the consumer can re-query the server with the new ordering.
|
|
76
|
+
*/
|
|
77
|
+
this.manualSort = false;
|
|
61
78
|
/** Column definitions */
|
|
62
79
|
this.columns = [];
|
|
63
80
|
/** Row data */
|
|
@@ -192,7 +209,7 @@ let TableComponent = class TableComponent {
|
|
|
192
209
|
// ── Data ──────────────────────────────────────────────────────────────────────
|
|
193
210
|
/** Rows sorted by current sort key/direction */
|
|
194
211
|
get sortedRows() {
|
|
195
|
-
if (!this.sortKey)
|
|
212
|
+
if (this.manualSort || !this.sortKey)
|
|
196
213
|
return this.rows;
|
|
197
214
|
const key = this.sortKey;
|
|
198
215
|
const dir = this.sortDirection === 'asc' ? 1 : -1;
|
|
@@ -244,7 +261,7 @@ TableComponent = __decorate([
|
|
|
244
261
|
selector: 'ml-table',
|
|
245
262
|
template: tableTemplate,
|
|
246
263
|
styles: tableStyles,
|
|
247
|
-
attributes: ['selectable', 'striped', 'hoverable', 'size', 'table-title', 'description', 'sticky-header', 'virtual']
|
|
264
|
+
attributes: ['selectable', 'striped', 'hoverable', 'size', 'table-title', 'description', 'sticky-header', 'virtual', 'manual-sort']
|
|
248
265
|
})
|
|
249
266
|
], TableComponent);
|
|
250
267
|
export { TableComponent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dialog/dialog.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"dialog.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/overlays/dialog/dialog.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,iDA2NxB,CAAC"}
|
|
@@ -47,7 +47,7 @@ export const dialogStyles = () => css `
|
|
|
47
47
|
/* Dialog base */
|
|
48
48
|
dialog.ml-dialog {
|
|
49
49
|
position: fixed;
|
|
50
|
-
display:
|
|
50
|
+
display: none;
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
width: 100%;
|
|
53
53
|
max-width: var(--ml-dialog-max-width);
|
|
@@ -70,6 +70,7 @@ export const dialogStyles = () => css `
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
dialog.ml-dialog[open] {
|
|
73
|
+
display: flex;
|
|
73
74
|
transform: scale(1) translateY(0);
|
|
74
75
|
opacity: 1;
|
|
75
76
|
}
|