@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/link-set/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import * as i1 from '@daffodil/design';
|
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
7
|
+
*
|
|
6
8
|
* DaffLinkSetComponent is a component for displaying a two or more links.
|
|
7
9
|
*/
|
|
8
10
|
declare class DaffLinkSetComponent {
|
|
@@ -15,6 +17,7 @@ declare class DaffLinkSetComponent {
|
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
/**
|
|
20
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
18
21
|
* A directive for adding a heading to a daff-link-set.
|
|
19
22
|
*/
|
|
20
23
|
declare class DaffLinkSetHeadingDirective {
|
|
@@ -27,6 +30,8 @@ declare class DaffLinkSetHeadingDirective {
|
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
/**
|
|
33
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
34
|
+
*
|
|
30
35
|
* A directive for adding a subheading to a daff-link-set.
|
|
31
36
|
*/
|
|
32
37
|
declare class DaffLinkSetSubheadingDirective {
|
|
@@ -38,6 +43,9 @@ declare class DaffLinkSetSubheadingDirective {
|
|
|
38
43
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffLinkSetSubheadingDirective, "[daffLinkSetSubheading]", never, {}, {}, never, never, true, never>;
|
|
39
44
|
}
|
|
40
45
|
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
48
|
+
*/
|
|
41
49
|
declare class DaffLinkSetItemComponent {
|
|
42
50
|
/**
|
|
43
51
|
* @docs-private
|
|
@@ -48,7 +56,7 @@ declare class DaffLinkSetItemComponent {
|
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
/**
|
|
51
|
-
* @deprecated
|
|
59
|
+
* @deprecated Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
52
60
|
*/
|
|
53
61
|
declare class DaffLinkSetModule {
|
|
54
62
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffLinkSetModule, never>;
|
package/list/README.md
CHANGED
|
@@ -88,12 +88,12 @@ A list consists of the following components:
|
|
|
88
88
|
### Icon support
|
|
89
89
|
Use the `[daffPrefix]` element to display a leading visual icon for a list item.
|
|
90
90
|
|
|
91
|
-
<
|
|
91
|
+
<daff-docs-example-viewer example="icon-list"></daff-docs-example-viewer>
|
|
92
92
|
|
|
93
93
|
### Multi-line lists
|
|
94
94
|
For list items that contain multiple lines of text, use the `[daffListItemTitle]` element to identify the primary title. Additional supporting content can be added using `<div>` or `<p>` elements.
|
|
95
95
|
|
|
96
|
-
<
|
|
96
|
+
<daff-docs-example-viewer example="multiline-list"></daff-docs-example-viewer>
|
|
97
97
|
|
|
98
98
|
## Accessibility
|
|
99
99
|
By default, list includes appropriate ARIA roles by default to support screen readers and provide an accessible experience.
|
package/loading-icon/README.md
CHANGED
|
@@ -51,7 +51,7 @@ Use the `color` property to change the color of a loading icon. The default colo
|
|
|
51
51
|
|
|
52
52
|
> `theme` and `white` should be used on a darker background in order to have sufficient contrast.
|
|
53
53
|
|
|
54
|
-
<
|
|
54
|
+
<daff-docs-example-viewer example="loading-icon-color"></daff-docs-example-viewer>
|
|
55
55
|
|
|
56
56
|
## Accessibility
|
|
57
57
|
Loading icons should be given meaningful labels by using `aria-label` or `aria-labelledby`.
|
package/loading-icon/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as i1$1 from '@angular/common';
|
|
|
3
3
|
import * as i1 from '@daffodil/design';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @deprecated in favor of `DaffSpinnerComponent`. Deprecated in version 0.91.1. Will be removed in version 0.94.0.
|
|
7
7
|
*/
|
|
8
8
|
declare class DaffLoadingIconComponent {
|
|
9
9
|
/**
|
package/media-gallery/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A media gallery displays a group of thumbnails in a gallery format, allowing use
|
|
|
4
4
|
## Overview
|
|
5
5
|
Media galleries are ideal for showcasing multiple images or other media related to a single product or topic. They provide an interactive way to browse through content with thumbnail previews that update the primary display when selected.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-media-gallery"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Best practices
|
|
10
10
|
|
|
@@ -86,14 +86,14 @@ A media gallery consists of the following components:
|
|
|
86
86
|
|
|
87
87
|
> Never use `[daffThumbnail]` as a standalone element. It must be placed within a `<daff-media-gallery>`.
|
|
88
88
|
|
|
89
|
-
<
|
|
89
|
+
<daff-docs-example-viewer example="media-gallery-with-video"></daff-docs-example-viewer>
|
|
90
90
|
|
|
91
91
|
## Aspect ratio
|
|
92
92
|
Use a consistent aspect ratio across all content to avoid layout shifts. Mismatched content sizes can cause the primary content area to shift as different thumbnails are selected.
|
|
93
93
|
|
|
94
94
|
Thumbnails are rendered in a square by default, so a 1:1 ratio is recommended, but not required since thumbnails are automatically centered horizontally and vertically.
|
|
95
95
|
|
|
96
|
-
<
|
|
96
|
+
<daff-docs-example-viewer example="mismatched-sizes-media-gallery"></daff-docs-example-viewer>
|
|
97
97
|
|
|
98
98
|
## Accessibility
|
|
99
99
|
- Always provide an accessible label for each thumbnail using the `label` attribute.
|
package/menu/README.md
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
# Menu
|
|
2
|
-
|
|
2
|
+
A menu is a floating panel that displays a list of actions or navigational items.
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
|
-
Menus
|
|
5
|
+
Menus appear when users interact with a menu activator button. Use menus for secondary actions or options that don't require immediate access.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
<daff-docs-example-viewer example="basic-menu"></daff-docs-example-viewer>
|
|
8
|
+
|
|
9
|
+
## Best practices
|
|
10
|
+
|
|
11
|
+
**When to use**
|
|
12
|
+
- Displaying a list of actions that don't need to be visible at all times
|
|
13
|
+
- Providing secondary or contextual options
|
|
14
|
+
- Creating dropdown navigation
|
|
15
|
+
|
|
16
|
+
**When not to use**
|
|
17
|
+
- Actions need to be immediately visible and accessible
|
|
18
|
+
- There are only one or two actions (consider using buttons instead)
|
|
9
19
|
|
|
10
20
|
## Usage
|
|
11
|
-
|
|
21
|
+
|
|
22
|
+
### Within a standalone component
|
|
23
|
+
To use menu in a standalone component, import `DAFF_MENU_COMPONENTS` directly into your custom component:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { DAFF_MENU_COMPONENTS } from '@daffodil/design/menu';
|
|
27
|
+
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'custom-component',
|
|
30
|
+
templateUrl: './custom-component.component.html',
|
|
31
|
+
imports: [
|
|
32
|
+
DAFF_MENU_COMPONENTS,
|
|
33
|
+
],
|
|
34
|
+
})
|
|
35
|
+
export class CustomComponent {}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Within a module (deprecated)
|
|
39
|
+
To use menu in a module, import `DaffMenuModule` into your custom module:
|
|
12
40
|
|
|
13
41
|
```ts
|
|
14
42
|
import { NgModule } from '@angular/core';
|
|
@@ -29,13 +57,82 @@ import { CustomComponent } from './custom.component';
|
|
|
29
57
|
export class CustomComponentModule { }
|
|
30
58
|
```
|
|
31
59
|
|
|
32
|
-
|
|
60
|
+
> This method is deprecated. It's recommended to update all custom components to standalone.
|
|
61
|
+
|
|
62
|
+
## Anatomy
|
|
63
|
+
A menu component consists of the following parts:
|
|
64
|
+
|
|
65
|
+
### Menu Activator
|
|
66
|
+
**`[daffMenuActivator]`**: A directive attached to a button that triggers the menu to open. The selector doubles as an input for the menu content to display.
|
|
67
|
+
|
|
68
|
+
### Menu
|
|
69
|
+
**`<daff-menu>`**: The container component that holds menu items.
|
|
33
70
|
|
|
34
71
|
### Menu Item
|
|
35
|
-
|
|
72
|
+
**`<daff-menu-item>`**: Represents a single action or navigation item within the menu. Should be used with an anchor or button HTML element.
|
|
36
73
|
|
|
37
74
|
### Icon
|
|
38
|
-
|
|
75
|
+
Use the `[daffPrefix]` directive to add a decorative icon before the menu item content.
|
|
39
76
|
|
|
40
|
-
###
|
|
41
|
-
|
|
77
|
+
### Basic structure
|
|
78
|
+
```html
|
|
79
|
+
<button [daffMenuActivator]="menu">
|
|
80
|
+
Open Menu
|
|
81
|
+
</button>
|
|
82
|
+
|
|
83
|
+
<ng-template #menu>
|
|
84
|
+
<daff-menu>
|
|
85
|
+
<button daff-menu-item>
|
|
86
|
+
<fa-icon [icon]="faEdit" daffPrefix></fa-icon>
|
|
87
|
+
Edit
|
|
88
|
+
</button>
|
|
89
|
+
<button daff-menu-item>
|
|
90
|
+
<fa-icon [icon]="faTrash" daffPrefix></fa-icon>
|
|
91
|
+
Delete
|
|
92
|
+
</button>
|
|
93
|
+
<a href="/settings" daff-menu-item>
|
|
94
|
+
<fa-icon [icon]="faCog" daffPrefix></fa-icon>
|
|
95
|
+
Settings
|
|
96
|
+
</a>
|
|
97
|
+
</daff-menu>
|
|
98
|
+
</ng-template>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Features
|
|
102
|
+
|
|
103
|
+
### Accessing menu state
|
|
104
|
+
The menu activator provides an `isOpen` property that tracks whether the menu is currently open or closed. Use this to update your UI based on the menu state, such as changing icons or styling.
|
|
105
|
+
|
|
106
|
+
<daff-docs-example-viewer example="menu-with-icon-toggle"></daff-docs-example-viewer>
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Setting an ID
|
|
110
|
+
|
|
111
|
+
The menu activator accepts an optional `id` input. When set, the opened menu's `id` is derived as `{id}-menu`. When no `id` is provided, a unique ID is auto-generated.
|
|
112
|
+
|
|
113
|
+
<daff-docs-example-viewer example="menu-with-id"></daff-docs-example-viewer>
|
|
114
|
+
|
|
115
|
+
## Accessibility
|
|
116
|
+
Menu follows the [Menu and Menubar WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/).
|
|
117
|
+
|
|
118
|
+
### Daffodil provides
|
|
119
|
+
- `role="menu"` and `role="menuitem"` on appropriate elements
|
|
120
|
+
- Focus management when menu opens and closes
|
|
121
|
+
- `aria-expanded` on the activator indicating the menu state
|
|
122
|
+
|
|
123
|
+
#### Keyboard interactions
|
|
124
|
+
Keyboard focus is placed on the first item when a menu is opened.
|
|
125
|
+
|
|
126
|
+
| Key | Action |
|
|
127
|
+
| --- | ------ |
|
|
128
|
+
| `Enter` / `Space` | Opens the menu when focused on the activator, or activates the focused menu item |
|
|
129
|
+
| `Escape` | Closes the menu and returns focus to the menu activator |
|
|
130
|
+
| `Down Arrow` | Moves focus to the next item. If focus is on the last item, focus moves to the first item |
|
|
131
|
+
| `Up Arrow` | Moves focus to the previous item. If focus is on the first item, focus moves to the last item |
|
|
132
|
+
| `Home` | Moves focus to the first item |
|
|
133
|
+
| `End` | Moves focus to the last item |
|
|
134
|
+
|
|
135
|
+
### Developer responsibilities
|
|
136
|
+
- Provide a meaningful label on the menu activator
|
|
137
|
+
- Ensure menu items have descriptive text or labels
|
|
138
|
+
- Use appropriate HTML elements (`<button>` for actions, `<a>` for navigation)
|
package/menu/index.d.ts
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import * as i2 from '@angular/cdk/overlay';
|
|
2
2
|
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injector, ViewContainerRef, TemplateRef, Type, OnDestroy, ChangeDetectorRef, AfterContentInit, AfterViewInit,
|
|
4
|
+
import { Injector, ViewContainerRef, TemplateRef, Type, OnDestroy, ChangeDetectorRef, AfterContentInit, AfterViewInit, ElementRef } from '@angular/core';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
|
+
import * as i6 from '@daffodil/design';
|
|
6
7
|
import { DaffLazyComponent, DaffPrefixDirective } from '@daffodil/design';
|
|
7
8
|
import * as i1 from '@angular/common';
|
|
8
|
-
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
|
9
|
+
import { ConfigurableFocusTrapFactory, FocusableOption } from '@angular/cdk/a11y';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for a menu instance.
|
|
13
|
+
*/
|
|
14
|
+
interface DaffMenuConfig {
|
|
15
|
+
/**
|
|
16
|
+
* A unique identifier for the menu instance.
|
|
17
|
+
*/
|
|
18
|
+
menuId?: string;
|
|
19
|
+
}
|
|
9
20
|
|
|
10
21
|
type DaffMenuSlot = TemplateRef<unknown> | DaffLazyComponent | Type<unknown>;
|
|
11
22
|
declare class DaffMenuService {
|
|
@@ -16,39 +27,121 @@ declare class DaffMenuService {
|
|
|
16
27
|
private $_open;
|
|
17
28
|
open$: Observable<boolean>;
|
|
18
29
|
constructor(overlay: Overlay, injector: Injector);
|
|
19
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @docs-private
|
|
32
|
+
*/
|
|
33
|
+
protected _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* @docs-private
|
|
36
|
+
*/
|
|
20
37
|
protected _destroyOverlay(): void;
|
|
21
38
|
close(): void;
|
|
22
|
-
open(activator: ViewContainerRef, component: DaffMenuSlot): void;
|
|
39
|
+
open(activator: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig): void;
|
|
23
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuService, never>;
|
|
24
41
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMenuService>;
|
|
25
42
|
}
|
|
26
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Directive that triggers the menu to open/close. Applied to the button that activates the menu. The selector doubles as an input for the menu content to display.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```html
|
|
49
|
+
* <button [daffMenuActivator]="menu">
|
|
50
|
+
* Open Menu
|
|
51
|
+
* </button>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
27
54
|
declare class DaffMenuActivatorDirective implements OnDestroy {
|
|
28
55
|
private service;
|
|
29
56
|
private viewContainerRef;
|
|
30
57
|
private cdRef;
|
|
31
58
|
private _destroyed$;
|
|
32
59
|
private _open;
|
|
60
|
+
private _defaultMenuId;
|
|
61
|
+
readonly isOpen: i0.WritableSignal<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* The menu content to display when activated.
|
|
64
|
+
*/
|
|
33
65
|
daffMenuActivator: Type<unknown> | TemplateRef<unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* An optional ID for the activator.
|
|
68
|
+
* When set, the menu's ID is derived as `${id}-menu`.
|
|
69
|
+
*/
|
|
70
|
+
id: i0.InputSignal<string>;
|
|
71
|
+
/**
|
|
72
|
+
* The resolved menu ID.
|
|
73
|
+
*/
|
|
74
|
+
private menuId;
|
|
75
|
+
/**
|
|
76
|
+
* @docs-private
|
|
77
|
+
*/
|
|
78
|
+
get ariaExpanded(): "true" | "false";
|
|
34
79
|
constructor(service: DaffMenuService, viewContainerRef: ViewContainerRef, cdRef: ChangeDetectorRef);
|
|
80
|
+
/**
|
|
81
|
+
* @docs-private
|
|
82
|
+
*/
|
|
35
83
|
ngOnDestroy(): void;
|
|
84
|
+
/**
|
|
85
|
+
* @docs-private
|
|
86
|
+
*/
|
|
36
87
|
focus(): void;
|
|
37
88
|
/**
|
|
38
89
|
* @docs-private
|
|
39
90
|
*/
|
|
40
91
|
onClick(event: MouseEvent): void;
|
|
41
92
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuActivatorDirective, never>;
|
|
42
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffMenuActivatorDirective, "[daffMenuActivator]",
|
|
93
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DaffMenuActivatorDirective, "[daffMenuActivator]", ["daffMenuActivator"], { "daffMenuActivator": { "alias": "daffMenuActivator"; "required": false; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
43
94
|
}
|
|
44
95
|
|
|
96
|
+
/**
|
|
97
|
+
* The floating panel that contains menu items.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```html
|
|
101
|
+
* <daff-menu>
|
|
102
|
+
* <button daff-menu-item>
|
|
103
|
+
* <fa-icon [icon]="faEdit" daffPrefix></fa-icon>
|
|
104
|
+
* Edit
|
|
105
|
+
* </button>
|
|
106
|
+
* <button daff-menu-item>
|
|
107
|
+
* <fa-icon [icon]="faTrash" daffPrefix></fa-icon>
|
|
108
|
+
* Delete
|
|
109
|
+
* </button>
|
|
110
|
+
* <a href="/settings" daff-menu-item>
|
|
111
|
+
* <fa-icon [icon]="faCog" daffPrefix></fa-icon>
|
|
112
|
+
* Settings
|
|
113
|
+
* </a>
|
|
114
|
+
* </daff-menu>
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
45
117
|
declare class DaffMenuComponent implements AfterContentInit, AfterViewInit {
|
|
46
118
|
private _focusTrapFactory;
|
|
47
|
-
private _ngZone;
|
|
48
119
|
private _elementRef;
|
|
49
120
|
private menuService;
|
|
121
|
+
/**
|
|
122
|
+
* @docs-private
|
|
123
|
+
*/
|
|
124
|
+
readonly config: DaffMenuConfig;
|
|
50
125
|
private _focusTrap;
|
|
51
|
-
|
|
126
|
+
private _keyManager;
|
|
127
|
+
/**
|
|
128
|
+
* @docs-private
|
|
129
|
+
*
|
|
130
|
+
* Content children that provide `DAFF_MENU_ITEM_TOKEN` are treated as menu items.
|
|
131
|
+
* This includes both `daff-menu-item` components and any custom directives that also provide the token.
|
|
132
|
+
*/
|
|
133
|
+
private _items;
|
|
134
|
+
constructor(_focusTrapFactory: ConfigurableFocusTrapFactory, _elementRef: ElementRef<HTMLElement>, menuService: DaffMenuService,
|
|
135
|
+
/**
|
|
136
|
+
* @docs-private
|
|
137
|
+
*/
|
|
138
|
+
config: DaffMenuConfig);
|
|
139
|
+
/**
|
|
140
|
+
* @docs-private
|
|
141
|
+
*
|
|
142
|
+
* Handle keyboard navigation
|
|
143
|
+
*/
|
|
144
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
52
145
|
/**
|
|
53
146
|
* @docs-private
|
|
54
147
|
*/
|
|
@@ -58,22 +151,61 @@ declare class DaffMenuComponent implements AfterContentInit, AfterViewInit {
|
|
|
58
151
|
*/
|
|
59
152
|
ngAfterViewInit(): void;
|
|
60
153
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuComponent, never>;
|
|
61
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DaffMenuComponent, "daff-menu", never, {}, {},
|
|
154
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DaffMenuComponent, "daff-menu", never, {}, {}, ["_items"], ["*"], true, never>;
|
|
62
155
|
}
|
|
63
156
|
|
|
64
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Individual clickable items within the menu. Applied to `<button>` or `<a>` elements.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```
|
|
162
|
+
* <a daff-menu-item href="/">Settings</a>
|
|
163
|
+
* <button daff-menu-item href="/">Settings</button>
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
declare class DaffMenuItemComponent implements FocusableOption {
|
|
167
|
+
private _elementRef;
|
|
168
|
+
private _menuService;
|
|
65
169
|
/**
|
|
66
170
|
* @docs-private
|
|
67
171
|
*/
|
|
68
172
|
_prefix: DaffPrefixDirective;
|
|
173
|
+
constructor(_elementRef: ElementRef<HTMLElement>, _menuService: DaffMenuService);
|
|
174
|
+
/**
|
|
175
|
+
* @docs-private
|
|
176
|
+
*/
|
|
177
|
+
onClick(): void;
|
|
178
|
+
/**
|
|
179
|
+
* Focus the menu item.
|
|
180
|
+
*/
|
|
181
|
+
focus(): void;
|
|
69
182
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuItemComponent, never>;
|
|
70
183
|
static ɵcmp: i0.ɵɵComponentDeclaration<DaffMenuItemComponent, "a[daff-menu-item],button[daff-menu-item]", never, {}, {}, ["_prefix"], ["[daffPrefix]", "*"], true, never>;
|
|
71
184
|
}
|
|
72
185
|
|
|
186
|
+
/**
|
|
187
|
+
* @deprecated in favor of {@link DAFF_MENU_COMPONENTS} Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
188
|
+
*/
|
|
73
189
|
declare class DaffMenuModule {
|
|
74
190
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMenuModule, never>;
|
|
75
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffMenuModule, never, [typeof i1.CommonModule, typeof i2.OverlayModule, typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent], [typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent]>;
|
|
191
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffMenuModule, never, [typeof i1.CommonModule, typeof i2.OverlayModule, typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent, typeof i6.DaffPrefixDirective], [typeof DaffMenuActivatorDirective, typeof DaffMenuComponent, typeof DaffMenuItemComponent, typeof i6.DaffPrefixDirective]>;
|
|
76
192
|
static ɵinj: i0.ɵɵInjectorDeclaration<DaffMenuModule>;
|
|
77
193
|
}
|
|
78
194
|
|
|
79
|
-
|
|
195
|
+
/**
|
|
196
|
+
* @docs-private
|
|
197
|
+
*/
|
|
198
|
+
declare const DAFF_MENU_COMPONENTS: readonly [typeof DaffMenuComponent, typeof DaffMenuActivatorDirective, typeof DaffMenuItemComponent];
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Injection token/provider pair used to identify menu items.
|
|
202
|
+
*
|
|
203
|
+
* `DaffMenuComponent` uses `@ContentChildren(DAFF_MENU_ITEM_TOKEN)` to discover
|
|
204
|
+
* its menu items. Use `provideDaffMenuItemToken` in component providers to register
|
|
205
|
+
* custom directives and components as menu items alongside native `daff-menu-item` elements.
|
|
206
|
+
*/
|
|
207
|
+
declare const DAFF_MENU_ITEM_TOKEN: i0.InjectionToken<FocusableOption>;
|
|
208
|
+
declare const provideDaffMenuItemToken: <R extends FocusableOption = FocusableOption>(klass: i0.Type<R>) => i0.ExistingProvider;
|
|
209
|
+
|
|
210
|
+
export { DAFF_MENU_COMPONENTS, DAFF_MENU_ITEM_TOKEN, DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService, provideDaffMenuItemToken };
|
|
211
|
+
export type { DaffMenuConfig, DaffMenuSlot };
|
package/modal/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Modal is a dynamically rendered element that floats above the rest of a page's c
|
|
|
4
4
|
## Overview
|
|
5
5
|
Modals are used to capture information or attention. They overlay the main content and prevent interaction with the page until the modal is dismissed.
|
|
6
6
|
|
|
7
|
-
<
|
|
7
|
+
<daff-docs-example-viewer example="basic-modal"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Best practices
|
|
10
10
|
|
package/modal/index.d.ts
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import * as rxjs from 'rxjs';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
|
3
4
|
import * as i2 from '@angular/cdk/portal';
|
|
4
5
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
6
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { Type, AfterContentInit, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef
|
|
7
|
+
import { Type, AfterContentInit, AfterViewInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
|
|
7
8
|
import * as i1 from '@daffodil/design';
|
|
8
9
|
import { DaffOpenable, DaffOpenableDirective, DaffFocusStackService } from '@daffodil/design';
|
|
9
10
|
import * as i3 from '@angular/cdk/overlay';
|
|
10
|
-
import { Overlay
|
|
11
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
11
12
|
import * as i1$1 from '@angular/common';
|
|
12
13
|
import * as i4 from '@daffodil/design/button';
|
|
13
14
|
import * as i5 from '@fortawesome/angular-fontawesome';
|
|
14
15
|
import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Reference to modal instance.
|
|
19
|
+
*/
|
|
20
|
+
interface DaffModalRef<T> {
|
|
21
|
+
/**
|
|
22
|
+
* The component instance inside the modal.
|
|
23
|
+
*/
|
|
24
|
+
instance: T;
|
|
25
|
+
/**
|
|
26
|
+
* Closes the modal.
|
|
27
|
+
*/
|
|
28
|
+
close(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Emits when the modal close animation completes.
|
|
31
|
+
*/
|
|
32
|
+
afterClosed: Observable<boolean>;
|
|
33
|
+
}
|
|
34
|
+
|
|
16
35
|
type DaffModalVerticalPosition = 'top' | 'center';
|
|
17
36
|
interface DaffModalPosition {
|
|
18
37
|
/**
|
|
@@ -59,7 +78,7 @@ declare class DaffModalService {
|
|
|
59
78
|
private _createOverlayRef;
|
|
60
79
|
private _removeModal;
|
|
61
80
|
private _closeAllModals;
|
|
62
|
-
open(component: Type<
|
|
81
|
+
open<T>(component: Type<T>, configuration?: Partial<DaffModalConfiguration>): DaffModalRef<T>;
|
|
63
82
|
close(component: DaffModalComponent): void;
|
|
64
83
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffModalService, never>;
|
|
65
84
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffModalService>;
|
|
@@ -203,21 +222,10 @@ declare class DaffModalModule {
|
|
|
203
222
|
static ɵinj: i0.ɵɵInjectorDeclaration<DaffModalModule>;
|
|
204
223
|
}
|
|
205
224
|
|
|
206
|
-
interface DaffModal {
|
|
207
|
-
/**
|
|
208
|
-
* The reference to the modal in question
|
|
209
|
-
*/
|
|
210
|
-
modal: ComponentRef<DaffModalComponent>;
|
|
211
|
-
/**
|
|
212
|
-
* The overlay associated with a given modal.
|
|
213
|
-
*/
|
|
214
|
-
overlay: OverlayRef;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
225
|
/**
|
|
218
226
|
* @docs-private
|
|
219
227
|
*/
|
|
220
228
|
declare const DAFF_MODAL_COMPONENTS: readonly [typeof DaffModalHeaderComponent, typeof DaffModalTitleDirective, typeof DaffModalContentComponent, typeof DaffModalActionsComponent, typeof DaffModalCloseDirective];
|
|
221
229
|
|
|
222
230
|
export { DAFF_MODAL_COMPONENTS, DaffModalActionsComponent, DaffModalCloseDirective, DaffModalComponent, DaffModalContentComponent, DaffModalHeaderComponent, DaffModalModule, DaffModalService, DaffModalTitleDirective };
|
|
223
|
-
export type {
|
|
231
|
+
export type { DaffModalRef };
|
package/native-select/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Native select works alongside the HTML select element, with additional custom st
|
|
|
4
4
|
## Overview
|
|
5
5
|
Native select has the same functionality as a native HTML select 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="basic-native-select"></daff-docs-example-viewer>
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
To use native select, import `DAFF_NATIVE_SELECT_COMPONENTS` directly into your custom component:
|
|
@@ -42,19 +42,19 @@ Native select must be used inside `<daff-form-field>` to enable proper state man
|
|
|
42
42
|
### Disabled
|
|
43
43
|
Native select can be disabled in two ways: using Angular's reactive forms with `FormControl` or with the native HTML `disabled` attribute.
|
|
44
44
|
|
|
45
|
-
<
|
|
45
|
+
<daff-docs-example-viewer example="native-select-disabled"></daff-docs-example-viewer>
|
|
46
46
|
|
|
47
47
|
### Error
|
|
48
48
|
Native select 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 select is invalid and has been touched or submitted.
|
|
49
49
|
|
|
50
|
-
<
|
|
50
|
+
<daff-docs-example-viewer example="native-select-error"></daff-docs-example-viewer>
|
|
51
51
|
|
|
52
52
|
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.
|
|
53
53
|
|
|
54
54
|
## Hints
|
|
55
55
|
Hints provide additional context or instructions to help users complete the select field correctly. Use `<daff-hint>` within the form field to display helpful information below the select. Unlike error messages, hints are always visible and provide guidance rather than validation feedback.
|
|
56
56
|
|
|
57
|
-
<
|
|
57
|
+
<daff-docs-example-viewer example="native-select-hint"></daff-docs-example-viewer>
|
|
58
58
|
|
|
59
59
|
## Accessibility
|
|
60
60
|
When `<daff-form-label>` is used within `<daff-form-field>`, the label automatically associates with the select using the `for` and `id` attributes.
|
package/native-select/index.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ declare class DaffNativeSelectComponent extends DaffFormFieldControl<string> imp
|
|
|
29
29
|
* Implemented as part of DaffFormFieldControl.
|
|
30
30
|
*/
|
|
31
31
|
private get _id();
|
|
32
|
+
constructor(
|
|
33
|
+
/**
|
|
34
|
+
* @docs-private
|
|
35
|
+
*/
|
|
36
|
+
ngControl: NgControl, _elementRef: ElementRef<HTMLInputElement>, formField: DaffFormFieldComponent);
|
|
32
37
|
/**
|
|
33
38
|
* @docs-private
|
|
34
39
|
*/
|
|
@@ -42,7 +47,7 @@ declare class DaffNativeSelectComponent extends DaffFormFieldControl<string> imp
|
|
|
42
47
|
/**
|
|
43
48
|
* @docs-private
|
|
44
49
|
*/
|
|
45
|
-
get disabledAttribute():
|
|
50
|
+
get disabledAttribute(): boolean;
|
|
46
51
|
private _required;
|
|
47
52
|
/**
|
|
48
53
|
* @docs-private
|
|
@@ -55,19 +60,15 @@ declare class DaffNativeSelectComponent extends DaffFormFieldControl<string> imp
|
|
|
55
60
|
* @docs-private
|
|
56
61
|
*/
|
|
57
62
|
get requiredAttribute(): true;
|
|
58
|
-
/**
|
|
59
|
-
* @docs-private
|
|
60
|
-
*/
|
|
61
63
|
focus(): void;
|
|
62
64
|
/**
|
|
63
65
|
* @docs-private
|
|
64
66
|
*/
|
|
65
|
-
|
|
66
|
-
constructor(
|
|
67
|
+
_handleFocus(): void;
|
|
67
68
|
/**
|
|
68
69
|
* @docs-private
|
|
69
70
|
*/
|
|
70
|
-
|
|
71
|
+
_handleBlur(): void;
|
|
71
72
|
/** @docs-private */
|
|
72
73
|
ngOnInit(): void;
|
|
73
74
|
/**
|