@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,374 @@
|
|
|
1
|
+
import { OverlayRef, ComponentType } from '@angular/cdk/overlay';
|
|
2
|
+
import { Subject, Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { ViewContainerRef, InjectionToken, OnDestroy, ElementRef, WritableSignal, ComponentRef, EmbeddedViewRef, TemplateRef } from '@angular/core';
|
|
5
|
+
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, DomPortal } from '@angular/cdk/portal';
|
|
6
|
+
import { AriaLivePoliteness } from '@angular/cdk/a11y';
|
|
7
|
+
import { Direction } from '@angular/cdk/bidi';
|
|
8
|
+
import { RichThemeColor } from '@cute-widgets/base/core';
|
|
9
|
+
import { CuteLayoutControl } from '@cute-widgets/base/abstract';
|
|
10
|
+
import * as i1 from '@angular/common';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @license Apache-2.0
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
16
|
+
*
|
|
17
|
+
* You may not use this file except in compliance with the License
|
|
18
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* This code is a modification of the `@angular/material` original
|
|
21
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** Injection token that can be used to access the data that was passed in to a snack bar. */
|
|
25
|
+
declare const CUTE_SNACK_BAR_DATA: InjectionToken<any>;
|
|
26
|
+
/** Possible values for horizontalPosition on CuteSnackBarConfig. */
|
|
27
|
+
type CuteSnackBarHorizontalPosition = 'start' | 'center' | 'end' | 'left' | 'right';
|
|
28
|
+
/** Possible values for verticalPosition on CuteSnackBarConfig. */
|
|
29
|
+
type CuteSnackBarVerticalPosition = 'top' | 'bottom';
|
|
30
|
+
/**
|
|
31
|
+
* Configuration used when opening a snack-bar.
|
|
32
|
+
*/
|
|
33
|
+
declare class CuteSnackBarConfig<D = any> {
|
|
34
|
+
/** The politeness level for the LiveAnnouncer announcement. */
|
|
35
|
+
politeness?: AriaLivePoliteness;
|
|
36
|
+
/**
|
|
37
|
+
* Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom
|
|
38
|
+
* component or template, the announcement message will default to the specified message.
|
|
39
|
+
*/
|
|
40
|
+
announcementMessage?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The view container that serves as the parent for the snackbar for the purposes of dependency
|
|
43
|
+
* injection. Note: this does not affect where the snackbar is inserted in the DOM.
|
|
44
|
+
*/
|
|
45
|
+
viewContainerRef?: ViewContainerRef;
|
|
46
|
+
/** The length of time in milliseconds to wait before automatically dismissing the snack bar. */
|
|
47
|
+
duration?: number;
|
|
48
|
+
/** Extra CSS classes to be added to the snack bar container. */
|
|
49
|
+
panelClass?: string | string[];
|
|
50
|
+
/** Text layout direction for the snack bar. */
|
|
51
|
+
direction?: Direction;
|
|
52
|
+
/** Data being injected into the child component. */
|
|
53
|
+
data?: D | null;
|
|
54
|
+
/** The horizontal position to place the snack bar. */
|
|
55
|
+
horizontalPosition?: CuteSnackBarHorizontalPosition;
|
|
56
|
+
/** The vertical position to place the snack bar. */
|
|
57
|
+
verticalPosition?: CuteSnackBarVerticalPosition;
|
|
58
|
+
/** Theme color for the snack bar. */
|
|
59
|
+
color?: RichThemeColor;
|
|
60
|
+
/** Adds a linear gradient as background image to the backgrounds */
|
|
61
|
+
gradientFill?: boolean;
|
|
62
|
+
/** Whether the user can dismiss the snack bar by clicking close button. */
|
|
63
|
+
dismissible?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @license Apache-2.0
|
|
68
|
+
*
|
|
69
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
70
|
+
*
|
|
71
|
+
* You may not use this file except in compliance with the License
|
|
72
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
73
|
+
*
|
|
74
|
+
* This code is a modification of the `@angular/material` original
|
|
75
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Internal component that wraps user-provided snack bar content.
|
|
80
|
+
*/
|
|
81
|
+
declare class CuteSnackBarContainer extends BasePortalOutlet implements OnDestroy {
|
|
82
|
+
private _ngZone;
|
|
83
|
+
readonly _elementRef: ElementRef<HTMLElement>;
|
|
84
|
+
private _changeDetectorRef;
|
|
85
|
+
private _platform;
|
|
86
|
+
protected _animationsDisabled: boolean;
|
|
87
|
+
snackBarConfig: CuteSnackBarConfig<any>;
|
|
88
|
+
private _document;
|
|
89
|
+
private _themeService;
|
|
90
|
+
private _trackedModals;
|
|
91
|
+
private _enterFallback;
|
|
92
|
+
private _exitFallback;
|
|
93
|
+
private _injector;
|
|
94
|
+
protected isLightTheme: WritableSignal<boolean>;
|
|
95
|
+
/** The number of milliseconds to wait before announcing the snack bar's content. */
|
|
96
|
+
private readonly _announceDelay;
|
|
97
|
+
/** The timeout for announcing the snack bar's content. */
|
|
98
|
+
private _announceTimeoutId;
|
|
99
|
+
/** Whether the component has been destroyed. */
|
|
100
|
+
private _destroyed;
|
|
101
|
+
/** The portal outlet inside this container into which the snack bar content will be loaded. */
|
|
102
|
+
_portalOutlet: CdkPortalOutlet;
|
|
103
|
+
/** Subject for notifying that the snack bar has announced to screen readers. */
|
|
104
|
+
readonly _onAnnounce: Subject<void>;
|
|
105
|
+
/** Subject for notifying that the snack bar has exited from view. */
|
|
106
|
+
readonly _onExit: Subject<void>;
|
|
107
|
+
/** Subject for notifying that the snack bar has finished entering the view. */
|
|
108
|
+
readonly _onEnter: Subject<void>;
|
|
109
|
+
/** The state of the snack bar animations. */
|
|
110
|
+
_animationState: string;
|
|
111
|
+
/** aria-live value for the live region. */
|
|
112
|
+
_live: AriaLivePoliteness;
|
|
113
|
+
/**
|
|
114
|
+
* Element that will have the `cute-snackbar__label` class applied if the attached component
|
|
115
|
+
* or template does not have it. This ensures that the appropriate structure, typography, and
|
|
116
|
+
* color are applied to the attached view.
|
|
117
|
+
*/
|
|
118
|
+
_label: ElementRef | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Role of the live region. This is only for Firefox as there is a known issue where Firefox +
|
|
121
|
+
* JAWS does not read out an aria-live message.
|
|
122
|
+
*/
|
|
123
|
+
_role?: 'status' | 'alert';
|
|
124
|
+
/** Unique ID of the aria-live element. */
|
|
125
|
+
readonly _liveElementId: string;
|
|
126
|
+
constructor(...args: unknown[]);
|
|
127
|
+
/** Attach a component portal as content to this snack bar container. */
|
|
128
|
+
attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
|
|
129
|
+
/** Attach a template portal as content to this snack bar container. */
|
|
130
|
+
attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
|
|
131
|
+
/**
|
|
132
|
+
* Attaches a DOM portal to the snack bar container.
|
|
133
|
+
* @deprecated To be turned into a method.
|
|
134
|
+
* @breaking-change 10.0.0
|
|
135
|
+
*/
|
|
136
|
+
attachDomPortal: (portal: DomPortal) => void;
|
|
137
|
+
/** Handle end of animations, updating the state of the snackbar. */
|
|
138
|
+
onAnimationEnd(animationName: string): void;
|
|
139
|
+
/** Begin animation of snack bar entrance into view. */
|
|
140
|
+
enter(): void;
|
|
141
|
+
/** Begin animation of the snack bar exiting from view. */
|
|
142
|
+
exit(): Observable<void>;
|
|
143
|
+
/** Makes sure the exit callbacks have been invoked when the element is destroyed. */
|
|
144
|
+
ngOnDestroy(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Removes the element in a microtask. Helps prevent errors where we end up
|
|
147
|
+
* removing an element which is in the middle of an animation.
|
|
148
|
+
*/
|
|
149
|
+
private _completeExit;
|
|
150
|
+
/**
|
|
151
|
+
* Called after the portal contents have been attached. Can be
|
|
152
|
+
* used to modify the DOM once it's guaranteed to be in place.
|
|
153
|
+
*/
|
|
154
|
+
private _afterPortalAttached;
|
|
155
|
+
/**
|
|
156
|
+
* Some browsers won't expose the accessibility node of the live element if there is an
|
|
157
|
+
* `aria-modal` and the live element is outside of it. This method works around the issue by
|
|
158
|
+
* pointing the `aria-owns` of all modals to the live element.
|
|
159
|
+
*/
|
|
160
|
+
private _exposeToModals;
|
|
161
|
+
/** Clears the references to the live element from any modals it was added to. */
|
|
162
|
+
private _clearFromModals;
|
|
163
|
+
/** Asserts that no content is already attached to the container. */
|
|
164
|
+
private _assertNotAttached;
|
|
165
|
+
/**
|
|
166
|
+
* Starts a timeout to move the snack bar content to the live region so screen readers will
|
|
167
|
+
* announce it.
|
|
168
|
+
*/
|
|
169
|
+
private _screenReaderAnnounce;
|
|
170
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackBarContainer, never>;
|
|
171
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CuteSnackBarContainer, "cute-snack-bar-container", never, {}, {}, never, never, true, never>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @license Apache-2.0
|
|
176
|
+
*
|
|
177
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
178
|
+
*
|
|
179
|
+
* You may not use this file except in compliance with the License
|
|
180
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
181
|
+
*
|
|
182
|
+
* This code is a modification of the `@angular/material` original
|
|
183
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
/** Event that is emitted when a snack bar is dismissed. */
|
|
187
|
+
interface CuteSnackBarDismiss {
|
|
188
|
+
/** Whether the snack bar was dismissed using the action button. */
|
|
189
|
+
dismissedByAction: boolean;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Reference to a snack bar dispatched from the snack bar service.
|
|
193
|
+
*/
|
|
194
|
+
declare class CuteSnackBarRef<T> {
|
|
195
|
+
private _overlayRef;
|
|
196
|
+
/** The instance of the component making up the content of the snack bar. */
|
|
197
|
+
instance: T | undefined;
|
|
198
|
+
/** The instance of the component making up the content of the snack bar. */
|
|
199
|
+
containerInstance: CuteSnackBarContainer;
|
|
200
|
+
/** Subject for notifying the user that the snack bar has been dismissed. */
|
|
201
|
+
private readonly _afterDismissed;
|
|
202
|
+
/** Subject for notifying the user that the snack bar has opened and appeared. */
|
|
203
|
+
private readonly _afterOpened;
|
|
204
|
+
/** Subject for notifying the user that the snack bar action was called. */
|
|
205
|
+
private readonly _onAction;
|
|
206
|
+
/**
|
|
207
|
+
* Timeout ID for the duration setTimeout call. Used to clear the timeout if the snackbar is
|
|
208
|
+
* dismissed before the duration passes.
|
|
209
|
+
*/
|
|
210
|
+
private _durationTimeoutId;
|
|
211
|
+
/** Whether the snack bar was dismissed using the action button. */
|
|
212
|
+
private _dismissedByAction;
|
|
213
|
+
constructor(containerInstance: CuteSnackBarContainer, _overlayRef: OverlayRef);
|
|
214
|
+
/** Dismisses the snack bar. */
|
|
215
|
+
dismiss(): void;
|
|
216
|
+
/** Marks the snackbar action clicked. */
|
|
217
|
+
dismissWithAction(): void;
|
|
218
|
+
/** Dismisses the snack bar after some duration */
|
|
219
|
+
_dismissAfter(duration: number): void;
|
|
220
|
+
/** Marks the snackbar as opened */
|
|
221
|
+
_open(): void;
|
|
222
|
+
/** Cleans up the DOM after closing. */
|
|
223
|
+
private _finishDismiss;
|
|
224
|
+
/** Gets an observable notified when the snack bar is finished closing. */
|
|
225
|
+
afterDismissed(): Observable<CuteSnackBarDismiss>;
|
|
226
|
+
/** Gets an observable notified when the snack bar has opened and appeared. */
|
|
227
|
+
afterOpened(): Observable<void>;
|
|
228
|
+
/** Gets an observable notified when the snack bar action is called. */
|
|
229
|
+
onAction(): Observable<void>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Interface for a simple snack bar component that has a message and a single action.
|
|
234
|
+
*/
|
|
235
|
+
interface TextOnlySnackBar {
|
|
236
|
+
data: {
|
|
237
|
+
message: string;
|
|
238
|
+
action: string;
|
|
239
|
+
};
|
|
240
|
+
snackBarRef: CuteSnackBarRef<TextOnlySnackBar>;
|
|
241
|
+
action: () => void;
|
|
242
|
+
hasAction: boolean;
|
|
243
|
+
}
|
|
244
|
+
declare class SimpleSnackBar extends CuteLayoutControl implements TextOnlySnackBar {
|
|
245
|
+
snackBarRef: CuteSnackBarRef<SimpleSnackBar>;
|
|
246
|
+
data: any;
|
|
247
|
+
protected readonly config: CuteSnackBarConfig;
|
|
248
|
+
constructor(...args: unknown[]);
|
|
249
|
+
protected generateId(): string;
|
|
250
|
+
/** Performs the action on the snack bar. */
|
|
251
|
+
action(): void;
|
|
252
|
+
/** If the action button should be shown. */
|
|
253
|
+
get hasAction(): boolean;
|
|
254
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SimpleSnackBar, never>;
|
|
255
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SimpleSnackBar, "simple-snack-bar", ["cuteSnackBar"], {}, {}, never, never, true, never>;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** Directive that should be applied to the element containing the snack bar's header elements. */
|
|
259
|
+
declare class CuteSnackBarHeader {
|
|
260
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackBarHeader, never>;
|
|
261
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CuteSnackBarHeader, "cute-snack-bar-header", never, {}, {}, never, ["*"], true, never>;
|
|
262
|
+
}
|
|
263
|
+
/** Directive that should be applied to the element containing the snack bar's body elements. */
|
|
264
|
+
declare class CuteSnackBarBody {
|
|
265
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackBarBody, never>;
|
|
266
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CuteSnackBarBody, "[cuteSnackBarBody]", never, {}, {}, never, never, true, never>;
|
|
267
|
+
}
|
|
268
|
+
/** Directive that should be applied to the text element to be rendered in the snack bar. */
|
|
269
|
+
declare class CuteSnackBarLabel {
|
|
270
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackBarLabel, never>;
|
|
271
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CuteSnackBarLabel, "[cuteSnackBarLabel]", never, {}, {}, never, never, true, never>;
|
|
272
|
+
}
|
|
273
|
+
/** Directive that should be applied to the element containing the snack bar's action buttons. */
|
|
274
|
+
declare class CuteSnackBarActions {
|
|
275
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackBarActions, never>;
|
|
276
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CuteSnackBarActions, "[cuteSnackBarActions]", never, {}, {}, never, never, true, never>;
|
|
277
|
+
}
|
|
278
|
+
/** Directive that should be applied to each of the snack bar's action buttons. */
|
|
279
|
+
declare class CuteSnackBarAction {
|
|
280
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackBarAction, never>;
|
|
281
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CuteSnackBarAction, "[cuteSnackBarAction]", never, {}, {}, never, never, true, never>;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Injection token that can be used to specify the default snack bar. */
|
|
285
|
+
declare const CUTE_SNACK_BAR_DEFAULT_OPTIONS: InjectionToken<CuteSnackBarConfig<any>>;
|
|
286
|
+
/**
|
|
287
|
+
* Service to dispatch Cute snack bar messages.
|
|
288
|
+
*/
|
|
289
|
+
declare class CuteSnackBar implements OnDestroy {
|
|
290
|
+
private _live;
|
|
291
|
+
private _injector;
|
|
292
|
+
private _overlay;
|
|
293
|
+
private _breakpointObserver;
|
|
294
|
+
private _parentSnackBar;
|
|
295
|
+
private _defaultConfig;
|
|
296
|
+
private _animationsDisabled;
|
|
297
|
+
private _destroyRef;
|
|
298
|
+
/**
|
|
299
|
+
* Reference to the current snack bar in the view *at this level* (in the Angular injector tree).
|
|
300
|
+
* If there is a parent snack-bar service, all operations should delegate to that parent
|
|
301
|
+
* via `_openedSnackBarRef`.
|
|
302
|
+
*/
|
|
303
|
+
private _snackBarRefAtThisLevel;
|
|
304
|
+
/** The component that should be rendered as the snack bar's simple component. */
|
|
305
|
+
private _simpleSnackBarComponent;
|
|
306
|
+
/** The container component that attaches the provided template or component. */
|
|
307
|
+
snackBarContainerComponent: typeof CuteSnackBarContainer;
|
|
308
|
+
/** The CSS class to apply for handset mode. */
|
|
309
|
+
handsetCssClass: string;
|
|
310
|
+
/** Reference to the currently opened snackbar at *any* level. */
|
|
311
|
+
get _openedSnackBarRef(): CuteSnackBarRef<any> | null;
|
|
312
|
+
set _openedSnackBarRef(value: CuteSnackBarRef<any> | null);
|
|
313
|
+
constructor(...args: unknown[]);
|
|
314
|
+
/**
|
|
315
|
+
* Creates and dispatches a snack bar with a custom component for the content, removing any
|
|
316
|
+
* currently opened snack bars.
|
|
317
|
+
*
|
|
318
|
+
* @param component Component to be instantiated.
|
|
319
|
+
* @param config Extra configuration for the snack bar.
|
|
320
|
+
*/
|
|
321
|
+
openFromComponent<T, D = any>(component: ComponentType<T>, config?: CuteSnackBarConfig<D>): CuteSnackBarRef<T>;
|
|
322
|
+
/**
|
|
323
|
+
* Creates and dispatches a snack bar with a custom template for the content, removing any
|
|
324
|
+
* currently opened snack bars.
|
|
325
|
+
*
|
|
326
|
+
* @param template Template to be instantiated.
|
|
327
|
+
* @param config Extra configuration for the snack bar.
|
|
328
|
+
*/
|
|
329
|
+
openFromTemplate(template: TemplateRef<any>, config?: CuteSnackBarConfig): CuteSnackBarRef<EmbeddedViewRef<any>>;
|
|
330
|
+
/**
|
|
331
|
+
* Opens a snackbar with a message and an optional action.
|
|
332
|
+
* @param message The message to show in the snackbar.
|
|
333
|
+
* @param action The label for the snackbar action.
|
|
334
|
+
* @param config Additional configuration options for the snackbar.
|
|
335
|
+
*/
|
|
336
|
+
open(message: string, action?: string, config?: CuteSnackBarConfig): CuteSnackBarRef<TextOnlySnackBar>;
|
|
337
|
+
/**
|
|
338
|
+
* Dismisses the currently visible snack bar.
|
|
339
|
+
*/
|
|
340
|
+
dismiss(): void;
|
|
341
|
+
ngOnDestroy(): void;
|
|
342
|
+
/**
|
|
343
|
+
* Attaches the snack bar container component to the overlay.
|
|
344
|
+
*/
|
|
345
|
+
private _attachSnackBarContainer;
|
|
346
|
+
/**
|
|
347
|
+
* Places a new component or a template as the content of the snack bar container.
|
|
348
|
+
*/
|
|
349
|
+
private _attach;
|
|
350
|
+
/** Animates the old snack bar out and the new one in. */
|
|
351
|
+
private _animateSnackBar;
|
|
352
|
+
/**
|
|
353
|
+
* Creates a new overlay and places it in the correct location.
|
|
354
|
+
* @param config The user-specified snack bar config.
|
|
355
|
+
*/
|
|
356
|
+
private _createOverlay;
|
|
357
|
+
/**
|
|
358
|
+
* Creates an injector to be used inside of a snack bar component.
|
|
359
|
+
* @param config Config that was used to create the snack bar.
|
|
360
|
+
* @param snackBarRef Reference to the snack bar.
|
|
361
|
+
*/
|
|
362
|
+
private _createInjector;
|
|
363
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackBar, never>;
|
|
364
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CuteSnackBar>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
declare class CuteSnackbarModule {
|
|
368
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CuteSnackbarModule, never>;
|
|
369
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CuteSnackbarModule, never, [typeof i1.CommonModule, typeof SimpleSnackBar, typeof CuteSnackBarContainer, typeof CuteSnackBarActions, typeof CuteSnackBarAction, typeof CuteSnackBarBody, typeof CuteSnackBarHeader, typeof CuteSnackBarLabel], [typeof CuteSnackBarContainer, typeof CuteSnackBarActions, typeof CuteSnackBarAction, typeof CuteSnackBarBody, typeof CuteSnackBarHeader, typeof CuteSnackBarLabel]>;
|
|
370
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CuteSnackbarModule>;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export { CUTE_SNACK_BAR_DATA, CUTE_SNACK_BAR_DEFAULT_OPTIONS, CuteSnackBar, CuteSnackBarAction, CuteSnackBarActions, CuteSnackBarBody, CuteSnackBarConfig, CuteSnackBarContainer, CuteSnackBarHeader, CuteSnackBarLabel, CuteSnackBarRef, CuteSnackbarModule, SimpleSnackBar };
|
|
374
|
+
export type { CuteSnackBarDismiss, CuteSnackBarHorizontalPosition, CuteSnackBarVerticalPosition, TextOnlySnackBar };
|