@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,1095 @@
|
|
|
1
|
+
import { FocusTrapFactory, FocusMonitor, InteractivityChecker } from '@angular/cdk/a11y';
|
|
2
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
3
|
+
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
4
|
+
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
5
|
+
import { Platform } from '@angular/cdk/platform';
|
|
6
|
+
import { CdkScrollable, ScrollDispatcher, ViewportRuler, CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { InjectionToken, inject, ElementRef, NgZone, ChangeDetectorRef, ViewEncapsulation, ChangeDetectionStrategy, Component, DOCUMENT, signal, EventEmitter, Injector, afterNextRender, ViewChild, Output, Input, QueryList, isDevMode, ContentChild, ContentChildren, NgModule } from '@angular/core';
|
|
9
|
+
import { Subject, fromEvent, merge } from 'rxjs';
|
|
10
|
+
import { filter, map, takeUntil, take, startWith, debounceTime } from 'rxjs/operators';
|
|
11
|
+
import { _animationsDisabled } from '@cute-widgets/base/core/animation';
|
|
12
|
+
import { CuteLayoutControl } from '@cute-widgets/base/abstract';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @license Apache-2.0
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
19
|
+
*
|
|
20
|
+
* You may not use this file except in compliance with the License
|
|
21
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* This code is a modification of the `@angular/material` original
|
|
24
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Throws an exception when two CuteDrawer are matching the same position.
|
|
28
|
+
*/
|
|
29
|
+
function throwCuteDuplicatedDrawerError(position) {
|
|
30
|
+
throw Error(`A drawer was already declared for 'position="${position}"'`);
|
|
31
|
+
}
|
|
32
|
+
/** Configures whether drawers should use auto sizing by default. */
|
|
33
|
+
const CUTE_DRAWER_DEFAULT_AUTOSIZE = new InjectionToken('CUTE_DRAWER_DEFAULT_AUTOSIZE', {
|
|
34
|
+
providedIn: 'root',
|
|
35
|
+
factory: () => false,
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Used to provide a drawer container to a drawer while avoiding circular references.
|
|
39
|
+
*/
|
|
40
|
+
const CUTE_DRAWER_CONTAINER = new InjectionToken('CUTE_DRAWER_CONTAINER');
|
|
41
|
+
/**
|
|
42
|
+
* The main content of the 'cute-drawer' component
|
|
43
|
+
*/
|
|
44
|
+
class CuteDrawerContent extends CdkScrollable {
|
|
45
|
+
generateId() {
|
|
46
|
+
return "";
|
|
47
|
+
}
|
|
48
|
+
constructor() {
|
|
49
|
+
const elementRef = inject(ElementRef);
|
|
50
|
+
const scrollDispatcher = inject(ScrollDispatcher);
|
|
51
|
+
const ngZone = inject(NgZone);
|
|
52
|
+
super(elementRef, scrollDispatcher, ngZone);
|
|
53
|
+
this._platform = inject(Platform);
|
|
54
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
55
|
+
this._container = inject(CuteDrawerContainer);
|
|
56
|
+
}
|
|
57
|
+
ngAfterContentInit() {
|
|
58
|
+
this._container._contentMarginChanges.subscribe(() => {
|
|
59
|
+
this._changeDetectorRef.markForCheck();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** Determines whether the content element should be hidden from the user. */
|
|
63
|
+
_shouldBeHidden() {
|
|
64
|
+
// In some modes the content is pushed based on the width of the opened sidenavs, however on
|
|
65
|
+
// the server we can't measure the sidenav so the margin is always zero. This can cause the
|
|
66
|
+
// content to jump around when it's rendered on the server and hydrated on the client. We
|
|
67
|
+
// avoid it by hiding the content on the initial render and then showing it once the sidenav
|
|
68
|
+
// has been measured on the client.
|
|
69
|
+
if (this._platform.isBrowser) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const { start, end } = this._container;
|
|
73
|
+
return ((start != null && start.mode !== 'over' && start.opened) ||
|
|
74
|
+
(end != null && end.mode !== 'over' && end.opened));
|
|
75
|
+
}
|
|
76
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteDrawerContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
77
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: CuteDrawerContent, isStandalone: true, selector: "cute-drawer-content", host: { properties: { "class.cute-drawer-content-hidden": "_shouldBeHidden()", "style.margin-left.px": "_container._contentMargins.left", "style.margin-right.px": "_container._contentMargins.right" }, classAttribute: "cute-drawer-content" }, providers: [
|
|
78
|
+
{
|
|
79
|
+
provide: CdkScrollable,
|
|
80
|
+
useExisting: CuteDrawerContent,
|
|
81
|
+
},
|
|
82
|
+
], usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteDrawerContent, decorators: [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{
|
|
87
|
+
selector: 'cute-drawer-content',
|
|
88
|
+
template: '<ng-content></ng-content>',
|
|
89
|
+
host: {
|
|
90
|
+
'class': 'cute-drawer-content',
|
|
91
|
+
'[class.cute-drawer-content-hidden]': '_shouldBeHidden()',
|
|
92
|
+
'[style.margin-left.px]': '_container._contentMargins.left',
|
|
93
|
+
'[style.margin-right.px]': '_container._contentMargins.right',
|
|
94
|
+
},
|
|
95
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
96
|
+
encapsulation: ViewEncapsulation.None,
|
|
97
|
+
providers: [
|
|
98
|
+
{
|
|
99
|
+
provide: CdkScrollable,
|
|
100
|
+
useExisting: CuteDrawerContent,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
standalone: true,
|
|
104
|
+
}]
|
|
105
|
+
}], ctorParameters: () => [] });
|
|
106
|
+
/**
|
|
107
|
+
* This component corresponds to a drawer that can be opened on the drawer container.
|
|
108
|
+
*/
|
|
109
|
+
class CuteDrawer extends CuteLayoutControl {
|
|
110
|
+
/** The side that the drawer is attached to. */
|
|
111
|
+
get position() { return this._position; }
|
|
112
|
+
set position(value) {
|
|
113
|
+
// Make sure we have a valid value.
|
|
114
|
+
value = value === 'end' ? 'end' : 'start';
|
|
115
|
+
if (value !== this._position) {
|
|
116
|
+
// Static inputs in Ivy are set before the element is in the DOM.
|
|
117
|
+
if (this._isAttached) {
|
|
118
|
+
this._updatePositionInParent(value);
|
|
119
|
+
}
|
|
120
|
+
this._position = value;
|
|
121
|
+
this.onPositionChanged.emit();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Mode of the drawer; one of 'over', 'push' or 'side'. */
|
|
125
|
+
get mode() { return this._mode; }
|
|
126
|
+
set mode(value) {
|
|
127
|
+
this._mode = value;
|
|
128
|
+
this._updateFocusTrapState();
|
|
129
|
+
this._modeChanged.next();
|
|
130
|
+
}
|
|
131
|
+
/** Whether the drawer can be closed with the escape key or by clicking on the backdrop. */
|
|
132
|
+
get disableClose() { return this._disableClose; }
|
|
133
|
+
set disableClose(value) {
|
|
134
|
+
this._disableClose = coerceBooleanProperty(value);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Whether the drawer should focus the first focusable element automatically when opened.
|
|
138
|
+
* Defaults to false in when `mode` is set to `side`, otherwise defaults to `true`. If explicitly
|
|
139
|
+
* enabled, focus will be moved into the sidenav in `side` mode as well.
|
|
140
|
+
* @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or AutoFocusTarget
|
|
141
|
+
* instead.
|
|
142
|
+
*/
|
|
143
|
+
get autoFocus() {
|
|
144
|
+
const value = this._autoFocus;
|
|
145
|
+
// Note that usually we don't allow autoFocus to be set to `first-tabbable` in `side` mode,
|
|
146
|
+
// because we don't know how the sidenav is being used, but in some cases it still makes
|
|
147
|
+
// sense to do it. The consumer can explicitly set `autoFocus`.
|
|
148
|
+
if (value == null) {
|
|
149
|
+
if (this.mode === 'side') {
|
|
150
|
+
return 'dialog';
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
return 'first-tabbable';
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
set autoFocus(value) {
|
|
159
|
+
if (value === 'true' || value === 'false' || value == null) {
|
|
160
|
+
value = coerceBooleanProperty(value);
|
|
161
|
+
}
|
|
162
|
+
this._autoFocus = value;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Whether the drawer is opened. We overload this because we trigger an event when it
|
|
166
|
+
* starts or ends.
|
|
167
|
+
*/
|
|
168
|
+
get opened() { return this._opened(); }
|
|
169
|
+
set opened(value) {
|
|
170
|
+
this.toggle(coerceBooleanProperty(value));
|
|
171
|
+
}
|
|
172
|
+
/** Implementation of `Expandable` interface */
|
|
173
|
+
get expanded() { return this.opened; }
|
|
174
|
+
generateId() {
|
|
175
|
+
return "";
|
|
176
|
+
}
|
|
177
|
+
constructor() {
|
|
178
|
+
super();
|
|
179
|
+
this._focusTrapFactory = inject(FocusTrapFactory);
|
|
180
|
+
this._focusMonitor = inject(FocusMonitor);
|
|
181
|
+
this._platform = inject(Platform);
|
|
182
|
+
this._ngZone = inject(NgZone);
|
|
183
|
+
this._interactivityChecker = inject(InteractivityChecker);
|
|
184
|
+
this._doc = inject(DOCUMENT);
|
|
185
|
+
this._container = inject(CUTE_DRAWER_CONTAINER, { optional: true });
|
|
186
|
+
this._elementFocusedBeforeDrawerWasOpened = null;
|
|
187
|
+
this._eventCleanups = [];
|
|
188
|
+
/** Whether the view of the component has been attached. */
|
|
189
|
+
this._isAttached = false;
|
|
190
|
+
/** Anchor node used to restore the drawer to its initial position. */
|
|
191
|
+
this._anchor = null;
|
|
192
|
+
/** Subject that emits when the component has been destroyed. */
|
|
193
|
+
this._destroyed = new Subject();
|
|
194
|
+
this._position = 'start';
|
|
195
|
+
this._mode = 'over';
|
|
196
|
+
this._disableClose = false;
|
|
197
|
+
this._opened = signal(false, ...(ngDevMode ? [{ debugName: "_opened" }] : []));
|
|
198
|
+
/** How the sidenav was opened (keypress, mouse click etc.) */
|
|
199
|
+
this._openedVia = null;
|
|
200
|
+
/** Emits whenever the drawer has started animating. */
|
|
201
|
+
this._animationStarted = new Subject();
|
|
202
|
+
/** Emits whenever the drawer is done animating. */
|
|
203
|
+
this._animationEnd = new Subject();
|
|
204
|
+
/** Event emitted when the drawer open state is changed. */
|
|
205
|
+
this.openedChange =
|
|
206
|
+
// Note this has to be async to avoid some issues with two-bindings (see #8872).
|
|
207
|
+
new EventEmitter(/* isAsync */ true);
|
|
208
|
+
/** Event emitted when the drawer has been opened. */
|
|
209
|
+
this._openedStream = this.openedChange.pipe(filter(o => o), map(() => { }));
|
|
210
|
+
/** Event emitted when the drawer has started opening. */
|
|
211
|
+
this.openedStart = this._animationStarted.pipe(filter(() => this.opened), map(() => undefined));
|
|
212
|
+
/** Event emitted when the drawer has been closed. */
|
|
213
|
+
this._closedStream = this.openedChange.pipe(filter(o => !o), map(() => { }));
|
|
214
|
+
/** Event emitted when the drawer has started closing. */
|
|
215
|
+
this.closedStart = this._animationStarted.pipe(filter(() => !this.opened), map(() => undefined));
|
|
216
|
+
/** Event emitted when the drawer's position changes. */
|
|
217
|
+
this.onPositionChanged = new EventEmitter();
|
|
218
|
+
/**
|
|
219
|
+
* An observable that emits when the drawer mode changes. This is used by the drawer container to know
|
|
220
|
+
* when to when the mode changes, so it can adapt the margins on the content.
|
|
221
|
+
*/
|
|
222
|
+
this._modeChanged = new Subject();
|
|
223
|
+
this._injector = inject(Injector);
|
|
224
|
+
/** Event handler for animation events. */
|
|
225
|
+
this._handleTransitionEvent = (event) => {
|
|
226
|
+
const element = this._elementRef.nativeElement;
|
|
227
|
+
if (event.target === element) {
|
|
228
|
+
this._ngZone.run(() => {
|
|
229
|
+
if (event.type === 'transitionrun') {
|
|
230
|
+
this._animationStarted.next(event);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
// Don't toggle the animating state on `transitioncancel` since another animation should
|
|
234
|
+
// start afterwards. This prevents the drawer from blinking if an animation is interrupted.
|
|
235
|
+
if (event.type === 'transitionend') {
|
|
236
|
+
this._setIsAnimating(false);
|
|
237
|
+
}
|
|
238
|
+
this._animationEnd.next(event);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
this.openedChange.pipe(takeUntil(this._destroyed)).subscribe((opened) => {
|
|
244
|
+
if (opened) {
|
|
245
|
+
this._elementFocusedBeforeDrawerWasOpened = this._doc.activeElement;
|
|
246
|
+
this._takeFocus();
|
|
247
|
+
}
|
|
248
|
+
else if (this._isFocusWithinDrawer()) {
|
|
249
|
+
this._restoreFocus(this._openedVia || 'program');
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
/**
|
|
253
|
+
* Listen to `keydown` events outside the zone so that change detection is not run every
|
|
254
|
+
* time a key is pressed. Instead, we re-enter the zone only if the `ESC` key is pressed,
|
|
255
|
+
* and we don't have a close disabled.
|
|
256
|
+
*/
|
|
257
|
+
this._ngZone.runOutsideAngular(() => {
|
|
258
|
+
const element = this._elementRef.nativeElement;
|
|
259
|
+
fromEvent(element, 'keydown')
|
|
260
|
+
.pipe(filter(event => {
|
|
261
|
+
return event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event);
|
|
262
|
+
}), takeUntil(this._destroyed))
|
|
263
|
+
.subscribe(event => this._ngZone.run(() => {
|
|
264
|
+
this.close();
|
|
265
|
+
event.stopPropagation();
|
|
266
|
+
event.preventDefault();
|
|
267
|
+
}));
|
|
268
|
+
this._eventCleanups = [
|
|
269
|
+
this._renderer.listen(element, 'transitionrun', this._handleTransitionEvent),
|
|
270
|
+
this._renderer.listen(element, 'transitionend', this._handleTransitionEvent),
|
|
271
|
+
this._renderer.listen(element, 'transitioncancel', this._handleTransitionEvent),
|
|
272
|
+
];
|
|
273
|
+
});
|
|
274
|
+
this._animationEnd.subscribe(() => {
|
|
275
|
+
this.openedChange.emit(this.opened);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Focuses the provided element. If the element is not focusable, it will add a tabIndex
|
|
280
|
+
* attribute to forcefully focus it. The attribute is removed after focus is moved.
|
|
281
|
+
* @param element The element to focus.
|
|
282
|
+
* @param options
|
|
283
|
+
*/
|
|
284
|
+
_forceFocus(element, options) {
|
|
285
|
+
if (!this._interactivityChecker.isFocusable(element)) {
|
|
286
|
+
element.tabIndex = -1;
|
|
287
|
+
// The tabindex attribute should be removed to avoid navigating to that element again
|
|
288
|
+
this._ngZone.runOutsideAngular(() => {
|
|
289
|
+
const callback = () => {
|
|
290
|
+
cleanupBlur();
|
|
291
|
+
cleanupMousedown();
|
|
292
|
+
element.removeAttribute('tabindex');
|
|
293
|
+
};
|
|
294
|
+
const cleanupBlur = this._renderer.listen(element, 'blur', callback);
|
|
295
|
+
const cleanupMousedown = this._renderer.listen(element, 'mousedown', callback);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
element.focus(options);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Focuses the first element that matches the given selector within the focus trap.
|
|
302
|
+
* @param selector The CSS selector for the element to set focus to.
|
|
303
|
+
* @param options
|
|
304
|
+
*/
|
|
305
|
+
_focusByCssSelector(selector, options) {
|
|
306
|
+
let elementToFocus = this._elementRef.nativeElement.querySelector(selector);
|
|
307
|
+
if (elementToFocus) {
|
|
308
|
+
this._forceFocus(elementToFocus, options);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Moves focus into the drawer. Note that this works even if
|
|
313
|
+
* the focus trap is disabled in `side` mode.
|
|
314
|
+
*/
|
|
315
|
+
_takeFocus() {
|
|
316
|
+
if (!this._focusTrap) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const element = this._elementRef.nativeElement;
|
|
320
|
+
// When autoFocus is not on the sidenav, if the element cannot be focused or does
|
|
321
|
+
// not exist, focus the sidenav itself so the keyboard navigation still works.
|
|
322
|
+
// We need to check that `focus` is a function due to Universal.
|
|
323
|
+
switch (this.autoFocus) {
|
|
324
|
+
case false:
|
|
325
|
+
case 'dialog':
|
|
326
|
+
return;
|
|
327
|
+
case true:
|
|
328
|
+
case 'first-tabbable':
|
|
329
|
+
afterNextRender(() => {
|
|
330
|
+
const hasMovedFocus = this._focusTrap.focusInitialElement();
|
|
331
|
+
if (!hasMovedFocus && typeof element.focus === 'function') {
|
|
332
|
+
element.focus();
|
|
333
|
+
}
|
|
334
|
+
}, { injector: this._injector });
|
|
335
|
+
break;
|
|
336
|
+
case 'first-heading':
|
|
337
|
+
this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');
|
|
338
|
+
break;
|
|
339
|
+
default:
|
|
340
|
+
this._focusByCssSelector(this.autoFocus);
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Restores focus to the element that was originally focused when the drawer opened.
|
|
346
|
+
* If no element was focused at that time, the focus will be restored to the drawer.
|
|
347
|
+
*/
|
|
348
|
+
_restoreFocus(focusOrigin) {
|
|
349
|
+
if (this.autoFocus === 'dialog') {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (this._elementFocusedBeforeDrawerWasOpened) {
|
|
353
|
+
this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened, focusOrigin);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
this._elementRef.nativeElement.blur();
|
|
357
|
+
}
|
|
358
|
+
this._elementFocusedBeforeDrawerWasOpened = null;
|
|
359
|
+
}
|
|
360
|
+
/** Whether focus is currently within the drawer. */
|
|
361
|
+
_isFocusWithinDrawer() {
|
|
362
|
+
const activeEl = this._doc.activeElement;
|
|
363
|
+
return !!activeEl && this._elementRef.nativeElement.contains(activeEl);
|
|
364
|
+
}
|
|
365
|
+
ngAfterViewInit() {
|
|
366
|
+
super.ngAfterViewInit();
|
|
367
|
+
this._isAttached = true;
|
|
368
|
+
// Only update the DOM position when the sidenav is positioned at
|
|
369
|
+
// the end since we project the sidenav before the content by default.
|
|
370
|
+
if (this._position === 'end') {
|
|
371
|
+
this._updatePositionInParent('end');
|
|
372
|
+
}
|
|
373
|
+
// Needs to happen after the position is updated
|
|
374
|
+
// so the focus trap anchors are in the right place.
|
|
375
|
+
if (this._platform.isBrowser) {
|
|
376
|
+
this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);
|
|
377
|
+
this._updateFocusTrapState();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
ngOnDestroy() {
|
|
381
|
+
super.ngOnDestroy();
|
|
382
|
+
this._eventCleanups.forEach(cleanup => cleanup());
|
|
383
|
+
this._focusTrap?.destroy();
|
|
384
|
+
this._anchor?.remove();
|
|
385
|
+
this._anchor = null;
|
|
386
|
+
this._animationStarted.complete();
|
|
387
|
+
this._animationEnd.complete();
|
|
388
|
+
this._modeChanged.complete();
|
|
389
|
+
this._destroyed.next();
|
|
390
|
+
this._destroyed.complete();
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Open the drawer.
|
|
394
|
+
* @param openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
|
|
395
|
+
* Used for focus management after the sidenav is closed.
|
|
396
|
+
*/
|
|
397
|
+
open(openedVia) {
|
|
398
|
+
return this.toggle(true, openedVia);
|
|
399
|
+
}
|
|
400
|
+
/** Close the drawer. */
|
|
401
|
+
close() {
|
|
402
|
+
return this.toggle(false);
|
|
403
|
+
}
|
|
404
|
+
/** Closes the drawer with context that the backdrop was clicked. */
|
|
405
|
+
_closeViaBackdropClick() {
|
|
406
|
+
// If the drawer is closed upon a backdrop click, we always want to restore focus. We
|
|
407
|
+
// don't need to check whether focus is currently in the drawer, as clicking on the
|
|
408
|
+
// backdrop causes to blur the active element.
|
|
409
|
+
return this._setOpen(/* isOpen */ false, /* restoreFocus */ true, 'mouse');
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Toggle this drawer.
|
|
413
|
+
* @param isOpen Whether the drawer should be open.
|
|
414
|
+
* @param openedVia Whether the drawer was opened by a key press, mouse click or programmatically.
|
|
415
|
+
* Used for focus management after the sidenav is closed.
|
|
416
|
+
*/
|
|
417
|
+
toggle(isOpen = !this.opened, openedVia) {
|
|
418
|
+
// If the focus is currently inside the drawer content, and we are closing the drawer,
|
|
419
|
+
// restore the focus to the initially focused element (when the drawer opened).
|
|
420
|
+
if (isOpen && openedVia) {
|
|
421
|
+
this._openedVia = openedVia;
|
|
422
|
+
}
|
|
423
|
+
const result = this._setOpen(isOpen,
|
|
424
|
+
/* restoreFocus */ !isOpen && this._isFocusWithinDrawer(), this._openedVia || 'program');
|
|
425
|
+
if (!isOpen) {
|
|
426
|
+
this._openedVia = null;
|
|
427
|
+
}
|
|
428
|
+
return result;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Toggles the opened state of the drawer.
|
|
432
|
+
* @param isOpen Whether the drawer should open or close.
|
|
433
|
+
* @param restoreFocus Whether focus should be restored on close.
|
|
434
|
+
* @param focusOrigin Origin to use when restoring focus.
|
|
435
|
+
*/
|
|
436
|
+
_setOpen(isOpen, restoreFocus, focusOrigin) {
|
|
437
|
+
if (isOpen === this.opened) {
|
|
438
|
+
return Promise.resolve(isOpen ? 'open' : 'close');
|
|
439
|
+
}
|
|
440
|
+
this._opened.set(isOpen);
|
|
441
|
+
if (this._container?._transitionsEnabled) {
|
|
442
|
+
// Note: it's important to set this as early as possible,
|
|
443
|
+
// otherwise the animation can look glitchy in some cases.
|
|
444
|
+
this._setIsAnimating(true);
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
// Simulate the animation events if animations are disabled.
|
|
448
|
+
setTimeout(() => {
|
|
449
|
+
this._animationStarted.next(undefined);
|
|
450
|
+
this._animationEnd.next(undefined);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
this._elementRef.nativeElement.classList.toggle('cute-drawer-opened', isOpen);
|
|
454
|
+
if (!isOpen && restoreFocus) {
|
|
455
|
+
this._restoreFocus(focusOrigin);
|
|
456
|
+
}
|
|
457
|
+
// Needed to ensure that the closing sequence fires off correctly.
|
|
458
|
+
this._changeDetectorRef.markForCheck();
|
|
459
|
+
this._updateFocusTrapState();
|
|
460
|
+
return new Promise(resolve => {
|
|
461
|
+
this.openedChange.pipe(take(1)).subscribe(open => resolve(open ? 'open' : 'close'));
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
/** Toggles whether the drawer is currently animating. */
|
|
465
|
+
_setIsAnimating(isAnimating) {
|
|
466
|
+
this._elementRef.nativeElement.classList.toggle('cute-drawer-animating', isAnimating);
|
|
467
|
+
}
|
|
468
|
+
_getWidth() {
|
|
469
|
+
return this._elementRef.nativeElement ? this._elementRef.nativeElement.offsetWidth || 0 : 0;
|
|
470
|
+
}
|
|
471
|
+
/** Updates the enabled state of the focus trap. */
|
|
472
|
+
_updateFocusTrapState() {
|
|
473
|
+
if (this._focusTrap) {
|
|
474
|
+
// Trap focus only if the backdrop is enabled. Otherwise, allow end user to interact with the
|
|
475
|
+
// sidenav content.
|
|
476
|
+
this._focusTrap.enabled = !!this._container?.hasBackdrop && this.opened;
|
|
477
|
+
;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Updates the position of the drawer in the DOM. We need to move the element around ourselves
|
|
482
|
+
* when it's in the `end` position so that it comes after the content and the visual order
|
|
483
|
+
* matches the tab order. We also need to be able to move it back to `start` if the sidenav
|
|
484
|
+
* started off as `end` and was changed to `start`.
|
|
485
|
+
*/
|
|
486
|
+
_updatePositionInParent(newPosition) {
|
|
487
|
+
// Don't move the DOM node around on the server, because it can throw off hydration.
|
|
488
|
+
if (!this._platform.isBrowser) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
const element = this._elementRef.nativeElement;
|
|
492
|
+
const parent = element.parentNode;
|
|
493
|
+
if (newPosition === 'end') {
|
|
494
|
+
if (!this._anchor) {
|
|
495
|
+
this._anchor = this._doc.createComment('cute-drawer-anchor');
|
|
496
|
+
parent.insertBefore(this._anchor, element);
|
|
497
|
+
}
|
|
498
|
+
parent.appendChild(element);
|
|
499
|
+
}
|
|
500
|
+
else if (this._anchor) {
|
|
501
|
+
this._anchor.parentNode.insertBefore(element, this._anchor);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
505
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: CuteDrawer, isStandalone: true, selector: "cute-drawer", inputs: { position: "position", mode: "mode", disableClose: "disableClose", autoFocus: "autoFocus", opened: "opened" }, outputs: { openedChange: "openedChange", _openedStream: "opened", openedStart: "openedStart", _closedStream: "closed", closedStart: "closedStart", onPositionChanged: "positionChanged" }, host: { properties: { "attr.align": "null", "class.cute-drawer-end": "position === \"end\"", "class.cute-drawer-over": "mode === \"over\"", "class.cute-drawer-push": "mode === \"push\"", "class.cute-drawer-side": "mode === \"side\"", "style.visibility": "(!_container && !opened) ? \"hidden\" : null", "attr.tabIndex": "(mode !== \"side\") ? \"-1\" : null" }, classAttribute: "cute-drawer" }, viewQueries: [{ propertyName: "_content", first: true, predicate: ["content"], descendants: true }], exportAs: ["cuteDrawer"], usesInheritance: true, ngImport: i0, template: "<div class=\"cute-drawer-inner-container\" cdkScrollable #content>\r\n <ng-content></ng-content>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
506
|
+
}
|
|
507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteDrawer, decorators: [{
|
|
508
|
+
type: Component,
|
|
509
|
+
args: [{ selector: 'cute-drawer', exportAs: 'cuteDrawer', host: {
|
|
510
|
+
'class': 'cute-drawer',
|
|
511
|
+
// must prevent the browser from aligning text based on value
|
|
512
|
+
'[attr.align]': 'null',
|
|
513
|
+
'[class.cute-drawer-end]': 'position === "end"',
|
|
514
|
+
'[class.cute-drawer-over]': 'mode === "over"',
|
|
515
|
+
'[class.cute-drawer-push]': 'mode === "push"',
|
|
516
|
+
'[class.cute-drawer-side]': 'mode === "side"',
|
|
517
|
+
// The styles that render the sidenav off-screen come from the drawer container. Prior to #30235
|
|
518
|
+
// this was also done by the animations module which some internal tests seem to depend on.
|
|
519
|
+
// Simulate it by toggling the `hidden` attribute instead.
|
|
520
|
+
'[style.visibility]': '(!_container && !opened) ? "hidden" : null', // The sidenav container should not be focused on when used in side mode. See b/286459024 for
|
|
521
|
+
// reference. Updates tabIndex of drawer/container to default to null if in side mode.
|
|
522
|
+
'[attr.tabIndex]': '(mode !== "side") ? "-1" : null',
|
|
523
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CdkScrollable], template: "<div class=\"cute-drawer-inner-container\" cdkScrollable #content>\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
|
|
524
|
+
}], ctorParameters: () => [], propDecorators: { position: [{
|
|
525
|
+
type: Input
|
|
526
|
+
}], mode: [{
|
|
527
|
+
type: Input
|
|
528
|
+
}], disableClose: [{
|
|
529
|
+
type: Input
|
|
530
|
+
}], autoFocus: [{
|
|
531
|
+
type: Input
|
|
532
|
+
}], opened: [{
|
|
533
|
+
type: Input
|
|
534
|
+
}], openedChange: [{
|
|
535
|
+
type: Output
|
|
536
|
+
}], _openedStream: [{
|
|
537
|
+
type: Output,
|
|
538
|
+
args: ['opened']
|
|
539
|
+
}], openedStart: [{
|
|
540
|
+
type: Output
|
|
541
|
+
}], _closedStream: [{
|
|
542
|
+
type: Output,
|
|
543
|
+
args: ['closed']
|
|
544
|
+
}], closedStart: [{
|
|
545
|
+
type: Output
|
|
546
|
+
}], onPositionChanged: [{
|
|
547
|
+
type: Output,
|
|
548
|
+
args: ['positionChanged']
|
|
549
|
+
}], _content: [{
|
|
550
|
+
type: ViewChild,
|
|
551
|
+
args: ['content']
|
|
552
|
+
}] } });
|
|
553
|
+
/**
|
|
554
|
+
* `<cute-drawer-container>` component.
|
|
555
|
+
*
|
|
556
|
+
* This is the parent component to one or two `<cute-drawer>`s that validates the state internally
|
|
557
|
+
* and coordinates the backdrop and content styling.
|
|
558
|
+
*/
|
|
559
|
+
class CuteDrawerContainer extends CuteLayoutControl {
|
|
560
|
+
/** The drawer child with the `start` position. */
|
|
561
|
+
get start() {
|
|
562
|
+
return this._start;
|
|
563
|
+
}
|
|
564
|
+
/** The drawer child with the `end` position. */
|
|
565
|
+
get end() {
|
|
566
|
+
return this._end;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Whether to automatically resize the container whenever
|
|
570
|
+
* the size of its drawers changes.
|
|
571
|
+
*
|
|
572
|
+
* **Use at your own risk!** Enabling this option can cause layout thrashing by measuring
|
|
573
|
+
* the drawers on every change detection cycle. Can be configured globally via the
|
|
574
|
+
* `CUTE_DRAWER_DEFAULT_AUTOSIZE` token.
|
|
575
|
+
*/
|
|
576
|
+
get autosize() { return this._autosize; }
|
|
577
|
+
set autosize(value) {
|
|
578
|
+
this._autosize = coerceBooleanProperty(value);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Whether the drawer container should have a backdrop while one of the `sidenav`s is open.
|
|
582
|
+
* If explicitly set to `true`, the backdrop will be enabled for drawers in the `side`
|
|
583
|
+
* mode as well.
|
|
584
|
+
*/
|
|
585
|
+
get hasBackdrop() {
|
|
586
|
+
return this._drawerHasBackdrop(this._start) || this._drawerHasBackdrop(this._end);
|
|
587
|
+
}
|
|
588
|
+
set hasBackdrop(value) {
|
|
589
|
+
this._backdropOverride = value == null ? null : coerceBooleanProperty(value);
|
|
590
|
+
}
|
|
591
|
+
/** Reference to the CdkScrollable instance that wraps the scrollable content. */
|
|
592
|
+
get scrollable() {
|
|
593
|
+
return (this._userContent || this._content);
|
|
594
|
+
}
|
|
595
|
+
generateId() {
|
|
596
|
+
return "";
|
|
597
|
+
}
|
|
598
|
+
constructor() {
|
|
599
|
+
super();
|
|
600
|
+
this._dir = inject(Directionality, { optional: true });
|
|
601
|
+
this._element = inject(ElementRef);
|
|
602
|
+
this._ngZone = inject(NgZone);
|
|
603
|
+
this._animationDisabled = _animationsDisabled();
|
|
604
|
+
this._transitionsEnabled = false;
|
|
605
|
+
/** Drawers that belong to this container. */
|
|
606
|
+
this._drawers = new QueryList();
|
|
607
|
+
this._autosize = false;
|
|
608
|
+
this._backdropOverride = null;
|
|
609
|
+
/** Event emitted when the drawer backdrop is clicked. */
|
|
610
|
+
this.backdropClick = new EventEmitter();
|
|
611
|
+
/** The drawer at the start/end position, independent of a direction. */
|
|
612
|
+
this._start = null;
|
|
613
|
+
this._end = null;
|
|
614
|
+
/**
|
|
615
|
+
* The drawer at the left/right. When a direction changes, these will change as well.
|
|
616
|
+
* They're used as aliases for the above to set the left/right style properly.
|
|
617
|
+
* In LTR, _left == _start and _right == _end.
|
|
618
|
+
* In RTL, _left == _end and _right == _start.
|
|
619
|
+
*/
|
|
620
|
+
this._left = null;
|
|
621
|
+
this._right = null;
|
|
622
|
+
/** Emits on every ngDoCheck. Used for debouncing reflows. */
|
|
623
|
+
this._doCheckSubject = new Subject();
|
|
624
|
+
/** Subject that emits when the component has been destroyed. */
|
|
625
|
+
this._destroyed = new Subject();
|
|
626
|
+
/**
|
|
627
|
+
* Margins to be applied to the content. These are used to push / shrink the drawer content when a
|
|
628
|
+
* drawer is open. We use margin rather than transform even for push mode because transform breaks
|
|
629
|
+
* fixed position elements inside of the transformed element.
|
|
630
|
+
*/
|
|
631
|
+
this._contentMargins = { left: null, right: null };
|
|
632
|
+
this._contentMarginChanges = new Subject();
|
|
633
|
+
this._injector = inject(Injector);
|
|
634
|
+
const platform = inject(Platform);
|
|
635
|
+
const viewportRuler = inject(ViewportRuler);
|
|
636
|
+
const defaultAutosize = inject(CUTE_DRAWER_DEFAULT_AUTOSIZE, { optional: true });
|
|
637
|
+
this._autosize = defaultAutosize ?? false;
|
|
638
|
+
// If a `Dir` directive exists up the tree, listen to direction changes
|
|
639
|
+
// and update the left/right properties to point to the proper start/end.
|
|
640
|
+
this._dir?.change.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
641
|
+
this._validateDrawers();
|
|
642
|
+
this.updateContentMargins();
|
|
643
|
+
});
|
|
644
|
+
// Since the minimum width of the sidenav depends on the viewport width,
|
|
645
|
+
// we need to recompute the margins if the viewport changes.
|
|
646
|
+
viewportRuler
|
|
647
|
+
.change()
|
|
648
|
+
.pipe(takeUntil(this._destroyed))
|
|
649
|
+
.subscribe(() => this.updateContentMargins());
|
|
650
|
+
if (!this._animationDisabled && platform.isBrowser) {
|
|
651
|
+
this._ngZone.runOutsideAngular(() => {
|
|
652
|
+
// Enable the animations after a delay in order to skip
|
|
653
|
+
// the initial transition if a drawer is open by default.
|
|
654
|
+
setTimeout(() => {
|
|
655
|
+
this._element.nativeElement.classList.add('cute-drawer-transition');
|
|
656
|
+
this._transitionsEnabled = true;
|
|
657
|
+
}, 200);
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
ngAfterContentInit() {
|
|
662
|
+
super.ngAfterContentInit();
|
|
663
|
+
this._allDrawers?.changes
|
|
664
|
+
.pipe(startWith(this._allDrawers), takeUntil(this._destroyed))
|
|
665
|
+
.subscribe((drawer) => {
|
|
666
|
+
this._drawers.reset(drawer.filter(item => !item._container || item._container === this));
|
|
667
|
+
this._drawers.notifyOnChanges();
|
|
668
|
+
});
|
|
669
|
+
this._drawers.changes.pipe(startWith(null)).subscribe(() => {
|
|
670
|
+
this._validateDrawers();
|
|
671
|
+
this._drawers.forEach((drawer) => {
|
|
672
|
+
this._watchDrawerToggle(drawer);
|
|
673
|
+
this._watchDrawerPosition(drawer);
|
|
674
|
+
this._watchDrawerMode(drawer);
|
|
675
|
+
});
|
|
676
|
+
if (!this._drawers.length ||
|
|
677
|
+
this._isDrawerOpen(this._start) ||
|
|
678
|
+
this._isDrawerOpen(this._end)) {
|
|
679
|
+
this.updateContentMargins();
|
|
680
|
+
}
|
|
681
|
+
this._changeDetectorRef.markForCheck();
|
|
682
|
+
});
|
|
683
|
+
// Avoid hitting the NgZone through the debounce timeout.
|
|
684
|
+
this._ngZone.runOutsideAngular(() => {
|
|
685
|
+
this._doCheckSubject
|
|
686
|
+
.pipe(debounceTime(10), // Arbitrary debounce time, less than a frame at 60fps
|
|
687
|
+
takeUntil(this._destroyed))
|
|
688
|
+
.subscribe(() => this.updateContentMargins());
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
ngOnDestroy() {
|
|
692
|
+
super.ngOnDestroy();
|
|
693
|
+
this._contentMarginChanges.complete();
|
|
694
|
+
this._doCheckSubject.complete();
|
|
695
|
+
this._drawers.destroy();
|
|
696
|
+
this._destroyed.next();
|
|
697
|
+
this._destroyed.complete();
|
|
698
|
+
}
|
|
699
|
+
/** Calls `open` of both start and end drawers */
|
|
700
|
+
open() {
|
|
701
|
+
this._drawers.forEach(drawer => drawer.open());
|
|
702
|
+
}
|
|
703
|
+
/** Calls `close` of both start and end drawers */
|
|
704
|
+
close() {
|
|
705
|
+
this._drawers.forEach(drawer => drawer.close());
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Recalculates and updates the inline styles for the content. Note that this should be used
|
|
709
|
+
* sparingly, because it causes a reflow.
|
|
710
|
+
*/
|
|
711
|
+
updateContentMargins() {
|
|
712
|
+
// 1. For drawers in `over` mode, they don't affect the content.
|
|
713
|
+
// 2. For drawers in `side` mode they should shrink the content. We do this by adding to the
|
|
714
|
+
// left margin (for left drawer) or right margin (for right the drawer).
|
|
715
|
+
// 3. For drawers in `push` mode the should shift the content without resizing it. We do this by
|
|
716
|
+
// adding to the left or right margin and simultaneously subtracting the same amount of
|
|
717
|
+
// margin from the other side.
|
|
718
|
+
let left = 0;
|
|
719
|
+
let right = 0;
|
|
720
|
+
if (this._left && this._left.opened) {
|
|
721
|
+
if (this._left.mode == 'side') {
|
|
722
|
+
left += this._left._getWidth();
|
|
723
|
+
}
|
|
724
|
+
else if (this._left.mode == 'push') {
|
|
725
|
+
const width = this._left._getWidth();
|
|
726
|
+
left += width;
|
|
727
|
+
right -= width;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if (this._right && this._right.opened) {
|
|
731
|
+
if (this._right.mode == 'side') {
|
|
732
|
+
right += this._right._getWidth();
|
|
733
|
+
}
|
|
734
|
+
else if (this._right.mode == 'push') {
|
|
735
|
+
const width = this._right._getWidth();
|
|
736
|
+
right += width;
|
|
737
|
+
left -= width;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
// If either `right` or `left` is zero, don't set a style to the element. This
|
|
741
|
+
// allows users to specify a custom size via CSS class in SSR scenarios where the
|
|
742
|
+
// measured widths will always be zero. Note that we reset to `null` here, rather
|
|
743
|
+
// than below, in order to ensure that the types in the `if` below are consistent.
|
|
744
|
+
left = left || null;
|
|
745
|
+
right = right || null;
|
|
746
|
+
if (left !== this._contentMargins.left || right !== this._contentMargins.right) {
|
|
747
|
+
this._contentMargins = { left, right };
|
|
748
|
+
// Pull back into the NgZone since in some cases we could be outside. We need to be careful
|
|
749
|
+
// to do it only when something changed, otherwise we can end up hitting the zone too often.
|
|
750
|
+
this._ngZone.run(() => this._contentMarginChanges.next(this._contentMargins));
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
ngDoCheck() {
|
|
754
|
+
// If users opted into autosizing, do a check every change detection cycle.
|
|
755
|
+
if (this._autosize && this._isPushed()) {
|
|
756
|
+
// Run outside the NgZone, otherwise the debouncer will throw us into an infinite loop.
|
|
757
|
+
this._ngZone.runOutsideAngular(() => this._doCheckSubject.next());
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Subscribes to drawer events in order to set a class on the main container element when the
|
|
762
|
+
* drawer is open and the backdrop is visible. This ensures any overflow on the container element
|
|
763
|
+
* is properly hidden.
|
|
764
|
+
*/
|
|
765
|
+
_watchDrawerToggle(drawer) {
|
|
766
|
+
drawer._animationStarted.pipe(takeUntil(this._drawers.changes)).subscribe(() => {
|
|
767
|
+
this.updateContentMargins();
|
|
768
|
+
this._changeDetectorRef.markForCheck();
|
|
769
|
+
});
|
|
770
|
+
if (drawer.mode !== 'side') {
|
|
771
|
+
drawer.openedChange
|
|
772
|
+
.pipe(takeUntil(this._drawers.changes))
|
|
773
|
+
.subscribe(() => this._setContainerClass(drawer.opened));
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Subscribes to drawer onPositionChanged event in order to
|
|
778
|
+
* re-validate drawers when the position changes.
|
|
779
|
+
*/
|
|
780
|
+
_watchDrawerPosition(drawer) {
|
|
781
|
+
if (!drawer) {
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
// NOTE: We need to wait for the microtask queue to be empty before validating,
|
|
785
|
+
// since both drawers may be swapping positions at the same time.
|
|
786
|
+
drawer.onPositionChanged.pipe(takeUntil(this._drawers.changes)).subscribe(() => {
|
|
787
|
+
afterNextRender({ read: () => this._validateDrawers() }, { injector: this._injector });
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
/** Subscribes to changes in drawer mode so we can run change detection. */
|
|
791
|
+
_watchDrawerMode(drawer) {
|
|
792
|
+
drawer._modeChanged
|
|
793
|
+
.pipe(takeUntil(merge(this._drawers.changes, this._destroyed)))
|
|
794
|
+
.subscribe(() => {
|
|
795
|
+
this.updateContentMargins();
|
|
796
|
+
this._changeDetectorRef.markForCheck();
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
/** Toggles the 'cute-drawer-opened' class on the main 'cute-drawer-container' element. */
|
|
800
|
+
_setContainerClass(isAdd) {
|
|
801
|
+
const classList = this._element.nativeElement.classList;
|
|
802
|
+
const className = 'cute-drawer-container-has-open';
|
|
803
|
+
if (isAdd) {
|
|
804
|
+
classList.add(className);
|
|
805
|
+
}
|
|
806
|
+
else {
|
|
807
|
+
classList.remove(className);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
/** Validate the state of the drawer children components. */
|
|
811
|
+
_validateDrawers() {
|
|
812
|
+
this._start = this._end = null;
|
|
813
|
+
// Ensure that we have at most one start and one end drawer.
|
|
814
|
+
this._drawers.forEach(drawer => {
|
|
815
|
+
if (drawer.position == 'end') {
|
|
816
|
+
if (this._end != null && isDevMode()) {
|
|
817
|
+
throwCuteDuplicatedDrawerError('end');
|
|
818
|
+
}
|
|
819
|
+
this._end = drawer;
|
|
820
|
+
}
|
|
821
|
+
else {
|
|
822
|
+
if (this._start != null && isDevMode()) {
|
|
823
|
+
throwCuteDuplicatedDrawerError('start');
|
|
824
|
+
}
|
|
825
|
+
this._start = drawer;
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
this._right = this._left = null;
|
|
829
|
+
// Detect if we're LTR or RTL.
|
|
830
|
+
if (this._dir && this._dir.value === 'rtl') {
|
|
831
|
+
this._left = this._end;
|
|
832
|
+
this._right = this._start;
|
|
833
|
+
}
|
|
834
|
+
else {
|
|
835
|
+
this._left = this._start;
|
|
836
|
+
this._right = this._end;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
/** Whether the container is being pushed to the side by one of the drawers. */
|
|
840
|
+
_isPushed() {
|
|
841
|
+
return ((this._isDrawerOpen(this._start) && this._start.mode != 'over') ||
|
|
842
|
+
(this._isDrawerOpen(this._end) && this._end.mode != 'over'));
|
|
843
|
+
}
|
|
844
|
+
_onBackdropClicked() {
|
|
845
|
+
this.backdropClick.emit();
|
|
846
|
+
this._closeModalDrawersViaBackdrop();
|
|
847
|
+
}
|
|
848
|
+
_closeModalDrawersViaBackdrop() {
|
|
849
|
+
// Close all open drawers where closing is not disabled and the mode is not `side`.
|
|
850
|
+
[this._start, this._end]
|
|
851
|
+
.filter(drawer => drawer && !drawer.disableClose && this._drawerHasBackdrop(drawer))
|
|
852
|
+
.forEach(drawer => drawer._closeViaBackdropClick());
|
|
853
|
+
}
|
|
854
|
+
_isShowingBackdrop() {
|
|
855
|
+
return ((this._isDrawerOpen(this._start) && this._drawerHasBackdrop(this._start)) ||
|
|
856
|
+
(this._isDrawerOpen(this._end) && this._drawerHasBackdrop(this._end)));
|
|
857
|
+
}
|
|
858
|
+
_isDrawerOpen(drawer) {
|
|
859
|
+
return drawer != null && drawer.opened;
|
|
860
|
+
}
|
|
861
|
+
// Whether argument drawer should have a backdrop when it opens
|
|
862
|
+
_drawerHasBackdrop(drawer) {
|
|
863
|
+
if (this._backdropOverride == null) {
|
|
864
|
+
return !!drawer && drawer.mode !== 'side';
|
|
865
|
+
}
|
|
866
|
+
return this._backdropOverride;
|
|
867
|
+
}
|
|
868
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteDrawerContainer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
869
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CuteDrawerContainer, isStandalone: true, selector: "cute-drawer-container", inputs: { autosize: "autosize", hasBackdrop: "hasBackdrop" }, outputs: { backdropClick: "backdropClick" }, host: { properties: { "class.cute-drawer-container-explicit-backdrop": "_backdropOverride" }, classAttribute: "cute-drawer-container" }, providers: [
|
|
870
|
+
{
|
|
871
|
+
provide: CUTE_DRAWER_CONTAINER,
|
|
872
|
+
useExisting: CuteDrawerContainer,
|
|
873
|
+
},
|
|
874
|
+
], queries: [{ propertyName: "_content", first: true, predicate: CuteDrawerContent, descendants: true }, { propertyName: "_allDrawers", predicate: CuteDrawer, descendants: true }], viewQueries: [{ propertyName: "_userContent", first: true, predicate: CuteDrawerContent, descendants: true }], exportAs: ["cuteDrawerContainer"], usesInheritance: true, ngImport: i0, template: "@if (hasBackdrop) {\r\n <div class=\"cute-drawer-backdrop\" (click)=\"_onBackdropClicked()\"\r\n [class.cute-drawer-shown]=\"_isShowingBackdrop()\"></div>\r\n}\r\n\r\n<ng-content select=\"cute-drawer\"></ng-content>\r\n\r\n<ng-content select=\"cute-drawer-content\"></ng-content>\r\n\r\n@if (!_content) {\r\n <cute-drawer-content>\r\n <ng-content></ng-content>\r\n </cute-drawer-content>\r\n}\r\n", styles: [".cute-drawer-container{position:relative;z-index:1;color:var(--bs-body-color);background-color:var(--bs-body-bg);box-sizing:border-box;display:block;overflow:hidden}.cute-drawer-container[fullscreen]{inset:0;position:absolute}.cute-drawer-container[fullscreen].cute-drawer-container-has-open{overflow:hidden}.cute-drawer-container.cute-drawer-container-explicit-backdrop .cute-drawer-side{z-index:3}.cute-drawer-container.ng-animate-disabled .cute-drawer-backdrop,.cute-drawer-container.ng-animate-disabled .cute-drawer-content,.ng-animate-disabled .cute-drawer-container .cute-drawer-backdrop,.ng-animate-disabled .cute-drawer-container .cute-drawer-content{transition:none}.cute-drawer-backdrop{inset:0;position:absolute;display:block;z-index:3;visibility:hidden}.cute-drawer-backdrop.cute-drawer-shown{visibility:visible;background-color:#0009}.cute-drawer-transition .cute-drawer-backdrop{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility}@media (forced-colors: active){.cute-drawer-backdrop{opacity:.5}}.cute-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.cute-drawer-content.cute-drawer-content-hidden{opacity:0}.cute-drawer-transition .cute-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}.cute-drawer{box-shadow:0 8px 10px -5px #0003,0 16px 24px 2px #00000024,0 6px 30px 5px #0000001f;position:relative;z-index:4;color:var(--bs-secondary-color);background-color:var(--bs-secondary-bg);border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-right:solid var(--bs-border-width) var(--bs-border-color);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%,0,0)}@media (forced-colors: active){.cute-drawer,[dir=rtl] .cute-drawer.cute-drawer-end{border-right:solid 1px currentColor}}@media (forced-colors: active){[dir=rtl] .cute-drawer,.cute-drawer.cute-drawer-end{border-left:solid 1px currentColor;border-right:none}}.cute-drawer.cute-drawer-side{z-index:2}.cute-drawer.cute-drawer-end{right:0;transform:translate3d(100%,0,0);border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .cute-drawer{border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%,0,0)}[dir=rtl] .cute-drawer.cute-drawer-end{border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%,0,0)}.cute-drawer-transition .cute-drawer{transition:transform .4s cubic-bezier(.25,.8,.25,1)}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating){visibility:hidden;box-shadow:none}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating) .cute-drawer-inner-container{display:none}.cute-drawer.cute-drawer-opened.cute-drawer-opened{transform:none}.cute-drawer-side{box-shadow:none;border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid}.cute-drawer-side.cute-drawer-end,[dir=rtl] .cute-drawer-side{border-left-color:var(--bs-border-color);border-left-width:var(--bs-border-width);border-left-style:solid;border-right:none}[dir=rtl] .cute-drawer-side.cute-drawer-end{border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid;border-left:none}.cute-drawer-inner-container{width:100%;height:100%;overflow:auto}.cute-sidenav-fixed{position:fixed}\n"], dependencies: [{ kind: "component", type: CuteDrawerContent, selector: "cute-drawer-content" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
875
|
+
}
|
|
876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteDrawerContainer, decorators: [{
|
|
877
|
+
type: Component,
|
|
878
|
+
args: [{ selector: 'cute-drawer-container', exportAs: 'cuteDrawerContainer', host: {
|
|
879
|
+
'class': 'cute-drawer-container',
|
|
880
|
+
'[class.cute-drawer-container-explicit-backdrop]': '_backdropOverride',
|
|
881
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
882
|
+
{
|
|
883
|
+
provide: CUTE_DRAWER_CONTAINER,
|
|
884
|
+
useExisting: CuteDrawerContainer,
|
|
885
|
+
},
|
|
886
|
+
], imports: [CuteDrawerContent], template: "@if (hasBackdrop) {\r\n <div class=\"cute-drawer-backdrop\" (click)=\"_onBackdropClicked()\"\r\n [class.cute-drawer-shown]=\"_isShowingBackdrop()\"></div>\r\n}\r\n\r\n<ng-content select=\"cute-drawer\"></ng-content>\r\n\r\n<ng-content select=\"cute-drawer-content\"></ng-content>\r\n\r\n@if (!_content) {\r\n <cute-drawer-content>\r\n <ng-content></ng-content>\r\n </cute-drawer-content>\r\n}\r\n", styles: [".cute-drawer-container{position:relative;z-index:1;color:var(--bs-body-color);background-color:var(--bs-body-bg);box-sizing:border-box;display:block;overflow:hidden}.cute-drawer-container[fullscreen]{inset:0;position:absolute}.cute-drawer-container[fullscreen].cute-drawer-container-has-open{overflow:hidden}.cute-drawer-container.cute-drawer-container-explicit-backdrop .cute-drawer-side{z-index:3}.cute-drawer-container.ng-animate-disabled .cute-drawer-backdrop,.cute-drawer-container.ng-animate-disabled .cute-drawer-content,.ng-animate-disabled .cute-drawer-container .cute-drawer-backdrop,.ng-animate-disabled .cute-drawer-container .cute-drawer-content{transition:none}.cute-drawer-backdrop{inset:0;position:absolute;display:block;z-index:3;visibility:hidden}.cute-drawer-backdrop.cute-drawer-shown{visibility:visible;background-color:#0009}.cute-drawer-transition .cute-drawer-backdrop{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility}@media (forced-colors: active){.cute-drawer-backdrop{opacity:.5}}.cute-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.cute-drawer-content.cute-drawer-content-hidden{opacity:0}.cute-drawer-transition .cute-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}.cute-drawer{box-shadow:0 8px 10px -5px #0003,0 16px 24px 2px #00000024,0 6px 30px 5px #0000001f;position:relative;z-index:4;color:var(--bs-secondary-color);background-color:var(--bs-secondary-bg);border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-right:solid var(--bs-border-width) var(--bs-border-color);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%,0,0)}@media (forced-colors: active){.cute-drawer,[dir=rtl] .cute-drawer.cute-drawer-end{border-right:solid 1px currentColor}}@media (forced-colors: active){[dir=rtl] .cute-drawer,.cute-drawer.cute-drawer-end{border-left:solid 1px currentColor;border-right:none}}.cute-drawer.cute-drawer-side{z-index:2}.cute-drawer.cute-drawer-end{right:0;transform:translate3d(100%,0,0);border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .cute-drawer{border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%,0,0)}[dir=rtl] .cute-drawer.cute-drawer-end{border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%,0,0)}.cute-drawer-transition .cute-drawer{transition:transform .4s cubic-bezier(.25,.8,.25,1)}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating){visibility:hidden;box-shadow:none}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating) .cute-drawer-inner-container{display:none}.cute-drawer.cute-drawer-opened.cute-drawer-opened{transform:none}.cute-drawer-side{box-shadow:none;border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid}.cute-drawer-side.cute-drawer-end,[dir=rtl] .cute-drawer-side{border-left-color:var(--bs-border-color);border-left-width:var(--bs-border-width);border-left-style:solid;border-right:none}[dir=rtl] .cute-drawer-side.cute-drawer-end{border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid;border-left:none}.cute-drawer-inner-container{width:100%;height:100%;overflow:auto}.cute-sidenav-fixed{position:fixed}\n"] }]
|
|
887
|
+
}], ctorParameters: () => [], propDecorators: { _allDrawers: [{
|
|
888
|
+
type: ContentChildren,
|
|
889
|
+
args: [CuteDrawer, {
|
|
890
|
+
// We need to use `descendants: true`, because Ivy will no longer match
|
|
891
|
+
// indirect descendants if it's left as false.
|
|
892
|
+
descendants: true,
|
|
893
|
+
}]
|
|
894
|
+
}], _content: [{
|
|
895
|
+
type: ContentChild,
|
|
896
|
+
args: [CuteDrawerContent]
|
|
897
|
+
}], _userContent: [{
|
|
898
|
+
type: ViewChild,
|
|
899
|
+
args: [CuteDrawerContent]
|
|
900
|
+
}], autosize: [{
|
|
901
|
+
type: Input
|
|
902
|
+
}], hasBackdrop: [{
|
|
903
|
+
type: Input
|
|
904
|
+
}], backdropClick: [{
|
|
905
|
+
type: Output
|
|
906
|
+
}] } });
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* @license Apache-2.0
|
|
910
|
+
*
|
|
911
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
912
|
+
*
|
|
913
|
+
* You may not use this file except in compliance with the License
|
|
914
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
915
|
+
*
|
|
916
|
+
* This code is a modification of the `@angular/material` original
|
|
917
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
918
|
+
*/
|
|
919
|
+
class CuteSidenavContent extends CuteDrawerContent {
|
|
920
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavContent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
921
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: CuteSidenavContent, isStandalone: true, selector: "cute-sidenav-content", host: { classAttribute: "cute-drawer-content cute-sidenav-content" }, providers: [
|
|
922
|
+
{
|
|
923
|
+
provide: CdkScrollable,
|
|
924
|
+
useExisting: CuteSidenavContent,
|
|
925
|
+
},
|
|
926
|
+
], usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
927
|
+
}
|
|
928
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavContent, decorators: [{
|
|
929
|
+
type: Component,
|
|
930
|
+
args: [{
|
|
931
|
+
selector: 'cute-sidenav-content',
|
|
932
|
+
template: '<ng-content></ng-content>',
|
|
933
|
+
host: {
|
|
934
|
+
'class': 'cute-drawer-content cute-sidenav-content',
|
|
935
|
+
},
|
|
936
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
937
|
+
encapsulation: ViewEncapsulation.None,
|
|
938
|
+
providers: [
|
|
939
|
+
{
|
|
940
|
+
provide: CdkScrollable,
|
|
941
|
+
useExisting: CuteSidenavContent,
|
|
942
|
+
},
|
|
943
|
+
],
|
|
944
|
+
standalone: true,
|
|
945
|
+
}]
|
|
946
|
+
}] });
|
|
947
|
+
class CuteSidenav extends CuteDrawer {
|
|
948
|
+
constructor() {
|
|
949
|
+
super(...arguments);
|
|
950
|
+
this._fixedInViewport = false;
|
|
951
|
+
this._fixedTopGap = 0;
|
|
952
|
+
this._fixedBottomGap = 0;
|
|
953
|
+
}
|
|
954
|
+
/** Whether the sidenav is fixed in the viewport. */
|
|
955
|
+
get fixedInViewport() { return this._fixedInViewport; }
|
|
956
|
+
set fixedInViewport(value) {
|
|
957
|
+
this._fixedInViewport = coerceBooleanProperty(value);
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* The gap between the top of the sidenav and the top of the viewport when the sidenav is in fixed
|
|
961
|
+
* mode.
|
|
962
|
+
*/
|
|
963
|
+
get fixedTopGap() { return this._fixedTopGap; }
|
|
964
|
+
set fixedTopGap(value) {
|
|
965
|
+
this._fixedTopGap = coerceNumberProperty(value);
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* The gap between the bottom of the sidenav and the bottom of the viewport when the sidenav is in
|
|
969
|
+
* fixed mode.
|
|
970
|
+
*/
|
|
971
|
+
get fixedBottomGap() { return this._fixedBottomGap; }
|
|
972
|
+
set fixedBottomGap(value) {
|
|
973
|
+
this._fixedBottomGap = coerceNumberProperty(value);
|
|
974
|
+
}
|
|
975
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenav, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
976
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: CuteSidenav, isStandalone: true, selector: "cute-sidenav", inputs: { fixedInViewport: "fixedInViewport", fixedTopGap: "fixedTopGap", fixedBottomGap: "fixedBottomGap" }, host: { properties: { "attr.tabIndex": "(mode !== \"side\") ? \"-1\" : null", "attr.align": "null", "class.cute-drawer-end": "position === \"end\"", "class.cute-drawer-over": "mode === \"over\"", "class.cute-drawer-push": "mode === \"push\"", "class.cute-drawer-side": "mode === \"side\"", "class.cute-sidenav-fixed": "fixedInViewport", "style.top.px": "fixedInViewport ? fixedTopGap : null", "style.bottom.px": "fixedInViewport ? fixedBottomGap : null" }, classAttribute: "cute-drawer cute-sidenav" }, providers: [{ provide: CuteDrawer, useExisting: CuteSidenav }], exportAs: ["cuteSidenav"], usesInheritance: true, ngImport: i0, template: "<div class=\"cute-drawer-inner-container\" cdkScrollable #content>\r\n <ng-content></ng-content>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
977
|
+
}
|
|
978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenav, decorators: [{
|
|
979
|
+
type: Component,
|
|
980
|
+
args: [{ selector: 'cute-sidenav', exportAs: 'cuteSidenav', host: {
|
|
981
|
+
'class': 'cute-drawer cute-sidenav',
|
|
982
|
+
// The sidenav container should not be focused on when used in side mode. See b/286459024 for
|
|
983
|
+
// reference. Updates tabIndex of drawer/container to default to null if in side mode.
|
|
984
|
+
'[attr.tabIndex]': '(mode !== "side") ? "-1" : null',
|
|
985
|
+
// must prevent the browser from aligning text based on value
|
|
986
|
+
'[attr.align]': 'null',
|
|
987
|
+
'[class.cute-drawer-end]': 'position === "end"',
|
|
988
|
+
'[class.cute-drawer-over]': 'mode === "over"',
|
|
989
|
+
'[class.cute-drawer-push]': 'mode === "push"',
|
|
990
|
+
'[class.cute-drawer-side]': 'mode === "side"',
|
|
991
|
+
'[class.cute-sidenav-fixed]': 'fixedInViewport',
|
|
992
|
+
'[style.top.px]': 'fixedInViewport ? fixedTopGap : null',
|
|
993
|
+
'[style.bottom.px]': 'fixedInViewport ? fixedBottomGap : null',
|
|
994
|
+
}, imports: [CdkScrollable], providers: [{ provide: CuteDrawer, useExisting: CuteSidenav }], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, template: "<div class=\"cute-drawer-inner-container\" cdkScrollable #content>\r\n <ng-content></ng-content>\r\n</div>\r\n" }]
|
|
995
|
+
}], propDecorators: { fixedInViewport: [{
|
|
996
|
+
type: Input
|
|
997
|
+
}], fixedTopGap: [{
|
|
998
|
+
type: Input
|
|
999
|
+
}], fixedBottomGap: [{
|
|
1000
|
+
type: Input
|
|
1001
|
+
}] } });
|
|
1002
|
+
class CuteSidenavContainer extends CuteDrawerContainer {
|
|
1003
|
+
constructor() {
|
|
1004
|
+
super(...arguments);
|
|
1005
|
+
this._allDrawers = undefined;
|
|
1006
|
+
// We need an initializer here to avoid a TS error.
|
|
1007
|
+
this._content = undefined;
|
|
1008
|
+
}
|
|
1009
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavContainer, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1010
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CuteSidenavContainer, isStandalone: true, selector: "cute-sidenav-container", host: { properties: { "class.cute-drawer-container-explicit-backdrop": "_backdropOverride" }, classAttribute: "cute-drawer-container cute-sidenav-container" }, providers: [
|
|
1011
|
+
{
|
|
1012
|
+
provide: CUTE_DRAWER_CONTAINER,
|
|
1013
|
+
useExisting: CuteSidenavContainer,
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
provide: CuteDrawerContainer,
|
|
1017
|
+
useExisting: CuteSidenavContainer,
|
|
1018
|
+
},
|
|
1019
|
+
], queries: [{ propertyName: "_content", first: true, predicate: CuteSidenavContent, descendants: true }, { propertyName: "_allDrawers", predicate: CuteSidenav, descendants: true }], exportAs: ["cuteSidenavContainer"], usesInheritance: true, ngImport: i0, template: "@if (hasBackdrop) {\r\n <div class=\"cute-drawer-backdrop\" (click)=\"_onBackdropClicked()\"\r\n [class.cute-drawer-shown]=\"_isShowingBackdrop()\"></div>\r\n}\r\n\r\n<ng-content select=\"cute-sidenav\"></ng-content>\r\n\r\n<ng-content select=\"cute-sidenav-content\"></ng-content>\r\n\r\n@if (!_content) {\r\n <cute-sidenav-content>\r\n <ng-content></ng-content>\r\n </cute-sidenav-content>\r\n}\r\n", styles: [".cute-drawer-container{position:relative;z-index:1;color:var(--bs-body-color);background-color:var(--bs-body-bg);box-sizing:border-box;display:block;overflow:hidden}.cute-drawer-container[fullscreen]{inset:0;position:absolute}.cute-drawer-container[fullscreen].cute-drawer-container-has-open{overflow:hidden}.cute-drawer-container.cute-drawer-container-explicit-backdrop .cute-drawer-side{z-index:3}.cute-drawer-container.ng-animate-disabled .cute-drawer-backdrop,.cute-drawer-container.ng-animate-disabled .cute-drawer-content,.ng-animate-disabled .cute-drawer-container .cute-drawer-backdrop,.ng-animate-disabled .cute-drawer-container .cute-drawer-content{transition:none}.cute-drawer-backdrop{inset:0;position:absolute;display:block;z-index:3;visibility:hidden}.cute-drawer-backdrop.cute-drawer-shown{visibility:visible;background-color:#0009}.cute-drawer-transition .cute-drawer-backdrop{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility}@media (forced-colors: active){.cute-drawer-backdrop{opacity:.5}}.cute-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.cute-drawer-content.cute-drawer-content-hidden{opacity:0}.cute-drawer-transition .cute-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}.cute-drawer{box-shadow:0 8px 10px -5px #0003,0 16px 24px 2px #00000024,0 6px 30px 5px #0000001f;position:relative;z-index:4;color:var(--bs-secondary-color);background-color:var(--bs-secondary-bg);border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-right:solid var(--bs-border-width) var(--bs-border-color);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%,0,0)}@media (forced-colors: active){.cute-drawer,[dir=rtl] .cute-drawer.cute-drawer-end{border-right:solid 1px currentColor}}@media (forced-colors: active){[dir=rtl] .cute-drawer,.cute-drawer.cute-drawer-end{border-left:solid 1px currentColor;border-right:none}}.cute-drawer.cute-drawer-side{z-index:2}.cute-drawer.cute-drawer-end{right:0;transform:translate3d(100%,0,0);border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .cute-drawer{border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%,0,0)}[dir=rtl] .cute-drawer.cute-drawer-end{border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%,0,0)}.cute-drawer-transition .cute-drawer{transition:transform .4s cubic-bezier(.25,.8,.25,1)}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating){visibility:hidden;box-shadow:none}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating) .cute-drawer-inner-container{display:none}.cute-drawer.cute-drawer-opened.cute-drawer-opened{transform:none}.cute-drawer-side{box-shadow:none;border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid}.cute-drawer-side.cute-drawer-end,[dir=rtl] .cute-drawer-side{border-left-color:var(--bs-border-color);border-left-width:var(--bs-border-width);border-left-style:solid;border-right:none}[dir=rtl] .cute-drawer-side.cute-drawer-end{border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid;border-left:none}.cute-drawer-inner-container{width:100%;height:100%;overflow:auto}.cute-sidenav-fixed{position:fixed}\n"], dependencies: [{ kind: "component", type: CuteSidenavContent, selector: "cute-sidenav-content" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1020
|
+
}
|
|
1021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavContainer, decorators: [{
|
|
1022
|
+
type: Component,
|
|
1023
|
+
args: [{ selector: 'cute-sidenav-container', exportAs: 'cuteSidenavContainer', host: {
|
|
1024
|
+
'class': 'cute-drawer-container cute-sidenav-container',
|
|
1025
|
+
'[class.cute-drawer-container-explicit-backdrop]': '_backdropOverride',
|
|
1026
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
1027
|
+
{
|
|
1028
|
+
provide: CUTE_DRAWER_CONTAINER,
|
|
1029
|
+
useExisting: CuteSidenavContainer,
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
provide: CuteDrawerContainer,
|
|
1033
|
+
useExisting: CuteSidenavContainer,
|
|
1034
|
+
},
|
|
1035
|
+
], imports: [
|
|
1036
|
+
CuteSidenavContent
|
|
1037
|
+
], template: "@if (hasBackdrop) {\r\n <div class=\"cute-drawer-backdrop\" (click)=\"_onBackdropClicked()\"\r\n [class.cute-drawer-shown]=\"_isShowingBackdrop()\"></div>\r\n}\r\n\r\n<ng-content select=\"cute-sidenav\"></ng-content>\r\n\r\n<ng-content select=\"cute-sidenav-content\"></ng-content>\r\n\r\n@if (!_content) {\r\n <cute-sidenav-content>\r\n <ng-content></ng-content>\r\n </cute-sidenav-content>\r\n}\r\n", styles: [".cute-drawer-container{position:relative;z-index:1;color:var(--bs-body-color);background-color:var(--bs-body-bg);box-sizing:border-box;display:block;overflow:hidden}.cute-drawer-container[fullscreen]{inset:0;position:absolute}.cute-drawer-container[fullscreen].cute-drawer-container-has-open{overflow:hidden}.cute-drawer-container.cute-drawer-container-explicit-backdrop .cute-drawer-side{z-index:3}.cute-drawer-container.ng-animate-disabled .cute-drawer-backdrop,.cute-drawer-container.ng-animate-disabled .cute-drawer-content,.ng-animate-disabled .cute-drawer-container .cute-drawer-backdrop,.ng-animate-disabled .cute-drawer-container .cute-drawer-content{transition:none}.cute-drawer-backdrop{inset:0;position:absolute;display:block;z-index:3;visibility:hidden}.cute-drawer-backdrop.cute-drawer-shown{visibility:visible;background-color:#0009}.cute-drawer-transition .cute-drawer-backdrop{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:background-color,visibility}@media (forced-colors: active){.cute-drawer-backdrop{opacity:.5}}.cute-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.cute-drawer-content.cute-drawer-content-hidden{opacity:0}.cute-drawer-transition .cute-drawer-content{transition-duration:.4s;transition-timing-function:cubic-bezier(.25,.8,.25,1);transition-property:transform,margin-left,margin-right}.cute-drawer{box-shadow:0 8px 10px -5px #0003,0 16px 24px 2px #00000024,0 6px 30px 5px #0000001f;position:relative;z-index:4;color:var(--bs-secondary-color);background-color:var(--bs-secondary-bg);border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-right:solid var(--bs-border-width) var(--bs-border-color);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%,0,0)}@media (forced-colors: active){.cute-drawer,[dir=rtl] .cute-drawer.cute-drawer-end{border-right:solid 1px currentColor}}@media (forced-colors: active){[dir=rtl] .cute-drawer,.cute-drawer.cute-drawer-end{border-left:solid 1px currentColor;border-right:none}}.cute-drawer.cute-drawer-side{z-index:2}.cute-drawer.cute-drawer-end{right:0;transform:translate3d(100%,0,0);border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .cute-drawer{border-top-left-radius:var(--bs-border-radius-lg);border-bottom-left-radius:var(--bs-border-radius-lg);border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%,0,0)}[dir=rtl] .cute-drawer.cute-drawer-end{border-top-right-radius:var(--bs-border-radius-lg);border-bottom-right-radius:var(--bs-border-radius-lg);border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%,0,0)}.cute-drawer-transition .cute-drawer{transition:transform .4s cubic-bezier(.25,.8,.25,1)}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating){visibility:hidden;box-shadow:none}.cute-drawer:not(.cute-drawer-opened):not(.cute-drawer-animating) .cute-drawer-inner-container{display:none}.cute-drawer.cute-drawer-opened.cute-drawer-opened{transform:none}.cute-drawer-side{box-shadow:none;border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid}.cute-drawer-side.cute-drawer-end,[dir=rtl] .cute-drawer-side{border-left-color:var(--bs-border-color);border-left-width:var(--bs-border-width);border-left-style:solid;border-right:none}[dir=rtl] .cute-drawer-side.cute-drawer-end{border-right-color:var(--bs-border-color);border-right-width:var(--bs-border-width);border-right-style:solid;border-left:none}.cute-drawer-inner-container{width:100%;height:100%;overflow:auto}.cute-sidenav-fixed{position:fixed}\n"] }]
|
|
1038
|
+
}], propDecorators: { _allDrawers: [{
|
|
1039
|
+
type: ContentChildren,
|
|
1040
|
+
args: [CuteSidenav, {
|
|
1041
|
+
// We need to use `descendants: true`, because Ivy will no longer match
|
|
1042
|
+
// indirect descendants if it's left as false.
|
|
1043
|
+
descendants: true,
|
|
1044
|
+
}]
|
|
1045
|
+
}], _content: [{
|
|
1046
|
+
type: ContentChild,
|
|
1047
|
+
args: [CuteSidenavContent]
|
|
1048
|
+
}] } });
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* @license Apache-2.0
|
|
1052
|
+
*
|
|
1053
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
1054
|
+
*
|
|
1055
|
+
* You may not use this file except in compliance with the License
|
|
1056
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
1057
|
+
*/
|
|
1058
|
+
const TYPES = [
|
|
1059
|
+
CuteDrawer,
|
|
1060
|
+
CuteDrawerContainer,
|
|
1061
|
+
CuteDrawerContent,
|
|
1062
|
+
CuteSidenav,
|
|
1063
|
+
CuteSidenavContainer,
|
|
1064
|
+
CuteSidenavContent,
|
|
1065
|
+
];
|
|
1066
|
+
class CuteSidenavModule {
|
|
1067
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1068
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavModule, imports: [CommonModule, CdkScrollableModule, CuteDrawer,
|
|
1069
|
+
CuteDrawerContainer,
|
|
1070
|
+
CuteDrawerContent,
|
|
1071
|
+
CuteSidenav,
|
|
1072
|
+
CuteSidenavContainer,
|
|
1073
|
+
CuteSidenavContent], exports: [CuteDrawer,
|
|
1074
|
+
CuteDrawerContainer,
|
|
1075
|
+
CuteDrawerContent,
|
|
1076
|
+
CuteSidenav,
|
|
1077
|
+
CuteSidenavContainer,
|
|
1078
|
+
CuteSidenavContent] }); }
|
|
1079
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavModule, imports: [CommonModule, CdkScrollableModule] }); }
|
|
1080
|
+
}
|
|
1081
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteSidenavModule, decorators: [{
|
|
1082
|
+
type: NgModule,
|
|
1083
|
+
args: [{
|
|
1084
|
+
declarations: [],
|
|
1085
|
+
imports: [CommonModule, CdkScrollableModule, ...TYPES],
|
|
1086
|
+
exports: TYPES,
|
|
1087
|
+
}]
|
|
1088
|
+
}] });
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Generated bundle index. Do not edit.
|
|
1092
|
+
*/
|
|
1093
|
+
|
|
1094
|
+
export { CUTE_DRAWER_CONTAINER, CUTE_DRAWER_DEFAULT_AUTOSIZE, CuteDrawer, CuteDrawerContainer, CuteDrawerContent, CuteSidenav, CuteSidenavContainer, CuteSidenavContent, CuteSidenavModule, throwCuteDuplicatedDrawerError };
|
|
1095
|
+
//# sourceMappingURL=cute-widgets-base-sidenav.mjs.map
|