@i-cell/ids-angular 0.0.0-watch
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/README.md +24 -0
- package/accordion/index.d.ts +81 -0
- package/accordion/package.json +3 -0
- package/avatar/index.d.ts +66 -0
- package/avatar/package.json +3 -0
- package/badge/index.d.ts +61 -0
- package/badge/package.json +3 -0
- package/breadcrumb/index.d.ts +67 -0
- package/breadcrumb/package.json +3 -0
- package/button/index.d.ts +81 -0
- package/button/package.json +3 -0
- package/card/index.d.ts +91 -0
- package/card/package.json +3 -0
- package/checkbox/index.d.ts +137 -0
- package/checkbox/package.json +3 -0
- package/chip/index.d.ts +82 -0
- package/chip/package.json +3 -0
- package/core/index.d.ts +168 -0
- package/core/package.json +3 -0
- package/datepicker/index.d.ts +112 -0
- package/datepicker/package.json +3 -0
- package/dialog/index.d.ts +72 -0
- package/dialog/package.json +3 -0
- package/divider/index.d.ts +45 -0
- package/divider/package.json +3 -0
- package/fesm2022/i-cell-ids-angular-accordion.mjs +223 -0
- package/fesm2022/i-cell-ids-angular-accordion.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-avatar.mjs +125 -0
- package/fesm2022/i-cell-ids-angular-avatar.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-badge.mjs +172 -0
- package/fesm2022/i-cell-ids-angular-badge.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-breadcrumb.mjs +313 -0
- package/fesm2022/i-cell-ids-angular-breadcrumb.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-button.mjs +149 -0
- package/fesm2022/i-cell-ids-angular-button.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-card.mjs +222 -0
- package/fesm2022/i-cell-ids-angular-card.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-checkbox.mjs +350 -0
- package/fesm2022/i-cell-ids-angular-checkbox.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-chip.mjs +166 -0
- package/fesm2022/i-cell-ids-angular-chip.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-core.mjs +409 -0
- package/fesm2022/i-cell-ids-angular-core.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-datepicker.mjs +860 -0
- package/fesm2022/i-cell-ids-angular-datepicker.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-dialog.mjs +183 -0
- package/fesm2022/i-cell-ids-angular-dialog.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-divider.mjs +76 -0
- package/fesm2022/i-cell-ids-angular-divider.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-forms.mjs +972 -0
- package/fesm2022/i-cell-ids-angular-forms.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-icon-button.mjs +120 -0
- package/fesm2022/i-cell-ids-angular-icon-button.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-icon.mjs +158 -0
- package/fesm2022/i-cell-ids-angular-icon.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-menu.mjs +154 -0
- package/fesm2022/i-cell-ids-angular-menu.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-notification.mjs +167 -0
- package/fesm2022/i-cell-ids-angular-notification.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-overlay-panel.mjs +72 -0
- package/fesm2022/i-cell-ids-angular-overlay-panel.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-paginator.mjs +319 -0
- package/fesm2022/i-cell-ids-angular-paginator.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-radio.mjs +312 -0
- package/fesm2022/i-cell-ids-angular-radio.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs +264 -0
- package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-segmented-control.mjs +283 -0
- package/fesm2022/i-cell-ids-angular-segmented-control.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-select.mjs +549 -0
- package/fesm2022/i-cell-ids-angular-select.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-side-nav.mjs +375 -0
- package/fesm2022/i-cell-ids-angular-side-nav.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-side-sheet.mjs +179 -0
- package/fesm2022/i-cell-ids-angular-side-sheet.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-snackbar.mjs +440 -0
- package/fesm2022/i-cell-ids-angular-snackbar.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-spinner.mjs +67 -0
- package/fesm2022/i-cell-ids-angular-spinner.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-switch.mjs +181 -0
- package/fesm2022/i-cell-ids-angular-switch.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-tab.mjs +142 -0
- package/fesm2022/i-cell-ids-angular-tab.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-table.mjs +663 -0
- package/fesm2022/i-cell-ids-angular-table.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-tag.mjs +116 -0
- package/fesm2022/i-cell-ids-angular-tag.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular-tooltip.mjs +586 -0
- package/fesm2022/i-cell-ids-angular-tooltip.mjs.map +1 -0
- package/fesm2022/i-cell-ids-angular.mjs +9 -0
- package/fesm2022/i-cell-ids-angular.mjs.map +1 -0
- package/forms/index.d.ts +470 -0
- package/forms/package.json +3 -0
- package/icon/index.d.ts +69 -0
- package/icon/package.json +3 -0
- package/icon-button/index.d.ts +68 -0
- package/icon-button/package.json +3 -0
- package/index.d.ts +2 -0
- package/menu/index.d.ts +68 -0
- package/menu/package.json +3 -0
- package/notification/index.d.ts +68 -0
- package/notification/package.json +3 -0
- package/overlay-panel/index.d.ts +41 -0
- package/overlay-panel/package.json +3 -0
- package/package.json +180 -0
- package/paginator/index.d.ts +122 -0
- package/paginator/package.json +3 -0
- package/radio/index.d.ts +95 -0
- package/radio/package.json +3 -0
- package/segmented-control/index.d.ts +98 -0
- package/segmented-control/package.json +3 -0
- package/segmented-control-toggle/index.d.ts +103 -0
- package/segmented-control-toggle/package.json +3 -0
- package/select/index.d.ts +103 -0
- package/select/package.json +3 -0
- package/side-nav/index.d.ts +107 -0
- package/side-nav/package.json +3 -0
- package/side-sheet/index.d.ts +84 -0
- package/side-sheet/package.json +3 -0
- package/snackbar/index.d.ts +149 -0
- package/snackbar/package.json +3 -0
- package/spinner/index.d.ts +41 -0
- package/spinner/package.json +3 -0
- package/switch/index.d.ts +89 -0
- package/switch/package.json +3 -0
- package/tab/index.d.ts +78 -0
- package/tab/package.json +3 -0
- package/table/index.d.ts +393 -0
- package/table/package.json +3 -0
- package/tag/index.d.ts +70 -0
- package/tag/package.json +3 -0
- package/tooltip/index.d.ts +96 -0
- package/tooltip/package.json +3 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, Directive, InjectionToken, ChangeDetectionStrategy, ViewEncapsulation, Component, EventEmitter, signal, Output } from '@angular/core';
|
|
3
|
+
import { DirectiveBase, IdsOrientation, IdsSize, ComponentBaseWithDefaults, coerceBooleanAttribute } from '@i-cell/ids-angular/core';
|
|
4
|
+
|
|
5
|
+
const IdsCardAppearance = {
|
|
6
|
+
FILLED: 'filled',
|
|
7
|
+
OUTLINED: 'outlined',
|
|
8
|
+
ELEVATED: 'elevated',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const IdsCardVariant = {
|
|
12
|
+
PRIMARY: 'primary',
|
|
13
|
+
SECONDARY: 'secondary',
|
|
14
|
+
SURFACE: 'surface',
|
|
15
|
+
BRAND: 'brand',
|
|
16
|
+
LIGHT: 'light',
|
|
17
|
+
DARK: 'dark',
|
|
18
|
+
INFO: 'info',
|
|
19
|
+
SUCCESS: 'success',
|
|
20
|
+
WARNING: 'warning',
|
|
21
|
+
ERROR: 'error',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class IdsCardSectionBase extends DirectiveBase {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.stretch = input(false, ...(ngDevMode ? [{ debugName: "stretch" }] : []));
|
|
28
|
+
this._hostClasses = computed(() => this._getHostClasses([this.stretch() ? 'stretched' : 'padded']), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
|
|
29
|
+
}
|
|
30
|
+
get _hostName() {
|
|
31
|
+
return 'card-section';
|
|
32
|
+
}
|
|
33
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardSectionBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
34
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.7", type: IdsCardSectionBase, isStandalone: false, inputs: { stretch: { classPropertyName: "stretch", publicName: "stretch", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardSectionBase, decorators: [{
|
|
37
|
+
type: Directive,
|
|
38
|
+
args: [{
|
|
39
|
+
standalone: false,
|
|
40
|
+
}]
|
|
41
|
+
}] });
|
|
42
|
+
|
|
43
|
+
class IdsCardBodyDirective extends IdsCardSectionBase {
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardBodyDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
45
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsCardBodyDirective, isStandalone: true, selector: "ids-card-body", host: { classAttribute: "ids-card-body" }, usesInheritance: true, ngImport: i0 }); }
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardBodyDirective, decorators: [{
|
|
48
|
+
type: Directive,
|
|
49
|
+
args: [{
|
|
50
|
+
selector: 'ids-card-body',
|
|
51
|
+
standalone: true,
|
|
52
|
+
host: {
|
|
53
|
+
class: 'ids-card-body',
|
|
54
|
+
},
|
|
55
|
+
}]
|
|
56
|
+
}] });
|
|
57
|
+
|
|
58
|
+
const IDS_CARD_DEFAULT_CONFIG = new InjectionToken('IDS_CARD_DEFAULT_CONFIG', {
|
|
59
|
+
providedIn: 'root',
|
|
60
|
+
factory: IDS_CARD_DEFAULT_CONFIG_FACTORY,
|
|
61
|
+
});
|
|
62
|
+
function IDS_CARD_DEFAULT_CONFIG_FACTORY() {
|
|
63
|
+
return {
|
|
64
|
+
appearance: IdsCardAppearance.FILLED,
|
|
65
|
+
size: IdsSize.COMPACT,
|
|
66
|
+
variant: IdsCardVariant.SURFACE,
|
|
67
|
+
orientation: IdsOrientation.VERTICAL,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class IdsCardFooterDirective extends IdsCardSectionBase {
|
|
72
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardFooterDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
73
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsCardFooterDirective, isStandalone: true, selector: "ids-card-footer,footer[idsCardFooter]", host: { classAttribute: "ids-card-footer" }, usesInheritance: true, ngImport: i0 }); }
|
|
74
|
+
}
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardFooterDirective, decorators: [{
|
|
76
|
+
type: Directive,
|
|
77
|
+
args: [{
|
|
78
|
+
selector: 'ids-card-footer,footer[idsCardFooter]',
|
|
79
|
+
standalone: true,
|
|
80
|
+
host: {
|
|
81
|
+
class: 'ids-card-footer',
|
|
82
|
+
},
|
|
83
|
+
}]
|
|
84
|
+
}] });
|
|
85
|
+
|
|
86
|
+
class IdsCardHeaderComponent extends IdsCardSectionBase {
|
|
87
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardHeaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
88
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: IdsCardHeaderComponent, isStandalone: true, selector: "ids-card-header,header[idsCardHeader]", host: { classAttribute: "ids-card-header" }, usesInheritance: true, ngImport: i0, template: `
|
|
89
|
+
<div class="ids-card-header-headline">
|
|
90
|
+
<ng-content select="ids-card-title, [idsCardTitle], ids-card-subtitle, [idsCardSubtitle]" />
|
|
91
|
+
</div>
|
|
92
|
+
<ng-content />
|
|
93
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardHeaderComponent, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{
|
|
98
|
+
selector: 'ids-card-header,header[idsCardHeader]',
|
|
99
|
+
imports: [],
|
|
100
|
+
template: `
|
|
101
|
+
<div class="ids-card-header-headline">
|
|
102
|
+
<ng-content select="ids-card-title, [idsCardTitle], ids-card-subtitle, [idsCardSubtitle]" />
|
|
103
|
+
</div>
|
|
104
|
+
<ng-content />
|
|
105
|
+
`,
|
|
106
|
+
encapsulation: ViewEncapsulation.None,
|
|
107
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
108
|
+
host: {
|
|
109
|
+
class: 'ids-card-header',
|
|
110
|
+
},
|
|
111
|
+
}]
|
|
112
|
+
}] });
|
|
113
|
+
|
|
114
|
+
class IdsCardMediaDirective extends IdsCardSectionBase {
|
|
115
|
+
constructor() {
|
|
116
|
+
super(...arguments);
|
|
117
|
+
this.stretch = input(true, ...(ngDevMode ? [{ debugName: "stretch" }] : []));
|
|
118
|
+
}
|
|
119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardMediaDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
120
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.7", type: IdsCardMediaDirective, isStandalone: true, selector: "[idsCardMedia]", inputs: { stretch: { classPropertyName: "stretch", publicName: "stretch", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "ids-card-media" }, usesInheritance: true, ngImport: i0 }); }
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardMediaDirective, decorators: [{
|
|
123
|
+
type: Directive,
|
|
124
|
+
args: [{
|
|
125
|
+
selector: '[idsCardMedia]',
|
|
126
|
+
standalone: true,
|
|
127
|
+
host: {
|
|
128
|
+
class: 'ids-card-media',
|
|
129
|
+
},
|
|
130
|
+
}]
|
|
131
|
+
}] });
|
|
132
|
+
|
|
133
|
+
class IdsCardSubtitleDirective {
|
|
134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardSubtitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
135
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsCardSubtitleDirective, isStandalone: true, selector: "[idsCardSubtitle]", host: { classAttribute: "ids-card-subtitle" }, ngImport: i0 }); }
|
|
136
|
+
}
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardSubtitleDirective, decorators: [{
|
|
138
|
+
type: Directive,
|
|
139
|
+
args: [{
|
|
140
|
+
selector: '[idsCardSubtitle]',
|
|
141
|
+
standalone: true,
|
|
142
|
+
host: {
|
|
143
|
+
class: 'ids-card-subtitle',
|
|
144
|
+
},
|
|
145
|
+
}]
|
|
146
|
+
}] });
|
|
147
|
+
|
|
148
|
+
class IdsCardTitleDirective {
|
|
149
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
150
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsCardTitleDirective, isStandalone: true, selector: "[idsCardTitle]", host: { classAttribute: "ids-card-title" }, ngImport: i0 }); }
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardTitleDirective, decorators: [{
|
|
153
|
+
type: Directive,
|
|
154
|
+
args: [{
|
|
155
|
+
selector: '[idsCardTitle]',
|
|
156
|
+
standalone: true,
|
|
157
|
+
host: {
|
|
158
|
+
class: 'ids-card-title',
|
|
159
|
+
},
|
|
160
|
+
}]
|
|
161
|
+
}] });
|
|
162
|
+
|
|
163
|
+
const defaultConfig = IDS_CARD_DEFAULT_CONFIG_FACTORY();
|
|
164
|
+
class IdsCardComponent extends ComponentBaseWithDefaults {
|
|
165
|
+
constructor() {
|
|
166
|
+
super(...arguments);
|
|
167
|
+
this._defaultConfig = this._getDefaultConfig(defaultConfig, IDS_CARD_DEFAULT_CONFIG);
|
|
168
|
+
this.appearance = input(this._defaultConfig.appearance, ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
169
|
+
this.size = input(this._defaultConfig.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
170
|
+
this.variant = input(this._defaultConfig.variant, ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
171
|
+
this.orientation = input(this._defaultConfig.orientation, ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
172
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: (value) => coerceBooleanAttribute(value) }] : [{ transform: (value) => coerceBooleanAttribute(value) }]));
|
|
173
|
+
// Old fashion output for now, signal outputs cannot be queried as of now for subscribers
|
|
174
|
+
this.click = new EventEmitter();
|
|
175
|
+
this._hasClickHandler = signal(false, ...(ngDevMode ? [{ debugName: "_hasClickHandler" }] : []));
|
|
176
|
+
this._hostClasses = computed(() => this._getHostClasses([
|
|
177
|
+
this.appearance(),
|
|
178
|
+
this.size(),
|
|
179
|
+
this.variant(),
|
|
180
|
+
this.orientation(),
|
|
181
|
+
this.disabled() && this._hasClickHandler() ? 'disabled' : null,
|
|
182
|
+
this._hasClickHandler() ? 'clickable' : null,
|
|
183
|
+
]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
|
|
184
|
+
}
|
|
185
|
+
get _hostName() {
|
|
186
|
+
return 'card';
|
|
187
|
+
}
|
|
188
|
+
ngOnInit() {
|
|
189
|
+
this._hasClickHandler.set(this.click.observed);
|
|
190
|
+
}
|
|
191
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
192
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: IdsCardComponent, isStandalone: true, selector: "ids-card,div[idsCard],article[idsCard],aside[idsCard],section[idsCard]", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, host: { properties: { "attr.aria-disabled": "this.disabled()? \"\" : null", "attr.tabindex": " this._hasClickHandler() ? 0 : null" } }, usesInheritance: true, ngImport: i0, template: `
|
|
193
|
+
<ng-content />
|
|
194
|
+
<ng-content select="ids-card-footer,footer[idsCardFooter]" />
|
|
195
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
196
|
+
}
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCardComponent, decorators: [{
|
|
198
|
+
type: Component,
|
|
199
|
+
args: [{
|
|
200
|
+
selector: 'ids-card,div[idsCard],article[idsCard],aside[idsCard],section[idsCard]',
|
|
201
|
+
imports: [],
|
|
202
|
+
template: `
|
|
203
|
+
<ng-content />
|
|
204
|
+
<ng-content select="ids-card-footer,footer[idsCardFooter]" />
|
|
205
|
+
`,
|
|
206
|
+
encapsulation: ViewEncapsulation.None,
|
|
207
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
208
|
+
host: {
|
|
209
|
+
'[attr.aria-disabled]': 'this.disabled()? "" : null',
|
|
210
|
+
'[attr.tabindex]': ' this._hasClickHandler() ? 0 : null',
|
|
211
|
+
},
|
|
212
|
+
}]
|
|
213
|
+
}], propDecorators: { click: [{
|
|
214
|
+
type: Output
|
|
215
|
+
}] } });
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Generated bundle index. Do not edit.
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
export { IDS_CARD_DEFAULT_CONFIG, IDS_CARD_DEFAULT_CONFIG_FACTORY, IdsCardAppearance, IdsCardBodyDirective, IdsCardComponent, IdsCardFooterDirective, IdsCardHeaderComponent, IdsCardMediaDirective, IdsCardSubtitleDirective, IdsCardTitleDirective, IdsCardVariant };
|
|
222
|
+
//# sourceMappingURL=i-cell-ids-angular-card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-cell-ids-angular-card.mjs","sources":["../../../projects/widgets/card/types/card-appearances.type.ts","../../../projects/widgets/card/types/card-variant.type.ts","../../../projects/widgets/card/card-section-base.directive.ts","../../../projects/widgets/card/card-body.directive.ts","../../../projects/widgets/card/card-defaults.ts","../../../projects/widgets/card/card-footer.directive.ts","../../../projects/widgets/card/card-header.component.ts","../../../projects/widgets/card/card-media.directive.ts","../../../projects/widgets/card/card-subtitle.directive.ts","../../../projects/widgets/card/card-title.directive.ts","../../../projects/widgets/card/card.component.ts","../../../projects/widgets/card/i-cell-ids-angular-card.ts"],"sourcesContent":["export const IdsCardAppearance = {\n FILLED: 'filled',\n OUTLINED: 'outlined',\n ELEVATED: 'elevated',\n} as const;\n\nexport type IdsCardAppearanceType = (typeof IdsCardAppearance)[keyof typeof IdsCardAppearance];\n","export const IdsCardVariant = {\n PRIMARY: 'primary',\n SECONDARY: 'secondary',\n SURFACE: 'surface',\n BRAND: 'brand',\n LIGHT: 'light',\n DARK: 'dark',\n INFO: 'info',\n SUCCESS: 'success',\n WARNING: 'warning',\n ERROR: 'error',\n} as const;\n\nexport type IdsCardVariantType = (typeof IdsCardVariant)[keyof typeof IdsCardVariant];\n\n","import { computed, Directive, input } from '@angular/core';\nimport { DirectiveBase } from '@i-cell/ids-angular/core';\n\n@Directive({\n standalone: false,\n})\nexport abstract class IdsCardSectionBase extends DirectiveBase {\n protected override get _hostName(): string {\n return 'card-section';\n }\n\n public stretch = input(false);\n\n protected _hostClasses = computed(() => this._getHostClasses([this.stretch() ? 'stretched' : 'padded']));\n}\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: 'ids-card-body',\n standalone: true,\n host: {\n class: 'ids-card-body',\n },\n})\nexport class IdsCardBodyDirective extends IdsCardSectionBase {}\n","import { IdsCardAppearance, IdsCardAppearanceType } from './types/card-appearances.type';\nimport { IdsCardVariant, IdsCardVariantType } from './types/card-variant.type';\n\nimport { InjectionToken } from '@angular/core';\nimport { IdsSize, IdsSizeType, IdsOrientationType, IdsOrientation } from '@i-cell/ids-angular/core';\n\nexport interface IdsCardDefaultConfig {\n appearance?: IdsCardAppearanceType,\n size?: IdsSizeType,\n variant?: IdsCardVariantType,\n orientation?: IdsOrientationType,\n}\n\nexport const IDS_CARD_DEFAULT_CONFIG = new InjectionToken<IdsCardDefaultConfig>(\n 'IDS_CARD_DEFAULT_CONFIG',\n {\n providedIn: 'root',\n factory: IDS_CARD_DEFAULT_CONFIG_FACTORY,\n },\n);\n\nexport function IDS_CARD_DEFAULT_CONFIG_FACTORY(): Required<IdsCardDefaultConfig> {\n return {\n appearance: IdsCardAppearance.FILLED,\n size: IdsSize.COMPACT,\n variant: IdsCardVariant.SURFACE,\n orientation: IdsOrientation.VERTICAL,\n };\n}\n\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: 'ids-card-footer,footer[idsCardFooter]',\n standalone: true,\n host: {\n class: 'ids-card-footer',\n },\n})\nexport class IdsCardFooterDirective extends IdsCardSectionBase {}\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'ids-card-header,header[idsCardHeader]',\n imports: [],\n template: `\n <div class=\"ids-card-header-headline\">\n <ng-content select=\"ids-card-title, [idsCardTitle], ids-card-subtitle, [idsCardSubtitle]\" />\n </div>\n <ng-content />\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ids-card-header',\n },\n})\nexport class IdsCardHeaderComponent extends IdsCardSectionBase {}\n","import { IdsCardSectionBase } from './card-section-base.directive';\n\nimport { Directive, input } from '@angular/core';\n\n@Directive({\n selector: '[idsCardMedia]',\n standalone: true,\n host: {\n class: 'ids-card-media',\n },\n})\nexport class IdsCardMediaDirective extends IdsCardSectionBase {\n public override stretch = input(true);\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[idsCardSubtitle]',\n standalone: true,\n host: {\n class: 'ids-card-subtitle',\n },\n})\nexport class IdsCardSubtitleDirective {}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[idsCardTitle]',\n standalone: true,\n host: {\n class: 'ids-card-title',\n },\n})\nexport class IdsCardTitleDirective {}\n","import { IDS_CARD_DEFAULT_CONFIG, IDS_CARD_DEFAULT_CONFIG_FACTORY, IdsCardDefaultConfig } from './card-defaults';\nimport { IdsCardAppearanceType } from './types/card-appearances.type';\nimport { IdsCardVariantType } from './types/card-variant.type';\n\nimport { ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output, ViewEncapsulation, computed, input, signal } from '@angular/core';\nimport { ComponentBaseWithDefaults, IdsOrientationType, IdsSizeType, coerceBooleanAttribute } from '@i-cell/ids-angular/core';\n\nconst defaultConfig = IDS_CARD_DEFAULT_CONFIG_FACTORY();\n\n@Component({\n selector: 'ids-card,div[idsCard],article[idsCard],aside[idsCard],section[idsCard]',\n imports: [],\n template: `\n <ng-content />\n <ng-content select=\"ids-card-footer,footer[idsCardFooter]\" />\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.aria-disabled]': 'this.disabled()? \"\" : null',\n '[attr.tabindex]': ' this._hasClickHandler() ? 0 : null',\n },\n})\nexport class IdsCardComponent extends ComponentBaseWithDefaults<IdsCardDefaultConfig> implements OnInit {\n protected override get _hostName(): string {\n return 'card';\n }\n\n protected readonly _defaultConfig = this._getDefaultConfig(defaultConfig, IDS_CARD_DEFAULT_CONFIG);\n\n public appearance = input<IdsCardAppearanceType>(this._defaultConfig.appearance);\n public size = input<IdsSizeType>(this._defaultConfig.size);\n public variant = input<IdsCardVariantType>(this._defaultConfig.variant);\n public orientation = input<IdsOrientationType>(this._defaultConfig.orientation);\n public disabled = input(false, { transform: (value: boolean | string) => coerceBooleanAttribute(value) });\n\n // Old fashion output for now, signal outputs cannot be queried as of now for subscribers\n @Output()\n // eslint-disable-next-line @angular-eslint/no-output-native\n public click = new EventEmitter();\n\n private _hasClickHandler = signal(false);\n\n protected _hostClasses = computed(() => this._getHostClasses([\n this.appearance(),\n this.size(),\n this.variant(),\n this.orientation(),\n this.disabled() && this._hasClickHandler() ? 'disabled' : null,\n this._hasClickHandler() ? 'clickable' : null,\n ]));\n\n public ngOnInit(): void {\n this._hasClickHandler.set(this.click.observed);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAO,MAAM,iBAAiB,GAAG;AAC/B,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,QAAQ,EAAE,UAAU;;;ACHf,MAAM,cAAc,GAAG;AAC5B,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,KAAK,EAAE,OAAO;;;ACJV,MAAgB,kBAAmB,SAAQ,aAAa,CAAA;AAH9D,IAAA,WAAA,GAAA;;AAQS,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC;QAEnB,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,WAAW,GAAG,QAAQ,CAAC,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CA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,350 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Injector, ChangeDetectorRef, signal, computed, input, model, output, viewChild, contentChildren, ChangeDetectionStrategy, ViewEncapsulation, Component, effect } from '@angular/core';
|
|
3
|
+
import { IdsSize, IdsOrientation, ComponentBaseWithDefaults, coerceBooleanAttribute, coerceNumberAttribute, isString } from '@i-cell/ids-angular/core';
|
|
4
|
+
import { NgControl, Validators, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { IdsHintMessageComponent, IdsErrorMessageComponent, IdsValidators, IDS_FORM_FIELD_CONTROL } from '@i-cell/ids-angular/forms';
|
|
6
|
+
import { IdsIconComponent } from '@i-cell/ids-angular/icon';
|
|
7
|
+
|
|
8
|
+
class IdsCheckBoxChangeEvent {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const IdsCheckboxState = {
|
|
12
|
+
UNCHECKED: 'unchecked',
|
|
13
|
+
CHECKED: 'checked',
|
|
14
|
+
INDETERMINATE: 'indeterminate',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const IdsCheckboxVariant = {
|
|
18
|
+
SURFACE: 'surface',
|
|
19
|
+
LIGHT: 'light',
|
|
20
|
+
DARK: 'dark',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const IDS_CHECKBOX_DEFAULT_CONFIG = new InjectionToken('IDS_CHECKBOX_DEFAULT_CONFIG', {
|
|
24
|
+
providedIn: 'root',
|
|
25
|
+
factory: IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY,
|
|
26
|
+
});
|
|
27
|
+
function IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY() {
|
|
28
|
+
return {
|
|
29
|
+
size: IdsSize.COMPACT,
|
|
30
|
+
variant: IdsCheckboxVariant.SURFACE,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const IDS_CHECKBOX_GROUP_DEFAULT_CONFIG = new InjectionToken('IDS_CHECKBOX_GROUP_DEFAULT_CONFIG', {
|
|
35
|
+
providedIn: 'root',
|
|
36
|
+
factory: IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY,
|
|
37
|
+
});
|
|
38
|
+
function IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY() {
|
|
39
|
+
return {
|
|
40
|
+
...IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY(),
|
|
41
|
+
orientation: IdsOrientation.VERTICAL,
|
|
42
|
+
allowParent: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
47
|
+
const IDS_CHECKBOX_GROUP_CHILD = new InjectionToken('IDS_CHECKBOX_GROUP_CHILD');
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
|
+
const IDS_CHECKBOX_PARENT = new InjectionToken('IDS_CHECKBOX_PARENT');
|
|
51
|
+
|
|
52
|
+
const defaultConfig$1 = IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY();
|
|
53
|
+
class IdsCheckboxComponent extends ComponentBaseWithDefaults {
|
|
54
|
+
constructor() {
|
|
55
|
+
super(...arguments);
|
|
56
|
+
this._injector = inject(Injector);
|
|
57
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
58
|
+
this._defaultConfig = this._getDefaultConfig(defaultConfig$1, IDS_CHECKBOX_DEFAULT_CONFIG);
|
|
59
|
+
this._checkboxGroup = inject(IDS_CHECKBOX_PARENT, { optional: true });
|
|
60
|
+
this._checkboxState = signal(IdsCheckboxState.UNCHECKED, ...(ngDevMode ? [{ debugName: "_checkboxState" }] : []));
|
|
61
|
+
this.checkboxState = this._checkboxState.asReadonly();
|
|
62
|
+
this._inputId = computed(() => `${this.id()}-input`, ...(ngDevMode ? [{ debugName: "_inputId" }] : []));
|
|
63
|
+
this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
|
|
64
|
+
this.required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: coerceBooleanAttribute }] : [{ transform: coerceBooleanAttribute }]));
|
|
65
|
+
this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly", transform: coerceBooleanAttribute }] : [{ transform: coerceBooleanAttribute }]));
|
|
66
|
+
this.size = input(this._defaultConfig.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
67
|
+
this.tabIndex = input(0, ...(ngDevMode ? [{ debugName: "tabIndex", transform: coerceNumberAttribute }] : [{ transform: coerceNumberAttribute }]));
|
|
68
|
+
this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
69
|
+
this.variant = input(this._defaultConfig.variant, ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
70
|
+
this.checked = input(false, ...(ngDevMode ? [{ debugName: "checked", transform: coerceBooleanAttribute }] : [{ transform: coerceBooleanAttribute }]));
|
|
71
|
+
this.indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate", transform: coerceBooleanAttribute }] : [{ transform: coerceBooleanAttribute }]));
|
|
72
|
+
this.ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel", alias: 'aria-label' }] : [{ alias: 'aria-label' }]));
|
|
73
|
+
this.ariaLabelledby = input(null, ...(ngDevMode ? [{ debugName: "ariaLabelledby", alias: 'aria-labelledby' }] : [{ alias: 'aria-labelledby' }]));
|
|
74
|
+
this.ariaDescribedby = input('', ...(ngDevMode ? [{ debugName: "ariaDescribedby", alias: 'aria-describedby' }] : [{ alias: 'aria-describedby' }]));
|
|
75
|
+
this.disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
76
|
+
this._isChecked = computed(() => this._checkboxState() === IdsCheckboxState.CHECKED, ...(ngDevMode ? [{ debugName: "_isChecked" }] : []));
|
|
77
|
+
this._isIndeterminate = computed(() => this._checkboxState() === IdsCheckboxState.INDETERMINATE, ...(ngDevMode ? [{ debugName: "_isIndeterminate" }] : []));
|
|
78
|
+
this._isFocusable = computed(() => !this.disabled() && !this.readonly(), ...(ngDevMode ? [{ debugName: "_isFocusable" }] : []));
|
|
79
|
+
this._hostClasses = computed(() => this._getHostClasses([
|
|
80
|
+
this._parentOrSelfSize(),
|
|
81
|
+
this._parentOrSelfVariant(),
|
|
82
|
+
this.disabled() ? 'disabled' : null,
|
|
83
|
+
]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
|
|
84
|
+
this._nativeValue = computed(() => {
|
|
85
|
+
const value = this.value();
|
|
86
|
+
return isString(value) ? value : undefined;
|
|
87
|
+
}, ...(ngDevMode ? [{ debugName: "_nativeValue" }] : []));
|
|
88
|
+
this._parentOrSelfSize = computed(() => this._checkboxGroup?.size() ?? this.size(), ...(ngDevMode ? [{ debugName: "_parentOrSelfSize" }] : []));
|
|
89
|
+
this._parentOrSelfVariant = computed(() => this._checkboxGroup?.variant() ?? this.variant(), ...(ngDevMode ? [{ debugName: "_parentOrSelfVariant" }] : []));
|
|
90
|
+
this._onChange = () => { };
|
|
91
|
+
this._onTouched = () => { };
|
|
92
|
+
this.controlDir = null;
|
|
93
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
94
|
+
this.change = output();
|
|
95
|
+
this.indeterminateChange = output();
|
|
96
|
+
this._inputElement = viewChild.required('inputEl');
|
|
97
|
+
this._hintMessages = contentChildren(IdsHintMessageComponent, ...(ngDevMode ? [{ debugName: "_hintMessages", descendants: true }] : [{ descendants: true }]));
|
|
98
|
+
this._errorMessages = contentChildren(IdsErrorMessageComponent, ...(ngDevMode ? [{ debugName: "_errorMessages", descendants: true }] : [{ descendants: true }]));
|
|
99
|
+
}
|
|
100
|
+
get _hostName() {
|
|
101
|
+
return 'checkbox';
|
|
102
|
+
}
|
|
103
|
+
ngOnChanges(changes) {
|
|
104
|
+
const checkedChange = changes['checked'];
|
|
105
|
+
const indeterminateChange = changes['indeterminate'];
|
|
106
|
+
if (indeterminateChange || checkedChange) {
|
|
107
|
+
const currentChecked = checkedChange?.currentValue;
|
|
108
|
+
const currentIndeterminate = indeterminateChange?.currentValue;
|
|
109
|
+
if (currentIndeterminate === true) {
|
|
110
|
+
this._checkboxState.set(IdsCheckboxState.INDETERMINATE);
|
|
111
|
+
}
|
|
112
|
+
else if (currentChecked === true) {
|
|
113
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this._checkboxState.set(IdsCheckboxState.UNCHECKED);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
ngOnInit() {
|
|
121
|
+
this.controlDir = this._injector.get(NgControl, null, { self: true, optional: true });
|
|
122
|
+
}
|
|
123
|
+
ngAfterViewInit() {
|
|
124
|
+
if (this.indeterminate !== undefined) {
|
|
125
|
+
this._syncIndeterminate(this.indeterminate());
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
focus() {
|
|
129
|
+
this._inputElement().nativeElement.focus();
|
|
130
|
+
}
|
|
131
|
+
writeValue(value) {
|
|
132
|
+
if (this._isIndeterminate()) {
|
|
133
|
+
this._checkboxState.set(IdsCheckboxState.INDETERMINATE);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
this._checkboxState.set(value ? IdsCheckboxState.CHECKED : IdsCheckboxState.UNCHECKED);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
registerOnChange(fn) {
|
|
140
|
+
this._onChange = fn;
|
|
141
|
+
}
|
|
142
|
+
registerOnTouched(fn) {
|
|
143
|
+
this._onTouched = fn;
|
|
144
|
+
}
|
|
145
|
+
setDisabledState(isDisabled) {
|
|
146
|
+
this.disabled.set(isDisabled);
|
|
147
|
+
}
|
|
148
|
+
_createChangeEvent(isChecked, value) {
|
|
149
|
+
const event = new IdsCheckBoxChangeEvent();
|
|
150
|
+
event.source = this;
|
|
151
|
+
event.checked = isChecked;
|
|
152
|
+
event.value = value;
|
|
153
|
+
return event;
|
|
154
|
+
}
|
|
155
|
+
_emitChangeEvent() {
|
|
156
|
+
this._onChange(this._isChecked());
|
|
157
|
+
this.change.emit(this._createChangeEvent(this._isChecked(), this.value()));
|
|
158
|
+
this._syncChecked(this._isChecked());
|
|
159
|
+
}
|
|
160
|
+
toggle() {
|
|
161
|
+
if (this._isIndeterminate()) {
|
|
162
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
this._checkboxState.set(this._checkboxState() === IdsCheckboxState.CHECKED ? IdsCheckboxState.UNCHECKED : IdsCheckboxState.CHECKED);
|
|
166
|
+
}
|
|
167
|
+
this._onChange(this._isChecked());
|
|
168
|
+
}
|
|
169
|
+
select() {
|
|
170
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
171
|
+
this._onChange(this._isChecked());
|
|
172
|
+
}
|
|
173
|
+
deselect() {
|
|
174
|
+
this._checkboxState.set(IdsCheckboxState.UNCHECKED);
|
|
175
|
+
this._onChange(this._isChecked());
|
|
176
|
+
}
|
|
177
|
+
_handleInputClick() {
|
|
178
|
+
if (this._isIndeterminate()) {
|
|
179
|
+
this._checkboxState.set(IdsCheckboxState.CHECKED);
|
|
180
|
+
this.indeterminateChange.emit(this._isIndeterminate());
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this._checkboxState.set(this._checkboxState() === IdsCheckboxState.CHECKED ? IdsCheckboxState.UNCHECKED : IdsCheckboxState.CHECKED);
|
|
184
|
+
}
|
|
185
|
+
this._emitChangeEvent();
|
|
186
|
+
this._syncIndeterminate(this._isIndeterminate());
|
|
187
|
+
}
|
|
188
|
+
onBlur() {
|
|
189
|
+
Promise.resolve().then(() => {
|
|
190
|
+
this._onTouched();
|
|
191
|
+
this._changeDetectorRef.markForCheck();
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
_syncChecked(value) {
|
|
195
|
+
const nativeCheckbox = this._inputElement();
|
|
196
|
+
nativeCheckbox.nativeElement.checked = value;
|
|
197
|
+
}
|
|
198
|
+
_syncIndeterminate(value) {
|
|
199
|
+
const nativeCheckbox = this._inputElement();
|
|
200
|
+
nativeCheckbox.nativeElement.indeterminate = value;
|
|
201
|
+
}
|
|
202
|
+
onInputClick() {
|
|
203
|
+
if (!this.readonly() && !this.disabled()) {
|
|
204
|
+
this._handleInputClick();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
onTouchTargetClick() {
|
|
208
|
+
if (!this.readonly() && !this.disabled()) {
|
|
209
|
+
this._handleInputClick();
|
|
210
|
+
}
|
|
211
|
+
if (!this.disabled()) {
|
|
212
|
+
this._inputElement().nativeElement.focus();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
get displayedMessages() {
|
|
216
|
+
if (this._errorMessages().length > 0 && this.controlDir?.errors) {
|
|
217
|
+
return 'error';
|
|
218
|
+
}
|
|
219
|
+
if (this._hintMessages().length > 0) {
|
|
220
|
+
return 'hint';
|
|
221
|
+
}
|
|
222
|
+
return undefined;
|
|
223
|
+
}
|
|
224
|
+
get _hasRequiredValidator() {
|
|
225
|
+
const control = this.controlDir?.control;
|
|
226
|
+
const attrRequired = this.required();
|
|
227
|
+
if (!control) {
|
|
228
|
+
return attrRequired;
|
|
229
|
+
}
|
|
230
|
+
return attrRequired
|
|
231
|
+
|| control.hasValidator(Validators.required)
|
|
232
|
+
|| control.hasValidator(Validators.requiredTrue)
|
|
233
|
+
|| control.hasValidator(IdsValidators.required)
|
|
234
|
+
|| control.hasValidator(IdsValidators.requiredTrue)
|
|
235
|
+
|| control.hasValidator(IdsValidators.requiredFalse);
|
|
236
|
+
}
|
|
237
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
238
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsCheckboxComponent, isStandalone: true, selector: "ids-checkbox", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", change: "change", indeterminateChange: "indeterminateChange" }, host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null" } }, providers: [
|
|
239
|
+
{
|
|
240
|
+
provide: NG_VALUE_ACCESSOR,
|
|
241
|
+
useExisting: IdsCheckboxComponent,
|
|
242
|
+
multi: true,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
provide: IDS_FORM_FIELD_CONTROL,
|
|
246
|
+
useExisting: IdsCheckboxComponent,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
provide: IDS_CHECKBOX_GROUP_CHILD,
|
|
250
|
+
useExisting: IdsCheckboxComponent,
|
|
251
|
+
},
|
|
252
|
+
], queries: [{ propertyName: "_hintMessages", predicate: IdsHintMessageComponent, descendants: true, isSignal: true }, { propertyName: "_errorMessages", predicate: IdsErrorMessageComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"ids-checkbox__input-wrapper\">\n <div class=\"ids-checkbox__touch-target\" (click)=\"onTouchTargetClick()\"></div>\n <input\n #inputEl\n type=\"checkbox\"\n [class.ids-checkbox--selected]=\"_isChecked()\"\n [id]=\"_inputId()\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"_isIndeterminate() ? 'mixed' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [checked]=\"_isChecked()\"\n [indeterminate]=\"_isIndeterminate()\"\n [name]=\"name()\"\n [required]=\"required()\"\n [tabIndex]=\"!_isFocusable() ? -1 : tabIndex()\"\n [value]=\"_nativeValue()\"\n (blur)=\"onBlur()\"\n (click)=\"onInputClick()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-checkbox__icon\" aria-hidden=\"true\">\n @if (_isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (_isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n\n<div class=\"ids-checkbox__label-wrapper\">\n <div class=\"ids-checkbox__label-container\">\n <label class=\"ids-checkbox__label\" [for]=\"_inputId()\">\n <ng-content />\n @if (_hasRequiredValidator) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n </label>\n </div>\n @let messages = displayedMessages;\n @if (messages) {\n <div class=\"ids-checkbox__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
253
|
+
}
|
|
254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCheckboxComponent, decorators: [{
|
|
255
|
+
type: Component,
|
|
256
|
+
args: [{ selector: 'ids-checkbox', imports: [IdsIconComponent], providers: [
|
|
257
|
+
{
|
|
258
|
+
provide: NG_VALUE_ACCESSOR,
|
|
259
|
+
useExisting: IdsCheckboxComponent,
|
|
260
|
+
multi: true,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
provide: IDS_FORM_FIELD_CONTROL,
|
|
264
|
+
useExisting: IdsCheckboxComponent,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
provide: IDS_CHECKBOX_GROUP_CHILD,
|
|
268
|
+
useExisting: IdsCheckboxComponent,
|
|
269
|
+
},
|
|
270
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
271
|
+
'[attr.aria-label]': 'null',
|
|
272
|
+
'[attr.aria-labelledby]': 'null',
|
|
273
|
+
}, template: "<div class=\"ids-checkbox__input-wrapper\">\n <div class=\"ids-checkbox__touch-target\" (click)=\"onTouchTargetClick()\"></div>\n <input\n #inputEl\n type=\"checkbox\"\n [class.ids-checkbox--selected]=\"_isChecked()\"\n [id]=\"_inputId()\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"_isIndeterminate() ? 'mixed' : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [checked]=\"_isChecked()\"\n [indeterminate]=\"_isIndeterminate()\"\n [name]=\"name()\"\n [required]=\"required()\"\n [tabIndex]=\"!_isFocusable() ? -1 : tabIndex()\"\n [value]=\"_nativeValue()\"\n (blur)=\"onBlur()\"\n (click)=\"onInputClick()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-checkbox__icon\" aria-hidden=\"true\">\n @if (_isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (_isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n\n<div class=\"ids-checkbox__label-wrapper\">\n <div class=\"ids-checkbox__label-container\">\n <label class=\"ids-checkbox__label\" [for]=\"_inputId()\">\n <ng-content />\n @if (_hasRequiredValidator) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n </label>\n </div>\n @let messages = displayedMessages;\n @if (messages) {\n <div class=\"ids-checkbox__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n" }]
|
|
274
|
+
}] });
|
|
275
|
+
|
|
276
|
+
const defaultConfig = IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY();
|
|
277
|
+
class IdsCheckboxGroupComponent extends ComponentBaseWithDefaults {
|
|
278
|
+
constructor() {
|
|
279
|
+
super(...arguments);
|
|
280
|
+
this._defaultConfig = this._getDefaultConfig(defaultConfig, IDS_CHECKBOX_GROUP_DEFAULT_CONFIG);
|
|
281
|
+
this._childCheckboxes = contentChildren(IDS_CHECKBOX_GROUP_CHILD, ...(ngDevMode ? [{ debugName: "_childCheckboxes" }] : []));
|
|
282
|
+
this.groupLabel = input('', ...(ngDevMode ? [{ debugName: "groupLabel", alias: 'label' }] : [{ alias: 'label' }]));
|
|
283
|
+
this.allowParent = input(this._defaultConfig.allowParent, ...(ngDevMode ? [{ debugName: "allowParent" }] : []));
|
|
284
|
+
this.parentCheckboxLabel = input('', ...(ngDevMode ? [{ debugName: "parentCheckboxLabel", alias: 'parentLabel' }] : [{ alias: 'parentLabel' }]));
|
|
285
|
+
this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
|
|
286
|
+
this.size = input(this._defaultConfig.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
287
|
+
this.variant = input(this._defaultConfig.variant, ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
288
|
+
this.orientation = input(this._defaultConfig.orientation, ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
289
|
+
this._groupLabelId = computed(() => `${this.id()}-label`, ...(ngDevMode ? [{ debugName: "_groupLabelId" }] : []));
|
|
290
|
+
this._hostClasses = computed(() => this._getHostClasses([
|
|
291
|
+
this.size(),
|
|
292
|
+
this.variant(),
|
|
293
|
+
this.orientation(),
|
|
294
|
+
]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
|
|
295
|
+
this._parentCheckboxChecked = computed(() => this._childCheckboxes().every((child) => child.checkboxState() === IdsCheckboxState.CHECKED), ...(ngDevMode ? [{ debugName: "_parentCheckboxChecked" }] : []));
|
|
296
|
+
this._parentCheckboxIndeterminate = computed(() => !this._parentCheckboxChecked() && this._childCheckboxes().some((child) => child.checkboxState() === IdsCheckboxState.CHECKED), ...(ngDevMode ? [{ debugName: "_parentCheckboxIndeterminate" }] : []));
|
|
297
|
+
this._invalidParentOrientation = effect(() => {
|
|
298
|
+
if (this.allowParent() && this.orientation() === IdsOrientation.HORIZONTAL) {
|
|
299
|
+
throw this._createHostError('Parent checkbox can be used only in vertical orientation');
|
|
300
|
+
}
|
|
301
|
+
}, ...(ngDevMode ? [{ debugName: "_invalidParentOrientation" }] : []));
|
|
302
|
+
}
|
|
303
|
+
get _hostName() {
|
|
304
|
+
return 'checkbox-group';
|
|
305
|
+
}
|
|
306
|
+
selectAllChild() {
|
|
307
|
+
this._childCheckboxes().forEach((child) => {
|
|
308
|
+
child.select();
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
deselectAllChild() {
|
|
312
|
+
this._childCheckboxes().forEach((child) => {
|
|
313
|
+
child.deselect();
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
_handleParentChange(event) {
|
|
317
|
+
if (event.checked) {
|
|
318
|
+
this.selectAllChild();
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
this.deselectAllChild();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCheckboxGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
325
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsCheckboxGroupComponent, isStandalone: true, selector: "ids-checkbox-group", inputs: { groupLabel: { classPropertyName: "groupLabel", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, allowParent: { classPropertyName: "allowParent", publicName: "allowParent", isSignal: true, isRequired: false, transformFunction: null }, parentCheckboxLabel: { classPropertyName: "parentCheckboxLabel", publicName: "parentLabel", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "_groupLabelId()" } }, providers: [
|
|
326
|
+
{
|
|
327
|
+
provide: IDS_CHECKBOX_PARENT,
|
|
328
|
+
useExisting: IdsCheckboxGroupComponent,
|
|
329
|
+
},
|
|
330
|
+
], queries: [{ propertyName: "_childCheckboxes", predicate: IDS_CHECKBOX_GROUP_CHILD, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label class=\"ids-checkbox-group__label\" [for]=\"id()\" [id]=\"_groupLabelId()\">{{ groupLabel() }}</label>\n\n@if (allowParent()) {\n <ids-checkbox\n [checked]=\"_parentCheckboxChecked()\"\n [indeterminate]=\"_parentCheckboxIndeterminate()\"\n (change)=\"_handleParentChange($event)\"\n >{{ parentCheckboxLabel() }}</ids-checkbox\n >\n}\n\n<div class=\"ids-checkbox-group__list\">\n <ng-content select=\"ids-checkbox\" />\n</div>\n", dependencies: [{ kind: "component", type: IdsCheckboxComponent, selector: "ids-checkbox", inputs: ["name", "required", "readonly", "size", "tabIndex", "value", "variant", "checked", "indeterminate", "aria-label", "aria-labelledby", "aria-describedby", "disabled"], outputs: ["disabledChange", "change", "indeterminateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
331
|
+
}
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsCheckboxGroupComponent, decorators: [{
|
|
333
|
+
type: Component,
|
|
334
|
+
args: [{ selector: 'ids-checkbox-group', imports: [IdsCheckboxComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
335
|
+
'role': 'group',
|
|
336
|
+
'[attr.aria-labelledby]': '_groupLabelId()',
|
|
337
|
+
}, providers: [
|
|
338
|
+
{
|
|
339
|
+
provide: IDS_CHECKBOX_PARENT,
|
|
340
|
+
useExisting: IdsCheckboxGroupComponent,
|
|
341
|
+
},
|
|
342
|
+
], template: "<label class=\"ids-checkbox-group__label\" [for]=\"id()\" [id]=\"_groupLabelId()\">{{ groupLabel() }}</label>\n\n@if (allowParent()) {\n <ids-checkbox\n [checked]=\"_parentCheckboxChecked()\"\n [indeterminate]=\"_parentCheckboxIndeterminate()\"\n (change)=\"_handleParentChange($event)\"\n >{{ parentCheckboxLabel() }}</ids-checkbox\n >\n}\n\n<div class=\"ids-checkbox-group__list\">\n <ng-content select=\"ids-checkbox\" />\n</div>\n" }]
|
|
343
|
+
}] });
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Generated bundle index. Do not edit.
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
export { IDS_CHECKBOX_DEFAULT_CONFIG, IDS_CHECKBOX_DEFAULT_CONFIG_FACTORY, IDS_CHECKBOX_GROUP_DEFAULT_CONFIG, IDS_CHECKBOX_GROUP_DEFAULT_CONFIG_FACTORY, IdsCheckBoxChangeEvent, IdsCheckboxComponent, IdsCheckboxGroupComponent, IdsCheckboxState, IdsCheckboxVariant };
|
|
350
|
+
//# sourceMappingURL=i-cell-ids-angular-checkbox.mjs.map
|