@tft/crispr-forms 14.0.1-rc.2 → 14.0.1
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/esm2020/src/lib/field-component-map.const.mjs +18 -18
- package/esm2020/src/lib/field.directive.mjs +2 -2
- package/esm2020/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +9 -6
- package/esm2020/ui/autocomplete-chiplist-field/public-api.mjs +2 -0
- package/esm2020/ui/autocomplete-chiplist-field/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +5 -0
- package/esm2020/ui/autocomplete-field/autocomplete-field.component.mjs +8 -5
- package/esm2020/ui/autocomplete-field/public-api.mjs +2 -0
- package/esm2020/ui/autocomplete-field/tft-crispr-forms-ui-autocomplete-field.mjs +5 -0
- package/esm2020/ui/button/button.component.mjs +5 -2
- package/esm2020/ui/button/public-api.mjs +2 -0
- package/esm2020/ui/button/tft-crispr-forms-ui-button.mjs +5 -0
- package/esm2020/ui/checkbox-field/checkbox-field.component.mjs +7 -7
- package/esm2020/ui/checkbox-field/public-api.mjs +2 -0
- package/esm2020/ui/checkbox-field/tft-crispr-forms-ui-checkbox-field.mjs +5 -0
- package/esm2020/ui/datepicker-field/datepicker-field.component.mjs +8 -5
- package/esm2020/ui/datepicker-field/public-api.mjs +2 -0
- package/esm2020/ui/datepicker-field/tft-crispr-forms-ui-datepicker-field.mjs +5 -0
- package/esm2020/ui/divider/public-api.mjs +2 -0
- package/esm2020/ui/divider/tft-crispr-forms-ui-divider.mjs +5 -0
- package/esm2020/ui/{file-upload/file-upload.component.mjs → file-upload-field/file-upload-field.component.mjs} +3 -3
- package/esm2020/ui/file-upload-field/public-api.mjs +2 -0
- package/esm2020/ui/file-upload-field/tft-crispr-forms-ui-file-upload-field.mjs +5 -0
- package/esm2020/ui/input-field/input-field.component.mjs +7 -4
- package/esm2020/ui/input-field/public-api.mjs +2 -0
- package/esm2020/ui/input-field/tft-crispr-forms-ui-input-field.mjs +5 -0
- package/esm2020/ui/option/public-api.mjs +2 -0
- package/esm2020/ui/option/tft-crispr-forms-ui-option.mjs +5 -0
- package/esm2020/ui/public-api.mjs +1 -15
- package/esm2020/ui/radio-field/public-api.mjs +2 -0
- package/esm2020/ui/radio-field/radio-field.component.mjs +7 -4
- package/esm2020/ui/radio-field/tft-crispr-forms-ui-radio-field.mjs +5 -0
- package/esm2020/ui/select-field/public-api.mjs +2 -0
- package/esm2020/ui/select-field/select-field.component.mjs +9 -10
- package/esm2020/ui/select-field/tft-crispr-forms-ui-select-field.mjs +5 -0
- package/esm2020/ui/slider-field/public-api.mjs +2 -0
- package/esm2020/ui/slider-field/slider-field.component.mjs +8 -5
- package/esm2020/ui/slider-field/tft-crispr-forms-ui-slider-field.mjs +5 -0
- package/esm2020/ui/textarea-field/public-api.mjs +2 -0
- package/esm2020/ui/textarea-field/textarea-field.component.mjs +6 -3
- package/esm2020/ui/textarea-field/tft-crispr-forms-ui-textarea-field.mjs +5 -0
- package/esm2020/ui/unit-conversion-field/public-api.mjs +2 -0
- package/esm2020/ui/unit-conversion-field/tft-crispr-forms-ui-unit-conversion-field.mjs +5 -0
- package/esm2020/ui/unit-conversion-field/unit-conversion-field.component.mjs +7 -4
- package/esm2020/utils/models/file-upload-field.config.mjs +1 -1
- package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +138 -0
- package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs +101 -0
- package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-button.mjs +55 -0
- package/fesm2015/tft-crispr-forms-ui-button.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs +49 -0
- package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs +71 -0
- package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-divider.mjs +34 -0
- package/fesm2015/tft-crispr-forms-ui-divider.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs +117 -0
- package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-input-field.mjs +48 -0
- package/fesm2015/tft-crispr-forms-ui-input-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-option.mjs +26 -0
- package/fesm2015/tft-crispr-forms-ui-option.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-radio-field.mjs +46 -0
- package/fesm2015/tft-crispr-forms-ui-radio-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-select-field.mjs +81 -0
- package/fesm2015/tft-crispr-forms-ui-select-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-slider-field.mjs +51 -0
- package/fesm2015/tft-crispr-forms-ui-slider-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs +49 -0
- package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs +93 -0
- package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui.mjs +2 -674
- package/fesm2015/tft-crispr-forms-ui.mjs.map +1 -1
- package/fesm2015/tft-crispr-forms.mjs +18 -18
- package/fesm2015/tft-crispr-forms.mjs.map +1 -1
- package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +137 -0
- package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs +100 -0
- package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-button.mjs +55 -0
- package/fesm2020/tft-crispr-forms-ui-button.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs +49 -0
- package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs +70 -0
- package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-divider.mjs +34 -0
- package/fesm2020/tft-crispr-forms-ui-divider.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs +115 -0
- package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-input-field.mjs +48 -0
- package/fesm2020/tft-crispr-forms-ui-input-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-option.mjs +26 -0
- package/fesm2020/tft-crispr-forms-ui-option.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-radio-field.mjs +46 -0
- package/fesm2020/tft-crispr-forms-ui-radio-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-select-field.mjs +80 -0
- package/fesm2020/tft-crispr-forms-ui-select-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-slider-field.mjs +51 -0
- package/fesm2020/tft-crispr-forms-ui-slider-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs +49 -0
- package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs +91 -0
- package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui.mjs +2 -666
- package/fesm2020/tft-crispr-forms-ui.mjs.map +1 -1
- package/fesm2020/tft-crispr-forms.mjs +18 -18
- package/fesm2020/tft-crispr-forms.mjs.map +1 -1
- package/package.json +113 -2
- package/src/lib/field-component-map.const.d.ts +31 -18
- package/tft-crispr-forms-14.0.1.tgz +0 -0
- package/ui/autocomplete-chiplist-field/index.d.ts +5 -1
- package/ui/autocomplete-chiplist-field/public-api.d.ts +1 -0
- package/ui/autocomplete-field/index.d.ts +5 -1
- package/ui/autocomplete-field/public-api.d.ts +1 -0
- package/ui/button/index.d.ts +5 -1
- package/ui/button/public-api.d.ts +1 -0
- package/ui/checkbox-field/index.d.ts +5 -1
- package/ui/checkbox-field/public-api.d.ts +1 -0
- package/ui/datepicker-field/index.d.ts +5 -1
- package/ui/datepicker-field/public-api.d.ts +1 -0
- package/ui/divider/index.d.ts +5 -1
- package/ui/divider/public-api.d.ts +1 -0
- package/ui/{file-upload/file-upload.component.d.ts → file-upload-field/file-upload-field.component.d.ts} +0 -0
- package/ui/file-upload-field/index.d.ts +5 -0
- package/ui/file-upload-field/public-api.d.ts +1 -0
- package/ui/input-field/index.d.ts +5 -1
- package/ui/input-field/public-api.d.ts +1 -0
- package/ui/option/index.d.ts +5 -1
- package/ui/option/public-api.d.ts +1 -0
- package/ui/public-api.d.ts +0 -14
- package/ui/radio-field/index.d.ts +5 -1
- package/ui/radio-field/public-api.d.ts +1 -0
- package/ui/select-field/index.d.ts +5 -1
- package/ui/select-field/public-api.d.ts +1 -0
- package/ui/slider-field/index.d.ts +5 -1
- package/ui/slider-field/public-api.d.ts +1 -0
- package/ui/textarea-field/index.d.ts +5 -1
- package/ui/textarea-field/public-api.d.ts +1 -0
- package/ui/unit-conversion-field/index.d.ts +5 -1
- package/ui/unit-conversion-field/public-api.d.ts +1 -0
- package/utils/models/file-upload-field.config.d.ts +7 -1
- package/esm2020/ui/autocomplete-chiplist-field/index.mjs +0 -2
- package/esm2020/ui/autocomplete-field/index.mjs +0 -2
- package/esm2020/ui/button/index.mjs +0 -2
- package/esm2020/ui/checkbox-field/index.mjs +0 -2
- package/esm2020/ui/datepicker-field/index.mjs +0 -2
- package/esm2020/ui/divider/index.mjs +0 -2
- package/esm2020/ui/file-upload/index.mjs +0 -2
- package/esm2020/ui/input-field/index.mjs +0 -2
- package/esm2020/ui/option/index.mjs +0 -2
- package/esm2020/ui/radio-field/index.mjs +0 -2
- package/esm2020/ui/select-field/index.mjs +0 -2
- package/esm2020/ui/slider-field/index.mjs +0 -2
- package/esm2020/ui/textarea-field/index.mjs +0 -2
- package/esm2020/ui/unit-conversion-field/index.mjs +0 -2
- package/tft-crispr-forms-14.0.1-rc.2.tgz +0 -0
- package/ui/file-upload/index.d.ts +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/divider';
|
|
4
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import { CrisprFieldComponent } from '@tft/crispr-forms/utils';
|
|
8
|
+
|
|
9
|
+
class DividerComponent extends CrisprFieldComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
// TODO: pull in type after configs are better organized
|
|
13
|
+
this.defaultConfig = {};
|
|
14
|
+
}
|
|
15
|
+
ngOnInit() {
|
|
16
|
+
super.ngOnInit();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
DividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
DividerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: DividerComponent, isStandalone: true, selector: "crispr-divider", usesInheritance: true, ngImport: i0, template: "<mat-divider [ngClass]=\"config.classes\"></mat-divider>", styles: [":host{display:block;padding:1em 0}::ng-deep .mat-divider.mat-divider-horizontal{position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], preserveWhitespaces: true });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, decorators: [{
|
|
22
|
+
type: Component,
|
|
23
|
+
args: [{ selector: 'crispr-divider', standalone: true, imports: [
|
|
24
|
+
CommonModule,
|
|
25
|
+
MatDividerModule
|
|
26
|
+
], template: "<mat-divider [ngClass]=\"config.classes\"></mat-divider>", styles: [":host{display:block;padding:1em 0}::ng-deep .mat-divider.mat-divider-horizontal{position:relative}\n"] }]
|
|
27
|
+
}] });
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Generated bundle index. Do not edit.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
export { DividerComponent };
|
|
34
|
+
//# sourceMappingURL=tft-crispr-forms-ui-divider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-ui-divider.mjs","sources":["../../../../libs/crispr-forms/ui/divider/divider.component.ts","../../../../libs/crispr-forms/ui/divider/divider.component.html","../../../../libs/crispr-forms/ui/divider/tft-crispr-forms-ui-divider.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { CommonModule } from '@angular/common';\n// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries\nimport { CrisprFieldComponent, DividerConfig } from '@tft/crispr-forms/utils';\n\n@Component({\n selector: 'crispr-divider',\n templateUrl: './divider.component.html',\n styleUrls: ['./divider.component.scss'],\n standalone: true,\n imports: [\n CommonModule,\n MatDividerModule\n ],\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","<mat-divider [ngClass]=\"config.classes\"></mat-divider>","/**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as i2 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Component, ChangeDetectionStrategy, Optional, Self, ViewChild } from '@angular/core';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i4 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
import * as i5 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
+
import * as i3 from '@angular/material/icon';
|
|
12
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
13
|
+
import * as i6 from '@angular/material/input';
|
|
14
|
+
import { MatInputModule } from '@angular/material/input';
|
|
15
|
+
import { of } from 'rxjs';
|
|
16
|
+
import { FileDropzoneDirective } from '@tft/crispr-forms/ui/file-dropzone';
|
|
17
|
+
import * as i7 from '@tft/form-validation-handler';
|
|
18
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
19
|
+
import { crisprControlMixin, CrisprFieldComponent } from '@tft/crispr-forms/utils';
|
|
20
|
+
import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
|
|
21
|
+
import { SelectedFileComponent } from '@tft/crispr-forms/ui/selected-file';
|
|
22
|
+
|
|
23
|
+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
|
|
24
|
+
const FileUploadFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
25
|
+
class FileUploadFieldComponent extends FileUploadFieldMixin {
|
|
26
|
+
// ngControl: NgControl = null;
|
|
27
|
+
constructor(ngControl) {
|
|
28
|
+
super();
|
|
29
|
+
this.ngControl = ngControl;
|
|
30
|
+
this.defaultConfig = {
|
|
31
|
+
allowMultipleFiles: false,
|
|
32
|
+
acceptedTypes: '*.*',
|
|
33
|
+
dropZoneText: 'DROP FILE HERE',
|
|
34
|
+
selectFilesButtonType: 'button',
|
|
35
|
+
selectButtonText: 'SELECT',
|
|
36
|
+
showClearFilesButton: true,
|
|
37
|
+
clearFilesButtonText: 'CLEAR',
|
|
38
|
+
uploadButtonText: 'UPLOAD',
|
|
39
|
+
uploadButtonType: 'button',
|
|
40
|
+
showUploadProgress: false,
|
|
41
|
+
disableOnUpload: true
|
|
42
|
+
};
|
|
43
|
+
this.isUploaded = false;
|
|
44
|
+
this.fileProgress = [];
|
|
45
|
+
if (this.ngControl != null) {
|
|
46
|
+
// Setting the value accessor directly (instead of using
|
|
47
|
+
// the providers) to avoid running into a circular import.
|
|
48
|
+
ngControl.valueAccessor = this;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
ngOnInit() {
|
|
52
|
+
super.ngOnInit();
|
|
53
|
+
this.disabled$ = this.config.disabledCallback
|
|
54
|
+
? this.config.disabledCallback(this.group)
|
|
55
|
+
: of(false);
|
|
56
|
+
}
|
|
57
|
+
filesChanged(files) {
|
|
58
|
+
if (files && files.length > 0) {
|
|
59
|
+
this.selectedFiles = files;
|
|
60
|
+
this.control.patchValue(files);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
uploadFiles() {
|
|
64
|
+
if (this.selectedFiles && this.config.uploadFiles) {
|
|
65
|
+
this.isUploaded = true;
|
|
66
|
+
this.config.uploadFiles(this.group, this.selectedFiles, this);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
resetFileInput() {
|
|
70
|
+
this.fileInputRef.nativeElement.value = '';
|
|
71
|
+
this.control.patchValue(null);
|
|
72
|
+
this.isUploaded = false;
|
|
73
|
+
}
|
|
74
|
+
writeValue(value) {
|
|
75
|
+
// clear file input
|
|
76
|
+
// this.host.nativeElement.value = '';
|
|
77
|
+
// this.file = null;
|
|
78
|
+
}
|
|
79
|
+
registerOnChange(fn) {
|
|
80
|
+
this.onChange = fn;
|
|
81
|
+
}
|
|
82
|
+
registerOnTouched(fn) {
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
FileUploadFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
+
FileUploadFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: FileUploadFieldComponent, isStandalone: true, selector: "crispr-file-upload-field", viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n appearance=\"outline\"\n [crisprFileDropzone]=\"!(disabled$ | async) && !(config.disableOnUpload && isUploaded)\"\n [formGroup]=\"group\"\n (fileDrop)=\"filesChanged($event)\">\n\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n style=\"display: none\"\n [accept]=\"config.acceptedTypes\"\n [multiple]=\"config.allowMultipleFiles\"\n (change)=\"filesChanged($event.target.files)\"/>\n <mat-label>{{config.label}}</mat-label>\n\n <div *ngIf=\"!(selectedFiles?.length > 0); else selectedFileList\" class=\"drop-info\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n or\n <button\n mat-raised-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async) || config.disableOnUpload && isUploaded\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n {{config.selectButtonText}}\n </button>\n </div>\n <ng-template #selectedFileList>\n <div class=\"selected-files-container\">\n <div class=\"selected-files-list\">\n <crispr-selected-file\n *ngFor=\"let file of selectedFiles; let i = index;\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"file.name\"\n [showProgress]=\"config.showUploadProgress\"\n [progress]=\"fileProgress && (fileProgress[i] | async)\">\n </crispr-selected-file>\n </div>\n\n </div>\n </ng-template>\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n </mat-form-field>\n <div class=\"button-container\" *ngIf=\"selectedFiles?.length > 0\">\n\n <button\n mat-button\n (click)=\"resetFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n aria-label=\"Remove Selected File(s)\">\n {{config.clearFilesButtonText}}\n <mat-icon>delete</mat-icon>\n </button>\n\n <button\n *ngIf=\"!!config.uploadFiles\"\n mat-raised-button\n type=\"button\"\n color=\"accent\"\n class=\"file-input-button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n (click)=\"uploadFiles()\"\n [attr.aria-label]=\"config.uploadButtonText\">\n {{ config.uploadButtonText }}\n </button>\n\n </div>\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0;display:flex;justify-content:center}:host .drop-info{display:flex;flex-direction:column;align-items:center}:host .drop-info .drop-icon{font-size:36px}:host .drop-info .mat-h2{margin:0}:host .button-container{display:flex;justify-content:flex-end;margin-top:-16px}:host .button-container button{margin-left:8px}:host .selected-files-container{width:100%}:host [matInput]{position:absolute;max-height:0;visibility:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: SelectedFileComponent, selector: "crispr-selected-file", inputs: ["fileName", "progress", "showProgress", "color"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "directive", type: FileDropzoneDirective, selector: "[crisprFileDropzone]", inputs: ["crisprFileDropzone"], outputs: ["fileDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, decorators: [{
|
|
88
|
+
type: Component,
|
|
89
|
+
args: [{ selector: 'crispr-file-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
90
|
+
CommonModule,
|
|
91
|
+
FieldContainerComponent,
|
|
92
|
+
ReactiveFormsModule,
|
|
93
|
+
MatIconModule,
|
|
94
|
+
MatButtonModule,
|
|
95
|
+
MatFormFieldModule,
|
|
96
|
+
MatInputModule,
|
|
97
|
+
SelectedFileComponent,
|
|
98
|
+
FormValidationHandlerModule,
|
|
99
|
+
FileDropzoneDirective,
|
|
100
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n appearance=\"outline\"\n [crisprFileDropzone]=\"!(disabled$ | async) && !(config.disableOnUpload && isUploaded)\"\n [formGroup]=\"group\"\n (fileDrop)=\"filesChanged($event)\">\n\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n style=\"display: none\"\n [accept]=\"config.acceptedTypes\"\n [multiple]=\"config.allowMultipleFiles\"\n (change)=\"filesChanged($event.target.files)\"/>\n <mat-label>{{config.label}}</mat-label>\n\n <div *ngIf=\"!(selectedFiles?.length > 0); else selectedFileList\" class=\"drop-info\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n or\n <button\n mat-raised-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async) || config.disableOnUpload && isUploaded\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n {{config.selectButtonText}}\n </button>\n </div>\n <ng-template #selectedFileList>\n <div class=\"selected-files-container\">\n <div class=\"selected-files-list\">\n <crispr-selected-file\n *ngFor=\"let file of selectedFiles; let i = index;\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"file.name\"\n [showProgress]=\"config.showUploadProgress\"\n [progress]=\"fileProgress && (fileProgress[i] | async)\">\n </crispr-selected-file>\n </div>\n\n </div>\n </ng-template>\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n </mat-form-field>\n <div class=\"button-container\" *ngIf=\"selectedFiles?.length > 0\">\n\n <button\n mat-button\n (click)=\"resetFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n aria-label=\"Remove Selected File(s)\">\n {{config.clearFilesButtonText}}\n <mat-icon>delete</mat-icon>\n </button>\n\n <button\n *ngIf=\"!!config.uploadFiles\"\n mat-raised-button\n type=\"button\"\n color=\"accent\"\n class=\"file-input-button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n (click)=\"uploadFiles()\"\n [attr.aria-label]=\"config.uploadButtonText\">\n {{ config.uploadButtonText }}\n </button>\n\n </div>\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0;display:flex;justify-content:center}:host .drop-info{display:flex;flex-direction:column;align-items:center}:host .drop-info .drop-icon{font-size:36px}:host .drop-info .mat-h2{margin:0}:host .button-container{display:flex;justify-content:flex-end;margin-top:-16px}:host .button-container button{margin-left:8px}:host .selected-files-container{width:100%}:host [matInput]{position:absolute;max-height:0;visibility:hidden}\n"] }]
|
|
101
|
+
}], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
|
|
102
|
+
type: Optional
|
|
103
|
+
}, {
|
|
104
|
+
type: Self
|
|
105
|
+
}] }]; }, propDecorators: { fileInputRef: [{
|
|
106
|
+
type: ViewChild,
|
|
107
|
+
args: ['fileInput']
|
|
108
|
+
}] } });
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Generated bundle index. Do not edit.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
export { FileUploadFieldComponent };
|
|
115
|
+
//# sourceMappingURL=tft-crispr-forms-ui-file-upload-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-ui-file-upload-field.mjs","sources":["../../../../libs/crispr-forms/ui/file-upload-field/file-upload-field.component.ts","../../../../libs/crispr-forms/ui/file-upload-field/file-upload-field.component.html","../../../../libs/crispr-forms/ui/file-upload-field/tft-crispr-forms-ui-file-upload-field.ts"],"sourcesContent":["/* eslint-disable @nrwl/nx/enforce-module-boundaries */\nimport { CommonModule } from '@angular/common';\nimport {\n Component,\n ElementRef,\n ViewChild,\n OnInit,\n ChangeDetectionStrategy,\n Optional,\n Self,\n} from '@angular/core';\nimport { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { Observable, of } from 'rxjs';\nimport { FileDropzoneDirective } from '@tft/crispr-forms/ui/file-dropzone';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\nimport { crisprControlMixin, CrisprFieldComponent, FileUploadFieldConfig } from '@tft/crispr-forms/utils';\nimport { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';\nimport { SelectedFileComponent } from '@tft/crispr-forms/ui/selected-file';\n\nconst FileUploadFieldMixin = crisprControlMixin<FileUploadFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-file-upload-field',\n templateUrl: './file-upload-field.component.html',\n styleUrls: ['./file-upload-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n FieldContainerComponent,\n ReactiveFormsModule,\n MatIconModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n SelectedFileComponent,\n FormValidationHandlerModule,\n FileDropzoneDirective,\n ],\n})\nexport class FileUploadFieldComponent 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)\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","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n appearance=\"outline\"\n [crisprFileDropzone]=\"!(disabled$ | async) && !(config.disableOnUpload && isUploaded)\"\n [formGroup]=\"group\"\n (fileDrop)=\"filesChanged($event)\">\n\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n style=\"display: none\"\n [accept]=\"config.acceptedTypes\"\n [multiple]=\"config.allowMultipleFiles\"\n (change)=\"filesChanged($event.target.files)\"/>\n <mat-label>{{config.label}}</mat-label>\n\n <div *ngIf=\"!(selectedFiles?.length > 0); else selectedFileList\" class=\"drop-info\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n or\n <button\n mat-raised-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async) || config.disableOnUpload && isUploaded\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n {{config.selectButtonText}}\n </button>\n </div>\n <ng-template #selectedFileList>\n <div class=\"selected-files-container\">\n <div class=\"selected-files-list\">\n <crispr-selected-file\n *ngFor=\"let file of selectedFiles; let i = index;\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"file.name\"\n [showProgress]=\"config.showUploadProgress\"\n [progress]=\"fileProgress && (fileProgress[i] | async)\">\n </crispr-selected-file>\n </div>\n\n </div>\n </ng-template>\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n </mat-form-field>\n <div class=\"button-container\" *ngIf=\"selectedFiles?.length > 0\">\n\n <button\n mat-button\n (click)=\"resetFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n aria-label=\"Remove Selected File(s)\">\n {{config.clearFilesButtonText}}\n <mat-icon>delete</mat-icon>\n </button>\n\n <button\n *ngIf=\"!!config.uploadFiles\"\n mat-raised-button\n type=\"button\"\n color=\"accent\"\n class=\"file-input-button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n (click)=\"uploadFiles()\"\n [attr.aria-label]=\"config.uploadButtonText\">\n {{ config.uploadButtonText }}\n </button>\n\n </div>\n</crispr-field-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAwBA,MAAM,oBAAoB,GAAG,kBAAkB,CAAwB,oBAAoB,CAAC,CAAC;AAqBvF,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;;AA4BhE,IAAA,WAAA,CAC6B,SAAoB,EAAA;AAE/C,QAAA,KAAK,EAAE,CAAC;QAFmB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;AAzBjD,QAAA,IAAA,CAAA,aAAa,GAAmC;AAC9C,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,qBAAqB,EAAE,QAAQ;AAC/B,YAAA,gBAAgB,EAAE,QAAQ;AAC1B,YAAA,oBAAoB,EAAE,IAAI;AAC1B,YAAA,oBAAoB,EAAE,OAAO;AAC7B,YAAA,gBAAgB,EAAE,QAAQ;AAC1B,YAAA,gBAAgB,EAAE,QAAQ;AAC1B,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,eAAe,EAAE,IAAI;SACtB,CAAA;QAMD,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;QAEnB,IAAY,CAAA,YAAA,GAAyB,EAAE,CAAC;AAQtC,QAAA,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;;;AAG1B,YAAA,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;AAChC,SAAA;KACF;IAED,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE,CAAC;AACjB,QAAA,IAAI,CAAC,S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,CAAA,8BAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC3B,qBAAqB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;2FAGZ,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAnBpC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,0BAA0B,mBAGnB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,uBAAuB;wBACvB,mBAAmB;wBACnB,aAAa;wBACb,eAAe;wBACf,kBAAkB;wBAClB,cAAc;wBACd,qBAAqB;wBACrB,2BAA2B;wBAC3B,qBAAqB;AACtB,qBAAA,EAAA,QAAA,EAAA,4rFAAA,EAAA,MAAA,EAAA,CAAA,2eAAA,CAAA,EAAA,CAAA;;0BA+BE,QAAQ;;0BAAI,IAAI;4CAXK,YAAY,EAAA,CAAA;sBAAnC,SAAS;uBAAC,WAAW,CAAA;;;AE/DxB;;AAEG;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/material/input';
|
|
4
|
+
import { MatInputModule } from '@angular/material/input';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i2 from '@angular/forms';
|
|
8
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import * as i3 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
+
import * as i5 from '@tft/form-validation-handler';
|
|
12
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
13
|
+
import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
|
|
14
|
+
import { InfoComponent } from '@tft/crispr-forms/ui/info';
|
|
15
|
+
import { crisprControlMixin, CrisprFieldComponent } from '@tft/crispr-forms/utils';
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
|
|
18
|
+
const InputFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
19
|
+
class InputFieldComponent extends InputFieldMixin {
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
this.defaultConfig = { inputType: 'text' };
|
|
23
|
+
}
|
|
24
|
+
ngOnInit() {
|
|
25
|
+
super.ngOnInit();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
InputFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
+
InputFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: InputFieldComponent, isStandalone: true, selector: "crispr-input-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label>\n {{config.label}}\n </mat-label>\n <input\n [type]=\"config.inputType\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [maxlength]=\"config.maxLength\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"\n [pattern]=\"config.pattern\"\n [spellcheck]=\"config.spellcheck\"\n [autocomplete]=\"config.autoComplete\"\n [autocapitalize]=\"config.autoCapitalize\">\n <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\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n\n</crispr-field-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i5.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i5.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InputFieldComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{ selector: 'crispr-input-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
33
|
+
CommonModule,
|
|
34
|
+
InfoComponent,
|
|
35
|
+
ReactiveFormsModule,
|
|
36
|
+
FieldContainerComponent,
|
|
37
|
+
MatFormFieldModule,
|
|
38
|
+
MatInputModule,
|
|
39
|
+
FormValidationHandlerModule,
|
|
40
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label>\n {{config.label}}\n </mat-label>\n <input\n [type]=\"config.inputType\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [maxlength]=\"config.maxLength\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"\n [pattern]=\"config.pattern\"\n [spellcheck]=\"config.spellcheck\"\n [autocomplete]=\"config.autoComplete\"\n [autocapitalize]=\"config.autoCapitalize\">\n <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\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n\n</crispr-field-container>\n" }]
|
|
41
|
+
}], ctorParameters: function () { return []; } });
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generated bundle index. Do not edit.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export { InputFieldComponent };
|
|
48
|
+
//# sourceMappingURL=tft-crispr-forms-ui-input-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-ui-input-field.mjs","sources":["../../../../libs/crispr-forms/ui/input-field/input-field.component.ts","../../../../libs/crispr-forms/ui/input-field/input-field.component.html","../../../../libs/crispr-forms/ui/input-field/tft-crispr-forms-ui-input-field.ts"],"sourcesContent":["/* eslint-disable @nrwl/nx/enforce-module-boundaries */\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';\nimport { InfoComponent } from '@tft/crispr-forms/ui/info';\nimport { InputFieldConfig, crisprControlMixin, CrisprFieldComponent } from '@tft/crispr-forms/utils';\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 standalone: true,\n imports: [\n CommonModule,\n InfoComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatFormFieldModule,\n MatInputModule,\n FormValidationHandlerModule,\n ],\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","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label>\n {{config.label}}\n </mat-label>\n <input\n [type]=\"config.inputType\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [maxlength]=\"config.maxLength\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"\n [pattern]=\"config.pattern\"\n [spellcheck]=\"config.spellcheck\"\n [autocomplete]=\"config.autoComplete\"\n [autocapitalize]=\"config.autoCapitalize\">\n <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\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n\n</crispr-field-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AAWA,MAAM,eAAe,GAAG,kBAAkB,CAAmB,oBAAoB,CAAC,CAAC;AAiB7E,MAAO,mBAAoB,SAAQ,eAAe,CAAA;AAGtD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;AAFV,QAAA,IAAA,CAAA,aAAa,GAA8B,EAAC,SAAS,EAAE,MAAM,EAAC,CAAC;KAG9D;IAED,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE,CAAC;KAClB;;gHATU,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAA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,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,8BAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;2FAGlB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAhB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,mBAGb,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,aAAa;wBACb,mBAAmB;wBACnB,uBAAuB;wBACvB,kBAAkB;wBAClB,cAAc;wBACd,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,0kCAAA,EAAA,CAAA;;;AE1BH;;AAEG;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
5
|
+
import { InfoComponent } from '@tft/crispr-forms/ui/info';
|
|
6
|
+
|
|
7
|
+
class OptionComponent {
|
|
8
|
+
}
|
|
9
|
+
OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
+
OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: OptionComponent, isStandalone: true, selector: "crispr-option", inputs: { option: "option" }, ngImport: i0, template: "<div>\n <img\n *ngIf=\"option.imageUrl\"\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n {{option.label}}\n</div>\n\n<crispr-info *ngIf=\"option.info as info\" [info]=\"info\">\n\n</crispr-info>\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: OptionComponent, decorators: [{
|
|
12
|
+
type: Component,
|
|
13
|
+
args: [{ selector: 'crispr-option', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
14
|
+
CommonModule,
|
|
15
|
+
InfoComponent,
|
|
16
|
+
], template: "<div>\n <img\n *ngIf=\"option.imageUrl\"\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n {{option.label}}\n</div>\n\n<crispr-info *ngIf=\"option.info as info\" [info]=\"info\">\n\n</crispr-info>\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"] }]
|
|
17
|
+
}], propDecorators: { option: [{
|
|
18
|
+
type: Input
|
|
19
|
+
}] } });
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Generated bundle index. Do not edit.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export { OptionComponent };
|
|
26
|
+
//# sourceMappingURL=tft-crispr-forms-ui-option.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-ui-option.mjs","sources":["../../../../libs/crispr-forms/ui/option/option.component.ts","../../../../libs/crispr-forms/ui/option/option.component.html","../../../../libs/crispr-forms/ui/option/tft-crispr-forms-ui-option.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { InfoComponent } from '@tft/crispr-forms/ui/info';\n// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries\nimport { SelectOption } from '@tft/crispr-forms/utils';\n\n@Component({\n selector: 'crispr-option',\n templateUrl: './option.component.html',\n styleUrls: ['./option.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n InfoComponent,\n ],\n})\nexport class OptionComponent {\n\n @Input() option: SelectOption\n\n}\n","<div>\n <img\n *ngIf=\"option.imageUrl\"\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n {{option.label}}\n</div>\n\n<crispr-info *ngIf=\"option.info as info\" [info]=\"info\">\n\n</crispr-info>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAiBa,eAAe,CAAA;;4GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAf,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,ECjB5B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,+SAcA,EDDI,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,mIACZ,aAAa,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;2FAGJ,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,mBAGR,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,+SAAA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA,CAAA;8BAIQ,MAAM,EAAA,CAAA;sBAAd,KAAK;;;AEnBR;;AAEG;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/material/radio';
|
|
4
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
5
|
+
import * as i2 from '@angular/forms';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i1 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i4 from '@tft/form-validation-handler';
|
|
10
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
11
|
+
import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
|
|
12
|
+
import { crisprControlMixin, CrisprFieldComponent, observablifyOptions } from '@tft/crispr-forms/utils';
|
|
13
|
+
|
|
14
|
+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
|
|
15
|
+
const RadioFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
16
|
+
class RadioFieldComponent extends RadioFieldMixin {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.defaultConfig = {};
|
|
20
|
+
}
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
super.ngOnInit();
|
|
23
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
24
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
25
|
+
this.options$ = observablifyOptions(this.config.options, this.group);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
RadioFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: RadioFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
+
RadioFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: RadioFieldComponent, isStandalone: true, selector: "crispr-radio-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-radio-group\n [formControl]=\"control\"\n [color]=\"config.color\">\n <mat-radio-button class=\"example-radio-button\" *ngFor=\"let option of options$ | async\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i3.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i3.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i4.ControlErrorsDirective, selector: "[formControl], [formControlName]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: RadioFieldComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{ selector: 'crispr-radio-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
33
|
+
CommonModule,
|
|
34
|
+
ReactiveFormsModule,
|
|
35
|
+
FieldContainerComponent,
|
|
36
|
+
MatRadioModule,
|
|
37
|
+
FormValidationHandlerModule,
|
|
38
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-radio-group\n [formControl]=\"control\"\n [color]=\"config.color\">\n <mat-radio-button class=\"example-radio-button\" *ngFor=\"let option of options$ | async\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"] }]
|
|
39
|
+
}] });
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Generated bundle index. Do not edit.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
export { RadioFieldComponent };
|
|
46
|
+
//# sourceMappingURL=tft-crispr-forms-ui-radio-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-ui-radio-field.mjs","sources":["../../../../libs/crispr-forms/ui/radio-field/radio-field.component.ts","../../../../libs/crispr-forms/ui/radio-field/radio-field.component.html","../../../../libs/crispr-forms/ui/radio-field/tft-crispr-forms-ui-radio-field.ts"],"sourcesContent":["/* eslint-disable @nrwl/nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\n import { Observable } from 'rxjs';\n\n\n import { MatRadioModule } from '@angular/material/radio';\n import { ReactiveFormsModule } from '@angular/forms';\n import { CommonModule } from '@angular/common';\n import { FormValidationHandlerModule } from '@tft/form-validation-handler';\n import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';\n import { CrisprFieldComponent, crisprControlMixin, RadioFieldConfig, SelectOption, observablifyOptions } from '@tft/crispr-forms/utils';\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 standalone: true,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatRadioModule,\n FormValidationHandlerModule,\n ],\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","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-radio-group\n [formControl]=\"control\"\n [color]=\"config.color\">\n <mat-radio-button class=\"example-radio-button\" *ngFor=\"let option of options$ | async\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n </mat-radio-group>\n</crispr-field-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AAYA,MAAM,eAAe,GAAG,kBAAkB,CAAmB,oBAAoB,CAAC,CAAC;AAgB7E,MAAO,mBAAoB,SAAQ,eAAe,CAAA;AAdxD,IAAA,WAAA,GAAA;;QAeE,IAAa,CAAA,aAAA,GAAG,EAAE,CAAC;AAQpB,KAAA;IANC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE,CAAC;;;AAGjB,QAAA,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;KACtE;;gHARU,mBAAmB,EAAA,IAAA,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AA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,cAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACd,2BAA2B,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,sBAAA,EAAA,QAAA,EAAA,kCAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;2FAGlB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAd/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,mBAGb,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,uBAAuB;wBACvB,cAAc;wBACd,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,wXAAA,EAAA,MAAA,EAAA,CAAA,kCAAA,CAAA,EAAA,CAAA;;;AE1BH;;AAEG;;;;"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/material/select';
|
|
4
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i2 from '@angular/material/checkbox';
|
|
8
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
9
|
+
import * as i6 from '@angular/forms';
|
|
10
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
11
|
+
import * as i3 from '@angular/material/form-field';
|
|
12
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
|
+
import { OptionComponent } from '@tft/crispr-forms/ui/option';
|
|
14
|
+
import * as i7 from '@tft/form-validation-handler';
|
|
15
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
16
|
+
import { InfoComponent } from '@tft/crispr-forms/ui/info';
|
|
17
|
+
import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
|
|
18
|
+
import { crisprControlMixin, CrisprFieldComponent, observablifyOptions } from '@tft/crispr-forms/utils';
|
|
19
|
+
import * as i5 from '@angular/material/core';
|
|
20
|
+
|
|
21
|
+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
|
|
22
|
+
const SelectFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
23
|
+
class SelectFieldComponent extends SelectFieldMixin {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.defaultConfig = {
|
|
27
|
+
enableToggleAll: false,
|
|
28
|
+
color: 'primary'
|
|
29
|
+
};
|
|
30
|
+
this.allSelected = false;
|
|
31
|
+
}
|
|
32
|
+
ngOnInit() {
|
|
33
|
+
super.ngOnInit();
|
|
34
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
35
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
36
|
+
this.options$ = observablifyOptions(this.config.options, this.group);
|
|
37
|
+
}
|
|
38
|
+
ngAfterViewInit() {
|
|
39
|
+
if (this.config.multiple
|
|
40
|
+
&& this.config.enableToggleAll
|
|
41
|
+
&& this.selectField.options?.length === this.value?.length) {
|
|
42
|
+
this.allSelected = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
toggleAll(isSelected) {
|
|
46
|
+
if (isSelected) {
|
|
47
|
+
this.selectField.options.forEach(option => option.deselect());
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.selectField.options.forEach(option => option.select());
|
|
51
|
+
}
|
|
52
|
+
this.allSelected = !this.allSelected;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
SelectFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
56
|
+
SelectFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SelectFieldComponent, isStandalone: true, selector: "crispr-select-field", viewQueries: [{ propertyName: "selectField", first: true, predicate: ["selectField"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControlName]=\"config.controlName\"\n [placeholder]=\"config.placeholder\"\n [multiple]=\"config.multiple\">\n\n <mat-checkbox\n [color]=\"config.color\"\n [checked]=\"allSelected\"\n *ngIf=\"config?.multiple && config.enableToggleAll\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n <mat-option\n *ngFor=\"let option of options$ | 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\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i6.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectFieldComponent, decorators: [{
|
|
58
|
+
type: Component,
|
|
59
|
+
args: [{ selector: 'crispr-select-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
60
|
+
CommonModule,
|
|
61
|
+
InfoComponent,
|
|
62
|
+
OptionComponent,
|
|
63
|
+
MatCheckboxModule,
|
|
64
|
+
MatSelectModule,
|
|
65
|
+
ReactiveFormsModule,
|
|
66
|
+
FormValidationHandlerModule,
|
|
67
|
+
FieldContainerComponent,
|
|
68
|
+
MatFormFieldModule,
|
|
69
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControlName]=\"config.controlName\"\n [placeholder]=\"config.placeholder\"\n [multiple]=\"config.multiple\">\n\n <mat-checkbox\n [color]=\"config.color\"\n [checked]=\"allSelected\"\n *ngIf=\"config?.multiple && config.enableToggleAll\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n <mat-option\n *ngFor=\"let option of options$ | 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\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"] }]
|
|
70
|
+
}], propDecorators: { selectField: [{
|
|
71
|
+
type: ViewChild,
|
|
72
|
+
args: ['selectField']
|
|
73
|
+
}] } });
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Generated bundle index. Do not edit.
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
export { SelectFieldComponent };
|
|
80
|
+
//# sourceMappingURL=tft-crispr-forms-ui-select-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-ui-select-field.mjs","sources":["../../../../libs/crispr-forms/ui/select-field/select-field.component.ts","../../../../libs/crispr-forms/ui/select-field/select-field.component.html","../../../../libs/crispr-forms/ui/select-field/tft-crispr-forms-ui-select-field.ts"],"sourcesContent":["/* eslint-disable @nrwl/nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy, ViewChild, AfterViewInit } from '@angular/core';\n import { Observable } from 'rxjs';\n\nimport { MatSelect, MatSelectModule } from '@angular/material/select';\nimport { ThemePalette } from '@angular/material/core';\nimport { CommonModule } from '@angular/common';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { OptionComponent } from '@tft/crispr-forms/ui/option';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { InfoComponent } from '@tft/crispr-forms/ui/info';\nimport { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';\nimport { observablifyOptions, CrisprFieldComponent, crisprControlMixin, SelectFieldConfig, SelectOption } from '@tft/crispr-forms/utils';\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 standalone: true,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n MatCheckboxModule,\n MatSelectModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n FieldContainerComponent,\n MatFormFieldModule,\n ]\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","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControlName]=\"config.controlName\"\n [placeholder]=\"config.placeholder\"\n [multiple]=\"config.multiple\">\n\n <mat-checkbox\n [color]=\"config.color\"\n [checked]=\"allSelected\"\n *ngIf=\"config?.multiple && config.enableToggleAll\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n <mat-option\n *ngFor=\"let option of options$ | 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\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAgBA,MAAM,gBAAgB,GAAG,kBAAkB,CAAoB,oBAAoB,CAAC,CAAC;AAoB/E,MAAO,oBAAqB,SAAQ,gBAAgB,CAAA;AAlB1D,IAAA,WAAA,GAAA;;AAmBE,QAAA,IAAA,CAAA,aAAa,GAAG;AACd,YAAA,eAAe,EAAE,KAAK;AACtB,YAAA,KAAK,EAAE,SAAyB;SACjC,CAAC;QAEF,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;AA6BrB,KAAA;IAzBC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE,CAAC;;;AAGjB,QAAA,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;KACtE;IAED,eAAe,GAAA;AACb,QAAA,IACE,IAAI,CAAC,MAAM,CAAC,QAAQ;eACjB,IAAI,CAAC,MAAM,CAAC,eAAe;AAC3B,eAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,KAAM,IAAI,CAAC,KAAe,EAAE,MAAM,EACrE;AACA,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;AACzB,SAAA;KACF;AAED,IAAA,SAAS,CAAC,UAAmB,EAAA;AAC3B,QAAA,IAAK,UAAU,EAAG;AAChB,YAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC/D,SAAA;AAAM,aAAA;AACL,YAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC7D,SAAA;AACD,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d,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,aAAa;wBACb,eAAe;wBACf,iBAAiB;wBACjB,eAAe;wBACf,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,kBAAkB;AACnB,qBAAA,EAAA,QAAA,EAAA,uuCAAA,EAAA,MAAA,EAAA,CAAA,4CAAA,CAAA,EAAA,CAAA;8BAUyB,WAAW,EAAA,CAAA;sBAApC,SAAS;uBAAC,aAAa,CAAA;;;AE5C1B;;AAEG;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/material/slider';
|
|
4
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i2 from '@angular/forms';
|
|
8
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { OptionComponent } from '@tft/crispr-forms/ui/option';
|
|
10
|
+
import * as i4 from '@tft/form-validation-handler';
|
|
11
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
12
|
+
import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
|
|
13
|
+
import { InfoComponent } from '@tft/crispr-forms/ui/info';
|
|
14
|
+
import { crisprControlMixin, CrisprFieldComponent } from '@tft/crispr-forms/utils';
|
|
15
|
+
|
|
16
|
+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
|
|
17
|
+
const defaultConfig = { displayLimits: true };
|
|
18
|
+
const SliderFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
19
|
+
class SliderFieldComponent extends SliderFieldMixin {
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
this.defaultConfig = defaultConfig;
|
|
23
|
+
}
|
|
24
|
+
get flexDirection() {
|
|
25
|
+
return this.config.vertical ? 'column' : 'row';
|
|
26
|
+
}
|
|
27
|
+
ngOnInit() {
|
|
28
|
+
super.ngOnInit();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
SliderFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SliderFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
|
+
SliderFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SliderFieldComponent, isStandalone: true, selector: "crispr-slider-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <div\n [formGroup]=\"group\">\n <label *ngIf=\"config.label\">\n {{config.label}}\n <crispr-info\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </label>\n <div class=\"slider-container\"\n [ngStyle]=\"{'flex-direction': flexDirection}\">\n <span *ngIf=\"config.displayLimits\">\n {{config.min}}\n </span>\n <mat-slider\n class=\"example-margin\"\n [formControlName]=\"config.controlName\"\n [invert]=\"config.invert\"\n [max]=\"config.max\"\n [min]=\"config.min\"\n [step]=\"config.step\"\n [thumbLabel]=\"config.thumbLabel\"\n [tickInterval]=\"config.tickInterval\"\n [vertical]=\"config.vertical\">\n </mat-slider>\n <span *ngIf=\"config.displayLimits\">\n {{config.max}}\n </span>\n </div>\n\n </div>\n</crispr-field-container>\n\n", styles: [".slider-container{display:flex;align-items:center}.slider-container .mat-slider-horizontal{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i3.MatSlider, selector: "mat-slider", inputs: ["disabled", "color", "tabIndex", "invert", "max", "min", "step", "thumbLabel", "tickInterval", "value", "displayWith", "valueText", "vertical"], outputs: ["change", "input", "valueChange"], exportAs: ["matSlider"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i4.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i4.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SliderFieldComponent, decorators: [{
|
|
34
|
+
type: Component,
|
|
35
|
+
args: [{ selector: 'crispr-slider-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
36
|
+
CommonModule,
|
|
37
|
+
InfoComponent,
|
|
38
|
+
OptionComponent,
|
|
39
|
+
FieldContainerComponent,
|
|
40
|
+
ReactiveFormsModule,
|
|
41
|
+
MatSliderModule,
|
|
42
|
+
FormValidationHandlerModule,
|
|
43
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <div\n [formGroup]=\"group\">\n <label *ngIf=\"config.label\">\n {{config.label}}\n <crispr-info\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </label>\n <div class=\"slider-container\"\n [ngStyle]=\"{'flex-direction': flexDirection}\">\n <span *ngIf=\"config.displayLimits\">\n {{config.min}}\n </span>\n <mat-slider\n class=\"example-margin\"\n [formControlName]=\"config.controlName\"\n [invert]=\"config.invert\"\n [max]=\"config.max\"\n [min]=\"config.min\"\n [step]=\"config.step\"\n [thumbLabel]=\"config.thumbLabel\"\n [tickInterval]=\"config.tickInterval\"\n [vertical]=\"config.vertical\">\n </mat-slider>\n <span *ngIf=\"config.displayLimits\">\n {{config.max}}\n </span>\n </div>\n\n </div>\n</crispr-field-container>\n\n", styles: [".slider-container{display:flex;align-items:center}.slider-container .mat-slider-horizontal{width:100%}\n"] }]
|
|
44
|
+
}], ctorParameters: function () { return []; } });
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Generated bundle index. Do not edit.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
export { SliderFieldComponent };
|
|
51
|
+
//# sourceMappingURL=tft-crispr-forms-ui-slider-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-ui-slider-field.mjs","sources":["../../../../libs/crispr-forms/ui/slider-field/slider-field.component.ts","../../../../libs/crispr-forms/ui/slider-field/slider-field.component.html","../../../../libs/crispr-forms/ui/slider-field/tft-crispr-forms-ui-slider-field.ts"],"sourcesContent":["/* eslint-disable @nrwl/nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { OptionComponent } from '@tft/crispr-forms/ui/option';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';\nimport { InfoComponent } from '@tft/crispr-forms/ui/info';\nimport { SliderFieldConfig, CrisprFieldComponent, crisprControlMixin } from '@tft/crispr-forms/utils';\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 standalone: true,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n FieldContainerComponent,\n ReactiveFormsModule,\n MatSliderModule,\n FormValidationHandlerModule,\n ],\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","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <div\n [formGroup]=\"group\">\n <label *ngIf=\"config.label\">\n {{config.label}}\n <crispr-info\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </label>\n <div class=\"slider-container\"\n [ngStyle]=\"{'flex-direction': flexDirection}\">\n <span *ngIf=\"config.displayLimits\">\n {{config.min}}\n </span>\n <mat-slider\n class=\"example-margin\"\n [formControlName]=\"config.controlName\"\n [invert]=\"config.invert\"\n [max]=\"config.max\"\n [min]=\"config.min\"\n [step]=\"config.step\"\n [thumbLabel]=\"config.thumbLabel\"\n [tickInterval]=\"config.tickInterval\"\n [vertical]=\"config.vertical\">\n </mat-slider>\n <span *ngIf=\"config.displayLimits\">\n {{config.max}}\n </span>\n </div>\n\n </div>\n</crispr-field-container>\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;AAWA,MAAM,aAAa,GAAG,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC;AAC5C,MAAM,gBAAgB,GAAG,kBAAkB,CAAoB,oBAAoB,CAAC,CAAC;AAkB/E,MAAO,oBAAqB,SAAQ,gBA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