@lavalogic/scoria 0.37.40 → 0.37.42
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.
|
@@ -74,10 +74,18 @@ function makeSpec(kind, def, internals = {}) {
|
|
|
74
74
|
* to roughly match what the legacy `<table>` element produced via the
|
|
75
75
|
* browser auto-layout algorithm for typical FloWMS column content. */
|
|
76
76
|
const KIND_DEFAULT_WIDTHS = {
|
|
77
|
-
text:
|
|
78
|
-
|
|
77
|
+
text: 180,
|
|
78
|
+
// Bumped from 100 → 120 so 7-8 digit IDs / quantities (e.g. shipment
|
|
79
|
+
// IDs, order IDs) fit cleanly alongside the sort / filter affordances
|
|
80
|
+
// without forcing the value to truncate or wrap.
|
|
81
|
+
number: 120,
|
|
79
82
|
checkbox: 80,
|
|
80
|
-
|
|
83
|
+
// Bumped from 140 → 180 so the formatted "DD/MM/YYYY HH:mm" string
|
|
84
|
+
// fits inside the cell. The legacy 140px floor cut off the time
|
|
85
|
+
// portion for the typical date format used across FloWMS pages and
|
|
86
|
+
// forced every consumer to set a per-column `width` override (see
|
|
87
|
+
// OrderManagement, which had to pin date columns at 210).
|
|
88
|
+
date: 180,
|
|
81
89
|
select: 160,
|
|
82
90
|
query: 160,
|
|
83
91
|
display: 150,
|
|
@@ -56,6 +56,15 @@ const PORTAL_Z_INDEX = 99998;
|
|
|
56
56
|
* inside their fixed-height box.
|
|
57
57
|
*/
|
|
58
58
|
const FLIP_THRESHOLD_PX = 240;
|
|
59
|
+
/**
|
|
60
|
+
* Hard cap on the dropdown's open height, regardless of how much
|
|
61
|
+
* vertical space the trigger leaves between itself and the viewport
|
|
62
|
+
* edge. Matches Svelecte's own `--sv-dropdown-height` default (320px)
|
|
63
|
+
* so a typical dropdown opens at a sensible "six rows plus search
|
|
64
|
+
* input" size and only shrinks below that when the trigger is genuinely
|
|
65
|
+
* close to the viewport edge.
|
|
66
|
+
*/
|
|
67
|
+
const MAX_DROPDOWN_HEIGHT_PX = 320;
|
|
59
68
|
/** Run a function on the next animation frame, coalescing repeat
|
|
60
69
|
* calls so we don't queue dozens of layout reads per scroll burst. */
|
|
61
70
|
function rafThrottle(fn) {
|
|
@@ -116,9 +125,16 @@ export function attachDropdownPortal(options) {
|
|
|
116
125
|
dropdown.style.minWidth = `${tr.width}px`;
|
|
117
126
|
dropdown.style.maxWidth = `${tr.width}px`;
|
|
118
127
|
dropdown.style.zIndex = String(PORTAL_Z_INDEX);
|
|
128
|
+
// Cap the dropdown height at `MAX_DROPDOWN_HEIGHT_PX` regardless
|
|
129
|
+
// of how much space the trigger has below / above it - we never
|
|
130
|
+
// want the dropdown to be as tall as the viewport just because
|
|
131
|
+
// the option list could fit. The `Math.max(..., 64)` floor
|
|
132
|
+
// stops the dropdown from collapsing to a single-row sliver
|
|
133
|
+
// when the trigger is genuinely pinned against the viewport
|
|
134
|
+
// edge; the inner scroll handles the rest.
|
|
119
135
|
const availableHeightPx = openUp
|
|
120
|
-
? Math.max(spaceAbove - 8, 64)
|
|
121
|
-
: Math.max(spaceBelow - 8, 64);
|
|
136
|
+
? Math.min(MAX_DROPDOWN_HEIGHT_PX, Math.max(spaceAbove - 8, 64))
|
|
137
|
+
: Math.min(MAX_DROPDOWN_HEIGHT_PX, Math.max(spaceBelow - 8, 64));
|
|
122
138
|
if (openUp) {
|
|
123
139
|
dropdown.style.top = '';
|
|
124
140
|
dropdown.style.bottom = `${viewportHeight - tr.top}px`;
|