@tft/crispr-forms 18.0.2 → 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 +206 -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 -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,190 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Renderer2, viewChild, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { CrisprControlComponent, ControlType, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
4
|
+
import { MapGeocoder, MapInfoWindow, GoogleMap, MapMarker } from '@angular/google-maps';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import { filter, switchMap, map, startWith, merge, BehaviorSubject, of, debounceTime } from 'rxjs';
|
|
8
|
+
import { AsyncPipe } from '@angular/common';
|
|
9
|
+
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
10
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
11
|
+
import { A as AutocompleteFieldComponent } from './tft-crispr-forms-autocomplete-field.component-jdr2Hr6I.mjs';
|
|
12
|
+
import * as i2 from '@angular/cdk/overlay';
|
|
13
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
14
|
+
import { MatFormField, MatLabel } from '@angular/material/form-field';
|
|
15
|
+
import { MatButton } from '@angular/material/button';
|
|
16
|
+
import { MatInput } from '@angular/material/input';
|
|
17
|
+
|
|
18
|
+
const defaultConfig = {
|
|
19
|
+
debounceTime: 500,
|
|
20
|
+
};
|
|
21
|
+
class MapFieldComponent extends CrisprControlComponent {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/**
|
|
25
|
+
* The overlay is positioned to align the top-right corner with the origin's bottom-right corner,
|
|
26
|
+
* and the top-left corner with the origin's bottom-left corner.
|
|
27
|
+
*/
|
|
28
|
+
this.overlayPositions = [
|
|
29
|
+
{
|
|
30
|
+
originX: 'start',
|
|
31
|
+
originY: 'bottom',
|
|
32
|
+
overlayX: 'start',
|
|
33
|
+
overlayY: 'top',
|
|
34
|
+
offsetY: -26
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
originX: 'end',
|
|
38
|
+
originY: 'bottom',
|
|
39
|
+
overlayX: 'end',
|
|
40
|
+
overlayY: 'top',
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
this.geoCoder = inject(MapGeocoder);
|
|
44
|
+
this.renderer = inject(Renderer2);
|
|
45
|
+
this.domSanitizer = inject(DomSanitizer);
|
|
46
|
+
this.infoWindow = viewChild(MapInfoWindow, ...(ngDevMode ? [{ debugName: "infoWindow" }] : []));
|
|
47
|
+
this.selectedMarker = signal(null, ...(ngDevMode ? [{ debugName: "selectedMarker" }] : []));
|
|
48
|
+
this.mapOpen = signal(false, ...(ngDevMode ? [{ debugName: "mapOpen" }] : []));
|
|
49
|
+
this.mapComponent = viewChild(GoogleMap, ...(ngDevMode ? [{ debugName: "mapComponent" }] : []));
|
|
50
|
+
this.defaultConfig = defaultConfig;
|
|
51
|
+
this.locationControl = new FormControl(this.config()?.location);
|
|
52
|
+
this.locationGroup = new FormGroup({
|
|
53
|
+
location: this.locationControl,
|
|
54
|
+
});
|
|
55
|
+
this.locationConfig = {
|
|
56
|
+
controlType: ControlType.AUTOCOMPLETE,
|
|
57
|
+
controlName: 'location',
|
|
58
|
+
label: 'Location',
|
|
59
|
+
placeholder: 'Enter a location',
|
|
60
|
+
options: async (group, searchTerm) => {
|
|
61
|
+
// Add an initial request body.
|
|
62
|
+
if (searchTerm) {
|
|
63
|
+
return new Promise((resolve) => {
|
|
64
|
+
const request = {
|
|
65
|
+
input: searchTerm,
|
|
66
|
+
// locationRestriction: { west: -122.44, north: 37.8, east: -122.39, south: 37.78 },
|
|
67
|
+
// origin: { lat: 37.7893, lng: -122.4039 },
|
|
68
|
+
includedPrimaryTypes: [
|
|
69
|
+
'postal_code',
|
|
70
|
+
'administrative_area_level_2',
|
|
71
|
+
'administrative_area_level_3',
|
|
72
|
+
// 'locality',
|
|
73
|
+
// 'sublocality',
|
|
74
|
+
],
|
|
75
|
+
language: "en-US",
|
|
76
|
+
region: "us",
|
|
77
|
+
// sessionToken: token,
|
|
78
|
+
};
|
|
79
|
+
const options = google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(request)
|
|
80
|
+
.then((response) => response.suggestions.map(suggestion => {
|
|
81
|
+
const option = {
|
|
82
|
+
value: suggestion,
|
|
83
|
+
label: suggestion.placePrediction.text.text
|
|
84
|
+
};
|
|
85
|
+
return option;
|
|
86
|
+
}));
|
|
87
|
+
resolve(options);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
this.inputCenter = this.locationControl.valueChanges.pipe(filter(value => !!value && typeof value !== 'string'), switchMap((value) => {
|
|
94
|
+
const request = {
|
|
95
|
+
address: value.placePrediction.text.text,
|
|
96
|
+
};
|
|
97
|
+
return this.geoCoder.geocode(request);
|
|
98
|
+
}), map((res) => {
|
|
99
|
+
const { geometry } = res.results?.[0] || {};
|
|
100
|
+
const { location } = geometry || {};
|
|
101
|
+
const center = location?.toJSON();
|
|
102
|
+
return center;
|
|
103
|
+
}), startWith(this.config()?.center || undefined));
|
|
104
|
+
this.center = merge;
|
|
105
|
+
this.currentMap = new BehaviorSubject(null);
|
|
106
|
+
this.displayValue = toSignal(toObservable(this.control).pipe(switchMap(control => control
|
|
107
|
+
? control.valueChanges.pipe(startWith(control.value))
|
|
108
|
+
: of('')), map(value => this.getDisplay(value))));
|
|
109
|
+
this.currentMarkers = toSignal(this.currentMap.pipe(debounceTime(500), switchMap((map) => {
|
|
110
|
+
return this.config()?.markers?.(map, this.group()) || of([]);
|
|
111
|
+
})));
|
|
112
|
+
}
|
|
113
|
+
onMapInit(event) {
|
|
114
|
+
this.currentMap.next(event);
|
|
115
|
+
}
|
|
116
|
+
ngOnInit() {
|
|
117
|
+
super.ngOnInit();
|
|
118
|
+
}
|
|
119
|
+
onMarkerClick(clickedMarker) {
|
|
120
|
+
const clickedPosition = clickedMarker.getPosition();
|
|
121
|
+
if (!clickedPosition)
|
|
122
|
+
return;
|
|
123
|
+
// A simple title match is less prone to float precision issues than position
|
|
124
|
+
const originalMarker = this.currentMarkers().find(m => m.title === clickedMarker.getTitle());
|
|
125
|
+
if (originalMarker) {
|
|
126
|
+
this.selectedMarker.set(originalMarker);
|
|
127
|
+
this.infoWindow().open(clickedMarker);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
selectMarker(marker) {
|
|
131
|
+
const valueToSet = marker.value || marker.title;
|
|
132
|
+
this.control().setValue(valueToSet);
|
|
133
|
+
this.closeMap();
|
|
134
|
+
this.infoWindow()?.close();
|
|
135
|
+
}
|
|
136
|
+
onBoundsChanged(bounds) {
|
|
137
|
+
console.log({ bounds });
|
|
138
|
+
}
|
|
139
|
+
onMove(map, group) {
|
|
140
|
+
this.config()?.onMove?.(map, group);
|
|
141
|
+
this.currentMap.next(map);
|
|
142
|
+
}
|
|
143
|
+
async onSelectLocation(suggestion) {
|
|
144
|
+
if (!google.maps.places || !suggestion.place_id)
|
|
145
|
+
return;
|
|
146
|
+
const place = new google.maps.places.Place({ id: suggestion.place_id });
|
|
147
|
+
const location = await place.fetchFields({ fields: ['location'] });
|
|
148
|
+
console.log({ suggestion, location });
|
|
149
|
+
}
|
|
150
|
+
openMap() {
|
|
151
|
+
this.mapOpen.set(true);
|
|
152
|
+
}
|
|
153
|
+
closeMap() {
|
|
154
|
+
this.mapOpen.set(false);
|
|
155
|
+
}
|
|
156
|
+
getDisplay(value) {
|
|
157
|
+
if (typeof value !== 'object' || value === null) {
|
|
158
|
+
return value;
|
|
159
|
+
}
|
|
160
|
+
const displayKey = this.config()?.valueDisplayKey;
|
|
161
|
+
console.log({ value, displayKey, displayValue: value[displayKey] });
|
|
162
|
+
if (displayKey && value[displayKey]) {
|
|
163
|
+
return value[displayKey];
|
|
164
|
+
}
|
|
165
|
+
// Attempt to find a sensible display property
|
|
166
|
+
return value.name || value.title || 'Selected Location';
|
|
167
|
+
}
|
|
168
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: MapFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
169
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: MapFieldComponent, isStandalone: true, selector: "crispr-map", viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true, isSignal: true }, { propertyName: "mapComponent", first: true, predicate: GoogleMap, descendants: true, isSignal: 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 #trigger=\"cdkOverlayOrigin\" (click)=\"openMap()\" cdkOverlayOrigin>\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input matInput [formControlName]=\"config().controlName\" style=\"display:none\">\n <input matInput readonly [value]=\"displayValue() || ''\" [placeholder]=\"config().placeholder\">\n </mat-form-field>\n\n <ng-template cdkConnectedOverlay (overlayOutsideClick)=\"closeMap()\" [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"mapOpen()\" [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\n [cdkConnectedOverlayMinWidth]=\"trigger.elementRef.nativeElement.offsetWidth\" (detach)=\"closeMap()\"\n (backdropClick)=\"closeMap()\">\n <crispr-autocomplete-field class=\"search-field\" [config]=\"locationConfig\" [group]=\"locationGroup\"\n (valueChanges)=\"onSelectLocation($event)\" aria-label=\"Search for a location\">\n </crispr-autocomplete-field>\n <google-map [center]=\"(inputCenter | async) || config().center\" [zoom]=\"11\" [options]=\"config().options\"\n (mapInitialized)=\"onMapInit($event)\" (idle)=\"onMove(map, group())\" #map>\n\n @for (marker of currentMarkers() || []; track $index) {\n <map-marker #markerRef=\"mapMarker\" [position]=\"marker.position\" [title]=\"marker.title\"\n (mapClick)=\"onMarkerClick(markerRef)\">\n </map-marker>\n\n }\n <map-info-window>\n @if(selectedMarker(); as marker) {\n <div class=\"info-window-content\">\n <p>{{ marker.title }}</p>\n <button mat-button (click)=\"selectMarker(marker)\">Select</button>\n </div>\n }\n </map-info-window>\n\n </google-map>\n </ng-template>\n</crispr-field-container>", styles: [":host .marker{background-color:#0ff}.search-field{position:absolute;top:.4rem;left:.4rem;z-index:1000}\n"], dependencies: [{ kind: "component", type: GoogleMap, selector: "google-map", inputs: ["height", "width", "mapId", "mapTypeId", "center", "zoom", "options"], outputs: ["mapInitialized", "authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { kind: "directive", type: MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged", "infoWindowInitialized"], exportAs: ["mapInfoWindow"] }, { kind: "directive", type: MapMarker, selector: "map-marker", inputs: ["title", "position", "label", "clickable", "options", "icon", "visible"], outputs: ["animationChanged", "mapClick", "clickableChanged", "cursorChanged", "mapDblclick", "mapDrag", "mapDragend", "draggableChanged", "mapDragstart", "flatChanged", "iconChanged", "mapMousedown", "mapMouseout", "mapMouseover", "mapMouseup", "positionChanged", "mapRightclick", "shapeChanged", "titleChanged", "visibleChanged", "zindexChanged", "markerInitialized"], exportAs: ["mapMarker"] }, { 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: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: 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: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: AutocompleteFieldComponent, selector: "crispr-autocomplete-field" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "component", type: 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: OverlayModule }, { kind: "directive", type: i2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i2.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
170
|
+
}
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: MapFieldComponent, decorators: [{
|
|
172
|
+
type: Component,
|
|
173
|
+
args: [{ selector: 'crispr-map', imports: [
|
|
174
|
+
GoogleMap,
|
|
175
|
+
MapInfoWindow,
|
|
176
|
+
MapMarker,
|
|
177
|
+
ReactiveFormsModule,
|
|
178
|
+
MatFormField,
|
|
179
|
+
MatInput,
|
|
180
|
+
MatLabel,
|
|
181
|
+
AsyncPipe,
|
|
182
|
+
AutocompleteFieldComponent,
|
|
183
|
+
FieldContainerComponent,
|
|
184
|
+
MatButton,
|
|
185
|
+
OverlayModule
|
|
186
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\"\n #trigger=\"cdkOverlayOrigin\" (click)=\"openMap()\" cdkOverlayOrigin>\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input matInput [formControlName]=\"config().controlName\" style=\"display:none\">\n <input matInput readonly [value]=\"displayValue() || ''\" [placeholder]=\"config().placeholder\">\n </mat-form-field>\n\n <ng-template cdkConnectedOverlay (overlayOutsideClick)=\"closeMap()\" [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"mapOpen()\" [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\n [cdkConnectedOverlayMinWidth]=\"trigger.elementRef.nativeElement.offsetWidth\" (detach)=\"closeMap()\"\n (backdropClick)=\"closeMap()\">\n <crispr-autocomplete-field class=\"search-field\" [config]=\"locationConfig\" [group]=\"locationGroup\"\n (valueChanges)=\"onSelectLocation($event)\" aria-label=\"Search for a location\">\n </crispr-autocomplete-field>\n <google-map [center]=\"(inputCenter | async) || config().center\" [zoom]=\"11\" [options]=\"config().options\"\n (mapInitialized)=\"onMapInit($event)\" (idle)=\"onMove(map, group())\" #map>\n\n @for (marker of currentMarkers() || []; track $index) {\n <map-marker #markerRef=\"mapMarker\" [position]=\"marker.position\" [title]=\"marker.title\"\n (mapClick)=\"onMarkerClick(markerRef)\">\n </map-marker>\n\n }\n <map-info-window>\n @if(selectedMarker(); as marker) {\n <div class=\"info-window-content\">\n <p>{{ marker.title }}</p>\n <button mat-button (click)=\"selectMarker(marker)\">Select</button>\n </div>\n }\n </map-info-window>\n\n </google-map>\n </ng-template>\n</crispr-field-container>", styles: [":host .marker{background-color:#0ff}.search-field{position:absolute;top:.4rem;left:.4rem;z-index:1000}\n"] }]
|
|
187
|
+
}], propDecorators: { infoWindow: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MapInfoWindow), { isSignal: true }] }], mapComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => GoogleMap), { isSignal: true }] }] } });
|
|
188
|
+
|
|
189
|
+
export { MapFieldComponent };
|
|
190
|
+
//# sourceMappingURL=tft-crispr-forms-index-DCRLl0jR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-DCRLl0jR.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/map/map-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/map/map-field.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, OnInit, Renderer2, computed, inject, signal, viewChild } from '@angular/core';\nimport { AutocompleteFieldConfig, ControlType, MapFieldConfig, TftMapMarker } from '../../utils';\nimport { GoogleMap, MapInfoWindow, MapMarker, MapGeocoder, } from '@angular/google-maps';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { BehaviorSubject, debounceTime, filter, map, merge, of, startWith, switchMap } from 'rxjs';\nimport { AsyncPipe, } from '@angular/common';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\nimport { AutocompleteFieldComponent } from \"../autocomplete-field/autocomplete-field.component\";\nimport { ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';\nimport { MatFormField, MatLabel } from '@angular/material/form-field';\nimport { FieldContainerComponent } from '../field-container';\nimport { MatButton } from '@angular/material/button';\nimport { MatInput } from '@angular/material/input';\n\nconst defaultConfig: Partial<MapFieldConfig> = {\n debounceTime: 500,\n};\n\n@Component({\n selector: 'crispr-map',\n imports: [\n GoogleMap,\n MapInfoWindow,\n MapMarker,\n ReactiveFormsModule,\n MatFormField,\n MatInput,\n MatLabel,\n AsyncPipe,\n AutocompleteFieldComponent,\n FieldContainerComponent,\n MatButton,\n OverlayModule\n ],\n templateUrl: './map-field.component.html',\n styleUrl: './map-field.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class MapFieldComponent\n extends CrisprControlComponent<MapFieldConfig>\n implements OnInit\n{\n\n /**\n * The overlay is positioned to align the top-right corner with the origin's bottom-right corner,\n * and the top-left corner with the origin's bottom-left corner.\n */\n overlayPositions: ConnectionPositionPair[] = [\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: -26\n },\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n }\n ];\n geoCoder = inject(MapGeocoder);\n renderer = inject(Renderer2);\n domSanitizer = inject(DomSanitizer);\n \n infoWindow = viewChild(MapInfoWindow);\n selectedMarker = signal<TftMapMarker | null>(null);\n\n mapOpen = signal(false);\n mapComponent = viewChild(GoogleMap);\n defaultConfig = defaultConfig;\n\n locationControl = new FormControl(this.config()?.location);\n locationGroup = new FormGroup({\n location: this.locationControl,\n });\n \n\n locationConfig: AutocompleteFieldConfig = { \n controlType: ControlType.AUTOCOMPLETE,\n controlName: 'location',\n label: 'Location',\n placeholder: 'Enter a location',\n options: async (group, searchTerm) => {\n // Add an initial request body.\n if (searchTerm) {\n return new Promise((resolve) => {\n const request: google.maps.places.AutocompleteRequest = {\n input: searchTerm,\n // locationRestriction: { west: -122.44, north: 37.8, east: -122.39, south: 37.78 },\n // origin: { lat: 37.7893, lng: -122.4039 },\n includedPrimaryTypes: [\n 'postal_code', \n 'administrative_area_level_2', \n 'administrative_area_level_3',\n // 'locality',\n // 'sublocality',\n ],\n language: \"en-US\",\n region: \"us\",\n // sessionToken: token,\n };\n const options = google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(request)\n .then((response) => response.suggestions.map(suggestion => {\n const option = {\n value: suggestion,\n label: suggestion.placePrediction.text.text\n }\n return option;\n }))\n resolve(options)\n })\n }\n return []\n }\n }\n\n inputCenter = this.locationControl.valueChanges.pipe(\n filter(value => !!value && typeof value !== 'string'),\n switchMap((value: google.maps.places.AutocompleteSuggestion) => {\n\n const request: google.maps.GeocoderRequest = {\n address: value.placePrediction.text.text,\n };\n return this.geoCoder.geocode(request);\n }),\n map((res) => {\n const { geometry } = res.results?.[0] || {};\n const { location }= geometry || {};\n const center = location?.toJSON();\n return center;\n }),\n startWith(this.config()?.center || undefined)\n )\n\n center = merge\n\n currentMap = new BehaviorSubject<GoogleMap | null>(null);\n\n displayValue = toSignal(\n toObservable(this.control).pipe(\n switchMap(control => control\n ? control.valueChanges.pipe(startWith(control.value))\n : of('')\n ),\n map(value => this.getDisplay(value))\n )\n ) \n \n currentMarkers = toSignal<TftMapMarker[]>(\n this.currentMap.pipe( \n debounceTime(500),\n switchMap((map) => {\n return this.config()?.markers?.(map, this.group()) || of([]);\n })\n )\n );\n\n\n onMapInit(event: GoogleMap) {\n this.currentMap.next(event);\n }\n ngOnInit() {\n super.ngOnInit();\n }\n\n onMarkerClick(clickedMarker: MapMarker) {\n const clickedPosition = clickedMarker.getPosition();\n if (!clickedPosition) return;\n // A simple title match is less prone to float precision issues than position\n const originalMarker = this.currentMarkers().find(m => m.title === clickedMarker.getTitle());\n\n if (originalMarker) {\n this.selectedMarker.set(originalMarker);\n this.infoWindow().open(clickedMarker);\n } \n }\n\n selectMarker(marker: TftMapMarker) {\n const valueToSet = marker.value || marker.title;\n this.control().setValue(valueToSet);\n this.closeMap();\n this.infoWindow()?.close();\n }\n\n onBoundsChanged(bounds: google.maps.LatLngBounds) {\n console.log({bounds});\n }\n\n onMove(map: GoogleMap, group: FormGroup) {\n this.config()?.onMove?.(map, group);\n this.currentMap.next(map);\n }\n\n async onSelectLocation(suggestion: google.maps.places.AutocompletePrediction) { \n if(!google.maps.places || !suggestion.place_id) return;\n const place = new google.maps.places.Place({id: suggestion.place_id })\n const location = await place.fetchFields({fields: ['location']});\n \n console.log({suggestion, location});\n }\n\n openMap() {\n this.mapOpen.set(true);\n }\n\n closeMap() {\n this.mapOpen.set(false);\n }\n\n getDisplay(value: any): string {\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n const displayKey = this.config()?.valueDisplayKey;\n console.log({value, displayKey, displayValue: value[displayKey]})\n if (displayKey && value[displayKey]) {\n return value[displayKey];\n }\n // Attempt to find a sensible display property\n return value.name || value.title || 'Selected Location';\n }\n}\n\n\ninterface Station {\n location: {\n lat: number;\n lng: number;\n };\n selectedProbability: number;\n selectedFrostTemperature: number;\n averageLastFrostDate: string;\n averageFirstFrostDate: string;\n averageAnnualRainfall: number;\n\n hardinessZone: number;\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\"\n #trigger=\"cdkOverlayOrigin\" (click)=\"openMap()\" cdkOverlayOrigin>\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input matInput [formControlName]=\"config().controlName\" style=\"display:none\">\n <input matInput readonly [value]=\"displayValue() || ''\" [placeholder]=\"config().placeholder\">\n </mat-form-field>\n\n <ng-template cdkConnectedOverlay (overlayOutsideClick)=\"closeMap()\" [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"mapOpen()\" [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\n [cdkConnectedOverlayMinWidth]=\"trigger.elementRef.nativeElement.offsetWidth\" (detach)=\"closeMap()\"\n (backdropClick)=\"closeMap()\">\n <crispr-autocomplete-field class=\"search-field\" [config]=\"locationConfig\" [group]=\"locationGroup\"\n (valueChanges)=\"onSelectLocation($event)\" aria-label=\"Search for a location\">\n </crispr-autocomplete-field>\n <google-map [center]=\"(inputCenter | async) || config().center\" [zoom]=\"11\" [options]=\"config().options\"\n (mapInitialized)=\"onMapInit($event)\" (idle)=\"onMove(map, group())\" #map>\n\n @for (marker of currentMarkers() || []; track $index) {\n <map-marker #markerRef=\"mapMarker\" [position]=\"marker.position\" [title]=\"marker.title\"\n (mapClick)=\"onMarkerClick(markerRef)\">\n </map-marker>\n\n }\n <map-info-window>\n @if(selectedMarker(); as marker) {\n <div class=\"info-window-content\">\n <p>{{ marker.title }}</p>\n <button mat-button (click)=\"selectMarker(marker)\">Select</button>\n </div>\n }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AA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAWJ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBArB7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAAA,OAAA,EACb;wBACL,SAAS;wBACT,aAAa;wBACb,SAAS;wBACT,mBAAmB;wBACnB,YAAY;wBACZ,QAAQ;wBACR,QAAQ;wBACR,SAAS;wBACT,0BAA0B;wBAC1B,uBAAuB;wBACvB,SAAS;wBACT;AACH,qBAAA,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,g9DAAA,EAAA,MAAA,EAAA,CAAA,0GAAA,CAAA,EAAA;AA8BK,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,aAAa,2FAIX,SAAS,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import * as i2 from '@angular/material/form-field';
|
|
6
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
+
import * as i3 from '@angular/material/input';
|
|
8
|
+
import { MatInputModule } from '@angular/material/input';
|
|
9
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
10
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
11
|
+
import { CrisprControlComponent, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
12
|
+
|
|
13
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
14
|
+
const defaultConfig = { rows: 5 };
|
|
15
|
+
class TextareaFieldComponent extends CrisprControlComponent {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.defaultConfig = defaultConfig;
|
|
19
|
+
}
|
|
20
|
+
ngOnInit() {
|
|
21
|
+
super.ngOnInit();
|
|
22
|
+
}
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: TextareaFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: TextareaFieldComponent, isStandalone: true, selector: "crispr-textarea-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <textarea [rows]=\"config().rows\" matInput [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\">\n </textarea>\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && control().valid) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>", styles: [""], dependencies: [{ kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { 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: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
25
|
+
}
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: TextareaFieldComponent, decorators: [{
|
|
27
|
+
type: Component,
|
|
28
|
+
args: [{ selector: 'crispr-textarea-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
29
|
+
InfoComponent,
|
|
30
|
+
ReactiveFormsModule,
|
|
31
|
+
FieldContainerComponent,
|
|
32
|
+
MatFormFieldModule,
|
|
33
|
+
MatInputModule,
|
|
34
|
+
FormValidationHandlerModule
|
|
35
|
+
], standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <textarea [rows]=\"config().rows\" matInput [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\">\n </textarea>\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && control().valid) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>" }]
|
|
36
|
+
}] });
|
|
37
|
+
|
|
38
|
+
export { TextareaFieldComponent };
|
|
39
|
+
//# sourceMappingURL=tft-crispr-forms-index-Dx-HIAiX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-Dx-HIAiX.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/textarea-field/textarea-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/textarea-field/textarea-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport { InfoComponent } from '../info';\nimport {\n TextareaFieldConfig,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<TextareaFieldConfig> = { rows: 5 };\n\n@Component({\n selector: 'crispr-textarea-field',\n templateUrl: './textarea-field.component.html',\n styleUrls: ['./textarea-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n InfoComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatFormFieldModule,\n MatInputModule,\n FormValidationHandlerModule\n ],\n standalone: true\n})\nexport class TextareaFieldComponent\n extends CrisprControlComponent<TextareaFieldConfig>\n implements OnInit\n{\n defaultConfig = defaultConfig;\n\n ngOnInit() {\n super.ngOnInit();\n }\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <textarea [rows]=\"config().rows\" matInput [placeholder]=\"config().placeholder\"\n [formControlName]=\"config().controlName\">\n </textarea>\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && control().valid) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>"],"names":["i4"],"mappings":";;;;;;;;;;;;AAAA;AAcA,MAAM,aAAa,GAAiC,EAAE,IAAI,EAAE,CAAC,EAAE;AAiBzD,MAAO,sBACX,SAAQ,sBAA2C,CAAA;AAhBrD,IAAA,WAAA,GAAA;;QAmBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAK9B,IAAA;IAHC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;IAClB;8GARW,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA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BAClB,cAAc;wBACd;AACH,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,usBAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as i1$1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import { MatOptionModule } from '@angular/material/core';
|
|
8
|
+
import * as i3 from '@angular/material/input';
|
|
9
|
+
import { MatInputModule } from '@angular/material/input';
|
|
10
|
+
import * as i3$1 from '@angular/material/select';
|
|
11
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
12
|
+
import { combineLatest } from 'rxjs';
|
|
13
|
+
import { startWith } from 'rxjs/operators';
|
|
14
|
+
import { O as OptionComponent } from './tft-crispr-forms-index-UAYeTe3L.mjs';
|
|
15
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
16
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
17
|
+
import { CrisprControlComponent, observablifyOptions, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
18
|
+
import * as i2 from '@angular/material/form-field';
|
|
19
|
+
import * as i2$1 from '@angular/material/autocomplete';
|
|
20
|
+
|
|
21
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
22
|
+
const defaultConfig = {};
|
|
23
|
+
class UnitConversionFieldComponent extends CrisprControlComponent {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.defaultConfig = defaultConfig;
|
|
27
|
+
this.displayValueControl = new FormControl();
|
|
28
|
+
this.unitSelectControl = new FormControl();
|
|
29
|
+
}
|
|
30
|
+
ngOnInit() {
|
|
31
|
+
const config = this.config();
|
|
32
|
+
super.ngOnInit();
|
|
33
|
+
// TODO: Validators need work. validation is tricky because the input needs to be validated against but the validator will compare against the controls value
|
|
34
|
+
// this.displayValueControl.setValidators(this.config.validators);
|
|
35
|
+
const controlValuePipeline = [
|
|
36
|
+
this.displayValueControl.valueChanges.pipe(startWith(this.displayValueControl.value)),
|
|
37
|
+
];
|
|
38
|
+
// setup all required pieces when showing a field for selecting units
|
|
39
|
+
if (config.showUnitSelect === true) {
|
|
40
|
+
this.unitOptions$ = observablifyOptions(config.selectableUnits, this.group());
|
|
41
|
+
controlValuePipeline.push(this.unitSelectControl.valueChanges.pipe(startWith(config?.initialDisplayUnit || null)));
|
|
42
|
+
this.unitSelectControl.setValue(config?.initialDisplayUnit || null);
|
|
43
|
+
}
|
|
44
|
+
this.transformationSubscription = combineLatest(controlValuePipeline).subscribe(([displayValue, unitValue]) => {
|
|
45
|
+
const computedValue = this.config().storedValueConversion(displayValue, unitValue);
|
|
46
|
+
this.control().setValue(computedValue);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
ngOnDestroy() {
|
|
50
|
+
this.transformationSubscription.unsubscribe();
|
|
51
|
+
}
|
|
52
|
+
setInitialDisplayValue(storedValue, unit) {
|
|
53
|
+
const initialDisplayValue = this.config().initialDisplayValueConversion(storedValue || null, unit);
|
|
54
|
+
this.displayValueControl.setValue(initialDisplayValue);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* We override the 'setControlValue' we inherited from crisprControlMixin and add our custom logic,
|
|
58
|
+
* This function gets called onInit because were object oriented. it's so great, so great that I'm
|
|
59
|
+
* typing a paragraph to explain what the hell is going on...
|
|
60
|
+
* @param value the initial value for the control passed down from the form components input
|
|
61
|
+
*/
|
|
62
|
+
setControlValue(value) {
|
|
63
|
+
const config = this.config();
|
|
64
|
+
const initialUnitValue = config.showUnitSelect
|
|
65
|
+
? config?.initialDisplayUnit
|
|
66
|
+
: null;
|
|
67
|
+
this.setInitialDisplayValue(value, initialUnitValue);
|
|
68
|
+
}
|
|
69
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: UnitConversionFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: UnitConversionFieldComponent, isStandalone: true, selector: "crispr-unit-conversion-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [style.width.%]=\"config().showUnitSelect ? 60 : 100\" class=\"number-field\" [color]=\"config().color\"\n [appearance]=\"config().appearance\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input type=\"number\" matInput [formControl]=\"displayValueControl\" [placeholder]=\"config().placeholder\"\n [min]=\"config().min\" [max]=\"config().max\" [step]=\"config().step\" [autofocus]=\"config().autofocus\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n </mat-form-field>\n\n @if (config().showUnitSelect) {\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\" class=\"unit-field\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select #selectField [formControl]=\"unitSelectControl\">\n @for (option of unitOptions$ | async; track option) {\n <mat-option [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n </mat-select>\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n </mat-form-field>\n }\n\n</crispr-field-container>", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { 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.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { 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: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { 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.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
71
|
+
}
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: UnitConversionFieldComponent, decorators: [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{ selector: 'crispr-unit-conversion-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
75
|
+
CommonModule,
|
|
76
|
+
InfoComponent,
|
|
77
|
+
OptionComponent,
|
|
78
|
+
ReactiveFormsModule,
|
|
79
|
+
FieldContainerComponent,
|
|
80
|
+
MatInputModule,
|
|
81
|
+
MatSelectModule,
|
|
82
|
+
MatOptionModule,
|
|
83
|
+
FormValidationHandlerModule,
|
|
84
|
+
], standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [style.width.%]=\"config().showUnitSelect ? 60 : 100\" class=\"number-field\" [color]=\"config().color\"\n [appearance]=\"config().appearance\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input type=\"number\" matInput [formControl]=\"displayValueControl\" [placeholder]=\"config().placeholder\"\n [min]=\"config().min\" [max]=\"config().max\" [step]=\"config().step\" [autofocus]=\"config().autofocus\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n </mat-form-field>\n\n @if (config().showUnitSelect) {\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\" class=\"unit-field\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select #selectField [formControl]=\"unitSelectControl\">\n @for (option of unitOptions$ | async; track option) {\n <mat-option [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n </mat-select>\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n </mat-form-field>\n }\n\n</crispr-field-container>", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"] }]
|
|
85
|
+
}] });
|
|
86
|
+
|
|
87
|
+
export { UnitConversionFieldComponent };
|
|
88
|
+
//# sourceMappingURL=tft-crispr-forms-index-Dyx5SqHu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-Dyx5SqHu.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 observablifyOptions,\n SelectOption,\n UnitConversionFieldConfig,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<UnitConversionFieldConfig> = {};\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 imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n ReactiveFormsModule,\n FieldContainerComponent,\n MatInputModule,\n MatSelectModule,\n MatOptionModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class UnitConversionFieldComponent\n extends CrisprControlComponent<UnitConversionFieldConfig>\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 const config = this.config();\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 (config.showUnitSelect === true) {\n this.unitOptions$ = observablifyOptions(\n config.selectableUnits,\n this.group()\n );\n controlValuePipeline.push(\n this.unitSelectControl.valueChanges.pipe(\n startWith(config?.initialDisplayUnit || null)\n )\n );\n this.unitSelectControl.setValue(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 config = this.config();\n const initialUnitValue = config.showUnitSelect\n ? config?.initialDisplayUnit\n : null;\n this.setInitialDisplayValue(value, initialUnitValue);\n }\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n <mat-form-field [style.width.%]=\"config().showUnitSelect ? 60 : 100\" class=\"number-field\" [color]=\"config().color\"\n [appearance]=\"config().appearance\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input type=\"number\" matInput [formControl]=\"displayValueControl\" [placeholder]=\"config().placeholder\"\n [min]=\"config().min\" [max]=\"config().max\" [step]=\"config().step\" [autofocus]=\"config().autofocus\">\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n </mat-form-field>\n\n @if (config().showUnitSelect) {\n <mat-form-field [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\" class=\"unit-field\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select #selectField [formControl]=\"unitSelectControl\">\n @for (option of unitOptions$ | async; track option) {\n <mat-option [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n </mat-select>\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n </mat-form-field>\n }\n\n</crispr-field-container>"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;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/material/select';
|
|
4
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
5
|
+
import * as i1$2 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i1 from '@angular/material/checkbox';
|
|
8
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
9
|
+
import * as i1$1 from '@angular/forms';
|
|
10
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
11
|
+
import * as i2 from '@angular/material/form-field';
|
|
12
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
|
+
import { O as OptionComponent } from './tft-crispr-forms-index-UAYeTe3L.mjs';
|
|
14
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
15
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
16
|
+
import { CrisprControlComponent, observablifyOptions, InfoComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
17
|
+
import * as i2$1 from '@angular/material/autocomplete';
|
|
18
|
+
|
|
19
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
20
|
+
class SelectFieldComponent extends CrisprControlComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.defaultConfig = {
|
|
24
|
+
enableToggleAll: false,
|
|
25
|
+
color: 'primary',
|
|
26
|
+
};
|
|
27
|
+
this.allSelected = false;
|
|
28
|
+
}
|
|
29
|
+
ngOnInit() {
|
|
30
|
+
super.ngOnInit();
|
|
31
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
32
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
33
|
+
this.options$ = observablifyOptions(this.config().options, this.group());
|
|
34
|
+
}
|
|
35
|
+
ngAfterViewInit() {
|
|
36
|
+
if (this.config().multiple &&
|
|
37
|
+
this.config().enableToggleAll &&
|
|
38
|
+
this.selectField.options?.length === this.value()?.length) {
|
|
39
|
+
this.allSelected = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
toggleAll(isSelected) {
|
|
43
|
+
if (isSelected) {
|
|
44
|
+
this.selectField.options.forEach((option) => option.deselect());
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.selectField.options.forEach((option) => option.select());
|
|
48
|
+
}
|
|
49
|
+
this.allSelected = !this.allSelected;
|
|
50
|
+
}
|
|
51
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SelectFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
52
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: SelectFieldComponent, isStandalone: true, selector: "crispr-select-field", viewQueries: [{ propertyName: "selectField", first: true, predicate: ["selectField"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select\n #selectField\n [formControlName]=\"config().controlName\"\n [placeholder]=\"config().placeholder\"\n [multiple]=\"config().multiple\">\n\n @if (config()?.multiple && config().enableToggleAll) {\n <mat-checkbox\n [color]=\"config().color\"\n [checked]=\"allSelected\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n }\n @for (option of options$ | async; track option) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n\n </mat-select>\n\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SelectFieldComponent, decorators: [{
|
|
55
|
+
type: Component,
|
|
56
|
+
args: [{ selector: 'crispr-select-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
57
|
+
CommonModule,
|
|
58
|
+
InfoComponent,
|
|
59
|
+
OptionComponent,
|
|
60
|
+
MatCheckboxModule,
|
|
61
|
+
MatSelectModule,
|
|
62
|
+
ReactiveFormsModule,
|
|
63
|
+
FormValidationHandlerModule,
|
|
64
|
+
FieldContainerComponent,
|
|
65
|
+
MatFormFieldModule,
|
|
66
|
+
], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select\n #selectField\n [formControlName]=\"config().controlName\"\n [placeholder]=\"config().placeholder\"\n [multiple]=\"config().multiple\">\n\n @if (config()?.multiple && config().enableToggleAll) {\n <mat-checkbox\n [color]=\"config().color\"\n [checked]=\"allSelected\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n }\n @for (option of options$ | async; track option) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n\n </mat-select>\n\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"] }]
|
|
67
|
+
}], propDecorators: { selectField: [{
|
|
68
|
+
type: ViewChild,
|
|
69
|
+
args: ['selectField']
|
|
70
|
+
}] } });
|
|
71
|
+
|
|
72
|
+
export { SelectFieldComponent };
|
|
73
|
+
//# sourceMappingURL=tft-crispr-forms-index-LX0Bvkjk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-LX0Bvkjk.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/select-field/select-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/select-field/select-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n ViewChild,\n AfterViewInit,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { MatSelect, MatSelectModule } from '@angular/material/select';\nimport { ThemePalette } from '@angular/material/core';\nimport { CommonModule } from '@angular/common';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { OptionComponent } from '../option';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { InfoComponent } from '../info';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n observablifyOptions,\n SelectFieldConfig,\n SelectOption,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\n@Component({\n selector: 'crispr-select-field',\n templateUrl: './select-field.component.html',\n styleUrls: ['./select-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n InfoComponent,\n OptionComponent,\n MatCheckboxModule,\n MatSelectModule,\n ReactiveFormsModule,\n FormValidationHandlerModule,\n FieldContainerComponent,\n MatFormFieldModule,\n ],\n standalone: true\n})\nexport class SelectFieldComponent\n extends CrisprControlComponent<SelectFieldConfig>\n implements OnInit, AfterViewInit\n{\n defaultConfig = {\n enableToggleAll: false,\n color: 'primary' as ThemePalette,\n };\n options$: Observable<SelectOption[]>;\n allSelected = false;\n\n @ViewChild('selectField') selectField: MatSelect;\n\n ngOnInit() {\n super.ngOnInit();\n // options$ can be passed as an array, promise that resolves array, or observable that resolves array\n // this functions accounts for all possibilities and converts to observable that resolves array\n this.options$ = observablifyOptions(this.config().options, this.group());\n }\n\n ngAfterViewInit() {\n if (\n this.config().multiple &&\n this.config().enableToggleAll &&\n this.selectField.options?.length === (this.value() as any[])?.length\n ) {\n this.allSelected = true;\n }\n }\n\n toggleAll(isSelected: boolean) {\n if (isSelected) {\n this.selectField.options.forEach((option) => option.deselect());\n } else {\n this.selectField.options.forEach((option) => option.select());\n }\n this.allSelected = !this.allSelected;\n }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n\n <mat-form-field\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <mat-select\n #selectField\n [formControlName]=\"config().controlName\"\n [placeholder]=\"config().placeholder\"\n [multiple]=\"config().multiple\">\n\n @if (config()?.multiple && config().enableToggleAll) {\n <mat-checkbox\n [color]=\"config().color\"\n [checked]=\"allSelected\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n }\n @for (option of options$ | async; track option) {\n <mat-option\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n }\n\n </mat-select>\n\n @if (config().fieldSuffix) {<span matSuffix>{{config().fieldSuffix}}</span>}\n @if (config().info) {<crispr-info matSuffix [info]=\"config().info\"></crispr-info>}\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n\n</crispr-field-container>\n"],"names":["i5","i7"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AA6CM,MAAO,oBACX,SAAQ,sBAAyC,CAAA;AAnBnD,IAAA,WAAA,GAAA;;AAsBE,QAAA,IAAA,CAAA,aAAa,GAAG;AACd,YAAA,eAAe,EAAE,KAAK;AACtB,YAAA,KAAK,EAAE,SAAyB;SACjC;QAED,IAAA,CAAA,WAAW,GAAG,KAAK;AA6BpB,IAAA;IAzBC,QAAQ,GAAA;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;IAEA,eAAe,GAAA;AACb,QAAA,IACE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ;AACtB,YAAA,IAAI,CAAC,MAAM,EAAE,CAAC,eAAe;AAC7B,YAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,KAAM,IAAI,CAAC,KAAK,EAAY,EAAE,MAAM,EACpE;AACA,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI;QACzB;IACF;AAEA,IAAA,SAAS,CAAC,UAAmB,EAAA;QAC3B,IAAI,UAAU,EAAE;AACd,YAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC;QACjE;a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A,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,eAAA,EAGd,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACL,YAAY;wBACZ,aAAa;wBACb,eAAe;wBACf,iBAAiB;wBACjB,eAAe;wBACf,mBAAmB;wBACnB,2BAA2B;wBAC3B,uBAAuB;wBACvB,kBAAkB;AACrB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,wwCAAA,EAAA,MAAA,EAAA,CAAA,4CAAA,CAAA,EAAA;;sBAajB,SAAS;uBAAC,aAAa;;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { InfoComponent } from './tft-crispr-forms.mjs';
|
|
4
|
+
|
|
5
|
+
class OptionComponent {
|
|
6
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: OptionComponent, isStandalone: true, selector: "crispr-option", inputs: { option: "option" }, ngImport: i0, template: "<div>\n @if (option.imageUrl) {\n <img\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n }\n {{option.label}}\n</div>\n\n@if (option.info; as info) {\n <crispr-info [info]=\"info\">\n </crispr-info>\n}\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"], dependencies: [{ kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
8
|
+
}
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: OptionComponent, decorators: [{
|
|
10
|
+
type: Component,
|
|
11
|
+
args: [{ selector: 'crispr-option', changeDetection: ChangeDetectionStrategy.OnPush, imports: [InfoComponent], template: "<div>\n @if (option.imageUrl) {\n <img\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n }\n {{option.label}}\n</div>\n\n@if (option.info; as info) {\n <crispr-info [info]=\"info\">\n </crispr-info>\n}\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"] }]
|
|
12
|
+
}], propDecorators: { option: [{
|
|
13
|
+
type: Input
|
|
14
|
+
}] } });
|
|
15
|
+
|
|
16
|
+
export { OptionComponent as O };
|
|
17
|
+
//# sourceMappingURL=tft-crispr-forms-index-UAYeTe3L.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-UAYeTe3L.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/option/option.component.ts","../../../../libs/crispr-forms/src/lib/ui/option/option.component.html"],"sourcesContent":["\nimport { Component, Input, ChangeDetectionStrategy } from '@angular/core';\nimport { InfoComponent } from '../info';\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport { SelectOption } from '../../utils';\n\n@Component({\n selector: 'crispr-option',\n templateUrl: './option.component.html',\n styleUrls: ['./option.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [InfoComponent]\n})\nexport class OptionComponent {\n @Input() option: SelectOption;\n}\n","<div>\n @if (option.imageUrl) {\n <img\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n }\n {{option.label}}\n</div>\n\n@if (option.info; as info) {\n <crispr-info [info]=\"info\">\n </crispr-info>\n}\n"],"names":[],"mappings":";;;;MAaa,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECb5B,iUAgBA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDLc,aAAa,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAEd,eAAe,EAAA,UAAA,EAAA,CAAA;kBAP3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,mBAGR,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,aAAa,CAAC,EAAA,QAAA,EAAA,iUAAA,EAAA,MAAA,EAAA,CAAA,gFAAA,CAAA,EAAA;;sBAGzB;;;;;"}
|