@daffodil/design 0.85.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.
Files changed (122) hide show
  1. package/atoms/form/error-message/error-message.component.d.ts +6 -0
  2. package/atoms/form/form-field/action/action.directive.d.ts +9 -0
  3. package/atoms/form/form-field/form-field/form-field.component.d.ts +115 -13
  4. package/atoms/form/form-field/form-field-control.d.ts +2 -0
  5. package/atoms/form/form-field/form-field.d.ts +3 -1
  6. package/atoms/form/form-field/label/label.directive.d.ts +5 -0
  7. package/atoms/form/form-field/public_api.d.ts +2 -0
  8. package/atoms/form/form-label/form-label.directive.d.ts +3 -0
  9. package/atoms/form/hint/hint.component.d.ts +1 -1
  10. package/button/README.md +60 -44
  11. package/button/button/button-base.directive.d.ts +11 -6
  12. package/button/button.d.ts +22 -1
  13. package/button/public_api.d.ts +1 -1
  14. package/button/src/button/button-base.scss +0 -19
  15. package/button/src/button/raised/raised-theme.scss +3 -3
  16. package/core/compactable/compactable.directive.d.ts +3 -0
  17. package/core/openable/openable.directive.d.ts +1 -1
  18. package/core/selectable/selectable.directive.d.ts +3 -1
  19. package/core/sizable/sizable.directive.d.ts +2 -2
  20. package/core/skeletonable/public_api.d.ts +0 -1
  21. package/core/skeletonable/skeletonable.directive.d.ts +3 -0
  22. package/core/statusable/statusable.directive.d.ts +22 -2
  23. package/core/text-alignable/text-alignable.directive.d.ts +9 -5
  24. package/fesm2022/daffodil-design-article.mjs +2 -2
  25. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  26. package/fesm2022/daffodil-design-breadcrumb.mjs +2 -2
  27. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  28. package/fesm2022/daffodil-design-button-examples.mjs +12 -12
  29. package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-button.mjs +61 -43
  31. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-form-field-examples.mjs +95 -0
  33. package/fesm2022/daffodil-design-form-field-examples.mjs.map +1 -0
  34. package/fesm2022/daffodil-design-image.mjs +2 -2
  35. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  36. package/fesm2022/daffodil-design-input-examples.mjs +10 -10
  37. package/fesm2022/daffodil-design-input-examples.mjs.map +1 -1
  38. package/fesm2022/daffodil-design-input.mjs +43 -4
  39. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  40. package/fesm2022/daffodil-design-media-gallery.mjs +2 -2
  41. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  42. package/fesm2022/daffodil-design-modal-examples.mjs +3 -2
  43. package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
  44. package/fesm2022/daffodil-design-modal.mjs +12 -11
  45. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  46. package/fesm2022/daffodil-design-notification-examples.mjs +3 -3
  47. package/fesm2022/daffodil-design-notification-examples.mjs.map +1 -1
  48. package/fesm2022/daffodil-design-quantity-field-examples.mjs +4 -4
  49. package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +1 -1
  50. package/fesm2022/daffodil-design-select-examples.mjs +117 -0
  51. package/fesm2022/daffodil-design-select-examples.mjs.map +1 -0
  52. package/fesm2022/daffodil-design-select.mjs +431 -0
  53. package/fesm2022/daffodil-design-select.mjs.map +1 -0
  54. package/fesm2022/daffodil-design-textarea-examples.mjs +66 -0
  55. package/fesm2022/daffodil-design-textarea-examples.mjs.map +1 -0
  56. package/fesm2022/daffodil-design-textarea.mjs +124 -0
  57. package/fesm2022/daffodil-design-textarea.mjs.map +1 -0
  58. package/fesm2022/daffodil-design-toast-examples.mjs +0 -59
  59. package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-toast.mjs +52 -40
  61. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  62. package/fesm2022/daffodil-design.mjs +357 -103
  63. package/fesm2022/daffodil-design.mjs.map +1 -1
  64. package/form-field/examples/examples.d.ts +3 -0
  65. package/form-field/examples/form-field-appearances/form-field-appearances.component.d.ts +7 -0
  66. package/form-field/examples/form-field-with-action/form-field-with-action.component.d.ts +9 -0
  67. package/form-field/examples/form-field-with-prefix/form-field-with-prefix.component.d.ts +6 -0
  68. package/form-field/examples/form-field-with-suffix/form-field-with-suffix.component.d.ts +6 -0
  69. package/form-field/examples/index.d.ts +1 -0
  70. package/form-field/examples/public_api.d.ts +1 -0
  71. package/input/input.component.d.ts +15 -3
  72. package/modal/modal/modal.component.d.ts +5 -3
  73. package/notification/src/notification-theme.scss +34 -18
  74. package/package.json +1 -1
  75. package/scss/state/skeleton/_mixins.scss +4 -1
  76. package/scss/theme.scss +8 -0
  77. package/scss/theming/contrast/luminance/luminance.scss +3 -3
  78. package/scss/theming/illuminate/illuminate.scss +2 -0
  79. package/select/README.md +8 -0
  80. package/select/animation/select-animation-state.d.ts +7 -0
  81. package/select/animation/select-animation.d.ts +4 -0
  82. package/select/animation/state.enum.d.ts +4 -0
  83. package/select/examples/default-select/default-select.component.d.ts +8 -0
  84. package/select/examples/disabled-select/disabled-select.component.d.ts +8 -0
  85. package/select/examples/index.d.ts +1 -0
  86. package/select/examples/models/address.type.d.ts +7 -0
  87. package/select/examples/models/addresses.d.ts +2 -0
  88. package/select/examples/public_api.d.ts +3 -0
  89. package/select/examples/select-with-error/select-with-error.component.d.ts +8 -0
  90. package/select/examples/skeleton-select/skeleton-select.component.d.ts +8 -0
  91. package/select/index.d.ts +1 -0
  92. package/select/option/context.type.d.ts +17 -0
  93. package/select/option/option.directive.d.ts +11 -0
  94. package/select/public_api.d.ts +4 -0
  95. package/select/select/select.component.d.ts +170 -0
  96. package/select/select.d.ts +4 -0
  97. package/select/src/select-theme.scss +75 -0
  98. package/src/atoms/form/form-field/form-field/form-field-theme.scss +36 -4
  99. package/textarea/README.md +28 -0
  100. package/textarea/examples/basic-textarea/basic-textarea.component.d.ts +5 -0
  101. package/textarea/examples/examples.d.ts +2 -0
  102. package/textarea/examples/index.d.ts +1 -0
  103. package/textarea/examples/public_api.d.ts +1 -0
  104. package/textarea/examples/textarea-disabled/textarea-disabled.component.d.ts +7 -0
  105. package/textarea/examples/textarea-error/textarea-error.component.d.ts +7 -0
  106. package/textarea/index.d.ts +1 -0
  107. package/textarea/public_api.d.ts +1 -0
  108. package/textarea/textarea.component.d.ts +59 -0
  109. package/toast/README.md +21 -1
  110. package/toast/examples/public_api.d.ts +1 -2
  111. package/toast/helpers/toast-position.d.ts +8 -0
  112. package/toast/interfaces/toast-options.d.ts +19 -0
  113. package/toast/interfaces/toast.d.ts +1 -1
  114. package/toast/public_api.d.ts +2 -2
  115. package/toast/service/position-strategy.d.ts +1 -1
  116. package/toast/service/position.service.d.ts +1 -1
  117. package/toast/service/toast.service.d.ts +1 -1
  118. package/toast/toast/toast-provider.d.ts +16 -4
  119. package/toast/toast/toast-template.component.d.ts +1 -1
  120. package/core/skeletonable/skeletonable.d.ts +0 -6
  121. package/toast/examples/toast-positions/toast-positions.component.d.ts +0 -20
  122. package/toast/options/daff-toast-options.d.ts +0 -14
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { HostBinding, Directive, Input, ContentChild, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule, HostListener, Optional, Self, EventEmitter, ElementRef, Output, ViewChild, ContentChildren, Injectable, InjectionToken, inject, PLATFORM_ID, Inject, makeEnvironmentProviders, provideAppInitializer, isDevMode } from '@angular/core';
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';
@@ -107,6 +107,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
107
107
  */
108
108
  class DaffSkeletonableDirective {
109
109
  constructor() {
110
+ /**
111
+ * Controls whether the component displays a skeleton loading state.
112
+ */
110
113
  this.skeleton = false;
111
114
  }
112
115
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffSkeletonableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -116,7 +119,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
116
119
  type: Directive,
117
120
  args: [{
118
121
  selector: '[daffSkeletonable]',
119
- standalone: true,
120
122
  }]
121
123
  }], propDecorators: { skeleton: [{
122
124
  type: Input
@@ -125,6 +127,103 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
125
127
  args: ['class.daff-skeleton']
126
128
  }] } });
127
129
 
130
+ class DaffErrorMessageComponent {
131
+ constructor() {
132
+ /**
133
+ * @docs-private
134
+ */
135
+ this.class = true;
136
+ /**
137
+ * @docs-private
138
+ *
139
+ * Sets the aria-live of an error message to polite.
140
+ */
141
+ this.ariaLive = 'polite';
142
+ }
143
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffErrorMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
144
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffErrorMessageComponent, isStandalone: true, selector: "daff-error-message", host: { properties: { "class.daff-error-message": "this.class", "attr.aria-live": "this.ariaLive" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block;font-size:.875rem;line-height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
145
+ }
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffErrorMessageComponent, decorators: [{
147
+ type: Component,
148
+ args: [{ selector: 'daff-error-message', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;font-size:.875rem;line-height:1rem}\n"] }]
149
+ }], propDecorators: { class: [{
150
+ type: HostBinding,
151
+ args: ['class.daff-error-message']
152
+ }], ariaLive: [{
153
+ type: HostBinding,
154
+ args: ['attr.aria-live']
155
+ }] } });
156
+
157
+ /**
158
+ * @deprecated in favor of the {@link DaffFormFieldLabelDirective}. It will be removed in v1.0.0. Deprecated in version 0.86.0. Will be removed in version 0.89.0.
159
+ */
160
+ class DaffFormLabelDirective {
161
+ constructor() {
162
+ /**
163
+ * @docs-private
164
+ */
165
+ this.class = true;
166
+ }
167
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
168
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffFormLabelDirective, isStandalone: true, selector: "[daffFormLabel]", host: { properties: { "class.daff-form-label": "this.class" } }, ngImport: i0 }); }
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormLabelDirective, decorators: [{
171
+ type: Directive,
172
+ args: [{
173
+ selector: '[daffFormLabel]',
174
+ }]
175
+ }], propDecorators: { class: [{
176
+ type: HostBinding,
177
+ args: ['class.daff-form-label']
178
+ }] } });
179
+
180
+ class DaffHintComponent {
181
+ constructor() {
182
+ /**
183
+ * @docs-private
184
+ */
185
+ this.class = true;
186
+ /**
187
+ * Displays a validated hint UI.
188
+ * */
189
+ this.validated = false;
190
+ }
191
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
192
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffHintComponent, isStandalone: true, selector: "daff-hint", inputs: { validated: "validated" }, host: { properties: { "class.daff-hint": "this.class", "class.validated": "this.validated" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:flex;gap:.25rem;font-size:.875rem;line-height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
193
+ }
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffHintComponent, decorators: [{
195
+ type: Component,
196
+ args: [{ selector: 'daff-hint', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, styles: [":host{display:flex;gap:.25rem;font-size:.875rem;line-height:1rem}\n"] }]
197
+ }], propDecorators: { class: [{
198
+ type: HostBinding,
199
+ args: ['class.daff-hint']
200
+ }], validated: [{
201
+ type: Input
202
+ }, {
203
+ type: HostBinding,
204
+ args: ['class.validated']
205
+ }] } });
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
+
128
227
  /**
129
228
  *
130
229
  * The class that a form control must **implement** in order to be
@@ -143,6 +242,7 @@ class DaffFormFieldControl {
143
242
  ;
144
243
  constructor(ngControl) {
145
244
  this.ngControl = ngControl;
245
+ this.supportsAutoLabelling = true;
146
246
  this._stateChanges = new BehaviorSubject({
147
247
  focused: false,
148
248
  filled: false,
@@ -168,51 +268,111 @@ class DaffFormFieldControl {
168
268
 
169
269
  const DaffFormFieldMissingControlMessage = 'A DaffFormFieldComponent must contain a DaffFormFieldControl';
170
270
 
271
+ class DaffFormFieldLabelDirective {
272
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormFieldLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
273
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffFormFieldLabelDirective, isStandalone: true, selector: "daff-form-label", ngImport: i0 }); }
274
+ }
275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormFieldLabelDirective, decorators: [{
276
+ type: Directive,
277
+ args: [{
278
+ // eslint-disable-next-line @angular-eslint/directive-selector
279
+ selector: 'daff-form-label',
280
+ }]
281
+ }] });
282
+
283
+ let daffFormFieldId = 0;
284
+ var DaffFormFieldApperanaceEnum;
285
+ (function (DaffFormFieldApperanaceEnum) {
286
+ DaffFormFieldApperanaceEnum["Fluid"] = "fluid";
287
+ DaffFormFieldApperanaceEnum["Fixed"] = "fixed";
288
+ })(DaffFormFieldApperanaceEnum || (DaffFormFieldApperanaceEnum = {}));
171
289
  class DaffFormFieldComponent {
172
290
  /** @docs-private */
173
291
  get isSelectField() {
174
292
  return this._control.controlType === 'native-select';
175
293
  }
176
- /**
177
- * @docs-private
178
- */
179
- get errorClass() {
180
- return this.isError;
181
- }
182
- /**
183
- * @docs-private
184
- */
185
- get disabledClass() {
186
- return this.isDisabled;
187
- }
188
- /**
189
- * @docs-private
190
- */
191
- get validClass() {
192
- return this.isValid;
193
- }
194
294
  constructor(cd) {
195
295
  this.cd = cd;
196
296
  /** @docs-private */
197
297
  this.class = true;
198
298
  /**
299
+ * @docs-private
300
+ *
199
301
  * Tracking property to keep a record of whether or not the
200
302
  * form field should be marked as error.
201
303
  */
202
304
  this.isError = false;
203
305
  /**
306
+ * @docs-private
307
+ *
204
308
  * Tracking property to keep a record of whether or not the
205
309
  * form field contains any user input.
206
310
  */
207
311
  this.isFilled = false;
312
+ /**
313
+ * @docs-private
314
+ *
315
+ * Tracking property to keep a record of whether or not the
316
+ * form field should be marked as disabled.
317
+ */
208
318
  this.isDisabled = false;
209
319
  /**
320
+ * @docs-private
321
+ *
210
322
  * Tracking property to keep a record of whether or not the
211
323
  * form field should be marked as valid.
212
324
  */
213
325
  this.isValid = false;
326
+ this._appearance = DaffFormFieldApperanaceEnum.Fluid;
327
+ /**
328
+ * The unique id of the form field. Defaults to an autogenerated value. When using this,
329
+ * it's your responsibility to ensure that the id for each form field is unique.
330
+ *
331
+ * It gets assigned to the `for` attribute on the `<label>` inside of the form field.
332
+ */
333
+ this.id = 'daff-form-field-' + ++daffFormFieldId;
334
+ /**
335
+ * @docs-private
336
+ */
337
+ this.hintId = this.id + '-hint';
338
+ /**
339
+ * @docs-private
340
+ */
341
+ this.errorMessageId = this.id + '-error';
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
+ }
355
+ /**
356
+ * @docs-private
357
+ */
358
+ get errorClass() {
359
+ return this.isError;
360
+ }
361
+ /**
362
+ * @docs-private
363
+ */
364
+ get disabledClass() {
365
+ return this.isDisabled;
366
+ }
367
+ /**
368
+ * @docs-private
369
+ */
370
+ get validClass() {
371
+ return this.isValid;
214
372
  }
215
373
  /**
374
+ * @docs-private
375
+ *
216
376
  * Determines whether or not the form field should display its focused state.
217
377
  */
218
378
  get isFocused() {
@@ -231,7 +391,83 @@ class DaffFormFieldComponent {
231
391
  return this._control?.raised || this.isFilled;
232
392
  }
233
393
  /**
234
- * Validate whether or not the FormField is in a "usable" state.
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
+ }
426
+ /**
427
+ * @docs-private
428
+ */
429
+ hasHint() {
430
+ return this._hint ? true : false;
431
+ }
432
+ /**
433
+ * @docs-private
434
+ */
435
+ hasErrorMessage() {
436
+ return this._error ? true : false;
437
+ }
438
+ /**
439
+ * @docs-private
440
+ */
441
+ get autoLabelId() {
442
+ return this._control.supportsAutoLabelling ? this.id : null;
443
+ }
444
+ /**
445
+ * @docs-private
446
+ */
447
+ get customId() {
448
+ return this._control.supportsAutoLabelling ? null : this.id;
449
+ }
450
+ /**
451
+ * @docs-private
452
+ *
453
+ * Displays a console warning if the `DaffFormFieldLabelDirective` is not used on controls (native HTML control elements) that support auto-labelling.
454
+ */
455
+ ngAfterViewInit() {
456
+ if (isDevMode()) {
457
+ if (!this._formFieldLabelDirective && this._control.supportsAutoLabelling && !(this._control.id)) {
458
+ console.warn(`Accessibility Warning: The form field with id "${this.id}" uses a control that supports auto-labelling, but no <daff-form-label> component was found.\n\n` +
459
+ `1. Add a <daff-form-label> component (recommended)\n` +
460
+ `2. OR manually set an 'id' on your input and matching 'for' attribute on your <label>.\n\n` +
461
+ `Why this matters: Proper labelling ensures assistive technologies can identify form fields correctly.`);
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
+ ;
467
+ }
468
+ }
469
+ /**
470
+ * Validates whether or not the form field is in a "usable" state.
235
471
  */
236
472
  _validateFormControl() {
237
473
  if (!this._control) {
@@ -239,11 +475,11 @@ class DaffFormFieldComponent {
239
475
  }
240
476
  }
241
477
  /**
242
- * Life cycle hook to verify that the form field has an acceptable
478
+ * @docs-private
479
+ *
480
+ * Lifecycle hook to verify that the form field has an acceptable
243
481
  * child control instance. Mostly useful for development-time
244
482
  * validation of usage.
245
- *
246
- * @docs-private
247
483
  */
248
484
  ngAfterContentInit() {
249
485
  this._validateFormControl();
@@ -256,38 +492,61 @@ class DaffFormFieldComponent {
256
492
  });
257
493
  }
258
494
  /**
259
- * Life cycle hook to verify that the form field has an acceptable
495
+ * @docs-private
496
+ *
497
+ * Lifecycle hook to verify that the form field has an acceptable
260
498
  * child control instance. Mostly useful for development-time
261
499
  * validation of usage.
262
- *
263
- * @docs-private
264
500
  */
265
501
  ngAfterContentChecked() {
266
502
  this._validateFormControl();
267
503
  }
268
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 }); }
269
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DaffFormFieldComponent, isStandalone: true, selector: "daff-form-field", 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 }], hostDirectives: [{ directive: DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<div class=\"daff-form-field__control\">\n\t@if (_prefix) {\n\t\t<ng-content select=\"[daffPrefix]\"></ng-content>\n\t}\n\t<div class=\"daff-form-field__form-wrapper\">\n\t\t<ng-content select=\"label[daffFormLabel]\"></ng-content>\n\t\t<ng-content></ng-content>\n\t\t@if (isSelectField) {\n\t\t\t<div class=\"daff-form-field__icon\"></div>\n\t\t}\n\t</div>\n @if (_suffix) {\n\t\t<ng-content select=\"[daffSuffix]\"></ng-content>\n\t}\n</div>\n<ng-content select=\"daff-hint\"></ng-content>\n<ng-content select=\"daff-error-message\"></ng-content>", styles: [".daff-form-field{display:block;position:relative}.daff-form-field .daff-hint,.daff-form-field .daff-error-message{margin-top:.25rem}.daff-form-field__control{display:flex;align-items:center;border-radius:.25rem;font-size:1rem;line-height:1rem;position:relative;width:100%}.daff-form-field__control * ::-webkit-input-placeholder{opacity:0}.daff-form-field__control input,.daff-form-field__control textarea,.daff-form-field__control select{font-size:1rem;line-height:1.5rem;padding:1rem}.daff-form-field__control .daff-form-label{position:absolute;left:1rem;top:1.25rem;pointer-events:none;transform-origin:left top;transition:transform .15s}.daff-form-field__control .daff-form-label+input,.daff-form-field__control .daff-form-label+textarea,.daff-form-field__control .daff-form-label+select{padding:1.5rem 1rem .5rem}.daff-form-field__control+.daff-hint,.daff-form-field__control+.daff-error-message{margin-top:.5rem}.daff-form-field.daff-raised .daff-form-label{transform:translateY(-75%) scale(.75)}.daff-form-field.daff-raised * ::-webkit-input-placeholder{opacity:1}.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__form-wrapper{flex-grow:1;position:relative}.daff-form-field .daff-prefix{padding-left:1rem}.daff-form-field .daff-suffix{padding-right:1rem}.daff-form-field.daff-skeleton{display:flex;position:relative}.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"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
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 }); }
270
506
  }
271
507
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormFieldComponent, decorators: [{
272
508
  type: Component,
273
- args: [{ selector: 'daff-form-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
509
+ args: [{ selector: 'daff-form-field', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
510
+ NgTemplateOutlet,
511
+ ], hostDirectives: [
274
512
  {
275
513
  directive: DaffSkeletonableDirective,
276
514
  inputs: ['skeleton'],
277
515
  },
278
- ], template: "<div class=\"daff-form-field__control\">\n\t@if (_prefix) {\n\t\t<ng-content select=\"[daffPrefix]\"></ng-content>\n\t}\n\t<div class=\"daff-form-field__form-wrapper\">\n\t\t<ng-content select=\"label[daffFormLabel]\"></ng-content>\n\t\t<ng-content></ng-content>\n\t\t@if (isSelectField) {\n\t\t\t<div class=\"daff-form-field__icon\"></div>\n\t\t}\n\t</div>\n @if (_suffix) {\n\t\t<ng-content select=\"[daffSuffix]\"></ng-content>\n\t}\n</div>\n<ng-content select=\"daff-hint\"></ng-content>\n<ng-content select=\"daff-error-message\"></ng-content>", styles: [".daff-form-field{display:block;position:relative}.daff-form-field .daff-hint,.daff-form-field .daff-error-message{margin-top:.25rem}.daff-form-field__control{display:flex;align-items:center;border-radius:.25rem;font-size:1rem;line-height:1rem;position:relative;width:100%}.daff-form-field__control * ::-webkit-input-placeholder{opacity:0}.daff-form-field__control input,.daff-form-field__control textarea,.daff-form-field__control select{font-size:1rem;line-height:1.5rem;padding:1rem}.daff-form-field__control .daff-form-label{position:absolute;left:1rem;top:1.25rem;pointer-events:none;transform-origin:left top;transition:transform .15s}.daff-form-field__control .daff-form-label+input,.daff-form-field__control .daff-form-label+textarea,.daff-form-field__control .daff-form-label+select{padding:1.5rem 1rem .5rem}.daff-form-field__control+.daff-hint,.daff-form-field__control+.daff-error-message{margin-top:.5rem}.daff-form-field.daff-raised .daff-form-label{transform:translateY(-75%) scale(.75)}.daff-form-field.daff-raised * ::-webkit-input-placeholder{opacity:1}.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__form-wrapper{flex-grow:1;position:relative}.daff-form-field .daff-prefix{padding-left:1rem}.daff-form-field .daff-suffix{padding-right:1rem}.daff-form-field.daff-skeleton{display:flex;position:relative}.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"] }]
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"] }]
279
517
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { class: [{
280
518
  type: HostBinding,
281
519
  args: ['class.daff-form-field']
282
520
  }], _prefix: [{
283
521
  type: ContentChild,
284
522
  args: [DaffPrefixDirective]
523
+ }], hasPrefixClass: [{
524
+ type: HostBinding,
525
+ args: ['class.has-prefix']
285
526
  }], _suffix: [{
286
527
  type: ContentChild,
287
528
  args: [DaffSuffixDirective]
529
+ }], hasSuffixClass: [{
530
+ type: HostBinding,
531
+ args: ['class.has-suffix']
288
532
  }], _control: [{
289
533
  type: ContentChild,
290
534
  args: [DaffFormFieldControl]
535
+ }], _formLabelDirective: [{
536
+ type: ContentChild,
537
+ args: [DaffFormLabelDirective]
538
+ }], _formFieldLabelDirective: [{
539
+ type: ContentChild,
540
+ args: [DaffFormFieldLabelDirective]
541
+ }], _action: [{
542
+ type: ContentChild,
543
+ args: [DaffFormFieldActionDirective]
544
+ }], _hint: [{
545
+ type: ContentChild,
546
+ args: [DaffHintComponent]
547
+ }], _error: [{
548
+ type: ContentChild,
549
+ args: [DaffErrorMessageComponent]
291
550
  }], errorClass: [{
292
551
  type: HostBinding,
293
552
  args: ['class.daff-error']
@@ -303,24 +562,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
303
562
  }], raisedClass: [{
304
563
  type: HostBinding,
305
564
  args: ['class.daff-raised']
306
- }] } });
307
-
308
- class DaffErrorMessageComponent {
309
- constructor() {
310
- /**
311
- * @docs-private
312
- */
313
- this.class = true;
314
- }
315
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffErrorMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
316
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffErrorMessageComponent, isStandalone: true, selector: "daff-error-message", host: { properties: { "class.daff-error-message": "this.class" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block;font-size:.875rem;line-height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
317
- }
318
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffErrorMessageComponent, decorators: [{
319
- type: Component,
320
- args: [{ selector: 'daff-error-message', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;font-size:.875rem;line-height:1rem}\n"] }]
321
- }], propDecorators: { class: [{
565
+ }], appearance: [{
566
+ type: Input
567
+ }], fluidClass: [{
322
568
  type: HostBinding,
323
- args: ['class.daff-error-message']
569
+ args: ['class.fluid']
570
+ }], fixedClass: [{
571
+ type: HostBinding,
572
+ args: ['class.fixed']
573
+ }], id: [{
574
+ type: Input
324
575
  }] } });
325
576
 
326
577
  /**
@@ -343,26 +594,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
343
594
  }]
344
595
  }] });
345
596
 
346
- class DaffFormLabelDirective {
347
- constructor() {
348
- /**
349
- * @docs-private
350
- */
351
- this.class = true;
352
- }
353
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
354
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffFormLabelDirective, isStandalone: true, selector: "[daffFormLabel]", host: { properties: { "class.daff-form-label": "this.class" } }, ngImport: i0 }); }
355
- }
356
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffFormLabelDirective, decorators: [{
357
- type: Directive,
358
- args: [{
359
- selector: '[daffFormLabel]',
360
- }]
361
- }], propDecorators: { class: [{
362
- type: HostBinding,
363
- args: ['class.daff-form-label']
364
- }] } });
365
-
366
597
  /**
367
598
  * @deprecated in favor of standalone components. Deprecated in version 0.84.0. Will be removed in version 1.0.0.
368
599
  */
@@ -413,33 +644,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
413
644
  }]
414
645
  }] });
415
646
 
416
- class DaffHintComponent {
417
- constructor() {
418
- /**
419
- * @docs-private
420
- */
421
- this.class = true;
422
- /**
423
- * Whether or not the hint has been validated
424
- * */
425
- this.validated = false;
426
- }
427
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
428
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffHintComponent, isStandalone: true, selector: "daff-hint", inputs: { validated: "validated" }, host: { properties: { "class.daff-hint": "this.class", "class.validated": "this.validated" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:flex;gap:.25rem;font-size:.875rem;line-height:1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
429
- }
430
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffHintComponent, decorators: [{
431
- type: Component,
432
- args: [{ selector: 'daff-hint', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, styles: [":host{display:flex;gap:.25rem;font-size:.875rem;line-height:1rem}\n"] }]
433
- }], propDecorators: { class: [{
434
- type: HostBinding,
435
- args: ['class.daff-hint']
436
- }], validated: [{
437
- type: Input
438
- }, {
439
- type: HostBinding,
440
- args: ['class.validated']
441
- }] } });
442
-
443
647
  /**
444
648
  * @docs-private
445
649
  */
@@ -450,6 +654,8 @@ const DAFF_FORM_FIELD_COMPONENTS = [
450
654
  DaffHintComponent,
451
655
  DaffPrefixDirective,
452
656
  DaffSuffixDirective,
657
+ DaffFormFieldLabelDirective,
658
+ DaffFormFieldActionDirective,
453
659
  ];
454
660
 
455
661
  class DaffNativeSelectComponent extends DaffFormFieldControl {
@@ -1221,8 +1427,10 @@ var DaffPaletteEnum;
1221
1427
 
1222
1428
  const colorInPalette = (color) => Object.values(DaffPaletteEnum).includes(color);
1223
1429
  const validateColor = (color) => {
1224
- if (color !== undefined && !colorInPalette(color)) {
1225
- console.warn(color + ' is not a valid color in DaffPalette');
1430
+ if (isDevMode()) {
1431
+ if (color !== undefined && !colorInPalette(color)) {
1432
+ console.warn(color + ' is not a valid color in DaffPalette');
1433
+ }
1226
1434
  }
1227
1435
  };
1228
1436
  /**
@@ -1396,6 +1604,15 @@ var DaffStatusEnum;
1396
1604
  DaffStatusEnum["Success"] = "success";
1397
1605
  })(DaffStatusEnum || (DaffStatusEnum = {}));
1398
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
+ };
1399
1616
  /**
1400
1617
  * `DaffStatusableDirective` allows a component to conditionally apply status-specific
1401
1618
  * styles by setting CSS classes based on the specified status. This directive is useful
@@ -1452,14 +1669,30 @@ class DaffStatusableDirective {
1452
1669
  'daff-success': this.status === DaffStatusEnum.Success,
1453
1670
  };
1454
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
+ }
1455
1689
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffStatusableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1456
- /** @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 }); }
1457
1691
  }
1458
1692
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffStatusableDirective, decorators: [{
1459
1693
  type: Directive,
1460
1694
  args: [{
1461
1695
  selector: '[daffStatusable]',
1462
- standalone: true,
1463
1696
  }]
1464
1697
  }], propDecorators: { class: [{
1465
1698
  type: HostBinding,
@@ -1475,6 +1708,14 @@ var DaffTextAlignmentEnum;
1475
1708
  DaffTextAlignmentEnum["Right"] = "right";
1476
1709
  })(DaffTextAlignmentEnum || (DaffTextAlignmentEnum = {}));
1477
1710
 
1711
+ const textAlignmentValues = (textAlignment) => Object.values(DaffTextAlignmentEnum).includes(textAlignment);
1712
+ const validateTextAlignment = (textAlignment) => {
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
+ }
1717
+ }
1718
+ };
1478
1719
  /**
1479
1720
  * `DaffTextAlignableDirective` allows for dynamic text alignment of a component by
1480
1721
  * setting CSS classes based on the specified text alignment. This directive is
@@ -1540,6 +1781,15 @@ class DaffTextAlignableDirective {
1540
1781
  this.textAlignment = this.defaultAlignment;
1541
1782
  }
1542
1783
  }
1784
+ /**
1785
+ * @docs-private
1786
+ */
1787
+ ngOnInit() {
1788
+ validateTextAlignment(this.textAlignment);
1789
+ if (!this.textAlignment) {
1790
+ this.textAlignment = this.defaultAlignment;
1791
+ }
1792
+ }
1543
1793
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffTextAlignableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1544
1794
  /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: DaffTextAlignableDirective, isStandalone: true, selector: "[daffTextAlignable]", inputs: { textAlignment: "textAlignment" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0 }); }
1545
1795
  }
@@ -1547,7 +1797,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
1547
1797
  type: Directive,
1548
1798
  args: [{
1549
1799
  selector: '[daffTextAlignable]',
1550
- standalone: true,
1551
1800
  }]
1552
1801
  }], propDecorators: { class: [{
1553
1802
  type: HostBinding,
@@ -1602,6 +1851,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
1602
1851
  */
1603
1852
  class DaffCompactableDirective {
1604
1853
  constructor() {
1854
+ /**
1855
+ * Controls whether the component is compact.
1856
+ */
1605
1857
  this.compact = false;
1606
1858
  }
1607
1859
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffCompactableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -2212,7 +2464,7 @@ const DaffOpenableStateError = '`open` cannot be set as an input property on the
2212
2464
  */
2213
2465
  class DaffOpenableDirective {
2214
2466
  constructor() {
2215
- /** Whether or not a component implementing the directive is open */
2467
+ /** Controls whether the component is open. */
2216
2468
  this.open = false;
2217
2469
  /** Whether or not a component should handle state
2218
2470
  *
@@ -2291,7 +2543,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
2291
2543
  class DaffSelectableDirective {
2292
2544
  constructor(cd) {
2293
2545
  this.cd = cd;
2294
- /** Whether or not a component implementing the directive is selected */
2546
+ /**
2547
+ * Controls whether the component is selected.
2548
+ */
2295
2549
  this.selected = false;
2296
2550
  /**
2297
2551
  * An event that fires after the media element becomes selected.
@@ -2343,5 +2597,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
2343
2597
  * Generated bundle index. Do not edit.
2344
2598
  */
2345
2599
 
2346
- export { DAFF_FORM_FIELD_COMPONENTS, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffCheckboxComponent, DaffCheckboxControlValueAccessorDirective, DaffCheckboxModule, DaffCheckboxSetComponent, DaffColorableDirective, DaffCompactableDirective, DaffErrorMessageComponent, DaffErrorMessageModule, DaffErrorStateMatcher, DaffFocusStackService, DaffFormFieldComponent, DaffFormFieldControl, 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 };
2347
2601
  //# sourceMappingURL=daffodil-design.mjs.map