@tft/crispr-forms 13.0.23 → 14.0.1-rc.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 +77 -76
- package/esm2020/public-api.mjs +5 -0
- package/esm2020/src/index.mjs +2 -0
- package/esm2020/src/lib/crispr-forms.module.mjs +57 -0
- package/esm2020/src/lib/field-component-map.const.mjs +27 -0
- package/esm2020/src/lib/field.directive.mjs +69 -0
- package/esm2020/src/lib/form/form.component.mjs +63 -0
- package/esm2020/src/lib/form-group-list/form-group-list.component.mjs +93 -0
- package/esm2020/src/lib/form-group-list/index.mjs +2 -0
- package/esm2020/src/lib/pipes/crispr-pipes.module.mjs +24 -0
- package/esm2020/src/lib/pipes/initial-control-value.pipe.mjs +21 -0
- package/esm2020/src/lib/public_api.mjs +3 -0
- package/esm2020/src/lib/sub-group/index.mjs +3 -0
- package/esm2020/src/lib/sub-group/sub-group.component.mjs +21 -0
- package/esm2020/src/lib/sub-group/sub-group.module.mjs +42 -0
- package/esm2020/tft-crispr-forms.mjs +2 -2
- package/esm2020/ui/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +127 -0
- package/esm2020/ui/autocomplete-chiplist-field/index.mjs +2 -0
- package/esm2020/ui/autocomplete-field/autocomplete-field.component.mjs +90 -0
- package/esm2020/ui/autocomplete-field/index.mjs +2 -0
- package/esm2020/ui/button/button.component.mjs +46 -0
- package/esm2020/ui/button/index.mjs +2 -0
- package/esm2020/ui/checkbox-field/checkbox-field.component.mjs +42 -0
- package/esm2020/ui/checkbox-field/index.mjs +2 -0
- package/esm2020/ui/datepicker-field/datepicker-field.component.mjs +60 -0
- package/esm2020/ui/datepicker-field/index.mjs +2 -0
- package/esm2020/ui/divider/divider.component.mjs +28 -0
- package/esm2020/ui/divider/index.mjs +2 -0
- package/esm2020/ui/field-container/field-container.component.mjs +58 -0
- package/esm2020/ui/field-container/public-api.mjs +2 -0
- package/esm2020/ui/field-container/tft-crispr-forms-ui-field-container.mjs +5 -0
- package/esm2020/ui/file-dropzone/file-dropzone.directive.mjs +40 -0
- package/esm2020/ui/file-dropzone/public-api.mjs +2 -0
- package/esm2020/ui/file-dropzone/tft-crispr-forms-ui-file-dropzone.mjs +5 -0
- package/esm2020/ui/file-upload/file-upload.component.mjs +108 -0
- package/esm2020/ui/file-upload/index.mjs +2 -0
- package/esm2020/ui/heading/heading.component.mjs +31 -0
- package/esm2020/ui/heading/public-api.mjs +2 -0
- package/esm2020/ui/heading/tft-crispr-forms-ui-heading.mjs +5 -0
- package/esm2020/ui/image-upload-field/image-upload-field.component.mjs +179 -0
- package/esm2020/ui/image-upload-field/public-api.mjs +2 -0
- package/esm2020/ui/image-upload-field/tft-crispr-forms-ui-image-upload-field.mjs +5 -0
- package/esm2020/ui/info/info.component.mjs +23 -0
- package/esm2020/ui/info/public-api.mjs +2 -0
- package/esm2020/ui/info/tft-crispr-forms-ui-info.mjs +5 -0
- package/esm2020/ui/input-field/index.mjs +2 -0
- package/esm2020/ui/input-field/input-field.component.mjs +38 -0
- package/esm2020/ui/option/index.mjs +2 -0
- package/esm2020/ui/option/option.component.mjs +19 -0
- package/esm2020/ui/public-api.mjs +21 -0
- package/esm2020/ui/radio-field/index.mjs +2 -0
- package/esm2020/ui/radio-field/radio-field.component.mjs +36 -0
- package/esm2020/ui/select-field/index.mjs +2 -0
- package/esm2020/ui/select-field/select-field.component.mjs +74 -0
- package/esm2020/ui/selected-file/public-api.mjs +2 -0
- package/esm2020/ui/selected-file/selected-file.component.mjs +26 -0
- package/esm2020/ui/selected-file/tft-crispr-forms-ui-selected-file.mjs +5 -0
- package/esm2020/ui/slider-field/index.mjs +2 -0
- package/esm2020/ui/slider-field/slider-field.component.mjs +41 -0
- package/esm2020/ui/textarea-field/index.mjs +2 -0
- package/esm2020/ui/textarea-field/textarea-field.component.mjs +39 -0
- package/esm2020/ui/tft-crispr-forms-ui.mjs +5 -0
- package/esm2020/ui/unit-conversion-field/index.mjs +2 -0
- package/esm2020/ui/unit-conversion-field/unit-conversion-field.component.mjs +81 -0
- package/esm2020/utils/abstracts/autocomplete-field.abstract.mjs +30 -0
- package/esm2020/utils/abstracts/crispr-control.mixin.mjs +27 -0
- package/esm2020/utils/abstracts/crispr-field.abstract.mjs +20 -0
- package/esm2020/utils/abstracts/index.mjs +4 -0
- package/esm2020/utils/functions/buildFormGroupFromConfig.mjs +28 -0
- package/esm2020/utils/functions/callOptionsIfFunction.mjs +4 -0
- package/esm2020/utils/functions/createControlForType.mjs +19 -0
- package/esm2020/utils/functions/filterOptionsByLabel.mjs +11 -0
- package/esm2020/utils/functions/image-compression.helpers.mjs +50 -0
- package/esm2020/utils/functions/index.mjs +8 -0
- package/esm2020/utils/functions/isControlConfig.mjs +7 -0
- package/esm2020/utils/functions/observablifyOptions.mjs +29 -0
- package/esm2020/utils/models/autocomplete-chiplist-field.config.mjs +2 -0
- package/esm2020/utils/models/autocomplete-field.config.mjs +2 -0
- package/esm2020/utils/models/button.config.mjs +2 -0
- package/esm2020/utils/models/checkbox-field.config.mjs +2 -0
- package/esm2020/utils/models/crispr-field.config.mjs +23 -0
- package/esm2020/utils/models/datepicker-field.config.mjs +2 -0
- package/esm2020/utils/models/divider.config.mjs +2 -0
- package/esm2020/utils/models/file-upload-field.config.mjs +2 -0
- package/esm2020/utils/models/form-group-list.config.mjs +2 -0
- package/esm2020/utils/models/heading.config.mjs +3 -0
- package/esm2020/utils/models/image-upload-field.config.mjs +2 -0
- package/esm2020/utils/models/index.mjs +18 -0
- package/esm2020/utils/models/input-field.config.mjs +2 -0
- package/esm2020/utils/models/radio-field.config.mjs +2 -0
- package/esm2020/utils/models/select-field.config.mjs +2 -0
- package/esm2020/utils/models/slider-field.config.mjs +2 -0
- package/esm2020/utils/models/textarea-field.config.mjs +2 -0
- package/esm2020/utils/models/unit-conversion-field.config.mjs +2 -0
- package/esm2020/utils/operators/form.operators.mjs +24 -0
- package/esm2020/utils/operators/index.mjs +2 -0
- package/esm2020/utils/public-api.mjs +5 -0
- package/esm2020/utils/tft-crispr-forms-utils.mjs +5 -0
- package/fesm2015/tft-crispr-forms-ui-field-container.mjs +64 -0
- package/fesm2015/tft-crispr-forms-ui-field-container.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs +47 -0
- package/fesm2015/tft-crispr-forms-ui-file-dropzone.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-heading.mjs +37 -0
- package/fesm2015/tft-crispr-forms-ui-heading.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs +182 -0
- package/fesm2015/tft-crispr-forms-ui-image-upload-field.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-info.mjs +30 -0
- package/fesm2015/tft-crispr-forms-ui-info.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui-selected-file.mjs +33 -0
- package/fesm2015/tft-crispr-forms-ui-selected-file.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-ui.mjs +684 -0
- package/fesm2015/tft-crispr-forms-ui.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms-utils.mjs +270 -0
- package/fesm2015/tft-crispr-forms-utils.mjs.map +1 -0
- package/fesm2015/tft-crispr-forms.mjs +117 -1730
- package/fesm2015/tft-crispr-forms.mjs.map +1 -1
- package/fesm2020/tft-crispr-forms-ui-field-container.mjs +65 -0
- package/fesm2020/tft-crispr-forms-ui-field-container.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs +47 -0
- package/fesm2020/tft-crispr-forms-ui-file-dropzone.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-heading.mjs +37 -0
- package/fesm2020/tft-crispr-forms-ui-heading.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs +185 -0
- package/fesm2020/tft-crispr-forms-ui-image-upload-field.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-info.mjs +30 -0
- package/fesm2020/tft-crispr-forms-ui-info.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui-selected-file.mjs +33 -0
- package/fesm2020/tft-crispr-forms-ui-selected-file.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-ui.mjs +676 -0
- package/fesm2020/tft-crispr-forms-ui.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms-utils.mjs +269 -0
- package/fesm2020/tft-crispr-forms-utils.mjs.map +1 -0
- package/fesm2020/tft-crispr-forms.mjs +117 -1723
- package/fesm2020/tft-crispr-forms.mjs.map +1 -1
- package/index.d.ts +5 -1
- package/package.json +77 -15
- package/public-api.d.ts +3 -0
- package/src/index.d.ts +1 -0
- package/src/lib/crispr-forms.module.d.ts +15 -0
- package/{lib → src/lib}/field-component-map.const.d.ts +7 -6
- package/{lib → src/lib}/field.directive.d.ts +4 -10
- package/{lib → src/lib}/form/form.component.d.ts +3 -3
- package/{lib → src/lib}/form-group-list/form-group-list.component.d.ts +12 -14
- package/{lib → src/lib}/form-group-list/index.d.ts +0 -1
- package/{lib → src/lib}/pipes/crispr-pipes.module.d.ts +0 -0
- package/{lib → src/lib}/pipes/initial-control-value.pipe.d.ts +2 -2
- package/src/lib/public_api.d.ts +2 -0
- package/{lib → src/lib}/sub-group/index.d.ts +0 -0
- package/src/lib/sub-group/sub-group.component.d.ts +22 -0
- package/{lib → src/lib}/sub-group/sub-group.module.d.ts +2 -2
- package/tft-crispr-forms-14.0.1-rc.2.tgz +0 -0
- package/ui/README.md +3 -0
- package/{lib/material → ui}/autocomplete-chiplist-field/autocomplete-chiplist-field.component.d.ts +2 -3
- package/ui/autocomplete-chiplist-field/index.d.ts +1 -0
- package/{lib/material → ui}/autocomplete-field/autocomplete-field.component.d.ts +2 -3
- package/ui/autocomplete-field/index.d.ts +1 -0
- package/{lib/material → ui}/button/button.component.d.ts +2 -3
- package/ui/button/index.d.ts +1 -0
- package/ui/checkbox-field/checkbox-field.component.d.ts +21 -0
- package/ui/checkbox-field/index.d.ts +1 -0
- package/{lib/material → ui}/datepicker-field/datepicker-field.component.d.ts +14 -17
- package/ui/datepicker-field/index.d.ts +1 -0
- package/{lib/material → ui}/divider/divider.component.d.ts +2 -3
- package/ui/divider/index.d.ts +1 -0
- package/{lib → ui}/field-container/field-container.component.d.ts +3 -10
- package/ui/field-container/index.d.ts +5 -0
- package/{lib/field-container/index.d.ts → ui/field-container/public-api.d.ts} +0 -0
- package/{lib/material/file-upload → ui/file-dropzone}/file-dropzone.directive.d.ts +1 -1
- package/ui/file-dropzone/index.d.ts +5 -0
- package/{lib/material/file-upload/index.d.ts → ui/file-dropzone/public-api.d.ts} +0 -1
- package/ui/file-upload/file-upload.component.d.ts +37 -0
- package/ui/file-upload/index.d.ts +1 -0
- package/ui/heading/heading.component.d.ts +8 -0
- package/ui/heading/index.d.ts +5 -0
- package/ui/heading/public-api.d.ts +1 -0
- package/ui/image-upload-field/image-upload-field.component.d.ts +48 -0
- package/ui/image-upload-field/index.d.ts +5 -0
- package/{lib/material/image-upload-field/index.d.ts → ui/image-upload-field/public-api.d.ts} +0 -0
- package/ui/index.d.ts +5 -0
- package/ui/info/index.d.ts +5 -0
- package/ui/info/info.component.d.ts +7 -0
- package/ui/info/public-api.d.ts +1 -0
- package/ui/input-field/index.d.ts +1 -0
- package/ui/input-field/input-field.component.d.ts +22 -0
- package/{lib/material → ui}/option/index.d.ts +0 -0
- package/{lib/material → ui}/option/option.component.d.ts +2 -2
- package/ui/public-api.d.ts +19 -0
- package/ui/radio-field/index.d.ts +1 -0
- package/ui/radio-field/radio-field.component.d.ts +23 -0
- package/ui/select-field/index.d.ts +1 -0
- package/{lib/material → ui}/select-field/select-field.component.d.ts +12 -14
- package/ui/selected-file/index.d.ts +5 -0
- package/ui/selected-file/public-api.d.ts +1 -0
- package/ui/selected-file/selected-file.component.d.ts +10 -0
- package/ui/slider-field/index.d.ts +1 -0
- package/ui/slider-field/slider-field.component.d.ts +25 -0
- package/ui/textarea-field/index.d.ts +1 -0
- package/ui/textarea-field/textarea-field.component.d.ts +21 -0
- package/ui/unit-conversion-field/index.d.ts +1 -0
- package/{lib/material → ui}/unit-conversion-field/unit-conversion-field.component.d.ts +14 -17
- package/utils/README.md +3 -0
- package/{lib → utils}/abstracts/autocomplete-field.abstract.d.ts +4 -4
- package/{lib → utils}/abstracts/crispr-control.mixin.d.ts +0 -0
- package/{lib → utils}/abstracts/crispr-field.abstract.d.ts +1 -1
- package/{lib → utils}/abstracts/index.d.ts +0 -0
- package/utils/functions/buildFormGroupFromConfig.d.ts +9 -0
- package/utils/functions/callOptionsIfFunction.d.ts +3 -0
- package/utils/functions/createControlForType.d.ts +9 -0
- package/utils/functions/filterOptionsByLabel.d.ts +7 -0
- package/utils/functions/image-compression.helpers.d.ts +5 -0
- package/utils/functions/index.d.ts +7 -0
- package/utils/functions/isControlConfig.d.ts +5 -0
- package/utils/functions/observablifyOptions.d.ts +12 -0
- package/utils/index.d.ts +5 -0
- package/{lib → utils}/models/autocomplete-chiplist-field.config.d.ts +2 -1
- package/{lib → utils}/models/autocomplete-field.config.d.ts +1 -2
- package/{lib → utils}/models/button.config.d.ts +0 -0
- package/{lib → utils}/models/checkbox-field.config.d.ts +1 -2
- package/{lib → utils}/models/crispr-field.config.d.ts +5 -7
- package/{lib → utils}/models/datepicker-field.config.d.ts +4 -6
- package/{lib → utils}/models/divider.config.d.ts +1 -1
- package/{lib → utils}/models/file-upload-field.config.d.ts +3 -4
- package/{lib → utils}/models/form-group-list.config.d.ts +1 -2
- package/{lib → utils}/models/heading.config.d.ts +1 -2
- package/{lib → utils}/models/image-upload-field.config.d.ts +2 -1
- package/{lib → utils}/models/index.d.ts +0 -0
- package/{lib → utils}/models/input-field.config.d.ts +1 -2
- package/{lib → utils}/models/radio-field.config.d.ts +0 -0
- package/{lib → utils}/models/select-field.config.d.ts +1 -2
- package/{lib → utils}/models/slider-field.config.d.ts +1 -2
- package/{lib → utils}/models/textarea-field.config.d.ts +1 -2
- package/{lib → utils}/models/unit-conversion-field.config.d.ts +1 -2
- package/{lib → utils/operators}/form.operators.d.ts +0 -0
- package/utils/operators/index.d.ts +1 -0
- package/utils/public-api.d.ts +4 -0
- package/esm2020/index.mjs +0 -2
- package/esm2020/lib/abstracts/autocomplete-field.abstract.mjs +0 -30
- package/esm2020/lib/abstracts/crispr-control.mixin.mjs +0 -27
- package/esm2020/lib/abstracts/crispr-field.abstract.mjs +0 -17
- package/esm2020/lib/abstracts/index.mjs +0 -4
- package/esm2020/lib/crispr-forms.module.mjs +0 -66
- package/esm2020/lib/field-component-map.const.mjs +0 -28
- package/esm2020/lib/field-container/field-container.component.mjs +0 -85
- package/esm2020/lib/field-container/index.mjs +0 -2
- package/esm2020/lib/field.directive.mjs +0 -90
- package/esm2020/lib/form/form.component.mjs +0 -53
- package/esm2020/lib/form-group-list/form-group-list.component.mjs +0 -77
- package/esm2020/lib/form-group-list/form-group-list.module.mjs +0 -54
- package/esm2020/lib/form-group-list/index.mjs +0 -3
- package/esm2020/lib/form.helpers.mjs +0 -190
- package/esm2020/lib/form.operators.mjs +0 -24
- package/esm2020/lib/material/autocomplete-chiplist-field/autocomplete-chiplist-field.component.mjs +0 -111
- package/esm2020/lib/material/autocomplete-field/autocomplete-field.component.mjs +0 -78
- package/esm2020/lib/material/button/button.component.mjs +0 -35
- package/esm2020/lib/material/checkbox-field/checkbox-field.component.mjs +0 -31
- package/esm2020/lib/material/datepicker-field/datepicker-field.component.mjs +0 -45
- package/esm2020/lib/material/divider/divider.component.mjs +0 -22
- package/esm2020/lib/material/file-upload/file-dropzone.directive.mjs +0 -39
- package/esm2020/lib/material/file-upload/file-upload.component.mjs +0 -145
- package/esm2020/lib/material/file-upload/index.mjs +0 -3
- package/esm2020/lib/material/heading/heading.component.mjs +0 -54
- package/esm2020/lib/material/image-upload-field/image-compression.helpers.mjs +0 -4
- package/esm2020/lib/material/image-upload-field/image-upload-field.component.mjs +0 -265
- package/esm2020/lib/material/image-upload-field/index.mjs +0 -2
- package/esm2020/lib/material/index.mjs +0 -18
- package/esm2020/lib/material/info/info.component.mjs +0 -46
- package/esm2020/lib/material/input-field/input-field.component.mjs +0 -27
- package/esm2020/lib/material/material.module.mjs +0 -200
- package/esm2020/lib/material/option/index.mjs +0 -2
- package/esm2020/lib/material/option/option.component.mjs +0 -15
- package/esm2020/lib/material/radio-field/radio-field.component.mjs +0 -29
- package/esm2020/lib/material/select-field/select-field.component.mjs +0 -58
- package/esm2020/lib/material/selected-file/selected-file.component.mjs +0 -47
- package/esm2020/lib/material/slider-field/slider-field.component.mjs +0 -30
- package/esm2020/lib/material/textarea-field/textarea-field.component.mjs +0 -28
- package/esm2020/lib/material/unit-conversion-field/unit-conversion-field.component.mjs +0 -69
- package/esm2020/lib/models/autocomplete-chiplist-field.config.mjs +0 -2
- package/esm2020/lib/models/autocomplete-field.config.mjs +0 -2
- package/esm2020/lib/models/button.config.mjs +0 -2
- package/esm2020/lib/models/checkbox-field.config.mjs +0 -2
- package/esm2020/lib/models/crispr-field.config.mjs +0 -23
- package/esm2020/lib/models/datepicker-field.config.mjs +0 -2
- package/esm2020/lib/models/divider.config.mjs +0 -2
- package/esm2020/lib/models/file-upload-field.config.mjs +0 -2
- package/esm2020/lib/models/form-group-list.config.mjs +0 -2
- package/esm2020/lib/models/heading.config.mjs +0 -3
- package/esm2020/lib/models/image-upload-field.config.mjs +0 -2
- package/esm2020/lib/models/index.mjs +0 -18
- package/esm2020/lib/models/input-field.config.mjs +0 -2
- package/esm2020/lib/models/radio-field.config.mjs +0 -2
- package/esm2020/lib/models/select-field.config.mjs +0 -2
- package/esm2020/lib/models/slider-field.config.mjs +0 -2
- package/esm2020/lib/models/textarea-field.config.mjs +0 -2
- package/esm2020/lib/models/unit-conversion-field.config.mjs +0 -2
- package/esm2020/lib/pipes/crispr-pipes.module.mjs +0 -26
- package/esm2020/lib/pipes/initial-control-value.pipe.mjs +0 -20
- package/esm2020/lib/public_api.mjs +0 -10
- package/esm2020/lib/sub-group/index.mjs +0 -3
- package/esm2020/lib/sub-group/sub-group.component.mjs +0 -20
- package/esm2020/lib/sub-group/sub-group.module.mjs +0 -45
- package/lib/crispr-forms.module.d.ts +0 -16
- package/lib/form-group-list/form-group-list.module.d.ts +0 -15
- package/lib/form.helpers.d.ts +0 -88
- package/lib/material/checkbox-field/checkbox-field.component.d.ts +0 -23
- package/lib/material/file-upload/file-upload.component.d.ts +0 -54
- package/lib/material/heading/heading.component.d.ts +0 -17
- package/lib/material/image-upload-field/image-compression.helpers.d.ts +0 -1
- package/lib/material/image-upload-field/image-upload-field.component.d.ts +0 -68
- package/lib/material/index.d.ts +0 -17
- package/lib/material/info/info.component.d.ts +0 -15
- package/lib/material/input-field/input-field.component.d.ts +0 -24
- package/lib/material/material.module.d.ts +0 -44
- package/lib/material/radio-field/radio-field.component.d.ts +0 -26
- package/lib/material/selected-file/selected-file.component.d.ts +0 -17
- package/lib/material/slider-field/slider-field.component.d.ts +0 -27
- package/lib/material/textarea-field/textarea-field.component.d.ts +0 -24
- package/lib/public_api.d.ts +0 -9
- package/lib/sub-group/sub-group.component.d.ts +0 -24
- package/tft-crispr-forms-13.0.23.tgz +0 -0
- package/tft-crispr-forms.d.ts +0 -5
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, ViewChild, Optional, Self } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/material/input';
|
|
4
|
+
import { MatInputModule } from '@angular/material/input';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import { FieldContainerComponent } from '@tft/crispr-forms/ui/field-container';
|
|
8
|
+
export * from '@tft/crispr-forms/ui/field-container';
|
|
9
|
+
import * as i2 from '@angular/forms';
|
|
10
|
+
import { ReactiveFormsModule, FormControl } from '@angular/forms';
|
|
11
|
+
import * as i3 from '@angular/material/form-field';
|
|
12
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
|
+
import { InfoComponent } from '@tft/crispr-forms/ui/info';
|
|
14
|
+
export * from '@tft/crispr-forms/ui/info';
|
|
15
|
+
import { crisprControlMixin, CrisprFieldComponent, observablifyOptions, DEFAULT_EMPTY_OPTIONS_MESSAGE, AbstractAutocompleteComponent } from '@tft/crispr-forms/utils';
|
|
16
|
+
import * as i4$1 from '@angular/material/select';
|
|
17
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
18
|
+
import * as i2$1 from '@angular/material/checkbox';
|
|
19
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
20
|
+
import * as i4$2 from '@angular/material/core';
|
|
21
|
+
import { MatOptionModule } from '@angular/material/core';
|
|
22
|
+
import * as i3$1 from '@angular/material/autocomplete';
|
|
23
|
+
import { MatAutocompleteTrigger, MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
24
|
+
import { tap, map, startWith } from 'rxjs/operators';
|
|
25
|
+
import { BehaviorSubject, combineLatest, of } from 'rxjs';
|
|
26
|
+
import { ENTER } from '@angular/cdk/keycodes';
|
|
27
|
+
import * as i7 from '@angular/material/chips';
|
|
28
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
29
|
+
import * as i3$2 from '@angular/material/icon';
|
|
30
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
31
|
+
import * as i3$3 from '@angular/material/slider';
|
|
32
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
33
|
+
import * as i2$2 from '@angular/material/button';
|
|
34
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
35
|
+
import * as i4$3 from '@angular/material/tooltip';
|
|
36
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
37
|
+
import * as i2$3 from '@angular/material/datepicker';
|
|
38
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
39
|
+
import { MatDateFnsModule } from '@angular/material-date-fns-adapter';
|
|
40
|
+
import * as i6 from '@angular/cdk/portal';
|
|
41
|
+
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
42
|
+
import * as i2$4 from '@angular/material/divider';
|
|
43
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
44
|
+
import * as i3$4 from '@angular/material/radio';
|
|
45
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
46
|
+
import * as i7$1 from '@tft/form-validation-handler';
|
|
47
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
48
|
+
import { FileDropzoneDirective } from '@tft/crispr-forms/ui/file-dropzone';
|
|
49
|
+
export * from '@tft/crispr-forms/ui/file-dropzone';
|
|
50
|
+
import { SelectedFileComponent } from '@tft/crispr-forms/ui/selected-file';
|
|
51
|
+
export * from '@tft/crispr-forms/ui/selected-file';
|
|
52
|
+
export * from '@tft/crispr-forms/ui/heading';
|
|
53
|
+
|
|
54
|
+
const InputFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
55
|
+
class InputFieldComponent extends InputFieldMixin {
|
|
56
|
+
constructor() {
|
|
57
|
+
super();
|
|
58
|
+
this.defaultConfig = { inputType: 'text' };
|
|
59
|
+
}
|
|
60
|
+
ngOnInit() {
|
|
61
|
+
super.ngOnInit();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
InputFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
65
|
+
InputFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: InputFieldComponent, isStandalone: true, selector: "crispr-input-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label>\n {{config.label}}\n </mat-label>\n <input\n [type]=\"config.inputType\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [maxlength]=\"config.maxLength\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"\n [pattern]=\"config.pattern\"\n [spellcheck]=\"config.spellcheck\"\n [autocomplete]=\"config.autoComplete\"\n [autocapitalize]=\"config.autoCapitalize\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n\n</crispr-field-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InputFieldComponent, decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{ selector: 'crispr-input-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
69
|
+
CommonModule,
|
|
70
|
+
InfoComponent,
|
|
71
|
+
ReactiveFormsModule,
|
|
72
|
+
FieldContainerComponent,
|
|
73
|
+
MatFormFieldModule,
|
|
74
|
+
MatInputModule,
|
|
75
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label>\n {{config.label}}\n </mat-label>\n <input\n [type]=\"config.inputType\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [maxlength]=\"config.maxLength\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\"\n [pattern]=\"config.pattern\"\n [spellcheck]=\"config.spellcheck\"\n [autocomplete]=\"config.autoComplete\"\n [autocapitalize]=\"config.autoCapitalize\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n\n</crispr-field-container>\n" }]
|
|
76
|
+
}], ctorParameters: function () { return []; } });
|
|
77
|
+
|
|
78
|
+
class OptionComponent {
|
|
79
|
+
}
|
|
80
|
+
OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: OptionComponent, isStandalone: true, selector: "crispr-option", inputs: { option: "option" }, ngImport: i0, template: "<div>\n <img\n *ngIf=\"option.imageUrl\"\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n {{option.label}}\n</div>\n\n<crispr-info *ngIf=\"option.info as info\" [info]=\"info\">\n\n</crispr-info>\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: OptionComponent, decorators: [{
|
|
83
|
+
type: Component,
|
|
84
|
+
args: [{ selector: 'crispr-option', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
85
|
+
CommonModule,
|
|
86
|
+
InfoComponent,
|
|
87
|
+
], template: "<div>\n <img\n *ngIf=\"option.imageUrl\"\n [src]=\"option.imageUrl\"\n alt=\"image of {{option.label}}\"\n style=\"vertical-align:middle;\"\n aria-hidden\n height=\"25\"/>\n {{option.label}}\n</div>\n\n<crispr-info *ngIf=\"option.info as info\" [info]=\"info\">\n\n</crispr-info>\n", styles: [":host{display:flex;justify-content:space-between}:host img{margin-right:4px}\n"] }]
|
|
88
|
+
}], propDecorators: { option: [{
|
|
89
|
+
type: Input
|
|
90
|
+
}] } });
|
|
91
|
+
|
|
92
|
+
const SelectFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
93
|
+
class SelectFieldComponent extends SelectFieldMixin {
|
|
94
|
+
constructor() {
|
|
95
|
+
super(...arguments);
|
|
96
|
+
this.defaultConfig = {
|
|
97
|
+
enableToggleAll: false,
|
|
98
|
+
color: 'primary'
|
|
99
|
+
};
|
|
100
|
+
this.allSelected = false;
|
|
101
|
+
}
|
|
102
|
+
ngOnInit() {
|
|
103
|
+
super.ngOnInit();
|
|
104
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
105
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
106
|
+
this.options$ = observablifyOptions(this.config.options, this.group);
|
|
107
|
+
}
|
|
108
|
+
ngAfterViewInit() {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
if (this.config.multiple
|
|
111
|
+
&& this.config.enableToggleAll
|
|
112
|
+
&& ((_a = this.selectField.options) === null || _a === void 0 ? void 0 : _a.length) === ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
113
|
+
this.allSelected = true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
toggleAll(isSelected) {
|
|
117
|
+
if (isSelected) {
|
|
118
|
+
this.selectField.options.forEach(option => option.deselect());
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.selectField.options.forEach(option => option.select());
|
|
122
|
+
}
|
|
123
|
+
this.allSelected = !this.allSelected;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
SelectFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
+
SelectFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SelectFieldComponent, isStandalone: true, selector: "crispr-select-field", viewQueries: [{ propertyName: "selectField", first: true, predicate: ["selectField"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControlName]=\"config.controlName\"\n [placeholder]=\"config.placeholder\"\n [multiple]=\"config.multiple\">\n\n <mat-checkbox\n [color]=\"config.color\"\n [checked]=\"allSelected\"\n *ngIf=\"config?.multiple && config.enableToggleAll\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n <mat-option\n *ngFor=\"let option of options$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type:
|
|
128
|
+
// CrisprFieldDirective,
|
|
129
|
+
FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SelectFieldComponent, decorators: [{
|
|
131
|
+
type: Component,
|
|
132
|
+
args: [{ selector: 'crispr-select-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
133
|
+
CommonModule,
|
|
134
|
+
InfoComponent,
|
|
135
|
+
OptionComponent,
|
|
136
|
+
MatCheckboxModule,
|
|
137
|
+
MatSelectModule,
|
|
138
|
+
ReactiveFormsModule,
|
|
139
|
+
// CrisprFieldDirective,
|
|
140
|
+
FieldContainerComponent,
|
|
141
|
+
MatFormFieldModule,
|
|
142
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControlName]=\"config.controlName\"\n [placeholder]=\"config.placeholder\"\n [multiple]=\"config.multiple\">\n\n <mat-checkbox\n [color]=\"config.color\"\n [checked]=\"allSelected\"\n *ngIf=\"config?.multiple && config.enableToggleAll\"\n (click)=\"toggleAll(allSelected)\">\n Select All\n </mat-checkbox>\n <mat-option\n *ngFor=\"let option of options$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: ["mat-checkbox{display:block;padding:16px}\n"] }]
|
|
143
|
+
}], propDecorators: { selectField: [{
|
|
144
|
+
type: ViewChild,
|
|
145
|
+
args: ['selectField']
|
|
146
|
+
}] } });
|
|
147
|
+
|
|
148
|
+
const defaultConfig$6 = {
|
|
149
|
+
autoActiveFirstOption: true,
|
|
150
|
+
typeDebounceTime: 500,
|
|
151
|
+
emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE
|
|
152
|
+
};
|
|
153
|
+
class AutocompleteFieldComponent extends AbstractAutocompleteComponent {
|
|
154
|
+
constructor() {
|
|
155
|
+
super(...arguments);
|
|
156
|
+
this.defaultConfig = defaultConfig$6;
|
|
157
|
+
}
|
|
158
|
+
ngOnInit() {
|
|
159
|
+
super.ngOnInit();
|
|
160
|
+
this.clearFieldSubscription = this.autocompleteInputControl.valueChanges.subscribe((text) => {
|
|
161
|
+
if (typeof text === 'string' && (text === null || text === void 0 ? void 0 : text.trim()) === '') {
|
|
162
|
+
this.control.setValue(null);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
ngOnDestroy() {
|
|
167
|
+
this.clearFieldSubscription.unsubscribe();
|
|
168
|
+
}
|
|
169
|
+
setControlValue(value) {
|
|
170
|
+
if (this.control && value) {
|
|
171
|
+
// sets the initial value on the control if one is passed
|
|
172
|
+
this.control.setValue(value.value || '');
|
|
173
|
+
this.autocompleteInputControl.setValue(value.label || '');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The material autocomplete defaults to displaying the options value instead of its label.
|
|
178
|
+
* We only have the value from the selected option to work with, so we have to pass the options
|
|
179
|
+
* through a function called in the template and return the function that the material displayWith
|
|
180
|
+
* input is expecting.
|
|
181
|
+
* @param options the array of options to search for option with corresponding value
|
|
182
|
+
*/
|
|
183
|
+
displayLabel(options) {
|
|
184
|
+
if (this.config.displayWith) {
|
|
185
|
+
return this.config.displayWith(options);
|
|
186
|
+
}
|
|
187
|
+
return (value) => {
|
|
188
|
+
var _a;
|
|
189
|
+
const label = !!options && Array.isArray(options)
|
|
190
|
+
? (_a = options.find((option) => JSON.stringify(option.value) === JSON.stringify(value))) === null || _a === void 0 ? void 0 : _a.label : value;
|
|
191
|
+
return label;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
handleSelect(event) {
|
|
195
|
+
this.control.setValue(event.option.value);
|
|
196
|
+
this.autoInputRef.nativeElement.blur();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
AutocompleteFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
200
|
+
AutocompleteFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: AutocompleteFieldComponent, isStandalone: true, selector: "crispr-autocomplete-field", viewQueries: [{ propertyName: "autoInput", first: true, predicate: ["autoInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "autoInputRef", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matAutocomplete]=\"auto\"\n role=\"textbox\"\n type=\"textbox\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"displayLabel(options$ | async)\">\n\n <ng-container *ngIf=\"options$ | async as options; else emptyOption\">\n <ng-container *ngIf=\"options.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of options\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n\n </mat-autocomplete>\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", styles: [".hidden-error-directive-anchor{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatOptionModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteFieldComponent, decorators: [{
|
|
202
|
+
type: Component,
|
|
203
|
+
args: [{ selector: 'crispr-autocomplete-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
204
|
+
CommonModule,
|
|
205
|
+
InfoComponent,
|
|
206
|
+
OptionComponent,
|
|
207
|
+
ReactiveFormsModule,
|
|
208
|
+
FieldContainerComponent,
|
|
209
|
+
MatAutocompleteModule,
|
|
210
|
+
MatInputModule,
|
|
211
|
+
MatOptionModule,
|
|
212
|
+
], template: "\n<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matAutocomplete]=\"auto\"\n role=\"textbox\"\n type=\"textbox\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput>\n\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"displayLabel(options$ | async)\">\n\n <ng-container *ngIf=\"options$ | async as options; else emptyOption\">\n <ng-container *ngIf=\"options.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of options\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n\n </mat-autocomplete>\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", styles: [".hidden-error-directive-anchor{display:none}\n"] }]
|
|
213
|
+
}], propDecorators: { autoInput: [{
|
|
214
|
+
type: ViewChild,
|
|
215
|
+
args: ['autoInput', { read: MatAutocompleteTrigger }]
|
|
216
|
+
}], autoInputRef: [{
|
|
217
|
+
type: ViewChild,
|
|
218
|
+
args: ['autoInput']
|
|
219
|
+
}] } });
|
|
220
|
+
|
|
221
|
+
const defaultConfig$5 = {
|
|
222
|
+
chipsSelectable: true,
|
|
223
|
+
areChipsRemovable: true,
|
|
224
|
+
tabToSelect: true,
|
|
225
|
+
autoActiveFirstOption: true,
|
|
226
|
+
imageUrlParam: 'image',
|
|
227
|
+
typeDebounceTime: 500,
|
|
228
|
+
allowDuplicates: false,
|
|
229
|
+
duplicateCompareFunction: (chip, option) => chip.value === option.value,
|
|
230
|
+
separatorKeyCodes: [ENTER],
|
|
231
|
+
emptyOptionsMessage: DEFAULT_EMPTY_OPTIONS_MESSAGE,
|
|
232
|
+
};
|
|
233
|
+
class AutocompleteChiplistFieldComponent extends AbstractAutocompleteComponent {
|
|
234
|
+
constructor() {
|
|
235
|
+
super(...arguments);
|
|
236
|
+
this.defaultConfig = defaultConfig$5;
|
|
237
|
+
this.chips$ = new BehaviorSubject([]);
|
|
238
|
+
this.controlValue$ = this.chips$.pipe(tap(chips => {
|
|
239
|
+
this.control.setValue(chips.map(chip => chip.value));
|
|
240
|
+
}));
|
|
241
|
+
}
|
|
242
|
+
ngOnInit() {
|
|
243
|
+
super.ngOnInit();
|
|
244
|
+
this.remainingOptions$ = combineLatest([
|
|
245
|
+
this.chips$,
|
|
246
|
+
this.options$
|
|
247
|
+
]).pipe(map(([chips, options]) => {
|
|
248
|
+
return this.config.allowDuplicates
|
|
249
|
+
? options
|
|
250
|
+
: options === null || options === void 0 ? void 0 : options.filter(option => {
|
|
251
|
+
return !chips.some(chip => this.config.duplicateCompareFunction(chip, option));
|
|
252
|
+
});
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
setControlValue(value) {
|
|
256
|
+
if (value) {
|
|
257
|
+
this.chips$.next(value);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
// handles mat selecting
|
|
261
|
+
handleSelect(event) {
|
|
262
|
+
const selectedOption = event.option.value;
|
|
263
|
+
this.chips$.next([...this.chips$.value, selectedOption]);
|
|
264
|
+
this.chipInputRef.nativeElement.value = '';
|
|
265
|
+
this.autocompleteInputControl.setValue('');
|
|
266
|
+
// setTimeout needed because the panel thinks it's still open at this point
|
|
267
|
+
setTimeout(() => this.chipInput.openPanel());
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* To follow ARIA standards we want to select the active option on blur.
|
|
271
|
+
* matChipInputAddOnBlur should do this but it causes buggy behaviour
|
|
272
|
+
* @param event blur event that triggers the handle blur
|
|
273
|
+
*/
|
|
274
|
+
handleTab(_event) {
|
|
275
|
+
if (this.chipInput.activeOption && (this.config.tabToSelect || this.config.addChipOnBlur)) {
|
|
276
|
+
const chip = this.chipInput.activeOption.value;
|
|
277
|
+
this.chips$.next([...this.chips$.value, chip]);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Handles selection via key tokens passed through separatorKeyCodes propert
|
|
282
|
+
* NOTE: If TAB is used focus does not move on to next component
|
|
283
|
+
* @param event
|
|
284
|
+
*/
|
|
285
|
+
handleTokenEnd(event) {
|
|
286
|
+
var _a;
|
|
287
|
+
if (this.chipInput.activeOption) {
|
|
288
|
+
this.chipInput.activeOption.select();
|
|
289
|
+
}
|
|
290
|
+
(_a = event.chipInput) === null || _a === void 0 ? void 0 : _a.clear();
|
|
291
|
+
}
|
|
292
|
+
mapToLabel(option) {
|
|
293
|
+
return option ? option.label : '';
|
|
294
|
+
}
|
|
295
|
+
removeChip(removedChip) {
|
|
296
|
+
const remainingChips = this.chips$.value.filter(chip => chip !== removedChip);
|
|
297
|
+
this.chips$.next(remainingChips);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
AutocompleteChiplistFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteChiplistFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
301
|
+
AutocompleteChiplistFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: AutocompleteChiplistFieldComponent, isStandalone: true, selector: "crispr-autocomplete-chiplist-field", viewQueries: [{ propertyName: "chipInput", first: true, predicate: ["autoInput"], descendants: true, read: MatAutocompleteTrigger }, { propertyName: "chipInputRef", first: true, predicate: ["autoInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n\n <mat-chip-list\n #chipList>\n <mat-chip\n class=\"refinement-chip\"\n *ngFor=\"let chip of controlValue$ | async\"\n [selectable]=\"config.chipsSelectable\"\n [removable]=\"config.areChipsRemovable\"\n (removed)=\"removeChip(chip)\">\n <span *ngIf=\"chip.imageUrl as imageUrl\" class=\"image-container\">\n <img [src]=\"imageUrl\" alt=\"image of {{chip.label}}\">\n </span>\n {{chip.label}}\n <mat-icon\n matChipRemove\n *ngIf=\"config.areChipsRemovable\">\n cancel\n </mat-icon>\n </mat-chip>\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"auto\"\n (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config.separatorKeyCodes\"\n (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\"\n type=\"text\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput/>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n </mat-chip-list>\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"this.config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"mapToLabel\">\n <ng-container *ngIf=\"remainingOptions$ | async as remainingOptions; else emptyOption\">\n <ng-container *ngIf=\"remainingOptions.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of remainingOptions$ | async\"\n [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n </mat-autocomplete>\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", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i3$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i3$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i7.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i7.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutocompleteChiplistFieldComponent, decorators: [{
|
|
303
|
+
type: Component,
|
|
304
|
+
args: [{ selector: 'crispr-autocomplete-chiplist-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
305
|
+
CommonModule,
|
|
306
|
+
InfoComponent,
|
|
307
|
+
OptionComponent,
|
|
308
|
+
ReactiveFormsModule,
|
|
309
|
+
FieldContainerComponent,
|
|
310
|
+
MatAutocompleteModule,
|
|
311
|
+
MatInputModule,
|
|
312
|
+
MatOptionModule,
|
|
313
|
+
MatChipsModule,
|
|
314
|
+
MatIconModule
|
|
315
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-form-field\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n\n <mat-chip-list\n #chipList>\n <mat-chip\n class=\"refinement-chip\"\n *ngFor=\"let chip of controlValue$ | async\"\n [selectable]=\"config.chipsSelectable\"\n [removable]=\"config.areChipsRemovable\"\n (removed)=\"removeChip(chip)\">\n <span *ngIf=\"chip.imageUrl as imageUrl\" class=\"image-container\">\n <img [src]=\"imageUrl\" alt=\"image of {{chip.label}}\">\n </span>\n {{chip.label}}\n <mat-icon\n matChipRemove\n *ngIf=\"config.areChipsRemovable\">\n cancel\n </mat-icon>\n </mat-chip>\n <input class=\"hidden-error-directive-anchor\" [formControlName]=\"config.controlName\" type=\"text\"/>\n\n <input\n matInput\n [formControl]=\"autocompleteInputControl\"\n [placeholder]=\"config.placeholder\"\n [matChipInputFor]=\"chipList\"\n [matAutocomplete]=\"auto\"\n (keydown.tab)=\"handleTab($event)\"\n [matChipInputSeparatorKeyCodes]=\"config.separatorKeyCodes\"\n (matChipInputTokenEnd)=\"handleTokenEnd($event)\"\n role=\"searchbox\"\n type=\"text\"\n autocapitalize=\"off\"\n autocorrect=\"off\"\n spellcheck=\"false\"\n #autoInput/>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info \">\n </crispr-info>\n\n </mat-chip-list>\n <mat-autocomplete\n #auto=\"matAutocomplete\"\n [autoActiveFirstOption]=\"this.config.autoActiveFirstOption\"\n (optionSelected)=\"handleSelect($event)\"\n [displayWith]=\"mapToLabel\">\n <ng-container *ngIf=\"remainingOptions$ | async as remainingOptions; else emptyOption\">\n <ng-container *ngIf=\"remainingOptions.length > 0; else emptyOption\">\n <mat-option\n *ngFor=\"let option of remainingOptions$ | async\"\n [value]=\"option\">\n <crispr-option [option]=\"option\"></crispr-option>\n </mat-option>\n </ng-container>\n\n </ng-container>\n <ng-template #emptyOption>\n <mat-option disabled=\"true\">\n {{config.emptyOptionsMessage}}\n </mat-option>\n </ng-template>\n </mat-autocomplete>\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", styles: [".refinement-chip .image-container{width:26px;height:26px;border-radius:50%;overflow:hidden;margin:-2px 4px -2px -8px}.refinement-chip .image-container img{width:100%;height:100%;object-fit:cover}.hidden-error-directive-anchor{display:none}\n"] }]
|
|
316
|
+
}], propDecorators: { chipInput: [{
|
|
317
|
+
type: ViewChild,
|
|
318
|
+
args: ['autoInput', { read: MatAutocompleteTrigger }]
|
|
319
|
+
}], chipInputRef: [{
|
|
320
|
+
type: ViewChild,
|
|
321
|
+
args: ['autoInput']
|
|
322
|
+
}] } });
|
|
323
|
+
|
|
324
|
+
const defaultConfig$4 = {
|
|
325
|
+
labelPosition: 'after',
|
|
326
|
+
inline: false
|
|
327
|
+
};
|
|
328
|
+
const CheckboxFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
329
|
+
class CheckboxFieldComponent extends CheckboxFieldMixin {
|
|
330
|
+
constructor() {
|
|
331
|
+
super(...arguments);
|
|
332
|
+
this.defaultConfig = defaultConfig$4;
|
|
333
|
+
}
|
|
334
|
+
ngOnInit() {
|
|
335
|
+
super.ngOnInit();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
CheckboxFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CheckboxFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
339
|
+
CheckboxFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: CheckboxFieldComponent, isStandalone: true, selector: "crispr-checkbox-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [inlineField]=\"config.inline\">\n <div\n [formGroup]=\"group\">\n <mat-checkbox\n [color]=\"config.color\"\n [labelPosition]=\"config.labelPosition\"\n [formControlName]=\"config.controlName\">\n {{config.label}}\n <crispr-info\n matSuffix *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type:
|
|
340
|
+
// CrisprFieldDirective,
|
|
341
|
+
FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
342
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CheckboxFieldComponent, decorators: [{
|
|
343
|
+
type: Component,
|
|
344
|
+
args: [{ selector: 'crispr-checkbox-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
345
|
+
CommonModule,
|
|
346
|
+
InfoComponent,
|
|
347
|
+
MatCheckboxModule,
|
|
348
|
+
ReactiveFormsModule,
|
|
349
|
+
// CrisprFieldDirective,
|
|
350
|
+
FieldContainerComponent
|
|
351
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\"\n [inlineField]=\"config.inline\">\n <div\n [formGroup]=\"group\">\n <mat-checkbox\n [color]=\"config.color\"\n [labelPosition]=\"config.labelPosition\"\n [formControlName]=\"config.controlName\">\n {{config.label}}\n <crispr-info\n matSuffix *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-checkbox>\n </div>\n</crispr-field-container>\n", styles: ["mat-checkbox{height:42px}\n"] }]
|
|
352
|
+
}] });
|
|
353
|
+
|
|
354
|
+
const defaultConfig$3 = { rows: 5 };
|
|
355
|
+
const TextareaFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
356
|
+
class TextareaFieldComponent extends TextareaFieldMixin {
|
|
357
|
+
constructor() {
|
|
358
|
+
super(...arguments);
|
|
359
|
+
this.defaultConfig = defaultConfig$3;
|
|
360
|
+
}
|
|
361
|
+
ngOnInit() {
|
|
362
|
+
super.ngOnInit();
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
TextareaFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: TextareaFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
366
|
+
TextareaFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: TextareaFieldComponent, isStandalone: true, selector: "crispr-textarea-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 <textarea\n [rows]=\"config.rows\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\">\n </textarea>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && control.valid\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: TextareaFieldComponent, decorators: [{
|
|
368
|
+
type: Component,
|
|
369
|
+
args: [{ selector: 'crispr-textarea-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
370
|
+
CommonModule,
|
|
371
|
+
InfoComponent,
|
|
372
|
+
ReactiveFormsModule,
|
|
373
|
+
FieldContainerComponent,
|
|
374
|
+
MatFormFieldModule,
|
|
375
|
+
MatInputModule,
|
|
376
|
+
], 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 <textarea\n [rows]=\"config.rows\"\n matInput\n [placeholder]=\"config.placeholder\"\n [formControlName]=\"config.controlName\">\n </textarea>\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n *ngIf=\"config.info\"\n matSuffix\n [info]=\"config.info\">\n </crispr-info>\n\n <mat-hint *ngIf=\"config.hint && control.valid\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n" }]
|
|
377
|
+
}] });
|
|
378
|
+
|
|
379
|
+
const defaultConfig$2 = { displayLimits: true };
|
|
380
|
+
const SliderFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
381
|
+
class SliderFieldComponent extends SliderFieldMixin {
|
|
382
|
+
constructor() {
|
|
383
|
+
super();
|
|
384
|
+
this.defaultConfig = defaultConfig$2;
|
|
385
|
+
}
|
|
386
|
+
get flexDirection() {
|
|
387
|
+
return this.config.vertical ? 'column' : 'row';
|
|
388
|
+
}
|
|
389
|
+
ngOnInit() {
|
|
390
|
+
super.ngOnInit();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
SliderFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SliderFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
394
|
+
SliderFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: SliderFieldComponent, isStandalone: true, selector: "crispr-slider-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <div\n [formGroup]=\"group\">\n <label *ngIf=\"config.label\">\n {{config.label}}\n <crispr-info\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </label>\n <div class=\"slider-container\"\n [ngStyle]=\"{'flex-direction': flexDirection}\">\n <span *ngIf=\"config.displayLimits\">\n {{config.min}}\n </span>\n <mat-slider\n class=\"example-margin\"\n [formControlName]=\"config.controlName\"\n [invert]=\"config.invert\"\n [max]=\"config.max\"\n [min]=\"config.min\"\n [step]=\"config.step\"\n [thumbLabel]=\"config.thumbLabel\"\n [tickInterval]=\"config.tickInterval\"\n [vertical]=\"config.vertical\">\n </mat-slider>\n <span *ngIf=\"config.displayLimits\">\n {{config.max}}\n </span>\n </div>\n\n </div>\n</crispr-field-container>\n\n", styles: [".slider-container{display:flex;align-items:center}.slider-container .mat-slider-horizontal{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i3$3.MatSlider, selector: "mat-slider", inputs: ["disabled", "color", "tabIndex", "invert", "max", "min", "step", "thumbLabel", "tickInterval", "value", "displayWith", "valueText", "vertical"], outputs: ["change", "input", "valueChange"], exportAs: ["matSlider"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: SliderFieldComponent, decorators: [{
|
|
396
|
+
type: Component,
|
|
397
|
+
args: [{ selector: 'crispr-slider-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
398
|
+
CommonModule,
|
|
399
|
+
InfoComponent,
|
|
400
|
+
OptionComponent,
|
|
401
|
+
FieldContainerComponent,
|
|
402
|
+
ReactiveFormsModule,
|
|
403
|
+
MatSliderModule
|
|
404
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <div\n [formGroup]=\"group\">\n <label *ngIf=\"config.label\">\n {{config.label}}\n <crispr-info\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </label>\n <div class=\"slider-container\"\n [ngStyle]=\"{'flex-direction': flexDirection}\">\n <span *ngIf=\"config.displayLimits\">\n {{config.min}}\n </span>\n <mat-slider\n class=\"example-margin\"\n [formControlName]=\"config.controlName\"\n [invert]=\"config.invert\"\n [max]=\"config.max\"\n [min]=\"config.min\"\n [step]=\"config.step\"\n [thumbLabel]=\"config.thumbLabel\"\n [tickInterval]=\"config.tickInterval\"\n [vertical]=\"config.vertical\">\n </mat-slider>\n <span *ngIf=\"config.displayLimits\">\n {{config.max}}\n </span>\n </div>\n\n </div>\n</crispr-field-container>\n\n", styles: [".slider-container{display:flex;align-items:center}.slider-container .mat-slider-horizontal{width:100%}\n"] }]
|
|
405
|
+
}], ctorParameters: function () { return []; } });
|
|
406
|
+
|
|
407
|
+
class ButtonComponent extends CrisprFieldComponent {
|
|
408
|
+
constructor() {
|
|
409
|
+
super(...arguments);
|
|
410
|
+
this.defaultConfig = { buttonType: 'raised', type: 'submit' };
|
|
411
|
+
}
|
|
412
|
+
get matButtonClass() {
|
|
413
|
+
return this.config.buttonType ? `mat-${this.config.buttonType}-button` : '';
|
|
414
|
+
}
|
|
415
|
+
ngOnInit() {
|
|
416
|
+
super.ngOnInit();
|
|
417
|
+
this.formValid$ = this.group.statusChanges.pipe(map(status => status === 'VALID'), startWith(this.group.valid));
|
|
418
|
+
}
|
|
419
|
+
handleClick(group, event) {
|
|
420
|
+
if (this.config.callback) {
|
|
421
|
+
this.config.callback(group, event);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
ButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
426
|
+
ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: ButtonComponent, isStandalone: true, selector: "crispr-button", usesInheritance: true, ngImport: i0, template: "<button\n [formGroup]=\"group\"\n mat-button\n [ngClass]=\"matButtonClass\"\n [color]=\"config.color\"\n [disabled]=\"config.disabledOnInvalidForm && !(formValid$ | async)\"\n [type]=\"config.type\"\n (click)=\"handleClick(group, $event)\"\n [matTooltip]=\"config.info?.content\"\n [matTooltipPosition]=\"config.info?.tooltipPosition || 'below'\">\n {{ config.label }}\n <mat-icon *ngIf=\"config.icon\">\n {{ config.icon}}\n </mat-icon>\n</button>\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
427
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
428
|
+
type: Component,
|
|
429
|
+
args: [{ selector: 'crispr-button', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
430
|
+
CommonModule,
|
|
431
|
+
MatButtonModule,
|
|
432
|
+
MatIconModule,
|
|
433
|
+
MatTooltipModule,
|
|
434
|
+
ReactiveFormsModule,
|
|
435
|
+
], template: "<button\n [formGroup]=\"group\"\n mat-button\n [ngClass]=\"matButtonClass\"\n [color]=\"config.color\"\n [disabled]=\"config.disabledOnInvalidForm && !(formValid$ | async)\"\n [type]=\"config.type\"\n (click)=\"handleClick(group, $event)\"\n [matTooltip]=\"config.info?.content\"\n [matTooltipPosition]=\"config.info?.tooltipPosition || 'below'\">\n {{ config.label }}\n <mat-icon *ngIf=\"config.icon\">\n {{ config.icon}}\n </mat-icon>\n</button>\n\n" }]
|
|
436
|
+
}] });
|
|
437
|
+
|
|
438
|
+
const defaultConfig$1 = {
|
|
439
|
+
startView: 'month',
|
|
440
|
+
};
|
|
441
|
+
const DatepickerFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
442
|
+
class DatepickerFieldComponent extends DatepickerFieldMixin {
|
|
443
|
+
constructor() {
|
|
444
|
+
super(...arguments);
|
|
445
|
+
this.defaultConfig = defaultConfig$1;
|
|
446
|
+
}
|
|
447
|
+
ngOnInit() {
|
|
448
|
+
var _a, _b;
|
|
449
|
+
super.ngOnInit();
|
|
450
|
+
this.startAt$ = this.config.startAt instanceof Date
|
|
451
|
+
? of(this.config.startAt)
|
|
452
|
+
: this.config.startAt instanceof Function
|
|
453
|
+
? this.config.startAt(this.group)
|
|
454
|
+
: of(null);
|
|
455
|
+
this.dateClass = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.cellClassFunction) || null;
|
|
456
|
+
this.dateClass$ = this.config.dateClass ? (_b = this.config) === null || _b === void 0 ? void 0 : _b.dateClass(this.group) : of(() => '');
|
|
457
|
+
}
|
|
458
|
+
ngAfterContentInit() {
|
|
459
|
+
if (this.config.datepickerActions) {
|
|
460
|
+
this.calendarFooterPortal = new ComponentPortal(this.config.datepickerActions);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
DatepickerFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DatepickerFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
465
|
+
DatepickerFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", 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$3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2$3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i2$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$3.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDateFnsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DatepickerFieldComponent, decorators: [{
|
|
467
|
+
type: Component,
|
|
468
|
+
args: [{ selector: 'crispr-datepicker-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
469
|
+
CommonModule,
|
|
470
|
+
FieldContainerComponent,
|
|
471
|
+
MatDatepickerModule,
|
|
472
|
+
MatFormFieldModule,
|
|
473
|
+
ReactiveFormsModule,
|
|
474
|
+
MatInputModule,
|
|
475
|
+
MatDateFnsModule,
|
|
476
|
+
PortalModule
|
|
477
|
+
], 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" }]
|
|
478
|
+
}] });
|
|
479
|
+
|
|
480
|
+
class DividerComponent extends CrisprFieldComponent {
|
|
481
|
+
constructor() {
|
|
482
|
+
super(...arguments);
|
|
483
|
+
// TODO: pull in type after configs are better organized
|
|
484
|
+
this.defaultConfig = {};
|
|
485
|
+
}
|
|
486
|
+
ngOnInit() {
|
|
487
|
+
super.ngOnInit();
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
DividerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
491
|
+
DividerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: DividerComponent, isStandalone: true, selector: "crispr-divider", usesInheritance: true, ngImport: i0, template: "<mat-divider [ngClass]=\"config.classes\"></mat-divider>", styles: [":host{display:block;padding:1em 0}::ng-deep .mat-divider.mat-divider-horizontal{position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i2$4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }], preserveWhitespaces: true });
|
|
492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DividerComponent, decorators: [{
|
|
493
|
+
type: Component,
|
|
494
|
+
args: [{ selector: 'crispr-divider', standalone: true, imports: [
|
|
495
|
+
CommonModule,
|
|
496
|
+
MatDividerModule
|
|
497
|
+
], template: "<mat-divider [ngClass]=\"config.classes\"></mat-divider>", styles: [":host{display:block;padding:1em 0}::ng-deep .mat-divider.mat-divider-horizontal{position:relative}\n"] }]
|
|
498
|
+
}] });
|
|
499
|
+
|
|
500
|
+
const RadioFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
501
|
+
class RadioFieldComponent extends RadioFieldMixin {
|
|
502
|
+
constructor() {
|
|
503
|
+
super(...arguments);
|
|
504
|
+
this.defaultConfig = {};
|
|
505
|
+
}
|
|
506
|
+
ngOnInit() {
|
|
507
|
+
super.ngOnInit();
|
|
508
|
+
// options$ can be passed as an array, promise that resolves array, or observable that resolves array
|
|
509
|
+
// this functions accounts for all possibilities and converts to observable that resolves array
|
|
510
|
+
this.options$ = observablifyOptions(this.config.options, this.group);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
RadioFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: RadioFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
514
|
+
RadioFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: RadioFieldComponent, isStandalone: true, selector: "crispr-radio-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-radio-group\n [formControl]=\"control\"\n [color]=\"config.color\">\n <mat-radio-button class=\"example-radio-button\" *ngFor=\"let option of options$ | async\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "directive", type: i3$4.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i3$4.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: RadioFieldComponent, decorators: [{
|
|
516
|
+
type: Component,
|
|
517
|
+
args: [{ selector: 'crispr-radio-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
518
|
+
CommonModule,
|
|
519
|
+
ReactiveFormsModule,
|
|
520
|
+
FieldContainerComponent,
|
|
521
|
+
MatRadioModule,
|
|
522
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n\n <mat-radio-group\n [formControl]=\"control\"\n [color]=\"config.color\">\n <mat-radio-button class=\"example-radio-button\" *ngFor=\"let option of options$ | async\" [value]=\"option.value\">\n {{option.label}}\n </mat-radio-button>\n </mat-radio-group>\n</crispr-field-container>\n", styles: ["mat-radio-button{padding:12px}\n"] }]
|
|
523
|
+
}] });
|
|
524
|
+
|
|
525
|
+
const defaultConfig = {};
|
|
526
|
+
const UnitConversionFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
527
|
+
class UnitConversionFieldComponent extends UnitConversionFieldMixin {
|
|
528
|
+
constructor() {
|
|
529
|
+
super(...arguments);
|
|
530
|
+
this.defaultConfig = defaultConfig;
|
|
531
|
+
this.displayValueControl = new FormControl();
|
|
532
|
+
this.unitSelectControl = new FormControl();
|
|
533
|
+
}
|
|
534
|
+
ngOnInit() {
|
|
535
|
+
var _a, _b;
|
|
536
|
+
super.ngOnInit();
|
|
537
|
+
// TODO: Validators need work. validation is tricky because the input needs to be validated against but the validator will compare against the controls value
|
|
538
|
+
// this.displayValueControl.setValidators(this.config.validators);
|
|
539
|
+
const controlValuePipeline = [
|
|
540
|
+
this.displayValueControl.valueChanges.pipe(startWith(this.displayValueControl.value))
|
|
541
|
+
];
|
|
542
|
+
// setup all required pieces when showing a field for selecting units
|
|
543
|
+
if (this.config.showUnitSelect) {
|
|
544
|
+
this.unitOptions$ = observablifyOptions(this.config.selectableUnits, this.group);
|
|
545
|
+
controlValuePipeline.push(this.unitSelectControl.valueChanges.pipe(startWith(((_a = this.config) === null || _a === void 0 ? void 0 : _a.initialDisplayUnit) || null)));
|
|
546
|
+
this.unitSelectControl.setValue(((_b = this.config) === null || _b === void 0 ? void 0 : _b.initialDisplayUnit) || null);
|
|
547
|
+
}
|
|
548
|
+
this.transformationSubscription = combineLatest(controlValuePipeline).subscribe(([displayValue, unitValue]) => {
|
|
549
|
+
const computedValue = this.config.storedValueConversion(displayValue, unitValue);
|
|
550
|
+
this.control.setValue(computedValue);
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
ngOnDestroy() {
|
|
554
|
+
this.transformationSubscription.unsubscribe();
|
|
555
|
+
}
|
|
556
|
+
setInitialDisplayValue(storedValue, unit) {
|
|
557
|
+
const initialDisplayValue = this.config.initialDisplayValueConversion(storedValue || null, unit);
|
|
558
|
+
this.displayValueControl.setValue(initialDisplayValue);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* We override the 'setControlValue' we inherited from crisprControlMixin and add our custom logic,
|
|
562
|
+
* This function gets called onInit because were object oriented. it's so great, so great that I'm
|
|
563
|
+
* typing a paragraph to explain what the hell is going on...
|
|
564
|
+
* @param value the initial value for the control passed down from the form components input
|
|
565
|
+
*/
|
|
566
|
+
setControlValue(value) {
|
|
567
|
+
var _a;
|
|
568
|
+
const initialUnitValue = this.config.showUnitSelect ? (_a = this.config) === null || _a === void 0 ? void 0 : _a.initialDisplayUnit : null;
|
|
569
|
+
this.setInitialDisplayValue(value, initialUnitValue);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
UnitConversionFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: UnitConversionFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
573
|
+
UnitConversionFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: UnitConversionFieldComponent, isStandalone: true, selector: "crispr-unit-conversion-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: InfoComponent, selector: "crispr-info", inputs: ["info"] }, { kind: "component", type: OptionComponent, selector: "crispr-option", inputs: ["option"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i4$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "ngmodule", type: MatOptionModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
574
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: UnitConversionFieldComponent, decorators: [{
|
|
575
|
+
type: Component,
|
|
576
|
+
args: [{ selector: 'crispr-unit-conversion-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
577
|
+
CommonModule,
|
|
578
|
+
InfoComponent,
|
|
579
|
+
OptionComponent,
|
|
580
|
+
ReactiveFormsModule,
|
|
581
|
+
FieldContainerComponent,
|
|
582
|
+
MatInputModule,
|
|
583
|
+
MatSelectModule,
|
|
584
|
+
MatOptionModule,
|
|
585
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field\n [style.width.%]=\"config.showUnitSelect ? 60 : 100\"\n class=\"number-field\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <input\n type=\"number\"\n matInput\n [formControl]=\"displayValueControl\"\n [placeholder]=\"config.placeholder\"\n [min]=\"config.min\"\n [max]=\"config.max\"\n [step]=\"config.step\"\n [autofocus]=\"config.autofocus\">\n <span *ngIf=\"config.fieldSuffix\" matSuffix>{{config.fieldSuffix}}</span>\n <crispr-info\n matSuffix\n *ngIf=\"config.info\"\n [info]=\"config.info\">\n </crispr-info>\n </mat-form-field>\n\n <mat-form-field\n *ngIf=\"config.showUnitSelect\"\n [color]=\"config.color\"\n [appearance]=\"config.appearance\"\n [formGroup]=\"group\"\n class=\"unit-field\">\n <mat-label *ngIf=\"config.label\">\n {{config.label}}\n </mat-label>\n <mat-select\n #selectField\n [formControl]=\"unitSelectControl\">\n\n <mat-option\n *ngFor=\"let option of unitOptions$ | async\"\n [value]=\"option.value\">\n <crispr-option [option]=\"option\">\n </crispr-option>\n </mat-option>\n\n </mat-select>\n\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n\n </mat-form-field>\n\n</crispr-field-container>\n", styles: [".unit-field{width:40%;margin-left:16px}:host ::ng-deep .field-container{display:flex}\n"] }]
|
|
586
|
+
}] });
|
|
587
|
+
|
|
588
|
+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
|
|
589
|
+
const FileUploadFieldMixin = crisprControlMixin(CrisprFieldComponent);
|
|
590
|
+
class FileUploadFieldComponent extends FileUploadFieldMixin {
|
|
591
|
+
// ngControl: NgControl = null;
|
|
592
|
+
constructor(ngControl) {
|
|
593
|
+
super();
|
|
594
|
+
this.ngControl = ngControl;
|
|
595
|
+
this.defaultConfig = {
|
|
596
|
+
allowMultipleFiles: false,
|
|
597
|
+
acceptedTypes: '*.*',
|
|
598
|
+
dropZoneText: 'DROP FILE HERE',
|
|
599
|
+
selectFilesButtonType: 'button',
|
|
600
|
+
selectButtonText: 'SELECT',
|
|
601
|
+
showClearFilesButton: true,
|
|
602
|
+
clearFilesButtonText: 'CLEAR',
|
|
603
|
+
uploadButtonText: 'UPLOAD',
|
|
604
|
+
uploadButtonType: 'button',
|
|
605
|
+
showUploadProgress: false,
|
|
606
|
+
disableOnUpload: true
|
|
607
|
+
};
|
|
608
|
+
this.isUploaded = false;
|
|
609
|
+
this.fileProgress = [];
|
|
610
|
+
if (this.ngControl != null) {
|
|
611
|
+
// Setting the value accessor directly (instead of using
|
|
612
|
+
// the providers) to avoid running into a circular import.
|
|
613
|
+
ngControl.valueAccessor = this;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
ngOnInit() {
|
|
617
|
+
super.ngOnInit();
|
|
618
|
+
this.disabled$ = this.config.disabledCallback
|
|
619
|
+
? this.config.disabledCallback(this.group)
|
|
620
|
+
: of(false);
|
|
621
|
+
}
|
|
622
|
+
filesChanged(files) {
|
|
623
|
+
if (files && files.length > 0) {
|
|
624
|
+
this.selectedFiles = files;
|
|
625
|
+
this.control.patchValue(files);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
uploadFiles() {
|
|
629
|
+
if (this.selectedFiles && this.config.uploadFiles) {
|
|
630
|
+
this.isUploaded = true;
|
|
631
|
+
this.config.uploadFiles(this.group, this.selectedFiles, this);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
resetFileInput() {
|
|
635
|
+
this.fileInputRef.nativeElement.value = '';
|
|
636
|
+
this.control.patchValue(null);
|
|
637
|
+
this.isUploaded = false;
|
|
638
|
+
}
|
|
639
|
+
writeValue(value) {
|
|
640
|
+
// clear file input
|
|
641
|
+
// this.host.nativeElement.value = '';
|
|
642
|
+
// this.file = null;
|
|
643
|
+
}
|
|
644
|
+
registerOnChange(fn) {
|
|
645
|
+
this.onChange = fn;
|
|
646
|
+
}
|
|
647
|
+
registerOnTouched(fn) {
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
FileUploadFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, deps: [{ token: i2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
651
|
+
FileUploadFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: FileUploadFieldComponent, isStandalone: true, selector: "crispr-file-upload-field", viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n appearance=\"outline\"\n [crisprFileDropzone]=\"!(disabled$ | async) && !(config.disableOnUpload && isUploaded)\"\n [formGroup]=\"group\"\n (fileDrop)=\"filesChanged($event)\">\n\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n style=\"display: none\"\n [accept]=\"config.acceptedTypes\"\n [multiple]=\"config.allowMultipleFiles\"\n (change)=\"filesChanged($event.target.files)\"/>\n <mat-label>{{config.label}}</mat-label>\n\n <div *ngIf=\"!(selectedFiles?.length > 0); else selectedFileList\" class=\"drop-info\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n or\n <button\n mat-raised-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async) || config.disableOnUpload && isUploaded\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n {{config.selectButtonText}}\n </button>\n </div>\n <ng-template #selectedFileList>\n <div class=\"selected-files-container\">\n <div class=\"selected-files-list\">\n <crispr-selected-file\n *ngFor=\"let file of selectedFiles; let i = index;\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"file.name\"\n [showProgress]=\"config.showUploadProgress\"\n [progress]=\"fileProgress && (fileProgress[i] | async)\">\n </crispr-selected-file>\n </div>\n\n </div>\n </ng-template>\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n </mat-form-field>\n <div class=\"button-container\" *ngIf=\"selectedFiles?.length > 0\">\n\n <button\n mat-button\n (click)=\"resetFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n aria-label=\"Remove Selected File(s)\">\n {{config.clearFilesButtonText}}\n <mat-icon>delete</mat-icon>\n </button>\n\n <button\n *ngIf=\"!!config.uploadFiles\"\n mat-raised-button\n type=\"button\"\n color=\"accent\"\n class=\"file-input-button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n (click)=\"uploadFiles()\"\n [attr.aria-label]=\"config.uploadButtonText\">\n {{ config.uploadButtonText }}\n </button>\n\n </div>\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0;display:flex;justify-content:center}:host .drop-info{display:flex;flex-direction:column;align-items:center}:host .drop-info .drop-icon{font-size:36px}:host .drop-info .mat-h2{margin:0}:host .button-container{display:flex;justify-content:flex-end;margin-top:-16px}:host .button-container button{margin-left:8px}:host .selected-files-container{width:100%}:host [matInput]{position:absolute;max-height:0;visibility:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: SelectedFileComponent, selector: "crispr-selected-file", inputs: ["fileName", "progress", "showProgress", "color"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i7$1.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i7$1.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "directive", type: FileDropzoneDirective, selector: "[crisprFileDropzone]", inputs: ["crisprFileDropzone"], outputs: ["fileDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true });
|
|
652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: FileUploadFieldComponent, decorators: [{
|
|
653
|
+
type: Component,
|
|
654
|
+
args: [{ selector: 'crispr-file-upload-field', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
655
|
+
CommonModule,
|
|
656
|
+
FieldContainerComponent,
|
|
657
|
+
ReactiveFormsModule,
|
|
658
|
+
MatIconModule,
|
|
659
|
+
MatButtonModule,
|
|
660
|
+
MatFormFieldModule,
|
|
661
|
+
MatInputModule,
|
|
662
|
+
SelectedFileComponent,
|
|
663
|
+
FormValidationHandlerModule,
|
|
664
|
+
FileDropzoneDirective
|
|
665
|
+
], template: "<crispr-field-container\n [config]=\"config\"\n [group]=\"group\">\n <mat-form-field floatLabel=\"always\"\n [color]=\"config.color\"\n appearance=\"outline\"\n [crisprFileDropzone]=\"!(disabled$ | async) && !(config.disableOnUpload && isUploaded)\"\n [formGroup]=\"group\"\n (fileDrop)=\"filesChanged($event)\">\n\n <input [formControlName]=\"config.controlName\" matInput type=\"text\"/>\n <input\n #fileInput\n type=\"file\"\n style=\"display: none\"\n [accept]=\"config.acceptedTypes\"\n [multiple]=\"config.allowMultipleFiles\"\n (change)=\"filesChanged($event.target.files)\"/>\n <mat-label>{{config.label}}</mat-label>\n\n <div *ngIf=\"!(selectedFiles?.length > 0); else selectedFileList\" class=\"drop-info\">\n <mat-icon class=\"drop-icon\" inline=\"true\">cloud_upload</mat-icon>\n <h2 class=\"mat-h2\">{{config.dropZoneText}}</h2>\n or\n <button\n mat-raised-button\n type=\"button\"\n color=\"primary\"\n [disabled]=\"(disabled$ | async) || config.disableOnUpload && isUploaded\"\n (click)=\"fileInput.click()\"\n [attr.aria-label]=\"config.controlName\">\n {{config.selectButtonText}}\n </button>\n </div>\n <ng-template #selectedFileList>\n <div class=\"selected-files-container\">\n <div class=\"selected-files-list\">\n <crispr-selected-file\n *ngFor=\"let file of selectedFiles; let i = index;\"\n [color]=\"config.color === 'primary' ? 'accent' : 'primary'\"\n [fileName]=\"file.name\"\n [showProgress]=\"config.showUploadProgress\"\n [progress]=\"fileProgress && (fileProgress[i] | async)\">\n </crispr-selected-file>\n </div>\n\n </div>\n </ng-template>\n <mat-hint *ngIf=\"config.hint && (control.valid || !control.touched)\">{{config.hint}}</mat-hint>\n </mat-form-field>\n <div class=\"button-container\" *ngIf=\"selectedFiles?.length > 0\">\n\n <button\n mat-button\n (click)=\"resetFileInput()\"\n type=\"button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n aria-label=\"Remove Selected File(s)\">\n {{config.clearFilesButtonText}}\n <mat-icon>delete</mat-icon>\n </button>\n\n <button\n *ngIf=\"!!config.uploadFiles\"\n mat-raised-button\n type=\"button\"\n color=\"accent\"\n class=\"file-input-button\"\n [disabled]=\"(disabled$ | async) || (config.disableOnUpload && isUploaded)\"\n (click)=\"uploadFiles()\"\n [attr.aria-label]=\"config.uploadButtonText\">\n {{ config.uploadButtonText }}\n </button>\n\n </div>\n</crispr-field-container>\n", styles: [":host ::ng-deep .mat-form-field .mat-form-field-infix{padding-top:0;display:flex;justify-content:center}:host .drop-info{display:flex;flex-direction:column;align-items:center}:host .drop-info .drop-icon{font-size:36px}:host .drop-info .mat-h2{margin:0}:host .button-container{display:flex;justify-content:flex-end;margin-top:-16px}:host .button-container button{margin-left:8px}:host .selected-files-container{width:100%}:host [matInput]{position:absolute;max-height:0;visibility:hidden}\n"] }]
|
|
666
|
+
}], ctorParameters: function () {
|
|
667
|
+
return [{ type: i2.NgControl, decorators: [{
|
|
668
|
+
type: Optional
|
|
669
|
+
}, {
|
|
670
|
+
type: Self
|
|
671
|
+
}] }];
|
|
672
|
+
}, propDecorators: { fileInputRef: [{
|
|
673
|
+
type: ViewChild,
|
|
674
|
+
args: ['fileInput']
|
|
675
|
+
}] } });
|
|
676
|
+
|
|
677
|
+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Generated bundle index. Do not edit.
|
|
681
|
+
*/
|
|
682
|
+
|
|
683
|
+
export { AutocompleteChiplistFieldComponent, AutocompleteFieldComponent, ButtonComponent, CheckboxFieldComponent, DatepickerFieldComponent, DividerComponent, FileUploadFieldComponent, InputFieldComponent, OptionComponent, RadioFieldComponent, SelectFieldComponent, SliderFieldComponent, TextareaFieldComponent, UnitConversionFieldComponent };
|
|
684
|
+
//# sourceMappingURL=tft-crispr-forms-ui.mjs.map
|