@tft/crispr-forms 21.0.17 → 21.1.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.
Files changed (39) hide show
  1. package/README.md +21 -4
  2. package/fesm2022/tft-crispr-forms.mjs +2071 -1
  3. package/fesm2022/tft-crispr-forms.mjs.map +1 -1
  4. package/package.json +7 -7
  5. package/types/tft-crispr-forms.d.ts +238 -212
  6. package/fesm2022/tft-crispr-forms-autocomplete-field.component-BgQZYqB0.mjs +0 -95
  7. package/fesm2022/tft-crispr-forms-autocomplete-field.component-BgQZYqB0.mjs.map +0 -1
  8. package/fesm2022/tft-crispr-forms-index-3aw152gK.mjs +0 -18
  9. package/fesm2022/tft-crispr-forms-index-3aw152gK.mjs.map +0 -1
  10. package/fesm2022/tft-crispr-forms-index-BFzx83fR.mjs +0 -39
  11. package/fesm2022/tft-crispr-forms-index-BFzx83fR.mjs.map +0 -1
  12. package/fesm2022/tft-crispr-forms-index-BMZQakFs.mjs +0 -88
  13. package/fesm2022/tft-crispr-forms-index-BMZQakFs.mjs.map +0 -1
  14. package/fesm2022/tft-crispr-forms-index-B_lhA83w.mjs +0 -2
  15. package/fesm2022/tft-crispr-forms-index-B_lhA83w.mjs.map +0 -1
  16. package/fesm2022/tft-crispr-forms-index-BawhjTMp.mjs +0 -183
  17. package/fesm2022/tft-crispr-forms-index-BawhjTMp.mjs.map +0 -1
  18. package/fesm2022/tft-crispr-forms-index-CXXD0vdZ.mjs +0 -172
  19. package/fesm2022/tft-crispr-forms-index-CXXD0vdZ.mjs.map +0 -1
  20. package/fesm2022/tft-crispr-forms-index-CmVahfkJ.mjs +0 -24
  21. package/fesm2022/tft-crispr-forms-index-CmVahfkJ.mjs.map +0 -1
  22. package/fesm2022/tft-crispr-forms-index-CoUwTugQ.mjs +0 -309
  23. package/fesm2022/tft-crispr-forms-index-CoUwTugQ.mjs.map +0 -1
  24. package/fesm2022/tft-crispr-forms-index-D99OHDPc.mjs +0 -40
  25. package/fesm2022/tft-crispr-forms-index-D99OHDPc.mjs.map +0 -1
  26. package/fesm2022/tft-crispr-forms-index-DYWkX7D3.mjs +0 -83
  27. package/fesm2022/tft-crispr-forms-index-DYWkX7D3.mjs.map +0 -1
  28. package/fesm2022/tft-crispr-forms-index-DysioRya.mjs +0 -39
  29. package/fesm2022/tft-crispr-forms-index-DysioRya.mjs.map +0 -1
  30. package/fesm2022/tft-crispr-forms-index-GlYQbbbv.mjs +0 -36
  31. package/fesm2022/tft-crispr-forms-index-GlYQbbbv.mjs.map +0 -1
  32. package/fesm2022/tft-crispr-forms-index-UX-Wdyk1.mjs +0 -40
  33. package/fesm2022/tft-crispr-forms-index-UX-Wdyk1.mjs.map +0 -1
  34. package/fesm2022/tft-crispr-forms-index-bTdYHJPk.mjs +0 -68
  35. package/fesm2022/tft-crispr-forms-index-bTdYHJPk.mjs.map +0 -1
  36. package/fesm2022/tft-crispr-forms-index-kah2HT_N.mjs +0 -54
  37. package/fesm2022/tft-crispr-forms-index-kah2HT_N.mjs.map +0 -1
  38. package/fesm2022/tft-crispr-forms-tft-crispr-forms-8liD7eof.mjs +0 -943
  39. package/fesm2022/tft-crispr-forms-tft-crispr-forms-8liD7eof.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-3aw152gK.mjs';
13
- import * as i6 from '@tft/form-validation-handler';
14
- import { FormValidationHandlerModule } from '@tft/form-validation-handler';
15
- import { D as DEFAULT_EMPTY_OPTIONS_MESSAGE, A as AbstractAutocompleteComponent, I as InfoComponent, F as FieldContainerComponent } from './tft-crispr-forms-tft-crispr-forms-8liD7eof.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]=\"testId()\"\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}crispr-info[matSuffix]{margin-right:.75em}\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]=\"testId()\"\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}crispr-info[matSuffix]{margin-right:.75em}\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-BgQZYqB0.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tft-crispr-forms-autocomplete-field.component-BgQZYqB0.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]=\"testId()\"\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,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;oBACnD,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC/B;AACF,YAAA,CAAC,CAAC;IACN;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,sBAAsB,CAAC,WAAW,EAAE;IAC3C;AAEA,IAAA,eAAe,CAAC,KAAmB,EAAA;AACjC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AA,EAAA,+CAAA,EAAA,MAAA,EAAA,CAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACd,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACf,2BAA2B,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,sBAAA,EAAA,QAAA,EAAA,kCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,8BAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAC,IAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAItB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAlBtC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,2BAA2B,EAAA,eAAA,EAGpB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,aAAa;wBACb,eAAe;wBACf,mBAAmB;wBACnB,uBAAuB;wBACvB,qBAAqB;wBACrB,cAAc;wBACd,eAAe;wBACf,2BAA2B;AAC9B,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,63DAAA,EAAA,MAAA,EAAA,CAAA,0FAAA,CAAA,EAAA;;sBAOjB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;;sBAEvD,SAAS;uBAAC,WAAW;;;;;"}
@@ -1,18 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { input, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { I as InfoComponent } from './tft-crispr-forms-tft-crispr-forms-8liD7eof.mjs';
4
-
5
- class OptionComponent {
6
- constructor() {
7
- this.option = input.required(...(ngDevMode ? [{ debugName: "option" }] : []));
8
- }
9
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: OptionComponent, isStandalone: true, selector: "crispr-option", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div>\n @if (option().imageUrl) {\n <img\n [src]=\"option().imageUrl\"\n alt=\"image of {{option().label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n }\n {{option().label}}\n</div>\n\n@if (option().info; as info) {\n <crispr-info [info]=\"info\">\n </crispr-info>\n}\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"], dependencies: [{ kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
11
- }
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: OptionComponent, decorators: [{
13
- type: Component,
14
- args: [{ selector: 'crispr-option', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [InfoComponent], template: "<div>\n @if (option().imageUrl) {\n <img\n [src]=\"option().imageUrl\"\n alt=\"image of {{option().label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n }\n {{option().label}}\n</div>\n\n@if (option().info; as info) {\n <crispr-info [info]=\"info\">\n </crispr-info>\n}\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"] }]
15
- }], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }] } });
16
-
17
- export { OptionComponent as O };
18
- //# sourceMappingURL=tft-crispr-forms-index-3aw152gK.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tft-crispr-forms-index-3aw152gK.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/option/option.component.ts","../../../../libs/crispr-forms/src/lib/ui/option/option.component.html"],"sourcesContent":["\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { InfoComponent } from '../info';\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { SelectOption } from '../../utils';\n\n@Component({\n selector: 'crispr-option',\n templateUrl: './option.component.html',\n styleUrls: ['./option.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [InfoComponent]\n})\nexport class OptionComponent {\n option = input.required<SelectOption>();\n}\n","<div>\n @if (option().imageUrl) {\n <img\n [src]=\"option().imageUrl\"\n alt=\"image of {{option().label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n }\n {{option().label}}\n</div>\n\n@if (option().info; as info) {\n <crispr-info [info]=\"info\">\n </crispr-info>\n}\n"],"names":[],"mappings":";;;;MAca,eAAe,CAAA;AAR5B,IAAA,WAAA,GAAA;AASE,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAgB;AACxC,IAAA;8GAFY,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECd5B,2UAgBA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDJc,aAAa,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAEd,eAAe,EAAA,UAAA,EAAA,CAAA;kBAR3B,SAAS;+BACI,eAAe,EAAA,eAAA,EAGR,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,OAAA,EACP,CAAC,aAAa,CAAC,EAAA,QAAA,EAAA,2UAAA,EAAA,MAAA,EAAA,CAAA,gFAAA,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/material/checkbox';
4
- import { MatCheckboxModule } from '@angular/material/checkbox';
5
- import * as i1$1 from '@angular/forms';
6
- import { ReactiveFormsModule } from '@angular/forms';
7
- import * as i6 from '@tft/form-validation-handler';
8
- import { FormValidationHandlerModule } from '@tft/form-validation-handler';
9
- import { a as CrisprControlComponent, I as InfoComponent, F as FieldContainerComponent } from './tft-crispr-forms-tft-crispr-forms-8liD7eof.mjs';
10
-
11
- /* eslint-disable @nx/enforce-module-boundaries */
12
- const defaultConfig = {
13
- labelPosition: 'after',
14
- inline: false,
15
- };
16
- class CheckboxFieldComponent extends CrisprControlComponent {
17
- constructor() {
18
- super(...arguments);
19
- this.defaultConfig = defaultConfig;
20
- }
21
- ngOnInit() {
22
- super.ngOnInit();
23
- }
24
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: CheckboxFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
25
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: CheckboxFieldComponent, isStandalone: true, selector: "crispr-checkbox-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\"\n [inlineField]=\"config().inline\">\n <div\n [formGroup]=\"group()\">\n <mat-checkbox\n [attr.data-testid]=\"testId()\"\n [color]=\"config().color\"\n [labelPosition]=\"config().labelPosition\"\n [formControlName]=\"config().controlName\">\n {{config().label}}\n @if (config().info) {\n <crispr-info\n matSuffix\n [info]=\"config().info\">\n </crispr-info>\n }\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"], dependencies: [{ kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { 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 }); }
26
- }
27
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: CheckboxFieldComponent, decorators: [{
28
- type: Component,
29
- args: [{ selector: 'crispr-checkbox-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
30
- InfoComponent,
31
- MatCheckboxModule,
32
- ReactiveFormsModule,
33
- FieldContainerComponent,
34
- FormValidationHandlerModule
35
- ], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\"\n [inlineField]=\"config().inline\">\n <div\n [formGroup]=\"group()\">\n <mat-checkbox\n [attr.data-testid]=\"testId()\"\n [color]=\"config().color\"\n [labelPosition]=\"config().labelPosition\"\n [formControlName]=\"config().controlName\">\n {{config().label}}\n @if (config().info) {\n <crispr-info\n matSuffix\n [info]=\"config().info\">\n </crispr-info>\n }\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"] }]
36
- }] });
37
-
38
- export { CheckboxFieldComponent };
39
- //# sourceMappingURL=tft-crispr-forms-index-BFzx83fR.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tft-crispr-forms-index-BFzx83fR.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/checkbox-field/checkbox-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/checkbox-field/checkbox-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\n\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { CheckboxFieldConfig } from '../../utils';\nimport { InfoComponent } from '../info';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<CheckboxFieldConfig> = {\n labelPosition: 'after',\n inline: false,\n};\n\n@Component({\n selector: 'crispr-checkbox-field',\n templateUrl: './checkbox-field.component.html',\n styleUrls: ['./checkbox-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n InfoComponent,\n MatCheckboxModule,\n ReactiveFormsModule,\n FieldContainerComponent,\n FormValidationHandlerModule\n ],\n standalone: true\n})\nexport class CheckboxFieldComponent\n extends CrisprControlComponent<CheckboxFieldConfig>\n implements OnInit\n{\n defaultConfig = defaultConfig;\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\"\n [inlineField]=\"config().inline\">\n <div\n [formGroup]=\"group()\">\n <mat-checkbox\n [attr.data-testid]=\"testId()\"\n [color]=\"config().color\"\n [labelPosition]=\"config().labelPosition\"\n [formControlName]=\"config().controlName\">\n {{config().label}}\n @if (config().info) {\n <crispr-info\n matSuffix\n [info]=\"config().info\">\n </crispr-info>\n }\n </mat-checkbox>\n </div>\n</crispr-field-container>\n"],"names":["i2","i3"],"mappings":";;;;;;;;;;AAAA;AAWA,MAAM,aAAa,GAAiC;AAClD,IAAA,aAAa,EAAE,OAAO;AACtB,IAAA,MAAM,EAAE,KAAK;CACd;AAgBK,MAAO,sBACX,SAAQ,sBAA2C,CAAA;AAfrD,IAAA,WAAA,GAAA;;QAkBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAI9B,IAAA;IAHC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;IAClB;8GAPW,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC9BnC,0jBAqBA,EAAA,MAAA,EAAA,CAAA,6BAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAA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CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,uBAAuB,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,OAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACvB,2BAA2B,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,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;;2FAIlB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAdlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAAA,eAAA,EAGhB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,aAAa;wBACb,iBAAiB;wBACjB,mBAAmB;wBACnB,uBAAuB;wBACvB;AACD,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,0jBAAA,EAAA,MAAA,EAAA,CAAA,6BAAA,CAAA,EAAA;;;;;"}
@@ -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-3aw152gK.mjs';
15
- import * as i6 from '@tft/form-validation-handler';
16
- import { FormValidationHandlerModule } from '@tft/form-validation-handler';
17
- import { a as CrisprControlComponent, o as observablifyOptions, I as InfoComponent, F as FieldContainerComponent } from './tft-crispr-forms-tft-crispr-forms-8liD7eof.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]=\"testId()\" [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]=\"testId()\" [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-BMZQakFs.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tft-crispr-forms-index-BMZQakFs.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/unit-conversion-field/unit-conversion-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/unit-conversion-field/unit-conversion-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { CommonModule } from '@angular/common';\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n OnDestroy,\n} from '@angular/core';\nimport { ReactiveFormsModule, FormControl } from '@angular/forms';\nimport { MatOptionModule } from '@angular/material/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { combineLatest, Observable, Subscription } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { OptionComponent } from '../option';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { InfoComponent } from '../info';\nimport {\n observablifyOptions,\n SelectOption,\n UnitConversionFieldConfig,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<UnitConversionFieldConfig> = {};\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'crispr-unit-conversion-field',\n templateUrl: './unit-conversion-field.component.html',\n styleUrls: ['./unit-conversion-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatInputModule,\n MatSelectModule,\n MatOptionModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class UnitConversionFieldComponent\n extends CrisprControlComponent<UnitConversionFieldConfig>\n implements OnInit, OnDestroy\n{\n defaultConfig = defaultConfig;\n\n displayValueControl = new FormControl();\n unitSelectControl = new FormControl();\n unitOptions$: Observable<SelectOption[]>;\n\n transformationSubscription: Subscription;\n\n ngOnInit() {\n const config = this.config();\n super.ngOnInit();\n // TODO: Validators need work. validation is tricky because the input needs to be validated against but the validator will compare against the controls value\n // this.displayValueControl.setValidators(this.config.validators);\n\n const controlValuePipeline: Observable<string>[] = [\n this.displayValueControl.valueChanges.pipe(\n startWith(this.displayValueControl.value)\n ),\n ];\n // setup all required pieces when showing a field for selecting units\n if (config.showUnitSelect === true) {\n this.unitOptions$ = observablifyOptions(\n config.selectableUnits,\n this.group()\n );\n controlValuePipeline.push(\n this.unitSelectControl.valueChanges.pipe(\n startWith(config?.initialDisplayUnit || null)\n )\n );\n this.unitSelectControl.setValue(config?.initialDisplayUnit || null);\n }\n\n this.transformationSubscription = combineLatest(\n controlValuePipeline\n ).subscribe(([displayValue, unitValue]) => {\n const computedValue = this.config().storedValueConversion(\n displayValue,\n unitValue\n );\n this.control().setValue(computedValue);\n });\n }\n\n ngOnDestroy() {\n this.transformationSubscription.unsubscribe();\n }\n\n setInitialDisplayValue(storedValue: any, unit: unknown) {\n const initialDisplayValue = this.config().initialDisplayValueConversion(\n storedValue || null,\n unit\n );\n this.displayValueControl.setValue(initialDisplayValue);\n }\n\n /**\n * We override the 'setControlValue' we inherited from crisprControlMixin and add our custom logic,\n * This function gets called onInit because were object oriented. it's so great, so great that I'm\n * typing a paragraph to explain what the hell is going on...\n * @param value the initial value for the control passed down from the form components input\n */\n setControlValue(value) {\n const config = this.config();\n const initialUnitValue = config.showUnitSelect\n ? config?.initialDisplayUnit\n : null;\n this.setInitialDisplayValue(value, initialUnitValue);\n }\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [attr.data-testid]=\"testId()\" [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>"],"names":["i2","i3","i4","i5","i7"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAyBA,MAAM,aAAa,GAAuC,EAAE;AAqBtD,MAAO,4BACX,SAAQ,sBAAiD,CAAA;AApB3D,IAAA,WAAA,GAAA;;QAuBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAE7B,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,WAAW,EAAE;AACvC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,WAAW,EAAE;AAkEtC,IAAA;IA7DC,QAAQ,GAAA;AACN,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;QAC5B,KAAK,CAAC,QAAQ,EAAE;;;AAIhB,QAAA,MAAM,oBAAoB,GAAyB;AACjD,YAAA,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,IAAI,CACxC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAC1C;SACF;;AAED,QAAA,IAAI,MAAM,CAAC,cAAc,KAAK,IAAI,EAAE;AAClC,YAAA,IAAI,CAAC,YAAY,GAAG,mBAAmB,CACrC,MAAM,CAAC,eAAe,EACtB,IAAI,CAAC,KAAK,EAAE,CACb;YACD,oBAAoB,CAAC,IAAI,CACvB,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,CACtC,SAAS,CAAC,MAAM,EAAE,kBAAkB,IAAI,IAAI,CAAC,CAC9C,CACF;YACD,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,IAAI,IAAI,CAAC;QACrE;AAEA,QAAA,IAAI,CAAC,0BAA0B,GAAG,aAAa,CAC7C,oBAAoB,CACrB,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,KAAI;AACxC,YAAA,MAAM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,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,26CAAA,EAAA,MAAA,EAAA,CAAA,yFAAA,CAAA,EAAA;;;;;"}
@@ -1,2 +0,0 @@
1
- export { A as AutocompleteFieldComponent } from './tft-crispr-forms-autocomplete-field.component-BgQZYqB0.mjs';
2
- //# sourceMappingURL=tft-crispr-forms-index-B_lhA83w.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tft-crispr-forms-index-B_lhA83w.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,183 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { signal, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { tap, map, take } 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 i1 from '@angular/forms';
9
- import { FormGroup, ReactiveFormsModule } from '@angular/forms';
10
- import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
11
- import * as i5 from '@angular/material/chips';
12
- import { MatChipsModule } from '@angular/material/chips';
13
- import * as i1$2 from '@angular/common';
14
- import { CommonModule } from '@angular/common';
15
- import { MatOptionModule } from '@angular/material/core';
16
- import * as i3 from '@angular/material/input';
17
- import { MatInputModule } from '@angular/material/input';
18
- import * as i1$1 from '@angular/material/button';
19
- import { MatButtonModule } from '@angular/material/button';
20
- import { O as OptionComponent } from './tft-crispr-forms-index-3aw152gK.mjs';
21
- import * as i2$2 from '@angular/material/icon';
22
- import { MatIconModule } from '@angular/material/icon';
23
- import { D as DEFAULT_EMPTY_OPTIONS_MESSAGE, A as AbstractAutocompleteComponent, b as buildFormGroupFromConfig, I as InfoComponent, F as FieldContainerComponent, c as CrisprFieldDirective } from './tft-crispr-forms-tft-crispr-forms-8liD7eof.mjs';
24
- import * as i6 from '@tft/form-validation-handler';
25
- import { FormValidationHandlerModule } from '@tft/form-validation-handler';
26
- import * as i2$1 from '@angular/material/form-field';
27
-
28
- /* eslint-disable @nx/enforce-module-boundaries */
29
- const defaultConfig = {
30
- chipsSelectable: true,
31
- areChipsRemovable: true,
32
- tabToSelect: true,
33
- autoActiveFirstOption: true,
34
- imageUrlParam: 'image',
35
- typeDebounceTime: 500,
36
- allowDuplicates: false,
37
- duplicateCompareFunction: (chip, option) => chip.value === option.value,
38
- separatorKeyCodes: [ENTER],
39
- emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,
40
- };
41
- /** Sentinel used to detect "Create New" selection — never matches a real SelectOption */
42
- const CREATE_NEW_SENTINEL = Symbol('CREATE_NEW');
43
- class AutocompleteChiplistFieldComponent extends AbstractAutocompleteComponent {
44
- constructor() {
45
- super(...arguments);
46
- this.defaultConfig = defaultConfig;
47
- this.chips$ = new BehaviorSubject([]);
48
- this.selectedChip = null;
49
- this.controlValue$ = this.chips$.pipe(tap((chips) => {
50
- this.control().setValue(chips.map((chip) => chip.value));
51
- }));
52
- this.createNewSentinel = CREATE_NEW_SENTINEL;
53
- this.showCreateForm = signal(false, ...(ngDevMode ? [{ debugName: "showCreateForm" }] : []));
54
- this.createFormGroup = new FormGroup({});
55
- this.createFormPositions = [
56
- { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
57
- { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
58
- ];
59
- }
60
- get overlayWidth() {
61
- return this.overlayOrigin?.elementRef.nativeElement.offsetWidth ?? 0;
62
- }
63
- ngOnInit() {
64
- super.ngOnInit();
65
- this.remainingOptions$ = combineLatest([this.chips$, this.options$]).pipe(map(([chips, options]) => {
66
- return this.config().allowDuplicates
67
- ? options
68
- : options?.filter((option) => {
69
- const compare = this.config().duplicateCompareFunction
70
- ?? ((chip, opt) => chip.value === opt.value);
71
- return !chips.some((chip) => compare(chip, option));
72
- });
73
- }));
74
- }
75
- setControlValue(value) {
76
- if (value) {
77
- this.chips$.next(value);
78
- }
79
- }
80
- handleSelect(event) {
81
- if (event.option.value === CREATE_NEW_SENTINEL) {
82
- this.openCreateForm();
83
- return;
84
- }
85
- const selectedOption = event.option.value;
86
- this.chips$.next([...this.chips$.value, selectedOption]);
87
- this.chipInputRef.nativeElement.value = '';
88
- this.autocompleteInputControl.setValue('');
89
- // setTimeout needed because the panel thinks it's still open at this point
90
- setTimeout(() => this.chipInput.openPanel());
91
- }
92
- openCreateForm() {
93
- this.createFormGroup = buildFormGroupFromConfig({ fields: this.config().createChip.fields });
94
- this.chipInputRef.nativeElement.value = '';
95
- this.autocompleteInputControl.setValue('');
96
- setTimeout(() => this.showCreateForm.set(true));
97
- }
98
- submitNewChip() {
99
- this.config().createChip.submitChip(this.createFormGroup)
100
- .pipe(take(1))
101
- .subscribe((newChip) => {
102
- this.chips$.next([...this.chips$.value, newChip]);
103
- this.showCreateForm.set(false);
104
- });
105
- }
106
- closeCreateForm() {
107
- this.showCreateForm.set(false);
108
- }
109
- /**
110
- * To follow ARIA standards we want to select the active option on blur.
111
- * matChipInputAddOnBlur should do this but it causes buggy behaviour
112
- * @param event blur event that triggers the handle blur
113
- */
114
- handleTab(_event) {
115
- if (this.chipInput.activeOption &&
116
- (this.config().tabToSelect || this.config().addChipOnBlur)) {
117
- const chip = this.chipInput.activeOption.value;
118
- this.chips$.next([...this.chips$.value, chip]);
119
- }
120
- }
121
- /**
122
- * Handles selection via key tokens passed through separatorKeyCodes property
123
- * NOTE: If TAB is used focus does not move on to next component
124
- * @param event
125
- */
126
- handleTokenEnd(event) {
127
- if (this.chipInput.activeOption) {
128
- this.chipInput.activeOption.select();
129
- }
130
- event.chipInput?.clear();
131
- }
132
- mapToLabel(option) {
133
- if (!option || option === CREATE_NEW_SENTINEL)
134
- return '';
135
- return option.label ?? '';
136
- }
137
- removeChip(removedChip) {
138
- const remainingChips = this.chips$.value.filter((chip) => chip !== removedChip);
139
- this.chips$.next(remainingChips);
140
- }
141
- highlightChip(chip) {
142
- if (this.config().chipsSelectable) {
143
- this.selectedChip = chip;
144
- }
145
- }
146
- blurField() {
147
- this.selectedChip = null;
148
- }
149
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteChiplistFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
150
- 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 }, { propertyName: "overlayOrigin", first: true, predicate: CdkOverlayOrigin, descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field cdkOverlayOrigin [attr.data-testid]=\"testId()\" [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 @if (config().createChip) {\n <mat-option [value]=\"createNewSentinel\" class=\"create-new-option\">\n {{ config().createChip?.createLabel ?? '+ Create New' }}\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\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"showCreateForm()\"\n [cdkConnectedOverlayWidth]=\"overlayWidth\"\n [cdkConnectedOverlayPositions]=\"createFormPositions\"\n (overlayOutsideClick)=\"closeCreateForm()\">\n <div class=\"create-chip-panel mat-elevation-z4\">\n @for (field of config().createChip?.fields ?? []; track field) {\n <ng-container crisprField [config]=\"field\" [group]=\"createFormGroup\"></ng-container>\n }\n <div class=\"create-chip-actions\">\n <button mat-stroked-button type=\"button\" (click)=\"closeCreateForm()\">Cancel</button>\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"submitNewChip()\">\n {{ config().createChip?.submitLabel ?? 'Add' }}\n </button>\n </div>\n </div>\n </ng-template>\n\n</crispr-field-container>\n", 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}::ng-deep .create-chip-panel{background:var(--mat-sys-surface, white);border-radius:4px;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;padding:16px;width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:8px}.create-chip-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.create-new-option{font-style:italic;color:var(--mat-sys-primary, #6750a4)}\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: MatButtonModule }, { kind: "component", type: i1$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CrisprFieldDirective, selector: "[crisprField]", inputs: ["config", "group", "testIdPrefix", "value"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
151
- }
152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteChiplistFieldComponent, decorators: [{
153
- type: Component,
154
- args: [{ selector: 'crispr-autocomplete-chiplist-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
155
- CommonModule,
156
- InfoComponent,
157
- OptionComponent,
158
- ReactiveFormsModule,
159
- FieldContainerComponent,
160
- MatAutocompleteModule,
161
- MatInputModule,
162
- MatOptionModule,
163
- MatChipsModule,
164
- MatIconModule,
165
- MatButtonModule,
166
- FormValidationHandlerModule,
167
- CdkConnectedOverlay,
168
- CdkOverlayOrigin,
169
- CrisprFieldDirective,
170
- ], standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field cdkOverlayOrigin [attr.data-testid]=\"testId()\" [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 @if (config().createChip) {\n <mat-option [value]=\"createNewSentinel\" class=\"create-new-option\">\n {{ config().createChip?.createLabel ?? '+ Create New' }}\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\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"showCreateForm()\"\n [cdkConnectedOverlayWidth]=\"overlayWidth\"\n [cdkConnectedOverlayPositions]=\"createFormPositions\"\n (overlayOutsideClick)=\"closeCreateForm()\">\n <div class=\"create-chip-panel mat-elevation-z4\">\n @for (field of config().createChip?.fields ?? []; track field) {\n <ng-container crisprField [config]=\"field\" [group]=\"createFormGroup\"></ng-container>\n }\n <div class=\"create-chip-actions\">\n <button mat-stroked-button type=\"button\" (click)=\"closeCreateForm()\">Cancel</button>\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"submitNewChip()\">\n {{ config().createChip?.submitLabel ?? 'Add' }}\n </button>\n </div>\n </div>\n </ng-template>\n\n</crispr-field-container>\n", 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}::ng-deep .create-chip-panel{background:var(--mat-sys-surface, white);border-radius:4px;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;padding:16px;width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:8px}.create-chip-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.create-new-option{font-style:italic;color:var(--mat-sys-primary, #6750a4)}\n"] }]
171
- }], propDecorators: { chipInput: [{
172
- type: ViewChild,
173
- args: ['autoInput', { read: MatAutocompleteTrigger }]
174
- }], chipInputRef: [{
175
- type: ViewChild,
176
- args: ['autoInput']
177
- }], overlayOrigin: [{
178
- type: ViewChild,
179
- args: [CdkOverlayOrigin]
180
- }] } });
181
-
182
- export { AutocompleteChiplistFieldComponent };
183
- //# sourceMappingURL=tft-crispr-forms-index-BawhjTMp.mjs.map