@daffodil/design 0.89.0 → 0.91.0
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 +1 -0
- package/accordion/index.d.ts +8 -5
- package/article/README.md +1 -1
- package/article/index.d.ts +20 -0
- package/article/src/article-theme.scss +10 -0
- package/button/index.d.ts +4 -4
- package/button/src/button/button-base.scss +3 -3
- package/button/src/button/raised/raised-theme.scss +6 -16
- package/card/README.md +0 -8
- package/card/index.d.ts +7 -41
- package/card/src/card-base-theme.scss +2 -5
- package/card/src/card-base.scss +2 -2
- package/checkbox/README.md +0 -0
- package/checkbox/index.d.ts +177 -0
- package/fesm2022/daffodil-design-accordion.mjs +23 -14
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +129 -5
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +24 -20
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +16 -63
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +317 -0
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -0
- package/fesm2022/daffodil-design-form-field.mjs +55 -162
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +62 -0
- package/fesm2022/daffodil-design-form.mjs.map +1 -0
- package/fesm2022/daffodil-design-image.mjs +12 -4
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +55 -56
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +14 -50
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +6 -11
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +3 -5
- package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +304 -0
- package/fesm2022/daffodil-design-radio.mjs.map +1 -0
- package/fesm2022/daffodil-design-select.mjs +2 -2
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +6 -36
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +48 -105
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +22 -14
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +131 -0
- package/fesm2022/daffodil-design-tag.mjs.map +1 -0
- package/fesm2022/daffodil-design-toast.mjs +56 -55
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +4 -13
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +250 -774
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form/README.md +75 -0
- package/form/index.d.ts +27 -0
- package/form-field/README.md +49 -39
- package/form-field/index.d.ts +58 -76
- package/image/README.md +27 -19
- package/image/index.d.ts +6 -1
- package/index.d.ts +180 -424
- package/input/README.md +32 -12
- package/modal/README.md +106 -16
- package/modal/index.d.ts +50 -21
- package/native-select/README.md +52 -15
- package/notification/index.d.ts +7 -38
- package/package.json +1 -1
- package/paginator/index.d.ts +1 -7
- package/radio/README.md +52 -0
- package/radio/index.d.ts +160 -0
- package/scss/core/error/error-to-string.scss +6 -6
- package/scss/core/map/map-get/map-get.scss +3 -3
- package/scss/layout/_breakpoint.scss +1 -1
- package/scss/theme.scss +4 -4
- package/scss/theming/_color-palettes.scss +21 -7
- package/scss/theming/_configure-theme.scss +11 -10
- package/scss/theming/_daff-theme.scss +5 -14
- package/scss/theming/_get-base-color.scss +2 -2
- package/scss/theming/_get-palette.scss +2 -2
- package/scss/theming/_get-theme-mode.scss +3 -3
- package/scss/theming/_index.scss +2 -1
- package/scss/theming/contrast/_index.scss +1 -0
- package/scss/theming/contrast/max-contrast/max-contrast.scss +47 -0
- package/scss/theming/contrast/max-contrast/max-contrast.spec.scss +57 -0
- package/scss/theming/contrast/text-contrast/text-contrast.scss +22 -16
- package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +57 -0
- package/scss/theming/create-theme/_create-theme.scss +330 -0
- package/scss/theming/create-theme/_create-theme.spec.scss +122 -0
- package/scss/theming/create-theme/_index.scss +1 -0
- package/scss/theming/get-font-colors/_get-font-colors.scss +36 -0
- package/scss/theming/get-font-colors/_get-font-colors.spec.scss +72 -0
- package/scss/typography/mixins/_font-weight.scss +8 -14
- package/select/README.md +107 -4
- package/sidebar/README.md +0 -8
- package/sidebar/index.d.ts +3 -15
- package/switch/README.md +19 -27
- package/switch/index.d.ts +18 -48
- package/switch/src/switch-theme.scss +26 -18
- package/tabs/index.d.ts +7 -4
- package/tag/README.md +87 -0
- package/tag/index.d.ts +71 -0
- package/tag/src/tag-theme.scss +137 -0
- package/textarea/README.md +35 -5
- package/tree/index.d.ts +0 -6
- package/tree/src/tree-theme.scss +0 -4
- package/accordion/examples/index.d.ts +0 -20
- package/article/examples/index.d.ts +0 -50
- package/breadcrumb/examples/index.d.ts +0 -10
- package/button/examples/index.d.ts +0 -67
- package/callout/examples/index.d.ts +0 -41
- package/card/examples/index.d.ts +0 -62
- package/card/src/card/raised/raised-theme.scss +0 -28
- package/checkbox/examples/index.d.ts +0 -32
- package/container/examples/index.d.ts +0 -16
- package/fesm2022/daffodil-design-accordion-examples.mjs +0 -50
- package/fesm2022/daffodil-design-accordion-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-article-examples.mjs +0 -134
- package/fesm2022/daffodil-design-article-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs +0 -46
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-button-examples.mjs +0 -178
- package/fesm2022/daffodil-design-button-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-callout-examples.mjs +0 -116
- package/fesm2022/daffodil-design-callout-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-card-examples.mjs +0 -168
- package/fesm2022/daffodil-design-card-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-checkbox-examples.mjs +0 -76
- package/fesm2022/daffodil-design-checkbox-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-container-examples.mjs +0 -41
- package/fesm2022/daffodil-design-container-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-form-field-examples.mjs +0 -96
- package/fesm2022/daffodil-design-form-field-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-hero-examples.mjs +0 -121
- package/fesm2022/daffodil-design-hero-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-image-examples.mjs +0 -58
- package/fesm2022/daffodil-design-image-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-input-examples.mjs +0 -108
- package/fesm2022/daffodil-design-input-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-list-examples.mjs +0 -77
- package/fesm2022/daffodil-design-list-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-loading-icon-examples.mjs +0 -44
- package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-media-gallery-examples.mjs +0 -104
- package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-menu-examples.mjs +0 -50
- package/fesm2022/daffodil-design-menu-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-modal-examples.mjs +0 -51
- package/fesm2022/daffodil-design-modal-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-native-select-examples.mjs +0 -71
- package/fesm2022/daffodil-design-native-select-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-navbar-examples.mjs +0 -88
- package/fesm2022/daffodil-design-navbar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-notification-examples.mjs +0 -102
- package/fesm2022/daffodil-design-notification-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-paginator-examples.mjs +0 -59
- package/fesm2022/daffodil-design-paginator-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +0 -57
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +0 -85
- package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-radio-examples.mjs +0 -31
- package/fesm2022/daffodil-design-radio-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-select-examples.mjs +0 -117
- package/fesm2022/daffodil-design-select-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-sidebar-examples.mjs +0 -109
- package/fesm2022/daffodil-design-sidebar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-sticky-examples.mjs +0 -25
- package/fesm2022/daffodil-design-sticky-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-switch-examples.mjs +0 -110
- package/fesm2022/daffodil-design-switch-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tabs-examples.mjs +0 -115
- package/fesm2022/daffodil-design-tabs-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-text-snippet-examples.mjs +0 -25
- package/fesm2022/daffodil-design-text-snippet-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-textarea-examples.mjs +0 -66
- package/fesm2022/daffodil-design-textarea-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-toast-examples.mjs +0 -147
- package/fesm2022/daffodil-design-toast-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tree-examples.mjs +0 -104
- package/fesm2022/daffodil-design-tree-examples.mjs.map +0 -1
- package/form-field/examples/index.d.ts +0 -18
- package/hero/examples/index.d.ts +0 -45
- package/image/examples/index.d.ts +0 -10
- package/input/examples/index.d.ts +0 -10
- package/list/examples/index.d.ts +0 -29
- package/loading-icon/examples/index.d.ts +0 -16
- package/media-gallery/examples/index.d.ts +0 -38
- package/menu/examples/index.d.ts +0 -20
- package/modal/examples/index.d.ts +0 -15
- package/native-select/examples/index.d.ts +0 -10
- package/navbar/examples/index.d.ts +0 -31
- package/notification/examples/index.d.ts +0 -12
- package/paginator/examples/index.d.ts +0 -26
- package/progress-bar/examples/index.d.ts +0 -10
- package/quantity-field/examples/index.d.ts +0 -30
- package/radio/examples/index.d.ts +0 -13
- package/select/examples/index.d.ts +0 -28
- package/sidebar/examples/index.d.ts +0 -10
- package/sticky/examples/index.d.ts +0 -10
- package/switch/examples/index.d.ts +0 -46
- package/tabs/examples/index.d.ts +0 -12
- package/text-snippet/examples/index.d.ts +0 -10
- package/textarea/examples/index.d.ts +0 -10
- package/toast/examples/index.d.ts +0 -56
- package/tree/examples/index.d.ts +0 -18
- /package/{form-field → form}/src/error-message/error-message-theme.scss +0 -0
- /package/{form-field → form}/src/hint/hint-theme.scss +0 -0
|
@@ -1,630 +1,11 @@
|
|
|
1
|
-
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import * as i1 from '@angular/forms';
|
|
2
|
+
import { HostBinding, Directive, NgModule, isDevMode, Input, Injectable, InjectionToken, inject, PLATFORM_ID, DOCUMENT, Inject, makeEnvironmentProviders, provideAppInitializer, EventEmitter, Output, afterNextRender } from '@angular/core';
|
|
5
3
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
4
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
6
5
|
import { of, fromEventPattern, Subject, merge, fromEvent, EMPTY, combineLatest } from 'rxjs';
|
|
7
6
|
import { startWith, map, catchError, filter, shareReplay } from 'rxjs/operators';
|
|
8
7
|
import { DaffServerSafePersistenceServiceToken } from '@daffodil/core';
|
|
9
8
|
|
|
10
|
-
class DaffErrorStateMatcher {
|
|
11
|
-
isErrorState(control, formSubmitted) {
|
|
12
|
-
return control.errors && (control.touched || formSubmitted);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let checkboxIdNum = 0;
|
|
17
|
-
class DaffCheckboxComponent {
|
|
18
|
-
get checked() {
|
|
19
|
-
return this._checked;
|
|
20
|
-
}
|
|
21
|
-
set checked(value) {
|
|
22
|
-
if (this._checked === value) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (value === true) {
|
|
26
|
-
this.nativeCheckbox.nativeElement.checked = true;
|
|
27
|
-
this.becameChecked.emit(this._checked);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
this.nativeCheckbox.nativeElement.checked = false;
|
|
31
|
-
this.becameUnchecked.emit();
|
|
32
|
-
}
|
|
33
|
-
this._checked = value;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @docs-private
|
|
37
|
-
*/
|
|
38
|
-
_onChange(val) {
|
|
39
|
-
if (val.target.checked) {
|
|
40
|
-
this.select();
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this.deselect();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
;
|
|
47
|
-
/**
|
|
48
|
-
* @docs-private
|
|
49
|
-
*/
|
|
50
|
-
get focusClass() {
|
|
51
|
-
return this.focused === true;
|
|
52
|
-
}
|
|
53
|
-
;
|
|
54
|
-
/**
|
|
55
|
-
* @docs-private
|
|
56
|
-
*/
|
|
57
|
-
get disabledClass() {
|
|
58
|
-
return this.disabled === true;
|
|
59
|
-
}
|
|
60
|
-
;
|
|
61
|
-
/**
|
|
62
|
-
* Sets focused to false.
|
|
63
|
-
*/
|
|
64
|
-
onBlur() {
|
|
65
|
-
this.focused = false;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Sets focused to true.
|
|
69
|
-
*/
|
|
70
|
-
onFocus() {
|
|
71
|
-
this.focused = true;
|
|
72
|
-
}
|
|
73
|
-
constructor(_cdRef) {
|
|
74
|
-
this._cdRef = _cdRef;
|
|
75
|
-
/**
|
|
76
|
-
* Boolean value to determine whether or not the checkbox is checked.
|
|
77
|
-
*/
|
|
78
|
-
this._checked = false;
|
|
79
|
-
/**
|
|
80
|
-
* The id of the checkbox. Must be unique. If not entered by a user then it is generated.
|
|
81
|
-
*/
|
|
82
|
-
this.id = 'daff-checkbox-' + checkboxIdNum;
|
|
83
|
-
/**
|
|
84
|
-
* The aria-label of the checkbox.
|
|
85
|
-
*/
|
|
86
|
-
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
87
|
-
this.label = '';
|
|
88
|
-
/**
|
|
89
|
-
* Event on whether or not the selection has changed.
|
|
90
|
-
*/
|
|
91
|
-
this.becameChecked = new EventEmitter();
|
|
92
|
-
this.becameUnchecked = new EventEmitter();
|
|
93
|
-
/**
|
|
94
|
-
* The role of the component. Set to "checkbox".
|
|
95
|
-
*
|
|
96
|
-
* @docs-private
|
|
97
|
-
*/
|
|
98
|
-
this.role = 'checkbox';
|
|
99
|
-
/**
|
|
100
|
-
* Increments id number on new checkbox. Gurantees unique ID on generation.
|
|
101
|
-
*/
|
|
102
|
-
checkboxIdNum++;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Sets checked to true.
|
|
106
|
-
*/
|
|
107
|
-
select() {
|
|
108
|
-
this.checked = true;
|
|
109
|
-
this._cdRef.markForCheck();
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Sets checked to false
|
|
113
|
-
*/
|
|
114
|
-
deselect() {
|
|
115
|
-
this.checked = false;
|
|
116
|
-
this._cdRef.markForCheck();
|
|
117
|
-
}
|
|
118
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
119
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffCheckboxComponent, isStandalone: false, selector: "daff-checkbox", inputs: { name: "name", value: "value", checked: "checked", id: "id", label: ["aria-label", "label"], labeledBy: ["aria-labelledby", "labeledBy"] }, outputs: { becameChecked: "becameChecked", becameUnchecked: "becameUnchecked" }, host: { properties: { "attr.role": "this.role", "class.focused": "this.focusClass", "class.disabled": "this.disabledClass" } }, viewQueries: [{ propertyName: "nativeCheckbox", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<input #inputElement\ntype=\"checkbox\"\n[attr.aria-label]=\"label\"\n[attr.aria-labelledby]=\"labeledBy\"\n[attr.checked]=\"checked ? '' : null\"\n[attr.id] = \"id\"\n[attr.value]=\"value\"\n[attr.name]=\"name\"\n[attr.disabled] = \"disabled ? '' : null\" \n(change)=\"_onChange($event)\"\n(blur)=\"onBlur()\"\n(focus)=\"onFocus()\"\n/>\n<label [attr.for]=\"id\"><ng-content></ng-content></label>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
120
|
-
}
|
|
121
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxComponent, decorators: [{
|
|
122
|
-
type: Component,
|
|
123
|
-
args: [{ selector: 'daff-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<input #inputElement\ntype=\"checkbox\"\n[attr.aria-label]=\"label\"\n[attr.aria-labelledby]=\"labeledBy\"\n[attr.checked]=\"checked ? '' : null\"\n[attr.id] = \"id\"\n[attr.value]=\"value\"\n[attr.name]=\"name\"\n[attr.disabled] = \"disabled ? '' : null\" \n(change)=\"_onChange($event)\"\n(blur)=\"onBlur()\"\n(focus)=\"onFocus()\"\n/>\n<label [attr.for]=\"id\"><ng-content></ng-content></label>" }]
|
|
124
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { nativeCheckbox: [{
|
|
125
|
-
type: ViewChild,
|
|
126
|
-
args: ['inputElement', { static: true, read: ElementRef }]
|
|
127
|
-
}], name: [{
|
|
128
|
-
type: Input
|
|
129
|
-
}], value: [{
|
|
130
|
-
type: Input
|
|
131
|
-
}], checked: [{
|
|
132
|
-
type: Input
|
|
133
|
-
}], id: [{
|
|
134
|
-
type: Input
|
|
135
|
-
}], label: [{
|
|
136
|
-
type: Input,
|
|
137
|
-
args: ['aria-label']
|
|
138
|
-
}], labeledBy: [{
|
|
139
|
-
type: Input,
|
|
140
|
-
args: ['aria-labelledby']
|
|
141
|
-
}], becameChecked: [{
|
|
142
|
-
type: Output
|
|
143
|
-
}], becameUnchecked: [{
|
|
144
|
-
type: Output
|
|
145
|
-
}], role: [{
|
|
146
|
-
type: HostBinding,
|
|
147
|
-
args: ['attr.role']
|
|
148
|
-
}], focusClass: [{
|
|
149
|
-
type: HostBinding,
|
|
150
|
-
args: ['class.focused']
|
|
151
|
-
}], disabledClass: [{
|
|
152
|
-
type: HostBinding,
|
|
153
|
-
args: ['class.disabled']
|
|
154
|
-
}] } });
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* A directive for binding the DaffCheckboxComponent and the Control Value Accessor.
|
|
158
|
-
*/
|
|
159
|
-
class DaffCheckboxControlValueAccessorDirective {
|
|
160
|
-
constructor(_control, _checkbox) {
|
|
161
|
-
this._control = _control;
|
|
162
|
-
this._checkbox = _checkbox;
|
|
163
|
-
if (this._control != null) {
|
|
164
|
-
this._control.valueAccessor = this;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* A lifecycle method called when the directive is initialized.
|
|
169
|
-
*/
|
|
170
|
-
/**
|
|
171
|
-
* @docs-private
|
|
172
|
-
*/
|
|
173
|
-
ngOnInit() {
|
|
174
|
-
// See the note about `writeValue` usage.
|
|
175
|
-
this.writeValue(this._control.value);
|
|
176
|
-
// Watch for user events on the component to update the state
|
|
177
|
-
this._checkbox.becameChecked.subscribe(() => {
|
|
178
|
-
this._onChange(true);
|
|
179
|
-
});
|
|
180
|
-
this._checkbox.becameUnchecked.subscribe(() => {
|
|
181
|
-
this._onChange(false);
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* writes a new value down into the component.
|
|
186
|
-
*/
|
|
187
|
-
writeValue(value) {
|
|
188
|
-
value = !!value;
|
|
189
|
-
if (value === true) {
|
|
190
|
-
this.fireSelect();
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
this.fireDeselect();
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Registers the change handler
|
|
198
|
-
*/
|
|
199
|
-
registerOnChange(fn) {
|
|
200
|
-
this._onChange = (val) => {
|
|
201
|
-
fn(val);
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Registers the touched handler
|
|
206
|
-
*/
|
|
207
|
-
registerOnTouched(fn) {
|
|
208
|
-
this._onTouched = fn;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Sets the disabled state.
|
|
212
|
-
*/
|
|
213
|
-
setDisabledState(isDisabled) {
|
|
214
|
-
this._checkbox.disabled = isDisabled;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* calls the child checkbox's select function
|
|
218
|
-
*/
|
|
219
|
-
fireSelect() {
|
|
220
|
-
this._checkbox.select();
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* calls the child checkbox's deselect function
|
|
224
|
-
*/
|
|
225
|
-
fireDeselect() {
|
|
226
|
-
this._checkbox.deselect();
|
|
227
|
-
}
|
|
228
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxControlValueAccessorDirective, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: DaffCheckboxComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
229
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffCheckboxControlValueAccessorDirective, isStandalone: false, selector: "daff-checkbox[ngModel], daff-checkbox[formControl], daff-checkbox[formControlName]", inputs: { value: "value", name: "name" }, ngImport: i0 }); }
|
|
230
|
-
}
|
|
231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxControlValueAccessorDirective, decorators: [{
|
|
232
|
-
type: Directive,
|
|
233
|
-
args: [{
|
|
234
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
235
|
-
selector: 'daff-checkbox[ngModel], daff-checkbox[formControl], daff-checkbox[formControlName]',
|
|
236
|
-
standalone: false,
|
|
237
|
-
}]
|
|
238
|
-
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
239
|
-
type: Optional
|
|
240
|
-
}, {
|
|
241
|
-
type: Self
|
|
242
|
-
}] }, { type: DaffCheckboxComponent }], propDecorators: { value: [{
|
|
243
|
-
type: Input
|
|
244
|
-
}], name: [{
|
|
245
|
-
type: Input
|
|
246
|
-
}] } });
|
|
247
|
-
|
|
248
|
-
class DaffCheckboxSetComponent {
|
|
249
|
-
constructor() {
|
|
250
|
-
/**
|
|
251
|
-
* The role of the component. Set to "checkbox".
|
|
252
|
-
*
|
|
253
|
-
* @docs-private
|
|
254
|
-
*/
|
|
255
|
-
this.role = 'group';
|
|
256
|
-
this.valueList = new EventEmitter();
|
|
257
|
-
}
|
|
258
|
-
getValues() {
|
|
259
|
-
const checkboxes = this.checkboxes.toArray();
|
|
260
|
-
return this.formArray.value.map((element, index) => element === true ? checkboxes[index].value : false).filter(element => element !== false);
|
|
261
|
-
}
|
|
262
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxSetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
263
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffCheckboxSetComponent, isStandalone: false, selector: "daff-checkbox-set", inputs: { formArray: "formArray", name: "name" }, outputs: { valueList: "valueList" }, host: { properties: { "attr.role": "this.role" } }, queries: [{ propertyName: "checkboxes", predicate: DaffCheckboxComponent }], ngImport: i0, template: "<ng-content></ng-content>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
264
|
-
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxSetComponent, decorators: [{
|
|
266
|
-
type: Component,
|
|
267
|
-
args: [{ selector: 'daff-checkbox-set', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-content></ng-content>" }]
|
|
268
|
-
}], propDecorators: { formArray: [{
|
|
269
|
-
type: Input
|
|
270
|
-
}], name: [{
|
|
271
|
-
type: Input
|
|
272
|
-
}], role: [{
|
|
273
|
-
type: HostBinding,
|
|
274
|
-
args: ['attr.role']
|
|
275
|
-
}], checkboxes: [{
|
|
276
|
-
type: ContentChildren,
|
|
277
|
-
args: [DaffCheckboxComponent]
|
|
278
|
-
}], valueList: [{
|
|
279
|
-
type: Output
|
|
280
|
-
}] } });
|
|
281
|
-
|
|
282
|
-
class DaffCheckboxModule {
|
|
283
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
284
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, declarations: [DaffCheckboxComponent,
|
|
285
|
-
DaffCheckboxSetComponent,
|
|
286
|
-
DaffCheckboxControlValueAccessorDirective], imports: [CommonModule], exports: [DaffCheckboxComponent,
|
|
287
|
-
DaffCheckboxSetComponent,
|
|
288
|
-
DaffCheckboxControlValueAccessorDirective] }); }
|
|
289
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, providers: [
|
|
290
|
-
DaffCheckboxSetComponent,
|
|
291
|
-
], imports: [CommonModule] }); }
|
|
292
|
-
}
|
|
293
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCheckboxModule, decorators: [{
|
|
294
|
-
type: NgModule,
|
|
295
|
-
args: [{
|
|
296
|
-
exports: [
|
|
297
|
-
DaffCheckboxComponent,
|
|
298
|
-
DaffCheckboxSetComponent,
|
|
299
|
-
DaffCheckboxControlValueAccessorDirective,
|
|
300
|
-
],
|
|
301
|
-
declarations: [
|
|
302
|
-
DaffCheckboxComponent,
|
|
303
|
-
DaffCheckboxSetComponent,
|
|
304
|
-
DaffCheckboxControlValueAccessorDirective,
|
|
305
|
-
],
|
|
306
|
-
imports: [
|
|
307
|
-
CommonModule,
|
|
308
|
-
],
|
|
309
|
-
providers: [
|
|
310
|
-
DaffCheckboxSetComponent,
|
|
311
|
-
],
|
|
312
|
-
}]
|
|
313
|
-
}] });
|
|
314
|
-
|
|
315
|
-
class DaffRadioSetComponent {
|
|
316
|
-
constructor() {
|
|
317
|
-
/**
|
|
318
|
-
* @docs-private
|
|
319
|
-
*/
|
|
320
|
-
this.role = 'radiogroup';
|
|
321
|
-
}
|
|
322
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioSetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
323
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffRadioSetComponent, isStandalone: false, selector: "daff-radio-set", inputs: { name: "name" }, host: { properties: { "attr.role": "this.role" } }, ngImport: i0, template: "<ng-content></ng-content>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
324
|
-
}
|
|
325
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioSetComponent, decorators: [{
|
|
326
|
-
type: Component,
|
|
327
|
-
args: [{ selector: 'daff-radio-set', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-content></ng-content>" }]
|
|
328
|
-
}], ctorParameters: () => [], propDecorators: { name: [{
|
|
329
|
-
type: Input
|
|
330
|
-
}], role: [{
|
|
331
|
-
type: HostBinding,
|
|
332
|
-
args: ['attr.role']
|
|
333
|
-
}] } });
|
|
334
|
-
|
|
335
|
-
let radioUniqueId = 0;
|
|
336
|
-
class DaffRadioComponent {
|
|
337
|
-
/**
|
|
338
|
-
* @docs-private
|
|
339
|
-
*/
|
|
340
|
-
get focusClass() {
|
|
341
|
-
return this.focused === true;
|
|
342
|
-
}
|
|
343
|
-
;
|
|
344
|
-
/**
|
|
345
|
-
* @docs-private
|
|
346
|
-
*/
|
|
347
|
-
get disabledClass() {
|
|
348
|
-
return this.disabled === true;
|
|
349
|
-
}
|
|
350
|
-
;
|
|
351
|
-
/**
|
|
352
|
-
* The checked property of the radio
|
|
353
|
-
*/
|
|
354
|
-
get checked() {
|
|
355
|
-
return this._checked;
|
|
356
|
-
}
|
|
357
|
-
set checked(value) {
|
|
358
|
-
if (this._checked !== value) {
|
|
359
|
-
this._checked = value;
|
|
360
|
-
this.selectionChange.emit(this.value);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
constructor(radioset) {
|
|
364
|
-
this.radioset = radioset;
|
|
365
|
-
/**
|
|
366
|
-
* @docs-private
|
|
367
|
-
*/
|
|
368
|
-
this.role = 'radio';
|
|
369
|
-
/**
|
|
370
|
-
* @docs-private
|
|
371
|
-
*/
|
|
372
|
-
this._checked = false;
|
|
373
|
-
/**
|
|
374
|
-
* Output event of selection being changed
|
|
375
|
-
*/
|
|
376
|
-
this.selectionChange = new EventEmitter();
|
|
377
|
-
/**
|
|
378
|
-
* The id of the radio. It is uniquely generated but can be overwritten by the user. Must be unique.
|
|
379
|
-
*/
|
|
380
|
-
this.id = 'daff-radio-' + radioUniqueId;
|
|
381
|
-
/**
|
|
382
|
-
* Name of the Radio
|
|
383
|
-
*/
|
|
384
|
-
this.name = '';
|
|
385
|
-
/**
|
|
386
|
-
* Used for aria-label. Default to name if user does not input a label.
|
|
387
|
-
*/
|
|
388
|
-
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
389
|
-
this.label = this.name;
|
|
390
|
-
this.disabled = false;
|
|
391
|
-
this.focused = false;
|
|
392
|
-
radioUniqueId++;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* @docs-private
|
|
396
|
-
*/
|
|
397
|
-
ngOnInit() {
|
|
398
|
-
this.name = this.radioset ? this.radioset.name : this.name;
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* updates Focus styling
|
|
402
|
-
*/
|
|
403
|
-
onFocus() {
|
|
404
|
-
this.focused = true;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* updates Blur styling
|
|
408
|
-
*/
|
|
409
|
-
onBlur() {
|
|
410
|
-
this.focused = false;
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* toggles checked attribute on
|
|
414
|
-
*/
|
|
415
|
-
select() {
|
|
416
|
-
this.checked = true;
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* toggles checked attribute off
|
|
420
|
-
*/
|
|
421
|
-
deselect() {
|
|
422
|
-
this.checked = false;
|
|
423
|
-
}
|
|
424
|
-
onChange() {
|
|
425
|
-
this.select();
|
|
426
|
-
}
|
|
427
|
-
;
|
|
428
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioComponent, deps: [{ token: DaffRadioSetComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
429
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DaffRadioComponent, isStandalone: false, selector: "daff-radio", inputs: { checked: "checked", value: "value", id: "id", name: "name", label: ["aria-label", "label"], labelledby: ["aria-labelledby", "labelledby"] }, outputs: { selectionChange: "selectionChange" }, host: { properties: { "attr.role": "this.role", "class.focused": "this.focusClass", "class.disabled": "this.disabledClass" } }, ngImport: i0, template: "<input type=\"radio\" \n[attr.checked]=\"checked ? '' : null\" \n[attr.id]=\"id\" \n[attr.name]=\"name\" \n[attr.aria-label]=\"label\"\n[attr.aria-labelledby]=\"labelledby\"\n[attr.value]=\"value\"\n[attr.disabled] = \"disabled ? '' : null\" \n(change)=\"onChange()\"\n(blur)=\"onBlur()\"\n(focus)=\"onFocus()\"/>\n<label [attr.for]=\"id\">\n <ng-content></ng-content>\n</label>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
430
|
-
}
|
|
431
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioComponent, decorators: [{
|
|
432
|
-
type: Component,
|
|
433
|
-
args: [{ selector: 'daff-radio', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<input type=\"radio\" \n[attr.checked]=\"checked ? '' : null\" \n[attr.id]=\"id\" \n[attr.name]=\"name\" \n[attr.aria-label]=\"label\"\n[attr.aria-labelledby]=\"labelledby\"\n[attr.value]=\"value\"\n[attr.disabled] = \"disabled ? '' : null\" \n(change)=\"onChange()\"\n(blur)=\"onBlur()\"\n(focus)=\"onFocus()\"/>\n<label [attr.for]=\"id\">\n <ng-content></ng-content>\n</label>" }]
|
|
434
|
-
}], ctorParameters: () => [{ type: DaffRadioSetComponent, decorators: [{
|
|
435
|
-
type: Optional
|
|
436
|
-
}] }], propDecorators: { role: [{
|
|
437
|
-
type: HostBinding,
|
|
438
|
-
args: ['attr.role']
|
|
439
|
-
}], focusClass: [{
|
|
440
|
-
type: HostBinding,
|
|
441
|
-
args: ['class.focused']
|
|
442
|
-
}], disabledClass: [{
|
|
443
|
-
type: HostBinding,
|
|
444
|
-
args: ['class.disabled']
|
|
445
|
-
}], selectionChange: [{
|
|
446
|
-
type: Output
|
|
447
|
-
}], checked: [{
|
|
448
|
-
type: Input
|
|
449
|
-
}], value: [{
|
|
450
|
-
type: Input
|
|
451
|
-
}], id: [{
|
|
452
|
-
type: Input
|
|
453
|
-
}], name: [{
|
|
454
|
-
type: Input
|
|
455
|
-
}], label: [{
|
|
456
|
-
type: Input,
|
|
457
|
-
args: ['aria-label']
|
|
458
|
-
}], labelledby: [{
|
|
459
|
-
type: Input,
|
|
460
|
-
args: ['aria-labelledby']
|
|
461
|
-
}] } });
|
|
462
|
-
|
|
463
|
-
class DaffRadioRegistry {
|
|
464
|
-
constructor() {
|
|
465
|
-
this._accessors = [];
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* @description
|
|
469
|
-
* Adds a control to the internal registry.
|
|
470
|
-
*/
|
|
471
|
-
add(control, accessor) {
|
|
472
|
-
this._accessors.push({
|
|
473
|
-
control,
|
|
474
|
-
accessor,
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* @description
|
|
479
|
-
* Removes a control from the internal registry.
|
|
480
|
-
*/
|
|
481
|
-
remove(accessor) {
|
|
482
|
-
for (let i = this._accessors.length - 1; i >= 0; --i) {
|
|
483
|
-
if (this._accessors[i].accessor === accessor) {
|
|
484
|
-
this._accessors.splice(i, 1);
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* @description
|
|
491
|
-
* Selects a radio button.
|
|
492
|
-
*/
|
|
493
|
-
select(accessor) {
|
|
494
|
-
this._accessors.forEach((c) => {
|
|
495
|
-
if (this._isSameGroup(c, accessor) && c.accessor !== accessor) {
|
|
496
|
-
c.accessor.fireDeselect();
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
_isSameGroup(controlPair, accessor) {
|
|
501
|
-
if (!controlPair.control.control) {
|
|
502
|
-
return false;
|
|
503
|
-
}
|
|
504
|
-
return controlPair.control.control.parent === accessor._control.control.parent
|
|
505
|
-
&& controlPair.accessor.name === accessor.name;
|
|
506
|
-
}
|
|
507
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
508
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioRegistry, providedIn: 'root' }); }
|
|
509
|
-
}
|
|
510
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioRegistry, decorators: [{
|
|
511
|
-
type: Injectable,
|
|
512
|
-
args: [{ providedIn: 'root' }]
|
|
513
|
-
}] });
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* ControlValueAccessor functionality for the DaffRadio
|
|
517
|
-
*/
|
|
518
|
-
class DaffRadioControlValueAccessorDirective {
|
|
519
|
-
constructor(_control, _registry, _radio) {
|
|
520
|
-
this._control = _control;
|
|
521
|
-
this._registry = _registry;
|
|
522
|
-
this._radio = _radio;
|
|
523
|
-
if (this._control != null) {
|
|
524
|
-
this._control.valueAccessor = this;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* @docs-private
|
|
529
|
-
*/
|
|
530
|
-
ngOnInit() {
|
|
531
|
-
this.writeValue(this._control.value);
|
|
532
|
-
this._registry.add(this._control, this);
|
|
533
|
-
this._radio.selectionChange.subscribe(value => value ? this._onChange() : null);
|
|
534
|
-
}
|
|
535
|
-
/**
|
|
536
|
-
*
|
|
537
|
-
* writeValue function from the CVA interface
|
|
538
|
-
*/
|
|
539
|
-
writeValue(value) {
|
|
540
|
-
// the this._onChange null check here is necessary because of an ongoing bug in angular forms
|
|
541
|
-
// where writeValue can be called before the component initializes: https://github.com/angular/angular/issues/29218
|
|
542
|
-
if (this.value === value && this._onChange) {
|
|
543
|
-
this._onChange();
|
|
544
|
-
this.fireSelect();
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* registerOnChange implemented from the CVA interface
|
|
549
|
-
*/
|
|
550
|
-
registerOnChange(fn) {
|
|
551
|
-
this._onChange = () => {
|
|
552
|
-
fn(this.value);
|
|
553
|
-
this._registry.select(this);
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* registerOnTouch implemented from the CVA interface
|
|
558
|
-
*/
|
|
559
|
-
registerOnTouched(fn) {
|
|
560
|
-
this._onTouched = fn;
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* sets the disabled state.
|
|
564
|
-
*/
|
|
565
|
-
setDisabledState(isDisabled) {
|
|
566
|
-
this._radio.disabled = isDisabled;
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
calls select function for the radio
|
|
570
|
-
*/
|
|
571
|
-
fireSelect() {
|
|
572
|
-
this._radio.select();
|
|
573
|
-
}
|
|
574
|
-
/**
|
|
575
|
-
calls deselect function for the radio
|
|
576
|
-
*/
|
|
577
|
-
fireDeselect() {
|
|
578
|
-
this._radio.deselect();
|
|
579
|
-
}
|
|
580
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioControlValueAccessorDirective, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: DaffRadioRegistry }, { token: DaffRadioComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
581
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffRadioControlValueAccessorDirective, isStandalone: false, selector: "daff-radio[ngModel], daff-radio[formControl], daff-radio[formControlName]", inputs: { value: "value", name: "name" }, ngImport: i0 }); }
|
|
582
|
-
}
|
|
583
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioControlValueAccessorDirective, decorators: [{
|
|
584
|
-
type: Directive,
|
|
585
|
-
args: [{
|
|
586
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
587
|
-
selector: 'daff-radio[ngModel], daff-radio[formControl], daff-radio[formControlName]',
|
|
588
|
-
standalone: false,
|
|
589
|
-
}]
|
|
590
|
-
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
591
|
-
type: Optional
|
|
592
|
-
}, {
|
|
593
|
-
type: Self
|
|
594
|
-
}] }, { type: DaffRadioRegistry }, { type: DaffRadioComponent }], propDecorators: { value: [{
|
|
595
|
-
type: Input
|
|
596
|
-
}], name: [{
|
|
597
|
-
type: Input
|
|
598
|
-
}] } });
|
|
599
|
-
|
|
600
|
-
class DaffRadioModule {
|
|
601
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
602
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioModule, declarations: [DaffRadioControlValueAccessorDirective,
|
|
603
|
-
DaffRadioComponent,
|
|
604
|
-
DaffRadioSetComponent], imports: [CommonModule], exports: [DaffRadioComponent,
|
|
605
|
-
DaffRadioSetComponent,
|
|
606
|
-
DaffRadioControlValueAccessorDirective] }); }
|
|
607
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioModule, imports: [CommonModule] }); }
|
|
608
|
-
}
|
|
609
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRadioModule, decorators: [{
|
|
610
|
-
type: NgModule,
|
|
611
|
-
args: [{
|
|
612
|
-
exports: [
|
|
613
|
-
DaffRadioComponent,
|
|
614
|
-
DaffRadioSetComponent,
|
|
615
|
-
DaffRadioControlValueAccessorDirective,
|
|
616
|
-
],
|
|
617
|
-
declarations: [
|
|
618
|
-
DaffRadioControlValueAccessorDirective,
|
|
619
|
-
DaffRadioComponent,
|
|
620
|
-
DaffRadioSetComponent,
|
|
621
|
-
],
|
|
622
|
-
imports: [
|
|
623
|
-
CommonModule,
|
|
624
|
-
],
|
|
625
|
-
}]
|
|
626
|
-
}] });
|
|
627
|
-
|
|
628
9
|
/**
|
|
629
10
|
* @deprecated in favor of the {@link DaffFormFieldLabelDirective}. Deprecated in version 0.86.0. Will be removed in version 1.0.0.
|
|
630
11
|
*/
|
|
@@ -669,55 +50,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
669
50
|
}] });
|
|
670
51
|
|
|
671
52
|
/**
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* `daff-form-field`, `daff-solo-field`, and `daff-list`.
|
|
53
|
+
* DaffPrefixDirective can be used to place content before another piece of content
|
|
54
|
+
* in components like `DaffFormFieldComponent` or `DaffListComponent`.
|
|
675
55
|
*/
|
|
676
56
|
class DaffPrefixDirective {
|
|
677
|
-
constructor() {
|
|
678
|
-
/**
|
|
679
|
-
* @docs-private
|
|
680
|
-
*/
|
|
681
|
-
this.class = true;
|
|
682
|
-
}
|
|
683
57
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
684
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffPrefixDirective, isStandalone: true, selector: "[daffPrefix]", host: {
|
|
58
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffPrefixDirective, isStandalone: true, selector: "[daffPrefix]", host: { classAttribute: "daff-prefix" }, ngImport: i0 }); }
|
|
685
59
|
}
|
|
686
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixDirective, decorators: [{
|
|
687
61
|
type: Directive,
|
|
688
62
|
args: [{
|
|
689
63
|
selector: '[daffPrefix]',
|
|
64
|
+
host: {
|
|
65
|
+
class: 'daff-prefix',
|
|
66
|
+
},
|
|
690
67
|
}]
|
|
691
|
-
}]
|
|
692
|
-
type: HostBinding,
|
|
693
|
-
args: ['class.daff-prefix']
|
|
694
|
-
}] } });
|
|
68
|
+
}] });
|
|
695
69
|
|
|
696
70
|
/**
|
|
697
|
-
*
|
|
698
|
-
*
|
|
699
|
-
* `daff-form-field`, `daff-solo-field`, and `daff-list`.
|
|
71
|
+
* DaffSuffixDirective can be used to place content after another piece of content
|
|
72
|
+
* in components like `DaffFormFieldComponent` or `DaffListComponent`.
|
|
700
73
|
*/
|
|
701
74
|
class DaffSuffixDirective {
|
|
702
|
-
constructor() {
|
|
703
|
-
/**
|
|
704
|
-
* @docs-private
|
|
705
|
-
*/
|
|
706
|
-
this.class = true;
|
|
707
|
-
}
|
|
708
75
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
709
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSuffixDirective, isStandalone: true, selector: "[daffSuffix]", host: {
|
|
76
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSuffixDirective, isStandalone: true, selector: "[daffSuffix]", host: { classAttribute: "daff-suffix" }, ngImport: i0 }); }
|
|
710
77
|
}
|
|
711
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSuffixDirective, decorators: [{
|
|
712
79
|
type: Directive,
|
|
713
80
|
args: [{
|
|
714
81
|
selector: '[daffSuffix]',
|
|
82
|
+
host: {
|
|
83
|
+
class: 'daff-suffix',
|
|
84
|
+
},
|
|
715
85
|
}]
|
|
716
|
-
}]
|
|
717
|
-
type: HostBinding,
|
|
718
|
-
args: ['class.daff-suffix']
|
|
719
|
-
}] } });
|
|
86
|
+
}] });
|
|
720
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated in favor of standalone components. Deprecated in version 0.91.0. Will be removed in version 1.0.0.
|
|
90
|
+
*/
|
|
721
91
|
class DaffPrefixSuffixModule {
|
|
722
92
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
723
93
|
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule, imports: [DaffPrefixDirective,
|
|
@@ -739,6 +109,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
739
109
|
}]
|
|
740
110
|
}] });
|
|
741
111
|
|
|
112
|
+
const DAFF_PREFIX_SUFFIX_DIRECTIVES = [
|
|
113
|
+
DaffPrefixDirective,
|
|
114
|
+
DaffSuffixDirective,
|
|
115
|
+
];
|
|
116
|
+
|
|
742
117
|
/**
|
|
743
118
|
* Enumerates the available color palette options for a component.
|
|
744
119
|
* These values can be used to apply specific color styles to components within the application.
|
|
@@ -857,23 +232,6 @@ const validateColor = (color) => {
|
|
|
857
232
|
* ```
|
|
858
233
|
*/
|
|
859
234
|
class DaffColorableDirective {
|
|
860
|
-
/**
|
|
861
|
-
* Dynamically sets the CSS classes based on the color.
|
|
862
|
-
* @docs-private
|
|
863
|
-
*/
|
|
864
|
-
get class() {
|
|
865
|
-
return {
|
|
866
|
-
'daff-primary': this.color === DaffPaletteEnum.Primary,
|
|
867
|
-
'daff-secondary': this.color === DaffPaletteEnum.Secondary,
|
|
868
|
-
'daff-tertiary': this.color === DaffPaletteEnum.Tertiary,
|
|
869
|
-
'daff-light': this.color === DaffPaletteEnum.Light,
|
|
870
|
-
'daff-dark': this.color === DaffPaletteEnum.Dark,
|
|
871
|
-
'daff-theme': this.color === DaffPaletteEnum.Theme,
|
|
872
|
-
'daff-theme-contrast': this.color === DaffPaletteEnum.ThemeContrast,
|
|
873
|
-
'daff-black': this.color === DaffPaletteEnum.Black,
|
|
874
|
-
'daff-white': this.color === DaffPaletteEnum.White,
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
235
|
/**
|
|
878
236
|
* @docs-private
|
|
879
237
|
*/
|
|
@@ -892,17 +250,25 @@ class DaffColorableDirective {
|
|
|
892
250
|
}
|
|
893
251
|
}
|
|
894
252
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffColorableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
895
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffColorableDirective, isStandalone: true, selector: "[daffColorable]", inputs: { color: "color" }, host: { properties: { "class": "
|
|
253
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffColorableDirective, isStandalone: true, selector: "[daffColorable]", inputs: { color: "color" }, host: { properties: { "class.daff-primary": "color === \"primary\"", "class.daff-secondary": "color === \"secondary\"", "class.daff-tertiary": "color === \"tertiary\"", "class.daff-light": "color === \"light\"", "class.daff-dark": "color === \"dark\"", "class.daff-theme": "color === \"theme\"", "class.daff-theme-contrast": "color === \"theme-contrast\"", "class.daff-black": "color === \"black\"", "class.daff-white": "color === \"white\"" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
896
254
|
}
|
|
897
255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffColorableDirective, decorators: [{
|
|
898
256
|
type: Directive,
|
|
899
257
|
args: [{
|
|
900
258
|
selector: '[daffColorable]',
|
|
259
|
+
host: {
|
|
260
|
+
'[class.daff-primary]': 'color === "primary"',
|
|
261
|
+
'[class.daff-secondary]': 'color === "secondary"',
|
|
262
|
+
'[class.daff-tertiary]': 'color === "tertiary"',
|
|
263
|
+
'[class.daff-light]': 'color === "light"',
|
|
264
|
+
'[class.daff-dark]': 'color === "dark"',
|
|
265
|
+
'[class.daff-theme]': 'color === "theme"',
|
|
266
|
+
'[class.daff-theme-contrast]': 'color === "theme-contrast"',
|
|
267
|
+
'[class.daff-black]': 'color === "black"',
|
|
268
|
+
'[class.daff-white]': 'color === "white"',
|
|
269
|
+
},
|
|
901
270
|
}]
|
|
902
|
-
}], propDecorators: {
|
|
903
|
-
type: HostBinding,
|
|
904
|
-
args: ['class']
|
|
905
|
-
}], color: [{
|
|
271
|
+
}], propDecorators: { color: [{
|
|
906
272
|
type: Input
|
|
907
273
|
}] } });
|
|
908
274
|
|
|
@@ -988,7 +354,6 @@ const validateStatus = (status) => {
|
|
|
988
354
|
*
|
|
989
355
|
* ```ts
|
|
990
356
|
* @Component({
|
|
991
|
-
* standalone: true,
|
|
992
357
|
* selector: 'custom-component',
|
|
993
358
|
* template: 'custom-component.html',
|
|
994
359
|
* hostDirectives: [
|
|
@@ -1017,18 +382,6 @@ const validateStatus = (status) => {
|
|
|
1017
382
|
* - `daff-success`: Applied when the status is `success`.
|
|
1018
383
|
*/
|
|
1019
384
|
class DaffStatusableDirective {
|
|
1020
|
-
/**
|
|
1021
|
-
* Dynamically sets the CSS classes based on the status.
|
|
1022
|
-
* @docs-private
|
|
1023
|
-
*/
|
|
1024
|
-
get class() {
|
|
1025
|
-
return {
|
|
1026
|
-
'daff-info': this.status === DaffStatusEnum.Info,
|
|
1027
|
-
'daff-warn': this.status === DaffStatusEnum.Warn,
|
|
1028
|
-
'daff-critical': this.status === DaffStatusEnum.Critical,
|
|
1029
|
-
'daff-success': this.status === DaffStatusEnum.Success,
|
|
1030
|
-
};
|
|
1031
|
-
}
|
|
1032
385
|
/**
|
|
1033
386
|
* @docs-private
|
|
1034
387
|
*/
|
|
@@ -1042,22 +395,25 @@ class DaffStatusableDirective {
|
|
|
1042
395
|
*/
|
|
1043
396
|
ngOnInit() {
|
|
1044
397
|
validateStatus(this.status);
|
|
1045
|
-
if (this.
|
|
398
|
+
if (this.defaultStatus && !this.status) {
|
|
1046
399
|
this.status = this.defaultStatus;
|
|
1047
400
|
}
|
|
1048
401
|
}
|
|
1049
402
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStatusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1050
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffStatusableDirective, isStandalone: true, selector: "[daffStatusable]", inputs: { status: "status" }, host: { properties: { "class": "
|
|
403
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffStatusableDirective, isStandalone: true, selector: "[daffStatusable]", inputs: { status: "status" }, host: { properties: { "class.daff-info": "status === \"info\"", "class.daff-warn": "status === \"warn\"", "class.daff-critical": "status === \"critical\"", "class.daff-success": "status === \"success\"" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
1051
404
|
}
|
|
1052
405
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStatusableDirective, decorators: [{
|
|
1053
406
|
type: Directive,
|
|
1054
407
|
args: [{
|
|
1055
408
|
selector: '[daffStatusable]',
|
|
409
|
+
host: {
|
|
410
|
+
'[class.daff-info]': 'status === "info"',
|
|
411
|
+
'[class.daff-warn]': 'status === "warn"',
|
|
412
|
+
'[class.daff-critical]': 'status === "critical"',
|
|
413
|
+
'[class.daff-success]': 'status === "success"',
|
|
414
|
+
},
|
|
1056
415
|
}]
|
|
1057
|
-
}], propDecorators: {
|
|
1058
|
-
type: HostBinding,
|
|
1059
|
-
args: ['class']
|
|
1060
|
-
}], status: [{
|
|
416
|
+
}], propDecorators: { status: [{
|
|
1061
417
|
type: Input
|
|
1062
418
|
}] } });
|
|
1063
419
|
|
|
@@ -1079,7 +435,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1079
435
|
*
|
|
1080
436
|
* ```ts
|
|
1081
437
|
* @Component({
|
|
1082
|
-
* standalone: true,
|
|
1083
438
|
* selector: 'custom-component',
|
|
1084
439
|
* template: 'custom-component.html',
|
|
1085
440
|
* hostDirectives: [
|
|
@@ -1111,18 +466,18 @@ class DaffSkeletonableDirective {
|
|
|
1111
466
|
this.skeleton = false;
|
|
1112
467
|
}
|
|
1113
468
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSkeletonableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1114
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSkeletonableDirective, isStandalone: true, selector: "[daffSkeletonable]", inputs: { skeleton: "skeleton" }, host: { properties: { "class.daff-skeleton": "
|
|
469
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSkeletonableDirective, isStandalone: true, selector: "[daffSkeletonable]", inputs: { skeleton: "skeleton" }, host: { properties: { "class.daff-skeleton": "skeleton" } }, ngImport: i0 }); }
|
|
1115
470
|
}
|
|
1116
471
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSkeletonableDirective, decorators: [{
|
|
1117
472
|
type: Directive,
|
|
1118
473
|
args: [{
|
|
1119
474
|
selector: '[daffSkeletonable]',
|
|
475
|
+
host: {
|
|
476
|
+
'[class.daff-skeleton]': 'skeleton',
|
|
477
|
+
},
|
|
1120
478
|
}]
|
|
1121
479
|
}], propDecorators: { skeleton: [{
|
|
1122
480
|
type: Input
|
|
1123
|
-
}, {
|
|
1124
|
-
type: HostBinding,
|
|
1125
|
-
args: ['class.daff-skeleton']
|
|
1126
481
|
}] } });
|
|
1127
482
|
|
|
1128
483
|
var DaffTextAlignmentEnum;
|
|
@@ -1165,7 +520,6 @@ const validateTextAlignment = (textAlignment) => {
|
|
|
1165
520
|
*
|
|
1166
521
|
* ```ts
|
|
1167
522
|
* @Component({
|
|
1168
|
-
* standalone: true,
|
|
1169
523
|
* selector: 'custom-component',
|
|
1170
524
|
* template: 'custom-component.html',
|
|
1171
525
|
* hostDirectives: [
|
|
@@ -1187,16 +541,6 @@ const validateTextAlignment = (textAlignment) => {
|
|
|
1187
541
|
* ```
|
|
1188
542
|
*/
|
|
1189
543
|
class DaffTextAlignableDirective {
|
|
1190
|
-
/**
|
|
1191
|
-
* @docs-private
|
|
1192
|
-
*/
|
|
1193
|
-
get class() {
|
|
1194
|
-
return {
|
|
1195
|
-
'daff-left': this.textAlignment === DaffTextAlignmentEnum.Left,
|
|
1196
|
-
'daff-center': this.textAlignment === DaffTextAlignmentEnum.Center,
|
|
1197
|
-
'daff-right': this.textAlignment === DaffTextAlignmentEnum.Right,
|
|
1198
|
-
};
|
|
1199
|
-
}
|
|
1200
544
|
/**
|
|
1201
545
|
* @docs-private
|
|
1202
546
|
*/
|
|
@@ -1215,17 +559,19 @@ class DaffTextAlignableDirective {
|
|
|
1215
559
|
}
|
|
1216
560
|
}
|
|
1217
561
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTextAlignableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1218
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffTextAlignableDirective, isStandalone: true, selector: "[daffTextAlignable]", inputs: { textAlignment: "textAlignment" }, host: { properties: { "class": "
|
|
562
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffTextAlignableDirective, isStandalone: true, selector: "[daffTextAlignable]", inputs: { textAlignment: "textAlignment" }, host: { properties: { "class.daff-left": "textAlignment === \"left\"", "class.daff-center": "textAlignment === \"center\"", "class.daff-right": "textAlignment === \"right\"" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
1219
563
|
}
|
|
1220
564
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTextAlignableDirective, decorators: [{
|
|
1221
565
|
type: Directive,
|
|
1222
566
|
args: [{
|
|
1223
567
|
selector: '[daffTextAlignable]',
|
|
568
|
+
host: {
|
|
569
|
+
'[class.daff-left]': 'textAlignment === "left"',
|
|
570
|
+
'[class.daff-center]': 'textAlignment === "center"',
|
|
571
|
+
'[class.daff-right]': 'textAlignment === "right"',
|
|
572
|
+
},
|
|
1224
573
|
}]
|
|
1225
|
-
}], propDecorators: {
|
|
1226
|
-
type: HostBinding,
|
|
1227
|
-
args: ['class']
|
|
1228
|
-
}], textAlignment: [{
|
|
574
|
+
}], propDecorators: { textAlignment: [{
|
|
1229
575
|
type: Input
|
|
1230
576
|
}] } });
|
|
1231
577
|
|
|
@@ -1247,7 +593,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1247
593
|
*
|
|
1248
594
|
* ```ts
|
|
1249
595
|
* @Component({
|
|
1250
|
-
* standalone: true,
|
|
1251
596
|
* selector: 'custom-component',
|
|
1252
597
|
* template: 'custom-component.html',
|
|
1253
598
|
* hostDirectives: [
|
|
@@ -1281,19 +626,18 @@ class DaffCompactableDirective {
|
|
|
1281
626
|
this.compact = false;
|
|
1282
627
|
}
|
|
1283
628
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCompactableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1284
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffCompactableDirective, isStandalone: true, selector: "[daffCompactable]", inputs: { compact: "compact" }, host: { properties: { "class.daff-compact": "
|
|
629
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffCompactableDirective, isStandalone: true, selector: "[daffCompactable]", inputs: { compact: "compact" }, host: { properties: { "class.daff-compact": "compact" } }, ngImport: i0 }); }
|
|
1285
630
|
}
|
|
1286
631
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCompactableDirective, decorators: [{
|
|
1287
632
|
type: Directive,
|
|
1288
633
|
args: [{
|
|
1289
634
|
selector: '[daffCompactable]',
|
|
1290
|
-
|
|
635
|
+
host: {
|
|
636
|
+
'[class.daff-compact]': 'compact',
|
|
637
|
+
},
|
|
1291
638
|
}]
|
|
1292
639
|
}], propDecorators: { compact: [{
|
|
1293
640
|
type: Input
|
|
1294
|
-
}, {
|
|
1295
|
-
type: HostBinding,
|
|
1296
|
-
args: ['class.daff-compact']
|
|
1297
641
|
}] } });
|
|
1298
642
|
|
|
1299
643
|
/**
|
|
@@ -1338,7 +682,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1338
682
|
*
|
|
1339
683
|
* ```ts
|
|
1340
684
|
* @Component({
|
|
1341
|
-
* standalone: true,
|
|
1342
685
|
* selector: 'my-custom-component',
|
|
1343
686
|
* template: 'my-custom-component.html',
|
|
1344
687
|
* hostDirectives: [{ directive: DaffManageContainerLayoutDirective }],
|
|
@@ -1355,25 +698,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1355
698
|
* This directive will apply the `daff-manage-container-layout` class to your component, ensuring that the styles set on `:host` are passed down to the container.
|
|
1356
699
|
*/
|
|
1357
700
|
class DaffManageContainerLayoutDirective {
|
|
1358
|
-
constructor() {
|
|
1359
|
-
/**
|
|
1360
|
-
* @docs-private
|
|
1361
|
-
*/
|
|
1362
|
-
this.class = true;
|
|
1363
|
-
}
|
|
1364
701
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffManageContainerLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1365
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffManageContainerLayoutDirective, isStandalone: true, selector: "[daffManageContainerLayout]", host: {
|
|
702
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffManageContainerLayoutDirective, isStandalone: true, selector: "[daffManageContainerLayout]", host: { classAttribute: "daff-manage-container-layout" }, ngImport: i0 }); }
|
|
1366
703
|
}
|
|
1367
704
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffManageContainerLayoutDirective, decorators: [{
|
|
1368
705
|
type: Directive,
|
|
1369
706
|
args: [{
|
|
1370
707
|
selector: '[daffManageContainerLayout]',
|
|
1371
|
-
|
|
708
|
+
host: {
|
|
709
|
+
class: 'daff-manage-container-layout',
|
|
710
|
+
},
|
|
1372
711
|
}]
|
|
1373
|
-
}]
|
|
1374
|
-
type: HostBinding,
|
|
1375
|
-
args: ['class.daff-manage-container-layout']
|
|
1376
|
-
}] } });
|
|
712
|
+
}] });
|
|
1377
713
|
|
|
1378
714
|
/**
|
|
1379
715
|
* `DaffArticleEncapsulatedDirective` is used to encapsulate custom components within an article,
|
|
@@ -1389,7 +725,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1389
725
|
*
|
|
1390
726
|
* ```ts
|
|
1391
727
|
* @Component({
|
|
1392
|
-
* standalone: true,
|
|
1393
728
|
* selector: 'custom-component',
|
|
1394
729
|
* template: 'custom-component.html',
|
|
1395
730
|
* hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
|
|
@@ -1400,25 +735,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1400
735
|
* This directive will apply the `daff-ae` class to the component, ensuring that it is encapsulated from the article's styles.
|
|
1401
736
|
*/
|
|
1402
737
|
class DaffArticleEncapsulatedDirective {
|
|
1403
|
-
constructor() {
|
|
1404
|
-
/**
|
|
1405
|
-
* @docs-private
|
|
1406
|
-
*/
|
|
1407
|
-
this.class = true;
|
|
1408
|
-
}
|
|
1409
738
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleEncapsulatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1410
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffArticleEncapsulatedDirective, isStandalone: true, selector: "[daffArticleEncapsulated]", host: {
|
|
739
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffArticleEncapsulatedDirective, isStandalone: true, selector: "[daffArticleEncapsulated]", host: { classAttribute: "daff-ae" }, ngImport: i0 }); }
|
|
1411
740
|
}
|
|
1412
741
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleEncapsulatedDirective, decorators: [{
|
|
1413
742
|
type: Directive,
|
|
1414
743
|
args: [{
|
|
1415
744
|
selector: '[daffArticleEncapsulated]',
|
|
1416
|
-
|
|
745
|
+
host: {
|
|
746
|
+
class: 'daff-ae',
|
|
747
|
+
},
|
|
1417
748
|
}]
|
|
1418
|
-
}]
|
|
1419
|
-
type: HostBinding,
|
|
1420
|
-
args: ['class.daff-ae']
|
|
1421
|
-
}] } });
|
|
749
|
+
}] });
|
|
1422
750
|
|
|
1423
751
|
/**
|
|
1424
752
|
* The possible states of a theme.
|
|
@@ -1794,19 +1122,6 @@ var DaffSizableEnum;
|
|
|
1794
1122
|
* - `daff-xl`: Applied when the size is `xl`.
|
|
1795
1123
|
*/
|
|
1796
1124
|
class DaffSizableDirective {
|
|
1797
|
-
/**
|
|
1798
|
-
* Dynamically sets the CSS classes based on the size.
|
|
1799
|
-
* @docs-private
|
|
1800
|
-
*/
|
|
1801
|
-
get class() {
|
|
1802
|
-
return {
|
|
1803
|
-
'daff-xs': this.size === DaffSizableEnum.XSmall,
|
|
1804
|
-
'daff-sm': this.size === DaffSizableEnum.Small,
|
|
1805
|
-
'daff-md': this.size === DaffSizableEnum.Medium,
|
|
1806
|
-
'daff-lg': this.size === DaffSizableEnum.Large,
|
|
1807
|
-
'daff-xl': this.size === DaffSizableEnum.XLarge,
|
|
1808
|
-
};
|
|
1809
|
-
}
|
|
1810
1125
|
/**
|
|
1811
1126
|
* @docs-private
|
|
1812
1127
|
*/
|
|
@@ -1824,18 +1139,21 @@ class DaffSizableDirective {
|
|
|
1824
1139
|
}
|
|
1825
1140
|
}
|
|
1826
1141
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1827
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSizableDirective, isStandalone: true, selector: "[daffSizable]", inputs: { size: "size" }, host: { properties: { "class": "
|
|
1142
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSizableDirective, isStandalone: true, selector: "[daffSizable]", inputs: { size: "size" }, host: { properties: { "class.daff-xs": "size === \"xs\"", "class.daff-sm": "size === \"sm\"", "class.daff-md": "size === \"md\"", "class.daff-lg": "size === \"lg\"", "class.daff-xl": "size === \"xl\"" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
1828
1143
|
}
|
|
1829
1144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSizableDirective, decorators: [{
|
|
1830
1145
|
type: Directive,
|
|
1831
1146
|
args: [{
|
|
1832
1147
|
selector: '[daffSizable]',
|
|
1833
|
-
|
|
1148
|
+
host: {
|
|
1149
|
+
'[class.daff-xs]': 'size === "xs"',
|
|
1150
|
+
'[class.daff-sm]': 'size === "sm"',
|
|
1151
|
+
'[class.daff-md]': 'size === "md"',
|
|
1152
|
+
'[class.daff-lg]': 'size === "lg"',
|
|
1153
|
+
'[class.daff-xl]': 'size === "xl"',
|
|
1154
|
+
},
|
|
1834
1155
|
}]
|
|
1835
|
-
}], propDecorators: {
|
|
1836
|
-
type: HostBinding,
|
|
1837
|
-
args: ['class']
|
|
1838
|
-
}], size: [{
|
|
1156
|
+
}], propDecorators: { size: [{
|
|
1839
1157
|
type: Input
|
|
1840
1158
|
}] } });
|
|
1841
1159
|
|
|
@@ -1947,23 +1265,109 @@ class DaffOpenableDirective {
|
|
|
1947
1265
|
}
|
|
1948
1266
|
}
|
|
1949
1267
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOpenableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1950
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffOpenableDirective, isStandalone: true, selector: "[daffOpenable]", inputs: { open: "open" }, outputs: { toggled: "toggled" }, host: { properties: { "class.daff-open": "
|
|
1268
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffOpenableDirective, isStandalone: true, selector: "[daffOpenable]", inputs: { open: "open" }, outputs: { toggled: "toggled" }, host: { properties: { "class.daff-open": "open" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
1951
1269
|
}
|
|
1952
1270
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOpenableDirective, decorators: [{
|
|
1953
1271
|
type: Directive,
|
|
1954
1272
|
args: [{
|
|
1955
1273
|
selector: '[daffOpenable]',
|
|
1956
|
-
|
|
1274
|
+
host: {
|
|
1275
|
+
'[class.daff-open]': 'open',
|
|
1276
|
+
},
|
|
1957
1277
|
}]
|
|
1958
1278
|
}], propDecorators: { open: [{
|
|
1959
1279
|
type: Input
|
|
1960
|
-
}, {
|
|
1961
|
-
type: HostBinding,
|
|
1962
|
-
args: ['class.daff-open']
|
|
1963
1280
|
}], toggled: [{
|
|
1964
1281
|
type: Output
|
|
1965
1282
|
}] } });
|
|
1966
1283
|
|
|
1284
|
+
var DaffOrientationEnum;
|
|
1285
|
+
(function (DaffOrientationEnum) {
|
|
1286
|
+
DaffOrientationEnum["Horizontal"] = "horizontal";
|
|
1287
|
+
DaffOrientationEnum["Vertical"] = "vertical";
|
|
1288
|
+
})(DaffOrientationEnum || (DaffOrientationEnum = {}));
|
|
1289
|
+
|
|
1290
|
+
const orientationValues = (orientation) => Object.values(DaffOrientationEnum).includes(orientation);
|
|
1291
|
+
const validateOrientation = (orientation) => {
|
|
1292
|
+
if (isDevMode()) {
|
|
1293
|
+
if (orientation !== undefined && !orientationValues(orientation)) {
|
|
1294
|
+
console.warn(`'${orientation}' is not a valid value of the orientation property. The available values are: left, center, or right.`);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
/**
|
|
1299
|
+
* `DaffOrientableDirective` allows for dynamic orientation of a component by
|
|
1300
|
+
* setting CSS classes based on the specified orientation. This directive is
|
|
1301
|
+
* useful when orientation needs to be managed dynamically in an Angular component.
|
|
1302
|
+
*
|
|
1303
|
+
* @example Implementing it as an attribute directive
|
|
1304
|
+
*
|
|
1305
|
+
* ```html
|
|
1306
|
+
* <div daffOrientable [orientation]="horizontal"></div>
|
|
1307
|
+
* ```
|
|
1308
|
+
*
|
|
1309
|
+
* In this example, the `daff-horizontal` class is added to the `div` element, allowing
|
|
1310
|
+
* you to style the `div` as you wish using the class.
|
|
1311
|
+
*
|
|
1312
|
+
* @example Implementing it as an Angular host directive
|
|
1313
|
+
*
|
|
1314
|
+
* ```ts
|
|
1315
|
+
* @Component({
|
|
1316
|
+
* selector: 'custom-component',
|
|
1317
|
+
* template: 'custom-component.html',
|
|
1318
|
+
* hostDirectives: [
|
|
1319
|
+
* {
|
|
1320
|
+
* directive: DaffOrientableDirective,
|
|
1321
|
+
* inputs: ['orientation'],
|
|
1322
|
+
* },
|
|
1323
|
+
* ],
|
|
1324
|
+
* })
|
|
1325
|
+
* export class CustomComponent { }
|
|
1326
|
+
* ```
|
|
1327
|
+
*
|
|
1328
|
+
* ```scss
|
|
1329
|
+
* .custom-component {
|
|
1330
|
+
* &.daff-vertical {
|
|
1331
|
+
* display: flex;
|
|
1332
|
+
* flex-direction: column;
|
|
1333
|
+
* }
|
|
1334
|
+
* }
|
|
1335
|
+
* ```
|
|
1336
|
+
*/
|
|
1337
|
+
class DaffOrientableDirective {
|
|
1338
|
+
/**
|
|
1339
|
+
* @docs-private
|
|
1340
|
+
*/
|
|
1341
|
+
ngOnInit() {
|
|
1342
|
+
if (this.defaultOrientation && !this.orientation) {
|
|
1343
|
+
this.orientation = this.defaultOrientation;
|
|
1344
|
+
}
|
|
1345
|
+
validateOrientation(this.orientation);
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* @docs-private
|
|
1349
|
+
*/
|
|
1350
|
+
ngOnChanges(changes) {
|
|
1351
|
+
if (!changes.orientation?.currentValue) {
|
|
1352
|
+
this.orientation = this.defaultOrientation;
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOrientableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1356
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffOrientableDirective, isStandalone: true, selector: "[daffOrientable]", inputs: { orientation: "orientation" }, host: { properties: { "class.daff-horizontal": "orientation === \"horizontal\"", "class.daff-vertical": "orientation === \"vertical\"" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
1357
|
+
}
|
|
1358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOrientableDirective, decorators: [{
|
|
1359
|
+
type: Directive,
|
|
1360
|
+
args: [{
|
|
1361
|
+
selector: '[daffOrientable]',
|
|
1362
|
+
host: {
|
|
1363
|
+
'[class.daff-horizontal]': 'orientation === "horizontal"',
|
|
1364
|
+
'[class.daff-vertical]': 'orientation === "vertical"',
|
|
1365
|
+
},
|
|
1366
|
+
}]
|
|
1367
|
+
}], propDecorators: { orientation: [{
|
|
1368
|
+
type: Input
|
|
1369
|
+
}] } });
|
|
1370
|
+
|
|
1967
1371
|
class DaffSelectableDirective {
|
|
1968
1372
|
constructor(cd) {
|
|
1969
1373
|
this.cd = cd;
|
|
@@ -1972,35 +1376,40 @@ class DaffSelectableDirective {
|
|
|
1972
1376
|
*/
|
|
1973
1377
|
this.selected = false;
|
|
1974
1378
|
/**
|
|
1975
|
-
* An event that fires after the
|
|
1379
|
+
* An event that fires after the component becomes selected.
|
|
1976
1380
|
*/
|
|
1977
1381
|
this.becameSelected = new EventEmitter();
|
|
1978
1382
|
}
|
|
1383
|
+
/**
|
|
1384
|
+
* Selects the component and emits the `becameSelected` event.
|
|
1385
|
+
*/
|
|
1979
1386
|
select() {
|
|
1980
1387
|
this.selected = true;
|
|
1981
1388
|
this.becameSelected.emit();
|
|
1982
1389
|
this.cd.markForCheck();
|
|
1983
1390
|
return this;
|
|
1984
1391
|
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Deselects the component.
|
|
1394
|
+
*/
|
|
1985
1395
|
deselect() {
|
|
1986
1396
|
this.selected = false;
|
|
1987
1397
|
this.cd.markForCheck();
|
|
1988
1398
|
return this;
|
|
1989
1399
|
}
|
|
1990
1400
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSelectableDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1991
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSelectableDirective, isStandalone: true, selector: "[daffSelected]", inputs: { selected: "selected" }, outputs: { becameSelected: "becameSelected" }, host: { properties: { "class.daff-selected": "
|
|
1401
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffSelectableDirective, isStandalone: true, selector: "[daffSelected]", inputs: { selected: "selected" }, outputs: { becameSelected: "becameSelected" }, host: { properties: { "class.daff-selected": "selected" } }, ngImport: i0 }); }
|
|
1992
1402
|
}
|
|
1993
1403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSelectableDirective, decorators: [{
|
|
1994
1404
|
type: Directive,
|
|
1995
1405
|
args: [{
|
|
1996
1406
|
selector: '[daffSelected]',
|
|
1997
|
-
|
|
1407
|
+
host: {
|
|
1408
|
+
'[class.daff-selected]': 'selected',
|
|
1409
|
+
},
|
|
1998
1410
|
}]
|
|
1999
1411
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { selected: [{
|
|
2000
1412
|
type: Input
|
|
2001
|
-
}, {
|
|
2002
|
-
type: HostBinding,
|
|
2003
|
-
args: ['class.daff-selected']
|
|
2004
1413
|
}], becameSelected: [{
|
|
2005
1414
|
type: Output
|
|
2006
1415
|
}] } });
|
|
@@ -2140,6 +1549,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
2140
1549
|
type: Input
|
|
2141
1550
|
}] } });
|
|
2142
1551
|
|
|
1552
|
+
/**
|
|
1553
|
+
* `DaffDisableableDirective` allows a component to display a disabled UI
|
|
1554
|
+
* by conditionally applying a CSS class. This is useful for indicating to
|
|
1555
|
+
* users that content is loading or being processed. This directive can be used to
|
|
1556
|
+
* apply a disabled UI to any component by toggling the `disabled`
|
|
1557
|
+
* input property. When `disabled` is `true`, the `daff-disabled` CSS class
|
|
1558
|
+
* is applied, which should style the component to look like it's not interactable.
|
|
1559
|
+
*
|
|
1560
|
+
* @example Implementing it as an attribute directive
|
|
1561
|
+
*
|
|
1562
|
+
* ```html
|
|
1563
|
+
* <div daffDisableable [disabled]="isDisabled">Content</div>
|
|
1564
|
+
* ```
|
|
1565
|
+
*
|
|
1566
|
+
* @example Implementing it as an Angular host directive
|
|
1567
|
+
*
|
|
1568
|
+
* ```ts
|
|
1569
|
+
* @Component({
|
|
1570
|
+
* selector: 'custom-component',
|
|
1571
|
+
* template: 'custom-component.html',
|
|
1572
|
+
* hostDirectives: [
|
|
1573
|
+
* {
|
|
1574
|
+
* directive: DaffDisableableDirective,
|
|
1575
|
+
* inputs: ['disabled'],
|
|
1576
|
+
* },
|
|
1577
|
+
* ],
|
|
1578
|
+
* })
|
|
1579
|
+
* export class CustomComponent { }
|
|
1580
|
+
* ```
|
|
1581
|
+
*
|
|
1582
|
+
* ```scss
|
|
1583
|
+
* :host {
|
|
1584
|
+
* .daff-disabled {
|
|
1585
|
+
* cursor: not-allowed;
|
|
1586
|
+
* opacity: 0.5;
|
|
1587
|
+
* }
|
|
1588
|
+
* }
|
|
1589
|
+
* ```
|
|
1590
|
+
*
|
|
1591
|
+
* The directive applies the `daff-disabled` class to the component. The class should be
|
|
1592
|
+
* defined in your styles to display the loading state as desired.
|
|
1593
|
+
*/
|
|
1594
|
+
class DaffDisableableDirective {
|
|
1595
|
+
constructor() {
|
|
1596
|
+
this.disabled = false;
|
|
1597
|
+
}
|
|
1598
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffDisableableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1599
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: DaffDisableableDirective, isStandalone: true, selector: "[daffDisableable]", inputs: { disabled: "disabled" }, host: { properties: { "class.daff-disabled": "disabled" } }, ngImport: i0 }); }
|
|
1600
|
+
}
|
|
1601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffDisableableDirective, decorators: [{
|
|
1602
|
+
type: Directive,
|
|
1603
|
+
args: [{
|
|
1604
|
+
selector: '[daffDisableable]',
|
|
1605
|
+
host: {
|
|
1606
|
+
'[class.daff-disabled]': 'disabled',
|
|
1607
|
+
},
|
|
1608
|
+
}]
|
|
1609
|
+
}], propDecorators: { disabled: [{
|
|
1610
|
+
type: Input
|
|
1611
|
+
}] } });
|
|
1612
|
+
|
|
1613
|
+
class DaffErrorStateMatcher {
|
|
1614
|
+
isErrorState(control, formSubmitted) {
|
|
1615
|
+
return control.errors && (control.touched || formSubmitted);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
|
|
2143
1619
|
// Core
|
|
2144
1620
|
|
|
2145
1621
|
/*
|
|
@@ -2156,5 +1632,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
2156
1632
|
* Generated bundle index. Do not edit.
|
|
2157
1633
|
*/
|
|
2158
1634
|
|
|
2159
|
-
export { DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints,
|
|
1635
|
+
export { DAFF_PREFIX_SUFFIX_DIRECTIVES, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffColorableDirective, DaffCompactableDirective, DaffDisableableDirective, DaffErrorStateMatcher, DaffFocusStackService, DaffFormLabelDirective, DaffFormLabelModule, DaffManageContainerLayoutDirective, DaffOpenableDirective, DaffOrientableDirective, DaffOrientationEnum, DaffPrefixDirective, DaffPrefixSuffixModule, DaffSelectableDirective, DaffSizableDirective, DaffSizableEnum, DaffSkeletonableDirective, DaffStatusEnum, DaffStatusableDirective, DaffStickyTrackerDirective, DaffSuffixDirective, DaffTextAlignableDirective, DaffTextAlignmentEnum, DaffTheme, DaffThemingService, NoopBreakpointObserver, SERVER_SAFE_BREAKPOINT_OBSERVER, daffFocusableElementsSelector };
|
|
2160
1636
|
//# sourceMappingURL=daffodil-design.mjs.map
|