@tft/crispr-forms 12.2.18 → 12.2.22
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/bundles/tft-crispr-forms.umd.js +16 -11
- package/bundles/tft-crispr-forms.umd.js.map +1 -1
- package/esm2015/lib/crispr-forms.module.ngfactory.js.map +1 -1
- package/esm2015/lib/form-group-list/form-group-list.component.js +9 -7
- package/esm2015/lib/form-group-list/form-group-list.component.js.map +1 -1
- package/esm2015/lib/form-group-list/form-group-list.component.metadata.json +1 -1
- package/esm2015/lib/material/autocomplete-field/autocomplete-field.component.js +6 -3
- package/esm2015/lib/material/autocomplete-field/autocomplete-field.component.js.map +1 -1
- package/esm2015/lib/material/material.module.ngfactory.js.map +1 -1
- package/esm2015/lib/material/unit-conversion-field/unit-conversion-field.component.js +1 -1
- package/esm2015/lib/material/unit-conversion-field/unit-conversion-field.component.js.map +1 -1
- package/esm2015/lib/material/unit-conversion-field/unit-conversion-field.component.metadata.json +1 -1
- package/esm2015/lib/models/autocomplete-field.config.js.map +1 -1
- package/esm2015/lib/models/crispr-field.config.js.map +1 -1
- package/esm2015/lib/models/form-group-list.config.js.map +1 -1
- package/esm2015/lib/models/input-field.config.js.map +1 -1
- package/esm2015/lib/models/unit-conversion-field.config.js.map +1 -1
- package/fesm2015/tft-crispr-forms.js +16 -11
- package/fesm2015/tft-crispr-forms.js.map +1 -1
- package/lib/material/autocomplete-field/autocomplete-field.component.d.ts +1 -1
- package/lib/models/autocomplete-field.config.d.ts +2 -1
- package/lib/models/crispr-field.config.d.ts +3 -1
- package/lib/models/form-group-list.config.d.ts +8 -1
- package/lib/models/input-field.config.d.ts +1 -1
- package/lib/models/unit-conversion-field.config.d.ts +0 -1
- package/package.json +1 -1
- package/tft-crispr-forms-12.2.22.tgz +0 -0
- package/tft-crispr-forms.metadata.json +1 -1
- package/tft-crispr-forms-12.2.18.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-group-list.config.js","sourceRoot":"","sources":["../../../../../../libs/crispr-forms/src/lib/models/form-group-list.config.ts"],"names":[],"mappings":"","sourcesContent":["import { ThemePalette } from '@angular/material/core';\nimport { CrisprControlConfig, ControlType } from './';\nimport { SubGroupConfig } from './crispr-field.config';\n\n// TODO: Below type would be ideal type to use for itemConfig, but there were some issues getting it to work\n// export type GroupListItemConfig = Omit<SubGroupConfig, 'controlName'> & {\n// /**\n// * @deprecated controlName doesn't do anything in the itemConfig and should be removed\n// * */\n// controlName?: string;\n// }\n\nexport interface FormGroupListConfig extends CrisprControlConfig {\n controlType: ControlType.GROUP_LIST;\n itemConfig: SubGroupConfig; // TODO: should be GroupListItemConfig but having issues working it out\n
|
|
1
|
+
{"version":3,"file":"form-group-list.config.js","sourceRoot":"","sources":["../../../../../../libs/crispr-forms/src/lib/models/form-group-list.config.ts"],"names":[],"mappings":"","sourcesContent":["import { ThemePalette } from '@angular/material/core';\nimport { CrisprControlConfig, ControlType } from './';\nimport { SubGroupConfig } from './crispr-field.config';\n\n// TODO: Below type would be ideal type to use for itemConfig, but there were some issues getting it to work\n// export type GroupListItemConfig = Omit<SubGroupConfig, 'controlName'> & {\n// /**\n// * @deprecated controlName doesn't do anything in the itemConfig and should be removed\n// * */\n// controlName?: string;\n// }\n\nexport interface FormGroupListConfig extends CrisprControlConfig {\n controlType: ControlType.GROUP_LIST;\n itemConfig: SubGroupConfig; // TODO: should be GroupListItemConfig but having issues working it out\n itemLabelBuilder?: (index: number) => string;\n /** The number of list items that a user can delete */\n minListLength?: number;\n /** If no items are passed as an initial value, should an initial empty item be created */\n displayInitialItem?: boolean;\n addButtonColor?: ThemePalette;\n addButtonLabel?: string;\n /**\n * @deprecated Please use addButtonLabel, addItemLabel will be removed in the next major release\n */\n addItemLabel?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.config.js","sourceRoot":"","sources":["../../../../../../libs/crispr-forms/src/lib/models/input-field.config.ts"],"names":[],"mappings":"","sourcesContent":["import { CrisprControlConfig } from '../models';\nimport { ControlType, FieldDescriptors, MatFieldProperties } from './crispr-field.config';\n\nexport interface InputFieldConfig extends CrisprControlConfig,\n FieldDescriptors,\n MatFieldProperties {\n controlType: ControlType.INPUT,\n inputType?: InputType;\n min?: number;\n max?: number;\n maxLength?: number;\n step?: number;\n pattern?: string;\n autofocus?: boolean;\n spellcheck?: boolean;\n autoComplete?:
|
|
1
|
+
{"version":3,"file":"input-field.config.js","sourceRoot":"","sources":["../../../../../../libs/crispr-forms/src/lib/models/input-field.config.ts"],"names":[],"mappings":"","sourcesContent":["import { CrisprControlConfig } from '../models';\nimport { ControlType, FieldDescriptors, MatFieldProperties } from './crispr-field.config';\n\nexport interface InputFieldConfig extends CrisprControlConfig,\n FieldDescriptors,\n MatFieldProperties {\n controlType: ControlType.INPUT,\n inputType?: InputType;\n min?: number;\n max?: number;\n maxLength?: number;\n step?: number;\n pattern?: string;\n autofocus?: boolean;\n spellcheck?: boolean;\n autoComplete?: string;\n autoCapitalize?: 'off' | 'on';\n}\n\ntype InputType = 'color'\n |'date'\n |'datetime-local'\n |'email'\n |'month'\n |'number'\n |'password'\n |'search'\n |'tel'\n |'text'\n |'time'\n |'url'\n |'week';\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-conversion-field.config.js","sourceRoot":"","sources":["../../../../../../libs/crispr-forms/src/lib/models/unit-conversion-field.config.ts"],"names":[],"mappings":"","sourcesContent":["import { FormGroup } from '@angular/forms';\r\nimport { CrisprControlConfig, ControlType } from '../models';\r\nimport { FieldDescriptors, MatFieldProperties } from './crispr-field.config';\r\nimport { OptionsType } from './select-field.config';\r\n\r\nexport type UnitConversionFieldConfig<ST = unknown, UT = unknown> = CrisprControlConfig &\r\n FieldDescriptors &\r\n MatFieldProperties & {\r\n controlType: ControlType.UNIT_CONVERSION;\r\n\r\n\r\n /**\r\n * Used convert config value to displayed value on initialization\r\n */\r\n initialDisplayValueConversion: (value?: ST, displayedUnit?: UT) => number;\r\n /**\r\n * The function to convert the display value into the stored value as the display value changes\r\n */\r\n storedValueConversion: (value?: string, displayedUnit?: UT) => number;\r\n min?: number;\r\n max?: number;\r\n autofocus?: boolean;\r\n
|
|
1
|
+
{"version":3,"file":"unit-conversion-field.config.js","sourceRoot":"","sources":["../../../../../../libs/crispr-forms/src/lib/models/unit-conversion-field.config.ts"],"names":[],"mappings":"","sourcesContent":["import { FormGroup } from '@angular/forms';\r\nimport { CrisprControlConfig, ControlType } from '../models';\r\nimport { FieldDescriptors, MatFieldProperties } from './crispr-field.config';\r\nimport { OptionsType } from './select-field.config';\r\n\r\nexport type UnitConversionFieldConfig<ST = unknown, UT = unknown> = CrisprControlConfig &\r\n FieldDescriptors &\r\n MatFieldProperties & {\r\n controlType: ControlType.UNIT_CONVERSION;\r\n\r\n\r\n /**\r\n * Used convert config value to displayed value on initialization\r\n */\r\n initialDisplayValueConversion: (value?: ST, displayedUnit?: UT) => number;\r\n /**\r\n * The function to convert the display value into the stored value as the display value changes\r\n */\r\n storedValueConversion: (value?: string, displayedUnit?: UT) => number;\r\n min?: number;\r\n max?: number;\r\n autofocus?: boolean;\r\n step?: number;\r\n\r\n} & ({\r\n showUnitSelect: true\r\n /**\r\n * A callback function that returns the options to be used by the unit select field. Can be used just like select field options.\r\n */\r\n selectableUnits: (group: FormGroup) => OptionsType,\r\n /**\r\n * Display unit to use on component initialization and when unit not user selectable i.e. showUnitSelect: false\r\n */\r\n initialDisplayUnit: UT;\r\n} | {\r\n showUnitSelect: false;\r\n})\r\n"]}
|
|
@@ -408,11 +408,14 @@ class AutocompleteFieldComponent extends AbstractAutocompleteComponent {
|
|
|
408
408
|
* @param options the array of options to search for option with corresponding value
|
|
409
409
|
*/
|
|
410
410
|
displayLabel(options) {
|
|
411
|
+
if (this.config.displayWith) {
|
|
412
|
+
return this.config.displayWith(options);
|
|
413
|
+
}
|
|
411
414
|
return (value) => {
|
|
412
415
|
var _a;
|
|
413
|
-
|
|
414
|
-
? (_a = options.find(option => option.value === value)) === null || _a === void 0 ? void 0 : _a.label
|
|
415
|
-
|
|
416
|
+
const label = !!options && Array.isArray(options)
|
|
417
|
+
? (_a = options.find((option) => JSON.stringify(option.value) === JSON.stringify(value))) === null || _a === void 0 ? void 0 : _a.label : value;
|
|
418
|
+
return label;
|
|
416
419
|
};
|
|
417
420
|
}
|
|
418
421
|
handleSelect(event) {
|
|
@@ -849,7 +852,7 @@ UnitConversionFieldComponent.decorators = [
|
|
|
849
852
|
{ type: Component, args: [{
|
|
850
853
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
851
854
|
selector: 'crispr-unit-conversion-field',
|
|
852
|
-
template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"
|
|
855
|
+
template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <!-- <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span> -->\n <!-- <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info> -->\n </mat-form-field>\n\n\n</crispr-field-container>\n",
|
|
853
856
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
854
857
|
styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}"]
|
|
855
858
|
},] }
|
|
@@ -1083,7 +1086,7 @@ CrisprFormComponent.propDecorators = {
|
|
|
1083
1086
|
};
|
|
1084
1087
|
|
|
1085
1088
|
const defaultConfig = {
|
|
1086
|
-
|
|
1089
|
+
addButtonLabel: 'ADD ITEM',
|
|
1087
1090
|
minListLength: 1,
|
|
1088
1091
|
};
|
|
1089
1092
|
const FormGroupListMixin = crisprControlMixin(CrisprFieldComponent);
|
|
@@ -1098,11 +1101,13 @@ class FormGroupListComponent extends FormGroupListMixin {
|
|
|
1098
1101
|
this.formArray = this.control;
|
|
1099
1102
|
}
|
|
1100
1103
|
setControlValue(values) {
|
|
1101
|
-
if (
|
|
1102
|
-
values
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
this.
|
|
1104
|
+
if (this.control) {
|
|
1105
|
+
if ((values === null || values === void 0 ? void 0 : values.length) > 0) {
|
|
1106
|
+
values.forEach(value => this.addGroup(value));
|
|
1107
|
+
}
|
|
1108
|
+
else if (this.config.displayInitialItem) {
|
|
1109
|
+
this.addGroup();
|
|
1110
|
+
}
|
|
1106
1111
|
}
|
|
1107
1112
|
}
|
|
1108
1113
|
addGroup(value = null) {
|
|
@@ -1115,7 +1120,7 @@ class FormGroupListComponent extends FormGroupListMixin {
|
|
|
1115
1120
|
FormGroupListComponent.decorators = [
|
|
1116
1121
|
{ type: Component, args: [{
|
|
1117
1122
|
selector: 'crispr-form-group-list',
|
|
1118
|
-
template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [formGroup]=\"group\">\n\n <div [formArrayName]=\"config.controlName\">\n <!-- TODO: add sortBy function -->\n <div *ngFor=\"let control of formArray?.controls; let i = index;\">\n <!-- TODO: use content projection to allow custom item label component -->\n <div class=\"item-header\">\n <span class=\"mat-h2\" *ngIf=\"config.itemLabelBuilder\"> {{ config.itemLabelBuilder(i) }} </span>\n <button\n mat-icon-button\n *ngIf=\"i + 1 > config.minListLength\">\n <mat-icon (click)=\"deleteGroup(i)\">delete</mat-icon>\n </button>\n </div>\n <div\n [formGroupName]=\"i\">\n <ng-container\n *ngFor=\"let field of config.itemConfig.fields;\"\n crisprField\n [config]=\"field\"\n [value]=\"value && value[i] | initialControlValue : field\"\n [group]=\"control\">\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"group-footer\">\n <button\n type=\"button\"\n class=\"add\"\n mat-raised-button\n [color]=\"config.addButtonColor\"\n (click)=\"addGroup()\">\n {{config.addItemLabel}}\n </button>\n </div>\n\n</crispr-field-container>\n",
|
|
1123
|
+
template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [formGroup]=\"group\">\n\n <div [formArrayName]=\"config.controlName\">\n <!-- TODO: add sortBy function -->\n <div *ngFor=\"let control of formArray?.controls; let i = index;\">\n <!-- TODO: use content projection to allow custom item label component -->\n <div class=\"item-header\">\n <span class=\"mat-h2\" *ngIf=\"config.itemLabelBuilder\"> {{ config.itemLabelBuilder(i) }} </span>\n <button\n mat-icon-button\n *ngIf=\"i + 1 > config.minListLength\">\n <mat-icon (click)=\"deleteGroup(i)\">delete</mat-icon>\n </button>\n </div>\n <div\n [formGroupName]=\"i\">\n <ng-container\n *ngFor=\"let field of config.itemConfig.fields;\"\n crisprField\n [config]=\"field\"\n [value]=\"value && value[i] | initialControlValue : field\"\n [group]=\"control\">\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"group-footer\">\n <button\n type=\"button\"\n class=\"add\"\n mat-raised-button\n [color]=\"config.addButtonColor\"\n (click)=\"addGroup()\">\n {{config.addItemLabel || config.addButtonLabel}}\n </button>\n </div>\n\n</crispr-field-container>\n",
|
|
1119
1124
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1120
1125
|
styles: [".item-header{display:flex;justify-content:space-between}.group-footer{display:flex;justify-content:flex-end}.group-footer button.add{margin-bottom:16px}"]
|
|
1121
1126
|
},] }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms.js","sources":["../../../../libs/crispr-forms/src/lib/models/select-field.config.ts","../../../../libs/crispr-forms/src/lib/models/crispr-field.config.ts","../../../../libs/crispr-forms/src/lib/models/heading.config.ts","../../../../libs/crispr-forms/src/lib/form.operators.ts","../../../../libs/crispr-forms/src/lib/form.helpers.ts","../../../../libs/crispr-forms/src/lib/abstracts/crispr-control.mixin.ts","../../../../libs/crispr-forms/src/lib/abstracts/crispr-field.abstract.ts","../../../../libs/crispr-forms/src/lib/abstracts/autocomplete-field.abstract.ts","../../../../libs/crispr-forms/src/lib/material/input-field/input-field.component.ts","../../../../libs/crispr-forms/src/lib/material/select-field/select-field.component.ts","../../../../libs/crispr-forms/src/lib/material/autocomplete-field/autocomplete-field.component.ts","../../../../libs/crispr-forms/src/lib/material/autocomplete-chiplist-field/autocomplete-chiplist-field.component.ts","../../../../libs/crispr-forms/src/lib/material/checkbox-field/checkbox-field.component.ts","../../../../libs/crispr-forms/src/lib/material/textarea-field/textarea-field.component.ts","../../../../libs/crispr-forms/src/lib/material/slider-field/slider-field.component.ts","../../../../libs/crispr-forms/src/lib/material/button/button.component.ts","../../../../libs/crispr-forms/src/lib/material/datepicker-field/datepicker-field.component.ts","../../../../libs/crispr-forms/src/lib/material/file-upload/file-upload.component.ts","../../../../libs/crispr-forms/src/lib/material/heading/heading.component.ts","../../../../libs/crispr-forms/src/lib/material/divider/divider.component.ts","../../../../libs/crispr-forms/src/lib/material/radio-field/radio-field.component.ts","../../../../libs/crispr-forms/src/lib/material/unit-conversion-field/unit-conversion-field.component.ts","../../../../libs/crispr-forms/src/lib/field-container/field-container.component.ts","../../../../libs/crispr-forms/src/lib/material/info/info.component.ts","../../../../libs/crispr-forms/src/lib/material/option/option.component.ts","../../../../libs/crispr-forms/src/lib/material/selected-file/selected-file.component.ts","../../../../libs/crispr-forms/src/lib/material/file-upload/file-dropzone.directive.ts","../../../../libs/crispr-forms/src/lib/material/material.module.ts","../../../../libs/crispr-forms/src/lib/form/form.component.ts","../../../../libs/crispr-forms/src/lib/form-group-list/form-group-list.component.ts","../../../../libs/crispr-forms/src/lib/sub-group/sub-group.component.ts","../../../../libs/crispr-forms/src/lib/field-component-map.const.ts","../../../../libs/crispr-forms/src/lib/field.directive.ts","../../../../libs/crispr-forms/src/lib/pipes/initial-control-value.pipe.ts","../../../../libs/crispr-forms/src/lib/crispr-forms.module.ts","../../../../libs/crispr-forms/src/tft-crispr-forms.ts"],"sourcesContent":["import { CrisprControlConfig } from '../models';\nimport { Observable } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { ControlType, FieldDescriptors, MatFieldProperties } from './crispr-field.config';\n\nexport interface SelectFieldConfig extends Omit<CrisprControlConfig, 'placeholder'>,\n FieldDescriptors,\n MatFieldProperties {\n controlType: ControlType.SELECT,\n emptyOptionsMessage?: string;\n multiple?: boolean;\n enableToggleAll?: boolean;\n options: OptionsType;\n}\n\nexport type OptionsType = SelectOption[] | Observable<SelectOption[]> | OptionsCallback | Promise<SelectOption[]>;\n\nexport type OptionsCallback = (group?: FormGroup) => OptionsType;\nexport type ReactiveOptionsCallback = (group?: FormGroup) => Observable<SelectOption[]>;\n// tslint:disable-next-line: max-line-length\nexport type AutocompleteOptionsCallback = (group?: FormGroup, searchTerm?: string) => OptionsType;\nexport interface SelectOption {\n label: string;\n value: any;\n imageUrl?: string;\n}\n\nexport const DEFAULT_EMPTY_OPTIONS_MESSAGE = 'No Items';\n","import { FormGroup, ValidatorFn } from '@angular/forms';\nimport { Observable, ObservableInput } from 'rxjs';\nimport { TooltipPosition } from '@angular/material/tooltip';\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\n\nimport { ErrorDictionary } from '@tft/form-validation-handler';\nimport {\n ComputeFieldConfig,\n CheckControlConfig,\n CheckControlsConfig,\n} from '../form.helpers';\nimport {\n SelectFieldConfig,\n HeadingConfig,\n ButtonConfig,\n DatepickerFieldConfig,\n InputFieldConfig,\n CheckboxFieldConfig,\n TextareaFieldConfig,\n AutocompleteFieldConfig,\n FormGroupListConfig,\n AutocompleteChiplistFieldConfig,\n SliderFieldConfig,\n DividerConfig,\n SelectOption,\n RadioFieldConfig\n} from '../models';\n\nimport { ThemePalette } from '@angular/material/core';\nimport { FileUploadFieldConfig } from './file-upload-field.config';\nimport { UnitConversionFieldConfig } from './unit-conversion-field.config';\n\n// export type ControlType = keyof typeof FIELD_COMPONENTS;\nexport enum ControlType {\n AUTOCOMPLETE = 'autocomplete',\n AUTOCOMPLETE_CHIPLIST = 'autocompleteChiplist',\n BUTTON = 'button',\n CHECKBOX = 'checkbox',\n CUSTOM = 'custom',\n DATEPICKER = 'datepicker',\n DIVIDER = 'divider',\n FILE_UPLOAD = 'fileUpload',\n HEADING = 'heading',\n INPUT = 'input',\n GROUP_LIST = 'groupList',\n RADIO = 'radio',\n SELECT = 'select',\n SLIDER = 'slider',\n SUB_GROUP = 'subGroup',\n TEXTAREA = 'textarea',\n UNIT_CONVERSION = 'unitConversion',\n}\n\n/**\n * The base interface for all the fields in the form's config\n */\nexport interface CrisprFieldConfig {\n controlType?: ControlType;\n classes?: string[];\n component?: any; // TODO: Define this better\n}\n\n// export function isCustomConfig(config: AnyFieldConfig): config is CustomFieldConfig {\n// return 'component' in config;\n// }\n// export interface CustomFieldConfig extends CrisprFieldConfig {\n// controlType: ControlType.CUSTOM;\n// component?: any; // TODO: type better\n// }\ntype RestrictedControlName<M> = M extends null ? string : keyof M;\n/**\n * The base interface for all control configs\n */\nexport interface CrisprControlConfig<M = null> extends CrisprFieldConfig {\n controlName: RestrictedControlName<M>\n controlType: ControlType;\n validators?: ValidatorFn[];\n // TODO: Determine if this is necessary\n /**\n * @deprecated please us computeValue instead\n */\n computeFieldConfig?: ComputeFieldConfig;\n computeValue?: (group: FormGroup) => Observable<unknown>;\n disabledCallback?: (group: FormGroup, config?: any) => Observable<boolean>;\n disabledCallbackConfig?: CheckControlConfig | CheckControlsConfig | any; // any is required for user defined configs\n hideDisabled?: boolean; // defaults to false\n heading?: HeadingConfig;\n}\n\n/**\n * Holds properties for control fields that describe field behavior to users\n */\nexport interface FieldDescriptors {\n label?: string;\n info?: Info;\n fieldSuffix?: string;\n placeholder?: string;\n}\n\nexport interface MatFieldProperties {\n appearance?: MatFormFieldAppearance;\n color?: ThemePalette;\n}\n\nexport interface Info {\n content: string;\n tooltipPosition?: TooltipPosition;\n iconName?: string;\n}\n\n// TODO: having AnyFieldConfig as the default for C seems redundant and silly\nexport interface AbstractGroupConfig<C extends CrisprFieldConfig = AnyFieldConfig, M = any> {\n // this union is needed, it joins any custom config provided by users to our default config options\n fields?: (AnyFieldConfig | C)[];\n}\nexport interface FormConfig<C = AnyFieldConfig> extends AbstractGroupConfig<C> {\n classes?: string[];\n errorDictionary?: ErrorDictionary;\n autocomplete?: 'off' | 'on';\n validators?: ValidatorFn[]\n}\n/**\n * Configuration for SubGroup components\n */\nexport interface SubGroupConfig extends CrisprControlConfig, AbstractGroupConfig {\n controlType: ControlType.SUB_GROUP;\n}\n\nexport type AnyFieldConfig = InputFieldConfig\n | SelectFieldConfig\n | RadioFieldConfig\n | FormGroupListConfig\n | SubGroupConfig\n | AutocompleteFieldConfig\n | AutocompleteChiplistFieldConfig\n | TextareaFieldConfig\n | CheckboxFieldConfig\n | DatepickerFieldConfig\n | SliderFieldConfig\n | FileUploadFieldConfig\n | HeadingConfig\n | ButtonConfig\n | DividerConfig\n | UnitConversionFieldConfig;\n // | CustomFieldConfig;\n\n\nexport type ControlValue<T = any> = boolean | string | number | Date | SelectOption | SelectOption[] | ControlGroupValue | T;\n\nexport type ControlGroupValue = {[key: string]: ControlValue};\n","import { CrisprFieldConfig, ControlType } from '../models';\nimport { FieldDescriptors } from './crispr-field.config';\n// This is done different from the rest of the fields because\n// when we use the heading inside of a field we don't want to have to\n// pass a controlType\nexport interface HeadingConfig extends\n Omit<CrisprFieldConfig, 'controlType'>,\n Omit<FieldDescriptors, 'placeholder' | 'fieldSuffix'> {\n // controlType is optional here because this component can be used as a crispr field where it needs a ControlType\n // or by a crispr field where it doesn't need a ControlType\n controlType?: ControlType.HEADING;\n typographyClass?: string;\n label: string;\n};\n","import { map } from 'rxjs/operators';\n\nexport function valueIn (values: string[]) {\n return map( (value: string) => {\n if (value) {\n return values.some(v => {\n if (isRegex(v)) {\n const trimmedStringForRegex = v.substr(1, v.length - 2);\n const regex = new RegExp(trimmedStringForRegex);\n return regex.test(value);\n } else {\n return v === value;\n }\n });\n } else {\n return false;\n }\n });\n}\n\nfunction isRegex(string: string) {\n return string.startsWith('/') && string.endsWith('/');\n}\n","import {\n SelectOption,\n AnyFieldConfig,\n FormConfig,\n ControlType,\n FormGroupListConfig,\n CrisprControlConfig,\n OptionsType,\n AutocompleteOptionsCallback,\n CrisprFieldConfig,\n ControlValue\n} from './models';\nimport {\n from,\n Observable,\n of,\n isObservable,\n combineLatest,\n OperatorFunction\n} from 'rxjs';\nimport { FormGroup, FormArray, FormControl } from '@angular/forms';\nimport { valueIn } from './form.operators';\nimport { map, startWith } from 'rxjs/operators';\n\n/**\n * DYNAMIC FORM UTILS: a collection of pure/mostly pure functions that are useful both internally and for\n * developing the consuming app.\n *\n * They are sorted by use case: building out the form object; helper functions to use with the disabled$ function;\n * helper functions to use with the compute field function; and other logic shared between components\n */\n\n/**\n * Required configuration to use with checkControlForValues function\n */\nexport interface CheckControlConfig {\n // the control name to watch\n controlName: string;\n // the values to watch for\n values: string[];\n // the function to run on the boolean returned by the watcher\n evaluate?: (isValueInValues: boolean) => boolean;\n}\n\n/**\n* Watches a single control for a list of values, returns true when field value matches any value in list\n* unless an evaluate method is found on config, in which case that method is run on the returned boolean value\n* @param group the direct parent of the field we want to watch\n* @param config\n*/\nexport function checkControlForValues(group: FormGroup, config: CheckControlConfig): Observable<boolean> {\n // check that all the pieces we need are available\n if (config && config.controlName && Array.isArray(config.values)) {\n return getValueChanges(group, config.controlName).pipe(\n // return a boolean, true if value is in the values being watch for, otherwise false\n valueIn(config.values),\n map((isValueInValues: boolean) => {\n // since we can only check if the value is in the list of watched values, the evaluate function gives us\n // a chance to make other decisions based on if the boolean returned, e.g. return true if value not in watched values\n if ( config.evaluate && config.evaluate instanceof Function ) {\n return config.evaluate(isValueInValues);\n } else { return isValueInValues; }\n })\n );\n } else {\n //\n return of(true);\n }\n}\n\n/**\n * The required configuration for running the checkControlsForValues function.\n */\nexport interface CheckControlsConfig {\n // an array of controls to watch and the values to check for\n watchConfigs: CheckControlConfig[];\n // the function to run against the array of current field valueIn responses\n evaluate?: ( bools: boolean[] ) => boolean;\n}\n\n/**\n * Watches a list of fields for individual lists of values returning true when any field contains one\n * of the values being watched for, or optionally running a function on the array of resolved booleans\n * from the listed fields and returning a boolean\n * @param group the form group that has the fields to watch as direct descendants\n * @param config the configuration to use when calling the function\n */\nexport function checkControlsForValues(group: FormGroup, config: CheckControlsConfig): Observable<any> {\n // if no config is passed we just want to show the field, so we return an observable of true\n if (!config || !config.watchConfigs) { return of(true); }\n // we run checkControlForValues on every control in the list of WatchConfigs creating\n // an array of Observable watching fields for values\n const fieldTriggers = config.watchConfigs.map(watchConfig => {\n // resolves a boolean, true when field value matches a watched value, otherwise false\n return checkControlForValues(group, watchConfig);\n });\n\n return combineLatest(\n fieldTriggers\n ).pipe(\n startWith([true]),\n map((booleans: boolean[]) => {\n // if the user passed an evaluate function use it\n if (config.evaluate && config.evaluate instanceof Function) {\n return config.evaluate(booleans);\n } else { // otherwise we return true if any of the watched fields resolve to true\n return booleans.some(bool => bool);\n }\n })\n );\n}\n\n/**\n * The required configuration when running the computeValue function\n */\nexport interface ComputeFieldConfig<T = any, RT = any> {\n // array of control names who's values we want to watch\n controlNamesToWatch: string[];\n // the function we want to call on the array of watched values to compute the value of the control we\n computeCallback: (\n values: (T)[]\n ) => RT;\n}\n\n/**\n * Watches values on an array of fields, computing their values as they change\n * @param group the group to get the fields from, for now it can only be the parent of the computed field\n * @param computeFieldsConfig the configuration that drives the computation, holds the names to watch and the\n * computation function that get called against the array of values\n */\nexport function computeValueFromFields(group: FormGroup, computeFieldsConfig: ComputeFieldConfig): Observable<any> {\n // TODO: better checking\n const { controlNamesToWatch } = computeFieldsConfig;\n //creates an observable listener for each control in the controlNamesToWatch array\n return combineLatest(\n controlNamesToWatch.map(controlNameToWatch => getValueChanges(group, controlNameToWatch))\n ).pipe(\n // each time a watched field values changes a new array of the latest field values is pipe through to the\n // compute callback. Which runs the users logic on the values to compute this fields value\n map(valuesArray => computeFieldsConfig.computeCallback(valuesArray)),\n );\n}\n\n/**\n * A simple wrapper for doing error checking around getting the valueChanges observable from a control on a form group\n * @param group the form group we want to pull the observable from\n * @param controlName the name of the control who's value we want to subscribe to\n */\nfunction getValueChanges(group: FormGroup, controlName: string) {\n const control = group.get(controlName);\n if (!control) {\n throw new Error(`No control with controlName ${controlName}`, );\n }\n return control.valueChanges;\n}\n/**\n * TODO: move to utils library after library is built\n * Allows developer to pass an array of operators into the pipe of an Observable.\n * Useful for creating function with a variable amount of operators to be run\n * @param observable the observable to pass the operators to\n * @param operators array of operators to pipe\n */\nfunction pipeOperatorsIntoObservable(observable: Observable<any>, operators: OperatorFunction<any, any>[]) {\n try {\n return operators.reduce((obs: Observable<{}>, op: OperatorFunction<{}, {}>) => {\n return obs.pipe(op);\n }, observable);\n } catch {\n console.error('Unable to pipe operators into observable');\n return of(null);\n }\n}\n\n\nexport function callOptionsIfFunction(\n options: OptionsType | AutocompleteOptionsCallback,\n parentGroup?: FormGroup,\n searchString?: string\n): OptionsType {\n return options instanceof Function ? options(parentGroup, searchString) : options;\n}\n/**\n * The user can give us select options as an array, a function that resolves to a promise,\n * or an observable. This functions consumes any of those and returns an observable that\n * resolves an array of options\n *\n * @param options the options passed in from the config\n * @param emptyMessageOption the message to display when the array is empty\n */\nexport function observablifyOptions(\n options: OptionsType,\n parentGroup: FormGroup,\n searchString?: string,\n): Observable<SelectOption[]> {\n const calledOptions = callOptionsIfFunction(options, parentGroup, searchString);\n // if options are a promise\n return calledOptions instanceof Promise\n // convert to observable\n ? from(calledOptions)\n // if array that isn't empty\n : Array.isArray(calledOptions) && calledOptions.length\n // convert to observable\n ? of(calledOptions)\n // if observable\n : isObservable(calledOptions)\n // return it\n ? calledOptions\n // else an empty array\n : of([]);\n}\n\n/**\n * Determines if the field config is for a form control (not a divider, heading or other non-control field)\n * */\nexport function isControlConfig(fieldConfig: CrisprFieldConfig): fieldConfig is CrisprControlConfig {\n return 'controlName' in fieldConfig;\n}\n/**\n * builds out form group based on config\n * @param config a configuration for a form group\n * @param value an object of initial values to pass in\n * @param group the form group to modify and build out\n */\nexport function buildFormGroupFromConfig(config: FormConfig, value = null, group: FormGroup = new FormGroup({}) ) {\n config.fields.forEach( (controlConfig: AnyFieldConfig) => {\n if (isControlConfig(controlConfig)) {\n // then add a control to the group using the controlName from configuration\n const {controlName} = controlConfig;\n // if there's a value object and it has a non-null/undefined value for this field use it.\n // Otherwise, default to null\n const controlValue = (value && value[controlName]) ?? null;\n group.addControl(controlName, createControlForType(controlConfig, controlValue));\n }\n });\n group.setValidators(config.validators);\n return group;\n}\n\n/**\n * Analyze the config and build a form control to spec. Notice we don't use FormBuilder here\n * as we want to keep this function pure.\n * @param controlConfig the configuration object for the control to build\n * @param value an initial value to use if passed in\n */\nexport function createControlForType(controlConfig: AnyFieldConfig, value: ControlValue = null) {\n // build form control out based on the control type\n const control = controlConfig.controlType === ControlType.SUB_GROUP\n ? buildFormGroupFromConfig(controlConfig as FormConfig, value)\n : controlConfig.controlType === ControlType.GROUP_LIST\n ? new FormArray([], (controlConfig as FormGroupListConfig).validators)\n : new FormControl(\n value || null,\n (controlConfig as CrisprControlConfig).validators\n );\n\n return control;\n}\n\n/**\n * A basic filter function that filters the search string against the label of the options object\n * @param options the array of options to filter\n * @param searchString the string from the input\n */\nexport function filterOptionsByLabel(options: SelectOption[], searchString: string) {\n return options.filter(option => {\n return option.label && option.label.toLowerCase().includes(searchString.toLowerCase());\n });\n}\n","import { FormGroup, AbstractControl } from '@angular/forms';\nimport { CrisprControlConfig, ControlValue, ControlType } from '../models';\nimport { CrisprFieldComponent } from './crispr-field.abstract';\n\nexport function crisprControlMixin<C extends CrisprControlConfig>(BaseClass: typeof CrisprFieldComponent) {\n return class extends BaseClass<C> {\n config: C;\n group: FormGroup;\n control: AbstractControl;\n\n _value: ControlValue;\n set value(value: ControlValue) {\n this.setControlValue(value);\n this._value = value;\n }\n\n get value() {\n return this._value;\n }\n\n ngOnInit() {\n super.ngOnInit();\n this.control = this.group.get(this.config.controlName);\n this.setControlValue(this.value);\n // setTimeouts are ugly but this seems to be the only way to get the computed field to compute initial values\n setTimeout(()=> {\n this.control.updateValueAndValidity();\n })\n }\n\n setControlValue(value: ControlValue) {\n if(value && this.control && this.config.controlType !== ControlType.SUB_GROUP) {\n this.control.setValue(value)\n }\n }\n }\n}\n","import {\n CrisprFieldConfig,\n} from '../models';\nimport { OnInit, Directive } from '@angular/core';\n\n@Directive()\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport abstract class CrisprFieldComponent<C extends CrisprFieldConfig> implements OnInit {\n config: C;\n defaultConfig?: Partial<C>\n\n ngOnInit() {\n this.applyDefaultConfig();\n }\n\n applyDefaultConfig() {\n this.config = this.defaultConfig ? {...this.defaultConfig, ...this.config} : this.config;\n }\n}\n\n\n","import { OnInit, Directive } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { Observable, of } from 'rxjs';\nimport { catchError, debounceTime, distinctUntilChanged, map, startWith, switchMap, tap } from 'rxjs/operators';\n\nimport { crisprControlMixin } from './crispr-control.mixin';\nimport { AutocompleteFieldConfig, AutocompleteChiplistFieldConfig, SelectOption } from '../models';\nimport { CrisprFieldComponent } from './crispr-field.abstract';\nimport { observablifyOptions } from '../form.helpers';\n\ntype AutocompleteConfigTypes = AutocompleteFieldConfig | AutocompleteChiplistFieldConfig;\n\nconst AbstractAutocompleteFieldMixin = crisprControlMixin<AutocompleteConfigTypes>(CrisprFieldComponent);\n\n@Directive()\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport class AbstractAutocompleteComponent<C>\n extends AbstractAutocompleteFieldMixin implements OnInit {\n // we need a separate control for the UI because of the way the material autocomplete chiplist works\n autocompleteInputControl = new FormControl('');\n options$: Observable<SelectOption[]>\n config: AutocompleteConfigTypes & C;\n ngOnInit() {\n super.ngOnInit();\n\n this.group.addControl(this.config.controlName, new FormControl());\n // filter options by the search string using either the default filter function or one passed in through config\n this.options$ = this.autocompleteInputControl.valueChanges.pipe(\n // this is needed to have the options panel to open on focus\n startWith(''),\n debounceTime(this.config.typeDebounceTime),\n distinctUntilChanged(),\n map(searchText => searchText || ''),\n switchMap((searchText: string) => observablifyOptions(this.config.options, this.group, searchText))\n );\n }\n}\n","import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { InputFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\n\nconst InputFieldMixin = crisprControlMixin<InputFieldConfig>(CrisprFieldComponent);\n@Component({\n selector: 'crispr-input-field',\n templateUrl: './input-field.component.html',\n styleUrls: ['./input-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class InputFieldComponent extends InputFieldMixin implements OnInit {\n\n defaultConfig: Partial<InputFieldConfig> = {inputType: 'text'};\n constructor() {\n super();\n }\n\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy, ViewChild, AfterViewInit } from '@angular/core';\n import { Observable } from 'rxjs';\n\nimport { SelectFieldConfig, SelectOption } from '../../models';\nimport { observablifyOptions } from '../../form.helpers';\nimport { CrisprFieldComponent, crisprControlMixin } from '../../abstracts';\nimport { MatSelect } from '@angular/material/select';\nimport { ThemePalette } from '@angular/material/core';\n\nconst SelectFieldMixin = crisprControlMixin<SelectFieldConfig>(CrisprFieldComponent);\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})\nexport class SelectFieldComponent extends SelectFieldMixin implements OnInit, AfterViewInit {\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","import { Component, OnInit, ViewChild, ChangeDetectionStrategy, ElementRef } from '@angular/core';\nimport { MatAutocompleteTrigger, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\n\nimport { SelectOption, AutocompleteFieldConfig, DEFAULT_EMPTY_OPTIONS_MESSAGE } from '../../models';\nimport { AbstractAutocompleteComponent } from '../../abstracts';\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})\nexport class AutocompleteFieldComponent\n extends AbstractAutocompleteComponent<AutocompleteFieldConfig>\n implements OnInit {\n\n defaultConfig = defaultConfig;\n @ViewChild('autoInput', { read: MatAutocompleteTrigger }) autoInput: MatAutocompleteTrigger;\n @ViewChild('autoInput') autoInputRef: ElementRef<HTMLInputElement>;\n\n ngOnInit() {\n super.ngOnInit();\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 return (value: any) => {\n return !!options && Array.isArray(options)\n ? options.find(option => option.value === value)?.label\n : value;\n };\n }\n\n handleSelect(event: MatAutocompleteSelectedEvent) {\n this.control.setValue(event.option.value)\n this.autoInputRef.nativeElement.blur();\n }\n}\n\n","import { Component, OnInit, ChangeDetectionStrategy, ViewChild, ElementRef } from '@angular/core';\nimport { map, tap } from 'rxjs/operators';\nimport { MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';\nimport { Observable, BehaviorSubject, combineLatest } from 'rxjs';\nimport { ENTER } from '@angular/cdk/keycodes';\n\nimport { AutocompleteChiplistFieldConfig, DEFAULT_EMPTY_OPTIONS_MESSAGE, SelectOption } from '../../models';\nimport { AbstractAutocompleteComponent } from '../../abstracts';\nimport { MatChipInputEvent } from '@angular/material/chips';\n\nconst defaultConfig: Partial<AutocompleteChiplistFieldConfig> = {\n chipsSelectable: true,\n areChipsRemovable: true,\n tabToSelect: true,\n autoActiveFirstOption: true,\n imageUrlParam: 'image',\n typeDebounceTime: 500,\n allowDuplicates: false,\n duplicateCompareFunction: (chip, option) => chip.value === option.value,\n separatorKeyCodes: [ENTER],\n emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,\n}\n\n@Component({\n selector: 'crispr-autocomplete-chiplist-field',\n templateUrl: './autocomplete-chiplist-field.component.html',\n styleUrls: ['./autocomplete-chiplist-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AutocompleteChiplistFieldComponent\n extends AbstractAutocompleteComponent<AutocompleteChiplistFieldConfig> implements OnInit {\n defaultConfig = defaultConfig;\n chips$ = new BehaviorSubject<SelectOption[]>([]);\n remainingOptions$: Observable<SelectOption[]>;\n\n controlValue$ = this.chips$.pipe(\n tap(chips => {\n this.control.setValue(chips.map(chip => chip.value))\n })\n );\n\n\n // We need use ViewChild twice on the same template ref to access as different types\n // - the MatAutocompleteTrigger is used to for selecting value on tab\n // - the ElementRef<HTMLInputElement> is used to clear the value from input element on selection\n @ViewChild('autoInput', { read: MatAutocompleteTrigger }) chipInput: MatAutocompleteTrigger;\n @ViewChild('autoInput') chipInputRef: ElementRef<HTMLInputElement>;\n\n\n ngOnInit() {\n super.ngOnInit();\n this.remainingOptions$ = combineLatest([\n this.chips$,\n this.options$\n ]).pipe(\n map(([chips, options]) => {\n return this.config.allowDuplicates\n ? options\n : options?.filter(option => {\n return !chips.some(chip => this.config.duplicateCompareFunction(chip, option));\n });\n })\n )\n }\n\n setControlValue(value: SelectOption[]) {\n if (value) {\n this.chips$.next(value);\n }\n }\n\n // handles mat selecting\n handleSelect(event: MatAutocompleteSelectedEvent) {\n const selectedOption: SelectOption = event.option.value as SelectOption;\n this.chips$.next([...this.chips$.value, selectedOption]);\n this.chipInputRef.nativeElement.value = '';\n this.autocompleteInputControl.setValue('');\n // setTimeout needed because the panel thinks it's still open at this point\n setTimeout(() => this.chipInput.openPanel())\n }\n\n /**\n * To follow ARIA standards we want to select the active option on blur.\n * matChipInputAddOnBlur should do this but it causes buggy behaviour\n * @param event blur event that triggers the handle blur\n */\n handleTab(_event: FocusEvent) {\n if (this.chipInput.activeOption && (this.config.tabToSelect || this.config.addChipOnBlur)) {\n const chip = this.chipInput.activeOption.value;\n this.chips$.next([...this.chips$.value, chip]);\n }\n }\n\n /**\n * Handles selection via key tokens passed through separatorKeyCodes propert\n * NOTE: If TAB is used focus does not move on to next component\n * @param event\n */\n handleTokenEnd(event: MatChipInputEvent) {\n if (this.chipInput.activeOption) {\n this.chipInput.activeOption.select();\n }\n event.chipInput?.clear();\n }\n\n mapToLabel(option: SelectOption) {\n return option ? option.label : '';\n }\n\n removeChip(removedChip: SelectOption) {\n const remainingChips: SelectOption[] = this.chips$.value.filter(chip => chip !== removedChip);\n this.chips$.next(remainingChips);\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { CheckboxFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\n\nconst defaultConfig: Partial<CheckboxFieldConfig> = {\n labelPosition: 'after',\n inline: false\n}\nconst CheckboxFieldMixin = crisprControlMixin<CheckboxFieldConfig>(CrisprFieldComponent);\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})\nexport class CheckboxFieldComponent extends CheckboxFieldMixin implements OnInit {\n\n defaultConfig = defaultConfig;\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { TextareaFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\n\nconst defaultConfig: Partial<TextareaFieldConfig> = {rows: 5};\nconst TextareaFieldMixin = crisprControlMixin<TextareaFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-textarea-field',\n templateUrl: './textarea-field.component.html',\n styleUrls: ['./textarea-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TextareaFieldComponent extends TextareaFieldMixin implements OnInit {\n defaultConfig = defaultConfig;\n\n ngOnInit() {\n super.ngOnInit()\n }\n}\n\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { SliderFieldConfig } from '../../models';\nimport { CrisprFieldComponent, crisprControlMixin } from '../../abstracts';\n\nconst defaultConfig = {displayLimits: true};\nconst SliderFieldMixin = crisprControlMixin<SliderFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-slider-field',\n templateUrl: './slider-field.component.html',\n styleUrls: ['./slider-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SliderFieldComponent extends SliderFieldMixin implements OnInit {\n\n defaultConfig = defaultConfig;\n constructor() {\n super();\n }\n\n get flexDirection() {\n return this.config.vertical ? 'column' : 'row';\n }\n\n ngOnInit() {\n super.ngOnInit();\n }\n\n}\n","\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ButtonConfig } from '../../models';\nimport { Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { CrisprFieldComponent } from '../../abstracts';\n\n@Component({\n selector: 'crispr-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ButtonComponent extends CrisprFieldComponent<ButtonConfig> implements OnInit {\n\n group: FormGroup;\n defaultConfig: Partial<ButtonConfig> = {buttonType: 'raised', type: 'submit'};\n formValid$: Observable<boolean>\n\n get matButtonClass () {\n return this.config.buttonType ? `mat-${this.config.buttonType}-button` : '';\n }\n\n ngOnInit() {\n super.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","import { Component, OnInit, ChangeDetectionStrategy, AfterContentInit } from '@angular/core';\nimport { DatepickerFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\nimport { MatCalendarCellClassFunction } from '@angular/material/datepicker';\nimport { Moment } from 'moment';\nimport { Observable, of } from 'rxjs';\nimport { ComponentPortal, Portal } from '@angular/cdk/portal';\n\nconst defaultConfig: Partial<DatepickerFieldConfig> = {\n startView: 'month',\n}\nconst DatepickerFieldMixin = crisprControlMixin<DatepickerFieldConfig>(CrisprFieldComponent);\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})\nexport class DatepickerFieldComponent extends DatepickerFieldMixin implements OnInit, AfterContentInit {\n\n defaultConfig = defaultConfig;\n\n dateClass: MatCalendarCellClassFunction<Moment>;\n dateClass$: Observable<MatCalendarCellClassFunction<Moment>>;\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 this.startAt$ = this.config.startAt instanceof Date\n ? of(this.config.startAt)\n : this.config.startAt instanceof Function\n ? this.config.startAt(this.group)\n : of(null);\n this.dateClass = this.config?.cellClassFunction || null\n this.dateClass$ = this.config.dateClass ? this.config?.dateClass(this.group) : of(() => '');\n }\n\n ngAfterContentInit() {\n if (this.config.datepickerActions) {\n this.calendarFooterPortal = new ComponentPortal(this.config.datepickerActions);\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","import {\n Component,\n ElementRef,\n ViewChild,\n OnInit,\n ChangeDetectionStrategy,\n Optional,\n Self\n} from '@angular/core';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { Observable, of } from 'rxjs';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\nimport { FileUploadFieldConfig } from '../../models/file-upload-field.config';\n\nconst FileUploadFieldMixin = crisprControlMixin<FileUploadFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FileUploadComponent extends FileUploadFieldMixin implements OnInit, ControlValueAccessor {\n\n onChange: () => void;\n\n defaultConfig: Partial<FileUploadFieldConfig> = {\n allowMultipleFiles: false,\n acceptedTypes: '*.*',\n dropZoneText: 'DROP FILE HERE',\n selectFilesButtonType: 'button',\n selectButtonText: 'SELECT',\n showClearFilesButton: true,\n clearFilesButtonText: 'CLEAR',\n uploadButtonText: 'UPLOAD',\n uploadButtonType: 'button',\n showUploadProgress: false,\n disableOnUpload: true\n }\n\n @ViewChild('fileInput') fileInputRef: ElementRef\n\n selectedFiles: FileList;\n\n isUploaded = false;\n\n fileProgress: Observable<number>[] = [];\n disabled$: Observable<boolean>;\n\n // ngControl: NgControl = null;\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n ) {\n super();\n if (this.ngControl != null) {\n // Setting the value accessor directly (instead of using\n // the providers) to avoid running into a circular import.\n ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit() {\n super.ngOnInit();\n this.disabled$ = this.config.disabledCallback\n ? this.config.disabledCallback(this.group, this.config)\n : of(false);\n }\n\n\n filesChanged(files: FileList): void {\n if (files && files.length > 0 ) {\n this.selectedFiles = files\n this.control.patchValue(files);\n }\n }\n\n uploadFiles() {\n if(this.selectedFiles && this.config.uploadFiles) {\n this.isUploaded = true;\n this.config.uploadFiles(this.group, this.selectedFiles, this);\n }\n }\n\n resetFileInput(): void {\n this.fileInputRef.nativeElement.value = ''\n this.control.patchValue(null);\n this.isUploaded = false;\n }\n\n writeValue( value: null ) {\n // clear file input\n // this.host.nativeElement.value = '';\n // this.file = null;\n }\n\n registerOnChange( fn: () => void ) {\n this.onChange = fn;\n }\n\n registerOnTouched( fn: () => void ) {\n }\n}\n","import { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { HeadingConfig } from '../../models';\nimport { CrisprFieldComponent } from '../../abstracts';\n\nconst defaultConfig: Partial<HeadingConfig> = {\n typographyClass: 'mat-h3'\n}\n@Component({\n selector: 'crispr-heading',\n templateUrl: './heading.component.html',\n styleUrls: ['./heading.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class HeadingComponent extends CrisprFieldComponent<HeadingConfig>{\n @Input() config: HeadingConfig;\n defaultConfig = defaultConfig;\n}\n","import { Component, OnInit } from '@angular/core';\nimport { DividerConfig } from '../../models';\nimport { CrisprFieldComponent } from '../../abstracts';\n\n@Component({\n selector: 'crispr-divider',\n templateUrl: './divider.component.html',\n styleUrls: ['./divider.component.scss']\n})\nexport class DividerComponent extends CrisprFieldComponent<DividerConfig> implements OnInit {\n // TODO: pull in type after configs are better organized\n defaultConfig = {};\n ngOnInit() {\n super.ngOnInit();\n }\n\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\n import { Observable } from 'rxjs';\n\nimport { SelectOption } from '../../models';\nimport { observablifyOptions } from '../../form.helpers';\nimport { CrisprFieldComponent, crisprControlMixin } from '../../abstracts';\nimport { RadioFieldConfig } from '../../models/radio-field.config';\n\nconst RadioFieldMixin = crisprControlMixin<RadioFieldConfig>(CrisprFieldComponent);\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})\nexport class RadioFieldComponent extends RadioFieldMixin 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","import { Component, OnInit, ChangeDetectionStrategy, OnDestroy } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { combineLatest, Observable, Subscription } from 'rxjs';\nimport { shareReplay, startWith, tap } from 'rxjs/operators';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\nimport { observablifyOptions } from '../../form.helpers';\nimport { SelectOption } from '../../models';\nimport { UnitConversionFieldConfig } from '../../models/unit-conversion-field.config';\n\nconst defaultConfig: Partial<UnitConversionFieldConfig> = {};\nconst UnitConversionFieldMixin = crisprControlMixin<UnitConversionFieldConfig>(CrisprFieldComponent);\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})\nexport class UnitConversionFieldComponent extends UnitConversionFieldMixin implements OnInit, OnDestroy {\n defaultConfig = defaultConfig;\n\n displayValueControl = new FormControl();\n unitSelectControl = new FormControl();\n unitOptions$: Observable<SelectOption[]>;\n\n transformationSubscription: Subscription;\n\n ngOnInit() {\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(startWith(this.displayValueControl.value))\n ];\n // setup all required pieces when showing a field for selecting units\n if (this.config.showUnitSelect) {\n this.unitOptions$ = observablifyOptions(this.config.selectableUnits, this.group)\n controlValuePipeline.push(this.unitSelectControl.valueChanges.pipe(startWith(this.config?.initialDisplayUnit || null)));\n this.unitSelectControl.setValue(this.config?.initialDisplayUnit || null);\n }\n\n this.transformationSubscription = combineLatest(controlValuePipeline).subscribe(([displayValue, unitValue] )=> {\n const computedValue = this.config.storedValueConversion(displayValue, unitValue);\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(storedValue || null, unit);\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 initialUnitValue = this.config.showUnitSelect ? this.config?.initialDisplayUnit : null;\n this.setInitialDisplayValue(value, initialUnitValue);\n }\n}\n","import { Component, OnInit, Input, ChangeDetectionStrategy, OnDestroy } from '@angular/core';\nimport { CrisprControlConfig } from '../models';\nimport { Observable, of, Subscription } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { tap, distinctUntilChanged } from 'rxjs/operators';\nimport { computeValueFromFields } from '../form.helpers';\n\n@Component({\n selector: 'crispr-field-container',\n templateUrl: './field-container.component.html',\n styleUrls: ['./field-container.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldContainerComponent implements OnInit, OnDestroy {\n // the configuration object for the field\n @Input() config: CrisprControlConfig;\n // the parent formGroup\n @Input() group: FormGroup;\n // boolean whether field-container is inline\n @Input() inlineField = false;\n // used to determine whether or not field should be shown\n disabled$: Observable<boolean>;\n\n subs: Subscription[] = [];\n\n ngOnInit() {\n this.disabled$ = this.connectDisabledCallback(this.group, this.config);\n // we tried moving this into afterViewChecked and afterContentChecked lifecycle hooks without any luck\n if (this.config.computeValue) {\n this.subs.push(\n this.config.computeValue(this.group).pipe(\n distinctUntilChanged(),\n tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))\n ).subscribe(),\n );\n } else if (this.config.computeFieldConfig) {\n console.warn(`computeFieldConfig property is deprecated, please use computeValue. Example here: https://stackblitz.com/github/nayfin/tft-documentation?file=src%2Fapp%2Fcrispr-forms-demo%2Ffeatures%2Fcomputed-field%2Fcomputed-field.component.ts`)\n this.subs.push(\n computeValueFromFields(this.group, this.config.computeFieldConfig).pipe(\n distinctUntilChanged(),\n tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))\n ).subscribe(),\n );\n }\n }\n\n ngOnDestroy(): void {\n this.subs.forEach(sub => sub.unsubscribe);\n }\n /**\n * Connects user defined disabledCallback function to the the view, so that the control is enabled/disabled\n * appropriately. It also keeps the form will hide disabled fields in the UI unless `hideDisabled` is set to\n * false in the controls config\n * @param group used to get valueChanges from control\n * @param config configuration object used to\n */\n connectDisabledCallback(group: FormGroup, config: CrisprControlConfig = null) {\n const control = group.get(config.controlName);\n // If the disabled$ function exists on the field config then call it with the disabledCallbackConfig\n // as a parameter otherwise return an observable of true.\n return config?.disabledCallback && config.disabledCallback instanceof Function\n ? config.disabledCallback(group, config.disabledCallbackConfig || null).pipe(\n // This enables/disables when callback conditions are met\n tap((shouldDisable) => shouldDisable ? control.disable() : control.enable())\n )\n : of(false);\n }\n}\n","import { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { Info } from '../../models';\n\n@Component({\n selector: 'crispr-info',\n templateUrl: './info.component.html',\n styleUrls: ['./info.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class InfoComponent {\n\n @Input() info: Info;\n\n}\n","import { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { SelectOption } from '../../models';\n\n@Component({\n selector: 'crispr-option',\n templateUrl: './option.component.html',\n styleUrls: ['./option.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OptionComponent {\n\n @Input() option: SelectOption\n\n}\n","import { Component, Input } from '@angular/core';\nimport { ThemePalette } from '@angular/material/core';\n\n@Component({\n selector: 'crispr-selected-file',\n templateUrl: './selected-file.component.html',\n styleUrls: ['./selected-file.component.scss']\n})\nexport class SelectedFileComponent {\n\n @Input() fileName: string;\n @Input() progress: number;\n @Input() showProgress: boolean;\n @Input() color: ThemePalette;\n\n}\n","import { Directive, HostListener, Output, EventEmitter, Input } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[crisprFileDropzone]'\r\n})\r\nexport class FileDropzoneDirective {\r\n\r\n @Output() fileDrop = new EventEmitter<FileList>();\r\n\r\n @Input() crisprFileDropzone = true;\r\n\r\n @HostListener('drop', ['$event'])\r\n onDrop($event: DragEvent) {\r\n if(this.crisprFileDropzone) {\r\n $event.preventDefault();\r\n this.fileDrop.emit($event.dataTransfer.files);\r\n }\r\n }\r\n\r\n // Prevents DOM from trying to open file in browser\r\n @HostListener('dragover', ['$event'])\r\n onDragOver($event: DragEvent) {\r\n if(this.crisprFileDropzone) {\r\n $event.preventDefault();\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\nimport { FieldContainerComponent } from '../field-container/field-container.component';\nimport { InputFieldComponent } from './input-field/input-field.component';\nimport { SelectFieldComponent } from './select-field/select-field.component';\nimport { AutocompleteFieldComponent } from './autocomplete-field/autocomplete-field.component';\nimport { CheckboxFieldComponent } from './checkbox-field/checkbox-field.component';\nimport { TextareaFieldComponent } from './textarea-field/textarea-field.component';\nimport { ButtonComponent } from './button/button.component';\nimport { DatepickerFieldComponent } from './datepicker-field/datepicker-field.component';\nimport { MatMomentDateModule } from '@angular/material-moment-adapter';\nimport { HeadingComponent } from './heading/heading.component';\nimport { InfoComponent } from './info/info.component';\nimport { SliderFieldComponent } from './slider-field/slider-field.component';\nimport { DividerComponent } from './divider/divider.component';\n// tslint:disable-next-line: max-line-length\nimport { AutocompleteChiplistFieldComponent } from './autocomplete-chiplist-field/autocomplete-chiplist-field.component';\nimport { OptionComponent } from './option/option.component';\nimport { RadioFieldComponent } from './radio-field/radio-field.component';\nimport { FileUploadComponent } from './file-upload/file-upload.component';\nimport { SelectedFileComponent } from './selected-file/selected-file.component';\nimport { FileDropzoneDirective } from './file-upload/file-dropzone.directive';\nimport { UnitConversionFieldComponent } from './unit-conversion-field/unit-conversion-field.component';\nimport { PortalModule } from '@angular/cdk/portal';\n\n// TODO: Should we import UI library?\n// Will the tree shaker shake the unused modules?\nconst MAT_DESIGN_MODULES = [\n MatIconModule,\n MatAutocompleteModule,\n MatDatepickerModule,\n MatInputModule,\n MatRadioModule,\n MatSelectModule,\n MatCheckboxModule,\n MatChipsModule,\n MatSliderModule,\n MatSlideToggleModule,\n MatButtonModule,\n MatButtonToggleModule,\n MatChipsModule,\n MatTooltipModule,\n MatFormFieldModule,\n MatMomentDateModule,\n MatDividerModule,\n MatProgressBarModule,\n PortalModule\n];\n\nconst CRISPR_FIELDS = [\n FieldContainerComponent,\n InputFieldComponent,\n SelectFieldComponent,\n RadioFieldComponent,\n AutocompleteFieldComponent,\n AutocompleteChiplistFieldComponent,\n CheckboxFieldComponent,\n TextareaFieldComponent,\n DatepickerFieldComponent,\n SliderFieldComponent,\n ButtonComponent,\n HeadingComponent,\n DividerComponent,\n FileUploadComponent,\n UnitConversionFieldComponent\n];\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n ...MAT_DESIGN_MODULES,\n ],\n exports: [\n ...MAT_DESIGN_MODULES,\n ...CRISPR_FIELDS\n ],\n declarations: [\n ...CRISPR_FIELDS,\n InfoComponent,\n OptionComponent,\n SelectedFileComponent,\n FileDropzoneDirective,\n ],\n entryComponents: CRISPR_FIELDS\n})\n\nexport class MaterialModule {\n}\n","import { Component, Input, OnInit, Output, EventEmitter, ChangeDetectionStrategy, OnDestroy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ControlGroupValue, ControlValue, FormConfig } from '../models';\nimport { buildFormGroupFromConfig } from '../form.helpers';\nimport { Subscription, Observable } from 'rxjs';\n@Component({\n selector: 'crispr-form',\n styleUrls: ['form.component.scss'],\n templateUrl: 'form.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CrisprFormComponent implements OnInit {\n // if no form has been passed in by consuming component, we create an empty group to build out\n @Input() config: FormConfig;\n @Input() form: FormGroup = new FormGroup({});\n @Input() value: ControlGroupValue = null;\n\n @Output() submitted = new EventEmitter<FormGroup>();\n // proxy value and status change events through to consuming component\n @Output() valueChanges: Observable<any> = this.form.valueChanges;\n @Output() statusChanges: Observable<string> = this.form.statusChanges;\n\n subs: Subscription[] = [];\n\n ngOnInit() {\n // build out the form, note that we pass in the form as the third argument and the function modifies it\n buildFormGroupFromConfig(this.config, this.value, this.form);\n }\n\n handleSubmit() {\n this.form.markAllAsTouched();\n this.submitted.emit(this.form);\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup, FormArray } from '@angular/forms';\n\nimport { FormGroupListConfig } from '../models';\nimport { createControlForType } from '../form.helpers';\nimport { CrisprFieldComponent, crisprControlMixin } from '../abstracts';\n\nconst defaultConfig: Partial<FormGroupListConfig> = {\n addItemLabel: 'ADD ITEM',\n minListLength: 1,\n};\n\nconst FormGroupListMixin = crisprControlMixin<FormGroupListConfig>(CrisprFieldComponent);\n@Component({\n selector: 'crispr-form-group-list',\n templateUrl: './form-group-list.component.html',\n styleUrls: ['./form-group-list.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormGroupListComponent extends FormGroupListMixin implements OnInit {\n defaultConfig = defaultConfig\n group: FormGroup;\n control: FormArray;\n _value: any[]\n // value: any[]; // TODO: not sure how to strongly type this yet\n formArray: FormArray;\n\n ngOnInit() {\n super.ngOnInit();\n // TODO: this is required to ngFor of controls in template, must be a better way\n this.formArray = this.control as FormArray;\n }\n\n setControlValue(values: any[]) {\n if(values && this.control) {\n values.forEach(value => this.addGroup(value));\n } else if (this.config.minListLength > 0) {\n this.addGroup()\n }\n }\n\n addGroup(value = null) {\n this.control.push(createControlForType(this.config.itemConfig, value));\n }\n\n deleteGroup(index: number) {\n this.control.removeAt(index);\n }\n}\n\n\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { SubGroupConfig } from '../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../abstracts';\n\n\nconst FormGroupMixin = crisprControlMixin<SubGroupConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-sub-group',\n templateUrl: './sub-group.component.html',\n styleUrls: ['./sub-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SubGroupComponent extends FormGroupMixin implements OnInit {\n group: FormGroup;\n\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","// tslint:disable-next-line: max-line-length\nimport { InputFieldComponent, SelectFieldComponent, AutocompleteFieldComponent,\n AutocompleteChiplistFieldComponent, TextareaFieldComponent, CheckboxFieldComponent,\n RadioFieldComponent, FileUploadComponent, SliderFieldComponent, DatepickerFieldComponent,\n HeadingComponent, DividerComponent, ButtonComponent, UnitConversionFieldComponent } from './material';\nimport { FormGroupListComponent } from './form-group-list/form-group-list.component';\nimport { isControlConfig } from './form.helpers';\nimport { ControlType } from './models';\nimport { SubGroupComponent } from './sub-group/sub-group.component';\n\nexport const FIELD_COMPONENTS = {\n button: ButtonComponent,\n input: InputFieldComponent,\n select: SelectFieldComponent,\n radio: RadioFieldComponent,\n subGroup: SubGroupComponent,\n groupList: FormGroupListComponent,\n autocomplete: AutocompleteFieldComponent,\n autocompleteChiplist: AutocompleteChiplistFieldComponent,\n textarea: TextareaFieldComponent,\n checkbox: CheckboxFieldComponent,\n slider: SliderFieldComponent,\n datepicker: DatepickerFieldComponent,\n fileUpload: FileUploadComponent,\n heading: HeadingComponent,\n divider: DividerComponent,\n unitConversion: UnitConversionFieldComponent\n};\n\nexport function isControlComponent(component: CrisprFieldComponent): component is CrisprControlComponent {\n return isControlConfig(component.config) || component.config.controlType === ControlType.BUTTON;\n}\n\nexport type CrisprControlComponent = ButtonComponent |\n InputFieldComponent |\n SelectFieldComponent |\n RadioFieldComponent |\n SubGroupComponent |\n FormGroupListComponent |\n AutocompleteFieldComponent |\n AutocompleteChiplistFieldComponent |\n TextareaFieldComponent |\n CheckboxFieldComponent |\n SliderFieldComponent |\n FileUploadComponent |\n DatepickerFieldComponent |\n UnitConversionFieldComponent;\n\nexport type ComponentKeys = keyof typeof FIELD_COMPONENTS;\n// export type CrisprFieldComponent = FIELD_COMPONENTS[ComponentKeys];\n\nexport type CrisprFieldComponent = CrisprControlComponent |\n HeadingComponent|\n DividerComponent;\n\n","import { Directive, Input, ComponentFactoryResolver, ViewContainerRef, OnInit, Renderer2 } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { AnyFieldConfig, ControlValue } from './models';\nimport { CrisprFieldComponent , FIELD_COMPONENTS, isControlComponent } from './field-component-map.const';\n\n@Directive({\n selector: '[crisprField]'\n})\nexport class CrisprFieldDirective implements OnInit {\n\n @Input() config: AnyFieldConfig;\n @Input() group: FormGroup;\n @Input() value: ControlValue | any[];\n component: CrisprFieldComponent;\n\n constructor(\n private resolver: ComponentFactoryResolver,\n private container: ViewContainerRef,\n private renderer: Renderer2\n ) {}\n\n ngOnInit() {\n /**\n * create component and set values from config on its instance\n */\n const component = this.config.component || FIELD_COMPONENTS[this.config.controlType];\n const factory = this.resolver.resolveComponentFactory<CrisprFieldComponent>(component);\n const componentRef = this.container.createComponent(factory);\n\n this.component = componentRef.instance;\n this.component.config = this.config;\n if ( isControlComponent(this.component)) {\n this.component.group = this.group;\n if ('value' in this.component) {\n this.component.value = this.value;\n }\n }\n // adds any config classes to the dynamically generated component\n // doing this here keeps us from having to extend a base component into each field component individually\n if(!this.config.classes) return;\n this.config.classes.forEach((klass) => {\n // check for passing multiple classes in one array element\n if(klass.includes(' ')) {\n throw Error(`Improperly formatted class. '${klass}' cannot contain spaces.`);\n } else {\n this.renderer.addClass(componentRef.location.nativeElement, klass);\n }\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ControlValue, AnyFieldConfig } from '../models';\nimport { isControlConfig } from '../form.helpers';\n\n@Pipe({\n name: 'initialControlValue'\n})\nexport class InitialControlValuePipe implements PipeTransform {\n // TODO: does changing any to unknown break anything?\n transform(initialFormValue: {[key: string]: ControlValue | any}, fieldConfig: AnyFieldConfig): unknown {\n return (initialFormValue && isControlConfig(fieldConfig))\n ? initialFormValue[fieldConfig.controlName] || null\n : null;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n// custom modules\nimport { MaterialModule } from './material/material.module'\n\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\n// components\nimport { CrisprFormComponent } from './form/form.component';\nimport { FormGroupListComponent } from './form-group-list/form-group-list.component';\n// directives\nimport { CrisprFieldDirective } from './field.directive';\nimport { InitialControlValuePipe } from './pipes/initial-control-value.pipe';\nimport { SubGroupComponent } from './sub-group/sub-group.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n MaterialModule\n ],\n declarations: [\n CrisprFieldDirective,\n CrisprFormComponent,\n FormGroupListComponent,\n InitialControlValuePipe,\n SubGroupComponent,\n ],\n exports: [\n CrisprFormComponent,\n MaterialModule\n ],\n entryComponents: [\n FormGroupListComponent,\n SubGroupComponent\n ],\n\n})\nexport class CrisprFormsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {AbstractAutocompleteComponent as ɵg,CrisprFieldComponent as ɵn} from './lib/abstracts';\nexport {FieldContainerComponent as ɵb} from './lib/field-container/field-container.component';\nexport {CrisprFieldDirective as ɵw} from './lib/field.directive';\nexport {FormGroupListComponent as ɵx} from './lib/form-group-list/form-group-list.component';\nexport {AutocompleteChiplistFieldComponent as ɵh} from './lib/material/autocomplete-chiplist-field/autocomplete-chiplist-field.component';\nexport {AutocompleteFieldComponent as ɵf} from './lib/material/autocomplete-field/autocomplete-field.component';\nexport {ButtonComponent as ɵm} from './lib/material/button/button.component';\nexport {CheckboxFieldComponent as ɵi} from './lib/material/checkbox-field/checkbox-field.component';\nexport {DatepickerFieldComponent as ɵk} from './lib/material/datepicker-field/datepicker-field.component';\nexport {DividerComponent as ɵp} from './lib/material/divider/divider.component';\nexport {FileDropzoneDirective as ɵv} from './lib/material/file-upload/file-dropzone.directive';\nexport {FileUploadComponent as ɵq} from './lib/material/file-upload/file-upload.component';\nexport {HeadingComponent as ɵo} from './lib/material/heading/heading.component';\nexport {InfoComponent as ɵs} from './lib/material/info/info.component';\nexport {InputFieldComponent as ɵc} from './lib/material/input-field/input-field.component';\nexport {MaterialModule as ɵa} from './lib/material/material.module';\nexport {OptionComponent as ɵt} from './lib/material/option/option.component';\nexport {RadioFieldComponent as ɵe} from './lib/material/radio-field/radio-field.component';\nexport {SelectFieldComponent as ɵd} from './lib/material/select-field/select-field.component';\nexport {SelectedFileComponent as ɵu} from './lib/material/selected-file/selected-file.component';\nexport {SliderFieldComponent as ɵl} from './lib/material/slider-field/slider-field.component';\nexport {TextareaFieldComponent as ɵj} from './lib/material/textarea-field/textarea-field.component';\nexport {UnitConversionFieldComponent as ɵr} from './lib/material/unit-conversion-field/unit-conversion-field.component';\nexport {InitialControlValuePipe as ɵy} from './lib/pipes/initial-control-value.pipe';\nexport {SubGroupComponent as ɵz} from './lib/sub-group/sub-group.component';"],"names":["defaultConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MA2Ba,6BAA6B,GAAG;;ACK7C;IACY;AAAZ,WAAY,WAAW;IACrB,4CAA6B,CAAA;IAC7B,6DAA8C,CAAA;IAC9C,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,kCAAmB,CAAA;IACnB,yCAA0B,CAAA;IAC1B,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,uCAAwB,CAAA;IACxB,8BAAe,CAAA;IACf,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,qCAAsB,CAAA;IACtB,oCAAqB,CAAA;IACrB,iDAAkC,CAAA;AACpC,CAAC,EAlBW,WAAW,KAAX,WAAW;;ACpBtB;;SCXe,OAAO,CAAE,MAAgB;IACvC,OAAO,GAAG,CAAE,CAAC,KAAa;QACxB,IAAI,KAAK,EAAE;YACT,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;gBAClB,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;oBACd,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBACxD,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC;oBAChD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC1B;qBAAM;oBACL,OAAO,CAAC,KAAK,KAAK,CAAC;iBACpB;aACF,CAAC,CAAC;SACJ;aAAM;YACL,OAAO,KAAK,CAAC;SACd;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,OAAO,CAAC,MAAc;IAC7B,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,CA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,IAAI,EAAE,qBAAqB;aAC5B;;;MCkCY,iBAAiB;;;YAxB7B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,mBAAmB;oBACnB,2BAA2B;oBAC3B,cAAc;iBACf;gBACD,YAAY,EAAE;oBACZ,oBAAoB;oBACpB,mBAAmB;oBACnB,sBAAsB;oBACtB,uBAAuB;oBACvB,iBAAiB;iBAClB;gBACD,OAAO,EAAE;oBACP,mBAAmB;oBACnB,cAAc;iBACf;gBACD,eAAe,EAAE;oBACf,sBAAsB;oBACtB,iBAAiB;iBAClB;aAEF;;;ACvCD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms.js","sources":["../../../../libs/crispr-forms/src/lib/models/select-field.config.ts","../../../../libs/crispr-forms/src/lib/models/crispr-field.config.ts","../../../../libs/crispr-forms/src/lib/models/heading.config.ts","../../../../libs/crispr-forms/src/lib/form.operators.ts","../../../../libs/crispr-forms/src/lib/form.helpers.ts","../../../../libs/crispr-forms/src/lib/abstracts/crispr-control.mixin.ts","../../../../libs/crispr-forms/src/lib/abstracts/crispr-field.abstract.ts","../../../../libs/crispr-forms/src/lib/abstracts/autocomplete-field.abstract.ts","../../../../libs/crispr-forms/src/lib/material/input-field/input-field.component.ts","../../../../libs/crispr-forms/src/lib/material/select-field/select-field.component.ts","../../../../libs/crispr-forms/src/lib/material/autocomplete-field/autocomplete-field.component.ts","../../../../libs/crispr-forms/src/lib/material/autocomplete-chiplist-field/autocomplete-chiplist-field.component.ts","../../../../libs/crispr-forms/src/lib/material/checkbox-field/checkbox-field.component.ts","../../../../libs/crispr-forms/src/lib/material/textarea-field/textarea-field.component.ts","../../../../libs/crispr-forms/src/lib/material/slider-field/slider-field.component.ts","../../../../libs/crispr-forms/src/lib/material/button/button.component.ts","../../../../libs/crispr-forms/src/lib/material/datepicker-field/datepicker-field.component.ts","../../../../libs/crispr-forms/src/lib/material/file-upload/file-upload.component.ts","../../../../libs/crispr-forms/src/lib/material/heading/heading.component.ts","../../../../libs/crispr-forms/src/lib/material/divider/divider.component.ts","../../../../libs/crispr-forms/src/lib/material/radio-field/radio-field.component.ts","../../../../libs/crispr-forms/src/lib/material/unit-conversion-field/unit-conversion-field.component.ts","../../../../libs/crispr-forms/src/lib/field-container/field-container.component.ts","../../../../libs/crispr-forms/src/lib/material/info/info.component.ts","../../../../libs/crispr-forms/src/lib/material/option/option.component.ts","../../../../libs/crispr-forms/src/lib/material/selected-file/selected-file.component.ts","../../../../libs/crispr-forms/src/lib/material/file-upload/file-dropzone.directive.ts","../../../../libs/crispr-forms/src/lib/material/material.module.ts","../../../../libs/crispr-forms/src/lib/form/form.component.ts","../../../../libs/crispr-forms/src/lib/form-group-list/form-group-list.component.ts","../../../../libs/crispr-forms/src/lib/sub-group/sub-group.component.ts","../../../../libs/crispr-forms/src/lib/field-component-map.const.ts","../../../../libs/crispr-forms/src/lib/field.directive.ts","../../../../libs/crispr-forms/src/lib/pipes/initial-control-value.pipe.ts","../../../../libs/crispr-forms/src/lib/crispr-forms.module.ts","../../../../libs/crispr-forms/src/tft-crispr-forms.ts"],"sourcesContent":["import { CrisprControlConfig } from '../models';\nimport { Observable } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { ControlType, FieldDescriptors, MatFieldProperties } from './crispr-field.config';\n\nexport interface SelectFieldConfig extends Omit<CrisprControlConfig, 'placeholder'>,\n FieldDescriptors,\n MatFieldProperties {\n controlType: ControlType.SELECT,\n emptyOptionsMessage?: string;\n multiple?: boolean;\n enableToggleAll?: boolean;\n options: OptionsType;\n}\n\nexport type OptionsType = SelectOption[] | Observable<SelectOption[]> | OptionsCallback | Promise<SelectOption[]>;\n\nexport type OptionsCallback = (group?: FormGroup) => OptionsType;\nexport type ReactiveOptionsCallback = (group?: FormGroup) => Observable<SelectOption[]>;\n// tslint:disable-next-line: max-line-length\nexport type AutocompleteOptionsCallback = (group?: FormGroup, searchTerm?: string) => OptionsType;\nexport interface SelectOption {\n label: string;\n value: any;\n imageUrl?: string;\n}\n\nexport const DEFAULT_EMPTY_OPTIONS_MESSAGE = 'No Items';\n","import { FormGroup, ValidatorFn } from '@angular/forms';\nimport { Observable, ObservableInput } from 'rxjs';\nimport { TooltipPosition } from '@angular/material/tooltip';\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\n\nimport { ErrorDictionary } from '@tft/form-validation-handler';\nimport {\n ComputeFieldConfig,\n CheckControlConfig,\n CheckControlsConfig,\n} from '../form.helpers';\nimport {\n SelectFieldConfig,\n HeadingConfig,\n ButtonConfig,\n DatepickerFieldConfig,\n InputFieldConfig,\n CheckboxFieldConfig,\n TextareaFieldConfig,\n AutocompleteFieldConfig,\n FormGroupListConfig,\n AutocompleteChiplistFieldConfig,\n SliderFieldConfig,\n DividerConfig,\n SelectOption,\n RadioFieldConfig\n} from '../models';\n\nimport { ThemePalette } from '@angular/material/core';\nimport { FileUploadFieldConfig } from './file-upload-field.config';\nimport { UnitConversionFieldConfig } from './unit-conversion-field.config';\n\n// export type ControlType = keyof typeof FIELD_COMPONENTS;\nexport enum ControlType {\n AUTOCOMPLETE = 'autocomplete',\n AUTOCOMPLETE_CHIPLIST = 'autocompleteChiplist',\n BUTTON = 'button',\n CHECKBOX = 'checkbox',\n CUSTOM = 'custom',\n DATEPICKER = 'datepicker',\n DIVIDER = 'divider',\n FILE_UPLOAD = 'fileUpload',\n HEADING = 'heading',\n INPUT = 'input',\n GROUP_LIST = 'groupList',\n RADIO = 'radio',\n SELECT = 'select',\n SLIDER = 'slider',\n SUB_GROUP = 'subGroup',\n TEXTAREA = 'textarea',\n UNIT_CONVERSION = 'unitConversion',\n}\n\n/**\n * The base interface for all the fields in the form's config\n */\nexport interface CrisprFieldConfig {\n controlType?: ControlType;\n classes?: string[];\n component?: any; // TODO: Define this better\n}\n\n// export function isCustomConfig(config: AnyFieldConfig): config is CustomFieldConfig {\n// return 'component' in config;\n// }\n// export interface CustomFieldConfig extends CrisprFieldConfig {\n// controlType: ControlType.CUSTOM;\n// component?: any; // TODO: type better\n// }\ntype RestrictedControlName<M> = M extends null ? string : keyof M;\n/**\n * The base interface for all control configs\n */\nexport interface CrisprControlConfig<M = null> extends CrisprFieldConfig {\n controlName: RestrictedControlName<M>\n controlType: ControlType;\n validators?: ValidatorFn[];\n // TODO: Determine if this is necessary\n /**\n * @deprecated please us computeValue instead\n */\n computeFieldConfig?: ComputeFieldConfig;\n computeValue?: (group: FormGroup) => Observable<unknown>;\n disabledCallback?: (group: FormGroup, config?: any) => Observable<boolean>;\n disabledCallbackConfig?: CheckControlConfig | CheckControlsConfig | any; // any is required for user defined configs\n hideDisabled?: boolean; // defaults to false\n heading?: HeadingConfig;\n}\n\n/**\n * Holds properties for control fields that describe field behavior to users\n */\nexport interface FieldDescriptors {\n label?: string;\n info?: Info;\n fieldSuffix?: string;\n placeholder?: string;\n}\n\nexport interface MatFieldProperties {\n appearance?: MatFormFieldAppearance;\n color?: ThemePalette;\n}\n\nexport interface Info {\n content: string;\n tooltipPosition?: TooltipPosition;\n iconName?: string;\n}\n\n// TODO: having AnyFieldConfig as the default for C seems redundant and silly\nexport interface AbstractGroupConfig<C extends CrisprFieldConfig = AnyFieldConfig, M = any> {\n // this union is needed, it joins any custom config provided by users to our default config options\n fields?: (AnyFieldConfig | C)[];\n}\nexport interface FormConfig<C = AnyFieldConfig> extends AbstractGroupConfig<C> {\n classes?: string[];\n errorDictionary?: ErrorDictionary;\n autoComplete?: string;\n /** @deprecated use autoComplete */\n autocomplete?: string;\n validators?: ValidatorFn[]\n}\n/**\n * Configuration for SubGroup components\n */\nexport interface SubGroupConfig extends CrisprControlConfig, AbstractGroupConfig {\n controlType: ControlType.SUB_GROUP;\n}\n\nexport type AnyFieldConfig = InputFieldConfig\n | SelectFieldConfig\n | RadioFieldConfig\n | FormGroupListConfig\n | SubGroupConfig\n | AutocompleteFieldConfig\n | AutocompleteChiplistFieldConfig\n | TextareaFieldConfig\n | CheckboxFieldConfig\n | DatepickerFieldConfig\n | SliderFieldConfig\n | FileUploadFieldConfig\n | HeadingConfig\n | ButtonConfig\n | DividerConfig\n | UnitConversionFieldConfig;\n // | CustomFieldConfig;\n\n\nexport type ControlValue<T = any> = boolean | string | number | Date | SelectOption | SelectOption[] | ControlGroupValue | T;\n\nexport type ControlGroupValue = {[key: string]: ControlValue};\n","import { CrisprFieldConfig, ControlType } from '../models';\nimport { FieldDescriptors } from './crispr-field.config';\n// This is done different from the rest of the fields because\n// when we use the heading inside of a field we don't want to have to\n// pass a controlType\nexport interface HeadingConfig extends\n Omit<CrisprFieldConfig, 'controlType'>,\n Omit<FieldDescriptors, 'placeholder' | 'fieldSuffix'> {\n // controlType is optional here because this component can be used as a crispr field where it needs a ControlType\n // or by a crispr field where it doesn't need a ControlType\n controlType?: ControlType.HEADING;\n typographyClass?: string;\n label: string;\n};\n","import { map } from 'rxjs/operators';\n\nexport function valueIn (values: string[]) {\n return map( (value: string) => {\n if (value) {\n return values.some(v => {\n if (isRegex(v)) {\n const trimmedStringForRegex = v.substr(1, v.length - 2);\n const regex = new RegExp(trimmedStringForRegex);\n return regex.test(value);\n } else {\n return v === value;\n }\n });\n } else {\n return false;\n }\n });\n}\n\nfunction isRegex(string: string) {\n return string.startsWith('/') && string.endsWith('/');\n}\n","import {\n SelectOption,\n AnyFieldConfig,\n FormConfig,\n ControlType,\n FormGroupListConfig,\n CrisprControlConfig,\n OptionsType,\n AutocompleteOptionsCallback,\n CrisprFieldConfig,\n ControlValue\n} from './models';\nimport {\n from,\n Observable,\n of,\n isObservable,\n combineLatest,\n OperatorFunction\n} from 'rxjs';\nimport { FormGroup, FormArray, FormControl } from '@angular/forms';\nimport { valueIn } from './form.operators';\nimport { map, startWith } from 'rxjs/operators';\n\n/**\n * DYNAMIC FORM UTILS: a collection of pure/mostly pure functions that are useful both internally and for\n * developing the consuming app.\n *\n * They are sorted by use case: building out the form object; helper functions to use with the disabled$ function;\n * helper functions to use with the compute field function; and other logic shared between components\n */\n\n/**\n * Required configuration to use with checkControlForValues function\n */\nexport interface CheckControlConfig {\n // the control name to watch\n controlName: string;\n // the values to watch for\n values: string[];\n // the function to run on the boolean returned by the watcher\n evaluate?: (isValueInValues: boolean) => boolean;\n}\n\n/**\n* Watches a single control for a list of values, returns true when field value matches any value in list\n* unless an evaluate method is found on config, in which case that method is run on the returned boolean value\n* @param group the direct parent of the field we want to watch\n* @param config\n*/\nexport function checkControlForValues(group: FormGroup, config: CheckControlConfig): Observable<boolean> {\n // check that all the pieces we need are available\n if (config && config.controlName && Array.isArray(config.values)) {\n return getValueChanges(group, config.controlName).pipe(\n // return a boolean, true if value is in the values being watch for, otherwise false\n valueIn(config.values),\n map((isValueInValues: boolean) => {\n // since we can only check if the value is in the list of watched values, the evaluate function gives us\n // a chance to make other decisions based on if the boolean returned, e.g. return true if value not in watched values\n if ( config.evaluate && config.evaluate instanceof Function ) {\n return config.evaluate(isValueInValues);\n } else { return isValueInValues; }\n })\n );\n } else {\n //\n return of(true);\n }\n}\n\n/**\n * The required configuration for running the checkControlsForValues function.\n */\nexport interface CheckControlsConfig {\n // an array of controls to watch and the values to check for\n watchConfigs: CheckControlConfig[];\n // the function to run against the array of current field valueIn responses\n evaluate?: ( bools: boolean[] ) => boolean;\n}\n\n/**\n * Watches a list of fields for individual lists of values returning true when any field contains one\n * of the values being watched for, or optionally running a function on the array of resolved booleans\n * from the listed fields and returning a boolean\n * @param group the form group that has the fields to watch as direct descendants\n * @param config the configuration to use when calling the function\n */\nexport function checkControlsForValues(group: FormGroup, config: CheckControlsConfig): Observable<any> {\n // if no config is passed we just want to show the field, so we return an observable of true\n if (!config || !config.watchConfigs) { return of(true); }\n // we run checkControlForValues on every control in the list of WatchConfigs creating\n // an array of Observable watching fields for values\n const fieldTriggers = config.watchConfigs.map(watchConfig => {\n // resolves a boolean, true when field value matches a watched value, otherwise false\n return checkControlForValues(group, watchConfig);\n });\n\n return combineLatest(\n fieldTriggers\n ).pipe(\n startWith([true]),\n map((booleans: boolean[]) => {\n // if the user passed an evaluate function use it\n if (config.evaluate && config.evaluate instanceof Function) {\n return config.evaluate(booleans);\n } else { // otherwise we return true if any of the watched fields resolve to true\n return booleans.some(bool => bool);\n }\n })\n );\n}\n\n/**\n * The required configuration when running the computeValue function\n */\nexport interface ComputeFieldConfig<T = any, RT = any> {\n // array of control names who's values we want to watch\n controlNamesToWatch: string[];\n // the function we want to call on the array of watched values to compute the value of the control we\n computeCallback: (\n values: (T)[]\n ) => RT;\n}\n\n/**\n * Watches values on an array of fields, computing their values as they change\n * @param group the group to get the fields from, for now it can only be the parent of the computed field\n * @param computeFieldsConfig the configuration that drives the computation, holds the names to watch and the\n * computation function that get called against the array of values\n */\nexport function computeValueFromFields(group: FormGroup, computeFieldsConfig: ComputeFieldConfig): Observable<any> {\n // TODO: better checking\n const { controlNamesToWatch } = computeFieldsConfig;\n //creates an observable listener for each control in the controlNamesToWatch array\n return combineLatest(\n controlNamesToWatch.map(controlNameToWatch => getValueChanges(group, controlNameToWatch))\n ).pipe(\n // each time a watched field values changes a new array of the latest field values is pipe through to the\n // compute callback. Which runs the users logic on the values to compute this fields value\n map(valuesArray => computeFieldsConfig.computeCallback(valuesArray)),\n );\n}\n\n/**\n * A simple wrapper for doing error checking around getting the valueChanges observable from a control on a form group\n * @param group the form group we want to pull the observable from\n * @param controlName the name of the control who's value we want to subscribe to\n */\nfunction getValueChanges(group: FormGroup, controlName: string) {\n const control = group.get(controlName);\n if (!control) {\n throw new Error(`No control with controlName ${controlName}`, );\n }\n return control.valueChanges;\n}\n/**\n * TODO: move to utils library after library is built\n * Allows developer to pass an array of operators into the pipe of an Observable.\n * Useful for creating function with a variable amount of operators to be run\n * @param observable the observable to pass the operators to\n * @param operators array of operators to pipe\n */\nfunction pipeOperatorsIntoObservable(observable: Observable<any>, operators: OperatorFunction<any, any>[]) {\n try {\n return operators.reduce((obs: Observable<{}>, op: OperatorFunction<{}, {}>) => {\n return obs.pipe(op);\n }, observable);\n } catch {\n console.error('Unable to pipe operators into observable');\n return of(null);\n }\n}\n\n\nexport function callOptionsIfFunction(\n options: OptionsType | AutocompleteOptionsCallback,\n parentGroup?: FormGroup,\n searchString?: string\n): OptionsType {\n return options instanceof Function ? options(parentGroup, searchString) : options;\n}\n/**\n * The user can give us select options as an array, a function that resolves to a promise,\n * or an observable. This functions consumes any of those and returns an observable that\n * resolves an array of options\n *\n * @param options the options passed in from the config\n * @param emptyMessageOption the message to display when the array is empty\n */\nexport function observablifyOptions(\n options: OptionsType,\n parentGroup: FormGroup,\n searchString?: string,\n): Observable<SelectOption[]> {\n const calledOptions = callOptionsIfFunction(options, parentGroup, searchString);\n // if options are a promise\n return calledOptions instanceof Promise\n // convert to observable\n ? from(calledOptions)\n // if array that isn't empty\n : Array.isArray(calledOptions) && calledOptions.length\n // convert to observable\n ? of(calledOptions)\n // if observable\n : isObservable(calledOptions)\n // return it\n ? calledOptions\n // else an empty array\n : of([]);\n}\n\n/**\n * Determines if the field config is for a form control (not a divider, heading or other non-control field)\n * */\nexport function isControlConfig(fieldConfig: CrisprFieldConfig): fieldConfig is CrisprControlConfig {\n return 'controlName' in fieldConfig;\n}\n/**\n * builds out form group based on config\n * @param config a configuration for a form group\n * @param value an object of initial values to pass in\n * @param group the form group to modify and build out\n */\nexport function buildFormGroupFromConfig(config: FormConfig, value = null, group: FormGroup = new FormGroup({}) ) {\n config.fields.forEach( (controlConfig: AnyFieldConfig) => {\n if (isControlConfig(controlConfig)) {\n // then add a control to the group using the controlName from configuration\n const {controlName} = controlConfig;\n // if there's a value object and it has a non-null/undefined value for this field use it.\n // Otherwise, default to null\n const controlValue = (value && value[controlName]) ?? null;\n group.addControl(controlName, createControlForType(controlConfig, controlValue));\n }\n });\n group.setValidators(config.validators);\n return group;\n}\n\n/**\n * Analyze the config and build a form control to spec. Notice we don't use FormBuilder here\n * as we want to keep this function pure.\n * @param controlConfig the configuration object for the control to build\n * @param value an initial value to use if passed in\n */\nexport function createControlForType(controlConfig: AnyFieldConfig, value: ControlValue = null) {\n // build form control out based on the control type\n const control = controlConfig.controlType === ControlType.SUB_GROUP\n ? buildFormGroupFromConfig(controlConfig as FormConfig, value)\n : controlConfig.controlType === ControlType.GROUP_LIST\n ? new FormArray([], (controlConfig as FormGroupListConfig).validators)\n : new FormControl(\n value || null,\n (controlConfig as CrisprControlConfig).validators\n );\n\n return control;\n}\n\n/**\n * A basic filter function that filters the search string against the label of the options object\n * @param options the array of options to filter\n * @param searchString the string from the input\n */\nexport function filterOptionsByLabel(options: SelectOption[], searchString: string) {\n return options.filter(option => {\n return option.label && option.label.toLowerCase().includes(searchString.toLowerCase());\n });\n}\n","import { FormGroup, AbstractControl } from '@angular/forms';\nimport { CrisprControlConfig, ControlValue, ControlType } from '../models';\nimport { CrisprFieldComponent } from './crispr-field.abstract';\n\nexport function crisprControlMixin<C extends CrisprControlConfig>(BaseClass: typeof CrisprFieldComponent) {\n return class extends BaseClass<C> {\n config: C;\n group: FormGroup;\n control: AbstractControl;\n\n _value: ControlValue;\n set value(value: ControlValue) {\n this.setControlValue(value);\n this._value = value;\n }\n\n get value() {\n return this._value;\n }\n\n ngOnInit() {\n super.ngOnInit();\n this.control = this.group.get(this.config.controlName);\n this.setControlValue(this.value);\n // setTimeouts are ugly but this seems to be the only way to get the computed field to compute initial values\n setTimeout(()=> {\n this.control.updateValueAndValidity();\n })\n }\n\n setControlValue(value: ControlValue) {\n if(value && this.control && this.config.controlType !== ControlType.SUB_GROUP) {\n this.control.setValue(value)\n }\n }\n }\n}\n","import {\n CrisprFieldConfig,\n} from '../models';\nimport { OnInit, Directive } from '@angular/core';\n\n@Directive()\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport abstract class CrisprFieldComponent<C extends CrisprFieldConfig> implements OnInit {\n config: C;\n defaultConfig?: Partial<C>\n\n ngOnInit() {\n this.applyDefaultConfig();\n }\n\n applyDefaultConfig() {\n this.config = this.defaultConfig ? {...this.defaultConfig, ...this.config} : this.config;\n }\n}\n\n\n","import { OnInit, Directive } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { Observable, of } from 'rxjs';\nimport { catchError, debounceTime, distinctUntilChanged, map, startWith, switchMap, tap } from 'rxjs/operators';\n\nimport { crisprControlMixin } from './crispr-control.mixin';\nimport { AutocompleteFieldConfig, AutocompleteChiplistFieldConfig, SelectOption } from '../models';\nimport { CrisprFieldComponent } from './crispr-field.abstract';\nimport { observablifyOptions } from '../form.helpers';\n\ntype AutocompleteConfigTypes = AutocompleteFieldConfig | AutocompleteChiplistFieldConfig;\n\nconst AbstractAutocompleteFieldMixin = crisprControlMixin<AutocompleteConfigTypes>(CrisprFieldComponent);\n\n@Directive()\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport class AbstractAutocompleteComponent<C>\n extends AbstractAutocompleteFieldMixin implements OnInit {\n // we need a separate control for the UI because of the way the material autocomplete chiplist works\n autocompleteInputControl = new FormControl('');\n options$: Observable<SelectOption[]>\n config: AutocompleteConfigTypes & C;\n ngOnInit() {\n super.ngOnInit();\n\n this.group.addControl(this.config.controlName, new FormControl());\n // filter options by the search string using either the default filter function or one passed in through config\n this.options$ = this.autocompleteInputControl.valueChanges.pipe(\n // this is needed to have the options panel to open on focus\n startWith(''),\n debounceTime(this.config.typeDebounceTime),\n distinctUntilChanged(),\n map(searchText => searchText || ''),\n switchMap((searchText: string) => observablifyOptions(this.config.options, this.group, searchText))\n );\n }\n}\n","import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { InputFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\n\nconst InputFieldMixin = crisprControlMixin<InputFieldConfig>(CrisprFieldComponent);\n@Component({\n selector: 'crispr-input-field',\n templateUrl: './input-field.component.html',\n styleUrls: ['./input-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class InputFieldComponent extends InputFieldMixin implements OnInit {\n\n defaultConfig: Partial<InputFieldConfig> = {inputType: 'text'};\n constructor() {\n super();\n }\n\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy, ViewChild, AfterViewInit } from '@angular/core';\n import { Observable } from 'rxjs';\n\nimport { SelectFieldConfig, SelectOption } from '../../models';\nimport { observablifyOptions } from '../../form.helpers';\nimport { CrisprFieldComponent, crisprControlMixin } from '../../abstracts';\nimport { MatSelect } from '@angular/material/select';\nimport { ThemePalette } from '@angular/material/core';\n\nconst SelectFieldMixin = crisprControlMixin<SelectFieldConfig>(CrisprFieldComponent);\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})\nexport class SelectFieldComponent extends SelectFieldMixin implements OnInit, AfterViewInit {\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","import { Component, OnInit, ViewChild, ChangeDetectionStrategy, ElementRef } from '@angular/core';\nimport { MatAutocompleteTrigger, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\n\nimport { SelectOption, AutocompleteFieldConfig, DEFAULT_EMPTY_OPTIONS_MESSAGE } from '../../models';\nimport { AbstractAutocompleteComponent } from '../../abstracts';\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})\nexport class AutocompleteFieldComponent\n extends AbstractAutocompleteComponent<AutocompleteFieldConfig>\n implements OnInit {\n\n defaultConfig = defaultConfig;\n @ViewChild('autoInput', { read: MatAutocompleteTrigger }) autoInput: MatAutocompleteTrigger;\n @ViewChild('autoInput') autoInputRef: ElementRef<HTMLInputElement>;\n\n ngOnInit() {\n super.ngOnInit();\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 = !!options && Array.isArray(options)\n ? options.find((option) => JSON.stringify(option.value) === JSON.stringify(value))?.label: 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","import { Component, OnInit, ChangeDetectionStrategy, ViewChild, ElementRef } from '@angular/core';\nimport { map, tap } from 'rxjs/operators';\nimport { MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';\nimport { Observable, BehaviorSubject, combineLatest } from 'rxjs';\nimport { ENTER } from '@angular/cdk/keycodes';\n\nimport { AutocompleteChiplistFieldConfig, DEFAULT_EMPTY_OPTIONS_MESSAGE, SelectOption } from '../../models';\nimport { AbstractAutocompleteComponent } from '../../abstracts';\nimport { MatChipInputEvent } from '@angular/material/chips';\n\nconst defaultConfig: Partial<AutocompleteChiplistFieldConfig> = {\n chipsSelectable: true,\n areChipsRemovable: true,\n tabToSelect: true,\n autoActiveFirstOption: true,\n imageUrlParam: 'image',\n typeDebounceTime: 500,\n allowDuplicates: false,\n duplicateCompareFunction: (chip, option) => chip.value === option.value,\n separatorKeyCodes: [ENTER],\n emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,\n}\n\n@Component({\n selector: 'crispr-autocomplete-chiplist-field',\n templateUrl: './autocomplete-chiplist-field.component.html',\n styleUrls: ['./autocomplete-chiplist-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AutocompleteChiplistFieldComponent\n extends AbstractAutocompleteComponent<AutocompleteChiplistFieldConfig> implements OnInit {\n defaultConfig = defaultConfig;\n chips$ = new BehaviorSubject<SelectOption[]>([]);\n remainingOptions$: Observable<SelectOption[]>;\n\n controlValue$ = this.chips$.pipe(\n tap(chips => {\n this.control.setValue(chips.map(chip => chip.value))\n })\n );\n\n\n // We need use ViewChild twice on the same template ref to access as different types\n // - the MatAutocompleteTrigger is used to for selecting value on tab\n // - the ElementRef<HTMLInputElement> is used to clear the value from input element on selection\n @ViewChild('autoInput', { read: MatAutocompleteTrigger }) chipInput: MatAutocompleteTrigger;\n @ViewChild('autoInput') chipInputRef: ElementRef<HTMLInputElement>;\n\n\n ngOnInit() {\n super.ngOnInit();\n this.remainingOptions$ = combineLatest([\n this.chips$,\n this.options$\n ]).pipe(\n map(([chips, options]) => {\n return this.config.allowDuplicates\n ? options\n : options?.filter(option => {\n return !chips.some(chip => this.config.duplicateCompareFunction(chip, option));\n });\n })\n )\n }\n\n setControlValue(value: SelectOption[]) {\n if (value) {\n this.chips$.next(value);\n }\n }\n\n // handles mat selecting\n handleSelect(event: MatAutocompleteSelectedEvent) {\n const selectedOption: SelectOption = event.option.value as SelectOption;\n this.chips$.next([...this.chips$.value, selectedOption]);\n this.chipInputRef.nativeElement.value = '';\n this.autocompleteInputControl.setValue('');\n // setTimeout needed because the panel thinks it's still open at this point\n setTimeout(() => this.chipInput.openPanel())\n }\n\n /**\n * To follow ARIA standards we want to select the active option on blur.\n * matChipInputAddOnBlur should do this but it causes buggy behaviour\n * @param event blur event that triggers the handle blur\n */\n handleTab(_event: FocusEvent) {\n if (this.chipInput.activeOption && (this.config.tabToSelect || this.config.addChipOnBlur)) {\n const chip = this.chipInput.activeOption.value;\n this.chips$.next([...this.chips$.value, chip]);\n }\n }\n\n /**\n * Handles selection via key tokens passed through separatorKeyCodes propert\n * NOTE: If TAB is used focus does not move on to next component\n * @param event\n */\n handleTokenEnd(event: MatChipInputEvent) {\n if (this.chipInput.activeOption) {\n this.chipInput.activeOption.select();\n }\n event.chipInput?.clear();\n }\n\n mapToLabel(option: SelectOption) {\n return option ? option.label : '';\n }\n\n removeChip(removedChip: SelectOption) {\n const remainingChips: SelectOption[] = this.chips$.value.filter(chip => chip !== removedChip);\n this.chips$.next(remainingChips);\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { CheckboxFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\n\nconst defaultConfig: Partial<CheckboxFieldConfig> = {\n labelPosition: 'after',\n inline: false\n}\nconst CheckboxFieldMixin = crisprControlMixin<CheckboxFieldConfig>(CrisprFieldComponent);\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})\nexport class CheckboxFieldComponent extends CheckboxFieldMixin implements OnInit {\n\n defaultConfig = defaultConfig;\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { TextareaFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\n\nconst defaultConfig: Partial<TextareaFieldConfig> = {rows: 5};\nconst TextareaFieldMixin = crisprControlMixin<TextareaFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-textarea-field',\n templateUrl: './textarea-field.component.html',\n styleUrls: ['./textarea-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TextareaFieldComponent extends TextareaFieldMixin implements OnInit {\n defaultConfig = defaultConfig;\n\n ngOnInit() {\n super.ngOnInit()\n }\n}\n\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { SliderFieldConfig } from '../../models';\nimport { CrisprFieldComponent, crisprControlMixin } from '../../abstracts';\n\nconst defaultConfig = {displayLimits: true};\nconst SliderFieldMixin = crisprControlMixin<SliderFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-slider-field',\n templateUrl: './slider-field.component.html',\n styleUrls: ['./slider-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SliderFieldComponent extends SliderFieldMixin implements OnInit {\n\n defaultConfig = defaultConfig;\n constructor() {\n super();\n }\n\n get flexDirection() {\n return this.config.vertical ? 'column' : 'row';\n }\n\n ngOnInit() {\n super.ngOnInit();\n }\n\n}\n","\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ButtonConfig } from '../../models';\nimport { Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { CrisprFieldComponent } from '../../abstracts';\n\n@Component({\n selector: 'crispr-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ButtonComponent extends CrisprFieldComponent<ButtonConfig> implements OnInit {\n\n group: FormGroup;\n defaultConfig: Partial<ButtonConfig> = {buttonType: 'raised', type: 'submit'};\n formValid$: Observable<boolean>\n\n get matButtonClass () {\n return this.config.buttonType ? `mat-${this.config.buttonType}-button` : '';\n }\n\n ngOnInit() {\n super.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","import { Component, OnInit, ChangeDetectionStrategy, AfterContentInit } from '@angular/core';\nimport { DatepickerFieldConfig } from '../../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\nimport { MatCalendarCellClassFunction } from '@angular/material/datepicker';\nimport { Moment } from 'moment';\nimport { Observable, of } from 'rxjs';\nimport { ComponentPortal, Portal } from '@angular/cdk/portal';\n\nconst defaultConfig: Partial<DatepickerFieldConfig> = {\n startView: 'month',\n}\nconst DatepickerFieldMixin = crisprControlMixin<DatepickerFieldConfig>(CrisprFieldComponent);\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})\nexport class DatepickerFieldComponent extends DatepickerFieldMixin implements OnInit, AfterContentInit {\n\n defaultConfig = defaultConfig;\n\n dateClass: MatCalendarCellClassFunction<Moment>;\n dateClass$: Observable<MatCalendarCellClassFunction<Moment>>;\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 this.startAt$ = this.config.startAt instanceof Date\n ? of(this.config.startAt)\n : this.config.startAt instanceof Function\n ? this.config.startAt(this.group)\n : of(null);\n this.dateClass = this.config?.cellClassFunction || null\n this.dateClass$ = this.config.dateClass ? this.config?.dateClass(this.group) : of(() => '');\n }\n\n ngAfterContentInit() {\n if (this.config.datepickerActions) {\n this.calendarFooterPortal = new ComponentPortal(this.config.datepickerActions);\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","import {\n Component,\n ElementRef,\n ViewChild,\n OnInit,\n ChangeDetectionStrategy,\n Optional,\n Self\n} from '@angular/core';\nimport { ControlValueAccessor, NgControl } from '@angular/forms';\nimport { Observable, of } from 'rxjs';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\nimport { FileUploadFieldConfig } from '../../models/file-upload-field.config';\n\nconst FileUploadFieldMixin = crisprControlMixin<FileUploadFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FileUploadComponent extends FileUploadFieldMixin implements OnInit, ControlValueAccessor {\n\n onChange: () => void;\n\n defaultConfig: Partial<FileUploadFieldConfig> = {\n allowMultipleFiles: false,\n acceptedTypes: '*.*',\n dropZoneText: 'DROP FILE HERE',\n selectFilesButtonType: 'button',\n selectButtonText: 'SELECT',\n showClearFilesButton: true,\n clearFilesButtonText: 'CLEAR',\n uploadButtonText: 'UPLOAD',\n uploadButtonType: 'button',\n showUploadProgress: false,\n disableOnUpload: true\n }\n\n @ViewChild('fileInput') fileInputRef: ElementRef\n\n selectedFiles: FileList;\n\n isUploaded = false;\n\n fileProgress: Observable<number>[] = [];\n disabled$: Observable<boolean>;\n\n // ngControl: NgControl = null;\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n ) {\n super();\n if (this.ngControl != null) {\n // Setting the value accessor directly (instead of using\n // the providers) to avoid running into a circular import.\n ngControl.valueAccessor = this;\n }\n }\n\n ngOnInit() {\n super.ngOnInit();\n this.disabled$ = this.config.disabledCallback\n ? this.config.disabledCallback(this.group, this.config)\n : of(false);\n }\n\n\n filesChanged(files: FileList): void {\n if (files && files.length > 0 ) {\n this.selectedFiles = files\n this.control.patchValue(files);\n }\n }\n\n uploadFiles() {\n if(this.selectedFiles && this.config.uploadFiles) {\n this.isUploaded = true;\n this.config.uploadFiles(this.group, this.selectedFiles, this);\n }\n }\n\n resetFileInput(): void {\n this.fileInputRef.nativeElement.value = ''\n this.control.patchValue(null);\n this.isUploaded = false;\n }\n\n writeValue( value: null ) {\n // clear file input\n // this.host.nativeElement.value = '';\n // this.file = null;\n }\n\n registerOnChange( fn: () => void ) {\n this.onChange = fn;\n }\n\n registerOnTouched( fn: () => void ) {\n }\n}\n","import { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { HeadingConfig } from '../../models';\nimport { CrisprFieldComponent } from '../../abstracts';\n\nconst defaultConfig: Partial<HeadingConfig> = {\n typographyClass: 'mat-h3'\n}\n@Component({\n selector: 'crispr-heading',\n templateUrl: './heading.component.html',\n styleUrls: ['./heading.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class HeadingComponent extends CrisprFieldComponent<HeadingConfig>{\n @Input() config: HeadingConfig;\n defaultConfig = defaultConfig;\n}\n","import { Component, OnInit } from '@angular/core';\nimport { DividerConfig } from '../../models';\nimport { CrisprFieldComponent } from '../../abstracts';\n\n@Component({\n selector: 'crispr-divider',\n templateUrl: './divider.component.html',\n styleUrls: ['./divider.component.scss']\n})\nexport class DividerComponent extends CrisprFieldComponent<DividerConfig> implements OnInit {\n // TODO: pull in type after configs are better organized\n defaultConfig = {};\n ngOnInit() {\n super.ngOnInit();\n }\n\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\n import { Observable } from 'rxjs';\n\nimport { SelectOption } from '../../models';\nimport { observablifyOptions } from '../../form.helpers';\nimport { CrisprFieldComponent, crisprControlMixin } from '../../abstracts';\nimport { RadioFieldConfig } from '../../models/radio-field.config';\n\nconst RadioFieldMixin = crisprControlMixin<RadioFieldConfig>(CrisprFieldComponent);\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})\nexport class RadioFieldComponent extends RadioFieldMixin 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","import { Component, OnInit, ChangeDetectionStrategy, OnDestroy } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { combineLatest, Observable, Subscription } from 'rxjs';\nimport { shareReplay, startWith, tap } from 'rxjs/operators';\nimport { crisprControlMixin, CrisprFieldComponent } from '../../abstracts';\nimport { observablifyOptions } from '../../form.helpers';\nimport { SelectOption } from '../../models';\nimport { UnitConversionFieldConfig } from '../../models/unit-conversion-field.config';\n\nconst defaultConfig: Partial<UnitConversionFieldConfig> = {};\nconst UnitConversionFieldMixin = crisprControlMixin<UnitConversionFieldConfig>(CrisprFieldComponent);\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})\nexport class UnitConversionFieldComponent extends UnitConversionFieldMixin implements OnInit, OnDestroy {\n defaultConfig = defaultConfig;\n\n displayValueControl = new FormControl();\n unitSelectControl = new FormControl();\n unitOptions$: Observable<SelectOption[]>;\n\n transformationSubscription: Subscription;\n\n ngOnInit() {\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(startWith(this.displayValueControl.value))\n ];\n // setup all required pieces when showing a field for selecting units\n if (this.config.showUnitSelect) {\n this.unitOptions$ = observablifyOptions(this.config.selectableUnits, this.group)\n controlValuePipeline.push(this.unitSelectControl.valueChanges.pipe(startWith(this.config?.initialDisplayUnit || null)));\n this.unitSelectControl.setValue(this.config?.initialDisplayUnit || null);\n }\n\n this.transformationSubscription = combineLatest(controlValuePipeline).subscribe(([displayValue, unitValue] )=> {\n const computedValue = this.config.storedValueConversion(displayValue, unitValue);\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(storedValue || null, unit);\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 initialUnitValue = this.config.showUnitSelect ? this.config?.initialDisplayUnit : null;\n this.setInitialDisplayValue(value, initialUnitValue);\n }\n}\n","import { Component, OnInit, Input, ChangeDetectionStrategy, OnDestroy } from '@angular/core';\nimport { CrisprControlConfig } from '../models';\nimport { Observable, of, Subscription } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { tap, distinctUntilChanged } from 'rxjs/operators';\nimport { computeValueFromFields } from '../form.helpers';\n\n@Component({\n selector: 'crispr-field-container',\n templateUrl: './field-container.component.html',\n styleUrls: ['./field-container.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FieldContainerComponent implements OnInit, OnDestroy {\n // the configuration object for the field\n @Input() config: CrisprControlConfig;\n // the parent formGroup\n @Input() group: FormGroup;\n // boolean whether field-container is inline\n @Input() inlineField = false;\n // used to determine whether or not field should be shown\n disabled$: Observable<boolean>;\n\n subs: Subscription[] = [];\n\n ngOnInit() {\n this.disabled$ = this.connectDisabledCallback(this.group, this.config);\n // we tried moving this into afterViewChecked and afterContentChecked lifecycle hooks without any luck\n if (this.config.computeValue) {\n this.subs.push(\n this.config.computeValue(this.group).pipe(\n distinctUntilChanged(),\n tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))\n ).subscribe(),\n );\n } else if (this.config.computeFieldConfig) {\n console.warn(`computeFieldConfig property is deprecated, please use computeValue. Example here: https://stackblitz.com/github/nayfin/tft-documentation?file=src%2Fapp%2Fcrispr-forms-demo%2Ffeatures%2Fcomputed-field%2Fcomputed-field.component.ts`)\n this.subs.push(\n computeValueFromFields(this.group, this.config.computeFieldConfig).pipe(\n distinctUntilChanged(),\n tap(computedValue => this.group.get(this.config.controlName).setValue(computedValue))\n ).subscribe(),\n );\n }\n }\n\n ngOnDestroy(): void {\n this.subs.forEach(sub => sub.unsubscribe);\n }\n /**\n * Connects user defined disabledCallback function to the the view, so that the control is enabled/disabled\n * appropriately. It also keeps the form will hide disabled fields in the UI unless `hideDisabled` is set to\n * false in the controls config\n * @param group used to get valueChanges from control\n * @param config configuration object used to\n */\n connectDisabledCallback(group: FormGroup, config: CrisprControlConfig = null) {\n const control = group.get(config.controlName);\n // If the disabled$ function exists on the field config then call it with the disabledCallbackConfig\n // as a parameter otherwise return an observable of true.\n return config?.disabledCallback && config.disabledCallback instanceof Function\n ? config.disabledCallback(group, config.disabledCallbackConfig || null).pipe(\n // This enables/disables when callback conditions are met\n tap((shouldDisable) => shouldDisable ? control.disable() : control.enable())\n )\n : of(false);\n }\n}\n","import { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { Info } from '../../models';\n\n@Component({\n selector: 'crispr-info',\n templateUrl: './info.component.html',\n styleUrls: ['./info.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class InfoComponent {\n\n @Input() info: Info;\n\n}\n","import { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { SelectOption } from '../../models';\n\n@Component({\n selector: 'crispr-option',\n templateUrl: './option.component.html',\n styleUrls: ['./option.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OptionComponent {\n\n @Input() option: SelectOption\n\n}\n","import { Component, Input } from '@angular/core';\nimport { ThemePalette } from '@angular/material/core';\n\n@Component({\n selector: 'crispr-selected-file',\n templateUrl: './selected-file.component.html',\n styleUrls: ['./selected-file.component.scss']\n})\nexport class SelectedFileComponent {\n\n @Input() fileName: string;\n @Input() progress: number;\n @Input() showProgress: boolean;\n @Input() color: ThemePalette;\n\n}\n","import { Directive, HostListener, Output, EventEmitter, Input } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[crisprFileDropzone]'\r\n})\r\nexport class FileDropzoneDirective {\r\n\r\n @Output() fileDrop = new EventEmitter<FileList>();\r\n\r\n @Input() crisprFileDropzone = true;\r\n\r\n @HostListener('drop', ['$event'])\r\n onDrop($event: DragEvent) {\r\n if(this.crisprFileDropzone) {\r\n $event.preventDefault();\r\n this.fileDrop.emit($event.dataTransfer.files);\r\n }\r\n }\r\n\r\n // Prevents DOM from trying to open file in browser\r\n @HostListener('dragover', ['$event'])\r\n onDragOver($event: DragEvent) {\r\n if(this.crisprFileDropzone) {\r\n $event.preventDefault();\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\nimport { FieldContainerComponent } from '../field-container/field-container.component';\nimport { InputFieldComponent } from './input-field/input-field.component';\nimport { SelectFieldComponent } from './select-field/select-field.component';\nimport { AutocompleteFieldComponent } from './autocomplete-field/autocomplete-field.component';\nimport { CheckboxFieldComponent } from './checkbox-field/checkbox-field.component';\nimport { TextareaFieldComponent } from './textarea-field/textarea-field.component';\nimport { ButtonComponent } from './button/button.component';\nimport { DatepickerFieldComponent } from './datepicker-field/datepicker-field.component';\nimport { MatMomentDateModule } from '@angular/material-moment-adapter';\nimport { HeadingComponent } from './heading/heading.component';\nimport { InfoComponent } from './info/info.component';\nimport { SliderFieldComponent } from './slider-field/slider-field.component';\nimport { DividerComponent } from './divider/divider.component';\n// tslint:disable-next-line: max-line-length\nimport { AutocompleteChiplistFieldComponent } from './autocomplete-chiplist-field/autocomplete-chiplist-field.component';\nimport { OptionComponent } from './option/option.component';\nimport { RadioFieldComponent } from './radio-field/radio-field.component';\nimport { FileUploadComponent } from './file-upload/file-upload.component';\nimport { SelectedFileComponent } from './selected-file/selected-file.component';\nimport { FileDropzoneDirective } from './file-upload/file-dropzone.directive';\nimport { UnitConversionFieldComponent } from './unit-conversion-field/unit-conversion-field.component';\nimport { PortalModule } from '@angular/cdk/portal';\n\n// TODO: Should we import UI library?\n// Will the tree shaker shake the unused modules?\nconst MAT_DESIGN_MODULES = [\n MatIconModule,\n MatAutocompleteModule,\n MatDatepickerModule,\n MatInputModule,\n MatRadioModule,\n MatSelectModule,\n MatCheckboxModule,\n MatChipsModule,\n MatSliderModule,\n MatSlideToggleModule,\n MatButtonModule,\n MatButtonToggleModule,\n MatChipsModule,\n MatTooltipModule,\n MatFormFieldModule,\n MatMomentDateModule,\n MatDividerModule,\n MatProgressBarModule,\n PortalModule\n];\n\nconst CRISPR_FIELDS = [\n FieldContainerComponent,\n InputFieldComponent,\n SelectFieldComponent,\n RadioFieldComponent,\n AutocompleteFieldComponent,\n AutocompleteChiplistFieldComponent,\n CheckboxFieldComponent,\n TextareaFieldComponent,\n DatepickerFieldComponent,\n SliderFieldComponent,\n ButtonComponent,\n HeadingComponent,\n DividerComponent,\n FileUploadComponent,\n UnitConversionFieldComponent\n];\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n ...MAT_DESIGN_MODULES,\n ],\n exports: [\n ...MAT_DESIGN_MODULES,\n ...CRISPR_FIELDS\n ],\n declarations: [\n ...CRISPR_FIELDS,\n InfoComponent,\n OptionComponent,\n SelectedFileComponent,\n FileDropzoneDirective,\n ],\n entryComponents: CRISPR_FIELDS\n})\n\nexport class MaterialModule {\n}\n","import { Component, Input, OnInit, Output, EventEmitter, ChangeDetectionStrategy, OnDestroy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { ControlGroupValue, ControlValue, FormConfig } from '../models';\nimport { buildFormGroupFromConfig } from '../form.helpers';\nimport { Subscription, Observable } from 'rxjs';\n@Component({\n selector: 'crispr-form',\n styleUrls: ['form.component.scss'],\n templateUrl: 'form.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CrisprFormComponent implements OnInit {\n // if no form has been passed in by consuming component, we create an empty group to build out\n @Input() config: FormConfig;\n @Input() form: FormGroup = new FormGroup({});\n @Input() value: ControlGroupValue = null;\n\n @Output() submitted = new EventEmitter<FormGroup>();\n // proxy value and status change events through to consuming component\n @Output() valueChanges: Observable<any> = this.form.valueChanges;\n @Output() statusChanges: Observable<string> = this.form.statusChanges;\n\n subs: Subscription[] = [];\n\n ngOnInit() {\n // build out the form, note that we pass in the form as the third argument and the function modifies it\n buildFormGroupFromConfig(this.config, this.value, this.form);\n }\n\n handleSubmit() {\n this.form.markAllAsTouched();\n this.submitted.emit(this.form);\n }\n}\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup, FormArray } from '@angular/forms';\n\nimport { FormGroupListConfig } from '../models';\nimport { createControlForType } from '../form.helpers';\nimport { CrisprFieldComponent, crisprControlMixin } from '../abstracts';\n\nconst defaultConfig: Partial<FormGroupListConfig> = {\n addButtonLabel: 'ADD ITEM',\n minListLength: 1,\n};\n\nconst FormGroupListMixin = crisprControlMixin<FormGroupListConfig>(CrisprFieldComponent);\n@Component({\n selector: 'crispr-form-group-list',\n templateUrl: './form-group-list.component.html',\n styleUrls: ['./form-group-list.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class FormGroupListComponent extends FormGroupListMixin implements OnInit {\n defaultConfig = defaultConfig\n group: FormGroup;\n control: FormArray;\n _value: any[]\n // value: any[]; // TODO: not sure how to strongly type this yet\n formArray: FormArray;\n\n ngOnInit() {\n super.ngOnInit();\n // TODO: this is required to ngFor of controls in template, must be a better way\n this.formArray = this.control as FormArray;\n }\n\n setControlValue(values: any[]) {\n if(this.control) {\n if(values?.length > 0) {\n values.forEach(value => this.addGroup(value));\n } else if (this.config.displayInitialItem) {\n this.addGroup()\n }\n }\n }\n\n addGroup(value = null) {\n this.control.push(createControlForType(this.config.itemConfig, value));\n }\n\n deleteGroup(index: number) {\n this.control.removeAt(index);\n }\n}\n\n\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { SubGroupConfig } from '../models';\nimport { crisprControlMixin, CrisprFieldComponent } from '../abstracts';\n\n\nconst FormGroupMixin = crisprControlMixin<SubGroupConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-sub-group',\n templateUrl: './sub-group.component.html',\n styleUrls: ['./sub-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SubGroupComponent extends FormGroupMixin implements OnInit {\n group: FormGroup;\n\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","// tslint:disable-next-line: max-line-length\nimport { InputFieldComponent, SelectFieldComponent, AutocompleteFieldComponent,\n AutocompleteChiplistFieldComponent, TextareaFieldComponent, CheckboxFieldComponent,\n RadioFieldComponent, FileUploadComponent, SliderFieldComponent, DatepickerFieldComponent,\n HeadingComponent, DividerComponent, ButtonComponent, UnitConversionFieldComponent } from './material';\nimport { FormGroupListComponent } from './form-group-list/form-group-list.component';\nimport { isControlConfig } from './form.helpers';\nimport { ControlType } from './models';\nimport { SubGroupComponent } from './sub-group/sub-group.component';\n\nexport const FIELD_COMPONENTS = {\n button: ButtonComponent,\n input: InputFieldComponent,\n select: SelectFieldComponent,\n radio: RadioFieldComponent,\n subGroup: SubGroupComponent,\n groupList: FormGroupListComponent,\n autocomplete: AutocompleteFieldComponent,\n autocompleteChiplist: AutocompleteChiplistFieldComponent,\n textarea: TextareaFieldComponent,\n checkbox: CheckboxFieldComponent,\n slider: SliderFieldComponent,\n datepicker: DatepickerFieldComponent,\n fileUpload: FileUploadComponent,\n heading: HeadingComponent,\n divider: DividerComponent,\n unitConversion: UnitConversionFieldComponent\n};\n\nexport function isControlComponent(component: CrisprFieldComponent): component is CrisprControlComponent {\n return isControlConfig(component.config) || component.config.controlType === ControlType.BUTTON;\n}\n\nexport type CrisprControlComponent = ButtonComponent |\n InputFieldComponent |\n SelectFieldComponent |\n RadioFieldComponent |\n SubGroupComponent |\n FormGroupListComponent |\n AutocompleteFieldComponent |\n AutocompleteChiplistFieldComponent |\n TextareaFieldComponent |\n CheckboxFieldComponent |\n SliderFieldComponent |\n FileUploadComponent |\n DatepickerFieldComponent |\n UnitConversionFieldComponent;\n\nexport type ComponentKeys = keyof typeof FIELD_COMPONENTS;\n// export type CrisprFieldComponent = FIELD_COMPONENTS[ComponentKeys];\n\nexport type CrisprFieldComponent = CrisprControlComponent |\n HeadingComponent|\n DividerComponent;\n\n","import { Directive, Input, ComponentFactoryResolver, ViewContainerRef, OnInit, Renderer2 } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { AnyFieldConfig, ControlValue } from './models';\nimport { CrisprFieldComponent , FIELD_COMPONENTS, isControlComponent } from './field-component-map.const';\n\n@Directive({\n selector: '[crisprField]'\n})\nexport class CrisprFieldDirective implements OnInit {\n\n @Input() config: AnyFieldConfig;\n @Input() group: FormGroup;\n @Input() value: ControlValue | any[];\n component: CrisprFieldComponent;\n\n constructor(\n private resolver: ComponentFactoryResolver,\n private container: ViewContainerRef,\n private renderer: Renderer2\n ) {}\n\n ngOnInit() {\n /**\n * create component and set values from config on its instance\n */\n const component = this.config.component || FIELD_COMPONENTS[this.config.controlType];\n const factory = this.resolver.resolveComponentFactory<CrisprFieldComponent>(component);\n const componentRef = this.container.createComponent(factory);\n\n this.component = componentRef.instance;\n this.component.config = this.config;\n if ( isControlComponent(this.component)) {\n this.component.group = this.group;\n if ('value' in this.component) {\n this.component.value = this.value;\n }\n }\n // adds any config classes to the dynamically generated component\n // doing this here keeps us from having to extend a base component into each field component individually\n if(!this.config.classes) return;\n this.config.classes.forEach((klass) => {\n // check for passing multiple classes in one array element\n if(klass.includes(' ')) {\n throw Error(`Improperly formatted class. '${klass}' cannot contain spaces.`);\n } else {\n this.renderer.addClass(componentRef.location.nativeElement, klass);\n }\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ControlValue, AnyFieldConfig } from '../models';\nimport { isControlConfig } from '../form.helpers';\n\n@Pipe({\n name: 'initialControlValue'\n})\nexport class InitialControlValuePipe implements PipeTransform {\n // TODO: does changing any to unknown break anything?\n transform(initialFormValue: {[key: string]: ControlValue | any}, fieldConfig: AnyFieldConfig): unknown {\n return (initialFormValue && isControlConfig(fieldConfig))\n ? initialFormValue[fieldConfig.controlName] || null\n : null;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n// custom modules\nimport { MaterialModule } from './material/material.module'\n\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\n// components\nimport { CrisprFormComponent } from './form/form.component';\nimport { FormGroupListComponent } from './form-group-list/form-group-list.component';\n// directives\nimport { CrisprFieldDirective } from './field.directive';\nimport { InitialControlValuePipe } from './pipes/initial-control-value.pipe';\nimport { SubGroupComponent } from './sub-group/sub-group.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n MaterialModule\n ],\n declarations: [\n CrisprFieldDirective,\n CrisprFormComponent,\n FormGroupListComponent,\n InitialControlValuePipe,\n SubGroupComponent,\n ],\n exports: [\n CrisprFormComponent,\n MaterialModule\n ],\n entryComponents: [\n FormGroupListComponent,\n SubGroupComponent\n ],\n\n})\nexport class CrisprFormsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {AbstractAutocompleteComponent as ɵg,CrisprFieldComponent as ɵn} from './lib/abstracts';\nexport {FieldContainerComponent as ɵb} from './lib/field-container/field-container.component';\nexport {CrisprFieldDirective as ɵw} from './lib/field.directive';\nexport {FormGroupListComponent as ɵx} from './lib/form-group-list/form-group-list.component';\nexport {AutocompleteChiplistFieldComponent as ɵh} from './lib/material/autocomplete-chiplist-field/autocomplete-chiplist-field.component';\nexport {AutocompleteFieldComponent as ɵf} from './lib/material/autocomplete-field/autocomplete-field.component';\nexport {ButtonComponent as ɵm} from './lib/material/button/button.component';\nexport {CheckboxFieldComponent as ɵi} from './lib/material/checkbox-field/checkbox-field.component';\nexport {DatepickerFieldComponent as ɵk} from './lib/material/datepicker-field/datepicker-field.component';\nexport {DividerComponent as ɵp} from './lib/material/divider/divider.component';\nexport {FileDropzoneDirective as ɵv} from './lib/material/file-upload/file-dropzone.directive';\nexport {FileUploadComponent as ɵq} from './lib/material/file-upload/file-upload.component';\nexport {HeadingComponent as ɵo} from './lib/material/heading/heading.component';\nexport {InfoComponent as ɵs} from './lib/material/info/info.component';\nexport {InputFieldComponent as ɵc} from './lib/material/input-field/input-field.component';\nexport {MaterialModule as ɵa} from './lib/material/material.module';\nexport {OptionComponent as ɵt} from './lib/material/option/option.component';\nexport {RadioFieldComponent as ɵe} from './lib/material/radio-field/radio-field.component';\nexport {SelectFieldComponent as ɵd} from './lib/material/select-field/select-field.component';\nexport {SelectedFileComponent as ɵu} from './lib/material/selected-file/selected-file.component';\nexport {SliderFieldComponent as ɵl} from './lib/material/slider-field/slider-field.component';\nexport {TextareaFieldComponent as ɵj} from './lib/material/textarea-field/textarea-field.component';\nexport {UnitConversionFieldComponent as ɵr} from './lib/material/unit-conversion-field/unit-conversion-field.component';\nexport {InitialControlValuePipe as ɵy} from './lib/pipes/initial-control-value.pipe';\nexport {SubGroupComponent as ɵz} from './lib/sub-group/sub-group.component';"],"names":["defaultConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MA2Ba,6BAA6B,GAAG;;ACK7C;IACY;AAAZ,WAAY,WAAW;IACrB,4CAA6B,CAAA;IAC7B,6DAA8C,CAAA;IAC9C,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,kCAAmB,CAAA;IACnB,yCAA0B,CAAA;IAC1B,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,uCAAwB,CAAA;IACxB,8BAAe,CAAA;IACf,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,qCAAsB,CAAA;IACtB,oCAAqB,CAAA;IACrB,iDAAkC,CAAA;AACpC,CAAC,EAlBW,WAAW,KAAX,WAAW;;ACpBtB;;SCXe,OAAO,CAAE,MAAgB;IACvC,OAAO,GAAG,CAAE,CAAC,KAAa;QACxB,IAAI,KAAK,EAAE;YACT,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;gBAClB,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;oBACd,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBACxD,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC;oBAChD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC1B;qBAAM;oBACL,OAAO,CAAC,KAAK,KAAK,CAAC;iBACpB;aACF,CAAC,CAAC;SACJ;aAAM;YACL,OAAO,KAAK,CAAC;SACd;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,OAAO,CAAC,MAAc;IAC7B,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,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B;YAAE,gBAAgB;YAAU,SAAS;;;qBAUrF,KAAK;oBACL,KAAK;oBACL,KAAK;;;MCLK,uBAAuB;;IAElC,SAAS,CAAC,gBAAqD,EAAE,WAA2B;QAC1F,OAAO,CAAC,gBAAgB,IAAI,eAAe,CAAC,WAAW,CAAC;cACpD,gBAAgB,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,IAAI;cACjD,IAAI,CAAC;KACV;;;YATF,IAAI,SAAC;gBACJ,IAAI,EAAE,qBAAqB;aAC5B;;;MCkCY,iBAAiB;;;YAxB7B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,mBAAmB;oBACnB,2BAA2B;oBAC3B,cAAc;iBACf;gBACD,YAAY,EAAE;oBACZ,oBAAoB;oBACpB,mBAAmB;oBACnB,sBAAsB;oBACtB,uBAAuB;oBACvB,iBAAiB;iBAClB;gBACD,OAAO,EAAE;oBACP,mBAAmB;oBACnB,cAAc;iBACf;gBACD,eAAe,EAAE;oBACf,sBAAsB;oBACtB,iBAAiB;iBAClB;aAEF;;;ACvCD;;;;;;"}
|
|
@@ -15,6 +15,6 @@ export declare class AutocompleteFieldComponent extends AbstractAutocompleteComp
|
|
|
15
15
|
* input is expecting.
|
|
16
16
|
* @param options the array of options to search for option with corresponding value
|
|
17
17
|
*/
|
|
18
|
-
displayLabel(options: SelectOption[]): (value:
|
|
18
|
+
displayLabel(options: SelectOption[]): (value: unknown) => string;
|
|
19
19
|
handleSelect(event: MatAutocompleteSelectedEvent): void;
|
|
20
20
|
}
|