@daffodil/design 0.90.0 → 0.92.3-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/README.md +26 -38
- package/accordion/index.d.ts +9 -6
- package/article/README.md +66 -46
- package/article/index.d.ts +41 -0
- package/article/src/article-theme.scss +22 -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 +27 -6
- package/button/src/button/basic/button-theme.scss +4 -2
- package/button/src/button/button-base.scss +29 -6
- package/button/src/button/icon/icon-theme.scss +10 -6
- package/button/src/button/raised/raised-theme.scss +6 -4
- package/callout/README.md +15 -27
- package/card/README.md +36 -69
- package/card/index.d.ts +7 -41
- package/card/src/card-base-theme.scss +2 -5
- package/card/src/card-base.scss +2 -2
- package/checkbox/README.md +0 -0
- package/checkbox/index.d.ts +177 -0
- package/container/README.md +18 -23
- package/fesm2022/daffodil-design-accordion.mjs +34 -25
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +283 -17
- 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 +90 -45
- 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 +43 -90
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-checkbox.mjs +317 -0
- package/fesm2022/daffodil-design-checkbox.mjs.map +1 -0
- package/fesm2022/daffodil-design-container.mjs +8 -8
- package/fesm2022/daffodil-design-container.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +56 -86
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +62 -0
- package/fesm2022/daffodil-design-form.mjs.map +1 -0
- package/fesm2022/daffodil-design-hero.mjs +23 -23
- package/fesm2022/daffodil-design-hero.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +19 -11
- 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 +86 -83
- 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 +28 -64
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +11 -16
- 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 +19 -18
- package/fesm2022/daffodil-design-quantity-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-radio.mjs +27 -56
- 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 +30 -60
- 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 +49 -106
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +35 -27
- 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 +79 -80
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design-tree.mjs +152 -112
- 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 +559 -711
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form/README.md +75 -0
- package/form/index.d.ts +27 -0
- package/form-field/README.md +74 -99
- package/form-field/index.d.ts +64 -42
- package/hero/README.md +5 -5
- package/image/README.md +27 -19
- package/image/index.d.ts +6 -1
- package/index.d.ts +282 -447
- package/input/README.md +36 -16
- 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 +107 -17
- package/modal/index.d.ts +72 -35
- package/native-select/README.md +52 -15
- 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/notification/index.d.ts +7 -38
- package/package.json +1 -1
- package/paginator/README.md +42 -6
- package/paginator/index.d.ts +5 -9
- 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/radio/index.d.ts +0 -16
- package/scss/layout/_breakpoint.scss +1 -1
- package/scss/theme.scss +9 -5
- package/scss/theming/_color-palettes.scss +19 -11
- package/scss/theming/_configure-theme.scss +11 -10
- package/scss/theming/_daff-theme.scss +5 -14
- package/scss/theming/_get-base-color.scss +2 -2
- package/scss/theming/_get-palette.scss +2 -2
- package/scss/theming/_get-theme-mode.scss +3 -3
- package/scss/theming/_index.scss +2 -1
- package/scss/theming/contrast/max-contrast/max-contrast.scss +3 -3
- package/scss/theming/contrast/text-contrast/text-contrast.scss +22 -16
- package/scss/theming/contrast/text-contrast/text-contrast.spec.scss +57 -0
- package/scss/theming/create-theme/_create-theme.scss +330 -0
- package/scss/theming/create-theme/_create-theme.spec.scss +122 -0
- package/scss/theming/create-theme/_index.scss +1 -0
- package/scss/theming/get-font-colors/_get-font-colors.scss +36 -0
- package/scss/theming/get-font-colors/_get-font-colors.spec.scss +72 -0
- package/scss/typography/mixins/_font-weight.scss +8 -14
- package/select/README.md +107 -4
- package/sidebar/README.md +6 -14
- package/sidebar/index.d.ts +3 -15
- 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 +21 -29
- package/switch/index.d.ts +18 -48
- package/switch/src/switch-theme.scss +26 -18
- package/tabs/README.md +1 -1
- package/tabs/index.d.ts +8 -5
- package/tag/README.md +24 -30
- package/tag/index.d.ts +1 -1
- package/tag/src/tag-theme.scss +11 -9
- package/text-snippet/README.md +1 -1
- package/text-snippet/src/text-snippet-theme.scss +12 -0
- package/textarea/README.md +36 -6
- 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 -96
- package/tree/src/tree-theme.scss +0 -4
- package/accordion/examples/index.d.ts +0 -20
- package/article/examples/index.d.ts +0 -50
- package/breadcrumb/examples/index.d.ts +0 -10
- package/button/examples/index.d.ts +0 -67
- package/callout/examples/index.d.ts +0 -41
- package/card/examples/index.d.ts +0 -62
- package/card/src/card/raised/raised-theme.scss +0 -28
- package/checkbox/examples/index.d.ts +0 -32
- package/container/examples/index.d.ts +0 -16
- package/fesm2022/daffodil-design-accordion-examples.mjs +0 -50
- package/fesm2022/daffodil-design-accordion-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-article-examples.mjs +0 -134
- package/fesm2022/daffodil-design-article-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs +0 -46
- package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-button-examples.mjs +0 -178
- package/fesm2022/daffodil-design-button-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-callout-examples.mjs +0 -116
- package/fesm2022/daffodil-design-callout-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-card-examples.mjs +0 -168
- package/fesm2022/daffodil-design-card-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-checkbox-examples.mjs +0 -76
- package/fesm2022/daffodil-design-checkbox-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-container-examples.mjs +0 -41
- package/fesm2022/daffodil-design-container-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-form-field-examples.mjs +0 -96
- package/fesm2022/daffodil-design-form-field-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-hero-examples.mjs +0 -121
- package/fesm2022/daffodil-design-hero-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-image-examples.mjs +0 -58
- package/fesm2022/daffodil-design-image-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-input-examples.mjs +0 -108
- package/fesm2022/daffodil-design-input-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-list-examples.mjs +0 -77
- package/fesm2022/daffodil-design-list-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-loading-icon-examples.mjs +0 -44
- package/fesm2022/daffodil-design-loading-icon-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-media-gallery-examples.mjs +0 -104
- package/fesm2022/daffodil-design-media-gallery-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-menu-examples.mjs +0 -50
- package/fesm2022/daffodil-design-menu-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-modal-examples.mjs +0 -51
- package/fesm2022/daffodil-design-modal-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-native-select-examples.mjs +0 -71
- package/fesm2022/daffodil-design-native-select-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-navbar-examples.mjs +0 -88
- package/fesm2022/daffodil-design-navbar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-notification-examples.mjs +0 -102
- package/fesm2022/daffodil-design-notification-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-paginator-examples.mjs +0 -59
- package/fesm2022/daffodil-design-paginator-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-progress-bar-examples.mjs +0 -57
- package/fesm2022/daffodil-design-progress-bar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +0 -85
- package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-radio-examples.mjs +0 -34
- package/fesm2022/daffodil-design-radio-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-select-examples.mjs +0 -117
- package/fesm2022/daffodil-design-select-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-sidebar-examples.mjs +0 -109
- package/fesm2022/daffodil-design-sidebar-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-sticky-examples.mjs +0 -25
- package/fesm2022/daffodil-design-sticky-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-switch-examples.mjs +0 -110
- package/fesm2022/daffodil-design-switch-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tabs-examples.mjs +0 -115
- package/fesm2022/daffodil-design-tabs-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tag-examples.mjs +0 -125
- package/fesm2022/daffodil-design-tag-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-text-snippet-examples.mjs +0 -25
- package/fesm2022/daffodil-design-text-snippet-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-textarea-examples.mjs +0 -66
- package/fesm2022/daffodil-design-textarea-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-toast-examples.mjs +0 -147
- package/fesm2022/daffodil-design-toast-examples.mjs.map +0 -1
- package/fesm2022/daffodil-design-tree-examples.mjs +0 -104
- package/fesm2022/daffodil-design-tree-examples.mjs.map +0 -1
- package/form-field/examples/index.d.ts +0 -18
- package/hero/examples/index.d.ts +0 -45
- package/image/examples/index.d.ts +0 -10
- package/input/examples/index.d.ts +0 -10
- package/list/examples/index.d.ts +0 -29
- package/loading-icon/examples/index.d.ts +0 -16
- package/media-gallery/examples/index.d.ts +0 -38
- package/menu/examples/index.d.ts +0 -20
- package/modal/examples/index.d.ts +0 -15
- package/native-select/examples/index.d.ts +0 -10
- package/navbar/examples/index.d.ts +0 -31
- package/notification/examples/index.d.ts +0 -12
- package/paginator/examples/index.d.ts +0 -26
- package/progress-bar/examples/index.d.ts +0 -10
- package/quantity-field/examples/index.d.ts +0 -30
- package/radio/examples/index.d.ts +0 -13
- package/select/examples/index.d.ts +0 -28
- package/sidebar/examples/index.d.ts +0 -10
- package/sticky/examples/index.d.ts +0 -10
- package/switch/examples/index.d.ts +0 -46
- package/tabs/examples/index.d.ts +0 -12
- package/tag/examples/index.d.ts +0 -50
- package/text-snippet/examples/index.d.ts +0 -10
- package/textarea/examples/index.d.ts +0 -10
- package/toast/examples/index.d.ts +0 -56
- package/tree/examples/index.d.ts +0 -18
- /package/{form-field → form}/src/error-message/error-message-theme.scss +0 -0
- /package/{form-field → form}/src/hint/hint-theme.scss +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, input, ContentChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@daffodil/design';
|
|
4
|
+
import { DaffColorableDirective, DaffSizableDirective } from '@daffodil/design';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Labels are used to describe the loading state and provide context for users.
|
|
8
|
+
* They are optional.
|
|
9
|
+
*
|
|
10
|
+
* @usage
|
|
11
|
+
* ```html
|
|
12
|
+
* <daff-spinner-label>Loading</daff-spinner-label>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
class DaffSpinnerLabelDirective {
|
|
16
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
17
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.18", type: DaffSpinnerLabelDirective, isStandalone: true, selector: "daff-spinner-label", ngImport: i0 }); }
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerLabelDirective, decorators: [{
|
|
20
|
+
type: Directive,
|
|
21
|
+
args: [{
|
|
22
|
+
/* eslint-disable-next-line @angular-eslint/directive-selector */
|
|
23
|
+
selector: 'daff-spinner-label',
|
|
24
|
+
}]
|
|
25
|
+
}] });
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* DaffSpinnerComponent is an animated indicator that lets users know content or action is being loaded.
|
|
29
|
+
*/
|
|
30
|
+
class DaffSpinnerComponent {
|
|
31
|
+
static { this.SIZE_MAP = {
|
|
32
|
+
xs: 12,
|
|
33
|
+
sm: 16,
|
|
34
|
+
md: 32,
|
|
35
|
+
lg: 40,
|
|
36
|
+
xl: 48,
|
|
37
|
+
}; }
|
|
38
|
+
/**
|
|
39
|
+
* @docs-private
|
|
40
|
+
*/
|
|
41
|
+
get _ariaLabel() {
|
|
42
|
+
if (!this._label) {
|
|
43
|
+
return this.ariaLabel();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @docs-private
|
|
48
|
+
*
|
|
49
|
+
* The dimension (width/height) based on the size.
|
|
50
|
+
*/
|
|
51
|
+
get dimension() {
|
|
52
|
+
return DaffSpinnerComponent.SIZE_MAP[this.sizable.size];
|
|
53
|
+
}
|
|
54
|
+
constructor(sizable) {
|
|
55
|
+
this.sizable = sizable;
|
|
56
|
+
/**
|
|
57
|
+
* The `aria-label` for the spinner. Defaults to "loading".
|
|
58
|
+
*/
|
|
59
|
+
this.ariaLabel = input('loading', ...(ngDevMode ? [{ debugName: "ariaLabel", alias: 'aria-label' }] : [{ alias: 'aria-label' }]));
|
|
60
|
+
this.sizable.defaultSize = 'md';
|
|
61
|
+
}
|
|
62
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerComponent, deps: [{ token: i1.DaffSizableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
63
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffSpinnerComponent, isStandalone: true, selector: "daff-spinner", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "status" }, properties: { "attr.aria-label": "_ariaLabel" }, classAttribute: "daff-spinner" }, queries: [{ propertyName: "_label", first: true, predicate: DaffSpinnerLabelDirective, descendants: true }], hostDirectives: [{ directive: i1.DaffColorableDirective, inputs: ["color", "color"] }, { directive: i1.DaffSizableDirective, inputs: ["size", "size"] }], ngImport: i0, template: "<svg\n [attr.height]=\"dimension\"\n [attr.width]=\"dimension\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n class=\"daff-spinner__svg\">\n <circle class=\"daff-spinner__track\" cx=\"8\" cy=\"8\" r=\"7\" vector-effect=\"non-scaling-stroke\"></circle>\n <path class=\"daff-spinner__path\" d=\"M15 8a7.002 7.002 0 00-7-7\" vector-effect=\"non-scaling-stroke\"></path>\n</svg>\n@if (_label) {\n <div class=\"daff-spinner__label\">\n <ng-content select=\"daff-spinner-label\"></ng-content>\n </div>\n}", styles: [":host{display:inline-flex;flex-direction:column;align-items:center;gap:.25rem}:host.daff-xs .daff-spinner__track,:host.daff-xs .daff-spinner__path{stroke-width:1.5}:host.daff-xl .daff-spinner__track,:host.daff-xl .daff-spinner__path{stroke-width:2.5}.daff-spinner__svg{display:block}.daff-spinner__track{stroke:currentColor;stroke-opacity:.25;stroke-width:2}.daff-spinner__path{stroke:currentColor;stroke-width:2;stroke-linecap:round;animation:spinner-rotation 1s cubic-bezier(0,0,1,1) infinite;transform-origin:center}@keyframes spinner-rotation{to{transform:rotate(1turn)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSpinnerComponent, decorators: [{
|
|
66
|
+
type: Component,
|
|
67
|
+
args: [{ selector: 'daff-spinner', host: {
|
|
68
|
+
class: 'daff-spinner',
|
|
69
|
+
role: 'status',
|
|
70
|
+
'[attr.aria-label]': '_ariaLabel',
|
|
71
|
+
}, hostDirectives: [
|
|
72
|
+
{
|
|
73
|
+
directive: DaffColorableDirective,
|
|
74
|
+
inputs: ['color'],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
directive: DaffSizableDirective,
|
|
78
|
+
inputs: ['size'],
|
|
79
|
+
},
|
|
80
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg\n [attr.height]=\"dimension\"\n [attr.width]=\"dimension\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n class=\"daff-spinner__svg\">\n <circle class=\"daff-spinner__track\" cx=\"8\" cy=\"8\" r=\"7\" vector-effect=\"non-scaling-stroke\"></circle>\n <path class=\"daff-spinner__path\" d=\"M15 8a7.002 7.002 0 00-7-7\" vector-effect=\"non-scaling-stroke\"></path>\n</svg>\n@if (_label) {\n <div class=\"daff-spinner__label\">\n <ng-content select=\"daff-spinner-label\"></ng-content>\n </div>\n}", styles: [":host{display:inline-flex;flex-direction:column;align-items:center;gap:.25rem}:host.daff-xs .daff-spinner__track,:host.daff-xs .daff-spinner__path{stroke-width:1.5}:host.daff-xl .daff-spinner__track,:host.daff-xl .daff-spinner__path{stroke-width:2.5}.daff-spinner__svg{display:block}.daff-spinner__track{stroke:currentColor;stroke-opacity:.25;stroke-width:2}.daff-spinner__path{stroke:currentColor;stroke-width:2;stroke-linecap:round;animation:spinner-rotation 1s cubic-bezier(0,0,1,1) infinite;transform-origin:center}@keyframes spinner-rotation{to{transform:rotate(1turn)}}\n"] }]
|
|
81
|
+
}], ctorParameters: () => [{ type: i1.DaffSizableDirective }], propDecorators: { _label: [{
|
|
82
|
+
type: ContentChild,
|
|
83
|
+
args: [DaffSpinnerLabelDirective]
|
|
84
|
+
}], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @docs-private
|
|
88
|
+
*/
|
|
89
|
+
const DAFF_SPINNER_COMPONENTS = [
|
|
90
|
+
DaffSpinnerComponent,
|
|
91
|
+
DaffSpinnerLabelDirective,
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Generated bundle index. Do not edit.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
export { DAFF_SPINNER_COMPONENTS, DaffSpinnerComponent, DaffSpinnerLabelDirective };
|
|
99
|
+
//# sourceMappingURL=daffodil-design-spinner.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-design-spinner.mjs","sources":["../../../libs/design/spinner/src/spinner-label/spinner-label.directive.ts","../../../libs/design/spinner/src/spinner.component.ts","../../../libs/design/spinner/src/spinner.component.html","../../../libs/design/spinner/src/spinner.ts","../../../libs/design/spinner/src/daffodil-design-spinner.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n/**\n * Labels are used to describe the loading state and provide context for users.\n * They are optional.\n *\n * @usage\n * ```html\n * <daff-spinner-label>Loading</daff-spinner-label>\n * ```\n */\n@Directive({\n /* eslint-disable-next-line @angular-eslint/directive-selector */\n selector: 'daff-spinner-label',\n})\nexport class DaffSpinnerLabelDirective {}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n ContentChild,\n} from '@angular/core';\n\nimport {\n DaffColorableDirective,\n DaffSizableDirective,\n DaffSizeAllType,\n} from '@daffodil/design';\n\nimport { DaffSpinnerLabelDirective } from './spinner-label/spinner-label.directive';\n\n/**\n * DaffSpinnerComponent is an animated indicator that lets users know content or action is being loaded.\n */\n@Component({\n selector: 'daff-spinner',\n templateUrl: './spinner.component.html',\n styleUrl: './spinner.component.scss',\n host: {\n class: 'daff-spinner',\n role: 'status',\n '[attr.aria-label]': '_ariaLabel',\n },\n hostDirectives: [\n {\n directive: DaffColorableDirective,\n inputs: ['color'],\n },\n {\n directive: DaffSizableDirective,\n inputs: ['size'],\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DaffSpinnerComponent {\n /**\n * @docs-private\n */\n @ContentChild(DaffSpinnerLabelDirective) _label: DaffSpinnerLabelDirective;\n\n private static readonly SIZE_MAP: Record<DaffSizeAllType, number> = {\n xs: 12,\n sm: 16,\n md: 32,\n lg: 40,\n xl: 48,\n };\n\n /**\n * The `aria-label` for the spinner. Defaults to \"loading\".\n */\n ariaLabel = input('loading', { alias: 'aria-label' });\n\n /**\n * @docs-private\n */\n get _ariaLabel() {\n if (!this._label) {\n return this.ariaLabel();\n }\n }\n\n /**\n * @docs-private\n *\n * The dimension (width/height) based on the size.\n */\n get dimension() {\n return DaffSpinnerComponent.SIZE_MAP[this.sizable.size];\n }\n\n constructor(\n private sizable: DaffSizableDirective<DaffSizeAllType>,\n ) {\n this.sizable.defaultSize = 'md';\n }\n}\n","<svg\n [attr.height]=\"dimension\"\n [attr.width]=\"dimension\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n class=\"daff-spinner__svg\">\n <circle class=\"daff-spinner__track\" cx=\"8\" cy=\"8\" r=\"7\" vector-effect=\"non-scaling-stroke\"></circle>\n <path class=\"daff-spinner__path\" d=\"M15 8a7.002 7.002 0 00-7-7\" vector-effect=\"non-scaling-stroke\"></path>\n</svg>\n@if (_label) {\n <div class=\"daff-spinner__label\">\n <ng-content select=\"daff-spinner-label\"></ng-content>\n </div>\n}","import { DaffSpinnerLabelDirective } from './spinner-label/spinner-label.directive';\nimport { DaffSpinnerComponent } from './spinner.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_SPINNER_COMPONENTS = <const> [\n DaffSpinnerComponent,\n DaffSpinnerLabelDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1,108 +1,65 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter, Output, Input,
|
|
4
|
-
import * as i1 from '@daffodil/design
|
|
5
|
-
import {
|
|
3
|
+
import { EventEmitter, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import * as i1 from '@daffodil/design';
|
|
5
|
+
import { DaffSizableDirective, DaffDisableableDirective } from '@daffodil/design';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The position of the label relative to the switch.
|
|
9
9
|
*/
|
|
10
|
-
var
|
|
11
|
-
(function (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})(
|
|
10
|
+
var DaffSwitchLabelPositionEnum;
|
|
11
|
+
(function (DaffSwitchLabelPositionEnum) {
|
|
12
|
+
DaffSwitchLabelPositionEnum["LEFT"] = "left";
|
|
13
|
+
DaffSwitchLabelPositionEnum["RIGHT"] = "right";
|
|
14
|
+
DaffSwitchLabelPositionEnum["TOP"] = "top";
|
|
15
|
+
DaffSwitchLabelPositionEnum["BOTTOM"] = "bottom";
|
|
16
|
+
})(DaffSwitchLabelPositionEnum || (DaffSwitchLabelPositionEnum = {}));
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/* eslint-disable quote-props */
|
|
19
|
+
let switchIncrementalId = 0;
|
|
19
20
|
/**
|
|
20
21
|
* The switch component provides a way to toggle between two settings.
|
|
21
22
|
*
|
|
22
23
|
* ```html
|
|
23
|
-
* <daff-switch>
|
|
24
|
-
* Label
|
|
25
|
-
* </daff-switch>
|
|
24
|
+
* <daff-switch>Label</daff-switch>
|
|
26
25
|
* ```
|
|
27
26
|
*/
|
|
28
|
-
class DaffSwitchComponent {
|
|
29
|
-
constructor() {
|
|
27
|
+
class DaffSwitchComponent extends DaffSizableDirective {
|
|
28
|
+
constructor(disabledDirective) {
|
|
29
|
+
super();
|
|
30
|
+
this.disabledDirective = disabledDirective;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* The position of the label relative to the switch.
|
|
32
33
|
*/
|
|
33
|
-
this.
|
|
34
|
+
this.labelPosition = DaffSwitchLabelPositionEnum.LEFT;
|
|
34
35
|
/**
|
|
35
36
|
* Current state of switch (on/off).
|
|
36
37
|
*/
|
|
37
38
|
this.checked = false;
|
|
38
|
-
/**
|
|
39
|
-
* The position of the label relative to the switch.
|
|
40
|
-
*/
|
|
41
|
-
this.labelPosition = DaffLabelPositionEnum.LEFT;
|
|
42
|
-
/**
|
|
43
|
-
* Whether the switch shows an error.
|
|
44
|
-
*/
|
|
45
|
-
this.error = false;
|
|
46
|
-
/**
|
|
47
|
-
* @docs-private
|
|
48
|
-
*/
|
|
49
|
-
this._disabled = false;
|
|
50
39
|
/**
|
|
51
40
|
* @docs-private
|
|
52
41
|
*/
|
|
53
|
-
this.
|
|
54
|
-
/**
|
|
55
|
-
* aria-label for the switch.
|
|
56
|
-
*/
|
|
57
|
-
this.ariaLabel = '';
|
|
42
|
+
this.labelId = 'daff-switch-' + switchIncrementalId++ + '-label';
|
|
58
43
|
/**
|
|
59
|
-
*
|
|
44
|
+
* The unique id of the switch. Defaults to an autogenerated value. When using this,
|
|
45
|
+
* it's your responsibility to ensure that the id for each switch is unique.
|
|
60
46
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @example Using the `id` property
|
|
64
|
-
* ```html
|
|
65
|
-
* <daff-switch [id]="'custom-id'"></daff-switch>
|
|
66
|
-
* ```
|
|
47
|
+
* It gets assigned to the `for` attribute on the `<label>` inside of the switch.
|
|
67
48
|
*/
|
|
68
|
-
this.id = 'daff-switch-' +
|
|
49
|
+
this.id = 'daff-switch-' + switchIncrementalId++;
|
|
69
50
|
/**
|
|
70
51
|
* Output event triggered when the switch has been toggled.
|
|
71
52
|
*/
|
|
72
53
|
this.toggled = new EventEmitter();
|
|
73
54
|
}
|
|
74
55
|
/**
|
|
75
|
-
* Whether the switch is disabled
|
|
56
|
+
* Whether the switch is disabled.
|
|
76
57
|
*/
|
|
77
58
|
get disabled() {
|
|
78
|
-
return this.
|
|
59
|
+
return this.disabledDirective.disabled;
|
|
79
60
|
}
|
|
80
61
|
set disabled(value) {
|
|
81
|
-
this.
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* @docs-private
|
|
85
|
-
*/
|
|
86
|
-
get disabledAttribute() {
|
|
87
|
-
return this.disabled ? true : null;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* @docs-private
|
|
91
|
-
*/
|
|
92
|
-
get ariaDisabled() {
|
|
93
|
-
return this.disabled ? true : null;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* @docs-private
|
|
97
|
-
*/
|
|
98
|
-
get classes() {
|
|
99
|
-
return `daff-switch ${this.labelPosition}`;
|
|
100
|
-
}
|
|
101
|
-
handleKeydown(event) {
|
|
102
|
-
if (event.code === 'Space') {
|
|
103
|
-
event.preventDefault();
|
|
104
|
-
this.onToggle();
|
|
105
|
-
}
|
|
62
|
+
this.disabledDirective.disabled = coerceBooleanProperty(value);
|
|
106
63
|
}
|
|
107
64
|
/**
|
|
108
65
|
* @docs-private
|
|
@@ -113,48 +70,34 @@ class DaffSwitchComponent {
|
|
|
113
70
|
this.toggled.emit(this.checked);
|
|
114
71
|
}
|
|
115
72
|
}
|
|
116
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
117
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
73
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSwitchComponent, deps: [{ token: i1.DaffDisableableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffSwitchComponent, isStandalone: true, selector: "daff-switch", inputs: { labelPosition: "labelPosition", disabled: "disabled", checked: "checked", id: "id" }, outputs: { toggled: "toggled" }, host: { properties: { "class.checked": "checked", "class.left": "labelPosition === \"left\"", "class.right": "labelPosition === \"right\"", "class.top": "labelPosition === \"top\"", "class.bottom": "labelPosition === \"bottom\"" }, classAttribute: "daff-switch" }, usesInheritance: true, hostDirectives: [{ directive: i1.DaffSizableDirective, inputs: ["size", "size"] }, { directive: i1.DaffDisableableDirective, inputs: ["disabled", "disabled"] }], ngImport: i0, template: "<label class=\"daff-switch__label\" [id]=\"labelId\" [for]=\"id\">\n <ng-content></ng-content>\n</label>\n\n<button class=\"daff-switch__toggle\"\n type=\"button\"\n role=\"switch\"\n (click)=\"onToggle()\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.id]=\"id\">\n</button>", styles: [":host{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.left{flex-direction:row}:host.right{flex-direction:row-reverse}:host.top{flex-direction:column}:host.bottom{flex-direction:column-reverse}:host.left,:host.right{justify-content:space-between;width:fit-content}:host.top,:host.bottom{align-items:flex-start}:host.daff-disabled{opacity:.5;cursor:not-allowed}:host.daff-disabled .daff-switch__label{cursor:not-allowed}:host.daff-disabled .daff-switch__toggle{cursor:not-allowed}:host.checked .daff-switch__toggle:before{transform:translate(1.5rem)}:host.daff-sm .daff-switch__toggle{height:1.5rem;width:2.75rem}:host.daff-sm .daff-switch__toggle:before{height:1.125rem;width:1.125rem;inset-inline-start:.15rem}:host.daff-sm.checked .daff-switch__toggle:before{transform:translate(1.25rem)}.daff-switch__label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:1rem;line-height:1rem}.daff-switch__toggle{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;display:flex;align-items:center;border:none;border-radius:1rem;height:2rem;width:3.5rem;margin:0;outline:none;padding:0;position:relative}.daff-switch__toggle:before{content:\"\";position:absolute;border-radius:1.5rem;height:1.625rem;width:1.625rem;inset-inline-start:.175rem;transition:transform .3s}.daff-switch__toggle:after{content:\"\";display:flex;border-radius:1rem;width:100%;outline-offset:1px;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
118
75
|
}
|
|
119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffSwitchComponent, decorators: [{
|
|
120
77
|
type: Component,
|
|
121
|
-
args: [{ selector: 'daff-switch', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
78
|
+
args: [{ selector: 'daff-switch', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
|
|
79
|
+
{
|
|
80
|
+
directive: DaffSizableDirective,
|
|
81
|
+
inputs: ['size'],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
directive: DaffDisableableDirective,
|
|
85
|
+
inputs: ['disabled'],
|
|
86
|
+
},
|
|
87
|
+
], host: {
|
|
88
|
+
'class': 'daff-switch',
|
|
89
|
+
'[class.checked]': 'checked',
|
|
90
|
+
'[class.left]': 'labelPosition === "left"',
|
|
91
|
+
'[class.right]': 'labelPosition === "right"',
|
|
92
|
+
'[class.top]': 'labelPosition === "top"',
|
|
93
|
+
'[class.bottom]': 'labelPosition === "bottom"',
|
|
94
|
+
}, template: "<label class=\"daff-switch__label\" [id]=\"labelId\" [for]=\"id\">\n <ng-content></ng-content>\n</label>\n\n<button class=\"daff-switch__toggle\"\n type=\"button\"\n role=\"switch\"\n (click)=\"onToggle()\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.id]=\"id\">\n</button>", styles: [":host{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host.left{flex-direction:row}:host.right{flex-direction:row-reverse}:host.top{flex-direction:column}:host.bottom{flex-direction:column-reverse}:host.left,:host.right{justify-content:space-between;width:fit-content}:host.top,:host.bottom{align-items:flex-start}:host.daff-disabled{opacity:.5;cursor:not-allowed}:host.daff-disabled .daff-switch__label{cursor:not-allowed}:host.daff-disabled .daff-switch__toggle{cursor:not-allowed}:host.checked .daff-switch__toggle:before{transform:translate(1.5rem)}:host.daff-sm .daff-switch__toggle{height:1.5rem;width:2.75rem}:host.daff-sm .daff-switch__toggle:before{height:1.125rem;width:1.125rem;inset-inline-start:.15rem}:host.daff-sm.checked .daff-switch__toggle:before{transform:translate(1.25rem)}.daff-switch__label{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:1rem;line-height:1rem}.daff-switch__toggle{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;appearance:none;display:flex;align-items:center;border:none;border-radius:1rem;height:2rem;width:3.5rem;margin:0;outline:none;padding:0;position:relative}.daff-switch__toggle:before{content:\"\";position:absolute;border-radius:1.5rem;height:1.625rem;width:1.625rem;inset-inline-start:.175rem;transition:transform .3s}.daff-switch__toggle:after{content:\"\";display:flex;border-radius:1rem;width:100%;outline-offset:1px;height:100%}\n"] }]
|
|
95
|
+
}], ctorParameters: () => [{ type: i1.DaffDisableableDirective }], propDecorators: { labelPosition: [{
|
|
125
96
|
type: Input
|
|
126
|
-
}, {
|
|
127
|
-
type: HostBinding,
|
|
128
|
-
args: ['class.daff-disabled']
|
|
129
|
-
}], disabledAttribute: [{
|
|
130
|
-
type: HostBinding,
|
|
131
|
-
args: ['attr.disabled']
|
|
132
|
-
}], ariaDisabled: [{
|
|
133
|
-
type: HostBinding,
|
|
134
|
-
args: ['attr.aria-disabled']
|
|
135
|
-
}], classes: [{
|
|
136
|
-
type: HostBinding,
|
|
137
|
-
args: ['class']
|
|
138
|
-
}], loading: [{
|
|
97
|
+
}], disabled: [{
|
|
139
98
|
type: Input
|
|
140
|
-
}, {
|
|
141
|
-
type: HostBinding,
|
|
142
|
-
args: ['class.daff-loading']
|
|
143
99
|
}], checked: [{
|
|
144
100
|
type: Input
|
|
145
|
-
}], labelPosition: [{
|
|
146
|
-
type: Input
|
|
147
|
-
}], error: [{
|
|
148
|
-
type: Input
|
|
149
|
-
}], handleKeydown: [{
|
|
150
|
-
type: HostListener,
|
|
151
|
-
args: ['keydown', ['$event']]
|
|
152
|
-
}], externalAriaLabel: [{
|
|
153
|
-
type: HostBinding,
|
|
154
|
-
args: ['attr.aria-label']
|
|
155
|
-
}], ariaLabel: [{
|
|
156
|
-
type: Input,
|
|
157
|
-
args: ['aria-label']
|
|
158
101
|
}], id: [{
|
|
159
102
|
type: Input
|
|
160
103
|
}], toggled: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-design-switch.mjs","sources":["../../../libs/design/switch/src/switch/label-position.ts","../../../libs/design/switch/src/switch/switch.component.ts","../../../libs/design/switch/src/switch/switch.component.html","../../../libs/design/switch/src/switch.ts","../../../libs/design/switch/src/daffodil-design-switch.ts"],"sourcesContent":["export type
|
|
1
|
+
{"version":3,"file":"daffodil-design-switch.mjs","sources":["../../../libs/design/switch/src/switch/label-position.ts","../../../libs/design/switch/src/switch/switch.component.ts","../../../libs/design/switch/src/switch/switch.component.html","../../../libs/design/switch/src/switch.ts","../../../libs/design/switch/src/daffodil-design-switch.ts"],"sourcesContent":["export type DaffSwitchLabelPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * The position of the label relative to the switch.\n */\nexport enum DaffSwitchLabelPositionEnum {\n LEFT = 'left',\n RIGHT = 'right',\n TOP = 'top',\n BOTTOM = 'bottom',\n}\n","/* eslint-disable quote-props */\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport {\n DaffDisableable,\n DaffDisableableDirective,\n DaffSizableDirective,\n DaffSizeSmallType,\n} from '@daffodil/design';\n\nimport {\n DaffSwitchLabelPosition,\n DaffSwitchLabelPositionEnum,\n} from './label-position';\n\nlet switchIncrementalId = 0;\n\nexport type DaffSwitchSize = DaffSizeSmallType;\n\n/**\n * The switch component provides a way to toggle between two settings.\n *\n * ```html\n * <daff-switch>Label</daff-switch>\n * ```\n */\n@Component({\n selector: 'daff-switch',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './switch.component.html',\n styleUrls: ['./switch.component.scss'],\n hostDirectives: [\n {\n directive: DaffSizableDirective,\n inputs: ['size'],\n },\n {\n directive: DaffDisableableDirective,\n inputs: ['disabled'],\n },\n ],\n host: {\n 'class': 'daff-switch',\n '[class.checked]': 'checked',\n '[class.left]': 'labelPosition === \"left\"',\n '[class.right]': 'labelPosition === \"right\"',\n '[class.top]': 'labelPosition === \"top\"',\n '[class.bottom]': 'labelPosition === \"bottom\"',\n },\n})\nexport class DaffSwitchComponent extends DaffSizableDirective<DaffSwitchSize> implements DaffDisableable {\n /**\n * The position of the label relative to the switch.\n */\n @Input() labelPosition: DaffSwitchLabelPosition = DaffSwitchLabelPositionEnum.LEFT;\n\n constructor(private disabledDirective: DaffDisableableDirective) {\n super();\n }\n\n /**\n * Whether the switch is disabled.\n */\n @Input() get disabled() {\n return this.disabledDirective.disabled;\n }\n set disabled(value: any) {\n this.disabledDirective.disabled = coerceBooleanProperty(value);\n }\n\n /**\n * Current state of switch (on/off).\n */\n @Input() checked = false;\n\n /**\n * @docs-private\n */\n labelId: string = 'daff-switch-' + switchIncrementalId++ + '-label';\n\n /**\n * The unique id of the switch. Defaults to an autogenerated value. When using this,\n * it's your responsibility to ensure that the id for each switch is unique.\n *\n * It gets assigned to the `for` attribute on the `<label>` inside of the switch.\n */\n @Input() id = 'daff-switch-' + switchIncrementalId++;\n\n /**\n * Output event triggered when the switch has been toggled.\n */\n @Output() toggled = new EventEmitter<boolean>();\n\n /**\n * @docs-private\n */\n onToggle() {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.toggled.emit(this.checked);\n }\n }\n}\n","<label class=\"daff-switch__label\" [id]=\"labelId\" [for]=\"id\">\n <ng-content></ng-content>\n</label>\n\n<button class=\"daff-switch__toggle\"\n type=\"button\"\n role=\"switch\"\n (click)=\"onToggle()\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-checked]=\"checked ? true : false\"\n [attr.aria-labelledby]=\"labelId\"\n [attr.id]=\"id\">\n</button>","import { DaffSwitchComponent } from './switch/switch.component';\n\n/**\n * @docs-private\n */\nexport const DAFF_SWITCH_COMPONENTS = <const> [\n DaffSwitchComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { TemplateRef, Input, ViewChild, ChangeDetectionStrategy, Component, ContentChild, ViewEncapsulation, EventEmitter, ViewChildren, ContentChildren, Output, HostBinding } from '@angular/core';
|
|
3
|
-
import * as i1$1 from '@angular/common';
|
|
4
|
-
import { NgIf, NgTemplateOutlet } from '@angular/common';
|
|
5
3
|
import * as i1 from '@daffodil/design';
|
|
6
|
-
import { DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
|
|
4
|
+
import { DaffDisableableDirective, DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
|
|
5
|
+
import * as i1$1 from '@angular/common';
|
|
6
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
7
7
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
8
8
|
|
|
9
9
|
let tabId = 1;
|
|
@@ -26,11 +26,16 @@ let tabId = 1;
|
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
class DaffTabComponent {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
/**
|
|
30
|
+
* @docs-private
|
|
31
|
+
*
|
|
32
|
+
* Whether the tab is disabled.
|
|
33
|
+
*/
|
|
34
|
+
get disabled() {
|
|
35
|
+
return this.disabledDirective.disabled;
|
|
36
|
+
}
|
|
37
|
+
constructor(disabledDirective) {
|
|
38
|
+
this.disabledDirective = disabledDirective;
|
|
34
39
|
/**
|
|
35
40
|
* A unique id for the tab component. Defaults to an autogenerated value. When using this,
|
|
36
41
|
* it's your responsibility to ensure that the id for each tab is unique.
|
|
@@ -42,8 +47,8 @@ class DaffTabComponent {
|
|
|
42
47
|
this.panelId = 'daff-tab-panel-' + tabId;
|
|
43
48
|
tabId++;
|
|
44
49
|
}
|
|
45
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
46
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
50
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabComponent, deps: [{ token: i1.DaffDisableableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
51
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffTabComponent, isStandalone: true, selector: "daff-tab", inputs: { id: "id" }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["content"], descendants: true, read: TemplateRef, static: true }, { propertyName: "labelRef", first: true, predicate: ["label"], descendants: true, read: TemplateRef, static: true }], hostDirectives: [{ directive: i1.DaffDisableableDirective, inputs: ["disabled", "disabled"] }], ngImport: i0, template: `
|
|
47
52
|
<ng-template #label>
|
|
48
53
|
<ng-content select="daff-tab-label"></ng-content>
|
|
49
54
|
</ng-template>
|
|
@@ -52,7 +57,7 @@ class DaffTabComponent {
|
|
|
52
57
|
</ng-template>
|
|
53
58
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
54
59
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabComponent, decorators: [{
|
|
56
61
|
type: Component,
|
|
57
62
|
args: [{
|
|
58
63
|
selector: 'daff-tab',
|
|
@@ -65,10 +70,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
65
70
|
</ng-template>
|
|
66
71
|
`,
|
|
67
72
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
73
|
+
hostDirectives: [
|
|
74
|
+
{
|
|
75
|
+
directive: DaffDisableableDirective,
|
|
76
|
+
inputs: ['disabled'],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
68
79
|
}]
|
|
69
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
70
|
-
type: Input
|
|
71
|
-
}], contentRef: [{
|
|
80
|
+
}], ctorParameters: () => [{ type: i1.DaffDisableableDirective }], propDecorators: { contentRef: [{
|
|
72
81
|
type: ViewChild,
|
|
73
82
|
args: ['content', { read: TemplateRef, static: true }]
|
|
74
83
|
}], labelRef: [{
|
|
@@ -91,13 +100,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
|
|
|
91
100
|
* ```
|
|
92
101
|
*/
|
|
93
102
|
class DaffTabLabelComponent {
|
|
94
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
95
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
103
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
104
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffTabLabelComponent, isStandalone: true, selector: "daff-tab-label", queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true }, { propertyName: "_suffix", first: true, predicate: DaffSuffixDirective, descendants: true }], ngImport: i0, template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-tab-label__content\">\n <ng-content></ng-content>\n</div>\n@if (_suffix) {\n <ng-content select=\"[daffSuffix]\"></ng-content>\n}", styles: [":host{display:flex;justify-content:center;align-items:center;gap:.5rem}.daff-tab-label__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
96
105
|
}
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabLabelComponent, decorators: [{
|
|
98
107
|
type: Component,
|
|
99
108
|
args: [{ selector: 'daff-tab-label', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
100
|
-
NgIf,
|
|
101
109
|
DaffPrefixDirective,
|
|
102
110
|
DaffSuffixDirective,
|
|
103
111
|
], template: "@if (_prefix) {\n <ng-content select=\"[daffPrefix]\"></ng-content>\n}\n<div class=\"daff-tab-label__content\">\n <ng-content></ng-content>\n</div>\n@if (_suffix) {\n <ng-content select=\"[daffSuffix]\"></ng-content>\n}", styles: [":host{display:flex;justify-content:center;align-items:center;gap:.5rem}.daff-tab-label__content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}\n"] }]
|
|
@@ -145,10 +153,10 @@ class DaffTabPanelComponent {
|
|
|
145
153
|
this._ariaLabelledBy = this.tab.id;
|
|
146
154
|
this._id = this.tab.panelId;
|
|
147
155
|
}
|
|
148
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
149
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
156
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabPanelComponent, deps: [{ token: DaffTabComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
157
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffTabPanelComponent, isStandalone: true, selector: "daff-tab-panel", host: { attributes: { "role": "tabpanel", "tabindex": "0" }, properties: { "attr.id": "tabPanelId", "attr.aria-labelledby": "ariaLabelledBy" }, classAttribute: "daff-tab-panel" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host(.daff-tab-panel){display:block;padding:1rem 0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
150
158
|
}
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabPanelComponent, decorators: [{
|
|
152
160
|
type: Component,
|
|
153
161
|
args: [{ selector: 'daff-tab-panel', template: `<ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
154
162
|
'class': 'daff-tab-panel',
|
|
@@ -192,10 +200,10 @@ class DaffTabActivatorComponent {
|
|
|
192
200
|
focus() {
|
|
193
201
|
this.el.nativeElement.focus();
|
|
194
202
|
}
|
|
195
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
196
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
203
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabActivatorComponent, deps: [{ token: i0.ElementRef }, { token: i1.DaffSelectableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
204
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: DaffTabActivatorComponent, isStandalone: true, selector: "button[daff-tab-activator],a[daff-tab-activator]", inputs: { tabActivatorId: "tabActivatorId", panelId: "panelId" }, host: { attributes: { "role": "tab" }, properties: { "attr.aria-selected": "ariaSelected", "attr.tabindex": "tabIndex", "attr.id": "tabActivatorId", "attr.aria-controls": "panelId" }, classAttribute: "daff-tab-activator" }, hostDirectives: [{ directive: i1.DaffSelectableDirective, inputs: ["selected", "selected"] }], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [".daff-tab-activator{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;appearance:none;background:none;border:none;font-size:1rem;line-height:1.5rem;font-weight:500;height:3rem;margin:0;min-width:8rem;padding:.5rem 1.5rem;text-decoration:none;z-index:2}.daff-tab-activator[disabled]{cursor:not-allowed;opacity:.6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
197
205
|
}
|
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
206
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabActivatorComponent, decorators: [{
|
|
199
207
|
type: Component,
|
|
200
208
|
args: [{ selector: '' +
|
|
201
209
|
'button[daff-tab-activator]' + ',' +
|
|
@@ -384,10 +392,10 @@ class DaffTabsComponent {
|
|
|
384
392
|
const array = this._tabs.toArray();
|
|
385
393
|
this.select(array[array.length - 1].id);
|
|
386
394
|
}
|
|
387
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
388
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
395
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
396
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: DaffTabsComponent, isStandalone: true, selector: "daff-tabs", inputs: { initiallySelected: "initiallySelected", ariaLabel: ["aria-label", "ariaLabel"], linkMode: "linkMode", url: "url", queryParam: "queryParam" }, outputs: { tabChange: "tabChange" }, host: { properties: { "attr.aria-label": "this.externalAriaLabel" }, classAttribute: "daff-tabs" }, queries: [{ propertyName: "_labels", predicate: DaffTabLabelComponent, descendants: true }, { propertyName: "_tabs", predicate: DaffTabComponent }], viewQueries: [{ propertyName: "_tabActivators", predicate: DaffTabActivatorComponent, descendants: true }], ngImport: i0, template: "<div class=\"daff-tabs__tab-list\"\n\trole=\"tablist\"\n\t[attr.aria-label]=\"ariaLabel\"\n\t(keydown.home)=\"selectFirst($event)\"\n\t(keydown.end)=\"selectLast($event)\">\n\t@for (tab of _tabs; track tab) {\n\t\t@if (linkMode && tab.disabled) {\n\t\t\t<button daff-tab-activator routerLinkActive\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[disabled]=\"tab.disabled\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</button>\n\t\t} @else if (linkMode) {\n\t\t\t<a daff-tab-activator routerLinkActive\n\t\t\t\tclass=\"daff-ae daff_tabs__link\"\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t[routerLink]=\"url || currentPath\"\n\t\t\t\tqueryParamsHandling=\"merge\"\n\t\t\t\t[queryParams]=\"_buildQueryParams(tab.id)\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\"\n\t\t\t\t(isActiveChange)=\"$event && select(tab.id)\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</a>\n\t\t} @else {\n\t\t\t<button daff-tab-activator\n\t\t\t\t[selected]=\"tab.id === selectedTab\"\n\t\t\t\t(click)=\"select(tab.id)\"\n\t\t\t\t[panelId]=\"tab.panelId\"\n\t\t\t\t[disabled]=\"tab.disabled\"\n\t\t\t\t[tabActivatorId]=\"tab.id\"\n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t\t<ng-container *ngTemplateOutlet=\"tab.labelRef\"></ng-container>\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n\n@for (tab of _tabs; track tab) {\n\t@if(tab.id === selectedTab ) {\n\t\t<ng-container *ngTemplateOutlet=\"tab.contentRef\"></ng-container>\n\t}\n}", styles: [":host(.daff-tabs){max-width:100%}.daff-tabs{display:block}.daff-tabs .daff-tabs__tab-list{display:flex;overflow-x:auto;scrollbar-width:thin;position:relative}.daff-tabs .daff-tabs__tab-list:after{content:\"\";position:absolute;height:.125rem;width:100%;bottom:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: DaffTabActivatorComponent, selector: "button[daff-tab-activator],a[daff-tab-activator]", inputs: ["tabActivatorId", "panelId"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
389
397
|
}
|
|
390
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: DaffTabsComponent, decorators: [{
|
|
391
399
|
type: Component,
|
|
392
400
|
args: [{ selector: 'daff-tabs', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
393
401
|
'class': 'daff-tabs',
|