@dorsk/tsumikit 0.60.1 → 0.60.3
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/README.md
CHANGED
|
@@ -516,12 +516,15 @@ page. Adornment widths are measured with a `ResizeObserver` into
|
|
|
516
516
|
The adornments sit flush inside the field's padding as ghost/primary controls,
|
|
517
517
|
no dividers: pick a control one step below the group (`size="sm"`/`box="sm"` in
|
|
518
518
|
an `md` group, `box="xs"` in `sm`, `box="lg"` in `lg`). `align="end"` (default)
|
|
519
|
-
pins them to the bottom edge as a textarea grows
|
|
519
|
+
pins them to the bottom edge as a textarea grows. A square control (`box`,
|
|
520
|
+
`iconOnly`) drops its fixed box and stretches square to the slot height, so its
|
|
521
|
+
glyph centres on the field; `align="center"` is for a
|
|
520
522
|
single-line `Input`. `size` sm/md/lg, `disabled` and `error` flow to the field
|
|
521
523
|
through context (a `size`/`invalid`/`disabled` set on the field still wins).
|
|
522
524
|
`Textarea` keeps `autoresize`, `maxHeight` and `resize="top"` (the grip is
|
|
523
525
|
clipped to the space between the adornments). Once a `Textarea` needs more
|
|
524
|
-
than one row (content, `rows`, or a dragged floor
|
|
526
|
+
than one row (content, `rows`, or a dragged floor; a wrapping placeholder does
|
|
527
|
+
not count, it stays on one clipped line) the adornments move into a
|
|
525
528
|
bar under the text: every line then runs the full width with the normal
|
|
526
529
|
padding, the textarea's box (and its scrollbar) ends above the controls, and
|
|
527
530
|
the bar continues the field's border, the controls still flush against its
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
// Grouped: report whether the content needs more than one row when laid out
|
|
88
88
|
// with the single-line padding (measured in that layout so the bar cannot
|
|
89
89
|
// flip back and forth), which moves the adornments into a bar under the text.
|
|
90
|
+
// An empty field has no content height: its scrollHeight counts the placeholder.
|
|
90
91
|
function probeBar() {
|
|
91
92
|
if (!el || !group) return;
|
|
92
93
|
const node = el;
|
|
@@ -98,7 +99,8 @@
|
|
|
98
99
|
node.style.minHeight = '';
|
|
99
100
|
const cs = getComputedStyle(node);
|
|
100
101
|
const borders = (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0);
|
|
101
|
-
const
|
|
102
|
+
const content = node.value === '' ? 0 : node.scrollHeight + borders;
|
|
103
|
+
const height = Math.max(content, floor, rowsFloor(node));
|
|
102
104
|
const oneRow = Math.max(rowsHeight(node, 1), parseFloat(cs.minHeight) || 0);
|
|
103
105
|
node.style.height = prevHeight;
|
|
104
106
|
if (floor) node.style.minHeight = `${floor}px`;
|
|
@@ -323,6 +325,11 @@
|
|
|
323
325
|
padding-inline: max(var(--ig-pad-x), var(--ig-leading-w, 0px) + var(--ig-gap))
|
|
324
326
|
max(var(--ig-pad-x), var(--ig-trailing-w, 0px) + var(--ig-gap));
|
|
325
327
|
}
|
|
328
|
+
.textarea.grouped:not(.bar)::placeholder {
|
|
329
|
+
white-space: nowrap;
|
|
330
|
+
overflow: hidden;
|
|
331
|
+
text-overflow: ellipsis;
|
|
332
|
+
}
|
|
326
333
|
.textarea.grouped:focus-visible {
|
|
327
334
|
outline: none;
|
|
328
335
|
}
|
|
@@ -157,14 +157,17 @@
|
|
|
157
157
|
.ig-adorn > :global(*) {
|
|
158
158
|
pointer-events: auto;
|
|
159
159
|
align-self: stretch;
|
|
160
|
-
height: auto;
|
|
161
|
-
min-height: 0;
|
|
162
160
|
--btn-size: 100%;
|
|
163
161
|
--btn-radius: 0;
|
|
164
162
|
--pop-trigger-radius: 0;
|
|
165
163
|
border-radius: 0;
|
|
166
164
|
}
|
|
167
|
-
|
|
165
|
+
/* The doubled class outranks an adornment's own fixed box (e.g. FileButton `box`). */
|
|
166
|
+
.ig.ig .ig-adorn > :global(*) {
|
|
167
|
+
height: auto;
|
|
168
|
+
min-height: 0;
|
|
169
|
+
}
|
|
170
|
+
.ig .ig-adorn > :global(:is(.btn-box, .btn-square, .btn-icon, .icon-only)) {
|
|
168
171
|
width: auto;
|
|
169
172
|
min-width: 0;
|
|
170
173
|
aspect-ratio: 1;
|
package/package.json
CHANGED