keevo-components 1.5.191 → 1.5.193
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/esm2020/keevo-components.mjs +5 -0
- package/esm2020/lib/api/base-components/base-component-button.mjs +36 -0
- package/esm2020/lib/api/base-components/base-component-chart.mjs +92 -0
- package/esm2020/lib/api/base-components/base-component-crud-form.mjs +270 -0
- package/esm2020/lib/api/base-components/base-component-crud-list.mjs +68 -0
- package/esm2020/lib/api/base-components/base-component-crud.mjs +65 -0
- package/esm2020/lib/api/base-components/base-component-dropdown-new.mjs +211 -0
- package/esm2020/lib/api/base-components/base-component-dropdown.mjs +161 -0
- package/esm2020/lib/api/base-components/base-component-input.mjs +94 -0
- package/esm2020/lib/api/base-components/base-component-multi-select.mjs +128 -0
- package/esm2020/lib/api/base-components/base-component.mjs +49 -0
- package/esm2020/lib/api/components/chart/chart.config.mjs +2 -0
- package/esm2020/lib/api/components/chart/chart.model.mjs +2 -0
- package/esm2020/lib/api/components/chart/orchart.config.mjs +2 -0
- package/esm2020/lib/api/components/chart/orchart.item.mjs +2 -0
- package/esm2020/lib/api/components/dropdown/filtro.combo.mjs +2 -0
- package/esm2020/lib/api/components/error/error.component.mjs +26 -0
- package/esm2020/lib/api/components/error/kverror.module.mjs +35 -0
- package/esm2020/lib/api/components/table/action-item.mjs +2 -0
- package/esm2020/lib/api/components/table/kv-menuitem.mjs +3 -0
- package/esm2020/lib/api/components/table/table.config.column.mjs +2 -0
- package/esm2020/lib/api/components/table/table.config.mjs +2 -0
- package/esm2020/lib/api/components/table/table.paginate.mjs +9 -0
- package/esm2020/lib/api/helpers/component-providers.mjs +16 -0
- package/esm2020/lib/api/helpers/keevo-validators.mjs +64 -0
- package/esm2020/lib/api/helpers/translate-primeng.mjs +23 -0
- package/esm2020/lib/api/models/menu/menu.model.mjs +2 -0
- package/esm2020/lib/api/models/menu/menucompleto.model.mjs +2 -0
- package/esm2020/lib/api/models/menu/sistemamenu.model.mjs +2 -0
- package/esm2020/lib/api/modules/primeng.module.mjs +247 -0
- package/esm2020/lib/api/services/base.api.service.mjs +74 -0
- package/esm2020/lib/api/services/component.service.mjs +27 -0
- package/esm2020/lib/api/services/form.service.mjs +84 -0
- package/esm2020/lib/api/services/imagens.service.mjs +22 -0
- package/esm2020/lib/api/services/notification.service.mjs +67 -0
- package/esm2020/lib/api/services/object.service.mjs +26 -0
- package/esm2020/lib/buttons/button-personalize/button-personalize.component.mjs +17 -0
- package/esm2020/lib/buttons/button-popup/button-popup.component.mjs +31 -0
- package/esm2020/lib/buttons/button-secondary/button-secondary.component.mjs +17 -0
- package/esm2020/lib/buttons/button-success/button-success.component.mjs +17 -0
- package/esm2020/lib/buttons/kvbutton.module.mjs +39 -0
- package/esm2020/lib/chart/chart.component.mjs +145 -0
- package/esm2020/lib/chart/kvchart.module.mjs +32 -0
- package/esm2020/lib/directives/template.directive.mjs +24 -0
- package/esm2020/lib/inputs/check/check.component.mjs +26 -0
- package/esm2020/lib/inputs/dropdown/dropdown.component.mjs +37 -0
- package/esm2020/lib/inputs/editor/editor.component.mjs +70 -0
- package/esm2020/lib/inputs/input-calendar/input-calendar.component.mjs +89 -0
- package/esm2020/lib/inputs/input-mask/input-mask.component.mjs +23 -0
- package/esm2020/lib/inputs/input-number/input-number.component.mjs +59 -0
- package/esm2020/lib/inputs/input-password/input-password.component.mjs +33 -0
- package/esm2020/lib/inputs/input-text/input-text.component.mjs +21 -0
- package/esm2020/lib/inputs/input-text-checkbox/input-text-checkbox.component.mjs +38 -0
- package/esm2020/lib/inputs/input-textarea/input-textarea.component.mjs +43 -0
- package/esm2020/lib/inputs/input-time/input-time.component.mjs +24 -0
- package/esm2020/lib/inputs/kvinputs.module.mjs +108 -0
- package/esm2020/lib/inputs/multi-select/multi-select.component.mjs +38 -0
- package/esm2020/lib/inputs/radio-group/radio-group.component.mjs +53 -0
- package/esm2020/lib/inputs/switch/switch.component.mjs +32 -0
- package/esm2020/lib/keevo-components.module.mjs +105 -0
- package/esm2020/lib/label/label.component.mjs +15 -0
- package/esm2020/lib/label/label.module.mjs +24 -0
- package/esm2020/lib/loader/kvloader.module.mjs +28 -0
- package/esm2020/lib/loader/loader.component.mjs +17 -0
- package/esm2020/lib/loader/loader.service.mjs +29 -0
- package/esm2020/lib/login/kvlogin.module.mjs +47 -0
- package/esm2020/lib/login/login.component.mjs +52 -0
- package/esm2020/lib/menu/kvmenu.module.mjs +43 -0
- package/esm2020/lib/menu/menu.component.mjs +237 -0
- package/esm2020/lib/orgchart/orgchart.component.mjs +100 -0
- package/esm2020/lib/orgchart/orgchart.module.mjs +24 -0
- package/esm2020/lib/page-form/kv-page-form.module.mjs +38 -0
- package/esm2020/lib/page-form/page-form.component.mjs +144 -0
- package/esm2020/lib/picklist/kvpicklist.module.mjs +32 -0
- package/esm2020/lib/picklist/picklist.component.mjs +48 -0
- package/esm2020/lib/pipes/codigofile.pipe.mjs +19 -0
- package/esm2020/lib/pipes/cpfcnpj.pipe.mjs +25 -0
- package/esm2020/lib/pipes/pipes.module.mjs +34 -0
- package/esm2020/lib/pipes/telefone.pipe.mjs +45 -0
- package/esm2020/lib/table/kvtable.module.mjs +32 -0
- package/esm2020/lib/table/table.component.mjs +500 -0
- package/esm2020/lib/tree-table/kv-treetable.component.mjs +371 -0
- package/esm2020/lib/tree-table/kv-treetable.module.mjs +32 -0
- package/esm2020/lib/tree-view/kvtree-view.module.mjs +28 -0
- package/esm2020/lib/tree-view/tree-view.component.mjs +29 -0
- package/esm2020/lib/workspace/kvworkspace.module.mjs +47 -0
- package/esm2020/lib/workspace/workspace.component.mjs +77 -0
- package/esm2020/public-api.mjs +138 -0
- package/fesm2015/keevo-components.mjs +4706 -0
- package/fesm2015/keevo-components.mjs.map +1 -0
- package/fesm2020/keevo-components.mjs +4697 -0
- package/fesm2020/keevo-components.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/api/base-components/base-component-button.d.ts +14 -0
- package/lib/api/base-components/base-component-chart.d.ts +40 -0
- package/lib/api/base-components/base-component-crud-form.d.ts +137 -0
- package/lib/api/base-components/base-component-crud-list.d.ts +63 -0
- package/lib/api/base-components/base-component-crud.d.ts +36 -0
- package/lib/api/base-components/base-component-dropdown-new.d.ts +14 -0
- package/lib/api/base-components/base-component-dropdown.d.ts +42 -0
- package/lib/api/base-components/base-component-input.d.ts +31 -0
- package/lib/api/base-components/base-component-multi-select.d.ts +35 -0
- package/lib/api/base-components/base-component.d.ts +21 -0
- package/lib/api/components/chart/chart.config.d.ts +11 -0
- package/lib/api/components/chart/chart.model.d.ts +9 -0
- package/lib/api/components/chart/orchart.config.d.ts +35 -0
- package/lib/api/components/chart/orchart.item.d.ts +26 -0
- package/lib/api/components/dropdown/filtro.combo.d.ts +4 -0
- package/lib/api/components/error/error.component.d.ts +12 -0
- package/lib/api/components/error/kverror.module.d.ts +10 -0
- package/lib/api/components/table/action-item.d.ts +5 -0
- package/lib/api/components/table/kv-menuitem.d.ts +9 -0
- package/lib/api/components/table/table.config.column.d.ts +21 -0
- package/lib/api/components/table/table.config.d.ts +17 -0
- package/lib/api/components/table/table.paginate.d.ts +6 -0
- package/lib/api/helpers/component-providers.d.ts +2 -0
- package/lib/api/helpers/keevo-validators.d.ts +10 -0
- package/lib/api/helpers/translate-primeng.d.ts +4 -0
- package/lib/api/models/menu/menu.model.d.ts +10 -0
- package/{src/lib/api/models/menu/menucompleto.model.ts → lib/api/models/menu/menucompleto.model.d.ts} +6 -7
- package/lib/api/models/menu/sistemamenu.model.d.ts +8 -0
- package/lib/api/modules/primeng.module.d.ts +60 -0
- package/lib/api/services/base.api.service.d.ts +25 -0
- package/lib/api/services/component.service.d.ts +11 -0
- package/lib/api/services/form.service.d.ts +27 -0
- package/lib/api/services/imagens.service.d.ts +8 -0
- package/lib/api/services/notification.service.d.ts +25 -0
- package/lib/api/services/object.service.d.ts +8 -0
- package/lib/buttons/button-personalize/button-personalize.component.d.ts +7 -0
- package/lib/buttons/button-popup/button-popup.component.d.ts +13 -0
- package/lib/buttons/button-secondary/button-secondary.component.d.ts +7 -0
- package/lib/buttons/button-success/button-success.component.d.ts +7 -0
- package/lib/buttons/kvbutton.module.d.ts +11 -0
- package/lib/chart/chart.component.d.ts +56 -0
- package/lib/chart/kvchart.module.d.ts +10 -0
- package/lib/directives/template.directive.d.ts +11 -0
- package/lib/inputs/check/check.component.d.ts +11 -0
- package/lib/inputs/dropdown/dropdown.component.d.ts +14 -0
- package/lib/inputs/editor/editor.component.d.ts +39 -0
- package/lib/inputs/input-calendar/input-calendar.component.d.ts +27 -0
- package/lib/inputs/input-mask/input-mask.component.d.ts +10 -0
- package/lib/inputs/input-number/input-number.component.d.ts +19 -0
- package/lib/inputs/input-password/input-password.component.d.ts +13 -0
- package/lib/inputs/input-text/input-text.component.d.ts +9 -0
- package/lib/inputs/input-text-checkbox/input-text-checkbox.component.d.ts +15 -0
- package/lib/inputs/input-textarea/input-textarea.component.d.ts +16 -0
- package/lib/inputs/input-time/input-time.component.d.ts +10 -0
- package/lib/inputs/kvinputs.module.d.ts +25 -0
- package/lib/inputs/multi-select/multi-select.component.d.ts +12 -0
- package/lib/inputs/radio-group/radio-group.component.d.ts +18 -0
- package/lib/inputs/switch/switch.component.d.ts +13 -0
- package/lib/keevo-components.module.d.ts +19 -0
- package/lib/label/label.component.d.ts +7 -0
- package/lib/label/label.module.d.ts +8 -0
- package/lib/loader/kvloader.module.d.ts +9 -0
- package/lib/loader/loader.component.d.ts +8 -0
- package/lib/loader/loader.service.d.ts +10 -0
- package/lib/login/kvlogin.module.d.ts +13 -0
- package/lib/login/login.component.d.ts +30 -0
- package/lib/menu/kvmenu.module.d.ts +12 -0
- package/lib/menu/menu.component.d.ts +74 -0
- package/lib/orgchart/orgchart.component.d.ts +27 -0
- package/lib/orgchart/orgchart.module.d.ts +9 -0
- package/lib/page-form/kv-page-form.module.d.ts +11 -0
- package/lib/page-form/page-form.component.d.ts +69 -0
- package/lib/picklist/kvpicklist.module.d.ts +10 -0
- package/lib/picklist/picklist.component.d.ts +20 -0
- package/lib/pipes/codigofile.pipe.d.ts +7 -0
- package/lib/pipes/cpfcnpj.pipe.d.ts +7 -0
- package/lib/pipes/pipes.module.d.ts +10 -0
- package/lib/pipes/telefone.pipe.d.ts +7 -0
- package/lib/table/kvtable.module.d.ts +10 -0
- package/lib/table/table.component.d.ts +105 -0
- package/lib/tree-table/kv-treetable.component.d.ts +84 -0
- package/lib/tree-table/kv-treetable.module.d.ts +11 -0
- package/lib/tree-view/kvtree-view.module.d.ts +9 -0
- package/lib/tree-view/tree-view.component.d.ts +14 -0
- package/lib/workspace/kvworkspace.module.d.ts +13 -0
- package/lib/workspace/workspace.component.d.ts +28 -0
- package/package.json +22 -3
- package/{src/public-api.ts → public-api.d.ts} +134 -156
- package/ng-package.json +0 -7
- 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 +0 -74
- package/src/assets/images/keevo-logo.png +0 -0
- package/src/assets/images/logokeevo_2.png +0 -0
- package/src/index.ts +0 -1
- package/src/lib/api/base-components/base-component-button.ts +0 -27
- package/src/lib/api/base-components/base-component-chart.ts +0 -105
- package/src/lib/api/base-components/base-component-crud-form.ts +0 -328
- package/src/lib/api/base-components/base-component-crud-list.ts +0 -111
- package/src/lib/api/base-components/base-component-crud.ts +0 -70
- package/src/lib/api/base-components/base-component-dropdown-new.ts +0 -112
- package/src/lib/api/base-components/base-component-dropdown.ts +0 -164
- package/src/lib/api/base-components/base-component-input.ts +0 -107
- package/src/lib/api/base-components/base-component-multi-select.ts +0 -136
- package/src/lib/api/base-components/base-component.ts +0 -46
- package/src/lib/api/components/chart/chart.config.ts +0 -12
- package/src/lib/api/components/chart/chart.model.ts +0 -9
- package/src/lib/api/components/chart/orchart.config.ts +0 -41
- package/src/lib/api/components/chart/orchart.item.ts +0 -33
- package/src/lib/api/components/dropdown/filtro.combo.ts +0 -4
- package/src/lib/api/components/error/error.component.html +0 -3
- package/src/lib/api/components/error/error.component.scss +0 -5
- package/src/lib/api/components/error/error.component.ts +0 -22
- package/src/lib/api/components/error/kverror.module.ts +0 -23
- package/src/lib/api/components/table/action-item.ts +0 -5
- package/src/lib/api/components/table/kv-menuitem.ts +0 -10
- package/src/lib/api/components/table/table.config.column.ts +0 -21
- package/src/lib/api/components/table/table.config.ts +0 -20
- package/src/lib/api/components/table/table.paginate.ts +0 -6
- package/src/lib/api/helpers/component-providers.ts +0 -16
- package/src/lib/api/helpers/keevo-validators.ts +0 -77
- package/src/lib/api/helpers/translate-primeng.ts +0 -25
- package/src/lib/api/models/menu/menu.model.ts +0 -10
- package/src/lib/api/models/menu/sistemamenu.model.ts +0 -8
- package/src/lib/api/modules/primeng.module.ts +0 -125
- package/src/lib/api/services/base.api.service.ts +0 -115
- package/src/lib/api/services/component.service.ts +0 -22
- package/src/lib/api/services/form.service.ts +0 -105
- package/src/lib/api/services/imagens.service.ts +0 -20
- package/src/lib/api/services/notification.service.ts +0 -82
- package/src/lib/api/services/object.service.ts +0 -20
- package/src/lib/buttons/button-personalize/button-personalize.component.html +0 -11
- package/src/lib/buttons/button-personalize/button-personalize.component.scss +0 -3
- package/src/lib/buttons/button-personalize/button-personalize.component.ts +0 -13
- package/src/lib/buttons/button-popup/button-popup.component.html +0 -12
- package/src/lib/buttons/button-popup/button-popup.component.scss +0 -13
- package/src/lib/buttons/button-popup/button-popup.component.ts +0 -30
- package/src/lib/buttons/button-secondary/button-secondary.component.html +0 -12
- package/src/lib/buttons/button-secondary/button-secondary.component.scss +0 -14
- package/src/lib/buttons/button-secondary/button-secondary.component.ts +0 -13
- package/src/lib/buttons/button-success/button-success.component.html +0 -11
- package/src/lib/buttons/button-success/button-success.component.scss +0 -13
- package/src/lib/buttons/button-success/button-success.component.ts +0 -13
- package/src/lib/buttons/kvbutton.module.ts +0 -25
- package/src/lib/chart/chart.component.html +0 -38
- package/src/lib/chart/chart.component.scss +0 -0
- package/src/lib/chart/chart.component.spec.ts +0 -28
- package/src/lib/chart/chart.component.ts +0 -141
- package/src/lib/chart/kvchart.module.ts +0 -20
- package/src/lib/directives/template.directive.ts +0 -15
- package/src/lib/inputs/check/check.component.html +0 -11
- package/src/lib/inputs/check/check.component.scss +0 -13
- package/src/lib/inputs/check/check.component.ts +0 -24
- package/src/lib/inputs/dropdown/dropdown.component.html +0 -91
- package/src/lib/inputs/dropdown/dropdown.component.scss +0 -0
- package/src/lib/inputs/dropdown/dropdown.component.ts +0 -28
- package/src/lib/inputs/editor/editor.component.html +0 -90
- package/src/lib/inputs/editor/editor.component.scss +0 -4
- package/src/lib/inputs/editor/editor.component.ts +0 -80
- package/src/lib/inputs/input-calendar/input-calendar.component.html +0 -30
- package/src/lib/inputs/input-calendar/input-calendar.component.scss +0 -0
- package/src/lib/inputs/input-calendar/input-calendar.component.ts +0 -81
- package/src/lib/inputs/input-mask/input-mask.component.html +0 -20
- package/src/lib/inputs/input-mask/input-mask.component.scss +0 -0
- package/src/lib/inputs/input-mask/input-mask.component.ts +0 -20
- package/src/lib/inputs/input-number/input-number.component.html +0 -22
- package/src/lib/inputs/input-number/input-number.component.scss +0 -0
- package/src/lib/inputs/input-number/input-number.component.ts +0 -52
- package/src/lib/inputs/input-password/input-password.component.html +0 -23
- package/src/lib/inputs/input-password/input-password.component.scss +0 -0
- package/src/lib/inputs/input-password/input-password.component.ts +0 -23
- package/src/lib/inputs/input-text/input-text.component.html +0 -20
- package/src/lib/inputs/input-text/input-text.component.scss +0 -18
- package/src/lib/inputs/input-text/input-text.component.ts +0 -17
- package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.html +0 -32
- 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 +0 -23
- package/src/lib/inputs/input-text-checkbox/input-text-checkbox.component.ts +0 -36
- package/src/lib/inputs/input-textarea/input-textarea.component.html +0 -22
- package/src/lib/inputs/input-textarea/input-textarea.component.scss +0 -0
- package/src/lib/inputs/input-textarea/input-textarea.component.ts +0 -33
- package/src/lib/inputs/input-time/input-time.component.html +0 -23
- package/src/lib/inputs/input-time/input-time.component.scss +0 -0
- package/src/lib/inputs/input-time/input-time.component.ts +0 -20
- package/src/lib/inputs/kvinputs.module.ts +0 -64
- package/src/lib/inputs/multi-select/multi-select.component.html +0 -28
- package/src/lib/inputs/multi-select/multi-select.component.scss +0 -8
- package/src/lib/inputs/multi-select/multi-select.component.ts +0 -31
- package/src/lib/inputs/radio-group/radio-group.component.html +0 -19
- package/src/lib/inputs/radio-group/radio-group.component.scss +0 -15
- package/src/lib/inputs/radio-group/radio-group.component.ts +0 -50
- package/src/lib/inputs/switch/switch.component.html +0 -12
- package/src/lib/inputs/switch/switch.component.scss +0 -3
- package/src/lib/inputs/switch/switch.component.ts +0 -30
- package/src/lib/keevo-components.module.ts +0 -50
- package/src/lib/label/label.component.html +0 -6
- package/src/lib/label/label.component.scss +0 -9
- package/src/lib/label/label.component.spec.ts +0 -23
- package/src/lib/label/label.component.ts +0 -13
- package/src/lib/label/label.module.ts +0 -18
- package/src/lib/loader/kvloader.module.ts +0 -17
- package/src/lib/loader/loader.component.html +0 -1
- package/src/lib/loader/loader.component.ts +0 -14
- package/src/lib/loader/loader.service.ts +0 -26
- package/src/lib/login/kvlogin.module.ts +0 -28
- package/src/lib/login/login.component.html +0 -108
- package/src/lib/login/login.component.scss +0 -48
- package/src/lib/login/login.component.spec.ts +0 -23
- package/src/lib/login/login.component.ts +0 -65
- package/src/lib/menu/kvmenu.module.ts +0 -27
- package/src/lib/menu/menu.component.html +0 -342
- package/src/lib/menu/menu.component.scss +0 -210
- package/src/lib/menu/menu.component.spec.ts +0 -23
- package/src/lib/menu/menu.component.ts +0 -246
- package/src/lib/orgchart/orgchart.component.html +0 -58
- package/src/lib/orgchart/orgchart.component.scss +0 -21
- package/src/lib/orgchart/orgchart.component.ts +0 -118
- package/src/lib/orgchart/orgchart.module.ts +0 -14
- package/src/lib/page-form/kv-page-form.module.ts +0 -22
- package/src/lib/page-form/page-form.component.html +0 -57
- package/src/lib/page-form/page-form.component.scss +0 -72
- package/src/lib/page-form/page-form.component.spec.ts +0 -28
- package/src/lib/page-form/page-form.component.ts +0 -121
- package/src/lib/picklist/kvpicklist.module.ts +0 -20
- package/src/lib/picklist/picklist.component.html +0 -17
- package/src/lib/picklist/picklist.component.scss +0 -0
- package/src/lib/picklist/picklist.component.spec.ts +0 -26
- package/src/lib/picklist/picklist.component.ts +0 -27
- package/src/lib/pipes/codigofile.pipe.ts +0 -15
- package/src/lib/pipes/cpfcnpj.pipe.ts +0 -21
- package/src/lib/pipes/pipes.module.ts +0 -22
- package/src/lib/pipes/telefone.pipe.ts +0 -38
- package/src/lib/styles-components.scss +0 -11
- package/src/lib/table/kvtable.module.ts +0 -22
- package/src/lib/table/table.component.html +0 -473
- package/src/lib/table/table.component.scss +0 -240
- package/src/lib/table/table.component.spec.ts +0 -28
- package/src/lib/table/table.component.ts +0 -546
- package/src/lib/tree-table/kv-treetable.component.html +0 -649
- package/src/lib/tree-table/kv-treetable.component.scss +0 -315
- package/src/lib/tree-table/kv-treetable.component.ts +0 -390
- package/src/lib/tree-table/kv-treetable.module.ts +0 -18
- package/src/lib/tree-view/kvtree-view.module.ts +0 -19
- package/src/lib/tree-view/tree-view.component.html +0 -9
- package/src/lib/tree-view/tree-view.component.scss +0 -0
- package/src/lib/tree-view/tree-view.component.spec.ts +0 -23
- package/src/lib/tree-view/tree-view.component.ts +0 -29
- package/src/lib/workspace/kvworkspace.module.ts +0 -29
- package/src/lib/workspace/workspace.component.html +0 -108
- package/src/lib/workspace/workspace.component.scss +0 -83
- package/src/lib/workspace/workspace.component.ts +0 -75
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { ActivatedRoute, Router } from "@angular/router";
|
|
2
|
-
import { Component, OnDestroy, OnInit } from "@angular/core";
|
|
3
|
-
import { DialogService, DynamicDialogConfig, DynamicDialogRef } from "primeng/dynamicdialog";
|
|
4
|
-
import { FormGroup, ValidatorFn } from "@angular/forms";
|
|
5
|
-
import { Observable, combineLatest, filter, finalize } from "rxjs";
|
|
6
|
-
|
|
7
|
-
import { ActionItem } from "../components/table/action-item";
|
|
8
|
-
import { BaseComponentCrud } from "./base-component-crud";
|
|
9
|
-
import { FormService } from "../services/form.service";
|
|
10
|
-
import { NotificationService } from "../services/notification.service";
|
|
11
|
-
import { loading } from "../../loader/loader.service";
|
|
12
|
-
|
|
13
|
-
export interface DadosTela {
|
|
14
|
-
subTituloForm: string | undefined;
|
|
15
|
-
tituloForm: string | undefined;
|
|
16
|
-
rotaListar: string;
|
|
17
|
-
mensagemValidacao: boolean
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@Component({
|
|
21
|
-
template: ''
|
|
22
|
-
})
|
|
23
|
-
export abstract class BaseComponentCrudForm extends BaseComponentCrud implements OnInit, OnDestroy {
|
|
24
|
-
|
|
25
|
-
protected isAccordionExpanded = false;
|
|
26
|
-
protected isNewRegistry = false;
|
|
27
|
-
protected isSaveLoading = false;
|
|
28
|
-
protected isView = false;
|
|
29
|
-
|
|
30
|
-
protected formGroup: FormGroup = new FormGroup({});
|
|
31
|
-
protected actions: ActionItem[] = [];
|
|
32
|
-
|
|
33
|
-
protected dadosTela: DadosTela | undefined;
|
|
34
|
-
protected popup: boolean = false;
|
|
35
|
-
protected registry: any = null;
|
|
36
|
-
|
|
37
|
-
private onSetFormValues: boolean = false;
|
|
38
|
-
|
|
39
|
-
constructor(
|
|
40
|
-
dialogService: DialogService,
|
|
41
|
-
notificationService: NotificationService,
|
|
42
|
-
protected activatedRoute: ActivatedRoute,
|
|
43
|
-
protected dynamicDialogRef: DynamicDialogRef,
|
|
44
|
-
protected dynamicDialogConfig: DynamicDialogConfig,
|
|
45
|
-
protected router: Router) {
|
|
46
|
-
super
|
|
47
|
-
(
|
|
48
|
-
dialogService,
|
|
49
|
-
notificationService
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Método disparado para configuração do form
|
|
55
|
-
*/
|
|
56
|
-
abstract configureForm(): void;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Método disparado para o carregamento do form
|
|
60
|
-
* @param id
|
|
61
|
-
*/
|
|
62
|
-
abstract loadForm(id: any): void;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Método disparado para salvamento dos dados
|
|
66
|
-
*/
|
|
67
|
-
abstract save(): void;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Método disparado para tratamento das notificações do backend
|
|
71
|
-
* @param err - Notificação
|
|
72
|
-
*/
|
|
73
|
-
protected backendError(err: any): void {
|
|
74
|
-
if (err) {
|
|
75
|
-
if (err.status == 404) {
|
|
76
|
-
this.notificationService.toastError(err.error.item2[0].message);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
else if (err.status == 400) {
|
|
80
|
-
// Erros de validação de domínio do backend
|
|
81
|
-
if (Array.isArray(err.error)) {
|
|
82
|
-
if (err.error?.length) {
|
|
83
|
-
|
|
84
|
-
if (err.error.length == 1 && err.error[0].key == '') {
|
|
85
|
-
this.notificationService.toastError(err.error[0].message);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
this.invalidForm(err.error);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else if (err.error?.title) {
|
|
94
|
-
// Erro de json no backend
|
|
95
|
-
this.notificationService.toastError(err.error.title);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else if (err.status == 415) {
|
|
100
|
-
if (err.error?.title) {
|
|
101
|
-
// Erro de json no backend
|
|
102
|
-
this.notificationService.toastError(err.error.title);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Qualquer outro tipo de erro que tenha mensagem
|
|
108
|
-
if (err.message) {
|
|
109
|
-
this.notificationService.toastError(err.message);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Método disparado ao clicar no botão de cancelamento
|
|
116
|
-
*/
|
|
117
|
-
protected cancel() {
|
|
118
|
-
this.notificationService.question({
|
|
119
|
-
type: 'question',
|
|
120
|
-
message: 'Deseja cancelar a operação?',
|
|
121
|
-
accept: () => {
|
|
122
|
-
this.navigateList();
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Verifica se houveram alterações nos componentes do formControl
|
|
129
|
-
* @param controls - Nomes do controles no formGroup
|
|
130
|
-
* @returns Observable
|
|
131
|
-
*/
|
|
132
|
-
protected detectFormControlChanges(controls: Array<string>): Observable<any> {
|
|
133
|
-
const controlList: Observable<any>[] = [];
|
|
134
|
-
controls.forEach(controlName => controlList.push(this.formGroup.controls[controlName].valueChanges));
|
|
135
|
-
return combineLatest(controlList).pipe(filter(() => !this.onSetFormValues));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Método responsável por desabilitar um componente
|
|
140
|
-
* @param controlName - Nome do controle no formGroup
|
|
141
|
-
*/
|
|
142
|
-
protected disableComponent(controlName: string) {
|
|
143
|
-
FormService.disableControl(this.formGroup, controlName);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Método responsável por limpar e desabilitar um componente
|
|
148
|
-
* @param controlName - Nome do controle no formGroup
|
|
149
|
-
* @param value - Valor default
|
|
150
|
-
*/
|
|
151
|
-
protected disableAndClearComponent(controlName: string, value?: any) {
|
|
152
|
-
FormService.disableAndClearControl(this.formGroup, controlName, value);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Método responsável por habilitar um componente
|
|
157
|
-
* @param controlName - Nome do controle no formGroup
|
|
158
|
-
*/
|
|
159
|
-
protected enableComponent(controName: string) {
|
|
160
|
-
FormService.enableControl(this.formGroup, controName);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Método que retorna o valor de um componente
|
|
165
|
-
* @param controlName - Nome do controle no formGroup
|
|
166
|
-
* @returns - Valor
|
|
167
|
-
*/
|
|
168
|
-
protected getFormValue<T>(controlName: string): T {
|
|
169
|
-
return FormService.getFormValue<T>(this.formGroup, controlName);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Verifica se o componente possui erro
|
|
174
|
-
* @param controlName - Nome do controle no formGroup
|
|
175
|
-
*/
|
|
176
|
-
protected hasControlError(controlName: string, errorCode?: string): boolean {
|
|
177
|
-
return FormService.hasControlError(this.formGroup, controlName, errorCode);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Seta inconsistências para o fomulário
|
|
182
|
-
* @param notification - Lista de notificações
|
|
183
|
-
*/
|
|
184
|
-
protected invalidForm(notification?: any) {
|
|
185
|
-
FormService.invalidForm(this.formGroup, notification);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Método responsável pelo carregamento da tela
|
|
190
|
-
* @param obs - Observable responsável pelo salvamento dos dados
|
|
191
|
-
*/
|
|
192
|
-
public loadData<T>(obs: Observable<any>) {
|
|
193
|
-
obs
|
|
194
|
-
.pipe(loading())
|
|
195
|
-
.subscribe((data: any) => {
|
|
196
|
-
this.isNewRegistry = false;
|
|
197
|
-
this.registry = data as T;
|
|
198
|
-
this.setFormValues(this.registry);
|
|
199
|
-
this.loadGrids();
|
|
200
|
-
this.setTitlePopup();
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
public loadGrids() { }
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Método disparado para retornar a lista
|
|
208
|
-
*/
|
|
209
|
-
protected navigateList(id: any = null) {
|
|
210
|
-
if (this.popup) {
|
|
211
|
-
this.dynamicDialogRef.close(id);
|
|
212
|
-
}
|
|
213
|
-
else if (this.dadosTela?.rotaListar) {
|
|
214
|
-
this.router.navigate([this.dadosTela.rotaListar]);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
public ngOnDestroy() {
|
|
219
|
-
if (this.dynamicDialogRef) {
|
|
220
|
-
this.dynamicDialogRef.close();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
public ngOnInit() {
|
|
225
|
-
this.configureForm();
|
|
226
|
-
|
|
227
|
-
this.popup = this.dynamicDialogConfig?.data?.popup || false;
|
|
228
|
-
|
|
229
|
-
this.activatedRoute.params.subscribe((params: any) => {
|
|
230
|
-
if (params['id']) {
|
|
231
|
-
this.loadForm(params['id']);
|
|
232
|
-
}
|
|
233
|
-
else if (this.dynamicDialogConfig?.data?.id) {
|
|
234
|
-
this.loadForm(this.dynamicDialogConfig.data.id);
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
this.isNewRegistry = true;
|
|
238
|
-
this.loadGrids();
|
|
239
|
-
this.setTitlePopup();
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Método disparado para salvar dados
|
|
246
|
-
* @param obs - Observable responsável pelo salvamento dos dados
|
|
247
|
-
*/
|
|
248
|
-
protected saveData(obs: Observable<any>) {
|
|
249
|
-
obs
|
|
250
|
-
.pipe((src: Observable<any>) => {
|
|
251
|
-
this.isSaveLoading = true;
|
|
252
|
-
return src.pipe(finalize(() => {
|
|
253
|
-
this.isSaveLoading = false;
|
|
254
|
-
}));
|
|
255
|
-
})
|
|
256
|
-
.subscribe({
|
|
257
|
-
next: (res: any) => {
|
|
258
|
-
this.notificationService.toastSuccess(res.item2[0].message);
|
|
259
|
-
this.navigateList(res.item1);
|
|
260
|
-
},
|
|
261
|
-
error: (e) => {
|
|
262
|
-
this.backendError(e);
|
|
263
|
-
},
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Método se atualiza o valor de um componente do formGroup
|
|
269
|
-
* @param controName - Nome do controle
|
|
270
|
-
* @param value - Valor para atualização
|
|
271
|
-
*/
|
|
272
|
-
protected setControlValue(controName: string, value: any) {
|
|
273
|
-
FormService.setControlValue(this.formGroup, controName, value);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Atualiza valores dos componentes do formGroup
|
|
278
|
-
* @param values - Valores para atualização
|
|
279
|
-
*/
|
|
280
|
-
protected setFormValues(values: any) {
|
|
281
|
-
this.onSetFormValues = true;
|
|
282
|
-
this.formGroup.patchValue(values, { emitEvent: false });
|
|
283
|
-
this.onSetFormValues = false;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Seta o título do popup
|
|
288
|
-
*/
|
|
289
|
-
private setTitlePopup() {
|
|
290
|
-
if (this.popup) {
|
|
291
|
-
if (this.dynamicDialogConfig)
|
|
292
|
-
this.dynamicDialogConfig.header = this.dadosTela?.tituloForm;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Atualiza o validador de um componente do formGroup
|
|
298
|
-
* @param controName - Nome do controle
|
|
299
|
-
* @param validators - Regra de validação
|
|
300
|
-
*/
|
|
301
|
-
protected setValidators(controName: string, validators: ValidatorFn | ValidatorFn[] | null) {
|
|
302
|
-
FormService.setValidators(this.formGroup, controName, validators);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Dispara os métodos de validações do formulário
|
|
307
|
-
* @returns - True/False
|
|
308
|
-
*/
|
|
309
|
-
protected validateForm(): boolean {
|
|
310
|
-
let valid: boolean = false;
|
|
311
|
-
|
|
312
|
-
if (this.formGroup && this.formGroup.valid) {
|
|
313
|
-
valid = true;
|
|
314
|
-
} else {
|
|
315
|
-
this.isAccordionExpanded = true;
|
|
316
|
-
this.invalidForm();
|
|
317
|
-
|
|
318
|
-
if (this.dadosTela?.mensagemValidacao) {
|
|
319
|
-
this.notificationService.dialog({
|
|
320
|
-
type: 'alert',
|
|
321
|
-
message: 'Verifique os campos obrigatórios.',
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return valid;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit } from "@angular/core";
|
|
2
|
-
import { DialogService } from "primeng/dynamicdialog";
|
|
3
|
-
import { Router } from "@angular/router";
|
|
4
|
-
|
|
5
|
-
import { BaseComponentCrud } from "./base-component-crud";
|
|
6
|
-
import { TablePaginate } from "../components/table/table.paginate";
|
|
7
|
-
import { TableConfig } from "../components/table/table.config";
|
|
8
|
-
import { ActionItem } from "../components/table/action-item";
|
|
9
|
-
import { NotificationService } from "../services/notification.service";
|
|
10
|
-
import { Observable } from "rxjs";
|
|
11
|
-
import { loading } from "../../loader/loader.service";
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
template: ''
|
|
15
|
-
})
|
|
16
|
-
export abstract class BaseComponentCrudList extends BaseComponentCrud implements OnInit {
|
|
17
|
-
|
|
18
|
-
dataSource: any;
|
|
19
|
-
selectedItem: any;
|
|
20
|
-
tableConfig!: TableConfig;
|
|
21
|
-
totalRecords: number = 0;
|
|
22
|
-
actionsPageList: ActionItem[] = [];
|
|
23
|
-
|
|
24
|
-
constructor(
|
|
25
|
-
dialogService: DialogService,
|
|
26
|
-
notificationService: NotificationService,
|
|
27
|
-
public router: Router) {
|
|
28
|
-
super
|
|
29
|
-
(
|
|
30
|
-
dialogService,
|
|
31
|
-
notificationService
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ngOnInit() {
|
|
36
|
-
this.loadFilters();
|
|
37
|
-
this.configureTable();
|
|
38
|
-
|
|
39
|
-
// Tabela não configurada para paginação
|
|
40
|
-
if (!this.tableConfig.lazy)
|
|
41
|
-
this.loadTable(new TablePaginate());
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Método disparado para configuração das tabelas do componente de lista
|
|
46
|
-
*/
|
|
47
|
-
abstract configureTable(): void;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Método disparado para edição de registros
|
|
51
|
-
* @param registry - Registro que está sendo editado
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
abstract edit(registry: any): void;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Método disparado para carregamento dos filtros da tela
|
|
58
|
-
*/
|
|
59
|
-
abstract loadFilters(): void;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Método disparado para carregar a tabela do componente de lista
|
|
63
|
-
* @param tablePaginate - Classe dos dados da paginação da tabela
|
|
64
|
-
*/
|
|
65
|
-
abstract loadTable(tablePaginate: TablePaginate): void;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Método disparado ao clicar no botão de novo registro
|
|
69
|
-
*/
|
|
70
|
-
abstract newRegistry(): void;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Método que seta o registro selecionado na tabela
|
|
74
|
-
* @param event - Registro
|
|
75
|
-
*/
|
|
76
|
-
protected activeItem(event: any) {
|
|
77
|
-
this.selectedItem = event;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Método que dispara o carregamento da tabela
|
|
82
|
-
* @param obs - Observable de carregamento dos dados
|
|
83
|
-
*/
|
|
84
|
-
protected loadData(obs: Observable<any>) {
|
|
85
|
-
obs
|
|
86
|
-
.pipe(loading())
|
|
87
|
-
.subscribe({
|
|
88
|
-
next: (res: any) => {
|
|
89
|
-
this.totalRecords = res.item1;
|
|
90
|
-
this.dataSource = res.item2
|
|
91
|
-
},
|
|
92
|
-
error: (e) => {
|
|
93
|
-
this.toastError(e);
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Método que dispara a paginação
|
|
100
|
-
*/
|
|
101
|
-
protected paginate(event: any) {
|
|
102
|
-
this.loadTable(event);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Método que dispara a atualização da página inteira
|
|
107
|
-
*/
|
|
108
|
-
protected refresh() {
|
|
109
|
-
this.loadTable(new TablePaginate());
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { DialogService } from 'primeng/dynamicdialog';
|
|
2
|
-
import { Component, Type } from "@angular/core";
|
|
3
|
-
import { FormService, paramsDialog } from "../services/form.service";
|
|
4
|
-
import { NotificationService } from '../services/notification.service';
|
|
5
|
-
import { Observable } from 'rxjs';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
template: ''
|
|
9
|
-
})
|
|
10
|
-
export abstract class BaseComponentCrud {
|
|
11
|
-
|
|
12
|
-
public isReport: boolean = false;
|
|
13
|
-
public itemsReport: any = [];
|
|
14
|
-
|
|
15
|
-
constructor(
|
|
16
|
-
public dialogService: DialogService,
|
|
17
|
-
public notificationService: NotificationService) {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Fecha um relatório
|
|
22
|
-
*/
|
|
23
|
-
public closeReport() {
|
|
24
|
-
this.isReport = false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Abre um form dialog
|
|
29
|
-
* @param componentType - Componente que será renderizado
|
|
30
|
-
* @param callBackFunction - Função de callback que deverá ser chamada após o fechamento do dialog
|
|
31
|
-
* @param paramsDialog - Parâmetros do dialog
|
|
32
|
-
*/
|
|
33
|
-
protected openDialog(componentType: Type<any>, callBackFunction: Function, paramsDialog?: paramsDialog) {
|
|
34
|
-
FormService.openDialog(
|
|
35
|
-
this.dialogService,
|
|
36
|
-
componentType,
|
|
37
|
-
callBackFunction,
|
|
38
|
-
paramsDialog);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Imprime um relatório na tela
|
|
43
|
-
* @param obs - Observable com o carregamento do relatório
|
|
44
|
-
*/
|
|
45
|
-
protected printReportFilter(obs: Observable<any>) {
|
|
46
|
-
obs
|
|
47
|
-
//.pipe(loading())
|
|
48
|
-
.subscribe({
|
|
49
|
-
next: (res: any) => {
|
|
50
|
-
this.itemsReport = res;
|
|
51
|
-
this.isReport = true;
|
|
52
|
-
},
|
|
53
|
-
error: (e) => {
|
|
54
|
-
this.toastError(e);
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Exibe um toast com um erro
|
|
61
|
-
* @param err - Erro
|
|
62
|
-
*/
|
|
63
|
-
protected toastError(err: any) {
|
|
64
|
-
if (err) {
|
|
65
|
-
if (err.message) {
|
|
66
|
-
this.notificationService.toastError(err.message);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { Component, Input, TemplateRef } from "@angular/core";
|
|
2
|
-
import { BaseComponentDropDown } from "./base-component-dropdown"
|
|
3
|
-
import { FormGroup, FormsModule, ReactiveFormsModule } from "@angular/forms";
|
|
4
|
-
import { KeevoComponentsModule } from "../../keevo-components.module";
|
|
5
|
-
import { PrimeNgModule } from "../modules/primeng.module";
|
|
6
|
-
import { LabelModule } from "../../label/label.module";
|
|
7
|
-
import { kvErrorModule } from "../components/error/kverror.module";
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'app-base-dropdown',
|
|
11
|
-
template: `
|
|
12
|
-
<span>
|
|
13
|
-
<kv-label
|
|
14
|
-
[componentId]="componentId"
|
|
15
|
-
[label]="label"
|
|
16
|
-
/>
|
|
17
|
-
<p-dropdown
|
|
18
|
-
appendTo="body"
|
|
19
|
-
[class]="baseInputClass"
|
|
20
|
-
[disabled]="disabled"
|
|
21
|
-
[filter]="filter"
|
|
22
|
-
[inputId]="componentId"
|
|
23
|
-
[(ngModel)]="value"
|
|
24
|
-
[options]="filteredOptions"
|
|
25
|
-
[optionLabel]="optionLabel"
|
|
26
|
-
[optionValue]="optionValue"
|
|
27
|
-
[optionDisabled]="optionDisabled"
|
|
28
|
-
[group]="group"
|
|
29
|
-
[optionGroupLabel]="optionGroupLabel"
|
|
30
|
-
[optionGroupChildren]="optionGroupChildren"
|
|
31
|
-
[showClear]="showClear"
|
|
32
|
-
[lazy]="lazy"
|
|
33
|
-
scrollHeight="250px"
|
|
34
|
-
(onBlur)="onInputBlur($event)"
|
|
35
|
-
(onClick)="onInputClick($event)"
|
|
36
|
-
(onChange)="onInputChange($event)"
|
|
37
|
-
(onFilter)="onInputFilter($event)"
|
|
38
|
-
[style]="{'width':widthField}"
|
|
39
|
-
[panelStyle]="{ width: widthField, overflow: 'auto' }"
|
|
40
|
-
styleClass="inputs"
|
|
41
|
-
>
|
|
42
|
-
|
|
43
|
-
<ng-template
|
|
44
|
-
*ngIf="showAddButton"
|
|
45
|
-
pTemplate="footer"
|
|
46
|
-
>
|
|
47
|
-
<p-divider></p-divider>
|
|
48
|
-
<div class="flex flex-wrap card-container p-1">
|
|
49
|
-
<div class="flex justify-content-center">
|
|
50
|
-
<button
|
|
51
|
-
pButton
|
|
52
|
-
label="Incluir"
|
|
53
|
-
pTooltip="Clique aqui para incluir um novo registro"
|
|
54
|
-
tooltipPosition="bottom"
|
|
55
|
-
icon="pi pi-plus"
|
|
56
|
-
class="p-button-rounded p-button-success mr-2"
|
|
57
|
-
(click)="addClick($event)"
|
|
58
|
-
></button>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</ng-template>
|
|
62
|
-
|
|
63
|
-
<ng-template
|
|
64
|
-
let-selectedItem
|
|
65
|
-
pTemplate="item"
|
|
66
|
-
*ngIf="itemTemplate"
|
|
67
|
-
>
|
|
68
|
-
<ng-container
|
|
69
|
-
[ngTemplateOutlet]="itemTemplate"
|
|
70
|
-
[ngTemplateOutletContext]="{ $implicit: selectedItem }"
|
|
71
|
-
>
|
|
72
|
-
</ng-container>
|
|
73
|
-
</ng-template>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<ng-template
|
|
77
|
-
let-item
|
|
78
|
-
pTemplate="selectedItem"
|
|
79
|
-
*ngIf="selectedItemTemplate"
|
|
80
|
-
>
|
|
81
|
-
<ng-container
|
|
82
|
-
[ngTemplateOutlet]="selectedItemTemplate"
|
|
83
|
-
[ngTemplateOutletContext]="{ $implicit: item }"
|
|
84
|
-
>
|
|
85
|
-
|
|
86
|
-
</ng-container>
|
|
87
|
-
</ng-template>
|
|
88
|
-
|
|
89
|
-
</p-dropdown>
|
|
90
|
-
|
|
91
|
-
<kv-error [hasError]="hasControlError()">{{ erroMessage() }}</kv-error>
|
|
92
|
-
</span>
|
|
93
|
-
<ng-content></ng-content>
|
|
94
|
-
`,
|
|
95
|
-
standalone: true,
|
|
96
|
-
imports: [KeevoComponentsModule, ReactiveFormsModule, FormsModule, PrimeNgModule, LabelModule, kvErrorModule]
|
|
97
|
-
})
|
|
98
|
-
export class BaseComponentDropdownNew extends BaseComponentDropDown {
|
|
99
|
-
|
|
100
|
-
@Input() formGroup!: FormGroup;
|
|
101
|
-
@Input() formControlName!: string;
|
|
102
|
-
|
|
103
|
-
@Input() dropDowValue!: any;
|
|
104
|
-
@Input() itemTemplate!: TemplateRef<any>;
|
|
105
|
-
@Input() selectedItemTemplate!: TemplateRef<any>;
|
|
106
|
-
|
|
107
|
-
override ngOnInit(): void {
|
|
108
|
-
if (this.dropDowValue)
|
|
109
|
-
this.value = this.dropDowValue;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
}
|