@tft/crispr-forms 14.0.1 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/public-api.mjs +4 -0
- package/{esm2020 → esm2022}/src/index.mjs +1 -1
- package/esm2022/src/lib/crispr-forms.module.mjs +55 -0
- package/esm2022/src/lib/display-field.directive.mjs +52 -0
- package/esm2022/src/lib/field-component-map.const.mjs +28 -0
- package/esm2022/src/lib/field.directive.mjs +69 -0
- package/esm2022/src/lib/form/form.component.mjs +62 -0
- package/esm2022/src/lib/form-group-list/form-group-list.component.mjs +97 -0
- package/{esm2020 → esm2022}/src/lib/form-group-list/index.mjs +1 -1
- package/{esm2020 → esm2022}/src/lib/pipes/crispr-pipes.module.mjs +24 -24
- package/esm2022/src/lib/pipes/initial-control-value.pipe.mjs +20 -0
- package/{esm2020 → esm2022}/src/lib/public_api.mjs +2 -2
- package/{esm2020 → esm2022}/src/lib/sub-group/index.mjs +2 -2
- package/esm2022/src/lib/sub-group/sub-group.component.mjs +20 -0
- package/esm2022/src/lib/sub-group/sub-group.module.mjs +42 -0
- package/esm2022/src/lib/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +138 -0
- package/esm2022/src/lib/ui/autocomplete-chiplist-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/autocomplete-chiplist-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/autocomplete-field/autocomplete-field.component.mjs +95 -0
- package/esm2022/src/lib/ui/autocomplete-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/autocomplete-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/button/button.component.mjs +52 -0
- package/esm2022/src/lib/ui/button/index.mjs +2 -0
- package/esm2022/src/lib/ui/button/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/checkbox-field/checkbox-field.component.mjs +42 -0
- package/esm2022/src/lib/ui/checkbox-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/checkbox-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/datepicker-field/datepicker-field.component.mjs +66 -0
- package/esm2022/src/lib/ui/datepicker-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/datepicker-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/divider/divider.component.mjs +25 -0
- package/esm2022/src/lib/ui/divider/index.mjs +2 -0
- package/esm2022/src/lib/ui/divider/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/field-container/field-container.component.mjs +59 -0
- package/esm2022/src/lib/ui/field-container/index.mjs +2 -0
- package/esm2022/src/lib/ui/field-container/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/file-dropzone/file-dropzone.directive.mjs +40 -0
- package/esm2022/src/lib/ui/file-dropzone/index.mjs +2 -0
- package/esm2022/src/lib/ui/file-dropzone/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/file-upload-field/file-upload-field.component.mjs +107 -0
- package/esm2022/src/lib/ui/file-upload-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/file-upload-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/heading/heading.component.mjs +27 -0
- package/esm2022/src/lib/ui/heading/index.mjs +2 -0
- package/esm2022/src/lib/ui/heading/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/image-upload-field/image-upload-field.component.mjs +184 -0
- package/esm2022/src/lib/ui/image-upload-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/image-upload-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/index.mjs +2 -0
- package/esm2022/src/lib/ui/info/index.mjs +2 -0
- package/esm2022/src/lib/ui/info/info.component.mjs +23 -0
- package/esm2022/src/lib/ui/info/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/input-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/input-field/input-field.component.mjs +43 -0
- package/esm2022/src/lib/ui/input-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/option/index.mjs +2 -0
- package/esm2022/src/lib/ui/option/option.component.mjs +16 -0
- package/esm2022/src/lib/ui/option/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/public-api.mjs +7 -0
- package/esm2022/src/lib/ui/radio-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/radio-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/radio-field/radio-field.component.mjs +39 -0
- package/esm2022/src/lib/ui/select-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/select-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/select-field/select-field.component.mjs +73 -0
- package/esm2022/src/lib/ui/selected-file/index.mjs +2 -0
- package/esm2022/src/lib/ui/selected-file/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/selected-file/selected-file.component.mjs +26 -0
- package/esm2022/src/lib/ui/slider-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/slider-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/slider-field/slider-field.component.mjs +46 -0
- package/esm2022/src/lib/ui/textarea-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/textarea-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/textarea-field/textarea-field.component.mjs +42 -0
- package/esm2022/src/lib/ui/unit-conversion-field/index.mjs +2 -0
- package/esm2022/src/lib/ui/unit-conversion-field/public-api.mjs +2 -0
- package/esm2022/src/lib/ui/unit-conversion-field/unit-conversion-field.component.mjs +86 -0
- package/esm2022/src/lib/utils/abstracts/autocomplete-field.abstract.mjs +30 -0
- package/esm2022/src/lib/utils/abstracts/crispr-control.mixin.mjs +27 -0
- package/esm2022/src/lib/utils/abstracts/crispr-display-field.abstract.mjs +14 -0
- package/esm2022/src/lib/utils/abstracts/crispr-field.abstract.mjs +19 -0
- package/esm2022/src/lib/utils/abstracts/index.mjs +5 -0
- package/esm2022/src/lib/utils/functions/buildFormGroupFromConfig.mjs +28 -0
- package/esm2022/src/lib/utils/functions/callOptionsIfFunction.mjs +4 -0
- package/esm2022/src/lib/utils/functions/createControlForType.mjs +19 -0
- package/esm2022/src/lib/utils/functions/filterOptionsByLabel.mjs +11 -0
- package/esm2022/src/lib/utils/functions/image-compression.helpers.mjs +50 -0
- package/esm2022/src/lib/utils/functions/index.mjs +8 -0
- package/esm2022/src/lib/utils/functions/isControlConfig.mjs +7 -0
- package/esm2022/src/lib/utils/functions/observablifyOptions.mjs +29 -0
- package/esm2022/src/lib/utils/index.mjs +2 -0
- package/esm2022/src/lib/utils/models/autocomplete-chiplist-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/autocomplete-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/button.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/checkbox-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/crispr-field.config.mjs +23 -0
- package/esm2022/src/lib/utils/models/datepicker-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/divider.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/file-upload-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/form-group-list.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/heading.config.mjs +3 -0
- package/esm2022/src/lib/utils/models/image-upload-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/index.mjs +18 -0
- package/esm2022/src/lib/utils/models/input-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/radio-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/select-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/slider-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/textarea-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/models/unit-conversion-field.config.mjs +2 -0
- package/esm2022/src/lib/utils/operators/form.operators.mjs +24 -0
- package/esm2022/src/lib/utils/operators/index.mjs +2 -0
- package/esm2022/src/lib/utils/public-api.mjs +5 -0
- package/esm2022/src/lib/utils/tft-crispr-forms-src-lib-utils.mjs +5 -0
- package/{esm2020 → esm2022}/tft-crispr-forms.mjs +4 -4
- package/fesm2022/tft-crispr-forms-index-2dAn0905.mjs +19 -0
- package/fesm2022/tft-crispr-forms-index-2dAn0905.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-76UuF0AI.mjs +36 -0
- package/fesm2022/tft-crispr-forms-index-76UuF0AI.mjs.map +1 -0
- package/{fesm2020/tft-crispr-forms-ui-image-upload-field.mjs → fesm2022/tft-crispr-forms-index-BXwiulEX.mjs} +169 -169
- package/fesm2022/tft-crispr-forms-index-BXwiulEX.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-BfR4XbYi.mjs +110 -0
- package/fesm2022/tft-crispr-forms-index-BfR4XbYi.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-C5X0mk3N.mjs +49 -0
- package/fesm2022/tft-crispr-forms-index-C5X0mk3N.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CFUop3Cq.mjs +80 -0
- package/fesm2022/tft-crispr-forms-index-CFUop3Cq.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CFdMVgM0.mjs +91 -0
- package/fesm2022/tft-crispr-forms-index-CFdMVgM0.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CZdi06Jj.mjs +49 -0
- package/fesm2022/tft-crispr-forms-index-CZdi06Jj.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-C_I9vjqf.mjs +57 -0
- package/fesm2022/tft-crispr-forms-index-C_I9vjqf.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DE8VOdBd.mjs +102 -0
- package/fesm2022/tft-crispr-forms-index-DE8VOdBd.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-OLo2t0tl.mjs +48 -0
- package/fesm2022/tft-crispr-forms-index-OLo2t0tl.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-OT7kkOgd.mjs +50 -0
- package/fesm2022/tft-crispr-forms-index-OT7kkOgd.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-Ukk3WgS2.mjs +54 -0
- package/fesm2022/tft-crispr-forms-index-Ukk3WgS2.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-rRi6OMY6.mjs +142 -0
- package/fesm2022/tft-crispr-forms-index-rRi6OMY6.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-xAaInTLg.mjs +73 -0
- package/fesm2022/tft-crispr-forms-index-xAaInTLg.mjs.map +1 -0
- package/{fesm2020/tft-crispr-forms-utils.mjs → fesm2022/tft-crispr-forms-src-lib-utils.mjs} +244 -235
- package/fesm2022/tft-crispr-forms-src-lib-utils.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms.mjs +848 -0
- package/fesm2022/tft-crispr-forms.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/package.json +13 -192
- package/public-api.d.ts +3 -3
- package/src/index.d.ts +1 -1
- package/src/lib/crispr-forms.module.d.ts +16 -15
- package/src/lib/display-field.directive.d.ts +23 -0
- package/src/lib/field-component-map.const.d.ts +42 -42
- package/src/lib/field.directive.d.ts +24 -24
- package/src/lib/form/form.component.d.ts +19 -19
- package/src/lib/form-group-list/form-group-list.component.d.ts +40 -36
- package/src/lib/form-group-list/index.d.ts +1 -1
- package/src/lib/pipes/crispr-pipes.module.d.ts +8 -8
- package/src/lib/pipes/initial-control-value.pipe.d.ts +10 -10
- package/src/lib/public_api.d.ts +2 -2
- package/src/lib/sub-group/index.d.ts +2 -2
- package/src/lib/sub-group/sub-group.component.d.ts +24 -22
- package/src/lib/sub-group/sub-group.module.d.ts +12 -12
- package/{ui → src/lib/ui}/autocomplete-chiplist-field/autocomplete-chiplist-field.component.d.ts +36 -33
- package/src/lib/ui/autocomplete-chiplist-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/autocomplete-chiplist-field/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/autocomplete-field/autocomplete-field.component.d.ts +25 -25
- package/src/lib/ui/autocomplete-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/autocomplete-field/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/button/button.component.d.ts +15 -15
- package/src/lib/ui/button/index.d.ts +1 -0
- package/{ui → src/lib/ui}/button/public-api.d.ts +1 -1
- package/src/lib/ui/checkbox-field/checkbox-field.component.d.ts +23 -0
- package/src/lib/ui/checkbox-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/checkbox-field/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/datepicker-field/datepicker-field.component.d.ts +32 -30
- package/src/lib/ui/datepicker-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/datepicker-field/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/divider/divider.component.d.ts +9 -9
- package/src/lib/ui/divider/index.d.ts +1 -0
- package/{ui → src/lib/ui}/divider/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/field-container/field-container.component.d.ts +24 -24
- package/src/lib/ui/field-container/index.d.ts +1 -0
- package/{ui → src/lib/ui}/field-container/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/file-dropzone/file-dropzone.directive.d.ts +10 -10
- package/src/lib/ui/file-dropzone/index.d.ts +1 -0
- package/{ui → src/lib/ui}/file-dropzone/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/file-upload-field/file-upload-field.component.d.ts +39 -37
- package/src/lib/ui/file-upload-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/file-upload-field/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/heading/heading.component.d.ts +8 -8
- package/src/lib/ui/heading/index.d.ts +1 -0
- package/{ui → src/lib/ui}/heading/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/image-upload-field/image-upload-field.component.d.ts +50 -48
- package/src/lib/ui/image-upload-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/image-upload-field/public-api.d.ts +1 -1
- package/src/lib/ui/index.d.ts +1 -0
- package/src/lib/ui/info/index.d.ts +1 -0
- package/{ui → src/lib/ui}/info/info.component.d.ts +7 -7
- package/{ui → src/lib/ui}/info/public-api.d.ts +1 -1
- package/src/lib/ui/input-field/index.d.ts +1 -0
- package/src/lib/ui/input-field/input-field.component.d.ts +24 -0
- package/{ui → src/lib/ui}/input-field/public-api.d.ts +1 -1
- package/src/lib/ui/option/index.d.ts +1 -0
- package/{ui → src/lib/ui}/option/option.component.d.ts +7 -7
- package/{ui → src/lib/ui}/option/public-api.d.ts +1 -1
- package/src/lib/ui/public-api.d.ts +6 -0
- package/src/lib/ui/radio-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/radio-field/public-api.d.ts +1 -1
- package/src/lib/ui/radio-field/radio-field.component.d.ts +25 -0
- package/src/lib/ui/select-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/select-field/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/select-field/select-field.component.d.ts +34 -32
- package/src/lib/ui/selected-file/index.d.ts +1 -0
- package/{ui → src/lib/ui}/selected-file/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/selected-file/selected-file.component.d.ts +10 -10
- package/src/lib/ui/slider-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/slider-field/public-api.d.ts +1 -1
- package/src/lib/ui/slider-field/slider-field.component.d.ts +24 -0
- package/src/lib/ui/textarea-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/textarea-field/public-api.d.ts +1 -1
- package/src/lib/ui/textarea-field/textarea-field.component.d.ts +23 -0
- package/src/lib/ui/unit-conversion-field/index.d.ts +1 -0
- package/{ui → src/lib/ui}/unit-conversion-field/public-api.d.ts +1 -1
- package/{ui → src/lib/ui}/unit-conversion-field/unit-conversion-field.component.d.ts +38 -36
- package/{utils → src/lib/utils}/abstracts/autocomplete-field.abstract.d.ts +28 -28
- package/{utils → src/lib/utils}/abstracts/crispr-control.mixin.d.ts +16 -16
- package/src/lib/utils/abstracts/crispr-display-field.abstract.d.ts +22 -0
- package/{utils → src/lib/utils}/abstracts/crispr-field.abstract.d.ts +11 -11
- package/{utils → src/lib/utils}/abstracts/index.d.ts +4 -3
- package/{utils → src/lib/utils}/functions/buildFormGroupFromConfig.d.ts +9 -9
- package/{utils → src/lib/utils}/functions/callOptionsIfFunction.d.ts +3 -3
- package/{utils → src/lib/utils}/functions/createControlForType.d.ts +9 -9
- package/{utils → src/lib/utils}/functions/filterOptionsByLabel.d.ts +7 -7
- package/{utils → src/lib/utils}/functions/image-compression.helpers.d.ts +5 -5
- package/{utils → src/lib/utils}/functions/index.d.ts +7 -7
- package/{utils → src/lib/utils}/functions/isControlConfig.d.ts +5 -5
- package/{utils → src/lib/utils}/functions/observablifyOptions.d.ts +12 -12
- package/{ui → src/lib/utils}/index.d.ts +5 -5
- package/{utils → src/lib/utils}/models/autocomplete-chiplist-field.config.d.ts +20 -20
- package/{utils → src/lib/utils}/models/autocomplete-field.config.d.ts +14 -14
- package/{utils → src/lib/utils}/models/button.config.d.ts +17 -17
- package/{utils → src/lib/utils}/models/checkbox-field.config.d.ts +6 -6
- package/{utils → src/lib/utils}/models/crispr-field.config.d.ts +97 -94
- package/{utils → src/lib/utils}/models/datepicker-field.config.d.ts +20 -20
- package/{utils → src/lib/utils}/models/divider.config.d.ts +5 -5
- package/{utils → src/lib/utils}/models/file-upload-field.config.d.ts +33 -33
- package/{utils → src/lib/utils}/models/form-group-list.config.d.ts +18 -17
- package/{utils → src/lib/utils}/models/heading.config.d.ts +6 -6
- package/{utils → src/lib/utils}/models/image-upload-field.config.d.ts +54 -54
- package/{utils → src/lib/utils}/models/index.d.ts +17 -17
- package/{utils → src/lib/utils}/models/input-field.config.d.ts +16 -16
- package/{utils → src/lib/utils}/models/radio-field.config.d.ts +6 -6
- package/{utils → src/lib/utils}/models/select-field.config.d.ts +21 -21
- package/{utils → src/lib/utils}/models/slider-field.config.d.ts +11 -13
- package/{utils → src/lib/utils}/models/textarea-field.config.d.ts +5 -5
- package/{utils → src/lib/utils}/models/unit-conversion-field.config.d.ts +30 -30
- package/{utils → src/lib/utils}/operators/form.operators.d.ts +1 -1
- package/{utils → src/lib/utils}/operators/index.d.ts +1 -1
- package/{utils → src/lib/utils}/public-api.d.ts +4 -4
- package/tft-crispr-forms-15.0.0.tgz +0 -0
- package/esm2020/public-api.mjs +0 -5
- package/esm2020/src/lib/crispr-forms.module.mjs +0 -57
- package/esm2020/src/lib/field-component-map.const.mjs +0 -27
- package/esm2020/src/lib/field.directive.mjs +0 -69
- package/esm2020/src/lib/form/form.component.mjs +0 -63
- package/esm2020/src/lib/form-group-list/form-group-list.component.mjs +0 -93
- package/esm2020/src/lib/pipes/initial-control-value.pipe.mjs +0 -21
- package/esm2020/src/lib/sub-group/sub-group.component.mjs +0 -21
- package/esm2020/src/lib/sub-group/sub-group.module.mjs +0 -42
- package/esm2020/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +0 -130
- package/esm2020/ui/autocomplete-chiplist-field/public-api.mjs +0 -2
- package/esm2020/ui/autocomplete-chiplist-field/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +0 -5
- package/esm2020/ui/autocomplete-field/autocomplete-field.component.mjs +0 -93
- package/esm2020/ui/autocomplete-field/public-api.mjs +0 -2
- package/esm2020/ui/autocomplete-field/tft-crispr-forms-ui-autocomplete-field.mjs +0 -5
- package/esm2020/ui/button/button.component.mjs +0 -49
- package/esm2020/ui/button/public-api.mjs +0 -2
- package/esm2020/ui/button/tft-crispr-forms-ui-button.mjs +0 -5
- package/esm2020/ui/checkbox-field/checkbox-field.component.mjs +0 -42
- package/esm2020/ui/checkbox-field/public-api.mjs +0 -2
- package/esm2020/ui/checkbox-field/tft-crispr-forms-ui-checkbox-field.mjs +0 -5
- package/esm2020/ui/datepicker-field/datepicker-field.component.mjs +0 -63
- package/esm2020/ui/datepicker-field/public-api.mjs +0 -2
- package/esm2020/ui/datepicker-field/tft-crispr-forms-ui-datepicker-field.mjs +0 -5
- package/esm2020/ui/divider/divider.component.mjs +0 -28
- package/esm2020/ui/divider/public-api.mjs +0 -2
- package/esm2020/ui/divider/tft-crispr-forms-ui-divider.mjs +0 -5
- package/esm2020/ui/field-container/field-container.component.mjs +0 -58
- package/esm2020/ui/field-container/public-api.mjs +0 -2
- package/esm2020/ui/field-container/tft-crispr-forms-ui-field-container.mjs +0 -5
- package/esm2020/ui/file-dropzone/file-dropzone.directive.mjs +0 -40
- package/esm2020/ui/file-dropzone/public-api.mjs +0 -2
- package/esm2020/ui/file-dropzone/tft-crispr-forms-ui-file-dropzone.mjs +0 -5
- package/esm2020/ui/file-upload-field/file-upload-field.component.mjs +0 -108
- package/esm2020/ui/file-upload-field/public-api.mjs +0 -2
- package/esm2020/ui/file-upload-field/tft-crispr-forms-ui-file-upload-field.mjs +0 -5
- package/esm2020/ui/heading/heading.component.mjs +0 -31
- package/esm2020/ui/heading/public-api.mjs +0 -2
- package/esm2020/ui/heading/tft-crispr-forms-ui-heading.mjs +0 -5
- package/esm2020/ui/image-upload-field/image-upload-field.component.mjs +0 -179
- package/esm2020/ui/image-upload-field/public-api.mjs +0 -2
- package/esm2020/ui/image-upload-field/tft-crispr-forms-ui-image-upload-field.mjs +0 -5
- package/esm2020/ui/info/info.component.mjs +0 -23
- package/esm2020/ui/info/public-api.mjs +0 -2
- package/esm2020/ui/info/tft-crispr-forms-ui-info.mjs +0 -5
- package/esm2020/ui/input-field/input-field.component.mjs +0 -41
- package/esm2020/ui/input-field/public-api.mjs +0 -2
- package/esm2020/ui/input-field/tft-crispr-forms-ui-input-field.mjs +0 -5
- package/esm2020/ui/option/option.component.mjs +0 -19
- package/esm2020/ui/option/public-api.mjs +0 -2
- package/esm2020/ui/option/tft-crispr-forms-ui-option.mjs +0 -5
- package/esm2020/ui/public-api.mjs +0 -7
- package/esm2020/ui/radio-field/public-api.mjs +0 -2
- package/esm2020/ui/radio-field/radio-field.component.mjs +0 -39
- package/esm2020/ui/radio-field/tft-crispr-forms-ui-radio-field.mjs +0 -5
- package/esm2020/ui/select-field/public-api.mjs +0 -2
- package/esm2020/ui/select-field/select-field.component.mjs +0 -73
- package/esm2020/ui/select-field/tft-crispr-forms-ui-select-field.mjs +0 -5
- package/esm2020/ui/selected-file/public-api.mjs +0 -2
- package/esm2020/ui/selected-file/selected-file.component.mjs +0 -26
- package/esm2020/ui/selected-file/tft-crispr-forms-ui-selected-file.mjs +0 -5
- package/esm2020/ui/slider-field/public-api.mjs +0 -2
- package/esm2020/ui/slider-field/slider-field.component.mjs +0 -44
- package/esm2020/ui/slider-field/tft-crispr-forms-ui-slider-field.mjs +0 -5
- package/esm2020/ui/textarea-field/public-api.mjs +0 -2
- package/esm2020/ui/textarea-field/textarea-field.component.mjs +0 -42
- package/esm2020/ui/textarea-field/tft-crispr-forms-ui-textarea-field.mjs +0 -5
- package/esm2020/ui/tft-crispr-forms-ui.mjs +0 -5
- package/esm2020/ui/unit-conversion-field/public-api.mjs +0 -2
- package/esm2020/ui/unit-conversion-field/tft-crispr-forms-ui-unit-conversion-field.mjs +0 -5
- package/esm2020/ui/unit-conversion-field/unit-conversion-field.component.mjs +0 -84
- package/esm2020/utils/abstracts/autocomplete-field.abstract.mjs +0 -30
- package/esm2020/utils/abstracts/crispr-control.mixin.mjs +0 -27
- package/esm2020/utils/abstracts/crispr-field.abstract.mjs +0 -20
- package/esm2020/utils/abstracts/index.mjs +0 -4
- package/esm2020/utils/functions/buildFormGroupFromConfig.mjs +0 -28
- package/esm2020/utils/functions/callOptionsIfFunction.mjs +0 -4
- package/esm2020/utils/functions/createControlForType.mjs +0 -19
- package/esm2020/utils/functions/filterOptionsByLabel.mjs +0 -11
- package/esm2020/utils/functions/image-compression.helpers.mjs +0 -50
- package/esm2020/utils/functions/index.mjs +0 -8
- package/esm2020/utils/functions/isControlConfig.mjs +0 -7
- package/esm2020/utils/functions/observablifyOptions.mjs +0 -29
- package/esm2020/utils/models/autocomplete-chiplist-field.config.mjs +0 -2
- package/esm2020/utils/models/autocomplete-field.config.mjs +0 -2
- package/esm2020/utils/models/button.config.mjs +0 -2
- package/esm2020/utils/models/checkbox-field.config.mjs +0 -2
- package/esm2020/utils/models/crispr-field.config.mjs +0 -23
- package/esm2020/utils/models/datepicker-field.config.mjs +0 -2
- package/esm2020/utils/models/divider.config.mjs +0 -2
- package/esm2020/utils/models/file-upload-field.config.mjs +0 -2
- package/esm2020/utils/models/form-group-list.config.mjs +0 -2
- package/esm2020/utils/models/heading.config.mjs +0 -3
- package/esm2020/utils/models/image-upload-field.config.mjs +0 -2
- package/esm2020/utils/models/index.mjs +0 -18
- package/esm2020/utils/models/input-field.config.mjs +0 -2
- package/esm2020/utils/models/radio-field.config.mjs +0 -2
- package/esm2020/utils/models/select-field.config.mjs +0 -2
- package/esm2020/utils/models/slider-field.config.mjs +0 -2
- package/esm2020/utils/models/textarea-field.config.mjs +0 -2
- package/esm2020/utils/models/unit-conversion-field.config.mjs +0 -2
- package/esm2020/utils/operators/form.operators.mjs +0 -24
- package/esm2020/utils/operators/index.mjs +0 -2
- package/esm2020/utils/public-api.mjs +0 -5
- package/esm2020/utils/tft-crispr-forms-utils.mjs +0 -5
- package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +0 -138
- package/fesm2015/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs +0 -101
- package/fesm2015/tft-crispr-forms-ui-autocomplete-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-button.mjs +0 -55
- package/fesm2015/tft-crispr-forms-ui-button.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs +0 -49
- package/fesm2015/tft-crispr-forms-ui-checkbox-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs +0 -71
- package/fesm2015/tft-crispr-forms-ui-datepicker-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-divider.mjs +0 -34
- package/fesm2015/tft-crispr-forms-ui-divider.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-field-container.mjs +0 -64
- package/fesm2015/tft-crispr-forms-ui-field-container.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs +0 -47
- package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs +0 -117
- package/fesm2015/tft-crispr-forms-ui-file-upload-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-heading.mjs +0 -37
- package/fesm2015/tft-crispr-forms-ui-heading.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs +0 -182
- package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-info.mjs +0 -30
- package/fesm2015/tft-crispr-forms-ui-info.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-input-field.mjs +0 -48
- package/fesm2015/tft-crispr-forms-ui-input-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-option.mjs +0 -26
- package/fesm2015/tft-crispr-forms-ui-option.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-radio-field.mjs +0 -46
- package/fesm2015/tft-crispr-forms-ui-radio-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-select-field.mjs +0 -81
- package/fesm2015/tft-crispr-forms-ui-select-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-selected-file.mjs +0 -33
- package/fesm2015/tft-crispr-forms-ui-selected-file.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-slider-field.mjs +0 -51
- package/fesm2015/tft-crispr-forms-ui-slider-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs +0 -49
- package/fesm2015/tft-crispr-forms-ui-textarea-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs +0 -93
- package/fesm2015/tft-crispr-forms-ui-unit-conversion-field.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-ui.mjs +0 -12
- package/fesm2015/tft-crispr-forms-ui.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms-utils.mjs +0 -270
- package/fesm2015/tft-crispr-forms-utils.mjs.map +0 -1
- package/fesm2015/tft-crispr-forms.mjs +0 -379
- package/fesm2015/tft-crispr-forms.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs +0 -137
- package/fesm2020/tft-crispr-forms-ui-autocomplete-chiplist-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs +0 -100
- package/fesm2020/tft-crispr-forms-ui-autocomplete-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-button.mjs +0 -55
- package/fesm2020/tft-crispr-forms-ui-button.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs +0 -49
- package/fesm2020/tft-crispr-forms-ui-checkbox-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs +0 -70
- package/fesm2020/tft-crispr-forms-ui-datepicker-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-divider.mjs +0 -34
- package/fesm2020/tft-crispr-forms-ui-divider.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-field-container.mjs +0 -65
- package/fesm2020/tft-crispr-forms-ui-field-container.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs +0 -47
- package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs +0 -115
- package/fesm2020/tft-crispr-forms-ui-file-upload-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-heading.mjs +0 -37
- package/fesm2020/tft-crispr-forms-ui-heading.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-info.mjs +0 -30
- package/fesm2020/tft-crispr-forms-ui-info.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-input-field.mjs +0 -48
- package/fesm2020/tft-crispr-forms-ui-input-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-option.mjs +0 -26
- package/fesm2020/tft-crispr-forms-ui-option.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-radio-field.mjs +0 -46
- package/fesm2020/tft-crispr-forms-ui-radio-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-select-field.mjs +0 -80
- package/fesm2020/tft-crispr-forms-ui-select-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-selected-file.mjs +0 -33
- package/fesm2020/tft-crispr-forms-ui-selected-file.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-slider-field.mjs +0 -51
- package/fesm2020/tft-crispr-forms-ui-slider-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs +0 -49
- package/fesm2020/tft-crispr-forms-ui-textarea-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs +0 -91
- package/fesm2020/tft-crispr-forms-ui-unit-conversion-field.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-ui.mjs +0 -12
- package/fesm2020/tft-crispr-forms-ui.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms-utils.mjs.map +0 -1
- package/fesm2020/tft-crispr-forms.mjs +0 -377
- package/fesm2020/tft-crispr-forms.mjs.map +0 -1
- package/tft-crispr-forms-14.0.1.tgz +0 -0
- package/ui/README.md +0 -3
- package/ui/autocomplete-chiplist-field/index.d.ts +0 -5
- package/ui/autocomplete-field/index.d.ts +0 -5
- package/ui/button/index.d.ts +0 -5
- package/ui/checkbox-field/checkbox-field.component.d.ts +0 -21
- package/ui/checkbox-field/index.d.ts +0 -5
- package/ui/datepicker-field/index.d.ts +0 -5
- package/ui/divider/index.d.ts +0 -5
- package/ui/field-container/index.d.ts +0 -5
- package/ui/file-dropzone/index.d.ts +0 -5
- package/ui/file-upload-field/index.d.ts +0 -5
- package/ui/heading/index.d.ts +0 -5
- package/ui/image-upload-field/index.d.ts +0 -5
- package/ui/info/index.d.ts +0 -5
- package/ui/input-field/index.d.ts +0 -5
- package/ui/input-field/input-field.component.d.ts +0 -22
- package/ui/option/index.d.ts +0 -5
- package/ui/public-api.d.ts +0 -5
- package/ui/radio-field/index.d.ts +0 -5
- package/ui/radio-field/radio-field.component.d.ts +0 -23
- package/ui/select-field/index.d.ts +0 -5
- package/ui/selected-file/index.d.ts +0 -5
- package/ui/slider-field/index.d.ts +0 -5
- package/ui/slider-field/slider-field.component.d.ts +0 -25
- package/ui/textarea-field/index.d.ts +0 -5
- package/ui/textarea-field/textarea-field.component.d.ts +0 -21
- package/ui/unit-conversion-field/index.d.ts +0 -5
- package/utils/index.d.ts +0 -5
- /package/{utils → src/lib/utils}/README.md +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/material/datepicker';
|
|
4
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
5
|
+
import { MatDateFnsModule } from '@angular/material-date-fns-adapter';
|
|
6
|
+
import { of } from 'rxjs';
|
|
7
|
+
import * as i6 from '@angular/cdk/portal';
|
|
8
|
+
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
9
|
+
import * as i3 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
+
import * as i1 from '@angular/common';
|
|
12
|
+
import { CommonModule } from '@angular/common';
|
|
13
|
+
import * as i2$1 from '@angular/forms';
|
|
14
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
15
|
+
import * as i5 from '@angular/material/input';
|
|
16
|
+
import { MatInputModule } from '@angular/material/input';
|
|
17
|
+
import * as i7 from '@tft/form-validation-handler';
|
|
18
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
19
|
+
import { crisprControlMixin, CrisprFieldComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
20
|
+
import 'rxjs/operators';
|
|
21
|
+
import '@angular/material/button';
|
|
22
|
+
import '@angular/material/icon';
|
|
23
|
+
import '@angular/material/progress-bar';
|
|
24
|
+
import '@angular/material/tooltip';
|
|
25
|
+
|
|
26
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
27
|
+
const defaultConfig = {
|
|
28
|
+
startView: 'month',
|
|
29
|
+
};
|
|
30
|
+
const DatepickerFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
31
|
+
class DatepickerFieldComponent extends DatepickerFieldMixin {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
this.defaultConfig = defaultConfig;
|
|
35
|
+
}
|
|
36
|
+
ngOnInit() {
|
|
37
|
+
super.ngOnInit();
|
|
38
|
+
this.startAt$ =
|
|
39
|
+
this.config.startAt instanceof Date
|
|
40
|
+
? of(this.config.startAt)
|
|
41
|
+
: this.config.startAt instanceof Function
|
|
42
|
+
? this.config.startAt(this.group)
|
|
43
|
+
: of(null);
|
|
44
|
+
this.dateClass = this.config?.cellClassFunction || null;
|
|
45
|
+
this.dateClass$ = this.config.dateClass
|
|
46
|
+
? this.config?.dateClass(this.group)
|
|
47
|
+
: of(() => '');
|
|
48
|
+
}
|
|
49
|
+
ngAfterContentInit() {
|
|
50
|
+
if (this.config.datepickerActions) {
|
|
51
|
+
this.calendarFooterPortal = new ComponentPortal(this.config.datepickerActions);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: DatepickerFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
55
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.9", type: DatepickerFieldComponent, isStandalone: true, selector: "crispr-datepicker-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n matInput\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config.datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config.touchUi\"\n [startView]=\"config.startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n <mat-datepicker-actions *ngIf=\"calendarFooterPortal\">\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n</crispr-field-container>\n\n", styles: [""], 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: MatDatepickerModule }, { kind: "component", type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "ngmodule", type: MatFormFieldModule }, { 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: ReactiveFormsModule }, { kind: "directive", type: i2$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { 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: "ngmodule", type: MatDateFnsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { 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 }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: DatepickerFieldComponent, decorators: [{
|
|
58
|
+
type: Component,
|
|
59
|
+
args: [{ selector: 'crispr-datepicker-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
60
|
+
CommonModule,
|
|
61
|
+
FieldContainerComponent,
|
|
62
|
+
MatDatepickerModule,
|
|
63
|
+
MatFormFieldModule,
|
|
64
|
+
ReactiveFormsModule,
|
|
65
|
+
MatInputModule,
|
|
66
|
+
MatDateFnsModule,
|
|
67
|
+
PortalModule,
|
|
68
|
+
FormValidationHandlerModule,
|
|
69
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n matInput\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config.datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config.touchUi\"\n [startView]=\"config.startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n <mat-datepicker-actions *ngIf=\"calendarFooterPortal\">\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n</crispr-field-container>\n\n" }]
|
|
70
|
+
}] });
|
|
71
|
+
|
|
72
|
+
export { DatepickerFieldComponent };
|
|
73
|
+
//# sourceMappingURL=tft-crispr-forms-index-xAaInTLg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-xAaInTLg.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n AfterContentInit,\n} from '@angular/core';\nimport {\n MatCalendarCellClassFunction,\n MatDatepickerModule,\n} from '@angular/material/datepicker';\nimport { MatDateFnsModule } from '@angular/material-date-fns-adapter';\nimport { Observable, of } from 'rxjs';\nimport { ComponentPortal, Portal, PortalModule } from '@angular/cdk/portal';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatInputModule } from '@angular/material/input';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n crisprControlMixin,\n CrisprFieldComponent,\n DatepickerFieldConfig,\n} from '../../utils';\n\nconst defaultConfig: Partial<DatepickerFieldConfig> = {\n startView: 'month',\n};\nconst DatepickerFieldMixin =\n crisprControlMixin<DatepickerFieldConfig>(CrisprFieldComponent);\n\n@Component({\n selector: 'crispr-datepicker-field',\n templateUrl: './datepicker-field.component.html',\n styleUrls: ['./datepicker-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n CommonModule,\n FieldContainerComponent,\n MatDatepickerModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDateFnsModule,\n PortalModule,\n FormValidationHandlerModule,\n ],\n})\nexport class DatepickerFieldComponent\n extends DatepickerFieldMixin\n implements OnInit, AfterContentInit\n{\n defaultConfig = defaultConfig;\n\n dateClass: MatCalendarCellClassFunction<Date>;\n dateClass$: Observable<MatCalendarCellClassFunction<Date>>;\n startAt$: Observable<Date>;\n\n /** A portal containing the footer component type for this calendar. */\n calendarFooterPortal: Portal<any>;\n\n ngOnInit() {\n super.ngOnInit();\n this.startAt$ =\n this.config.startAt instanceof Date\n ? of(this.config.startAt)\n : this.config.startAt instanceof Function\n ? this.config.startAt(this.group)\n : of(null);\n this.dateClass = this.config?.cellClassFunction || null;\n this.dateClass$ = this.config.dateClass\n ? this.config?.dateClass(this.group)\n : of(() => '');\n }\n\n ngAfterContentInit() {\n if (this.config.datepickerActions) {\n this.calendarFooterPortal = new ComponentPortal(\n this.config.datepickerActions\n );\n }\n }\n\n // handleSelectedChange(event, picker: MatDatepicker<unknown>) {\n // console.log({event, picker})\n // if(this.config.selectedChange) {\n // this.config.selectedChange(event, picker);\n // }\n // }\n}\n","<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n matInput\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config.datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config.touchUi\"\n [startView]=\"config.startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n <mat-datepicker-actions *ngIf=\"calendarFooterPortal\">\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n </mat-datepicker>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n</crispr-field-container>\n\n"],"names":[],"mappings":"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"}
|
|
@@ -1,269 +1,278 @@
|
|
|
1
1
|
import { map, startWith, debounceTime, distinctUntilChanged, switchMap, shareReplay } from 'rxjs/operators';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Directive } from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
|
5
5
|
import { from, of, isObservable } from 'rxjs';
|
|
6
6
|
|
|
7
|
-
function valueIn(values) {
|
|
8
|
-
return map((value) => {
|
|
9
|
-
if (value) {
|
|
10
|
-
return values.some(v => {
|
|
11
|
-
if (isRegex(v)) {
|
|
12
|
-
const trimmedStringForRegex = v.substr(1, v.length - 2);
|
|
13
|
-
const regex = new RegExp(trimmedStringForRegex);
|
|
14
|
-
return regex.test(value);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return v === value;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function isRegex(string) {
|
|
27
|
-
return string.startsWith('/') && string.endsWith('/');
|
|
7
|
+
function valueIn(values) {
|
|
8
|
+
return map((value) => {
|
|
9
|
+
if (value) {
|
|
10
|
+
return values.some(v => {
|
|
11
|
+
if (isRegex(v)) {
|
|
12
|
+
const trimmedStringForRegex = v.substr(1, v.length - 2);
|
|
13
|
+
const regex = new RegExp(trimmedStringForRegex);
|
|
14
|
+
return regex.test(value);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return v === value;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function isRegex(string) {
|
|
27
|
+
return string.startsWith('/') && string.endsWith('/');
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const DEFAULT_EMPTY_OPTIONS_MESSAGE = 'No Items';
|
|
31
31
|
|
|
32
|
-
// export type ControlType = keyof typeof FIELD_COMPONENTS;
|
|
33
|
-
var ControlType;
|
|
34
|
-
(function (ControlType) {
|
|
35
|
-
ControlType["AUTOCOMPLETE"] = "autocomplete";
|
|
36
|
-
ControlType["AUTOCOMPLETE_CHIPLIST"] = "autocompleteChiplist";
|
|
37
|
-
ControlType["BUTTON"] = "button";
|
|
38
|
-
ControlType["CHECKBOX"] = "checkbox";
|
|
39
|
-
ControlType["CUSTOM"] = "custom";
|
|
40
|
-
ControlType["DATEPICKER"] = "datepicker";
|
|
41
|
-
ControlType["DIVIDER"] = "divider";
|
|
42
|
-
ControlType["FILE_UPLOAD"] = "fileUpload";
|
|
43
|
-
ControlType["HEADING"] = "heading";
|
|
44
|
-
ControlType["INPUT"] = "input";
|
|
45
|
-
ControlType["IMAGE_UPLOAD"] = "imageUpload";
|
|
46
|
-
ControlType["GROUP_LIST"] = "groupList";
|
|
47
|
-
ControlType["RADIO"] = "radio";
|
|
48
|
-
ControlType["SELECT"] = "select";
|
|
49
|
-
ControlType["SLIDER"] = "slider";
|
|
50
|
-
ControlType["SUB_GROUP"] = "subGroup";
|
|
51
|
-
ControlType["TEXTAREA"] = "textarea";
|
|
52
|
-
ControlType["UNIT_CONVERSION"] = "unitConversion";
|
|
32
|
+
// export type ControlType = keyof typeof FIELD_COMPONENTS;
|
|
33
|
+
var ControlType;
|
|
34
|
+
(function (ControlType) {
|
|
35
|
+
ControlType["AUTOCOMPLETE"] = "autocomplete";
|
|
36
|
+
ControlType["AUTOCOMPLETE_CHIPLIST"] = "autocompleteChiplist";
|
|
37
|
+
ControlType["BUTTON"] = "button";
|
|
38
|
+
ControlType["CHECKBOX"] = "checkbox";
|
|
39
|
+
ControlType["CUSTOM"] = "custom";
|
|
40
|
+
ControlType["DATEPICKER"] = "datepicker";
|
|
41
|
+
ControlType["DIVIDER"] = "divider";
|
|
42
|
+
ControlType["FILE_UPLOAD"] = "fileUpload";
|
|
43
|
+
ControlType["HEADING"] = "heading";
|
|
44
|
+
ControlType["INPUT"] = "input";
|
|
45
|
+
ControlType["IMAGE_UPLOAD"] = "imageUpload";
|
|
46
|
+
ControlType["GROUP_LIST"] = "groupList";
|
|
47
|
+
ControlType["RADIO"] = "radio";
|
|
48
|
+
ControlType["SELECT"] = "select";
|
|
49
|
+
ControlType["SLIDER"] = "slider";
|
|
50
|
+
ControlType["SUB_GROUP"] = "subGroup";
|
|
51
|
+
ControlType["TEXTAREA"] = "textarea";
|
|
52
|
+
ControlType["UNIT_CONVERSION"] = "unitConversion";
|
|
53
53
|
})(ControlType || (ControlType = {}));
|
|
54
54
|
|
|
55
55
|
;
|
|
56
56
|
|
|
57
|
-
function crisprControlMixin(BaseClass) {
|
|
58
|
-
return class extends BaseClass {
|
|
59
|
-
set value(value) {
|
|
60
|
-
this.setControlValue(value);
|
|
61
|
-
this._value = value;
|
|
62
|
-
}
|
|
63
|
-
get value() {
|
|
64
|
-
return this._value;
|
|
65
|
-
}
|
|
66
|
-
ngOnInit() {
|
|
67
|
-
super.ngOnInit();
|
|
68
|
-
this.control = this.group.get(this.config.controlName);
|
|
69
|
-
this.setControlValue(this.value);
|
|
70
|
-
// setTimeouts are ugly but this seems to be the only way to get the computed field to compute initial values
|
|
71
|
-
setTimeout(() => {
|
|
72
|
-
this.control.updateValueAndValidity();
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
setControlValue(value) {
|
|
76
|
-
if (value && this.control && this.config.controlType !== ControlType.SUB_GROUP) {
|
|
77
|
-
this.control.setValue(value);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
57
|
+
function crisprControlMixin(BaseClass) {
|
|
58
|
+
return class extends BaseClass {
|
|
59
|
+
set value(value) {
|
|
60
|
+
this.setControlValue(value);
|
|
61
|
+
this._value = value;
|
|
62
|
+
}
|
|
63
|
+
get value() {
|
|
64
|
+
return this._value;
|
|
65
|
+
}
|
|
66
|
+
ngOnInit() {
|
|
67
|
+
super.ngOnInit();
|
|
68
|
+
this.control = this.group.get(this.config.controlName);
|
|
69
|
+
this.setControlValue(this.value);
|
|
70
|
+
// setTimeouts are ugly but this seems to be the only way to get the computed field to compute initial values
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
this.control.updateValueAndValidity();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
setControlValue(value) {
|
|
76
|
+
if (value && this.control && this.config.controlType !== ControlType.SUB_GROUP) {
|
|
77
|
+
this.control.setValue(value);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}]
|
|
83
|
+
class CrisprFieldComponent {
|
|
84
|
+
ngOnInit() {
|
|
85
|
+
this.applyDefaultConfig();
|
|
86
|
+
}
|
|
87
|
+
applyDefaultConfig() {
|
|
88
|
+
this.config = this.defaultConfig ? { ...this.defaultConfig, ...this.config } : this.config;
|
|
89
|
+
}
|
|
90
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
91
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.9", type: CrisprFieldComponent, isStandalone: true, ngImport: i0 }); }
|
|
92
|
+
}
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprFieldComponent, decorators: [{
|
|
94
|
+
type: Directive,
|
|
95
|
+
args: [{
|
|
96
|
+
standalone: true
|
|
97
|
+
}]
|
|
99
98
|
}] });
|
|
100
99
|
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Analyze the config and build a form control to spec. Notice we don't use FormBuilder here
|
|
102
|
+
* as we want to keep this function pure.
|
|
103
|
+
* @param controlConfig the configuration object for the control to build
|
|
104
|
+
* @param value an initial value to use if passed in
|
|
105
|
+
*/
|
|
106
|
+
function createControlForType(controlConfig, value = null) {
|
|
107
|
+
// build form control out based on the control type
|
|
108
|
+
const control = controlConfig.controlType === ControlType.SUB_GROUP
|
|
109
|
+
? buildFormGroupFromConfig(controlConfig, value)
|
|
110
|
+
: controlConfig.controlType === ControlType.GROUP_LIST
|
|
111
|
+
? new FormArray([], controlConfig.validators)
|
|
112
|
+
: new FormControl(value || null, controlConfig.validators);
|
|
113
|
+
return control;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Determines if the field config is for a form control (not a divider, heading or other non-control field)
|
|
118
|
+
*/
|
|
119
|
+
function isControlConfig(fieldConfig) {
|
|
120
|
+
return 'controlName' in fieldConfig;
|
|
103
121
|
}
|
|
104
122
|
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
: of([]);
|
|
129
|
-
return observableOptions;
|
|
123
|
+
/**
|
|
124
|
+
* builds out form group based on config
|
|
125
|
+
* @param config a configuration for a form group
|
|
126
|
+
* @param value an object of initial values to pass in
|
|
127
|
+
* @param group the form group to modify and build out
|
|
128
|
+
*/
|
|
129
|
+
function buildFormGroupFromConfig(config, value = null, group = new FormGroup({})) {
|
|
130
|
+
config.fields.forEach((controlConfig) => {
|
|
131
|
+
if (isControlConfig(controlConfig)) {
|
|
132
|
+
// then add a control to the group using the controlName from configuration
|
|
133
|
+
const { controlName } = controlConfig;
|
|
134
|
+
if (group.get(controlName)) {
|
|
135
|
+
group.removeControl(controlName);
|
|
136
|
+
}
|
|
137
|
+
// if there's a value object and it has a non-null/undefined value for this field use it.
|
|
138
|
+
// Otherwise, default to null
|
|
139
|
+
const controlValue = (value && value[controlName]) ?? null;
|
|
140
|
+
const control = createControlForType(controlConfig, controlValue);
|
|
141
|
+
group.addControl(controlName, control);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
group.setValidators(config.validators);
|
|
145
|
+
return group;
|
|
130
146
|
}
|
|
131
147
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
constructor() {
|
|
136
|
-
super(...arguments);
|
|
137
|
-
// we need a separate control for the UI because of the way the material autocomplete chiplist works
|
|
138
|
-
this.autocompleteInputControl = new FormControl('');
|
|
139
|
-
}
|
|
140
|
-
ngOnInit() {
|
|
141
|
-
super.ngOnInit();
|
|
142
|
-
this.group.addControl(this.config.controlName, new FormControl());
|
|
143
|
-
// filter options by the search string using either the default filter function or one passed in through config
|
|
144
|
-
this.options$ = this.autocompleteInputControl.valueChanges.pipe(
|
|
145
|
-
// this is needed to have the options panel to open on focus
|
|
146
|
-
startWith(''), debounceTime(this.config.typeDebounceTime), map((searchText) => typeof searchText === 'string' ? searchText?.trim() : ''), distinctUntilChanged(), switchMap((searchText) => observablifyOptions(this.config.options, this.group, searchText)), shareReplay(1));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
AbstractAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AbstractAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
150
|
-
AbstractAutocompleteComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: AbstractAutocompleteComponent, usesInheritance: true, ngImport: i0 });
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AbstractAutocompleteComponent, decorators: [{
|
|
152
|
-
type: Directive
|
|
153
|
-
}] });
|
|
148
|
+
function callOptionsIfFunction(options, parentGroup, searchString) {
|
|
149
|
+
return options instanceof Function ? options(parentGroup, searchString) : options;
|
|
150
|
+
}
|
|
154
151
|
|
|
155
|
-
/**
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* @param
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
? buildFormGroupFromConfig(controlConfig, value)
|
|
165
|
-
: controlConfig.controlType === ControlType.GROUP_LIST
|
|
166
|
-
? new FormArray([], controlConfig.validators)
|
|
167
|
-
: new FormControl(value || null, controlConfig.validators);
|
|
168
|
-
return control;
|
|
152
|
+
/**
|
|
153
|
+
* A basic filter function that filters the search string against the label of the options object
|
|
154
|
+
* @param options the array of options to filter
|
|
155
|
+
* @param searchString the string from the input
|
|
156
|
+
*/
|
|
157
|
+
function filterOptionsByLabel(options, searchString) {
|
|
158
|
+
return options.filter(option => {
|
|
159
|
+
return option.label && option.label.toLowerCase().includes(searchString.toLowerCase());
|
|
160
|
+
});
|
|
169
161
|
}
|
|
170
162
|
|
|
171
|
-
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
|
|
175
|
-
|
|
163
|
+
/**
|
|
164
|
+
* The user can give us select options as an array, a function that resolves to a promise,
|
|
165
|
+
* or an observable. This functions consumes any of those and returns an observable that
|
|
166
|
+
* resolves an array of options
|
|
167
|
+
*
|
|
168
|
+
* @param options the options passed in from the config
|
|
169
|
+
* @param emptyMessageOption the message to display when the array is empty
|
|
170
|
+
*/
|
|
171
|
+
function observablifyOptions(options, parentGroup, searchString) {
|
|
172
|
+
const calledOptions = callOptionsIfFunction(options, parentGroup, searchString);
|
|
173
|
+
// if options are a promise
|
|
174
|
+
const observableOptions = calledOptions instanceof Promise
|
|
175
|
+
// convert to observable
|
|
176
|
+
? from(calledOptions)
|
|
177
|
+
// if array that isn't empty
|
|
178
|
+
: Array.isArray(calledOptions) && calledOptions.length
|
|
179
|
+
// convert to observable
|
|
180
|
+
? of(calledOptions)
|
|
181
|
+
// if observable
|
|
182
|
+
: isObservable(calledOptions)
|
|
183
|
+
// return it
|
|
184
|
+
? calledOptions
|
|
185
|
+
// else an empty array
|
|
186
|
+
: of([]);
|
|
187
|
+
return observableOptions;
|
|
176
188
|
}
|
|
177
189
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
190
|
+
function convertBytesToMb(bytes) {
|
|
191
|
+
return bytes / 1048576;
|
|
192
|
+
}
|
|
193
|
+
function maxFileSizeValidator(maxFileSize) {
|
|
194
|
+
return (control) => {
|
|
195
|
+
const controlValue = control.value;
|
|
196
|
+
if (!(controlValue instanceof File)) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
const actualFileSize = +convertBytesToMb(controlValue.size).toPrecision(3);
|
|
200
|
+
if (maxFileSize > actualFileSize)
|
|
201
|
+
return null;
|
|
202
|
+
return { maxFileSize: { maxFileSize, actualFileSize } };
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function allowedFileExtValidator(allowedFileExtensions, onlyAllowFiles = true) {
|
|
206
|
+
return (control) => {
|
|
207
|
+
const controlValue = control.value;
|
|
208
|
+
const isFile = controlValue instanceof File;
|
|
209
|
+
if (!onlyAllowFiles && !isFile)
|
|
210
|
+
return null;
|
|
211
|
+
const actualExtension = isFile ? controlValue.name.split('.').pop().toLocaleLowerCase() : 'Not a file';
|
|
212
|
+
const isAllowedExtension = allowedFileExtensions.includes(actualExtension);
|
|
213
|
+
if (isAllowedExtension) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
return { allowedExtension: { allowedFileExtensions, actualExtension } };
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function allowedFileType(matchExp) {
|
|
220
|
+
return (formControl) => {
|
|
221
|
+
const value = formControl.value;
|
|
222
|
+
if (!(value instanceof File))
|
|
223
|
+
return null;
|
|
224
|
+
const type = value.type;
|
|
225
|
+
const matches = type.match(matchExp);
|
|
226
|
+
if (!type || !matches?.length) {
|
|
227
|
+
return {
|
|
228
|
+
allowedFileType: {
|
|
229
|
+
actualType: type,
|
|
230
|
+
allowedTypeExp: matchExp
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
201
238
|
}
|
|
202
239
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
240
|
+
const AbstractAutocompleteFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
241
|
+
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
242
|
+
class AbstractAutocompleteComponent extends AbstractAutocompleteFieldMixin {
|
|
243
|
+
constructor() {
|
|
244
|
+
super(...arguments);
|
|
245
|
+
// we need a separate control for the UI because of the way the material autocomplete chiplist works
|
|
246
|
+
this.autocompleteInputControl = new FormControl('');
|
|
247
|
+
}
|
|
248
|
+
ngOnInit() {
|
|
249
|
+
super.ngOnInit();
|
|
250
|
+
this.group.addControl(this.config.controlName, new FormControl());
|
|
251
|
+
// filter options by the search string using either the default filter function or one passed in through config
|
|
252
|
+
this.options$ = this.autocompleteInputControl.valueChanges.pipe(
|
|
253
|
+
// this is needed to have the options panel to open on focus
|
|
254
|
+
startWith(''), debounceTime(this.config.typeDebounceTime), map((searchText) => typeof searchText === 'string' ? searchText?.trim() : ''), distinctUntilChanged(), switchMap((searchText) => observablifyOptions(this.config.options, this.group, searchText)), shareReplay(1));
|
|
255
|
+
}
|
|
256
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AbstractAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
257
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.9", type: AbstractAutocompleteComponent, usesInheritance: true, ngImport: i0 }); }
|
|
212
258
|
}
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: AbstractAutocompleteComponent, decorators: [{
|
|
260
|
+
type: Directive
|
|
261
|
+
}] });
|
|
213
262
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const controlValue = control.value;
|
|
220
|
-
if (!(controlValue instanceof File)) {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
const actualFileSize = +convertBytesToMb(controlValue.size).toPrecision(3);
|
|
224
|
-
if (maxFileSize > actualFileSize)
|
|
225
|
-
return null;
|
|
226
|
-
return { maxFileSize: { maxFileSize, actualFileSize } };
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
function allowedFileExtValidator(allowedFileExtensions, onlyAllowFiles = true) {
|
|
230
|
-
return (control) => {
|
|
231
|
-
const controlValue = control.value;
|
|
232
|
-
const isFile = controlValue instanceof File;
|
|
233
|
-
if (!onlyAllowFiles && !isFile)
|
|
234
|
-
return null;
|
|
235
|
-
const actualExtension = isFile ? controlValue.name.split('.').pop().toLocaleLowerCase() : 'Not a file';
|
|
236
|
-
const isAllowedExtension = allowedFileExtensions.includes(actualExtension);
|
|
237
|
-
if (isAllowedExtension) {
|
|
238
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
return { allowedExtension: { allowedFileExtensions, actualExtension } };
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
function allowedFileType(matchExp) {
|
|
244
|
-
return (formControl) => {
|
|
245
|
-
const value = formControl.value;
|
|
246
|
-
if (!(value instanceof File))
|
|
247
|
-
return null;
|
|
248
|
-
const type = value.type;
|
|
249
|
-
const matches = type.match(matchExp);
|
|
250
|
-
if (!type || !matches?.length) {
|
|
251
|
-
return {
|
|
252
|
-
allowedFileType: {
|
|
253
|
-
actualType: type,
|
|
254
|
-
allowedTypeExp: matchExp
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
return null;
|
|
260
|
-
}
|
|
261
|
-
};
|
|
263
|
+
const CrisprDisplayFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
264
|
+
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
265
|
+
class CrisprDisplayFieldComponent extends CrisprDisplayFieldMixin {
|
|
266
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprDisplayFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
267
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.9", type: CrisprDisplayFieldComponent, usesInheritance: true, ngImport: i0 }); }
|
|
262
268
|
}
|
|
269
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.9", ngImport: i0, type: CrisprDisplayFieldComponent, decorators: [{
|
|
270
|
+
type: Directive
|
|
271
|
+
}] });
|
|
263
272
|
|
|
264
|
-
/**
|
|
265
|
-
* Generated bundle index. Do not edit.
|
|
273
|
+
/**
|
|
274
|
+
* Generated bundle index. Do not edit.
|
|
266
275
|
*/
|
|
267
276
|
|
|
268
|
-
export { AbstractAutocompleteComponent, ControlType, CrisprFieldComponent, DEFAULT_EMPTY_OPTIONS_MESSAGE, allowedFileExtValidator, allowedFileType, buildFormGroupFromConfig, callOptionsIfFunction, convertBytesToMb, createControlForType, crisprControlMixin, filterOptionsByLabel, isControlConfig, maxFileSizeValidator, observablifyOptions, valueIn };
|
|
269
|
-
//# sourceMappingURL=tft-crispr-forms-utils.mjs.map
|
|
277
|
+
export { AbstractAutocompleteComponent, ControlType, CrisprDisplayFieldComponent, CrisprFieldComponent, DEFAULT_EMPTY_OPTIONS_MESSAGE, allowedFileExtValidator, allowedFileType, buildFormGroupFromConfig, callOptionsIfFunction, convertBytesToMb, createControlForType, crisprControlMixin, filterOptionsByLabel, isControlConfig, maxFileSizeValidator, observablifyOptions, valueIn };
|
|
278
|
+
//# sourceMappingURL=tft-crispr-forms-src-lib-utils.mjs.map
|