@tft/crispr-forms 18.0.2 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -112
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-jdr2Hr6I.mjs +95 -0
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-jdr2Hr6I.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-BHv9E1Y2.mjs +36 -0
- package/fesm2022/tft-crispr-forms-index-BHv9E1Y2.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-BIhGbdgn.mjs +68 -0
- package/fesm2022/tft-crispr-forms-index-BIhGbdgn.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-BQFuEW6x.mjs +40 -0
- package/fesm2022/tft-crispr-forms-index-BQFuEW6x.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-BWsxn34Q.mjs +2 -0
- package/fesm2022/tft-crispr-forms-index-BWsxn34Q.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-Bh8kDfe4.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-Bh8kDfe4.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-C9gYJRzb.mjs +182 -0
- package/fesm2022/tft-crispr-forms-index-C9gYJRzb.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-ClPQl_5D.mjs +137 -0
- package/fesm2022/tft-crispr-forms-index-ClPQl_5D.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DCRLl0jR.mjs +190 -0
- package/fesm2022/tft-crispr-forms-index-DCRLl0jR.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-Dx-HIAiX.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-Dx-HIAiX.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-Dyx5SqHu.mjs +88 -0
- package/fesm2022/tft-crispr-forms-index-Dyx5SqHu.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-LX0Bvkjk.mjs +73 -0
- package/fesm2022/tft-crispr-forms-index-LX0Bvkjk.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-UAYeTe3L.mjs +17 -0
- package/fesm2022/tft-crispr-forms-index-UAYeTe3L.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-UvEVbwnf.mjs +41 -0
- package/fesm2022/tft-crispr-forms-index-UvEVbwnf.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-joNvlmny.mjs +61 -0
- package/fesm2022/tft-crispr-forms-index-joNvlmny.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-kjMTlZoq.mjs +24 -0
- package/fesm2022/tft-crispr-forms-index-kjMTlZoq.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms.mjs +206 -175
- package/fesm2022/tft-crispr-forms.mjs.map +1 -1
- package/package.json +3 -5
- package/tft-crispr-forms-20.0.0.tgz +0 -0
- package/types/tft-crispr-forms.d.ts +887 -0
- package/esm2022/public-api.mjs +0 -4
- package/esm2022/src/index.mjs +0 -2
- package/esm2022/src/lib/crispr-forms.module.mjs +0 -55
- package/esm2022/src/lib/display-field.directive.mjs +0 -52
- package/esm2022/src/lib/field-component-map.const.mjs +0 -29
- package/esm2022/src/lib/field.directive.mjs +0 -69
- package/esm2022/src/lib/form/form.component.mjs +0 -62
- package/esm2022/src/lib/form-group-list/form-group-list.component.mjs +0 -97
- package/esm2022/src/lib/form-group-list/index.mjs +0 -2
- package/esm2022/src/lib/pipes/crispr-pipes.module.mjs +0 -24
- package/esm2022/src/lib/pipes/initial-control-value.pipe.mjs +0 -20
- package/esm2022/src/lib/public_api.mjs +0 -4
- package/esm2022/src/lib/sub-group/index.mjs +0 -3
- package/esm2022/src/lib/sub-group/sub-group.component.mjs +0 -20
- package/esm2022/src/lib/sub-group/sub-group.module.mjs +0 -42
- package/esm2022/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +0 -138
- package/esm2022/src/lib/ui/autocomplete-chiplist-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/autocomplete-chiplist-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/autocomplete-field/autocomplete-field.component.mjs +0 -95
- package/esm2022/src/lib/ui/autocomplete-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/autocomplete-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/button/button.component.mjs +0 -52
- package/esm2022/src/lib/ui/button/index.mjs +0 -2
- package/esm2022/src/lib/ui/button/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/checkbox-field/checkbox-field.component.mjs +0 -42
- package/esm2022/src/lib/ui/checkbox-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/checkbox-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/datepicker-field/datepicker-field.component.mjs +0 -66
- package/esm2022/src/lib/ui/datepicker-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/datepicker-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/divider/divider.component.mjs +0 -25
- package/esm2022/src/lib/ui/divider/index.mjs +0 -2
- package/esm2022/src/lib/ui/divider/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/field-container/field-container.component.mjs +0 -59
- package/esm2022/src/lib/ui/field-container/index.mjs +0 -2
- package/esm2022/src/lib/ui/field-container/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/file-dropzone/file-dropzone.directive.mjs +0 -40
- package/esm2022/src/lib/ui/file-dropzone/index.mjs +0 -2
- package/esm2022/src/lib/ui/file-dropzone/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/file-upload-field/file-upload-field.component.mjs +0 -107
- package/esm2022/src/lib/ui/file-upload-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/file-upload-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/heading/heading.component.mjs +0 -27
- package/esm2022/src/lib/ui/heading/index.mjs +0 -2
- package/esm2022/src/lib/ui/heading/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/image-upload-field/image-upload-field.component.mjs +0 -184
- package/esm2022/src/lib/ui/image-upload-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/image-upload-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/index.mjs +0 -2
- package/esm2022/src/lib/ui/info/index.mjs +0 -2
- package/esm2022/src/lib/ui/info/info.component.mjs +0 -23
- package/esm2022/src/lib/ui/info/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/input-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/input-field/input-field.component.mjs +0 -43
- package/esm2022/src/lib/ui/input-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/map/index.mjs +0 -2
- package/esm2022/src/lib/ui/map/map-field.component.mjs +0 -22
- package/esm2022/src/lib/ui/map/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/option/index.mjs +0 -2
- package/esm2022/src/lib/ui/option/option.component.mjs +0 -16
- package/esm2022/src/lib/ui/option/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/public-api.mjs +0 -8
- package/esm2022/src/lib/ui/radio-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/radio-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/radio-field/radio-field.component.mjs +0 -39
- package/esm2022/src/lib/ui/select-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/select-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/select-field/select-field.component.mjs +0 -73
- package/esm2022/src/lib/ui/selected-file/index.mjs +0 -2
- package/esm2022/src/lib/ui/selected-file/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/selected-file/selected-file.component.mjs +0 -26
- package/esm2022/src/lib/ui/slider-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/slider-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/slider-field/slider-field.component.mjs +0 -46
- package/esm2022/src/lib/ui/textarea-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/textarea-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/textarea-field/textarea-field.component.mjs +0 -42
- package/esm2022/src/lib/ui/unit-conversion-field/index.mjs +0 -2
- package/esm2022/src/lib/ui/unit-conversion-field/public-api.mjs +0 -2
- package/esm2022/src/lib/ui/unit-conversion-field/unit-conversion-field.component.mjs +0 -86
- package/esm2022/src/lib/utils/abstracts/autocomplete-field.abstract.mjs +0 -30
- package/esm2022/src/lib/utils/abstracts/crispr-control.mixin.mjs +0 -27
- package/esm2022/src/lib/utils/abstracts/crispr-display-field.abstract.mjs +0 -14
- package/esm2022/src/lib/utils/abstracts/crispr-field.abstract.mjs +0 -19
- package/esm2022/src/lib/utils/abstracts/index.mjs +0 -5
- package/esm2022/src/lib/utils/functions/buildFormGroupFromConfig.mjs +0 -28
- package/esm2022/src/lib/utils/functions/callOptionsIfFunction.mjs +0 -4
- package/esm2022/src/lib/utils/functions/createControlForType.mjs +0 -19
- package/esm2022/src/lib/utils/functions/filterOptionsByLabel.mjs +0 -11
- package/esm2022/src/lib/utils/functions/image-compression.helpers.mjs +0 -50
- package/esm2022/src/lib/utils/functions/index.mjs +0 -8
- package/esm2022/src/lib/utils/functions/isControlConfig.mjs +0 -7
- package/esm2022/src/lib/utils/functions/observablifyOptions.mjs +0 -29
- package/esm2022/src/lib/utils/index.mjs +0 -2
- package/esm2022/src/lib/utils/models/autocomplete-chiplist-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/autocomplete-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/button.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/checkbox-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/crispr-field.config.mjs +0 -24
- package/esm2022/src/lib/utils/models/datepicker-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/divider.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/file-upload-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/form-group-list.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/heading.config.mjs +0 -3
- package/esm2022/src/lib/utils/models/image-upload-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/index.mjs +0 -19
- package/esm2022/src/lib/utils/models/input-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/map-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/radio-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/select-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/slider-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/textarea-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/models/unit-conversion-field.config.mjs +0 -2
- package/esm2022/src/lib/utils/operators/form.operators.mjs +0 -24
- package/esm2022/src/lib/utils/operators/index.mjs +0 -2
- package/esm2022/src/lib/utils/public-api.mjs +0 -5
- package/esm2022/tft-crispr-forms.mjs +0 -5
- package/fesm2022/tft-crispr-forms-index-3_zzaLSn.mjs +0 -37
- package/fesm2022/tft-crispr-forms-index-3_zzaLSn.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BC1uV7T_.mjs +0 -19
- package/fesm2022/tft-crispr-forms-index-BC1uV7T_.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BHUGuVwS.mjs +0 -55
- package/fesm2022/tft-crispr-forms-index-BHUGuVwS.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CAFXSHea.mjs +0 -58
- package/fesm2022/tft-crispr-forms-index-CAFXSHea.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CN1GmYGC.mjs +0 -91
- package/fesm2022/tft-crispr-forms-index-CN1GmYGC.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CvnyvJJ_.mjs +0 -73
- package/fesm2022/tft-crispr-forms-index-CvnyvJJ_.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DKwMd-o-.mjs +0 -185
- package/fesm2022/tft-crispr-forms-index-DKwMd-o-.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-De3tRDbo.mjs +0 -49
- package/fesm2022/tft-crispr-forms-index-De3tRDbo.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DiNlBPaX.mjs +0 -35
- package/fesm2022/tft-crispr-forms-index-DiNlBPaX.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DkkAr7Yr.mjs +0 -102
- package/fesm2022/tft-crispr-forms-index-DkkAr7Yr.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DseuVavm.mjs +0 -49
- package/fesm2022/tft-crispr-forms-index-DseuVavm.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-T4Ook6pV.mjs +0 -51
- package/fesm2022/tft-crispr-forms-index-T4Ook6pV.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-cdo59qhx.mjs +0 -142
- package/fesm2022/tft-crispr-forms-index-cdo59qhx.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-kJUZksiq.mjs +0 -49
- package/fesm2022/tft-crispr-forms-index-kJUZksiq.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-xbMIxY3P.mjs +0 -81
- package/fesm2022/tft-crispr-forms-index-xbMIxY3P.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/public-api.d.ts +0 -3
- package/src/index.d.ts +0 -1
- package/src/lib/crispr-forms.module.d.ts +0 -16
- package/src/lib/display-field.directive.d.ts +0 -23
- package/src/lib/field-component-map.const.d.ts +0 -44
- package/src/lib/field.directive.d.ts +0 -24
- package/src/lib/form/form.component.d.ts +0 -19
- package/src/lib/form-group-list/form-group-list.component.d.ts +0 -40
- package/src/lib/form-group-list/index.d.ts +0 -1
- package/src/lib/pipes/crispr-pipes.module.d.ts +0 -8
- package/src/lib/pipes/initial-control-value.pipe.d.ts +0 -10
- package/src/lib/public_api.d.ts +0 -3
- package/src/lib/sub-group/index.d.ts +0 -2
- package/src/lib/sub-group/sub-group.component.d.ts +0 -24
- package/src/lib/sub-group/sub-group.module.d.ts +0 -12
- package/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.d.ts +0 -36
- package/src/lib/ui/autocomplete-chiplist-field/index.d.ts +0 -1
- package/src/lib/ui/autocomplete-chiplist-field/public-api.d.ts +0 -1
- package/src/lib/ui/autocomplete-field/autocomplete-field.component.d.ts +0 -25
- package/src/lib/ui/autocomplete-field/index.d.ts +0 -1
- package/src/lib/ui/autocomplete-field/public-api.d.ts +0 -1
- package/src/lib/ui/button/button.component.d.ts +0 -15
- package/src/lib/ui/button/index.d.ts +0 -1
- package/src/lib/ui/button/public-api.d.ts +0 -1
- package/src/lib/ui/checkbox-field/checkbox-field.component.d.ts +0 -23
- package/src/lib/ui/checkbox-field/index.d.ts +0 -1
- package/src/lib/ui/checkbox-field/public-api.d.ts +0 -1
- package/src/lib/ui/datepicker-field/datepicker-field.component.d.ts +0 -32
- package/src/lib/ui/datepicker-field/index.d.ts +0 -1
- package/src/lib/ui/datepicker-field/public-api.d.ts +0 -1
- package/src/lib/ui/divider/divider.component.d.ts +0 -9
- package/src/lib/ui/divider/index.d.ts +0 -1
- package/src/lib/ui/divider/public-api.d.ts +0 -1
- package/src/lib/ui/field-container/field-container.component.d.ts +0 -24
- package/src/lib/ui/field-container/index.d.ts +0 -1
- package/src/lib/ui/field-container/public-api.d.ts +0 -1
- package/src/lib/ui/file-dropzone/file-dropzone.directive.d.ts +0 -10
- package/src/lib/ui/file-dropzone/index.d.ts +0 -1
- package/src/lib/ui/file-dropzone/public-api.d.ts +0 -1
- package/src/lib/ui/file-upload-field/file-upload-field.component.d.ts +0 -39
- package/src/lib/ui/file-upload-field/index.d.ts +0 -1
- package/src/lib/ui/file-upload-field/public-api.d.ts +0 -1
- package/src/lib/ui/heading/heading.component.d.ts +0 -8
- package/src/lib/ui/heading/index.d.ts +0 -1
- package/src/lib/ui/heading/public-api.d.ts +0 -1
- package/src/lib/ui/image-upload-field/image-upload-field.component.d.ts +0 -50
- package/src/lib/ui/image-upload-field/index.d.ts +0 -1
- package/src/lib/ui/image-upload-field/public-api.d.ts +0 -1
- package/src/lib/ui/index.d.ts +0 -1
- package/src/lib/ui/info/index.d.ts +0 -1
- package/src/lib/ui/info/info.component.d.ts +0 -7
- package/src/lib/ui/info/public-api.d.ts +0 -1
- package/src/lib/ui/input-field/index.d.ts +0 -1
- package/src/lib/ui/input-field/input-field.component.d.ts +0 -24
- package/src/lib/ui/input-field/public-api.d.ts +0 -1
- package/src/lib/ui/map/index.d.ts +0 -1
- package/src/lib/ui/map/map-field.component.d.ts +0 -23
- package/src/lib/ui/map/public-api.d.ts +0 -1
- package/src/lib/ui/option/index.d.ts +0 -1
- package/src/lib/ui/option/option.component.d.ts +0 -7
- package/src/lib/ui/option/public-api.d.ts +0 -1
- package/src/lib/ui/public-api.d.ts +0 -7
- package/src/lib/ui/radio-field/index.d.ts +0 -1
- package/src/lib/ui/radio-field/public-api.d.ts +0 -1
- package/src/lib/ui/radio-field/radio-field.component.d.ts +0 -25
- package/src/lib/ui/select-field/index.d.ts +0 -1
- package/src/lib/ui/select-field/public-api.d.ts +0 -1
- package/src/lib/ui/select-field/select-field.component.d.ts +0 -34
- package/src/lib/ui/selected-file/index.d.ts +0 -1
- package/src/lib/ui/selected-file/public-api.d.ts +0 -1
- package/src/lib/ui/selected-file/selected-file.component.d.ts +0 -10
- package/src/lib/ui/slider-field/index.d.ts +0 -1
- package/src/lib/ui/slider-field/public-api.d.ts +0 -1
- package/src/lib/ui/slider-field/slider-field.component.d.ts +0 -24
- package/src/lib/ui/textarea-field/index.d.ts +0 -1
- package/src/lib/ui/textarea-field/public-api.d.ts +0 -1
- package/src/lib/ui/textarea-field/textarea-field.component.d.ts +0 -23
- package/src/lib/ui/unit-conversion-field/index.d.ts +0 -1
- package/src/lib/ui/unit-conversion-field/public-api.d.ts +0 -1
- package/src/lib/ui/unit-conversion-field/unit-conversion-field.component.d.ts +0 -38
- package/src/lib/utils/abstracts/autocomplete-field.abstract.d.ts +0 -28
- package/src/lib/utils/abstracts/crispr-control.mixin.d.ts +0 -16
- package/src/lib/utils/abstracts/crispr-display-field.abstract.d.ts +0 -22
- package/src/lib/utils/abstracts/crispr-field.abstract.d.ts +0 -11
- package/src/lib/utils/abstracts/index.d.ts +0 -4
- package/src/lib/utils/functions/buildFormGroupFromConfig.d.ts +0 -9
- package/src/lib/utils/functions/callOptionsIfFunction.d.ts +0 -3
- package/src/lib/utils/functions/createControlForType.d.ts +0 -9
- package/src/lib/utils/functions/filterOptionsByLabel.d.ts +0 -7
- package/src/lib/utils/functions/image-compression.helpers.d.ts +0 -5
- package/src/lib/utils/functions/index.d.ts +0 -7
- package/src/lib/utils/functions/isControlConfig.d.ts +0 -5
- package/src/lib/utils/functions/observablifyOptions.d.ts +0 -12
- package/src/lib/utils/index.d.ts +0 -1
- package/src/lib/utils/models/autocomplete-chiplist-field.config.d.ts +0 -20
- package/src/lib/utils/models/autocomplete-field.config.d.ts +0 -14
- package/src/lib/utils/models/button.config.d.ts +0 -17
- package/src/lib/utils/models/checkbox-field.config.d.ts +0 -6
- package/src/lib/utils/models/crispr-field.config.d.ts +0 -98
- package/src/lib/utils/models/datepicker-field.config.d.ts +0 -20
- package/src/lib/utils/models/divider.config.d.ts +0 -5
- package/src/lib/utils/models/file-upload-field.config.d.ts +0 -33
- package/src/lib/utils/models/form-group-list.config.d.ts +0 -18
- package/src/lib/utils/models/heading.config.d.ts +0 -6
- package/src/lib/utils/models/image-upload-field.config.d.ts +0 -54
- package/src/lib/utils/models/index.d.ts +0 -18
- package/src/lib/utils/models/input-field.config.d.ts +0 -16
- package/src/lib/utils/models/map-field.config.d.ts +0 -5
- package/src/lib/utils/models/radio-field.config.d.ts +0 -6
- package/src/lib/utils/models/select-field.config.d.ts +0 -21
- package/src/lib/utils/models/slider-field.config.d.ts +0 -11
- package/src/lib/utils/models/textarea-field.config.d.ts +0 -5
- package/src/lib/utils/models/unit-conversion-field.config.d.ts +0 -30
- package/src/lib/utils/operators/form.operators.d.ts +0 -1
- package/src/lib/utils/operators/index.d.ts +0 -1
- package/src/lib/utils/public-api.d.ts +0 -4
- package/tft-crispr-forms-18.0.2.tgz +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/radio';
|
|
4
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i1$1 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
10
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
11
|
+
import { CrisprControlComponent, observablifyOptions, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
12
|
+
|
|
13
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
14
|
+
class RadioFieldComponent extends CrisprControlComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.defaultConfig = {};
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
super.ngOnInit();
|
|
21
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
22
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
23
|
+
this.options$ = observablifyOptions(this.config().options, this.group());
|
|
24
|
+
}
|
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: RadioFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: RadioFieldComponent, isStandalone: true, selector: "crispr-radio-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-radio-group\n [formControl]=\"control()\"\n [color]=\"config().color\">\n @for (option of options$ | async; track option) {\n <mat-radio-button class=\"example-radio-button\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n }\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i2.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i2.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
27
|
+
}
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: RadioFieldComponent, decorators: [{
|
|
29
|
+
type: Component,
|
|
30
|
+
args: [{ selector: 'crispr-radio-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
31
|
+
CommonModule,
|
|
32
|
+
ReactiveFormsModule,
|
|
33
|
+
FieldContainerComponent,
|
|
34
|
+
MatRadioModule,
|
|
35
|
+
FormValidationHandlerModule,
|
|
36
|
+
], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-radio-group\n [formControl]=\"control()\"\n [color]=\"config().color\">\n @for (option of options$ | async; track option) {\n <mat-radio-button class=\"example-radio-button\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n }\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"] }]
|
|
37
|
+
}] });
|
|
38
|
+
|
|
39
|
+
export { RadioFieldComponent };
|
|
40
|
+
//# sourceMappingURL=tft-crispr-forms-index-BQFuEW6x.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-BQFuEW6x.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/radio-field/radio-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/radio-field/radio-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { MatRadioModule } from '@angular/material/radio';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { RadioFieldConfig, SelectOption, observablifyOptions } from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\n@Component({\n selector: 'crispr-radio-field',\n templateUrl: './radio-field.component.html',\n styleUrls: ['./radio-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatRadioModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class RadioFieldComponent extends CrisprControlComponent<RadioFieldConfig> implements OnInit {\n defaultConfig = {};\n options$: Observable<SelectOption[]>;\n ngOnInit() {\n super.ngOnInit();\n // options$ can be passed as an array, promise that resolves array, or observable that resolves array\n // this functions accounts for all possibilities and converts to observable that resolves array\n this.options$ = observablifyOptions(this.config().options, this.group());\n }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-radio-group\n [formControl]=\"control()\"\n [color]=\"config().color\">\n @for (option of options$ | async; track option) {\n <mat-radio-button class=\"example-radio-button\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n }\n </mat-radio-group>\n</crispr-field-container>\n"],"names":["i3","i4"],"mappings":";;;;;;;;;;;;AAAA;AA0BM,MAAO,mBAAoB,SAAQ,sBAAwC,CAAA;AAdjF,IAAA,WAAA,GAAA;;QAeE,IAAA,CAAA,aAAa,GAAG,EAAE;AAQnB,IAAA;IANC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;;;AAGhB,QAAA,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAC1E;8GARW,mBAAmB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC1BhC,0ZAcA,EAAA,MAAA,EAAA,CAAA,kCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIQ,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACZ,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EA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AAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAItB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAd/B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,eAAA,EAGb,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,mBAAmB;wBACnB,uBAAuB;wBACvB,cAAc;wBACd,2BAA2B;AAC9B,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,0ZAAA,EAAA,MAAA,EAAA,CAAA,kCAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-BWsxn34Q.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/checkbox';
|
|
4
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
5
|
+
import * as i1$1 from '@angular/forms';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
8
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
9
|
+
import { CrisprControlComponent, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
10
|
+
|
|
11
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
12
|
+
const defaultConfig = {
|
|
13
|
+
labelPosition: 'after',
|
|
14
|
+
inline: false,
|
|
15
|
+
};
|
|
16
|
+
class CheckboxFieldComponent extends CrisprControlComponent {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.defaultConfig = defaultConfig;
|
|
20
|
+
}
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
super.ngOnInit();
|
|
23
|
+
}
|
|
24
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: CheckboxFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
25
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: CheckboxFieldComponent, isStandalone: true, selector: "crispr-checkbox-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\"\n [inlineField]=\"config().inline\">\n <div\n [formGroup]=\"group()\">\n <mat-checkbox\n [color]=\"config().color\"\n [labelPosition]=\"config().labelPosition\"\n [formControlName]=\"config().controlName\">\n {{config().label}}\n @if (config().info) {\n <crispr-info\n matSuffix\n [info]=\"config().info\">\n </crispr-info>\n }\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"], dependencies: [{ kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
26
|
+
}
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: CheckboxFieldComponent, decorators: [{
|
|
28
|
+
type: Component,
|
|
29
|
+
args: [{ selector: 'crispr-checkbox-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
30
|
+
InfoComponent,
|
|
31
|
+
MatCheckboxModule,
|
|
32
|
+
ReactiveFormsModule,
|
|
33
|
+
FieldContainerComponent,
|
|
34
|
+
FormValidationHandlerModule
|
|
35
|
+
], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\"\n [inlineField]=\"config().inline\">\n <div\n [formGroup]=\"group()\">\n <mat-checkbox\n [color]=\"config().color\"\n [labelPosition]=\"config().labelPosition\"\n [formControlName]=\"config().controlName\">\n {{config().label}}\n @if (config().info) {\n <crispr-info\n matSuffix\n [info]=\"config().info\">\n </crispr-info>\n }\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"] }]
|
|
36
|
+
}] });
|
|
37
|
+
|
|
38
|
+
export { CheckboxFieldComponent };
|
|
39
|
+
//# sourceMappingURL=tft-crispr-forms-index-Bh8kDfe4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-Bh8kDfe4.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/checkbox-field/checkbox-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/checkbox-field/checkbox-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\n\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n CrisprFieldComponent,\n CheckboxFieldConfig,\n} from '../../utils';\nimport { InfoComponent } from '../info';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<CheckboxFieldConfig> = {\n labelPosition: 'after',\n inline: false,\n};\n\n@Component({\n selector: 'crispr-checkbox-field',\n templateUrl: './checkbox-field.component.html',\n styleUrls: ['./checkbox-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n InfoComponent,\n MatCheckboxModule,\n ReactiveFormsModule,\n FieldContainerComponent,\n FormValidationHandlerModule\n ],\n standalone: true\n})\nexport class CheckboxFieldComponent\n extends CrisprControlComponent<CheckboxFieldConfig>\n implements OnInit\n{\n defaultConfig = defaultConfig;\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\"\n [inlineField]=\"config().inline\">\n <div\n [formGroup]=\"group()\">\n <mat-checkbox\n [color]=\"config().color\"\n [labelPosition]=\"config().labelPosition\"\n [formControlName]=\"config().controlName\">\n {{config().label}}\n @if (config().info) {\n <crispr-info\n matSuffix\n [info]=\"config().info\">\n </crispr-info>\n }\n </mat-checkbox>\n </div>\n</crispr-field-container>\n"],"names":["i2","i3"],"mappings":";;;;;;;;;;AAAA;AAcA,MAAM,aAAa,GAAiC;AAClD,IAAA,aAAa,EAAE,OAAO;AACtB,IAAA,MAAM,EAAE,KAAK;CACd;AAgBK,MAAO,sBACX,SAAQ,sBAA2C,CAAA;AAfrD,IAAA,WAAA,GAAA;;QAkBE,IAAA,CAAA,aAAa,GAA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,MAAA,EAAA,CAAA,6BAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as i1$2 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { ViewChild, Optional, Self, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i1$1 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
import * as i2$2 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
+
import * as i2$1 from '@angular/material/icon';
|
|
12
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
13
|
+
import * as i3 from '@angular/material/input';
|
|
14
|
+
import { MatInputModule } from '@angular/material/input';
|
|
15
|
+
import * as i2 from '@angular/platform-browser';
|
|
16
|
+
import imageCompression from 'browser-image-compression';
|
|
17
|
+
import { Subject, combineLatest, of } from 'rxjs';
|
|
18
|
+
import { shareReplay, switchMap, map, tap, startWith } from 'rxjs/operators';
|
|
19
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
20
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
21
|
+
import { CrisprControlComponent, convertBytesToMb, FieldContainerComponent, SelectedFileComponent, FileDropzoneDirective } from './tft-crispr-forms.mjs';
|
|
22
|
+
|
|
23
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
24
|
+
class ImageUploadFieldComponent extends CrisprControlComponent {
|
|
25
|
+
constructor(ngControl, domSanitizer, cdr) {
|
|
26
|
+
super();
|
|
27
|
+
this.ngControl = ngControl;
|
|
28
|
+
this.domSanitizer = domSanitizer;
|
|
29
|
+
this.cdr = cdr;
|
|
30
|
+
this.defaultConfig = {
|
|
31
|
+
// allowMultipleFiles: false,
|
|
32
|
+
acceptedTypes: 'image/*',
|
|
33
|
+
dropZoneText: 'DROP FILE HERE',
|
|
34
|
+
selectFilesButtonType: 'button',
|
|
35
|
+
selectButtonText: 'SELECT',
|
|
36
|
+
showClearFilesButton: true,
|
|
37
|
+
clearFilesButtonText: 'CLEAR',
|
|
38
|
+
resetFilesButtonText: 'RESET',
|
|
39
|
+
imagePreviewHeight: '250px',
|
|
40
|
+
compressImage: false,
|
|
41
|
+
targetCompressedImageFileSizeMb: 0.4,
|
|
42
|
+
minCompressionThresholdMb: 0.6,
|
|
43
|
+
useWebWorker: true,
|
|
44
|
+
};
|
|
45
|
+
this.inputImageFileSubject = new Subject();
|
|
46
|
+
this.inputImageFile$ = this.inputImageFileSubject
|
|
47
|
+
.asObservable()
|
|
48
|
+
.pipe(shareReplay(1));
|
|
49
|
+
this.compressedFile$ = this.inputImageFile$.pipe(switchMap(async (file) => {
|
|
50
|
+
if (!file || !(file instanceof File))
|
|
51
|
+
return null;
|
|
52
|
+
const { compressImage, targetCompressedImageFileSizeMb, minCompressionThresholdMb, maxWidthOrHeight, useWebWorker, } = this.config();
|
|
53
|
+
const fileSizeMb = convertBytesToMb(file.size);
|
|
54
|
+
const shouldCompress = compressImage &&
|
|
55
|
+
targetCompressedImageFileSizeMb < fileSizeMb &&
|
|
56
|
+
minCompressionThresholdMb < fileSizeMb;
|
|
57
|
+
if (shouldCompress) {
|
|
58
|
+
const options = {
|
|
59
|
+
// Use maxWidthOrHeight if it was provided, else use target compressed size
|
|
60
|
+
...(maxWidthOrHeight
|
|
61
|
+
? { maxWidthOrHeight }
|
|
62
|
+
: { maxSizeMB: targetCompressedImageFileSizeMb }),
|
|
63
|
+
useWebWorker,
|
|
64
|
+
maxIterations: 30,
|
|
65
|
+
onProgress: (progress) => {
|
|
66
|
+
this.progress = progress;
|
|
67
|
+
this.cdr.detectChanges();
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
return await imageCompression(file, options);
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
return file;
|
|
74
|
+
}), map((compressedFile) => {
|
|
75
|
+
if (!compressedFile)
|
|
76
|
+
return compressedFile;
|
|
77
|
+
const { type, name, lastModified } = compressedFile;
|
|
78
|
+
return new File([compressedFile], this.config().fileName || name, {
|
|
79
|
+
type,
|
|
80
|
+
lastModified,
|
|
81
|
+
});
|
|
82
|
+
}), tap((file) => {
|
|
83
|
+
// only set the value if there is a file because resetToInitialValue sets the control value
|
|
84
|
+
// to initial value and clears the compressed image, so setting it to null here would undo that
|
|
85
|
+
if (file) {
|
|
86
|
+
this.control().setValue(file);
|
|
87
|
+
}
|
|
88
|
+
if (file || this.value) {
|
|
89
|
+
this.control().markAsTouched();
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
this.cdr.detectChanges();
|
|
92
|
+
}, 100);
|
|
93
|
+
}
|
|
94
|
+
}), shareReplay(1));
|
|
95
|
+
this.compressedImageUrlString$ = this.compressedFile$.pipe(switchMap(async (file) => {
|
|
96
|
+
if (!file)
|
|
97
|
+
return null;
|
|
98
|
+
const compressedStringImage = await imageCompression.getDataUrlFromFile(file);
|
|
99
|
+
return this.domSanitizer.bypassSecurityTrustResourceUrl(compressedStringImage);
|
|
100
|
+
}), shareReplay(1));
|
|
101
|
+
this.isUploaded = false;
|
|
102
|
+
if (this.ngControl != null) {
|
|
103
|
+
// Setting the value accessor directly (instead of using
|
|
104
|
+
// the providers) to avoid running into a circular import.
|
|
105
|
+
ngControl.valueAccessor = this;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
ngOnInit() {
|
|
109
|
+
super.ngOnInit();
|
|
110
|
+
this.imageSrcUrl$ = combineLatest([
|
|
111
|
+
this.compressedImageUrlString$.pipe(startWith(null)),
|
|
112
|
+
this.control().valueChanges.pipe(startWith(this.value), map((controlValue) => {
|
|
113
|
+
if (!controlValue)
|
|
114
|
+
return null;
|
|
115
|
+
if (controlValue instanceof File)
|
|
116
|
+
return null;
|
|
117
|
+
return (this.config().mapInputValueToUrl?.(controlValue) ||
|
|
118
|
+
controlValue);
|
|
119
|
+
})),
|
|
120
|
+
]).pipe(map(([compressedImageUrlString, controlUrl]) => {
|
|
121
|
+
return compressedImageUrlString || controlUrl || null;
|
|
122
|
+
}));
|
|
123
|
+
this.disabled$ = this.config().disabledCallback
|
|
124
|
+
? this.config().disabledCallback(this.group())
|
|
125
|
+
: of(false);
|
|
126
|
+
}
|
|
127
|
+
filesChanged(files) {
|
|
128
|
+
if (files && files.length > 0) {
|
|
129
|
+
const imageFile = files[0];
|
|
130
|
+
// We clear the control here so that it is invalid while compressing
|
|
131
|
+
// the input pipeline will take care of resetting it
|
|
132
|
+
this.control().patchValue(null);
|
|
133
|
+
// this.control().setErrors({compressing: {loadingMessage: 'Please wait while file compresses'}});
|
|
134
|
+
this.control().markAsTouched();
|
|
135
|
+
this.inputImageFileSubject.next(imageFile);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
clearFileInput() {
|
|
139
|
+
this.inputImageFileSubject.next(null);
|
|
140
|
+
this.fileInputRef.nativeElement.value = '';
|
|
141
|
+
this.control().patchValue(null);
|
|
142
|
+
this.control().markAsTouched();
|
|
143
|
+
this.isUploaded = false;
|
|
144
|
+
}
|
|
145
|
+
resetToInitialValue(initialValue) {
|
|
146
|
+
this.inputImageFileSubject.next(null);
|
|
147
|
+
this.control().patchValue(initialValue);
|
|
148
|
+
this.isUploaded = false;
|
|
149
|
+
}
|
|
150
|
+
writeValue(value) { }
|
|
151
|
+
registerOnChange(fn) {
|
|
152
|
+
this.onChange = fn;
|
|
153
|
+
}
|
|
154
|
+
registerOnTouched(fn) { }
|
|
155
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: ImageUploadFieldComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
156
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: ImageUploadFieldComponent, isStandalone: true, selector: "crispr-image-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\n <mat-form-field floatLabel=\"always\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n <mat-label>{{config().label}}</mat-label>\n <input [formControlName]=\"config().controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n [accept]=\"config().acceptedTypes\"\n (change)=\"filesChanged($event.target.files)\"/>\n <div class=\"ui-container\">\n\n <div class=\"image-preview\" [style.height]=\"config().imagePreviewHeight\">\n @if ((progress < 100) && inputImageFile$ | async; as file) {\n <crispr-selected-file\n [color]=\"config().color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n } @else {\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n @if (imageSrcUrl$ | async; as srcUrl) {\n <img [src]=\"srcUrl\" alt=\"\">\n } @else {\n <div class=\"drop-container\"\n [crisprFileDropzone]=\"!(disabled$ | async)\"\n (fileDrop)=\"filesChanged($event)\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config().dropZoneText}}</h2>\n </div>\n }\n }\n\n </div>\n\n\n\n <!-- </ng-template> -->\n @if (true) {\n <div class=\"button-container\">\n <button\n mat-button\n (click)=\"clearFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>delete</mat-icon>\n {{config().clearFilesButtonText}}\n </button>\n @if (value()) {\n <button\n mat-button\n (click)=\"resetToInitialValue(value())\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>replay</mat-icon>\n {{config().resetFilesButtonText}}\n </button>\n }\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async)\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config().controlName\">\n <mat-icon>\n camera\n </mat-icon>\n SELECT\n </button>\n </div>\n }\n </div>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n</mat-form-field>\n\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-infix{padding-top:0}:host ::ng-deep .mat-mdc-form-field .mat-button-wrapper{display:flex;flex-direction:column;align-items:center;padding-top:8px}:host .ui-container{display:flex;flex-direction:column}:host .ui-container .image-preview{display:flex;flex-direction:column;align-content:space-between;justify-content:center;align-items:center;margin:8px 0;flex-grow:1}:host .ui-container .image-preview crispr-selected-file{width:100%}:host .ui-container .image-preview .drop-container{display:flex;box-sizing:border-box;flex-direction:column;align-items:center;border:3px dashed gray;height:100%;width:100%;align-content:center;justify-content:center;border-radius:8px}:host .ui-container .image-preview .drop-container .drop-icon{height:32px;width:32px;font-size:36px}:host .ui-container .image-preview .drop-container .mat-h2{margin:0}:host .ui-container .image-preview img{height:inherit;max-width:100%}:host .ui-container .button-container{display:flex;flex-direction:var(--image-upload-button-container-direction);justify-content:flex-end}:host .ui-container .button-container button{margin-left:8px}:host input{position:absolute;max-height:0;visibility:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: SelectedFileComponent, selector: "crispr-selected-file", inputs: ["fileName", "progress", "showProgress", "color"] }, { kind: "directive", type: FileDropzoneDirective, selector: "[crisprFileDropzone]", inputs: ["crisprFileDropzone"], outputs: ["fileDrop"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
157
|
+
}
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: ImageUploadFieldComponent, decorators: [{
|
|
159
|
+
type: Component,
|
|
160
|
+
args: [{ selector: 'crispr-image-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
161
|
+
CommonModule,
|
|
162
|
+
FieldContainerComponent,
|
|
163
|
+
ReactiveFormsModule,
|
|
164
|
+
MatIconModule,
|
|
165
|
+
MatButtonModule,
|
|
166
|
+
MatFormFieldModule,
|
|
167
|
+
MatInputModule,
|
|
168
|
+
SelectedFileComponent,
|
|
169
|
+
FileDropzoneDirective,
|
|
170
|
+
FormValidationHandlerModule,
|
|
171
|
+
], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field floatLabel=\"always\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n <mat-label>{{config().label}}</mat-label>\n <input [formControlName]=\"config().controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n [accept]=\"config().acceptedTypes\"\n (change)=\"filesChanged($event.target.files)\"/>\n <div class=\"ui-container\">\n\n <div class=\"image-preview\" [style.height]=\"config().imagePreviewHeight\">\n @if ((progress < 100) && inputImageFile$ | async; as file) {\n <crispr-selected-file\n [color]=\"config().color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n } @else {\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n @if (imageSrcUrl$ | async; as srcUrl) {\n <img [src]=\"srcUrl\" alt=\"\">\n } @else {\n <div class=\"drop-container\"\n [crisprFileDropzone]=\"!(disabled$ | async)\"\n (fileDrop)=\"filesChanged($event)\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config().dropZoneText}}</h2>\n </div>\n }\n }\n\n </div>\n\n\n\n <!-- </ng-template> -->\n @if (true) {\n <div class=\"button-container\">\n <button\n mat-button\n (click)=\"clearFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>delete</mat-icon>\n {{config().clearFilesButtonText}}\n </button>\n @if (value()) {\n <button\n mat-button\n (click)=\"resetToInitialValue(value())\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>replay</mat-icon>\n {{config().resetFilesButtonText}}\n </button>\n }\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async)\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config().controlName\">\n <mat-icon>\n camera\n </mat-icon>\n SELECT\n </button>\n </div>\n }\n </div>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n</mat-form-field>\n\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-mdc-form-field .mat-mdc-form-field-infix{padding-top:0}:host ::ng-deep .mat-mdc-form-field .mat-button-wrapper{display:flex;flex-direction:column;align-items:center;padding-top:8px}:host .ui-container{display:flex;flex-direction:column}:host .ui-container .image-preview{display:flex;flex-direction:column;align-content:space-between;justify-content:center;align-items:center;margin:8px 0;flex-grow:1}:host .ui-container .image-preview crispr-selected-file{width:100%}:host .ui-container .image-preview .drop-container{display:flex;box-sizing:border-box;flex-direction:column;align-items:center;border:3px dashed gray;height:100%;width:100%;align-content:center;justify-content:center;border-radius:8px}:host .ui-container .image-preview .drop-container .drop-icon{height:32px;width:32px;font-size:36px}:host .ui-container .image-preview .drop-container .mat-h2{margin:0}:host .ui-container .image-preview img{height:inherit;max-width:100%}:host .ui-container .button-container{display:flex;flex-direction:var(--image-upload-button-container-direction);justify-content:flex-end}:host .ui-container .button-container button{margin-left:8px}:host input{position:absolute;max-height:0;visibility:hidden}\n"] }]
|
|
172
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
173
|
+
type: Optional
|
|
174
|
+
}, {
|
|
175
|
+
type: Self
|
|
176
|
+
}] }, { type: i2.DomSanitizer }, { type: i0.ChangeDetectorRef }], propDecorators: { fileInputRef: [{
|
|
177
|
+
type: ViewChild,
|
|
178
|
+
args: ['fileInput']
|
|
179
|
+
}] } });
|
|
180
|
+
|
|
181
|
+
export { ImageUploadFieldComponent };
|
|
182
|
+
//# sourceMappingURL=tft-crispr-forms-index-C9gYJRzb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-C9gYJRzb.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/image-upload-field/image-upload-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/image-upload-field/image-upload-field.component.html"],"sourcesContent":["/* eslint-disable @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 ChangeDetectorRef,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NgControl,\n ReactiveFormsModule,\n} 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 { DomSanitizer } from '@angular/platform-browser';\nimport imageCompression from 'browser-image-compression';\nimport { combineLatest, Observable, of, Subject } from 'rxjs';\nimport { map, shareReplay, startWith, switchMap, tap } from 'rxjs/operators';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FileDropzoneDirective } from '../file-dropzone';\nimport { SelectedFileComponent } from '../selected-file';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n convertBytesToMb,\n ImageUploadFieldConfig,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\n@Component({\n selector: 'crispr-image-upload-field',\n templateUrl: './image-upload-field.component.html',\n styleUrls: ['./image-upload-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n FieldContainerComponent,\n ReactiveFormsModule,\n MatIconModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n SelectedFileComponent,\n FileDropzoneDirective,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class ImageUploadFieldComponent\n extends CrisprControlComponent<ImageUploadFieldConfig>\n implements OnInit, ControlValueAccessor\n{\n onChange: () => void;\n\n defaultConfig: Partial<ImageUploadFieldConfig> = {\n // allowMultipleFiles: false,\n acceptedTypes: 'image/*',\n dropZoneText: 'DROP FILE HERE',\n selectFilesButtonType: 'button',\n selectButtonText: 'SELECT',\n showClearFilesButton: true,\n clearFilesButtonText: 'CLEAR',\n resetFilesButtonText: 'RESET',\n imagePreviewHeight: '250px',\n compressImage: false,\n targetCompressedImageFileSizeMb: 0.4,\n minCompressionThresholdMb: 0.6,\n useWebWorker: true,\n };\n\n private inputImageFileSubject = new Subject<File | null>();\n inputImageFile$ = this.inputImageFileSubject\n .asObservable()\n .pipe(shareReplay(1));\n /**\n * the compression progress\n */\n progress: number | undefined;\n\n compressedFile$: Observable<File> = this.inputImageFile$.pipe(\n switchMap(async (file) => {\n if (!file || !(file instanceof File)) return null;\n const {\n compressImage,\n targetCompressedImageFileSizeMb,\n minCompressionThresholdMb,\n maxWidthOrHeight,\n useWebWorker,\n } = this.config();\n const fileSizeMb = convertBytesToMb(file.size);\n const shouldCompress =\n compressImage &&\n targetCompressedImageFileSizeMb < fileSizeMb &&\n minCompressionThresholdMb < fileSizeMb;\n if (shouldCompress) {\n const options = {\n // Use maxWidthOrHeight if it was provided, else use target compressed size\n ...(maxWidthOrHeight\n ? { maxWidthOrHeight }\n : { maxSizeMB: targetCompressedImageFileSizeMb }),\n useWebWorker,\n maxIterations: 30,\n onProgress: (progress: number) => {\n this.progress = progress;\n this.cdr.detectChanges();\n },\n };\n return await imageCompression(file, options);\n } else return file;\n }),\n map((compressedFile: File) => {\n if (!compressedFile) return compressedFile;\n const { type, name, lastModified } = compressedFile;\n return new File([compressedFile], this.config().fileName || name, {\n type,\n lastModified,\n });\n }),\n tap((file) => {\n // only set the value if there is a file because resetToInitialValue sets the control value\n // to initial value and clears the compressed image, so setting it to null here would undo that\n if (file) {\n this.control().setValue(file);\n }\n if (file || this.value) {\n this.control().markAsTouched();\n setTimeout(() => {\n this.cdr.detectChanges();\n }, 100);\n }\n }),\n shareReplay(1)\n );\n\n compressedImageUrlString$: Observable<string | null> =\n this.compressedFile$.pipe(\n switchMap(async (file) => {\n if (!file) return null;\n const compressedStringImage = await imageCompression.getDataUrlFromFile(\n file\n );\n return this.domSanitizer.bypassSecurityTrustResourceUrl(\n compressedStringImage\n ) as string;\n }),\n shareReplay(1)\n );\n\n // This is what is displayed by the image preview\n imageSrcUrl$: Observable<string | null>;\n\n @ViewChild('fileInput') fileInputRef: ElementRef;\n\n selectedFiles: FileList;\n\n isUploaded = false;\n\n disabled$: Observable<boolean>;\n\n constructor(\n @Optional() @Self() public ngControl: NgControl,\n private domSanitizer: DomSanitizer,\n private cdr: ChangeDetectorRef\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.imageSrcUrl$ = combineLatest([\n this.compressedImageUrlString$.pipe(startWith(null)),\n this.control().valueChanges.pipe(\n startWith(this.value),\n map((controlValue): string => {\n if (!controlValue) return null;\n if (controlValue instanceof File) return null;\n return (\n this.config().mapInputValueToUrl?.(controlValue) ||\n (controlValue as string)\n );\n })\n ),\n ]).pipe(\n map(([compressedImageUrlString, controlUrl]) => {\n return compressedImageUrlString || controlUrl || null;\n })\n );\n this.disabled$ = this.config().disabledCallback\n ? this.config().disabledCallback(this.group())\n : of(false);\n }\n\n filesChanged(files: FileList): void {\n if (files && files.length > 0) {\n const imageFile = files[0];\n // We clear the control here so that it is invalid while compressing\n // the input pipeline will take care of resetting it\n this.control().patchValue(null);\n // this.control().setErrors({compressing: {loadingMessage: 'Please wait while file compresses'}});\n this.control().markAsTouched();\n this.inputImageFileSubject.next(imageFile);\n }\n }\n\n clearFileInput(): void {\n this.inputImageFileSubject.next(null);\n this.fileInputRef.nativeElement.value = '';\n this.control().patchValue(null);\n this.control().markAsTouched();\n this.isUploaded = false;\n }\n\n resetToInitialValue(initialValue: string): void {\n this.inputImageFileSubject.next(null);\n this.control().patchValue(initialValue);\n this.isUploaded = false;\n }\n\n writeValue(value: null) {}\n\n registerOnChange(fn: () => void) {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void) {}\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field floatLabel=\"always\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n <mat-label>{{config().label}}</mat-label>\n <input [formControlName]=\"config().controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n [accept]=\"config().acceptedTypes\"\n (change)=\"filesChanged($event.target.files)\"/>\n <div class=\"ui-container\">\n\n <div class=\"image-preview\" [style.height]=\"config().imagePreviewHeight\">\n @if ((progress < 100) && inputImageFile$ | async; as file) {\n <crispr-selected-file\n [color]=\"config().color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n } @else {\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n @if (imageSrcUrl$ | async; as srcUrl) {\n <img [src]=\"srcUrl\" alt=\"\">\n } @else {\n <div class=\"drop-container\"\n [crisprFileDropzone]=\"!(disabled$ | async)\"\n (fileDrop)=\"filesChanged($event)\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config().dropZoneText}}</h2>\n </div>\n }\n }\n\n </div>\n\n\n\n <!-- </ng-template> -->\n @if (true) {\n <div class=\"button-container\">\n <button\n mat-button\n (click)=\"clearFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>delete</mat-icon>\n {{config().clearFilesButtonText}}\n </button>\n @if (value()) {\n <button\n mat-button\n (click)=\"resetToInitialValue(value())\"\n type=\"button\"\n [disabled]=\"(disabled$ | async)\"\n aria-label=\"Remove Selected File(s)\">\n <mat-icon>replay</mat-icon>\n {{config().resetFilesButtonText}}\n </button>\n }\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async)\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config().controlName\">\n <mat-icon>\n camera\n </mat-icon>\n SELECT\n </button>\n </div>\n }\n </div>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n</mat-form-field>\n\n</crispr-field-container>\n"],"names":["i4","i5","i7","i8"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAsDM,MAAO,yBACX,SAAQ,sBAA8C,CAAA;AA8GtD,IAAA,WAAA,CAC6B,SAAoB,EACvC,YAA0B,EAC1B,GAAsB,EAAA;AAE9B,QAAA,KAAK,EAAE;QAJoB,IAAA,CAAA,SAAS,GAAT,SAAS;QAC5B,IAAA,CAAA,YAAY,GAAZ,YAAY;QACZ,IAAA,CAAA,GAAG,GAAH,GAAG;AA5Gb,QAAA,IAAA,CA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A,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACrB,2BAA2B,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,sBAAA,EAAA,QAAA,EAAA,kCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,8BAAA,EAAA,QAAA,EAAA,sCAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAC,IAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAItB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAnBrC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,2BAA2B,EAAA,eAAA,EAGpB,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,uBAAuB;wBACvB,mBAAmB;wBACnB,aAAa;wBACb,eAAe;wBACf,kBAAkB;wBAClB,cAAc;wBACd,qBAAqB;wBACrB,qBAAqB;wBACrB,2BAA2B;AAC9B,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,20FAAA,EAAA,MAAA,EAAA,CAAA,ysCAAA,CAAA,EAAA;;0BAkHf;;0BAAY;;sBATd,SAAS;uBAAC,WAAW;;;;;"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { tap, map } from 'rxjs/operators';
|
|
4
|
+
import * as i2 from '@angular/material/autocomplete';
|
|
5
|
+
import { MatAutocompleteModule, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
|
6
|
+
import { BehaviorSubject, combineLatest } from 'rxjs';
|
|
7
|
+
import { ENTER } from '@angular/cdk/keycodes';
|
|
8
|
+
import * as i5 from '@angular/material/chips';
|
|
9
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
10
|
+
import * as i1$1 from '@angular/common';
|
|
11
|
+
import { CommonModule } from '@angular/common';
|
|
12
|
+
import * as i1 from '@angular/forms';
|
|
13
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
14
|
+
import { MatOptionModule } from '@angular/material/core';
|
|
15
|
+
import * as i3 from '@angular/material/input';
|
|
16
|
+
import { MatInputModule } from '@angular/material/input';
|
|
17
|
+
import { O as OptionComponent } from './tft-crispr-forms-index-UAYeTe3L.mjs';
|
|
18
|
+
import * as i2$2 from '@angular/material/icon';
|
|
19
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
20
|
+
import { DEFAULT_EMPTY_OPTIONS_MESSAGE, AbstractAutocompleteComponent, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
21
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
22
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
23
|
+
import * as i2$1 from '@angular/material/form-field';
|
|
24
|
+
|
|
25
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
26
|
+
const defaultConfig = {
|
|
27
|
+
chipsSelectable: true,
|
|
28
|
+
areChipsRemovable: true,
|
|
29
|
+
tabToSelect: true,
|
|
30
|
+
autoActiveFirstOption: true,
|
|
31
|
+
imageUrlParam: 'image',
|
|
32
|
+
typeDebounceTime: 500,
|
|
33
|
+
allowDuplicates: false,
|
|
34
|
+
duplicateCompareFunction: (chip, option) => chip.value === option.value,
|
|
35
|
+
separatorKeyCodes: [ENTER],
|
|
36
|
+
emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,
|
|
37
|
+
};
|
|
38
|
+
class AutocompleteChiplistFieldComponent extends AbstractAutocompleteComponent {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.defaultConfig = defaultConfig;
|
|
42
|
+
this.chips$ = new BehaviorSubject([]);
|
|
43
|
+
this.selectedChip = null;
|
|
44
|
+
this.controlValue$ = this.chips$.pipe(tap((chips) => {
|
|
45
|
+
this.control().setValue(chips.map((chip) => chip.value));
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
ngOnInit() {
|
|
49
|
+
super.ngOnInit();
|
|
50
|
+
this.remainingOptions$ = combineLatest([this.chips$, this.options$]).pipe(map(([chips, options]) => {
|
|
51
|
+
return this.config().allowDuplicates
|
|
52
|
+
? options
|
|
53
|
+
: options?.filter((option) => {
|
|
54
|
+
return !chips.some((chip) => this.config().duplicateCompareFunction(chip, option));
|
|
55
|
+
});
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
setControlValue(value) {
|
|
59
|
+
if (value) {
|
|
60
|
+
this.chips$.next(value);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// handles mat selecting
|
|
64
|
+
handleSelect(event) {
|
|
65
|
+
const selectedOption = event.option.value;
|
|
66
|
+
this.chips$.next([...this.chips$.value, selectedOption]);
|
|
67
|
+
this.chipInputRef.nativeElement.value = '';
|
|
68
|
+
this.autocompleteInputControl.setValue('');
|
|
69
|
+
// setTimeout needed because the panel thinks it's still open at this point
|
|
70
|
+
setTimeout(() => this.chipInput.openPanel());
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* To follow ARIA standards we want to select the active option on blur.
|
|
74
|
+
* matChipInputAddOnBlur should do this but it causes buggy behaviour
|
|
75
|
+
* @param event blur event that triggers the handle blur
|
|
76
|
+
*/
|
|
77
|
+
handleTab(_event) {
|
|
78
|
+
if (this.chipInput.activeOption &&
|
|
79
|
+
(this.config().tabToSelect || this.config().addChipOnBlur)) {
|
|
80
|
+
const chip = this.chipInput.activeOption.value;
|
|
81
|
+
this.chips$.next([...this.chips$.value, chip]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Handles selection via key tokens passed through separatorKeyCodes property
|
|
86
|
+
* NOTE: If TAB is used focus does not move on to next component
|
|
87
|
+
* @param event
|
|
88
|
+
*/
|
|
89
|
+
handleTokenEnd(event) {
|
|
90
|
+
if (this.chipInput.activeOption) {
|
|
91
|
+
this.chipInput.activeOption.select();
|
|
92
|
+
}
|
|
93
|
+
event.chipInput?.clear();
|
|
94
|
+
}
|
|
95
|
+
mapToLabel(option) {
|
|
96
|
+
return option ? option.label : '';
|
|
97
|
+
}
|
|
98
|
+
removeChip(removedChip) {
|
|
99
|
+
const remainingChips = this.chips$.value.filter((chip) => chip !== removedChip);
|
|
100
|
+
this.chips$.next(remainingChips);
|
|
101
|
+
}
|
|
102
|
+
highlightChip(chip) {
|
|
103
|
+
if (this.config().chipsSelectable) {
|
|
104
|
+
this.selectedChip = chip;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
blurField() {
|
|
108
|
+
this.selectedChip = null;
|
|
109
|
+
}
|
|
110
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteChiplistFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
111
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: AutocompleteChiplistFieldComponent, isStandalone: true, selector: "crispr-autocomplete-chiplist-field", viewQueries: [{ propertyName: "chipInput", first: true, predicate: ["autoInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "chipInputRef", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <mat-chip-grid #chipList>\n <!-- [selectable]=\"config().chipsSelectable\" -->\n @for (chip of controlValue$ | async; track chip; let i = $index) {\n <mat-chip-row class=\"refinement-chip\" [removable]=\"config().areChipsRemovable\"\n [highlighted]=\"chip?.value === selectedChip?.value\" (click)=\"highlightChip(chip)\" (removed)=\"removeChip(chip)\">\n @if (chip.imageUrl) {<img [src]=\"chip.imageUrl\" matChipAvatar alt=\"image of {{chip.label}}\">}\n {{chip.label}}\n @if (config().areChipsRemovable) {<mat-icon matChipRemove>cancel</mat-icon>}\n </mat-chip-row>\n }\n <input class=\"hidden-error-directive-anchor\" (blur)=\"blurField()\" [formControlName]=\"config().controlName\"\n type=\"text\" />\n\n <input matInput [formControl]=\"autocompleteInputControl\" [placeholder]=\"config().placeholder\"\n [matChipInputFor]=\"chipList\" [matAutocomplete]=\"auto\" (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config().separatorKeyCodes\" (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\" type=\"text\" autocapitalize=\"off\" autocorrect=\"off\" spellcheck=\"false\" (blur)=\"blurField()\"\n #autoInput />\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n </mat-chip-grid>\n <mat-autocomplete #auto=\"matAutocomplete\" [autoActiveFirstOption]=\"this.config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\" [displayWith]=\"mapToLabel\">\n @if (remainingOptions$ | async; as remainingOptions) {\n @if (remainingOptions.length > 0) {\n @for (option of remainingOptions$ | async; track option) {\n <mat-option [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "directive", type: i5.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
112
|
+
}
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AutocompleteChiplistFieldComponent, decorators: [{
|
|
114
|
+
type: Component,
|
|
115
|
+
args: [{ selector: 'crispr-autocomplete-chiplist-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
116
|
+
CommonModule,
|
|
117
|
+
InfoComponent,
|
|
118
|
+
OptionComponent,
|
|
119
|
+
ReactiveFormsModule,
|
|
120
|
+
FieldContainerComponent,
|
|
121
|
+
MatAutocompleteModule,
|
|
122
|
+
MatInputModule,
|
|
123
|
+
MatOptionModule,
|
|
124
|
+
MatChipsModule,
|
|
125
|
+
MatIconModule,
|
|
126
|
+
FormValidationHandlerModule,
|
|
127
|
+
], standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <mat-chip-grid #chipList>\n <!-- [selectable]=\"config().chipsSelectable\" -->\n @for (chip of controlValue$ | async; track chip; let i = $index) {\n <mat-chip-row class=\"refinement-chip\" [removable]=\"config().areChipsRemovable\"\n [highlighted]=\"chip?.value === selectedChip?.value\" (click)=\"highlightChip(chip)\" (removed)=\"removeChip(chip)\">\n @if (chip.imageUrl) {<img [src]=\"chip.imageUrl\" matChipAvatar alt=\"image of {{chip.label}}\">}\n {{chip.label}}\n @if (config().areChipsRemovable) {<mat-icon matChipRemove>cancel</mat-icon>}\n </mat-chip-row>\n }\n <input class=\"hidden-error-directive-anchor\" (blur)=\"blurField()\" [formControlName]=\"config().controlName\"\n type=\"text\" />\n\n <input matInput [formControl]=\"autocompleteInputControl\" [placeholder]=\"config().placeholder\"\n [matChipInputFor]=\"chipList\" [matAutocomplete]=\"auto\" (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config().separatorKeyCodes\" (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\" type=\"text\" autocapitalize=\"off\" autocorrect=\"off\" spellcheck=\"false\" (blur)=\"blurField()\"\n #autoInput />\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n </mat-chip-grid>\n <mat-autocomplete #auto=\"matAutocomplete\" [autoActiveFirstOption]=\"this.config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\" [displayWith]=\"mapToLabel\">\n @if (remainingOptions$ | async; as remainingOptions) {\n @if (remainingOptions.length > 0) {\n @for (option of remainingOptions$ | async; track option) {\n <mat-option [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"] }]
|
|
128
|
+
}], propDecorators: { chipInput: [{
|
|
129
|
+
type: ViewChild,
|
|
130
|
+
args: ['autoInput', { read: MatAutocompleteTrigger }]
|
|
131
|
+
}], chipInputRef: [{
|
|
132
|
+
type: ViewChild,
|
|
133
|
+
args: ['autoInput']
|
|
134
|
+
}] } });
|
|
135
|
+
|
|
136
|
+
export { AutocompleteChiplistFieldComponent };
|
|
137
|
+
//# sourceMappingURL=tft-crispr-forms-index-ClPQl_5D.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-ClPQl_5D.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n ViewChild,\n ElementRef,\n} from '@angular/core';\nimport { map, tap } from 'rxjs/operators';\nimport {\n MatAutocompleteModule,\n MatAutocompleteSelectedEvent,\n MatAutocompleteTrigger,\n} from '@angular/material/autocomplete';\nimport { Observable, BehaviorSubject, combineLatest } from 'rxjs';\nimport { ENTER } from '@angular/cdk/keycodes';\n\nimport { MatChipInputEvent, MatChipsModule } from '@angular/material/chips';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatOptionModule } from '@angular/material/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { OptionComponent } from '../option';\nimport { MatIconModule } from '@angular/material/icon';\nimport {\n AutocompleteChiplistFieldConfig,\n AbstractAutocompleteComponent,\n DEFAULT_EMPTY_OPTIONS_MESSAGE,\n SelectOption,\n} from '../../utils';\nimport { FieldContainerComponent } from '../field-container';\nimport { InfoComponent } from '../info';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\n\nconst defaultConfig: Partial<AutocompleteChiplistFieldConfig> = {\n chipsSelectable: true,\n areChipsRemovable: true,\n tabToSelect: true,\n autoActiveFirstOption: true,\n imageUrlParam: 'image',\n typeDebounceTime: 500,\n allowDuplicates: false,\n duplicateCompareFunction: (chip, option) => chip.value === option.value,\n separatorKeyCodes: [ENTER],\n emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,\n};\n\n@Component({\n selector: 'crispr-autocomplete-chiplist-field',\n templateUrl: './autocomplete-chiplist-field.component.html',\n styleUrls: ['./autocomplete-chiplist-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatAutocompleteModule,\n MatInputModule,\n MatOptionModule,\n MatChipsModule,\n MatIconModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class AutocompleteChiplistFieldComponent\n extends AbstractAutocompleteComponent<AutocompleteChiplistFieldConfig>\n implements OnInit\n{\n defaultConfig = defaultConfig;\n chips$ = new BehaviorSubject<SelectOption[]>([]);\n remainingOptions$: Observable<SelectOption[]>;\n selectedChip: SelectOption = null;\n controlValue$ = this.chips$.pipe(\n tap((chips) => {\n this.control().setValue(chips.map((chip) => chip.value));\n })\n );\n\n // We need use ViewChild twice on the same template ref to access as different types\n // - the MatAutocompleteTrigger is used to for selecting value on tab\n // - the ElementRef<HTMLInputElement> is used to clear the value from input element on selection\n @ViewChild('autoInput', { read: MatAutocompleteTrigger })\n chipInput: MatAutocompleteTrigger;\n @ViewChild('autoInput') chipInputRef: ElementRef<HTMLInputElement>;\n\n ngOnInit() {\n super.ngOnInit();\n this.remainingOptions$ = combineLatest([this.chips$, this.options$]).pipe(\n map(([chips, options]) => {\n return this.config().allowDuplicates\n ? options\n : options?.filter((option) => {\n return !chips.some((chip) =>\n this.config().duplicateCompareFunction(chip, option)\n );\n });\n })\n );\n }\n\n setControlValue(value: SelectOption[]) {\n if (value) {\n this.chips$.next(value);\n }\n }\n\n // handles mat selecting\n handleSelect(event: MatAutocompleteSelectedEvent) {\n const selectedOption: SelectOption = event.option.value as SelectOption;\n this.chips$.next([...this.chips$.value, selectedOption]);\n this.chipInputRef.nativeElement.value = '';\n this.autocompleteInputControl.setValue('');\n // setTimeout needed because the panel thinks it's still open at this point\n setTimeout(() => this.chipInput.openPanel());\n }\n\n /**\n * To follow ARIA standards we want to select the active option on blur.\n * matChipInputAddOnBlur should do this but it causes buggy behaviour\n * @param event blur event that triggers the handle blur\n */\n handleTab(_event: FocusEvent) {\n if (\n this.chipInput.activeOption &&\n (this.config().tabToSelect || this.config().addChipOnBlur)\n ) {\n const chip = this.chipInput.activeOption.value;\n this.chips$.next([...this.chips$.value, chip]);\n }\n }\n\n /**\n * Handles selection via key tokens passed through separatorKeyCodes property\n * NOTE: If TAB is used focus does not move on to next component\n * @param event\n */\n handleTokenEnd(event: MatChipInputEvent) {\n if (this.chipInput.activeOption) {\n this.chipInput.activeOption.select();\n }\n event.chipInput?.clear();\n }\n\n mapToLabel(option: SelectOption) {\n return option ? option.label : '';\n }\n\n removeChip(removedChip: SelectOption) {\n const remainingChips: SelectOption[] = this.chips$.value.filter(\n (chip) => chip !== removedChip\n );\n this.chips$.next(remainingChips);\n }\n\n highlightChip(chip: SelectOption) {\n if(this.config().chipsSelectable) {\n this.selectedChip = chip\n }\n }\n \n blurField() {\n this.selectedChip = null;\n }\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n\n <mat-chip-grid #chipList>\n <!-- [selectable]=\"config().chipsSelectable\" -->\n @for (chip of controlValue$ | async; track chip; let i = $index) {\n <mat-chip-row class=\"refinement-chip\" [removable]=\"config().areChipsRemovable\"\n [highlighted]=\"chip?.value === selectedChip?.value\" (click)=\"highlightChip(chip)\" (removed)=\"removeChip(chip)\">\n @if (chip.imageUrl) {<img [src]=\"chip.imageUrl\" matChipAvatar alt=\"image of {{chip.label}}\">}\n {{chip.label}}\n @if (config().areChipsRemovable) {<mat-icon matChipRemove>cancel</mat-icon>}\n </mat-chip-row>\n }\n <input class=\"hidden-error-directive-anchor\" (blur)=\"blurField()\" [formControlName]=\"config().controlName\"\n type=\"text\" />\n\n <input matInput [formControl]=\"autocompleteInputControl\" [placeholder]=\"config().placeholder\"\n [matChipInputFor]=\"chipList\" [matAutocomplete]=\"auto\" (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config().separatorKeyCodes\" (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\" type=\"text\" autocapitalize=\"off\" autocorrect=\"off\" spellcheck=\"false\" (blur)=\"blurField()\"\n #autoInput />\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info \"></crispr-info>}\n\n </mat-chip-grid>\n <mat-autocomplete #auto=\"matAutocomplete\" [autoActiveFirstOption]=\"this.config().autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\" [displayWith]=\"mapToLabel\">\n @if (remainingOptions$ | async; as remainingOptions) {\n @if (remainingOptions.length > 0) {\n @for (option of remainingOptions$ | async; track option) {\n <mat-option [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n } @else {\n <mat-option disabled=\"true\">\n {{config().emptyOptionsMessage}}\n </mat-option>\n }\n </mat-autocomplete>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>"],"names":["i4","i6","i7","i8"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAkCA,MAAM,aAAa,GAA6C;AAC9D,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,aAAa,EAAE,OAAO;AACtB,IAAA,gBA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