@leavittsoftware/web 11.0.1 → 11.1.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/CLAUDE.md
CHANGED
|
@@ -27,6 +27,7 @@ When bumping `@leavittsoftware/web` in a downstream project, read every entry **
|
|
|
27
27
|
|
|
28
28
|
**Search downstream for:**
|
|
29
29
|
|
|
30
|
+
- Hand-rolled multi selects built from `titanium-chip-multi-select` + a `leavitt-*-select` / `titanium-single-select-base` subclass
|
|
30
31
|
- `AppRoute` / `PageRoute` / `RedirectRoute` imports from `titanium/helpers/route`
|
|
31
32
|
- App-shell `#routes` tables and `before` handlers on page routes
|
|
32
33
|
- `'page' in route` / `'redirect' in route` discriminators used to collect or execute matches
|
|
@@ -34,11 +35,13 @@ When bumping `@leavittsoftware/web` in a downstream project, read every entry **
|
|
|
34
35
|
|
|
35
36
|
**Adopt when upgrading to this version:**
|
|
36
37
|
|
|
38
|
+
- **`titanium-multi-select-base`** — new generic multi select combobox: selected items render as chips inside the field and the search input lives in the popover above the selectable items. Replaces the `titanium-chip-multi-select` + separate single-select + add-button pattern for "pick several from a list" inputs. Use it directly with `.items` (local fuse.js search) and optional `.sections` grouping, or extend it and override `onInputChanged` / `showSuggestions` for remote search — same hook names as `titanium-single-select-base`. Fires `selected-changed`; read the new value from `event.target.selected`.
|
|
37
39
|
- **Middleware + halt pipeline** — `AppRoute` now includes `MiddlewareRoute` (`pattern` + required `before`, no `page`/`redirect`). Matching destinations run **all** matching middleware (and page `before` handlers) in declaration order; handlers continue by default and may return `ROUTE_HALT` / `'halt'` (`RouteHandlerResult`) to stop the pipeline without rendering. Rework app routers from “first match wins immediately” to the two-pass collect-then-execute pattern (see skeleton.leavitt.com `develop` / leavittbook `my-app.ts`). Prefer importing `ROUTE_HALT` from `titanium/helpers/route` instead of the string literal.
|
|
38
40
|
- **`titanium-single-select-base` shaped menu tokens** — shaped open menus now set `--md-menu-item-leading-icon-color` / `--md-menu-item-trailing-icon-color` to `inverse-on-surface` (alongside the existing label/supporting-text tokens). Inert section-header `md-menu-item` styling (spacing + shaped inverse colors) lives on the base — remove duplicate `md-menu-item[inert]` / leading-icon color overrides from subclasses once on this build.
|
|
39
41
|
|
|
40
42
|
**Renamed / API changes:**
|
|
41
43
|
|
|
44
|
+
- New element: `titanium-multi-select-base` (`titanium/multi-select-base/multi-select-base`); new exported type `TitaniumMultiSelectSection<T>`
|
|
42
45
|
- `AppRoute` = `MiddlewareRoute | PageRoute | RedirectRoute`
|
|
43
46
|
- `PageRoute.before` return type is now `RouteHandlerResult | Promise<RouteHandlerResult>` (may return `ROUTE_HALT` / `'halt'`)
|
|
44
47
|
- New exports: `MiddlewareRoute`, `RouteHandlerResult`, `ROUTE_HALT`
|
|
@@ -165,6 +168,7 @@ Titanium **mixins and decorators** (`ThemePreference`, `promiseTracking`, …) a
|
|
|
165
168
|
| `titanium-date-input` | composes | `md-filled-field` |
|
|
166
169
|
| `titanium-date-range-selector` | composes | `md-filled-field`, `md-menu`, `md-list` |
|
|
167
170
|
| `titanium-single-select-base` and all `leavitt-*-select`, `titanium-icon-picker`, `google-address-input` | composes | `md-filled-text-field`, `md-menu`, `md-menu-item` |
|
|
171
|
+
| `titanium-multi-select-base` | composes | `titanium-filled-input-validator` (extends `MdFilledField`), `md-menu`, `md-menu-item`, `titanium-chip` |
|
|
168
172
|
| `titanium-chip-multi-select` | composes | `titanium-filled-input-validator` (extends `MdFilledField`); slots intended for `md-filled-tonal-button`, `md-input-chip` |
|
|
169
173
|
| `titanium-confirmation-dialog` and most modal/dialog components | composes | `md-dialog` (+ `md-filled-button` / `md-text-button` actions) |
|
|
170
174
|
| `titanium-data-table-core` | composes | `md-checkbox`, `md-icon-button`, `md-menu` |
|
|
@@ -349,6 +353,7 @@ Titanium class inheritance (in addition to Material Web extend/compose — see *
|
|
|
349
353
|
| `MdFilledTextField` | `@material/web/textfield/filled-text-field` | `titanium-filled-duration-input`, `titanium-filled-youtube-input` |
|
|
350
354
|
| `MdFilledField` | `@material/web/field/filled-field` | `titanium-filled-input-validator` |
|
|
351
355
|
| `TitaniumSingleSelectBase` | `titanium/single-select-base/single-select-base` | All `leavitt-*-select`, `titanium-icon-picker`, `google-address-input` |
|
|
356
|
+
| `TitaniumMultiSelectBase` | `titanium/multi-select-base/multi-select-base` | Usable directly; extend for remote-search multi selects |
|
|
352
357
|
| `google-address-input` | `titanium/address-input/google-address-input` | `titanium-address-input` |
|
|
353
358
|
| `ThemePreference` mixin | `leavitt/theme/theme-preference` | `leavitt-app-logo`, `leavitt-error-page`, `leavitt-service-worker-notifier`, `titanium-single-select-base` |
|
|
354
359
|
|
|
@@ -913,6 +918,64 @@ Row clicks with `itemLinkUrl` navigate directly via `window.navigation.navigate(
|
|
|
913
918
|
|
|
914
919
|
---
|
|
915
920
|
|
|
921
|
+
### `titanium-multi-select-base`
|
|
922
|
+
|
|
923
|
+
**Purpose:** Generic multi select combobox. Selected items render as removable chips inside the field; the search input lives in the popover directly above the selectable items.
|
|
924
|
+
|
|
925
|
+
**Material Web:** Composes `titanium-filled-input-validator` (extends `MdFilledField`) as the field, plus `md-menu` + `md-menu-item` for the popover and `titanium-chip` for the chips.
|
|
926
|
+
|
|
927
|
+
**Import:** `import '@leavittsoftware/web/titanium/multi-select-base/multi-select-base.js'`
|
|
928
|
+
|
|
929
|
+
**Source:** `titanium/multi-select-base/multi-select-base.ts`
|
|
930
|
+
|
|
931
|
+
| Kind | Name | Type / values | Notes |
|
|
932
|
+
| --------- | ------------------------------------------------------ | ------------------------------------------------ | ----------------------------------------------------------- |
|
|
933
|
+
| Property | `selected` | `T[]` | Selected items |
|
|
934
|
+
| Property | `items` | `T[]` | Full catalog; searched locally with fuse.js |
|
|
935
|
+
| Property | `sections` | `TitaniumMultiSelectSection<T>[]` | Optional grouping shown when no search term is entered |
|
|
936
|
+
| Property | `label`, `placeholder` | `string` | `placeholder` shows in the field when nothing is selected |
|
|
937
|
+
| Attribute | `search-placeholder` | `string` | Placeholder of the popover search input |
|
|
938
|
+
| Property | `pathToSelectedText` | `string` | Default `'Name'`; key holding the display text |
|
|
939
|
+
| Property | `pathToIcon` | `string` | Optional key holding a Material Symbols icon name |
|
|
940
|
+
| Property | `searchKeys` | `string[]` | fuse.js keys; defaults to `[pathToSelectedText]` |
|
|
941
|
+
| Attribute | `max-selected` | `number` | `0` (default) allows an unlimited number |
|
|
942
|
+
| Property | `required`, `disabled`, `error` | `boolean` | `required` = at least one selection |
|
|
943
|
+
| Property | `errorText`, `supportingText` | `string` | |
|
|
944
|
+
| Attribute | `no-items-text`, `no-results-text` | `string` | Empty-state text for an empty catalog / an unmatched search |
|
|
945
|
+
| Attribute | `has-leading-icon`, `no-asterisk`, `disable-clear-all` | `boolean` | |
|
|
946
|
+
| Attribute | `match-input-width` | `boolean` | ResizeObserver keeps the popover the width of the field |
|
|
947
|
+
| Attribute | `menu-open` | `boolean` | Reflected; read via the `isOpen` getter |
|
|
948
|
+
| Property | `positioning` | `absolute` \| `fixed` \| `document` \| `popover` | Default `popover` |
|
|
949
|
+
| Getter | `isOpen`, `isAtMaxSelected` | `boolean` | |
|
|
950
|
+
| State | `isLoading` | `boolean` | Via `promiseTracking` / `trackLoadingPromise` |
|
|
951
|
+
|
|
952
|
+
**Methods:** `open()`, `close()`, `toggleMenu()`, `focus()`, `selectItem(item)`, `deselectItem(item)`, `toggleItem(item)`, `isSelected(item)`, `clear()`, `reset()`, `softReset()`, `checkValidity()`, `reportValidity()`, `trackLoadingPromise(promise)`
|
|
953
|
+
|
|
954
|
+
**Events:** `selected-changed` (composed) — read `event.target.selected`; redispatches menu `opening`/`opened`/`closing`/`closed`
|
|
955
|
+
|
|
956
|
+
**Slots:** `leading-icon` (requires `has-leading-icon`)
|
|
957
|
+
|
|
958
|
+
**CSS parts:** `menu`
|
|
959
|
+
|
|
960
|
+
**CSS custom properties:** `--titanium-multi-select-menu-max-height` (default `460px`), `--titanium-multi-select-search-height` (default `52px`)
|
|
961
|
+
|
|
962
|
+
**Exported types:** `TitaniumMultiSelectSection<T>` — `{ key, headline, supportingText?, icon?, items }`
|
|
963
|
+
|
|
964
|
+
**Usage notes / gotchas:**
|
|
965
|
+
|
|
966
|
+
- Items may appear in more than one section (e.g. "Frequently used" + "All"); identity comes from `Id`, falling back to the display text, so duplicates stay in sync
|
|
967
|
+
- Searching always renders a flat list across the whole catalog, never the sections
|
|
968
|
+
- Menu items are rendered with `keep-open`, so the popover stays open while toggling; the base handles click / Enter / Space selection so `renderSuggestion` overrides only need markup
|
|
969
|
+
- Keyboard: `ArrowDown` from the search input moves into the list, `ArrowUp` on the first item returns to the search input, `Backspace` on an empty search removes the last chip, `Escape` closes
|
|
970
|
+
- Validity is reported when the popover closes; `required` fields do not error before the user has interacted
|
|
971
|
+
- `positioning='popover'` falls back to `'fixed'` in Firefox
|
|
972
|
+
|
|
973
|
+
**Subclassing (remote search):** override `onInputChanged(searchTerm)` and call `showSuggestions(results, totalCount)` — same hooks as `titanium-single-select-base`. Override `renderSuggestion`, `renderChip`, `renderSectionHeader`, `renderTrailingMenuSlot`, `getItemText`, `getItemIcon`, or `getItemKey` to customize rendering and identity.
|
|
974
|
+
|
|
975
|
+
**Pairs with:** `titanium-chip`, `titanium-filled-input-validator`
|
|
976
|
+
|
|
977
|
+
---
|
|
978
|
+
|
|
916
979
|
### `titanium-icon-picker`
|
|
917
980
|
|
|
918
981
|
**Purpose:** Material Symbols icon search and select.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leavittsoftware/web",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"files": [
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"url": "https://github.com/LeavittSoftware/titanium-elements/issues"
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/LeavittSoftware/titanium-elements/#readme",
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "82d2a75718eeced0e64f20dd84a1c5a4c5625b75"
|
|
46
46
|
}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import '@material/web/icon/icon';
|
|
2
|
+
import '@material/web/iconbutton/icon-button';
|
|
3
|
+
import '@material/web/menu/menu';
|
|
4
|
+
import '@material/web/menu/menu-item';
|
|
5
|
+
import '@material/web/progress/circular-progress';
|
|
6
|
+
import '../chip/chip';
|
|
7
|
+
import '../input-validator/filled-input-validator';
|
|
8
|
+
import { LitElement, nothing, PropertyValues, TemplateResult } from 'lit';
|
|
9
|
+
import { Identifier } from '../types/identifier-interface';
|
|
10
|
+
import { Menu } from '@material/web/menu/internal/menu';
|
|
11
|
+
import { TitaniumFilledInputValidator } from '../input-validator/filled-input-validator';
|
|
12
|
+
/**
|
|
13
|
+
* A group of items rendered under a header when no search term is entered.
|
|
14
|
+
*/
|
|
15
|
+
export type TitaniumMultiSelectSection<T> = {
|
|
16
|
+
/**
|
|
17
|
+
* Unique key of the section. Used for list diffing.
|
|
18
|
+
*/
|
|
19
|
+
key: string;
|
|
20
|
+
/**
|
|
21
|
+
* Header text of the section.
|
|
22
|
+
*/
|
|
23
|
+
headline: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional second line of the section header.
|
|
26
|
+
*/
|
|
27
|
+
supportingText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional Material Symbols icon name shown before the header text.
|
|
30
|
+
*/
|
|
31
|
+
icon?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Items belonging to the section. Items may appear in more than one section.
|
|
34
|
+
*/
|
|
35
|
+
items: Array<T>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Generic multi select combobox. Selected items are displayed as chips inside the field
|
|
39
|
+
* and the search input lives in the popover above the selectable items.
|
|
40
|
+
*
|
|
41
|
+
* Use directly for locally searchable lists or extend it to supply remote search results.
|
|
42
|
+
*
|
|
43
|
+
* @element titanium-multi-select-base
|
|
44
|
+
*
|
|
45
|
+
* @fires selected-changed - Fired when the user adds or removes an item. Read the new value from `event.target.selected`.
|
|
46
|
+
*
|
|
47
|
+
* @slot leading-icon - Icon displayed at the start of the field. Requires `has-leading-icon`.
|
|
48
|
+
*
|
|
49
|
+
* @cssprop --titanium-multi-select-menu-max-height - Max height of the popover. Defaults to 460px.
|
|
50
|
+
* @cssprop --titanium-multi-select-search-height - Height of the sticky search row. Defaults to 52px.
|
|
51
|
+
*/
|
|
52
|
+
export declare class TitaniumMultiSelectBase<T extends Identifier = Identifier> extends LitElement {
|
|
53
|
+
#private;
|
|
54
|
+
accessor isLoading: boolean;
|
|
55
|
+
trackLoadingPromise: (promise: Promise<unknown>) => Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Sets floating label value.
|
|
58
|
+
*/
|
|
59
|
+
accessor label: string;
|
|
60
|
+
/**
|
|
61
|
+
* Text displayed in the field when nothing is selected.
|
|
62
|
+
*/
|
|
63
|
+
accessor placeholder: string;
|
|
64
|
+
/**
|
|
65
|
+
* Placeholder text of the search input inside the popover.
|
|
66
|
+
*/
|
|
67
|
+
accessor searchPlaceholder: string;
|
|
68
|
+
/**
|
|
69
|
+
* The items selected by the user.
|
|
70
|
+
*/
|
|
71
|
+
accessor selected: Array<T>;
|
|
72
|
+
/**
|
|
73
|
+
* Every selectable item. Searched locally with fuse.js and rendered when `sections` is empty.
|
|
74
|
+
*/
|
|
75
|
+
accessor items: Array<T>;
|
|
76
|
+
/**
|
|
77
|
+
* Optional grouping of items rendered when no search term is entered. Search results are always
|
|
78
|
+
* rendered as a flat list.
|
|
79
|
+
*/
|
|
80
|
+
accessor sections: Array<TitaniumMultiSelectSection<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Key on an item holding the text to display in chips and menu items.
|
|
83
|
+
*/
|
|
84
|
+
accessor pathToSelectedText: string;
|
|
85
|
+
/**
|
|
86
|
+
* Optional key on an item holding a Material Symbols icon name.
|
|
87
|
+
*/
|
|
88
|
+
accessor pathToIcon: string;
|
|
89
|
+
/**
|
|
90
|
+
* Keys searched by the local fuse.js search. Defaults to `[pathToSelectedText]`.
|
|
91
|
+
*/
|
|
92
|
+
accessor searchKeys: Array<string>;
|
|
93
|
+
/**
|
|
94
|
+
* Maximum number of items the user is allowed to select. Zero allows an unlimited number.
|
|
95
|
+
*/
|
|
96
|
+
accessor maxSelected: number;
|
|
97
|
+
/**
|
|
98
|
+
* Displays error state when nothing is selected.
|
|
99
|
+
*/
|
|
100
|
+
accessor required: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Whether or not the input should be disabled.
|
|
103
|
+
*/
|
|
104
|
+
accessor disabled: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Gets or sets whether or not the field is in a visually invalid state.
|
|
107
|
+
*/
|
|
108
|
+
accessor error: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Error message displayed below the field when it is in an invalid state.
|
|
111
|
+
*/
|
|
112
|
+
accessor errorText: string;
|
|
113
|
+
/**
|
|
114
|
+
* Conveys additional information below the field, such as how it should be used.
|
|
115
|
+
*/
|
|
116
|
+
accessor supportingText: string;
|
|
117
|
+
/**
|
|
118
|
+
* Disables the asterisk on the floating label when the field is required.
|
|
119
|
+
*/
|
|
120
|
+
accessor noAsterisk: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Renders the `leading-icon` slot at the start of the field.
|
|
123
|
+
*/
|
|
124
|
+
accessor hasLeadingIcon: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Text displayed in the popover when there is nothing to select.
|
|
127
|
+
*/
|
|
128
|
+
accessor noItemsText: string;
|
|
129
|
+
/**
|
|
130
|
+
* Text displayed in the popover when a search returns no results.
|
|
131
|
+
*/
|
|
132
|
+
accessor noResultsText: string;
|
|
133
|
+
/**
|
|
134
|
+
* Hides the clear all button that appears in the field once something is selected.
|
|
135
|
+
*/
|
|
136
|
+
accessor disableClearAll: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Positioning strategy of the popover. `popover` falls back to `fixed` in browsers without popover support.
|
|
139
|
+
*/
|
|
140
|
+
accessor positioning: 'absolute' | 'fixed' | 'document' | 'popover';
|
|
141
|
+
/**
|
|
142
|
+
* When enabled, uses a ResizeObserver to keep the popover width in sync with the field width.
|
|
143
|
+
*/
|
|
144
|
+
accessor matchInputWidth: boolean;
|
|
145
|
+
private accessor menuOpen;
|
|
146
|
+
protected accessor searchTerm: string;
|
|
147
|
+
/**
|
|
148
|
+
* Results of the last search. Rendered instead of `items` / `sections` while a search term is entered.
|
|
149
|
+
*/
|
|
150
|
+
protected accessor suggestions: Array<T>;
|
|
151
|
+
protected accessor count: number;
|
|
152
|
+
private accessor menuWidth;
|
|
153
|
+
protected accessor menu: Menu | null;
|
|
154
|
+
protected accessor field: TitaniumFilledInputValidator | null;
|
|
155
|
+
protected accessor searchInput: HTMLInputElement | null;
|
|
156
|
+
/**
|
|
157
|
+
* Whether or not the popover is open.
|
|
158
|
+
*/
|
|
159
|
+
get isOpen(): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Whether or not `maxSelected` has been reached.
|
|
162
|
+
*/
|
|
163
|
+
get isAtMaxSelected(): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Items currently rendered in the popover, flattened across sections.
|
|
166
|
+
*/
|
|
167
|
+
protected get visibleItems(): Array<T>;
|
|
168
|
+
/**
|
|
169
|
+
* Items searched by the local search. Falls back to the items of every section when `items` is empty.
|
|
170
|
+
*/
|
|
171
|
+
protected get searchPool(): Array<T>;
|
|
172
|
+
connectedCallback(): void;
|
|
173
|
+
disconnectedCallback(): void;
|
|
174
|
+
update(changed: PropertyValues<this>): void;
|
|
175
|
+
updated(changed: PropertyValues<this>): void;
|
|
176
|
+
/**
|
|
177
|
+
* Opens the popover and focuses the search input.
|
|
178
|
+
*/
|
|
179
|
+
open(): void;
|
|
180
|
+
/**
|
|
181
|
+
* Closes the popover.
|
|
182
|
+
*/
|
|
183
|
+
close(): void;
|
|
184
|
+
/**
|
|
185
|
+
* Opens the popover when closed, closes it when open.
|
|
186
|
+
*/
|
|
187
|
+
toggleMenu(): void;
|
|
188
|
+
/**
|
|
189
|
+
* Sets focus on the field.
|
|
190
|
+
*/
|
|
191
|
+
focus(): Promise<void>;
|
|
192
|
+
/**
|
|
193
|
+
* Returns true when the given item is selected.
|
|
194
|
+
*/
|
|
195
|
+
isSelected(item: T): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Adds an item to the selection. Does nothing when it is already selected or `maxSelected` is reached.
|
|
198
|
+
*/
|
|
199
|
+
selectItem(item: T): void;
|
|
200
|
+
/**
|
|
201
|
+
* Removes an item from the selection.
|
|
202
|
+
*/
|
|
203
|
+
deselectItem(item: T): void;
|
|
204
|
+
/**
|
|
205
|
+
* Adds the item when it is not selected, removes it when it is.
|
|
206
|
+
*/
|
|
207
|
+
toggleItem(item: T): void;
|
|
208
|
+
/**
|
|
209
|
+
* Removes every selected item.
|
|
210
|
+
*/
|
|
211
|
+
clear(): void;
|
|
212
|
+
/**
|
|
213
|
+
* Clears the selection, the search term and the validity state.
|
|
214
|
+
*/
|
|
215
|
+
reset(): void;
|
|
216
|
+
/**
|
|
217
|
+
* Clears the search term and its results.
|
|
218
|
+
*/
|
|
219
|
+
softReset(): void;
|
|
220
|
+
/**
|
|
221
|
+
* Returns true if the field passes validity checks.
|
|
222
|
+
*/
|
|
223
|
+
checkValidity(): boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Runs checkValidity() method, and if it returns false, then it reports to the user that the field is invalid.
|
|
226
|
+
*/
|
|
227
|
+
reportValidity(): boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Called with the current search term after every keystroke. Override to supply remote results
|
|
230
|
+
* and call `showSuggestions()` when they arrive.
|
|
231
|
+
*/
|
|
232
|
+
protected onInputChanged(searchTerm: string): void;
|
|
233
|
+
/**
|
|
234
|
+
* Renders the given search results in the popover.
|
|
235
|
+
*/
|
|
236
|
+
protected showSuggestions(suggestions: Array<T>, totalSuggestionCount: number): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Unique key of an item. Used for list diffing and selection comparisons.
|
|
239
|
+
*/
|
|
240
|
+
protected getItemKey(item: T): string;
|
|
241
|
+
/**
|
|
242
|
+
* Text of an item shown in its chip and menu item.
|
|
243
|
+
*/
|
|
244
|
+
protected getItemText(item: T): string;
|
|
245
|
+
/**
|
|
246
|
+
* Material Symbols icon name of an item, or an empty string when it has none.
|
|
247
|
+
*/
|
|
248
|
+
protected getItemIcon(item: T): string;
|
|
249
|
+
static styles: import("lit").CSSResult[];
|
|
250
|
+
/**
|
|
251
|
+
* Renders the chip of a selected item. Override to customize.
|
|
252
|
+
*/
|
|
253
|
+
protected renderChip(item: T): TemplateResult<1>;
|
|
254
|
+
/**
|
|
255
|
+
* Renders a selectable item. Override to customize. Bind the item to the `item` property of the
|
|
256
|
+
* `md-menu-item` and keep `keep-open` so the popover stays open on selection.
|
|
257
|
+
*/
|
|
258
|
+
protected renderSuggestion(item: T): TemplateResult<1>;
|
|
259
|
+
/**
|
|
260
|
+
* Renders the header of a section. Override to customize.
|
|
261
|
+
*/
|
|
262
|
+
protected renderSectionHeader(section: TitaniumMultiSelectSection<T>): TemplateResult<1>;
|
|
263
|
+
/**
|
|
264
|
+
* Renders content at the bottom of the popover, below the selectable items.
|
|
265
|
+
*/
|
|
266
|
+
protected renderTrailingMenuSlot(): TemplateResult | typeof nothing;
|
|
267
|
+
render(): TemplateResult<1>;
|
|
268
|
+
}
|
|
269
|
+
declare global {
|
|
270
|
+
interface HTMLElementTagNameMap {
|
|
271
|
+
'titanium-multi-select-base': TitaniumMultiSelectBase;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=multi-select-base.d.ts.map
|