keevo-components 1.5.189 → 1.5.191
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 +24 -24
- package/ng-package.json +7 -0
- package/package.json +3 -22
- package/src/assets/.gitkeep +0 -0
- package/src/assets/images/LogoEvo.png +0 -0
- package/src/assets/images/LogoPequenaEvo.png +0 -0
- package/src/assets/images/background.png +0 -0
- package/src/assets/images/keepass-logo.png +0 -0
- package/src/assets/images/keepass-logo.svg +74 -0
- package/src/assets/images/keevo-logo.png +0 -0
- package/src/assets/images/logokeevo_2.png +0 -0
- package/src/index.ts +1 -0
- package/src/lib/api/base-components/base-component-button.ts +27 -0
- package/src/lib/api/base-components/base-component-chart.ts +105 -0
- package/src/lib/api/base-components/base-component-crud-form.ts +328 -0
- package/src/lib/api/base-components/base-component-crud-list.ts +111 -0
- package/src/lib/api/base-components/base-component-crud.ts +70 -0
- package/src/lib/api/base-components/base-component-dropdown-new.ts +112 -0
- package/src/lib/api/base-components/base-component-dropdown.ts +164 -0
- package/src/lib/api/base-components/base-component-input.ts +107 -0
- package/src/lib/api/base-components/base-component-multi-select.ts +136 -0
- package/src/lib/api/base-components/base-component.ts +46 -0
- package/src/lib/api/components/chart/chart.config.ts +12 -0
- package/src/lib/api/components/chart/chart.model.ts +9 -0
- package/src/lib/api/components/chart/orchart.config.ts +41 -0
- package/src/lib/api/components/chart/orchart.item.ts +33 -0
- package/src/lib/api/components/dropdown/filtro.combo.ts +4 -0
- package/src/lib/api/components/error/error.component.html +3 -0
- package/src/lib/api/components/error/error.component.scss +5 -0
- package/src/lib/api/components/error/error.component.ts +22 -0
- package/src/lib/api/components/error/kverror.module.ts +23 -0
- package/src/lib/api/components/table/action-item.ts +5 -0
- package/src/lib/api/components/table/kv-menuitem.ts +10 -0
- package/src/lib/api/components/table/table.config.column.ts +21 -0
- package/src/lib/api/components/table/table.config.ts +20 -0
- package/src/lib/api/components/table/table.paginate.ts +6 -0
- package/src/lib/api/helpers/component-providers.ts +16 -0
- package/src/lib/api/helpers/keevo-validators.ts +77 -0
- package/src/lib/api/helpers/translate-primeng.ts +25 -0
- package/src/lib/api/models/menu/menu.model.ts +10 -0
- package/{lib/api/models/menu/menucompleto.model.d.ts → src/lib/api/models/menu/menucompleto.model.ts} +7 -6
- package/src/lib/api/models/menu/sistemamenu.model.ts +8 -0
- package/src/lib/api/modules/primeng.module.ts +125 -0
- package/src/lib/api/services/base.api.service.ts +115 -0
- package/src/lib/api/services/component.service.ts +22 -0
- package/src/lib/api/services/form.service.ts +105 -0
- package/src/lib/api/services/imagens.service.ts +20 -0
- package/src/lib/api/services/notification.service.ts +82 -0
- package/src/lib/api/services/object.service.ts +20 -0
- package/src/lib/buttons/button-personalize/button-personalize.component.html +11 -0
- package/src/lib/buttons/button-personalize/button-personalize.component.scss +3 -0
- package/src/lib/buttons/button-personalize/button-personalize.component.ts +13 -0
- package/src/lib/buttons/button-popup/button-popup.component.html +12 -0
- package/src/lib/buttons/button-popup/button-popup.component.scss +13 -0
- package/src/lib/buttons/button-popup/button-popup.component.ts +30 -0
- package/src/lib/buttons/button-secondary/button-secondary.component.html +12 -0
- package/src/lib/buttons/button-secondary/button-secondary.component.scss +14 -0
- package/src/lib/buttons/button-secondary/button-secondary.component.ts +13 -0
- package/src/lib/buttons/button-success/button-success.component.html +11 -0
- package/src/lib/buttons/button-success/button-success.component.scss +13 -0
- package/src/lib/buttons/button-success/button-success.component.ts +13 -0
- package/src/lib/buttons/kvbutton.module.ts +25 -0
- package/src/lib/chart/chart.component.html +38 -0
- package/src/lib/chart/chart.component.scss +0 -0
- package/src/lib/chart/chart.component.spec.ts +28 -0
- package/src/lib/chart/chart.component.ts +141 -0
- package/src/lib/chart/kvchart.module.ts +20 -0
- package/src/lib/directives/template.directive.ts +15 -0
- package/src/lib/inputs/check/check.component.html +11 -0
- package/src/lib/inputs/check/check.component.scss +13 -0
- package/src/lib/inputs/check/check.component.ts +24 -0
- package/src/lib/inputs/dropdown/dropdown.component.html +91 -0
- package/src/lib/inputs/dropdown/dropdown.component.scss +0 -0
- package/src/lib/inputs/dropdown/dropdown.component.ts +28 -0
- package/src/lib/inputs/editor/editor.component.html +90 -0
- package/src/lib/inputs/editor/editor.component.scss +4 -0
- package/src/lib/inputs/editor/editor.component.ts +80 -0
- package/src/lib/inputs/input-calendar/input-calendar.component.html +30 -0
- package/src/lib/inputs/input-calendar/input-calendar.component.scss +0 -0
- package/src/lib/inputs/input-calendar/input-calendar.component.ts +81 -0
- package/src/lib/inputs/input-mask/input-mask.component.html +20 -0
- package/src/lib/inputs/input-mask/input-mask.component.scss +0 -0
- package/src/lib/inputs/input-mask/input-mask.component.ts +20 -0
- package/src/lib/inputs/input-number/input-number.component.html +22 -0
- package/src/lib/inputs/input-number/input-number.component.scss +0 -0
- package/src/lib/inputs/input-number/input-number.component.ts +52 -0
- package/src/lib/inputs/input-password/input-password.component.html +23 -0
- package/src/lib/inputs/input-password/input-password.component.scss +0 -0
- package/src/lib/inputs/input-password/input-password.component.ts +23 -0
- package/src/lib/inputs/input-text/input-text.component.html +20 -0
- package/src/lib/inputs/input-text/input-text.component.scss +18 -0
- package/src/lib/inputs/input-text/input-text.component.ts +17 -0
- package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.html +32 -0
- package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.scss +0 -0
- package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.spec.ts +23 -0
- package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.ts +36 -0
- package/src/lib/inputs/input-textarea/input-textarea.component.html +22 -0
- package/src/lib/inputs/input-textarea/input-textarea.component.scss +0 -0
- package/src/lib/inputs/input-textarea/input-textarea.component.ts +33 -0
- package/src/lib/inputs/input-time/input-time.component.html +23 -0
- package/src/lib/inputs/input-time/input-time.component.scss +0 -0
- package/src/lib/inputs/input-time/input-time.component.ts +20 -0
- package/src/lib/inputs/kvinputs.module.ts +64 -0
- package/src/lib/inputs/multi-select/multi-select.component.html +28 -0
- package/src/lib/inputs/multi-select/multi-select.component.scss +8 -0
- package/src/lib/inputs/multi-select/multi-select.component.ts +31 -0
- package/src/lib/inputs/radio-group/radio-group.component.html +19 -0
- package/src/lib/inputs/radio-group/radio-group.component.scss +15 -0
- package/src/lib/inputs/radio-group/radio-group.component.ts +50 -0
- package/src/lib/inputs/switch/switch.component.html +12 -0
- package/src/lib/inputs/switch/switch.component.scss +3 -0
- package/src/lib/inputs/switch/switch.component.ts +30 -0
- package/src/lib/keevo-components.module.ts +50 -0
- package/src/lib/label/label.component.html +6 -0
- package/src/lib/label/label.component.scss +9 -0
- package/src/lib/label/label.component.spec.ts +23 -0
- package/src/lib/label/label.component.ts +13 -0
- package/src/lib/label/label.module.ts +18 -0
- package/src/lib/loader/kvloader.module.ts +17 -0
- package/src/lib/loader/loader.component.html +1 -0
- package/src/lib/loader/loader.component.ts +14 -0
- package/src/lib/loader/loader.service.ts +26 -0
- package/src/lib/login/kvlogin.module.ts +28 -0
- package/src/lib/login/login.component.html +108 -0
- package/src/lib/login/login.component.scss +48 -0
- package/src/lib/login/login.component.spec.ts +23 -0
- package/src/lib/login/login.component.ts +65 -0
- package/src/lib/menu/kvmenu.module.ts +27 -0
- package/src/lib/menu/menu.component.html +342 -0
- package/src/lib/menu/menu.component.scss +210 -0
- package/src/lib/menu/menu.component.spec.ts +23 -0
- package/src/lib/menu/menu.component.ts +246 -0
- package/src/lib/orgchart/orgchart.component.html +58 -0
- package/src/lib/orgchart/orgchart.component.scss +21 -0
- package/src/lib/orgchart/orgchart.component.ts +118 -0
- package/src/lib/orgchart/orgchart.module.ts +14 -0
- package/src/lib/page-form/kv-page-form.module.ts +22 -0
- package/src/lib/page-form/page-form.component.html +57 -0
- package/src/lib/page-form/page-form.component.scss +72 -0
- package/src/lib/page-form/page-form.component.spec.ts +28 -0
- package/src/lib/page-form/page-form.component.ts +121 -0
- package/src/lib/picklist/kvpicklist.module.ts +20 -0
- package/src/lib/picklist/picklist.component.html +17 -0
- package/src/lib/picklist/picklist.component.scss +0 -0
- package/src/lib/picklist/picklist.component.spec.ts +26 -0
- package/src/lib/picklist/picklist.component.ts +27 -0
- package/src/lib/pipes/codigofile.pipe.ts +15 -0
- package/src/lib/pipes/cpfcnpj.pipe.ts +21 -0
- package/src/lib/pipes/pipes.module.ts +22 -0
- package/src/lib/pipes/telefone.pipe.ts +38 -0
- package/src/lib/styles-components.scss +11 -0
- package/src/lib/table/kvtable.module.ts +22 -0
- package/src/lib/table/table.component.html +473 -0
- package/src/lib/table/table.component.scss +240 -0
- package/src/lib/table/table.component.spec.ts +28 -0
- package/src/lib/table/table.component.ts +546 -0
- package/src/lib/tree-table/kv-treetable.component.html +649 -0
- package/src/lib/tree-table/kv-treetable.component.scss +315 -0
- package/src/lib/tree-table/kv-treetable.component.ts +390 -0
- package/src/lib/tree-table/kv-treetable.module.ts +18 -0
- package/src/lib/tree-view/kvtree-view.module.ts +19 -0
- package/src/lib/tree-view/tree-view.component.html +9 -0
- package/src/lib/tree-view/tree-view.component.scss +0 -0
- package/src/lib/tree-view/tree-view.component.spec.ts +23 -0
- package/src/lib/tree-view/tree-view.component.ts +29 -0
- package/src/lib/workspace/kvworkspace.module.ts +29 -0
- package/src/lib/workspace/workspace.component.html +108 -0
- package/src/lib/workspace/workspace.component.scss +83 -0
- package/src/lib/workspace/workspace.component.ts +75 -0
- package/{public-api.d.ts → src/public-api.ts} +156 -133
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2020/keevo-components.mjs +0 -5
- package/esm2020/lib/api/base-components/base-component-button.mjs +0 -36
- package/esm2020/lib/api/base-components/base-component-chart.mjs +0 -92
- package/esm2020/lib/api/base-components/base-component-crud-form.mjs +0 -269
- package/esm2020/lib/api/base-components/base-component-crud-list.mjs +0 -67
- package/esm2020/lib/api/base-components/base-component-crud.mjs +0 -65
- package/esm2020/lib/api/base-components/base-component-dropdown-new.mjs +0 -211
- package/esm2020/lib/api/base-components/base-component-dropdown.mjs +0 -161
- package/esm2020/lib/api/base-components/base-component-input.mjs +0 -94
- package/esm2020/lib/api/base-components/base-component-multi-select.mjs +0 -128
- package/esm2020/lib/api/base-components/base-component.mjs +0 -49
- package/esm2020/lib/api/components/chart/chart.config.mjs +0 -2
- package/esm2020/lib/api/components/chart/chart.model.mjs +0 -2
- package/esm2020/lib/api/components/chart/orchart.config.mjs +0 -2
- package/esm2020/lib/api/components/chart/orchart.item.mjs +0 -2
- package/esm2020/lib/api/components/dropdown/filtro.combo.mjs +0 -2
- package/esm2020/lib/api/components/error/error.component.mjs +0 -26
- package/esm2020/lib/api/components/error/kverror.module.mjs +0 -35
- package/esm2020/lib/api/components/table/action-item.mjs +0 -2
- package/esm2020/lib/api/components/table/kv-menuitem.mjs +0 -3
- package/esm2020/lib/api/components/table/table.config.column.mjs +0 -2
- package/esm2020/lib/api/components/table/table.config.mjs +0 -2
- package/esm2020/lib/api/components/table/table.paginate.mjs +0 -9
- package/esm2020/lib/api/helpers/component-providers.mjs +0 -16
- package/esm2020/lib/api/helpers/keevo-validators.mjs +0 -64
- package/esm2020/lib/api/helpers/translate-primeng.mjs +0 -23
- package/esm2020/lib/api/models/menu/menu.model.mjs +0 -2
- package/esm2020/lib/api/models/menu/menucompleto.model.mjs +0 -2
- package/esm2020/lib/api/models/menu/sistemamenu.model.mjs +0 -2
- package/esm2020/lib/api/modules/primeng.module.mjs +0 -247
- package/esm2020/lib/api/services/base.api.service.mjs +0 -74
- package/esm2020/lib/api/services/component.service.mjs +0 -27
- package/esm2020/lib/api/services/form.service.mjs +0 -84
- package/esm2020/lib/api/services/imagens.service.mjs +0 -22
- package/esm2020/lib/api/services/notification.service.mjs +0 -67
- package/esm2020/lib/api/services/object.service.mjs +0 -26
- package/esm2020/lib/buttons/button-personalize/button-personalize.component.mjs +0 -17
- package/esm2020/lib/buttons/button-popup/button-popup.component.mjs +0 -31
- package/esm2020/lib/buttons/button-secondary/button-secondary.component.mjs +0 -17
- package/esm2020/lib/buttons/button-success/button-success.component.mjs +0 -17
- package/esm2020/lib/buttons/kvbutton.module.mjs +0 -39
- package/esm2020/lib/chart/chart.component.mjs +0 -145
- package/esm2020/lib/chart/kvchart.module.mjs +0 -32
- package/esm2020/lib/directives/template.directive.mjs +0 -24
- package/esm2020/lib/inputs/check/check.component.mjs +0 -26
- package/esm2020/lib/inputs/dropdown/dropdown.component.mjs +0 -37
- package/esm2020/lib/inputs/editor/editor.component.mjs +0 -70
- package/esm2020/lib/inputs/input-calendar/input-calendar.component.mjs +0 -89
- package/esm2020/lib/inputs/input-mask/input-mask.component.mjs +0 -23
- package/esm2020/lib/inputs/input-number/input-number.component.mjs +0 -59
- package/esm2020/lib/inputs/input-password/input-password.component.mjs +0 -33
- package/esm2020/lib/inputs/input-text/input-text.component.mjs +0 -21
- package/esm2020/lib/inputs/input-text-checkbox/input-text-checkbox.component.mjs +0 -38
- package/esm2020/lib/inputs/input-textarea/input-textarea.component.mjs +0 -43
- package/esm2020/lib/inputs/input-time/input-time.component.mjs +0 -24
- package/esm2020/lib/inputs/kvinputs.module.mjs +0 -108
- package/esm2020/lib/inputs/multi-select/multi-select.component.mjs +0 -38
- package/esm2020/lib/inputs/radio-group/radio-group.component.mjs +0 -53
- package/esm2020/lib/inputs/switch/switch.component.mjs +0 -32
- package/esm2020/lib/keevo-components.module.mjs +0 -105
- package/esm2020/lib/label/label.component.mjs +0 -15
- package/esm2020/lib/label/label.module.mjs +0 -24
- package/esm2020/lib/loader/loader.component.mjs +0 -18
- package/esm2020/lib/loader/loader.module.mjs +0 -28
- package/esm2020/lib/loader/loader.service.mjs +0 -29
- package/esm2020/lib/login/kvlogin.module.mjs +0 -47
- package/esm2020/lib/login/login.component.mjs +0 -52
- package/esm2020/lib/menu/kvmenu.module.mjs +0 -43
- package/esm2020/lib/menu/menu.component.mjs +0 -237
- package/esm2020/lib/orgchart/orgchart.component.mjs +0 -100
- package/esm2020/lib/orgchart/orgchart.module.mjs +0 -24
- package/esm2020/lib/page-form/kv-page-form.module.mjs +0 -38
- package/esm2020/lib/page-form/page-form.component.mjs +0 -144
- package/esm2020/lib/picklist/kvpicklist.module.mjs +0 -32
- package/esm2020/lib/picklist/picklist.component.mjs +0 -48
- package/esm2020/lib/pipes/codigofile.pipe.mjs +0 -19
- package/esm2020/lib/pipes/cpfcnpj.pipe.mjs +0 -25
- package/esm2020/lib/pipes/pipes.module.mjs +0 -34
- package/esm2020/lib/pipes/telefone.pipe.mjs +0 -45
- package/esm2020/lib/table/kvtable.module.mjs +0 -32
- package/esm2020/lib/table/table.component.mjs +0 -499
- package/esm2020/lib/tree-table/kv-treetable.component.mjs +0 -371
- package/esm2020/lib/tree-table/kv-treetable.module.mjs +0 -32
- package/esm2020/lib/tree-view/kvtree-view.module.mjs +0 -28
- package/esm2020/lib/tree-view/tree-view.component.mjs +0 -29
- package/esm2020/lib/workspace/kvworkspace.module.mjs +0 -47
- package/esm2020/lib/workspace/workspace.component.mjs +0 -77
- package/esm2020/public-api.mjs +0 -137
- package/fesm2015/keevo-components.mjs +0 -4706
- package/fesm2015/keevo-components.mjs.map +0 -1
- package/fesm2020/keevo-components.mjs +0 -4697
- package/fesm2020/keevo-components.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/api/base-components/base-component-button.d.ts +0 -14
- package/lib/api/base-components/base-component-chart.d.ts +0 -40
- package/lib/api/base-components/base-component-crud-form.d.ts +0 -137
- package/lib/api/base-components/base-component-crud-list.d.ts +0 -63
- package/lib/api/base-components/base-component-crud.d.ts +0 -36
- package/lib/api/base-components/base-component-dropdown-new.d.ts +0 -14
- package/lib/api/base-components/base-component-dropdown.d.ts +0 -42
- package/lib/api/base-components/base-component-input.d.ts +0 -31
- package/lib/api/base-components/base-component-multi-select.d.ts +0 -35
- package/lib/api/base-components/base-component.d.ts +0 -21
- package/lib/api/components/chart/chart.config.d.ts +0 -11
- package/lib/api/components/chart/chart.model.d.ts +0 -9
- package/lib/api/components/chart/orchart.config.d.ts +0 -35
- package/lib/api/components/chart/orchart.item.d.ts +0 -26
- package/lib/api/components/dropdown/filtro.combo.d.ts +0 -4
- package/lib/api/components/error/error.component.d.ts +0 -12
- package/lib/api/components/error/kverror.module.d.ts +0 -10
- package/lib/api/components/table/action-item.d.ts +0 -5
- package/lib/api/components/table/kv-menuitem.d.ts +0 -9
- package/lib/api/components/table/table.config.column.d.ts +0 -21
- package/lib/api/components/table/table.config.d.ts +0 -17
- package/lib/api/components/table/table.paginate.d.ts +0 -6
- package/lib/api/helpers/component-providers.d.ts +0 -2
- package/lib/api/helpers/keevo-validators.d.ts +0 -10
- package/lib/api/helpers/translate-primeng.d.ts +0 -4
- package/lib/api/models/menu/menu.model.d.ts +0 -10
- package/lib/api/models/menu/sistemamenu.model.d.ts +0 -8
- package/lib/api/modules/primeng.module.d.ts +0 -60
- package/lib/api/services/base.api.service.d.ts +0 -25
- package/lib/api/services/component.service.d.ts +0 -11
- package/lib/api/services/form.service.d.ts +0 -27
- package/lib/api/services/imagens.service.d.ts +0 -8
- package/lib/api/services/notification.service.d.ts +0 -25
- package/lib/api/services/object.service.d.ts +0 -8
- package/lib/buttons/button-personalize/button-personalize.component.d.ts +0 -7
- package/lib/buttons/button-popup/button-popup.component.d.ts +0 -13
- package/lib/buttons/button-secondary/button-secondary.component.d.ts +0 -7
- package/lib/buttons/button-success/button-success.component.d.ts +0 -7
- package/lib/buttons/kvbutton.module.d.ts +0 -11
- package/lib/chart/chart.component.d.ts +0 -56
- package/lib/chart/kvchart.module.d.ts +0 -10
- package/lib/directives/template.directive.d.ts +0 -11
- package/lib/inputs/check/check.component.d.ts +0 -11
- package/lib/inputs/dropdown/dropdown.component.d.ts +0 -14
- package/lib/inputs/editor/editor.component.d.ts +0 -39
- package/lib/inputs/input-calendar/input-calendar.component.d.ts +0 -27
- package/lib/inputs/input-mask/input-mask.component.d.ts +0 -10
- package/lib/inputs/input-number/input-number.component.d.ts +0 -19
- package/lib/inputs/input-password/input-password.component.d.ts +0 -13
- package/lib/inputs/input-text/input-text.component.d.ts +0 -9
- package/lib/inputs/input-text-checkbox/input-text-checkbox.component.d.ts +0 -15
- package/lib/inputs/input-textarea/input-textarea.component.d.ts +0 -16
- package/lib/inputs/input-time/input-time.component.d.ts +0 -10
- package/lib/inputs/kvinputs.module.d.ts +0 -25
- package/lib/inputs/multi-select/multi-select.component.d.ts +0 -12
- package/lib/inputs/radio-group/radio-group.component.d.ts +0 -18
- package/lib/inputs/switch/switch.component.d.ts +0 -13
- package/lib/keevo-components.module.d.ts +0 -19
- package/lib/label/label.component.d.ts +0 -7
- package/lib/label/label.module.d.ts +0 -8
- package/lib/loader/loader.component.d.ts +0 -10
- package/lib/loader/loader.module.d.ts +0 -9
- package/lib/loader/loader.service.d.ts +0 -10
- package/lib/login/kvlogin.module.d.ts +0 -13
- package/lib/login/login.component.d.ts +0 -30
- package/lib/menu/kvmenu.module.d.ts +0 -12
- package/lib/menu/menu.component.d.ts +0 -74
- package/lib/orgchart/orgchart.component.d.ts +0 -27
- package/lib/orgchart/orgchart.module.d.ts +0 -9
- package/lib/page-form/kv-page-form.module.d.ts +0 -11
- package/lib/page-form/page-form.component.d.ts +0 -69
- package/lib/picklist/kvpicklist.module.d.ts +0 -10
- package/lib/picklist/picklist.component.d.ts +0 -20
- package/lib/pipes/codigofile.pipe.d.ts +0 -7
- package/lib/pipes/cpfcnpj.pipe.d.ts +0 -7
- package/lib/pipes/pipes.module.d.ts +0 -10
- package/lib/pipes/telefone.pipe.d.ts +0 -7
- package/lib/table/kvtable.module.d.ts +0 -10
- package/lib/table/table.component.d.ts +0 -104
- package/lib/tree-table/kv-treetable.component.d.ts +0 -84
- package/lib/tree-table/kv-treetable.module.d.ts +0 -11
- package/lib/tree-view/kvtree-view.module.d.ts +0 -9
- package/lib/tree-view/tree-view.component.d.ts +0 -14
- package/lib/workspace/kvworkspace.module.d.ts +0 -13
- package/lib/workspace/workspace.component.d.ts +0 -28
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Injectable, Injector } from '@angular/core';
|
|
2
|
+
import { FormControl, FormControlName, FormGroupDirective, NgControl } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class ComponentService {
|
|
6
|
+
|
|
7
|
+
constructor(public readonly injector: Injector, public changeDetectorRef: ChangeDetectorRef) { }
|
|
8
|
+
|
|
9
|
+
getFormControl(): FormControl<any> | undefined {
|
|
10
|
+
try {
|
|
11
|
+
const control = this.injector.get(NgControl);
|
|
12
|
+
if (control.constructor === FormControlName) {
|
|
13
|
+
return this.injector.get(FormGroupDirective).getControl(control as FormControlName);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
catch(ex){
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Injectable, Type } from '@angular/core';
|
|
2
|
+
import { FormGroup, ValidatorFn } from '@angular/forms';
|
|
3
|
+
import { ObjectService } from './object.service';
|
|
4
|
+
import { DialogService } from 'primeng/dynamicdialog';
|
|
5
|
+
|
|
6
|
+
export interface paramsDialog {
|
|
7
|
+
id?: any;
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
maximizable?: boolean;
|
|
10
|
+
popup?: boolean;
|
|
11
|
+
height?: string;
|
|
12
|
+
width?: string;
|
|
13
|
+
styleClass?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Injectable({
|
|
17
|
+
providedIn: 'root'
|
|
18
|
+
})
|
|
19
|
+
export class FormService {
|
|
20
|
+
|
|
21
|
+
static disableControl(formGroup: FormGroup, controName: string) {
|
|
22
|
+
formGroup?.controls[controName]?.disable();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static disableAndClearControl(formGroup: FormGroup, controName: string, value?: any) {
|
|
26
|
+
this.disableControl(formGroup, controName);
|
|
27
|
+
this.setControlValue(formGroup, controName, null || value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static enableControl(formGroup: FormGroup, controName: string) {
|
|
31
|
+
formGroup?.controls[controName]?.enable();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static getFormValue<T>(formGroup: FormGroup, controName: string): T {
|
|
35
|
+
return <T>formGroup?.controls[controName]?.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static hasControlError(formGroup: FormGroup, control: string, errorCode?: string): boolean {
|
|
39
|
+
const formControl = formGroup.get(control);
|
|
40
|
+
let hasError: boolean = false;
|
|
41
|
+
|
|
42
|
+
if (!formControl) return false;
|
|
43
|
+
if (errorCode) hasError = formControl.hasError(errorCode);
|
|
44
|
+
else hasError = formControl.errors ? true : false;
|
|
45
|
+
|
|
46
|
+
return hasError && formControl.touched;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static invalidForm(formGroup: FormGroup, notification?: any) {
|
|
50
|
+
const keys = Object.keys(formGroup.getRawValue());
|
|
51
|
+
|
|
52
|
+
keys.forEach(k => {
|
|
53
|
+
const control = formGroup.controls[k];
|
|
54
|
+
|
|
55
|
+
if (notification) {
|
|
56
|
+
if (notification?.item2) {
|
|
57
|
+
const item = ObjectService.findObject(notification.item2, 'property', k);
|
|
58
|
+
if (item) control.setErrors({ backendError: true, erroMessage: item.message });
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const item = ObjectService.findObject(notification, 'key', k);
|
|
62
|
+
if (item) control.setErrors({ backendError: true, erroMessage: item.message });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (!control.valid) {
|
|
67
|
+
control.markAsTouched();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static openDialog(
|
|
73
|
+
dialogService: DialogService,
|
|
74
|
+
componentType: Type<any>,
|
|
75
|
+
callBackFunction: Function,
|
|
76
|
+
paramsDialog?: paramsDialog
|
|
77
|
+
) {
|
|
78
|
+
const ref = dialogService.open(componentType, {
|
|
79
|
+
closable: paramsDialog?.closable || false,
|
|
80
|
+
maximizable: paramsDialog?.maximizable || false,
|
|
81
|
+
height: paramsDialog?.height || 'auto',
|
|
82
|
+
width: paramsDialog?.width,
|
|
83
|
+
styleClass: paramsDialog?.styleClass,
|
|
84
|
+
showHeader: true,
|
|
85
|
+
data: { id: paramsDialog?.id, popup: paramsDialog?.popup && true }
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
ref.onClose.subscribe((data: any) => {
|
|
89
|
+
if (data) callBackFunction(data);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
static setControlValue(formGroup: FormGroup, controName: string, value: any) {
|
|
94
|
+
formGroup?.controls[controName]?.setValue(value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static setValidators(formGroup: FormGroup, controName: string, validators: ValidatorFn | ValidatorFn[] | null) {
|
|
98
|
+
formGroup?.controls[controName]?.setValidators(validators);
|
|
99
|
+
formGroup?.controls[controName]?.updateValueAndValidity();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static clearValidators(formGroup: FormGroup, controName: string) {
|
|
103
|
+
formGroup?.controls[controName]?.updateValueAndValidity();
|
|
104
|
+
}
|
|
105
|
+
}
|