compote-ui 0.74.0 → 0.74.2
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/dist/components/data-table-v9/toolbar/data-table-column-filter.svelte +2 -2
- package/dist/components/data-table-v9/toolbar/data-table-search.svelte +1 -1
- package/dist/components/field/field.svelte +2 -1
- package/dist/components/field/types.d.ts +7 -0
- package/dist/components/tree-view/tree-view.svelte +1 -1
- package/package.json +1 -1
- package/skills/component-usage/references/forms-and-inputs.md +8 -1
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
: allOptions}
|
|
291
291
|
{@const selected = getSelectValues(column)}
|
|
292
292
|
<div class="flex flex-col gap-1">
|
|
293
|
-
<Field.Root>
|
|
293
|
+
<Field.Root hideMessageLine>
|
|
294
294
|
<Field.Input
|
|
295
295
|
placeholder="Search..."
|
|
296
296
|
value={search}
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
</ScrollArea.Root>
|
|
326
326
|
</div>
|
|
327
327
|
{:else}
|
|
328
|
-
<Field.Root>
|
|
328
|
+
<Field.Root hideMessageLine>
|
|
329
329
|
<Field.Input
|
|
330
330
|
placeholder="Search..."
|
|
331
331
|
value={localText[column.id] ?? ''}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
field,
|
|
9
9
|
helperText,
|
|
10
10
|
errorText,
|
|
11
|
+
hideMessageLine = false,
|
|
11
12
|
class: className,
|
|
12
13
|
invalid,
|
|
13
14
|
required,
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
<Field.ErrorText>{resolvedError}</Field.ErrorText>
|
|
38
39
|
{:else if helperText}
|
|
39
40
|
<Field.HelperText>{helperText}</Field.HelperText>
|
|
40
|
-
{:else}
|
|
41
|
+
{:else if !hideMessageLine}
|
|
41
42
|
<!--
|
|
42
43
|
Holds the message line open so a field does not change height when an
|
|
43
44
|
error appears. `1lh` resolves against this element's own line-height, so
|
|
@@ -19,6 +19,13 @@ export interface FieldRootProps extends FieldRootBaseProps {
|
|
|
19
19
|
* for `invalid` and `required`.
|
|
20
20
|
*/
|
|
21
21
|
errorText?: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to drop the spacer that otherwise holds the message line open
|
|
24
|
+
* when there is no error or helper text to show. Defaults to `false`. Set
|
|
25
|
+
* to `true` for a field that never surfaces validation (a toolbar search
|
|
26
|
+
* box, say), so it doesn't reserve height it will never use.
|
|
27
|
+
*/
|
|
28
|
+
hideMessageLine?: boolean;
|
|
22
29
|
}
|
|
23
30
|
export interface FieldLabelProps extends FieldLabelBaseProps {
|
|
24
31
|
class?: ClassValue;
|
package/package.json
CHANGED
|
@@ -36,7 +36,14 @@ genuinely need several, `<Field.ErrorText>` children still work.
|
|
|
36
36
|
|
|
37
37
|
The message line is **always held open**, so a field never changes height when an error appears and
|
|
38
38
|
nothing below it moves. Errors and `helperText` share that line — an error replaces the helper
|
|
39
|
-
rather than stacking under it.
|
|
39
|
+
rather than stacking under it. For a field that never surfaces validation (a toolbar search box,
|
|
40
|
+
say), pass `hideMessageLine` to drop the spacer entirely:
|
|
41
|
+
|
|
42
|
+
```svelte
|
|
43
|
+
<Field.Root hideMessageLine>
|
|
44
|
+
<Field.Input bind:value={search} placeholder="Search..." />
|
|
45
|
+
</Field.Root>
|
|
46
|
+
```
|
|
40
47
|
|
|
41
48
|
List controls use `{ value, label }` items:
|
|
42
49
|
|