@livenetworks/ashlar 2.1.13 → 2.2.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/components/COMPONENTS.md +80 -80
- package/components/ln-api-connector/ln-api-connector.schema.json +105 -105
- package/components/ln-chart/ln-chart-dev.scss +0 -4
- package/components/ln-core/README.md +21 -21
- package/components/ln-core/ln-core.schema.json +120 -120
- package/components/ln-core/query.js +113 -113
- package/components/ln-data-coordinator/README.md +2 -0
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +196 -196
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +457 -432
- package/components/ln-data-store/ln-data-store.schema.json +92 -92
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/src/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/generated-attributes.js +304 -302
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-external-links/README.md +19 -19
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/ln-external-links.schema.json +9 -0
- package/components/ln-external-links/ln-external-links.scss +12 -0
- package/components/ln-external-links/src/ln-external-links.js +3 -2
- package/components/ln-filter/README.md +2 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +157 -169
- package/components/ln-filter/src/ln-filter.js +1 -3
- package/components/ln-form/ln-form.schema.json +57 -57
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-key/ln-key.schema.json +8 -0
- package/components/ln-key/src/ln-key.js +8 -5
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.schema.json +6 -0
- package/components/ln-obfuscator/src/ln-obfuscator.js +2 -2
- package/components/ln-options/ln-options.schema.json +47 -47
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-progress/ln-progress.schema.json +0 -13
- package/components/ln-search/ln-search.schema.json +111 -111
- package/components/ln-sort/README.md +1 -0
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sort/ln-sort.schema.json +100 -112
- package/components/ln-sort/src/sort-model.js +1 -6
- package/components/ln-sortable/ln-sortable.schema.json +38 -38
- package/components/ln-sortable/ln-sortable.scss +25 -25
- package/components/ln-table/README.md +8 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/ln-table.schema.json +195 -195
- package/components/ln-table/src/ln-table.js +43 -7
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +18 -0
- package/components/ln-table-coordinator/src/ln-table-coordinator.js +104 -2
- package/components/ln-toast/README.md +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toast/ln-toast.schema.json +6 -0
- package/components/ln-toast/src/ln-toast.js +1 -1
- package/components/ln-validate/README.md +6 -6
- package/components/ln-validate/ln-validate-dev.scss +0 -5
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/ln-validate.schema.json +0 -6
- package/components/ln-validate/src/ln-validate.js +48 -29
- package/ln-ashlar.html-data.json +1824 -1814
- package/package.json +95 -95
- package/theme/README.md +7 -6
- package/theme/base/_global.scss +2 -2
- package/theme/base/_reset.scss +11 -0
- package/theme/components/_app-shell.scss +0 -8
- package/theme/components/_form.scss +6 -6
- package/theme/components/_ln-table.scss +6 -3
- package/theme/components/_scrollbar.scss +5 -4
- package/theme/components/_sortable.scss +19 -19
- package/theme/components/_stat-card.scss +1 -0
- package/theme/components/_table.scss +10 -33
- package/theme/config/_density.scss +236 -104
- package/theme/config/_palette.scss +71 -49
- package/theme/config/_theme.scss +27 -31
- package/theme/config/_tokens.scss +28 -26
- package/theme/config/mixins/_app-shell.scss +17 -21
- package/theme/config/mixins/_btn.scss +4 -2
- package/theme/config/mixins/_card.scss +87 -67
- package/theme/config/mixins/_colors.scss +2 -1
- package/theme/config/mixins/_display.scss +12 -0
- package/theme/config/mixins/_footer.scss +3 -1
- package/theme/config/mixins/_form.scss +48 -16
- package/theme/config/mixins/_layout.scss +9 -0
- package/theme/config/mixins/_ln-table.scss +22 -15
- package/theme/config/mixins/_modal.scss +3 -0
- package/theme/config/mixins/_nav.scss +27 -4
- package/theme/config/mixins/_sidebar.scss +2 -1
- package/theme/config/mixins/_stat-card.scss +33 -2
- package/theme/config/mixins/_status-badge.scss +1 -0
- package/theme/config/mixins/_table.scss +81 -39
- package/theme/config/mixins/_tabs.scss +31 -0
- package/theme/config/mixins/_toast.scss +0 -1
- package/theme/designs/relaxed/_card.scss +12 -0
- package/theme/designs/relaxed/_layout.scss +24 -0
- package/theme/ln-ashlar-core.scss +1 -0
- package/theme/ln-ashlar-dev.scss +0 -1
- package/theme/ln-ashlar-relaxed.scss +67 -0
- package/theme/tailwind/components.css +561 -24
- package/theme/utilities/_utilities.scss +1 -11
- package/web-types.json +2351 -2337
- package/components/ln-progress/ln-progress-dev.scss +0 -8
|
@@ -1,195 +1,195 @@
|
|
|
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": "author",
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-table-dev.scss",
|
|
10
|
-
"src/ln-table.js"
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
"data-ln-sort": {
|
|
14
|
-
"direction": null,
|
|
15
|
-
"sources": [
|
|
16
|
-
"ln-table-dev.scss",
|
|
17
|
-
"ln-table.scss"
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
"data-ln-sort-icon": {
|
|
21
|
-
"direction": null,
|
|
22
|
-
"sources": [
|
|
23
|
-
"ln-table.scss"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"data-ln-table": {
|
|
27
|
-
"direction": null,
|
|
28
|
-
"sources": [
|
|
29
|
-
"ln-table-dev.scss",
|
|
30
|
-
"ln-table.scss",
|
|
31
|
-
"src/ln-table.js"
|
|
32
|
-
],
|
|
33
|
-
"type": "string",
|
|
34
|
-
"fallback": "",
|
|
35
|
-
"description": "Table instance name or identifier"
|
|
36
|
-
},
|
|
37
|
-
"data-ln-table-body": {
|
|
38
|
-
"direction": "author",
|
|
39
|
-
"sources": [
|
|
40
|
-
"src/ln-table.js"
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
"data-ln-table-cell-attr": {
|
|
44
|
-
"direction": "author",
|
|
45
|
-
"sources": [
|
|
46
|
-
"src/ln-table.js"
|
|
47
|
-
],
|
|
48
|
-
"type": "string",
|
|
49
|
-
"description": "Cell attribute template mapping"
|
|
50
|
-
},
|
|
51
|
-
"data-ln-table-col": {
|
|
52
|
-
"direction": "author",
|
|
53
|
-
"sources": [
|
|
54
|
-
"src/ln-table.js"
|
|
55
|
-
],
|
|
56
|
-
"type": "string",
|
|
57
|
-
"description": "Column header identifier or field mapping"
|
|
58
|
-
},
|
|
59
|
-
"data-ln-table-col-select": {
|
|
60
|
-
"direction": "author",
|
|
61
|
-
"sources": [
|
|
62
|
-
"src/ln-table.js"
|
|
63
|
-
],
|
|
64
|
-
"type": "trigger",
|
|
65
|
-
"description": "Header select-all checkbox trigger"
|
|
66
|
-
},
|
|
67
|
-
"data-ln-table-col-sort": {
|
|
68
|
-
"direction": null,
|
|
69
|
-
"sources": [
|
|
70
|
-
"ln-table-dev.scss"
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
"data-ln-table-dict": {
|
|
74
|
-
"direction": "author",
|
|
75
|
-
"sources": [
|
|
76
|
-
"src/ln-table.js"
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
"data-ln-table-empty": {
|
|
80
|
-
"direction": "
|
|
81
|
-
"sources": [
|
|
82
|
-
"src/ln-table.js"
|
|
83
|
-
],
|
|
84
|
-
"type": "marker",
|
|
85
|
-
"description": "Container for table empty state"
|
|
86
|
-
},
|
|
87
|
-
"data-ln-table-empty-when": {
|
|
88
|
-
"direction": "author",
|
|
89
|
-
"sources": [
|
|
90
|
-
"src/ln-table.js"
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
"data-ln-table-filtered": {
|
|
94
|
-
"direction": "author",
|
|
95
|
-
"sources": [
|
|
96
|
-
"src/ln-table.js"
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
"data-ln-table-loading": {
|
|
100
|
-
"direction": "author",
|
|
101
|
-
"sources": [
|
|
102
|
-
"src/ln-table.js"
|
|
103
|
-
],
|
|
104
|
-
"type": "marker",
|
|
105
|
-
"description": "Loading indicator element in footer or template"
|
|
106
|
-
},
|
|
107
|
-
"data-ln-table-row": {
|
|
108
|
-
"direction": "author",
|
|
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": "author",
|
|
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-template": {
|
|
183
|
-
"direction": null,
|
|
184
|
-
"sources": [
|
|
185
|
-
"src/ln-table.js"
|
|
186
|
-
]
|
|
187
|
-
},
|
|
188
|
-
"data-ln-value": {
|
|
189
|
-
"direction": "runtime",
|
|
190
|
-
"sources": [
|
|
191
|
-
"src/ln-table.js"
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
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": "author",
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-table-dev.scss",
|
|
10
|
+
"src/ln-table.js"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"data-ln-sort": {
|
|
14
|
+
"direction": null,
|
|
15
|
+
"sources": [
|
|
16
|
+
"ln-table-dev.scss",
|
|
17
|
+
"ln-table.scss"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"data-ln-sort-icon": {
|
|
21
|
+
"direction": null,
|
|
22
|
+
"sources": [
|
|
23
|
+
"ln-table.scss"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"data-ln-table": {
|
|
27
|
+
"direction": null,
|
|
28
|
+
"sources": [
|
|
29
|
+
"ln-table-dev.scss",
|
|
30
|
+
"ln-table.scss",
|
|
31
|
+
"src/ln-table.js"
|
|
32
|
+
],
|
|
33
|
+
"type": "string",
|
|
34
|
+
"fallback": "",
|
|
35
|
+
"description": "Table instance name or identifier"
|
|
36
|
+
},
|
|
37
|
+
"data-ln-table-body": {
|
|
38
|
+
"direction": "author",
|
|
39
|
+
"sources": [
|
|
40
|
+
"src/ln-table.js"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"data-ln-table-cell-attr": {
|
|
44
|
+
"direction": "author",
|
|
45
|
+
"sources": [
|
|
46
|
+
"src/ln-table.js"
|
|
47
|
+
],
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "Cell attribute template mapping"
|
|
50
|
+
},
|
|
51
|
+
"data-ln-table-col": {
|
|
52
|
+
"direction": "author",
|
|
53
|
+
"sources": [
|
|
54
|
+
"src/ln-table.js"
|
|
55
|
+
],
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "Column header identifier or field mapping"
|
|
58
|
+
},
|
|
59
|
+
"data-ln-table-col-select": {
|
|
60
|
+
"direction": "author",
|
|
61
|
+
"sources": [
|
|
62
|
+
"src/ln-table.js"
|
|
63
|
+
],
|
|
64
|
+
"type": "trigger",
|
|
65
|
+
"description": "Header select-all checkbox trigger"
|
|
66
|
+
},
|
|
67
|
+
"data-ln-table-col-sort": {
|
|
68
|
+
"direction": null,
|
|
69
|
+
"sources": [
|
|
70
|
+
"ln-table-dev.scss"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"data-ln-table-dict": {
|
|
74
|
+
"direction": "author",
|
|
75
|
+
"sources": [
|
|
76
|
+
"src/ln-table.js"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"data-ln-table-empty": {
|
|
80
|
+
"direction": "both",
|
|
81
|
+
"sources": [
|
|
82
|
+
"src/ln-table.js"
|
|
83
|
+
],
|
|
84
|
+
"type": "marker",
|
|
85
|
+
"description": "Container for table empty state"
|
|
86
|
+
},
|
|
87
|
+
"data-ln-table-empty-when": {
|
|
88
|
+
"direction": "author",
|
|
89
|
+
"sources": [
|
|
90
|
+
"src/ln-table.js"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"data-ln-table-filtered": {
|
|
94
|
+
"direction": "author",
|
|
95
|
+
"sources": [
|
|
96
|
+
"src/ln-table.js"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"data-ln-table-loading": {
|
|
100
|
+
"direction": "author",
|
|
101
|
+
"sources": [
|
|
102
|
+
"src/ln-table.js"
|
|
103
|
+
],
|
|
104
|
+
"type": "marker",
|
|
105
|
+
"description": "Loading indicator element in footer or template"
|
|
106
|
+
},
|
|
107
|
+
"data-ln-table-row": {
|
|
108
|
+
"direction": "author",
|
|
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": "author",
|
|
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-template": {
|
|
183
|
+
"direction": null,
|
|
184
|
+
"sources": [
|
|
185
|
+
"src/ln-table.js"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"data-ln-value": {
|
|
189
|
+
"direction": "runtime",
|
|
190
|
+
"sources": [
|
|
191
|
+
"src/ln-table.js"
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -113,6 +113,9 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
113
113
|
this._vEnd = -1;
|
|
114
114
|
this._rafId = null;
|
|
115
115
|
this._scrollHandler = null;
|
|
116
|
+
this._resizeHandler = null;
|
|
117
|
+
this._vResized = false;
|
|
118
|
+
this._vTop = 0;
|
|
116
119
|
this._scrollContainer = null;
|
|
117
120
|
this._colgroup = null;
|
|
118
121
|
this._rowPool = null;
|
|
@@ -479,6 +482,8 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
479
482
|
|
|
480
483
|
_component.prototype._lockColumnWidths = function () {
|
|
481
484
|
if (!this.table || !this.thead || this._colgroup) return;
|
|
485
|
+
// Header row has no box (card mode, hidden ancestor): don't lock 0px columns; retried on resize.
|
|
486
|
+
if (this.ths.length && !this.ths[0].offsetWidth) return;
|
|
482
487
|
|
|
483
488
|
const colgroup = document.createElement('colgroup');
|
|
484
489
|
this.ths.forEach(function (th) {
|
|
@@ -618,8 +623,16 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
618
623
|
});
|
|
619
624
|
};
|
|
620
625
|
|
|
626
|
+
// Resize shares the scroll rAF; the flag scopes re-measuring to resize frames.
|
|
627
|
+
// A lock deferred while the header row had no box happens here, before the re-measure.
|
|
628
|
+
this._resizeHandler = function () {
|
|
629
|
+
self._lockColumnWidths();
|
|
630
|
+
self._vResized = true;
|
|
631
|
+
self._scrollHandler();
|
|
632
|
+
};
|
|
633
|
+
|
|
621
634
|
scrollTarget.addEventListener('scroll', this._scrollHandler, { passive: true });
|
|
622
|
-
window.addEventListener('resize', this.
|
|
635
|
+
window.addEventListener('resize', this._resizeHandler, { passive: true });
|
|
623
636
|
};
|
|
624
637
|
|
|
625
638
|
_component.prototype._disableVirtualScroll = function () {
|
|
@@ -629,8 +642,9 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
629
642
|
if (this._scrollHandler) {
|
|
630
643
|
const scrollTarget = this._scrollContainer || window;
|
|
631
644
|
scrollTarget.removeEventListener('scroll', this._scrollHandler);
|
|
632
|
-
window.removeEventListener('resize', this.
|
|
645
|
+
window.removeEventListener('resize', this._resizeHandler);
|
|
633
646
|
this._scrollHandler = null;
|
|
647
|
+
this._resizeHandler = null;
|
|
634
648
|
}
|
|
635
649
|
this._scrollContainer = null;
|
|
636
650
|
if (this._rafId) {
|
|
@@ -835,8 +849,7 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
835
849
|
_component.prototype._renderVirtual = function () {
|
|
836
850
|
const data = this._filteredData;
|
|
837
851
|
const total = data.length;
|
|
838
|
-
|
|
839
|
-
if (!rowH || !total) return;
|
|
852
|
+
if (!this._rowHeight || !total) return;
|
|
840
853
|
|
|
841
854
|
const theadH = this.thead ? this.thead.offsetHeight : 0;
|
|
842
855
|
const sc = this._scrollContainer;
|
|
@@ -857,7 +870,25 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
857
870
|
viewportH = window.innerHeight;
|
|
858
871
|
}
|
|
859
872
|
|
|
860
|
-
|
|
873
|
+
// After a resize a media query may have restyled rows (e.g. stacked cards):
|
|
874
|
+
// re-measure the rendered block's pitch (read before any write) and keep the
|
|
875
|
+
// record that was at the viewport top in place.
|
|
876
|
+
let target = scrollIntoData;
|
|
877
|
+
if (this._vResized) {
|
|
878
|
+
this._vResized = false;
|
|
879
|
+
const n = this._vEnd - this._vStart;
|
|
880
|
+
const last = this._rowPool && this._rowPool[n - 1];
|
|
881
|
+
const pitch = last ? (last.getBoundingClientRect().bottom - this._rowPool[0].getBoundingClientRect().top) / n : 0;
|
|
882
|
+
if (pitch && pitch !== this._rowHeight) {
|
|
883
|
+
this._rowHeight = pitch;
|
|
884
|
+
this._vStart = -1;
|
|
885
|
+
if (this._vTop > 0) target = this._vTop * pitch;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
const rowH = this._rowHeight;
|
|
889
|
+
this._vTop = target / rowH;
|
|
890
|
+
|
|
891
|
+
const vw = calculateVirtualWindow(target, viewportH, rowH, total, BUFFER_ROWS);
|
|
861
892
|
const startRow = vw.start;
|
|
862
893
|
const endRow = vw.end;
|
|
863
894
|
|
|
@@ -911,6 +942,11 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
911
942
|
}
|
|
912
943
|
|
|
913
944
|
if (this._selectable) this._updateSelectAll();
|
|
945
|
+
|
|
946
|
+
if (target !== scrollIntoData) {
|
|
947
|
+
if (sc) sc.scrollTop += target - scrollIntoData;
|
|
948
|
+
else window.scrollTo(window.scrollX, window.scrollY + target - scrollIntoData);
|
|
949
|
+
}
|
|
914
950
|
};
|
|
915
951
|
|
|
916
952
|
|
|
@@ -944,13 +980,13 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
944
980
|
td.setAttribute('colspan', String(colSpan));
|
|
945
981
|
td.appendChild(clone);
|
|
946
982
|
const tr = document.createElement('tr');
|
|
947
|
-
tr.className = 'table-empty ln-table__empty';
|
|
948
983
|
tr.appendChild(td);
|
|
949
984
|
loadingEl = tr;
|
|
950
985
|
}
|
|
951
986
|
}
|
|
952
987
|
|
|
953
988
|
if (loadingEl) {
|
|
989
|
+
loadingEl.setAttribute('data-ln-table-empty', '');
|
|
954
990
|
this.tbody.replaceChildren(loadingEl);
|
|
955
991
|
} else {
|
|
956
992
|
this.tbody.replaceChildren();
|
|
@@ -1011,13 +1047,13 @@ import { calculateSelectionState, calculateVirtualWindow, calculatePoolSize, tog
|
|
|
1011
1047
|
td.setAttribute('colspan', String(colSpan));
|
|
1012
1048
|
td.appendChild(clone);
|
|
1013
1049
|
const tr = document.createElement('tr');
|
|
1014
|
-
tr.className = 'ln-table__empty';
|
|
1015
1050
|
tr.appendChild(td);
|
|
1016
1051
|
emptyEl = tr;
|
|
1017
1052
|
}
|
|
1018
1053
|
}
|
|
1019
1054
|
|
|
1020
1055
|
if (emptyEl) {
|
|
1056
|
+
emptyEl.setAttribute('data-ln-table-empty', '');
|
|
1021
1057
|
this.tbody.replaceChildren(emptyEl);
|
|
1022
1058
|
} else {
|
|
1023
1059
|
this.tbody.replaceChildren();
|