@tft/crispr-forms 21.0.3 → 21.0.4
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/fesm2022/tft-crispr-forms-autocomplete-field.component-CpEWI7bT.mjs +95 -0
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-CpEWI7bT.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-BICpK-GR.mjs +2 -0
- package/fesm2022/tft-crispr-forms-index-BICpK-GR.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CG3cLos3.mjs +88 -0
- package/fesm2022/tft-crispr-forms-index-CG3cLos3.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CLJ89Dev.mjs +73 -0
- package/fesm2022/tft-crispr-forms-index-CLJ89Dev.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CvTUJeC6.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-CvTUJeC6.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-D6cKptyg.mjs +36 -0
- package/fesm2022/tft-crispr-forms-index-D6cKptyg.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DAx6Am4i.mjs +40 -0
- package/fesm2022/tft-crispr-forms-index-DAx6Am4i.mjs.map +1 -0
- package/fesm2022/{tft-crispr-forms-index-BQFuEW6x.mjs → tft-crispr-forms-index-DEu5NqmR.mjs} +3 -3
- package/fesm2022/tft-crispr-forms-index-DEu5NqmR.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DOpDpDdt.mjs +179 -0
- package/fesm2022/tft-crispr-forms-index-DOpDpDdt.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DW1QGkrv.mjs +137 -0
- package/fesm2022/tft-crispr-forms-index-DW1QGkrv.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DuvnSHLl.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-DuvnSHLl.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DvrD-Lli.mjs +190 -0
- package/fesm2022/tft-crispr-forms-index-DvrD-Lli.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-usD7jUs3.mjs +68 -0
- package/fesm2022/tft-crispr-forms-index-usD7jUs3.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms.mjs +60 -52
- package/fesm2022/tft-crispr-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/tft-crispr-forms.d.ts +14 -14
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-ChocHy3F.mjs +0 -95
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-ChocHy3F.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BQFuEW6x.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BZ9V1Ec-.mjs +0 -39
- package/fesm2022/tft-crispr-forms-index-BZ9V1Ec-.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BkCdLt5V.mjs +0 -40
- package/fesm2022/tft-crispr-forms-index-BkCdLt5V.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-Bypm5YtY.mjs +0 -137
- package/fesm2022/tft-crispr-forms-index-Bypm5YtY.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CFwkbxFk.mjs +0 -88
- package/fesm2022/tft-crispr-forms-index-CFwkbxFk.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DEctfeGr.mjs +0 -2
- package/fesm2022/tft-crispr-forms-index-DEctfeGr.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DcrZSpdk.mjs +0 -73
- package/fesm2022/tft-crispr-forms-index-DcrZSpdk.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DmaDlaNf.mjs +0 -68
- package/fesm2022/tft-crispr-forms-index-DmaDlaNf.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-Hsgr_WHO.mjs +0 -190
- package/fesm2022/tft-crispr-forms-index-Hsgr_WHO.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-gORcx6V1.mjs +0 -36
- package/fesm2022/tft-crispr-forms-index-gORcx6V1.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-lrhnilye.mjs +0 -39
- package/fesm2022/tft-crispr-forms-index-lrhnilye.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-uu4CyAEP.mjs +0 -182
- package/fesm2022/tft-crispr-forms-index-uu4CyAEP.mjs.map +0 -1
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import * as i2 from '@angular/material/autocomplete';
|
|
4
|
-
import { MatAutocompleteModule, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
5
|
-
import * as i1$1 from '@angular/common';
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
7
|
-
import * as i1 from '@angular/forms';
|
|
8
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import * as i3 from '@angular/material/input';
|
|
10
|
-
import { MatInputModule } from '@angular/material/input';
|
|
11
|
-
import { MatOptionModule } from '@angular/material/core';
|
|
12
|
-
import { O as OptionComponent } from './tft-crispr-forms-index-UAYeTe3L.mjs';
|
|
13
|
-
import * as i6 from '@tft/form-validation-handler';
|
|
14
|
-
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
15
|
-
import { DEFAULT_EMPTY_OPTIONS_MESSAGE, AbstractAutocompleteComponent, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
16
|
-
import * as i2$1 from '@angular/material/form-field';
|
|
17
|
-
|
|
18
|
-
/* eslint-disable @nx/enforce-module-boundaries */
|
|
19
|
-
const defaultConfig = {
|
|
20
|
-
autoActiveFirstOption: true,
|
|
21
|
-
typeDebounceTime: 500,
|
|
22
|
-
emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,
|
|
23
|
-
};
|
|
24
|
-
class AutocompleteFieldComponent extends AbstractAutocompleteComponent {
|
|
25
|
-
constructor() {
|
|
26
|
-
super(...arguments);
|
|
27
|
-
this.defaultConfig = defaultConfig;
|
|
28
|
-
}
|
|
29
|
-
ngOnInit() {
|
|
30
|
-
super.ngOnInit();
|
|
31
|
-
this.clearFieldSubscription =
|
|
32
|
-
this.autocompleteInputControl.valueChanges.subscribe((text) => {
|
|
33
|
-
if (typeof text === 'string' && text?.trim() === '') {
|
|
34
|
-
this.control().setValue(null);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
ngOnDestroy() {
|
|
39
|
-
this.clearFieldSubscription.unsubscribe();
|
|
40
|
-
}
|
|
41
|
-
setControlValue(value) {
|
|
42
|
-
if (this.control() && value) {
|
|
43
|
-
// sets the initial value on the control if one is passed
|
|
44
|
-
this.control().setValue(value.value || '');
|
|
45
|
-
this.autocompleteInputControl.setValue(value.label || '');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The material autocomplete defaults to displaying the options value instead of its label.
|
|
50
|
-
* We only have the value from the selected option to work with, so we have to pass the options
|
|
51
|
-
* through a function called in the template and return the function that the material displayWith
|
|
52
|
-
* input is expecting.
|
|
53
|
-
* @param options the array of options to search for option with corresponding value
|
|
54
|
-
*/
|
|
55
|
-
displayLabel(options) {
|
|
56
|
-
if (this.config().displayWith) {
|
|
57
|
-
return this.config().displayWith(options);
|
|
58
|
-
}
|
|
59
|
-
return (value) => {
|
|
60
|
-
const label = !!options && Array.isArray(options)
|
|
61
|
-
? options.find((option) => JSON.stringify(option.value) === JSON.stringify(value))?.label
|
|
62
|
-
: value;
|
|
63
|
-
return label;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
handleSelect(event) {
|
|
67
|
-
this.control().setValue(event.option.value);
|
|
68
|
-
this.autoInputRef.nativeElement.blur();
|
|
69
|
-
}
|
|
70
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: AutocompleteFieldComponent, isStandalone: true, selector: "crispr-autocomplete-field", viewQueries: [{ propertyName: "autoInput", first: true, predicate: ["autoInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "autoInputRef", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "\n<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field\n [attr.data-testid]=\"config().controlName\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config().controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config().placeholder\"\n [matAutocomplete]=\"auto\"\n role=\"textbox\"\n type=\"textbox\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput>\n\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"displayLabel(options$ | async)\">\n\n @if (options$ | async; as options) {\n @if (options.length > 0) {\n @for (option of options; track option.value) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>\n", styles: [".hidden-error-directive-anchor{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
72
|
-
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteFieldComponent, decorators: [{
|
|
74
|
-
type: Component,
|
|
75
|
-
args: [{ selector: 'crispr-autocomplete-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
76
|
-
CommonModule,
|
|
77
|
-
InfoComponent,
|
|
78
|
-
OptionComponent,
|
|
79
|
-
ReactiveFormsModule,
|
|
80
|
-
FieldContainerComponent,
|
|
81
|
-
MatAutocompleteModule,
|
|
82
|
-
MatInputModule,
|
|
83
|
-
MatOptionModule,
|
|
84
|
-
FormValidationHandlerModule,
|
|
85
|
-
], standalone: true, template: "\n<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field\n [attr.data-testid]=\"config().controlName\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config().controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config().placeholder\"\n [matAutocomplete]=\"auto\"\n role=\"textbox\"\n type=\"textbox\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput>\n\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"displayLabel(options$ | async)\">\n\n @if (options$ | async; as options) {\n @if (options.length > 0) {\n @for (option of options; track option.value) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>\n", styles: [".hidden-error-directive-anchor{display:none}\n"] }]
|
|
86
|
-
}], propDecorators: { autoInput: [{
|
|
87
|
-
type: ViewChild,
|
|
88
|
-
args: ['autoInput', { read: MatAutocompleteTrigger }]
|
|
89
|
-
}], autoInputRef: [{
|
|
90
|
-
type: ViewChild,
|
|
91
|
-
args: ['autoInput']
|
|
92
|
-
}] } });
|
|
93
|
-
|
|
94
|
-
export { AutocompleteFieldComponent as A };
|
|
95
|
-
//# sourceMappingURL=tft-crispr-forms-autocomplete-field.component-ChocHy3F.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-autocomplete-field.component-ChocHy3F.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/autocomplete-field/autocomplete-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/autocomplete-field/autocomplete-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ViewChild,\n ChangeDetectionStrategy,\n ElementRef,\n OnDestroy,\n} from '@angular/core';\nimport {\n MatAutocompleteTrigger,\n MatAutocompleteSelectedEvent,\n MatAutocompleteModule,\n} from '@angular/material/autocomplete';\n\nimport { Subscription } from 'rxjs';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatOptionModule } from '@angular/material/core';\nimport { OptionComponent } from '../option';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\nimport { FieldContainerComponent } from '../field-container';\nimport {\n SelectOption,\n AbstractAutocompleteComponent,\n AutocompleteFieldConfig,\n DEFAULT_EMPTY_OPTIONS_MESSAGE,\n} from '../../utils';\nimport { InfoComponent } from '../info';\n\nconst defaultConfig: Partial<AutocompleteFieldConfig> = {\n autoActiveFirstOption: true,\n typeDebounceTime: 500,\n emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,\n};\n\n@Component({\n selector: 'crispr-autocomplete-field',\n templateUrl: './autocomplete-field.component.html',\n styleUrls: ['./autocomplete-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatAutocompleteModule,\n MatInputModule,\n MatOptionModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class AutocompleteFieldComponent\n extends AbstractAutocompleteComponent<AutocompleteFieldConfig>\n implements OnInit, OnDestroy\n{\n defaultConfig = defaultConfig;\n @ViewChild('autoInput', { read: MatAutocompleteTrigger })\n autoInput: MatAutocompleteTrigger;\n @ViewChild('autoInput') autoInputRef: ElementRef<HTMLInputElement>;\n\n clearFieldSubscription: Subscription;\n\n ngOnInit() {\n super.ngOnInit();\n this.clearFieldSubscription =\n this.autocompleteInputControl.valueChanges.subscribe((text: string) => {\n if (typeof text === 'string' && text?.trim() === '') {\n this.control().setValue(null);\n }\n });\n }\n\n ngOnDestroy() {\n this.clearFieldSubscription.unsubscribe();\n }\n\n setControlValue(value: SelectOption) {\n if (this.control() && value) {\n // sets the initial value on the control if one is passed\n this.control().setValue(value.value || '');\n this.autocompleteInputControl.setValue(value.label || '');\n }\n }\n\n /**\n * The material autocomplete defaults to displaying the options value instead of its label.\n * We only have the value from the selected option to work with, so we have to pass the options\n * through a function called in the template and return the function that the material displayWith\n * input is expecting.\n * @param options the array of options to search for option with corresponding value\n */\n displayLabel(options: SelectOption[]) {\n if (this.config().displayWith) {\n return this.config().displayWith(options);\n }\n return (value: any) => {\n const label: string =\n !!options && Array.isArray(options)\n ? options.find(\n (option) => JSON.stringify(option.value) === JSON.stringify(value)\n )?.label\n : value;\n return label;\n };\n }\n\n handleSelect(event: MatAutocompleteSelectedEvent) {\n this.control().setValue(event.option.value);\n this.autoInputRef.nativeElement.blur();\n }\n}\n","\n<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field\n [attr.data-testid]=\"config().controlName\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config().controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config().placeholder\"\n [matAutocomplete]=\"auto\"\n role=\"textbox\"\n type=\"textbox\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput>\n\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"displayLabel(options$ | async)\">\n\n @if (options$ | async; as options) {\n @if (options.length > 0) {\n @for (option of options; track option.value) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>\n"],"names":["i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAgCA,MAAM,aAAa,GAAqC;AACtD,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,gBAAgB,EAAE,GAAG;AACrB,IAAA,mBAAmB,EAAE,6BAA6B;CACnD;AAoBK,MAAO,0BACX,SAAQ,6BAAsD,CAAA;AAnBhE,IAAA,WAAA,GAAA;;QAsBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAuD9B,IAAA;IAhDC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;AAChB,QAAA,IAAI,CAAC,sBAAsB;YACzB,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,IAAY,KAAI;AACpE,gBAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,E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jB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;;sBAEvD,SAAS;uBAAC,WAAW;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-BQFuEW6x.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/radio-field/radio-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/radio-field/radio-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { MatRadioModule } from '@angular/material/radio';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { RadioFieldConfig, SelectOption, observablifyOptions } from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\n@Component({\n selector: 'crispr-radio-field',\n templateUrl: './radio-field.component.html',\n styleUrls: ['./radio-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatRadioModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class RadioFieldComponent extends CrisprControlComponent<RadioFieldConfig> implements OnInit {\n defaultConfig = {};\n options$: Observable<SelectOption[]>;\n ngOnInit() {\n super.ngOnInit();\n // options$ can be passed as an array, promise that resolves array, or observable that resolves array\n // this functions accounts for all possibilities and converts to observable that resolves array\n this.options$ = observablifyOptions(this.config().options, this.group());\n }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-radio-group\n [formControl]=\"control()\"\n [color]=\"config().color\">\n @for (option of options$ | async; track option) {\n <mat-radio-button class=\"example-radio-button\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n }\n </mat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AA,EAGb,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,mBAAmB;wBACnB,uBAAuB;wBACvB,cAAc;wBACd,2BAA2B;AAC9B,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,0ZAAA,EAAA,MAAA,EAAA,CAAA,kCAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/forms';
|
|
4
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import * as i2 from '@angular/material/form-field';
|
|
6
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
-
import * as i3 from '@angular/material/input';
|
|
8
|
-
import { MatInputModule } from '@angular/material/input';
|
|
9
|
-
import * as i6 from '@tft/form-validation-handler';
|
|
10
|
-
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
11
|
-
import { CrisprControlComponent, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
12
|
-
|
|
13
|
-
/* eslint-disable @nx/enforce-module-boundaries */
|
|
14
|
-
const defaultConfig = { rows: 5 };
|
|
15
|
-
class TextareaFieldComponent extends CrisprControlComponent {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.defaultConfig = defaultConfig;
|
|
19
|
-
}
|
|
20
|
-
ngOnInit() {
|
|
21
|
-
super.ngOnInit();
|
|
22
|
-
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: TextareaFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: TextareaFieldComponent, isStandalone: true, selector: "crispr-textarea-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [attr.data-testid]=\"config().controlName\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <textarea [rows]=\"config().rows\" matInput [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\">\n </textarea>\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && control().valid) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>", styles: [""], dependencies: [{ kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
25
|
-
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: TextareaFieldComponent, decorators: [{
|
|
27
|
-
type: Component,
|
|
28
|
-
args: [{ selector: 'crispr-textarea-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
29
|
-
InfoComponent,
|
|
30
|
-
ReactiveFormsModule,
|
|
31
|
-
FieldContainerComponent,
|
|
32
|
-
MatFormFieldModule,
|
|
33
|
-
MatInputModule,
|
|
34
|
-
FormValidationHandlerModule
|
|
35
|
-
], standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [attr.data-testid]=\"config().controlName\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <textarea [rows]=\"config().rows\" matInput [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\">\n </textarea>\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && control().valid) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>" }]
|
|
36
|
-
}] });
|
|
37
|
-
|
|
38
|
-
export { TextareaFieldComponent };
|
|
39
|
-
//# sourceMappingURL=tft-crispr-forms-index-BZ9V1Ec-.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-BZ9V1Ec-.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/textarea-field/textarea-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/textarea-field/textarea-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { InfoComponent } from '../info';\nimport {\n TextareaFieldConfig,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<TextareaFieldConfig> = { rows: 5 };\n\n@Component({\n selector: 'crispr-textarea-field',\n templateUrl: './textarea-field.component.html',\n styleUrls: ['./textarea-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n InfoComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatFormFieldModule,\n MatInputModule,\n FormValidationHandlerModule\n ],\n standalone: true\n})\nexport class TextareaFieldComponent\n extends CrisprControlComponent<TextareaFieldConfig>\n implements OnInit\n{\n defaultConfig = defaultConfig;\n\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [attr.data-testid]=\"config().controlName\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <textarea [rows]=\"config().rows\" matInput [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\">\n </textarea>\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && control().valid) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>"],"names":["i4"],"mappings":";;;;;;;;;;;;AAAA;AAcA,MAAM,aAAa,GAAiC,EAAE,IAAI,EAAE,CAAC,EAAE;AAiBzD,MAAO,sBACX,SAAQ,sBAA2C,CAAA;AAhBrD,IAAA,WAAA,GAAA;;QAmBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAK9B,IAAA;IAHC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;IAClB;8GARW,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC/BnC,mvBAYyB,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDUjB,aAAa,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACb,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,EAAA,EAAA,IAAA,EA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AA,EAAA,IAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,+CAAA,EAAA,MAAA,EAAA,CAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAClB,cAAc,iYACd,2BAA2B,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,sBAAA,EAAA,QAAA,EAAA,kCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,8BAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAItB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAflC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAAA,eAAA,EAGhB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,aAAa;wBACb,mBAAmB;wBACnB,uBAAuB;wBACvB,kBAAkB;wBAClB,cAAc;wBACd;AACH,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,mvBAAA,EAAA;;;;;"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import * as i3 from '@angular/material/input';
|
|
4
|
-
import { MatInputModule } from '@angular/material/input';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import * as i2 from '@angular/material/form-field';
|
|
8
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
9
|
-
import * as i6 from '@tft/form-validation-handler';
|
|
10
|
-
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
11
|
-
import { CrisprControlComponent, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
12
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
13
|
-
|
|
14
|
-
/* eslint-disable @nx/enforce-module-boundaries */
|
|
15
|
-
class InputFieldComponent extends CrisprControlComponent {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this.defaultConfig = { inputType: 'text' };
|
|
19
|
-
}
|
|
20
|
-
ngOnInit() {
|
|
21
|
-
super.ngOnInit();
|
|
22
|
-
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: InputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: InputFieldComponent, isStandalone: true, selector: "crispr-input-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n <mat-form-field\n [attr.data-testid]=\"config().controlName\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n <mat-label>\n {{config().label}}\n </mat-label>\n <input\n [type]=\"config().inputType\"\n matInput\n [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [maxlength]=\"config().maxLength\"\n [step]=\"config().step\"\n [autofocus]=\"config().autofocus\"\n [pattern]=\"config().pattern\"\n [spellcheck]=\"config().spellcheck\"\n [autocomplete]=\"config().autoComplete\"\n [autocapitalize]=\"config().autoCapitalize\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n\n</crispr-field-container>\n", styles: [""], dependencies: [{ kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "ngmodule", type: MatIconModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
25
|
-
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: InputFieldComponent, decorators: [{
|
|
27
|
-
type: Component,
|
|
28
|
-
args: [{ selector: 'crispr-input-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
29
|
-
InfoComponent,
|
|
30
|
-
ReactiveFormsModule,
|
|
31
|
-
FieldContainerComponent,
|
|
32
|
-
MatFormFieldModule,
|
|
33
|
-
MatInputModule,
|
|
34
|
-
FormValidationHandlerModule,
|
|
35
|
-
MatIconModule
|
|
36
|
-
], template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n <mat-form-field\n [attr.data-testid]=\"config().controlName\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n <mat-label>\n {{config().label}}\n </mat-label>\n <input\n [type]=\"config().inputType\"\n matInput\n [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [maxlength]=\"config().maxLength\"\n [step]=\"config().step\"\n [autofocus]=\"config().autofocus\"\n [pattern]=\"config().pattern\"\n [spellcheck]=\"config().spellcheck\"\n [autocomplete]=\"config().autoComplete\"\n [autocapitalize]=\"config().autoCapitalize\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n\n</crispr-field-container>\n" }]
|
|
37
|
-
}], ctorParameters: () => [] });
|
|
38
|
-
|
|
39
|
-
export { InputFieldComponent };
|
|
40
|
-
//# sourceMappingURL=tft-crispr-forms-index-BkCdLt5V.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-BkCdLt5V.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/input-field/input-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/input-field/input-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { InfoComponent } from '../info';\nimport { InputFieldConfig } from '../../utils';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\n@Component({\n selector: 'crispr-input-field',\n templateUrl: './input-field.component.html',\n styleUrls: ['./input-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n InfoComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatFormFieldModule,\n MatInputModule,\n FormValidationHandlerModule,\n MatIconModule\n ]\n})\nexport class InputFieldComponent extends CrisprControlComponent<InputFieldConfig> implements OnInit {\n\n defaultConfig: Partial<InputFieldConfig> = {inputType: 'text'};\n constructor() {\n super();\n }\n\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n <mat-form-field\n [attr.data-testid]=\"config().controlName\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n <mat-label>\n {{config().label}}\n </mat-label>\n <input\n [type]=\"config().inputType\"\n matInput\n [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [maxlength]=\"config().maxLength\"\n [step]=\"config().step\"\n [autofocus]=\"config().autofocus\"\n [pattern]=\"config().pattern\"\n [spellcheck]=\"config().spellcheck\"\n [autocomplete]=\"config().autoComplete\"\n [autocapitalize]=\"config().autoCapitalize\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n\n</crispr-field-container>\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AA4BM,MAAO,mBAAoB,SAAQ,sBAAwC,CAAA;AAG/E,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AAFT,QAAA,IAAA,CAAA,aAAa,GAA8B,EAAC,SAAS,EAAE,MAAM,EAAC;IAG9D;IAEA,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;IAClB;8GATW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5BhC,8oCAiCA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDdM,aAAa,yEACb,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,W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wBACb,mBAAmB;wBACnB,uBAAuB;wBACvB,kBAAkB;wBAClB,cAAc;wBACd,2BAA2B;wBAC3B;AACD,qBAAA,EAAA,QAAA,EAAA,8oCAAA,EAAA;;;;;"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { tap, map } from 'rxjs/operators';
|
|
4
|
-
import * as i2 from '@angular/material/autocomplete';
|
|
5
|
-
import { MatAutocompleteModule, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
6
|
-
import { BehaviorSubject, combineLatest } from 'rxjs';
|
|
7
|
-
import { ENTER } from '@angular/cdk/keycodes';
|
|
8
|
-
import * as i5 from '@angular/material/chips';
|
|
9
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
10
|
-
import * as i1$1 from '@angular/common';
|
|
11
|
-
import { CommonModule } from '@angular/common';
|
|
12
|
-
import * as i1 from '@angular/forms';
|
|
13
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
14
|
-
import { MatOptionModule } from '@angular/material/core';
|
|
15
|
-
import * as i3 from '@angular/material/input';
|
|
16
|
-
import { MatInputModule } from '@angular/material/input';
|
|
17
|
-
import { O as OptionComponent } from './tft-crispr-forms-index-UAYeTe3L.mjs';
|
|
18
|
-
import * as i2$2 from '@angular/material/icon';
|
|
19
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
20
|
-
import { DEFAULT_EMPTY_OPTIONS_MESSAGE, AbstractAutocompleteComponent, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
21
|
-
import * as i6 from '@tft/form-validation-handler';
|
|
22
|
-
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
23
|
-
import * as i2$1 from '@angular/material/form-field';
|
|
24
|
-
|
|
25
|
-
/* eslint-disable @nx/enforce-module-boundaries */
|
|
26
|
-
const defaultConfig = {
|
|
27
|
-
chipsSelectable: true,
|
|
28
|
-
areChipsRemovable: true,
|
|
29
|
-
tabToSelect: true,
|
|
30
|
-
autoActiveFirstOption: true,
|
|
31
|
-
imageUrlParam: 'image',
|
|
32
|
-
typeDebounceTime: 500,
|
|
33
|
-
allowDuplicates: false,
|
|
34
|
-
duplicateCompareFunction: (chip, option) => chip.value === option.value,
|
|
35
|
-
separatorKeyCodes: [ENTER],
|
|
36
|
-
emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,
|
|
37
|
-
};
|
|
38
|
-
class AutocompleteChiplistFieldComponent extends AbstractAutocompleteComponent {
|
|
39
|
-
constructor() {
|
|
40
|
-
super(...arguments);
|
|
41
|
-
this.defaultConfig = defaultConfig;
|
|
42
|
-
this.chips$ = new BehaviorSubject([]);
|
|
43
|
-
this.selectedChip = null;
|
|
44
|
-
this.controlValue$ = this.chips$.pipe(tap((chips) => {
|
|
45
|
-
this.control().setValue(chips.map((chip) => chip.value));
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
ngOnInit() {
|
|
49
|
-
super.ngOnInit();
|
|
50
|
-
this.remainingOptions$ = combineLatest([this.chips$, this.options$]).pipe(map(([chips, options]) => {
|
|
51
|
-
return this.config().allowDuplicates
|
|
52
|
-
? options
|
|
53
|
-
: options?.filter((option) => {
|
|
54
|
-
return !chips.some((chip) => this.config().duplicateCompareFunction(chip, option));
|
|
55
|
-
});
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
setControlValue(value) {
|
|
59
|
-
if (value) {
|
|
60
|
-
this.chips$.next(value);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
// handles mat selecting
|
|
64
|
-
handleSelect(event) {
|
|
65
|
-
const selectedOption = event.option.value;
|
|
66
|
-
this.chips$.next([...this.chips$.value, selectedOption]);
|
|
67
|
-
this.chipInputRef.nativeElement.value = '';
|
|
68
|
-
this.autocompleteInputControl.setValue('');
|
|
69
|
-
// setTimeout needed because the panel thinks it's still open at this point
|
|
70
|
-
setTimeout(() => this.chipInput.openPanel());
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* To follow ARIA standards we want to select the active option on blur.
|
|
74
|
-
* matChipInputAddOnBlur should do this but it causes buggy behaviour
|
|
75
|
-
* @param event blur event that triggers the handle blur
|
|
76
|
-
*/
|
|
77
|
-
handleTab(_event) {
|
|
78
|
-
if (this.chipInput.activeOption &&
|
|
79
|
-
(this.config().tabToSelect || this.config().addChipOnBlur)) {
|
|
80
|
-
const chip = this.chipInput.activeOption.value;
|
|
81
|
-
this.chips$.next([...this.chips$.value, chip]);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Handles selection via key tokens passed through separatorKeyCodes property
|
|
86
|
-
* NOTE: If TAB is used focus does not move on to next component
|
|
87
|
-
* @param event
|
|
88
|
-
*/
|
|
89
|
-
handleTokenEnd(event) {
|
|
90
|
-
if (this.chipInput.activeOption) {
|
|
91
|
-
this.chipInput.activeOption.select();
|
|
92
|
-
}
|
|
93
|
-
event.chipInput?.clear();
|
|
94
|
-
}
|
|
95
|
-
mapToLabel(option) {
|
|
96
|
-
return option ? option.label : '';
|
|
97
|
-
}
|
|
98
|
-
removeChip(removedChip) {
|
|
99
|
-
const remainingChips = this.chips$.value.filter((chip) => chip !== removedChip);
|
|
100
|
-
this.chips$.next(remainingChips);
|
|
101
|
-
}
|
|
102
|
-
highlightChip(chip) {
|
|
103
|
-
if (this.config().chipsSelectable) {
|
|
104
|
-
this.selectedChip = chip;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
blurField() {
|
|
108
|
-
this.selectedChip = null;
|
|
109
|
-
}
|
|
110
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteChiplistFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
111
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: AutocompleteChiplistFieldComponent, isStandalone: true, selector: "crispr-autocomplete-chiplist-field", viewQueries: [{ propertyName: "chipInput", first: true, predicate: ["autoInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "chipInputRef", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [attr.data-testid]=\"config().controlName\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <mat-chip-grid #chipList>\n <!-- [selectable]=\"config().chipsSelectable\" -->\n @for (chip of controlValue$ | async; track chip; let i = $index) {\n <mat-chip-row class=\"refinement-chip\" [removable]=\"config().areChipsRemovable\"\n [highlighted]=\"chip?.value === selectedChip?.value\" (click)=\"highlightChip(chip)\" (removed)=\"removeChip(chip)\">\n @if (chip.imageUrl) {<img [src]=\"chip.imageUrl\" matChipAvatar alt=\"image of {{chip.label}}\">}\n {{chip.label}}\n @if (config().areChipsRemovable) {<mat-icon matChipRemove>cancel</mat-icon>}\n </mat-chip-row>\n }\n <input class=\"hidden-error-directive-anchor\" (blur)=\"blurField()\" [formControlName]=\"config().controlName\"\n type=\"text\" />\n\n <input matInput [formControl]=\"autocompleteInputControl\" [placeholder]=\"config().placeholder\"\n [matChipInputFor]=\"chipList\" [matAutocomplete]=\"auto\" (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config().separatorKeyCodes\" (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\" type=\"text\" autocapitalize=\"off\" autocorrect=\"off\" spellcheck=\"false\" (blur)=\"blurField()\"\n #autoInput />\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n </mat-chip-grid>\n <mat-autocomplete #auto=\"matAutocomplete\" [autoActiveFirstOption]=\"this.config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\" [displayWith]=\"mapToLabel\">\n @if (remainingOptions$ | async; as remainingOptions) {\n @if (remainingOptions.length > 0) {\n @for (option of remainingOptions$ | async; track option.value) {\n <mat-option [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "directive", type: i5.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
112
|
-
}
|
|
113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteChiplistFieldComponent, decorators: [{
|
|
114
|
-
type: Component,
|
|
115
|
-
args: [{ selector: 'crispr-autocomplete-chiplist-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
116
|
-
CommonModule,
|
|
117
|
-
InfoComponent,
|
|
118
|
-
OptionComponent,
|
|
119
|
-
ReactiveFormsModule,
|
|
120
|
-
FieldContainerComponent,
|
|
121
|
-
MatAutocompleteModule,
|
|
122
|
-
MatInputModule,
|
|
123
|
-
MatOptionModule,
|
|
124
|
-
MatChipsModule,
|
|
125
|
-
MatIconModule,
|
|
126
|
-
FormValidationHandlerModule,
|
|
127
|
-
], standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [attr.data-testid]=\"config().controlName\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <mat-chip-grid #chipList>\n <!-- [selectable]=\"config().chipsSelectable\" -->\n @for (chip of controlValue$ | async; track chip; let i = $index) {\n <mat-chip-row class=\"refinement-chip\" [removable]=\"config().areChipsRemovable\"\n [highlighted]=\"chip?.value === selectedChip?.value\" (click)=\"highlightChip(chip)\" (removed)=\"removeChip(chip)\">\n @if (chip.imageUrl) {<img [src]=\"chip.imageUrl\" matChipAvatar alt=\"image of {{chip.label}}\">}\n {{chip.label}}\n @if (config().areChipsRemovable) {<mat-icon matChipRemove>cancel</mat-icon>}\n </mat-chip-row>\n }\n <input class=\"hidden-error-directive-anchor\" (blur)=\"blurField()\" [formControlName]=\"config().controlName\"\n type=\"text\" />\n\n <input matInput [formControl]=\"autocompleteInputControl\" [placeholder]=\"config().placeholder\"\n [matChipInputFor]=\"chipList\" [matAutocomplete]=\"auto\" (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config().separatorKeyCodes\" (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\" type=\"text\" autocapitalize=\"off\" autocorrect=\"off\" spellcheck=\"false\" (blur)=\"blurField()\"\n #autoInput />\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n </mat-chip-grid>\n <mat-autocomplete #auto=\"matAutocomplete\" [autoActiveFirstOption]=\"this.config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\" [displayWith]=\"mapToLabel\">\n @if (remainingOptions$ | async; as remainingOptions) {\n @if (remainingOptions.length > 0) {\n @for (option of remainingOptions$ | async; track option.value) {\n <mat-option [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"] }]
|
|
128
|
-
}], propDecorators: { chipInput: [{
|
|
129
|
-
type: ViewChild,
|
|
130
|
-
args: ['autoInput', { read: MatAutocompleteTrigger }]
|
|
131
|
-
}], chipInputRef: [{
|
|
132
|
-
type: ViewChild,
|
|
133
|
-
args: ['autoInput']
|
|
134
|
-
}] } });
|
|
135
|
-
|
|
136
|
-
export { AutocompleteChiplistFieldComponent };
|
|
137
|
-
//# sourceMappingURL=tft-crispr-forms-index-Bypm5YtY.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-Bypm5YtY.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n ViewChild,\n ElementRef,\n} from '@angular/core';\nimport { map, tap } from 'rxjs/operators';\nimport {\n MatAutocompleteModule,\n MatAutocompleteSelectedEvent,\n MatAutocompleteTrigger,\n} from '@angular/material/autocomplete';\nimport { Observable, BehaviorSubject, combineLatest } from 'rxjs';\nimport { ENTER } from '@angular/cdk/keycodes';\n\nimport { MatChipInputEvent, MatChipsModule } from '@angular/material/chips';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatOptionModule } from '@angular/material/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { OptionComponent } from '../option';\nimport { MatIconModule } from '@angular/material/icon';\nimport {\n AutocompleteChiplistFieldConfig,\n AbstractAutocompleteComponent,\n DEFAULT_EMPTY_OPTIONS_MESSAGE,\n SelectOption,\n} from '../../utils';\nimport { FieldContainerComponent } from '../field-container';\nimport { InfoComponent } from '../info';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\nconst defaultConfig: Partial<AutocompleteChiplistFieldConfig> = {\n chipsSelectable: true,\n areChipsRemovable: true,\n tabToSelect: true,\n autoActiveFirstOption: true,\n imageUrlParam: 'image',\n typeDebounceTime: 500,\n allowDuplicates: false,\n duplicateCompareFunction: (chip, option) => chip.value === option.value,\n separatorKeyCodes: [ENTER],\n emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,\n};\n\n@Component({\n selector: 'crispr-autocomplete-chiplist-field',\n templateUrl: './autocomplete-chiplist-field.component.html',\n styleUrls: ['./autocomplete-chiplist-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatAutocompleteModule,\n MatInputModule,\n MatOptionModule,\n MatChipsModule,\n MatIconModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class AutocompleteChiplistFieldComponent\n extends AbstractAutocompleteComponent<AutocompleteChiplistFieldConfig>\n implements OnInit\n{\n defaultConfig = defaultConfig;\n chips$ = new BehaviorSubject<SelectOption[]>([]);\n remainingOptions$: Observable<SelectOption[]>;\n selectedChip: SelectOption = null;\n controlValue$ = this.chips$.pipe(\n tap((chips) => {\n this.control().setValue(chips.map((chip) => chip.value));\n })\n );\n\n // We need use ViewChild twice on the same template ref to access as different types\n // - the MatAutocompleteTrigger is used to for selecting value on tab\n // - the ElementRef<HTMLInputElement> is used to clear the value from input element on selection\n @ViewChild('autoInput', { read: MatAutocompleteTrigger })\n chipInput: MatAutocompleteTrigger;\n @ViewChild('autoInput') chipInputRef: ElementRef<HTMLInputElement>;\n\n ngOnInit() {\n super.ngOnInit();\n this.remainingOptions$ = combineLatest([this.chips$, this.options$]).pipe(\n map(([chips, options]) => {\n return this.config().allowDuplicates\n ? options\n : options?.filter((option) => {\n return !chips.some((chip) =>\n this.config().duplicateCompareFunction(chip, option)\n );\n });\n })\n );\n }\n\n setControlValue(value: SelectOption[]) {\n if (value) {\n this.chips$.next(value);\n }\n }\n\n // handles mat selecting\n handleSelect(event: MatAutocompleteSelectedEvent) {\n const selectedOption: SelectOption = event.option.value as SelectOption;\n this.chips$.next([...this.chips$.value, selectedOption]);\n this.chipInputRef.nativeElement.value = '';\n this.autocompleteInputControl.setValue('');\n // setTimeout needed because the panel thinks it's still open at this point\n setTimeout(() => this.chipInput.openPanel());\n }\n\n /**\n * To follow ARIA standards we want to select the active option on blur.\n * matChipInputAddOnBlur should do this but it causes buggy behaviour\n * @param event blur event that triggers the handle blur\n */\n handleTab(_event: FocusEvent) {\n if (\n this.chipInput.activeOption &&\n (this.config().tabToSelect || this.config().addChipOnBlur)\n ) {\n const chip = this.chipInput.activeOption.value;\n this.chips$.next([...this.chips$.value, chip]);\n }\n }\n\n /**\n * Handles selection via key tokens passed through separatorKeyCodes property\n * NOTE: If TAB is used focus does not move on to next component\n * @param event\n */\n handleTokenEnd(event: MatChipInputEvent) {\n if (this.chipInput.activeOption) {\n this.chipInput.activeOption.select();\n }\n event.chipInput?.clear();\n }\n\n mapToLabel(option: SelectOption) {\n return option ? option.label : '';\n }\n\n removeChip(removedChip: SelectOption) {\n const remainingChips: SelectOption[] = this.chips$.value.filter(\n (chip) => chip !== removedChip\n );\n this.chips$.next(remainingChips);\n }\n\n highlightChip(chip: SelectOption) {\n if(this.config().chipsSelectable) {\n this.selectedChip = chip\n }\n }\n \n blurField() {\n this.selectedChip = null;\n }\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [attr.data-testid]=\"config().controlName\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <mat-chip-grid #chipList>\n <!-- [selectable]=\"config().chipsSelectable\" -->\n @for (chip of controlValue$ | async; track chip; let i = $index) {\n <mat-chip-row class=\"refinement-chip\" [removable]=\"config().areChipsRemovable\"\n [highlighted]=\"chip?.value === selectedChip?.value\" (click)=\"highlightChip(chip)\" (removed)=\"removeChip(chip)\">\n @if (chip.imageUrl) {<img [src]=\"chip.imageUrl\" matChipAvatar alt=\"image of {{chip.label}}\">}\n {{chip.label}}\n @if (config().areChipsRemovable) {<mat-icon matChipRemove>cancel</mat-icon>}\n </mat-chip-row>\n }\n <input class=\"hidden-error-directive-anchor\" (blur)=\"blurField()\" [formControlName]=\"config().controlName\"\n type=\"text\" />\n\n <input matInput [formControl]=\"autocompleteInputControl\" [placeholder]=\"config().placeholder\"\n [matChipInputFor]=\"chipList\" [matAutocomplete]=\"auto\" (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config().separatorKeyCodes\" (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\" type=\"text\" autocapitalize=\"off\" autocorrect=\"off\" spellcheck=\"false\" (blur)=\"blurField()\"\n #autoInput />\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n </mat-chip-grid>\n <mat-autocomplete #auto=\"matAutocomplete\" [autoActiveFirstOption]=\"this.config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\" [displayWith]=\"mapToLabel\">\n @if (remainingOptions$ | async; as remainingOptions) {\n @if (remainingOptions.length > 0) {\n @for (option of remainingOptions$ | async; track option.value) {\n <mat-option [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>"],"names":["i4","i6","i7","i8"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAkCA,MAAM,aAAa,GAA6C;AAC9D,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,aAAa,EAAE,OAAO;AACtB,IAAA,gBAAgB,EAAE,GAAG;AACrB,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,wBAAwB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK;IACvE,iBAAiB,EAAE,CAAC,KAAK,CAAC;AAC1B,IAAA,mBAAmB,EAAE,6BAA6B;CACnD;AAsBK,MAAO,kCACX,SAAQ,6BAA8D,CAAA;AArBxE,IAAA,WAAA,GAAA;;QAwBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAC7B,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAAiB,EAAE,CAAC;QAEhD,IAAA,CAAA,YAAY,GAAiB,IAAI;AACjC,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAC9B,GAAG,CAAC,CAAC,KAAK,KAAI;YACZ,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1D,CAAC,CAAC,CACH;AAuFF,IAAA;IA9EC,QAAQ,GAAA;Q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E;;sBAEvD,SAAS;uBAAC,WAAW;;;;;"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import * as i1$1 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import { MatOptionModule } from '@angular/material/core';
|
|
8
|
-
import * as i3 from '@angular/material/input';
|
|
9
|
-
import { MatInputModule } from '@angular/material/input';
|
|
10
|
-
import * as i3$1 from '@angular/material/select';
|
|
11
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
12
|
-
import { combineLatest } from 'rxjs';
|
|
13
|
-
import { startWith } from 'rxjs/operators';
|
|
14
|
-
import { O as OptionComponent } from './tft-crispr-forms-index-UAYeTe3L.mjs';
|
|
15
|
-
import * as i6 from '@tft/form-validation-handler';
|
|
16
|
-
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
17
|
-
import { CrisprControlComponent, observablifyOptions, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
18
|
-
import * as i2 from '@angular/material/form-field';
|
|
19
|
-
import * as i2$1 from '@angular/material/autocomplete';
|
|
20
|
-
|
|
21
|
-
/* eslint-disable @nx/enforce-module-boundaries */
|
|
22
|
-
const defaultConfig = {};
|
|
23
|
-
class UnitConversionFieldComponent extends CrisprControlComponent {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
this.defaultConfig = defaultConfig;
|
|
27
|
-
this.displayValueControl = new FormControl();
|
|
28
|
-
this.unitSelectControl = new FormControl();
|
|
29
|
-
}
|
|
30
|
-
ngOnInit() {
|
|
31
|
-
const config = this.config();
|
|
32
|
-
super.ngOnInit();
|
|
33
|
-
// TODO: Validators need work. validation is tricky because the input needs to be validated against but the validator will compare against the controls value
|
|
34
|
-
// this.displayValueControl.setValidators(this.config.validators);
|
|
35
|
-
const controlValuePipeline = [
|
|
36
|
-
this.displayValueControl.valueChanges.pipe(startWith(this.displayValueControl.value)),
|
|
37
|
-
];
|
|
38
|
-
// setup all required pieces when showing a field for selecting units
|
|
39
|
-
if (config.showUnitSelect === true) {
|
|
40
|
-
this.unitOptions$ = observablifyOptions(config.selectableUnits, this.group());
|
|
41
|
-
controlValuePipeline.push(this.unitSelectControl.valueChanges.pipe(startWith(config?.initialDisplayUnit || null)));
|
|
42
|
-
this.unitSelectControl.setValue(config?.initialDisplayUnit || null);
|
|
43
|
-
}
|
|
44
|
-
this.transformationSubscription = combineLatest(controlValuePipeline).subscribe(([displayValue, unitValue]) => {
|
|
45
|
-
const computedValue = this.config().storedValueConversion(displayValue, unitValue);
|
|
46
|
-
this.control().setValue(computedValue);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
ngOnDestroy() {
|
|
50
|
-
this.transformationSubscription.unsubscribe();
|
|
51
|
-
}
|
|
52
|
-
setInitialDisplayValue(storedValue, unit) {
|
|
53
|
-
const initialDisplayValue = this.config().initialDisplayValueConversion(storedValue || null, unit);
|
|
54
|
-
this.displayValueControl.setValue(initialDisplayValue);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* We override the 'setControlValue' we inherited from crisprControlMixin and add our custom logic,
|
|
58
|
-
* This function gets called onInit because were object oriented. it's so great, so great that I'm
|
|
59
|
-
* typing a paragraph to explain what the hell is going on...
|
|
60
|
-
* @param value the initial value for the control passed down from the form components input
|
|
61
|
-
*/
|
|
62
|
-
setControlValue(value) {
|
|
63
|
-
const config = this.config();
|
|
64
|
-
const initialUnitValue = config.showUnitSelect
|
|
65
|
-
? config?.initialDisplayUnit
|
|
66
|
-
: null;
|
|
67
|
-
this.setInitialDisplayValue(value, initialUnitValue);
|
|
68
|
-
}
|
|
69
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: UnitConversionFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: UnitConversionFieldComponent, isStandalone: true, selector: "crispr-unit-conversion-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [attr.data-testid]=\"config().controlName\" [style.width.%]=\"config().showUnitSelect ? 60 : 100\" class=\"number-field\" [color]=\"config().color\"\n [appearance]=\"config().appearance\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input type=\"number\" matInput [formControl]=\"displayValueControl\" [placeholder]=\"config().placeholder\"\n [min]=\"config().min\" [max]=\"config().max\" [step]=\"config().step\" [autofocus]=\"config().autofocus\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n </mat-form-field>\n\n @if (config().showUnitSelect) {\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\" class=\"unit-field\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select #selectField [formControl]=\"unitSelectControl\">\n @for (option of unitOptions$ | async; track option) {\n <mat-option [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n </mat-select>\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n </mat-form-field>\n }\n\n</crispr-field-container>", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
71
|
-
}
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: UnitConversionFieldComponent, decorators: [{
|
|
73
|
-
type: Component,
|
|
74
|
-
args: [{ selector: 'crispr-unit-conversion-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
75
|
-
CommonModule,
|
|
76
|
-
InfoComponent,
|
|
77
|
-
OptionComponent,
|
|
78
|
-
ReactiveFormsModule,
|
|
79
|
-
FieldContainerComponent,
|
|
80
|
-
MatInputModule,
|
|
81
|
-
MatSelectModule,
|
|
82
|
-
MatOptionModule,
|
|
83
|
-
FormValidationHandlerModule,
|
|
84
|
-
], standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [attr.data-testid]=\"config().controlName\" [style.width.%]=\"config().showUnitSelect ? 60 : 100\" class=\"number-field\" [color]=\"config().color\"\n [appearance]=\"config().appearance\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input type=\"number\" matInput [formControl]=\"displayValueControl\" [placeholder]=\"config().placeholder\"\n [min]=\"config().min\" [max]=\"config().max\" [step]=\"config().step\" [autofocus]=\"config().autofocus\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n </mat-form-field>\n\n @if (config().showUnitSelect) {\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\" class=\"unit-field\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select #selectField [formControl]=\"unitSelectControl\">\n @for (option of unitOptions$ | async; track option) {\n <mat-option [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n </mat-select>\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n </mat-form-field>\n }\n\n</crispr-field-container>", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"] }]
|
|
85
|
-
}] });
|
|
86
|
-
|
|
87
|
-
export { UnitConversionFieldComponent };
|
|
88
|
-
//# sourceMappingURL=tft-crispr-forms-index-CFwkbxFk.mjs.map
|