@nanahoshi/mona-ui 0.36.1 → 0.38.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/docs/api/common.md +1 -1
- package/docs/api/dropdown-list.md +2 -0
- package/docs/api/dropdown-tree.md +81 -0
- package/docs/api/dropdowns.md +34 -8
- package/docs/api/editor.md +67 -0
- package/docs/api/file-upload.md +1 -1
- package/docs/api/i18n.md +49 -4
- package/docs/api/list.md +1 -1
- package/docs/api/locales.md +14 -14
- package/docs/api/multi-select-tree.md +75 -0
- package/docs/api/multi-select.md +3 -1
- package/docs/api/popup.md +1 -1
- package/docs/api/tree-view.md +2 -2
- package/docs/auto-complete.md +2 -0
- package/docs/combo-box.md +2 -0
- package/docs/dropdown-list.md +52 -0
- package/docs/dropdown-tree.md +427 -0
- package/docs/editor.md +238 -9
- package/docs/multi-select-tree.md +353 -0
- package/docs/multi-select.md +6 -0
- package/dropdown-tree/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +40 -5
- package/fesm2022/nanahoshi-mona-ui-dropdown-tree.mjs +1061 -0
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +701 -60
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +1356 -192
- package/fesm2022/nanahoshi-mona-ui-file-upload.mjs +28 -94
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +63 -1
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +80 -37
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +83 -2
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +66 -1
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +30 -1
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +42 -1
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +42 -1
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +24 -1
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +42 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +24 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +24 -1
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +64 -1
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +42 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +64 -1
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +24 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +24 -1
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +24 -1
- package/fesm2022/nanahoshi-mona-ui-multi-select-tree.mjs +1179 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +42 -7
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +3 -1
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -1
- package/i18n/catalogs/en-US.messages.json +26 -1
- package/llms.txt +7 -3
- package/locales/ar-sa/ar-sa.messages.json +26 -1
- package/locales/de-de/de-de.messages.json +26 -1
- package/locales/es-es/es-es.messages.json +26 -1
- package/locales/fr-fr/fr-fr.messages.json +26 -1
- package/locales/id-id/id-id.messages.json +26 -1
- package/locales/it-it/it-it.messages.json +26 -1
- package/locales/ja-jp/ja-jp.messages.json +26 -1
- package/locales/ko-kr/ko-kr.messages.json +26 -1
- package/locales/pl-pl/pl-pl.messages.json +26 -1
- package/locales/pt-br/pt-br.messages.json +26 -1
- package/locales/ru-ru/ru-ru.messages.json +26 -1
- package/locales/tr-tr/tr-tr.messages.json +26 -1
- package/locales/zh-cn/zh-cn.messages.json +26 -1
- package/locales/zh-tw/zh-tw.messages.json +26 -1
- package/multi-select-tree/package.json +4 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +33 -5
- package/types/nanahoshi-mona-ui-dropdown-tree.d.ts +414 -0
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +198 -8
- package/types/nanahoshi-mona-ui-editor.d.ts +124 -2
- package/types/nanahoshi-mona-ui-file-upload.d.ts +1 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +44 -0
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +36 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +37 -0
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +25 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +25 -0
- package/types/nanahoshi-mona-ui-multi-select-tree.d.ts +456 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +43 -7
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { TemplateRef } from "@angular/core";
|
|
3
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
4
|
+
import { Predicate } from "@mirei/ts-collections";
|
|
5
|
+
import { PreventableEvent } from "@nanahoshi/mona-ui/common";
|
|
6
|
+
import * as i1 from "@nanahoshi/mona-ui/dropdowns";
|
|
7
|
+
import { AdaptiveMode, DropdownFieldPredicateType, DropdownFieldSelectorType, DropdownPopupInput } from "@nanahoshi/mona-ui/dropdowns";
|
|
8
|
+
import { ListSizeInputType } from "@nanahoshi/mona-ui/internal/list";
|
|
9
|
+
import { ChildrenSelector, DataStructure } from "@nanahoshi/mona-ui/internal/tree";
|
|
10
|
+
import { MultiSelectVariantInput } from "@nanahoshi/mona-ui/multi-select";
|
|
11
|
+
import { PopupCloseEvent } from "@nanahoshi/mona-ui/popup";
|
|
12
|
+
import { MonaMultiSelectTreeMessages } from "@nanahoshi/mona-ui/i18n";
|
|
13
|
+
/** A checked item, as its tag shows it. */
|
|
14
|
+
interface MultiSelectTreeTag<TData, TValue> {
|
|
15
|
+
/** The item, when its node is loaded or the value holds items. */
|
|
16
|
+
readonly data: TData | null;
|
|
17
|
+
readonly key: unknown;
|
|
18
|
+
readonly text: string;
|
|
19
|
+
readonly value: TValue;
|
|
20
|
+
}
|
|
21
|
+
export declare class MultiSelectTreeComponent<TData = unknown, TValue = TData> implements FormValueControl<Iterable<TValue>>, MultiSelectVariantInput, DropdownPopupInput {
|
|
22
|
+
#private;
|
|
23
|
+
/** While the popup is open and the field has focus (no filter box), the active node of the popup's tree. */
|
|
24
|
+
protected readonly activeDescendant: import("@angular/core").Signal<string | null>;
|
|
25
|
+
protected readonly affixClass: import("@angular/core").Signal<string>;
|
|
26
|
+
protected readonly baseClass: import("@angular/core").Signal<string>;
|
|
27
|
+
protected readonly chipMessages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaChipMessages>;
|
|
28
|
+
protected readonly clearButtonVisible: import("@angular/core").Signal<boolean>;
|
|
29
|
+
protected readonly describedBy: import("@angular/core").Signal<string | null>;
|
|
30
|
+
protected readonly effectiveAriaLabel: import("@angular/core").Signal<string>;
|
|
31
|
+
protected readonly effectiveDisabled: import("@angular/core").Signal<boolean>;
|
|
32
|
+
protected readonly expanded: import("@angular/core").Signal<boolean>;
|
|
33
|
+
protected readonly footerTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
34
|
+
protected readonly headerTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
35
|
+
protected readonly indicatorClass: import("@angular/core").Signal<string>;
|
|
36
|
+
protected readonly invalidState: import("@angular/core").Signal<boolean>;
|
|
37
|
+
protected readonly itemContainerClass: import("@angular/core").Signal<string>;
|
|
38
|
+
protected readonly itemTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
39
|
+
protected readonly labelledBy: import("@angular/core").Signal<string | null>;
|
|
40
|
+
protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaMultiSelectTreeMessages>;
|
|
41
|
+
protected readonly noDataTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
42
|
+
/** The field's name, which names the popup's tree and its filter box. */
|
|
43
|
+
protected readonly popupAriaLabel: import("@angular/core").Signal<string>;
|
|
44
|
+
/** The popup's size: large in a bottom sheet, for touch. */
|
|
45
|
+
protected readonly popupSize: import("@angular/core").Signal<"small" | "medium" | "large">;
|
|
46
|
+
protected readonly popupSurfaceClass: import("@angular/core").Signal<string>;
|
|
47
|
+
protected readonly popupTemplate: import("@angular/core").Signal<TemplateRef<unknown>>;
|
|
48
|
+
protected readonly prefixTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
49
|
+
protected readonly sheet: import("@angular/core").Signal<boolean>;
|
|
50
|
+
protected readonly summaryTagTemplate: import("@angular/core").Signal<TemplateRef<unknown> | null>;
|
|
51
|
+
protected readonly tagCount: import("@angular/core").Signal<number>;
|
|
52
|
+
protected readonly tagTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
53
|
+
/** One tag per checked item, in the order of the value. */
|
|
54
|
+
protected readonly tags: import("@angular/core").Signal<readonly MultiSelectTreeTag<TData, TValue>[]>;
|
|
55
|
+
protected readonly treeId: string;
|
|
56
|
+
/** The tags shown before the summary tag: all of them unless `monaMultiSelectSummaryTag` limits them. */
|
|
57
|
+
protected readonly visibleTags: import("@angular/core").Signal<readonly MultiSelectTreeTag<TData, TValue>[]>;
|
|
58
|
+
/**
|
|
59
|
+
* @description Opens the popup as a sheet along the bottom of the screen on a small screen (narrower than 640
|
|
60
|
+
* pixels) with `"auto"`, so it's easy to reach with a thumb. With `"none"`, it always opens under the field.
|
|
61
|
+
* @default "none"
|
|
62
|
+
*/
|
|
63
|
+
readonly adaptiveMode: import("@angular/core").InputSignal<AdaptiveMode>;
|
|
64
|
+
/**
|
|
65
|
+
* @description Title of the bottom sheet the popup opens as with `adaptiveMode="auto"`. When empty, the sheet
|
|
66
|
+
* shows the field's name.
|
|
67
|
+
* @default ""
|
|
68
|
+
*/
|
|
69
|
+
readonly adaptiveTitle: import("@angular/core").InputSignal<string>;
|
|
70
|
+
/**
|
|
71
|
+
* @description ID of an element that describes the multi-select tree, such as help text or an error message.
|
|
72
|
+
* @default ""
|
|
73
|
+
*/
|
|
74
|
+
readonly ariaDescribedBy: import("@angular/core").InputSignal<string>;
|
|
75
|
+
/**
|
|
76
|
+
* @description Accessible name of the multi-select tree. Describe what it represents. Falls back to
|
|
77
|
+
* {@link placeholder} when neither this nor `aria-labelledby` is set.
|
|
78
|
+
* @default ""
|
|
79
|
+
*/
|
|
80
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
81
|
+
/**
|
|
82
|
+
* @description ID of an external element that provides the accessible name of the multi-select tree.
|
|
83
|
+
* @default ""
|
|
84
|
+
*/
|
|
85
|
+
readonly ariaLabelledBy: import("@angular/core").InputSignal<string>;
|
|
86
|
+
/**
|
|
87
|
+
* @description Whether checking an item checks its children too, and unchecking it unchecks them.
|
|
88
|
+
* @default true
|
|
89
|
+
*/
|
|
90
|
+
readonly checkChildren: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
91
|
+
/**
|
|
92
|
+
* @description Whether an item is checked when all its children are, and unchecked when one of them isn't. An
|
|
93
|
+
* item with only some of its children checked shows a mixed checkbox.
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
readonly checkParents: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
97
|
+
/**
|
|
98
|
+
* @description Property name or accessor that gives a node's children, for `mode="hierarchical"`. An accessor
|
|
99
|
+
* may return an observable, which loads the children when the node is first opened; set `hasChildren` with it.
|
|
100
|
+
* @default ""
|
|
101
|
+
*/
|
|
102
|
+
readonly children: import("@angular/core").InputSignal<ChildrenSelector<TData>>;
|
|
103
|
+
/**
|
|
104
|
+
* @description Emitted when the popup is about to close. This event is preventable.
|
|
105
|
+
*/
|
|
106
|
+
readonly close: import("@angular/core").OutputEmitterRef<PopupCloseEvent<unknown>>;
|
|
107
|
+
/**
|
|
108
|
+
* @description Emitted after the popup closes.
|
|
109
|
+
*/
|
|
110
|
+
readonly closed: import("@angular/core").OutputEmitterRef<void>;
|
|
111
|
+
/**
|
|
112
|
+
* @description The items of the tree: its root items for `mode="hierarchical"`, or every item for `mode="flat"`.
|
|
113
|
+
* @default []
|
|
114
|
+
*/
|
|
115
|
+
readonly data: import("@angular/core").InputSignal<Iterable<TData>>;
|
|
116
|
+
/**
|
|
117
|
+
* @description Disables the component, preventing the popup from opening and blocking tag removal.
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
121
|
+
/**
|
|
122
|
+
* @description Whether an item has children, before they load. Needed when `children` returns an observable.
|
|
123
|
+
* @default null
|
|
124
|
+
*/
|
|
125
|
+
readonly hasChildren: import("@angular/core").InputSignal<Predicate<TData> | null>;
|
|
126
|
+
/**
|
|
127
|
+
* @description Property name that holds an item's unique id, for `mode="flat"`.
|
|
128
|
+
* @default ""
|
|
129
|
+
*/
|
|
130
|
+
readonly idField: import("@angular/core").InputSignal<string>;
|
|
131
|
+
/**
|
|
132
|
+
* @description Marks the multi-select tree as invalid. When bound to a signal form field via `[formField]`, this
|
|
133
|
+
* is written by the `FormField` directive.
|
|
134
|
+
* @default false
|
|
135
|
+
*/
|
|
136
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
137
|
+
/**
|
|
138
|
+
* @description Predicate or field name that tells whether an item is disabled. A disabled item can't be checked
|
|
139
|
+
* or opened, and neither can its children; checking its parent leaves it as it is.
|
|
140
|
+
* @default undefined
|
|
141
|
+
*/
|
|
142
|
+
readonly itemDisabled: import("@angular/core").InputSignal<DropdownFieldPredicateType<TData>>;
|
|
143
|
+
/**
|
|
144
|
+
* @description Shows a loading indicator, in place of the clear button, and marks the field busy. It doesn't
|
|
145
|
+
* block interaction: the field stays usable while data loads.
|
|
146
|
+
* @default false
|
|
147
|
+
*/
|
|
148
|
+
readonly loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
149
|
+
/**
|
|
150
|
+
* @description Shape of `data`: `"hierarchical"` for items that hold their children (see `children`), or
|
|
151
|
+
* `"flat"` for one list linked by `idField` and `parentIdField`.
|
|
152
|
+
* @default "hierarchical"
|
|
153
|
+
*/
|
|
154
|
+
readonly mode: import("@angular/core").InputSignal<DataStructure>;
|
|
155
|
+
/**
|
|
156
|
+
* @description Emitted when the popup is about to open. This event is preventable.
|
|
157
|
+
*/
|
|
158
|
+
readonly open: import("@angular/core").OutputEmitterRef<PreventableEvent<Event>>;
|
|
159
|
+
/**
|
|
160
|
+
* @description Emitted after the popup opens.
|
|
161
|
+
*/
|
|
162
|
+
readonly opened: import("@angular/core").OutputEmitterRef<void>;
|
|
163
|
+
/**
|
|
164
|
+
* @description Property name that holds an item's parent id, for `mode="flat"`. Items without one are roots.
|
|
165
|
+
* @default ""
|
|
166
|
+
*/
|
|
167
|
+
readonly parentIdField: import("@angular/core").InputSignal<string>;
|
|
168
|
+
/**
|
|
169
|
+
* @description Text shown when nothing is checked. It also names the multi-select tree when neither `aria-label`
|
|
170
|
+
* nor `aria-labelledby` is set.
|
|
171
|
+
* @default ""
|
|
172
|
+
*/
|
|
173
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
174
|
+
/**
|
|
175
|
+
* @description Additional CSS classes applied to the popup element.
|
|
176
|
+
* @default ""
|
|
177
|
+
*/
|
|
178
|
+
readonly popupClass: import("@angular/core").InputSignal<string>;
|
|
179
|
+
/**
|
|
180
|
+
* @description Maximum height of the popup, in pixels or as a CSS length. Shorter trees shrink to fit. When
|
|
181
|
+
* unset, the popup is at most 200 pixels tall.
|
|
182
|
+
* @default null
|
|
183
|
+
*/
|
|
184
|
+
readonly popupHeight: import("@angular/core").InputSignal<ListSizeInputType>;
|
|
185
|
+
/**
|
|
186
|
+
* @description Width of the popup element. When unset, the popup is as wide as the field.
|
|
187
|
+
* @default null
|
|
188
|
+
*/
|
|
189
|
+
readonly popupWidth: import("@angular/core").InputSignal<ListSizeInputType>;
|
|
190
|
+
/**
|
|
191
|
+
* @description Prevents value changes while preserving the component's visual state.
|
|
192
|
+
* @default false
|
|
193
|
+
*/
|
|
194
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
195
|
+
/**
|
|
196
|
+
* @description Marks the field as required: at least one item has to be checked.
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
200
|
+
/**
|
|
201
|
+
* @description Border-radius preset applied to the component.
|
|
202
|
+
* @default "medium"
|
|
203
|
+
*/
|
|
204
|
+
readonly rounded: import("@angular/core").InputSignal<"none" | "small" | "medium" | "large" | "full" | null | undefined>;
|
|
205
|
+
/**
|
|
206
|
+
* @description Shows a button that unchecks every item when at least one is checked.
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
readonly showClearButton: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
210
|
+
/**
|
|
211
|
+
* @description Size preset controlling the component's dimensions.
|
|
212
|
+
* @default "medium"
|
|
213
|
+
*/
|
|
214
|
+
readonly size: import("@angular/core").InputSignal<"small" | "medium" | "large" | null | undefined>;
|
|
215
|
+
/**
|
|
216
|
+
* @description Property name or accessor that gives an item's text. When unset, the item itself is the text.
|
|
217
|
+
* @default undefined
|
|
218
|
+
*/
|
|
219
|
+
readonly textField: import("@angular/core").InputSignal<DropdownFieldSelectorType<TData, string>>;
|
|
220
|
+
/**
|
|
221
|
+
* @description Emitted when focus leaves the multi-select tree. Moving between it, its tags, its clear button and
|
|
222
|
+
* its popup doesn't count. The `FormField` directive listens to this to mark the field as touched.
|
|
223
|
+
*/
|
|
224
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
225
|
+
/**
|
|
226
|
+
* @description Marks the control as touched. Set automatically by the `FormField` directive when bound via `[formField]`.
|
|
227
|
+
* @default false
|
|
228
|
+
*/
|
|
229
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
230
|
+
/**
|
|
231
|
+
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
232
|
+
* @default ""
|
|
233
|
+
*/
|
|
234
|
+
readonly userClass: import("@angular/core").InputSignal<string>;
|
|
235
|
+
/**
|
|
236
|
+
* @description The checked items, two-way bindable and compatible with Signal Forms via `[formField]`: the data
|
|
237
|
+
* items, or with {@link valuePrimitive}, the values {@link valueField} gives for them. A user's change lists them
|
|
238
|
+
* in the tree's order. Nothing checked is an empty array.
|
|
239
|
+
* @default []
|
|
240
|
+
*/
|
|
241
|
+
readonly value: import("@angular/core").ModelSignal<Iterable<TValue>>;
|
|
242
|
+
/**
|
|
243
|
+
* @description Property name or accessor that gives an item's value: what identifies the item, matches the
|
|
244
|
+
* values set from code to their nodes, and is the value with {@link valuePrimitive}. When unset, the item itself
|
|
245
|
+
* is the value. It should be a stable, unique scalar.
|
|
246
|
+
* @default undefined
|
|
247
|
+
*/
|
|
248
|
+
readonly valueField: import("@angular/core").InputSignal<DropdownFieldSelectorType<TData, unknown>>;
|
|
249
|
+
/**
|
|
250
|
+
* @description Whether the value holds what {@link valueField} gives for the checked items (`true`), or the items
|
|
251
|
+
* themselves (`false`).
|
|
252
|
+
* @default false
|
|
253
|
+
*/
|
|
254
|
+
readonly valuePrimitive: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
255
|
+
constructor();
|
|
256
|
+
/**
|
|
257
|
+
* @description Moves focus to the multi-select tree.
|
|
258
|
+
* @param options Passed to `HTMLElement.focus()`, for example `{ preventScroll: true }`.
|
|
259
|
+
*/
|
|
260
|
+
focus(options?: FocusOptions): void;
|
|
261
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
262
|
+
/** The summary tag's remove button unchecks the items it stands for, and leaves the rest as they are. */
|
|
263
|
+
protected onSummaryTagRemove(event: Event): void;
|
|
264
|
+
/** A tag's remove button unchecks its item, as unchecking it in the tree does (its children too). */
|
|
265
|
+
protected onTagRemove(event: Event, tag: MultiSelectTreeTag<TData, TValue>): void;
|
|
266
|
+
protected onValueClear(event: Event): void;
|
|
267
|
+
/** What identifies a value: the value itself with `valuePrimitive`, else what `valueField` gives for the item. */
|
|
268
|
+
private getValueKey;
|
|
269
|
+
private handlePopupPositionUpdate;
|
|
270
|
+
private setSubscriptions;
|
|
271
|
+
/** Checks or unchecks a node the way its checkbox does. Disabled nodes, and nodes without a checkbox, stay. */
|
|
272
|
+
private toggleNode;
|
|
273
|
+
private uncheckTag;
|
|
274
|
+
private updateValue;
|
|
275
|
+
/**
|
|
276
|
+
* Turns the tree's checked keys into the value: the loaded items in the tree's order, then the checked items whose
|
|
277
|
+
* nodes aren't loaded, kept from the current value.
|
|
278
|
+
*/
|
|
279
|
+
private updateValueFromKeys;
|
|
280
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectTreeComponent<any, any>, never>;
|
|
281
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MultiSelectTreeComponent<any, any>, "mona-multi-select-tree", never, {
|
|
282
|
+
"adaptiveMode": {
|
|
283
|
+
"alias": "adaptiveMode";
|
|
284
|
+
"required": false;
|
|
285
|
+
"isSignal": true;
|
|
286
|
+
};
|
|
287
|
+
"adaptiveTitle": {
|
|
288
|
+
"alias": "adaptiveTitle";
|
|
289
|
+
"required": false;
|
|
290
|
+
"isSignal": true;
|
|
291
|
+
};
|
|
292
|
+
"ariaDescribedBy": {
|
|
293
|
+
"alias": "aria-describedby";
|
|
294
|
+
"required": false;
|
|
295
|
+
"isSignal": true;
|
|
296
|
+
};
|
|
297
|
+
"ariaLabel": {
|
|
298
|
+
"alias": "aria-label";
|
|
299
|
+
"required": false;
|
|
300
|
+
"isSignal": true;
|
|
301
|
+
};
|
|
302
|
+
"ariaLabelledBy": {
|
|
303
|
+
"alias": "aria-labelledby";
|
|
304
|
+
"required": false;
|
|
305
|
+
"isSignal": true;
|
|
306
|
+
};
|
|
307
|
+
"checkChildren": {
|
|
308
|
+
"alias": "checkChildren";
|
|
309
|
+
"required": false;
|
|
310
|
+
"isSignal": true;
|
|
311
|
+
};
|
|
312
|
+
"checkParents": {
|
|
313
|
+
"alias": "checkParents";
|
|
314
|
+
"required": false;
|
|
315
|
+
"isSignal": true;
|
|
316
|
+
};
|
|
317
|
+
"children": {
|
|
318
|
+
"alias": "children";
|
|
319
|
+
"required": false;
|
|
320
|
+
"isSignal": true;
|
|
321
|
+
};
|
|
322
|
+
"data": {
|
|
323
|
+
"alias": "data";
|
|
324
|
+
"required": false;
|
|
325
|
+
"isSignal": true;
|
|
326
|
+
};
|
|
327
|
+
"disabled": {
|
|
328
|
+
"alias": "disabled";
|
|
329
|
+
"required": false;
|
|
330
|
+
"isSignal": true;
|
|
331
|
+
};
|
|
332
|
+
"hasChildren": {
|
|
333
|
+
"alias": "hasChildren";
|
|
334
|
+
"required": false;
|
|
335
|
+
"isSignal": true;
|
|
336
|
+
};
|
|
337
|
+
"idField": {
|
|
338
|
+
"alias": "idField";
|
|
339
|
+
"required": false;
|
|
340
|
+
"isSignal": true;
|
|
341
|
+
};
|
|
342
|
+
"invalid": {
|
|
343
|
+
"alias": "invalid";
|
|
344
|
+
"required": false;
|
|
345
|
+
"isSignal": true;
|
|
346
|
+
};
|
|
347
|
+
"itemDisabled": {
|
|
348
|
+
"alias": "itemDisabled";
|
|
349
|
+
"required": false;
|
|
350
|
+
"isSignal": true;
|
|
351
|
+
};
|
|
352
|
+
"loading": {
|
|
353
|
+
"alias": "loading";
|
|
354
|
+
"required": false;
|
|
355
|
+
"isSignal": true;
|
|
356
|
+
};
|
|
357
|
+
"mode": {
|
|
358
|
+
"alias": "mode";
|
|
359
|
+
"required": false;
|
|
360
|
+
"isSignal": true;
|
|
361
|
+
};
|
|
362
|
+
"parentIdField": {
|
|
363
|
+
"alias": "parentIdField";
|
|
364
|
+
"required": false;
|
|
365
|
+
"isSignal": true;
|
|
366
|
+
};
|
|
367
|
+
"placeholder": {
|
|
368
|
+
"alias": "placeholder";
|
|
369
|
+
"required": false;
|
|
370
|
+
"isSignal": true;
|
|
371
|
+
};
|
|
372
|
+
"popupClass": {
|
|
373
|
+
"alias": "popupClass";
|
|
374
|
+
"required": false;
|
|
375
|
+
"isSignal": true;
|
|
376
|
+
};
|
|
377
|
+
"popupHeight": {
|
|
378
|
+
"alias": "popupHeight";
|
|
379
|
+
"required": false;
|
|
380
|
+
"isSignal": true;
|
|
381
|
+
};
|
|
382
|
+
"popupWidth": {
|
|
383
|
+
"alias": "popupWidth";
|
|
384
|
+
"required": false;
|
|
385
|
+
"isSignal": true;
|
|
386
|
+
};
|
|
387
|
+
"readonly": {
|
|
388
|
+
"alias": "readonly";
|
|
389
|
+
"required": false;
|
|
390
|
+
"isSignal": true;
|
|
391
|
+
};
|
|
392
|
+
"required": {
|
|
393
|
+
"alias": "required";
|
|
394
|
+
"required": false;
|
|
395
|
+
"isSignal": true;
|
|
396
|
+
};
|
|
397
|
+
"rounded": {
|
|
398
|
+
"alias": "rounded";
|
|
399
|
+
"required": false;
|
|
400
|
+
"isSignal": true;
|
|
401
|
+
};
|
|
402
|
+
"showClearButton": {
|
|
403
|
+
"alias": "showClearButton";
|
|
404
|
+
"required": false;
|
|
405
|
+
"isSignal": true;
|
|
406
|
+
};
|
|
407
|
+
"size": {
|
|
408
|
+
"alias": "size";
|
|
409
|
+
"required": false;
|
|
410
|
+
"isSignal": true;
|
|
411
|
+
};
|
|
412
|
+
"textField": {
|
|
413
|
+
"alias": "textField";
|
|
414
|
+
"required": false;
|
|
415
|
+
"isSignal": true;
|
|
416
|
+
};
|
|
417
|
+
"touched": {
|
|
418
|
+
"alias": "touched";
|
|
419
|
+
"required": false;
|
|
420
|
+
"isSignal": true;
|
|
421
|
+
};
|
|
422
|
+
"userClass": {
|
|
423
|
+
"alias": "class";
|
|
424
|
+
"required": false;
|
|
425
|
+
"isSignal": true;
|
|
426
|
+
};
|
|
427
|
+
"value": {
|
|
428
|
+
"alias": "value";
|
|
429
|
+
"required": false;
|
|
430
|
+
"isSignal": true;
|
|
431
|
+
};
|
|
432
|
+
"valueField": {
|
|
433
|
+
"alias": "valueField";
|
|
434
|
+
"required": false;
|
|
435
|
+
"isSignal": true;
|
|
436
|
+
};
|
|
437
|
+
"valuePrimitive": {
|
|
438
|
+
"alias": "valuePrimitive";
|
|
439
|
+
"required": false;
|
|
440
|
+
"isSignal": true;
|
|
441
|
+
};
|
|
442
|
+
}, {
|
|
443
|
+
"close": "close";
|
|
444
|
+
"closed": "closed";
|
|
445
|
+
"open": "open";
|
|
446
|
+
"opened": "opened";
|
|
447
|
+
"touch": "touch";
|
|
448
|
+
"value": "valueChange";
|
|
449
|
+
}, ["footerTemplate", "headerTemplate", "itemTemplate", "noDataTemplate", "prefixTemplate", "tagTemplate"], never, true, [{
|
|
450
|
+
directive: typeof i1.DropdownTreePopupHandlerDirective;
|
|
451
|
+
inputs: {};
|
|
452
|
+
outputs: {};
|
|
453
|
+
}]>;
|
|
454
|
+
}
|
|
455
|
+
export declare const MULTI_SELECT_TREE_DEFAULT_MESSAGES: MonaMultiSelectTreeMessages;
|
|
456
|
+
export {};
|
|
@@ -3,24 +3,28 @@ import { TemplateRef } from "@angular/core";
|
|
|
3
3
|
import { FormValueControl } from "@angular/forms/signals";
|
|
4
4
|
import { PreventableEvent } from "@nanahoshi/mona-ui/common";
|
|
5
5
|
import * as i1 from "@nanahoshi/mona-ui/dropdowns";
|
|
6
|
-
import { DropdownDataInput, DropdownFieldPredicateType, DropdownFieldSelectorType, DropdownPopupInput, DropdownPopupVariantInput } from "@nanahoshi/mona-ui/dropdowns";
|
|
6
|
+
import { AdaptiveMode, DropdownDataInput, DropdownFieldPredicateType, DropdownFieldSelectorType, DropdownPopupInput, DropdownPopupVariantInput } from "@nanahoshi/mona-ui/dropdowns";
|
|
7
7
|
import { ListItem, ListSizeInputType } from "@nanahoshi/mona-ui/internal/list";
|
|
8
8
|
import { PopupCloseEvent } from "@nanahoshi/mona-ui/popup";
|
|
9
9
|
import { VariantInputs } from "@nanahoshi/mona-ui/internal";
|
|
10
10
|
import { VariantProps } from "class-variance-authority";
|
|
11
11
|
import { MonaMultiSelectMessages } from "@nanahoshi/mona-ui/i18n";
|
|
12
|
-
|
|
12
|
+
/** @hidden Shared with the multi-select tree, which looks the same. */
|
|
13
|
+
export declare const multiSelectBaseThemeVariants: (props?: ({
|
|
13
14
|
disabled?: boolean | null | undefined;
|
|
14
15
|
focused?: boolean | null | undefined;
|
|
15
16
|
invalid?: boolean | null | undefined;
|
|
16
17
|
rounded?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
|
17
18
|
size?: "small" | "medium" | "large" | null | undefined;
|
|
18
19
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
|
-
|
|
20
|
+
/** @hidden Shared with the multi-select tree, which looks the same. */
|
|
21
|
+
export declare const multiSelectItemContainerThemeVariants: (props?: ({
|
|
20
22
|
rounded?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
|
21
23
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
|
-
|
|
23
|
-
declare const
|
|
24
|
+
/** @hidden Shared with the multi-select tree, which looks the same. */
|
|
25
|
+
export declare const multiSelectAffixContainerThemeVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
26
|
+
/** @hidden Shared with the multi-select tree, which looks the same. */
|
|
27
|
+
export declare const multiSelectIndicatorContainerThemeVariants: (props?: ({
|
|
24
28
|
size?: "small" | "medium" | "large" | null | undefined;
|
|
25
29
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
26
30
|
type MultiSelectBaseVariantProps = VariantProps<typeof multiSelectBaseThemeVariants>;
|
|
@@ -54,17 +58,32 @@ export declare class MultiSelectComponent<TData = unknown, TValue = TData> imple
|
|
|
54
58
|
protected readonly labelledBy: import("@angular/core").Signal<string | null>;
|
|
55
59
|
protected readonly listId: string;
|
|
56
60
|
protected readonly listPopupClass: import("@angular/core").Signal<string>;
|
|
61
|
+
/** The list's size: large in a bottom sheet, for touch. */
|
|
62
|
+
protected readonly listSize: import("@angular/core").Signal<"small" | "medium" | "large" | null | undefined>;
|
|
57
63
|
protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaMultiSelectMessages>;
|
|
58
64
|
protected readonly noDataTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
59
65
|
protected readonly popupTemplate: import("@angular/core").Signal<TemplateRef<unknown>>;
|
|
60
66
|
protected readonly prefixTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
61
67
|
protected readonly selectedDataItems: import("@angular/core").Signal<import("@mirei/ts-collections").ImmutableSet<TData>>;
|
|
62
68
|
protected readonly selectedListItems: import("@angular/core").Signal<import("@mirei/ts-collections").ImmutableSet<ListItem<TData>>>;
|
|
69
|
+
protected readonly sheet: import("@angular/core").Signal<boolean>;
|
|
63
70
|
protected readonly summaryTagTemplate: import("@angular/core").Signal<TemplateRef<unknown> | null>;
|
|
64
71
|
protected readonly tagCount: import("@angular/core").Signal<number>;
|
|
65
72
|
protected readonly tagTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
66
73
|
protected readonly valueTextMap: import("@angular/core").Signal<import("@mirei/ts-collections").ImmutableDictionary<ListItem<TData>, string>>;
|
|
67
74
|
protected readonly visibleTagCount: import("@angular/core").Signal<number>;
|
|
75
|
+
/**
|
|
76
|
+
* @description Opens the popup as a sheet along the bottom of the screen on a small screen (narrower than 640
|
|
77
|
+
* pixels) with `"auto"`, so it's easy to reach with a thumb. With `"none"`, it always opens under the field.
|
|
78
|
+
* @default "none"
|
|
79
|
+
*/
|
|
80
|
+
readonly adaptiveMode: import("@angular/core").InputSignal<AdaptiveMode>;
|
|
81
|
+
/**
|
|
82
|
+
* @description Title of the bottom sheet the popup opens as with `adaptiveMode="auto"`. When empty, the sheet
|
|
83
|
+
* shows the field's name.
|
|
84
|
+
* @default ""
|
|
85
|
+
*/
|
|
86
|
+
readonly adaptiveTitle: import("@angular/core").InputSignal<string>;
|
|
68
87
|
/**
|
|
69
88
|
* @description Lets people add values that aren't in {@link data}: Enter in the popup's filter box, on text that
|
|
70
89
|
* matches no item, emits {@link valueAdd} with the text, and an item whose text it matches is selected instead.
|
|
@@ -285,6 +304,16 @@ export declare class MultiSelectComponent<TData = unknown, TValue = TData> imple
|
|
|
285
304
|
private warnIfCustomValueHasNoFilter;
|
|
286
305
|
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectComponent<any, any>, never>;
|
|
287
306
|
static ɵcmp: i0.ɵɵComponentDeclaration<MultiSelectComponent<any, any>, "mona-multi-select", never, {
|
|
307
|
+
"adaptiveMode": {
|
|
308
|
+
"alias": "adaptiveMode";
|
|
309
|
+
"required": false;
|
|
310
|
+
"isSignal": true;
|
|
311
|
+
};
|
|
312
|
+
"adaptiveTitle": {
|
|
313
|
+
"alias": "adaptiveTitle";
|
|
314
|
+
"required": false;
|
|
315
|
+
"isSignal": true;
|
|
316
|
+
};
|
|
288
317
|
"allowCustomValue": {
|
|
289
318
|
"alias": "allowCustomValue";
|
|
290
319
|
"required": false;
|
|
@@ -453,7 +482,7 @@ export declare class MultiSelectSummaryTagDirective {
|
|
|
453
482
|
readonly tagCount: import("@angular/core").InputSignal<number>;
|
|
454
483
|
constructor();
|
|
455
484
|
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectSummaryTagDirective, never>;
|
|
456
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MultiSelectSummaryTagDirective, "mona-multi-select[monaMultiSelectSummaryTag]", never, {
|
|
485
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MultiSelectSummaryTagDirective, "mona-multi-select[monaMultiSelectSummaryTag], mona-multi-select-tree[monaMultiSelectSummaryTag]", never, {
|
|
457
486
|
"tagCount": {
|
|
458
487
|
"alias": "monaMultiSelectSummaryTag";
|
|
459
488
|
"required": false;
|
|
@@ -470,4 +499,11 @@ export declare class MultiSelectTagTemplateDirective {
|
|
|
470
499
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MultiSelectTagTemplateDirective, "ng-template[monaMultiSelectTagTemplate]", never, {}, {}, never, never, true, never>;
|
|
471
500
|
}
|
|
472
501
|
export declare const MULTI_SELECT_DEFAULT_MESSAGES: MonaMultiSelectMessages;
|
|
473
|
-
|
|
502
|
+
/** @hidden The summary tag settings a multi-select or multi-select tree shares with its directives. */
|
|
503
|
+
export declare class MultiSelectService {
|
|
504
|
+
readonly summaryTagTemplate: import("@angular/core").WritableSignal<TemplateRef<unknown> | null>;
|
|
505
|
+
readonly tagCount: import("@angular/core").WritableSignal<number>;
|
|
506
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectService, never>;
|
|
507
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
508
|
+
}
|
|
509
|
+
export type { MultiSelectVariantInput, MultiSelectVariantProps };
|