@daffodil/design 0.86.0 → 0.87.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/atoms/form/form-field/action/action.directive.d.ts +9 -0
- package/atoms/form/form-field/form-field/form-field.component.d.ts +33 -1
- package/atoms/form/form-field/form-field.d.ts +2 -1
- package/atoms/form/form-field/public_api.d.ts +1 -0
- package/button/README.md +58 -42
- package/button/button/button-base.directive.d.ts +10 -4
- package/button/button.d.ts +22 -1
- package/button/public_api.d.ts +1 -1
- package/button/src/button/button-base.scss +0 -1
- package/button/src/button/raised/raised-theme.scss +3 -3
- package/core/statusable/statusable.directive.d.ts +22 -2
- package/fesm2022/daffodil-design-article.mjs +2 -2
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +58 -16
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field-examples.mjs +95 -0
- package/fesm2022/daffodil-design-form-field-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-input-examples.mjs +5 -5
- package/fesm2022/daffodil-design-input-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +11 -15
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal-examples.mjs +3 -2
- package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +12 -11
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification-examples.mjs +3 -3
- package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +4 -4
- package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-select-examples.mjs +117 -0
- package/fesm2022/daffodil-design-select-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-select.mjs +431 -0
- package/fesm2022/daffodil-design-select.mjs.map +1 -0
- package/fesm2022/daffodil-design-textarea-examples.mjs +66 -0
- package/fesm2022/daffodil-design-textarea-examples.mjs.map +1 -0
- package/fesm2022/daffodil-design-textarea.mjs +124 -0
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -0
- package/fesm2022/daffodil-design.mjs +135 -11
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form-field/examples/examples.d.ts +3 -0
- package/form-field/examples/form-field-appearances/form-field-appearances.component.d.ts +7 -0
- package/form-field/examples/form-field-with-action/form-field-with-action.component.d.ts +9 -0
- package/form-field/examples/form-field-with-prefix/form-field-with-prefix.component.d.ts +6 -0
- package/form-field/examples/form-field-with-suffix/form-field-with-suffix.component.d.ts +6 -0
- package/form-field/examples/index.d.ts +1 -0
- package/form-field/examples/public_api.d.ts +1 -0
- package/input/input.component.d.ts +4 -8
- package/modal/modal/modal.component.d.ts +5 -3
- package/notification/src/notification-theme.scss +34 -18
- package/package.json +1 -1
- package/scss/theme.scss +8 -0
- package/scss/theming/illuminate/illuminate.scss +2 -0
- package/select/README.md +8 -0
- package/select/animation/select-animation-state.d.ts +7 -0
- package/select/animation/select-animation.d.ts +4 -0
- package/select/animation/state.enum.d.ts +4 -0
- package/select/examples/default-select/default-select.component.d.ts +8 -0
- package/select/examples/disabled-select/disabled-select.component.d.ts +8 -0
- package/select/examples/index.d.ts +1 -0
- package/select/examples/models/address.type.d.ts +7 -0
- package/select/examples/models/addresses.d.ts +2 -0
- package/select/examples/public_api.d.ts +3 -0
- package/select/examples/select-with-error/select-with-error.component.d.ts +8 -0
- package/select/examples/skeleton-select/skeleton-select.component.d.ts +8 -0
- package/select/index.d.ts +1 -0
- package/select/option/context.type.d.ts +17 -0
- package/select/option/option.directive.d.ts +11 -0
- package/select/public_api.d.ts +4 -0
- package/select/select/select.component.d.ts +170 -0
- package/select/select.d.ts +4 -0
- package/select/src/select-theme.scss +75 -0
- package/src/atoms/form/form-field/form-field/form-field-theme.scss +35 -8
- package/textarea/README.md +28 -0
- package/textarea/examples/basic-textarea/basic-textarea.component.d.ts +5 -0
- package/textarea/examples/examples.d.ts +2 -0
- package/textarea/examples/index.d.ts +1 -0
- package/textarea/examples/public_api.d.ts +1 -0
- package/textarea/examples/textarea-disabled/textarea-disabled.component.d.ts +7 -0
- package/textarea/examples/textarea-error/textarea-error.component.d.ts +7 -0
- package/textarea/index.d.ts +1 -0
- package/textarea/public_api.d.ts +1 -0
- package/textarea/textarea.component.d.ts +59 -0
@@ -0,0 +1,124 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { HostBinding, HostListener, Optional, Self, ChangeDetectionStrategy, Component } from '@angular/core';
|
3
|
+
import * as i1 from '@angular/forms';
|
4
|
+
import { merge, of, map } from 'rxjs';
|
5
|
+
import * as i2 from '@daffodil/design';
|
6
|
+
import { DaffFormFieldControl } from '@daffodil/design';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* DaffTextareaComponent provides the same functionality as a native `<textarea>` and contains custom styling and functionality.
|
10
|
+
*/
|
11
|
+
class DaffTextareaComponent extends DaffFormFieldControl {
|
12
|
+
get _id() {
|
13
|
+
return this.formField?.id;
|
14
|
+
}
|
15
|
+
;
|
16
|
+
/**
|
17
|
+
* @docs-private
|
18
|
+
*/
|
19
|
+
get internalId() {
|
20
|
+
return this._id;
|
21
|
+
}
|
22
|
+
/**
|
23
|
+
* @docs-private
|
24
|
+
*/
|
25
|
+
focus() {
|
26
|
+
this.focused = true;
|
27
|
+
this.emitState();
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* @docs-private
|
31
|
+
*/
|
32
|
+
blur() {
|
33
|
+
this.focused = false;
|
34
|
+
this.emitState();
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* @docs-private
|
38
|
+
*/
|
39
|
+
get ariaDescribedBy() {
|
40
|
+
if (this.formField.hasErrorMessage()) {
|
41
|
+
return this.formField.errorMessageId;
|
42
|
+
}
|
43
|
+
else if (this.formField.hasHint()) {
|
44
|
+
return this.formField.hintId;
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
return null;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
constructor(
|
51
|
+
/**
|
52
|
+
* @docs-private
|
53
|
+
*/
|
54
|
+
ngControl, _elementRef, formField) {
|
55
|
+
super(ngControl);
|
56
|
+
this.ngControl = ngControl;
|
57
|
+
this._elementRef = _elementRef;
|
58
|
+
this.formField = formField;
|
59
|
+
/** @docs-private */
|
60
|
+
this.controlType = 'native-textarea';
|
61
|
+
/**
|
62
|
+
* @docs-private
|
63
|
+
*/
|
64
|
+
this.class = true;
|
65
|
+
/**
|
66
|
+
* @docs-private
|
67
|
+
*/
|
68
|
+
this.focused = false;
|
69
|
+
}
|
70
|
+
/** @docs-private */
|
71
|
+
ngOnInit() {
|
72
|
+
this.stateChanges = merge(this._stateChanges.asObservable(), this.ngControl ? this.ngControl.statusChanges : of(undefined)).pipe(map(() => this.state));
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* @docs-private
|
76
|
+
*/
|
77
|
+
onFocus() {
|
78
|
+
this._elementRef.nativeElement.focus();
|
79
|
+
}
|
80
|
+
/**
|
81
|
+
* @docs-private
|
82
|
+
*/
|
83
|
+
get value() {
|
84
|
+
return this._elementRef.nativeElement.value;
|
85
|
+
}
|
86
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffTextareaComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }, { token: i2.DaffFormFieldComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
87
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffTextareaComponent, isStandalone: true, selector: "textarea[daff-textarea]", host: { listeners: { "focus": "focus()", "blur": "blur()" }, properties: { "class.daff-textarea": "this.class", "attr.id": "this.internalId", "attr.aria-describedby": "this.ariaDescribedBy" } }, providers: [
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
89
|
+
{ provide: DaffFormFieldControl, useExisting: DaffTextareaComponent },
|
90
|
+
], usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{background:none;border:none;box-shadow:none;margin:0;padding:0;resize:vertical;min-height:3.5rem;width:100%;box-sizing:border-box}:host:focus{border:none;box-shadow:none;outline:none}:host:disabled{cursor:not-allowed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
91
|
+
}
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffTextareaComponent, decorators: [{
|
93
|
+
type: Component,
|
94
|
+
args: [{ selector: 'textarea[daff-textarea]', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
96
|
+
{ provide: DaffFormFieldControl, useExisting: DaffTextareaComponent },
|
97
|
+
], styles: [":host{background:none;border:none;box-shadow:none;margin:0;padding:0;resize:vertical;min-height:3.5rem;width:100%;box-sizing:border-box}:host:focus{border:none;box-shadow:none;outline:none}:host:disabled{cursor:not-allowed}\n"] }]
|
98
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
99
|
+
type: Optional
|
100
|
+
}, {
|
101
|
+
type: Self
|
102
|
+
}] }, { type: i0.ElementRef }, { type: i2.DaffFormFieldComponent }], propDecorators: { class: [{
|
103
|
+
type: HostBinding,
|
104
|
+
args: ['class.daff-textarea']
|
105
|
+
}], internalId: [{
|
106
|
+
type: HostBinding,
|
107
|
+
args: ['attr.id']
|
108
|
+
}], focus: [{
|
109
|
+
type: HostListener,
|
110
|
+
args: ['focus']
|
111
|
+
}], blur: [{
|
112
|
+
type: HostListener,
|
113
|
+
args: ['blur']
|
114
|
+
}], ariaDescribedBy: [{
|
115
|
+
type: HostBinding,
|
116
|
+
args: ['attr.aria-describedby']
|
117
|
+
}] } });
|
118
|
+
|
119
|
+
/**
|
120
|
+
* Generated bundle index. Do not edit.
|
121
|
+
*/
|
122
|
+
|
123
|
+
export { DaffTextareaComponent };
|
124
|
+
//# sourceMappingURL=daffodil-design-textarea.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"daffodil-design-textarea.mjs","sources":["../../../libs/design/textarea/src/textarea.component.ts","../../../libs/design/textarea/src/daffodil-design-textarea.ts"],"sourcesContent":["import {\n Component,\n Optional,\n Self,\n ElementRef,\n HostListener,\n ChangeDetectionStrategy,\n HostBinding,\n OnInit,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport {\n map,\n merge,\n of,\n} from 'rxjs';\n\nimport {\n DaffFormFieldComponent,\n DaffFormFieldControl,\n} from '@daffodil/design';\n\n/**\n * DaffTextareaComponent provides the same functionality as a native `<textarea>` and contains custom styling and functionality.\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'textarea[daff-textarea]',\n template: '<ng-content></ng-content>',\n styleUrls: ['./textarea.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n { provide: DaffFormFieldControl, useExisting: DaffTextareaComponent },\n ],\n})\nexport class DaffTextareaComponent extends DaffFormFieldControl<string> implements DaffFormFieldControl<string>, OnInit {\n\n /** @docs-private */\n controlType = 'native-textarea';\n\n /**\n * @docs-private\n */\n @HostBinding('class.daff-textarea') class = true;\n\n /**\n * @docs-private\n */\n focused = false;\n\n private get _id() {\n return this.formField?.id;\n };\n\n /**\n * @docs-private\n */\n @HostBinding('attr.id') get internalId() {\n return this._id;\n }\n\n /**\n * @docs-private\n */\n @HostListener('focus') focus() {\n this.focused = true;\n this.emitState();\n }\n\n /**\n * @docs-private\n */\n @HostListener('blur') blur() {\n this.focused = false;\n this.emitState();\n }\n\n /**\n * @docs-private\n */\n @HostBinding('attr.aria-describedby') get ariaDescribedBy() {\n if(this.formField.hasErrorMessage()) {\n return this.formField.errorMessageId;\n } else if(this.formField.hasHint()) {\n return this.formField.hintId;\n } else {\n return null;\n }\n }\n\n constructor(\n /**\n * @docs-private\n */\n @Optional() @Self() public ngControl: NgControl,\n private _elementRef: ElementRef<HTMLInputElement>,\n private formField: DaffFormFieldComponent,\n ) {\n super(ngControl);\n }\n\n /** @docs-private */\n ngOnInit() {\n this.stateChanges = merge(\n this._stateChanges.asObservable(),\n this.ngControl ? this.ngControl.statusChanges : of(undefined),\n ).pipe(\n map(() => this.state),\n );\n }\n\n /**\n * @docs-private\n */\n onFocus() {\n this._elementRef.nativeElement.focus();\n }\n\n /**\n * @docs-private\n */\n get value() {\n return this._elementRef.nativeElement.value;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { HostBinding, Directive, Input, ChangeDetectionStrategy, Component, isDevMode, ContentChild, ViewEncapsulation, NgModule, HostListener, Optional, Self, EventEmitter, ElementRef, Output, ViewChild, ContentChildren, Injectable, InjectionToken, inject, PLATFORM_ID, Inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
|
3
|
+
import { NgTemplateOutlet, CommonModule, isPlatformBrowser, DOCUMENT } from '@angular/common';
|
3
4
|
import { BehaviorSubject, of, fromEventPattern, Subject, merge, fromEvent, EMPTY, combineLatest } from 'rxjs';
|
4
5
|
import * as i1 from '@angular/forms';
|
5
|
-
import { CommonModule, isPlatformBrowser, DOCUMENT } from '@angular/common';
|
6
6
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
7
7
|
import { startWith, map, catchError, filter, shareReplay } from 'rxjs/operators';
|
8
8
|
import { DaffServerSafePersistenceServiceToken } from '@daffodil/core';
|
@@ -204,6 +204,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
204
204
|
args: ['class.validated']
|
205
205
|
}] } });
|
206
206
|
|
207
|
+
class DaffFormFieldActionDirective {
|
208
|
+
constructor() {
|
209
|
+
/**
|
210
|
+
* @docs-private
|
211
|
+
*/
|
212
|
+
this.class = true;
|
213
|
+
}
|
214
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormFieldActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
215
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffFormFieldActionDirective, isStandalone: true, selector: "[daffFormFieldAction]", host: { properties: { "class.daff-form-field-action": "this.class" } }, ngImport: i0 }); }
|
216
|
+
}
|
217
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormFieldActionDirective, decorators: [{
|
218
|
+
type: Directive,
|
219
|
+
args: [{
|
220
|
+
selector: '[daffFormFieldAction]',
|
221
|
+
}]
|
222
|
+
}], propDecorators: { class: [{
|
223
|
+
type: HostBinding,
|
224
|
+
args: ['class.daff-form-field-action']
|
225
|
+
}] } });
|
226
|
+
|
207
227
|
/**
|
208
228
|
*
|
209
229
|
* The class that a form control must **implement** in order to be
|
@@ -261,6 +281,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
261
281
|
}] });
|
262
282
|
|
263
283
|
let daffFormFieldId = 0;
|
284
|
+
var DaffFormFieldApperanaceEnum;
|
285
|
+
(function (DaffFormFieldApperanaceEnum) {
|
286
|
+
DaffFormFieldApperanaceEnum["Fluid"] = "fluid";
|
287
|
+
DaffFormFieldApperanaceEnum["Fixed"] = "fixed";
|
288
|
+
})(DaffFormFieldApperanaceEnum || (DaffFormFieldApperanaceEnum = {}));
|
264
289
|
class DaffFormFieldComponent {
|
265
290
|
/** @docs-private */
|
266
291
|
get isSelectField() {
|
@@ -298,6 +323,7 @@ class DaffFormFieldComponent {
|
|
298
323
|
* form field should be marked as valid.
|
299
324
|
*/
|
300
325
|
this.isValid = false;
|
326
|
+
this._appearance = DaffFormFieldApperanaceEnum.Fluid;
|
301
327
|
/**
|
302
328
|
* The unique id of the form field. Defaults to an autogenerated value. When using this,
|
303
329
|
* it's your responsibility to ensure that the id for each form field is unique.
|
@@ -314,6 +340,18 @@ class DaffFormFieldComponent {
|
|
314
340
|
*/
|
315
341
|
this.errorMessageId = this.id + '-error';
|
316
342
|
}
|
343
|
+
/**
|
344
|
+
* @docs-private
|
345
|
+
*/
|
346
|
+
get hasPrefixClass() {
|
347
|
+
return this._prefix;
|
348
|
+
}
|
349
|
+
/**
|
350
|
+
* @docs-private
|
351
|
+
*/
|
352
|
+
get hasSuffixClass() {
|
353
|
+
return this._suffix || this._action;
|
354
|
+
}
|
317
355
|
/**
|
318
356
|
* @docs-private
|
319
357
|
*/
|
@@ -352,6 +390,39 @@ class DaffFormFieldComponent {
|
|
352
390
|
get raisedClass() {
|
353
391
|
return this._control?.raised || this.isFilled;
|
354
392
|
}
|
393
|
+
/**
|
394
|
+
* The appearance style of a form field, whether the label is fluid or fixed.
|
395
|
+
*/
|
396
|
+
get appearance() {
|
397
|
+
return this._appearance;
|
398
|
+
}
|
399
|
+
set appearance(value) {
|
400
|
+
if (value === null || value === undefined || value === '') {
|
401
|
+
this._appearance = DaffFormFieldApperanaceEnum.Fluid;
|
402
|
+
}
|
403
|
+
else {
|
404
|
+
this._appearance = value;
|
405
|
+
}
|
406
|
+
}
|
407
|
+
;
|
408
|
+
/**
|
409
|
+
* @docs-private
|
410
|
+
*/
|
411
|
+
get fluidClass() {
|
412
|
+
return this._appearance === DaffFormFieldApperanaceEnum.Fluid;
|
413
|
+
}
|
414
|
+
/**
|
415
|
+
* @docs-private
|
416
|
+
*/
|
417
|
+
get fixedClass() {
|
418
|
+
return this._appearance === DaffFormFieldApperanaceEnum.Fixed;
|
419
|
+
}
|
420
|
+
/**
|
421
|
+
* @docs-private
|
422
|
+
*/
|
423
|
+
get isFixed() {
|
424
|
+
return this._appearance === DaffFormFieldApperanaceEnum.Fixed;
|
425
|
+
}
|
355
426
|
/**
|
356
427
|
* @docs-private
|
357
428
|
*/
|
@@ -389,6 +460,10 @@ class DaffFormFieldComponent {
|
|
389
460
|
`2. OR manually set an 'id' on your input and matching 'for' attribute on your <label>.\n\n` +
|
390
461
|
`Why this matters: Proper labelling ensures assistive technologies can identify form fields correctly.`);
|
391
462
|
}
|
463
|
+
if (this._suffix && this._action && !this.isFixed) {
|
464
|
+
console.warn(`UI consideration for form field with id "${this.id}":\n\n` + `In a fluid appearance, avoid using suffix alongside an action.`);
|
465
|
+
}
|
466
|
+
;
|
392
467
|
}
|
393
468
|
}
|
394
469
|
/**
|
@@ -427,25 +502,33 @@ class DaffFormFieldComponent {
|
|
427
502
|
this._validateFormControl();
|
428
503
|
}
|
429
504
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormFieldComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
430
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DaffFormFieldComponent, isStandalone: true, selector: "daff-form-field", inputs: { id: "id" }, host: { properties: { "class.daff-form-field": "this.class", "class.daff-error": "this.errorClass", "class.daff-disabled": "this.disabledClass", "class.daff-valid": "this.validClass", "class.daff-focused": "this.focusedClass", "class.daff-raised": "this.raisedClass" } }, queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }, { propertyName: "_suffix", first: true, predicate: DaffSuffixDirective, descendants: true }, { propertyName: "_control", first: true, predicate: DaffFormFieldControl, descendants: true }, { propertyName: "_formLabelDirective", first: true, predicate: DaffFormLabelDirective, descendants: true }, { propertyName: "_formFieldLabelDirective", first: true, predicate: DaffFormFieldLabelDirective, descendants: true }, { propertyName: "_hint", first: true, predicate: DaffHintComponent, descendants: true }, { propertyName: "_error", first: true, predicate: DaffErrorMessageComponent, descendants: true }], hostDirectives: [{ directive: DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<
|
505
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DaffFormFieldComponent, isStandalone: true, selector: "daff-form-field", inputs: { appearance: "appearance", id: "id" }, host: { properties: { "class.daff-form-field": "this.class", "class.has-prefix": "this.hasPrefixClass", "class.has-suffix": "this.hasSuffixClass", "class.daff-error": "this.errorClass", "class.daff-disabled": "this.disabledClass", "class.daff-valid": "this.validClass", "class.daff-focused": "this.focusedClass", "class.daff-raised": "this.raisedClass", "class.fluid": "this.fluidClass", "class.fixed": "this.fixedClass" } }, queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }, { propertyName: "_suffix", first: true, predicate: DaffSuffixDirective, descendants: true }, { propertyName: "_control", first: true, predicate: DaffFormFieldControl, descendants: true }, { propertyName: "_formLabelDirective", first: true, predicate: DaffFormLabelDirective, descendants: true }, { propertyName: "_formFieldLabelDirective", first: true, predicate: DaffFormFieldLabelDirective, descendants: true }, { propertyName: "_action", first: true, predicate: DaffFormFieldActionDirective, descendants: true }, { propertyName: "_hint", first: true, predicate: DaffHintComponent, descendants: true }, { propertyName: "_error", first: true, predicate: DaffErrorMessageComponent, descendants: true }], hostDirectives: [{ directive: DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<ng-content />\n\n@if (isFixed) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n}\n<div class=\"daff-form-field__wrapper\">\n\t<div class=\"daff-form-field__control\">\n\t\t@if (_prefix) {\n\t\t\t<ng-content select=\"[daffPrefix]\"></ng-content>\n\t\t}\n\t\t<div class=\"daff-form-field__inner\">\n\t\t\t@if (!isFixed) {\n\t\t\t\t<ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n\t\t\t}\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (isSelectField) {\n\t\t\t<div class=\"daff-form-field__icon\"></div>\n\t\t}\n\t\t@if (_suffix) {\n\t\t\t<ng-content select=\"[daffSuffix]\"></ng-content>\n\t\t}\n\t\t@if (_action && !isFixed) {\n\t\t\t<ng-container *ngTemplateOutlet=\"actionTemplate\"></ng-container>\n\t\t}\n\t</div>\n\t@if ((_action && isFixed)) {\n\t\t<ng-container *ngTemplateOutlet=\"actionTemplate\"></ng-container>\n\t}\n</div>\n@if (hasHint()) {\n\t<div\n\t\tclass=\"daff-form-field__hint-wrapper\"\n\t\t[id]=\"hintId\">\n\t\t<ng-content select=\"daff-hint\"></ng-content>\n\t</div>\n}\n@if (hasErrorMessage()) {\n\t<div\n\t\tclass=\"daff-form-field__error-wrapper\"\n\t\t[id]=\"errorMessageId\">\n\t\t<ng-content select=\"daff-error-message\"></ng-content>\n\t</div>\n}\n\n<ng-template #actionTemplate>\n\t<ng-content select=\"[daffFormFieldAction]\"></ng-content>\n</ng-template>\n\n<ng-template #labelTemplate>\n @if (_formLabelDirective) {\n <ng-content select=\"label[daffFormLabel]\"></ng-content>\n } @else if(_formFieldLabelDirective) {\n <label class=\"daff-form-field__label\"\n [attr.for]=\"autoLabelId\"\n [attr.id]=\"customId\">\n <ng-content select=\"daff-form-label\"></ng-content>\n </label>\n } @else {\n <ng-content select=\"label\"></ng-content>\n }\n</ng-template>", styles: [".daff-form-field{display:flex;flex-direction:column;gap:.25rem;position:relative}.daff-form-field.has-prefix .daff-form-field__control{padding-left:0}.daff-form-field.has-suffix .daff-form-field__control{padding-right:0}.daff-form-field__hint-wrapper,.daff-form-field__error-wrapper{display:flex;flex-direction:column;gap:.25rem}.daff-form-field__wrapper{display:flex;gap:.25rem}.daff-form-field__control{display:flex;align-items:center;border-radius:.25rem;font-size:1rem;line-height:1rem;padding:0 1rem;position:relative;width:100%}.daff-form-field__control+.daff-hint,.daff-form-field__control+.daff-error-message{margin-top:.5rem}.daff-form-field.fixed input,.daff-form-field.fixed textarea,.daff-form-field.fixed select{font-size:1rem;line-height:1.5rem;padding:calc(.75rem - 1px) 0}.daff-form-field.fixed input * ::-webkit-input-placeholder,.daff-form-field.fixed textarea * ::-webkit-input-placeholder,.daff-form-field.fixed select * ::-webkit-input-placeholder{opacity:1}.daff-form-field.fluid .daff-form-field__control * ::-webkit-input-placeholder{opacity:0}.daff-form-field.fluid .daff-form-field-action{margin-right:.25rem}.daff-form-field.fluid input,.daff-form-field.fluid textarea,.daff-form-field.fluid select{font-size:1rem;line-height:1.5rem;padding:1rem 0}.daff-form-field.fluid label,.daff-form-field.fluid .daff-form-label,.daff-form-field.fluid .daff-form-field__label{position:absolute;left:0;top:1.25rem;pointer-events:none;transform-origin:left top;transition:transform .15s;overflow:hidden;white-space:nowrap}.daff-form-field.fluid label+input,.daff-form-field.fluid label+textarea,.daff-form-field.fluid label+select,.daff-form-field.fluid .daff-form-label+input,.daff-form-field.fluid .daff-form-label+textarea,.daff-form-field.fluid .daff-form-label+select,.daff-form-field.fluid .daff-form-field__label+input,.daff-form-field.fluid .daff-form-field__label+textarea,.daff-form-field.fluid .daff-form-field__label+select{padding:calc(1.5rem - 1px) 0 calc(.5rem - 1px)}.daff-form-field.fluid.daff-raised label,.daff-form-field.fluid.daff-raised .daff-form-label,.daff-form-field.fluid.daff-raised .daff-form-field__label{transform:translateY(-75%) scale(.75)}.daff-form-field.fluid.daff-raised * ::-webkit-input-placeholder{opacity:1}.daff-form-field.fluid .daff-prefix,.daff-form-field.fluid .daff-suffix{height:3rem;min-width:3rem}.daff-form-field.daff-disabled{cursor:not-allowed;opacity:.5}.daff-form-field__icon{content:\"\";position:absolute;top:48%;right:1rem;display:inline-block;border-right:2px solid currentColor;border-bottom:2px solid currentColor;width:.5rem;height:.5rem;transform:translateY(-50%) rotate(45deg);transition:transform .15s}.daff-form-field__inner{flex-grow:1;position:relative;overflow:hidden}.daff-form-field .daff-prefix,.daff-form-field .daff-suffix{display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:none;height:calc(3rem - 2px);min-width:calc(3rem - 2px)}.daff-form-field.daff-skeleton{display:flex;position:relative;height:3.5rem;width:100%;border-radius:.25rem}.daff-form-field.daff-skeleton:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:3.5rem;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}.daff-form-field.daff-skeleton>*{visibility:hidden}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
431
506
|
}
|
432
507
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormFieldComponent, decorators: [{
|
433
508
|
type: Component,
|
434
|
-
args: [{ selector: 'daff-form-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush,
|
509
|
+
args: [{ selector: 'daff-form-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
510
|
+
NgTemplateOutlet,
|
511
|
+
], hostDirectives: [
|
435
512
|
{
|
436
513
|
directive: DaffSkeletonableDirective,
|
437
514
|
inputs: ['skeleton'],
|
438
515
|
},
|
439
|
-
], template: "<
|
516
|
+
], template: "<ng-content />\n\n@if (isFixed) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n}\n<div class=\"daff-form-field__wrapper\">\n\t<div class=\"daff-form-field__control\">\n\t\t@if (_prefix) {\n\t\t\t<ng-content select=\"[daffPrefix]\"></ng-content>\n\t\t}\n\t\t<div class=\"daff-form-field__inner\">\n\t\t\t@if (!isFixed) {\n\t\t\t\t<ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\n\t\t\t}\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t\t@if (isSelectField) {\n\t\t\t<div class=\"daff-form-field__icon\"></div>\n\t\t}\n\t\t@if (_suffix) {\n\t\t\t<ng-content select=\"[daffSuffix]\"></ng-content>\n\t\t}\n\t\t@if (_action && !isFixed) {\n\t\t\t<ng-container *ngTemplateOutlet=\"actionTemplate\"></ng-container>\n\t\t}\n\t</div>\n\t@if ((_action && isFixed)) {\n\t\t<ng-container *ngTemplateOutlet=\"actionTemplate\"></ng-container>\n\t}\n</div>\n@if (hasHint()) {\n\t<div\n\t\tclass=\"daff-form-field__hint-wrapper\"\n\t\t[id]=\"hintId\">\n\t\t<ng-content select=\"daff-hint\"></ng-content>\n\t</div>\n}\n@if (hasErrorMessage()) {\n\t<div\n\t\tclass=\"daff-form-field__error-wrapper\"\n\t\t[id]=\"errorMessageId\">\n\t\t<ng-content select=\"daff-error-message\"></ng-content>\n\t</div>\n}\n\n<ng-template #actionTemplate>\n\t<ng-content select=\"[daffFormFieldAction]\"></ng-content>\n</ng-template>\n\n<ng-template #labelTemplate>\n @if (_formLabelDirective) {\n <ng-content select=\"label[daffFormLabel]\"></ng-content>\n } @else if(_formFieldLabelDirective) {\n <label class=\"daff-form-field__label\"\n [attr.for]=\"autoLabelId\"\n [attr.id]=\"customId\">\n <ng-content select=\"daff-form-label\"></ng-content>\n </label>\n } @else {\n <ng-content select=\"label\"></ng-content>\n }\n</ng-template>", styles: [".daff-form-field{display:flex;flex-direction:column;gap:.25rem;position:relative}.daff-form-field.has-prefix .daff-form-field__control{padding-left:0}.daff-form-field.has-suffix .daff-form-field__control{padding-right:0}.daff-form-field__hint-wrapper,.daff-form-field__error-wrapper{display:flex;flex-direction:column;gap:.25rem}.daff-form-field__wrapper{display:flex;gap:.25rem}.daff-form-field__control{display:flex;align-items:center;border-radius:.25rem;font-size:1rem;line-height:1rem;padding:0 1rem;position:relative;width:100%}.daff-form-field__control+.daff-hint,.daff-form-field__control+.daff-error-message{margin-top:.5rem}.daff-form-field.fixed input,.daff-form-field.fixed textarea,.daff-form-field.fixed select{font-size:1rem;line-height:1.5rem;padding:calc(.75rem - 1px) 0}.daff-form-field.fixed input * ::-webkit-input-placeholder,.daff-form-field.fixed textarea * ::-webkit-input-placeholder,.daff-form-field.fixed select * ::-webkit-input-placeholder{opacity:1}.daff-form-field.fluid .daff-form-field__control * ::-webkit-input-placeholder{opacity:0}.daff-form-field.fluid .daff-form-field-action{margin-right:.25rem}.daff-form-field.fluid input,.daff-form-field.fluid textarea,.daff-form-field.fluid select{font-size:1rem;line-height:1.5rem;padding:1rem 0}.daff-form-field.fluid label,.daff-form-field.fluid .daff-form-label,.daff-form-field.fluid .daff-form-field__label{position:absolute;left:0;top:1.25rem;pointer-events:none;transform-origin:left top;transition:transform .15s;overflow:hidden;white-space:nowrap}.daff-form-field.fluid label+input,.daff-form-field.fluid label+textarea,.daff-form-field.fluid label+select,.daff-form-field.fluid .daff-form-label+input,.daff-form-field.fluid .daff-form-label+textarea,.daff-form-field.fluid .daff-form-label+select,.daff-form-field.fluid .daff-form-field__label+input,.daff-form-field.fluid .daff-form-field__label+textarea,.daff-form-field.fluid .daff-form-field__label+select{padding:calc(1.5rem - 1px) 0 calc(.5rem - 1px)}.daff-form-field.fluid.daff-raised label,.daff-form-field.fluid.daff-raised .daff-form-label,.daff-form-field.fluid.daff-raised .daff-form-field__label{transform:translateY(-75%) scale(.75)}.daff-form-field.fluid.daff-raised * ::-webkit-input-placeholder{opacity:1}.daff-form-field.fluid .daff-prefix,.daff-form-field.fluid .daff-suffix{height:3rem;min-width:3rem}.daff-form-field.daff-disabled{cursor:not-allowed;opacity:.5}.daff-form-field__icon{content:\"\";position:absolute;top:48%;right:1rem;display:inline-block;border-right:2px solid currentColor;border-bottom:2px solid currentColor;width:.5rem;height:.5rem;transform:translateY(-50%) rotate(45deg);transition:transform .15s}.daff-form-field__inner{flex-grow:1;position:relative;overflow:hidden}.daff-form-field .daff-prefix,.daff-form-field .daff-suffix{display:flex;align-items:center;justify-content:center;appearance:none;background:none;border:none;height:calc(3rem - 2px);min-width:calc(3rem - 2px)}.daff-form-field.daff-skeleton{display:flex;position:relative;height:3.5rem;width:100%;border-radius:.25rem}.daff-form-field.daff-skeleton:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:3.5rem;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}.daff-form-field.daff-skeleton>*{visibility:hidden}\n"] }]
|
440
517
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { class: [{
|
441
518
|
type: HostBinding,
|
442
519
|
args: ['class.daff-form-field']
|
443
520
|
}], _prefix: [{
|
444
521
|
type: ContentChild,
|
445
522
|
args: [DaffPrefixDirective]
|
523
|
+
}], hasPrefixClass: [{
|
524
|
+
type: HostBinding,
|
525
|
+
args: ['class.has-prefix']
|
446
526
|
}], _suffix: [{
|
447
527
|
type: ContentChild,
|
448
528
|
args: [DaffSuffixDirective]
|
529
|
+
}], hasSuffixClass: [{
|
530
|
+
type: HostBinding,
|
531
|
+
args: ['class.has-suffix']
|
449
532
|
}], _control: [{
|
450
533
|
type: ContentChild,
|
451
534
|
args: [DaffFormFieldControl]
|
@@ -455,6 +538,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
455
538
|
}], _formFieldLabelDirective: [{
|
456
539
|
type: ContentChild,
|
457
540
|
args: [DaffFormFieldLabelDirective]
|
541
|
+
}], _action: [{
|
542
|
+
type: ContentChild,
|
543
|
+
args: [DaffFormFieldActionDirective]
|
458
544
|
}], _hint: [{
|
459
545
|
type: ContentChild,
|
460
546
|
args: [DaffHintComponent]
|
@@ -476,6 +562,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
476
562
|
}], raisedClass: [{
|
477
563
|
type: HostBinding,
|
478
564
|
args: ['class.daff-raised']
|
565
|
+
}], appearance: [{
|
566
|
+
type: Input
|
567
|
+
}], fluidClass: [{
|
568
|
+
type: HostBinding,
|
569
|
+
args: ['class.fluid']
|
570
|
+
}], fixedClass: [{
|
571
|
+
type: HostBinding,
|
572
|
+
args: ['class.fixed']
|
479
573
|
}], id: [{
|
480
574
|
type: Input
|
481
575
|
}] } });
|
@@ -561,6 +655,7 @@ const DAFF_FORM_FIELD_COMPONENTS = [
|
|
561
655
|
DaffPrefixDirective,
|
562
656
|
DaffSuffixDirective,
|
563
657
|
DaffFormFieldLabelDirective,
|
658
|
+
DaffFormFieldActionDirective,
|
564
659
|
];
|
565
660
|
|
566
661
|
class DaffNativeSelectComponent extends DaffFormFieldControl {
|
@@ -1332,8 +1427,10 @@ var DaffPaletteEnum;
|
|
1332
1427
|
|
1333
1428
|
const colorInPalette = (color) => Object.values(DaffPaletteEnum).includes(color);
|
1334
1429
|
const validateColor = (color) => {
|
1335
|
-
if (
|
1336
|
-
|
1430
|
+
if (isDevMode()) {
|
1431
|
+
if (color !== undefined && !colorInPalette(color)) {
|
1432
|
+
console.warn(color + ' is not a valid color in DaffPalette');
|
1433
|
+
}
|
1337
1434
|
}
|
1338
1435
|
};
|
1339
1436
|
/**
|
@@ -1507,6 +1604,15 @@ var DaffStatusEnum;
|
|
1507
1604
|
DaffStatusEnum["Success"] = "success";
|
1508
1605
|
})(DaffStatusEnum || (DaffStatusEnum = {}));
|
1509
1606
|
|
1607
|
+
const statusValues = (status) => Object.values(DaffStatusEnum).includes(status);
|
1608
|
+
const validateStatus = (status) => {
|
1609
|
+
if (isDevMode()) {
|
1610
|
+
if (status !== undefined && !statusValues(status)) {
|
1611
|
+
console.warn(`'${status}' is not a valid value of the status property.\n\n` +
|
1612
|
+
`The available values are: info, warn, critical, or success.`);
|
1613
|
+
}
|
1614
|
+
}
|
1615
|
+
};
|
1510
1616
|
/**
|
1511
1617
|
* `DaffStatusableDirective` allows a component to conditionally apply status-specific
|
1512
1618
|
* styles by setting CSS classes based on the specified status. This directive is useful
|
@@ -1563,14 +1669,30 @@ class DaffStatusableDirective {
|
|
1563
1669
|
'daff-success': this.status === DaffStatusEnum.Success,
|
1564
1670
|
};
|
1565
1671
|
}
|
1672
|
+
/**
|
1673
|
+
* @docs-private
|
1674
|
+
*/
|
1675
|
+
ngOnChanges(changes) {
|
1676
|
+
if (!changes.status.currentValue) {
|
1677
|
+
this.status = this.defaultStatus;
|
1678
|
+
}
|
1679
|
+
}
|
1680
|
+
/**
|
1681
|
+
* @docs-private
|
1682
|
+
*/
|
1683
|
+
ngOnInit() {
|
1684
|
+
validateStatus(this.status);
|
1685
|
+
if (this.status !== this.defaultStatus && this.defaultStatus) {
|
1686
|
+
this.status = this.defaultStatus;
|
1687
|
+
}
|
1688
|
+
}
|
1566
1689
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffStatusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
1567
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffStatusableDirective, isStandalone: true, selector: "[daffStatusable]", inputs: { status: "status" }, host: { properties: { "class": "this.class" } }, ngImport: i0 }); }
|
1690
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffStatusableDirective, isStandalone: true, selector: "[daffStatusable]", inputs: { status: "status" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0 }); }
|
1568
1691
|
}
|
1569
1692
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffStatusableDirective, decorators: [{
|
1570
1693
|
type: Directive,
|
1571
1694
|
args: [{
|
1572
1695
|
selector: '[daffStatusable]',
|
1573
|
-
standalone: true,
|
1574
1696
|
}]
|
1575
1697
|
}], propDecorators: { class: [{
|
1576
1698
|
type: HostBinding,
|
@@ -1588,8 +1710,10 @@ var DaffTextAlignmentEnum;
|
|
1588
1710
|
|
1589
1711
|
const textAlignmentValues = (textAlignment) => Object.values(DaffTextAlignmentEnum).includes(textAlignment);
|
1590
1712
|
const validateTextAlignment = (textAlignment) => {
|
1591
|
-
if (
|
1592
|
-
|
1713
|
+
if (isDevMode()) {
|
1714
|
+
if (textAlignment !== undefined && !textAlignmentValues(textAlignment)) {
|
1715
|
+
console.warn(`'${textAlignment}' is not a valid value of the textAlignment property. The available values are: left, center, or right.`);
|
1716
|
+
}
|
1593
1717
|
}
|
1594
1718
|
};
|
1595
1719
|
/**
|
@@ -2473,5 +2597,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
2473
2597
|
* Generated bundle index. Do not edit.
|
2474
2598
|
*/
|
2475
2599
|
|
2476
|
-
export { DAFF_FORM_FIELD_COMPONENTS, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffCheckboxComponent, DaffCheckboxControlValueAccessorDirective, DaffCheckboxModule, DaffCheckboxSetComponent, DaffColorableDirective, DaffCompactableDirective, DaffErrorMessageComponent, DaffErrorMessageModule, DaffErrorStateMatcher, DaffFocusStackService, DaffFormFieldComponent, DaffFormFieldControl, DaffFormFieldLabelDirective, DaffFormFieldModule, DaffFormLabelDirective, DaffFormLabelModule, DaffHintComponent, DaffManageContainerLayoutDirective, DaffNativeSelectComponent, DaffNativeSelectModule, DaffOpenableDirective, DaffPrefixDirective, DaffPrefixSuffixModule, DaffRadioComponent, DaffRadioControlValueAccessorDirective, DaffRadioModule, DaffRadioSetComponent, DaffSelectableDirective, DaffSizableDirective, DaffSizableEnum, DaffSkeletonableDirective, DaffStatusEnum, DaffStatusableDirective, DaffSuffixDirective, DaffTextAlignableDirective, DaffTextAlignmentEnum, DaffTheme, DaffThemingService, NoopBreakpointObserver, SERVER_SAFE_BREAKPOINT_OBSERVER, daffFocusableElementsSelector };
|
2600
|
+
export { DAFF_FORM_FIELD_COMPONENTS, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffCheckboxComponent, DaffCheckboxControlValueAccessorDirective, DaffCheckboxModule, DaffCheckboxSetComponent, DaffColorableDirective, DaffCompactableDirective, DaffErrorMessageComponent, DaffErrorMessageModule, DaffErrorStateMatcher, DaffFocusStackService, DaffFormFieldActionDirective, DaffFormFieldComponent, DaffFormFieldControl, DaffFormFieldLabelDirective, DaffFormFieldModule, DaffFormLabelDirective, DaffFormLabelModule, DaffHintComponent, DaffManageContainerLayoutDirective, DaffNativeSelectComponent, DaffNativeSelectModule, DaffOpenableDirective, DaffPrefixDirective, DaffPrefixSuffixModule, DaffRadioComponent, DaffRadioControlValueAccessorDirective, DaffRadioModule, DaffRadioSetComponent, DaffSelectableDirective, DaffSizableDirective, DaffSizableEnum, DaffSkeletonableDirective, DaffStatusEnum, DaffStatusableDirective, DaffSuffixDirective, DaffTextAlignableDirective, DaffTextAlignmentEnum, DaffTheme, DaffThemingService, NoopBreakpointObserver, SERVER_SAFE_BREAKPOINT_OBSERVER, daffFocusableElementsSelector };
|
2477
2601
|
//# sourceMappingURL=daffodil-design.mjs.map
|