@daffodil/design 0.85.0 → 0.86.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/atoms/form/error-message/error-message.component.d.ts +6 -0
- package/atoms/form/form-field/form-field/form-field.component.d.ts +83 -13
- package/atoms/form/form-field/form-field-control.d.ts +2 -0
- package/atoms/form/form-field/form-field.d.ts +2 -1
- package/atoms/form/form-field/label/label.directive.d.ts +5 -0
- package/atoms/form/form-field/public_api.d.ts +1 -0
- package/atoms/form/form-label/form-label.directive.d.ts +3 -0
- package/atoms/form/hint/hint.component.d.ts +1 -1
- package/button/README.md +3 -3
- package/button/button/button-base.directive.d.ts +1 -2
- package/button/src/button/button-base.scss +0 -18
- package/core/compactable/compactable.directive.d.ts +3 -0
- package/core/openable/openable.directive.d.ts +1 -1
- package/core/selectable/selectable.directive.d.ts +3 -1
- package/core/sizable/sizable.directive.d.ts +2 -2
- package/core/skeletonable/public_api.d.ts +0 -1
- package/core/skeletonable/skeletonable.directive.d.ts +3 -0
- package/core/text-alignable/text-alignable.directive.d.ts +9 -5
- package/fesm2022/daffodil-design-article.mjs +2 -2
- package/fesm2022/daffodil-design-breadcrumb.mjs +2 -2
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button-examples.mjs +12 -12
- package/fesm2022/daffodil-design-button-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +15 -39
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +2 -2
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input-examples.mjs +10 -10
- package/fesm2022/daffodil-design-input-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +48 -5
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +2 -2
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-quantity-field-examples.mjs +4 -4
- package/fesm2022/daffodil-design-quantity-field-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast-examples.mjs +0 -59
- package/fesm2022/daffodil-design-toast-examples.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +52 -40
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +228 -98
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/input/input.component.d.ts +21 -5
- package/package.json +1 -1
- package/scss/state/skeleton/_mixins.scss +4 -1
- package/scss/theming/contrast/luminance/luminance.scss +3 -3
- package/src/atoms/form/form-field/form-field/form-field-theme.scss +7 -2
- package/toast/README.md +21 -1
- package/toast/examples/public_api.d.ts +1 -2
- package/toast/helpers/toast-position.d.ts +8 -0
- package/toast/interfaces/toast-options.d.ts +19 -0
- package/toast/interfaces/toast.d.ts +1 -1
- package/toast/public_api.d.ts +2 -2
- package/toast/service/position-strategy.d.ts +1 -1
- package/toast/service/position.service.d.ts +1 -1
- package/toast/service/toast.service.d.ts +1 -1
- package/toast/toast/toast-provider.d.ts +16 -4
- package/toast/toast/toast-template.component.d.ts +1 -1
- package/core/skeletonable/skeletonable.d.ts +0 -6
- package/toast/examples/toast-positions/toast-positions.component.d.ts +0 -20
- package/toast/options/daff-toast-options.d.ts +0 -14
@@ -13,7 +13,7 @@ class InputDisabledComponent {
|
|
13
13
|
this.disabled = new UntypedFormControl({ value: '', disabled: true });
|
14
14
|
}
|
15
15
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputDisabledComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
16
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: InputDisabledComponent, isStandalone: true, selector: "input-disabled", ngImport: i0, template: "<daff-form-field>\n <label
|
16
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: InputDisabledComponent, isStandalone: true, selector: "input-disabled", ngImport: i0, template: "<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"disabled\"/>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }, { kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "directive", type: i1.DaffFormFieldLabelDirective, selector: "daff-form-label" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
17
17
|
}
|
18
18
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputDisabledComponent, decorators: [{
|
19
19
|
type: Component,
|
@@ -21,7 +21,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
21
21
|
ReactiveFormsModule,
|
22
22
|
DaffInputComponent,
|
23
23
|
DAFF_FORM_FIELD_COMPONENTS,
|
24
|
-
], template: "<daff-form-field>\n <label
|
24
|
+
], template: "<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"disabled\"/>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
25
25
|
}] });
|
26
26
|
|
27
27
|
class InputErrorComponent {
|
@@ -32,7 +32,7 @@ class InputErrorComponent {
|
|
32
32
|
]);
|
33
33
|
}
|
34
34
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
35
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: InputErrorComponent, isStandalone: true, selector: "input-error", ngImport: i0, template: "<daff-form-field>\n <label
|
35
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: InputErrorComponent, isStandalone: true, selector: "input-error", ngImport: i0, template: "<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"control\"/>\n <daff-hint>Hint</daff-hint>\n @if (control.errors?.required) {\n <daff-error-message>Email is a required field.</daff-error-message>\n }\n @if (control.errors?.email) {\n <daff-error-message>Email is not valid.</daff-error-message>\n }\n</daff-form-field>\n<p>Value: {{ control.value }} </p>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "component", type: i1.DaffErrorMessageComponent, selector: "daff-error-message" }, { kind: "component", type: i1.DaffHintComponent, selector: "daff-hint", inputs: ["validated"] }, { kind: "directive", type: i1.DaffFormFieldLabelDirective, selector: "daff-form-label" }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
36
36
|
}
|
37
37
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputErrorComponent, decorators: [{
|
38
38
|
type: Component,
|
@@ -41,12 +41,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
41
41
|
DaffInputComponent,
|
42
42
|
DaffHintComponent,
|
43
43
|
ReactiveFormsModule,
|
44
|
-
], template: "<daff-form-field>\n <label
|
44
|
+
], template: "<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"control\"/>\n <daff-hint>Hint</daff-hint>\n @if (control.errors?.required) {\n <daff-error-message>Email is a required field.</daff-error-message>\n }\n @if (control.errors?.email) {\n <daff-error-message>Email is not valid.</daff-error-message>\n }\n</daff-form-field>\n<p>Value: {{ control.value }} </p>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
45
45
|
}] });
|
46
46
|
|
47
47
|
class InputHintComponent {
|
48
48
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
49
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: InputHintComponent, isStandalone: true, selector: "input-hint", ngImport: i0, template: "<daff-form-field>\n <label
|
49
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: InputHintComponent, isStandalone: true, selector: "input-hint", ngImport: i0, template: "<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\"/>\n <daff-hint>Hint goes here.</daff-hint>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "component", type: i1.DaffHintComponent, selector: "daff-hint", inputs: ["validated"] }, { kind: "directive", type: i1.DaffFormFieldLabelDirective, selector: "daff-form-label" }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
50
50
|
}
|
51
51
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputHintComponent, decorators: [{
|
52
52
|
type: Component,
|
@@ -54,7 +54,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
54
54
|
DAFF_FORM_FIELD_COMPONENTS,
|
55
55
|
DaffInputComponent,
|
56
56
|
DaffHintComponent,
|
57
|
-
], template: "<daff-form-field>\n <label
|
57
|
+
], template: "<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\"/>\n <daff-hint>Hint goes here.</daff-hint>\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
58
58
|
}] });
|
59
59
|
|
60
60
|
class InputHintAndErrorComponent {
|
@@ -64,7 +64,7 @@ class InputHintAndErrorComponent {
|
|
64
64
|
this.control = new UntypedFormControl('', [Validators.required, Validators.minLength(8)]);
|
65
65
|
}
|
66
66
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputHintAndErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
67
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: InputHintAndErrorComponent, isStandalone: true, selector: "input-hint-and-error", ngImport: i0, template: "<daff-form-field>\n <label
|
67
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: InputHintAndErrorComponent, isStandalone: true, selector: "input-hint-and-error", ngImport: i0, template: "<daff-form-field>\n <daff-form-label>Password</daff-form-label>\n <input daff-input type=\"text\" name=\"password\" [formControl]=\"control\"/>\n <daff-hint [validated]=\"!(control.invalid) && control.dirty\">\n @if (!(control.invalid) && control.dirty) {\n <fa-icon [icon]=\"faCheck\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n } @else {\n <fa-icon [icon]=\"faXmark\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n }\n Minimum of 8 characters.\n </daff-hint>\n @if (control.errors?.required && control.touched) {\n <daff-error-message>Password is a required field.</daff-error-message>\n }\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "component", type: i1.DaffErrorMessageComponent, selector: "daff-error-message" }, { kind: "component", type: i1.DaffHintComponent, selector: "daff-hint", inputs: ["validated"] }, { kind: "directive", type: i1.DaffFormFieldLabelDirective, selector: "daff-form-label" }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
68
68
|
}
|
69
69
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputHintAndErrorComponent, decorators: [{
|
70
70
|
type: Component,
|
@@ -73,7 +73,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
73
73
|
DaffInputComponent,
|
74
74
|
ReactiveFormsModule,
|
75
75
|
FaIconComponent,
|
76
|
-
], template: "<daff-form-field>\n <label
|
76
|
+
], template: "<daff-form-field>\n <daff-form-label>Password</daff-form-label>\n <input daff-input type=\"text\" name=\"password\" [formControl]=\"control\"/>\n <daff-hint [validated]=\"!(control.invalid) && control.dirty\">\n @if (!(control.invalid) && control.dirty) {\n <fa-icon [icon]=\"faCheck\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n } @else {\n <fa-icon [icon]=\"faXmark\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n }\n Minimum of 8 characters.\n </daff-hint>\n @if (control.errors?.required && control.touched) {\n <daff-error-message>Password is a required field.</daff-error-message>\n }\n</daff-form-field>", styles: ["daff-form-field{max-width:320px}\n"] }]
|
77
77
|
}] });
|
78
78
|
|
79
79
|
class InputWithFormFieldComponent {
|
@@ -82,7 +82,7 @@ class InputWithFormFieldComponent {
|
|
82
82
|
this.faCircleXmark = faCircleXmark;
|
83
83
|
}
|
84
84
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputWithFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
85
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: InputWithFormFieldComponent, isStandalone: true, selector: "input-with-form-field", ngImport: i0, template: "<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <label
|
85
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: InputWithFormFieldComponent, isStandalone: true, selector: "input-with-form-field", ngImport: i0, template: "<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <daff-form-label>First Name</daff-form-label>\n <input daff-input type=\"text\" name=\"first-name\" />\n <fa-icon [icon]=\"faCircleXmark\" daffSuffix></fa-icon>\n</daff-form-field>\n", styles: ["daff-form-field{max-width:320px}\n"], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "directive", type: i1.DaffPrefixDirective, selector: "[daffPrefix]" }, { kind: "directive", type: i1.DaffSuffixDirective, selector: "[daffSuffix]" }, { kind: "directive", type: i1.DaffFormFieldLabelDirective, selector: "daff-form-label" }, { kind: "component", type: DaffInputComponent, selector: "input[daff-input]" }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "ngmodule", type: DaffPrefixSuffixModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
86
86
|
}
|
87
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: InputWithFormFieldComponent, decorators: [{
|
88
88
|
type: Component,
|
@@ -91,7 +91,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
91
91
|
DaffInputComponent,
|
92
92
|
FaIconComponent,
|
93
93
|
DaffPrefixSuffixModule,
|
94
|
-
], template: "<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <label
|
94
|
+
], template: "<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <daff-form-label>First Name</daff-form-label>\n <input daff-input type=\"text\" name=\"first-name\" />\n <fa-icon [icon]=\"faCircleXmark\" daffSuffix></fa-icon>\n</daff-form-field>\n", styles: ["daff-form-field{max-width:320px}\n"] }]
|
95
95
|
}] });
|
96
96
|
|
97
97
|
const INPUT_EXAMPLES = [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-design-input-examples.mjs","sources":["../../../libs/design/input/examples/src/input-disabled/input-disabled.component.ts","../../../libs/design/input/examples/src/input-disabled/input-disabled.component.html","../../../libs/design/input/examples/src/input-error/input-error.component.ts","../../../libs/design/input/examples/src/input-error/input-error.component.html","../../../libs/design/input/examples/src/input-hint/input-hint.component.ts","../../../libs/design/input/examples/src/input-hint/input-hint.component.html","../../../libs/design/input/examples/src/input-hint-and-error/input-hint-and-error.component.ts","../../../libs/design/input/examples/src/input-hint-and-error/input-hint-and-error.component.html","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.ts","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.html","../../../libs/design/input/examples/src/examples.ts","../../../libs/design/input/examples/src/daffodil-design-input-examples.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n ReactiveFormsModule,\n UntypedFormControl,\n} from '@angular/forms';\n\nimport { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-disabled',\n templateUrl: './input-disabled.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n ReactiveFormsModule,\n DaffInputComponent,\n DAFF_FORM_FIELD_COMPONENTS,\n ],\n})\nexport class InputDisabledComponent {\n disabled = new UntypedFormControl({ value : '' , disabled: true });\n}\n","<daff-form-field>\n <label daffFormLabel for=\"disabled-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"disabled-input\" [formControl]=\"disabled\"/>\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n UntypedFormControl,\n Validators,\n ReactiveFormsModule,\n} from '@angular/forms';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffHintComponent,\n} from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-error',\n templateUrl: './input-error.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n DaffHintComponent,\n ReactiveFormsModule,\n ],\n})\nexport class InputErrorComponent {\n control: UntypedFormControl = new UntypedFormControl('test@example.com', [\n Validators.email,\n Validators.required,\n ]);\n}\n","<daff-form-field>\n <label daffFormLabel for=\"error-input\">Email</label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"control\" id=\"error-input\"/>\n @if (control.errors?.required) {\n <daff-error-message>Email is a required field.</daff-error-message>\n }\n @if (control.errors?.email) {\n <daff-error-message>Email is not valid.</daff-error-message>\n }\n</daff-form-field>\n<p>Value: {{ control.value }} </p>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffHintComponent,\n} from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-hint',\n templateUrl: './input-hint.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n DaffHintComponent,\n ],\n})\nexport class InputHintComponent {\n}\n","<daff-form-field>\n <label daffFormLabel for=\"input-hint\">Email</label>\n <input daff-input type=\"text\" name=\"email\" id=\"input-hint\"/>\n <daff-hint>Hint goes here.</daff-hint>\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n UntypedFormControl,\n Validators,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faCheck,\n faXmark,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-hint-and-error',\n templateUrl: './input-hint-and-error.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n ReactiveFormsModule,\n FaIconComponent,\n ],\n})\nexport class InputHintAndErrorComponent {\n faCheck = faCheck;\n faXmark = faXmark;\n\n control: UntypedFormControl = new UntypedFormControl('', [Validators.required, Validators.minLength(8)]);\n}\n","<daff-form-field>\n <label daffFormLabel for=\"error-input\">Password</label>\n <input daff-input type=\"text\" name=\"password\" [formControl]=\"control\" id=\"error-input\"/>\n <daff-hint [validated]=\"!(control.invalid) && control.dirty\">\n @if (!(control.invalid) && control.dirty) {\n <fa-icon [icon]=\"faCheck\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n } @else {\n <fa-icon [icon]=\"faXmark\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n }\n Minimum of 8 characters.\n </daff-hint>\n @if (control.errors?.required && control.touched) {\n <daff-error-message>Password is a required field.</daff-error-message>\n }\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faUser,\n faCircleXmark,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffPrefixSuffixModule,\n} from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-with-form-field',\n templateUrl: './input-with-form-field.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n FaIconComponent,\n DaffPrefixSuffixModule,\n ],\n})\nexport class InputWithFormFieldComponent {\n faUser = faUser;\n faCircleXmark = faCircleXmark;\n}\n","<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <label daffFormLabel for=\"example-input\">First Name</label>\n <input daff-input type=\"text\" name=\"first-name\" id=\"example-input\" />\n <fa-icon [icon]=\"faCircleXmark\" daffSuffix></fa-icon>\n</daff-form-field>","import { InputDisabledComponent } from './input-disabled/input-disabled.component';\nimport { InputErrorComponent } from './input-error/input-error.component';\nimport { InputHintComponent } from './input-hint/input-hint.component';\nimport { InputHintAndErrorComponent } from './input-hint-and-error/input-hint-and-error.component';\nimport { InputWithFormFieldComponent } from './input-with-form-field/input-with-form-field.component';\n\nexport const INPUT_EXAMPLES = [\n InputWithFormFieldComponent,\n InputDisabledComponent,\n InputErrorComponent,\n InputHintComponent,\n InputHintAndErrorComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2"],"mappings":";;;;;;;;;;MA4Ba,sBAAsB,CAAA;AAhBnC,IAAA,WAAA,GAAA;AAiBE,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,kBAAkB,CAAC,EAAE,KAAK,EAAG,EAAE,EAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;AACnE;kIAFY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAA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BAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,QAAA,EAAA,cAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDuBd,kBAAkB,EAClB,QAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,eAAe,2MACf,sBAAsB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGb,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAjBvC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAOhB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACtC,OAAA,EAAA;wBACP,0BAA0B;wBAC1B,kBAAkB;wBAClB,eAAe;wBACf,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,sSAAA,EAAA,MAAA,EAAA,CAAA,oCAAA,CAAA,EAAA;;;AEzBU,MAAA,cAAc,GAAG;IAC5B,2BAA2B;IAC3B,sBAAsB;IACtB,mBAAmB;IACnB,kBAAkB;IAClB,0BAA0B;;;ACX5B;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-design-input-examples.mjs","sources":["../../../libs/design/input/examples/src/input-disabled/input-disabled.component.ts","../../../libs/design/input/examples/src/input-disabled/input-disabled.component.html","../../../libs/design/input/examples/src/input-error/input-error.component.ts","../../../libs/design/input/examples/src/input-error/input-error.component.html","../../../libs/design/input/examples/src/input-hint/input-hint.component.ts","../../../libs/design/input/examples/src/input-hint/input-hint.component.html","../../../libs/design/input/examples/src/input-hint-and-error/input-hint-and-error.component.ts","../../../libs/design/input/examples/src/input-hint-and-error/input-hint-and-error.component.html","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.ts","../../../libs/design/input/examples/src/input-with-form-field/input-with-form-field.component.html","../../../libs/design/input/examples/src/examples.ts","../../../libs/design/input/examples/src/daffodil-design-input-examples.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n ReactiveFormsModule,\n UntypedFormControl,\n} from '@angular/forms';\n\nimport { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-disabled',\n templateUrl: './input-disabled.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n ReactiveFormsModule,\n DaffInputComponent,\n DAFF_FORM_FIELD_COMPONENTS,\n ],\n})\nexport class InputDisabledComponent {\n disabled = new UntypedFormControl({ value : '' , disabled: true });\n}\n","<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"disabled\"/>\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n UntypedFormControl,\n Validators,\n ReactiveFormsModule,\n} from '@angular/forms';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffHintComponent,\n} from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-error',\n templateUrl: './input-error.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n DaffHintComponent,\n ReactiveFormsModule,\n ],\n})\nexport class InputErrorComponent {\n control: UntypedFormControl = new UntypedFormControl('test@example.com', [\n Validators.email,\n Validators.required,\n ]);\n}\n","<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\" [formControl]=\"control\"/>\n <daff-hint>Hint</daff-hint>\n @if (control.errors?.required) {\n <daff-error-message>Email is a required field.</daff-error-message>\n }\n @if (control.errors?.email) {\n <daff-error-message>Email is not valid.</daff-error-message>\n }\n</daff-form-field>\n<p>Value: {{ control.value }} </p>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffHintComponent,\n} from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-hint',\n templateUrl: './input-hint.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n DaffHintComponent,\n ],\n})\nexport class InputHintComponent {\n}\n","<daff-form-field>\n <daff-form-label>Email</daff-form-label>\n <input daff-input type=\"text\" name=\"email\"/>\n <daff-hint>Hint goes here.</daff-hint>\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport {\n UntypedFormControl,\n Validators,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faCheck,\n faXmark,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport { DAFF_FORM_FIELD_COMPONENTS } from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-hint-and-error',\n templateUrl: './input-hint-and-error.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n ReactiveFormsModule,\n FaIconComponent,\n ],\n})\nexport class InputHintAndErrorComponent {\n faCheck = faCheck;\n faXmark = faXmark;\n\n control: UntypedFormControl = new UntypedFormControl('', [Validators.required, Validators.minLength(8)]);\n}\n","<daff-form-field>\n <daff-form-label>Password</daff-form-label>\n <input daff-input type=\"text\" name=\"password\" [formControl]=\"control\"/>\n <daff-hint [validated]=\"!(control.invalid) && control.dirty\">\n @if (!(control.invalid) && control.dirty) {\n <fa-icon [icon]=\"faCheck\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n } @else {\n <fa-icon [icon]=\"faXmark\" [fixedWidth]=\"true\" size=\"xs\"></fa-icon>\n }\n Minimum of 8 characters.\n </daff-hint>\n @if (control.errors?.required && control.touched) {\n <daff-error-message>Password is a required field.</daff-error-message>\n }\n</daff-form-field>","import {\n ChangeDetectionStrategy,\n Component,\n} from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport {\n faUser,\n faCircleXmark,\n} from '@fortawesome/free-solid-svg-icons';\n\nimport {\n DAFF_FORM_FIELD_COMPONENTS,\n DaffPrefixSuffixModule,\n} from '@daffodil/design';\nimport { DaffInputComponent } from '@daffodil/design/input';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input-with-form-field',\n templateUrl: './input-with-form-field.component.html',\n styles: [`\n daff-form-field {\n max-width: 320px;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n DAFF_FORM_FIELD_COMPONENTS,\n DaffInputComponent,\n FaIconComponent,\n DaffPrefixSuffixModule,\n ],\n})\nexport class InputWithFormFieldComponent {\n faUser = faUser;\n faCircleXmark = faCircleXmark;\n}\n","<daff-form-field>\n <fa-icon [icon]=\"faUser\" daffPrefix></fa-icon>\n <daff-form-label>First Name</daff-form-label>\n <input daff-input type=\"text\" name=\"first-name\" />\n <fa-icon [icon]=\"faCircleXmark\" daffSuffix></fa-icon>\n</daff-form-field>\n","import { InputDisabledComponent } from './input-disabled/input-disabled.component';\nimport { InputErrorComponent } from './input-error/input-error.component';\nimport { InputHintComponent } from './input-hint/input-hint.component';\nimport { InputHintAndErrorComponent } from './input-hint-and-error/input-hint-and-error.component';\nimport { InputWithFormFieldComponent } from './input-with-form-field/input-with-form-field.component';\n\nexport const INPUT_EXAMPLES = [\n InputWithFormFieldComponent,\n InputDisabledComponent,\n InputErrorComponent,\n InputHintComponent,\n InputHintAndErrorComponent,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2"],"mappings":";;;;;;;;;;MA4Ba,sBAAsB,CAAA;AAhBnC,IAAA,WAAA,GAAA;AAiBE,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,kBAAkB,CAAC,EAAE,KAAK,EAAG,EAAE,EAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;AACnE;kIAFY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,sBAAsB,EC5BnC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,kKAGkB,EDoBd,MAAA,EAAA,CAAA,oCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,mBAAmB,0kBACnB,kBAAkB,EAAA,QAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,sBAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,2BAAA,EAAA,QAAA,EAAA,iBAAA,E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A,QAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDsBI,kBAAkB,EAClB,QAAA,EAAA,mBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,eAAe,2MACf,sBAAsB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGb,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAjBvC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAOhB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACtC,OAAA,EAAA;wBACP,0BAA0B;wBAC1B,kBAAkB;wBAClB,eAAe;wBACf,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,mQAAA,EAAA,MAAA,EAAA,CAAA,oCAAA,CAAA,EAAA;;;AEzBU,MAAA,cAAc,GAAG;IAC5B,2BAA2B;IAC3B,sBAAsB;IACtB,mBAAmB;IACnB,kBAAkB;IAClB,0BAA0B;;;ACX5B;;AAEG;;;;"}
|
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
|
|
2
2
|
import { HostListener, HostBinding, Optional, Self, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
3
3
|
import * as i1 from '@angular/forms';
|
4
4
|
import { merge, of, map } from 'rxjs';
|
5
|
+
import * as i2 from '@daffodil/design';
|
5
6
|
import { DaffFormFieldControl } from '@daffodil/design';
|
6
7
|
|
7
8
|
/**
|
@@ -13,6 +14,26 @@ class DaffInputComponent extends DaffFormFieldControl {
|
|
13
14
|
this.focused = true;
|
14
15
|
this.emitState();
|
15
16
|
}
|
17
|
+
/**
|
18
|
+
* @docs-private
|
19
|
+
*/
|
20
|
+
get internalId() {
|
21
|
+
return this._id;
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* @docs-private
|
25
|
+
*/
|
26
|
+
get ariaDescribedBy() {
|
27
|
+
if (this.formField.hasErrorMessage()) {
|
28
|
+
return this.formField.errorMessageId;
|
29
|
+
}
|
30
|
+
else if (this.formField.hasHint()) {
|
31
|
+
return this.formField.hintId;
|
32
|
+
}
|
33
|
+
else {
|
34
|
+
return null;
|
35
|
+
}
|
36
|
+
}
|
16
37
|
/** @docs-private */
|
17
38
|
blur() {
|
18
39
|
this.focused = false;
|
@@ -20,32 +41,48 @@ class DaffInputComponent extends DaffFormFieldControl {
|
|
20
41
|
}
|
21
42
|
constructor(
|
22
43
|
/** @docs-private */
|
23
|
-
ngControl, _elementRef) {
|
44
|
+
ngControl, _elementRef, formField) {
|
24
45
|
super(ngControl);
|
25
46
|
this.ngControl = ngControl;
|
26
47
|
this._elementRef = _elementRef;
|
48
|
+
this.formField = formField;
|
27
49
|
/** @docs-private */
|
28
50
|
this.class = true;
|
29
51
|
/** @docs-private */
|
30
52
|
this.controlType = 'native-input';
|
53
|
+
/** @docs-private */
|
31
54
|
this.focused = false;
|
55
|
+
this._id = '';
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* @docs-private
|
59
|
+
*/
|
60
|
+
ngOnChanges(changes) {
|
61
|
+
if (this.id || changes?.id.currentValue) {
|
62
|
+
this._id = changes.id.currentValue;
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
this._id = this.formField.id;
|
66
|
+
}
|
32
67
|
}
|
33
68
|
/** @docs-private */
|
34
69
|
ngOnInit() {
|
35
70
|
this.stateChanges = merge(this._stateChanges.asObservable(), this.ngControl ? this.ngControl.statusChanges : of(undefined)).pipe(map(() => this.state));
|
71
|
+
this._id = this.id ?? this.formField.id;
|
36
72
|
}
|
37
73
|
/** @docs-private */
|
38
74
|
onFocus() {
|
39
75
|
this._elementRef.nativeElement.focus();
|
40
76
|
}
|
77
|
+
/** @docs-private */
|
41
78
|
get value() {
|
42
79
|
return this._elementRef.nativeElement.value;
|
43
80
|
}
|
44
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
45
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffInputComponent, isStandalone: true, selector: "input[daff-input]", host: { listeners: { "focus": "focus()", "blur": "blur()" }, properties: { "class.daff-input": "this.class" } }, providers: [
|
81
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }, { token: i2.DaffFormFieldComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
82
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DaffInputComponent, isStandalone: true, selector: "input[daff-input]", host: { listeners: { "focus": "focus()", "blur": "blur()" }, properties: { "class.daff-input": "this.class", "attr.id": "this.internalId", "attr.aria-describedby": "this.ariaDescribedBy" } }, providers: [
|
46
83
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
47
84
|
{ provide: DaffFormFieldControl, useExisting: DaffInputComponent },
|
48
|
-
], usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{background:none;border:none;box-shadow:none;margin:0;width:100%;box-sizing:border-box}:host:focus{border:none;box-shadow:none;outline:none}:host:disabled{cursor:not-allowed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
85
|
+
], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{background:none;border:none;box-shadow:none;margin:0;width:100%;box-sizing:border-box}:host:focus{border:none;box-shadow:none;outline:none}:host:disabled{cursor:not-allowed}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
49
86
|
}
|
50
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffInputComponent, decorators: [{
|
51
88
|
type: Component,
|
@@ -57,12 +94,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
57
94
|
type: Optional
|
58
95
|
}, {
|
59
96
|
type: Self
|
60
|
-
}] }, { type: i0.ElementRef }], propDecorators: { class: [{
|
97
|
+
}] }, { type: i0.ElementRef }, { type: i2.DaffFormFieldComponent }], propDecorators: { class: [{
|
61
98
|
type: HostBinding,
|
62
99
|
args: ['class.daff-input']
|
63
100
|
}], focus: [{
|
64
101
|
type: HostListener,
|
65
102
|
args: ['focus']
|
103
|
+
}], internalId: [{
|
104
|
+
type: HostBinding,
|
105
|
+
args: ['attr.id']
|
106
|
+
}], ariaDescribedBy: [{
|
107
|
+
type: HostBinding,
|
108
|
+
args: ['attr.aria-describedby']
|
66
109
|
}], blur: [{
|
67
110
|
type: HostListener,
|
68
111
|
args: ['blur']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-design-input.mjs","sources":["../../../libs/design/input/src/input.component.ts","../../../libs/design/input/src/input.module.ts","../../../libs/design/input/src/daffodil-design-input.ts"],"sourcesContent":["import {\n Component,\n Optional,\n Self,\n ElementRef,\n HostListener,\n ChangeDetectionStrategy,\n HostBinding,\n OnInit,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport {\n merge,\n of,\n map,\n} from 'rxjs';\n\nimport {
|
1
|
+
{"version":3,"file":"daffodil-design-input.mjs","sources":["../../../libs/design/input/src/input.component.ts","../../../libs/design/input/src/input.module.ts","../../../libs/design/input/src/daffodil-design-input.ts"],"sourcesContent":["import {\n Component,\n Optional,\n Self,\n ElementRef,\n HostListener,\n ChangeDetectionStrategy,\n HostBinding,\n OnInit,\n OnChanges,\n SimpleChanges,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport {\n merge,\n of,\n map,\n} from 'rxjs';\n\nimport {\n DaffFormFieldComponent,\n DaffFormFieldControl,\n} from '@daffodil/design';\n\n/**\n * DaffInputComponent provides the same functionality as a native `<input>` and contains custom styling and functionality.\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'input[daff-input]',\n template: '<ng-content></ng-content>',\n styleUrl: './input.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n { provide: DaffFormFieldControl, useExisting: DaffInputComponent },\n ],\n})\nexport class DaffInputComponent extends DaffFormFieldControl<string> implements DaffFormFieldControl<string>, OnInit, OnChanges {\n\n /** @docs-private */\n @HostBinding('class.daff-input') class = true;\n\n /** @docs-private */\n controlType = 'native-input';\n\n /** @docs-private */\n focused = false;\n\n /** @docs-private */\n @HostListener('focus') focus() {\n this.focused = true;\n this.emitState();\n\n }\n\n private _id = '';\n\n /**\n * @docs-private\n */\n @HostBinding('attr.id') get internalId() {\n return this._id;\n }\n\n /**\n * @docs-private\n */\n @HostBinding('attr.aria-describedby') get ariaDescribedBy() {\n if(this.formField.hasErrorMessage()) {\n return this.formField.errorMessageId;\n } else if(this.formField.hasHint()) {\n return this.formField.hintId;\n } else {\n return null;\n }\n }\n\n /** @docs-private */\n @HostListener('blur') blur() {\n this.focused = false;\n this.emitState();\n }\n\n constructor(\n /** @docs-private */\n @Optional() @Self() public ngControl: NgControl,\n private _elementRef: ElementRef<HTMLInputElement>,\n private formField: DaffFormFieldComponent,\n ) {\n super(ngControl);\n }\n\n /**\n * @docs-private\n */\n ngOnChanges(changes: SimpleChanges) {\n if (this.id || changes?.id.currentValue) {\n this._id = changes.id.currentValue;\n } else {\n this._id = this.formField.id;\n }\n }\n\n /** @docs-private */\n ngOnInit() {\n this.stateChanges = merge(\n this._stateChanges.asObservable(),\n this.ngControl ? this.ngControl.statusChanges : of(undefined),\n ).pipe(\n map(() => this.state),\n );\n this._id = this.id ?? this.formField.id;\n }\n\n /** @docs-private */\n onFocus() {\n this._elementRef.nativeElement.focus();\n }\n\n /** @docs-private */\n get value() {\n return this._elementRef.nativeElement.value;\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffInputComponent } from './input.component';\n\n/**\n * @deprecated in favor of standalone components. Deprecated in version 0.84.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n DaffInputComponent,\n ],\n exports: [\n DaffInputComponent,\n ],\n})\nexport class DaffInputModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAwBA;;AAEG;AAYG,MAAO,kBAAmB,SAAQ,oBAA4B,CAAA;;IAY3C,KAAK,GAAA;AAC1B,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;QACnB,IAAI,CAAC,SAAS,EAAE;;AAMlB;;AAEG;AACH,IAAA,IAA4B,UAAU,GAAA;QACpC,OAAO,IAAI,CAAC,GAAG;;AAGjB;;AAEG;AACH,IAAA,IAA0C,eAAe,GAAA;AACvD,QAAA,IAAG,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,EAAE;AACnC,YAAA,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc;;AAC/B,aAAA,IAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE;AAClC,YAAA,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM;;aACvB;AACL,YAAA,OAAO,IAAI;;;;IAKO,IAAI,GAAA;AACxB,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;QACpB,IAAI,CAAC,SAAS,EAAE;;AAGlB,IAAA,WAAA;;IAE6B,SAAoB,EACvC,WAAyC,EACzC,SAAiC,EAAA;QAEzC,KAAK,CAAC,SAAS,CAAC;QAJW,IAAS,CAAA,SAAA,GAAT,SAAS;QAC5B,IAAW,CAAA,WAAA,GAAX,WAAW;QACX,IAAS,CAAA,SAAA,GAAT,SAAS;;QA/Cc,IAAK,CAAA,KAAA,GAAG,IAAI;;Q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,EAAA,CAAA;sBAAzB,YAAY;uBAAC,MAAM;;;AC3EtB;;AAEG;MASU,eAAe,CAAA;kIAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mIAAf,eAAe,EAAA,OAAA,EAAA,CANxB,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAGlB,kBAAkB,CAAA,EAAA,CAAA,CAAA;mIAGT,eAAe,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAR3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,kBAAkB;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,kBAAkB;AACnB,qBAAA;AACF,iBAAA;;;ACdD;;AAEG;;;;"}
|
@@ -221,7 +221,7 @@ class DaffMediaGalleryComponent {
|
|
221
221
|
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: DaffMediaGalleryComponent, isStandalone: true, selector: "daff-media-gallery", inputs: { id: "id" }, outputs: { elementChange: "elementChange" }, host: { properties: { "attr.id": "this.id", "class.daff-media-gallery": "this.class" } }, providers: [
|
222
222
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
223
223
|
{ provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },
|
224
|
-
], queries: [{ propertyName: "_thumbnails", predicate: DaffThumbnailDirective, isSignal: true }], viewQueries: [{ propertyName: "_thumbnailButtons", predicate: ["thumbnailButtons"], descendants: true, read: ElementRef }], hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }, { directive: i1.DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media (min-width: 1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media (min-width: 480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative;
|
224
|
+
], queries: [{ propertyName: "_thumbnails", predicate: DaffThumbnailDirective, isSignal: true }], viewQueries: [{ propertyName: "_thumbnailButtons", predicate: ["thumbnailButtons"], descendants: true, read: ElementRef }], hostDirectives: [{ directive: i1.DaffArticleEncapsulatedDirective }, { directive: i1.DaffSkeletonableDirective, inputs: ["skeleton", "skeleton"] }], ngImport: i0, template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media (min-width: 1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4rem;width:4rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media (min-width: 480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4.5rem;width:4.5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:5rem;width:5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{flex-grow:1;display:flex;position:relative;height:100%;width:100%;border-radius:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media (min-width: 1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media (min-width: 1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DaffSelectableDirective, selector: "[daffSelected]", inputs: ["selected"], outputs: ["becameSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
225
225
|
}
|
226
226
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffMediaGalleryComponent, decorators: [{
|
227
227
|
type: Component,
|
@@ -238,7 +238,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
|
|
238
238
|
DaffThumbnailDirective,
|
239
239
|
NgTemplateOutlet,
|
240
240
|
DaffSelectableDirective,
|
241
|
-
], template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media (min-width: 1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media (min-width: 480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{display:flex;position:relative;
|
241
|
+
], template: "<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>", styles: [":host(.daff-media-gallery){display:flex;flex-direction:column;gap:.5rem}@media (min-width: 1024px){:host(.daff-media-gallery){flex-direction:row}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;display:flex;flex-direction:row;justify-content:center;align-items:center;height:4rem;width:4rem;max-width:100%;overflow:hidden;user-select:none;padding:0;position:relative;flex-shrink:0}@media (min-width: 480px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{height:4.5rem;width:4.5rem}}@media (min-width: 1024px){:host(.daff-media-gallery) ::ng-deep .daff-thumbnail{flex-direction:column;height:5rem;width:5rem}}:host(.daff-media-gallery) ::ng-deep .daff-thumbnail img{display:block;width:100%}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4rem;width:4rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4rem;width:4rem;position:absolute;top:0;left:0}@media (min-width: 480px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:4.5rem;width:4.5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:4.5rem;width:4.5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail{display:flex;position:relative;height:5rem;width:5rem;border-radius:0}:host(.daff-media-gallery).daff-skeleton ::ng-deep .daff-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:5rem;width:5rem;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}}:host(.daff-media-gallery).daff-skeleton ::ng-deep img{opacity:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail{flex-grow:1;display:flex;position:relative;height:100%;width:100%;border-radius:0}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__selected-thumbnail:before{animation-name:loading;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;content:\"\";height:100%;width:100%;position:absolute;top:0;left:0}@keyframes loading{0%{opacity:.5}to{opacity:1}}:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:16rem}@media (min-width: 1024px){:host(.daff-media-gallery).daff-skeleton .daff-media-gallery__skeleton-placeholder{height:30rem}}.daff-media-gallery__thumbnails{display:flex;flex-direction:row;flex-shrink:0;gap:.25rem;order:2;max-width:100%;overflow-x:auto}@media (min-width: 1024px){.daff-media-gallery__thumbnails{max-height:29.5rem;flex-direction:column;overflow-y:auto;order:1}}.daff-media-gallery__selected-thumbnail{display:flex;align-items:center;justify-content:center;flex-grow:1;width:100%;order:1}@media (min-width: 1024px){.daff-media-gallery__selected-thumbnail{order:2;margin:0}}.daff-media-gallery__video-button{width:2rem;height:2rem;border-radius:100%;position:absolute}.daff-media-gallery__video-button:after{content:\"\";position:absolute;width:.75rem;height:.75rem;left:60%;top:50%;transform:translate(-60%,-50%) rotate(90deg);clip-path:polygon(50% 15%,0% 100%,100% 100%);transition:all .4s ease-in-out}\n"] }]
|
242
242
|
}], ctorParameters: () => [{ type: i1.DaffSkeletonableDirective }], propDecorators: { id: [{
|
243
243
|
type: HostBinding,
|
244
244
|
args: ['attr.id']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daffodil-design-media-gallery.mjs","sources":["../../../libs/design/media-gallery/src/helpers/media-gallery-token.ts","../../../libs/design/media-gallery/src/thumbnail/thumbnail.directive.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.html","../../../libs/design/media-gallery/src/media-gallery.module.ts","../../../libs/design/media-gallery/src/media-gallery.ts","../../../libs/design/media-gallery/src/daffodil-design-media-gallery.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffMediaGalleryRegistration } from './media-gallery-registration.interface';\n\nexport const {\n token: DAFF_MEDIA_GALLERY_TOKEN,\n /**\n * Provider function for {@link DAFF_MEDIA_GALLERY_TOKEN}.\n */\n provider: provideDaffMediaGalleryToken,\n} = createSingleInjectionToken<DaffMediaGalleryRegistration>('DAFF_MEDIA_GALLERY_TOKEN');\n","import {\n Directive,\n Inject,\n Input,\n TemplateRef,\n OnInit,\n isDevMode,\n} from '@angular/core';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\n\nlet uniqueThumbnailId = 0;\n\n/**\n * DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.\n *\n * ```html\n * <ng-template daffThumbnail></ng-template>\n * ```\n */\n@Directive({\n selector: '[daffThumbnail]',\n})\nexport class DaffThumbnailDirective implements OnInit {\n\n private _increment = uniqueThumbnailId;\n\n /**\n * @docs-private\n *\n * The autogenerated unique id for a thumbnail.\n */\n get id(): string {\n return this.gallery.id + '-thumbnail-' + this._increment;\n }\n\n /**\n * @docs-private\n *\n * The unique id of the selected thumbnail.\n */\n get selectedThumbnailId(): string {\n return this.id + '-selected';\n }\n\n /**\n * The file path to a thumbnail, presumably an image.\n */\n @Input() thumbnailSrc = undefined;\n\n /**\n * Provides an accessible label for a thumbnail.\n */\n @Input() label: string = undefined;\n\n /** Indicates whether the thumbnail represents a video. */\n @Input() isVideo = false;\n\n constructor(\n /**\n * @docs-private\n */\n @Inject(DAFF_MEDIA_GALLERY_TOKEN) public gallery: DaffMediaGalleryRegistration,\n /**\n * @docs-private\n */\n public templateRef: TemplateRef<unknown>,\n ) {\n uniqueThumbnailId++;\n }\n\n /**\n * @docs-private\n */\n ngOnInit() {\n if(!this.label && isDevMode()) {\n console.warn('The thumbnail ' + this.id + ' is missing a label.');\n }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n HostBinding,\n ChangeDetectionStrategy,\n Input,\n QueryList,\n ViewChildren,\n ElementRef,\n Output,\n EventEmitter,\n contentChildren,\n signal,\n computed,\n Signal,\n} from '@angular/core';\n\nimport {\n DaffArticleEncapsulatedDirective,\n DaffSelectableDirective,\n DaffSkeletonableDirective,\n} from '@daffodil/design';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\nimport { DaffThumbnailDirective } from '../thumbnail/thumbnail.directive';\n\nlet uniqueGalleryId = 0;\n\n/**\n * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.\n *\n * ```html\n * <daff-media-gallery>\n * <ng-template daffThumbnail thumbnailSrc=\"/thumbnail-path.jpg\" label=\"Your description\">\n * <daff-image src=\"/image-path.jpg\" alt=\"Your description\" width=\"100\" height=\"100\"></daff-image>\n * </ng-template>\n * </daff-media-gallery>\n * ```\n */\n@Component({\n selector: 'daff-media-gallery',\n templateUrl: './media-gallery.component.html',\n styleUrls: ['./media-gallery.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },\n ],\n hostDirectives: [\n { directive: DaffArticleEncapsulatedDirective },\n {\n directive: DaffSkeletonableDirective,\n inputs: ['skeleton'],\n },\n ],\n imports: [\n DaffThumbnailDirective,\n NgTemplateOutlet,\n DaffSelectableDirective,\n ],\n})\nexport class DaffMediaGalleryComponent implements DaffMediaGalleryRegistration {\n /**\n * The internal ID of the gallery.\n */\n private _id = 'media-gallery-' + uniqueGalleryId;\n\n /**\n * Custom ID for the media gallery that overrides the auto-generated one. When using this input, it is your responsibility to ensure that the ID is unique.\n */\n @HostBinding('attr.id')\n @Input()\n get id() {\n return this._id;\n }\n set id(val: string | undefined | null) {\n if(!val){\n return;\n }\n this._id = val;\n };\n\n /**\n * @docs-private\n *\n * Adds a class for styling the media gallery\n */\n @HostBinding('class.daff-media-gallery') private class = true;\n\n /**\n * An event indicating that the selected media gallery element has changed.\n */\n @Output() elementChange: EventEmitter<number> = new EventEmitter<number>();\n\n /**\n * @docs-private\n */\n _thumbnails = contentChildren(DaffThumbnailDirective);\n\n /**\n * @docs-private\n */\n @ViewChildren('thumbnailButtons', { read: ElementRef }) private _thumbnailButtons: QueryList<ElementRef<HTMLElement>>;\n\n /**\n * @docs-private\n */\n constructor(private skeletonDirective: DaffSkeletonableDirective) {\n uniqueGalleryId++;\n }\n\n /**\n * @docs-private\n *\n * Whether or not the component its currently displaying its skeleton state.\n */\n get skeleton() {\n return this.skeletonDirective.skeleton;\n }\n\n /**\n * @docs-private\n */\n _selectedThumbnail: Signal<DaffThumbnailDirective> = computed(() => {\n const idx = this._selectedIndex();\n if(!idx) {\n return this._thumbnails().at(0);\n }\n return this._thumbnails().at(idx);\n });\n\n private _selectedIndex = signal<number | null>(null);\n\n private focusSelected() {\n this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();\n }\n\n /**\n * Select a specific entry in the media gallery by its index.\n *\n * @param index The index to set, starting at 0.\n */\n selectIndex(index: number) {\n this._selectedIndex.set(index);\n this.elementChange.emit(index);\n }\n\n /**\n * Navigate to the next element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n next(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Navigate to the previous element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n previous(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the first element.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n selectFirst(focus: boolean = true) {\n this._selectedIndex.set(0);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the last element of the gallery.\n *\n * @param Whether to move focus to the newly selected item.\n */\n selectLast(focus: boolean = true) {\n this._selectedIndex.set(this._thumbnails().length - 1);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n}\n","<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n exports: [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n})\nexport class DaffMediaGalleryModule {}\n","import { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_MEDIA_GALLERY_COMPONENTS = <const> [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,EACX,KAAK,EAAE,wBAAwB;AAC/B;;AAEG;AACH,QAAQ,EAAE,4BAA4B,GACvC,GAAG,0BAA0B,CAA+B,0BAA0B,CAAC;;ACExF,IAAI,iBAAiB,GAAG,CAAC;AAEzB;;;;;;AAMG;MAIU,sBAAsB,CAAA;AAIjC;;;;AAIG;AACH,IAAA,IAAI,EAAE,GAAA;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC,UAAU;;AAG1D;;;;AAIG;AACH,IAAA,IAAI,mBAAmB,GAAA;AACrB,QAAA,OAAO,IAAI,CAAC,EAAE,GAAG,WAAW;;AAgB9B,IAAA,WAAA;AACE;;AAEG;IACsC,OAAqC;AAC9E;;AAEG;IACI,WAAiC,EAAA;QAJC,IAAO,CAAA,OAAA,GAAP,OAAO;QAIzC,IAAW,CAAA,WAAA,GAAX,WAAW;QAzCZ,IAAU,CAAA,UAAA,GAAG,iBAAiB;AAoBtC;;AAEG;QACM,IAAY,CAAA,YAAA,GAAG,SAAS;AAEjC;;AAEG;QACM,IAAK,CAAA,KAAA,GA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AAA,EAAA,IAAA,EAAA,sBAAsB,YAT/B,YAAY;YACZ,yBAAyB;AACzB,YAAA,sBAAsB,aAGtB,yBAAyB;YACzB,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAGb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAT/B,YAAY,CAAA,EAAA,CAAA,CAAA;;4FASH,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;AACU,MAAA,6BAA6B,GAAW;IACnD,yBAAyB;IACzB,sBAAsB;;;ACRxB;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"daffodil-design-media-gallery.mjs","sources":["../../../libs/design/media-gallery/src/helpers/media-gallery-token.ts","../../../libs/design/media-gallery/src/thumbnail/thumbnail.directive.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.ts","../../../libs/design/media-gallery/src/media-gallery/media-gallery.component.html","../../../libs/design/media-gallery/src/media-gallery.module.ts","../../../libs/design/media-gallery/src/media-gallery.ts","../../../libs/design/media-gallery/src/daffodil-design-media-gallery.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nimport { DaffMediaGalleryRegistration } from './media-gallery-registration.interface';\n\nexport const {\n token: DAFF_MEDIA_GALLERY_TOKEN,\n /**\n * Provider function for {@link DAFF_MEDIA_GALLERY_TOKEN}.\n */\n provider: provideDaffMediaGalleryToken,\n} = createSingleInjectionToken<DaffMediaGalleryRegistration>('DAFF_MEDIA_GALLERY_TOKEN');\n","import {\n Directive,\n Inject,\n Input,\n TemplateRef,\n OnInit,\n isDevMode,\n} from '@angular/core';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\n\nlet uniqueThumbnailId = 0;\n\n/**\n * DaffThumbnailDirective is a structural directive used to mark elements as thumbnails within the `DaffMediaGalleryComponent`.\n *\n * ```html\n * <ng-template daffThumbnail></ng-template>\n * ```\n */\n@Directive({\n selector: '[daffThumbnail]',\n})\nexport class DaffThumbnailDirective implements OnInit {\n\n private _increment = uniqueThumbnailId;\n\n /**\n * @docs-private\n *\n * The autogenerated unique id for a thumbnail.\n */\n get id(): string {\n return this.gallery.id + '-thumbnail-' + this._increment;\n }\n\n /**\n * @docs-private\n *\n * The unique id of the selected thumbnail.\n */\n get selectedThumbnailId(): string {\n return this.id + '-selected';\n }\n\n /**\n * The file path to a thumbnail, presumably an image.\n */\n @Input() thumbnailSrc = undefined;\n\n /**\n * Provides an accessible label for a thumbnail.\n */\n @Input() label: string = undefined;\n\n /** Indicates whether the thumbnail represents a video. */\n @Input() isVideo = false;\n\n constructor(\n /**\n * @docs-private\n */\n @Inject(DAFF_MEDIA_GALLERY_TOKEN) public gallery: DaffMediaGalleryRegistration,\n /**\n * @docs-private\n */\n public templateRef: TemplateRef<unknown>,\n ) {\n uniqueThumbnailId++;\n }\n\n /**\n * @docs-private\n */\n ngOnInit() {\n if(!this.label && isDevMode()) {\n console.warn('The thumbnail ' + this.id + ' is missing a label.');\n }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n HostBinding,\n ChangeDetectionStrategy,\n Input,\n QueryList,\n ViewChildren,\n ElementRef,\n Output,\n EventEmitter,\n contentChildren,\n signal,\n computed,\n Signal,\n} from '@angular/core';\n\nimport {\n DaffArticleEncapsulatedDirective,\n DaffSelectableDirective,\n DaffSkeletonableDirective,\n} from '@daffodil/design';\n\nimport { DaffMediaGalleryRegistration } from '../helpers/media-gallery-registration.interface';\nimport { DAFF_MEDIA_GALLERY_TOKEN } from '../helpers/media-gallery-token';\nimport { DaffThumbnailDirective } from '../thumbnail/thumbnail.directive';\n\nlet uniqueGalleryId = 0;\n\n/**\n * The `DaffMediaGalleryComonent` is used to display a group of thumbnails in a gallery format.\n *\n * ```html\n * <daff-media-gallery>\n * <ng-template daffThumbnail thumbnailSrc=\"/thumbnail-path.jpg\" label=\"Your description\">\n * <daff-image src=\"/image-path.jpg\" alt=\"Your description\" width=\"100\" height=\"100\"></daff-image>\n * </ng-template>\n * </daff-media-gallery>\n * ```\n */\n@Component({\n selector: 'daff-media-gallery',\n templateUrl: './media-gallery.component.html',\n styleUrls: ['./media-gallery.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n { provide: DAFF_MEDIA_GALLERY_TOKEN, useExisting: DaffMediaGalleryComponent },\n ],\n hostDirectives: [\n { directive: DaffArticleEncapsulatedDirective },\n {\n directive: DaffSkeletonableDirective,\n inputs: ['skeleton'],\n },\n ],\n imports: [\n DaffThumbnailDirective,\n NgTemplateOutlet,\n DaffSelectableDirective,\n ],\n})\nexport class DaffMediaGalleryComponent implements DaffMediaGalleryRegistration {\n /**\n * The internal ID of the gallery.\n */\n private _id = 'media-gallery-' + uniqueGalleryId;\n\n /**\n * Custom ID for the media gallery that overrides the auto-generated one. When using this input, it is your responsibility to ensure that the ID is unique.\n */\n @HostBinding('attr.id')\n @Input()\n get id() {\n return this._id;\n }\n set id(val: string | undefined | null) {\n if(!val){\n return;\n }\n this._id = val;\n };\n\n /**\n * @docs-private\n *\n * Adds a class for styling the media gallery\n */\n @HostBinding('class.daff-media-gallery') private class = true;\n\n /**\n * An event indicating that the selected media gallery element has changed.\n */\n @Output() elementChange: EventEmitter<number> = new EventEmitter<number>();\n\n /**\n * @docs-private\n */\n _thumbnails = contentChildren(DaffThumbnailDirective);\n\n /**\n * @docs-private\n */\n @ViewChildren('thumbnailButtons', { read: ElementRef }) private _thumbnailButtons: QueryList<ElementRef<HTMLElement>>;\n\n /**\n * @docs-private\n */\n constructor(private skeletonDirective: DaffSkeletonableDirective) {\n uniqueGalleryId++;\n }\n\n /**\n * @docs-private\n *\n * Whether or not the component its currently displaying its skeleton state.\n */\n get skeleton() {\n return this.skeletonDirective.skeleton;\n }\n\n /**\n * @docs-private\n */\n _selectedThumbnail: Signal<DaffThumbnailDirective> = computed(() => {\n const idx = this._selectedIndex();\n if(!idx) {\n return this._thumbnails().at(0);\n }\n return this._thumbnails().at(idx);\n });\n\n private _selectedIndex = signal<number | null>(null);\n\n private focusSelected() {\n this._thumbnailButtons.get(this._selectedIndex())?.nativeElement.focus();\n }\n\n /**\n * Select a specific entry in the media gallery by its index.\n *\n * @param index The index to set, starting at 0.\n */\n selectIndex(index: number) {\n this._selectedIndex.set(index);\n this.elementChange.emit(index);\n }\n\n /**\n * Navigate to the next element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n next(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) + 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Navigate to the previous element in the list of thumbnails.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n previous(focus: boolean = true) {\n this._selectedIndex.update((curr) => ((curr ?? 0) - 1 + this._thumbnails().length) % this._thumbnails().length);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the first element.\n *\n * @param focus Whether to move focus to the newly selected item.\n */\n selectFirst(focus: boolean = true) {\n this._selectedIndex.set(0);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n\n /**\n * Select the last element of the gallery.\n *\n * @param Whether to move focus to the newly selected item.\n */\n selectLast(focus: boolean = true) {\n this._selectedIndex.set(this._thumbnails().length - 1);\n this.elementChange.emit(this._selectedIndex());\n\n if(focus) {\n this.focusSelected();\n }\n }\n}\n","<ng-content></ng-content>\n\n<div class=\"daff-media-gallery__thumbnails\" #thumbnailsEl role=\"tablist\">\n\t@if(skeleton) {\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t\t<div class=\"daff-thumbnail\"></div>\n\t}\n\t@else {\n\t\t@for (thumbnail of _thumbnails(); track thumbnail; let index = $index) {\n\t\t\t<button \n\t\t\t\t#thumbnailButtons\n\t\t\t\tclass=\"daff-thumbnail\" \n\t\t\t\trole=\"tab\"\n\t\t\t\tdaffSelected\n\t\t\t\t[selected]=\"thumbnail === _selectedThumbnail()\"\n\t\t\t\tattr.aria-label=\"{{ thumbnail.label ?? 'Gallery Element ' + (index + 1) }}\"\n\t\t\t\t[attr.aria-selected]=\"thumbnail === _selectedThumbnail() ? 'true' : 'false'\"\n\t\t\t\t[attr.aria-controls]=\"thumbnail.selectedThumbnailId\"\n\t\t\t\t[attr.tabindex]=\"thumbnail === _selectedThumbnail() ? 0 : -1\"\n\t\t\t\t(click)=\"selectIndex(index)\"\n\t\t\t\t[attr.id]=\"thumbnail.id\" \n\t\t\t\t(keydown.arrowright)=\"next()\"\n\t\t\t\t(keydown.arrowleft)=\"previous()\">\n\t\t\t\t@if (thumbnail.thumbnailSrc) {\n\t\t\t\t\t<img [src]=\"thumbnail.thumbnailSrc\" aria-hidden=\"true\"/>\n\t\t\t\t}\n\t\t\t\t@if (thumbnail.isVideo) {\n\t\t\t\t\t<div class=\"daff-media-gallery__video-button\">\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</button>\n\t\t}\n\t}\n</div>\n@let selectedEl = this._selectedThumbnail();\n<div \n\tclass=\"daff-media-gallery__selected-thumbnail\"\n\ttabindex=\"0\"\n\t#selectedThumbnail\n\trole=\"tabpanel\"\n\t[attr.id]=\"selectedEl?.selectedThumbnailId\">\n\t\t@if(selectedEl) {\n\t\t\t<ng-container *ngTemplateOutlet=\"selectedEl.templateRef\"></ng-container>\n\t\t}\n\t\t@else {\n\t\t\t<div class=\"daff-media-gallery__skeleton-placeholder\"></div>\n\t\t}\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @deprecated in favor of {@link DAFF_MEDIA_GALLERY_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n exports: [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n ],\n})\nexport class DaffMediaGalleryModule {}\n","import { DaffMediaGalleryComponent } from './media-gallery/media-gallery.component';\nimport { DaffThumbnailDirective } from './thumbnail/thumbnail.directive';\n\n/**\n * @docs-private\n */\nexport const DAFF_MEDIA_GALLERY_COMPONENTS = <const> [\n DaffMediaGalleryComponent,\n DaffThumbnailDirective,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,EACX,KAAK,EAAE,wBAAwB;AAC/B;;AAEG;AACH,QAAQ,EAAE,4BAA4B,GACvC,GAAG,0BAA0B,CAA+B,0BAA0B,CAAC;;ACExF,IAAI,iBAAiB,GAAG,CAAC;AAEzB;;;;;;AAMG;MAIU,sBAAsB,CAAA;AAIjC;;;;AAIG;AACH,IAAA,IAAI,EAAE,GAAA;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC,UAAU;;AAG1D;;;;AAIG;AACH,IAAA,IAAI,mBAAmB,GAAA;AACrB,QAAA,OAAO,IAAI,CAAC,EAAE,GAAG,WAAW;;AAgB9B,IAAA,WAAA;AACE;;AAEG;IACsC,OAAqC;AAC9E;;A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EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAtB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAT/B,YAAY;YACZ,yBAAyB;AACzB,YAAA,sBAAsB,aAGtB,yBAAyB;YACzB,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAGb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAT/B,YAAY,CAAA,EAAA,CAAA,CAAA;;4FASH,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,yBAAyB;wBACzB,sBAAsB;AACvB,qBAAA;AACF,iBAAA;;;AChBD;;AAEG;AACU,MAAA,6BAA6B,GAAW;IACnD,yBAAyB;IACzB,sBAAsB;;;ACRxB;;AAEG;;;;"}
|
@@ -11,7 +11,7 @@ class BasicQuantityFieldComponent {
|
|
11
11
|
this.control = new UntypedFormControl(1);
|
12
12
|
}
|
13
13
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BasicQuantityFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
14
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: BasicQuantityFieldComponent, isStandalone: true, selector: "basic-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field [formControl]=\"control\"></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
14
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: BasicQuantityFieldComponent, isStandalone: true, selector: "basic-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field [formControl]=\"control\"></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
15
15
|
}
|
16
16
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: BasicQuantityFieldComponent, decorators: [{
|
17
17
|
type: Component,
|
@@ -27,7 +27,7 @@ class CustomRangeQuantityFieldComponent {
|
|
27
27
|
this.control = new UntypedFormControl(5);
|
28
28
|
}
|
29
29
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: CustomRangeQuantityFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
30
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: CustomRangeQuantityFieldComponent, isStandalone: true, selector: "custom-range-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field\n [formControl]=\"control\"\n [min]=\"5\"\n [max]=\"50\"\n ></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
30
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: CustomRangeQuantityFieldComponent, isStandalone: true, selector: "custom-range-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field\n [formControl]=\"control\"\n [min]=\"5\"\n [max]=\"50\"\n ></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
31
31
|
}
|
32
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: CustomRangeQuantityFieldComponent, decorators: [{
|
33
33
|
type: Component,
|
@@ -43,7 +43,7 @@ class DisabledQuantityFieldComponent {
|
|
43
43
|
this.control = new UntypedFormControl({ value: '1', disabled: true });
|
44
44
|
}
|
45
45
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DisabledQuantityFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
46
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DisabledQuantityFieldComponent, isStandalone: true, selector: "disabled-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field [formControl]=\"control\"></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
46
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: DisabledQuantityFieldComponent, isStandalone: true, selector: "disabled-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field [formControl]=\"control\"></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
47
47
|
}
|
48
48
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DisabledQuantityFieldComponent, decorators: [{
|
49
49
|
type: Component,
|
@@ -59,7 +59,7 @@ class SelectMaxQuantityFieldComponent {
|
|
59
59
|
this.control = new UntypedFormControl(1);
|
60
60
|
}
|
61
61
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: SelectMaxQuantityFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
62
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: SelectMaxQuantityFieldComponent, isStandalone: true, selector: "select-max-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field\n [formControl]=\"control\"\n [selectMax]=\"15\"\n ></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field" }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
62
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: SelectMaxQuantityFieldComponent, isStandalone: true, selector: "select-max-quantity-field", ngImport: i0, template: "<daff-form-field>\n <daff-quantity-field\n [formControl]=\"control\"\n [selectMax]=\"15\"\n ></daff-quantity-field>\n</daff-form-field>\n\n<p>\n Control Value: {{control.value}}\n</p>\n", styles: [""], dependencies: [{ kind: "component", type: i1.DaffFormFieldComponent, selector: "daff-form-field", inputs: ["id"] }, { kind: "component", type: DaffQuantityFieldComponent, selector: "daff-quantity-field", inputs: ["min", "max", "selectMax", "id"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
63
63
|
}
|
64
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: SelectMaxQuantityFieldComponent, decorators: [{
|
65
65
|
type: Component,
|