mn-angular-lib 1.0.174 → 1.0.176
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/fesm2022/mn-angular-lib.mjs +367 -12
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +1 -1
- package/types/mn-angular-lib.d.ts +139 -3
package/package.json
CHANGED
|
@@ -684,6 +684,11 @@ type MnInputBaseProps = {
|
|
|
684
684
|
* Use it to give an accessible name to an input rendered without a visible label.
|
|
685
685
|
*/
|
|
686
686
|
ariaLabel?: string;
|
|
687
|
+
/**
|
|
688
|
+
* Id of the option a surrounding listbox has highlighted, set as `aria-activedescendant`. Used by
|
|
689
|
+
* the select's search box, which keeps focus while the arrow keys move through the options.
|
|
690
|
+
*/
|
|
691
|
+
ariaActiveDescendant?: string | null;
|
|
687
692
|
/** Input mask (e.g., '(000) 000-0000') */
|
|
688
693
|
mask?: string;
|
|
689
694
|
/** Autocomplete attribute */
|
|
@@ -2858,6 +2863,8 @@ declare class MnMultiSelect implements OnInit {
|
|
|
2858
2863
|
private readonly destroyRef;
|
|
2859
2864
|
private readonly renderer;
|
|
2860
2865
|
private readonly cdr;
|
|
2866
|
+
/** Injector for the after-render scroll of the highlighted option. */
|
|
2867
|
+
private readonly injector;
|
|
2861
2868
|
/** Reference to the trigger element for positioning the dropdown */
|
|
2862
2869
|
triggerRef: ElementRef<HTMLElement>;
|
|
2863
2870
|
/** Layout classes for the anchored popover panel. The mobile sheet is rendered by
|
|
@@ -2926,6 +2933,11 @@ declare class MnMultiSelect implements OnInit {
|
|
|
2926
2933
|
isOpen: boolean;
|
|
2927
2934
|
isDisabled: boolean;
|
|
2928
2935
|
searchTerm: string;
|
|
2936
|
+
/**
|
|
2937
|
+
* Position in `filteredOptions` of the option the keyboard is on, or -1 for none. Reset when the
|
|
2938
|
+
* list it indexes changes (a search) or goes away (close), so it never points at a stale row.
|
|
2939
|
+
*/
|
|
2940
|
+
activeIndex: number;
|
|
2929
2941
|
/** Dropdown position calculated from trigger bounding rect */
|
|
2930
2942
|
/** Inline placement of the anchored panel; `maxHeight` only binds when the viewport is the tighter cap. */
|
|
2931
2943
|
dropdownStyle: {
|
|
@@ -3041,7 +3053,53 @@ declare class MnMultiSelect implements OnInit {
|
|
|
3041
3053
|
removeOption(option: MnMultiSelectOption, event: Event): void;
|
|
3042
3054
|
isSelected(option: MnMultiSelectOption): boolean;
|
|
3043
3055
|
isMaxReached(option: MnMultiSelectOption): boolean;
|
|
3056
|
+
/** Filters the options; the first match is highlighted so Enter toggles it, none once the box is cleared. */
|
|
3044
3057
|
onSearch(term: string): void;
|
|
3058
|
+
/**
|
|
3059
|
+
* Whether the keyboard may highlight an option: not disabled, and not blocked by `maxSelections`.
|
|
3060
|
+
* An arrow function so it can be handed to `stepEnabledIndex` as it is.
|
|
3061
|
+
*/
|
|
3062
|
+
private readonly isChoosable;
|
|
3063
|
+
/** Id of the keyboard-highlighted option, for `aria-activedescendant`; null when none is. */
|
|
3064
|
+
get activeOptionId(): string | null;
|
|
3065
|
+
/**
|
|
3066
|
+
* The DOM id of the option rendered at a position in `filteredOptions`.
|
|
3067
|
+
* @param index - The option's position.
|
|
3068
|
+
* @returns The id, unique per multi-select.
|
|
3069
|
+
*/
|
|
3070
|
+
optionId(index: number): string;
|
|
3071
|
+
/**
|
|
3072
|
+
* Keyboard handling for the trigger and the search box, the WAI-ARIA combobox pattern. While
|
|
3073
|
+
* closed, ArrowDown, ArrowUp, Enter and Space open the list with an option highlighted. While
|
|
3074
|
+
* open, the arrows move the highlight past disabled options without wrapping, Home and End jump
|
|
3075
|
+
* to the ends, Enter (and Space outside the search box) toggles the highlighted option and keeps the list open for the next one, Escape closes and Tab closes and lets focus move on. Enter and Space
|
|
3076
|
+
* stop here, so they can never submit a surrounding form or close a surrounding modal.
|
|
3077
|
+
* @param event - The keydown.
|
|
3078
|
+
* @param fromSearch - True when it came from the search box, where Space, Home and End edit text.
|
|
3079
|
+
*/
|
|
3080
|
+
onKeydown(event: KeyboardEvent, fromSearch?: boolean): void;
|
|
3081
|
+
/**
|
|
3082
|
+
* Moves the highlight one enabled option from `from` and scrolls it into view.
|
|
3083
|
+
* @param from - Where to step from; -1 to start at an end.
|
|
3084
|
+
* @param step - 1 for down, -1 for up.
|
|
3085
|
+
*/
|
|
3086
|
+
private moveActive;
|
|
3087
|
+
/**
|
|
3088
|
+
* Toggles the highlighted option. The list stays open, as it does for a click, so several options
|
|
3089
|
+
* can be picked in a row.
|
|
3090
|
+
* @param event - The Enter or Space keydown, claimed so a form around the field is not submitted.
|
|
3091
|
+
*/
|
|
3092
|
+
private toggleActive;
|
|
3093
|
+
/**
|
|
3094
|
+
* Takes a key for the field: no default action (no scroll, no form submit) and no bubbling to a
|
|
3095
|
+
* surrounding modal's own Enter or Escape handling.
|
|
3096
|
+
* @param event - The keydown to claim.
|
|
3097
|
+
*/
|
|
3098
|
+
private claim;
|
|
3099
|
+
/** Scrolls the highlighted option into view once the render that paints its ring has run. */
|
|
3100
|
+
private revealActiveOption;
|
|
3101
|
+
/** Puts focus back on the trigger. */
|
|
3102
|
+
private focusTrigger;
|
|
3045
3103
|
get filteredOptions(): MnMultiSelectOption[];
|
|
3046
3104
|
get selectedOptions(): MnMultiSelectOption[];
|
|
3047
3105
|
/**
|
|
@@ -4047,6 +4105,11 @@ declare class MnSelect implements OnInit {
|
|
|
4047
4105
|
isOpen: boolean;
|
|
4048
4106
|
isDisabled: boolean;
|
|
4049
4107
|
searchTerm: string;
|
|
4108
|
+
/**
|
|
4109
|
+
* Position in `filteredOptions` of the option the keyboard is on, or -1 for none. Reset when the
|
|
4110
|
+
* list it indexes changes (a search) or goes away (close), so it never points at a stale row.
|
|
4111
|
+
*/
|
|
4112
|
+
activeIndex: number;
|
|
4050
4113
|
protected uiConfig: MnSelectUIConfig;
|
|
4051
4114
|
private readonly configService;
|
|
4052
4115
|
private readonly sectionPath;
|
|
@@ -4056,6 +4119,7 @@ declare class MnSelect implements OnInit {
|
|
|
4056
4119
|
private readonly destroyRef;
|
|
4057
4120
|
private readonly renderer;
|
|
4058
4121
|
private readonly cdr;
|
|
4122
|
+
private readonly injector;
|
|
4059
4123
|
/** Lucide data for the trailing check shown on the selected row. */
|
|
4060
4124
|
protected readonly checkIcon: mn_angular_lib.LucideIconData;
|
|
4061
4125
|
/** Reference to the trigger element for positioning the dropdown. */
|
|
@@ -4189,7 +4253,42 @@ declare class MnSelect implements OnInit {
|
|
|
4189
4253
|
/** Selects an option, notifies the form and closes — a single choice ends the interaction. */
|
|
4190
4254
|
selectOption(option: MnSelectOption): void;
|
|
4191
4255
|
isSelected(option: MnSelectOption): boolean;
|
|
4256
|
+
/** Filters the options; the first match is highlighted so Enter picks it, none once the box is cleared. */
|
|
4192
4257
|
onSearch(term: string | null): void;
|
|
4258
|
+
/** Id of the keyboard-highlighted option, for `aria-activedescendant`; null when none is. */
|
|
4259
|
+
get activeOptionId(): string | null;
|
|
4260
|
+
/**
|
|
4261
|
+
* The DOM id of the option rendered at a position in `filteredOptions`.
|
|
4262
|
+
* @param index - The option's position.
|
|
4263
|
+
* @returns The id, unique per select.
|
|
4264
|
+
*/
|
|
4265
|
+
optionId(index: number): string;
|
|
4266
|
+
/**
|
|
4267
|
+
* Keyboard handling for the trigger and the search box, the WAI-ARIA combobox pattern. While
|
|
4268
|
+
* closed, ArrowDown, ArrowUp, Enter and Space open the list with an option highlighted. While
|
|
4269
|
+
* open, the arrows move the highlight past disabled options without wrapping, Home and End jump
|
|
4270
|
+
* to the ends, Enter (and Space outside the search box) chooses the highlighted option and returns focus to the trigger, Escape closes and Tab closes and lets focus move on. Enter and Space
|
|
4271
|
+
* stop here, so they can never submit a surrounding form or close a surrounding modal.
|
|
4272
|
+
* @param event - The keydown.
|
|
4273
|
+
* @param fromSearch - True when it came from the search box, where Space, Home and End edit text.
|
|
4274
|
+
*/
|
|
4275
|
+
onKeydown(event: KeyboardEvent, fromSearch?: boolean): void;
|
|
4276
|
+
/**
|
|
4277
|
+
* Moves the highlight one enabled option from `from` and scrolls it into view.
|
|
4278
|
+
* @param from - Where to step from; -1 to start at an end.
|
|
4279
|
+
* @param step - 1 for down, -1 for up.
|
|
4280
|
+
*/
|
|
4281
|
+
private moveActive;
|
|
4282
|
+
/**
|
|
4283
|
+
* Chooses the highlighted option (or just closes when none is) and hands focus back to the trigger,
|
|
4284
|
+
* because the search box that may hold it is removed with the panel.
|
|
4285
|
+
* @param event - The Enter or Space keydown, claimed so a form around the select is not submitted.
|
|
4286
|
+
*/
|
|
4287
|
+
private chooseActive;
|
|
4288
|
+
/** Scrolls the highlighted option into view once the render that paints its ring has run. */
|
|
4289
|
+
private revealActiveOption;
|
|
4290
|
+
/** Puts focus back on the trigger. */
|
|
4291
|
+
private focusTrigger;
|
|
4193
4292
|
/**
|
|
4194
4293
|
* The single close path. Every trigger (outside click, Escape, scroll, resize, the trigger
|
|
4195
4294
|
* being hidden, a choice) funnels through here so the open-only listeners are always torn
|
|
@@ -7493,6 +7592,14 @@ declare class MnList<T = unknown> extends MnSelectableCollectionBase<T, ListData
|
|
|
7493
7592
|
/** Skeleton lines rendered for each placeholder item, falling back to the default two-bar layout. */
|
|
7494
7593
|
get skeletonLines(): Partial<MnSkeletonProps>[];
|
|
7495
7594
|
onItemClick(item: T): void;
|
|
7595
|
+
/**
|
|
7596
|
+
* Keyboard activation of a clickable item: Enter and Space open it, as they would a button.
|
|
7597
|
+
* Handled on keydown so Space does not scroll the page first, and only when the item itself has
|
|
7598
|
+
* focus, so a checkbox or button inside the item keeps its own keys.
|
|
7599
|
+
* @param event - The keydown on the item.
|
|
7600
|
+
* @param item - The item the key was pressed on.
|
|
7601
|
+
*/
|
|
7602
|
+
onItemKeydown(event: KeyboardEvent, item: T): void;
|
|
7496
7603
|
/**
|
|
7497
7604
|
* The toolbar template the base class watches for identity changes. Prefers the
|
|
7498
7605
|
* left slot, then the right, then the deprecated `toolbarTemplate`, so a list
|
|
@@ -7612,6 +7719,14 @@ declare class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>>
|
|
|
7612
7719
|
protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
|
|
7613
7720
|
protected collectionBody?: ElementRef<HTMLElement>;
|
|
7614
7721
|
onItemClick(item: T): void;
|
|
7722
|
+
/**
|
|
7723
|
+
* Keyboard activation of a clickable item: Enter and Space open it, as they would a button.
|
|
7724
|
+
* Handled on keydown so Space does not scroll the page first, and only when the item itself has
|
|
7725
|
+
* focus, so a checkbox or button inside the item keeps its own keys.
|
|
7726
|
+
* @param event - The keydown on the item.
|
|
7727
|
+
* @param item - The item the key was pressed on.
|
|
7728
|
+
*/
|
|
7729
|
+
onItemKeydown(event: KeyboardEvent, item: T): void;
|
|
7615
7730
|
protected applyFilter(searchForItems: boolean): void;
|
|
7616
7731
|
/** Accessible name for the scrollable grid region. */
|
|
7617
7732
|
get gridRegionLabel(): string;
|
|
@@ -10012,11 +10127,16 @@ declare class MnCard {
|
|
|
10012
10127
|
* same at every size.
|
|
10013
10128
|
*/
|
|
10014
10129
|
declare const mnIconChipVariants: tailwind_variants.TVReturnType<{
|
|
10015
|
-
/**
|
|
10130
|
+
/**
|
|
10131
|
+
* `xs` for compact rows and inline labels, `sm` for list rows, `md` for section-card headers
|
|
10132
|
+
* and stat tiles, `lg` for page headers, `xl` for a lone hero or empty-state icon.
|
|
10133
|
+
*/
|
|
10016
10134
|
size: {
|
|
10135
|
+
xs: string;
|
|
10017
10136
|
sm: string;
|
|
10018
10137
|
md: string;
|
|
10019
10138
|
lg: string;
|
|
10139
|
+
xl: string;
|
|
10020
10140
|
};
|
|
10021
10141
|
color: {
|
|
10022
10142
|
primary: string;
|
|
@@ -10028,11 +10148,16 @@ declare const mnIconChipVariants: tailwind_variants.TVReturnType<{
|
|
|
10028
10148
|
gray: string;
|
|
10029
10149
|
};
|
|
10030
10150
|
}, undefined, "inline-flex shrink-0 items-center justify-center", {
|
|
10031
|
-
/**
|
|
10151
|
+
/**
|
|
10152
|
+
* `xs` for compact rows and inline labels, `sm` for list rows, `md` for section-card headers
|
|
10153
|
+
* and stat tiles, `lg` for page headers, `xl` for a lone hero or empty-state icon.
|
|
10154
|
+
*/
|
|
10032
10155
|
size: {
|
|
10156
|
+
xs: string;
|
|
10033
10157
|
sm: string;
|
|
10034
10158
|
md: string;
|
|
10035
10159
|
lg: string;
|
|
10160
|
+
xl: string;
|
|
10036
10161
|
};
|
|
10037
10162
|
color: {
|
|
10038
10163
|
primary: string;
|
|
@@ -10044,11 +10169,16 @@ declare const mnIconChipVariants: tailwind_variants.TVReturnType<{
|
|
|
10044
10169
|
gray: string;
|
|
10045
10170
|
};
|
|
10046
10171
|
}, undefined, tailwind_variants.TVReturnType<{
|
|
10047
|
-
/**
|
|
10172
|
+
/**
|
|
10173
|
+
* `xs` for compact rows and inline labels, `sm` for list rows, `md` for section-card headers
|
|
10174
|
+
* and stat tiles, `lg` for page headers, `xl` for a lone hero or empty-state icon.
|
|
10175
|
+
*/
|
|
10048
10176
|
size: {
|
|
10177
|
+
xs: string;
|
|
10049
10178
|
sm: string;
|
|
10050
10179
|
md: string;
|
|
10051
10180
|
lg: string;
|
|
10181
|
+
xl: string;
|
|
10052
10182
|
};
|
|
10053
10183
|
color: {
|
|
10054
10184
|
primary: string;
|
|
@@ -10131,6 +10261,12 @@ type MnProportionSegment = {
|
|
|
10131
10261
|
value: number;
|
|
10132
10262
|
/** Colour of this run; `gray` for the part that has no answer yet. */
|
|
10133
10263
|
color: NonNullable<MnIconChipVariants['color']>;
|
|
10264
|
+
/**
|
|
10265
|
+
* Draw the run as a pale tint of its colour instead of solid. For a part that is on its way but
|
|
10266
|
+
* not there yet, next to a solid run of the same colour: spots asked about but not answered,
|
|
10267
|
+
* payments announced but not received.
|
|
10268
|
+
*/
|
|
10269
|
+
soft?: boolean;
|
|
10134
10270
|
};
|
|
10135
10271
|
/** Configuration of one {@link MnProportionBar}. */
|
|
10136
10272
|
type MnProportionBarTypes = {
|