@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,546 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, NgZone, booleanAttribute, HostBinding, Input, ContentChildren, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component, numberAttribute, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { CuteFocusableControl } from '@cute-widgets/base/abstract';
|
|
5
|
+
import { CuteIcon } from '@cute-widgets/base/icon';
|
|
6
|
+
import { RippleManager } from '@cute-widgets/base/core/ripple';
|
|
7
|
+
import { Subject, fromEvent } from 'rxjs';
|
|
8
|
+
import { takeUntil } from 'rxjs/operators';
|
|
9
|
+
import { toThemeColor, toColorCssClass } from '@cute-widgets/base/core';
|
|
10
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
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
|
+
/** Injection token that can be used to provide the default options the button component. */
|
|
24
|
+
const CUTE_BUTTON_CONFIG = new InjectionToken('CUTE_BUTTON_CONFIG');
|
|
25
|
+
/**
|
|
26
|
+
* Injection token that can be used to reference instances of `CuteButtonBase`.
|
|
27
|
+
* It serves as an alternative token to the actual `CuteButtonBase` class, which
|
|
28
|
+
* could cause unnecessary retention of the class and its component metadata.
|
|
29
|
+
*/
|
|
30
|
+
const CUTE_BUTTON_BASE = new InjectionToken('CuteButtonBase');
|
|
31
|
+
class CuteButtonBase extends CuteFocusableControl {
|
|
32
|
+
/** Button's appearance style in the following format: `{style}-button` */
|
|
33
|
+
get inputButtonStyle() { return this._inputButtonStyle; }
|
|
34
|
+
set inputButtonStyle(value) {
|
|
35
|
+
this._inputButtonStyle = value || "base-button";
|
|
36
|
+
// Transform Angular Material's style
|
|
37
|
+
switch (this._inputButtonStyle) {
|
|
38
|
+
case "text":
|
|
39
|
+
this._inputButtonStyle = "base-button";
|
|
40
|
+
break;
|
|
41
|
+
case "elevated":
|
|
42
|
+
this._inputButtonStyle = "raised-button";
|
|
43
|
+
break;
|
|
44
|
+
case "outlined":
|
|
45
|
+
this._inputButtonStyle = "outline-button";
|
|
46
|
+
break;
|
|
47
|
+
case "filled":
|
|
48
|
+
this._inputButtonStyle = "flat-button";
|
|
49
|
+
break;
|
|
50
|
+
case "tonal":
|
|
51
|
+
this._inputButtonStyle = "flat-button";
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
const dashPos = this._inputButtonStyle.lastIndexOf("-");
|
|
55
|
+
if (dashPos >= 0) {
|
|
56
|
+
// Format: {style}-button
|
|
57
|
+
this._buttonStyle = this._inputButtonStyle.substring(0, dashPos).trim().toLowerCase() || "base";
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this._buttonStyle = this._inputButtonStyle;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Whether to disable the ripple effect on button clicking */
|
|
64
|
+
get disableRipple() { return this._ripple.disabled; }
|
|
65
|
+
set disableRipple(value) { this._ripple.disabled = value; }
|
|
66
|
+
/**
|
|
67
|
+
* Natively disabled buttons prevent focus and any pointer events from reaching the button.
|
|
68
|
+
* In some scenarios, this might not be desirable, because it can prevent users from finding out
|
|
69
|
+
* why the button is disabled (e.g., via tooltip).
|
|
70
|
+
*
|
|
71
|
+
* Enabling this input will change the button so that it is styled to be disabled and will be
|
|
72
|
+
* marked as `aria-disabled`, but it will allow the button to receive events and focus.
|
|
73
|
+
*
|
|
74
|
+
* Note that by enabling this, you need to set the `tabindex` yourself if the button isn't
|
|
75
|
+
* meant to be tabbable, and you have to prevent the button action (e.g., form submissions).
|
|
76
|
+
*/
|
|
77
|
+
get disabledInteractive() { return this._disabledInteractive; }
|
|
78
|
+
set disabledInteractive(value) { this._disabledInteractive = value; }
|
|
79
|
+
get classNames() {
|
|
80
|
+
let classes = "cute-" + this._inputButtonStyle; // e.g. `cute-outline-button`
|
|
81
|
+
if (this.color) {
|
|
82
|
+
classes += ["base", "close", "icon"].indexOf(this.buttonStyle) == -1
|
|
83
|
+
? " btn-" + (this.buttonStyle == "outline" ? "outline-" : "") + toThemeColor(this.color)
|
|
84
|
+
: this.buttonStyle == "base"
|
|
85
|
+
? (" " + (this.color == "link" ? "btn-link" : toColorCssClass(this.color)))
|
|
86
|
+
: "";
|
|
87
|
+
}
|
|
88
|
+
return classes;
|
|
89
|
+
}
|
|
90
|
+
/** Focus shadow color for `close-button` */
|
|
91
|
+
get _closeButtonShadowColor() {
|
|
92
|
+
return (this.color && this.buttonStyle == "close") ? "0 0 0 0.25rem rgba(var(--bs-" + this.color + "-rgb), 0.25)" : "";
|
|
93
|
+
}
|
|
94
|
+
get buttonLargestBinding() { return this.magnitude == "largest"; }
|
|
95
|
+
get buttonLargerBinding() { return this.magnitude == "larger"; }
|
|
96
|
+
get buttonLargeBinding() { return this.magnitude == "large"; }
|
|
97
|
+
get buttonSmallBinding() { return this.magnitude == "small"; }
|
|
98
|
+
get buttonSmallerBinding() { return this.magnitude == "smaller"; }
|
|
99
|
+
get buttonSmallestBinding() { return this.magnitude == "smallest"; }
|
|
100
|
+
get iconButtonColorBinding() {
|
|
101
|
+
return this.buttonStyle == "icon" ? "var(" + (this.color ? this.bsColorVarName : "--bs-body-color-rgb") + ")" : "";
|
|
102
|
+
}
|
|
103
|
+
get baseButtonColorBinding() {
|
|
104
|
+
return this.buttonStyle == "base" ? "var(" + (this.color ? this.bsColorVarName : "--bs-body-color-rgb") + ")" : "";
|
|
105
|
+
}
|
|
106
|
+
/** Returns button style name. */
|
|
107
|
+
get buttonStyle() {
|
|
108
|
+
return this._buttonStyle;
|
|
109
|
+
}
|
|
110
|
+
get bsColorVarName() {
|
|
111
|
+
if (this.color) {
|
|
112
|
+
if (this.color == "link") {
|
|
113
|
+
return `--bs-${this.color}-color-rgb`;
|
|
114
|
+
}
|
|
115
|
+
return `--bs-${this.color}-rgb`;
|
|
116
|
+
}
|
|
117
|
+
return "";
|
|
118
|
+
}
|
|
119
|
+
constructor() {
|
|
120
|
+
super();
|
|
121
|
+
this._destroyed$ = new Subject();
|
|
122
|
+
this._ngZone = inject(NgZone);
|
|
123
|
+
this._isAnchor = false;
|
|
124
|
+
this._inputButtonStyle = "base-button";
|
|
125
|
+
this._buttonStyle = "base";
|
|
126
|
+
/** Whether to disable text wrapping */
|
|
127
|
+
this.nowrap = false;
|
|
128
|
+
/** Whether to show the collapse/expand indicator based on the `aria-expanded` current value. */
|
|
129
|
+
this.withAriaExpandedIndicator = false;
|
|
130
|
+
const config = inject(CUTE_BUTTON_CONFIG, { optional: true });
|
|
131
|
+
this.disabledInteractive = config?.disabledInteractive ?? false;
|
|
132
|
+
this._ripple = RippleManager.getInstance(this._nativeElement);
|
|
133
|
+
this._isAnchor = (this._nativeElement.tagName == "A");
|
|
134
|
+
}
|
|
135
|
+
generateId() {
|
|
136
|
+
return ""; // `cute-button-${++nextUniqueId}`;
|
|
137
|
+
}
|
|
138
|
+
_getTabIndex() {
|
|
139
|
+
if (this._isAnchor) {
|
|
140
|
+
return this.disabled && !this.disabledInteractive ? -1 : this.tabIndex;
|
|
141
|
+
}
|
|
142
|
+
return this.tabIndex;
|
|
143
|
+
}
|
|
144
|
+
_setupAsAnchor() {
|
|
145
|
+
this._cleanupClick = this._ngZone.runOutsideAngular(() => this._renderer.listen(this._nativeElement, 'click', (event) => {
|
|
146
|
+
if (this.disabled) {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
event.stopImmediatePropagation();
|
|
149
|
+
}
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
setDisabledState(newState) {
|
|
153
|
+
if (this._isAnchor) {
|
|
154
|
+
if (newState) {
|
|
155
|
+
this._savedTabIndex = this.tabIndex;
|
|
156
|
+
this.tabIndex = -1;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
this.tabIndex = this._savedTabIndex;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return super.setDisabledState(newState);
|
|
163
|
+
}
|
|
164
|
+
_getAriaDisabled() {
|
|
165
|
+
if (this.ariaDisabled != null) {
|
|
166
|
+
return this.ariaDisabled;
|
|
167
|
+
}
|
|
168
|
+
if (this._isAnchor) {
|
|
169
|
+
return this.disabled || null;
|
|
170
|
+
}
|
|
171
|
+
return this.disabled && this.disabledInteractive ? true : null;
|
|
172
|
+
}
|
|
173
|
+
_getDisabledAttribute() {
|
|
174
|
+
//return this.disabledInteractive || !this.disabled ? null : true;
|
|
175
|
+
return this.disabled ? true : null;
|
|
176
|
+
}
|
|
177
|
+
_haltDisabledEvents(event) {
|
|
178
|
+
// A disabled button shouldn't apply any actions
|
|
179
|
+
if (this.disabled && (this.disabledInteractive || this._isAnchor)) {
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
event.stopImmediatePropagation();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
;
|
|
185
|
+
/** Whether to apply a `focus-ring` css-class to the button when it focused via keyboard interaction */
|
|
186
|
+
get displayFocusRing() {
|
|
187
|
+
return this.buttonStyle == "base" && this.hasClass("cdk-keyboard-focused");
|
|
188
|
+
}
|
|
189
|
+
ngOnInit() {
|
|
190
|
+
super.ngOnInit();
|
|
191
|
+
this._focusMonitor.monitor(this._elementRef, true);
|
|
192
|
+
["mousedown", "mouseup", "click"].forEach((type) => {
|
|
193
|
+
fromEvent(this._nativeElement, type, { capture: true })
|
|
194
|
+
.pipe(takeUntil(this._destroyed$))
|
|
195
|
+
.subscribe((ev) => this._onMouseEvent(ev));
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
ngAfterContentInit() {
|
|
199
|
+
super.ngAfterContentInit();
|
|
200
|
+
if (this._icons && this.buttonStyle == "icon") {
|
|
201
|
+
this._icons.forEach(icon => { icon.defaultColor = this.color; });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
ngAfterViewInit() {
|
|
205
|
+
super.ngAfterViewInit();
|
|
206
|
+
// Some internal tests depend on the timing of this,
|
|
207
|
+
// otherwise we could bind it in the constructor.
|
|
208
|
+
if (this._isAnchor) {
|
|
209
|
+
this._setupAsAnchor();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
ngDoCheck() {
|
|
213
|
+
// This line was added due to "Expression Changed After Checked..." error raised if we place it in the @HostBinding
|
|
214
|
+
this.toggleClass("focus-ring", this.displayFocusRing);
|
|
215
|
+
}
|
|
216
|
+
ngOnDestroy() {
|
|
217
|
+
super.ngOnDestroy();
|
|
218
|
+
this._cleanupClick?.();
|
|
219
|
+
this._ripple.stop();
|
|
220
|
+
this._destroyed$.next();
|
|
221
|
+
this._destroyed$.complete();
|
|
222
|
+
}
|
|
223
|
+
/** mouse events handler */
|
|
224
|
+
_onMouseEvent(event) {
|
|
225
|
+
this._haltDisabledEvents(event);
|
|
226
|
+
if (!event.defaultPrevented && event.type == "mousedown") {
|
|
227
|
+
this._launchRipple(event);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
_launchRipple(event) {
|
|
231
|
+
if (this._ripple && !this._ripple.disabled) {
|
|
232
|
+
const options = {};
|
|
233
|
+
if (this.buttonStyle == "icon") {
|
|
234
|
+
options.centered = true;
|
|
235
|
+
options.color = "rgba(var(--cute-icon-button-color), 0.25)";
|
|
236
|
+
}
|
|
237
|
+
this._ripple.launch(event, options);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
241
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.15", type: CuteButtonBase, isStandalone: true, inputs: { inputButtonStyle: ["cuteButton", "inputButtonStyle"], magnitude: "magnitude", nowrap: "nowrap", disableRipple: "disableRipple", ariaDisabled: ["aria-disabled", "ariaDisabled", booleanAttribute], withAriaExpandedIndicator: ["withAriaExpandedIndicator", "withAriaExpandedIndicator", booleanAttribute], disabledInteractive: ["disabledInteractive", "disabledInteractive", booleanAttribute], visuallyHiddenLabel: "visuallyHiddenLabel" }, host: { listeners: { "keydown": "_haltDisabledEvents($event)" }, properties: { "style.--bs-focus-ring-color": "color? \"rgba(var(\"+bsColorVarName+\"), var(--bs-focus-ring-opacity))\" : \"var(--bs-border-color-translucent)\"", "class": "this.classNames", "style.--bs-btn-close-focus-shadow": "this._closeButtonShadowColor", "class.cute-btn-xxl": "this.buttonLargestBinding", "class.cute-btn-xl": "this.buttonLargerBinding", "class.btn-lg": "this.buttonLargeBinding", "class.btn-sm": "this.buttonSmallBinding", "class.cute-btn-xs": "this.buttonSmallerBinding", "class.cute-btn-xxs": "this.buttonSmallestBinding", "style.--cute-icon-button-color-rgb": "this.iconButtonColorBinding", "style.--cute-base-button-color-rgb": "this.baseButtonColorBinding" }, classAttribute: "btn" }, queries: [{ propertyName: "_icons", predicate: CuteIcon }], usesInheritance: true, ngImport: i0 }); }
|
|
242
|
+
}
|
|
243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonBase, decorators: [{
|
|
244
|
+
type: Directive,
|
|
245
|
+
args: [{
|
|
246
|
+
host: {
|
|
247
|
+
class: 'btn',
|
|
248
|
+
'[style.--bs-focus-ring-color]': 'color? "rgba(var("+bsColorVarName+"), var(--bs-focus-ring-opacity))" : "var(--bs-border-color-translucent)"',
|
|
249
|
+
'(keydown)': '_haltDisabledEvents($event)',
|
|
250
|
+
}
|
|
251
|
+
}]
|
|
252
|
+
}], ctorParameters: () => [], propDecorators: { _icons: [{
|
|
253
|
+
type: ContentChildren,
|
|
254
|
+
args: [CuteIcon]
|
|
255
|
+
}], inputButtonStyle: [{
|
|
256
|
+
type: Input,
|
|
257
|
+
args: ["cuteButton"]
|
|
258
|
+
}], magnitude: [{
|
|
259
|
+
type: Input
|
|
260
|
+
}], nowrap: [{
|
|
261
|
+
type: Input
|
|
262
|
+
}], disableRipple: [{
|
|
263
|
+
type: Input
|
|
264
|
+
}], ariaDisabled: [{
|
|
265
|
+
type: Input,
|
|
266
|
+
args: [{ transform: booleanAttribute, alias: 'aria-disabled' }]
|
|
267
|
+
}], withAriaExpandedIndicator: [{
|
|
268
|
+
type: Input,
|
|
269
|
+
args: [{ transform: booleanAttribute }]
|
|
270
|
+
}], disabledInteractive: [{
|
|
271
|
+
type: Input,
|
|
272
|
+
args: [{ transform: booleanAttribute }]
|
|
273
|
+
}], visuallyHiddenLabel: [{
|
|
274
|
+
type: Input
|
|
275
|
+
}], classNames: [{
|
|
276
|
+
type: HostBinding,
|
|
277
|
+
args: ["class"]
|
|
278
|
+
}], _closeButtonShadowColor: [{
|
|
279
|
+
type: HostBinding,
|
|
280
|
+
args: ["style.--bs-btn-close-focus-shadow"]
|
|
281
|
+
}], buttonLargestBinding: [{
|
|
282
|
+
type: HostBinding,
|
|
283
|
+
args: ["class.cute-btn-xxl"]
|
|
284
|
+
}], buttonLargerBinding: [{
|
|
285
|
+
type: HostBinding,
|
|
286
|
+
args: ["class.cute-btn-xl"]
|
|
287
|
+
}], buttonLargeBinding: [{
|
|
288
|
+
type: HostBinding,
|
|
289
|
+
args: ["class.btn-lg"]
|
|
290
|
+
}], buttonSmallBinding: [{
|
|
291
|
+
type: HostBinding,
|
|
292
|
+
args: ["class.btn-sm"]
|
|
293
|
+
}], buttonSmallerBinding: [{
|
|
294
|
+
type: HostBinding,
|
|
295
|
+
args: ["class.cute-btn-xs"]
|
|
296
|
+
}], buttonSmallestBinding: [{
|
|
297
|
+
type: HostBinding,
|
|
298
|
+
args: ["class.cute-btn-xxs"]
|
|
299
|
+
}], iconButtonColorBinding: [{
|
|
300
|
+
type: HostBinding,
|
|
301
|
+
args: ["style.--cute-icon-button-color-rgb"]
|
|
302
|
+
}], baseButtonColorBinding: [{
|
|
303
|
+
type: HostBinding,
|
|
304
|
+
args: ["style.--cute-base-button-color-rgb"]
|
|
305
|
+
}] } });
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @license Apache-2.0
|
|
309
|
+
*
|
|
310
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
311
|
+
*
|
|
312
|
+
* You may not use this file except in compliance with the License
|
|
313
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
314
|
+
*
|
|
315
|
+
* This code is a modification of the `@angular/material` original
|
|
316
|
+
* code licensed under MIT-style License (https://angular.dev/license).
|
|
317
|
+
*/
|
|
318
|
+
class CuteButton extends CuteButtonBase {
|
|
319
|
+
constructor() {
|
|
320
|
+
super();
|
|
321
|
+
this.toThemeColor = toThemeColor;
|
|
322
|
+
}
|
|
323
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
324
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CuteButton, isStandalone: true, selector: "button[cuteButton],\n button[cute-button],\n a[cuteButton],\n a[cute-button],\n ", host: { properties: { "class.cute-anchor": "_isAnchor", "class.btn-close": "buttonStyle == \"close\"", "class.rounded-pill": "buttonStyle==\"pill\"", "class.rounded-circle": "buttonStyle==\"circle\"", "class.raised": "buttonStyle==\"raised\" && !disabled", "class.icon-link": "toThemeColor(color)==\"link\"", "class.cute-button-expandable": "withAriaExpandedIndicator", "class.nowrap": "nowrap", "class.disabled": "(_isAnchor || buttonStyle==\"icon\" || disabledInteractive) && disabled", "class.cute-button-disabled-interactive": "disabledInteractive", "class.cute-unthemed": "!color", "attr.tabindex": "_getTabIndex()", "attr.disabled": "_getDisabledAttribute()", "attr.aria-disabled": "_getAriaDisabled()", "attr.id": "id || null", "attr.aria-label": "ariaLabel || null" }, classAttribute: "cute-button" }, providers: [
|
|
325
|
+
{ provide: CUTE_BUTTON_BASE, useExisting: CuteButton }
|
|
326
|
+
], exportAs: ["cuteButton"], usesInheritance: true, ngImport: i0, template: "<!--\r\n For capturing HTML-elements such as <i class..> or <img src=\"\"...> and others\r\n we need apply [cuteButtonIcon] attribute to them.\r\n-->\r\n<span class=\"cute-icon-wrapper\">\r\n <ng-content select=\".material-icons:not([iconPositionEnd]),\r\n .bi:not([iconPositionEnd]),\r\n cute-icon:not([iconPositionEnd]),\r\n cute-avatar:not([iconPositionEnd]),\r\n [cuteButtonIcon]:not([iconPositionEnd])\">\r\n </ng-content>\r\n</span>\r\n\r\n<span class=\"cute-button-label\">\r\n <ng-content>\r\n @if(visuallyHiddenLabel) {\r\n <span class=\"visually-hidden\"> {{visuallyHiddenLabel}} </span>\r\n }\r\n </ng-content>\r\n</span>\r\n\r\n<span class=\"cute-icon-wrapper\">\r\n <ng-content select=\".material-icons[iconPositionEnd],\r\n .bi:[iconPositionEnd],\r\n cute-icon[iconPositionEnd],\r\n cute-avatar:[iconPositionEnd],\r\n [cuteButtonIcon][iconPositionEnd]\">\r\n </ng-content>\r\n</span>\r\n", styles: [".cute-ripple-element{--cute-ripple-duration: .5s;--cute-ripple-bg-color: rgba(255, 255, 255, .18);position:absolute;border-radius:50%;pointer-events:none;transform:scale3d(0,0,0);animation:cute-ripple-element-animation var(--cute-ripple-duration) cubic-bezier(.65,.05,.36,1);background-color:var(--cute-ripple-bg-color);will-change:transform,opacity}@media (forced-colors: active){.cute-ripple-element{display:none}}@keyframes cute-ripple-element-animation{to{transform:scale(8);opacity:0}}.cute-button,.cute-anchor{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;overflow:visible;box-shadow:none}.cute-button:has(>:not(.cute-ripple):nth-child(2)),.cute-anchor:has(>:not(.cute-ripple):nth-child(2)){gap:.5em}.cute-button.dropdown-toggle,.cute-anchor.dropdown-toggle{gap:.375em}.cute-button.dropdown-toggle-split,.cute-anchor.dropdown-toggle-split{gap:0}.cute-button .cute-icon-wrapper,.cute-anchor .cute-icon-wrapper{display:contents}.cute-button .cute-icon-wrapper:empty,.cute-anchor .cute-icon-wrapper:empty{display:none}.cute-button .cute-button-label,.cute-anchor .cute-button-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cute-button .cute-button-label .badge,.cute-anchor .cute-button-label .badge{line-height:var(--bs-btn-line-height);top:0}.cute-button .cute-button-label:empty,.cute-anchor .cute-button-label:empty{display:none}.cute-button.cute-button-disabled-interactive,.cute-anchor.cute-button-disabled-interactive{cursor:pointer}.cute-button.cute-button-disabled-interactive:disabled,.cute-button.cute-button-disabled-interactive.disabled,.cute-anchor.cute-button-disabled-interactive:disabled,.cute-anchor.cute-button-disabled-interactive.disabled{pointer-events:auto;cursor:default;box-shadow:none;--bs-btn-active-bg: var(--bs-btn-disabled-bg);--bs-btn-active-border-color: var(--bs-btn-disabled-border-color);--bs-btn-active-color: var(--bs-btn-disabled-color)}.cute-button.cute-button-disabled-interactive:disabled.cute-icon-button,.cute-button.cute-button-disabled-interactive.disabled.cute-icon-button,.cute-anchor.cute-button-disabled-interactive:disabled.cute-icon-button,.cute-anchor.cute-button-disabled-interactive.disabled.cute-icon-button{--bs-btn-active-bg: transparent;--bs-btn-active-border-color: transparent;--bs-btn-hover-bg: transparent}.cute-button.cute-base-button,.cute-anchor.cute-base-button{font-weight:500;--cute-base-button-color-rgb: var(--bs-body-color-rgb);--bs-btn-active-bg: rgba(var(--cute-base-button-color-rgb), .08);--bs-btn-active-border-color: rgba(var(--cute-base-button-color-rgb), .12);--bs-btn-disabled-border-color: transparent;--bs-btn-hover-bg: rgba(var(--cute-base-button-color-rgb), .06)}.cute-button.cute-flat-button.cute-unthemed,.cute-anchor.cute-flat-button.cute-unthemed{--bs-btn-bg: var(--bs-tertiary-bg);--bs-btn-hover-bg: var(--bs-secondary-bg);--bs-btn-active-bg: var(--bs-secondary-bg);border-color:transparent}.cute-button.raised,.cute-anchor.raised{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:box-shadow .2s cubic-bezier(.4,0,.2,1)}.cute-button.raised:hover,.cute-button.raised:focus,.cute-anchor.raised:hover,.cute-anchor.raised:focus{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.cute-button.raised:active,.cute-anchor.raised:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cute-button.raised:disabled,.cute-button.raised.disabled,.cute-anchor.raised:disabled,.cute-anchor.raised.disabled{box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f}.cute-button.btn-light:disabled,.cute-button.btn-light.disabled,.cute-anchor.btn-light:disabled,.cute-anchor.btn-light.disabled{background-color:#0000001a}.cute-button>[role=img],.cute-button i[class],.cute-anchor>[role=img],.cute-anchor i[class]{align-self:center;pointer-events:none;overflow:visible}.cute-button.cute-fab-button,.cute-anchor.cute-fab-button{--icon-size: 40px;width:var(--icon-size);height:var(--icon-size);min-width:var(--icon-size);line-height:1;padding:0;padding-top:revert;gap:0;border-radius:50%;flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.cute-button.cute-fab-button[magnitude=largest],.cute-anchor.cute-fab-button[magnitude=largest]{--icon-size: 64px}.cute-button.cute-fab-button[magnitude=larger],.cute-anchor.cute-fab-button[magnitude=larger]{--icon-size: 56px}.cute-button.cute-fab-button[magnitude=large],.cute-anchor.cute-fab-button[magnitude=large]{--icon-size: 48px}.cute-button.cute-fab-button[magnitude=middle],.cute-anchor.cute-fab-button[magnitude=middle]{--icon-size: 40px}.cute-button.cute-fab-button[magnitude=small],.cute-anchor.cute-fab-button[magnitude=small]{--icon-size: 32px}.cute-button.cute-fab-button[magnitude=smaller],.cute-anchor.cute-fab-button[magnitude=smaller]{--icon-size: 24px}.cute-button.cute-fab-button[magnitude=smallest],.cute-anchor.cute-fab-button[magnitude=smallest]{--icon-size: 16px}.cute-button.cute-fab-button svg,.cute-anchor.cute-fab-button svg{vertical-align:baseline}.cute-button.cute-fab-button:active,.cute-anchor.cute-fab-button:active{box-shadow:0 7px 8px -4px #0003,0 12px 17px 2px #00000024,0 5px 22px 4px #0000001f}.cute-button.cute-fab-button:active.btn-light,.cute-anchor.cute-fab-button:active.btn-light{border-color:#00000040}.cute-button.cute-fab-button:hover,.cute-button.cute-fab-button.cdk-focused,.cute-anchor.cute-fab-button:hover,.cute-anchor.cute-fab-button.cdk-focused{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cute-button.cute-fab-button:disabled,.cute-button.cute-fab-button.disabled,.cute-anchor.cute-fab-button:disabled,.cute-anchor.cute-fab-button.disabled{border:0;box-shadow:none}.cute-button.cute-fab-button:disabled>[role=img],.cute-button.cute-fab-button:disabled i[class],.cute-button.cute-fab-button.disabled>[role=img],.cute-button.cute-fab-button.disabled i[class],.cute-anchor.cute-fab-button:disabled>[role=img],.cute-anchor.cute-fab-button:disabled i[class],.cute-anchor.cute-fab-button.disabled>[role=img],.cute-anchor.cute-fab-button.disabled i[class]{color:#00000061!important}.cute-button.cute-icon-button,.cute-anchor.cute-icon-button{overflow:hidden;border-radius:50%;border:0;padding:0;gap:0!important;--icon-size: 40px;width:var(--icon-size);height:var(--icon-size);min-width:var(--icon-size);line-height:1;--cute-icon-button-color-rgb: var(--bs-body-color-rgb);--bs-btn-active-bg: rgba(var(--cute-icon-button-color-rgb), .12);--bs-btn-active-border-color: rgba(var(--cute-icon-button-color-rgb), .12);--bs-btn-hover-bg: rgba(var(--cute-icon-button-color-rgb), .06)}.cute-button.cute-icon-button[magnitude=largest],.cute-anchor.cute-icon-button[magnitude=largest]{--icon-size: 64px}.cute-button.cute-icon-button[magnitude=larger],.cute-anchor.cute-icon-button[magnitude=larger]{--icon-size: 56px}.cute-button.cute-icon-button[magnitude=large],.cute-anchor.cute-icon-button[magnitude=large]{--icon-size: 48px}.cute-button.cute-icon-button[magnitude=middle],.cute-anchor.cute-icon-button[magnitude=middle]{--icon-size: 40px}.cute-button.cute-icon-button[magnitude=small],.cute-anchor.cute-icon-button[magnitude=small]{--icon-size: 32px}.cute-button.cute-icon-button[magnitude=smaller],.cute-anchor.cute-icon-button[magnitude=smaller]{--icon-size: 24px}.cute-button.cute-icon-button[magnitude=smallest],.cute-anchor.cute-icon-button[magnitude=smallest]{--icon-size: 16px}.cute-button.cute-icon-button svg,.cute-anchor.cute-icon-button svg{vertical-align:baseline}.cute-button.cute-icon-button.cdk-focused,.cute-anchor.cute-icon-button.cdk-focused{--bs-btn-hover-bg: rgba(var(--cute-icon-button-color-rgb), .04)}.cute-btn-xxs,.cute-btn-group-xxs>.btn{--bs-btn-padding-y: .25rem;--bs-btn-padding-x: .5rem;--bs-btn-font-size: .5rem}.cute-btn-xs,.cute-btn-group-xs>.btn{--bs-btn-padding-y: .25rem;--bs-btn-padding-x: .5rem;--bs-btn-font-size: .75rem}.cute-btn-xl,.cute-btn-group-xl>.btn{--bs-btn-padding-y: .5rem;--bs-btn-padding-x: 1rem;--bs-btn-font-size: 1.5rem}.cute-btn-xxl,.cute-btn-group-xxl>.btn{--bs-btn-padding-y: .5rem;--bs-btn-padding-x: 1rem;--bs-btn-font-size: 2.5rem}[dir=rtl] .btn-group>.btn:not(:first-child):not(.dropdown-toggle),[dir=rtl] .btn-group>.btn.dropdown-toggle-split:last-child,[dir=rtl] .btn-group>.btn-group:not(:first-child)>.btn{border-radius:0}[dir=rtl] .btn-group>.btn:nth-child(n+3),[dir=rtl] .btn-group>:not(.btn-check)+.btn,[dir=rtl] .btn-group>.btn-group:not(:last-child)>.btn{border-radius:0 var(--bs-btn-border-radius) var(--bs-btn-border-radius) 0}[dir=rtl] .btn-group>.btn:first-child:not(.dropdown-toggle),[dir=rtl] .btn-group>.btn.dropdown-toggle-split:first-child,[dir=rtl] .btn-group>.btn-group:first-child>.btn{border-radius:0 var(--bs-btn-border-radius) var(--bs-btn-border-radius) 0}[dir=rtl] .btn-group>.btn:last-child:not(.dropdown-toggle),[dir=rtl] .btn-group>.btn.dropdown-toggle-split:last-child,[dir=rtl] .btn-group>.btn-group:last-child>.btn{border-radius:var(--bs-btn-border-radius) 0 0 var(--bs-btn-border-radius)}.cute-button-expandable{padding:.25rem .5rem;font-weight:600;color:var(--bs-emphasis-color);background-color:transparent}.cute-button-expandable:hover,.cute-button-expandable:focus{color:rgba(var(--bs-emphasis-color-rgb),.85);background-color:var(--bs-tertiary-bg)}.cute-button-expandable:before{width:1.25em;line-height:0;content:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e\");transition:transform .35s ease;transform-origin:.5em 50%;transform:scale(.85)}[data-bs-theme=dark] .cute-button-expandable:before{content:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28255,255,255,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e\")}[dir=rtl] .cute-button-expandable:before{transform:rotate(180deg) scale(.85);margin-left:.25em;text-align:end}.cute-button-expandable[aria-expanded=true]{color:rgba(var(--bs-emphasis-color-rgb),.85)}.cute-button-expandable[aria-expanded=true]:before{transform:rotate(90deg) scale(.85)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButton, decorators: [{
|
|
329
|
+
type: Component,
|
|
330
|
+
args: [{ selector: `button[cuteButton],
|
|
331
|
+
button[cute-button],
|
|
332
|
+
a[cuteButton],
|
|
333
|
+
a[cute-button],
|
|
334
|
+
`, exportAs: "cuteButton", imports: [CommonModule], host: {
|
|
335
|
+
'class': 'cute-button',
|
|
336
|
+
'[class.cute-anchor]': '_isAnchor',
|
|
337
|
+
'[class.btn-close]': 'buttonStyle == "close"',
|
|
338
|
+
'[class.rounded-pill]': 'buttonStyle=="pill"',
|
|
339
|
+
'[class.rounded-circle]': 'buttonStyle=="circle"',
|
|
340
|
+
'[class.raised]': 'buttonStyle=="raised" && !disabled',
|
|
341
|
+
'[class.icon-link]': 'toThemeColor(color)=="link"',
|
|
342
|
+
'[class.cute-button-expandable]': 'withAriaExpandedIndicator',
|
|
343
|
+
//'[class.focus-ring]': 'buttonStyle=="base" && hasClass("cdk-keyboard-focused")', // See: CuteButtonBase.ngDoCheck()
|
|
344
|
+
'[class.nowrap]': 'nowrap',
|
|
345
|
+
'[class.disabled]': '(_isAnchor || buttonStyle=="icon" || disabledInteractive) && disabled',
|
|
346
|
+
'[class.cute-button-disabled-interactive]': 'disabledInteractive',
|
|
347
|
+
'[class.cute-unthemed]': '!color',
|
|
348
|
+
'[attr.tabindex]': '_getTabIndex()', //'disabled ? -1 : tabIndex',
|
|
349
|
+
'[attr.disabled]': '_getDisabledAttribute()',
|
|
350
|
+
'[attr.aria-disabled]': '_getAriaDisabled()',
|
|
351
|
+
'[attr.id]': 'id || null',
|
|
352
|
+
'[attr.aria-label]': 'ariaLabel || null',
|
|
353
|
+
}, providers: [
|
|
354
|
+
{ provide: CUTE_BUTTON_BASE, useExisting: CuteButton }
|
|
355
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\r\n For capturing HTML-elements such as <i class..> or <img src=\"\"...> and others\r\n we need apply [cuteButtonIcon] attribute to them.\r\n-->\r\n<span class=\"cute-icon-wrapper\">\r\n <ng-content select=\".material-icons:not([iconPositionEnd]),\r\n .bi:not([iconPositionEnd]),\r\n cute-icon:not([iconPositionEnd]),\r\n cute-avatar:not([iconPositionEnd]),\r\n [cuteButtonIcon]:not([iconPositionEnd])\">\r\n </ng-content>\r\n</span>\r\n\r\n<span class=\"cute-button-label\">\r\n <ng-content>\r\n @if(visuallyHiddenLabel) {\r\n <span class=\"visually-hidden\"> {{visuallyHiddenLabel}} </span>\r\n }\r\n </ng-content>\r\n</span>\r\n\r\n<span class=\"cute-icon-wrapper\">\r\n <ng-content select=\".material-icons[iconPositionEnd],\r\n .bi:[iconPositionEnd],\r\n cute-icon[iconPositionEnd],\r\n cute-avatar:[iconPositionEnd],\r\n [cuteButtonIcon][iconPositionEnd]\">\r\n </ng-content>\r\n</span>\r\n", styles: [".cute-ripple-element{--cute-ripple-duration: .5s;--cute-ripple-bg-color: rgba(255, 255, 255, .18);position:absolute;border-radius:50%;pointer-events:none;transform:scale3d(0,0,0);animation:cute-ripple-element-animation var(--cute-ripple-duration) cubic-bezier(.65,.05,.36,1);background-color:var(--cute-ripple-bg-color);will-change:transform,opacity}@media (forced-colors: active){.cute-ripple-element{display:none}}@keyframes cute-ripple-element-animation{to{transform:scale(8);opacity:0}}.cute-button,.cute-anchor{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;overflow:visible;box-shadow:none}.cute-button:has(>:not(.cute-ripple):nth-child(2)),.cute-anchor:has(>:not(.cute-ripple):nth-child(2)){gap:.5em}.cute-button.dropdown-toggle,.cute-anchor.dropdown-toggle{gap:.375em}.cute-button.dropdown-toggle-split,.cute-anchor.dropdown-toggle-split{gap:0}.cute-button .cute-icon-wrapper,.cute-anchor .cute-icon-wrapper{display:contents}.cute-button .cute-icon-wrapper:empty,.cute-anchor .cute-icon-wrapper:empty{display:none}.cute-button .cute-button-label,.cute-anchor .cute-button-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cute-button .cute-button-label .badge,.cute-anchor .cute-button-label .badge{line-height:var(--bs-btn-line-height);top:0}.cute-button .cute-button-label:empty,.cute-anchor .cute-button-label:empty{display:none}.cute-button.cute-button-disabled-interactive,.cute-anchor.cute-button-disabled-interactive{cursor:pointer}.cute-button.cute-button-disabled-interactive:disabled,.cute-button.cute-button-disabled-interactive.disabled,.cute-anchor.cute-button-disabled-interactive:disabled,.cute-anchor.cute-button-disabled-interactive.disabled{pointer-events:auto;cursor:default;box-shadow:none;--bs-btn-active-bg: var(--bs-btn-disabled-bg);--bs-btn-active-border-color: var(--bs-btn-disabled-border-color);--bs-btn-active-color: var(--bs-btn-disabled-color)}.cute-button.cute-button-disabled-interactive:disabled.cute-icon-button,.cute-button.cute-button-disabled-interactive.disabled.cute-icon-button,.cute-anchor.cute-button-disabled-interactive:disabled.cute-icon-button,.cute-anchor.cute-button-disabled-interactive.disabled.cute-icon-button{--bs-btn-active-bg: transparent;--bs-btn-active-border-color: transparent;--bs-btn-hover-bg: transparent}.cute-button.cute-base-button,.cute-anchor.cute-base-button{font-weight:500;--cute-base-button-color-rgb: var(--bs-body-color-rgb);--bs-btn-active-bg: rgba(var(--cute-base-button-color-rgb), .08);--bs-btn-active-border-color: rgba(var(--cute-base-button-color-rgb), .12);--bs-btn-disabled-border-color: transparent;--bs-btn-hover-bg: rgba(var(--cute-base-button-color-rgb), .06)}.cute-button.cute-flat-button.cute-unthemed,.cute-anchor.cute-flat-button.cute-unthemed{--bs-btn-bg: var(--bs-tertiary-bg);--bs-btn-hover-bg: var(--bs-secondary-bg);--bs-btn-active-bg: var(--bs-secondary-bg);border-color:transparent}.cute-button.raised,.cute-anchor.raised{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transition:box-shadow .2s cubic-bezier(.4,0,.2,1)}.cute-button.raised:hover,.cute-button.raised:focus,.cute-anchor.raised:hover,.cute-anchor.raised:focus{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.cute-button.raised:active,.cute-anchor.raised:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cute-button.raised:disabled,.cute-button.raised.disabled,.cute-anchor.raised:disabled,.cute-anchor.raised.disabled{box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f}.cute-button.btn-light:disabled,.cute-button.btn-light.disabled,.cute-anchor.btn-light:disabled,.cute-anchor.btn-light.disabled{background-color:#0000001a}.cute-button>[role=img],.cute-button i[class],.cute-anchor>[role=img],.cute-anchor i[class]{align-self:center;pointer-events:none;overflow:visible}.cute-button.cute-fab-button,.cute-anchor.cute-fab-button{--icon-size: 40px;width:var(--icon-size);height:var(--icon-size);min-width:var(--icon-size);line-height:1;padding:0;padding-top:revert;gap:0;border-radius:50%;flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.cute-button.cute-fab-button[magnitude=largest],.cute-anchor.cute-fab-button[magnitude=largest]{--icon-size: 64px}.cute-button.cute-fab-button[magnitude=larger],.cute-anchor.cute-fab-button[magnitude=larger]{--icon-size: 56px}.cute-button.cute-fab-button[magnitude=large],.cute-anchor.cute-fab-button[magnitude=large]{--icon-size: 48px}.cute-button.cute-fab-button[magnitude=middle],.cute-anchor.cute-fab-button[magnitude=middle]{--icon-size: 40px}.cute-button.cute-fab-button[magnitude=small],.cute-anchor.cute-fab-button[magnitude=small]{--icon-size: 32px}.cute-button.cute-fab-button[magnitude=smaller],.cute-anchor.cute-fab-button[magnitude=smaller]{--icon-size: 24px}.cute-button.cute-fab-button[magnitude=smallest],.cute-anchor.cute-fab-button[magnitude=smallest]{--icon-size: 16px}.cute-button.cute-fab-button svg,.cute-anchor.cute-fab-button svg{vertical-align:baseline}.cute-button.cute-fab-button:active,.cute-anchor.cute-fab-button:active{box-shadow:0 7px 8px -4px #0003,0 12px 17px 2px #00000024,0 5px 22px 4px #0000001f}.cute-button.cute-fab-button:active.btn-light,.cute-anchor.cute-fab-button:active.btn-light{border-color:#00000040}.cute-button.cute-fab-button:hover,.cute-button.cute-fab-button.cdk-focused,.cute-anchor.cute-fab-button:hover,.cute-anchor.cute-fab-button.cdk-focused{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cute-button.cute-fab-button:disabled,.cute-button.cute-fab-button.disabled,.cute-anchor.cute-fab-button:disabled,.cute-anchor.cute-fab-button.disabled{border:0;box-shadow:none}.cute-button.cute-fab-button:disabled>[role=img],.cute-button.cute-fab-button:disabled i[class],.cute-button.cute-fab-button.disabled>[role=img],.cute-button.cute-fab-button.disabled i[class],.cute-anchor.cute-fab-button:disabled>[role=img],.cute-anchor.cute-fab-button:disabled i[class],.cute-anchor.cute-fab-button.disabled>[role=img],.cute-anchor.cute-fab-button.disabled i[class]{color:#00000061!important}.cute-button.cute-icon-button,.cute-anchor.cute-icon-button{overflow:hidden;border-radius:50%;border:0;padding:0;gap:0!important;--icon-size: 40px;width:var(--icon-size);height:var(--icon-size);min-width:var(--icon-size);line-height:1;--cute-icon-button-color-rgb: var(--bs-body-color-rgb);--bs-btn-active-bg: rgba(var(--cute-icon-button-color-rgb), .12);--bs-btn-active-border-color: rgba(var(--cute-icon-button-color-rgb), .12);--bs-btn-hover-bg: rgba(var(--cute-icon-button-color-rgb), .06)}.cute-button.cute-icon-button[magnitude=largest],.cute-anchor.cute-icon-button[magnitude=largest]{--icon-size: 64px}.cute-button.cute-icon-button[magnitude=larger],.cute-anchor.cute-icon-button[magnitude=larger]{--icon-size: 56px}.cute-button.cute-icon-button[magnitude=large],.cute-anchor.cute-icon-button[magnitude=large]{--icon-size: 48px}.cute-button.cute-icon-button[magnitude=middle],.cute-anchor.cute-icon-button[magnitude=middle]{--icon-size: 40px}.cute-button.cute-icon-button[magnitude=small],.cute-anchor.cute-icon-button[magnitude=small]{--icon-size: 32px}.cute-button.cute-icon-button[magnitude=smaller],.cute-anchor.cute-icon-button[magnitude=smaller]{--icon-size: 24px}.cute-button.cute-icon-button[magnitude=smallest],.cute-anchor.cute-icon-button[magnitude=smallest]{--icon-size: 16px}.cute-button.cute-icon-button svg,.cute-anchor.cute-icon-button svg{vertical-align:baseline}.cute-button.cute-icon-button.cdk-focused,.cute-anchor.cute-icon-button.cdk-focused{--bs-btn-hover-bg: rgba(var(--cute-icon-button-color-rgb), .04)}.cute-btn-xxs,.cute-btn-group-xxs>.btn{--bs-btn-padding-y: .25rem;--bs-btn-padding-x: .5rem;--bs-btn-font-size: .5rem}.cute-btn-xs,.cute-btn-group-xs>.btn{--bs-btn-padding-y: .25rem;--bs-btn-padding-x: .5rem;--bs-btn-font-size: .75rem}.cute-btn-xl,.cute-btn-group-xl>.btn{--bs-btn-padding-y: .5rem;--bs-btn-padding-x: 1rem;--bs-btn-font-size: 1.5rem}.cute-btn-xxl,.cute-btn-group-xxl>.btn{--bs-btn-padding-y: .5rem;--bs-btn-padding-x: 1rem;--bs-btn-font-size: 2.5rem}[dir=rtl] .btn-group>.btn:not(:first-child):not(.dropdown-toggle),[dir=rtl] .btn-group>.btn.dropdown-toggle-split:last-child,[dir=rtl] .btn-group>.btn-group:not(:first-child)>.btn{border-radius:0}[dir=rtl] .btn-group>.btn:nth-child(n+3),[dir=rtl] .btn-group>:not(.btn-check)+.btn,[dir=rtl] .btn-group>.btn-group:not(:last-child)>.btn{border-radius:0 var(--bs-btn-border-radius) var(--bs-btn-border-radius) 0}[dir=rtl] .btn-group>.btn:first-child:not(.dropdown-toggle),[dir=rtl] .btn-group>.btn.dropdown-toggle-split:first-child,[dir=rtl] .btn-group>.btn-group:first-child>.btn{border-radius:0 var(--bs-btn-border-radius) var(--bs-btn-border-radius) 0}[dir=rtl] .btn-group>.btn:last-child:not(.dropdown-toggle),[dir=rtl] .btn-group>.btn.dropdown-toggle-split:last-child,[dir=rtl] .btn-group>.btn-group:last-child>.btn{border-radius:var(--bs-btn-border-radius) 0 0 var(--bs-btn-border-radius)}.cute-button-expandable{padding:.25rem .5rem;font-weight:600;color:var(--bs-emphasis-color);background-color:transparent}.cute-button-expandable:hover,.cute-button-expandable:focus{color:rgba(var(--bs-emphasis-color-rgb),.85);background-color:var(--bs-tertiary-bg)}.cute-button-expandable:before{width:1.25em;line-height:0;content:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e\");transition:transform .35s ease;transform-origin:.5em 50%;transform:scale(.85)}[data-bs-theme=dark] .cute-button-expandable:before{content:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28255,255,255,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e\")}[dir=rtl] .cute-button-expandable:before{transform:rotate(180deg) scale(.85);margin-left:.25em;text-align:end}.cute-button-expandable[aria-expanded=true]{color:rgba(var(--bs-emphasis-color-rgb),.85)}.cute-button-expandable[aria-expanded=true]:before{transform:rotate(90deg) scale(.85)}\n"] }]
|
|
356
|
+
}], ctorParameters: () => [] });
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* @license Apache-2.0
|
|
360
|
+
*
|
|
361
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
362
|
+
*
|
|
363
|
+
* You may not use this file except in compliance with the License
|
|
364
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
365
|
+
*/
|
|
366
|
+
// Counter used to generate unique IDs.
|
|
367
|
+
let uniqueIdCounter$1 = 0;
|
|
368
|
+
/**
|
|
369
|
+
* Group a series of buttons together on a single line or stack them in a vertical column.
|
|
370
|
+
*/
|
|
371
|
+
class CuteButtonGroup extends CuteFocusableControl {
|
|
372
|
+
get buttonLargerBinding() { return this.magnitude == "larger"; }
|
|
373
|
+
get buttonLargeBinding() { return this.magnitude == "large"; }
|
|
374
|
+
get buttonSmallerBinding() { return this.magnitude == "smaller"; }
|
|
375
|
+
get buttonSmallBinding() { return this.magnitude == "small"; }
|
|
376
|
+
constructor() {
|
|
377
|
+
super();
|
|
378
|
+
/** Whether to place the nested buttons in the vertical direction. */
|
|
379
|
+
this.vertical = false;
|
|
380
|
+
}
|
|
381
|
+
generateId() {
|
|
382
|
+
return `button-group-${++uniqueIdCounter$1}`;
|
|
383
|
+
}
|
|
384
|
+
setDisabledState(newState, emitEvent) {
|
|
385
|
+
let res = super.setDisabledState(newState, emitEvent);
|
|
386
|
+
if (res && this._buttons) {
|
|
387
|
+
this._buttons.forEach(btn => {
|
|
388
|
+
btn.disabled = coerceBooleanProperty(newState);
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
return res;
|
|
392
|
+
}
|
|
393
|
+
ngAfterContentInit() {
|
|
394
|
+
super.ngAfterContentInit();
|
|
395
|
+
this._buttons?.forEach(b => {
|
|
396
|
+
b.defaultColor = this.color ?? "primary";
|
|
397
|
+
b.disabled = this.disabled;
|
|
398
|
+
if (b.buttonStyle == "base") {
|
|
399
|
+
b.inputButtonStyle = this.buttonStyle ?? "flat-button";
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
404
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.15", type: CuteButtonGroup, isStandalone: true, selector: "cute-button-group", inputs: { vertical: ["vertical", "vertical", booleanAttribute], magnitude: "magnitude", buttonStyle: "buttonStyle" }, host: { attributes: { "role": "group" }, properties: { "class": "\"btn-group\" +(vertical?\"-vertical\":\"\")", "attr.aria-label": "ariaLabel || null", "attr.aria-labelledby": "ariaLabelledby || null", "attr.aria-describedby": "ariaDescribedby || null", "id": "id || null", "class.cute-btn-group-xl": "this.buttonLargerBinding", "class.btn-group-lg": "this.buttonLargeBinding", "class.cute-btn-group-xs": "this.buttonSmallerBinding", "class.btn-group-sm": "this.buttonSmallBinding" }, classAttribute: "cute-button-group" }, queries: [{ propertyName: "_buttons", predicate: CUTE_BUTTON_BASE, descendants: true }], exportAs: ["cuteButtonGroup"], usesInheritance: true, ngImport: i0 }); }
|
|
405
|
+
}
|
|
406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonGroup, decorators: [{
|
|
407
|
+
type: Directive,
|
|
408
|
+
args: [{
|
|
409
|
+
selector: "cute-button-group",
|
|
410
|
+
exportAs: "cuteButtonGroup",
|
|
411
|
+
host: {
|
|
412
|
+
'role': 'group',
|
|
413
|
+
'class': 'cute-button-group',
|
|
414
|
+
'[class]': '"btn-group" +(vertical?"-vertical":"")',
|
|
415
|
+
'[attr.aria-label]': 'ariaLabel || null',
|
|
416
|
+
'[attr.aria-labelledby]': 'ariaLabelledby || null',
|
|
417
|
+
'[attr.aria-describedby]': 'ariaDescribedby || null',
|
|
418
|
+
'[id]': 'id || null'
|
|
419
|
+
},
|
|
420
|
+
standalone: true
|
|
421
|
+
}]
|
|
422
|
+
}], ctorParameters: () => [], propDecorators: { vertical: [{
|
|
423
|
+
type: Input,
|
|
424
|
+
args: [{ transform: booleanAttribute }]
|
|
425
|
+
}], magnitude: [{
|
|
426
|
+
type: Input
|
|
427
|
+
}], buttonStyle: [{
|
|
428
|
+
type: Input
|
|
429
|
+
}], buttonLargerBinding: [{
|
|
430
|
+
type: HostBinding,
|
|
431
|
+
args: ["class.cute-btn-group-xl"]
|
|
432
|
+
}], buttonLargeBinding: [{
|
|
433
|
+
type: HostBinding,
|
|
434
|
+
args: ["class.btn-group-lg"]
|
|
435
|
+
}], buttonSmallerBinding: [{
|
|
436
|
+
type: HostBinding,
|
|
437
|
+
args: ["class.cute-btn-group-xs"]
|
|
438
|
+
}], buttonSmallBinding: [{
|
|
439
|
+
type: HostBinding,
|
|
440
|
+
args: ["class.btn-group-sm"]
|
|
441
|
+
}], _buttons: [{
|
|
442
|
+
type: ContentChildren,
|
|
443
|
+
args: [CUTE_BUTTON_BASE, { descendants: true }]
|
|
444
|
+
}] } });
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* @license Apache-2.0
|
|
448
|
+
*
|
|
449
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
450
|
+
*
|
|
451
|
+
* You may not use this file except in compliance with the License
|
|
452
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
453
|
+
*/
|
|
454
|
+
// Counter used to generate unique IDs.
|
|
455
|
+
let uniqueIdCounter = 0;
|
|
456
|
+
class CuteButtonToolbar extends CuteFocusableControl {
|
|
457
|
+
/** The gutter between buttons */
|
|
458
|
+
get gap() { return this._gap; }
|
|
459
|
+
set gap(value) {
|
|
460
|
+
const MAX_GAP = 5;
|
|
461
|
+
value = Math.round(value);
|
|
462
|
+
if (value >= 0 && value <= MAX_GAP) {
|
|
463
|
+
this._gap = value;
|
|
464
|
+
}
|
|
465
|
+
else if (value > MAX_GAP) {
|
|
466
|
+
this._gap = MAX_GAP;
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
this._gap = 0;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
/** Child buttons. */
|
|
473
|
+
//@ContentChildren(CUTE_BUTTON_BASE, {descendants: true})
|
|
474
|
+
//_buttons: QueryList<ButtonBase> | undefined;
|
|
475
|
+
constructor() {
|
|
476
|
+
super();
|
|
477
|
+
//@Input({transform: booleanAttribute}) vertical: boolean = false;
|
|
478
|
+
this._gap = 0;
|
|
479
|
+
}
|
|
480
|
+
generateId() {
|
|
481
|
+
return `button-toolbar-${++uniqueIdCounter}`;
|
|
482
|
+
}
|
|
483
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonToolbar, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
484
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.3.15", type: CuteButtonToolbar, isStandalone: true, selector: "cute-button-toolbar", inputs: { gap: ["gap", "gap", numberAttribute], magnitude: "magnitude" }, host: { attributes: { "role": "toolbar" }, properties: { "class": "\"gap-\"+gap", "attr.gap": "null", "attr.aria-label": "ariaLabel || null", "attr.aria-labelledby": "ariaLabelledby || null", "attr.aria-describedby": "ariaDescribedby || null", "id": "id || null" }, classAttribute: "btn-toolbar" }, exportAs: ["cuteButtonToolbar"], usesInheritance: true, ngImport: i0 }); }
|
|
485
|
+
}
|
|
486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonToolbar, decorators: [{
|
|
487
|
+
type: Directive,
|
|
488
|
+
args: [{
|
|
489
|
+
selector: "cute-button-toolbar",
|
|
490
|
+
exportAs: "cuteButtonToolbar",
|
|
491
|
+
host: {
|
|
492
|
+
'role': 'toolbar',
|
|
493
|
+
'class': 'btn-toolbar',
|
|
494
|
+
'[class]': '"gap-"+gap',
|
|
495
|
+
'[attr.gap]': 'null',
|
|
496
|
+
'[attr.aria-label]': 'ariaLabel || null',
|
|
497
|
+
'[attr.aria-labelledby]': 'ariaLabelledby || null',
|
|
498
|
+
'[attr.aria-describedby]': 'ariaDescribedby || null',
|
|
499
|
+
'[id]': 'id || null'
|
|
500
|
+
},
|
|
501
|
+
standalone: true
|
|
502
|
+
}]
|
|
503
|
+
}], ctorParameters: () => [], propDecorators: { gap: [{
|
|
504
|
+
type: Input,
|
|
505
|
+
args: [{ transform: numberAttribute }]
|
|
506
|
+
}], magnitude: [{
|
|
507
|
+
type: Input
|
|
508
|
+
}] } });
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* @license Apache-2.0
|
|
512
|
+
*
|
|
513
|
+
* Copyright (c) 2025 CuteWidgets Team. All Rights Reserved.
|
|
514
|
+
*
|
|
515
|
+
* You may not use this file except in compliance with the License
|
|
516
|
+
* that can be found at http://www.apache.org/licenses/LICENSE-2.0
|
|
517
|
+
*/
|
|
518
|
+
const TYPES = [
|
|
519
|
+
CuteButton,
|
|
520
|
+
CuteButtonGroup,
|
|
521
|
+
CuteButtonToolbar,
|
|
522
|
+
];
|
|
523
|
+
class CuteButtonModule {
|
|
524
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
525
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonModule, imports: [CommonModule, CuteButton,
|
|
526
|
+
CuteButtonGroup,
|
|
527
|
+
CuteButtonToolbar], exports: [CuteButton,
|
|
528
|
+
CuteButtonGroup,
|
|
529
|
+
CuteButtonToolbar] }); }
|
|
530
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonModule, imports: [CommonModule, CuteButton] }); }
|
|
531
|
+
}
|
|
532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuteButtonModule, decorators: [{
|
|
533
|
+
type: NgModule,
|
|
534
|
+
args: [{
|
|
535
|
+
imports: [CommonModule, ...TYPES],
|
|
536
|
+
exports: TYPES,
|
|
537
|
+
declarations: [],
|
|
538
|
+
}]
|
|
539
|
+
}] });
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Generated bundle index. Do not edit.
|
|
543
|
+
*/
|
|
544
|
+
|
|
545
|
+
export { CUTE_BUTTON_BASE, CUTE_BUTTON_CONFIG, CuteButton, CuteButtonBase, CuteButtonGroup, CuteButtonModule, CuteButtonToolbar };
|
|
546
|
+
//# sourceMappingURL=cute-widgets-base-button.mjs.map
|