@synopackageland/ui 0.25.13 → 0.25.15
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/CHANGELOG.md +18 -0
- package/README.md +24 -2
- package/dist/components/app/aside-panel/AsidePanel.vue.d.ts +9 -1
- package/dist/components/composite/data-grid/DataGrid.vue.d.ts +6 -0
- package/dist/components/composite/expand-all/ExpandAllButtons.vue.d.ts +30 -0
- package/dist/components/composite/expand-all/expandAll.d.ts +12 -0
- package/dist/components/composite/tag-picker/TagPicker.vue.d.ts +77 -0
- package/dist/components/composite/tag-picker/TagPickerList.vue.d.ts +56 -0
- package/dist/components/composite/tag-picker/tagPicker.d.ts +44 -0
- package/dist/grid.js +241 -160
- package/dist/i18n/text.d.ts +9 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +13145 -12454
- package/dist/json-preview/preview.js +292 -211
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/adaptive-layout.md +1 -0
- package/docs/component-defaults.md +2 -0
- package/docs/theme-hooks.md +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.25.15 (2026-11-13)
|
|
6
|
+
|
|
7
|
+
### Tags
|
|
8
|
+
|
|
9
|
+
- **A new Tag look, for every app.** `Tag` is now a soft chip with no border, 20px high (was 24px with a grey border): a neutral fill by default, the soft fill of its `appearance` otherwise. Only `selected` and `invalid` keep a 1px inset ring. Hover and press lay the theme's state layer over the fill, so interactive tags work on every tone. It reads theme tokens, so the dark theme follows. The chips in MultipleSelect, SuperboxSelect and Combobox take the same look; TagEditor uses Tag already. The API is unchanged
|
|
10
|
+
- **TagPicker: a searchable multi-select for tags.** Options come from the caller (values, or `{ value, label?, disabled? }`). Type to filter; only the rows in view render, so 1000 tags draw about a dozen rows. `max` shows a counter, disables the rest and shows a `#limit` slot; `allow-create` adds a Create row (`create-filter` refuses names); `single` picks one and closes. `variant="inline"` draws chips with a quiet "+ Add tag" and mounts no popover until first used, for a table cell; `save` persists each change and rolls back on failure. Full keyboard support (the search is a combobox over a multiselectable listbox); on a phone the list opens as a bottom sheet. `TagPickerList` is the list alone, to embed in another panel. Exported with `tagPickerRows`, `tagPickerWindow`, `normalizeTagOption` and the `TagPickerOption` types
|
|
11
|
+
|
|
12
|
+
### Tables
|
|
13
|
+
|
|
14
|
+
- **ExpandAllButtons: Expand all and Collapse all for a table whose rows expand.** Two icon buttons with tooltips for the table's toolbar; they act on the rows shown and each is disabled when it would change nothing. Pass a DataGrid's ref as `grid`, or bind `v-model` to another table's expanded keys with `shown`. `expandAll`, `collapseAll` and `expandState` are exported too
|
|
15
|
+
- **DataGrid `collapseAllRows` closes only the rows shown**, as `expandAllRows` opens only them; rows on other pages or filtered out keep their state. The grid also exposes `visibleRowKeys`, `expandedRowKeys` and `setExpandedKeys`
|
|
16
|
+
|
|
17
|
+
## 0.25.14 (2026-11-13)
|
|
18
|
+
|
|
19
|
+
### Aside panel
|
|
20
|
+
|
|
21
|
+
- **`AsidePanel header-layout="inline"`: tabs in the header row.** The `tabs` slot moves into the row with the header actions (tabs at the start, expand and collapse at the end), and the title is hidden visually while it stays the panel's accessible name and an `h2` for screen readers; on a phone the tabs share the sheet's header row. Without a `tabs` slot the title stays visible. The default, `stacked`, is unchanged. The header carries `data-ui-aside-header-layout`
|
|
22
|
+
|
|
5
23
|
## 0.25.13 (2026-11-13)
|
|
6
24
|
|
|
7
25
|
### Lists
|
package/README.md
CHANGED
|
@@ -556,7 +556,7 @@ DSM-style application building blocks:
|
|
|
556
556
|
- PageHeader / PageToolbar (the row under the header: views and filters at the start, actions at the end) / SectionTabs
|
|
557
557
|
- Statistic / StatTile / StatTileGroup / SummaryCard (a section summary that opens its detail, with loading and error states)
|
|
558
558
|
- TimelineRow (one event in a list) / NewItemsPill (a floating "N new" pill) / SectionSkeleton `variant="lines" | "figures" | "rows"`
|
|
559
|
-
- FacetPanel (filter groups with counts; a bottom sheet on a phone) / TagEditor (tags edited in place, saved optimistically)
|
|
559
|
+
- FacetPanel (filter groups with counts; a bottom sheet on a phone) / TagEditor (tags edited in place, saved optimistically) / TagPicker (a searchable, virtualised multi-select of tags; see [Tags](#tags-tag-and-tagpicker))
|
|
560
560
|
- SplitPane / StorageMeter / StackedBar (see [docs/size-and-split.md](docs/size-and-split.md))
|
|
561
561
|
- ListDetail (a list with the selected item's detail beside it, the pane's width set by dragging and remembered; see [docs/list-detail.md](docs/list-detail.md))
|
|
562
562
|
- AsidePanel (the right side region: rail, docked, floating, sheet) / RecordPanel (a non-modal record panel docked over the view) / AdaptivePanel (a popover on desktop, a bottom sheet on a phone) / StatusSlot
|
|
@@ -903,7 +903,7 @@ for one column.
|
|
|
903
903
|
- **Selection.** The header box selects every selectable row of its scope: the current page (`select-all-scope="page"`, the default) or every row the filter leaves, across pages (`"all"`). It is checked when all of them are selected, mixed (`aria-checked="mixed"`, a dash) when some are, and a click when all are clears them; keys outside the scope (another page, rows the filter hides) are kept. `row-selectable(row)` returning `false` disables a row's box, and the header box skips that row and keeps its state. `row-select-disabled-reason(row)` says why: the box is wrapped in a Tab stop with that text as its accessible name and as a `Tooltip`, so the reason is visible on hover and keyboard focus, not only in a native `title`. With no selectable row the header box is disabled.
|
|
904
904
|
- **Footer bar.** `footer` shows the DSM bar with the item count; `refreshable` adds the refresh button (`@refresh`, `refreshing` spins it). Without `footer` it appears when there is more than one page, a page-size choice that matters, or a `#footer` slot.
|
|
905
905
|
- **Localisation.** Every built-in string goes through `labels`: `empty`, `noMatch`, `items(count)`, `filtered(count, total)`, `page(page, count)`, `previous`, `next`, `pageSize`, `refresh`, `selectAll`, `selectRow(key, row)`, `resizeColumn(label)`, `columns`, `resetColumns`, `hiddenByWidth`. `emptyText` still works.
|
|
906
|
-
- **Expanded rows.** `:expandable="{ type: 'row' }"` adds a chevron column (double click toggles too) and renders the `#expand` slot under an open row; bind `v-model:expanded-keys` or call the exposed `expandRow` / `collapseRow` / `expandAllRows`. `type: 'cell'` draws no chevron column and ignores double click: a `#cell-<key>` slot opens the row itself with its `toggleExpand` and `expanded` props, so give that control an `aria-expanded`. The slot gets `indent`, the pixels to the first data column's text, also set as `--ui-grid-detail-indent` on the expand row.
|
|
906
|
+
- **Expanded rows.** `:expandable="{ type: 'row' }"` adds a chevron column (double click toggles too) and renders the `#expand` slot under an open row; bind `v-model:expanded-keys` or call the exposed `expandRow` / `collapseRow` / `expandAllRows` / `collapseAllRows` (both act on the rows shown: this page, after filtering). For an Expand all / Collapse all pair in the table's toolbar, put `<ExpandAllButtons :grid="gridRef" />` there: two icon buttons with tooltips that act on the rows the grid shows, each disabled when it would change nothing. With another table, bind `v-model` to its expanded keys and pass the shown rows' keys as `shown`. `type: 'cell'` draws no chevron column and ignores double click: a `#cell-<key>` slot opens the row itself with its `toggleExpand` and `expanded` props, so give that control an `aria-expanded`. The slot gets `indent`, the pixels to the first data column's text, also set as `--ui-grid-detail-indent` on the expand row.
|
|
907
907
|
- **Detail rows.** For sub-rows in that slot (the copies of a file, the members of a group) use `DetailList`: it starts under the Name column's text, puts each line's `#leading` (a `Tag`) in a column as wide as the widest, then the item's `text` and `secondary` (or the default slot), then `#trailing` actions (an `IconButton` with a `label`, or a `variant="text"` Button). `max` shows that many lines and a summary line counts the rest ("3 more", or `summary` / `#summary`); `#summary-leading` and `#summary-trailing` fill that line, for example a "Show all 20 copies" button that opens a `Sheet`. A `#summary` slot keeps the line even when nothing is hidden. Under 448px the lead, text and actions stack.
|
|
908
908
|
|
|
909
909
|
```vue
|
|
@@ -923,6 +923,28 @@ for one column.
|
|
|
923
923
|
remaining space and its rows scroll above the footer. Use `class="flex-none"`
|
|
924
924
|
for a grid that should retain its content height.
|
|
925
925
|
|
|
926
|
+
### Tags: Tag and TagPicker
|
|
927
|
+
|
|
928
|
+
`Tag` is a soft chip with no border, 20px high: a neutral fill by default, or the soft fill of `appearance` (`info`, `success`, `warning`, `danger`, `theme`). Only `selected` and `invalid` add a 1px inset ring. It reads the theme's tokens, so it follows the light and the dark theme. Use it for labels and applied filters; a status with a dot is a `Badge`.
|
|
929
|
+
|
|
930
|
+
`TagPicker` chooses tags from a list the caller supplies. It searches as you type, renders only the rows in view (1000 tags draw about a dozen rows), and on a phone opens as a bottom sheet.
|
|
931
|
+
|
|
932
|
+
```vue
|
|
933
|
+
<FormItem label="Tags">
|
|
934
|
+
<TagPicker v-model="tags" :options="allTags" :max="30" allow-create>
|
|
935
|
+
<template #limit="{ max }">A device has at most {{ max }} tags</template>
|
|
936
|
+
</TagPicker>
|
|
937
|
+
</FormItem>
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
- `options` are values, or `{ value, label?, disabled? }`; the model holds values. A chosen value that `options` no longer lists still shows.
|
|
941
|
+
- `max` shows "n / max" and, once reached, disables the other rows and shows the `#limit` slot (default "At most {max} tags").
|
|
942
|
+
- `allow-create` adds a Create row for a name no tag has; picking it adds the name and emits `create`. `create-filter` refuses names (length, characters).
|
|
943
|
+
- `single` picks one tag and closes. `loading` shows "Loading tags" while the list is empty.
|
|
944
|
+
- `variant="inline"` draws chips in place with a quiet "+ Add tag", for a table cell or a detail panel. It mounts no popover until first used, so a table can render one per row. `chip-limit` (default 3 inline, 6 in a field) ends the chips in "+N"; `wrap` wraps them instead. `save` persists each change and rolls back when it rejects, emitting `error`.
|
|
945
|
+
- Keyboard: Enter, Space or ArrowDown on the field opens it, and Backspace there removes the last tag. In the search, ArrowUp/ArrowDown/PageUp/PageDown move, Enter toggles, Backspace in an empty search removes the last tag, and Escape closes. The search is a combobox whose `aria-activedescendant` names the active option of a multiselectable listbox.
|
|
946
|
+
- `TagPickerList` is the list on its own, to embed in another panel (a filter popover). It emits `pick`, `clear` and `remove-last`, and changes no value itself.
|
|
947
|
+
|
|
926
948
|
### Loading
|
|
927
949
|
|
|
928
950
|
`Spinner` is the DSM ring (`size` is the box in px, default 24). `LoadingMask` wraps content and covers it with a white 60% mask and a centred message box while `loading` (`delay` in ms holds the mask back so a quick load never flashes it; the region is `aria-busy` at once, so disable the actions it gates yourself); `LoadingArea` fills its container (give the parent a height) and centres the indicator, for whole-page or whole-panel waits. `Button loading` shows the 16px ring inline. Do not place a bare `Spinner` in a block container and expect it to be centred: use `LoadingArea`.
|
|
@@ -9,6 +9,13 @@ type __VLS_Props = {
|
|
|
9
9
|
unread?: boolean;
|
|
10
10
|
/** The phone button that opens the sheet; without it the app opens the sheet itself. */
|
|
11
11
|
fab?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* `stacked`: the tabs sit above a row with the title and the actions.
|
|
14
|
+
* `inline`: the tabs take the title's place in the actions' row and the
|
|
15
|
+
* title is kept for assistive technology only (it stays the panel's
|
|
16
|
+
* accessible name). Without a `tabs` slot the title stays visible.
|
|
17
|
+
*/
|
|
18
|
+
headerLayout?: 'stacked' | 'inline';
|
|
12
19
|
/** Offers `expanded` (the panel takes the content area). */
|
|
13
20
|
expandable?: boolean;
|
|
14
21
|
/** Where focus goes when the panel opens: `field` (the first field in the composer or body, not on touch), the `panel`, or `none`. */
|
|
@@ -28,7 +35,7 @@ type SlotProps = {
|
|
|
28
35
|
restore: () => void;
|
|
29
36
|
};
|
|
30
37
|
type __VLS_Slots = {
|
|
31
|
-
/** Surface tabs above the header row (a SegmentControl size="sm"); shown only when given. */
|
|
38
|
+
/** Surface tabs above the header row, or in it with `header-layout="inline"` (a SegmentControl size="sm"); shown only when given. */
|
|
32
39
|
tabs?: (props: SlotProps) => unknown;
|
|
33
40
|
/** Extra header actions before expand and collapse (a ⋯ menu). */
|
|
34
41
|
actions?: (props: SlotProps) => unknown;
|
|
@@ -58,6 +65,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
|
58
65
|
shortcut: string;
|
|
59
66
|
expandable: boolean;
|
|
60
67
|
unread: boolean;
|
|
68
|
+
headerLayout: "stacked" | "inline";
|
|
61
69
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
62
70
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
63
71
|
declare const _default: typeof __VLS_export;
|
|
@@ -95,6 +95,7 @@ export type DataGridAdapter = {
|
|
|
95
95
|
expandRow: (key: string) => void;
|
|
96
96
|
collapseRow: (key: string) => void;
|
|
97
97
|
expandAllRows: () => void;
|
|
98
|
+
/** Collapses the rows shown; rows on other pages or filtered out keep their state. */
|
|
98
99
|
collapseAllRows: () => void;
|
|
99
100
|
expandAllGroups: () => void;
|
|
100
101
|
collapseAllGroups: () => void;
|
|
@@ -253,6 +254,11 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
|
253
254
|
collapseRow: (key: string) => void;
|
|
254
255
|
expandAllRows: () => void;
|
|
255
256
|
collapseAllRows: () => void;
|
|
257
|
+
/** Keys of the rows shown now (this page, after filtering and sorting). */
|
|
258
|
+
visibleRowKeys: import('vue').ComputedRef<string[]>;
|
|
259
|
+
/** Keys of the expanded rows. */
|
|
260
|
+
expandedRowKeys: import('vue').ComputedRef<string[]>;
|
|
261
|
+
setExpandedKeys: (keys: string[]) => void;
|
|
256
262
|
expandAllGroups: () => void;
|
|
257
263
|
collapseAllGroups: () => void;
|
|
258
264
|
moveRowUp: (row: Record<string, unknown>) => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** What the buttons need from a DataGrid: its exposed shown and expanded keys and setter. */
|
|
2
|
+
export interface ExpandAllGrid {
|
|
3
|
+
visibleRowKeys: readonly string[];
|
|
4
|
+
expandedRowKeys: readonly string[];
|
|
5
|
+
setExpandedKeys: (keys: string[]) => void;
|
|
6
|
+
}
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** Keys of the rows the table shows now (this page, after filtering). */
|
|
9
|
+
shown?: readonly string[];
|
|
10
|
+
/** A DataGrid instance (its template ref), instead of `shown` and `v-model`. */
|
|
11
|
+
grid?: ExpandAllGrid | null;
|
|
12
|
+
size?: 'sm' | 'md';
|
|
13
|
+
expandLabel?: string;
|
|
14
|
+
collapseLabel?: string;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_ModelProps = {
|
|
17
|
+
modelValue?: string[];
|
|
18
|
+
};
|
|
19
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
20
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
"update:modelValue": (value: string[]) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
size: "sm" | "md";
|
|
26
|
+
grid: ExpandAllGrid | null;
|
|
27
|
+
shown: readonly string[];
|
|
28
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expand all / collapse all over the rows a table shows. Only the shown rows
|
|
3
|
+
* change: rows another page or a search keeps out stay as they were, and a
|
|
4
|
+
* long list is never opened beyond what is on screen.
|
|
5
|
+
*/
|
|
6
|
+
export declare function expandAll(expanded: readonly string[], shown: readonly string[]): string[];
|
|
7
|
+
export declare function collapseAll(expanded: readonly string[], shown: readonly string[]): string[];
|
|
8
|
+
/** Which of the two buttons does something: none to open, or none to close. */
|
|
9
|
+
export declare function expandState(expanded: readonly string[], shown: readonly string[]): {
|
|
10
|
+
canExpand: boolean;
|
|
11
|
+
canCollapse: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { TagPickerOption } from './tagPicker';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** The chosen values. */
|
|
4
|
+
modelValue?: readonly string[];
|
|
5
|
+
/** The tags offered: values, or `{ value, label?, disabled? }`. */
|
|
6
|
+
options?: readonly TagPickerOption[];
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
/** Offers the search text as a new tag; picking it adds it and emits `create`. */
|
|
9
|
+
allowCreate?: boolean;
|
|
10
|
+
/** Accepts or refuses a new tag name (its length, its characters). */
|
|
11
|
+
createFilter?: (name: string) => boolean;
|
|
12
|
+
/** At most this many chosen: the rest turn disabled and the `limit` slot shows. */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** Picks one tag and closes. */
|
|
15
|
+
single?: boolean;
|
|
16
|
+
variant?: 'field' | 'inline';
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Accessible name; inside a FormItem the item's label names it instead. */
|
|
19
|
+
label?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
invalid?: boolean;
|
|
22
|
+
/** Chips shown before "+N"; default 6 in a field, 3 inline. */
|
|
23
|
+
chipLimit?: number;
|
|
24
|
+
/** Inline only: chips wrap onto more lines instead of one clipped line. */
|
|
25
|
+
wrap?: boolean;
|
|
26
|
+
/** Persists a change; a rejection rolls the value back to `previous`. */
|
|
27
|
+
save?: (next: string[], previous: string[]) => unknown;
|
|
28
|
+
/** Width of the dropdown. */
|
|
29
|
+
width?: string;
|
|
30
|
+
searchPlaceholder?: string;
|
|
31
|
+
emptyText?: string;
|
|
32
|
+
loadingText?: string;
|
|
33
|
+
removeLabel?: string;
|
|
34
|
+
};
|
|
35
|
+
type __VLS_Slots = {
|
|
36
|
+
/** The line shown once `max` are chosen; defaults to "At most {max} tags". */
|
|
37
|
+
limit?: (props: {
|
|
38
|
+
max: number;
|
|
39
|
+
count: number;
|
|
40
|
+
}) => unknown;
|
|
41
|
+
};
|
|
42
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
|
+
error: (error: unknown) => any;
|
|
44
|
+
close: () => any;
|
|
45
|
+
open: () => any;
|
|
46
|
+
"update:modelValue": (value: string[]) => any;
|
|
47
|
+
create: (name: string) => any;
|
|
48
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
49
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
50
|
+
onClose?: (() => any) | undefined;
|
|
51
|
+
onOpen?: (() => any) | undefined;
|
|
52
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
53
|
+
onCreate?: ((name: string) => any) | undefined;
|
|
54
|
+
}>, {
|
|
55
|
+
variant: "field" | "inline";
|
|
56
|
+
loading: boolean;
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
max: number;
|
|
59
|
+
width: string;
|
|
60
|
+
invalid: boolean;
|
|
61
|
+
modelValue: readonly string[];
|
|
62
|
+
options: readonly TagPickerOption[];
|
|
63
|
+
allowCreate: boolean;
|
|
64
|
+
single: boolean;
|
|
65
|
+
wrap: boolean;
|
|
66
|
+
save: (next: string[], previous: string[]) => unknown;
|
|
67
|
+
createFilter: (name: string) => boolean;
|
|
68
|
+
chipLimit: number;
|
|
69
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
70
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
71
|
+
declare const _default: typeof __VLS_export;
|
|
72
|
+
export default _default;
|
|
73
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
74
|
+
new (): {
|
|
75
|
+
$slots: S;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { TagPickerOption } from './tagPicker';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** The chosen values. */
|
|
4
|
+
modelValue: readonly string[];
|
|
5
|
+
options: readonly TagPickerOption[];
|
|
6
|
+
/** Shows the loading text while there are no rows yet. */
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
allowCreate?: boolean;
|
|
9
|
+
createFilter?: (name: string) => boolean;
|
|
10
|
+
/** At most this many chosen; ignored with `single`. */
|
|
11
|
+
max?: number;
|
|
12
|
+
single?: boolean;
|
|
13
|
+
/** Accessible name of the list. */
|
|
14
|
+
label?: string;
|
|
15
|
+
searchPlaceholder?: string;
|
|
16
|
+
emptyText?: string;
|
|
17
|
+
loadingText?: string;
|
|
18
|
+
clearText?: string;
|
|
19
|
+
/** Rows in view before the list scrolls. */
|
|
20
|
+
visibleRows?: number;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_Slots = {
|
|
23
|
+
/** The line shown once `max` are chosen; defaults to "At most {max} tags". */
|
|
24
|
+
limit?: (props: {
|
|
25
|
+
max: number;
|
|
26
|
+
count: number;
|
|
27
|
+
}) => unknown;
|
|
28
|
+
};
|
|
29
|
+
/** Puts the caret in the search box (after the list is shown somewhere new). */
|
|
30
|
+
declare function focus(): void;
|
|
31
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
32
|
+
focus: typeof focus;
|
|
33
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
34
|
+
clear: () => any;
|
|
35
|
+
pick: (value: string, kind: "create" | "tag") => any;
|
|
36
|
+
"remove-last": () => any;
|
|
37
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
38
|
+
onClear?: (() => any) | undefined;
|
|
39
|
+
onPick?: ((value: string, kind: "create" | "tag") => any) | undefined;
|
|
40
|
+
"onRemove-last"?: (() => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
loading: boolean;
|
|
43
|
+
max: number;
|
|
44
|
+
allowCreate: boolean;
|
|
45
|
+
single: boolean;
|
|
46
|
+
createFilter: (name: string) => boolean;
|
|
47
|
+
visibleRows: number;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** A tag the picker offers: its value, or the value with a label and a disabled flag. */
|
|
2
|
+
export type TagPickerOption = string | {
|
|
3
|
+
value: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface TagPickerRow {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
selected: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TagPickerRows {
|
|
14
|
+
rows: TagPickerRow[];
|
|
15
|
+
/** The trimmed search text when it may become a new tag, else `null`. */
|
|
16
|
+
create: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface TagPickerRowOptions {
|
|
19
|
+
/** Offer the search text as a new tag when no tag has that name. */
|
|
20
|
+
allowCreate?: boolean;
|
|
21
|
+
/** Unchosen rows turn disabled once this many are chosen, and nothing is created. */
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Accepts or refuses a new tag name (length, characters); default accepts any. */
|
|
24
|
+
createFilter?: (name: string) => boolean;
|
|
25
|
+
}
|
|
26
|
+
/** The value and label of an option, whichever form it takes. */
|
|
27
|
+
export declare function normalizeTagOption(option: TagPickerOption): {
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The list for `query`: every offered or chosen tag whose label contains the
|
|
34
|
+
* query (case-insensitive), chosen ones first while there is no query, then
|
|
35
|
+
* by label. Unchosen rows are disabled once `max` are chosen. A chosen value
|
|
36
|
+
* the options no longer list still shows, by its value. An empty value is
|
|
37
|
+
* never a row.
|
|
38
|
+
*/
|
|
39
|
+
export declare function tagPickerRows(options: readonly TagPickerOption[], selected: readonly string[], query: string, opts?: TagPickerRowOptions): TagPickerRows;
|
|
40
|
+
/** The rows a fixed-height virtual list renders: what is in view plus `overscan` on each side. */
|
|
41
|
+
export declare function visibleWindow(scrollTop: number, rowHeight: number, viewport: number, total: number, overscan?: number): {
|
|
42
|
+
start: number;
|
|
43
|
+
end: number;
|
|
44
|
+
};
|