@ngx-formly/material 5.10.22 → 6.0.0-next.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 +4 -2
- package/checkbox/checkbox.module.d.ts +10 -0
- package/checkbox/checkbox.type.d.ts +5 -2
- package/checkbox/ngx-formly-material-checkbox.d.ts +1 -0
- package/checkbox/package.json +6 -9
- package/datepicker/datepicker.module.d.ts +11 -0
- package/datepicker/datepicker.type.d.ts +4 -4
- package/datepicker/ngx-formly-material-datepicker.d.ts +1 -1
- package/datepicker/package.json +6 -9
- package/esm2020/checkbox/checkbox.module.mjs +61 -0
- package/esm2020/checkbox/checkbox.type.mjs +109 -0
- package/esm2020/checkbox/ngx-formly-material-checkbox.mjs +5 -0
- package/esm2020/checkbox/public_api.mjs +3 -0
- package/esm2020/datepicker/datepicker.module.mjs +57 -0
- package/esm2020/datepicker/datepicker.type.mjs +117 -0
- package/esm2020/datepicker/ngx-formly-material-datepicker.mjs +5 -0
- package/esm2020/datepicker/public_api.mjs +2 -0
- package/esm2020/form-field/field.type.mjs +124 -0
- package/esm2020/form-field/form-field.module.mjs +47 -0
- package/esm2020/form-field/form-field.wrapper.mjs +141 -0
- package/esm2020/form-field/ngx-formly-material-form-field.mjs +5 -0
- package/esm2020/form-field/public_api.mjs +3 -0
- package/esm2020/input/input.module.mjs +91 -0
- package/esm2020/input/input.type.mjs +79 -0
- package/esm2020/input/ngx-formly-material-input.mjs +5 -0
- package/esm2020/input/public_api.mjs +3 -0
- package/esm2020/lib/ui-material.mjs +3 -0
- package/esm2020/lib/ui-material.module.mjs +43 -0
- package/esm2020/multicheckbox/multicheckbox.module.mjs +57 -0
- package/esm2020/multicheckbox/multicheckbox.type.mjs +82 -0
- package/esm2020/multicheckbox/ngx-formly-material-multicheckbox.mjs +5 -0
- package/esm2020/multicheckbox/public_api.mjs +3 -0
- package/esm2020/native-select/native-select.module.mjs +57 -0
- package/esm2020/native-select/native-select.type.mjs +97 -0
- package/esm2020/native-select/ngx-formly-material-native-select.mjs +5 -0
- package/esm2020/native-select/public_api.mjs +3 -0
- package/esm2020/ngx-formly-material.mjs +5 -0
- package/esm2020/public_api.mjs +5 -0
- package/esm2020/radio/ngx-formly-material-radio.mjs +5 -0
- package/esm2020/radio/public_api.mjs +3 -0
- package/esm2020/radio/radio.module.mjs +57 -0
- package/esm2020/radio/radio.type.mjs +89 -0
- package/esm2020/select/ngx-formly-material-select.mjs +5 -0
- package/esm2020/select/public_api.mjs +3 -0
- package/esm2020/select/select.module.mjs +63 -0
- package/esm2020/select/select.type.mjs +151 -0
- package/esm2020/slider/ngx-formly-material-slider.mjs +5 -0
- package/esm2020/slider/public_api.mjs +2 -0
- package/esm2020/slider/slider.module.mjs +53 -0
- package/esm2020/slider/slider.type.mjs +79 -0
- package/esm2020/textarea/ngx-formly-material-textarea.mjs +5 -0
- package/esm2020/textarea/public_api.mjs +3 -0
- package/esm2020/textarea/textarea.module.mjs +53 -0
- package/esm2020/textarea/textarea.type.mjs +77 -0
- package/esm2020/toggle/ngx-formly-material-toggle.mjs +5 -0
- package/esm2020/toggle/public_api.mjs +2 -0
- package/esm2020/toggle/toggle.module.mjs +53 -0
- package/esm2020/toggle/toggle.type.mjs +61 -0
- package/fesm2015/ngx-formly-material-checkbox.mjs +171 -0
- package/fesm2015/ngx-formly-material-checkbox.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-datepicker.mjs +177 -0
- package/fesm2015/ngx-formly-material-datepicker.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-form-field.mjs +312 -0
- package/fesm2015/ngx-formly-material-form-field.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-input.mjs +172 -0
- package/fesm2015/ngx-formly-material-input.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-multicheckbox.mjs +140 -0
- package/fesm2015/ngx-formly-material-multicheckbox.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-native-select.mjs +156 -0
- package/fesm2015/ngx-formly-material-native-select.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-radio.mjs +146 -0
- package/fesm2015/ngx-formly-material-radio.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-select.mjs +219 -0
- package/fesm2015/ngx-formly-material-select.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-slider.mjs +133 -0
- package/fesm2015/ngx-formly-material-slider.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-textarea.mjs +131 -0
- package/fesm2015/ngx-formly-material-textarea.mjs.map +1 -0
- package/fesm2015/ngx-formly-material-toggle.mjs +115 -0
- package/fesm2015/ngx-formly-material-toggle.mjs.map +1 -0
- package/fesm2015/ngx-formly-material.mjs +55 -0
- package/fesm2015/ngx-formly-material.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-checkbox.mjs +171 -0
- package/fesm2020/ngx-formly-material-checkbox.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-datepicker.mjs +176 -0
- package/fesm2020/ngx-formly-material-datepicker.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-form-field.mjs +309 -0
- package/fesm2020/ngx-formly-material-form-field.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-input.mjs +172 -0
- package/fesm2020/ngx-formly-material-input.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-multicheckbox.mjs +140 -0
- package/fesm2020/ngx-formly-material-multicheckbox.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-native-select.mjs +156 -0
- package/fesm2020/ngx-formly-material-native-select.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-radio.mjs +146 -0
- package/fesm2020/ngx-formly-material-radio.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-select.mjs +216 -0
- package/fesm2020/ngx-formly-material-select.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-slider.mjs +133 -0
- package/fesm2020/ngx-formly-material-slider.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-textarea.mjs +131 -0
- package/fesm2020/ngx-formly-material-textarea.mjs.map +1 -0
- package/fesm2020/ngx-formly-material-toggle.mjs +115 -0
- package/fesm2020/ngx-formly-material-toggle.mjs.map +1 -0
- package/fesm2020/ngx-formly-material.mjs +55 -0
- package/fesm2020/ngx-formly-material.mjs.map +1 -0
- package/form-field/field.type.d.ts +23 -17
- package/form-field/form-field.module.d.ts +9 -0
- package/form-field/form-field.wrapper.d.ts +26 -27
- package/form-field/ngx-formly-material-form-field.d.ts +1 -1
- package/form-field/package.json +6 -9
- package/form-field/public_api.d.ts +1 -0
- package/input/input.module.d.ts +10 -0
- package/input/input.type.d.ts +4 -3
- package/input/ngx-formly-material-input.d.ts +1 -0
- package/input/package.json +6 -9
- package/lib/ui-material.module.d.ts +11 -0
- package/multicheckbox/multicheckbox.module.d.ts +11 -0
- package/multicheckbox/multicheckbox.type.d.ts +5 -2
- package/multicheckbox/ngx-formly-material-multicheckbox.d.ts +1 -0
- package/multicheckbox/package.json +6 -9
- package/native-select/native-select.module.d.ts +11 -0
- package/native-select/native-select.type.d.ts +3 -2
- package/native-select/ngx-formly-material-native-select.d.ts +1 -0
- package/native-select/package.json +6 -9
- package/ngx-formly-material.d.ts +1 -0
- package/package.json +118 -31
- package/radio/ngx-formly-material-radio.d.ts +1 -0
- package/radio/package.json +6 -9
- package/radio/radio.module.d.ts +11 -0
- package/radio/radio.type.d.ts +4 -1
- package/select/ngx-formly-material-select.d.ts +1 -0
- package/select/package.json +6 -9
- package/select/select.module.d.ts +12 -0
- package/select/select.type.d.ts +6 -4
- package/slider/ngx-formly-material-slider.d.ts +1 -1
- package/slider/package.json +6 -9
- package/slider/slider.module.d.ts +10 -0
- package/slider/slider.type.d.ts +4 -1
- package/textarea/ngx-formly-material-textarea.d.ts +1 -0
- package/textarea/package.json +6 -9
- package/textarea/textarea.module.d.ts +10 -0
- package/textarea/textarea.type.d.ts +3 -2
- package/toggle/ngx-formly-material-toggle.d.ts +1 -1
- package/toggle/package.json +6 -9
- package/toggle/toggle.module.d.ts +10 -0
- package/toggle/toggle.type.d.ts +4 -1
- package/bundles/ngx-formly-material-checkbox.umd.js +0 -189
- package/bundles/ngx-formly-material-checkbox.umd.js.map +0 -1
- package/bundles/ngx-formly-material-checkbox.umd.min.js +0 -2
- package/bundles/ngx-formly-material-checkbox.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-datepicker.umd.js +0 -151
- package/bundles/ngx-formly-material-datepicker.umd.js.map +0 -1
- package/bundles/ngx-formly-material-datepicker.umd.min.js +0 -2
- package/bundles/ngx-formly-material-datepicker.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-form-field.umd.js +0 -532
- package/bundles/ngx-formly-material-form-field.umd.js.map +0 -1
- package/bundles/ngx-formly-material-form-field.umd.min.js +0 -2
- package/bundles/ngx-formly-material-form-field.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-input.umd.js +0 -113
- package/bundles/ngx-formly-material-input.umd.js.map +0 -1
- package/bundles/ngx-formly-material-input.umd.min.js +0 -2
- package/bundles/ngx-formly-material-input.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-multicheckbox.umd.js +0 -205
- package/bundles/ngx-formly-material-multicheckbox.umd.js.map +0 -1
- package/bundles/ngx-formly-material-multicheckbox.umd.min.js +0 -2
- package/bundles/ngx-formly-material-multicheckbox.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-native-select.umd.js +0 -111
- package/bundles/ngx-formly-material-native-select.umd.js.map +0 -1
- package/bundles/ngx-formly-material-native-select.umd.min.js +0 -2
- package/bundles/ngx-formly-material-native-select.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-radio.umd.js +0 -161
- package/bundles/ngx-formly-material-radio.umd.js.map +0 -1
- package/bundles/ngx-formly-material-radio.umd.min.js +0 -2
- package/bundles/ngx-formly-material-radio.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-select.umd.js +0 -249
- package/bundles/ngx-formly-material-select.umd.js.map +0 -1
- package/bundles/ngx-formly-material-select.umd.min.js +0 -2
- package/bundles/ngx-formly-material-select.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-slider.umd.js +0 -122
- package/bundles/ngx-formly-material-slider.umd.js.map +0 -1
- package/bundles/ngx-formly-material-slider.umd.min.js +0 -2
- package/bundles/ngx-formly-material-slider.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-textarea.umd.js +0 -116
- package/bundles/ngx-formly-material-textarea.umd.js.map +0 -1
- package/bundles/ngx-formly-material-textarea.umd.min.js +0 -2
- package/bundles/ngx-formly-material-textarea.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material-toggle.umd.js +0 -122
- package/bundles/ngx-formly-material-toggle.umd.js.map +0 -1
- package/bundles/ngx-formly-material-toggle.umd.min.js +0 -2
- package/bundles/ngx-formly-material-toggle.umd.min.js.map +0 -1
- package/bundles/ngx-formly-material.umd.js +0 -52
- package/bundles/ngx-formly-material.umd.js.map +0 -1
- package/bundles/ngx-formly-material.umd.min.js +0 -2
- package/bundles/ngx-formly-material.umd.min.js.map +0 -1
- package/checkbox/ngx-formly-material-checkbox.metadata.json +0 -1
- package/datepicker/ngx-formly-material-datepicker.metadata.json +0 -1
- package/esm2015/checkbox/checkbox.module.js +0 -34
- package/esm2015/checkbox/checkbox.type.js +0 -129
- package/esm2015/checkbox/ngx-formly-material-checkbox.js +0 -9
- package/esm2015/checkbox/public_api.js +0 -7
- package/esm2015/datepicker/datepicker.module.js +0 -34
- package/esm2015/datepicker/datepicker.type.js +0 -113
- package/esm2015/datepicker/ngx-formly-material-datepicker.js +0 -10
- package/esm2015/datepicker/public_api.js +0 -6
- package/esm2015/form-field/field.type.js +0 -170
- package/esm2015/form-field/form-field.module.js +0 -29
- package/esm2015/form-field/form-field.wrapper.js +0 -244
- package/esm2015/form-field/formly.error-state-matcher.js +0 -28
- package/esm2015/form-field/ngx-formly-material-form-field.js +0 -10
- package/esm2015/form-field/public_api.js +0 -7
- package/esm2015/input/input.module.js +0 -34
- package/esm2015/input/input.type.js +0 -53
- package/esm2015/input/ngx-formly-material-input.js +0 -9
- package/esm2015/input/public_api.js +0 -7
- package/esm2015/lib/ui-material.js +0 -7
- package/esm2015/lib/ui-material.module.js +0 -28
- package/esm2015/multicheckbox/multicheckbox.module.js +0 -36
- package/esm2015/multicheckbox/multicheckbox.type.js +0 -86
- package/esm2015/multicheckbox/ngx-formly-material-multicheckbox.js +0 -9
- package/esm2015/multicheckbox/public_api.js +0 -7
- package/esm2015/native-select/native-select.module.js +0 -36
- package/esm2015/native-select/native-select.type.js +0 -63
- package/esm2015/native-select/ngx-formly-material-native-select.js +0 -9
- package/esm2015/native-select/public_api.js +0 -7
- package/esm2015/ngx-formly-material.js +0 -9
- package/esm2015/public_api.js +0 -9
- package/esm2015/radio/ngx-formly-material-radio.js +0 -9
- package/esm2015/radio/public_api.js +0 -7
- package/esm2015/radio/radio.module.js +0 -34
- package/esm2015/radio/radio.type.js +0 -94
- package/esm2015/select/ngx-formly-material-select.js +0 -9
- package/esm2015/select/public_api.js +0 -7
- package/esm2015/select/select.module.js +0 -36
- package/esm2015/select/select.type.js +0 -165
- package/esm2015/slider/ngx-formly-material-slider.js +0 -10
- package/esm2015/slider/public_api.js +0 -6
- package/esm2015/slider/slider.module.js +0 -32
- package/esm2015/slider/slider.type.js +0 -56
- package/esm2015/textarea/ngx-formly-material-textarea.js +0 -9
- package/esm2015/textarea/public_api.js +0 -7
- package/esm2015/textarea/textarea.module.js +0 -34
- package/esm2015/textarea/textarea.type.js +0 -58
- package/esm2015/toggle/ngx-formly-material-toggle.js +0 -10
- package/esm2015/toggle/public_api.js +0 -6
- package/esm2015/toggle/toggle.module.js +0 -32
- package/esm2015/toggle/toggle.type.js +0 -53
- package/esm5/checkbox/checkbox.module.js +0 -38
- package/esm5/checkbox/checkbox.type.js +0 -132
- package/esm5/checkbox/ngx-formly-material-checkbox.js +0 -9
- package/esm5/checkbox/public_api.js +0 -7
- package/esm5/datepicker/datepicker.module.js +0 -38
- package/esm5/datepicker/datepicker.type.js +0 -90
- package/esm5/datepicker/ngx-formly-material-datepicker.js +0 -10
- package/esm5/datepicker/public_api.js +0 -6
- package/esm5/form-field/field.type.js +0 -245
- package/esm5/form-field/form-field.module.js +0 -33
- package/esm5/form-field/form-field.wrapper.js +0 -285
- package/esm5/form-field/formly.error-state-matcher.js +0 -32
- package/esm5/form-field/ngx-formly-material-form-field.js +0 -10
- package/esm5/form-field/public_api.js +0 -7
- package/esm5/input/input.module.js +0 -38
- package/esm5/input/input.type.js +0 -40
- package/esm5/input/ngx-formly-material-input.js +0 -9
- package/esm5/input/public_api.js +0 -7
- package/esm5/lib/ui-material.js +0 -7
- package/esm5/lib/ui-material.module.js +0 -32
- package/esm5/multicheckbox/multicheckbox.module.js +0 -40
- package/esm5/multicheckbox/multicheckbox.type.js +0 -92
- package/esm5/multicheckbox/ngx-formly-material-multicheckbox.js +0 -9
- package/esm5/multicheckbox/public_api.js +0 -7
- package/esm5/native-select/native-select.module.js +0 -40
- package/esm5/native-select/native-select.type.js +0 -38
- package/esm5/native-select/ngx-formly-material-native-select.js +0 -9
- package/esm5/native-select/public_api.js +0 -7
- package/esm5/ngx-formly-material.js +0 -9
- package/esm5/public_api.js +0 -9
- package/esm5/radio/ngx-formly-material-radio.js +0 -9
- package/esm5/radio/public_api.js +0 -7
- package/esm5/radio/radio.module.js +0 -38
- package/esm5/radio/radio.type.js +0 -98
- package/esm5/select/ngx-formly-material-select.js +0 -9
- package/esm5/select/public_api.js +0 -7
- package/esm5/select/select.module.js +0 -40
- package/esm5/select/select.type.js +0 -155
- package/esm5/slider/ngx-formly-material-slider.js +0 -10
- package/esm5/slider/public_api.js +0 -6
- package/esm5/slider/slider.module.js +0 -36
- package/esm5/slider/slider.type.js +0 -52
- package/esm5/textarea/ngx-formly-material-textarea.js +0 -9
- package/esm5/textarea/public_api.js +0 -7
- package/esm5/textarea/textarea.module.js +0 -38
- package/esm5/textarea/textarea.type.js +0 -45
- package/esm5/toggle/ngx-formly-material-toggle.js +0 -10
- package/esm5/toggle/public_api.js +0 -6
- package/esm5/toggle/toggle.module.js +0 -36
- package/esm5/toggle/toggle.type.js +0 -52
- package/fesm2015/ngx-formly-material-checkbox.js +0 -152
- package/fesm2015/ngx-formly-material-checkbox.js.map +0 -1
- package/fesm2015/ngx-formly-material-datepicker.js +0 -146
- package/fesm2015/ngx-formly-material-datepicker.js.map +0 -1
- package/fesm2015/ngx-formly-material-form-field.js +0 -408
- package/fesm2015/ngx-formly-material-form-field.js.map +0 -1
- package/fesm2015/ngx-formly-material-input.js +0 -93
- package/fesm2015/ngx-formly-material-input.js.map +0 -1
- package/fesm2015/ngx-formly-material-multicheckbox.js +0 -126
- package/fesm2015/ngx-formly-material-multicheckbox.js.map +0 -1
- package/fesm2015/ngx-formly-material-native-select.js +0 -103
- package/fesm2015/ngx-formly-material-native-select.js.map +0 -1
- package/fesm2015/ngx-formly-material-radio.js +0 -126
- package/fesm2015/ngx-formly-material-radio.js.map +0 -1
- package/fesm2015/ngx-formly-material-select.js +0 -200
- package/fesm2015/ngx-formly-material-select.js.map +0 -1
- package/fesm2015/ngx-formly-material-slider.js +0 -92
- package/fesm2015/ngx-formly-material-slider.js.map +0 -1
- package/fesm2015/ngx-formly-material-textarea.js +0 -95
- package/fesm2015/ngx-formly-material-textarea.js.map +0 -1
- package/fesm2015/ngx-formly-material-toggle.js +0 -89
- package/fesm2015/ngx-formly-material-toggle.js.map +0 -1
- package/fesm2015/ngx-formly-material.js +0 -48
- package/fesm2015/ngx-formly-material.js.map +0 -1
- package/fesm5/ngx-formly-material-checkbox.js +0 -157
- package/fesm5/ngx-formly-material-checkbox.js.map +0 -1
- package/fesm5/ngx-formly-material-datepicker.js +0 -125
- package/fesm5/ngx-formly-material-datepicker.js.map +0 -1
- package/fesm5/ngx-formly-material-form-field.js +0 -527
- package/fesm5/ngx-formly-material-form-field.js.map +0 -1
- package/fesm5/ngx-formly-material-input.js +0 -82
- package/fesm5/ngx-formly-material-input.js.map +0 -1
- package/fesm5/ngx-formly-material-multicheckbox.js +0 -134
- package/fesm5/ngx-formly-material-multicheckbox.js.map +0 -1
- package/fesm5/ngx-formly-material-native-select.js +0 -80
- package/fesm5/ngx-formly-material-native-select.js.map +0 -1
- package/fesm5/ngx-formly-material-radio.js +0 -132
- package/fesm5/ngx-formly-material-radio.js.map +0 -1
- package/fesm5/ngx-formly-material-select.js +0 -192
- package/fesm5/ngx-formly-material-select.js.map +0 -1
- package/fesm5/ngx-formly-material-slider.js +0 -90
- package/fesm5/ngx-formly-material-slider.js.map +0 -1
- package/fesm5/ngx-formly-material-textarea.js +0 -84
- package/fesm5/ngx-formly-material-textarea.js.map +0 -1
- package/fesm5/ngx-formly-material-toggle.js +0 -90
- package/fesm5/ngx-formly-material-toggle.js.map +0 -1
- package/fesm5/ngx-formly-material.js +0 -51
- package/fesm5/ngx-formly-material.js.map +0 -1
- package/form-field/formly.error-state-matcher.d.ts +0 -8
- package/form-field/ngx-formly-material-form-field.metadata.json +0 -1
- package/input/ngx-formly-material-input.metadata.json +0 -1
- package/multicheckbox/ngx-formly-material-multicheckbox.metadata.json +0 -1
- package/native-select/ngx-formly-material-native-select.metadata.json +0 -1
- package/ngx-formly-material.metadata.json +0 -1
- package/radio/ngx-formly-material-radio.metadata.json +0 -1
- package/select/ngx-formly-material-select.metadata.json +0 -1
- package/slider/ngx-formly-material-slider.metadata.json +0 -1
- package/textarea/ngx-formly-material-textarea.metadata.json +0 -1
- package/toggle/ngx-formly-material-toggle.metadata.json +0 -1
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
3
|
-
import { MatFormField, MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
|
|
4
|
-
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
5
|
-
import { ViewChild, Type, Component, Renderer2, ElementRef, ViewContainerRef, ViewEncapsulation, NgModule } from '@angular/core';
|
|
6
|
-
import { FieldType, ɵdefineHiddenProp, FieldWrapper, FormlyConfig, FormlyModule } from '@ngx-formly/core';
|
|
7
|
-
import { Subject } from 'rxjs';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @fileoverview added by tsickle
|
|
11
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
12
|
-
*/
|
|
13
|
-
class FormlyErrorStateMatcher {
|
|
14
|
-
/**
|
|
15
|
-
* @param {?} field
|
|
16
|
-
*/
|
|
17
|
-
constructor(field) {
|
|
18
|
-
this.field = field;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @param {?} control
|
|
22
|
-
* @param {?} form
|
|
23
|
-
* @return {?}
|
|
24
|
-
*/
|
|
25
|
-
isErrorState(control, form) {
|
|
26
|
-
return this.field && this.field.showError;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @fileoverview added by tsickle
|
|
32
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* @abstract
|
|
36
|
-
* @template F
|
|
37
|
-
*/
|
|
38
|
-
class FieldType$1 extends FieldType {
|
|
39
|
-
constructor() {
|
|
40
|
-
super(...arguments);
|
|
41
|
-
this.errorStateMatcher = new FormlyErrorStateMatcher(this);
|
|
42
|
-
this.stateChanges = new Subject();
|
|
43
|
-
this._errorState = false;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @return {?}
|
|
47
|
-
*/
|
|
48
|
-
get formFieldControl() { return this._control || this; }
|
|
49
|
-
/**
|
|
50
|
-
* @param {?} control
|
|
51
|
-
* @return {?}
|
|
52
|
-
*/
|
|
53
|
-
set formFieldControl(control) {
|
|
54
|
-
this._control = control;
|
|
55
|
-
if (this.formField && control !== this.formField._control) {
|
|
56
|
-
this.formField._control = control;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* @return {?}
|
|
61
|
-
*/
|
|
62
|
-
ngOnInit() {
|
|
63
|
-
if (this.formField) {
|
|
64
|
-
this.formField._control = this.formFieldControl;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @return {?}
|
|
69
|
-
*/
|
|
70
|
-
ngAfterViewInit() {
|
|
71
|
-
if (this.matPrefix || this.matSuffix) {
|
|
72
|
-
setTimeout((/**
|
|
73
|
-
* @return {?}
|
|
74
|
-
*/
|
|
75
|
-
() => {
|
|
76
|
-
ɵdefineHiddenProp(this.field, '_matprefix', this.matPrefix);
|
|
77
|
-
ɵdefineHiddenProp(this.field, '_matsuffix', this.matSuffix);
|
|
78
|
-
((/** @type {?} */ (this.options)))._markForCheck(this.field);
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* @return {?}
|
|
84
|
-
*/
|
|
85
|
-
ngOnDestroy() {
|
|
86
|
-
if (this.formField) {
|
|
87
|
-
delete this.formField._control;
|
|
88
|
-
}
|
|
89
|
-
this.stateChanges.complete();
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* @param {?} ids
|
|
93
|
-
* @return {?}
|
|
94
|
-
*/
|
|
95
|
-
setDescribedByIds(ids) { }
|
|
96
|
-
/**
|
|
97
|
-
* @param {?} event
|
|
98
|
-
* @return {?}
|
|
99
|
-
*/
|
|
100
|
-
onContainerClick(event) {
|
|
101
|
-
this.field.focus = true;
|
|
102
|
-
this.stateChanges.next();
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* @return {?}
|
|
106
|
-
*/
|
|
107
|
-
get errorState() {
|
|
108
|
-
/** @type {?} */
|
|
109
|
-
const showError = (/** @type {?} */ ((/** @type {?} */ (this.options)).showError))(this);
|
|
110
|
-
if (showError !== this._errorState) {
|
|
111
|
-
this._errorState = showError;
|
|
112
|
-
this.stateChanges.next();
|
|
113
|
-
}
|
|
114
|
-
return showError;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* @return {?}
|
|
118
|
-
*/
|
|
119
|
-
get controlType() {
|
|
120
|
-
if (this.to.type) {
|
|
121
|
-
return this.to.type;
|
|
122
|
-
}
|
|
123
|
-
if (((/** @type {?} */ (this.field.type))) instanceof Type) {
|
|
124
|
-
return (/** @type {?} */ (this.field.type)).constructor.name;
|
|
125
|
-
}
|
|
126
|
-
return (/** @type {?} */ (this.field.type));
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* @return {?}
|
|
130
|
-
*/
|
|
131
|
-
get focused() { return !!this.field.focus && !this.disabled; }
|
|
132
|
-
/**
|
|
133
|
-
* @return {?}
|
|
134
|
-
*/
|
|
135
|
-
get disabled() { return !!this.to.disabled; }
|
|
136
|
-
/**
|
|
137
|
-
* @return {?}
|
|
138
|
-
*/
|
|
139
|
-
get required() { return !!this.to.required; }
|
|
140
|
-
/**
|
|
141
|
-
* @return {?}
|
|
142
|
-
*/
|
|
143
|
-
get placeholder() { return this.to.placeholder || ''; }
|
|
144
|
-
/**
|
|
145
|
-
* @return {?}
|
|
146
|
-
*/
|
|
147
|
-
get shouldPlaceholderFloat() { return this.shouldLabelFloat; }
|
|
148
|
-
/**
|
|
149
|
-
* @return {?}
|
|
150
|
-
*/
|
|
151
|
-
get value() { return this.formControl.value; }
|
|
152
|
-
/**
|
|
153
|
-
* @param {?} value
|
|
154
|
-
* @return {?}
|
|
155
|
-
*/
|
|
156
|
-
set value(value) { this.formControl.patchValue(value); }
|
|
157
|
-
/**
|
|
158
|
-
* @return {?}
|
|
159
|
-
*/
|
|
160
|
-
get ngControl() { return (/** @type {?} */ (this.formControl)); }
|
|
161
|
-
/**
|
|
162
|
-
* @return {?}
|
|
163
|
-
*/
|
|
164
|
-
get empty() { return this.value === undefined || this.value === null || this.value === ''; }
|
|
165
|
-
/**
|
|
166
|
-
* @return {?}
|
|
167
|
-
*/
|
|
168
|
-
get shouldLabelFloat() { return this.focused || !this.empty; }
|
|
169
|
-
/**
|
|
170
|
-
* @return {?}
|
|
171
|
-
*/
|
|
172
|
-
get formField() { return this.field ? ((/** @type {?} */ (this.field)))['__formField__'] : null; }
|
|
173
|
-
}
|
|
174
|
-
FieldType$1.propDecorators = {
|
|
175
|
-
matPrefix: [{ type: ViewChild, args: ['matPrefix',] }],
|
|
176
|
-
matSuffix: [{ type: ViewChild, args: ['matSuffix',] }]
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* @fileoverview added by tsickle
|
|
181
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
182
|
-
*/
|
|
183
|
-
class FormlyWrapperFormField extends FieldWrapper {
|
|
184
|
-
/**
|
|
185
|
-
* @param {?} config
|
|
186
|
-
* @param {?} renderer
|
|
187
|
-
* @param {?} elementRef
|
|
188
|
-
* @param {?} focusMonitor
|
|
189
|
-
*/
|
|
190
|
-
constructor(config, renderer, elementRef, focusMonitor) {
|
|
191
|
-
super();
|
|
192
|
-
this.config = config;
|
|
193
|
-
this.renderer = renderer;
|
|
194
|
-
this.elementRef = elementRef;
|
|
195
|
-
this.focusMonitor = focusMonitor;
|
|
196
|
-
this.stateChanges = new Subject();
|
|
197
|
-
this._errorState = false;
|
|
198
|
-
this.initialGapCalculated = false;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* @return {?}
|
|
202
|
-
*/
|
|
203
|
-
ngOnInit() {
|
|
204
|
-
this.formField._control = this;
|
|
205
|
-
ɵdefineHiddenProp(this.field, '__formField__', this.formField);
|
|
206
|
-
/** @type {?} */
|
|
207
|
-
const ref = this.config.resolveFieldTypeRef(this.formlyField);
|
|
208
|
-
if (ref && !(ref.instance instanceof FieldType$1)) {
|
|
209
|
-
console.warn(`Component '${ref.componentType.name}' must extend 'FieldType' from '@ngx-formly/material/form-field'.`);
|
|
210
|
-
}
|
|
211
|
-
// fix for https://github.com/angular/material2/issues/11437
|
|
212
|
-
if (this.formlyField.hide && (/** @type {?} */ (this.formlyField.templateOptions)).appearance === 'outline') {
|
|
213
|
-
this.initialGapCalculated = true;
|
|
214
|
-
}
|
|
215
|
-
this.focusMonitor.monitor(this.elementRef, true).subscribe((/**
|
|
216
|
-
* @param {?} origin
|
|
217
|
-
* @return {?}
|
|
218
|
-
*/
|
|
219
|
-
origin => {
|
|
220
|
-
if (!origin && this.field.focus) {
|
|
221
|
-
this.field.focus = false;
|
|
222
|
-
}
|
|
223
|
-
this.stateChanges.next();
|
|
224
|
-
}));
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* @return {?}
|
|
228
|
-
*/
|
|
229
|
-
ngAfterContentChecked() {
|
|
230
|
-
if (!this.initialGapCalculated || this.formlyField.hide) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
this.formField.updateOutlineGap();
|
|
234
|
-
this.initialGapCalculated = true;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* @return {?}
|
|
238
|
-
*/
|
|
239
|
-
ngAfterViewInit() {
|
|
240
|
-
// temporary fix for https://github.com/angular/material2/issues/7891
|
|
241
|
-
if (this.formField.appearance !== 'outline' && this.to.hideFieldUnderline === true) {
|
|
242
|
-
/** @type {?} */
|
|
243
|
-
const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');
|
|
244
|
-
underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* @return {?}
|
|
249
|
-
*/
|
|
250
|
-
ngOnDestroy() {
|
|
251
|
-
delete this.formlyField.__formField__;
|
|
252
|
-
this.stateChanges.complete();
|
|
253
|
-
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* @param {?} ids
|
|
257
|
-
* @return {?}
|
|
258
|
-
*/
|
|
259
|
-
setDescribedByIds(ids) { }
|
|
260
|
-
/**
|
|
261
|
-
* @param {?} event
|
|
262
|
-
* @return {?}
|
|
263
|
-
*/
|
|
264
|
-
onContainerClick(event) {
|
|
265
|
-
this.formlyField.focus = true;
|
|
266
|
-
this.stateChanges.next();
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* @return {?}
|
|
270
|
-
*/
|
|
271
|
-
get errorState() {
|
|
272
|
-
/** @type {?} */
|
|
273
|
-
const showError = (/** @type {?} */ ((/** @type {?} */ (this.options)).showError))(this);
|
|
274
|
-
if (showError !== this._errorState) {
|
|
275
|
-
this._errorState = showError;
|
|
276
|
-
this.stateChanges.next();
|
|
277
|
-
}
|
|
278
|
-
return showError;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* @return {?}
|
|
282
|
-
*/
|
|
283
|
-
get controlType() { return this.to.type; }
|
|
284
|
-
/**
|
|
285
|
-
* @return {?}
|
|
286
|
-
*/
|
|
287
|
-
get focused() { return !!this.formlyField.focus && !this.disabled; }
|
|
288
|
-
/**
|
|
289
|
-
* @return {?}
|
|
290
|
-
*/
|
|
291
|
-
get disabled() { return !!this.to.disabled; }
|
|
292
|
-
/**
|
|
293
|
-
* @return {?}
|
|
294
|
-
*/
|
|
295
|
-
get required() { return !!this.to.required; }
|
|
296
|
-
/**
|
|
297
|
-
* @return {?}
|
|
298
|
-
*/
|
|
299
|
-
get placeholder() { return this.to.placeholder || ''; }
|
|
300
|
-
/**
|
|
301
|
-
* @return {?}
|
|
302
|
-
*/
|
|
303
|
-
get shouldPlaceholderFloat() { return this.shouldLabelFloat; }
|
|
304
|
-
/**
|
|
305
|
-
* @return {?}
|
|
306
|
-
*/
|
|
307
|
-
get value() { return this.formControl.value; }
|
|
308
|
-
/**
|
|
309
|
-
* @return {?}
|
|
310
|
-
*/
|
|
311
|
-
get ngControl() { return (/** @type {?} */ (this.formControl)); }
|
|
312
|
-
/**
|
|
313
|
-
* @return {?}
|
|
314
|
-
*/
|
|
315
|
-
get empty() { return !this.formControl.value; }
|
|
316
|
-
/**
|
|
317
|
-
* @return {?}
|
|
318
|
-
*/
|
|
319
|
-
get shouldLabelFloat() { return this.focused || !this.empty; }
|
|
320
|
-
/**
|
|
321
|
-
* @return {?}
|
|
322
|
-
*/
|
|
323
|
-
get formlyField() { return (/** @type {?} */ (this.field)); }
|
|
324
|
-
}
|
|
325
|
-
FormlyWrapperFormField.decorators = [
|
|
326
|
-
{ type: Component, args: [{
|
|
327
|
-
selector: 'formly-wrapper-mat-form-field',
|
|
328
|
-
template: `
|
|
329
|
-
<!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->
|
|
330
|
-
<mat-form-field
|
|
331
|
-
[hideRequiredMarker]="true"
|
|
332
|
-
[floatLabel]="to.floatLabel"
|
|
333
|
-
[appearance]="to.appearance"
|
|
334
|
-
[color]="to.color">
|
|
335
|
-
<ng-container #fieldComponent></ng-container>
|
|
336
|
-
<mat-label *ngIf="to.label && to.hideLabel !== true">
|
|
337
|
-
{{ to.label }}
|
|
338
|
-
<span *ngIf="to.required && to.hideRequiredMarker !== true" aria-hidden="true" class="mat-form-field-required-marker">*</span>
|
|
339
|
-
</mat-label>
|
|
340
|
-
|
|
341
|
-
<ng-container matPrefix *ngIf="to.prefix || to._matPrefix">
|
|
342
|
-
<ng-container *ngTemplateOutlet="to.prefix ? to.prefix : to._matPrefix"></ng-container>
|
|
343
|
-
</ng-container>
|
|
344
|
-
|
|
345
|
-
<ng-container matSuffix *ngIf="to.suffix || to._matSuffix">
|
|
346
|
-
<ng-container *ngTemplateOutlet="to.suffix ? to.suffix : to._matSuffix"></ng-container>
|
|
347
|
-
</ng-container>
|
|
348
|
-
|
|
349
|
-
<mat-error>
|
|
350
|
-
<formly-validation-message [field]="field"></formly-validation-message>
|
|
351
|
-
</mat-error>
|
|
352
|
-
<!-- fix https://github.com/angular/material2/issues/7737 by setting id to null -->
|
|
353
|
-
<mat-hint *ngIf="to.description" [id]="null">{{ to.description }}</mat-hint>
|
|
354
|
-
</mat-form-field>
|
|
355
|
-
`,
|
|
356
|
-
providers: [{ provide: MatFormFieldControl, useExisting: FormlyWrapperFormField }],
|
|
357
|
-
encapsulation: ViewEncapsulation.None,
|
|
358
|
-
styles: ["formly-wrapper-mat-form-field .mat-form-field{width:100%}formly-wrapper-mat-form-field .mat-form-field-subscript-wrapper,formly-wrapper-mat-form-field .mat-form-field-underline{position:static}"]
|
|
359
|
-
}] }
|
|
360
|
-
];
|
|
361
|
-
/** @nocollapse */
|
|
362
|
-
FormlyWrapperFormField.ctorParameters = () => [
|
|
363
|
-
{ type: FormlyConfig },
|
|
364
|
-
{ type: Renderer2 },
|
|
365
|
-
{ type: ElementRef },
|
|
366
|
-
{ type: FocusMonitor }
|
|
367
|
-
];
|
|
368
|
-
FormlyWrapperFormField.propDecorators = {
|
|
369
|
-
fieldComponent: [{ type: ViewChild, args: ['fieldComponent', (/** @type {?} */ ({ read: ViewContainerRef, static: true })),] }],
|
|
370
|
-
formField: [{ type: ViewChild, args: [MatFormField, (/** @type {?} */ ({ static: true })),] }]
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* @fileoverview added by tsickle
|
|
375
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
376
|
-
*/
|
|
377
|
-
class FormlyMatFormFieldModule {
|
|
378
|
-
}
|
|
379
|
-
FormlyMatFormFieldModule.decorators = [
|
|
380
|
-
{ type: NgModule, args: [{
|
|
381
|
-
declarations: [FormlyWrapperFormField],
|
|
382
|
-
imports: [
|
|
383
|
-
CommonModule,
|
|
384
|
-
ReactiveFormsModule,
|
|
385
|
-
MatFormFieldModule,
|
|
386
|
-
FormlyModule.forChild({
|
|
387
|
-
wrappers: [{
|
|
388
|
-
name: 'form-field',
|
|
389
|
-
component: FormlyWrapperFormField,
|
|
390
|
-
}],
|
|
391
|
-
}),
|
|
392
|
-
],
|
|
393
|
-
},] }
|
|
394
|
-
];
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* @fileoverview added by tsickle
|
|
398
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
399
|
-
*/
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* @fileoverview added by tsickle
|
|
403
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
404
|
-
*/
|
|
405
|
-
|
|
406
|
-
export { FormlyMatFormFieldModule, FieldType$1 as FieldType, FormlyWrapperFormField as ɵa };
|
|
407
|
-
|
|
408
|
-
//# sourceMappingURL=ngx-formly-material-form-field.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-form-field.js.map","sources":["ng://@ngx-formly/material/form-field/formly.error-state-matcher.ts","ng://@ngx-formly/material/form-field/field.type.ts","ng://@ngx-formly/material/form-field/form-field.wrapper.ts","ng://@ngx-formly/material/form-field/form-field.module.ts"],"sourcesContent":["import { FormControl, FormGroupDirective, NgForm } from '@angular/forms';\nimport { ErrorStateMatcher } from '@angular/material/core';\nimport { FieldType } from '@ngx-formly/core';\n\nexport class FormlyErrorStateMatcher implements ErrorStateMatcher {\n constructor(private field: FieldType) {}\n\n isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {\n return this.field && this.field.showError;\n }\n}\n","import { OnInit, OnDestroy, AfterViewInit, TemplateRef, ViewChild, Type } from '@angular/core';\nimport { FieldType as CoreFieldType, ɵdefineHiddenProp as defineHiddenProp, FormlyFieldConfig } from '@ngx-formly/core';\nimport { Subject } from 'rxjs';\nimport { MatFormField, MatFormFieldControl } from '@angular/material/form-field';\nimport { FormlyErrorStateMatcher } from './formly.error-state-matcher';\n\nexport abstract class FieldType<F extends FormlyFieldConfig = FormlyFieldConfig> extends CoreFieldType<F> implements OnInit, AfterViewInit, OnDestroy, MatFormFieldControl<any> {\n @ViewChild('matPrefix') matPrefix!: TemplateRef<any>;\n @ViewChild('matSuffix') matSuffix!: TemplateRef<any>;\n\n get formFieldControl() { return this._control || this; }\n set formFieldControl(control: MatFormFieldControl<any>) {\n this._control = control;\n if (this.formField && control !== this.formField._control) {\n this.formField._control = control;\n }\n }\n\n errorStateMatcher = new FormlyErrorStateMatcher(this);\n stateChanges = new Subject<void>();\n _errorState = false;\n private _control!: MatFormFieldControl<any>;\n\n ngOnInit() {\n if (this.formField) {\n this.formField._control = this.formFieldControl;\n }\n }\n\n ngAfterViewInit() {\n if (this.matPrefix || this.matSuffix) {\n setTimeout(() => {\n defineHiddenProp(this.field, '_matprefix', this.matPrefix);\n defineHiddenProp(this.field, '_matsuffix', this.matSuffix);\n (<any> this.options)._markForCheck(this.field);\n });\n }\n }\n\n ngOnDestroy() {\n if (this.formField) {\n delete this.formField._control;\n }\n this.stateChanges.complete();\n }\n\n setDescribedByIds(ids: string[]): void { }\n onContainerClick(event: MouseEvent): void {\n this.field.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n\n get controlType() {\n if (this.to.type) {\n return this.to.type;\n }\n\n if ((<any> this.field.type) instanceof Type) {\n return this.field.type!.constructor.name;\n }\n\n return this.field.type!;\n }\n get focused() { return !!this.field.focus && !this.disabled; }\n get disabled() { return !!this.to.disabled; }\n get required() { return !!this.to.required; }\n get placeholder() { return this.to.placeholder || ''; }\n get shouldPlaceholderFloat() { return this.shouldLabelFloat; }\n get value() { return this.formControl.value; }\n set value(value) { this.formControl.patchValue(value); }\n get ngControl() { return this.formControl as any; }\n get empty() { return this.value === undefined || this.value === null || this.value === ''; }\n get shouldLabelFloat() { return this.focused || !this.empty; }\n get formField(): MatFormField { return this.field ? (<any>this.field)['__formField__'] : null; }\n}\n","import { Component, ViewChild, OnInit, OnDestroy, Renderer2, AfterViewInit, AfterContentChecked, ElementRef, ViewContainerRef, ViewEncapsulation } from '@angular/core';\nimport { FieldWrapper, ɵdefineHiddenProp as defineHiddenProp, FormlyFieldConfig, FormlyConfig } from '@ngx-formly/core';\nimport { MatFormField } from '@angular/material/form-field';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { Subject } from 'rxjs';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { FieldType } from './field.type';\n\ninterface MatFormlyFieldConfig extends FormlyFieldConfig {\n __formField__: FormlyWrapperFormField;\n}\n\n@Component({\n selector: 'formly-wrapper-mat-form-field',\n template: `\n <!-- fix https://github.com/angular/material2/pull/7083 by setting width to 100% -->\n <mat-form-field\n [hideRequiredMarker]=\"true\"\n [floatLabel]=\"to.floatLabel\"\n [appearance]=\"to.appearance\"\n [color]=\"to.color\">\n <ng-container #fieldComponent></ng-container>\n <mat-label *ngIf=\"to.label && to.hideLabel !== true\">\n {{ to.label }}\n <span *ngIf=\"to.required && to.hideRequiredMarker !== true\" aria-hidden=\"true\" class=\"mat-form-field-required-marker\">*</span>\n </mat-label>\n\n <ng-container matPrefix *ngIf=\"to.prefix || to._matPrefix\">\n <ng-container *ngTemplateOutlet=\"to.prefix ? to.prefix : to._matPrefix\"></ng-container>\n </ng-container>\n\n <ng-container matSuffix *ngIf=\"to.suffix || to._matSuffix\">\n <ng-container *ngTemplateOutlet=\"to.suffix ? to.suffix : to._matSuffix\"></ng-container>\n </ng-container>\n\n <mat-error>\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </mat-error>\n <!-- fix https://github.com/angular/material2/issues/7737 by setting id to null -->\n <mat-hint *ngIf=\"to.description\" [id]=\"null\">{{ to.description }}</mat-hint>\n </mat-form-field>\n `,\n providers: [{ provide: MatFormFieldControl, useExisting: FormlyWrapperFormField }],\n styleUrls: ['./form-field.wrapper.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperFormField extends FieldWrapper<MatFormlyFieldConfig> implements OnInit, OnDestroy, MatFormFieldControl<any>, AfterViewInit, AfterContentChecked {\n // TODO: remove `any`, once dropping angular `V7` support.\n @ViewChild('fieldComponent', <any>{ read: ViewContainerRef, static: true }) fieldComponent!: ViewContainerRef;\n\n // TODO: remove `any`, once dropping angular `V7` support.\n @ViewChild(MatFormField, <any> { static: true }) formField!: MatFormField;\n\n stateChanges = new Subject<void>();\n _errorState = false;\n private initialGapCalculated = false;\n\n constructor(\n private config: FormlyConfig,\n private renderer: Renderer2,\n private elementRef: ElementRef,\n private focusMonitor: FocusMonitor,\n ) {\n super();\n }\n\n ngOnInit() {\n this.formField._control = this;\n defineHiddenProp(this.field, '__formField__', this.formField);\n\n const ref = this.config.resolveFieldTypeRef(this.formlyField);\n if (ref && !(ref.instance instanceof FieldType)) {\n console.warn(`Component '${ref.componentType.name}' must extend 'FieldType' from '@ngx-formly/material/form-field'.`);\n }\n\n // fix for https://github.com/angular/material2/issues/11437\n if (this.formlyField.hide && this.formlyField.templateOptions!.appearance === 'outline') {\n this.initialGapCalculated = true;\n }\n\n this.focusMonitor.monitor(this.elementRef, true).subscribe(origin => {\n if (!origin && this.field.focus) {\n this.field.focus = false;\n }\n\n this.stateChanges.next();\n });\n }\n\n ngAfterContentChecked() {\n if (!this.initialGapCalculated || this.formlyField.hide) {\n return;\n }\n\n this.formField.updateOutlineGap();\n this.initialGapCalculated = true;\n }\n\n ngAfterViewInit() {\n // temporary fix for https://github.com/angular/material2/issues/7891\n if (this.formField.appearance !== 'outline' && this.to.hideFieldUnderline === true) {\n const underlineElement = this.formField._elementRef.nativeElement.querySelector('.mat-form-field-underline');\n underlineElement && this.renderer.removeChild(underlineElement.parentNode, underlineElement);\n }\n }\n\n ngOnDestroy() {\n delete this.formlyField.__formField__;\n this.stateChanges.complete();\n this.focusMonitor.stopMonitoring(this.elementRef);\n }\n\n setDescribedByIds(ids: string[]): void { }\n onContainerClick(event: MouseEvent): void {\n this.formlyField.focus = true;\n this.stateChanges.next();\n }\n\n get errorState() {\n const showError = this.options!.showError!(this);\n if (showError !== this._errorState) {\n this._errorState = showError;\n this.stateChanges.next();\n }\n\n return showError;\n }\n get controlType() { return this.to.type; }\n get focused() { return !!this.formlyField.focus && !this.disabled; }\n get disabled() { return !!this.to.disabled; }\n get required() { return !!this.to.required; }\n get placeholder() { return this.to.placeholder || ''; }\n get shouldPlaceholderFloat() { return this.shouldLabelFloat; }\n get value() { return this.formControl.value; }\n get ngControl() { return this.formControl as any; }\n get empty() { return !this.formControl.value; }\n get shouldLabelFloat() { return this.focused || !this.empty; }\n\n get formlyField() { return this.field as MatFormlyFieldConfig; }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n FormlyModule.forChild({\n wrappers: [{\n name: 'form-field',\n component: FormlyWrapperFormField,\n }],\n }),\n ],\n})\nexport class FormlyMatFormFieldModule { }\n"],"names":["FieldType","CoreFieldType","defineHiddenProp"],"mappings":";;;;;;;;;;;;AAIA,MAAa,uBAAuB;;;;IAClC,YAAoB,KAAgB;QAAhB,UAAK,GAAL,KAAK,CAAW;KAAI;;;;;;IAExC,YAAY,CAAC,OAA2B,EAAE,IAAwC;QAChF,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;KAC3C;CACF;;;;;;ACVD;;;;AAMA,MAAsBA,WAA2D,SAAQC,SAAgB;IAAzG;;QAYE,sBAAiB,GAAG,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;QACtD,iBAAY,GAAG,IAAI,OAAO,EAAQ,CAAC;QACnC,gBAAW,GAAG,KAAK,CAAC;KAgErB;;;;IA1EC,IAAI,gBAAgB,KAAK,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,EAAE;;;;;IACxD,IA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AK,0BAAO,IAAI,CAAC,KAAK,GAAyB,EAAE;;;YA9HjE,SAAS,SAAC;gBACT,QAAQ,EAAE,+BAA+B;gBACzC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BT;gBACD,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;gBAElF,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACtC;;;;YA5CgF,YAAY;YAD3C,SAAS;YAAsC,UAAU;YAKlG,YAAY;;;6BA2ClB,SAAS,SAAC,gBAAgB,qBAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;wBAGzE,SAAS,SAAC,YAAY,qBAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;;;;;;;ACnDjD,MAqBa,wBAAwB;;;YAdpC,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;gBACtC,OAAO,EAAE;oBACP,YAAY;oBACZ,mBAAmB;oBACnB,kBAAkB;oBAClB,YAAY,CAAC,QAAQ,CAAC;wBACpB,QAAQ,EAAE,CAAC;gCACT,IAAI,EAAE,YAAY;gCAClB,SAAS,EAAE,sBAAsB;6BAClC,CAAC;qBACH,CAAC;iBACH;aACF;;;;;;;;;;;;;;;"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { FormlyModule } from '@ngx-formly/core';
|
|
3
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { Component, ViewChild, NgModule } from '@angular/core';
|
|
5
|
-
import { MatInput, MatInputModule } from '@angular/material/input';
|
|
6
|
-
import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @fileoverview added by tsickle
|
|
10
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11
|
-
*/
|
|
12
|
-
class FormlyFieldInput extends FieldType {
|
|
13
|
-
/**
|
|
14
|
-
* @return {?}
|
|
15
|
-
*/
|
|
16
|
-
get type() {
|
|
17
|
-
return this.to.type || 'text';
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
FormlyFieldInput.decorators = [
|
|
21
|
-
{ type: Component, args: [{
|
|
22
|
-
selector: 'formly-field-mat-input',
|
|
23
|
-
template: `
|
|
24
|
-
<input *ngIf="type !== 'number'; else numberTmp"
|
|
25
|
-
matInput
|
|
26
|
-
[id]="id"
|
|
27
|
-
[type]="type || 'text'"
|
|
28
|
-
[readonly]="to.readonly"
|
|
29
|
-
[required]="to.required"
|
|
30
|
-
[errorStateMatcher]="errorStateMatcher"
|
|
31
|
-
[formControl]="formControl"
|
|
32
|
-
[formlyAttributes]="field"
|
|
33
|
-
[tabindex]="to.tabindex"
|
|
34
|
-
[placeholder]="to.placeholder">
|
|
35
|
-
<ng-template #numberTmp>
|
|
36
|
-
<input matInput
|
|
37
|
-
[id]="id"
|
|
38
|
-
type="number"
|
|
39
|
-
[readonly]="to.readonly"
|
|
40
|
-
[required]="to.required"
|
|
41
|
-
[errorStateMatcher]="errorStateMatcher"
|
|
42
|
-
[formControl]="formControl"
|
|
43
|
-
[formlyAttributes]="field"
|
|
44
|
-
[tabIndex]="to.tabindex"
|
|
45
|
-
[placeholder]="to.placeholder">
|
|
46
|
-
</ng-template>
|
|
47
|
-
`
|
|
48
|
-
}] }
|
|
49
|
-
];
|
|
50
|
-
FormlyFieldInput.propDecorators = {
|
|
51
|
-
formFieldControl: [{ type: ViewChild, args: [MatInput, (/** @type {?} */ ({ static: false })),] }]
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @fileoverview added by tsickle
|
|
56
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
57
|
-
*/
|
|
58
|
-
class FormlyMatInputModule {
|
|
59
|
-
}
|
|
60
|
-
FormlyMatInputModule.decorators = [
|
|
61
|
-
{ type: NgModule, args: [{
|
|
62
|
-
declarations: [FormlyFieldInput],
|
|
63
|
-
imports: [
|
|
64
|
-
CommonModule,
|
|
65
|
-
ReactiveFormsModule,
|
|
66
|
-
MatInputModule,
|
|
67
|
-
FormlyMatFormFieldModule,
|
|
68
|
-
FormlyModule.forChild({
|
|
69
|
-
types: [
|
|
70
|
-
{
|
|
71
|
-
name: 'input',
|
|
72
|
-
component: FormlyFieldInput,
|
|
73
|
-
wrappers: ['form-field'],
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
}),
|
|
77
|
-
],
|
|
78
|
-
},] }
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @fileoverview added by tsickle
|
|
83
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @fileoverview added by tsickle
|
|
88
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
export { FormlyMatInputModule, FormlyFieldInput };
|
|
92
|
-
|
|
93
|
-
//# sourceMappingURL=ngx-formly-material-input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-input.js.map","sources":["ng://@ngx-formly/material/input/input.type.ts","ng://@ngx-formly/material/input/input.module.ts"],"sourcesContent":["import { Component, OnInit, ViewChild } from '@angular/core';\nimport { MatInput } from '@angular/material/input';\nimport { FieldType } from '@ngx-formly/material/form-field';\n\n@Component({\n selector: 'formly-field-mat-input',\n template: `\n <input *ngIf=\"type !== 'number'; else numberTmp\"\n matInput\n [id]=\"id\"\n [type]=\"type || 'text'\"\n [readonly]=\"to.readonly\"\n [required]=\"to.required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabindex]=\"to.tabindex\"\n [placeholder]=\"to.placeholder\">\n <ng-template #numberTmp>\n <input matInput\n [id]=\"id\"\n type=\"number\"\n [readonly]=\"to.readonly\"\n [required]=\"to.required\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"to.tabindex\"\n [placeholder]=\"to.placeholder\">\n </ng-template>\n `,\n})\nexport class FormlyFieldInput extends FieldType implements OnInit {\n @ViewChild(MatInput, <any> { static: false }) formFieldControl!: MatInput;\n\n get type() {\n return this.to.type || 'text';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { FormlyFieldInput } from './input.type';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatInputModule,\n\n FormlyMatFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatInputModule { }\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAgCa,gBAAiB,SAAQ,SAAS;;;;IAG7C,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,MAAM,CAAC;KAC/B;;;YAjCF,SAAS,SAAC;gBACT,QAAQ,EAAE,wBAAwB;gBAClC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;GAwBT;aACF;;;+BAEE,SAAS,SAAC,QAAQ,qBAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;;;;;;;ACjC9C,MA6Ba,oBAAoB;;;YAnBhC,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;gBAChC,OAAO,EAAE;oBACP,YAAY;oBACZ,mBAAmB;oBACnB,cAAc;oBAEd,wBAAwB;oBACxB,YAAY,CAAC,QAAQ,CAAC;wBACpB,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,OAAO;gCACb,SAAS,EAAE,gBAAgB;gCAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;6BACzB;yBACF;qBACF,CAAC;iBACH;aACF;;;;;;;;;;;;;;;"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
3
|
-
import { FormlyModule } from '@ngx-formly/core';
|
|
4
|
-
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
5
|
-
import { Component, ViewChildren, NgModule } from '@angular/core';
|
|
6
|
-
import { FieldType, FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';
|
|
7
|
-
import { MatCheckbox, MatCheckboxModule } from '@angular/material/checkbox';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @fileoverview added by tsickle
|
|
11
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
12
|
-
*/
|
|
13
|
-
class FormlyFieldMultiCheckbox extends FieldType {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.defaultOptions = {
|
|
17
|
-
templateOptions: {
|
|
18
|
-
hideFieldUnderline: true,
|
|
19
|
-
floatLabel: 'always',
|
|
20
|
-
options: [],
|
|
21
|
-
color: 'accent',
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @param {?} value
|
|
27
|
-
* @param {?} checked
|
|
28
|
-
* @return {?}
|
|
29
|
-
*/
|
|
30
|
-
onChange(value, checked) {
|
|
31
|
-
if (this.to.type === 'array') {
|
|
32
|
-
this.formControl.patchValue(checked
|
|
33
|
-
? [...(this.formControl.value || []), value]
|
|
34
|
-
: [...(this.formControl.value || [])].filter((/**
|
|
35
|
-
* @param {?} o
|
|
36
|
-
* @return {?}
|
|
37
|
-
*/
|
|
38
|
-
o => o !== value)));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.formControl.patchValue(Object.assign({}, this.formControl.value, { [value]: checked }));
|
|
42
|
-
}
|
|
43
|
-
this.formControl.markAsTouched();
|
|
44
|
-
}
|
|
45
|
-
// TODO: find a solution to prevent scroll on focus
|
|
46
|
-
/**
|
|
47
|
-
* @return {?}
|
|
48
|
-
*/
|
|
49
|
-
onContainerClick() { }
|
|
50
|
-
/**
|
|
51
|
-
* @param {?} option
|
|
52
|
-
* @return {?}
|
|
53
|
-
*/
|
|
54
|
-
isChecked(option) {
|
|
55
|
-
/** @type {?} */
|
|
56
|
-
const value = this.formControl.value;
|
|
57
|
-
return value && (this.to.type === 'array'
|
|
58
|
-
? (value.indexOf(option.value) !== -1)
|
|
59
|
-
: value[option.value]);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
FormlyFieldMultiCheckbox.decorators = [
|
|
63
|
-
{ type: Component, args: [{
|
|
64
|
-
selector: 'formly-field-mat-multicheckbox',
|
|
65
|
-
template: `
|
|
66
|
-
<ng-container *ngFor="let option of to.options | formlySelectOptions:field | async; let i = index;">
|
|
67
|
-
<mat-checkbox
|
|
68
|
-
[id]="id + '_' + i"
|
|
69
|
-
[formlyAttributes]="field"
|
|
70
|
-
[tabIndex]="to.tabindex"
|
|
71
|
-
[color]="to.color"
|
|
72
|
-
[labelPosition]="to.labelPosition"
|
|
73
|
-
[checked]="isChecked(option)"
|
|
74
|
-
[disabled]="formControl.disabled"
|
|
75
|
-
(change)="onChange(option.value, $event.checked)">
|
|
76
|
-
{{ option.label }}
|
|
77
|
-
</mat-checkbox>
|
|
78
|
-
</ng-container>
|
|
79
|
-
`
|
|
80
|
-
}] }
|
|
81
|
-
];
|
|
82
|
-
FormlyFieldMultiCheckbox.propDecorators = {
|
|
83
|
-
checkboxes: [{ type: ViewChildren, args: [MatCheckbox,] }]
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @fileoverview added by tsickle
|
|
88
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
89
|
-
*/
|
|
90
|
-
class FormlyMatMultiCheckboxModule {
|
|
91
|
-
}
|
|
92
|
-
FormlyMatMultiCheckboxModule.decorators = [
|
|
93
|
-
{ type: NgModule, args: [{
|
|
94
|
-
declarations: [FormlyFieldMultiCheckbox],
|
|
95
|
-
imports: [
|
|
96
|
-
CommonModule,
|
|
97
|
-
ReactiveFormsModule,
|
|
98
|
-
MatCheckboxModule,
|
|
99
|
-
FormlyMatFormFieldModule,
|
|
100
|
-
FormlySelectModule,
|
|
101
|
-
FormlyModule.forChild({
|
|
102
|
-
types: [
|
|
103
|
-
{
|
|
104
|
-
name: 'multicheckbox',
|
|
105
|
-
component: FormlyFieldMultiCheckbox,
|
|
106
|
-
wrappers: ['form-field'],
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
}),
|
|
110
|
-
],
|
|
111
|
-
},] }
|
|
112
|
-
];
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @fileoverview added by tsickle
|
|
116
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* @fileoverview added by tsickle
|
|
121
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
export { FormlyMatMultiCheckboxModule, FormlyFieldMultiCheckbox };
|
|
125
|
-
|
|
126
|
-
//# sourceMappingURL=ngx-formly-material-multicheckbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-material-multicheckbox.js.map","sources":["ng://@ngx-formly/material/multicheckbox/multicheckbox.type.ts","ng://@ngx-formly/material/multicheckbox/multicheckbox.module.ts"],"sourcesContent":["import { Component, ViewChildren, QueryList } from '@angular/core';\nimport { FieldType } from '@ngx-formly/material/form-field';\nimport { MatCheckbox } from '@angular/material/checkbox';\n\n@Component({\n selector: 'formly-field-mat-multicheckbox',\n template: `\n <ng-container *ngFor=\"let option of to.options | formlySelectOptions:field | async; let i = index;\">\n <mat-checkbox\n [id]=\"id + '_' + i\"\n [formlyAttributes]=\"field\"\n [tabIndex]=\"to.tabindex\"\n [color]=\"to.color\"\n [labelPosition]=\"to.labelPosition\"\n [checked]=\"isChecked(option)\"\n [disabled]=\"formControl.disabled\"\n (change)=\"onChange(option.value, $event.checked)\">\n {{ option.label }}\n </mat-checkbox>\n </ng-container>\n `,\n})\nexport class FormlyFieldMultiCheckbox extends FieldType {\n @ViewChildren(MatCheckbox) checkboxes!: QueryList<MatCheckbox>;\n\n defaultOptions = {\n templateOptions: {\n hideFieldUnderline: true,\n floatLabel: 'always',\n options: [],\n color: 'accent', // workaround for https://github.com/angular/components/issues/18465\n },\n };\n\n onChange(value: any, checked: boolean) {\n if (this.to.type === 'array') {\n this.formControl.patchValue(checked\n ? [...(this.formControl.value || []), value]\n : [...(this.formControl.value || [])].filter(o => o !== value),\n );\n } else {\n this.formControl.patchValue({ ...this.formControl.value, [value]: checked });\n }\n this.formControl.markAsTouched();\n }\n\n // TODO: find a solution to prevent scroll on focus\n onContainerClick() {}\n\n isChecked(option: any) {\n const value = this.formControl.value;\n\n return value && (\n this.to.type === 'array'\n ? (value.indexOf(option.value) !== -1)\n : value[option.value]\n );\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FormlyMatFormFieldModule } from '@ngx-formly/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\n\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n MatCheckboxModule,\n\n FormlyMatFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyMatMultiCheckboxModule { }\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAsBa,wBAAyB,SAAQ,SAAS;IAlBvD;;QAqBE,mBAAc,GAAG;YACf,eAAe,EAAE;gBACf,kBAAkB,EAAE,IAAI;gBACxB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,EAAE;gBACX,KAAK,EAAE,QAAQ;aAChB;SACF,CAAC;KA0BH;;;;;;IAxBC,QAAQ,CAAC,KAAU,EAAE,OAAgB;QACnC,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,OAAO,EAAE;YAC5B,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO;kBAC/B,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC;kBAC1C,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM;;;;gBAAC,CAAC,IAAI,CAAC,KAAK,KAAK,EAAC,CAC/D,CAAC;SACH;aAAM;YACL,IAAI,CAAC,WAAW,CAAC,UAAU,mBAAM,IAAI,CAAC,WAAW,CAAC,KAAK,IAAE,CAAC,KAAK,GAAG,OAAO,IAAG,CAAC;SAC9E;QACD,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;KAClC;;;;;IAGD,gBAAgB,MAAK;;;;;IAErB,SAA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