@livenetworks/ashlar 2.1.5 → 2.1.7

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,211 +1,211 @@
1
- {
2
- "$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
3
- "component": "ln-table",
4
- "generator": "scripts/sync-ln-schemas.mjs",
5
- "attributes": {
6
- "data-ln-debug": {
7
- "direction": null,
8
- "sources": [
9
- "ln-table-dev.scss"
10
- ]
11
- },
12
- "data-ln-sort": {
13
- "direction": null,
14
- "sources": [
15
- "ln-table-dev.scss",
16
- "ln-table.scss"
17
- ]
18
- },
19
- "data-ln-sort-icon": {
20
- "direction": null,
21
- "sources": [
22
- "ln-table.scss"
23
- ]
24
- },
25
- "data-ln-table": {
26
- "direction": null,
27
- "sources": [
28
- "ln-table-dev.scss",
29
- "ln-table.scss",
30
- "src/ln-table.js"
31
- ],
32
- "type": "string",
33
- "fallback": "",
34
- "description": "Table instance name or identifier"
35
- },
36
- "data-ln-table-body": {
37
- "direction": "author",
38
- "sources": [
39
- "src/ln-table.js"
40
- ]
41
- },
42
- "data-ln-table-cell-attr": {
43
- "direction": "author",
44
- "sources": [
45
- "src/ln-table.js"
46
- ],
47
- "type": "string",
48
- "description": "Cell attribute template mapping"
49
- },
50
- "data-ln-table-col": {
51
- "direction": "author",
52
- "sources": [
53
- "src/ln-table.js"
54
- ],
55
- "type": "string",
56
- "description": "Column header identifier or field mapping"
57
- },
58
- "data-ln-table-col-select": {
59
- "direction": "author",
60
- "sources": [
61
- "src/ln-table.js"
62
- ],
63
- "type": "trigger",
64
- "description": "Header select-all checkbox trigger"
65
- },
66
- "data-ln-table-col-sort": {
67
- "direction": null,
68
- "sources": [
69
- "ln-table-dev.scss"
70
- ]
71
- },
72
- "data-ln-table-count": {
73
- "direction": "author",
74
- "sources": [
75
- "src/ln-table.js"
76
- ],
77
- "type": "integer",
78
- "min": 0,
79
- "description": "Total record count override for virtual scrollbar calculation"
80
- },
81
- "data-ln-table-dict": {
82
- "direction": "author",
83
- "sources": [
84
- "src/ln-table.js"
85
- ]
86
- },
87
- "data-ln-table-empty": {
88
- "direction": "author",
89
- "sources": [
90
- "src/ln-table.js"
91
- ],
92
- "type": "marker",
93
- "description": "Container for table empty state"
94
- },
95
- "data-ln-table-empty-when": {
96
- "direction": "author",
97
- "sources": [
98
- "src/ln-table.js"
99
- ]
100
- },
101
- "data-ln-table-filtered": {
102
- "direction": "author",
103
- "sources": [
104
- "src/ln-table.js"
105
- ]
106
- },
107
- "data-ln-table-row": {
108
- "direction": "both",
109
- "sources": [
110
- "src/ln-table.js"
111
- ],
112
- "type": "marker",
113
- "description": "Table row template element"
114
- },
115
- "data-ln-table-row-action": {
116
- "direction": "author",
117
- "sources": [
118
- "src/ln-table.js"
119
- ],
120
- "type": "trigger",
121
- "description": "Action trigger inside a table row"
122
- },
123
- "data-ln-table-row-id": {
124
- "direction": "both",
125
- "sources": [
126
- "src/ln-table.js"
127
- ],
128
- "type": "string",
129
- "description": "Record identifier on row element"
130
- },
131
- "data-ln-table-row-select": {
132
- "direction": "both",
133
- "sources": [
134
- "src/ln-table.js"
135
- ],
136
- "type": "trigger",
137
- "description": "Row selection checkbox trigger"
138
- },
139
- "data-ln-table-select-all-label": {
140
- "direction": "author",
141
- "sources": [
142
- "src/ln-table.js"
143
- ],
144
- "type": "string",
145
- "description": "Accessibility label for select-all header trigger"
146
- },
147
- "data-ln-table-selectable": {
148
- "direction": null,
149
- "sources": [
150
- "src/ln-table.js"
151
- ],
152
- "type": "boolean",
153
- "description": "Enables row selection check controls"
154
- },
155
- "data-ln-table-selected": {
156
- "direction": "author",
157
- "sources": [
158
- "src/ln-table.js"
159
- ]
160
- },
161
- "data-ln-table-sort": {
162
- "direction": null,
163
- "sources": [
164
- "ln-table-dev.scss"
165
- ]
166
- },
167
- "data-ln-table-source": {
168
- "direction": "author",
169
- "sources": [
170
- "src/ln-table.js"
171
- ],
172
- "type": "string",
173
- "fallback": "",
174
- "description": "Source store or coordinator addressing"
175
- },
176
- "data-ln-table-total": {
177
- "direction": "author",
178
- "sources": [
179
- "src/ln-table.js"
180
- ]
181
- },
182
- "data-ln-table-window": {
183
- "direction": "author",
184
- "sources": [
185
- "src/ln-table.js"
186
- ],
187
- "type": "integer",
188
- "min": 10,
189
- "description": "Virtual scrolling window size in rows"
190
- },
191
- "data-ln-table-window-page": {
192
- "direction": "author",
193
- "sources": [
194
- "src/ln-table.js"
195
- ],
196
- "type": "integer",
197
- "min": 5,
198
- "description": "Virtual scrolling slice page size"
199
- },
200
- "data-ln-table-window-threshold": {
201
- "direction": "author",
202
- "sources": [
203
- "src/ln-table.js"
204
- ],
205
- "type": "integer",
206
- "fallback": 50,
207
- "min": 0,
208
- "description": "Scroll threshold margin in pixels to trigger page fetch"
209
- }
210
- }
211
- }
1
+ {
2
+ "$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
3
+ "component": "ln-table",
4
+ "generator": "scripts/sync-ln-schemas.mjs",
5
+ "attributes": {
6
+ "data-ln-debug": {
7
+ "direction": null,
8
+ "sources": [
9
+ "ln-table-dev.scss"
10
+ ]
11
+ },
12
+ "data-ln-sort": {
13
+ "direction": null,
14
+ "sources": [
15
+ "ln-table-dev.scss",
16
+ "ln-table.scss"
17
+ ]
18
+ },
19
+ "data-ln-sort-icon": {
20
+ "direction": null,
21
+ "sources": [
22
+ "ln-table.scss"
23
+ ]
24
+ },
25
+ "data-ln-table": {
26
+ "direction": null,
27
+ "sources": [
28
+ "ln-table-dev.scss",
29
+ "ln-table.scss",
30
+ "src/ln-table.js"
31
+ ],
32
+ "type": "string",
33
+ "fallback": "",
34
+ "description": "Table instance name or identifier"
35
+ },
36
+ "data-ln-table-body": {
37
+ "direction": "author",
38
+ "sources": [
39
+ "src/ln-table.js"
40
+ ]
41
+ },
42
+ "data-ln-table-cell-attr": {
43
+ "direction": "author",
44
+ "sources": [
45
+ "src/ln-table.js"
46
+ ],
47
+ "type": "string",
48
+ "description": "Cell attribute template mapping"
49
+ },
50
+ "data-ln-table-col": {
51
+ "direction": "author",
52
+ "sources": [
53
+ "src/ln-table.js"
54
+ ],
55
+ "type": "string",
56
+ "description": "Column header identifier or field mapping"
57
+ },
58
+ "data-ln-table-col-select": {
59
+ "direction": "author",
60
+ "sources": [
61
+ "src/ln-table.js"
62
+ ],
63
+ "type": "trigger",
64
+ "description": "Header select-all checkbox trigger"
65
+ },
66
+ "data-ln-table-col-sort": {
67
+ "direction": null,
68
+ "sources": [
69
+ "ln-table-dev.scss"
70
+ ]
71
+ },
72
+ "data-ln-table-count": {
73
+ "direction": "author",
74
+ "sources": [
75
+ "src/ln-table.js"
76
+ ],
77
+ "type": "integer",
78
+ "min": 0,
79
+ "description": "Total record count override for virtual scrollbar calculation"
80
+ },
81
+ "data-ln-table-dict": {
82
+ "direction": "author",
83
+ "sources": [
84
+ "src/ln-table.js"
85
+ ]
86
+ },
87
+ "data-ln-table-empty": {
88
+ "direction": "author",
89
+ "sources": [
90
+ "src/ln-table.js"
91
+ ],
92
+ "type": "marker",
93
+ "description": "Container for table empty state"
94
+ },
95
+ "data-ln-table-empty-when": {
96
+ "direction": "author",
97
+ "sources": [
98
+ "src/ln-table.js"
99
+ ]
100
+ },
101
+ "data-ln-table-filtered": {
102
+ "direction": "author",
103
+ "sources": [
104
+ "src/ln-table.js"
105
+ ]
106
+ },
107
+ "data-ln-table-row": {
108
+ "direction": "both",
109
+ "sources": [
110
+ "src/ln-table.js"
111
+ ],
112
+ "type": "marker",
113
+ "description": "Table row template element"
114
+ },
115
+ "data-ln-table-row-action": {
116
+ "direction": "author",
117
+ "sources": [
118
+ "src/ln-table.js"
119
+ ],
120
+ "type": "trigger",
121
+ "description": "Action trigger inside a table row"
122
+ },
123
+ "data-ln-table-row-id": {
124
+ "direction": "both",
125
+ "sources": [
126
+ "src/ln-table.js"
127
+ ],
128
+ "type": "string",
129
+ "description": "Record identifier on row element"
130
+ },
131
+ "data-ln-table-row-select": {
132
+ "direction": "both",
133
+ "sources": [
134
+ "src/ln-table.js"
135
+ ],
136
+ "type": "trigger",
137
+ "description": "Row selection checkbox trigger"
138
+ },
139
+ "data-ln-table-select-all-label": {
140
+ "direction": "author",
141
+ "sources": [
142
+ "src/ln-table.js"
143
+ ],
144
+ "type": "string",
145
+ "description": "Accessibility label for select-all header trigger"
146
+ },
147
+ "data-ln-table-selectable": {
148
+ "direction": null,
149
+ "sources": [
150
+ "src/ln-table.js"
151
+ ],
152
+ "type": "boolean",
153
+ "description": "Enables row selection check controls"
154
+ },
155
+ "data-ln-table-selected": {
156
+ "direction": "author",
157
+ "sources": [
158
+ "src/ln-table.js"
159
+ ]
160
+ },
161
+ "data-ln-table-sort": {
162
+ "direction": null,
163
+ "sources": [
164
+ "ln-table-dev.scss"
165
+ ]
166
+ },
167
+ "data-ln-table-source": {
168
+ "direction": "author",
169
+ "sources": [
170
+ "src/ln-table.js"
171
+ ],
172
+ "type": "string",
173
+ "fallback": "",
174
+ "description": "Source store or coordinator addressing"
175
+ },
176
+ "data-ln-table-total": {
177
+ "direction": "author",
178
+ "sources": [
179
+ "src/ln-table.js"
180
+ ]
181
+ },
182
+ "data-ln-table-window": {
183
+ "direction": "author",
184
+ "sources": [
185
+ "src/ln-table.js"
186
+ ],
187
+ "type": "integer",
188
+ "min": 10,
189
+ "description": "Virtual scrolling window size in rows"
190
+ },
191
+ "data-ln-table-window-page": {
192
+ "direction": "author",
193
+ "sources": [
194
+ "src/ln-table.js"
195
+ ],
196
+ "type": "integer",
197
+ "min": 5,
198
+ "description": "Virtual scrolling slice page size"
199
+ },
200
+ "data-ln-table-window-threshold": {
201
+ "direction": "author",
202
+ "sources": [
203
+ "src/ln-table.js"
204
+ ],
205
+ "type": "integer",
206
+ "fallback": 50,
207
+ "min": 0,
208
+ "description": "Scroll threshold margin in pixels to trigger page fetch"
209
+ }
210
+ }
211
+ }
@@ -291,8 +291,14 @@ import { calculateSelectionState, calculateVirtualWindow, toggleRowSelection, to
291
291
  // The source owns the query, so a query change reaches the view as a
292
292
  // restart order, not as query state — the window drops to page 0 and
293
293
  // the composed query is resolved at serve time.
294
- this._onRequestInvalidate = function () {
294
+ this._onRequestInvalidate = function (e) {
295
295
  if (!self._windowed || !self._cache) return;
296
+ if (e && e.detail && e.detail.query) {
297
+ const q = e.detail.query;
298
+ if (q.search !== undefined) self.currentSearch = q.search;
299
+ if (q.filters !== undefined) self.currentFilters = q.filters;
300
+ if (q.sort !== undefined) self.currentSort = q.sort;
301
+ }
296
302
  self._requestData();
297
303
  };
298
304
  dom.addEventListener('ln-table:request-invalidate', this._onRequestInvalidate);
@@ -359,17 +365,20 @@ import { calculateSelectionState, calculateVirtualWindow, toggleRowSelection, to
359
365
  this._parseRows();
360
366
  }
361
367
 
362
- // Initial request-data
363
- if (this._windowed) {
364
- this._kickWindowInitial();
365
- } else {
366
- dispatch(dom, 'ln-table:request-data', {
367
- table: this.name,
368
- sort: this.currentSort,
369
- filters: this.currentFilters,
370
- search: this.currentSearch
371
- });
372
- }
368
+ // Initial request-data deferred so coordinators have attached listeners
369
+ setTimeout(function () {
370
+ if (!self.dom || !document.contains(self.dom)) return;
371
+ if (self._windowed) {
372
+ self._kickWindowInitial();
373
+ } else {
374
+ dispatch(dom, 'ln-table:request-data', {
375
+ table: self.name,
376
+ sort: self.currentSort,
377
+ filters: self.currentFilters,
378
+ search: self.currentSearch
379
+ });
380
+ }
381
+ }, 0);
373
382
 
374
383
  } else {
375
384
  // SSR Mode
@@ -814,6 +823,8 @@ import { calculateSelectionState, calculateVirtualWindow, toggleRowSelection, to
814
823
  const startRow = vw.start;
815
824
  const endRow = vw.end;
816
825
 
826
+ if (startRow === this._vStart && endRow === this._vEnd) return;
827
+
817
828
  const colSpan = this.ths.length || 1;
818
829
  const topH = vw.topPadding;
819
830
  const bottomH = vw.bottomPadding;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livenetworks/ashlar",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "LiveNetworks unified frontend library - CSS framework and vanilla JS components",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Live Networks",
@@ -52,7 +52,7 @@
52
52
  border-spacing: 0;
53
53
  border-radius: 0;
54
54
  box-shadow: none;
55
- table-layout: auto !important;
55
+ table-layout: var(--table-layout, auto);
56
56
  min-width: var(--table-min-width, 768px);
57
57
  }
58
58
 
@@ -61,6 +61,8 @@
61
61
  // so per-th radius is unnecessary.
62
62
  thead {
63
63
  @include sticky-top;
64
+ will-change: transform;
65
+ transform: translateZ(0);
64
66
  }
65
67
 
66
68
  thead th {
@@ -198,6 +200,8 @@
198
200
  position: sticky;
199
201
  bottom: 0;
200
202
  z-index: var(--z-sticky);
203
+ will-change: transform;
204
+ transform: translateZ(0);
201
205
 
202
206
  strong {
203
207
  color: var(--color-fg);
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@livenetworks/ashlar",
4
- "version": "2.1.5",
4
+ "version": "2.1.7",
5
5
  "framework": "html",
6
6
  "contributions": {
7
7
  "html": {