@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
|
@@ -4,17 +4,19 @@ export class VirtualScroller {
|
|
|
4
4
|
this._resizeObserver = null;
|
|
5
5
|
this._options = null;
|
|
6
6
|
this._handleScroll = () => {
|
|
7
|
-
this._compute(
|
|
7
|
+
this._compute();
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
/** Attach to a scrollable viewport element and begin observing */
|
|
11
11
|
attach(viewport, options) {
|
|
12
12
|
this._viewport = viewport;
|
|
13
13
|
this._options = options;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
// Recompute on resize. We deliberately read clientHeight inside _compute
|
|
15
|
+
// (not entry.contentRect.height) so resize, scroll, and invalidate all use
|
|
16
|
+
// the same height definition — contentRect excludes padding, clientHeight
|
|
17
|
+
// includes it, and mixing them shifted the visible range by a row.
|
|
18
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
19
|
+
this._compute();
|
|
18
20
|
});
|
|
19
21
|
this._resizeObserver.observe(viewport);
|
|
20
22
|
viewport.addEventListener('scroll', this._handleScroll);
|
|
@@ -31,11 +33,9 @@ export class VirtualScroller {
|
|
|
31
33
|
}
|
|
32
34
|
/** Call after item count or row height changes (e.g. after sort/filter/page change) */
|
|
33
35
|
invalidate() {
|
|
34
|
-
|
|
35
|
-
return;
|
|
36
|
-
this._compute(this._viewport.clientHeight);
|
|
36
|
+
this._compute();
|
|
37
37
|
}
|
|
38
|
-
_compute(
|
|
38
|
+
_compute() {
|
|
39
39
|
if (!this._viewport || !this._options)
|
|
40
40
|
return;
|
|
41
41
|
const { rowHeight, itemCount, onUpdate, enabled, buffer = 3 } = this._options;
|
|
@@ -44,6 +44,7 @@ export class VirtualScroller {
|
|
|
44
44
|
onUpdate(0, count);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
+
const viewportHeight = this._viewport.clientHeight;
|
|
47
48
|
const scrollTop = this._viewport.scrollTop;
|
|
48
49
|
const rowH = rowHeight();
|
|
49
50
|
const newStart = Math.max(0, Math.floor(scrollTop / rowH) - buffer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melodicdev/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Themeable UI component library built on the Melodic Framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Melodic Development",
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
"generate:icon-map": "node scripts/generate-icon-map.mjs"
|
|
278
278
|
},
|
|
279
279
|
"peerDependencies": {
|
|
280
|
-
"@melodicdev/core": "^
|
|
280
|
+
"@melodicdev/core": "^2.0.0"
|
|
281
281
|
},
|
|
282
282
|
"devDependencies": {
|
|
283
283
|
"typescript": "~5.9.3",
|