@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
package/index.d.ts
CHANGED
|
@@ -1,180 +1,9 @@
|
|
|
1
|
-
import { UntypedFormControl, UntypedFormArray, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import * as i4 from '@angular/common';
|
|
2
|
+
import { OnChanges, OnInit, SimpleChanges, InjectionToken, Type, EventEmitter, ChangeDetectorRef, OnDestroy, ElementRef, Renderer2 } from '@angular/core';
|
|
5
3
|
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
|
|
6
4
|
import { Observable } from 'rxjs';
|
|
7
5
|
import { DaffPersistenceService } from '@daffodil/core';
|
|
8
|
-
|
|
9
|
-
declare class DaffErrorStateMatcher {
|
|
10
|
-
isErrorState(control: UntypedFormControl, formSubmitted: boolean): boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare class DaffCheckboxComponent {
|
|
14
|
-
private _cdRef;
|
|
15
|
-
/**
|
|
16
|
-
* @docs-private
|
|
17
|
-
*/
|
|
18
|
-
nativeCheckbox: ElementRef<HTMLInputElement>;
|
|
19
|
-
/**
|
|
20
|
-
* The name of the checkbox.
|
|
21
|
-
*/
|
|
22
|
-
name: string;
|
|
23
|
-
/**
|
|
24
|
-
* The value of the checkbox.
|
|
25
|
-
*/
|
|
26
|
-
value: any;
|
|
27
|
-
/**
|
|
28
|
-
* Boolean value to determine whether or not the checkbox is checked.
|
|
29
|
-
*/
|
|
30
|
-
private _checked;
|
|
31
|
-
get checked(): boolean;
|
|
32
|
-
set checked(value: boolean);
|
|
33
|
-
/**
|
|
34
|
-
* The id of the checkbox. Must be unique. If not entered by a user then it is generated.
|
|
35
|
-
*/
|
|
36
|
-
id: string;
|
|
37
|
-
/**
|
|
38
|
-
* The aria-label of the checkbox.
|
|
39
|
-
*/
|
|
40
|
-
label: string;
|
|
41
|
-
/**
|
|
42
|
-
* The aria-labeledby of the checkbox.
|
|
43
|
-
*/
|
|
44
|
-
labeledBy: string;
|
|
45
|
-
/**
|
|
46
|
-
* Event on whether or not the selection has changed.
|
|
47
|
-
*/
|
|
48
|
-
becameChecked: EventEmitter<boolean>;
|
|
49
|
-
becameUnchecked: EventEmitter<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Whether the checkbox is focused
|
|
52
|
-
*/
|
|
53
|
-
focused: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the checkbox is disabled.
|
|
56
|
-
*/
|
|
57
|
-
disabled: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The role of the component. Set to "checkbox".
|
|
60
|
-
*
|
|
61
|
-
* @docs-private
|
|
62
|
-
*/
|
|
63
|
-
role: string;
|
|
64
|
-
/**
|
|
65
|
-
* @docs-private
|
|
66
|
-
*/
|
|
67
|
-
_onChange(val: Event): void;
|
|
68
|
-
/**
|
|
69
|
-
* @docs-private
|
|
70
|
-
*/
|
|
71
|
-
get focusClass(): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* @docs-private
|
|
74
|
-
*/
|
|
75
|
-
get disabledClass(): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Sets focused to false.
|
|
78
|
-
*/
|
|
79
|
-
onBlur(): void;
|
|
80
|
-
/**
|
|
81
|
-
* Sets focused to true.
|
|
82
|
-
*/
|
|
83
|
-
onFocus(): void;
|
|
84
|
-
constructor(_cdRef: ChangeDetectorRef);
|
|
85
|
-
/**
|
|
86
|
-
* Sets checked to true.
|
|
87
|
-
*/
|
|
88
|
-
select(): void;
|
|
89
|
-
/**
|
|
90
|
-
* Sets checked to false
|
|
91
|
-
*/
|
|
92
|
-
deselect(): void;
|
|
93
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCheckboxComponent, never>;
|
|
94
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DaffCheckboxComponent, "daff-checkbox", never, { "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "id": { "alias": "id"; "required": false; }; "label": { "alias": "aria-label"; "required": false; }; "labeledBy": { "alias": "aria-labelledby"; "required": false; }; }, { "becameChecked": "becameChecked"; "becameUnchecked": "becameUnchecked"; }, never, ["*"], false, never>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
declare class DaffCheckboxSetComponent {
|
|
98
|
-
formArray: UntypedFormArray;
|
|
99
|
-
/**
|
|
100
|
-
* The name of the checkbox-set
|
|
101
|
-
*/
|
|
102
|
-
name: string;
|
|
103
|
-
/**
|
|
104
|
-
* The role of the component. Set to "checkbox".
|
|
105
|
-
*
|
|
106
|
-
* @docs-private
|
|
107
|
-
*/
|
|
108
|
-
role: string;
|
|
109
|
-
/**
|
|
110
|
-
* The list of checkboxes in the set.
|
|
111
|
-
*
|
|
112
|
-
* @docs-private
|
|
113
|
-
*/
|
|
114
|
-
checkboxes: QueryList<DaffCheckboxComponent>;
|
|
115
|
-
valueList: EventEmitter<any[]>;
|
|
116
|
-
getValues(): any[];
|
|
117
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCheckboxSetComponent, never>;
|
|
118
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DaffCheckboxSetComponent, "daff-checkbox-set", never, { "formArray": { "alias": "formArray"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, { "valueList": "valueList"; }, ["checkboxes"], ["*"], false, never>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* A directive for binding the DaffCheckboxComponent and the Control Value Accessor.
|
|
123
|
-
*/
|
|
124
|
-
declare class DaffCheckboxControlValueAccessorDirective implements OnInit, ControlValueAccessor {
|
|
125
|
-
_control: NgControl;
|
|
126
|
-
private _checkbox;
|
|
127
|
-
_onChange: (val: any) => void;
|
|
128
|
-
_onTouched: () => void;
|
|
129
|
-
/**
|
|
130
|
-
* The value of the ControlValueAccessor
|
|
131
|
-
*/
|
|
132
|
-
value: any;
|
|
133
|
-
/**
|
|
134
|
-
* The name of the ControlValueAccessor
|
|
135
|
-
*/
|
|
136
|
-
name: string;
|
|
137
|
-
constructor(_control: NgControl, _checkbox: DaffCheckboxComponent);
|
|
138
|
-
/**
|
|
139
|
-
* A lifecycle method called when the directive is initialized.
|
|
140
|
-
*/
|
|
141
|
-
/**
|
|
142
|
-
* @docs-private
|
|
143
|
-
*/
|
|
144
|
-
ngOnInit(): void;
|
|
145
|
-
/**
|
|
146
|
-
* writes a new value down into the component.
|
|
147
|
-
*/
|
|
148
|
-
writeValue(value: any): void;
|
|
149
|
-
/**
|
|
150
|
-
* Registers the change handler
|
|
151
|
-
*/
|
|
152
|
-
registerOnChange(fn: any): void;
|
|
153
|
-
/**
|
|
154
|
-
* Registers the touched handler
|
|
155
|
-
*/
|
|
156
|
-
registerOnTouched(fn: any): void;
|
|
157
|
-
/**
|
|
158
|
-
* Sets the disabled state.
|
|
159
|
-
*/
|
|
160
|
-
setDisabledState?(isDisabled: boolean): void;
|
|
161
|
-
/**
|
|
162
|
-
* calls the child checkbox's select function
|
|
163
|
-
*/
|
|
164
|
-
fireSelect(): void;
|
|
165
|
-
/**
|
|
166
|
-
* calls the child checkbox's deselect function
|
|
167
|
-
*/
|
|
168
|
-
fireDeselect(): void;
|
|
169
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCheckboxControlValueAccessorDirective, [{ optional: true; self: true; }, null]>;
|
|
170
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffCheckboxControlValueAccessorDirective, "daff-checkbox[ngModel], daff-checkbox[formControl], daff-checkbox[formControlName]", never, { "value": { "alias": "value"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, {}, never, never, false, never>;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
declare class DaffCheckboxModule {
|
|
174
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCheckboxModule, never>;
|
|
175
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCheckboxModule, [typeof DaffCheckboxComponent, typeof DaffCheckboxSetComponent, typeof DaffCheckboxControlValueAccessorDirective], [typeof i4.CommonModule], [typeof DaffCheckboxComponent, typeof DaffCheckboxSetComponent, typeof DaffCheckboxControlValueAccessorDirective]>;
|
|
176
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCheckboxModule>;
|
|
177
|
-
}
|
|
6
|
+
import { UntypedFormControl } from '@angular/forms';
|
|
178
7
|
|
|
179
8
|
/**
|
|
180
9
|
* @deprecated in favor of the {@link DaffFormFieldLabelDirective}. Deprecated in version 0.86.0. Will be removed in version 1.0.0.
|
|
@@ -207,39 +36,34 @@ interface AnimationStateWithParams<T = unknown, V = Record<string | number, unkn
|
|
|
207
36
|
}
|
|
208
37
|
|
|
209
38
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* `daff-form-field`, `daff-solo-field`, and `daff-list`.
|
|
39
|
+
* DaffPrefixDirective can be used to place content before another piece of content
|
|
40
|
+
* in components like `DaffFormFieldComponent` or `DaffListComponent`.
|
|
213
41
|
*/
|
|
214
42
|
declare class DaffPrefixDirective {
|
|
215
|
-
/**
|
|
216
|
-
* @docs-private
|
|
217
|
-
*/
|
|
218
|
-
class: boolean;
|
|
219
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffPrefixDirective, never>;
|
|
220
44
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffPrefixDirective, "[daffPrefix]", never, {}, {}, never, never, true, never>;
|
|
221
45
|
}
|
|
222
46
|
|
|
223
47
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* `daff-form-field`, `daff-solo-field`, and `daff-list`.
|
|
48
|
+
* DaffSuffixDirective can be used to place content after another piece of content
|
|
49
|
+
* in components like `DaffFormFieldComponent` or `DaffListComponent`.
|
|
227
50
|
*/
|
|
228
51
|
declare class DaffSuffixDirective {
|
|
229
|
-
/**
|
|
230
|
-
* @docs-private
|
|
231
|
-
*/
|
|
232
|
-
class: boolean;
|
|
233
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSuffixDirective, never>;
|
|
234
53
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffSuffixDirective, "[daffSuffix]", never, {}, {}, never, never, true, never>;
|
|
235
54
|
}
|
|
236
55
|
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated in favor of standalone components. Deprecated in version 0.91.0. Will be removed in version 1.0.0.
|
|
58
|
+
*/
|
|
237
59
|
declare class DaffPrefixSuffixModule {
|
|
238
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffPrefixSuffixModule, never>;
|
|
239
61
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffPrefixSuffixModule, never, [typeof DaffPrefixDirective, typeof DaffSuffixDirective], [typeof DaffPrefixDirective, typeof DaffSuffixDirective]>;
|
|
240
62
|
static ɵinj: i0.ɵɵInjectorDeclaration<DaffPrefixSuffixModule>;
|
|
241
63
|
}
|
|
242
64
|
|
|
65
|
+
declare const DAFF_PREFIX_SUFFIX_DIRECTIVES: readonly [typeof DaffPrefixDirective, typeof DaffSuffixDirective];
|
|
66
|
+
|
|
243
67
|
interface DaffColorable {
|
|
244
68
|
color: DaffPalette;
|
|
245
69
|
}
|
|
@@ -312,29 +136,19 @@ type DaffPalette = 'primary' | 'secondary' | 'tertiary' | 'light' | 'dark' | 'th
|
|
|
312
136
|
* ```
|
|
313
137
|
*/
|
|
314
138
|
declare class DaffColorableDirective implements DaffColorable, OnChanges, OnInit {
|
|
315
|
-
/**
|
|
316
|
-
* Dynamically sets the CSS classes based on the color.
|
|
317
|
-
* @docs-private
|
|
318
|
-
*/
|
|
319
|
-
get class(): {
|
|
320
|
-
'daff-primary': boolean;
|
|
321
|
-
'daff-secondary': boolean;
|
|
322
|
-
'daff-tertiary': boolean;
|
|
323
|
-
'daff-light': boolean;
|
|
324
|
-
'daff-dark': boolean;
|
|
325
|
-
'daff-theme': boolean;
|
|
326
|
-
'daff-theme-contrast': boolean;
|
|
327
|
-
'daff-black': boolean;
|
|
328
|
-
'daff-white': boolean;
|
|
329
|
-
};
|
|
330
139
|
/**
|
|
331
140
|
* Sets the color on a component.
|
|
332
|
-
*
|
|
333
|
-
* Default options are: `primary`, `secondary`, `tertiary`, `light`, `dark`, `theme`, and `theme-contrast`.
|
|
334
141
|
*/
|
|
335
142
|
color: DaffPalette;
|
|
336
143
|
/**
|
|
337
144
|
* Sets a default color.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* constructor(private colorableDirective: DaffColorableDirective) {
|
|
149
|
+
* this.colorableDirective.defaultColor = 'theme';
|
|
150
|
+
* }
|
|
151
|
+
* ```
|
|
338
152
|
*/
|
|
339
153
|
defaultColor: DaffPalette;
|
|
340
154
|
/**
|
|
@@ -393,7 +207,7 @@ interface DaffStatusable {
|
|
|
393
207
|
}
|
|
394
208
|
/**
|
|
395
209
|
* The `DaffStatus` type defines the possible status values that a component can have.
|
|
396
|
-
* - 'info':
|
|
210
|
+
* - 'info': Indicates an informational status.
|
|
397
211
|
* - 'warn': Indicates a warning status.
|
|
398
212
|
* - 'critical': Indicates a critical or error status.
|
|
399
213
|
* - 'success': Indicates a success status.
|
|
@@ -424,7 +238,6 @@ declare enum DaffStatusEnum {
|
|
|
424
238
|
*
|
|
425
239
|
* ```ts
|
|
426
240
|
* @Component({
|
|
427
|
-
* standalone: true,
|
|
428
241
|
* selector: 'custom-component',
|
|
429
242
|
* template: 'custom-component.html',
|
|
430
243
|
* hostDirectives: [
|
|
@@ -453,20 +266,8 @@ declare enum DaffStatusEnum {
|
|
|
453
266
|
* - `daff-success`: Applied when the status is `success`.
|
|
454
267
|
*/
|
|
455
268
|
declare class DaffStatusableDirective implements DaffStatusable, OnChanges, OnInit {
|
|
456
|
-
/**
|
|
457
|
-
* Dynamically sets the CSS classes based on the status.
|
|
458
|
-
* @docs-private
|
|
459
|
-
*/
|
|
460
|
-
get class(): {
|
|
461
|
-
'daff-info': boolean;
|
|
462
|
-
'daff-warn': boolean;
|
|
463
|
-
'daff-critical': boolean;
|
|
464
|
-
'daff-success': boolean;
|
|
465
|
-
};
|
|
466
269
|
/**
|
|
467
270
|
* Sets the status on a component.
|
|
468
|
-
*
|
|
469
|
-
* Options are: `info`, `warn`, `critical`, and `success`.
|
|
470
271
|
*/
|
|
471
272
|
status: DaffStatus;
|
|
472
273
|
/**
|
|
@@ -510,7 +311,6 @@ declare class DaffStatusableDirective implements DaffStatusable, OnChanges, OnIn
|
|
|
510
311
|
*
|
|
511
312
|
* ```ts
|
|
512
313
|
* @Component({
|
|
513
|
-
* standalone: true,
|
|
514
314
|
* selector: 'custom-component',
|
|
515
315
|
* template: 'custom-component.html',
|
|
516
316
|
* hostDirectives: [
|
|
@@ -592,7 +392,6 @@ declare enum DaffTextAlignmentEnum {
|
|
|
592
392
|
*
|
|
593
393
|
* ```ts
|
|
594
394
|
* @Component({
|
|
595
|
-
* standalone: true,
|
|
596
395
|
* selector: 'custom-component',
|
|
597
396
|
* template: 'custom-component.html',
|
|
598
397
|
* hostDirectives: [
|
|
@@ -614,22 +413,19 @@ declare enum DaffTextAlignmentEnum {
|
|
|
614
413
|
* ```
|
|
615
414
|
*/
|
|
616
415
|
declare class DaffTextAlignableDirective implements DaffTextAlignable, OnChanges, OnInit {
|
|
617
|
-
/**
|
|
618
|
-
* @docs-private
|
|
619
|
-
*/
|
|
620
|
-
get class(): {
|
|
621
|
-
'daff-left': boolean;
|
|
622
|
-
'daff-center': boolean;
|
|
623
|
-
'daff-right': boolean;
|
|
624
|
-
};
|
|
625
416
|
/**
|
|
626
417
|
* The text alignment of the component.
|
|
627
|
-
*
|
|
628
|
-
* Options are: `left`, `center`, and `right`.
|
|
629
418
|
*/
|
|
630
419
|
textAlignment: DaffTextAlignment;
|
|
631
420
|
/**
|
|
632
|
-
* Sets a default alignment
|
|
421
|
+
* Sets a default alignment.
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```ts
|
|
425
|
+
* constructor(private textAligmentDirective: DaffTextAlignableDirective) {
|
|
426
|
+
* this.textAligmentDirective.defaultAlignent = 'left';
|
|
427
|
+
* }
|
|
428
|
+
* ```
|
|
633
429
|
*/
|
|
634
430
|
defaultAlignment: DaffTextAlignment;
|
|
635
431
|
/**
|
|
@@ -670,7 +466,6 @@ interface DaffCompactable {
|
|
|
670
466
|
*
|
|
671
467
|
* ```ts
|
|
672
468
|
* @Component({
|
|
673
|
-
* standalone: true,
|
|
674
469
|
* selector: 'custom-component',
|
|
675
470
|
* template: 'custom-component.html',
|
|
676
471
|
* hostDirectives: [
|
|
@@ -747,7 +542,6 @@ declare class DaffCompactableDirective {
|
|
|
747
542
|
*
|
|
748
543
|
* ```ts
|
|
749
544
|
* @Component({
|
|
750
|
-
* standalone: true,
|
|
751
545
|
* selector: 'my-custom-component',
|
|
752
546
|
* template: 'my-custom-component.html',
|
|
753
547
|
* hostDirectives: [{ directive: DaffManageContainerLayoutDirective }],
|
|
@@ -764,10 +558,6 @@ declare class DaffCompactableDirective {
|
|
|
764
558
|
* 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.
|
|
765
559
|
*/
|
|
766
560
|
declare class DaffManageContainerLayoutDirective {
|
|
767
|
-
/**
|
|
768
|
-
* @docs-private
|
|
769
|
-
*/
|
|
770
|
-
class: boolean;
|
|
771
561
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffManageContainerLayoutDirective, never>;
|
|
772
562
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffManageContainerLayoutDirective, "[daffManageContainerLayout]", never, {}, {}, never, never, true, never>;
|
|
773
563
|
}
|
|
@@ -786,7 +576,6 @@ declare class DaffManageContainerLayoutDirective {
|
|
|
786
576
|
*
|
|
787
577
|
* ```ts
|
|
788
578
|
* @Component({
|
|
789
|
-
* standalone: true,
|
|
790
579
|
* selector: 'custom-component',
|
|
791
580
|
* template: 'custom-component.html',
|
|
792
581
|
* hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
|
|
@@ -797,10 +586,6 @@ declare class DaffManageContainerLayoutDirective {
|
|
|
797
586
|
* This directive will apply the `daff-ae` class to the component, ensuring that it is encapsulated from the article's styles.
|
|
798
587
|
*/
|
|
799
588
|
declare class DaffArticleEncapsulatedDirective {
|
|
800
|
-
/**
|
|
801
|
-
* @docs-private
|
|
802
|
-
*/
|
|
803
|
-
class: boolean;
|
|
804
589
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffArticleEncapsulatedDirective, never>;
|
|
805
590
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffArticleEncapsulatedDirective, "[daffArticleEncapsulated]", never, {}, {}, never, never, true, never>;
|
|
806
591
|
}
|
|
@@ -1008,25 +793,19 @@ declare enum DaffSizableEnum {
|
|
|
1008
793
|
* - `daff-xl`: Applied when the size is `xl`.
|
|
1009
794
|
*/
|
|
1010
795
|
declare class DaffSizableDirective<T extends DaffSizeAllType> implements DaffSizable<T>, OnChanges, OnInit {
|
|
1011
|
-
/**
|
|
1012
|
-
* Dynamically sets the CSS classes based on the size.
|
|
1013
|
-
* @docs-private
|
|
1014
|
-
*/
|
|
1015
|
-
get class(): {
|
|
1016
|
-
'daff-xs': boolean;
|
|
1017
|
-
'daff-sm': boolean;
|
|
1018
|
-
'daff-md': boolean;
|
|
1019
|
-
'daff-lg': boolean;
|
|
1020
|
-
'daff-xl': boolean;
|
|
1021
|
-
};
|
|
1022
796
|
/**
|
|
1023
797
|
* The size of the component.
|
|
1024
|
-
*
|
|
1025
|
-
* Options are: `xs`, `sm`, `md`, `lg`, and `xl`.
|
|
1026
798
|
*/
|
|
1027
799
|
size: T;
|
|
1028
800
|
/**
|
|
1029
|
-
* Sets a default size
|
|
801
|
+
* Sets a default size.
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* ```ts
|
|
805
|
+
* constructor(private sizableDirective: DaffSizableDirective) {
|
|
806
|
+
* this.sizableDirective.defaultSize = 'md';
|
|
807
|
+
* }
|
|
808
|
+
* ```
|
|
1030
809
|
*/
|
|
1031
810
|
defaultSize: T;
|
|
1032
811
|
/**
|
|
@@ -1138,6 +917,90 @@ declare class DaffOpenableDirective implements DaffOpenable, OnChanges {
|
|
|
1138
917
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffOpenableDirective, "[daffOpenable]", never, { "open": { "alias": "open"; "required": false; }; }, { "toggled": "toggled"; }, never, never, true, never>;
|
|
1139
918
|
}
|
|
1140
919
|
|
|
920
|
+
/**
|
|
921
|
+
* Interface for giving a component the ability to customize text alignment for component-specific UI.
|
|
922
|
+
*/
|
|
923
|
+
interface DaffOrientable {
|
|
924
|
+
orientation: DaffOrientation;
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* The possible types that can be passed to a DaffOrientable component
|
|
928
|
+
*/
|
|
929
|
+
type DaffOrientation = 'horizontal' | 'vertical';
|
|
930
|
+
declare enum DaffOrientationEnum {
|
|
931
|
+
Horizontal = "horizontal",
|
|
932
|
+
Vertical = "vertical"
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* `DaffOrientableDirective` allows for dynamic orientation of a component by
|
|
937
|
+
* setting CSS classes based on the specified orientation. This directive is
|
|
938
|
+
* useful when orientation needs to be managed dynamically in an Angular component.
|
|
939
|
+
*
|
|
940
|
+
* @example Implementing it as an attribute directive
|
|
941
|
+
*
|
|
942
|
+
* ```html
|
|
943
|
+
* <div daffOrientable [orientation]="horizontal"></div>
|
|
944
|
+
* ```
|
|
945
|
+
*
|
|
946
|
+
* In this example, the `daff-horizontal` class is added to the `div` element, allowing
|
|
947
|
+
* you to style the `div` as you wish using the class.
|
|
948
|
+
*
|
|
949
|
+
* @example Implementing it as an Angular host directive
|
|
950
|
+
*
|
|
951
|
+
* ```ts
|
|
952
|
+
* @Component({
|
|
953
|
+
* selector: 'custom-component',
|
|
954
|
+
* template: 'custom-component.html',
|
|
955
|
+
* hostDirectives: [
|
|
956
|
+
* {
|
|
957
|
+
* directive: DaffOrientableDirective,
|
|
958
|
+
* inputs: ['orientation'],
|
|
959
|
+
* },
|
|
960
|
+
* ],
|
|
961
|
+
* })
|
|
962
|
+
* export class CustomComponent { }
|
|
963
|
+
* ```
|
|
964
|
+
*
|
|
965
|
+
* ```scss
|
|
966
|
+
* .custom-component {
|
|
967
|
+
* &.daff-vertical {
|
|
968
|
+
* display: flex;
|
|
969
|
+
* flex-direction: column;
|
|
970
|
+
* }
|
|
971
|
+
* }
|
|
972
|
+
* ```
|
|
973
|
+
*/
|
|
974
|
+
declare class DaffOrientableDirective implements DaffOrientable, OnChanges, OnInit {
|
|
975
|
+
/**
|
|
976
|
+
* The orientation of the component.
|
|
977
|
+
*
|
|
978
|
+
* Options are: `horizontal` and `vertical`.
|
|
979
|
+
*/
|
|
980
|
+
orientation: DaffOrientation;
|
|
981
|
+
/**
|
|
982
|
+
* Sets a default orientation.
|
|
983
|
+
*
|
|
984
|
+
* @example
|
|
985
|
+
* ```ts
|
|
986
|
+
* constructor(private orientableDirective: DaffOrientableDirective) {
|
|
987
|
+
* this.orientableDirective.defaultOrientation = 'horizontal';
|
|
988
|
+
* }
|
|
989
|
+
* ```
|
|
990
|
+
*/
|
|
991
|
+
defaultOrientation: DaffOrientation;
|
|
992
|
+
/**
|
|
993
|
+
* @docs-private
|
|
994
|
+
*/
|
|
995
|
+
ngOnInit(): void;
|
|
996
|
+
/**
|
|
997
|
+
* @docs-private
|
|
998
|
+
*/
|
|
999
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
1000
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffOrientableDirective, never>;
|
|
1001
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffOrientableDirective, "[daffOrientable]", never, { "orientation": { "alias": "orientation"; "required": false; }; }, {}, never, never, true, never>;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1141
1004
|
/**
|
|
1142
1005
|
* An interface for giving a component the ability to display a selected UI.
|
|
1143
1006
|
* In order to be selectable, the class must implement this property.
|
|
@@ -1153,11 +1016,17 @@ declare class DaffSelectableDirective implements DaffSelectable {
|
|
|
1153
1016
|
*/
|
|
1154
1017
|
selected: boolean;
|
|
1155
1018
|
/**
|
|
1156
|
-
* An event that fires after the
|
|
1019
|
+
* An event that fires after the component becomes selected.
|
|
1157
1020
|
*/
|
|
1158
1021
|
becameSelected: EventEmitter<void>;
|
|
1159
1022
|
constructor(cd: ChangeDetectorRef);
|
|
1023
|
+
/**
|
|
1024
|
+
* Selects the component and emits the `becameSelected` event.
|
|
1025
|
+
*/
|
|
1160
1026
|
select(): this;
|
|
1027
|
+
/**
|
|
1028
|
+
* Deselects the component.
|
|
1029
|
+
*/
|
|
1161
1030
|
deselect(): this;
|
|
1162
1031
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffSelectableDirective, never>;
|
|
1163
1032
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffSelectableDirective, "[daffSelected]", never, { "selected": { "alias": "selected"; "required": false; }; }, { "becameSelected": "becameSelected"; }, never, never, true, never>;
|
|
@@ -1185,5 +1054,57 @@ declare class DaffStickyTrackerDirective implements OnDestroy {
|
|
|
1185
1054
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffStickyTrackerDirective, "[daffStickyTracker]", never, { "sticky": { "alias": "sticky"; "required": false; }; }, {}, never, never, true, never>;
|
|
1186
1055
|
}
|
|
1187
1056
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1057
|
+
/**
|
|
1058
|
+
* `DaffDisableableDirective` allows a component to display a disabled UI
|
|
1059
|
+
* by conditionally applying a CSS class. This is useful for indicating to
|
|
1060
|
+
* users that content is loading or being processed. This directive can be used to
|
|
1061
|
+
* apply a disabled UI to any component by toggling the `disabled`
|
|
1062
|
+
* input property. When `disabled` is `true`, the `daff-disabled` CSS class
|
|
1063
|
+
* is applied, which should style the component to look like it's not interactable.
|
|
1064
|
+
*
|
|
1065
|
+
* @example Implementing it as an attribute directive
|
|
1066
|
+
*
|
|
1067
|
+
* ```html
|
|
1068
|
+
* <div daffDisableable [disabled]="isDisabled">Content</div>
|
|
1069
|
+
* ```
|
|
1070
|
+
*
|
|
1071
|
+
* @example Implementing it as an Angular host directive
|
|
1072
|
+
*
|
|
1073
|
+
* ```ts
|
|
1074
|
+
* @Component({
|
|
1075
|
+
* selector: 'custom-component',
|
|
1076
|
+
* template: 'custom-component.html',
|
|
1077
|
+
* hostDirectives: [
|
|
1078
|
+
* {
|
|
1079
|
+
* directive: DaffDisableableDirective,
|
|
1080
|
+
* inputs: ['disabled'],
|
|
1081
|
+
* },
|
|
1082
|
+
* ],
|
|
1083
|
+
* })
|
|
1084
|
+
* export class CustomComponent { }
|
|
1085
|
+
* ```
|
|
1086
|
+
*
|
|
1087
|
+
* ```scss
|
|
1088
|
+
* :host {
|
|
1089
|
+
* .daff-disabled {
|
|
1090
|
+
* cursor: not-allowed;
|
|
1091
|
+
* opacity: 0.5;
|
|
1092
|
+
* }
|
|
1093
|
+
* }
|
|
1094
|
+
* ```
|
|
1095
|
+
*
|
|
1096
|
+
* The directive applies the `daff-disabled` class to the component. The class should be
|
|
1097
|
+
* defined in your styles to display the loading state as desired.
|
|
1098
|
+
*/
|
|
1099
|
+
declare class DaffDisableableDirective {
|
|
1100
|
+
disabled: boolean;
|
|
1101
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffDisableableDirective, never>;
|
|
1102
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffDisableableDirective, "[daffDisableable]", never, { "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
declare class DaffErrorStateMatcher {
|
|
1106
|
+
isErrorState(control: UntypedFormControl, formSubmitted: boolean): boolean;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
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 };
|
|
1110
|
+
export type { AnimationStateWithParams, Constructor, DaffColorable, DaffCompactable, DaffLazyComponent, DaffMutable, DaffOpenable, DaffOrientable, DaffOrientation, DaffPalette, DaffSelectable, DaffSizable, DaffSizeAllType, DaffSizeLargeType, DaffSizeMediumType, DaffSizeSmallType, DaffSizeXLargeType, DaffSizeXSmallType, DaffStatus, DaffStatusable, DaffTextAlignable, DaffTextAlignment };
|
package/input/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Input
|
|
2
|
-
|
|
2
|
+
Input works alongside the native HTML input element, with additional custom styling and functionality.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
|
|
5
|
+
Input has the same functionality as a native HTML input element, with additional custom styling and functionality. It **cannot** be used by itself and must be contained within a [form field](/libs/design/form-field/README.md).
|
|
6
6
|
|
|
7
7
|
<design-land-example-viewer-container example="input-with-form-field"></design-land-example-viewer-container>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
### Within a standalone component
|
|
12
|
-
To use
|
|
12
|
+
To use input in a standalone component, import `DaffInputComponent` directly into your custom component:
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
15
|
import { DaffInputComponent } from '@daffodil/design/input';
|
|
@@ -25,7 +25,7 @@ export class CustomComponent {}
|
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### Within a module (deprecated)
|
|
28
|
-
To use
|
|
28
|
+
To use input in a module, import `DaffInputModule` into your custom module:
|
|
29
29
|
|
|
30
30
|
```ts
|
|
31
31
|
import { NgModule } from '@angular/core';
|
|
@@ -33,7 +33,7 @@ import { DaffInputModule } from '@daffodil/design/input';
|
|
|
33
33
|
import { CustomComponent } from './custom.component';
|
|
34
34
|
|
|
35
35
|
@NgModule({
|
|
36
|
-
|
|
36
|
+
declarations: [
|
|
37
37
|
CustomComponent,
|
|
38
38
|
],
|
|
39
39
|
exports: [
|
|
@@ -46,21 +46,41 @@ import { CustomComponent } from './custom.component';
|
|
|
46
46
|
export class CustomComponentModule { }
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
> **Warning**
|
|
50
|
+
>
|
|
49
51
|
> This method is deprecated. It's recommended to update all custom components to standalone.
|
|
50
52
|
|
|
51
|
-
##
|
|
53
|
+
## Anatomy
|
|
54
|
+
Input must be used inside `<daff-form-field>` to enable proper state management and provide enhanced UI features such as hints, error messages, prefixes, and suffixes. The form field component also ensures accessibility compliance. For more details, see the [form field documentation](/libs/design/form-field/README.md).
|
|
52
55
|
|
|
53
|
-
###
|
|
54
|
-
|
|
56
|
+
### Basic structure
|
|
57
|
+
```html
|
|
58
|
+
<daff-form-field>
|
|
59
|
+
<daff-form-label>First Name</daff-form-label>
|
|
60
|
+
<input daff-input type="text" name="first-name" />
|
|
61
|
+
</daff-form-field>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## States
|
|
65
|
+
|
|
66
|
+
### Disabled
|
|
67
|
+
Input can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
|
|
55
68
|
|
|
56
69
|
<design-land-example-viewer-container example="input-disabled"></design-land-example-viewer-container>
|
|
57
70
|
|
|
58
|
-
###
|
|
59
|
-
|
|
71
|
+
### Error
|
|
72
|
+
Input supports validation and error messages through Angular's form validation system. Use `<daff-error-message>` within the form field to display context-specific error messages. Error messages automatically appear when the input is invalid and has been touched or submitted.
|
|
60
73
|
|
|
61
74
|
<design-land-example-viewer-container example="input-error"></design-land-example-viewer-container>
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
|
|
76
|
+
Multiple error messages can be displayed conditionally based on the type of validation error. The form field component handles the styling and positioning of error messages.
|
|
77
|
+
|
|
78
|
+
## Hints
|
|
79
|
+
Hints provide additional context or instructions to help users complete the input field correctly. Use `<daff-hint>` within the form field to display helpful information below the input. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
|
|
65
80
|
|
|
66
81
|
<design-land-example-viewer-container example="input-hint"></design-land-example-viewer-container>
|
|
82
|
+
|
|
83
|
+
## Accessibility
|
|
84
|
+
When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the input using the `for` and `id` attributes.
|
|
85
|
+
|
|
86
|
+
If a `<daff-form-label>` is not specified, use the `<label>` element to associate text with form elements explicitly. The `for` attribute of the label must exactly match the `id` of the form control.
|