@cute-widgets/base 20.0.1
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 +1 -0
- package/LICENSE.md +191 -0
- package/README.md +190 -0
- package/abstract/index.d.ts +327 -0
- package/alert/index.d.ts +68 -0
- package/autocomplete/index.d.ts +442 -0
- package/badge/index.d.ts +26 -0
- package/bottom-sheet/index.d.ts +231 -0
- package/button/index.d.ts +182 -0
- package/button-toggle/index.d.ts +225 -0
- package/card/index.d.ts +163 -0
- package/checkbox/index.d.ts +174 -0
- package/chips/index.d.ts +963 -0
- package/collapse/index.d.ts +97 -0
- package/core/animation/index.d.ts +43 -0
- package/core/datetime/index.d.ts +404 -0
- package/core/directives/index.d.ts +168 -0
- package/core/error/index.d.ts +74 -0
- package/core/index.d.ts +1039 -0
- package/core/interfaces/index.d.ts +114 -0
- package/core/layout/index.d.ts +53 -0
- package/core/line/index.d.ts +37 -0
- package/core/nav/index.d.ts +321 -0
- package/core/observers/index.d.ts +124 -0
- package/core/option/index.d.ts +185 -0
- package/core/pipes/index.d.ts +53 -0
- package/core/ripple/index.d.ts +66 -0
- package/core/testing/index.d.ts +154 -0
- package/core/theming/index.d.ts +118 -0
- package/core/types/index.d.ts +53 -0
- package/core/utils/index.d.ts +129 -0
- package/cute-widgets-base-20.0.1.tgz +0 -0
- package/datepicker/index.d.ts +1817 -0
- package/dialog/index.d.ts +484 -0
- package/divider/index.d.ts +24 -0
- package/expansion/README.md +8 -0
- package/expansion/index.d.ts +308 -0
- package/fesm2022/cute-widgets-base-abstract.mjs +547 -0
- package/fesm2022/cute-widgets-base-abstract.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-alert.mjs +198 -0
- package/fesm2022/cute-widgets-base-alert.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-autocomplete.mjs +1217 -0
- package/fesm2022/cute-widgets-base-autocomplete.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-badge.mjs +75 -0
- package/fesm2022/cute-widgets-base-badge.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-bottom-sheet.mjs +416 -0
- package/fesm2022/cute-widgets-base-bottom-sheet.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-button-toggle.mjs +640 -0
- package/fesm2022/cute-widgets-base-button-toggle.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-button.mjs +546 -0
- package/fesm2022/cute-widgets-base-button.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-card.mjs +471 -0
- package/fesm2022/cute-widgets-base-card.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-checkbox.mjs +390 -0
- package/fesm2022/cute-widgets-base-checkbox.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-chips.mjs +2360 -0
- package/fesm2022/cute-widgets-base-chips.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-collapse.mjs +259 -0
- package/fesm2022/cute-widgets-base-collapse.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-animation.mjs +53 -0
- package/fesm2022/cute-widgets-base-core-animation.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-datetime.mjs +568 -0
- package/fesm2022/cute-widgets-base-core-datetime.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-directives.mjs +404 -0
- package/fesm2022/cute-widgets-base-core-directives.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-error.mjs +105 -0
- package/fesm2022/cute-widgets-base-core-error.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-interfaces.mjs +22 -0
- package/fesm2022/cute-widgets-base-core-interfaces.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-layout.mjs +74 -0
- package/fesm2022/cute-widgets-base-core-layout.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-line.mjs +87 -0
- package/fesm2022/cute-widgets-base-core-line.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-nav.mjs +863 -0
- package/fesm2022/cute-widgets-base-core-nav.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-observers.mjs +304 -0
- package/fesm2022/cute-widgets-base-core-observers.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-option.mjs +373 -0
- package/fesm2022/cute-widgets-base-core-option.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-pipes.mjs +97 -0
- package/fesm2022/cute-widgets-base-core-pipes.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-ripple.mjs +172 -0
- package/fesm2022/cute-widgets-base-core-ripple.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-testing.mjs +210 -0
- package/fesm2022/cute-widgets-base-core-testing.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-theming.mjs +314 -0
- package/fesm2022/cute-widgets-base-core-theming.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-types.mjs +22 -0
- package/fesm2022/cute-widgets-base-core-types.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core-utils.mjs +257 -0
- package/fesm2022/cute-widgets-base-core-utils.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-core.mjs +1600 -0
- package/fesm2022/cute-widgets-base-core.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-datepicker.mjs +4827 -0
- package/fesm2022/cute-widgets-base-datepicker.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-dialog.mjs +1046 -0
- package/fesm2022/cute-widgets-base-dialog.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-divider.mjs +86 -0
- package/fesm2022/cute-widgets-base-divider.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-expansion.mjs +623 -0
- package/fesm2022/cute-widgets-base-expansion.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-form-field.mjs +969 -0
- package/fesm2022/cute-widgets-base-form-field.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-grid-list.mjs +715 -0
- package/fesm2022/cute-widgets-base-grid-list.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-icon.mjs +1105 -0
- package/fesm2022/cute-widgets-base-icon.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-input.mjs +726 -0
- package/fesm2022/cute-widgets-base-input.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-layout-container.mjs +95 -0
- package/fesm2022/cute-widgets-base-layout-container.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-layout-stack.mjs +166 -0
- package/fesm2022/cute-widgets-base-layout-stack.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-layout.mjs +250 -0
- package/fesm2022/cute-widgets-base-layout.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-list.mjs +1557 -0
- package/fesm2022/cute-widgets-base-list.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-menu.mjs +1283 -0
- package/fesm2022/cute-widgets-base-menu.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-navbar.mjs +359 -0
- package/fesm2022/cute-widgets-base-navbar.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-paginator.mjs +485 -0
- package/fesm2022/cute-widgets-base-paginator.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-progress.mjs +321 -0
- package/fesm2022/cute-widgets-base-progress.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-radio.mjs +637 -0
- package/fesm2022/cute-widgets-base-radio.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-select.mjs +1208 -0
- package/fesm2022/cute-widgets-base-select.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-sidenav.mjs +1095 -0
- package/fesm2022/cute-widgets-base-sidenav.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-slider.mjs +99 -0
- package/fesm2022/cute-widgets-base-slider.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-snack-bar.mjs +897 -0
- package/fesm2022/cute-widgets-base-snack-bar.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-sort.mjs +639 -0
- package/fesm2022/cute-widgets-base-sort.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-spinner.mjs +154 -0
- package/fesm2022/cute-widgets-base-spinner.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-stepper.mjs +673 -0
- package/fesm2022/cute-widgets-base-stepper.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-table.mjs +1023 -0
- package/fesm2022/cute-widgets-base-table.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-tabs.mjs +729 -0
- package/fesm2022/cute-widgets-base-tabs.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-timepicker.mjs +965 -0
- package/fesm2022/cute-widgets-base-timepicker.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-toolbar.mjs +120 -0
- package/fesm2022/cute-widgets-base-toolbar.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-tooltip.mjs +947 -0
- package/fesm2022/cute-widgets-base-tooltip.mjs.map +1 -0
- package/fesm2022/cute-widgets-base-tree.mjs +598 -0
- package/fesm2022/cute-widgets-base-tree.mjs.map +1 -0
- package/fesm2022/cute-widgets-base.mjs +68 -0
- package/fesm2022/cute-widgets-base.mjs.map +1 -0
- package/form-field/index.d.ts +401 -0
- package/grid-list/index.d.ts +361 -0
- package/icon/index.d.ts +477 -0
- package/index.d.ts +3 -0
- package/input/index.d.ts +256 -0
- package/layout/container/index.d.ts +31 -0
- package/layout/index.d.ts +78 -0
- package/layout/stack/index.d.ts +52 -0
- package/list/index.d.ts +659 -0
- package/menu/index.d.ts +497 -0
- package/navbar/index.d.ts +91 -0
- package/package.json +279 -0
- package/paginator/index.d.ts +216 -0
- package/progress/index.d.ts +130 -0
- package/radio/index.d.ts +259 -0
- package/select/index.d.ts +426 -0
- package/sidenav/index.d.ts +369 -0
- package/slider/index.d.ts +48 -0
- package/snack-bar/index.d.ts +374 -0
- package/sort/index.d.ts +334 -0
- package/spinner/index.d.ts +70 -0
- package/stepper/index.d.ts +295 -0
- package/table/index.d.ts +395 -0
- package/tabs/index.d.ts +307 -0
- package/timepicker/index.d.ts +350 -0
- package/toolbar/index.d.ts +36 -0
- package/tooltip/index.d.ts +299 -0
- package/tree/index.d.ts +314 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { AfterContentInit, OnDestroy, TemplateRef, ElementRef, QueryList, EventEmitter, InjectionToken, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
3
|
+
import * as i2 from '@cute-widgets/base/core/option';
|
|
4
|
+
import { CuteOption, CuteOptgroup, CuteOptionSelectionChange } from '@cute-widgets/base/core/option';
|
|
5
|
+
import { RichThemeColor } from '@cute-widgets/base/core';
|
|
6
|
+
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
|
|
7
|
+
import { ScrollStrategy } from '@angular/cdk/overlay';
|
|
8
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
import { Expandable } from '@cute-widgets/base/abstract';
|
|
11
|
+
import * as i1 from '@angular/common';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @license Apache-2.0
|
|
15
|
+
*
|
|
16
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
17
|
+
*
|
|
18
|
+
* You may not use this file except in compliance with the License
|
|
19
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* This code is a modification of the `@angular/material` original
|
|
22
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** Event object that is emitted when an autocomplete option is selected. */
|
|
26
|
+
declare class CuteAutocompleteSelectedEvent {
|
|
27
|
+
/** Reference to the autocomplete panel that emitted the event. */
|
|
28
|
+
source: CuteAutocomplete;
|
|
29
|
+
/** Option that was selected. */
|
|
30
|
+
option: CuteOption;
|
|
31
|
+
constructor(
|
|
32
|
+
/** Reference to the autocomplete panel that emitted the event. */
|
|
33
|
+
source: CuteAutocomplete,
|
|
34
|
+
/** Option that was selected. */
|
|
35
|
+
option: CuteOption);
|
|
36
|
+
}
|
|
37
|
+
/** Event object that is emitted when an autocomplete option is activated. */
|
|
38
|
+
interface CuteAutocompleteActivatedEvent {
|
|
39
|
+
/** Reference to the autocomplete panel that emitted the event. */
|
|
40
|
+
source: CuteAutocomplete;
|
|
41
|
+
/** Option that was selected. */
|
|
42
|
+
option: CuteOption | null;
|
|
43
|
+
}
|
|
44
|
+
/** Default `cute-autocomplete` options that can be overridden. */
|
|
45
|
+
interface CuteAutocompleteDefaultOptions {
|
|
46
|
+
/** Whether the first option should be highlighted when an autocomplete panel is opened. */
|
|
47
|
+
autoActiveFirstOption?: boolean;
|
|
48
|
+
/** Whether the active option should be selected as the user is navigating. */
|
|
49
|
+
autoSelectActiveOption?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the user is required to make a choice when
|
|
52
|
+
* they're interacting with the autocomplete.
|
|
53
|
+
*/
|
|
54
|
+
requireSelection?: boolean;
|
|
55
|
+
/** Class to be applied to the autocomplete's backdrop. */
|
|
56
|
+
backdropClass?: string;
|
|
57
|
+
/** Whether the autocomplete has a backdrop. */
|
|
58
|
+
hasBackdrop?: boolean;
|
|
59
|
+
/** Class or list of classes to be applied to the autocomplete's overlay panel. */
|
|
60
|
+
overlayPanelClass?: string | string[];
|
|
61
|
+
/** Whether icon indicators should be hidden for single-selection. */
|
|
62
|
+
hideSingleSelectionIndicator?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Injection token to be used to override the default options for `cute-autocomplete`. */
|
|
65
|
+
declare const CUTE_AUTOCOMPLETE_DEFAULT_OPTIONS: InjectionToken<CuteAutocompleteDefaultOptions>;
|
|
66
|
+
/** Autocomplete component. */
|
|
67
|
+
declare class CuteAutocomplete implements AfterContentInit, OnDestroy {
|
|
68
|
+
private _changeDetectorRef;
|
|
69
|
+
private _elementRef;
|
|
70
|
+
protected _defaults: CuteAutocompleteDefaultOptions;
|
|
71
|
+
protected _animationsDisabled: boolean;
|
|
72
|
+
private _activeOptionChanges;
|
|
73
|
+
/** Manages active item in an option list based on key events. */
|
|
74
|
+
_keyManager: ActiveDescendantKeyManager<CuteOption> | undefined;
|
|
75
|
+
/** Whether the autocomplete panel should be visible, depending on option length. */
|
|
76
|
+
showPanel: boolean;
|
|
77
|
+
/** Whether the autocomplete panel is open. */
|
|
78
|
+
get isOpen(): boolean;
|
|
79
|
+
_isOpen: boolean;
|
|
80
|
+
/** Latest trigger that opened the autocomplete. */
|
|
81
|
+
_latestOpeningTrigger: unknown;
|
|
82
|
+
/** @docs-private Sets the theme color of the panel. */
|
|
83
|
+
_setColor(value: RichThemeColor | undefined): void;
|
|
84
|
+
/** @docs-private theme color of the panel */
|
|
85
|
+
protected _color: RichThemeColor | undefined;
|
|
86
|
+
/** @docs-private */
|
|
87
|
+
template: TemplateRef<any>;
|
|
88
|
+
/** Element for the panel containing the autocomplete options. */
|
|
89
|
+
panel: ElementRef | undefined;
|
|
90
|
+
/** Reference to all options within the autocomplete. */
|
|
91
|
+
options: QueryList<CuteOption> | undefined;
|
|
92
|
+
/** Reference to all option groups within the autocomplete. */
|
|
93
|
+
optionGroups: QueryList<CuteOptgroup> | undefined;
|
|
94
|
+
/** Aria label of the autocomplete. */
|
|
95
|
+
ariaLabel: string | undefined;
|
|
96
|
+
/** Input that can be used to specify the `aria-labelledby` attribute. */
|
|
97
|
+
ariaLabelledby: string | undefined;
|
|
98
|
+
/** Function that maps an option's control value to its display value in the trigger. */
|
|
99
|
+
displayWith: ((value: any) => string) | null;
|
|
100
|
+
/**
|
|
101
|
+
* Whether the first option should be highlighted when the autocomplete panel is opened.
|
|
102
|
+
* Can be configured globally through the `CUTE_AUTOCOMPLETE_DEFAULT_OPTIONS` token.
|
|
103
|
+
*/
|
|
104
|
+
autoActiveFirstOption: boolean;
|
|
105
|
+
/** Whether the active option should be selected as the user is navigating. */
|
|
106
|
+
autoSelectActiveOption: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the user is required to make a choice when they're interacting with the
|
|
109
|
+
* autocomplete. If the user moves away from the autocomplete without selecting an option from
|
|
110
|
+
* the list, the value will be reset. If the user opens the panel and closes it without
|
|
111
|
+
* interacting or selecting a value, the initial value will be kept.
|
|
112
|
+
*/
|
|
113
|
+
requireSelection: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Specify the width of the autocomplete panel. Can be any CSS sizing value, otherwise it will
|
|
116
|
+
* match the width of its host.
|
|
117
|
+
*/
|
|
118
|
+
panelWidth: string | number | undefined;
|
|
119
|
+
/** Whether ripples are disabled within the autocomplete panel. */
|
|
120
|
+
disableRipple: boolean;
|
|
121
|
+
/** Event that is emitted whenever an option from the list is selected. */
|
|
122
|
+
readonly optionSelected: EventEmitter<CuteAutocompleteSelectedEvent>;
|
|
123
|
+
/** Event that is emitted when the autocomplete panel is opened. */
|
|
124
|
+
readonly opened: EventEmitter<void>;
|
|
125
|
+
/** Event that is emitted when the autocomplete panel is closed. */
|
|
126
|
+
readonly closed: EventEmitter<void>;
|
|
127
|
+
/** Emits whenever an option is activated. */
|
|
128
|
+
readonly optionActivated: EventEmitter<CuteAutocompleteActivatedEvent>;
|
|
129
|
+
/**
|
|
130
|
+
* Takes classes set on the host cute-autocomplete element and applies them to the panel
|
|
131
|
+
* inside the overlay container to allow for easy styling.
|
|
132
|
+
*/
|
|
133
|
+
set classList(value: string | string[]);
|
|
134
|
+
_classList: string | string[] | undefined;
|
|
135
|
+
/** Whether the checkmark indicator for single-selection options is hidden. */
|
|
136
|
+
get hideSingleSelectionIndicator(): boolean;
|
|
137
|
+
set hideSingleSelectionIndicator(value: boolean);
|
|
138
|
+
private _hideSingleSelectionIndicator;
|
|
139
|
+
/** Syncs the parent state with the individual options. */
|
|
140
|
+
_syncParentProperties(): void;
|
|
141
|
+
/** Unique ID to be used by autocomplete trigger's "aria-owns" property. */
|
|
142
|
+
id: string;
|
|
143
|
+
/**
|
|
144
|
+
* Tells any descendant `cute-optgroup` to use the inert a11y pattern.
|
|
145
|
+
*/
|
|
146
|
+
readonly inertGroups: boolean;
|
|
147
|
+
constructor(...args: unknown[]);
|
|
148
|
+
ngAfterContentInit(): void;
|
|
149
|
+
ngOnDestroy(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Sets the panel scrollTop. This allows us to manually scroll to display options
|
|
152
|
+
* above or below the fold, as they are not being focused when active.
|
|
153
|
+
*/
|
|
154
|
+
_setScrollTop(scrollTop: number): void;
|
|
155
|
+
/** Returns the panel's scrollTop. */
|
|
156
|
+
_getScrollTop(): number;
|
|
157
|
+
/** The Panel should hide itself when the option list is empty. */
|
|
158
|
+
_setVisibility(): void;
|
|
159
|
+
/** Emits the `select` event. */
|
|
160
|
+
_emitSelectEvent(option: CuteOption): void;
|
|
161
|
+
/** Gets the aria-labelledby for the autocomplete panel. */
|
|
162
|
+
_getPanelAriaLabelledby(labelId: string | null): string | null;
|
|
163
|
+
protected _skipPredicate(): boolean;
|
|
164
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteAutocomplete, never>;
|
|
165
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CuteAutocomplete, "cute-autocomplete", ["cuteAutocomplete"], { "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "displayWith": { "alias": "displayWith"; "required": false; }; "autoActiveFirstOption": { "alias": "autoActiveFirstOption"; "required": false; }; "autoSelectActiveOption": { "alias": "autoSelectActiveOption"; "required": false; }; "requireSelection": { "alias": "requireSelection"; "required": false; }; "panelWidth": { "alias": "panelWidth"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "classList": { "alias": "class"; "required": false; }; "hideSingleSelectionIndicator": { "alias": "hideSingleSelectionIndicator"; "required": false; }; }, { "optionSelected": "optionSelected"; "opened": "opened"; "closed": "closed"; "optionActivated": "optionActivated"; }, ["options", "optionGroups"], ["*"], true, never>;
|
|
166
|
+
static ngAcceptInputType_autoActiveFirstOption: unknown;
|
|
167
|
+
static ngAcceptInputType_autoSelectActiveOption: unknown;
|
|
168
|
+
static ngAcceptInputType_requireSelection: unknown;
|
|
169
|
+
static ngAcceptInputType_disableRipple: unknown;
|
|
170
|
+
static ngAcceptInputType_hideSingleSelectionIndicator: unknown;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @license Apache-2.0
|
|
175
|
+
*
|
|
176
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
177
|
+
*
|
|
178
|
+
* You may not use this file except in compliance with the License
|
|
179
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
180
|
+
*
|
|
181
|
+
* This code is a modification of the `@angular/material` original
|
|
182
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Directive applied to an element to make it usable
|
|
187
|
+
* as a connection point for an autocomplete panel.
|
|
188
|
+
*/
|
|
189
|
+
declare class CuteAutocompleteOrigin {
|
|
190
|
+
elementRef: ElementRef<HTMLElement>;
|
|
191
|
+
constructor(...args: unknown[]);
|
|
192
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteAutocompleteOrigin, never>;
|
|
193
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CuteAutocompleteOrigin, "[cuteAutocompleteOrigin]", ["cuteAutocompleteOrigin"], {}, {}, never, never, true, never>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Provider that allows the autocomplete to register as a ControlValueAccessor.
|
|
198
|
+
* @docs-private
|
|
199
|
+
*/
|
|
200
|
+
declare const CUTE_AUTOCOMPLETE_VALUE_ACCESSOR: any;
|
|
201
|
+
/**
|
|
202
|
+
* Creates an error to be thrown when attempting to use an autocomplete trigger without a panel.
|
|
203
|
+
* @docs-private
|
|
204
|
+
*/
|
|
205
|
+
declare function getCuteAutocompleteMissingPanelError(): Error;
|
|
206
|
+
/** Injection token that determines the scroll handling while the autocomplete panel is open. */
|
|
207
|
+
declare const CUTE_AUTOCOMPLETE_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
|
|
208
|
+
/** Base class with all the `CuteAutocompleteTrigger` functionality. */
|
|
209
|
+
declare class CuteAutocompleteTrigger implements ControlValueAccessor, AfterViewInit, OnChanges, OnDestroy, Expandable {
|
|
210
|
+
private _environmentInjector;
|
|
211
|
+
private _element;
|
|
212
|
+
private _injector;
|
|
213
|
+
private _viewContainerRef;
|
|
214
|
+
private _zone;
|
|
215
|
+
private _changeDetectorRef;
|
|
216
|
+
private _dir;
|
|
217
|
+
private _formField;
|
|
218
|
+
private _viewportRuler;
|
|
219
|
+
private _scrollStrategy;
|
|
220
|
+
private _renderer;
|
|
221
|
+
private _animationsDisabled;
|
|
222
|
+
private _defaults;
|
|
223
|
+
private _overlayRef;
|
|
224
|
+
private _portal;
|
|
225
|
+
private _componentDestroyed;
|
|
226
|
+
private _initialized;
|
|
227
|
+
private _keydownSubscription;
|
|
228
|
+
private _outsideClickSubscription;
|
|
229
|
+
private _cleanupWindowBlur;
|
|
230
|
+
/** Old value of the native input. Used to work around issues with the `input` event on IE. */
|
|
231
|
+
private _previousValue;
|
|
232
|
+
/** Value of the input element when the panel was attached (even if there are no options). */
|
|
233
|
+
private _valueOnAttach;
|
|
234
|
+
/** Value on the previous keydown event. */
|
|
235
|
+
private _valueOnLastKeydown;
|
|
236
|
+
/** Strategy that is used to position the panel. */
|
|
237
|
+
private _positionStrategy;
|
|
238
|
+
/** Whether the label state is being overridden. */
|
|
239
|
+
private _manuallyFloatingLabel;
|
|
240
|
+
/** The subscription for closing actions (some are bound to document). */
|
|
241
|
+
private _closingActionsSubscription;
|
|
242
|
+
/** Subscription to viewport size changes. */
|
|
243
|
+
private _viewportSubscription;
|
|
244
|
+
/** Implements BreakpointObserver to be used to detect handset landscape */
|
|
245
|
+
private _breakpointObserver;
|
|
246
|
+
private _handsetLandscapeSubscription;
|
|
247
|
+
/**
|
|
248
|
+
* Whether the autocomplete can open the next time, it is focused. Used to prevent a focused,
|
|
249
|
+
* closed autocomplete from being reopened if the user switches to another browser tab and then
|
|
250
|
+
* comes back.
|
|
251
|
+
*/
|
|
252
|
+
private _canOpenOnNextFocus;
|
|
253
|
+
/** Value inside the input before we auto-selected an option. */
|
|
254
|
+
private _valueBeforeAutoSelection;
|
|
255
|
+
/**
|
|
256
|
+
* The current option that we have auto-selected as the user is navigating,
|
|
257
|
+
* but which hasn't been propagated to the model value yet.
|
|
258
|
+
*/
|
|
259
|
+
private _pendingAutoselectedOption;
|
|
260
|
+
/** Stream of keyboard events that can close the panel. */
|
|
261
|
+
private readonly _closeKeyEventStream;
|
|
262
|
+
/** Classes to apply to the panel. Exposed as a public property for internal usage. */
|
|
263
|
+
readonly _overlayPanelClass: string[];
|
|
264
|
+
/**
|
|
265
|
+
* Event handler for when the window is blurred. Needs to be an
|
|
266
|
+
* arrow function to preserve the context.
|
|
267
|
+
*/
|
|
268
|
+
private _windowBlurHandler;
|
|
269
|
+
/** `View -> model callback called when value changes` */
|
|
270
|
+
_onChange: (value: any) => void;
|
|
271
|
+
/** `View -> model callback called when autocomplete has been touched` */
|
|
272
|
+
_onTouched: () => void;
|
|
273
|
+
/** The autocomplete panel to be attached to this trigger. */
|
|
274
|
+
autocomplete: CuteAutocomplete;
|
|
275
|
+
/**
|
|
276
|
+
* Position of the autocomplete panel relative to the trigger element. A position of `auto`
|
|
277
|
+
* will render the panel underneath the trigger if there is enough space for it to fit in
|
|
278
|
+
* the viewport, otherwise the panel will be shown above it. If the position is set to
|
|
279
|
+
* `above` or `below`, the panel will always be shown above or below the trigger. no matter
|
|
280
|
+
* whether it fits completely in the viewport.
|
|
281
|
+
*/
|
|
282
|
+
position: 'auto' | 'above' | 'below';
|
|
283
|
+
/**
|
|
284
|
+
* Reference relative to which to position the autocomplete panel.
|
|
285
|
+
* Defaults to the autocomplete trigger element.
|
|
286
|
+
*/
|
|
287
|
+
connectedTo: CuteAutocompleteOrigin | undefined;
|
|
288
|
+
/**
|
|
289
|
+
* `autocomplete` attribute to be set on the input element.
|
|
290
|
+
* @docs-private
|
|
291
|
+
*/
|
|
292
|
+
autocompleteAttribute: string;
|
|
293
|
+
/**
|
|
294
|
+
* Whether the autocomplete is disabled. When disabled, the element will
|
|
295
|
+
* act as a regular input and the user won't be able to open the panel.
|
|
296
|
+
*/
|
|
297
|
+
autocompleteDisabled: boolean;
|
|
298
|
+
constructor(...args: unknown[]);
|
|
299
|
+
/** Class to apply to the panel when it's above the input. */
|
|
300
|
+
private _aboveClass;
|
|
301
|
+
ngAfterViewInit(): void;
|
|
302
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
303
|
+
ngOnDestroy(): void;
|
|
304
|
+
/** Whether the autocomplete panel is open. */
|
|
305
|
+
get panelOpen(): boolean;
|
|
306
|
+
private _overlayAttached;
|
|
307
|
+
/** Opens the autocomplete suggestion panel. */
|
|
308
|
+
openPanel(): void;
|
|
309
|
+
/** Closes the autocomplete suggestion panel. */
|
|
310
|
+
closePanel(): void;
|
|
311
|
+
get expanded(): boolean;
|
|
312
|
+
open(): void;
|
|
313
|
+
close(): void;
|
|
314
|
+
toggle(): void;
|
|
315
|
+
/**
|
|
316
|
+
* Updates the position of the autocomplete suggestion panel to ensure that it fits all options
|
|
317
|
+
* within the viewport.
|
|
318
|
+
*/
|
|
319
|
+
updatePosition(): void;
|
|
320
|
+
/**
|
|
321
|
+
* A stream of actions that should close the autocomplete panel, including
|
|
322
|
+
* when an option is selected, on blur, and when TAB is pressed.
|
|
323
|
+
*/
|
|
324
|
+
get panelClosingActions(): Observable<CuteOptionSelectionChange | null>;
|
|
325
|
+
/** Stream of changes to the selection state of the autocomplete options. */
|
|
326
|
+
readonly optionSelections: Observable<CuteOptionSelectionChange>;
|
|
327
|
+
/** The currently active option, coerced to CuteOption type. */
|
|
328
|
+
get activeOption(): CuteOption | null;
|
|
329
|
+
/** Stream of clicks outside the autocomplete panel. */
|
|
330
|
+
private _getOutsideClickStream;
|
|
331
|
+
writeValue(value: any): void;
|
|
332
|
+
registerOnChange(fn: (value: any) => {}): void;
|
|
333
|
+
registerOnTouched(fn: () => {}): void;
|
|
334
|
+
setDisabledState(isDisabled: boolean): void;
|
|
335
|
+
protected _handleKeydown(e: Event): void;
|
|
336
|
+
protected _handleInput(event: KeyboardEvent): void;
|
|
337
|
+
protected _handleFocus(): void;
|
|
338
|
+
protected _handleClick(): void;
|
|
339
|
+
/** Whether the input currently has focus. */
|
|
340
|
+
private _hasFocus;
|
|
341
|
+
/**
|
|
342
|
+
* In "auto" mode, the label will animate down as soon as focus is lost.
|
|
343
|
+
* This causes the value to jump when selecting an option with the mouse.
|
|
344
|
+
* This method manually floats the label until the panel can be closed.
|
|
345
|
+
* @param shouldAnimate Whether the label should be animated when it is floated.
|
|
346
|
+
*/
|
|
347
|
+
private _floatLabel;
|
|
348
|
+
/** If the label has been manually elevated, return it to its normal state. */
|
|
349
|
+
private _resetLabel;
|
|
350
|
+
/**
|
|
351
|
+
* This method listens to a stream of panel closing actions and resets the
|
|
352
|
+
* stream every time the option list changes.
|
|
353
|
+
*/
|
|
354
|
+
private _subscribeToClosingActions;
|
|
355
|
+
/**
|
|
356
|
+
* Emits the opened event once it's known that the panel will be shown and stores
|
|
357
|
+
* the state of the trigger right before the opening sequence was finished.
|
|
358
|
+
*/
|
|
359
|
+
private _emitOpened;
|
|
360
|
+
/** Destroys the autocomplete suggestion panel. */
|
|
361
|
+
private _destroyPanel;
|
|
362
|
+
/** Given a value, returns the string that should be shown within the input. */
|
|
363
|
+
private _getDisplayValue;
|
|
364
|
+
private _assignOptionValue;
|
|
365
|
+
private _updateNativeInputValue;
|
|
366
|
+
/**
|
|
367
|
+
* This method closes the panel, and if a value is specified, also sets the associated
|
|
368
|
+
* control to that value. It will also mark the control as dirty if this interaction
|
|
369
|
+
* stemmed from the user.
|
|
370
|
+
*/
|
|
371
|
+
private _setValueAndClose;
|
|
372
|
+
/**
|
|
373
|
+
* Clear any previous selected option and emit a selection change event for this option
|
|
374
|
+
*/
|
|
375
|
+
private _clearPreviousSelectedOption;
|
|
376
|
+
private _openPanelInternal;
|
|
377
|
+
private _attachOverlay;
|
|
378
|
+
/** Handles keyboard events coming from the overlay panel. */
|
|
379
|
+
private _handlePanelKeydown;
|
|
380
|
+
/** Updates the panel's visibility state and any trigger state tied to id. */
|
|
381
|
+
private _updatePanelState;
|
|
382
|
+
private _getOverlayConfig;
|
|
383
|
+
private _getOverlayPosition;
|
|
384
|
+
/** Sets the positions on a position strategy based on the directive's input state. */
|
|
385
|
+
private _setStrategyPositions;
|
|
386
|
+
private _getConnectedElement;
|
|
387
|
+
private _getPanelWidth;
|
|
388
|
+
/** Returns the width of the input element, so the panel width can match it. */
|
|
389
|
+
private _getHostWidth;
|
|
390
|
+
/**
|
|
391
|
+
* Reset the active item to -1. This is so that pressing arrow keys will activate the correct
|
|
392
|
+
* option.
|
|
393
|
+
*
|
|
394
|
+
* If the consumer opted-in to automatically activating the first option, activate the first
|
|
395
|
+
* *enabled* option.
|
|
396
|
+
*/
|
|
397
|
+
private _resetActiveItem;
|
|
398
|
+
/** Determines whether the panel can be opened. */
|
|
399
|
+
private _canOpen;
|
|
400
|
+
/** Scrolls to a particular option in the list. */
|
|
401
|
+
private _scrollToOption;
|
|
402
|
+
/**
|
|
403
|
+
* Track which modal we have modified the `aria-owns` attribute of. When the combobox trigger is
|
|
404
|
+
* inside an aria-modal, we apply aria-owns to the parent modal with the `id` of the options
|
|
405
|
+
* panel. Track the modal we have changed, so we can undo the changes on destroy.
|
|
406
|
+
*/
|
|
407
|
+
private _trackedModal;
|
|
408
|
+
/**
|
|
409
|
+
* If the autocomplete trigger is inside an `aria-modal` element, connect
|
|
410
|
+
* that modal to the options panel with `aria-owns`.
|
|
411
|
+
*
|
|
412
|
+
* For some browser + screen reader combinations, when navigation is inside
|
|
413
|
+
* an `aria-modal` element, the screen reader treats everything outside
|
|
414
|
+
* of that modal as hidden or invisible.
|
|
415
|
+
*
|
|
416
|
+
* This causes a problem when the combobox trigger is _inside_ of a modal, because the
|
|
417
|
+
* options panel is rendered _outside_ of that modal, preventing screen reader navigation
|
|
418
|
+
* from reaching the panel.
|
|
419
|
+
*
|
|
420
|
+
* We can work around this issue by applying `aria-owns` to the modal with the `id` of
|
|
421
|
+
* the options panel. This effectively communicates to assistive technology that the
|
|
422
|
+
* options panel is part of the same interaction as the modal.
|
|
423
|
+
*
|
|
424
|
+
* At the time of this writing, this issue is present in VoiceOver.
|
|
425
|
+
* See https://github.com/angular/components/issues/20694
|
|
426
|
+
*/
|
|
427
|
+
private _applyModalPanelOwnership;
|
|
428
|
+
/** Clears the references to the listbox overlay element from the modal it was added to. */
|
|
429
|
+
private _clearFromModal;
|
|
430
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteAutocompleteTrigger, never>;
|
|
431
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CuteAutocompleteTrigger, "input[cuteAutocomplete], textarea[cuteAutocomplete]", ["cuteAutocompleteTrigger"], { "autocomplete": { "alias": "cuteAutocomplete"; "required": false; }; "position": { "alias": "cuteAutocompletePosition"; "required": false; }; "connectedTo": { "alias": "cuteAutocompleteConnectedTo"; "required": false; }; "autocompleteAttribute": { "alias": "autocomplete"; "required": false; }; "autocompleteDisabled": { "alias": "cuteAutocompleteDisabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
432
|
+
static ngAcceptInputType_autocompleteDisabled: unknown;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
declare class CuteAutocompleteModule {
|
|
436
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteAutocompleteModule, never>;
|
|
437
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CuteAutocompleteModule, never, [typeof i1.CommonModule, typeof i2.CuteOptionModule, typeof CuteAutocomplete, typeof CuteAutocompleteTrigger, typeof CuteAutocompleteOrigin], [typeof i2.CuteOptionModule, typeof CuteAutocomplete, typeof CuteAutocompleteTrigger, typeof CuteAutocompleteOrigin]>;
|
|
438
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CuteAutocompleteModule>;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export { CUTE_AUTOCOMPLETE_DEFAULT_OPTIONS, CUTE_AUTOCOMPLETE_SCROLL_STRATEGY, CUTE_AUTOCOMPLETE_VALUE_ACCESSOR, CuteAutocomplete, CuteAutocompleteModule, CuteAutocompleteOrigin, CuteAutocompleteSelectedEvent, CuteAutocompleteTrigger, getCuteAutocompleteMissingPanelError };
|
|
442
|
+
export type { CuteAutocompleteActivatedEvent, CuteAutocompleteDefaultOptions };
|
package/badge/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CuteBaseControl } from '@cute-widgets/base/abstract';
|
|
2
|
+
import { toTextBgCssClass } from '@cute-widgets/base/core';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Small count and labeling component
|
|
8
|
+
*/
|
|
9
|
+
declare class CuteBadge extends CuteBaseControl {
|
|
10
|
+
/** Makes a badge more rounded with a larger border-radius */
|
|
11
|
+
roundedPill: boolean;
|
|
12
|
+
constructor();
|
|
13
|
+
protected generateId(): string;
|
|
14
|
+
protected readonly toTextBgCssClass: typeof toTextBgCssClass;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteBadge, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CuteBadge, "cute-badge", ["cuteBadge"], { "roundedPill": { "alias": "roundedPill"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
17
|
+
static ngAcceptInputType_roundedPill: unknown;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare class CuteBadgeModule {
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteBadgeModule, never>;
|
|
22
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CuteBadgeModule, never, [typeof i1.CommonModule, typeof CuteBadge], [typeof CuteBadge]>;
|
|
23
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CuteBadgeModule>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { CuteBadge, CuteBadgeModule };
|