@daffodil/design 0.90.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/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 +2 -2
- 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 +35 -65
- 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 +13 -42
- package/fesm2022/daffodil-design-radio.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-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 -461
- 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 +56 -36
- package/image/README.md +27 -19
- package/image/index.d.ts +6 -1
- package/index.d.ts +180 -259
- 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/index.d.ts +0 -16
- package/scss/layout/_breakpoint.scss +1 -1
- package/scss/theme.scss +2 -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/max-contrast/max-contrast.scss +3 -3
- 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/src/tag-theme.scss +11 -9
- 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 -34
- 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-tag-examples.mjs +0 -125
- package/fesm2022/daffodil-design-tag-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/tag/examples/index.d.ts +0 -50
- 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,317 +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
9
|
/**
|
|
316
10
|
* @deprecated in favor of the {@link DaffFormFieldLabelDirective}. Deprecated in version 0.86.0. Will be removed in version 1.0.0.
|
|
317
11
|
*/
|
|
@@ -356,55 +50,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
356
50
|
}] });
|
|
357
51
|
|
|
358
52
|
/**
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* `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`.
|
|
362
55
|
*/
|
|
363
56
|
class DaffPrefixDirective {
|
|
364
|
-
constructor() {
|
|
365
|
-
/**
|
|
366
|
-
* @docs-private
|
|
367
|
-
*/
|
|
368
|
-
this.class = true;
|
|
369
|
-
}
|
|
370
57
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
371
|
-
/** @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 }); }
|
|
372
59
|
}
|
|
373
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixDirective, decorators: [{
|
|
374
61
|
type: Directive,
|
|
375
62
|
args: [{
|
|
376
63
|
selector: '[daffPrefix]',
|
|
64
|
+
host: {
|
|
65
|
+
class: 'daff-prefix',
|
|
66
|
+
},
|
|
377
67
|
}]
|
|
378
|
-
}]
|
|
379
|
-
type: HostBinding,
|
|
380
|
-
args: ['class.daff-prefix']
|
|
381
|
-
}] } });
|
|
68
|
+
}] });
|
|
382
69
|
|
|
383
70
|
/**
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
* `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`.
|
|
387
73
|
*/
|
|
388
74
|
class DaffSuffixDirective {
|
|
389
|
-
constructor() {
|
|
390
|
-
/**
|
|
391
|
-
* @docs-private
|
|
392
|
-
*/
|
|
393
|
-
this.class = true;
|
|
394
|
-
}
|
|
395
75
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
396
|
-
/** @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 }); }
|
|
397
77
|
}
|
|
398
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSuffixDirective, decorators: [{
|
|
399
79
|
type: Directive,
|
|
400
80
|
args: [{
|
|
401
81
|
selector: '[daffSuffix]',
|
|
82
|
+
host: {
|
|
83
|
+
class: 'daff-suffix',
|
|
84
|
+
},
|
|
402
85
|
}]
|
|
403
|
-
}]
|
|
404
|
-
type: HostBinding,
|
|
405
|
-
args: ['class.daff-suffix']
|
|
406
|
-
}] } });
|
|
86
|
+
}] });
|
|
407
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated in favor of standalone components. Deprecated in version 0.91.0. Will be removed in version 1.0.0.
|
|
90
|
+
*/
|
|
408
91
|
class DaffPrefixSuffixModule {
|
|
409
92
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
410
93
|
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffPrefixSuffixModule, imports: [DaffPrefixDirective,
|
|
@@ -426,6 +109,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
426
109
|
}]
|
|
427
110
|
}] });
|
|
428
111
|
|
|
112
|
+
const DAFF_PREFIX_SUFFIX_DIRECTIVES = [
|
|
113
|
+
DaffPrefixDirective,
|
|
114
|
+
DaffSuffixDirective,
|
|
115
|
+
];
|
|
116
|
+
|
|
429
117
|
/**
|
|
430
118
|
* Enumerates the available color palette options for a component.
|
|
431
119
|
* These values can be used to apply specific color styles to components within the application.
|
|
@@ -544,23 +232,6 @@ const validateColor = (color) => {
|
|
|
544
232
|
* ```
|
|
545
233
|
*/
|
|
546
234
|
class DaffColorableDirective {
|
|
547
|
-
/**
|
|
548
|
-
* Dynamically sets the CSS classes based on the color.
|
|
549
|
-
* @docs-private
|
|
550
|
-
*/
|
|
551
|
-
get class() {
|
|
552
|
-
return {
|
|
553
|
-
'daff-primary': this.color === DaffPaletteEnum.Primary,
|
|
554
|
-
'daff-secondary': this.color === DaffPaletteEnum.Secondary,
|
|
555
|
-
'daff-tertiary': this.color === DaffPaletteEnum.Tertiary,
|
|
556
|
-
'daff-light': this.color === DaffPaletteEnum.Light,
|
|
557
|
-
'daff-dark': this.color === DaffPaletteEnum.Dark,
|
|
558
|
-
'daff-theme': this.color === DaffPaletteEnum.Theme,
|
|
559
|
-
'daff-theme-contrast': this.color === DaffPaletteEnum.ThemeContrast,
|
|
560
|
-
'daff-black': this.color === DaffPaletteEnum.Black,
|
|
561
|
-
'daff-white': this.color === DaffPaletteEnum.White,
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
235
|
/**
|
|
565
236
|
* @docs-private
|
|
566
237
|
*/
|
|
@@ -579,17 +250,25 @@ class DaffColorableDirective {
|
|
|
579
250
|
}
|
|
580
251
|
}
|
|
581
252
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffColorableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
582
|
-
/** @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 }); }
|
|
583
254
|
}
|
|
584
255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffColorableDirective, decorators: [{
|
|
585
256
|
type: Directive,
|
|
586
257
|
args: [{
|
|
587
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
|
+
},
|
|
588
270
|
}]
|
|
589
|
-
}], propDecorators: {
|
|
590
|
-
type: HostBinding,
|
|
591
|
-
args: ['class']
|
|
592
|
-
}], color: [{
|
|
271
|
+
}], propDecorators: { color: [{
|
|
593
272
|
type: Input
|
|
594
273
|
}] } });
|
|
595
274
|
|
|
@@ -675,7 +354,6 @@ const validateStatus = (status) => {
|
|
|
675
354
|
*
|
|
676
355
|
* ```ts
|
|
677
356
|
* @Component({
|
|
678
|
-
* standalone: true,
|
|
679
357
|
* selector: 'custom-component',
|
|
680
358
|
* template: 'custom-component.html',
|
|
681
359
|
* hostDirectives: [
|
|
@@ -704,18 +382,6 @@ const validateStatus = (status) => {
|
|
|
704
382
|
* - `daff-success`: Applied when the status is `success`.
|
|
705
383
|
*/
|
|
706
384
|
class DaffStatusableDirective {
|
|
707
|
-
/**
|
|
708
|
-
* Dynamically sets the CSS classes based on the status.
|
|
709
|
-
* @docs-private
|
|
710
|
-
*/
|
|
711
|
-
get class() {
|
|
712
|
-
return {
|
|
713
|
-
'daff-info': this.status === DaffStatusEnum.Info,
|
|
714
|
-
'daff-warn': this.status === DaffStatusEnum.Warn,
|
|
715
|
-
'daff-critical': this.status === DaffStatusEnum.Critical,
|
|
716
|
-
'daff-success': this.status === DaffStatusEnum.Success,
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
385
|
/**
|
|
720
386
|
* @docs-private
|
|
721
387
|
*/
|
|
@@ -729,22 +395,25 @@ class DaffStatusableDirective {
|
|
|
729
395
|
*/
|
|
730
396
|
ngOnInit() {
|
|
731
397
|
validateStatus(this.status);
|
|
732
|
-
if (this.
|
|
398
|
+
if (this.defaultStatus && !this.status) {
|
|
733
399
|
this.status = this.defaultStatus;
|
|
734
400
|
}
|
|
735
401
|
}
|
|
736
402
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStatusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
737
|
-
/** @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 }); }
|
|
738
404
|
}
|
|
739
405
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffStatusableDirective, decorators: [{
|
|
740
406
|
type: Directive,
|
|
741
407
|
args: [{
|
|
742
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
|
+
},
|
|
743
415
|
}]
|
|
744
|
-
}], propDecorators: {
|
|
745
|
-
type: HostBinding,
|
|
746
|
-
args: ['class']
|
|
747
|
-
}], status: [{
|
|
416
|
+
}], propDecorators: { status: [{
|
|
748
417
|
type: Input
|
|
749
418
|
}] } });
|
|
750
419
|
|
|
@@ -766,7 +435,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
766
435
|
*
|
|
767
436
|
* ```ts
|
|
768
437
|
* @Component({
|
|
769
|
-
* standalone: true,
|
|
770
438
|
* selector: 'custom-component',
|
|
771
439
|
* template: 'custom-component.html',
|
|
772
440
|
* hostDirectives: [
|
|
@@ -798,18 +466,18 @@ class DaffSkeletonableDirective {
|
|
|
798
466
|
this.skeleton = false;
|
|
799
467
|
}
|
|
800
468
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSkeletonableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
801
|
-
/** @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 }); }
|
|
802
470
|
}
|
|
803
471
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSkeletonableDirective, decorators: [{
|
|
804
472
|
type: Directive,
|
|
805
473
|
args: [{
|
|
806
474
|
selector: '[daffSkeletonable]',
|
|
475
|
+
host: {
|
|
476
|
+
'[class.daff-skeleton]': 'skeleton',
|
|
477
|
+
},
|
|
807
478
|
}]
|
|
808
479
|
}], propDecorators: { skeleton: [{
|
|
809
480
|
type: Input
|
|
810
|
-
}, {
|
|
811
|
-
type: HostBinding,
|
|
812
|
-
args: ['class.daff-skeleton']
|
|
813
481
|
}] } });
|
|
814
482
|
|
|
815
483
|
var DaffTextAlignmentEnum;
|
|
@@ -852,7 +520,6 @@ const validateTextAlignment = (textAlignment) => {
|
|
|
852
520
|
*
|
|
853
521
|
* ```ts
|
|
854
522
|
* @Component({
|
|
855
|
-
* standalone: true,
|
|
856
523
|
* selector: 'custom-component',
|
|
857
524
|
* template: 'custom-component.html',
|
|
858
525
|
* hostDirectives: [
|
|
@@ -874,16 +541,6 @@ const validateTextAlignment = (textAlignment) => {
|
|
|
874
541
|
* ```
|
|
875
542
|
*/
|
|
876
543
|
class DaffTextAlignableDirective {
|
|
877
|
-
/**
|
|
878
|
-
* @docs-private
|
|
879
|
-
*/
|
|
880
|
-
get class() {
|
|
881
|
-
return {
|
|
882
|
-
'daff-left': this.textAlignment === DaffTextAlignmentEnum.Left,
|
|
883
|
-
'daff-center': this.textAlignment === DaffTextAlignmentEnum.Center,
|
|
884
|
-
'daff-right': this.textAlignment === DaffTextAlignmentEnum.Right,
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
544
|
/**
|
|
888
545
|
* @docs-private
|
|
889
546
|
*/
|
|
@@ -902,17 +559,19 @@ class DaffTextAlignableDirective {
|
|
|
902
559
|
}
|
|
903
560
|
}
|
|
904
561
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTextAlignableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
905
|
-
/** @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 }); }
|
|
906
563
|
}
|
|
907
564
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffTextAlignableDirective, decorators: [{
|
|
908
565
|
type: Directive,
|
|
909
566
|
args: [{
|
|
910
567
|
selector: '[daffTextAlignable]',
|
|
568
|
+
host: {
|
|
569
|
+
'[class.daff-left]': 'textAlignment === "left"',
|
|
570
|
+
'[class.daff-center]': 'textAlignment === "center"',
|
|
571
|
+
'[class.daff-right]': 'textAlignment === "right"',
|
|
572
|
+
},
|
|
911
573
|
}]
|
|
912
|
-
}], propDecorators: {
|
|
913
|
-
type: HostBinding,
|
|
914
|
-
args: ['class']
|
|
915
|
-
}], textAlignment: [{
|
|
574
|
+
}], propDecorators: { textAlignment: [{
|
|
916
575
|
type: Input
|
|
917
576
|
}] } });
|
|
918
577
|
|
|
@@ -934,7 +593,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
934
593
|
*
|
|
935
594
|
* ```ts
|
|
936
595
|
* @Component({
|
|
937
|
-
* standalone: true,
|
|
938
596
|
* selector: 'custom-component',
|
|
939
597
|
* template: 'custom-component.html',
|
|
940
598
|
* hostDirectives: [
|
|
@@ -968,19 +626,18 @@ class DaffCompactableDirective {
|
|
|
968
626
|
this.compact = false;
|
|
969
627
|
}
|
|
970
628
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCompactableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
971
|
-
/** @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 }); }
|
|
972
630
|
}
|
|
973
631
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffCompactableDirective, decorators: [{
|
|
974
632
|
type: Directive,
|
|
975
633
|
args: [{
|
|
976
634
|
selector: '[daffCompactable]',
|
|
977
|
-
|
|
635
|
+
host: {
|
|
636
|
+
'[class.daff-compact]': 'compact',
|
|
637
|
+
},
|
|
978
638
|
}]
|
|
979
639
|
}], propDecorators: { compact: [{
|
|
980
640
|
type: Input
|
|
981
|
-
}, {
|
|
982
|
-
type: HostBinding,
|
|
983
|
-
args: ['class.daff-compact']
|
|
984
641
|
}] } });
|
|
985
642
|
|
|
986
643
|
/**
|
|
@@ -1025,7 +682,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1025
682
|
*
|
|
1026
683
|
* ```ts
|
|
1027
684
|
* @Component({
|
|
1028
|
-
* standalone: true,
|
|
1029
685
|
* selector: 'my-custom-component',
|
|
1030
686
|
* template: 'my-custom-component.html',
|
|
1031
687
|
* hostDirectives: [{ directive: DaffManageContainerLayoutDirective }],
|
|
@@ -1042,25 +698,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1042
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.
|
|
1043
699
|
*/
|
|
1044
700
|
class DaffManageContainerLayoutDirective {
|
|
1045
|
-
constructor() {
|
|
1046
|
-
/**
|
|
1047
|
-
* @docs-private
|
|
1048
|
-
*/
|
|
1049
|
-
this.class = true;
|
|
1050
|
-
}
|
|
1051
701
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffManageContainerLayoutDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1052
|
-
/** @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 }); }
|
|
1053
703
|
}
|
|
1054
704
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffManageContainerLayoutDirective, decorators: [{
|
|
1055
705
|
type: Directive,
|
|
1056
706
|
args: [{
|
|
1057
707
|
selector: '[daffManageContainerLayout]',
|
|
1058
|
-
|
|
708
|
+
host: {
|
|
709
|
+
class: 'daff-manage-container-layout',
|
|
710
|
+
},
|
|
1059
711
|
}]
|
|
1060
|
-
}]
|
|
1061
|
-
type: HostBinding,
|
|
1062
|
-
args: ['class.daff-manage-container-layout']
|
|
1063
|
-
}] } });
|
|
712
|
+
}] });
|
|
1064
713
|
|
|
1065
714
|
/**
|
|
1066
715
|
* `DaffArticleEncapsulatedDirective` is used to encapsulate custom components within an article,
|
|
@@ -1076,7 +725,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1076
725
|
*
|
|
1077
726
|
* ```ts
|
|
1078
727
|
* @Component({
|
|
1079
|
-
* standalone: true,
|
|
1080
728
|
* selector: 'custom-component',
|
|
1081
729
|
* template: 'custom-component.html',
|
|
1082
730
|
* hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
|
|
@@ -1087,25 +735,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1087
735
|
* This directive will apply the `daff-ae` class to the component, ensuring that it is encapsulated from the article's styles.
|
|
1088
736
|
*/
|
|
1089
737
|
class DaffArticleEncapsulatedDirective {
|
|
1090
|
-
constructor() {
|
|
1091
|
-
/**
|
|
1092
|
-
* @docs-private
|
|
1093
|
-
*/
|
|
1094
|
-
this.class = true;
|
|
1095
|
-
}
|
|
1096
738
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleEncapsulatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1097
|
-
/** @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 }); }
|
|
1098
740
|
}
|
|
1099
741
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffArticleEncapsulatedDirective, decorators: [{
|
|
1100
742
|
type: Directive,
|
|
1101
743
|
args: [{
|
|
1102
744
|
selector: '[daffArticleEncapsulated]',
|
|
1103
|
-
|
|
745
|
+
host: {
|
|
746
|
+
class: 'daff-ae',
|
|
747
|
+
},
|
|
1104
748
|
}]
|
|
1105
|
-
}]
|
|
1106
|
-
type: HostBinding,
|
|
1107
|
-
args: ['class.daff-ae']
|
|
1108
|
-
}] } });
|
|
749
|
+
}] });
|
|
1109
750
|
|
|
1110
751
|
/**
|
|
1111
752
|
* The possible states of a theme.
|
|
@@ -1481,19 +1122,6 @@ var DaffSizableEnum;
|
|
|
1481
1122
|
* - `daff-xl`: Applied when the size is `xl`.
|
|
1482
1123
|
*/
|
|
1483
1124
|
class DaffSizableDirective {
|
|
1484
|
-
/**
|
|
1485
|
-
* Dynamically sets the CSS classes based on the size.
|
|
1486
|
-
* @docs-private
|
|
1487
|
-
*/
|
|
1488
|
-
get class() {
|
|
1489
|
-
return {
|
|
1490
|
-
'daff-xs': this.size === DaffSizableEnum.XSmall,
|
|
1491
|
-
'daff-sm': this.size === DaffSizableEnum.Small,
|
|
1492
|
-
'daff-md': this.size === DaffSizableEnum.Medium,
|
|
1493
|
-
'daff-lg': this.size === DaffSizableEnum.Large,
|
|
1494
|
-
'daff-xl': this.size === DaffSizableEnum.XLarge,
|
|
1495
|
-
};
|
|
1496
|
-
}
|
|
1497
1125
|
/**
|
|
1498
1126
|
* @docs-private
|
|
1499
1127
|
*/
|
|
@@ -1511,18 +1139,21 @@ class DaffSizableDirective {
|
|
|
1511
1139
|
}
|
|
1512
1140
|
}
|
|
1513
1141
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1514
|
-
/** @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 }); }
|
|
1515
1143
|
}
|
|
1516
1144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSizableDirective, decorators: [{
|
|
1517
1145
|
type: Directive,
|
|
1518
1146
|
args: [{
|
|
1519
1147
|
selector: '[daffSizable]',
|
|
1520
|
-
|
|
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
|
+
},
|
|
1521
1155
|
}]
|
|
1522
|
-
}], propDecorators: {
|
|
1523
|
-
type: HostBinding,
|
|
1524
|
-
args: ['class']
|
|
1525
|
-
}], size: [{
|
|
1156
|
+
}], propDecorators: { size: [{
|
|
1526
1157
|
type: Input
|
|
1527
1158
|
}] } });
|
|
1528
1159
|
|
|
@@ -1634,23 +1265,109 @@ class DaffOpenableDirective {
|
|
|
1634
1265
|
}
|
|
1635
1266
|
}
|
|
1636
1267
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOpenableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1637
|
-
/** @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 }); }
|
|
1638
1269
|
}
|
|
1639
1270
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffOpenableDirective, decorators: [{
|
|
1640
1271
|
type: Directive,
|
|
1641
1272
|
args: [{
|
|
1642
1273
|
selector: '[daffOpenable]',
|
|
1643
|
-
|
|
1274
|
+
host: {
|
|
1275
|
+
'[class.daff-open]': 'open',
|
|
1276
|
+
},
|
|
1644
1277
|
}]
|
|
1645
1278
|
}], propDecorators: { open: [{
|
|
1646
1279
|
type: Input
|
|
1647
|
-
}, {
|
|
1648
|
-
type: HostBinding,
|
|
1649
|
-
args: ['class.daff-open']
|
|
1650
1280
|
}], toggled: [{
|
|
1651
1281
|
type: Output
|
|
1652
1282
|
}] } });
|
|
1653
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
|
+
|
|
1654
1371
|
class DaffSelectableDirective {
|
|
1655
1372
|
constructor(cd) {
|
|
1656
1373
|
this.cd = cd;
|
|
@@ -1659,35 +1376,40 @@ class DaffSelectableDirective {
|
|
|
1659
1376
|
*/
|
|
1660
1377
|
this.selected = false;
|
|
1661
1378
|
/**
|
|
1662
|
-
* An event that fires after the
|
|
1379
|
+
* An event that fires after the component becomes selected.
|
|
1663
1380
|
*/
|
|
1664
1381
|
this.becameSelected = new EventEmitter();
|
|
1665
1382
|
}
|
|
1383
|
+
/**
|
|
1384
|
+
* Selects the component and emits the `becameSelected` event.
|
|
1385
|
+
*/
|
|
1666
1386
|
select() {
|
|
1667
1387
|
this.selected = true;
|
|
1668
1388
|
this.becameSelected.emit();
|
|
1669
1389
|
this.cd.markForCheck();
|
|
1670
1390
|
return this;
|
|
1671
1391
|
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Deselects the component.
|
|
1394
|
+
*/
|
|
1672
1395
|
deselect() {
|
|
1673
1396
|
this.selected = false;
|
|
1674
1397
|
this.cd.markForCheck();
|
|
1675
1398
|
return this;
|
|
1676
1399
|
}
|
|
1677
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 }); }
|
|
1678
|
-
/** @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 }); }
|
|
1679
1402
|
}
|
|
1680
1403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffSelectableDirective, decorators: [{
|
|
1681
1404
|
type: Directive,
|
|
1682
1405
|
args: [{
|
|
1683
1406
|
selector: '[daffSelected]',
|
|
1684
|
-
|
|
1407
|
+
host: {
|
|
1408
|
+
'[class.daff-selected]': 'selected',
|
|
1409
|
+
},
|
|
1685
1410
|
}]
|
|
1686
1411
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { selected: [{
|
|
1687
1412
|
type: Input
|
|
1688
|
-
}, {
|
|
1689
|
-
type: HostBinding,
|
|
1690
|
-
args: ['class.daff-selected']
|
|
1691
1413
|
}], becameSelected: [{
|
|
1692
1414
|
type: Output
|
|
1693
1415
|
}] } });
|
|
@@ -1827,6 +1549,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1827
1549
|
type: Input
|
|
1828
1550
|
}] } });
|
|
1829
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
|
+
|
|
1830
1619
|
// Core
|
|
1831
1620
|
|
|
1832
1621
|
/*
|
|
@@ -1843,5 +1632,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
1843
1632
|
* Generated bundle index. Do not edit.
|
|
1844
1633
|
*/
|
|
1845
1634
|
|
|
1846
|
-
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 };
|
|
1847
1636
|
//# sourceMappingURL=daffodil-design.mjs.map
|