@tft/crispr-forms 18.0.1 → 19.0.2
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 +300 -175
- package/fesm2022/tft-crispr-forms.mjs.map +1 -1
- package/package.json +3 -5
- package/tft-crispr-forms-19.0.2.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 -3
- 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 -53
- 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 -7
- 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-BC1uV7T_.mjs +0 -19
- package/fesm2022/tft-crispr-forms-index-BC1uV7T_.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BDJfgpKH.mjs +0 -142
- package/fesm2022/tft-crispr-forms-index-BDJfgpKH.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BVwoi2lw.mjs +0 -49
- package/fesm2022/tft-crispr-forms-index-BVwoi2lw.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-Bbcv75sh.mjs +0 -48
- package/fesm2022/tft-crispr-forms-index-Bbcv75sh.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BdOC-6h3.mjs +0 -110
- package/fesm2022/tft-crispr-forms-index-BdOC-6h3.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BwC11k3P.mjs +0 -73
- package/fesm2022/tft-crispr-forms-index-BwC11k3P.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CN4M4eEo.mjs +0 -50
- package/fesm2022/tft-crispr-forms-index-CN4M4eEo.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CP5Jn6EK.mjs +0 -63
- package/fesm2022/tft-crispr-forms-index-CP5Jn6EK.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CYzZB0sA.mjs +0 -54
- package/fesm2022/tft-crispr-forms-index-CYzZB0sA.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-C_YTy6il.mjs +0 -102
- package/fesm2022/tft-crispr-forms-index-C_YTy6il.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-Cpu5cwLo.mjs +0 -80
- package/fesm2022/tft-crispr-forms-index-Cpu5cwLo.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DLa8K3lm.mjs +0 -36
- package/fesm2022/tft-crispr-forms-index-DLa8K3lm.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DNTOjcVZ.mjs +0 -49
- package/fesm2022/tft-crispr-forms-index-DNTOjcVZ.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DYHyL8s6.mjs +0 -57
- package/fesm2022/tft-crispr-forms-index-DYHyL8s6.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DhIYxOdD.mjs +0 -185
- package/fesm2022/tft-crispr-forms-index-DhIYxOdD.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-o78Cm3Kf.mjs +0 -91
- package/fesm2022/tft-crispr-forms-index-o78Cm3Kf.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 -2
- 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 -32
- 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 -6
- 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 -13
- 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.1.tgz +0 -0
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import * as i1 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 i2 from '@angular/forms';
|
|
6
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import * as i2$2 from '@angular/material/button';
|
|
8
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
-
import * as i3$1 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 i5 from '@angular/material/input';
|
|
14
|
-
import { MatInputModule } from '@angular/material/input';
|
|
15
|
-
import * as i2$1 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 i7 from '@tft/form-validation-handler';
|
|
20
|
-
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
21
|
-
import { crisprControlMixin, CrisprFieldComponent, convertBytesToMb, FieldContainerComponent, SelectedFileComponent, FileDropzoneDirective } from './tft-crispr-forms.mjs';
|
|
22
|
-
import '@angular/material/progress-bar';
|
|
23
|
-
import '@angular/material/tooltip';
|
|
24
|
-
|
|
25
|
-
/* eslint-disable @nx/enforce-module-boundaries */
|
|
26
|
-
const ImageUploadFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
27
|
-
class ImageUploadFieldComponent extends ImageUploadFieldMixin {
|
|
28
|
-
constructor(ngControl, domSanitizer, cdr) {
|
|
29
|
-
super();
|
|
30
|
-
this.ngControl = ngControl;
|
|
31
|
-
this.domSanitizer = domSanitizer;
|
|
32
|
-
this.cdr = cdr;
|
|
33
|
-
this.defaultConfig = {
|
|
34
|
-
// allowMultipleFiles: false,
|
|
35
|
-
acceptedTypes: 'image/*',
|
|
36
|
-
dropZoneText: 'DROP FILE HERE',
|
|
37
|
-
selectFilesButtonType: 'button',
|
|
38
|
-
selectButtonText: 'SELECT',
|
|
39
|
-
showClearFilesButton: true,
|
|
40
|
-
clearFilesButtonText: 'CLEAR',
|
|
41
|
-
resetFilesButtonText: 'RESET',
|
|
42
|
-
imagePreviewHeight: '250px',
|
|
43
|
-
compressImage: false,
|
|
44
|
-
targetCompressedImageFileSizeMb: 0.4,
|
|
45
|
-
minCompressionThresholdMb: 0.6,
|
|
46
|
-
useWebWorker: true,
|
|
47
|
-
};
|
|
48
|
-
this.inputImageFileSubject = new Subject();
|
|
49
|
-
this.inputImageFile$ = this.inputImageFileSubject
|
|
50
|
-
.asObservable()
|
|
51
|
-
.pipe(shareReplay(1));
|
|
52
|
-
this.compressedFile$ = this.inputImageFile$.pipe(switchMap(async (file) => {
|
|
53
|
-
if (!file || !(file instanceof File))
|
|
54
|
-
return null;
|
|
55
|
-
const { compressImage, targetCompressedImageFileSizeMb, minCompressionThresholdMb, maxWidthOrHeight, useWebWorker, } = this.config;
|
|
56
|
-
const fileSizeMb = convertBytesToMb(file.size);
|
|
57
|
-
const shouldCompress = compressImage &&
|
|
58
|
-
targetCompressedImageFileSizeMb < fileSizeMb &&
|
|
59
|
-
minCompressionThresholdMb < fileSizeMb;
|
|
60
|
-
if (shouldCompress) {
|
|
61
|
-
const options = {
|
|
62
|
-
// Use maxWidthOrHeight if it was provided, else use target compressed size
|
|
63
|
-
...(maxWidthOrHeight
|
|
64
|
-
? { maxWidthOrHeight }
|
|
65
|
-
: { maxSizeMB: targetCompressedImageFileSizeMb }),
|
|
66
|
-
useWebWorker,
|
|
67
|
-
maxIterations: 30,
|
|
68
|
-
onProgress: (progress) => {
|
|
69
|
-
this.progress = progress;
|
|
70
|
-
this.cdr.detectChanges();
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
return await imageCompression(file, options);
|
|
74
|
-
}
|
|
75
|
-
else
|
|
76
|
-
return file;
|
|
77
|
-
}), map((compressedFile) => {
|
|
78
|
-
if (!compressedFile)
|
|
79
|
-
return compressedFile;
|
|
80
|
-
const { type, name, lastModified } = compressedFile;
|
|
81
|
-
return new File([compressedFile], this.config.fileName || name, {
|
|
82
|
-
type,
|
|
83
|
-
lastModified,
|
|
84
|
-
});
|
|
85
|
-
}), tap((file) => {
|
|
86
|
-
// only set the value if there is a file because resetToInitialValue sets the control value
|
|
87
|
-
// to initial value and clears the compressed image, so setting it to null here would undo that
|
|
88
|
-
if (file) {
|
|
89
|
-
this.control.setValue(file);
|
|
90
|
-
}
|
|
91
|
-
if (file || this.value) {
|
|
92
|
-
this.control.markAsTouched();
|
|
93
|
-
setTimeout(() => {
|
|
94
|
-
this.cdr.detectChanges();
|
|
95
|
-
}, 100);
|
|
96
|
-
}
|
|
97
|
-
}), shareReplay(1));
|
|
98
|
-
this.compressedImageUrlString$ = this.compressedFile$.pipe(switchMap(async (file) => {
|
|
99
|
-
if (!file)
|
|
100
|
-
return null;
|
|
101
|
-
const compressedStringImage = await imageCompression.getDataUrlFromFile(file);
|
|
102
|
-
return this.domSanitizer.bypassSecurityTrustResourceUrl(compressedStringImage);
|
|
103
|
-
}), shareReplay(1));
|
|
104
|
-
this.isUploaded = false;
|
|
105
|
-
if (this.ngControl != null) {
|
|
106
|
-
// Setting the value accessor directly (instead of using
|
|
107
|
-
// the providers) to avoid running into a circular import.
|
|
108
|
-
ngControl.valueAccessor = this;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
ngOnInit() {
|
|
112
|
-
super.ngOnInit();
|
|
113
|
-
this.imageSrcUrl$ = combineLatest([
|
|
114
|
-
this.compressedImageUrlString$.pipe(startWith(null)),
|
|
115
|
-
this.control.valueChanges.pipe(startWith(this.value), map((controlValue) => {
|
|
116
|
-
if (!controlValue)
|
|
117
|
-
return null;
|
|
118
|
-
if (controlValue instanceof File)
|
|
119
|
-
return null;
|
|
120
|
-
return (this.config.mapInputValueToUrl?.(controlValue) ||
|
|
121
|
-
controlValue);
|
|
122
|
-
})),
|
|
123
|
-
]).pipe(map(([compressedImageUrlString, controlUrl]) => {
|
|
124
|
-
return compressedImageUrlString || controlUrl || null;
|
|
125
|
-
}));
|
|
126
|
-
this.disabled$ = this.config.disabledCallback
|
|
127
|
-
? this.config.disabledCallback(this.group)
|
|
128
|
-
: of(false);
|
|
129
|
-
}
|
|
130
|
-
filesChanged(files) {
|
|
131
|
-
if (files && files.length > 0) {
|
|
132
|
-
const imageFile = files[0];
|
|
133
|
-
// We clear the control here so that it is invalid while compressing
|
|
134
|
-
// the input pipeline will take care of resetting it
|
|
135
|
-
this.control.patchValue(null);
|
|
136
|
-
// this.control.setErrors({compressing: {loadingMessage: 'Please wait while file compresses'}});
|
|
137
|
-
this.control.markAsTouched();
|
|
138
|
-
this.inputImageFileSubject.next(imageFile);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
clearFileInput() {
|
|
142
|
-
this.inputImageFileSubject.next(null);
|
|
143
|
-
this.fileInputRef.nativeElement.value = '';
|
|
144
|
-
this.control.patchValue(null);
|
|
145
|
-
this.control.markAsTouched();
|
|
146
|
-
this.isUploaded = false;
|
|
147
|
-
}
|
|
148
|
-
resetToInitialValue(initialValue) {
|
|
149
|
-
this.inputImageFileSubject.next(null);
|
|
150
|
-
this.control.patchValue(initialValue);
|
|
151
|
-
this.isUploaded = false;
|
|
152
|
-
}
|
|
153
|
-
writeValue(value) { }
|
|
154
|
-
registerOnChange(fn) {
|
|
155
|
-
this.onChange = fn;
|
|
156
|
-
}
|
|
157
|
-
registerOnTouched(fn) { }
|
|
158
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: ImageUploadFieldComponent, deps: [{ token: i2.NgControl, optional: true, self: true }, { token: i2$1.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
159
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.3", 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 <crispr-selected-file\n *ngIf=\"(progress < 100) && inputImageFile$ | async as file; else dropzoneOrPreview\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n\n <ng-template #dropzoneOrPreview>\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n <img *ngIf=\"imageSrcUrl$ | async as srcUrl; else noImage\" [src]=\"srcUrl\" alt=\"\">\n <ng-template #noImage>\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 </ng-template>\n\n </ng-template>\n </div>\n\n\n\n <!-- </ng-template> -->\n <div class=\"button-container\" *ngIf=\"true\">\n\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\n <button\n *ngIf=\"value\"\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 </div>\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: [":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: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { 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.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: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: "directive", type: FileDropzoneDirective, selector: "[crisprFileDropzone]", inputs: ["crisprFileDropzone"], outputs: ["fileDrop"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
160
|
-
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: ImageUploadFieldComponent, decorators: [{
|
|
162
|
-
type: Component,
|
|
163
|
-
args: [{ selector: 'crispr-image-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
164
|
-
CommonModule,
|
|
165
|
-
FieldContainerComponent,
|
|
166
|
-
ReactiveFormsModule,
|
|
167
|
-
MatIconModule,
|
|
168
|
-
MatButtonModule,
|
|
169
|
-
MatFormFieldModule,
|
|
170
|
-
MatInputModule,
|
|
171
|
-
SelectedFileComponent,
|
|
172
|
-
FileDropzoneDirective,
|
|
173
|
-
FormValidationHandlerModule,
|
|
174
|
-
], 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 <crispr-selected-file\n *ngIf=\"(progress < 100) && inputImageFile$ | async as file; else dropzoneOrPreview\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n\n <ng-template #dropzoneOrPreview>\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n <img *ngIf=\"imageSrcUrl$ | async as srcUrl; else noImage\" [src]=\"srcUrl\" alt=\"\">\n <ng-template #noImage>\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 </ng-template>\n\n </ng-template>\n </div>\n\n\n\n <!-- </ng-template> -->\n <div class=\"button-container\" *ngIf=\"true\">\n\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\n <button\n *ngIf=\"value\"\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 </div>\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: [":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"] }]
|
|
175
|
-
}], ctorParameters: () => [{ type: i2.NgControl, decorators: [{
|
|
176
|
-
type: Optional
|
|
177
|
-
}, {
|
|
178
|
-
type: Self
|
|
179
|
-
}] }, { type: i2$1.DomSanitizer }, { type: i0.ChangeDetectorRef }], propDecorators: { fileInputRef: [{
|
|
180
|
-
type: ViewChild,
|
|
181
|
-
args: ['fileInput']
|
|
182
|
-
}] } });
|
|
183
|
-
|
|
184
|
-
export { ImageUploadFieldComponent };
|
|
185
|
-
//# sourceMappingURL=tft-crispr-forms-index-DhIYxOdD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-DhIYxOdD.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 crisprControlMixin,\n CrisprFieldComponent,\n convertBytesToMb,\n ImageUploadFieldConfig,\n} from '../../utils';\n\nconst ImageUploadFieldMixin =\n crisprControlMixin<ImageUploadFieldConfig>(CrisprFieldComponent);\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 standalone: true,\n imports: [\n CommonModule,\n FieldContainerComponent,\n ReactiveFormsModule,\n MatIconModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n SelectedFileComponent,\n FileDropzoneDirective,\n FormValidationHandlerModule,\n ],\n})\nexport class ImageUploadFieldComponent\n extends ImageUploadFieldMixin\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 <crispr-selected-file\n *ngIf=\"(progress < 100) && inputImageFile$ | async as file; else dropzoneOrPreview\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"'Compressing: ' + file.name\"\n [showProgress]=\"true\"\n [progress]=\"progress\">\n </crispr-selected-file>\n\n <ng-template #dropzoneOrPreview>\n <!-- <img *ngIf=\"(initialUrlString$ | async) as initialUrlString;\" [src]=\"initialUrlString\" alt=\"\"> -->\n <img *ngIf=\"imageSrcUrl$ | async as srcUrl; else noImage\" [src]=\"srcUrl\" alt=\"\">\n <ng-template #noImage>\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 </ng-template>\n\n </ng-template>\n </div>\n\n\n\n <!-- </ng-template> -->\n <div class=\"button-container\" *ngIf=\"true\">\n\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\n <button\n *ngIf=\"value\"\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 </div>\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"],"names":["i1","i2","i5","i6","i8"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAoCA,MAAM,qBAAqB,GACzB,kBAAkB,CAAyB,oBAAoB,CAAC,CAAC;AAqB7D,MAAO,yBACX,SAAQ,qBAAqB,CAAA;AA8G7B,IAAA,WAAA,CAC6B,SAAoB,EACvC,YAA0B,EAC1B,GAAsB,EAAA;AAE9B,QAAA,KAAK,EAAE,CAAC;QAJmB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;QACvC,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAC1B,IAAG,CAAA,GAAA,GAAH,GAAG,CAAmB;AA5GhC,QAAA,IAAA,CAAA,aAAa,GAAoC;;AAE/C,YAAA,aAAa,EAAE,SAAS;AACxB,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,oBAAoB,EAAE,OAAO;AAC7B,YAAA,kBAAkB,EAAE,OAAO;AAC3B,YAAA,aAAa,EAAE,KAAK;AACpB,YAAA,+BAA+B,EAAE,GAAG;AACpC,YAAA,yBAAyB,EAAE,GAAG;AAC9B,YAAA,YAAY,EAAE,IAAI;SACnB,CAAC;AAEM,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,OAAO,EAAe,CAAC;QAC3D,IAAe,CAAA,eAAA,GAAG,IAAI,CAAC,qBAAqB;AACzC,aAAA,YAAY,EAAE;AACd,aAAA,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAMxB,QAAA,IAAA,CAAA,eAAe,GAAqB,IAAI,CAAC,eAAe,CAAC,IAAI,CAC3D,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,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,uBAAuB;wBACvB,mBAAmB;wBACnB,aAAa;wBACb,eAAe;wBACf,kBAAkB;wBAClB,cAAc;wBACd,qBAAqB;wBACrB,qBAAqB;wBACrB,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,i2FAAA,EAAA,MAAA,EAAA,CAAA,ysCAAA,CAAA,EAAA,CAAA;;0BAkHE,QAAQ;;0BAAI,IAAI;sGATK,YAAY,EAAA,CAAA;sBAAnC,SAAS;uBAAC,WAAW,CAAA;;;;;"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import * as i1 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
5
|
-
import * as i2 from '@angular/forms';
|
|
6
|
-
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import * as i4$1 from '@angular/material/core';
|
|
8
|
-
import { MatOptionModule } from '@angular/material/core';
|
|
9
|
-
import * as i5 from '@angular/material/input';
|
|
10
|
-
import { MatInputModule } from '@angular/material/input';
|
|
11
|
-
import * as i4 from '@angular/material/select';
|
|
12
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
13
|
-
import { combineLatest } from 'rxjs';
|
|
14
|
-
import { startWith } from 'rxjs/operators';
|
|
15
|
-
import { O as OptionComponent } from './tft-crispr-forms-index-BC1uV7T_.mjs';
|
|
16
|
-
import * as i7 from '@tft/form-validation-handler';
|
|
17
|
-
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
18
|
-
import { crisprControlMixin, CrisprFieldComponent, observablifyOptions, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
19
|
-
import * as i3 from '@angular/material/form-field';
|
|
20
|
-
import '@angular/material/button';
|
|
21
|
-
import '@angular/material/icon';
|
|
22
|
-
import '@angular/material/progress-bar';
|
|
23
|
-
import '@angular/material/tooltip';
|
|
24
|
-
|
|
25
|
-
/* eslint-disable @nx/enforce-module-boundaries */
|
|
26
|
-
const defaultConfig = {};
|
|
27
|
-
const UnitConversionFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
28
|
-
class UnitConversionFieldComponent extends UnitConversionFieldMixin {
|
|
29
|
-
constructor() {
|
|
30
|
-
super(...arguments);
|
|
31
|
-
this.defaultConfig = defaultConfig;
|
|
32
|
-
this.displayValueControl = new FormControl();
|
|
33
|
-
this.unitSelectControl = new FormControl();
|
|
34
|
-
}
|
|
35
|
-
ngOnInit() {
|
|
36
|
-
super.ngOnInit();
|
|
37
|
-
// TODO: Validators need work. validation is tricky because the input needs to be validated against but the validator will compare against the controls value
|
|
38
|
-
// this.displayValueControl.setValidators(this.config.validators);
|
|
39
|
-
const controlValuePipeline = [
|
|
40
|
-
this.displayValueControl.valueChanges.pipe(startWith(this.displayValueControl.value)),
|
|
41
|
-
];
|
|
42
|
-
// setup all required pieces when showing a field for selecting units
|
|
43
|
-
if (this.config.showUnitSelect) {
|
|
44
|
-
this.unitOptions$ = observablifyOptions(this.config.selectableUnits, this.group);
|
|
45
|
-
controlValuePipeline.push(this.unitSelectControl.valueChanges.pipe(startWith(this.config?.initialDisplayUnit || null)));
|
|
46
|
-
this.unitSelectControl.setValue(this.config?.initialDisplayUnit || null);
|
|
47
|
-
}
|
|
48
|
-
this.transformationSubscription = combineLatest(controlValuePipeline).subscribe(([displayValue, unitValue]) => {
|
|
49
|
-
const computedValue = this.config.storedValueConversion(displayValue, unitValue);
|
|
50
|
-
this.control.setValue(computedValue);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
ngOnDestroy() {
|
|
54
|
-
this.transformationSubscription.unsubscribe();
|
|
55
|
-
}
|
|
56
|
-
setInitialDisplayValue(storedValue, unit) {
|
|
57
|
-
const initialDisplayValue = this.config.initialDisplayValueConversion(storedValue || null, unit);
|
|
58
|
-
this.displayValueControl.setValue(initialDisplayValue);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* We override the 'setControlValue' we inherited from crisprControlMixin and add our custom logic,
|
|
62
|
-
* This function gets called onInit because were object oriented. it's so great, so great that I'm
|
|
63
|
-
* typing a paragraph to explain what the hell is going on...
|
|
64
|
-
* @param value the initial value for the control passed down from the form components input
|
|
65
|
-
*/
|
|
66
|
-
setControlValue(value) {
|
|
67
|
-
const initialUnitValue = this.config.showUnitSelect
|
|
68
|
-
? this.config?.initialDisplayUnit
|
|
69
|
-
: null;
|
|
70
|
-
this.setInitialDisplayValue(value, initialUnitValue);
|
|
71
|
-
}
|
|
72
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: UnitConversionFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
73
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.3", type: UnitConversionFieldComponent, isStandalone: true, selector: "crispr-unit-conversion-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <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: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\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: 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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { 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.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
74
|
-
}
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: UnitConversionFieldComponent, decorators: [{
|
|
76
|
-
type: Component,
|
|
77
|
-
args: [{ selector: 'crispr-unit-conversion-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
78
|
-
CommonModule,
|
|
79
|
-
InfoComponent,
|
|
80
|
-
OptionComponent,
|
|
81
|
-
ReactiveFormsModule,
|
|
82
|
-
FieldContainerComponent,
|
|
83
|
-
MatInputModule,
|
|
84
|
-
MatSelectModule,
|
|
85
|
-
MatOptionModule,
|
|
86
|
-
FormValidationHandlerModule,
|
|
87
|
-
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <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: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"] }]
|
|
88
|
-
}] });
|
|
89
|
-
|
|
90
|
-
export { UnitConversionFieldComponent };
|
|
91
|
-
//# sourceMappingURL=tft-crispr-forms-index-o78Cm3Kf.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tft-crispr-forms-index-o78Cm3Kf.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/unit-conversion-field/unit-conversion-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/unit-conversion-field/unit-conversion-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { CommonModule } from '@angular/common';\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n OnDestroy,\n} from '@angular/core';\nimport { ReactiveFormsModule, FormControl } from '@angular/forms';\nimport { MatOptionModule } from '@angular/material/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { combineLatest, Observable, Subscription } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { OptionComponent } from '../option';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { InfoComponent } from '../info';\nimport {\n crisprControlMixin,\n CrisprFieldComponent,\n observablifyOptions,\n SelectOption,\n UnitConversionFieldConfig,\n} from '../../utils';\n\nconst defaultConfig: Partial<UnitConversionFieldConfig> = {};\nconst UnitConversionFieldMixin =\n crisprControlMixin<UnitConversionFieldConfig>(CrisprFieldComponent);\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'crispr-unit-conversion-field',\n templateUrl: './unit-conversion-field.component.html',\n styleUrls: ['./unit-conversion-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatInputModule,\n MatSelectModule,\n MatOptionModule,\n FormValidationHandlerModule,\n ],\n})\nexport class UnitConversionFieldComponent\n extends UnitConversionFieldMixin\n implements OnInit, OnDestroy\n{\n defaultConfig = defaultConfig;\n\n displayValueControl = new FormControl();\n unitSelectControl = new FormControl();\n unitOptions$: Observable<SelectOption[]>;\n\n transformationSubscription: Subscription;\n\n ngOnInit() {\n super.ngOnInit();\n // TODO: Validators need work. validation is tricky because the input needs to be validated against but the validator will compare against the controls value\n // this.displayValueControl.setValidators(this.config.validators);\n\n const controlValuePipeline: Observable<string>[] = [\n this.displayValueControl.valueChanges.pipe(\n startWith(this.displayValueControl.value)\n ),\n ];\n // setup all required pieces when showing a field for selecting units\n if (this.config.showUnitSelect) {\n this.unitOptions$ = observablifyOptions(\n this.config.selectableUnits,\n this.group\n );\n controlValuePipeline.push(\n this.unitSelectControl.valueChanges.pipe(\n startWith(this.config?.initialDisplayUnit || null)\n )\n );\n this.unitSelectControl.setValue(this.config?.initialDisplayUnit || null);\n }\n\n this.transformationSubscription = combineLatest(\n controlValuePipeline\n ).subscribe(([displayValue, unitValue]) => {\n const computedValue = this.config.storedValueConversion(\n displayValue,\n unitValue\n );\n this.control.setValue(computedValue);\n });\n }\n\n ngOnDestroy() {\n this.transformationSubscription.unsubscribe();\n }\n\n setInitialDisplayValue(storedValue: any, unit: unknown) {\n const initialDisplayValue = this.config.initialDisplayValueConversion(\n storedValue || null,\n unit\n );\n this.displayValueControl.setValue(initialDisplayValue);\n }\n\n /**\n * We override the 'setControlValue' we inherited from crisprControlMixin and add our custom logic,\n * This function gets called onInit because were object oriented. it's so great, so great that I'm\n * typing a paragraph to explain what the hell is going on...\n * @param value the initial value for the control passed down from the form components input\n */\n setControlValue(value) {\n const initialUnitValue = this.config.showUnitSelect\n ? this.config?.initialDisplayUnit\n : null;\n this.setInitialDisplayValue(value, initialUnitValue);\n }\n}\n","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n"],"names":["i3","i4","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AA0BA,MAAM,aAAa,GAAuC,EAAE,CAAC;AAC7D,MAAM,wBAAwB,GAC5B,kBAAkB,CAA4B,oBAAoB,CAAC,CAAC;AAqBhE,MAAO,4BACX,SAAQ,wBAAwB,CAAA;AApBlC,IAAA,WAAA,GAAA;;QAuBE,IAAa,CAAA,aAAA,GAAG,aAAa,CAAC;AAE9B,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,WAAW,EAAE,CAAC;AACxC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,WAAW,EAAE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,CAAA,EAAA,CAAA;;;;;"}
|
package/index.d.ts
DELETED
package/public-api.d.ts
DELETED
package/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './lib/public_api';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "@angular/common";
|
|
3
|
-
import * as i2 from "@angular/forms";
|
|
4
|
-
import * as i3 from "@tft/form-validation-handler";
|
|
5
|
-
import * as i4 from "./form-group-list/form-group-list.component";
|
|
6
|
-
import * as i5 from "./ui/field-container/field-container.component";
|
|
7
|
-
import * as i6 from "./field.directive";
|
|
8
|
-
import * as i7 from "./display-field.directive";
|
|
9
|
-
import * as i8 from "./sub-group/sub-group.module";
|
|
10
|
-
import * as i9 from "./pipes/crispr-pipes.module";
|
|
11
|
-
import * as i10 from "./form/form.component";
|
|
12
|
-
export declare class CrisprFormsModule {
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CrisprFormsModule, never>;
|
|
14
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CrisprFormsModule, never, [typeof i1.CommonModule, typeof i2.ReactiveFormsModule, typeof i3.FormValidationHandlerModule, typeof i4.FormGroupListComponent, typeof i5.FieldContainerComponent, typeof i6.CrisprFieldDirective, typeof i7.CrisprDisplayFieldDirective, typeof i8.SubGroupModule, typeof i9.CrisprPipesModule, typeof i10.CrisprFormComponent], [typeof i10.CrisprFormComponent, typeof i5.FieldContainerComponent]>;
|
|
15
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<CrisprFormsModule>;
|
|
16
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ViewContainerRef, OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { ControlValue } from './utils';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class CrisprDisplayFieldDirective implements OnInit {
|
|
6
|
-
private container;
|
|
7
|
-
private cdr;
|
|
8
|
-
group: FormGroup;
|
|
9
|
-
/**
|
|
10
|
-
* value setter updates the control's value as well
|
|
11
|
-
*/
|
|
12
|
-
_value: ControlValue | any[];
|
|
13
|
-
set value(value: ControlValue | any[]);
|
|
14
|
-
get value(): ControlValue | any[];
|
|
15
|
-
private component;
|
|
16
|
-
index?: number;
|
|
17
|
-
private componentInstance;
|
|
18
|
-
constructor(container: ViewContainerRef, cdr: ChangeDetectorRef);
|
|
19
|
-
ngOnInit(): Promise<void>;
|
|
20
|
-
updateComponentValue(value: ControlValue | any[]): void;
|
|
21
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CrisprDisplayFieldDirective, never>;
|
|
22
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CrisprDisplayFieldDirective, "[crisprDisplayField]", never, { "group": { "alias": "group"; "required": false; }; "value": { "alias": "value"; "required": false; }; "component": { "alias": "component"; "required": false; }; "index": { "alias": "index"; "required": false; }; }, {}, never, never, true, never>;
|
|
23
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { FormGroupListComponent } from './form-group-list/form-group-list.component';
|
|
2
|
-
import type { SubGroupComponent } from './sub-group/sub-group.component';
|
|
3
|
-
import type { HeadingComponent } from './ui';
|
|
4
|
-
import type { ImageUploadFieldComponent } from './ui/image-upload-field';
|
|
5
|
-
import type { DatepickerFieldComponent } from './ui/datepicker-field';
|
|
6
|
-
import type { CheckboxFieldComponent } from './ui/checkbox-field';
|
|
7
|
-
import type { TextareaFieldComponent } from './ui/textarea-field';
|
|
8
|
-
import type { AutocompleteFieldComponent } from './ui/autocomplete-field';
|
|
9
|
-
import type { SelectFieldComponent } from './ui/select-field';
|
|
10
|
-
import type { InputFieldComponent } from './ui/input-field';
|
|
11
|
-
import type { RadioFieldComponent } from './ui/radio-field';
|
|
12
|
-
import type { FileUploadFieldComponent } from './ui/file-upload-field';
|
|
13
|
-
import type { SliderFieldComponent } from './ui/slider-field';
|
|
14
|
-
import type { DividerComponent } from './ui/divider';
|
|
15
|
-
import type { ButtonComponent } from './ui/button';
|
|
16
|
-
import type { UnitConversionFieldComponent } from './ui/unit-conversion-field';
|
|
17
|
-
import type { AutocompleteChiplistFieldComponent } from './ui/autocomplete-chiplist-field';
|
|
18
|
-
import { MapFieldComponent } from './ui/map';
|
|
19
|
-
export declare const FIELD_COMPONENTS: {
|
|
20
|
-
groupList: () => Promise<typeof FormGroupListComponent>;
|
|
21
|
-
subGroup: () => Promise<typeof SubGroupComponent>;
|
|
22
|
-
button: () => Promise<typeof ButtonComponent>;
|
|
23
|
-
input: () => Promise<typeof InputFieldComponent>;
|
|
24
|
-
select: () => Promise<typeof SelectFieldComponent>;
|
|
25
|
-
radio: () => Promise<typeof RadioFieldComponent>;
|
|
26
|
-
autocomplete: () => Promise<typeof AutocompleteFieldComponent>;
|
|
27
|
-
autocompleteChiplist: () => Promise<typeof AutocompleteChiplistFieldComponent>;
|
|
28
|
-
map: () => Promise<typeof MapFieldComponent>;
|
|
29
|
-
textarea: () => Promise<typeof TextareaFieldComponent>;
|
|
30
|
-
checkbox: () => Promise<typeof CheckboxFieldComponent>;
|
|
31
|
-
slider: () => Promise<typeof SliderFieldComponent>;
|
|
32
|
-
datepicker: () => Promise<typeof DatepickerFieldComponent>;
|
|
33
|
-
fileUpload: () => Promise<typeof FileUploadFieldComponent>;
|
|
34
|
-
imageUpload: () => Promise<typeof ImageUploadFieldComponent>;
|
|
35
|
-
heading: () => Promise<typeof HeadingComponent>;
|
|
36
|
-
divider: () => Promise<typeof DividerComponent>;
|
|
37
|
-
unitConversion: () => Promise<typeof UnitConversionFieldComponent>;
|
|
38
|
-
};
|
|
39
|
-
export declare function isControlComponent(component: CrisprFieldComponentType): component is CrisprControlComponentType;
|
|
40
|
-
export declare function isControlOrButtonComponent(component: CrisprFieldComponentType): component is CrisprControlOrButton;
|
|
41
|
-
export type CrisprControlOrButton = CrisprControlComponentType | ButtonComponent;
|
|
42
|
-
export type CrisprControlComponentType = InputFieldComponent | SelectFieldComponent | RadioFieldComponent | SubGroupComponent | FormGroupListComponent | AutocompleteFieldComponent | AutocompleteChiplistFieldComponent | TextareaFieldComponent | CheckboxFieldComponent | SliderFieldComponent | FileUploadFieldComponent | ImageUploadFieldComponent | DatepickerFieldComponent | UnitConversionFieldComponent | MapFieldComponent;
|
|
43
|
-
export type ComponentKeys = keyof typeof FIELD_COMPONENTS;
|
|
44
|
-
export type CrisprFieldComponentType = CrisprControlComponentType | HeadingComponent | DividerComponent | ButtonComponent;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ViewContainerRef, Renderer2, OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { CrisprFieldComponentType } from './field-component-map.const';
|
|
4
|
-
import { AnyFieldConfig, ControlValue } from './utils';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class CrisprFieldDirective implements OnInit {
|
|
7
|
-
private container;
|
|
8
|
-
private renderer;
|
|
9
|
-
private cdr;
|
|
10
|
-
config: AnyFieldConfig;
|
|
11
|
-
group: FormGroup;
|
|
12
|
-
/**
|
|
13
|
-
* value setter updates the control's value as well
|
|
14
|
-
*/
|
|
15
|
-
_value: ControlValue | any[];
|
|
16
|
-
set value(value: ControlValue | any[]);
|
|
17
|
-
get value(): ControlValue | any[];
|
|
18
|
-
component: CrisprFieldComponentType;
|
|
19
|
-
constructor(container: ViewContainerRef, renderer: Renderer2, cdr: ChangeDetectorRef);
|
|
20
|
-
ngOnInit(): Promise<void>;
|
|
21
|
-
updateComponentValue(value: ControlValue | any[]): void;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CrisprFieldDirective, never>;
|
|
23
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CrisprFieldDirective, "[crisprField]", never, { "config": { "alias": "config"; "required": false; }; "group": { "alias": "group"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, true, never>;
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, ElementRef, OnInit } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { ControlGroupValue, FormConfig } from '../utils';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class CrisprFormComponent implements OnInit {
|
|
7
|
-
config: FormConfig;
|
|
8
|
-
form: FormGroup;
|
|
9
|
-
value: ControlGroupValue;
|
|
10
|
-
submitted: EventEmitter<FormGroup<any>>;
|
|
11
|
-
valueChanges: Observable<any>;
|
|
12
|
-
statusChanges: Observable<string>;
|
|
13
|
-
submitTrigger: ElementRef<HTMLButtonElement>;
|
|
14
|
-
ngOnInit(): void;
|
|
15
|
-
handleSubmit(): void;
|
|
16
|
-
triggerSubmit(): void;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CrisprFormComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CrisprFormComponent, "crispr-form", never, { "config": { "alias": "config"; "required": false; }; "form": { "alias": "form"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "submitted": "submitted"; "valueChanges": "valueChanges"; "statusChanges": "statusChanges"; }, never, never, true, never>;
|
|
19
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { FormGroup, FormArray } from '@angular/forms';
|
|
3
|
-
import { FormGroupListConfig } from '../utils';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
declare const FormGroupListMixin: {
|
|
6
|
-
new (): {
|
|
7
|
-
config: FormGroupListConfig;
|
|
8
|
-
group: FormGroup;
|
|
9
|
-
control: import("@angular/forms").AbstractControl;
|
|
10
|
-
_value: import("../utils").ControlValue;
|
|
11
|
-
value: any;
|
|
12
|
-
ngOnInit(): void;
|
|
13
|
-
setControlValue(value: import("../utils").ControlValue): void;
|
|
14
|
-
defaultConfig?: Partial<FormGroupListConfig>;
|
|
15
|
-
applyDefaultConfig(): void;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare class FormGroupListComponent extends FormGroupListMixin implements OnInit {
|
|
19
|
-
private cdr;
|
|
20
|
-
defaultConfig: Partial<FormGroupListConfig>;
|
|
21
|
-
group: FormGroup;
|
|
22
|
-
control: FormArray;
|
|
23
|
-
/**
|
|
24
|
-
* By setting this to true when adding/removing items from array,
|
|
25
|
-
* we can block original values from overwriting form values
|
|
26
|
-
* */
|
|
27
|
-
blockValue: boolean;
|
|
28
|
-
selectedIndex: number;
|
|
29
|
-
constructor(cdr: ChangeDetectorRef);
|
|
30
|
-
ngOnInit(): void;
|
|
31
|
-
setControlValue(values: any[]): void;
|
|
32
|
-
clickDelete(index: number): void;
|
|
33
|
-
clickAdd(): void;
|
|
34
|
-
addGroup(value?: any): void;
|
|
35
|
-
deleteGroup(index: number): void;
|
|
36
|
-
clickEditItem(index: number): void;
|
|
37
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupListComponent, never>;
|
|
38
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormGroupListComponent, "crispr-form-group-list", never, {}, {}, never, never, true, never>;
|
|
39
|
-
}
|
|
40
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './form-group-list.component';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./initial-control-value.pipe";
|
|
3
|
-
import * as i2 from "@angular/common";
|
|
4
|
-
export declare class CrisprPipesModule {
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CrisprPipesModule, never>;
|
|
6
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CrisprPipesModule, [typeof i1.InitialControlValuePipe], [typeof i2.CommonModule], [typeof i1.InitialControlValuePipe]>;
|
|
7
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<CrisprPipesModule>;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import { ControlValue, AnyFieldConfig } from '../utils';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class InitialControlValuePipe implements PipeTransform {
|
|
5
|
-
transform(initialFormValue: {
|
|
6
|
-
[key: string]: ControlValue | any;
|
|
7
|
-
}, fieldConfig: AnyFieldConfig): unknown;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<InitialControlValuePipe, never>;
|
|
9
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<InitialControlValuePipe, "initialControlValue", false>;
|
|
10
|
-
}
|
package/src/lib/public_api.d.ts
DELETED