@daffodil/design 0.91.0 → 0.92.3-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/README.md +26 -38
- package/accordion/index.d.ts +2 -2
- package/article/README.md +66 -46
- package/article/index.d.ts +22 -1
- package/article/src/article-theme.scss +12 -0
- package/breadcrumb/README.md +6 -1
- package/breadcrumb/index.d.ts +65 -11
- package/breadcrumb/src/breadcrumb-theme.scss +1 -1
- package/button/README.md +36 -33
- package/button/index.d.ts +26 -5
- package/button/src/button/basic/button-theme.scss +4 -2
- package/button/src/button/button-base.scss +26 -3
- package/button/src/button/icon/icon-theme.scss +10 -6
- package/button/src/button/raised/raised-theme.scss +4 -2
- package/callout/README.md +15 -27
- package/card/README.md +36 -61
- package/container/README.md +18 -23
- package/fesm2022/daffodil-design-accordion.mjs +13 -13
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +168 -26
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs +180 -28
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +83 -42
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +23 -23
- package/fesm2022/daffodil-design-callout.mjs.map +1 -1
- package/fesm2022/daffodil-design-card.mjs +33 -33
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +13 -13
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -1
- package/fesm2022/daffodil-design-container.mjs +8 -8
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +26 -26
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +9 -9
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-hero.mjs +23 -23
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +8 -8
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +18 -14
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-link-set.mjs +25 -17
- package/fesm2022/daffodil-design-link-set.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +16 -16
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-loading-icon.mjs +8 -8
- package/fesm2022/daffodil-design-loading-icon.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +13 -13
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +223 -60
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +33 -29
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +47 -41
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-navbar.mjs +25 -21
- package/fesm2022/daffodil-design-navbar.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +16 -16
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +7 -7
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +10 -10
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field.mjs +17 -14
- package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +16 -16
- package/fesm2022/daffodil-design-radio.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +6 -6
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +25 -25
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +99 -0
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -0
- package/fesm2022/daffodil-design-switch.mjs +3 -3
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +15 -15
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +7 -7
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet.mjs +6 -8
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +6 -3
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +23 -25
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +152 -103
- package/fesm2022/daffodil-design-tree.mjs.map +1 -1
- package/fesm2022/daffodil-design-youtube-player.mjs +6 -6
- package/fesm2022/daffodil-design-youtube-player.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +385 -326
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form-field/README.md +50 -85
- package/form-field/index.d.ts +11 -9
- package/hero/README.md +5 -5
- package/image/README.md +2 -2
- package/index.d.ts +184 -270
- package/input/README.md +4 -4
- package/input/index.d.ts +4 -3
- package/link-set/index.d.ts +9 -1
- package/list/README.md +2 -2
- package/loading-icon/README.md +1 -1
- package/loading-icon/index.d.ts +1 -1
- package/media-gallery/README.md +3 -3
- package/menu/README.md +107 -10
- package/menu/index.d.ts +143 -11
- package/modal/README.md +1 -1
- package/modal/index.d.ts +23 -15
- package/native-select/README.md +4 -4
- package/native-select/index.d.ts +8 -7
- package/navbar/README.md +23 -17
- package/navbar/index.d.ts +12 -2
- package/navbar/src/navbar-theme.scss +4 -46
- package/notification/README.md +4 -4
- package/package.json +1 -1
- package/paginator/README.md +42 -6
- package/paginator/index.d.ts +4 -2
- package/progress-bar/README.md +3 -3
- package/quantity-field/README.md +4 -4
- package/quantity-field/index.d.ts +4 -1
- package/radio/README.md +1 -1
- package/scss/theme.scss +7 -1
- package/scss/theming/_color-palettes.scss +0 -6
- package/select/README.md +4 -4
- package/sidebar/README.md +6 -6
- package/spinner/README.md +57 -0
- package/spinner/index.d.ts +53 -0
- package/spinner/src/spinner-theme.scss +62 -0
- package/switch/README.md +4 -4
- package/switch/index.d.ts +2 -2
- package/tabs/README.md +1 -1
- package/tabs/index.d.ts +2 -2
- package/tag/README.md +24 -30
- package/tag/index.d.ts +1 -1
- package/text-snippet/README.md +1 -1
- package/text-snippet/src/text-snippet-theme.scss +12 -0
- package/textarea/README.md +4 -4
- package/textarea/index.d.ts +4 -4
- package/toast/README.md +4 -4
- package/tree/README.md +39 -22
- package/tree/index.d.ts +57 -90
package/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { OnChanges, OnInit, SimpleChanges, InjectionToken, Type, EventEmitter, C
|
|
|
3
3
|
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { DaffPersistenceService } from '@daffodil/core';
|
|
6
|
-
import
|
|
6
|
+
import * as i1 from '@angular/cdk/a11y';
|
|
7
|
+
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @deprecated in favor of the {@link DaffFormFieldLabelDirective}. Deprecated in version 0.86.0. Will be removed in version 1.0.0.
|
|
@@ -64,93 +65,34 @@ declare class DaffPrefixSuffixModule {
|
|
|
64
65
|
|
|
65
66
|
declare const DAFF_PREFIX_SUFFIX_DIRECTIVES: readonly [typeof DaffPrefixDirective, typeof DaffSuffixDirective];
|
|
66
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 1.0.0.
|
|
70
|
+
*/
|
|
67
71
|
interface DaffColorable {
|
|
68
|
-
color:
|
|
72
|
+
color: DaffColor;
|
|
69
73
|
}
|
|
70
74
|
/**
|
|
71
|
-
*
|
|
75
|
+
* The available color options.
|
|
76
|
+
*/
|
|
77
|
+
type DaffColor = 'primary' | 'secondary' | 'tertiary' | 'light' | 'dark' | 'theme' | 'theme-contrast' | 'black' | 'white' | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 1.0.0.
|
|
72
80
|
*/
|
|
73
|
-
type DaffPalette =
|
|
81
|
+
type DaffPalette = DaffColor;
|
|
74
82
|
|
|
75
83
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* for applying different color palettes to a component in an Angular application.
|
|
79
|
-
*
|
|
80
|
-
* Supported colors: `primary | secondary | tertiary | light | dark | theme | theme-contrast`
|
|
81
|
-
*
|
|
82
|
-
* | Color | Class |
|
|
83
|
-
* | -------- | ----- |
|
|
84
|
-
* | `primary` | `.daff-primary`|
|
|
85
|
-
* | `secondary` | `.daff-secondary`|
|
|
86
|
-
* | `tertiary` | `.daff-tertiary`|
|
|
87
|
-
* | `light` | `daff-light` |
|
|
88
|
-
* | `dark` | `daff-dark` |
|
|
89
|
-
* | `theme` | `daff-theme`|
|
|
90
|
-
* | `theme-contrast` | `.daff-theme-contrast`|
|
|
91
|
-
*
|
|
92
|
-
* `white` and `black` have been deprecated in favor of `light` and `dark`.
|
|
93
|
-
*
|
|
94
|
-
* @example Implementing it as an attribute directive
|
|
95
|
-
*
|
|
96
|
-
* ```html
|
|
97
|
-
* <div daffColorable [color]="primary">Colored content</div>
|
|
98
|
-
* ```
|
|
99
|
-
*
|
|
100
|
-
* ```scss
|
|
101
|
-
* .div {
|
|
102
|
-
* &.daff-primary {
|
|
103
|
-
* color: daff-color($primary);
|
|
104
|
-
* }
|
|
105
|
-
* }
|
|
106
|
-
* ```
|
|
107
|
-
*
|
|
108
|
-
* In this example, the `daff-primary` class is applied to the `div` element, allowing you to
|
|
109
|
-
* use the color class to style the `div`.
|
|
110
|
-
*
|
|
111
|
-
* @example Implementing it as an Angular host directive
|
|
112
|
-
*
|
|
113
|
-
* ```ts
|
|
114
|
-
* @Component({
|
|
115
|
-
* selector: 'custom-component',
|
|
116
|
-
* template: 'custom-component.html',
|
|
117
|
-
* hostDirectives: [
|
|
118
|
-
* {
|
|
119
|
-
* directive: DaffColorableDirective,
|
|
120
|
-
* inputs: ['color'],
|
|
121
|
-
* },
|
|
122
|
-
* ],
|
|
123
|
-
* })
|
|
124
|
-
* export class CustomComponent {
|
|
125
|
-
* @HostBinding('class.custom-component') class = true;
|
|
126
|
-
* }
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* ```scss
|
|
130
|
-
* .custom-component {
|
|
131
|
-
* &.daff-primary {
|
|
132
|
-
* background: daff-color($primary, 10);
|
|
133
|
-
* color: daff-color($primary, 90);
|
|
134
|
-
* }
|
|
135
|
-
* }
|
|
136
|
-
* ```
|
|
84
|
+
* Enforces consistent use of {@link DaffColor} on a component by applying
|
|
85
|
+
* color-specific CSS classes and validating the color in dev mode.
|
|
137
86
|
*/
|
|
138
|
-
declare class DaffColorableDirective implements
|
|
87
|
+
declare class DaffColorableDirective implements OnChanges, OnInit {
|
|
139
88
|
/**
|
|
140
|
-
*
|
|
89
|
+
* The color of the component.
|
|
141
90
|
*/
|
|
142
|
-
color:
|
|
91
|
+
color: DaffColor;
|
|
143
92
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* constructor(private colorableDirective: DaffColorableDirective) {
|
|
149
|
-
* this.colorableDirective.defaultColor = 'theme';
|
|
150
|
-
* }
|
|
151
|
-
* ```
|
|
93
|
+
* The default color used when no color is set.
|
|
152
94
|
*/
|
|
153
|
-
defaultColor:
|
|
95
|
+
defaultColor: DaffColor;
|
|
154
96
|
/**
|
|
155
97
|
* @docs-private
|
|
156
98
|
*/
|
|
@@ -163,12 +105,21 @@ declare class DaffColorableDirective implements DaffColorable, OnChanges, OnInit
|
|
|
163
105
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffColorableDirective, "[daffColorable]", never, { "color": { "alias": "color"; "required": false; }; }, {}, never, never, true, never>;
|
|
164
106
|
}
|
|
165
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Sensible breakpoints for layouts and interfaces used across `@daffodil/design` components.
|
|
110
|
+
*/
|
|
166
111
|
declare enum DaffBreakpoints {
|
|
112
|
+
/** `min-width: 1920px` */
|
|
167
113
|
DESKTOP = "(min-width: 1920px)",
|
|
114
|
+
/** `min-width: 1440px` */
|
|
168
115
|
LAPTOP = "(min-width: 1440px)",
|
|
116
|
+
/** `min-width: 1200px` */
|
|
169
117
|
SMALL_LAPTOP = "(min-width: 1200px)",
|
|
118
|
+
/** `min-width: 1024px` */
|
|
170
119
|
BIG_TABLET = "(min-width: 1024px)",
|
|
120
|
+
/** `min-width: 768px` */
|
|
171
121
|
TABLET = "(min-width: 768px)",
|
|
122
|
+
/** `min-width: 480px` */
|
|
172
123
|
MOBILE = "(min-width: 480px)"
|
|
173
124
|
}
|
|
174
125
|
|
|
@@ -178,11 +129,22 @@ declare enum DaffBreakpoints {
|
|
|
178
129
|
declare const SERVER_SAFE_BREAKPOINT_OBSERVER: InjectionToken<Omit<BreakpointObserver, never>>;
|
|
179
130
|
|
|
180
131
|
/**
|
|
181
|
-
* A
|
|
132
|
+
* A no-op implementation of Angular CDK's `BreakpointObserver` that always reports
|
|
133
|
+
* no breakpoints as matched. Useful for server-side rendering or testing contexts
|
|
134
|
+
* where browser layout APIs are unavailable.
|
|
182
135
|
*/
|
|
183
136
|
declare class NoopBreakpointObserver implements Omit<BreakpointObserver, never> {
|
|
137
|
+
/**
|
|
138
|
+
* @docs-private
|
|
139
|
+
*/
|
|
184
140
|
ngOnDestroy(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Always returns `false`, indicating that none of the given media queries are active.
|
|
143
|
+
*/
|
|
185
144
|
isMatched(value: string | readonly string[]): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Returns an observable that never emits a `BreakpointState`, making breakpoint-dependent logic inert.
|
|
147
|
+
*/
|
|
186
148
|
observe(value: string | readonly string[]): Observable<BreakpointState>;
|
|
187
149
|
static ɵfac: i0.ɵɵFactoryDeclaration<NoopBreakpointObserver, never>;
|
|
188
150
|
static ɵprov: i0.ɵɵInjectableDeclaration<NoopBreakpointObserver>;
|
|
@@ -344,23 +306,18 @@ declare class DaffSkeletonableDirective {
|
|
|
344
306
|
}
|
|
345
307
|
|
|
346
308
|
/**
|
|
347
|
-
*
|
|
348
|
-
* In order to be mutable, our class must implement this property.
|
|
349
|
-
*/
|
|
350
|
-
interface DaffMutable {
|
|
351
|
-
mutating: boolean;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Interface for giving a component the ability to customize text alignment for component-specific UI.
|
|
309
|
+
* @deprecated Deprecated in version 0.92.1. Will be removed in version 1.0.0.
|
|
356
310
|
*/
|
|
357
311
|
interface DaffTextAlignable {
|
|
358
312
|
textAlignment: DaffTextAlignment;
|
|
359
313
|
}
|
|
360
314
|
/**
|
|
361
|
-
* The
|
|
315
|
+
* * The available text alignment options.
|
|
362
316
|
*/
|
|
363
317
|
type DaffTextAlignment = 'left' | 'center' | 'right';
|
|
318
|
+
/**
|
|
319
|
+
* This enum will be removed from the public api in v1.0.0.
|
|
320
|
+
*/
|
|
364
321
|
declare enum DaffTextAlignmentEnum {
|
|
365
322
|
Left = "left",
|
|
366
323
|
Center = "center",
|
|
@@ -368,49 +325,7 @@ declare enum DaffTextAlignmentEnum {
|
|
|
368
325
|
}
|
|
369
326
|
|
|
370
327
|
/**
|
|
371
|
-
* `DaffTextAlignableDirective`
|
|
372
|
-
* setting CSS classes based on the specified text alignment. This directive is
|
|
373
|
-
* useful when text alignment needs to be managed dynamically in an Angular component.
|
|
374
|
-
*
|
|
375
|
-
* ## Why not just use CSS?
|
|
376
|
-
*
|
|
377
|
-
* While the native CSS `text-align` property can be used for static text alignment,
|
|
378
|
-
* the `DaffTextAlignableDirective` provides a structured and consistent way to handle
|
|
379
|
-
* dynamic text alignment within Angular components in more complex use cases where the
|
|
380
|
-
* application of `text-align: center;` would cause unexpected side effects.
|
|
381
|
-
*
|
|
382
|
-
* @example Implementing it as an attribute directive
|
|
383
|
-
*
|
|
384
|
-
* ```html
|
|
385
|
-
* <div daffTextAlignable textAlignment="center">Aligned text</div>
|
|
386
|
-
* ```
|
|
387
|
-
*
|
|
388
|
-
* In this example, the `daff-center` class is added to the `div` element, allowing
|
|
389
|
-
* you to style the `div` as you wish using the class.
|
|
390
|
-
*
|
|
391
|
-
* @example Implementing it as an Angular host directive
|
|
392
|
-
*
|
|
393
|
-
* ```ts
|
|
394
|
-
* @Component({
|
|
395
|
-
* selector: 'custom-component',
|
|
396
|
-
* template: 'custom-component.html',
|
|
397
|
-
* hostDirectives: [
|
|
398
|
-
* {
|
|
399
|
-
* directive: DaffTextAlignableDirective,
|
|
400
|
-
* inputs: ['textAlignment'],
|
|
401
|
-
* },
|
|
402
|
-
* ],
|
|
403
|
-
* })
|
|
404
|
-
* export class CustomComponent { }
|
|
405
|
-
* ```
|
|
406
|
-
*
|
|
407
|
-
* ```scss
|
|
408
|
-
* .custom-component {
|
|
409
|
-
* &.daff-left {
|
|
410
|
-
* text-align: left;
|
|
411
|
-
* }
|
|
412
|
-
* }
|
|
413
|
-
* ```
|
|
328
|
+
* `DaffTextAlignableDirective` enforces consistent use of text alignment across components.
|
|
414
329
|
*/
|
|
415
330
|
declare class DaffTextAlignableDirective implements DaffTextAlignable, OnChanges, OnInit {
|
|
416
331
|
/**
|
|
@@ -418,14 +333,7 @@ declare class DaffTextAlignableDirective implements DaffTextAlignable, OnChanges
|
|
|
418
333
|
*/
|
|
419
334
|
textAlignment: DaffTextAlignment;
|
|
420
335
|
/**
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
* @example
|
|
424
|
-
* ```ts
|
|
425
|
-
* constructor(private textAligmentDirective: DaffTextAlignableDirective) {
|
|
426
|
-
* this.textAligmentDirective.defaultAlignent = 'left';
|
|
427
|
-
* }
|
|
428
|
-
* ```
|
|
336
|
+
* The default used when no text alignment is set.
|
|
429
337
|
*/
|
|
430
338
|
defaultAlignment: DaffTextAlignment;
|
|
431
339
|
/**
|
|
@@ -441,59 +349,18 @@ declare class DaffTextAlignableDirective implements DaffTextAlignable, OnChanges
|
|
|
441
349
|
}
|
|
442
350
|
|
|
443
351
|
/**
|
|
444
|
-
*
|
|
445
|
-
* In order to be compactable, the class must implement this property.
|
|
352
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 1.0.0.
|
|
446
353
|
*/
|
|
447
354
|
interface DaffCompactable {
|
|
448
355
|
compact: boolean;
|
|
449
356
|
}
|
|
450
357
|
|
|
451
358
|
/**
|
|
452
|
-
*
|
|
453
|
-
* style by toggling a CSS class. This is useful for creating components that can
|
|
454
|
-
* switch between regular and compact styles based on the `compact` property.
|
|
455
|
-
*
|
|
456
|
-
* @example Implementing it as an attribute directive
|
|
457
|
-
*
|
|
458
|
-
* ```html
|
|
459
|
-
* <div daffCompactable [compact]="isCompact">Content goes here</div>
|
|
460
|
-
* ```
|
|
461
|
-
*
|
|
462
|
-
* In this example, the `daff-compact` class is applied to the `div` element when
|
|
463
|
-
* `isCompact` is `true`, making the `div` display its compact state.
|
|
464
|
-
*
|
|
465
|
-
* @example Implementing it as an Angular host directive
|
|
466
|
-
*
|
|
467
|
-
* ```ts
|
|
468
|
-
* @Component({
|
|
469
|
-
* selector: 'custom-component',
|
|
470
|
-
* template: 'custom-component.html',
|
|
471
|
-
* hostDirectives: [
|
|
472
|
-
* {
|
|
473
|
-
* directive: DaffCompactableDirective,
|
|
474
|
-
* inputs: ['compact'],
|
|
475
|
-
* },
|
|
476
|
-
* ],
|
|
477
|
-
* })
|
|
478
|
-
* export class CustomComponent { }
|
|
479
|
-
* ```
|
|
480
|
-
*
|
|
481
|
-
* The directive applies the `daff-compact` class to the component and
|
|
482
|
-
* should be defined in your styles to display the compact state as desired.
|
|
483
|
-
*
|
|
484
|
-
* ```scss
|
|
485
|
-
* :host {
|
|
486
|
-
* padding: 8px 16px;
|
|
487
|
-
*
|
|
488
|
-
* &.daff-compact {
|
|
489
|
-
* padding: 4px 8px;
|
|
490
|
-
* }
|
|
491
|
-
* }
|
|
492
|
-
* ```
|
|
359
|
+
* Enforces consistent use of the compact property.
|
|
493
360
|
*/
|
|
494
361
|
declare class DaffCompactableDirective {
|
|
495
362
|
/**
|
|
496
|
-
*
|
|
363
|
+
* Whether the component is compact.
|
|
497
364
|
*/
|
|
498
365
|
compact: boolean;
|
|
499
366
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCompactableDirective, never>;
|
|
@@ -563,27 +430,7 @@ declare class DaffManageContainerLayoutDirective {
|
|
|
563
430
|
}
|
|
564
431
|
|
|
565
432
|
/**
|
|
566
|
-
* `DaffArticleEncapsulatedDirective`
|
|
567
|
-
* preventing {@link DaffArticleComponent } styles from bleeding into the component.
|
|
568
|
-
*
|
|
569
|
-
* @example Implementing it as an attribute directive
|
|
570
|
-
*
|
|
571
|
-
* ```html
|
|
572
|
-
* <my-custom-component daffArticleEncapsulated></my-custom-component>
|
|
573
|
-
* ```
|
|
574
|
-
*
|
|
575
|
-
* @example Implementing it as an Angular host directive
|
|
576
|
-
*
|
|
577
|
-
* ```ts
|
|
578
|
-
* @Component({
|
|
579
|
-
* selector: 'custom-component',
|
|
580
|
-
* template: 'custom-component.html',
|
|
581
|
-
* hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
|
|
582
|
-
* })
|
|
583
|
-
* export class CustomComponent { }
|
|
584
|
-
* ```
|
|
585
|
-
*
|
|
586
|
-
* This directive will apply the `daff-ae` class to the component, ensuring that it is encapsulated from the article's styles.
|
|
433
|
+
* The `DaffArticleEncapsulatedDirective` prevents {@link DaffArticleComponent } styles from bleeding into custom components nested within an article.
|
|
587
434
|
*/
|
|
588
435
|
declare class DaffArticleEncapsulatedDirective {
|
|
589
436
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffArticleEncapsulatedDirective, never>;
|
|
@@ -918,6 +765,8 @@ declare class DaffOpenableDirective implements DaffOpenable, OnChanges {
|
|
|
918
765
|
}
|
|
919
766
|
|
|
920
767
|
/**
|
|
768
|
+
* @deprecated Deprecated in version 0.92.1. Will be removed in version 1.0.0.
|
|
769
|
+
*
|
|
921
770
|
* Interface for giving a component the ability to customize text alignment for component-specific UI.
|
|
922
771
|
*/
|
|
923
772
|
interface DaffOrientable {
|
|
@@ -927,66 +776,24 @@ interface DaffOrientable {
|
|
|
927
776
|
* The possible types that can be passed to a DaffOrientable component
|
|
928
777
|
*/
|
|
929
778
|
type DaffOrientation = 'horizontal' | 'vertical';
|
|
779
|
+
/**
|
|
780
|
+
* This enum will be removed from the public api in v1.0.0.
|
|
781
|
+
*/
|
|
930
782
|
declare enum DaffOrientationEnum {
|
|
931
783
|
Horizontal = "horizontal",
|
|
932
784
|
Vertical = "vertical"
|
|
933
785
|
}
|
|
934
786
|
|
|
935
787
|
/**
|
|
936
|
-
* `DaffOrientableDirective`
|
|
937
|
-
* setting CSS classes based on the specified orientation. This directive is
|
|
938
|
-
* useful when orientation needs to be managed dynamically in an Angular component.
|
|
939
|
-
*
|
|
940
|
-
* @example Implementing it as an attribute directive
|
|
941
|
-
*
|
|
942
|
-
* ```html
|
|
943
|
-
* <div daffOrientable [orientation]="horizontal"></div>
|
|
944
|
-
* ```
|
|
945
|
-
*
|
|
946
|
-
* In this example, the `daff-horizontal` class is added to the `div` element, allowing
|
|
947
|
-
* you to style the `div` as you wish using the class.
|
|
948
|
-
*
|
|
949
|
-
* @example Implementing it as an Angular host directive
|
|
950
|
-
*
|
|
951
|
-
* ```ts
|
|
952
|
-
* @Component({
|
|
953
|
-
* selector: 'custom-component',
|
|
954
|
-
* template: 'custom-component.html',
|
|
955
|
-
* hostDirectives: [
|
|
956
|
-
* {
|
|
957
|
-
* directive: DaffOrientableDirective,
|
|
958
|
-
* inputs: ['orientation'],
|
|
959
|
-
* },
|
|
960
|
-
* ],
|
|
961
|
-
* })
|
|
962
|
-
* export class CustomComponent { }
|
|
963
|
-
* ```
|
|
964
|
-
*
|
|
965
|
-
* ```scss
|
|
966
|
-
* .custom-component {
|
|
967
|
-
* &.daff-vertical {
|
|
968
|
-
* display: flex;
|
|
969
|
-
* flex-direction: column;
|
|
970
|
-
* }
|
|
971
|
-
* }
|
|
972
|
-
* ```
|
|
788
|
+
* `DaffOrientableDirective`enforces consistent use of orientation across components.
|
|
973
789
|
*/
|
|
974
790
|
declare class DaffOrientableDirective implements DaffOrientable, OnChanges, OnInit {
|
|
975
791
|
/**
|
|
976
792
|
* The orientation of the component.
|
|
977
|
-
*
|
|
978
|
-
* Options are: `horizontal` and `vertical`.
|
|
979
793
|
*/
|
|
980
794
|
orientation: DaffOrientation;
|
|
981
795
|
/**
|
|
982
|
-
*
|
|
983
|
-
*
|
|
984
|
-
* @example
|
|
985
|
-
* ```ts
|
|
986
|
-
* constructor(private orientableDirective: DaffOrientableDirective) {
|
|
987
|
-
* this.orientableDirective.defaultOrientation = 'horizontal';
|
|
988
|
-
* }
|
|
989
|
-
* ```
|
|
796
|
+
* The default used when no orientation is set.
|
|
990
797
|
*/
|
|
991
798
|
defaultOrientation: DaffOrientation;
|
|
992
799
|
/**
|
|
@@ -1055,17 +862,36 @@ declare class DaffStickyTrackerDirective implements OnDestroy {
|
|
|
1055
862
|
}
|
|
1056
863
|
|
|
1057
864
|
/**
|
|
1058
|
-
*
|
|
865
|
+
* Enforces consistent use of the disabled property.
|
|
866
|
+
*/
|
|
867
|
+
declare class DaffDisableableDirective {
|
|
868
|
+
/**
|
|
869
|
+
* Whether the component is disabled.
|
|
870
|
+
*/
|
|
871
|
+
disabled: boolean;
|
|
872
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffDisableableDirective, never>;
|
|
873
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffDisableableDirective, "[daffDisableable]", never, { "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* An interface for any component or directive that can be disabled.
|
|
878
|
+
*/
|
|
879
|
+
interface DaffDisableable {
|
|
880
|
+
disabled: boolean;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* `DaffLoadableDirective` allows a component to display a loading UI
|
|
1059
885
|
* by conditionally applying a CSS class. This is useful for indicating to
|
|
1060
|
-
* users that
|
|
1061
|
-
* apply a
|
|
1062
|
-
* input property. When `
|
|
886
|
+
* users that a user action is being processed. This directive can be used to
|
|
887
|
+
* apply a loading UI to any component by toggling the `loading`
|
|
888
|
+
* input property. When `loading` is `true`, the `daff-loading` CSS class
|
|
1063
889
|
* is applied, which should style the component to look like it's not interactable.
|
|
1064
890
|
*
|
|
1065
891
|
* @example Implementing it as an attribute directive
|
|
1066
892
|
*
|
|
1067
893
|
* ```html
|
|
1068
|
-
* <div
|
|
894
|
+
* <div daffLoadable [loading]="isLoading">Content</div>
|
|
1069
895
|
* ```
|
|
1070
896
|
*
|
|
1071
897
|
* @example Implementing it as an Angular host directive
|
|
@@ -1076,8 +902,8 @@ declare class DaffStickyTrackerDirective implements OnDestroy {
|
|
|
1076
902
|
* template: 'custom-component.html',
|
|
1077
903
|
* hostDirectives: [
|
|
1078
904
|
* {
|
|
1079
|
-
* directive:
|
|
1080
|
-
* inputs: ['
|
|
905
|
+
* directive: DaffLoadableDirective,
|
|
906
|
+
* inputs: ['loading'],
|
|
1081
907
|
* },
|
|
1082
908
|
* ],
|
|
1083
909
|
* })
|
|
@@ -1086,25 +912,113 @@ declare class DaffStickyTrackerDirective implements OnDestroy {
|
|
|
1086
912
|
*
|
|
1087
913
|
* ```scss
|
|
1088
914
|
* :host {
|
|
1089
|
-
* .
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
915
|
+
* .spinner {
|
|
916
|
+
* opacity: 0;
|
|
917
|
+
* }
|
|
918
|
+
* .daff-loading {
|
|
919
|
+
* .spinner {
|
|
920
|
+
* opacity: 1;
|
|
921
|
+
* }
|
|
1092
922
|
* }
|
|
1093
923
|
* }
|
|
1094
924
|
* ```
|
|
1095
925
|
*
|
|
1096
|
-
* The directive applies the `daff-
|
|
926
|
+
* The directive applies the `daff-loading` class to the component. The class should be
|
|
1097
927
|
* defined in your styles to display the loading state as desired.
|
|
1098
928
|
*/
|
|
1099
|
-
declare class
|
|
1100
|
-
|
|
1101
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
1102
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
929
|
+
declare class DaffLoadableDirective {
|
|
930
|
+
loading: boolean;
|
|
931
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffLoadableDirective, never>;
|
|
932
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffLoadableDirective, "[daffLoadable]", never, { "loading": { "alias": "loading"; "required": false; }; }, {}, never, never, true, never>;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
declare class DaffRovingTabIndexService {
|
|
936
|
+
private document;
|
|
937
|
+
private readonly _hierarchy;
|
|
938
|
+
private readonly _group;
|
|
939
|
+
readonly group: i0.Signal<string>;
|
|
940
|
+
constructor(document: Document);
|
|
941
|
+
enter(group: string): void;
|
|
942
|
+
leave(): void;
|
|
943
|
+
next(): void;
|
|
944
|
+
previous(): void;
|
|
945
|
+
private _changeFocus;
|
|
946
|
+
onKeydown(evt: Event): void;
|
|
947
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffRovingTabIndexService, never>;
|
|
948
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffRovingTabIndexService>;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Defines the boundary of an RTI group.
|
|
953
|
+
*/
|
|
954
|
+
declare class DaffRovingTabIndexBoundaryDirective {
|
|
955
|
+
private groupService;
|
|
956
|
+
private focusTrap;
|
|
957
|
+
/**
|
|
958
|
+
* Don't touch this directly. Use `_uniqueId`.
|
|
959
|
+
*/
|
|
960
|
+
private static _uniqueIdCounter;
|
|
961
|
+
/**
|
|
962
|
+
* Don't touch this directly. Use `_uniqueId`.
|
|
963
|
+
*/
|
|
964
|
+
private _cachedUniqueId;
|
|
965
|
+
private get _uniqueId();
|
|
966
|
+
/**
|
|
967
|
+
* The name of the group for which that this element will act as boundary.
|
|
968
|
+
* Optional, will be autogenerated to a unique name if omitted.
|
|
969
|
+
*/
|
|
970
|
+
readonly rtiBoundary: i0.InputSignal<string>;
|
|
971
|
+
/**
|
|
972
|
+
* The name of the group defined by this boundary.
|
|
973
|
+
*/
|
|
974
|
+
readonly effectiveBoundary: i0.Signal<string>;
|
|
975
|
+
constructor(groupService: DaffRovingTabIndexService, focusTrap: CdkTrapFocus);
|
|
976
|
+
/**
|
|
977
|
+
* @docs-private
|
|
978
|
+
*/
|
|
979
|
+
enterGroup(evt: Event): void;
|
|
980
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffRovingTabIndexBoundaryDirective, never>;
|
|
981
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffRovingTabIndexBoundaryDirective, "[rtiBoundary]", never, { "rtiBoundary": { "alias": "rtiBoundary"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkTrapFocus; inputs: {}; outputs: {}; }, { directive: typeof DaffRovingTabIndexDirective; inputs: {}; outputs: {}; }]>;
|
|
1103
982
|
}
|
|
1104
983
|
|
|
1105
|
-
|
|
1106
|
-
|
|
984
|
+
/**
|
|
985
|
+
* Declares that an element is an RTI target.
|
|
986
|
+
* Automatically applied to `<a>` and `<button>` elements.
|
|
987
|
+
*/
|
|
988
|
+
declare class DaffRovingTabIndexDirective {
|
|
989
|
+
private service;
|
|
990
|
+
private parent;
|
|
991
|
+
/**
|
|
992
|
+
* Allows the RTI group to be overriden.
|
|
993
|
+
* By default it will be the nearest ancestor or the default root group if no boundary ancestor exists.
|
|
994
|
+
* @see {@link DaffRovingTabIndexBoundaryDirective}.
|
|
995
|
+
*/
|
|
996
|
+
readonly rti: i0.InputSignal<string>;
|
|
997
|
+
/**
|
|
998
|
+
* The group in which this RTI target resides.
|
|
999
|
+
* See {@link DaffRovingTabIndexBoundaryDirective} to make an element act as the boundary of an RTI group.
|
|
1000
|
+
*/
|
|
1001
|
+
readonly group: i0.Signal<string>;
|
|
1002
|
+
/**
|
|
1003
|
+
* @docs-private
|
|
1004
|
+
*/
|
|
1005
|
+
readonly tabindex: i0.Signal<0 | -1>;
|
|
1006
|
+
constructor(service: DaffRovingTabIndexService, parent: DaffRovingTabIndexBoundaryDirective);
|
|
1007
|
+
/**
|
|
1008
|
+
* @docs-private
|
|
1009
|
+
*/
|
|
1010
|
+
leaveGroup(evt: Event): void;
|
|
1011
|
+
/**
|
|
1012
|
+
* @docs-private
|
|
1013
|
+
*/
|
|
1014
|
+
next(evt: Event): void;
|
|
1015
|
+
/**
|
|
1016
|
+
* @docs-private
|
|
1017
|
+
*/
|
|
1018
|
+
previous(evt: Event): void;
|
|
1019
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffRovingTabIndexDirective, [null, { optional: true; skipSelf: true; }]>;
|
|
1020
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffRovingTabIndexDirective, "[rti],a,button", never, { "rti": { "alias": "rti"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1107
1021
|
}
|
|
1108
1022
|
|
|
1109
|
-
export { DAFF_PREFIX_SUFFIX_DIRECTIVES, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffColorableDirective, DaffCompactableDirective, DaffDisableableDirective,
|
|
1110
|
-
export type { AnimationStateWithParams, Constructor, DaffColorable, DaffCompactable,
|
|
1023
|
+
export { DAFF_PREFIX_SUFFIX_DIRECTIVES, DAFF_THEME_INITIALIZER, DaffArticleEncapsulatedDirective, DaffBreakpoints, DaffColorableDirective, DaffCompactableDirective, DaffDisableableDirective, DaffFocusStackService, DaffFormLabelDirective, DaffFormLabelModule, DaffLoadableDirective, DaffManageContainerLayoutDirective, DaffOpenableDirective, DaffOrientableDirective, DaffOrientationEnum, DaffPrefixDirective, DaffPrefixSuffixModule, DaffRovingTabIndexBoundaryDirective, DaffRovingTabIndexDirective, DaffSelectableDirective, DaffSizableDirective, DaffSizableEnum, DaffSkeletonableDirective, DaffStatusEnum, DaffStatusableDirective, DaffStickyTrackerDirective, DaffSuffixDirective, DaffTextAlignableDirective, DaffTextAlignmentEnum, DaffTheme, DaffThemingService, NoopBreakpointObserver, SERVER_SAFE_BREAKPOINT_OBSERVER, daffFocusableElementsSelector };
|
|
1024
|
+
export type { AnimationStateWithParams, Constructor, DaffColor, DaffColorable, DaffCompactable, DaffDisableable, DaffLazyComponent, DaffOpenable, DaffOrientable, DaffOrientation, DaffPalette, DaffSelectable, DaffSizable, DaffSizeAllType, DaffSizeLargeType, DaffSizeMediumType, DaffSizeSmallType, DaffSizeXLargeType, DaffSizeXSmallType, DaffStatus, DaffStatusable, DaffTextAlignable, DaffTextAlignment };
|
package/input/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Input works alongside the native HTML input element, with additional custom styl
|
|
|
4
4
|
## Overview
|
|
5
5
|
Input has the same functionality as a native HTML input element, with additional custom styling and functionality. It **cannot** be used by itself and must be contained within a [form field](/libs/design/form-field/README.md).
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="input-with-form-field"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
@@ -66,19 +66,19 @@ Input must be used inside `<daff-form-field>` to enable proper state management
|
|
|
66
66
|
### Disabled
|
|
67
67
|
Input can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
|
|
68
68
|
|
|
69
|
-
<
|
|
69
|
+
<daff-docs-example-viewer example="input-disabled"></daff-docs-example-viewer>
|
|
70
70
|
|
|
71
71
|
### Error
|
|
72
72
|
Input supports validation and error messages through Angular's form validation system. Use `<daff-error-message>` within the form field to display context-specific error messages. Error messages automatically appear when the input is invalid and has been touched or submitted.
|
|
73
73
|
|
|
74
|
-
<
|
|
74
|
+
<daff-docs-example-viewer example="input-error"></daff-docs-example-viewer>
|
|
75
75
|
|
|
76
76
|
Multiple error messages can be displayed conditionally based on the type of validation error. The form field component handles the styling and positioning of error messages.
|
|
77
77
|
|
|
78
78
|
## Hints
|
|
79
79
|
Hints provide additional context or instructions to help users complete the input field correctly. Use `<daff-hint>` within the form field to display helpful information below the input. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
|
|
80
80
|
|
|
81
|
-
<
|
|
81
|
+
<daff-docs-example-viewer example="input-hint"></daff-docs-example-viewer>
|
|
82
82
|
|
|
83
83
|
## Accessibility
|
|
84
84
|
When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the input using the `for` and `id` attributes.
|
package/input/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare class DaffInputComponent extends DaffFormFieldControl<string> implements
|
|
|
29
29
|
/**
|
|
30
30
|
* @docs-private
|
|
31
31
|
*/
|
|
32
|
-
get disabledAttribute():
|
|
32
|
+
get disabledAttribute(): boolean;
|
|
33
33
|
private _required;
|
|
34
34
|
/**
|
|
35
35
|
* @docs-private
|
|
@@ -46,10 +46,11 @@ declare class DaffInputComponent extends DaffFormFieldControl<string> implements
|
|
|
46
46
|
* @docs-private
|
|
47
47
|
*/
|
|
48
48
|
get ariaDescribedBy(): string;
|
|
49
|
-
/** @docs-private */
|
|
50
49
|
focus(): void;
|
|
51
50
|
/** @docs-private */
|
|
52
|
-
|
|
51
|
+
_handleFocus(): void;
|
|
52
|
+
/** @docs-private */
|
|
53
|
+
_handleBlur(): void;
|
|
53
54
|
constructor(
|
|
54
55
|
/** @docs-private */
|
|
55
56
|
ngControl: NgControl, _elementRef: ElementRef<HTMLInputElement>, formField: DaffFormFieldComponent);
|