@daffodil/design 0.93.0 → 0.94.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/README.md +0 -1
- package/accordion/src/accordion-theme.scss +2 -2
- package/article/src/article/_stops-article-cascade.scss +5 -1
- package/article/src/article-theme.scss +2 -2
- package/badge/README.md +85 -0
- package/badge/src/badge-theme.scss +197 -0
- package/beacon/README.md +61 -0
- package/beacon/src/beacon-theme.scss +61 -0
- package/breadcrumb/src/breadcrumb-theme.scss +2 -2
- package/button/src/button/basic/button-theme.scss +2 -2
- package/button/src/button/flat/flat-theme.scss +2 -2
- package/button/src/button/icon/icon-theme.scss +2 -2
- package/button/src/button/raised/raised-theme.scss +13 -13
- package/button/src/button/stroked/stroked-theme.scss +2 -2
- package/button/src/button/underline/underline-theme.scss +2 -2
- package/callout/src/callout-theme.scss +12 -2
- package/card/src/card/stroked/stroked-theme.scss +14 -22
- package/card/src/card-base-theme.scss +4 -4
- package/card/src/card-base.scss +13 -16
- package/fesm2022/daffodil-design-accordion.mjs +9 -15
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +2 -2
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-badge.mjs +87 -0
- package/fesm2022/daffodil-design-badge.mjs.map +1 -0
- package/fesm2022/daffodil-design-beacon.mjs +48 -0
- package/fesm2022/daffodil-design-beacon.mjs.map +1 -0
- package/fesm2022/daffodil-design-breadcrumb.mjs +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +1 -1
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +2 -2
- package/fesm2022/daffodil-design-card.mjs +9 -11
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +95 -115
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +5 -7
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +41 -98
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +3 -3
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +16 -21
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +56 -61
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +61 -38
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +2 -2
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +3 -3
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +17 -20
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +71 -76
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +33 -53
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +1 -1
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +2 -2
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +17 -16
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +20 -29
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +86 -88
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +33 -28
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet.mjs +18 -23
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +3 -3
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +19 -20
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +111 -80
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form/src/hint/hint-theme.scss +2 -2
- package/form-field/src/form-field-theme.scss +2 -2
- package/hero/src/hero-theme.scss +12 -2
- package/list/README.md +10 -0
- package/list/src/list-theme.scss +2 -2
- package/media-gallery/README.md +0 -5
- package/media-gallery/src/media-gallery-theme.scss +2 -2
- package/menu/README.md +5 -0
- package/menu/src/menu-theme.scss +4 -4
- package/notification/src/notification-theme.scss +2 -2
- package/package.json +1 -1
- package/paginator/src/paginator-theme.scss +2 -2
- package/progress-bar/README.md +1 -1
- package/progress-bar/src/progress-bar-theme.scss +2 -2
- package/scss/global.scss +4 -0
- package/scss/state/skeleton/_mixins.scss +2 -2
- package/scss/theme/default.scss +15 -0
- package/scss/theme.scss +4 -8
- package/scss/theming/_configure-palette.scss +5 -1
- package/scss/theming/_get-theme-mode.scss +1 -1
- package/scss/theming/_index.scss +2 -3
- package/scss/theming/_light-dark.scss +37 -12
- package/scss/theming/color-shift/_color-shift.scss +56 -0
- package/scss/theming/color-shift/_color-shift.spec.scss +107 -0
- package/scss/theming/color-shift/_index.scss +1 -0
- package/scss/theming/{_daff-theme.scss → default/_daff-theme.scss} +4 -4
- package/scss/theming/default/_index.scss +1 -0
- package/select/src/select-theme.scss +5 -3
- package/switch/src/switch-theme.scss +2 -2
- package/tabs/src/tabs-theme.scss +2 -2
- package/tag/README.md +10 -6
- package/tag/src/tag-theme.scss +102 -5
- package/toast/src/toast-theme.scss +2 -2
- package/tree/src/tree-theme.scss +2 -2
- package/types/daffodil-design-accordion.d.ts +4 -4
- package/types/daffodil-design-badge.d.ts +63 -0
- package/types/daffodil-design-beacon.d.ts +26 -0
- package/types/daffodil-design-card.d.ts +2 -2
- package/types/daffodil-design-form-field.d.ts +34 -31
- package/types/daffodil-design-form.d.ts +2 -2
- package/types/daffodil-design-image.d.ts +15 -28
- package/types/daffodil-design-list.d.ts +3 -3
- package/types/daffodil-design-media-gallery.d.ts +31 -20
- package/types/daffodil-design-menu.d.ts +51 -20
- package/types/daffodil-design-notification.d.ts +5 -6
- package/types/daffodil-design-paginator.d.ts +20 -25
- package/types/daffodil-design-progress-bar.d.ts +16 -21
- package/types/daffodil-design-spinner.d.ts +2 -2
- package/types/daffodil-design-switch.d.ts +7 -8
- package/types/daffodil-design-tabs.d.ts +29 -29
- package/types/daffodil-design-tag.d.ts +22 -16
- package/types/daffodil-design-text-snippet.d.ts +9 -9
- package/types/daffodil-design.d.ts +61 -41
- package/fesm2022/daffodil-design-loading-icon.mjs +0 -67
- package/fesm2022/daffodil-design-loading-icon.mjs.map +0 -1
- package/loading-icon/README.md +0 -59
- package/loading-icon/src/loading-icon-theme.scss +0 -103
- package/scss/theming/illuminate/illuminate.scss +0 -149
- package/scss/theming/illuminate/illuminate.spec.scss +0 -15
- package/types/daffodil-design-loading-icon.d.ts +0 -31
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, model, output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import * as i1 from '@daffodil/design';
|
|
5
5
|
import { DaffSizableDirective, DaffDisableableDirective } from '@daffodil/design';
|
|
6
6
|
|
|
@@ -15,7 +15,6 @@ var DaffSwitchLabelPositionEnum;
|
|
|
15
15
|
DaffSwitchLabelPositionEnum["BOTTOM"] = "bottom";
|
|
16
16
|
})(DaffSwitchLabelPositionEnum || (DaffSwitchLabelPositionEnum = {}));
|
|
17
17
|
|
|
18
|
-
/* eslint-disable quote-props */
|
|
19
18
|
let switchIncrementalId = 0;
|
|
20
19
|
/**
|
|
21
20
|
* The switch component provides a way to toggle between two settings.
|
|
@@ -31,11 +30,11 @@ class DaffSwitchComponent extends DaffSizableDirective {
|
|
|
31
30
|
/**
|
|
32
31
|
* The position of the label relative to the switch.
|
|
33
32
|
*/
|
|
34
|
-
this.labelPosition = DaffSwitchLabelPositionEnum.LEFT;
|
|
33
|
+
this.labelPosition = input(DaffSwitchLabelPositionEnum.LEFT, ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
35
34
|
/**
|
|
36
35
|
* Current state of switch (on/off).
|
|
37
36
|
*/
|
|
38
|
-
this.checked = false;
|
|
37
|
+
this.checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
39
38
|
/**
|
|
40
39
|
* @docs-private
|
|
41
40
|
*/
|
|
@@ -46,36 +45,36 @@ class DaffSwitchComponent extends DaffSizableDirective {
|
|
|
46
45
|
*
|
|
47
46
|
* It gets assigned to the `for` attribute on the `<label>` inside of the switch.
|
|
48
47
|
*/
|
|
49
|
-
this.id = 'daff-switch-' + switchIncrementalId
|
|
48
|
+
this.id = input('daff-switch-' + switchIncrementalId++, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
50
49
|
/**
|
|
51
50
|
* Output event triggered when the switch has been toggled.
|
|
52
51
|
*/
|
|
53
|
-
this.toggled =
|
|
52
|
+
this.toggled = output();
|
|
54
53
|
}
|
|
55
54
|
/**
|
|
56
55
|
* Whether the switch is disabled.
|
|
57
56
|
*/
|
|
58
57
|
get disabled() {
|
|
59
|
-
return this.disabledDirective.disabled;
|
|
58
|
+
return this.disabledDirective.disabled();
|
|
60
59
|
}
|
|
61
60
|
set disabled(value) {
|
|
62
|
-
this.disabledDirective.disabled
|
|
61
|
+
this.disabledDirective.disabled.set(coerceBooleanProperty(value));
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
* @docs-private
|
|
66
65
|
*/
|
|
67
66
|
onToggle() {
|
|
68
67
|
if (!this.disabled) {
|
|
69
|
-
this.checked
|
|
70
|
-
this.toggled.emit(this.checked);
|
|
68
|
+
this.checked.set(!this.checked());
|
|
69
|
+
this.toggled.emit(this.checked());
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSwitchComponent, deps: [{ token: i1.DaffDisableableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
73
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: DaffSwitchComponent, isStandalone: true, selector: "daff-switch", inputs: { labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", 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 }); }
|
|
75
74
|
}
|
|
76
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffSwitchComponent, decorators: [{
|
|
77
76
|
type: Component,
|
|
78
|
-
args: [{ selector: 'daff-switch',
|
|
77
|
+
args: [{ selector: 'daff-switch', hostDirectives: [
|
|
79
78
|
{
|
|
80
79
|
directive: DaffSizableDirective,
|
|
81
80
|
inputs: ['size'],
|
|
@@ -85,24 +84,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
85
84
|
inputs: ['disabled'],
|
|
86
85
|
},
|
|
87
86
|
], host: {
|
|
88
|
-
|
|
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: [{
|
|
87
|
+
class: 'daff-switch',
|
|
88
|
+
'[class.checked]': 'checked()',
|
|
89
|
+
'[class.left]': 'labelPosition() === "left"',
|
|
90
|
+
'[class.right]': 'labelPosition() === "right"',
|
|
91
|
+
'[class.top]': 'labelPosition() === "top"',
|
|
92
|
+
'[class.bottom]': 'labelPosition() === "bottom"',
|
|
93
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
94
|
+
}], ctorParameters: () => [{ type: i1.DaffDisableableDirective }], propDecorators: { labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], disabled: [{
|
|
96
95
|
type: Input
|
|
97
|
-
}],
|
|
98
|
-
type: Input
|
|
99
|
-
}], checked: [{
|
|
100
|
-
type: Input
|
|
101
|
-
}], id: [{
|
|
102
|
-
type: Input
|
|
103
|
-
}], toggled: [{
|
|
104
|
-
type: Output
|
|
105
|
-
}] } });
|
|
96
|
+
}], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], toggled: [{ type: i0.Output, args: ["toggled"] }] } });
|
|
106
97
|
|
|
107
98
|
/**
|
|
108
99
|
* @docs-private
|
|
@@ -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 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","
|
|
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","import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n input,\n model,\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 templateUrl: './switch.component.html',\n styleUrl: './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 changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DaffSwitchComponent extends DaffSizableDirective<DaffSwitchSize> implements DaffDisableable {\n /**\n * The position of the label relative to the switch.\n */\n labelPosition = input<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.set(coerceBooleanProperty(value));\n }\n\n /**\n * Current state of switch (on/off).\n */\n checked = model(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 id = input('daff-switch-' + switchIncrementalId++);\n\n /**\n * Output event triggered when the switch has been toggled.\n */\n toggled = output<boolean>();\n\n /**\n * @docs-private\n */\n onToggle() {\n if (!this.disabled) {\n this.checked.set(!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":";;;;;;AAEA;;AAEG;AACH,IAAY,2BAKX;AALD,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,2BAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,2BAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,2BAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EALW,2BAA2B,KAA3B,2BAA2B,GAAA,EAAA,CAAA,CAAA;;ACiBvC,IAAI,mBAAmB,GAAG,CAAC;AAI3B;;;;;;AAMG;AAyBG,MAAO,mBAAoB,SAAQ,oBAAoC,CAAA;AAM3E,IAAA,WAAA,CAAoB,iBAA2C,EAAA;AAC7D,QAAA,KAAK,EAAE;QADW,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;AALrC;;AAEG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAA0B,2BAA2B,CAAC,IAAI,oFAAC;AAgBhF;;AAEG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,KAAK,8EAAC;AAEtB;;AAEG;AACH,QAAA,IAAA,CAAA,OAAO,GAAW,cAAc,GAAG,mBAAmB,EAAE,GAAG,QAAQ;AAEnE;;;;;AAKG;QACH,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,cAAc,GAAG,mBAAmB,EAAE,yEAAC;AAElD;;AAEG;QACH,IAAA,CAAA,OAAO,GAAG,MAAM,EAAW;IAjC3B;AAEA;;AAEG;AACH,IAAA,IAAa,QAAQ,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE;IAC1C;IACA,IAAI,QAAQ,CAAC,KAAU,EAAA;AACrB,QAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACnE;AAyBA;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC;IACF;iIAnDW,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,wBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,ylCCzDhC,8XAYS,EAAA,MAAA,EAAA,CAAA,6jDAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FD6CI,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAxB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,cAAA,EAGP;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,oBAAoB;4BAC/B,MAAM,EAAE,CAAC,MAAM,CAAC;AACjB,yBAAA;AACD,wBAAA;AACE,4BAAA,SAAS,EAAE,wBAAwB;4BACnC,MAAM,EAAE,CAAC,UAAU,CAAC;AACrB,yBAAA;qBACF,EAAA,IAAA,EACK;AACJ,wBAAA,KAAK,EAAE,aAAa;AACpB,wBAAA,iBAAiB,EAAE,WAAW;AAC9B,wBAAA,cAAc,EAAE,4BAA4B;AAC5C,wBAAA,eAAe,EAAE,6BAA6B;AAC9C,wBAAA,aAAa,EAAE,2BAA2B;AAC1C,wBAAA,gBAAgB,EAAE,8BAA8B;qBACjD,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,8XAAA,EAAA,MAAA,EAAA,CAAA,6jDAAA,CAAA,EAAA;;sBAe9C;;;AEpEH;;AAEG;AACI,MAAM,sBAAsB,GAAW;IAC5C,mBAAmB;;;ACNrB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { viewChild, TemplateRef, input, ChangeDetectionStrategy, Component, contentChild, ViewEncapsulation, signal, output, contentChildren, viewChildren } from '@angular/core';
|
|
3
3
|
import * as i1 from '@daffodil/design';
|
|
4
4
|
import { DaffDisableableDirective, DaffPrefixDirective, DaffSuffixDirective, DaffSelectableDirective } from '@daffodil/design';
|
|
5
5
|
import * as i1$1 from '@angular/common';
|
|
@@ -32,15 +32,23 @@ class DaffTabComponent {
|
|
|
32
32
|
* Whether the tab is disabled.
|
|
33
33
|
*/
|
|
34
34
|
get disabled() {
|
|
35
|
-
return this.disabledDirective.disabled;
|
|
35
|
+
return this.disabledDirective.disabled();
|
|
36
36
|
}
|
|
37
37
|
constructor(disabledDirective) {
|
|
38
38
|
this.disabledDirective = disabledDirective;
|
|
39
|
+
/**
|
|
40
|
+
* @docs-private
|
|
41
|
+
*/
|
|
42
|
+
this.contentRef = viewChild('content', { ...(ngDevMode ? { debugName: "contentRef" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
43
|
+
/**
|
|
44
|
+
* @docs-private
|
|
45
|
+
*/
|
|
46
|
+
this.labelRef = viewChild('label', { ...(ngDevMode ? { debugName: "labelRef" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
39
47
|
/**
|
|
40
48
|
* A unique id for the tab component. Defaults to an autogenerated value. When using this,
|
|
41
49
|
* it's your responsibility to ensure that the id for each tab is unique.
|
|
42
50
|
*/
|
|
43
|
-
this.id = 'daff-tab-' + tabId;
|
|
51
|
+
this.id = input('daff-tab-' + tabId, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
44
52
|
/**
|
|
45
53
|
* @docs-private
|
|
46
54
|
*/
|
|
@@ -48,7 +56,7 @@ class DaffTabComponent {
|
|
|
48
56
|
tabId++;
|
|
49
57
|
}
|
|
50
58
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabComponent, deps: [{ token: i1.DaffDisableableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
51
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
59
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.9", type: DaffTabComponent, isStandalone: true, selector: "daff-tab", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["content"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "labelRef", first: true, predicate: ["label"], descendants: true, read: TemplateRef, isSignal: true }], hostDirectives: [{ directive: i1.DaffDisableableDirective, inputs: ["disabled", "disabled"] }], ngImport: i0, template: `
|
|
52
60
|
<ng-template #label>
|
|
53
61
|
<ng-content select="daff-tab-label"></ng-content>
|
|
54
62
|
</ng-template>
|
|
@@ -77,15 +85,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
77
85
|
},
|
|
78
86
|
],
|
|
79
87
|
}]
|
|
80
|
-
}], ctorParameters: () => [{ type: i1.DaffDisableableDirective }], propDecorators: { contentRef: [{
|
|
81
|
-
type: ViewChild,
|
|
82
|
-
args: ['content', { read: TemplateRef, static: true }]
|
|
83
|
-
}], labelRef: [{
|
|
84
|
-
type: ViewChild,
|
|
85
|
-
args: ['label', { read: TemplateRef, static: true }]
|
|
86
|
-
}], id: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}] } });
|
|
88
|
+
}], ctorParameters: () => [{ type: i1.DaffDisableableDirective }], propDecorators: { contentRef: [{ type: i0.ViewChild, args: ['content', { ...{ read: TemplateRef }, isSignal: true }] }], labelRef: [{ type: i0.ViewChild, args: ['label', { ...{ read: TemplateRef }, isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Tab label is the clicakble label that activates its corresponding tab panel. Labels can contain text, icons, or both.
|
|
@@ -100,24 +100,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
100
100
|
* ```
|
|
101
101
|
*/
|
|
102
102
|
class DaffTabLabelComponent {
|
|
103
|
+
constructor() {
|
|
104
|
+
/**
|
|
105
|
+
* @docs-private
|
|
106
|
+
*/
|
|
107
|
+
this._prefix = contentChild(DaffPrefixDirective, ...(ngDevMode ? [{ debugName: "_prefix" }] : /* istanbul ignore next */ []));
|
|
108
|
+
/**
|
|
109
|
+
* @docs-private
|
|
110
|
+
*/
|
|
111
|
+
this._suffix = contentChild(DaffSuffixDirective, ...(ngDevMode ? [{ debugName: "_suffix" }] : /* istanbul ignore next */ []));
|
|
112
|
+
}
|
|
103
113
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
104
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", 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 }); }
|
|
114
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffTabLabelComponent, isStandalone: true, selector: "daff-tab-label", queries: [{ propertyName: "_prefix", first: true, predicate: DaffPrefixDirective, descendants: true, isSignal: true }, { propertyName: "_suffix", first: true, predicate: DaffSuffixDirective, descendants: true, isSignal: 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 }); }
|
|
105
115
|
}
|
|
106
116
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabLabelComponent, decorators: [{
|
|
107
117
|
type: Component,
|
|
108
118
|
args: [{ selector: 'daff-tab-label', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
109
119
|
DaffPrefixDirective,
|
|
110
120
|
DaffSuffixDirective,
|
|
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"] }]
|
|
112
|
-
}], propDecorators: { _prefix: [{
|
|
113
|
-
type: ContentChild,
|
|
114
|
-
args: [DaffPrefixDirective]
|
|
115
|
-
}], _suffix: [{
|
|
116
|
-
type: ContentChild,
|
|
117
|
-
args: [DaffSuffixDirective]
|
|
118
|
-
}] } });
|
|
121
|
+
], 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"] }]
|
|
122
|
+
}], propDecorators: { _prefix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DaffPrefixDirective), { isSignal: true }] }], _suffix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DaffSuffixDirective), { isSignal: true }] }] } });
|
|
119
123
|
|
|
120
|
-
/* eslint-disable quote-props */
|
|
121
124
|
/**
|
|
122
125
|
* Tab panel is the content area displayed when a tab is active.
|
|
123
126
|
*
|
|
@@ -150,7 +153,7 @@ class DaffTabPanelComponent {
|
|
|
150
153
|
/**
|
|
151
154
|
* Sets the value of `ariaLabelledBy` to the id of the tab component.
|
|
152
155
|
*/
|
|
153
|
-
this._ariaLabelledBy = this.tab.id;
|
|
156
|
+
this._ariaLabelledBy = this.tab.id();
|
|
154
157
|
this._id = this.tab.panelId;
|
|
155
158
|
}
|
|
156
159
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabPanelComponent, deps: [{ token: DaffTabComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -159,15 +162,14 @@ class DaffTabPanelComponent {
|
|
|
159
162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabPanelComponent, decorators: [{
|
|
160
163
|
type: Component,
|
|
161
164
|
args: [{ selector: 'daff-tab-panel', template: `<ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
class: 'daff-tab-panel',
|
|
166
|
+
role: 'tabpanel',
|
|
167
|
+
tabindex: '0',
|
|
165
168
|
'[attr.id]': 'tabPanelId',
|
|
166
169
|
'[attr.aria-labelledby]': 'ariaLabelledBy',
|
|
167
170
|
}, styles: [":host(.daff-tab-panel){display:block;padding:1rem 0}\n"] }]
|
|
168
171
|
}], ctorParameters: () => [{ type: DaffTabComponent }] });
|
|
169
172
|
|
|
170
|
-
/* eslint-disable quote-props */
|
|
171
173
|
class DaffTabActivatorComponent {
|
|
172
174
|
/**
|
|
173
175
|
* @docs-private
|
|
@@ -191,8 +193,8 @@ class DaffTabActivatorComponent {
|
|
|
191
193
|
/**
|
|
192
194
|
* The html id of the tab activator component
|
|
193
195
|
*/
|
|
194
|
-
this.tabActivatorId = '';
|
|
195
|
-
this.panelId = '';
|
|
196
|
+
this.tabActivatorId = input('', ...(ngDevMode ? [{ debugName: "tabActivatorId" }] : /* istanbul ignore next */ []));
|
|
197
|
+
this.panelId = input('', ...(ngDevMode ? [{ debugName: "panelId" }] : /* istanbul ignore next */ []));
|
|
196
198
|
}
|
|
197
199
|
/**
|
|
198
200
|
* Sets focus to the native element of the component.
|
|
@@ -201,7 +203,7 @@ class DaffTabActivatorComponent {
|
|
|
201
203
|
this.el.nativeElement.focus();
|
|
202
204
|
}
|
|
203
205
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabActivatorComponent, deps: [{ token: i0.ElementRef }, { token: i1.DaffSelectableDirective }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
204
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
206
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: DaffTabActivatorComponent, isStandalone: true, selector: "button[daff-tab-activator],a[daff-tab-activator]", inputs: { tabActivatorId: { classPropertyName: "tabActivatorId", publicName: "tabActivatorId", isSignal: true, isRequired: false, transformFunction: null }, panelId: { classPropertyName: "panelId", publicName: "panelId", isSignal: true, isRequired: false, transformFunction: null } }, 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 }); }
|
|
205
207
|
}
|
|
206
208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabActivatorComponent, decorators: [{
|
|
207
209
|
type: Component,
|
|
@@ -213,20 +215,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
213
215
|
inputs: ['selected'],
|
|
214
216
|
},
|
|
215
217
|
], host: {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
class: 'daff-tab-activator',
|
|
219
|
+
role: 'tab',
|
|
218
220
|
'[attr.aria-selected]': 'ariaSelected',
|
|
219
221
|
'[attr.tabindex]': 'tabIndex',
|
|
220
|
-
'[attr.id]': 'tabActivatorId',
|
|
221
|
-
'[attr.aria-controls]': 'panelId',
|
|
222
|
+
'[attr.id]': 'tabActivatorId()',
|
|
223
|
+
'[attr.aria-controls]': 'panelId()',
|
|
222
224
|
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, 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"] }]
|
|
223
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DaffSelectableDirective }], propDecorators: { tabActivatorId: [{
|
|
224
|
-
type: Input
|
|
225
|
-
}], panelId: [{
|
|
226
|
-
type: Input
|
|
227
|
-
}] } });
|
|
225
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DaffSelectableDirective }], propDecorators: { tabActivatorId: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabActivatorId", required: false }] }], panelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelId", required: false }] }] } });
|
|
228
226
|
|
|
229
|
-
/* eslint-disable quote-props */
|
|
230
227
|
/**
|
|
231
228
|
* Tabs provide a way to navigate between panels that display related content without leaving the page.
|
|
232
229
|
*
|
|
@@ -264,33 +261,56 @@ class DaffTabsComponent {
|
|
|
264
261
|
constructor(cdRef, location) {
|
|
265
262
|
this.cdRef = cdRef;
|
|
266
263
|
this.location = location;
|
|
264
|
+
/**
|
|
265
|
+
* @docs-private
|
|
266
|
+
*
|
|
267
|
+
* The currently selected tab. This property is dynamically updated when a user selects a tab.
|
|
268
|
+
*/
|
|
269
|
+
this.selectedTab = signal(undefined, ...(ngDevMode ? [{ debugName: "selectedTab" }] : /* istanbul ignore next */ []));
|
|
267
270
|
/**
|
|
268
271
|
* The tab that is selected on initial load. If it's not used, the first tab in the tablist will be selected by default.
|
|
269
272
|
*/
|
|
270
|
-
this.initiallySelected = null;
|
|
273
|
+
this.initiallySelected = input(null, ...(ngDevMode ? [{ debugName: "initiallySelected" }] : /* istanbul ignore next */ []));
|
|
271
274
|
/**
|
|
272
275
|
* `aria-label` to label the tablist.
|
|
273
276
|
*/
|
|
274
|
-
this.ariaLabel = '';
|
|
277
|
+
this.ariaLabel = input('', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
275
278
|
/**
|
|
276
279
|
* Replace the tab buttons as links.
|
|
277
280
|
*/
|
|
278
|
-
this.linkMode = false;
|
|
281
|
+
this.linkMode = input(false, ...(ngDevMode ? [{ debugName: "linkMode" }] : /* istanbul ignore next */ []));
|
|
282
|
+
/**
|
|
283
|
+
* The URL to navigate to when the component is in link mode.
|
|
284
|
+
* This component will set the specified query param.
|
|
285
|
+
*/
|
|
286
|
+
this.url = input(...(ngDevMode ? [undefined, { debugName: "url" }] : /* istanbul ignore next */ []));
|
|
279
287
|
/**
|
|
280
288
|
* The query parameter that the tabs component will use to set the tab value in link mode.
|
|
281
289
|
*/
|
|
282
|
-
this.queryParam = 'tab';
|
|
290
|
+
this.queryParam = input('tab', ...(ngDevMode ? [{ debugName: "queryParam" }] : /* istanbul ignore next */ []));
|
|
283
291
|
/**
|
|
284
292
|
* Event emitted when tab selection changes.
|
|
285
293
|
*/
|
|
286
|
-
this.tabChange =
|
|
294
|
+
this.tabChange = output();
|
|
295
|
+
/**
|
|
296
|
+
* @docs-private
|
|
297
|
+
*/
|
|
298
|
+
this._labels = contentChildren(DaffTabLabelComponent, { ...(ngDevMode ? { debugName: "_labels" } : /* istanbul ignore next */ {}), descendants: true });
|
|
299
|
+
/**
|
|
300
|
+
* @docs-private
|
|
301
|
+
*/
|
|
302
|
+
this._tabs = contentChildren(DaffTabComponent, ...(ngDevMode ? [{ debugName: "_tabs" }] : /* istanbul ignore next */ []));
|
|
303
|
+
/**
|
|
304
|
+
* @docs-private
|
|
305
|
+
*/
|
|
306
|
+
this._tabActivators = viewChildren(DaffTabActivatorComponent, ...(ngDevMode ? [{ debugName: "_tabActivators" }] : /* istanbul ignore next */ []));
|
|
287
307
|
}
|
|
288
308
|
reset() {
|
|
289
|
-
if (this.initiallySelected) {
|
|
290
|
-
this.selectedTab
|
|
309
|
+
if (this.initiallySelected()) {
|
|
310
|
+
this.selectedTab.set(this.initiallySelected());
|
|
291
311
|
}
|
|
292
|
-
if (!this.selectedTab) {
|
|
293
|
-
this.selectedTab
|
|
312
|
+
if (!this.selectedTab()) {
|
|
313
|
+
this.selectedTab.set(this._tabs()[0].id());
|
|
294
314
|
}
|
|
295
315
|
}
|
|
296
316
|
/**
|
|
@@ -299,10 +319,10 @@ class DaffTabsComponent {
|
|
|
299
319
|
ngOnInit() {
|
|
300
320
|
this.location.onUrlChange(() => {
|
|
301
321
|
// if the app is navigated away from the current page, reset the state
|
|
302
|
-
if (this.linkMode && !this.location.isCurrentPathEqualTo(this.url, `${this.queryParam}=${this.selectedTab}`)) {
|
|
303
|
-
this.selectedTab
|
|
322
|
+
if (this.linkMode() && !this.location.isCurrentPathEqualTo(this.url(), `${this.queryParam()}=${this.selectedTab()}`)) {
|
|
323
|
+
this.selectedTab.set(null);
|
|
304
324
|
this.reset();
|
|
305
|
-
this.tabChange.emit(this.selectedTab);
|
|
325
|
+
this.tabChange.emit(this.selectedTab());
|
|
306
326
|
}
|
|
307
327
|
});
|
|
308
328
|
}
|
|
@@ -318,13 +338,13 @@ class DaffTabsComponent {
|
|
|
318
338
|
* Selects a tab and sets focus on the selected tab.
|
|
319
339
|
*/
|
|
320
340
|
select(tabId) {
|
|
321
|
-
const tabActivator = this._tabActivators.find(el => el.tabActivatorId === tabId);
|
|
341
|
+
const tabActivator = this._tabActivators().find(el => el.tabActivatorId() === tabId);
|
|
322
342
|
if (!tabActivator) {
|
|
323
343
|
console.warn(`The tab '${tabId}' was not able to be selected because it does not exist. Check the id on your <daff-tab>s.`);
|
|
324
344
|
return;
|
|
325
345
|
}
|
|
326
346
|
this.tabChange.emit(tabId);
|
|
327
|
-
this.selectedTab
|
|
347
|
+
this.selectedTab.set(tabId);
|
|
328
348
|
this.cdRef.markForCheck();
|
|
329
349
|
tabActivator.focus();
|
|
330
350
|
}
|
|
@@ -333,22 +353,22 @@ class DaffTabsComponent {
|
|
|
333
353
|
* Moves forward or backward in the tab array, wrapping around when necessary.
|
|
334
354
|
*/
|
|
335
355
|
navigateTabs(offset) {
|
|
336
|
-
const array = this._tabs
|
|
337
|
-
let selectedIndex = array.findIndex(el => el.id === this.selectedTab);
|
|
356
|
+
const array = this._tabs();
|
|
357
|
+
let selectedIndex = array.findIndex(el => el.id() === this.selectedTab());
|
|
338
358
|
const startingIndex = selectedIndex;
|
|
339
359
|
let newIndex;
|
|
340
360
|
do {
|
|
341
361
|
newIndex = (selectedIndex + offset + array.length) % array.length;
|
|
342
362
|
selectedIndex = newIndex;
|
|
343
363
|
} while (array[newIndex].disabled && selectedIndex !== startingIndex); // Skip disabled tabs
|
|
344
|
-
this.select(array[newIndex].id);
|
|
364
|
+
this.select(array[newIndex].id());
|
|
345
365
|
}
|
|
346
366
|
/**
|
|
347
367
|
* @docs-private
|
|
348
368
|
*/
|
|
349
369
|
_buildQueryParams(tab) {
|
|
350
370
|
return {
|
|
351
|
-
[this.queryParam]: tab,
|
|
371
|
+
[this.queryParam()]: tab,
|
|
352
372
|
};
|
|
353
373
|
}
|
|
354
374
|
/**
|
|
@@ -374,7 +394,7 @@ class DaffTabsComponent {
|
|
|
374
394
|
*/
|
|
375
395
|
selectFirst(event) {
|
|
376
396
|
event.preventDefault();
|
|
377
|
-
this.select(this._tabs
|
|
397
|
+
this.select(this._tabs()[0].id());
|
|
378
398
|
}
|
|
379
399
|
/**
|
|
380
400
|
* @docs-private
|
|
@@ -383,46 +403,24 @@ class DaffTabsComponent {
|
|
|
383
403
|
*/
|
|
384
404
|
selectLast(event) {
|
|
385
405
|
event.preventDefault();
|
|
386
|
-
const array = this._tabs
|
|
387
|
-
this.select(array[array.length - 1].id);
|
|
406
|
+
const array = this._tabs();
|
|
407
|
+
this.select(array[array.length - 1].id());
|
|
388
408
|
}
|
|
389
409
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
390
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffTabsComponent, isStandalone: true, selector: "daff-tabs", inputs: { initiallySelected: "initiallySelected", ariaLabel:
|
|
410
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DaffTabsComponent, isStandalone: true, selector: "daff-tabs", inputs: { initiallySelected: { classPropertyName: "initiallySelected", publicName: "initiallySelected", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, linkMode: { classPropertyName: "linkMode", publicName: "linkMode", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, queryParam: { classPropertyName: "queryParam", publicName: "queryParam", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChange: "tabChange" }, host: { properties: { "attr.aria-label": "null" }, classAttribute: "daff-tabs" }, queries: [{ propertyName: "_labels", predicate: DaffTabLabelComponent, descendants: true, isSignal: true }, { propertyName: "_tabs", predicate: DaffTabComponent, isSignal: true }], viewQueries: [{ propertyName: "_tabActivators", predicate: DaffTabActivatorComponent, descendants: true, isSignal: 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}\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 }); }
|
|
391
411
|
}
|
|
392
412
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTabsComponent, decorators: [{
|
|
393
413
|
type: Component,
|
|
394
414
|
args: [{ selector: 'daff-tabs', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
395
|
-
|
|
415
|
+
class: 'daff-tabs',
|
|
396
416
|
'[attr.aria-label]': 'null',
|
|
397
417
|
}, imports: [
|
|
398
418
|
NgTemplateOutlet,
|
|
399
419
|
RouterLink,
|
|
400
420
|
RouterLinkActive,
|
|
401
421
|
DaffTabActivatorComponent,
|
|
402
|
-
], 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"] }]
|
|
403
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$1.Location }], propDecorators: { initiallySelected: [{
|
|
404
|
-
type: Input
|
|
405
|
-
}], ariaLabel: [{
|
|
406
|
-
type: Input,
|
|
407
|
-
args: ['aria-label']
|
|
408
|
-
}], linkMode: [{
|
|
409
|
-
type: Input
|
|
410
|
-
}], url: [{
|
|
411
|
-
type: Input
|
|
412
|
-
}], queryParam: [{
|
|
413
|
-
type: Input
|
|
414
|
-
}], tabChange: [{
|
|
415
|
-
type: Output
|
|
416
|
-
}], _labels: [{
|
|
417
|
-
type: ContentChildren,
|
|
418
|
-
args: [DaffTabLabelComponent, { descendants: true }]
|
|
419
|
-
}], _tabs: [{
|
|
420
|
-
type: ContentChildren,
|
|
421
|
-
args: [DaffTabComponent]
|
|
422
|
-
}], _tabActivators: [{
|
|
423
|
-
type: ViewChildren,
|
|
424
|
-
args: [DaffTabActivatorComponent]
|
|
425
|
-
}] } });
|
|
422
|
+
], 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}\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"] }]
|
|
423
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$1.Location }], propDecorators: { initiallySelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "initiallySelected", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], linkMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkMode", required: false }] }], url: [{ type: i0.Input, args: [{ isSignal: true, alias: "url", required: false }] }], queryParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParam", required: false }] }], tabChange: [{ type: i0.Output, args: ["tabChange"] }], _labels: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => DaffTabLabelComponent), { ...{ descendants: true }, isSignal: true }] }], _tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => DaffTabComponent), { isSignal: true }] }], _tabActivators: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => DaffTabActivatorComponent), { isSignal: true }] }] } });
|
|
426
424
|
|
|
427
425
|
/**
|
|
428
426
|
* @docs-private
|