spiderly 0.0.8 → 19.0.1
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/eslint.config.js +32 -0
- package/ng-package.json +10 -0
- package/package.json +55 -65
- package/src/lib/components/auth/login/login.component.html +25 -0
- package/src/lib/components/auth/login/login.component.ts +77 -0
- package/src/lib/components/auth/partials/auth.component.html +29 -0
- package/src/lib/components/auth/partials/auth.component.ts +60 -0
- package/src/lib/components/auth/partials/login-verification.component.html +2 -0
- package/src/lib/components/auth/partials/login-verification.component.ts +41 -0
- package/src/lib/components/auth/partials/registration-verification.component.html +1 -0
- package/src/lib/components/auth/partials/registration-verification.component.ts +41 -0
- package/src/lib/components/auth/partials/verification-wrapper.component.html +39 -0
- package/src/lib/components/auth/partials/verification-wrapper.component.ts +68 -0
- package/src/lib/components/auth/registration/registration.component.html +31 -0
- package/src/lib/components/auth/registration/registration.component.ts +77 -0
- package/src/lib/components/base-details/role-base-details.component.html +33 -0
- package/src/lib/components/base-details/role-base-details.component.ts +194 -0
- package/src/lib/components/base-form/base-form copy.ts +356 -0
- package/src/lib/components/card-skeleton/card-skeleton.component.html +8 -0
- package/src/lib/components/card-skeleton/card-skeleton.component.ts +21 -0
- package/src/lib/components/footer/app.footer.component.ts +17 -0
- package/src/lib/components/footer/footer.component.html +3 -0
- package/src/lib/components/footer/footer.component.ts +17 -0
- package/src/lib/components/index-card/index-card.component.html +15 -0
- package/src/lib/components/index-card/index-card.component.ts +48 -0
- package/src/lib/components/info-card/info-card.component.html +18 -0
- package/src/lib/components/info-card/info-card.component.ts +29 -0
- package/src/lib/components/layout/layout-base.component.ts +140 -0
- package/src/lib/components/layout/sidebar/menuitem.component.html +40 -0
- package/src/lib/components/layout/sidebar/menuitem.component.ts +179 -0
- package/src/lib/components/layout/sidebar/sidebar-menu.component.html +6 -0
- package/src/lib/components/layout/sidebar/sidebar-menu.component.ts +44 -0
- package/src/lib/components/layout/sidebar/sidebar-menu.service.ts +22 -0
- package/src/lib/components/layout/sidebar/sidebar.component.html +1 -0
- package/src/lib/components/layout/sidebar/sidebar.component.ts +20 -0
- package/src/lib/components/layout/topbar/topbar.component.html +64 -0
- package/src/lib/components/layout/topbar/topbar.component.ts +137 -0
- package/src/lib/components/not-found/not-found.component.html +27 -0
- package/src/lib/components/not-found/not-found.component.ts +22 -0
- package/src/lib/components/required/required.component.html +1 -0
- package/src/lib/components/required/required.component.ts +13 -0
- package/src/lib/components/spiderly-buttons/google-button/google-button.component.html +5 -0
- package/src/lib/components/spiderly-buttons/google-button/google-button.component.ts +53 -0
- package/src/lib/components/spiderly-buttons/return-button/return-button.component.html +3 -0
- package/src/lib/components/spiderly-buttons/return-button/return-button.component.ts +35 -0
- package/src/lib/components/spiderly-buttons/spiderly-button/spiderly-button.component.html +14 -0
- package/src/lib/components/spiderly-buttons/spiderly-button/spiderly-button.component.ts +27 -0
- package/src/lib/components/spiderly-buttons/spiderly-button-base/spiderly-button-base.ts +61 -0
- package/src/lib/components/spiderly-buttons/spiderly-split-button/spiderly-split-button.component.html +15 -0
- package/src/lib/components/spiderly-buttons/spiderly-split-button/spiderly-split-button.component.ts +24 -0
- package/src/lib/components/spiderly-data-table/spiderly-data-table.component.html +93 -0
- package/{styles → src/lib}/components/spiderly-data-table/spiderly-data-table.component.scss +15 -0
- package/src/lib/components/spiderly-data-table/spiderly-data-table.component.ts +614 -0
- package/src/lib/components/spiderly-delete-dialog/spiderly-delete-confirmation.component.html +17 -0
- package/src/lib/components/spiderly-delete-dialog/spiderly-delete-confirmation.component.ts +39 -0
- package/src/lib/components/spiderly-form-control/spiderly-form-control.ts +60 -0
- package/src/lib/components/spiderly-panels/panel-body/panel-body.component.html +8 -0
- package/src/lib/components/spiderly-panels/panel-body/panel-body.component.ts +16 -0
- package/src/lib/components/spiderly-panels/panel-footer/panel-footer.component.html +8 -0
- package/{styles → src/lib}/components/spiderly-panels/panel-footer/panel-footer.component.scss +3 -3
- package/src/lib/components/spiderly-panels/panel-footer/panel-footer.component.ts +15 -0
- package/src/lib/components/spiderly-panels/panel-header/panel-header.component.html +25 -0
- package/src/lib/components/spiderly-panels/panel-header/panel-header.component.ts +69 -0
- package/src/lib/components/spiderly-panels/spiderly-card/spiderly-card.component.html +7 -0
- package/src/lib/components/spiderly-panels/spiderly-card/spiderly-card.component.ts +17 -0
- package/src/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.html +40 -0
- package/src/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.scss +11 -0
- package/src/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.ts +42 -0
- package/src/lib/components/spiderly-panels/spiderly-panels.module.ts +32 -0
- package/src/lib/controls/base-autocomplete-control.ts +17 -0
- package/src/lib/controls/base-control.ts +60 -0
- package/src/lib/controls/base-dropdown-control.ts +37 -0
- package/src/lib/controls/spiderly-autocomplete/spiderly-autocomplete.component.html +36 -0
- package/src/lib/controls/spiderly-autocomplete/spiderly-autocomplete.component.ts +56 -0
- package/src/lib/controls/spiderly-calendar/spiderly-calendar.component.html +21 -0
- package/src/lib/controls/spiderly-calendar/spiderly-calendar.component.ts +37 -0
- package/src/lib/controls/spiderly-checkbox/spiderly-checkbox.component.html +16 -0
- package/src/lib/controls/spiderly-checkbox/spiderly-checkbox.component.ts +38 -0
- package/src/lib/controls/spiderly-colorpick/spiderly-colorpick.component.html +33 -0
- package/src/lib/controls/spiderly-colorpick/spiderly-colorpick.component.ts +40 -0
- package/src/lib/controls/spiderly-controls.module.ts +61 -0
- package/src/lib/controls/spiderly-dropdown/spiderly-dropdown.component.html +27 -0
- package/src/lib/controls/spiderly-dropdown/spiderly-dropdown.component.ts +39 -0
- package/src/lib/controls/spiderly-editor/spiderly-editor.component.html +22 -0
- package/src/lib/controls/spiderly-editor/spiderly-editor.component.ts +58 -0
- package/src/lib/controls/spiderly-file/spiderly-file.component.html +54 -0
- package/src/lib/controls/spiderly-file/spiderly-file.component.ts +123 -0
- package/src/lib/controls/spiderly-multiautocomplete/spiderly-multiautocomplete.component.html +30 -0
- package/src/lib/controls/spiderly-multiautocomplete/spiderly-multiautocomplete.component.ts +38 -0
- package/src/lib/controls/spiderly-multiselect/spiderly-multiselect.component.html +23 -0
- package/src/lib/controls/spiderly-multiselect/spiderly-multiselect.component.ts +32 -0
- package/src/lib/controls/spiderly-number/spiderly-number.component.html +19 -0
- package/src/lib/controls/spiderly-number/spiderly-number.component.ts +37 -0
- package/src/lib/controls/spiderly-password/spiderly-password.component.html +17 -0
- package/src/lib/controls/spiderly-password/spiderly-password.component.ts +34 -0
- package/src/lib/controls/spiderly-textarea/spiderly-textarea.component.html +18 -0
- package/src/lib/controls/spiderly-textarea/spiderly-textarea.component.ts +32 -0
- package/src/lib/controls/spiderly-textbox/spiderly-textbox.component.html +23 -0
- package/src/lib/controls/spiderly-textbox/spiderly-textbox.component.ts +41 -0
- package/src/lib/entities/base-entity.ts +25 -0
- package/src/lib/entities/codebook.ts +23 -0
- package/src/lib/entities/init-company-auth-dialog-details.ts +22 -0
- package/src/lib/entities/init-top-bar-data.ts +35 -0
- package/src/lib/entities/is-authorized-for-save-event.ts +22 -0
- package/src/lib/entities/last-menu-icon-index-clicked.ts +18 -0
- package/src/lib/entities/lazy-load-selected-ids-result.ts +22 -0
- package/{lib/entities/menuchangeevent.d.ts → src/lib/entities/menuchangeevent.ts} +4 -4
- package/src/lib/entities/mime-type.ts +15 -0
- package/src/lib/entities/namebook.ts +22 -0
- package/src/lib/entities/primeng-option.ts +23 -0
- package/src/lib/entities/readonly-object.ts +1 -0
- package/src/lib/entities/security-entities.ts +548 -0
- package/src/lib/entities/simple-save-result.ts +19 -0
- package/src/lib/entities/spiderly-button.ts +30 -0
- package/{lib/entities/table-filter-context.d.ts → src/lib/entities/table-filter-context.ts} +6 -5
- package/src/lib/entities/table-filter-sort-meta.ts +5 -0
- package/{lib/entities/table-filter.d.ts → src/lib/entities/table-filter.ts} +48 -23
- package/src/lib/entities/table-response.ts +5 -0
- package/src/lib/enums/security-enums.ts +28 -0
- package/src/lib/enums/verification-type-codes.ts +5 -0
- package/src/lib/guards/auth.guard.ts +39 -0
- package/src/lib/guards/not-auth.guard.ts +32 -0
- package/src/lib/handlers/spiderly-error-handler.ts +32 -0
- package/src/lib/handlers/spiderly-transloco-fallback-strategy.ts +25 -0
- package/src/lib/interceptors/http-loading.interceptor.ts +21 -0
- package/src/lib/interceptors/json-parser.interceptor.ts +44 -0
- package/src/lib/interceptors/jwt.interceptor.ts +18 -0
- package/src/lib/interceptors/unauthorized.interceptor.ts +77 -0
- package/src/lib/modules/core.module.ts +22 -0
- package/src/lib/modules/primeng.module.ts +122 -0
- package/src/lib/modules/spiderly-transloco.module.ts +50 -0
- package/src/lib/services/api.service.security.ts +120 -0
- package/src/lib/services/app-initializer.ts +9 -0
- package/src/lib/services/app-layout-base.service.ts +184 -0
- package/src/lib/services/auth-base.service.ts +271 -0
- package/src/lib/services/base-form.service.ts +178 -0
- package/src/lib/services/config-base.service.ts +36 -0
- package/src/lib/services/helper-functions.ts +288 -0
- package/src/lib/services/spiderly-message.service.ts +66 -0
- package/src/lib/services/spiderly-transloco-loader.ts +15 -0
- package/src/lib/services/translate-labels-abstract.service.ts +13 -0
- package/src/lib/services/validator-abstract.service.ts +63 -0
- package/{styles → src/lib}/styles/layout/_config.scss +2 -2
- package/{styles → src/lib}/styles/layout/_content.scss +2 -0
- package/{styles → src/lib}/styles/layout/_footer.scss +2 -0
- package/{styles → src/lib}/styles/layout/_main.scss +6 -3
- package/{styles → src/lib}/styles/layout/_menu.scss +10 -7
- package/{styles → src/lib}/styles/layout/_mixins.scss +2 -2
- package/{styles → src/lib}/styles/layout/_preloading.scss +1 -1
- package/{styles → src/lib}/styles/layout/_responsive.scss +2 -0
- package/{styles → src/lib}/styles/layout/_spiderly-controls.scss +2 -0
- package/{styles → src/lib}/styles/layout/_topbar.scss +16 -11
- package/{styles → src/lib}/styles/layout/_typography.scss +1 -1
- package/{styles → src/lib}/styles/layout/_utils.scss +1 -1
- package/{styles → src/lib}/styles/layout/_variables.scss +59 -53
- package/src/lib/styles/layout/layout.scss +13 -0
- package/{styles → src/lib}/styles/shared.scss +70 -42
- package/src/lib/styles/styles.scss +3 -0
- package/{public-api.d.ts → src/public-api.ts} +103 -90
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/lib/components/auth/auth.module.mjs +0 -65
- package/esm2022/lib/components/auth/login/login.component.mjs +0 -60
- package/esm2022/lib/components/auth/partials/auth.component.mjs +0 -53
- package/esm2022/lib/components/auth/partials/login-verification.component.mjs +0 -39
- package/esm2022/lib/components/auth/partials/registration-verification.component.mjs +0 -37
- package/esm2022/lib/components/auth/partials/verification-wrapper.component.mjs +0 -74
- package/esm2022/lib/components/auth/registration/registration.component.mjs +0 -59
- package/esm2022/lib/components/base-details/role-base-details.component.mjs +0 -171
- package/esm2022/lib/components/base-form/base-form copy.mjs +0 -247
- package/esm2022/lib/components/card-skeleton/card-skeleton.component.mjs +0 -25
- package/esm2022/lib/components/footer/footer.component.mjs +0 -16
- package/esm2022/lib/components/index-card/index-card.component.mjs +0 -57
- package/esm2022/lib/components/info-card/info-card.component.mjs +0 -29
- package/esm2022/lib/components/layout/layout-base.component.mjs +0 -121
- package/esm2022/lib/components/layout/sidebar/menuitem.component.mjs +0 -161
- package/esm2022/lib/components/layout/sidebar/sidebar-menu.component.mjs +0 -34
- package/esm2022/lib/components/layout/sidebar/sidebar-menu.service.mjs +0 -26
- package/esm2022/lib/components/layout/sidebar/sidebar.component.mjs +0 -21
- package/esm2022/lib/components/layout/topbar/topbar.component.mjs +0 -115
- package/esm2022/lib/components/not-found/not-found.component.mjs +0 -20
- package/esm2022/lib/components/required/required.component.mjs +0 -12
- package/esm2022/lib/components/spiderly-buttons/google-button/google-button.component.mjs +0 -43
- package/esm2022/lib/components/spiderly-buttons/return-button/return-button.component.mjs +0 -37
- package/esm2022/lib/components/spiderly-buttons/spiderly-button/spiderly-button.component.mjs +0 -20
- package/esm2022/lib/components/spiderly-buttons/spiderly-button-base/spiderly-button-base.mjs +0 -68
- package/esm2022/lib/components/spiderly-buttons/spiderly-split-button/spiderly-split-button.component.mjs +0 -22
- package/esm2022/lib/components/spiderly-data-table/spiderly-data-table.component.mjs +0 -501
- package/esm2022/lib/components/spiderly-delete-dialog/spiderly-delete-confirmation.component.mjs +0 -42
- package/esm2022/lib/components/spiderly-form-control/spiderly-form-control.mjs +0 -36
- package/esm2022/lib/components/spiderly-panels/panel-body/panel-body.component.mjs +0 -19
- package/esm2022/lib/components/spiderly-panels/panel-footer/panel-footer.component.mjs +0 -14
- package/esm2022/lib/components/spiderly-panels/panel-header/panel-header.component.mjs +0 -49
- package/esm2022/lib/components/spiderly-panels/spiderly-card/spiderly-card.component.mjs +0 -20
- package/esm2022/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.mjs +0 -63
- package/esm2022/lib/components/spiderly-panels/spiderly-panels.module.mjs +0 -49
- package/esm2022/lib/controls/base-autocomplete-control.mjs +0 -18
- package/esm2022/lib/controls/base-control.mjs +0 -62
- package/esm2022/lib/controls/base-dropdown-control.mjs +0 -37
- package/esm2022/lib/controls/spiderly-autocomplete/spiderly-autocomplete.component.mjs +0 -60
- package/esm2022/lib/controls/spiderly-calendar/spiderly-calendar.component.mjs +0 -39
- package/esm2022/lib/controls/spiderly-checkbox/spiderly-checkbox.component.mjs +0 -45
- package/esm2022/lib/controls/spiderly-colorpick/spiderly-colorpick.component.mjs +0 -40
- package/esm2022/lib/controls/spiderly-controls.module.mjs +0 -112
- package/esm2022/lib/controls/spiderly-dropdown/spiderly-dropdown.component.mjs +0 -40
- package/esm2022/lib/controls/spiderly-editor/spiderly-editor.component.mjs +0 -59
- package/esm2022/lib/controls/spiderly-file/spiderly-file.component.mjs +0 -106
- package/esm2022/lib/controls/spiderly-multiautocomplete/spiderly-multiautocomplete.component.mjs +0 -38
- package/esm2022/lib/controls/spiderly-multiselect/spiderly-multiselect.component.mjs +0 -34
- package/esm2022/lib/controls/spiderly-number/spiderly-number.component.mjs +0 -44
- package/esm2022/lib/controls/spiderly-password/spiderly-password.component.mjs +0 -37
- package/esm2022/lib/controls/spiderly-textarea/spiderly-textarea.component.mjs +0 -34
- package/esm2022/lib/controls/spiderly-textbox/spiderly-textbox.component.mjs +0 -45
- package/esm2022/lib/entities/base-entity.mjs +0 -18
- package/esm2022/lib/entities/codebook.mjs +0 -10
- package/esm2022/lib/entities/init-company-auth-dialog-details.mjs +0 -9
- package/esm2022/lib/entities/init-top-bar-data.mjs +0 -12
- package/esm2022/lib/entities/is-authorized-for-save-event.mjs +0 -9
- package/esm2022/lib/entities/last-menu-icon-index-clicked.mjs +0 -8
- package/esm2022/lib/entities/lazy-load-selected-ids-result.mjs +0 -11
- package/esm2022/lib/entities/menuchangeevent.mjs +0 -3
- package/esm2022/lib/entities/mime-type.mjs +0 -15
- package/esm2022/lib/entities/namebook.mjs +0 -9
- package/esm2022/lib/entities/primeng-option.mjs +0 -9
- package/esm2022/lib/entities/security-entities.mjs +0 -169
- package/esm2022/lib/entities/simple-save-result.mjs +0 -9
- package/esm2022/lib/entities/spiderly-button.mjs +0 -11
- package/esm2022/lib/entities/table-filter-context.mjs +0 -3
- package/esm2022/lib/entities/table-filter-sort-meta.mjs +0 -3
- package/esm2022/lib/entities/table-filter.mjs +0 -15
- package/esm2022/lib/entities/table-response.mjs +0 -3
- package/esm2022/lib/enums/security-enums.mjs +0 -26
- package/esm2022/lib/enums/verification-type-codes.mjs +0 -6
- package/esm2022/lib/guards/auth.guard.mjs +0 -40
- package/esm2022/lib/guards/not-auth.guard.mjs +0 -32
- package/esm2022/lib/handlers/spiderly-error-handler.mjs +0 -30
- package/esm2022/lib/handlers/spiderly-transloco-fallback-strategy.mjs +0 -24
- package/esm2022/lib/interceptors/http-loading.interceptor.mjs +0 -27
- package/esm2022/lib/interceptors/json-parser.interceptor.mjs +0 -47
- package/esm2022/lib/interceptors/jwt.interceptor.mjs +0 -27
- package/esm2022/lib/interceptors/unauthorized.interceptor.mjs +0 -64
- package/esm2022/lib/modules/core.module.mjs +0 -140
- package/esm2022/lib/modules/primeng.module.mjs +0 -278
- package/esm2022/lib/modules/spiderly-transloco.module.mjs +0 -44
- package/esm2022/lib/services/api.service.security.mjs +0 -86
- package/esm2022/lib/services/app-initializer.mjs +0 -6
- package/esm2022/lib/services/app-layout-base.service.mjs +0 -132
- package/esm2022/lib/services/auth-base.service.mjs +0 -220
- package/esm2022/lib/services/base-form.service.mjs +0 -124
- package/esm2022/lib/services/config-base.service.mjs +0 -33
- package/esm2022/lib/services/helper-functions.mjs +0 -229
- package/esm2022/lib/services/spiderly-message.service.mjs +0 -64
- package/esm2022/lib/services/spiderly-transloco-loader.mjs +0 -20
- package/esm2022/lib/services/translate-labels-abstract.service.mjs +0 -15
- package/esm2022/lib/services/validator-abstract.service.mjs +0 -51
- package/esm2022/public-api.mjs +0 -94
- package/esm2022/spiderly.mjs +0 -5
- package/fesm2022/spiderly.mjs +0 -4807
- package/fesm2022/spiderly.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/auth/auth.module.d.ts +0 -17
- package/lib/components/auth/login/login.component.d.ts +0 -35
- package/lib/components/auth/partials/auth.component.d.ts +0 -21
- package/lib/components/auth/partials/login-verification.component.d.ts +0 -18
- package/lib/components/auth/partials/registration-verification.component.d.ts +0 -17
- package/lib/components/auth/partials/verification-wrapper.component.d.ts +0 -31
- package/lib/components/auth/registration/registration.component.d.ts +0 -34
- package/lib/components/base-details/role-base-details.component.d.ts +0 -50
- package/lib/components/base-form/base-form copy.d.ts +0 -54
- package/lib/components/card-skeleton/card-skeleton.component.d.ts +0 -12
- package/lib/components/footer/footer.component.d.ts +0 -9
- package/lib/components/index-card/index-card.component.d.ts +0 -22
- package/lib/components/info-card/info-card.component.d.ts +0 -11
- package/lib/components/layout/layout-base.component.d.ts +0 -37
- package/lib/components/layout/sidebar/menuitem.component.d.ts +0 -43
- package/lib/components/layout/sidebar/sidebar-menu.component.d.ts +0 -23
- package/lib/components/layout/sidebar/sidebar-menu.service.d.ts +0 -12
- package/lib/components/layout/sidebar/sidebar.component.d.ts +0 -11
- package/lib/components/layout/topbar/topbar.component.d.ts +0 -45
- package/lib/components/not-found/not-found.component.d.ts +0 -9
- package/lib/components/required/required.component.d.ts +0 -6
- package/lib/components/spiderly-buttons/google-button/google-button.component.d.ts +0 -17
- package/lib/components/spiderly-buttons/return-button/return-button.component.d.ts +0 -10
- package/lib/components/spiderly-buttons/spiderly-button/spiderly-button.component.d.ts +0 -6
- package/lib/components/spiderly-buttons/spiderly-button-base/spiderly-button-base.d.ts +0 -27
- package/lib/components/spiderly-buttons/spiderly-split-button/spiderly-split-button.component.d.ts +0 -8
- package/lib/components/spiderly-data-table/spiderly-data-table.component.d.ts +0 -157
- package/lib/components/spiderly-delete-dialog/spiderly-delete-confirmation.component.d.ts +0 -11
- package/lib/components/spiderly-form-control/spiderly-form-control.d.ts +0 -37
- package/lib/components/spiderly-panels/panel-body/panel-body.component.d.ts +0 -9
- package/lib/components/spiderly-panels/panel-footer/panel-footer.component.d.ts +0 -8
- package/lib/components/spiderly-panels/panel-header/panel-header.component.d.ts +0 -29
- package/lib/components/spiderly-panels/spiderly-card/spiderly-card.component.d.ts +0 -10
- package/lib/components/spiderly-panels/spiderly-panel/spiderly-panel.component.d.ts +0 -25
- package/lib/components/spiderly-panels/spiderly-panels.module.d.ts +0 -13
- package/lib/controls/base-autocomplete-control.d.ts +0 -9
- package/lib/controls/base-control.d.ts +0 -23
- package/lib/controls/base-dropdown-control.d.ts +0 -18
- package/lib/controls/spiderly-autocomplete/spiderly-autocomplete.component.d.ts +0 -18
- package/lib/controls/spiderly-calendar/spiderly-calendar.component.d.ts +0 -13
- package/lib/controls/spiderly-checkbox/spiderly-checkbox.component.d.ts +0 -14
- package/lib/controls/spiderly-colorpick/spiderly-colorpick.component.d.ts +0 -11
- package/lib/controls/spiderly-controls.module.d.ts +0 -22
- package/lib/controls/spiderly-dropdown/spiderly-dropdown.component.d.ts +0 -14
- package/lib/controls/spiderly-editor/spiderly-editor.component.d.ts +0 -16
- package/lib/controls/spiderly-file/spiderly-file.component.d.ts +0 -36
- package/lib/controls/spiderly-multiautocomplete/spiderly-multiautocomplete.component.d.ts +0 -13
- package/lib/controls/spiderly-multiselect/spiderly-multiselect.component.d.ts +0 -11
- package/lib/controls/spiderly-number/spiderly-number.component.d.ts +0 -15
- package/lib/controls/spiderly-password/spiderly-password.component.d.ts +0 -12
- package/lib/controls/spiderly-textarea/spiderly-textarea.component.d.ts +0 -11
- package/lib/controls/spiderly-textbox/spiderly-textbox.component.d.ts +0 -15
- package/lib/entities/base-entity.d.ts +0 -14
- package/lib/entities/codebook.d.ts +0 -9
- package/lib/entities/init-company-auth-dialog-details.d.ts +0 -9
- package/lib/entities/init-top-bar-data.d.ts +0 -16
- package/lib/entities/is-authorized-for-save-event.d.ts +0 -9
- package/lib/entities/last-menu-icon-index-clicked.d.ts +0 -7
- package/lib/entities/lazy-load-selected-ids-result.d.ts +0 -9
- package/lib/entities/mime-type.d.ts +0 -11
- package/lib/entities/namebook.d.ts +0 -9
- package/lib/entities/primeng-option.d.ts +0 -9
- package/lib/entities/security-entities.d.ts +0 -211
- package/lib/entities/simple-save-result.d.ts +0 -7
- package/lib/entities/spiderly-button.d.ts +0 -13
- package/lib/entities/table-filter-sort-meta.d.ts +0 -4
- package/lib/entities/table-response.d.ts +0 -4
- package/lib/enums/security-enums.d.ts +0 -22
- package/lib/enums/verification-type-codes.d.ts +0 -4
- package/lib/guards/auth.guard.d.ts +0 -15
- package/lib/guards/not-auth.guard.d.ts +0 -12
- package/lib/handlers/spiderly-error-handler.d.ts +0 -14
- package/lib/handlers/spiderly-transloco-fallback-strategy.d.ts +0 -13
- package/lib/interceptors/http-loading.interceptor.d.ts +0 -11
- package/lib/interceptors/json-parser.interceptor.d.ts +0 -11
- package/lib/interceptors/jwt.interceptor.d.ts +0 -11
- package/lib/interceptors/unauthorized.interceptor.d.ts +0 -16
- package/lib/modules/core.module.d.ts +0 -13
- package/lib/modules/primeng.module.d.ts +0 -42
- package/lib/modules/spiderly-transloco.module.d.ts +0 -9
- package/lib/services/api.service.security.d.ts +0 -35
- package/lib/services/app-initializer.d.ts +0 -4
- package/lib/services/app-layout-base.service.d.ts +0 -60
- package/lib/services/auth-base.service.d.ts +0 -55
- package/lib/services/base-form.service.d.ts +0 -27
- package/lib/services/config-base.service.d.ts +0 -24
- package/lib/services/helper-functions.d.ts +0 -37
- package/lib/services/spiderly-message.service.d.ts +0 -17
- package/lib/services/spiderly-transloco-loader.d.ts +0 -10
- package/lib/services/translate-labels-abstract.service.d.ts +0 -7
- package/lib/services/validator-abstract.service.d.ts +0 -13
- package/styles/styles/layout/layout.scss +0 -13
- package/styles/styles/styles.scss +0 -6
- package/styles/styles/theme/base/_colors.scss +0 -18
- package/styles/styles/theme/base/_common.scss +0 -75
- package/styles/styles/theme/base/_components.scss +0 -106
- package/styles/styles/theme/base/_mixins.scss +0 -343
- package/styles/styles/theme/base/components/button/_button.scss +0 -564
- package/styles/styles/theme/base/components/button/_speeddial.scss +0 -96
- package/styles/styles/theme/base/components/button/_splitbutton.scss +0 -381
- package/styles/styles/theme/base/components/data/_carousel.scss +0 -37
- package/styles/styles/theme/base/components/data/_datatable.scss +0 -338
- package/styles/styles/theme/base/components/data/_dataview.scss +0 -55
- package/styles/styles/theme/base/components/data/_filter.scss +0 -138
- package/styles/styles/theme/base/components/data/_orderlist.scss +0 -103
- package/styles/styles/theme/base/components/data/_organizationchart.scss +0 -50
- package/styles/styles/theme/base/components/data/_paginator.scss +0 -92
- package/styles/styles/theme/base/components/data/_picklist.scss +0 -103
- package/styles/styles/theme/base/components/data/_timeline.scss +0 -81
- package/styles/styles/theme/base/components/data/_tree.scss +0 -149
- package/styles/styles/theme/base/components/data/_treetable.scss +0 -256
- package/styles/styles/theme/base/components/data/_virtualscroller.scss +0 -28
- package/styles/styles/theme/base/components/file/_fileupload.scss +0 -64
- package/styles/styles/theme/base/components/input/_autocomplete.scss +0 -118
- package/styles/styles/theme/base/components/input/_calendar.scss +0 -263
- package/styles/styles/theme/base/components/input/_cascadeselect.scss +0 -130
- package/styles/styles/theme/base/components/input/_checkbox.scss +0 -90
- package/styles/styles/theme/base/components/input/_chips.scss +0 -55
- package/styles/styles/theme/base/components/input/_colorpicker.scss +0 -26
- package/styles/styles/theme/base/components/input/_dropdown.scss +0 -152
- package/styles/styles/theme/base/components/input/_editor.scss +0 -122
- package/styles/styles/theme/base/components/input/_inputgroup.scss +0 -75
- package/styles/styles/theme/base/components/input/_inputmask.scss +0 -16
- package/styles/styles/theme/base/components/input/_inputnumber.scss +0 -28
- package/styles/styles/theme/base/components/input/_inputswitch.scss +0 -60
- package/styles/styles/theme/base/components/input/_inputtext.scss +0 -100
- package/styles/styles/theme/base/components/input/_listbox.scss +0 -82
- package/styles/styles/theme/base/components/input/_multiselect.scss +0 -173
- package/styles/styles/theme/base/components/input/_password.scss +0 -52
- package/styles/styles/theme/base/components/input/_radiobutton.scss +0 -78
- package/styles/styles/theme/base/components/input/_rating.scss +0 -55
- package/styles/styles/theme/base/components/input/_selectbutton.scss +0 -50
- package/styles/styles/theme/base/components/input/_slider.scss +0 -71
- package/styles/styles/theme/base/components/input/_togglebutton.scss +0 -48
- package/styles/styles/theme/base/components/input/_treeselect.scss +0 -139
- package/styles/styles/theme/base/components/menu/_breadcrumb.scss +0 -42
- package/styles/styles/theme/base/components/menu/_contextmenu.scss +0 -39
- package/styles/styles/theme/base/components/menu/_dock.scss +0 -95
- package/styles/styles/theme/base/components/menu/_megamenu.scss +0 -55
- package/styles/styles/theme/base/components/menu/_menu.scss +0 -37
- package/styles/styles/theme/base/components/menu/_menubar.scss +0 -141
- package/styles/styles/theme/base/components/menu/_panelmenu.scss +0 -153
- package/styles/styles/theme/base/components/menu/_slidemenu.scss +0 -59
- package/styles/styles/theme/base/components/menu/_steps.scss +0 -56
- package/styles/styles/theme/base/components/menu/_tabmenu.scss +0 -74
- package/styles/styles/theme/base/components/menu/_tieredmenu.scss +0 -43
- package/styles/styles/theme/base/components/messages/_inlinemessage.scss +0 -69
- package/styles/styles/theme/base/components/messages/_message.scss +0 -107
- package/styles/styles/theme/base/components/messages/_toast.scss +0 -103
- package/styles/styles/theme/base/components/misc/_avatar.scss +0 -30
- package/styles/styles/theme/base/components/misc/_badge.scss +0 -48
- package/styles/styles/theme/base/components/misc/_blockui.scss +0 -0
- package/styles/styles/theme/base/components/misc/_chip.scss +0 -42
- package/styles/styles/theme/base/components/misc/_inplace.scss +0 -17
- package/styles/styles/theme/base/components/misc/_progressbar.scss +0 -17
- package/styles/styles/theme/base/components/misc/_scrolltop.scss +0 -25
- package/styles/styles/theme/base/components/misc/_skeleton.scss +0 -8
- package/styles/styles/theme/base/components/misc/_tag.scss +0 -40
- package/styles/styles/theme/base/components/misc/_terminal.scss +0 -12
- package/styles/styles/theme/base/components/multimedia/_galleria.scss +0 -155
- package/styles/styles/theme/base/components/multimedia/_image.scss +0 -49
- package/styles/styles/theme/base/components/overlay/_confirmpopup.scss +0 -72
- package/styles/styles/theme/base/components/overlay/_dialog.scss +0 -73
- package/styles/styles/theme/base/components/overlay/_overlaypanel.scss +0 -64
- package/styles/styles/theme/base/components/overlay/_sidebar.scss +0 -27
- package/styles/styles/theme/base/components/overlay/_tooltip.scss +0 -33
- package/styles/styles/theme/base/components/panel/_accordion.scss +0 -119
- package/styles/styles/theme/base/components/panel/_card.scss +0 -30
- package/styles/styles/theme/base/components/panel/_divider.scss +0 -31
- package/styles/styles/theme/base/components/panel/_fieldset.scss +0 -47
- package/styles/styles/theme/base/components/panel/_panel.scss +0 -58
- package/styles/styles/theme/base/components/panel/_scrollpanel.scss +0 -6
- package/styles/styles/theme/base/components/panel/_splitter.scss +0 -19
- package/styles/styles/theme/base/components/panel/_tabview.scss +0 -82
- package/styles/styles/theme/base/components/panel/_toolbar.scss +0 -11
- package/styles/styles/theme/saga/_extensions.scss +0 -27
- package/styles/styles/theme/saga/_variables.scss +0 -1
- package/styles/styles/theme/saga/saga-blue/_extensions.scss +0 -2
- package/styles/styles/theme/saga/saga-blue/_fonts.scss +0 -1
- package/styles/styles/theme/saga/saga-blue/_variables.scss +0 -1
- package/styles/styles/theme/saga/saga-blue/theme.scss +0 -4
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
import { Component, EventEmitter, Inject, Input, LOCALE_ID, OnInit, Output, ViewChild } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { SelectItem } from 'primeng/api';
|
|
4
|
+
import { Table, TableFilterEvent, TableLazyLoadEvent } from 'primeng/table';
|
|
5
|
+
import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
6
|
+
import { SpiderlyDeleteConfirmationComponent } from '../spiderly-delete-dialog/spiderly-delete-confirmation.component';
|
|
7
|
+
import { CommonModule, formatDate } from '@angular/common';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
import { SpiderlyMessageService } from '../../services/spiderly-message.service';
|
|
10
|
+
import { firstValueFrom, Observable } from 'rxjs';
|
|
11
|
+
import { PrimengOption } from '../../entities/primeng-option';
|
|
12
|
+
import { TranslocoDirective, TranslocoService } from '@jsverse/transloco';
|
|
13
|
+
import { SpiderlyControlsModule } from '../../controls/spiderly-controls.module';
|
|
14
|
+
import { SpiderlyFormControl } from '../spiderly-form-control/spiderly-form-control';
|
|
15
|
+
import { TableResponse } from '../../entities/table-response';
|
|
16
|
+
import { LazyLoadSelectedIdsResult } from '../../entities/lazy-load-selected-ids-result';
|
|
17
|
+
import { exportListToExcel } from '../../services/helper-functions';
|
|
18
|
+
import { TableFilter } from '../../entities/table-filter';
|
|
19
|
+
import { PrimengModule } from '../../modules/primeng.module';
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'spiderly-data-table',
|
|
23
|
+
templateUrl: './spiderly-data-table.component.html',
|
|
24
|
+
styleUrl: 'spiderly-data-table.component.scss',
|
|
25
|
+
styles: [`
|
|
26
|
+
:host {
|
|
27
|
+
::ng-deep {
|
|
28
|
+
.remove-button-border-focus:focus,
|
|
29
|
+
.remove-button-border-focus:enabled:focus {
|
|
30
|
+
box-shadow: none;
|
|
31
|
+
-webkit-box-shadow: none;
|
|
32
|
+
-moz-box-shadow: none;
|
|
33
|
+
background-color: var(--gray-200);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`],
|
|
38
|
+
imports: [
|
|
39
|
+
FormsModule,
|
|
40
|
+
CommonModule,
|
|
41
|
+
PrimengModule,
|
|
42
|
+
TranslocoDirective,
|
|
43
|
+
SpiderlyControlsModule,
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
export class SpiderlyDataTableComponent implements OnInit {
|
|
47
|
+
@ViewChild('dt') table: Table;
|
|
48
|
+
@Input() tableTitle: string;
|
|
49
|
+
@Input() tableIcon: string = 'pi pi-list';
|
|
50
|
+
@Input() items: any[]; // FT: Pass only when hasLazyLoad === false
|
|
51
|
+
@Input() rows: number = 10;
|
|
52
|
+
@Input() cols: Column[];
|
|
53
|
+
@Input() showPaginator: boolean = true; // FT: Pass only when hasLazyLoad === false
|
|
54
|
+
@Input() showCardWrapper: boolean = true;
|
|
55
|
+
@Input() readonly: boolean = false;
|
|
56
|
+
totalRecords: number;
|
|
57
|
+
@Output() onTotalRecordsChange: EventEmitter<number> = new EventEmitter();
|
|
58
|
+
|
|
59
|
+
@Input() getTableDataObservableMethod: (tableFilter: TableFilter) => Observable<TableResponse>;
|
|
60
|
+
@Input() exportTableDataToExcelObservableMethod: (tableFilter: TableFilter) => Observable<any>;
|
|
61
|
+
@Input() deleteItemFromTableObservableMethod: (rowId: number) => Observable<any>;
|
|
62
|
+
|
|
63
|
+
lastLazyLoadEvent: TableLazyLoadEvent;
|
|
64
|
+
loading: boolean = true;
|
|
65
|
+
|
|
66
|
+
@Input() newlySelectedItems: number[] = [];
|
|
67
|
+
fakeSelectedItems: number[] = []; // FT: Only for showing checkboxes, we will not send this to the backend
|
|
68
|
+
currentPageSelectedItemsFromDb: number[] = []; // FT: Made so we can add only newly selected items to the newlySelectedItems
|
|
69
|
+
@Input() unselectedItems: number[] = [];
|
|
70
|
+
@Input() selectionMode: 'single' | 'multiple' | undefined | null;
|
|
71
|
+
@Output() onLazyLoad: EventEmitter<TableFilter> = new EventEmitter();
|
|
72
|
+
rowsSelectedNumber: number = 0;
|
|
73
|
+
isAllSelected: boolean = null;
|
|
74
|
+
fakeIsAllSelected: boolean = false; // FT: Only for showing checkboxes, we will not send this to the backend
|
|
75
|
+
isFirstTimeLazyLoad: boolean = true;
|
|
76
|
+
@Output() onIsAllSelectedChange: EventEmitter<AllClickEvent> = new EventEmitter();
|
|
77
|
+
@Input() selectedLazyLoadObservableMethod: (tableFilter: TableFilter) => Observable<LazyLoadSelectedIdsResult>;
|
|
78
|
+
@Input() additionalFilterIdLong: number;
|
|
79
|
+
|
|
80
|
+
matchModeDateOptions: SelectItem[] = [];
|
|
81
|
+
matchModeNumberOptions: SelectItem[] = [];
|
|
82
|
+
@Input() showAddButton: boolean = true;
|
|
83
|
+
@Input() showExportToExcelButton: boolean = true;
|
|
84
|
+
@Input() showReloadTableButton: boolean = false;
|
|
85
|
+
|
|
86
|
+
deleteRef: DynamicDialogRef;
|
|
87
|
+
|
|
88
|
+
// Client side table
|
|
89
|
+
// @Input() formArrayItems: any[]; // FT: Pass this only if you have some additional logic for showing data
|
|
90
|
+
@Input() getFormArrayItems: (additionalIndexes?: any) => any[];
|
|
91
|
+
@Input() hasLazyLoad: boolean = true;
|
|
92
|
+
selectedItemIds: number[] = []; // FT: Pass only when hasLazyLoad === false, it's enough if the M2M association hasn't additional fields
|
|
93
|
+
@Input() getAlreadySelectedItemIds: (additionalIndexes?: any) => number[]; // FT: Pass only when hasLazyLoad === false, it's enough if the M2M association hasn't additional fields
|
|
94
|
+
selectedItems: any[] = []; // FT: Pass only when hasLazyLoad === false
|
|
95
|
+
@Input() getAlreadySelectedItems: (additionalIndexes?: any) => any[]; // FT: Pass only when hasLazyLoad === false, it's enough if the M2M association hasn't additional fields
|
|
96
|
+
@Input() getFormControl: (formControlName: string, index: number, additionalIndexes?: any) => SpiderlyFormControl;
|
|
97
|
+
@Input() additionalIndexes: any;
|
|
98
|
+
@Output() onRowSelect: EventEmitter<RowClickEvent> = new EventEmitter();
|
|
99
|
+
@Output() onRowUnselect: EventEmitter<RowClickEvent> = new EventEmitter();
|
|
100
|
+
|
|
101
|
+
constructor(
|
|
102
|
+
private router: Router,
|
|
103
|
+
private dialogService: DialogService,
|
|
104
|
+
private route: ActivatedRoute,
|
|
105
|
+
private messageService: SpiderlyMessageService,
|
|
106
|
+
private translocoService: TranslocoService,
|
|
107
|
+
@Inject(LOCALE_ID) private locale: string
|
|
108
|
+
) {}
|
|
109
|
+
|
|
110
|
+
ngOnInit(): void {
|
|
111
|
+
this.matchModeDateOptions = [
|
|
112
|
+
{ label: this.translocoService.translate('OnDate'), value: 'equals' },
|
|
113
|
+
{ label: this.translocoService.translate('DatesBefore'), value: 'dateBefore' },
|
|
114
|
+
{ label: this.translocoService.translate('DatesAfter'), value: 'dateAfter' },
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
this.matchModeNumberOptions = [
|
|
118
|
+
{ label: this.translocoService.translate('Equals'), value: 'equals' },
|
|
119
|
+
{ label: this.translocoService.translate('MoreThan'), value: 'gte' },
|
|
120
|
+
{ label: this.translocoService.translate('LessThan'), value: 'lte' },
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
if (this.hasLazyLoad === false) {
|
|
124
|
+
this.clientLoad();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
lazyLoad(event: TableLazyLoadEvent) {
|
|
129
|
+
this.lastLazyLoadEvent = event;
|
|
130
|
+
|
|
131
|
+
let tableFilter: TableFilter = event as unknown as TableFilter;
|
|
132
|
+
tableFilter.additionalFilterIdLong = this.additionalFilterIdLong;
|
|
133
|
+
|
|
134
|
+
this.onLazyLoad.next(tableFilter);
|
|
135
|
+
|
|
136
|
+
this.getTableDataObservableMethod(tableFilter).subscribe({
|
|
137
|
+
next: async (res) => {
|
|
138
|
+
this.items = res.data;
|
|
139
|
+
this.totalRecords = res.totalRecords;
|
|
140
|
+
this.onTotalRecordsChange.next(res.totalRecords);
|
|
141
|
+
|
|
142
|
+
if (this.selectedLazyLoadObservableMethod != null) {
|
|
143
|
+
let selectedRowsMethodResult: LazyLoadSelectedIdsResult = await firstValueFrom(this.selectedLazyLoadObservableMethod(tableFilter));
|
|
144
|
+
|
|
145
|
+
this.currentPageSelectedItemsFromDb = [...selectedRowsMethodResult.selectedIds];
|
|
146
|
+
|
|
147
|
+
if (this.isFirstTimeLazyLoad == true) {
|
|
148
|
+
this.rowsSelectedNumber = selectedRowsMethodResult.totalRecordsSelected;
|
|
149
|
+
this.setFakeIsAllSelected();
|
|
150
|
+
this.isFirstTimeLazyLoad = false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (this.isAllSelected == true) {
|
|
154
|
+
let idsToInsert = [...this.items.map(x => x.id)];
|
|
155
|
+
idsToInsert = idsToInsert.filter(x => this.unselectedItems.includes(x) == false);
|
|
156
|
+
this.fakeSelectedItems = [...idsToInsert]; // FT: Only for showing checkboxes, we will not send this to the backend
|
|
157
|
+
}
|
|
158
|
+
else if (this.isAllSelected == false) {
|
|
159
|
+
this.fakeSelectedItems = [...this.newlySelectedItems]; // FT: Only for showing checkboxes, we will not send this to the backend
|
|
160
|
+
}
|
|
161
|
+
else if (this.isAllSelected == null) {
|
|
162
|
+
let idsToInsert = [...selectedRowsMethodResult.selectedIds, ...this.newlySelectedItems];
|
|
163
|
+
idsToInsert = idsToInsert.filter(x => this.unselectedItems.includes(x) == false);
|
|
164
|
+
this.fakeSelectedItems = [...idsToInsert];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
this.loading = false;
|
|
169
|
+
},
|
|
170
|
+
error: () => {
|
|
171
|
+
this.loading = false;
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
clientLoad(){
|
|
177
|
+
this.loading = false;
|
|
178
|
+
|
|
179
|
+
this.loadFormArrayItems();
|
|
180
|
+
this.totalRecords = this.items.length;
|
|
181
|
+
this.onTotalRecordsChange.next(this.items.length);
|
|
182
|
+
|
|
183
|
+
if (this.getAlreadySelectedItemIds) {
|
|
184
|
+
this.selectedItemIds = this.getAlreadySelectedItemIds(this.additionalIndexes);
|
|
185
|
+
}
|
|
186
|
+
if (this.getAlreadySelectedItems) {
|
|
187
|
+
this.selectedItems = this.getAlreadySelectedItems(this.additionalIndexes);
|
|
188
|
+
}
|
|
189
|
+
this.rowsSelectedNumber = this.selectedItemIds.length;
|
|
190
|
+
this.setFakeIsAllSelected();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
private clientFilterCount = 0;
|
|
194
|
+
|
|
195
|
+
filter(event: TableFilterEvent){
|
|
196
|
+
if (this.hasLazyLoad && this.selectionMode === 'multiple')
|
|
197
|
+
this.selectAll(false); // FT: We need to do it like this because: totalRecords: 1 -> selectedRecords from earlyer selection 2 -> unselect current -> all checkbox is set to true
|
|
198
|
+
|
|
199
|
+
if (this.hasLazyLoad === false && this.selectionMode === 'multiple') {
|
|
200
|
+
if (this.clientFilterCount === 0) {
|
|
201
|
+
this.loadFormArrayItems();
|
|
202
|
+
this.clientFilterCount++;
|
|
203
|
+
}else{
|
|
204
|
+
this.clientFilterCount--;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
private loadFormArrayItems(){
|
|
210
|
+
this.items = this.getFormArrayItems(this.additionalIndexes);
|
|
211
|
+
this.items.forEach((item, index) => {
|
|
212
|
+
item.index = index;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
getColHeaderWidth(filterType: string) {
|
|
217
|
+
switch (filterType) {
|
|
218
|
+
case 'text':
|
|
219
|
+
return 'min-width: 12rem;';
|
|
220
|
+
case 'date':
|
|
221
|
+
return 'min-width: 10rem;';
|
|
222
|
+
case 'multiselect':
|
|
223
|
+
return 'min-width: 12rem;';
|
|
224
|
+
case 'boolean':
|
|
225
|
+
return 'min-width: 8rem;';
|
|
226
|
+
case 'numeric':
|
|
227
|
+
return 'min-width: 12rem;';
|
|
228
|
+
default:
|
|
229
|
+
return 'width: 0rem;'; // fitting content of the row like this
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
getColMatchModeOptions(filterType: string){
|
|
234
|
+
switch (filterType) {
|
|
235
|
+
case 'text':
|
|
236
|
+
return null;
|
|
237
|
+
case 'date':
|
|
238
|
+
return this.matchModeDateOptions;
|
|
239
|
+
case 'multiselect':
|
|
240
|
+
return null;
|
|
241
|
+
case 'boolean':
|
|
242
|
+
return null;
|
|
243
|
+
case 'numeric':
|
|
244
|
+
return this.matchModeNumberOptions;
|
|
245
|
+
default:
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
getColMatchMode(filterType: string){
|
|
251
|
+
switch (filterType) {
|
|
252
|
+
case 'text':
|
|
253
|
+
return 'contains';
|
|
254
|
+
case 'date':
|
|
255
|
+
return null;
|
|
256
|
+
case 'multiselect':
|
|
257
|
+
return 'in';
|
|
258
|
+
case 'boolean':
|
|
259
|
+
return 'equals';
|
|
260
|
+
case 'numeric':
|
|
261
|
+
return null;
|
|
262
|
+
default:
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
isDropOrMulti(filterType: string){
|
|
268
|
+
if (filterType == 'dropdown' || filterType == 'multiselect') {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
navigateToDetails(rowId: number){
|
|
277
|
+
this.router.navigate([rowId], {relativeTo: this.route});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
deleteObject(rowId: number){
|
|
281
|
+
this.deleteRef = this.dialogService.open(SpiderlyDeleteConfirmationComponent,
|
|
282
|
+
{
|
|
283
|
+
header: this.translocoService.translate('AreYouSure'),
|
|
284
|
+
width: '400px',
|
|
285
|
+
data:{ deleteItemFromTableObservableMethod: this.deleteItemFromTableObservableMethod, id: rowId, }
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
this.deleteRef.onClose.subscribe((deletedSuccessfully: boolean)=>{
|
|
289
|
+
if(deletedSuccessfully === true){
|
|
290
|
+
this.messageService.successMessage(this.translocoService.translate('SuccessfullyDeletedMessage'));
|
|
291
|
+
this.reload();
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
reload(){
|
|
297
|
+
this.loading = true;
|
|
298
|
+
this.items = null;
|
|
299
|
+
this.lazyLoad(this.lastLazyLoadEvent);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
showActions(): boolean {
|
|
303
|
+
return this.cols.some(x => x.actions?.length > 0);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
getStyleForBodyColumn(col: Column<any>) {
|
|
307
|
+
switch(col.filterType){
|
|
308
|
+
case 'numeric':
|
|
309
|
+
return 'text-align: right;';
|
|
310
|
+
default:
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
getClassForAction(action: Action): string{
|
|
316
|
+
switch(action.field){
|
|
317
|
+
case 'Details':
|
|
318
|
+
return 'pi pi-pencil text-lg cursor-pointer primary-color';
|
|
319
|
+
case 'Delete':
|
|
320
|
+
return 'pi pi-trash text-lg text-red-500 cursor-pointer';
|
|
321
|
+
default:
|
|
322
|
+
return `${action.icon} ${action.style} text-lg cursor-pointer`;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
getMethodForAction(action: Action, rowData: any){
|
|
327
|
+
switch(action.field){
|
|
328
|
+
case 'Details':
|
|
329
|
+
return this.navigateToDetails(rowData.id);
|
|
330
|
+
case 'Delete':
|
|
331
|
+
return this.deleteObject(rowData.id);
|
|
332
|
+
default:
|
|
333
|
+
return action.onClick(rowData.id);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
getRowData(rowData: any, col: Column): string{
|
|
338
|
+
switch (col.filterType) {
|
|
339
|
+
case 'text':
|
|
340
|
+
return rowData[col.field];
|
|
341
|
+
case 'date':
|
|
342
|
+
if (rowData[col.field] == null)
|
|
343
|
+
return null;
|
|
344
|
+
|
|
345
|
+
if (col.showTime)
|
|
346
|
+
return formatDate(rowData[col.field], 'dd.MM.yyyy. HH:mm', this.locale);
|
|
347
|
+
else
|
|
348
|
+
return formatDate(rowData[col.field], 'dd.MM.yyyy.', this.locale);
|
|
349
|
+
case 'multiselect':
|
|
350
|
+
return rowData[col.field];
|
|
351
|
+
case 'boolean':
|
|
352
|
+
return rowData[col.field] == true ? this.translocoService.translate('Yes') : this.translocoService.translate('No');
|
|
353
|
+
case 'numeric':
|
|
354
|
+
// TODO FT: make decimal pipe
|
|
355
|
+
return rowData[col.field];
|
|
356
|
+
default:
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
colTrackByFn(index, item){
|
|
362
|
+
return item.field;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
actionTrackByFn(index, item: Action){
|
|
366
|
+
return `${index}${item.field}`
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
exportListToExcel() {
|
|
370
|
+
let tableFilter: TableFilter = this.lastLazyLoadEvent as unknown as TableFilter;
|
|
371
|
+
tableFilter.additionalFilterIdLong = this.additionalFilterIdLong;
|
|
372
|
+
|
|
373
|
+
exportListToExcel(this.exportTableDataToExcelObservableMethod, tableFilter);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
clear(table: Table) {
|
|
377
|
+
table.clear();
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
//#region Selection
|
|
381
|
+
|
|
382
|
+
setFakeIsAllSelected(){
|
|
383
|
+
if(this.rowsSelectedNumber == this.totalRecords)
|
|
384
|
+
this.fakeIsAllSelected = true;
|
|
385
|
+
else
|
|
386
|
+
this.fakeIsAllSelected = false;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
selectAll(checked: boolean){
|
|
390
|
+
this.unselectedItems.length = 0;
|
|
391
|
+
this.newlySelectedItems.length = 0;
|
|
392
|
+
|
|
393
|
+
if (checked == true) {
|
|
394
|
+
this.isAllSelected = true;
|
|
395
|
+
this.fakeIsAllSelected = true;
|
|
396
|
+
this.onIsAllSelectedChange.next(new AllClickEvent({checked: true, additionalIndexes: this.additionalIndexes}));
|
|
397
|
+
this.rowsSelectedNumber = this.totalRecords;
|
|
398
|
+
this.fakeSelectedItems = [...this.items.map(x => x.id)];
|
|
399
|
+
this.selectedItemIds = [...this.items.map(x => x.id)]
|
|
400
|
+
}
|
|
401
|
+
else{
|
|
402
|
+
this.isAllSelected = false;
|
|
403
|
+
this.fakeIsAllSelected = false;
|
|
404
|
+
this.onIsAllSelectedChange.next(new AllClickEvent({checked: false, additionalIndexes: this.additionalIndexes}));
|
|
405
|
+
this.rowsSelectedNumber = 0;
|
|
406
|
+
this.fakeSelectedItems = [];
|
|
407
|
+
this.selectedItemIds = [];
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
selectRow(id: number, index: number) {
|
|
412
|
+
if (this.isRowSelected(id)) {
|
|
413
|
+
this.rowUnselect(id);
|
|
414
|
+
this.onRowUnselect.next(new RowClickEvent({ index: index, id: id, additionalIndexes: this.additionalIndexes }));
|
|
415
|
+
} else {
|
|
416
|
+
this.rowSelect(id);
|
|
417
|
+
this.onRowSelect.next(new RowClickEvent({ index: index, id: id, additionalIndexes: this.additionalIndexes }));
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
isRowSelected(id: number){
|
|
422
|
+
if (this.hasLazyLoad){
|
|
423
|
+
return this.fakeSelectedItems.find(x => x === id) != undefined;
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
return this.selectedItemIds.find(x => x === id) != undefined;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
rowSelect(id: number){
|
|
431
|
+
if (this.isAllSelected == false || this.currentPageSelectedItemsFromDb.includes(id) == false) {
|
|
432
|
+
this.newlySelectedItems.push(id);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (this.hasLazyLoad){
|
|
436
|
+
this.fakeSelectedItems.push(id);
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
this.selectedItemIds.push(id);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
this.rowsSelectedNumber++;
|
|
443
|
+
|
|
444
|
+
const index = this.unselectedItems.indexOf(id);
|
|
445
|
+
if (index !== -1) {
|
|
446
|
+
this.unselectedItems.splice(index, 1); // FT: Splice is mutating the array
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
this.setFakeIsAllSelected();
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
rowUnselect(id: number) {
|
|
453
|
+
if (this.isAllSelected == true || this.currentPageSelectedItemsFromDb.includes(id) == true) {
|
|
454
|
+
this.unselectedItems.push(id);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
this.rowsSelectedNumber--;
|
|
458
|
+
|
|
459
|
+
const index = this.newlySelectedItems.indexOf(id);
|
|
460
|
+
const fakeIndex = this.fakeSelectedItems.indexOf(id);
|
|
461
|
+
const nonLazyLoadIndex = this.selectedItemIds.indexOf(id);
|
|
462
|
+
|
|
463
|
+
if (index !== -1) {
|
|
464
|
+
this.newlySelectedItems.splice(index, 1); // FT: Splice is mutating the array
|
|
465
|
+
}
|
|
466
|
+
if (fakeIndex !== -1) {
|
|
467
|
+
this.fakeSelectedItems.splice(fakeIndex, 1); // FT: Splice is mutating the array
|
|
468
|
+
}
|
|
469
|
+
if (nonLazyLoadIndex !== -1) {
|
|
470
|
+
this.selectedItemIds.splice(nonLazyLoadIndex, 1); // FT: Splice is mutating the array
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
this.setFakeIsAllSelected();
|
|
474
|
+
}
|
|
475
|
+
//#endregion
|
|
476
|
+
|
|
477
|
+
//#region Client side table
|
|
478
|
+
|
|
479
|
+
// FT: Can do it with Id also, because we are never adding the new record in the table at the same page.
|
|
480
|
+
getFormArrayControlByIndex(formControlName: string, index: number): SpiderlyFormControl{
|
|
481
|
+
if (this.getFormControl) {
|
|
482
|
+
return this.getFormControl(formControlName, index, this.additionalIndexes);
|
|
483
|
+
}
|
|
484
|
+
else{
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
//#endregion
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export class Action {
|
|
493
|
+
name?: string;
|
|
494
|
+
field?: string;
|
|
495
|
+
icon?: string;
|
|
496
|
+
style?: string;
|
|
497
|
+
onClick?: (id: number) => void;
|
|
498
|
+
|
|
499
|
+
constructor(
|
|
500
|
+
{
|
|
501
|
+
name,
|
|
502
|
+
field,
|
|
503
|
+
icon,
|
|
504
|
+
style,
|
|
505
|
+
onClick,
|
|
506
|
+
}:{
|
|
507
|
+
name?: string;
|
|
508
|
+
field?: string;
|
|
509
|
+
icon?: string;
|
|
510
|
+
style?: string;
|
|
511
|
+
onClick?: () => void;
|
|
512
|
+
} = {}
|
|
513
|
+
) {
|
|
514
|
+
this.name = name;
|
|
515
|
+
this.field = field;
|
|
516
|
+
this.icon = icon;
|
|
517
|
+
this.style = style;
|
|
518
|
+
this.onClick = onClick;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export class Column<T = any> {
|
|
523
|
+
name: string;
|
|
524
|
+
field?: string & keyof T;
|
|
525
|
+
filterField?: string & keyof T; // FT: Made specificaly for multiautocomplete, maybe for something more in the future
|
|
526
|
+
filterType?: 'text' | 'date' | 'multiselect' | 'boolean' | 'numeric';
|
|
527
|
+
filterPlaceholder?: string;
|
|
528
|
+
showMatchModes?: boolean;
|
|
529
|
+
showAddButton?: boolean;
|
|
530
|
+
dropdownOrMultiselectValues?: PrimengOption[];
|
|
531
|
+
actions?: Action[];
|
|
532
|
+
editable?: boolean;
|
|
533
|
+
showTime?: boolean;
|
|
534
|
+
|
|
535
|
+
constructor(
|
|
536
|
+
{
|
|
537
|
+
name,
|
|
538
|
+
field,
|
|
539
|
+
filterField,
|
|
540
|
+
filterType,
|
|
541
|
+
filterPlaceholder,
|
|
542
|
+
showMatchModes,
|
|
543
|
+
showAddButton,
|
|
544
|
+
dropdownOrMultiselectValues,
|
|
545
|
+
actions,
|
|
546
|
+
editable,
|
|
547
|
+
showTime,
|
|
548
|
+
}:{
|
|
549
|
+
name?: string;
|
|
550
|
+
field?: string & keyof T;
|
|
551
|
+
filterField?: string & keyof T; // FT: Made specificaly for multiautocomplete, maybe for something more in the future;
|
|
552
|
+
filterType?: 'text' | 'date' | 'multiselect' | 'boolean' | 'numeric';
|
|
553
|
+
filterPlaceholder?: string;
|
|
554
|
+
showMatchModes?: boolean;
|
|
555
|
+
showAddButton?: boolean;
|
|
556
|
+
dropdownOrMultiselectValues?: PrimengOption[];
|
|
557
|
+
actions?: Action[];
|
|
558
|
+
editable?: boolean;
|
|
559
|
+
showTime?: boolean;
|
|
560
|
+
} = {}
|
|
561
|
+
) {
|
|
562
|
+
this.name = name;
|
|
563
|
+
this.field = field;
|
|
564
|
+
this.filterField = filterField;
|
|
565
|
+
this.filterType = filterType;
|
|
566
|
+
this.filterPlaceholder = filterPlaceholder;
|
|
567
|
+
this.showMatchModes = showMatchModes;
|
|
568
|
+
this.showAddButton = showAddButton;
|
|
569
|
+
this.dropdownOrMultiselectValues = dropdownOrMultiselectValues;
|
|
570
|
+
this.actions = actions;
|
|
571
|
+
this.editable = editable;
|
|
572
|
+
this.showTime = showTime;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export class RowClickEvent {
|
|
577
|
+
index?: number;
|
|
578
|
+
id?: number;
|
|
579
|
+
additionalIndexes?: any;
|
|
580
|
+
|
|
581
|
+
constructor(
|
|
582
|
+
{
|
|
583
|
+
index,
|
|
584
|
+
id,
|
|
585
|
+
additionalIndexes
|
|
586
|
+
}:{
|
|
587
|
+
index?: number;
|
|
588
|
+
id?: number;
|
|
589
|
+
additionalIndexes?: any;
|
|
590
|
+
} = {}
|
|
591
|
+
) {
|
|
592
|
+
this.index = index;
|
|
593
|
+
this.id = id;
|
|
594
|
+
this.additionalIndexes = additionalIndexes;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export class AllClickEvent {
|
|
599
|
+
checked?: boolean;
|
|
600
|
+
additionalIndexes?: any;
|
|
601
|
+
|
|
602
|
+
constructor(
|
|
603
|
+
{
|
|
604
|
+
checked,
|
|
605
|
+
additionalIndexes
|
|
606
|
+
}:{
|
|
607
|
+
checked?: boolean;
|
|
608
|
+
additionalIndexes?: any;
|
|
609
|
+
} = {}
|
|
610
|
+
) {
|
|
611
|
+
this.checked = checked;
|
|
612
|
+
this.additionalIndexes = additionalIndexes;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<ng-container *transloco="let t">
|
|
2
|
+
<p-confirmDialog
|
|
3
|
+
#cd
|
|
4
|
+
></p-confirmDialog>
|
|
5
|
+
<div
|
|
6
|
+
class="border-bottom-1 surface-border text-lg"
|
|
7
|
+
style="display: flex; align-items: center; padding-bottom: 10px; width: 100%; gap: 10px;"
|
|
8
|
+
>
|
|
9
|
+
<i class="pi pi-exclamation-circle text-4xl"></i>
|
|
10
|
+
<p>{{t('PleaseConfirmToProceed')}}</p>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div style="display: flex; gap: 5px; justify-content: right; margin-top: 28px;">
|
|
14
|
+
<spiderly-button (onClick)="reject()" icon="pi pi-times" [label]="t('Cancle')" severity="secondary"></spiderly-button>
|
|
15
|
+
<spiderly-button (onClick)="accept()" icon="pi pi-check" [label]="t('Confirm')" styleClass="p-button-danger"></spiderly-button>
|
|
16
|
+
</div>
|
|
17
|
+
</ng-container>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ConfirmationService } from 'primeng/api';
|
|
2
|
+
import { Component } from "@angular/core";
|
|
3
|
+
import { DynamicDialogConfig, DynamicDialogRef } from "primeng/dynamicdialog";
|
|
4
|
+
import { TranslocoDirective } from '@jsverse/transloco';
|
|
5
|
+
import { PrimengModule } from '../../modules/primeng.module';
|
|
6
|
+
import { SpiderlyButtonComponent } from '../spiderly-buttons/spiderly-button/spiderly-button.component';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'spiderly-delete-confirmation',
|
|
10
|
+
templateUrl: './spiderly-delete-confirmation.component.html',
|
|
11
|
+
styles: [],
|
|
12
|
+
imports: [
|
|
13
|
+
PrimengModule,
|
|
14
|
+
SpiderlyButtonComponent,
|
|
15
|
+
TranslocoDirective,
|
|
16
|
+
],
|
|
17
|
+
providers: [
|
|
18
|
+
ConfirmationService
|
|
19
|
+
]
|
|
20
|
+
})
|
|
21
|
+
export class SpiderlyDeleteConfirmationComponent {
|
|
22
|
+
|
|
23
|
+
constructor(public ref: DynamicDialogRef, public config: DynamicDialogConfig) {}
|
|
24
|
+
|
|
25
|
+
accept(){
|
|
26
|
+
this.config.data.deleteItemFromTableObservableMethod(this.config.data.id).subscribe({
|
|
27
|
+
next: () => {
|
|
28
|
+
this.ref.close(true); // deleted succesfully
|
|
29
|
+
},
|
|
30
|
+
error: () => {
|
|
31
|
+
this.ref.close(false); // not deleted succesfully
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
reject(){
|
|
37
|
+
this.ref.close(false);
|
|
38
|
+
}
|
|
39
|
+
}
|