@tft/crispr-forms 21.0.3 → 21.0.5
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-IB92ztLj.mjs +95 -0
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-IB92ztLj.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-2ggYh_Ev.mjs +40 -0
- package/fesm2022/tft-crispr-forms-index-2ggYh_Ev.mjs.map +1 -0
- package/fesm2022/{tft-crispr-forms-index-UAYeTe3L.mjs → tft-crispr-forms-index-BIPapWdD.mjs} +2 -2
- package/fesm2022/{tft-crispr-forms-index-UAYeTe3L.mjs.map → tft-crispr-forms-index-BIPapWdD.mjs.map} +1 -1
- package/fesm2022/{tft-crispr-forms-index-kjMTlZoq.mjs → tft-crispr-forms-index-BJb-E_LR.mjs} +2 -2
- package/fesm2022/{tft-crispr-forms-index-kjMTlZoq.mjs.map → tft-crispr-forms-index-BJb-E_LR.mjs.map} +1 -1
- package/fesm2022/{tft-crispr-forms-index-joNvlmny.mjs → tft-crispr-forms-index-BN-qHciF.mjs} +2 -2
- package/fesm2022/{tft-crispr-forms-index-joNvlmny.mjs.map → tft-crispr-forms-index-BN-qHciF.mjs.map} +1 -1
- package/fesm2022/tft-crispr-forms-index-BQWfppWN.mjs +73 -0
- package/fesm2022/tft-crispr-forms-index-BQWfppWN.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-Bau6o4JD.mjs +68 -0
- package/fesm2022/tft-crispr-forms-index-Bau6o4JD.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-C6I8JpR5.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-C6I8JpR5.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CXR7Jz3T.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-CXR7Jz3T.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CZ8se247.mjs +179 -0
- package/fesm2022/tft-crispr-forms-index-CZ8se247.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CjxxE8O4.mjs +2 -0
- package/fesm2022/tft-crispr-forms-index-CjxxE8O4.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-D699lPdT.mjs +40 -0
- package/fesm2022/tft-crispr-forms-index-D699lPdT.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DOaGEZK0.mjs +36 -0
- package/fesm2022/tft-crispr-forms-index-DOaGEZK0.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-D_9DqcSv.mjs +88 -0
- package/fesm2022/tft-crispr-forms-index-D_9DqcSv.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-HP6w4mnV.mjs +181 -0
- package/fesm2022/tft-crispr-forms-index-HP6w4mnV.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-XA--BwG_.mjs +190 -0
- package/fesm2022/tft-crispr-forms-index-XA--BwG_.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs +982 -0
- package/fesm2022/tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms.mjs +1 -973
- package/fesm2022/tft-crispr-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/tft-crispr-forms.d.ts +38 -16
- 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 +0 -40
- 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
|
@@ -0,0 +1,95 @@
|
|
|
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-BIPapWdD.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-BFiZ8Nhn.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-IB92ztLj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-autocomplete-field.component-IB92ztLj.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,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,KAAK,EAAE;;AAE3B,YAAA,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAC3D;IACF;AAEA;;;;;;AAMG;AACH,IAAA,YAAY,CAAC,OAA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A,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;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/radio';
|
|
4
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i1$1 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
10
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
11
|
+
import { a as CrisprControlComponent, o as observablifyOptions, F as FieldContainerComponent } from './tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs';
|
|
12
|
+
|
|
13
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
14
|
+
class RadioFieldComponent extends CrisprControlComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.defaultConfig = {};
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
super.ngOnInit();
|
|
21
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
22
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
23
|
+
this.options$ = observablifyOptions(this.config().options, this.group());
|
|
24
|
+
}
|
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: RadioFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: RadioFieldComponent, isStandalone: true, selector: "crispr-radio-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-radio-group\n [attr.data-testid]=\"testId()\"\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-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i2.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i2.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
27
|
+
}
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: RadioFieldComponent, decorators: [{
|
|
29
|
+
type: Component,
|
|
30
|
+
args: [{ selector: 'crispr-radio-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
31
|
+
CommonModule,
|
|
32
|
+
ReactiveFormsModule,
|
|
33
|
+
FieldContainerComponent,
|
|
34
|
+
MatRadioModule,
|
|
35
|
+
FormValidationHandlerModule,
|
|
36
|
+
], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-radio-group\n [attr.data-testid]=\"testId()\"\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-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"] }]
|
|
37
|
+
}] });
|
|
38
|
+
|
|
39
|
+
export { RadioFieldComponent };
|
|
40
|
+
//# sourceMappingURL=tft-crispr-forms-index-2ggYh_Ev.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-2ggYh_Ev.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 [attr.data-testid]=\"testId()\"\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-radio-group>\n</crispr-field-container>\n"],"names":["i3","i4"],"mappings":";;;;;;;;;;;;AAAA;AA0BM,MAAO,mBAAoB,SAAQ,sBAAwC,CAAA;AAdjF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2B;AAC9B,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,+bAAA,EAAA,MAAA,EAAA,CAAA,kCAAA,CAAA,EAAA;;;;;"}
|
package/fesm2022/{tft-crispr-forms-index-UAYeTe3L.mjs → tft-crispr-forms-index-BIPapWdD.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { InfoComponent } from './tft-crispr-forms.mjs';
|
|
3
|
+
import { I as InfoComponent } from './tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs';
|
|
4
4
|
|
|
5
5
|
class OptionComponent {
|
|
6
6
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -14,4 +14,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
14
14
|
}] } });
|
|
15
15
|
|
|
16
16
|
export { OptionComponent as O };
|
|
17
|
-
//# sourceMappingURL=tft-crispr-forms-index-
|
|
17
|
+
//# sourceMappingURL=tft-crispr-forms-index-BIPapWdD.mjs.map
|
package/fesm2022/{tft-crispr-forms-index-UAYeTe3L.mjs.map → tft-crispr-forms-index-BIPapWdD.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-BIPapWdD.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/option/option.component.ts","../../../../libs/crispr-forms/src/lib/ui/option/option.component.html"],"sourcesContent":["\nimport { Component, Input, ChangeDetectionStrategy } 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 imports: [InfoComponent]\n})\nexport class OptionComponent {\n @Input() option: 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":";;;;MAaa,eAAe,CAAA;8GAAf,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,QAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECb5B,iUAgBA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDLc,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;kBAP3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,mBAGR,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,aAAa,CAAC,EAAA,QAAA,EAAA,iUAAA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA;;sBAGzB;;;;;"}
|
package/fesm2022/{tft-crispr-forms-index-kjMTlZoq.mjs → tft-crispr-forms-index-BJb-E_LR.mjs}
RENAMED
|
@@ -4,7 +4,7 @@ import * as i2 from '@angular/material/divider';
|
|
|
4
4
|
import { MatDividerModule } from '@angular/material/divider';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
|
-
import { CrisprFieldComponent } from './tft-crispr-forms.mjs';
|
|
7
|
+
import { C as CrisprFieldComponent } from './tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs';
|
|
8
8
|
|
|
9
9
|
class DividerComponent extends CrisprFieldComponent {
|
|
10
10
|
constructor() {
|
|
@@ -21,4 +21,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
21
21
|
}] });
|
|
22
22
|
|
|
23
23
|
export { DividerComponent };
|
|
24
|
-
//# sourceMappingURL=tft-crispr-forms-index-
|
|
24
|
+
//# sourceMappingURL=tft-crispr-forms-index-BJb-E_LR.mjs.map
|
package/fesm2022/{tft-crispr-forms-index-kjMTlZoq.mjs.map → tft-crispr-forms-index-BJb-E_LR.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-BJb-E_LR.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/divider/divider.component.ts","../../../../libs/crispr-forms/src/lib/ui/divider/divider.component.html"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { CommonModule } from '@angular/common';\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { CrisprFieldComponent, DividerConfig } from '../../utils';\n\n@Component({\n selector: 'crispr-divider',\n templateUrl: './divider.component.html',\n styleUrls: ['./divider.component.scss'],\n imports: [CommonModule, MatDividerModule],\n standalone: true\n})\nexport class DividerComponent\n extends CrisprFieldComponent<DividerConfig>\n{\n // TODO: pull in type after configs are better organized\n defaultConfig = {};\n}\n","<mat-divider [ngClass]=\"config().class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
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
14
14
|
import * as i6 from '@tft/form-validation-handler';
|
|
15
15
|
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
16
|
-
import { CrisprFieldComponent } from './tft-crispr-forms.mjs';
|
|
16
|
+
import { C as CrisprFieldComponent } from './tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs';
|
|
17
17
|
|
|
18
18
|
class ButtonComponent extends CrisprFieldComponent {
|
|
19
19
|
constructor() {
|
|
@@ -58,4 +58,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
58
58
|
}] } });
|
|
59
59
|
|
|
60
60
|
export { ButtonComponent };
|
|
61
|
-
//# sourceMappingURL=tft-crispr-forms-index-
|
|
61
|
+
//# sourceMappingURL=tft-crispr-forms-index-BN-qHciF.mjs.map
|
package/fesm2022/{tft-crispr-forms-index-joNvlmny.mjs.map → tft-crispr-forms-index-BN-qHciF.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-BN-qHciF.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/button/button.component.ts","../../../../libs/crispr-forms/src/lib/ui/button/button.component.html"],"sourcesContent":["import { Component, OnInit, ChangeDetectionStrategy, Input, signal } from '@angular/core';\nimport { ReactiveFormsModule, FormGroup } from '@angular/forms';\nimport { Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { CrisprFieldComponent, ButtonConfig, ControlValue } from '../../utils';\n\n@Component({\n selector: 'crispr-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n MatButtonModule,\n MatIconModule,\n MatTooltipModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class ButtonComponent\n extends CrisprFieldComponent<ButtonConfig>\n implements OnInit\n{\n defaultConfig: Partial<ButtonConfig> = {\n buttonType: 'raised',\n type: 'submit',\n };\n formValid$: Observable<boolean>;\n\n group = signal<FormGroup>(null);\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input({alias: 'group'})\n set inputGroup(group: ControlValue) {\n this.group.set(group);\n }\n get matButtonClass() {\n return this.config().buttonType ? `mat-${this.config().buttonType}-button` : '';\n }\n\n ngOnInit() {\n this.formValid$ = this.group().statusChanges.pipe(\n map((status) => status === 'VALID'),\n startWith(this.group().valid)\n );\n }\n\n handleClick(group: FormGroup, event: MouseEvent) {\n if (this.config().callback) {\n this.config().callback(group, event);\n }\n }\n}\n","<button\n [formGroup]=\"group()\"\n mat-button\n [ngClass]=\"matButtonClass\"\n [color]=\"config().color\"\n [disabled]=\"config().disabledOnInvalidForm && !(formValid$ | async)\"\n [type]=\"config().type\"\n (click)=\"handleClick(group(), $event)\"\n [matTooltip]=\"config().info?.content\"\n [matTooltipPosition]=\"config().info?.tooltipPosition || 'below'\">\n {{ config().label }}\n @if (config().icon) {<mat-icon>{{ config().icon}}</mat-icon>}\n</button>\n\n"],"names":["i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;;;AA2BM,MAAO,eACX,SAAQ,oBAAkC,CAAA;AAhB5C,IAAA,WAAA,GAAA;;AAmBE,QAAA,IAAA,CAAA,aAAa,GAA0B;AACrC,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,IAAI,EAAE,QAAQ;SACf;AAGD,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAY,IAAI,iDAAC;AAsBhC,IAAA;;IApBC,IACI,UAAU,CAAC,KAAmB,EAAA;AAChC,QA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CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAItB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAf3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,eAAA,EAGR,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,eAAe;wBACf,aAAa;wBACb,gBAAgB;wBAChB,mBAAmB;wBACnB,2BAA2B;AAC9B,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,4dAAA,EAAA;;sBAcjB,KAAK;uBAAC,EAAC,KAAK,EAAE,OAAO,EAAC;;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/material/select';
|
|
4
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
5
|
+
import * as i1$2 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i1 from '@angular/material/checkbox';
|
|
8
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
9
|
+
import * as i1$1 from '@angular/forms';
|
|
10
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
11
|
+
import * as i2 from '@angular/material/form-field';
|
|
12
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
|
+
import { O as OptionComponent } from './tft-crispr-forms-index-BIPapWdD.mjs';
|
|
14
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
15
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
16
|
+
import { a as CrisprControlComponent, o as observablifyOptions, I as InfoComponent, F as FieldContainerComponent } from './tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs';
|
|
17
|
+
import * as i2$1 from '@angular/material/autocomplete';
|
|
18
|
+
|
|
19
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
20
|
+
class SelectFieldComponent extends CrisprControlComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.defaultConfig = {
|
|
24
|
+
enableToggleAll: false,
|
|
25
|
+
color: 'primary',
|
|
26
|
+
};
|
|
27
|
+
this.allSelected = false;
|
|
28
|
+
}
|
|
29
|
+
ngOnInit() {
|
|
30
|
+
super.ngOnInit();
|
|
31
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
32
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
33
|
+
this.options$ = observablifyOptions(this.config().options, this.group());
|
|
34
|
+
}
|
|
35
|
+
ngAfterViewInit() {
|
|
36
|
+
if (this.config().multiple &&
|
|
37
|
+
this.config().enableToggleAll &&
|
|
38
|
+
this.selectField.options?.length === this.value()?.length) {
|
|
39
|
+
this.allSelected = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
toggleAll(isSelected) {
|
|
43
|
+
if (isSelected) {
|
|
44
|
+
this.selectField.options.forEach((option) => option.deselect());
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.selectField.options.forEach((option) => option.select());
|
|
48
|
+
}
|
|
49
|
+
this.allSelected = !this.allSelected;
|
|
50
|
+
}
|
|
51
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SelectFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
52
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: SelectFieldComponent, isStandalone: true, selector: "crispr-select-field", viewQueries: [{ propertyName: "selectField", first: true, predicate: ["selectField"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<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 <mat-select\n #selectField\n [formControlName]=\"config().controlName\"\n [placeholder]=\"config().placeholder\"\n [multiple]=\"config().multiple\">\n\n @if (config()?.multiple && config().enableToggleAll) {\n <mat-checkbox\n [color]=\"config().color\"\n [checked]=\"allSelected\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n }\n @for (option of options$ | async; track option) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n\n </mat-select>\n\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</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}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: 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: MatSelectModule }, { 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: "component", type: i3.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: 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: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SelectFieldComponent, decorators: [{
|
|
55
|
+
type: Component,
|
|
56
|
+
args: [{ selector: 'crispr-select-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
57
|
+
CommonModule,
|
|
58
|
+
InfoComponent,
|
|
59
|
+
OptionComponent,
|
|
60
|
+
MatCheckboxModule,
|
|
61
|
+
MatSelectModule,
|
|
62
|
+
ReactiveFormsModule,
|
|
63
|
+
FormValidationHandlerModule,
|
|
64
|
+
FieldContainerComponent,
|
|
65
|
+
MatFormFieldModule,
|
|
66
|
+
], standalone: true, template: "<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 <mat-select\n #selectField\n [formControlName]=\"config().controlName\"\n [placeholder]=\"config().placeholder\"\n [multiple]=\"config().multiple\">\n\n @if (config()?.multiple && config().enableToggleAll) {\n <mat-checkbox\n [color]=\"config().color\"\n [checked]=\"allSelected\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n }\n @for (option of options$ | async; track option) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n\n </mat-select>\n\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</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}crispr-info[matSuffix]{margin-right:.75em}\n"] }]
|
|
67
|
+
}], propDecorators: { selectField: [{
|
|
68
|
+
type: ViewChild,
|
|
69
|
+
args: ['selectField']
|
|
70
|
+
}] } });
|
|
71
|
+
|
|
72
|
+
export { SelectFieldComponent };
|
|
73
|
+
//# sourceMappingURL=tft-crispr-forms-index-BQWfppWN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-BQWfppWN.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/select-field/select-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/select-field/select-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n ViewChild,\n AfterViewInit,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { MatSelect, MatSelectModule } from '@angular/material/select';\nimport { ThemePalette } from '@angular/material/core';\nimport { CommonModule } from '@angular/common';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { OptionComponent } from '../option';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { InfoComponent } from '../info';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n observablifyOptions,\n SelectFieldConfig,\n SelectOption,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\n@Component({\n selector: 'crispr-select-field',\n templateUrl: './select-field.component.html',\n styleUrls: ['./select-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n MatCheckboxModule,\n MatSelectModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n FieldContainerComponent,\n MatFormFieldModule,\n ],\n standalone: true\n})\nexport class SelectFieldComponent\n extends CrisprControlComponent<SelectFieldConfig>\n implements OnInit, AfterViewInit\n{\n defaultConfig = {\n enableToggleAll: false,\n color: 'primary' as ThemePalette,\n };\n options$: Observable<SelectOption[]>;\n allSelected = false;\n\n @ViewChild('selectField') selectField: MatSelect;\n\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 ngAfterViewInit() {\n if (\n this.config().multiple &&\n this.config().enableToggleAll &&\n this.selectField.options?.length === (this.value() as any[])?.length\n ) {\n this.allSelected = true;\n }\n }\n\n toggleAll(isSelected: boolean) {\n if (isSelected) {\n this.selectField.options.forEach((option) => option.deselect());\n } else {\n this.selectField.options.forEach((option) => option.select());\n }\n this.allSelected = !this.allSelected;\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 <mat-select\n #selectField\n [formControlName]=\"config().controlName\"\n [placeholder]=\"config().placeholder\"\n [multiple]=\"config().multiple\">\n\n @if (config()?.multiple && config().enableToggleAll) {\n <mat-checkbox\n [color]=\"config().color\"\n [checked]=\"allSelected\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n }\n @for (option of options$ | async; track option) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n\n </mat-select>\n\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</crispr-field-container>\n"],"names":["i5","i7"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AA6CM,MAAO,oBACX,SAAQ,sBAAyC,CAAA;AAnBnD,IAAA,WAAA,GAAA;;AAsBE,QAAA,IAAA,CAAA,aAAa,GAAG;AACd,YAAA,eAAe,EAAE,KAAK;AACtB,YAAA,KAAK,EAAE,SAAyB;SACjC;QAED,IAAA,CAAA,WAAW,GAAG,KAAK;AA6BpB,IAAA;IAzBC,QAAQ,GAAA;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AAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACnB,2BAA2B,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,sBAAA,EAAA,QAAA,EAAA,kCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,8BAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC3B,uBAAuB,8GACvB,kBAAkB,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;;2FAIb,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAlBhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,eAAA,EAGd,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,aAAa;wBACb,eAAe;wBACf,iBAAiB;wBACjB,eAAe;wBACf,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,kBAAkB;AACrB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,6yCAAA,EAAA,MAAA,EAAA,CAAA,sFAAA,CAAA,EAAA;;sBAajB,SAAS;uBAAC,aAAa;;;;;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/datepicker';
|
|
4
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
5
|
+
import { MatDateFnsModule } from '@angular/material-date-fns-adapter';
|
|
6
|
+
import { of } from 'rxjs';
|
|
7
|
+
import * as i5 from '@angular/cdk/portal';
|
|
8
|
+
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
9
|
+
import * as i2 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
+
import * as i1$2 from '@angular/common';
|
|
12
|
+
import { CommonModule } from '@angular/common';
|
|
13
|
+
import * as i1$1 from '@angular/forms';
|
|
14
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
15
|
+
import * as i3 from '@angular/material/input';
|
|
16
|
+
import { MatInputModule } from '@angular/material/input';
|
|
17
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
18
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
19
|
+
import { a as CrisprControlComponent, F as FieldContainerComponent } from './tft-crispr-forms-tft-crispr-forms-BFiZ8Nhn.mjs';
|
|
20
|
+
|
|
21
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
22
|
+
const defaultConfig = {
|
|
23
|
+
startView: 'month',
|
|
24
|
+
};
|
|
25
|
+
class DatepickerFieldComponent extends CrisprControlComponent {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.defaultConfig = defaultConfig;
|
|
29
|
+
}
|
|
30
|
+
ngOnInit() {
|
|
31
|
+
super.ngOnInit();
|
|
32
|
+
const config = this.config();
|
|
33
|
+
this.startAt$ =
|
|
34
|
+
config.startAt instanceof Date
|
|
35
|
+
? of(config.startAt)
|
|
36
|
+
: config.startAt instanceof Function
|
|
37
|
+
? config.startAt(this.group())
|
|
38
|
+
: of(null);
|
|
39
|
+
this.dateClass = config?.cellClassFunction || null;
|
|
40
|
+
this.dateClass$ = config.dateClass
|
|
41
|
+
? config?.dateClass(this.group())
|
|
42
|
+
: of(() => '');
|
|
43
|
+
}
|
|
44
|
+
ngAfterContentInit() {
|
|
45
|
+
if (this.config().datepickerActions) {
|
|
46
|
+
this.calendarFooterPortal = new ComponentPortal(this.config().datepickerActions);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: DatepickerFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: DatepickerFieldComponent, isStandalone: true, selector: "crispr-datepicker-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\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 <input\n matInput\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config().datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config().touchUi\"\n [startView]=\"config().startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n @if (calendarFooterPortal) {\n <mat-datepicker-actions>\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n }\n </mat-datepicker>\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\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i1.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { 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: ReactiveFormsModule }, { kind: "directive", type: i1$1.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$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: "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: MatDateFnsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i5.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: DatepickerFieldComponent, decorators: [{
|
|
53
|
+
type: Component,
|
|
54
|
+
args: [{ selector: 'crispr-datepicker-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
55
|
+
CommonModule,
|
|
56
|
+
FieldContainerComponent,
|
|
57
|
+
MatDatepickerModule,
|
|
58
|
+
MatFormFieldModule,
|
|
59
|
+
ReactiveFormsModule,
|
|
60
|
+
MatInputModule,
|
|
61
|
+
MatDateFnsModule,
|
|
62
|
+
PortalModule,
|
|
63
|
+
FormValidationHandlerModule,
|
|
64
|
+
], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\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 <input\n matInput\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config().datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config().touchUi\"\n [startView]=\"config().startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n @if (calendarFooterPortal) {\n <mat-datepicker-actions>\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n }\n </mat-datepicker>\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\n" }]
|
|
65
|
+
}] });
|
|
66
|
+
|
|
67
|
+
export { DatepickerFieldComponent };
|
|
68
|
+
//# sourceMappingURL=tft-crispr-forms-index-Bau6o4JD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-Bau6o4JD.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n AfterContentInit,\n} from '@angular/core';\nimport {\n MatCalendarCellClassFunction,\n MatDatepickerModule,\n} from '@angular/material/datepicker';\nimport { MatDateFnsModule } from '@angular/material-date-fns-adapter';\nimport { Observable, of } from 'rxjs';\nimport { ComponentPortal, Portal, PortalModule } from '@angular/cdk/portal';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatInputModule } from '@angular/material/input';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n DatepickerFieldConfig,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<DatepickerFieldConfig> = {\n startView: 'month',\n};\n\n@Component({\n selector: 'crispr-datepicker-field',\n templateUrl: './datepicker-field.component.html',\n styleUrls: ['./datepicker-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n FieldContainerComponent,\n MatDatepickerModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDateFnsModule,\n PortalModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class DatepickerFieldComponent\n extends CrisprControlComponent<DatepickerFieldConfig>\n implements OnInit, AfterContentInit\n{\n defaultConfig = defaultConfig;\n\n dateClass: MatCalendarCellClassFunction<Date>;\n dateClass$: Observable<MatCalendarCellClassFunction<Date>>;\n startAt$: Observable<Date>;\n\n /** A portal containing the footer component type for this calendar. */\n calendarFooterPortal: Portal<any>;\n\n ngOnInit() {\n super.ngOnInit();\n const config = this.config();\n this.startAt$ =\n config.startAt instanceof Date\n ? of(config.startAt)\n : config.startAt instanceof Function\n ? config.startAt(this.group())\n : of(null);\n this.dateClass = config?.cellClassFunction || null;\n this.dateClass$ = config.dateClass\n ? config?.dateClass(this.group())\n : of(() => '');\n }\n\n ngAfterContentInit() {\n if (this.config().datepickerActions) {\n this.calendarFooterPortal = new ComponentPortal(\n this.config().datepickerActions\n );\n }\n }\n\n // handleSelectedChange(event, picker: MatDatepicker<unknown>) {\n // console.log({event, picker})\n // if(this.config.selectedChange) {\n // this.config.selectedChange(event, picker);\n // }\n // }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\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 <input\n matInput\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config().datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config().touchUi\"\n [startView]=\"config().startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n @if (calendarFooterPortal) {\n <mat-datepicker-actions>\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n }\n </mat-datepicker>\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\n"],"names":["i4","i7"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAyBA,MAAM,aAAa,GAAmC;AACpD,IAAA,SAAS,EAAE,OAAO;CACnB;AAoBK,MAAO,wBACX,SAAQ,sBAA6C,CAAA;AAnBvD,IAAA,WAAA,GAAA;;QAsBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAsC9B,IAAA;IA7BC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;AAChB,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAC5B,QAAA,IAAI,CAAC,QAAQ;YACX,MAAM,CAAC,OAAO,YAAY;AACxB,kBAAE,EAAE,CAAC,MAAM,CAAC,OAAO;AACnB,kBAAE,MAAM,CAAC,OAAO,YAAY;sBAC1B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;AAC7B,sBAAE,EAAE,CAAC,IAAI,CAAC;QACd,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,iBAAiB,IAAI,IAAI;AAClD,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;cACrB,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE;cAC9B,EAAE,CAAC,MAAM,EAAE,CAAC;IAClB;IAEA,kBAAkB,GAAA;AAChB,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,iBAAiB,EAAE;AACnC,YAAA,IAAI,CAAC,oBAAoB,GAAG,IAAI,eAAe,CAC7C,IAAI,CAAC,MAAM,EAAE,CAAC,iBAAiB,CAChC;QACH;IACF;8GAlCW,wBAAwB,EAAA,IAAA,EAAA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A,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,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAlBpC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,yBAAyB,EAAA,eAAA,EAGlB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,uBAAuB;wBACvB,mBAAmB;wBACnB,kBAAkB;wBAClB,mBAAmB;wBACnB,cAAc;wBACd,gBAAgB;wBAChB,YAAY;wBACZ,2BAA2B;AAC9B,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,4rCAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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-BFiZ8Nhn.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-C6I8JpR5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-C6I8JpR5.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;AAgB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