@pega/angular-sdk-overrides 0.23.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/lib/designSystemExtension/alert/alert.component.html +19 -0
- package/lib/designSystemExtension/alert/alert.component.scss +52 -0
- package/lib/designSystemExtension/alert/alert.component.spec.ts +22 -0
- package/lib/designSystemExtension/alert/alert.component.ts +43 -0
- package/lib/designSystemExtension/alert-banner/alert-banner.component.html +12 -0
- package/lib/designSystemExtension/alert-banner/alert-banner.component.scss +0 -0
- package/lib/designSystemExtension/alert-banner/alert-banner.component.spec.ts +22 -0
- package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +27 -0
- package/lib/designSystemExtension/banner/banner.component.html +28 -0
- package/lib/designSystemExtension/banner/banner.component.scss +64 -0
- package/lib/designSystemExtension/banner/banner.component.spec.ts +22 -0
- package/lib/designSystemExtension/banner/banner.component.ts +26 -0
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.html +12 -0
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.scss +0 -0
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.spec.ts +24 -0
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +58 -0
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +52 -0
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +142 -0
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.spec.ts +24 -0
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +80 -0
- package/lib/designSystemExtension/material-details/material-details.component.html +40 -0
- package/lib/designSystemExtension/material-details/material-details.component.scss +121 -0
- package/lib/designSystemExtension/material-details/material-details.component.spec.ts +24 -0
- package/lib/designSystemExtension/material-details/material-details.component.ts +32 -0
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +23 -0
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.scss +33 -0
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.spec.ts +22 -0
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +29 -0
- package/lib/designSystemExtension/material-summary-item/material-summary-item.component.html +37 -0
- package/lib/designSystemExtension/material-summary-item/material-summary-item.component.scss +127 -0
- package/lib/designSystemExtension/material-summary-item/material-summary-item.component.spec.ts +24 -0
- package/lib/designSystemExtension/material-summary-item/material-summary-item.component.ts +32 -0
- package/lib/designSystemExtension/material-summary-list/material-summary-list.component.html +3 -0
- package/lib/designSystemExtension/material-summary-list/material-summary-list.component.scss +1 -0
- package/lib/designSystemExtension/material-summary-list/material-summary-list.component.spec.ts +24 -0
- package/lib/designSystemExtension/material-summary-list/material-summary-list.component.ts +17 -0
- package/lib/designSystemExtension/material-utility/material-utility.component.html +17 -0
- package/lib/designSystemExtension/material-utility/material-utility.component.scss +52 -0
- package/lib/designSystemExtension/material-utility/material-utility.component.spec.ts +24 -0
- package/lib/designSystemExtension/material-utility/material-utility.component.ts +26 -0
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.html +12 -0
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.scss +28 -0
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.spec.ts +24 -0
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.ts +40 -0
- package/lib/designSystemExtension/operator/operator.component.html +20 -0
- package/lib/designSystemExtension/operator/operator.component.scss +83 -0
- package/lib/designSystemExtension/operator/operator.component.spec.ts +24 -0
- package/lib/designSystemExtension/operator/operator.component.ts +146 -0
- package/lib/designSystemExtension/pulse/pulse.component.html +3 -0
- package/lib/designSystemExtension/pulse/pulse.component.scss +8 -0
- package/lib/designSystemExtension/pulse/pulse.component.spec.ts +24 -0
- package/lib/designSystemExtension/pulse/pulse.component.ts +40 -0
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.html +33 -0
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +20 -0
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.spec.ts +24 -0
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +89 -0
- package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.html +13 -0
- package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.scss +43 -0
- package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.spec.ts +22 -0
- package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.ts +15 -0
- package/lib/field/auto-complete/auto-complete.component.html +32 -0
- package/lib/field/auto-complete/auto-complete.component.scss +20 -0
- package/lib/field/auto-complete/auto-complete.component.spec.ts +24 -0
- package/lib/field/auto-complete/auto-complete.component.ts +345 -0
- package/lib/field/auto-complete/config-ext.json +10 -0
- package/lib/field/cancel-alert/cancel-alert.component.html +18 -0
- package/lib/field/cancel-alert/cancel-alert.component.scss +24 -0
- package/lib/field/cancel-alert/cancel-alert.component.spec.ts +24 -0
- package/lib/field/cancel-alert/cancel-alert.component.ts +107 -0
- package/lib/field/check-box/check-box.component.html +41 -0
- package/lib/field/check-box/check-box.component.scss +24 -0
- package/lib/field/check-box/check-box.component.spec.ts +24 -0
- package/lib/field/check-box/check-box.component.ts +188 -0
- package/lib/field/check-box/config-ext.json +9 -0
- package/lib/field/currency/config-ext.json +9 -0
- package/lib/field/currency/currency.component.html +31 -0
- package/lib/field/currency/currency.component.scss +28 -0
- package/lib/field/currency/currency.component.spec.ts +24 -0
- package/lib/field/currency/currency.component.ts +197 -0
- package/lib/field/date/config-ext.json +9 -0
- package/lib/field/date/date.component.html +31 -0
- package/lib/field/date/date.component.scss +24 -0
- package/lib/field/date/date.component.spec.ts +24 -0
- package/lib/field/date/date.component.ts +245 -0
- package/lib/field/date-time/config-ext.json +8 -0
- package/lib/field/date-time/date-time.component.html +29 -0
- package/lib/field/date-time/date-time.component.scss +80 -0
- package/lib/field/date-time/date-time.component.spec.ts +24 -0
- package/lib/field/date-time/date-time.component.ts +224 -0
- package/lib/field/decimal/config-ext.json +8 -0
- package/lib/field/decimal/decimal.component.html +28 -0
- package/lib/field/decimal/decimal.component.scss +20 -0
- package/lib/field/decimal/decimal.component.spec.ts +24 -0
- package/lib/field/decimal/decimal.component.ts +187 -0
- package/lib/field/dropdown/config-ext.json +8 -0
- package/lib/field/dropdown/dropdown.component.html +31 -0
- package/lib/field/dropdown/dropdown.component.scss +25 -0
- package/lib/field/dropdown/dropdown.component.spec.ts +24 -0
- package/lib/field/dropdown/dropdown.component.ts +247 -0
- package/lib/field/email/config-ext.json +8 -0
- package/lib/field/email/email.component.html +27 -0
- package/lib/field/email/email.component.scss +20 -0
- package/lib/field/email/email.component.spec.ts +24 -0
- package/lib/field/email/email.component.ts +180 -0
- package/lib/field/integer/config-ext.json +8 -0
- package/lib/field/integer/integer.component.html +28 -0
- package/lib/field/integer/integer.component.scss +20 -0
- package/lib/field/integer/integer.component.spec.ts +24 -0
- package/lib/field/integer/integer.component.ts +185 -0
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +12 -0
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.scss +1 -0
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.spec.ts +22 -0
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +40 -0
- package/lib/field/percentage/config-ext.json +8 -0
- package/lib/field/percentage/percentage.component.html +29 -0
- package/lib/field/percentage/percentage.component.scss +20 -0
- package/lib/field/percentage/percentage.component.spec.ts +24 -0
- package/lib/field/percentage/percentage.component.ts +181 -0
- package/lib/field/phone/config-ext.json +8 -0
- package/lib/field/phone/phone.component.html +26 -0
- package/lib/field/phone/phone.component.scss +81 -0
- package/lib/field/phone/phone.component.spec.ts +24 -0
- package/lib/field/phone/phone.component.ts +199 -0
- package/lib/field/radio-buttons/config-ext.json +8 -0
- package/lib/field/radio-buttons/radio-buttons.component.html +37 -0
- package/lib/field/radio-buttons/radio-buttons.component.scss +39 -0
- package/lib/field/radio-buttons/radio-buttons.component.spec.ts +24 -0
- package/lib/field/radio-buttons/radio-buttons.component.ts +241 -0
- package/lib/field/rich-text/rich-text.component.html +20 -0
- package/lib/field/rich-text/rich-text.component.scss +0 -0
- package/lib/field/rich-text/rich-text.component.spec.ts +24 -0
- package/lib/field/rich-text/rich-text.component.ts +131 -0
- package/lib/field/scalar-list/config-ext.json +8 -0
- package/lib/field/scalar-list/scalar-list.component.html +9 -0
- package/lib/field/scalar-list/scalar-list.component.scss +0 -0
- package/lib/field/scalar-list/scalar-list.component.spec.ts +22 -0
- package/lib/field/scalar-list/scalar-list.component.ts +119 -0
- package/lib/field/semantic-link/config-ext.json +7 -0
- package/lib/field/semantic-link/semantic-link.component.html +10 -0
- package/lib/field/semantic-link/semantic-link.component.scss +16 -0
- package/lib/field/semantic-link/semantic-link.component.spec.ts +0 -0
- package/lib/field/semantic-link/semantic-link.component.ts +70 -0
- package/lib/field/text/text.component.html +14 -0
- package/lib/field/text/text.component.scss +30 -0
- package/lib/field/text/text.component.spec.ts +24 -0
- package/lib/field/text/text.component.ts +158 -0
- package/lib/field/text-area/config-ext.json +8 -0
- package/lib/field/text-area/text-area.component.html +29 -0
- package/lib/field/text-area/text-area.component.scss +20 -0
- package/lib/field/text-area/text-area.component.spec.ts +24 -0
- package/lib/field/text-area/text-area.component.ts +186 -0
- package/lib/field/text-content/config-ext.json +7 -0
- package/lib/field/text-content/text-content.component.html +7 -0
- package/lib/field/text-content/text-content.component.scss +4 -0
- package/lib/field/text-content/text-content.component.spec.ts +24 -0
- package/lib/field/text-content/text-content.component.ts +89 -0
- package/lib/field/text-input/config-ext.json +8 -0
- package/lib/field/text-input/text-input.component.html +27 -0
- package/lib/field/text-input/text-input.component.scss +20 -0
- package/lib/field/text-input/text-input.component.spec.ts +24 -0
- package/lib/field/text-input/text-input.component.ts +183 -0
- package/lib/field/time/config-ext.json +8 -0
- package/lib/field/time/time.component.html +26 -0
- package/lib/field/time/time.component.scss +20 -0
- package/lib/field/time/time.component.spec.ts +24 -0
- package/lib/field/time/time.component.ts +177 -0
- package/lib/field/url/config-ext.json +8 -0
- package/lib/field/url/url.component.html +26 -0
- package/lib/field/url/url.component.scss +20 -0
- package/lib/field/url/url.component.spec.ts +24 -0
- package/lib/field/url/url.component.ts +179 -0
- package/lib/field/user-reference/config-ext.json +7 -0
- package/lib/field/user-reference/user-reference.component.html +48 -0
- package/lib/field/user-reference/user-reference.component.scss +30 -0
- package/lib/field/user-reference/user-reference.component.spec.ts +24 -0
- package/lib/field/user-reference/user-reference.component.ts +213 -0
- package/lib/infra/Containers/flow-container/flow-container.component.html +39 -0
- package/lib/infra/Containers/flow-container/flow-container.component.scss +33 -0
- package/lib/infra/Containers/flow-container/flow-container.component.spec.ts +24 -0
- package/lib/infra/Containers/flow-container/flow-container.component.ts +633 -0
- package/lib/infra/Containers/flow-container/helpers.ts +79 -0
- package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.html +1 -0
- package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.scss +0 -0
- package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.spec.ts +24 -0
- package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +24 -0
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +35 -0
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.scss +29 -0
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.spec.ts +24 -0
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +394 -0
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.html +1 -0
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.scss +0 -0
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.spec.ts +24 -0
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +35 -0
- package/lib/infra/Containers/view-container/view-container.component.html +31 -0
- package/lib/infra/Containers/view-container/view-container.component.scss +7 -0
- package/lib/infra/Containers/view-container/view-container.component.spec.ts +24 -0
- package/lib/infra/Containers/view-container/view-container.component.ts +289 -0
- package/lib/infra/action-buttons/action-buttons.component.html +12 -0
- package/lib/infra/action-buttons/action-buttons.component.scss +1 -0
- package/lib/infra/action-buttons/action-buttons.component.spec.ts +24 -0
- package/lib/infra/action-buttons/action-buttons.component.ts +25 -0
- package/lib/infra/assignment/assignment.component.html +28 -0
- package/lib/infra/assignment/assignment.component.scss +0 -0
- package/lib/infra/assignment/assignment.component.spec.ts +24 -0
- package/lib/infra/assignment/assignment.component.ts +463 -0
- package/lib/infra/assignment-card/assignment-card.component.html +26 -0
- package/lib/infra/assignment-card/assignment-card.component.scss +9 -0
- package/lib/infra/assignment-card/assignment-card.component.spec.ts +24 -0
- package/lib/infra/assignment-card/assignment-card.component.ts +39 -0
- package/lib/infra/dashboard-filter/dashboard-filter.component.html +35 -0
- package/lib/infra/dashboard-filter/dashboard-filter.component.scss +14 -0
- package/lib/infra/dashboard-filter/dashboard-filter.component.spec.ts +24 -0
- package/lib/infra/dashboard-filter/dashboard-filter.component.ts +90 -0
- package/lib/infra/defer-load/defer-load.component.html +3 -0
- package/lib/infra/defer-load/defer-load.component.scss +0 -0
- package/lib/infra/defer-load/defer-load.component.spec.ts +24 -0
- package/lib/infra/defer-load/defer-load.component.ts +169 -0
- package/lib/infra/error-boundary/error-boundary.component.html +1 -0
- package/lib/infra/error-boundary/error-boundary.component.scss +0 -0
- package/lib/infra/error-boundary/error-boundary.component.spec.ts +22 -0
- package/lib/infra/error-boundary/error-boundary.component.ts +16 -0
- package/lib/infra/multi-step/multi-step.component.html +98 -0
- package/lib/infra/multi-step/multi-step.component.scss +247 -0
- package/lib/infra/multi-step/multi-step.component.spec.ts +24 -0
- package/lib/infra/multi-step/multi-step.component.ts +85 -0
- package/lib/infra/navbar/navbar.component.html +55 -0
- package/lib/infra/navbar/navbar.component.scss +154 -0
- package/lib/infra/navbar/navbar.component.spec.ts +24 -0
- package/lib/infra/navbar/navbar.component.ts +175 -0
- package/lib/infra/reference/reference.component.html +1 -0
- package/lib/infra/reference/reference.component.scss +0 -0
- package/lib/infra/reference/reference.component.ts +165 -0
- package/lib/infra/region/region.component.html +11 -0
- package/lib/infra/region/region.component.scss +0 -0
- package/lib/infra/region/region.component.spec.ts +24 -0
- package/lib/infra/region/region.component.ts +37 -0
- package/lib/infra/root-container/root-container.component.html +36 -0
- package/lib/infra/root-container/root-container.component.scss +20 -0
- package/lib/infra/root-container/root-container.component.spec.ts +24 -0
- package/lib/infra/root-container/root-container.component.ts +256 -0
- package/lib/infra/stages/stages.component.html +15 -0
- package/lib/infra/stages/stages.component.scss +109 -0
- package/lib/infra/stages/stages.component.spec.ts +24 -0
- package/lib/infra/stages/stages.component.ts +83 -0
- package/lib/infra/view/view.component.html +38 -0
- package/lib/infra/view/view.component.scss +16 -0
- package/lib/infra/view/view.component.spec.ts +24 -0
- package/lib/infra/view/view.component.ts +214 -0
- package/lib/template/app-shell/app-shell.component.html +15 -0
- package/lib/template/app-shell/app-shell.component.scss +51 -0
- package/lib/template/app-shell/app-shell.component.spec.ts +24 -0
- package/lib/template/app-shell/app-shell.component.ts +192 -0
- package/lib/template/banner-page/banner-page.component.html +12 -0
- package/lib/template/banner-page/banner-page.component.scss +0 -0
- package/lib/template/banner-page/banner-page.component.spec.ts +22 -0
- package/lib/template/banner-page/banner-page.component.ts +65 -0
- package/lib/template/case-summary/case-summary.component.html +1 -0
- package/lib/template/case-summary/case-summary.component.scss +44 -0
- package/lib/template/case-summary/case-summary.component.spec.ts +24 -0
- package/lib/template/case-summary/case-summary.component.ts +100 -0
- package/lib/template/case-summary/config-ext.json +8 -0
- package/lib/template/case-view/case-view.component.html +89 -0
- package/lib/template/case-view/case-view.component.scss +107 -0
- package/lib/template/case-view/case-view.component.spec.ts +24 -0
- package/lib/template/case-view/case-view.component.ts +242 -0
- package/lib/template/case-view/config-ext.json +8 -0
- package/lib/template/confirmation/config-ext.json +11 -0
- package/lib/template/confirmation/confirmation.component.html +23 -0
- package/lib/template/confirmation/confirmation.component.scss +10 -0
- package/lib/template/confirmation/confirmation.component.spec.ts +23 -0
- package/lib/template/confirmation/confirmation.component.ts +91 -0
- package/lib/template/data-reference/config-ext.json +8 -0
- package/lib/template/data-reference/data-reference.component.html +13 -0
- package/lib/template/data-reference/data-reference.component.scss +0 -0
- package/lib/template/data-reference/data-reference.component.spec.ts +24 -0
- package/lib/template/data-reference/data-reference.component.ts +275 -0
- package/lib/template/default-form/config-ext.json +8 -0
- package/lib/template/default-form/default-form.component.html +19 -0
- package/lib/template/default-form/default-form.component.scss +38 -0
- package/lib/template/default-form/default-form.component.spec.ts +24 -0
- package/lib/template/default-form/default-form.component.ts +76 -0
- package/lib/template/details/config-ext.json +9 -0
- package/lib/template/details/details.component.html +3 -0
- package/lib/template/details/details.component.scss +7 -0
- package/lib/template/details/details.component.spec.ts +24 -0
- package/lib/template/details/details.component.ts +113 -0
- package/lib/template/details-narrow-wide/config-ext.json +8 -0
- package/lib/template/details-narrow-wide/details-narrow-wide.component.html +4 -0
- package/lib/template/details-narrow-wide/details-narrow-wide.component.scss +7 -0
- package/lib/template/details-narrow-wide/details-narrow-wide.component.spec.ts +24 -0
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +82 -0
- package/lib/template/details-one-column/config-ext.json +9 -0
- package/lib/template/details-one-column/details-one-column.component.html +1 -0
- package/lib/template/details-one-column/details-one-column.component.scss +0 -0
- package/lib/template/details-one-column/details-one-column.component.spec.ts +24 -0
- package/lib/template/details-one-column/details-one-column.component.ts +85 -0
- package/lib/template/details-sub-tabs/config-ext.json +8 -0
- package/lib/template/details-sub-tabs/details-sub-tabs.component.html +15 -0
- package/lib/template/details-sub-tabs/details-sub-tabs.component.scss +0 -0
- package/lib/template/details-sub-tabs/details-sub-tabs.component.spec.ts +24 -0
- package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +73 -0
- package/lib/template/details-three-column/config-ext.json +8 -0
- package/lib/template/details-three-column/details-three-column.component.html +4 -0
- package/lib/template/details-three-column/details-three-column.component.scss +7 -0
- package/lib/template/details-three-column/details-three-column.component.spec.ts +24 -0
- package/lib/template/details-three-column/details-three-column.component.ts +94 -0
- package/lib/template/details-two-column/config-ext.json +8 -0
- package/lib/template/details-two-column/details-two-column.component.html +4 -0
- package/lib/template/details-two-column/details-two-column.component.scss +7 -0
- package/lib/template/details-two-column/details-two-column.component.spec.ts +24 -0
- package/lib/template/details-two-column/details-two-column.component.ts +92 -0
- package/lib/template/details-wide-narrow/config-ext.json +8 -0
- package/lib/template/details-wide-narrow/details-wide-narrow.component.html +4 -0
- package/lib/template/details-wide-narrow/details-wide-narrow.component.scss +7 -0
- package/lib/template/details-wide-narrow/details-wide-narrow.component.spec.ts +24 -0
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +88 -0
- package/lib/template/dynamic-tabs/config-ext.json +36 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +5 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.scss +0 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.spec.ts +22 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +78 -0
- package/lib/template/field-group-list/field-group-list.component.html +8 -0
- package/lib/template/field-group-list/field-group-list.component.scss +12 -0
- package/lib/template/field-group-list/field-group-list.component.spec.ts +22 -0
- package/lib/template/field-group-list/field-group-list.component.ts +18 -0
- package/lib/template/field-group-template/field-group-template.component.html +33 -0
- package/lib/template/field-group-template/field-group-template.component.scss +8 -0
- package/lib/template/field-group-template/field-group-template.component.spec.ts +22 -0
- package/lib/template/field-group-template/field-group-template.component.ts +168 -0
- package/lib/template/field-value-list/field-value-list.component.html +15 -0
- package/lib/template/field-value-list/field-value-list.component.scss +18 -0
- package/lib/template/field-value-list/field-value-list.component.spec.ts +22 -0
- package/lib/template/field-value-list/field-value-list.component.ts +15 -0
- package/lib/template/inline-dashboard/inline-dashboard.component.html +19 -0
- package/lib/template/inline-dashboard/inline-dashboard.component.scss +31 -0
- package/lib/template/inline-dashboard/inline-dashboard.component.spec.ts +24 -0
- package/lib/template/inline-dashboard/inline-dashboard.component.ts +24 -0
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.html +1 -0
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.scss +0 -0
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.spec.ts +24 -0
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +55 -0
- package/lib/template/list-page/config-ext.json +7 -0
- package/lib/template/list-page/list-page.component.html +1 -0
- package/lib/template/list-page/list-page.component.scss +0 -0
- package/lib/template/list-page/list-page.component.spec.ts +24 -0
- package/lib/template/list-page/list-page.component.ts +13 -0
- package/lib/template/list-view/DefaultViewMeta.ts +220 -0
- package/lib/template/list-view/config-ext.json +8 -0
- package/lib/template/list-view/list-view.component.html +253 -0
- package/lib/template/list-view/list-view.component.scss +169 -0
- package/lib/template/list-view/list-view.component.spec.ts +24 -0
- package/lib/template/list-view/list-view.component.ts +1408 -0
- package/lib/template/list-view/listViewHelpers.ts +87 -0
- package/lib/template/list-view/utils.ts +745 -0
- package/lib/template/multi-reference-readonly/multi-reference-readonly.component.html +4 -0
- package/lib/template/multi-reference-readonly/multi-reference-readonly.component.scss +0 -0
- package/lib/template/multi-reference-readonly/multi-reference-readonly.component.spec.ts +22 -0
- package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +54 -0
- package/lib/template/narrow-wide-form/config-ext.json +8 -0
- package/lib/template/narrow-wide-form/narrow-wide-form.component.html +16 -0
- package/lib/template/narrow-wide-form/narrow-wide-form.component.scss +20 -0
- package/lib/template/narrow-wide-form/narrow-wide-form.component.spec.ts +24 -0
- package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +34 -0
- package/lib/template/one-column/config-ext.json +8 -0
- package/lib/template/one-column/one-column.component.html +11 -0
- package/lib/template/one-column/one-column.component.scss +3 -0
- package/lib/template/one-column/one-column.component.spec.ts +24 -0
- package/lib/template/one-column/one-column.component.ts +34 -0
- package/lib/template/one-column-page/config-ext.json +8 -0
- package/lib/template/one-column-page/one-column-page.component.html +1 -0
- package/lib/template/one-column-page/one-column-page.component.scss +0 -0
- package/lib/template/one-column-page/one-column-page.component.spec.ts +24 -0
- package/lib/template/one-column-page/one-column-page.component.ts +15 -0
- package/lib/template/one-column-tab/config-ext.json +8 -0
- package/lib/template/one-column-tab/one-column-tab.component.html +9 -0
- package/lib/template/one-column-tab/one-column-tab.component.scss +9 -0
- package/lib/template/one-column-tab/one-column-tab.component.ts +34 -0
- package/lib/template/page/page.component.html +12 -0
- package/lib/template/page/page.component.scss +3 -0
- package/lib/template/page/page.component.spec.ts +24 -0
- package/lib/template/page/page.component.ts +68 -0
- package/lib/template/promoted-filters/promoted-filters.component.html +27 -0
- package/lib/template/promoted-filters/promoted-filters.component.scss +7 -0
- package/lib/template/promoted-filters/promoted-filters.component.spec.ts +24 -0
- package/lib/template/promoted-filters/promoted-filters.component.ts +157 -0
- package/lib/template/repeating-structures/repeating-structures.component.html +21 -0
- package/lib/template/repeating-structures/repeating-structures.component.scss +17 -0
- package/lib/template/repeating-structures/repeating-structures.component.spec.ts +24 -0
- package/lib/template/repeating-structures/repeating-structures.component.ts +155 -0
- package/lib/template/simple-table/config-ext.json +7 -0
- package/lib/template/simple-table/simple-table.component.html +13 -0
- package/lib/template/simple-table/simple-table.component.scss +0 -0
- package/lib/template/simple-table/simple-table.component.spec.ts +24 -0
- package/lib/template/simple-table/simple-table.component.ts +171 -0
- package/lib/template/simple-table-manual/helpers.ts +294 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.html +147 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +185 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.spec.ts +24 -0
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +950 -0
- package/lib/template/simple-table-select/simple-table-select.component.html +14 -0
- package/lib/template/simple-table-select/simple-table-select.component.scss +0 -0
- package/lib/template/simple-table-select/simple-table-select.component.spec.ts +24 -0
- package/lib/template/simple-table-select/simple-table-select.component.ts +151 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.html +1 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +0 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.spec.ts +22 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +15 -0
- package/lib/template/sub-tabs/config-ext.json +8 -0
- package/lib/template/sub-tabs/sub-tabs.component.html +12 -0
- package/lib/template/sub-tabs/sub-tabs.component.scss +3 -0
- package/lib/template/sub-tabs/sub-tabs.component.spec.ts +24 -0
- package/lib/template/sub-tabs/sub-tabs.component.ts +76 -0
- package/lib/template/three-column/config-ext.json +8 -0
- package/lib/template/three-column/three-column.component.html +13 -0
- package/lib/template/three-column/three-column.component.scss +16 -0
- package/lib/template/three-column/three-column.component.spec.ts +24 -0
- package/lib/template/three-column/three-column.component.ts +34 -0
- package/lib/template/three-column-page/config-ext.json +8 -0
- package/lib/template/three-column-page/three-column-page.component.html +1 -0
- package/lib/template/three-column-page/three-column-page.component.scss +0 -0
- package/lib/template/three-column-page/three-column-page.component.spec.ts +24 -0
- package/lib/template/three-column-page/three-column-page.component.ts +15 -0
- package/lib/template/two-column/config-ext.json +8 -0
- package/lib/template/two-column/two-column.component.html +16 -0
- package/lib/template/two-column/two-column.component.scss +28 -0
- package/lib/template/two-column/two-column.component.spec.ts +24 -0
- package/lib/template/two-column/two-column.component.ts +34 -0
- package/lib/template/two-column-page/config-ext.json +8 -0
- package/lib/template/two-column-page/two-column-page.component.html +1 -0
- package/lib/template/two-column-page/two-column-page.component.scss +0 -0
- package/lib/template/two-column-page/two-column-page.component.spec.ts +24 -0
- package/lib/template/two-column-page/two-column-page.component.ts +43 -0
- package/lib/template/two-column-tab/config-ext.json +8 -0
- package/lib/template/two-column-tab/two-column-tab.component.html +16 -0
- package/lib/template/two-column-tab/two-column-tab.component.scss +28 -0
- package/lib/template/two-column-tab/two-column-tab.component.spec.ts +24 -0
- package/lib/template/two-column-tab/two-column-tab.component.ts +34 -0
- package/lib/template/utils.ts +23 -0
- package/lib/template/wide-narrow-form/config-ext.json +8 -0
- package/lib/template/wide-narrow-form/wide-narrow-form.component.html +16 -0
- package/lib/template/wide-narrow-form/wide-narrow-form.component.scss +20 -0
- package/lib/template/wide-narrow-form/wide-narrow-form.component.spec.ts +24 -0
- package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +34 -0
- package/lib/template/wide-narrow-page/config-ext.json +8 -0
- package/lib/template/wide-narrow-page/wide-narrow-page.component.html +6 -0
- package/lib/template/wide-narrow-page/wide-narrow-page.component.scss +0 -0
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +61 -0
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +32 -0
- package/lib/template/wss-nav-bar/wss-nav-bar.component.scss +166 -0
- package/lib/template/wss-nav-bar/wss-nav-bar.component.spec.ts +22 -0
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +172 -0
- package/lib/widget/app-announcement/app-announcement.component.html +13 -0
- package/lib/widget/app-announcement/app-announcement.component.scss +21 -0
- package/lib/widget/app-announcement/app-announcement.component.spec.ts +24 -0
- package/lib/widget/app-announcement/app-announcement.component.ts +35 -0
- package/lib/widget/app-announcement/config-ext.json +8 -0
- package/lib/widget/attachment/attachment.component.html +31 -0
- package/lib/widget/attachment/attachment.component.scss +57 -0
- package/lib/widget/attachment/attachment.component.spec.ts +24 -0
- package/lib/widget/attachment/attachment.component.ts +705 -0
- package/lib/widget/attachment/config-ext.json +7 -0
- package/lib/widget/case-history/case-history.component.html +12 -0
- package/lib/widget/case-history/case-history.component.scss +22 -0
- package/lib/widget/case-history/case-history.component.spec.ts +24 -0
- package/lib/widget/case-history/case-history.component.ts +104 -0
- package/lib/widget/case-history/config-ext.json +8 -0
- package/lib/widget/feed-container/config-ext.json +12 -0
- package/lib/widget/feed-container/feed-api.ts +410 -0
- package/lib/widget/feed-container/feed-container.component.html +137 -0
- package/lib/widget/feed-container/feed-container.component.scss +188 -0
- package/lib/widget/feed-container/feed-container.component.spec.ts +24 -0
- package/lib/widget/feed-container/feed-container.component.ts +616 -0
- package/lib/widget/file-utility/config-ext.json +8 -0
- package/lib/widget/file-utility/file-utility.component.html +100 -0
- package/lib/widget/file-utility/file-utility.component.scss +107 -0
- package/lib/widget/file-utility/file-utility.component.spec.ts +24 -0
- package/lib/widget/file-utility/file-utility.component.ts +759 -0
- package/lib/widget/list-utility/list-utility.component.html +32 -0
- package/lib/widget/list-utility/list-utility.component.scss +135 -0
- package/lib/widget/list-utility/list-utility.component.spec.ts +24 -0
- package/lib/widget/list-utility/list-utility.component.ts +47 -0
- package/lib/widget/quick-create/quick-create.component.html +1 -0
- package/lib/widget/quick-create/quick-create.component.scss +0 -0
- package/lib/widget/quick-create/quick-create.component.spec.ts +22 -0
- package/lib/widget/quick-create/quick-create.component.ts +96 -0
- package/lib/widget/todo/config-ext.json +8 -0
- package/lib/widget/todo/todo.component.html +47 -0
- package/lib/widget/todo/todo.component.scss +98 -0
- package/lib/widget/todo/todo.component.spec.ts +24 -0
- package/lib/widget/todo/todo.component.ts +265 -0
- package/lib/widget/utility/utility.component.html +1 -0
- package/lib/widget/utility/utility.component.scss +0 -0
- package/lib/widget/utility/utility.component.spec.ts +24 -0
- package/lib/widget/utility/utility.component.ts +50 -0
- package/package.json +14 -0
|
@@ -0,0 +1,950 @@
|
|
|
1
|
+
/* eslint-disable max-classes-per-file */
|
|
2
|
+
import { Component, OnInit, Input, ViewChild, forwardRef, OnDestroy } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { FormGroup } from '@angular/forms';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
7
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
8
|
+
import { MatInputModule } from '@angular/material/input';
|
|
9
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
10
|
+
import { MatOptionModule } from '@angular/material/core';
|
|
11
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
12
|
+
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
13
|
+
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
14
|
+
import isEqual from 'fast-deep-equal';
|
|
15
|
+
|
|
16
|
+
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
17
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
18
|
+
import { DatapageService } from '@pega/angular-sdk-components';
|
|
19
|
+
import { getReferenceList } from '@pega/angular-sdk-components';
|
|
20
|
+
import { buildFieldsForTable, filterDataByCommonFields, filterDataByDate, getContext } from './helpers';
|
|
21
|
+
import { Utils } from '@pega/angular-sdk-components';
|
|
22
|
+
import { getSeconds } from '@pega/angular-sdk-components';
|
|
23
|
+
|
|
24
|
+
declare const window: any;
|
|
25
|
+
|
|
26
|
+
interface SimpleTableManualProps {
|
|
27
|
+
// If any, enter additional props that only exist on this component
|
|
28
|
+
visibility?: boolean;
|
|
29
|
+
grouping?: any;
|
|
30
|
+
referenceList?: any[];
|
|
31
|
+
children?: any[];
|
|
32
|
+
renderMode?: string;
|
|
33
|
+
presets?: any[];
|
|
34
|
+
label?: string;
|
|
35
|
+
showLabel?: boolean;
|
|
36
|
+
dataPageName?: string;
|
|
37
|
+
contextClass?: string;
|
|
38
|
+
propertyLabel?: string;
|
|
39
|
+
fieldMetadata?: any;
|
|
40
|
+
allowTableEdit?: boolean;
|
|
41
|
+
editMode?: string;
|
|
42
|
+
addAndEditRowsWithin?: any;
|
|
43
|
+
viewForAddAndEditModal?: any;
|
|
44
|
+
editModeConfig?: any;
|
|
45
|
+
displayMode?: string;
|
|
46
|
+
useSeparateViewForEdit: any;
|
|
47
|
+
viewForEditModal: any;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
class Group {
|
|
51
|
+
level = 0;
|
|
52
|
+
parent: Group;
|
|
53
|
+
expanded = true;
|
|
54
|
+
totalCounts = 0;
|
|
55
|
+
get visible(): boolean {
|
|
56
|
+
return !this.parent || (this.parent.visible && this.parent.expanded);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Component({
|
|
61
|
+
selector: 'app-simple-table-manual',
|
|
62
|
+
templateUrl: './simple-table-manual.component.html',
|
|
63
|
+
styleUrls: ['./simple-table-manual.component.scss'],
|
|
64
|
+
standalone: true,
|
|
65
|
+
imports: [
|
|
66
|
+
CommonModule,
|
|
67
|
+
MatTableModule,
|
|
68
|
+
MatButtonModule,
|
|
69
|
+
MatSortModule,
|
|
70
|
+
MatMenuModule,
|
|
71
|
+
MatFormFieldModule,
|
|
72
|
+
MatDatepickerModule,
|
|
73
|
+
MatOptionModule,
|
|
74
|
+
MatSelectModule,
|
|
75
|
+
MatInputModule,
|
|
76
|
+
forwardRef(() => ComponentMapperComponent)
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
80
|
+
@ViewChild(MatSort) sort: MatSort;
|
|
81
|
+
|
|
82
|
+
@Input() pConn$: typeof PConnect;
|
|
83
|
+
@Input() formGroup$: FormGroup;
|
|
84
|
+
|
|
85
|
+
// Used with AngularPConnect
|
|
86
|
+
angularPConnectData: AngularPConnectData = {};
|
|
87
|
+
configProps$: SimpleTableManualProps;
|
|
88
|
+
fields$: any[];
|
|
89
|
+
|
|
90
|
+
bVisible$ = true;
|
|
91
|
+
displayedColumns: string[] = [];
|
|
92
|
+
rowData: MatTableDataSource<any>;
|
|
93
|
+
originalData: any[] = [];
|
|
94
|
+
processedFields: any[] = [];
|
|
95
|
+
fieldDefs: any[] = [];
|
|
96
|
+
requestedReadOnlyMode = false;
|
|
97
|
+
readOnlyMode = false;
|
|
98
|
+
editableMode: boolean;
|
|
99
|
+
menuIconOverride$: string;
|
|
100
|
+
pageReference: string;
|
|
101
|
+
referenceList: any;
|
|
102
|
+
contextClass: any;
|
|
103
|
+
showAddRowButton: boolean;
|
|
104
|
+
prevReferenceList: any[] = [];
|
|
105
|
+
elementsData: MatTableDataSource<any>;
|
|
106
|
+
rawFields: any;
|
|
107
|
+
label?: string = '';
|
|
108
|
+
searchIcon$: string;
|
|
109
|
+
|
|
110
|
+
bShowSearch$ = false;
|
|
111
|
+
bColumnReorder$ = false;
|
|
112
|
+
bGrouping$ = false;
|
|
113
|
+
|
|
114
|
+
perfFilter: string;
|
|
115
|
+
searchFilter: string;
|
|
116
|
+
|
|
117
|
+
menuSvgIcon$: string;
|
|
118
|
+
arrowSvgIcon$ = '';
|
|
119
|
+
arrowDownSvgIcon$: string;
|
|
120
|
+
arrowUpSvgIcon$: string;
|
|
121
|
+
|
|
122
|
+
filterSvgIcon$: string;
|
|
123
|
+
filterOnSvgIcon$: string;
|
|
124
|
+
groupBySvgIcon$: string;
|
|
125
|
+
|
|
126
|
+
groupByColumns$: string[] = [];
|
|
127
|
+
compareType: string;
|
|
128
|
+
compareRef: string;
|
|
129
|
+
arrowDirection = 'down';
|
|
130
|
+
filterByColumns: any[] = [];
|
|
131
|
+
currentFilterRefData: any;
|
|
132
|
+
filterContainsLabel$ = '';
|
|
133
|
+
filterContainsType$ = 'contains';
|
|
134
|
+
filterContainsValue$: any;
|
|
135
|
+
bShowFilterPopover$ = false;
|
|
136
|
+
bContains$ = true;
|
|
137
|
+
bDateTime$ = false;
|
|
138
|
+
|
|
139
|
+
bIsDate$ = false;
|
|
140
|
+
bIsDateTime$ = false;
|
|
141
|
+
bIsTime$ = false;
|
|
142
|
+
currentFilterImageEl: any;
|
|
143
|
+
|
|
144
|
+
arFilterMainButtons$: any[] = [];
|
|
145
|
+
arFilterSecondaryButtons$: any[] = [];
|
|
146
|
+
selectionMode: string;
|
|
147
|
+
singleSelectionMode: boolean;
|
|
148
|
+
multiSelectionMode: boolean;
|
|
149
|
+
rowID: any;
|
|
150
|
+
response: any;
|
|
151
|
+
compositeKeys: any;
|
|
152
|
+
parameters: any;
|
|
153
|
+
allowEditingInModal = false;
|
|
154
|
+
defaultView: any;
|
|
155
|
+
referenceListStr: any;
|
|
156
|
+
bUseSeparateViewForEdit: any;
|
|
157
|
+
editView: any;
|
|
158
|
+
settingsSvgIcon$: string;
|
|
159
|
+
|
|
160
|
+
constructor(
|
|
161
|
+
private angularPConnect: AngularPConnectService,
|
|
162
|
+
private utils: Utils,
|
|
163
|
+
private dataPageService: DatapageService
|
|
164
|
+
) {}
|
|
165
|
+
|
|
166
|
+
ngOnInit(): void {
|
|
167
|
+
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
168
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
169
|
+
this.configProps$ = this.pConn$.getConfigProps() as SimpleTableManualProps;
|
|
170
|
+
// Then, continue on with other initialization
|
|
171
|
+
this.menuIconOverride$ = this.utils.getImageSrc('trash', this.utils.getSDKStaticContentUrl());
|
|
172
|
+
// call checkAndUpdate when initializing
|
|
173
|
+
this.checkAndUpdate();
|
|
174
|
+
this.filterSvgIcon$ = this.utils.getImageSrc('filter', this.utils.getSDKStaticContentUrl());
|
|
175
|
+
this.filterOnSvgIcon$ = this.utils.getImageSrc('filter-on', this.utils.getSDKStaticContentUrl());
|
|
176
|
+
this.groupBySvgIcon$ = this.utils.getImageSrc('row', this.utils.getSDKStaticContentUrl());
|
|
177
|
+
this.bGrouping$ = this.utils.getBooleanValue(this.configProps$.grouping);
|
|
178
|
+
this.menuSvgIcon$ = this.utils.getImageSrc('more', this.utils.getSDKStaticContentUrl());
|
|
179
|
+
|
|
180
|
+
this.arFilterMainButtons$.push({ actionID: 'submit', jsAction: 'submit', name: 'Submit' });
|
|
181
|
+
this.arFilterSecondaryButtons$.push({ actionID: 'cancel', jsAction: 'cancel', name: 'Cancel' });
|
|
182
|
+
|
|
183
|
+
this.searchIcon$ = this.utils.getImageSrc('search', this.utils.getSDKStaticContentUrl());
|
|
184
|
+
|
|
185
|
+
this.settingsSvgIcon$ = this.utils.getImageSrc('more', this.utils.getSDKStaticContentUrl());
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
ngOnDestroy(): void {
|
|
189
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
190
|
+
this.angularPConnectData.unsubscribeFn();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
checkAndUpdate() {
|
|
195
|
+
// Should always check the bridge to see if the component should
|
|
196
|
+
// update itself (re-render)
|
|
197
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
198
|
+
|
|
199
|
+
// ONLY call updateSelf when the component should update
|
|
200
|
+
if (bUpdateSelf) {
|
|
201
|
+
this.updateSelf();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// updateSelf
|
|
206
|
+
updateSelf(): void {
|
|
207
|
+
// moved this from ngOnInit() and call this from there instead...
|
|
208
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as SimpleTableManualProps;
|
|
209
|
+
|
|
210
|
+
if (this.configProps$.visibility != null) {
|
|
211
|
+
// eslint-disable-next-line no-multi-assign
|
|
212
|
+
this.bVisible$ = this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// NOTE: getConfigProps() has each child.config with datasource and value undefined
|
|
216
|
+
// but getRawMetadata() has each child.config with datasource and value showing their unresolved values (ex: "@P thePropName")
|
|
217
|
+
// We need to use the prop name as the "glue" to tie the Angular Material table dataSource, displayColumns and data together.
|
|
218
|
+
// So, in the code below, we'll use the unresolved config.value (but replacing the space with an underscore to keep things happy)
|
|
219
|
+
const rawMetadata: any = this.pConn$.getRawMetadata();
|
|
220
|
+
|
|
221
|
+
// Adapted from Nebula
|
|
222
|
+
const {
|
|
223
|
+
referenceList = [], // if referenceList not in configProps$, default to empy list
|
|
224
|
+
renderMode,
|
|
225
|
+
children, // destructure children into an array var: "resolvedFields"
|
|
226
|
+
presets,
|
|
227
|
+
allowTableEdit,
|
|
228
|
+
label: labelProp,
|
|
229
|
+
propertyLabel,
|
|
230
|
+
fieldMetadata,
|
|
231
|
+
editMode,
|
|
232
|
+
addAndEditRowsWithin,
|
|
233
|
+
viewForAddAndEditModal,
|
|
234
|
+
editModeConfig,
|
|
235
|
+
displayMode,
|
|
236
|
+
useSeparateViewForEdit,
|
|
237
|
+
viewForEditModal
|
|
238
|
+
} = this.configProps$;
|
|
239
|
+
|
|
240
|
+
this.referenceListStr = getContext(this.pConn$).referenceListStr;
|
|
241
|
+
this.label = labelProp || propertyLabel;
|
|
242
|
+
this.parameters = fieldMetadata?.datasource?.parameters;
|
|
243
|
+
|
|
244
|
+
const hideAddRow = allowTableEdit === false;
|
|
245
|
+
const hideDeleteRow = allowTableEdit === false;
|
|
246
|
+
let { contextClass } = this.configProps$;
|
|
247
|
+
this.referenceList = referenceList;
|
|
248
|
+
if (!contextClass) {
|
|
249
|
+
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
|
|
250
|
+
let listName = this.pConn$.getComponentConfig().referenceList;
|
|
251
|
+
listName = PCore.getAnnotationUtils().getPropertyName(listName);
|
|
252
|
+
// @ts-ignore - Property 'getFieldMetadata' is private and only accessible within class 'C11nEnv'
|
|
253
|
+
contextClass = this.pConn$.getFieldMetadata(listName)?.pageClass;
|
|
254
|
+
}
|
|
255
|
+
this.contextClass = contextClass;
|
|
256
|
+
|
|
257
|
+
const resolvedFields = children?.[0]?.children || presets?.[0].children?.[0].children;
|
|
258
|
+
// get raw config as @P and other annotations are processed and don't appear in the resolved config.
|
|
259
|
+
// Destructure "raw" children into array var: "rawFields"
|
|
260
|
+
// NOTE: when config.listType == "associated", the property can be found in either
|
|
261
|
+
// config.value (ex: "@P .DeclarantChoice") or
|
|
262
|
+
// config.datasource (ex: "@ASSOCIATED .DeclarantChoice")
|
|
263
|
+
// Neither of these appear in the resolved (this.configProps$)
|
|
264
|
+
const rawConfig = rawMetadata?.config;
|
|
265
|
+
const rawFields = rawConfig?.children?.[0]?.children || rawConfig?.presets?.[0].children?.[0]?.children;
|
|
266
|
+
this.rawFields = rawFields;
|
|
267
|
+
// At this point, fields has resolvedFields and rawFields we can use
|
|
268
|
+
|
|
269
|
+
// start of from Nebula
|
|
270
|
+
// get context name and referenceList which will be used to prepare config of PConnect
|
|
271
|
+
// const { contextName, referenceListStr, pageReferenceForRows } = getContext(this.pConn$);
|
|
272
|
+
|
|
273
|
+
const resolvedList = getReferenceList(this.pConn$);
|
|
274
|
+
this.pageReference = `${this.pConn$.getPageReference()}${resolvedList}`;
|
|
275
|
+
this.pConn$.setReferenceList(resolvedList);
|
|
276
|
+
|
|
277
|
+
// This gives up the "properties" we need to map to row/column values later
|
|
278
|
+
// const processedData = populateRowKey(referenceList);
|
|
279
|
+
|
|
280
|
+
this.requestedReadOnlyMode = renderMode === 'ReadOnly';
|
|
281
|
+
this.readOnlyMode = renderMode === 'ReadOnly';
|
|
282
|
+
this.editableMode = renderMode === 'Editable';
|
|
283
|
+
const isDisplayModeEnabled = displayMode === 'DISPLAY_ONLY';
|
|
284
|
+
this.showAddRowButton = !this.readOnlyMode && !hideAddRow;
|
|
285
|
+
this.allowEditingInModal =
|
|
286
|
+
(editMode ? editMode === 'modal' : addAndEditRowsWithin === 'modal') && !(renderMode === 'ReadOnly' || isDisplayModeEnabled);
|
|
287
|
+
const showDeleteButton = this.editableMode && !hideDeleteRow;
|
|
288
|
+
this.defaultView = editModeConfig ? editModeConfig.defaultView : viewForAddAndEditModal;
|
|
289
|
+
this.bUseSeparateViewForEdit = editModeConfig ? editModeConfig.useSeparateViewForEdit : useSeparateViewForEdit;
|
|
290
|
+
this.editView = editModeConfig ? editModeConfig.editView : viewForEditModal;
|
|
291
|
+
// const showDeleteButton = !this.readOnlyMode && !hideDeleteRow;
|
|
292
|
+
|
|
293
|
+
// Nebula has other handling for isReadOnlyMode but has Cosmos-specific code
|
|
294
|
+
// so ignoring that for now...
|
|
295
|
+
// fieldDefs will be an array where each entry will have a "name" which will be the
|
|
296
|
+
// "resolved" property name (that we can use as the colId) though it's not really
|
|
297
|
+
// resolved. The buildFieldsForTable helper just removes the "@P " (which is what
|
|
298
|
+
// Nebula does). It will also have the "label", and "meta" contains the original,
|
|
299
|
+
// unchanged config info. For now, much of the info here is carried over from
|
|
300
|
+
// Nebula and we may not end up using it all.
|
|
301
|
+
this.fieldDefs = buildFieldsForTable(rawFields, resolvedFields, showDeleteButton);
|
|
302
|
+
|
|
303
|
+
// end of from Nebula
|
|
304
|
+
|
|
305
|
+
// Here, we use the "name" field in fieldDefs since that has the assoicated property
|
|
306
|
+
// (if one exists for the field). If no "name", use "cellRenderer" (typically get DELETE_ICON)
|
|
307
|
+
// for our columns.
|
|
308
|
+
this.displayedColumns = this.fieldDefs?.map(field => {
|
|
309
|
+
return field.name ? field.name : field.cellRenderer;
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// And now we can process the resolvedFields to add in the "name"
|
|
313
|
+
// from from the fieldDefs. This "name" is the value that
|
|
314
|
+
// we'll share to connect things together in the table.
|
|
315
|
+
|
|
316
|
+
this.processedFields = [];
|
|
317
|
+
|
|
318
|
+
this.processedFields = resolvedFields.map((field, i) => {
|
|
319
|
+
field.config.name = this.displayedColumns[i]; // .config["value"].replace(/ ./g,"_"); // replace space dot with underscore
|
|
320
|
+
return field;
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// for adding rows to table when editable and not modal view
|
|
324
|
+
if (this.prevReferenceList.length !== this.referenceList.length && this.editableMode && !this.allowEditingInModal) {
|
|
325
|
+
this.buildElementsForTable();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// for edit and adding rows in modal view and to generate readonly list
|
|
329
|
+
if (!isEqual(this.prevReferenceList, this.referenceList) && (this.readOnlyMode || this.allowEditingInModal)) {
|
|
330
|
+
this.generateRowsData();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
this.prevReferenceList = this.referenceList;
|
|
334
|
+
|
|
335
|
+
// These are the data structures referred to in the html file.
|
|
336
|
+
// These are the relationships that make the table work
|
|
337
|
+
// displayedColumns: key/value pairs where key is order of column and
|
|
338
|
+
// value is the property shown in that column. Ex: 1: "FirstName"
|
|
339
|
+
// processedFields: key/value pairs where each key is order of column
|
|
340
|
+
// and each value is an object of more detailed information about that
|
|
341
|
+
// column.
|
|
342
|
+
// rowData: array of each row's key/value pairs. Inside each row,
|
|
343
|
+
// each key is an entry in displayedColumns: ex: "FirstName": "Charles"
|
|
344
|
+
// Ex: { 1: {config: {label: "First Name", readOnly: true: name: "FirstName"}}, type: "TextInput" }
|
|
345
|
+
// The "type" indicates the type of component that should be used for editing (when editing is enabled)
|
|
346
|
+
//
|
|
347
|
+
// Note that the "property" shown in the column ("FirstName" in the above examples) is what
|
|
348
|
+
// ties the 3 data structures together.
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
getResultsText() {
|
|
352
|
+
const recordsCount = this.readOnlyMode ? this.rowData?.data.length : this.referenceList?.length;
|
|
353
|
+
return `${recordsCount} result${recordsCount > 1 ? 's' : ''}`;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
sortCompare(a, b): number {
|
|
357
|
+
let aValue = a[this.compareRef];
|
|
358
|
+
let bValue = b[this.compareRef];
|
|
359
|
+
|
|
360
|
+
if (this.compareType == 'Date' || this.compareType == 'DateTime') {
|
|
361
|
+
aValue = getSeconds(aValue);
|
|
362
|
+
bValue = getSeconds(bValue);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (this.compareRef == 'pxRefObjectInsName') {
|
|
366
|
+
const result = this.compareByColumnPxRefObjectInsName(aValue, bValue);
|
|
367
|
+
if (result !== undefined) {
|
|
368
|
+
return result;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (aValue === bValue) {
|
|
373
|
+
return 0;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (this.arrowDirection === 'up') return aValue - bValue;
|
|
377
|
+
if (this.arrowDirection === 'down') return bValue - aValue;
|
|
378
|
+
|
|
379
|
+
return 0;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
compareByColumnPxRefObjectInsName(aValue, bValue) {
|
|
383
|
+
const prefixX = aValue.split('-');
|
|
384
|
+
const prefixY = bValue.split('-');
|
|
385
|
+
switch (this.arrowDirection) {
|
|
386
|
+
case 'up':
|
|
387
|
+
if (prefixX[0] !== prefixY[0]) {
|
|
388
|
+
if (prefixX[0] < prefixY[0]) return -1;
|
|
389
|
+
if (prefixX[0] > prefixY[0]) return 1;
|
|
390
|
+
return 0;
|
|
391
|
+
}
|
|
392
|
+
return prefixX[1] - prefixY[1];
|
|
393
|
+
case 'down':
|
|
394
|
+
if (prefixX[0] !== prefixY[0]) {
|
|
395
|
+
if (prefixX[0] > prefixY[0]) return -1;
|
|
396
|
+
if (prefixX[0] < prefixY[0]) return 1;
|
|
397
|
+
return 0;
|
|
398
|
+
}
|
|
399
|
+
return prefixY[1] - prefixX[1];
|
|
400
|
+
default:
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return undefined;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
updateFilterDisplay(type) {
|
|
408
|
+
switch (type) {
|
|
409
|
+
case 'Date':
|
|
410
|
+
this.filterContainsType$ = 'notequal';
|
|
411
|
+
this.bContains$ = false;
|
|
412
|
+
this.bDateTime$ = true;
|
|
413
|
+
this.bIsDate$ = true;
|
|
414
|
+
this.bIsDateTime$ = false;
|
|
415
|
+
this.bIsTime$ = false;
|
|
416
|
+
break;
|
|
417
|
+
case 'DateTime':
|
|
418
|
+
this.filterContainsType$ = 'notequal';
|
|
419
|
+
this.bContains$ = false;
|
|
420
|
+
this.bDateTime$ = true;
|
|
421
|
+
this.bIsDate$ = false;
|
|
422
|
+
this.bIsDateTime$ = true;
|
|
423
|
+
this.bIsTime$ = false;
|
|
424
|
+
break;
|
|
425
|
+
case 'Time':
|
|
426
|
+
this.filterContainsType$ = 'notequal';
|
|
427
|
+
this.bContains$ = false;
|
|
428
|
+
this.bDateTime$ = true;
|
|
429
|
+
this.bIsDate$ = false;
|
|
430
|
+
this.bIsDateTime$ = false;
|
|
431
|
+
this.bIsTime$ = true;
|
|
432
|
+
break;
|
|
433
|
+
default:
|
|
434
|
+
this.filterContainsType$ = 'contains';
|
|
435
|
+
this.bContains$ = true;
|
|
436
|
+
this.bDateTime$ = false;
|
|
437
|
+
this.bIsDate$ = false;
|
|
438
|
+
this.bIsDateTime$ = false;
|
|
439
|
+
this.bIsTime$ = false;
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
_filter(event, columnData) {
|
|
445
|
+
// add clickAway listener
|
|
446
|
+
window.addEventListener('mouseup', this._clickAway.bind(this));
|
|
447
|
+
|
|
448
|
+
this.currentFilterRefData = columnData;
|
|
449
|
+
this.filterContainsLabel$ = columnData.config.label;
|
|
450
|
+
|
|
451
|
+
setTimeout(() => {
|
|
452
|
+
this.updateFilterDisplay(columnData.type);
|
|
453
|
+
|
|
454
|
+
this.updateFilterVarsWithCurrent(columnData);
|
|
455
|
+
|
|
456
|
+
this.bShowFilterPopover$ = true;
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
_clickAway(event: any) {
|
|
461
|
+
let bInPopUp = false;
|
|
462
|
+
|
|
463
|
+
// run through list of elements in path, if menu not in th path, then want to
|
|
464
|
+
// hide (toggle) the menu
|
|
465
|
+
const eventPath = event.path;
|
|
466
|
+
for (let eventIndex = 0; eventIndex < eventPath.length; eventIndex++) {
|
|
467
|
+
if (
|
|
468
|
+
eventPath[eventIndex].className == 'psdk-modal-file-top' ||
|
|
469
|
+
eventPath[eventIndex].tagName == 'BUTTON' ||
|
|
470
|
+
eventPath[eventIndex].tagName == 'MAT-OPTION' ||
|
|
471
|
+
eventPath[eventIndex].tagName == 'MAT-INPUT'
|
|
472
|
+
) {
|
|
473
|
+
bInPopUp = true;
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (!bInPopUp) {
|
|
478
|
+
// this.bShowFilterPopover$ = false;
|
|
479
|
+
|
|
480
|
+
window.removeEventListener('mouseup', this._clickAway.bind(this));
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
_filterContainsType(event) {
|
|
485
|
+
this.filterContainsType$ = event.value;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
_filterContainsValue(event) {
|
|
489
|
+
this.filterContainsValue$ = event.target.value;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
_filterContainsDateValue(event, value) {
|
|
493
|
+
this.filterContainsValue$ = value;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
_filterContainsDateTimeValue(event) {
|
|
497
|
+
this.filterContainsValue$ = event.target.value;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
_filterContainsTimeValue(event) {
|
|
501
|
+
this.filterContainsValue$ = event.target.value;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
_onFilterActionButtonClick(event: any) {
|
|
505
|
+
// modal buttons
|
|
506
|
+
switch (event.action) {
|
|
507
|
+
case 'cancel':
|
|
508
|
+
this.currentFilterRefData = [];
|
|
509
|
+
break;
|
|
510
|
+
case 'submit':
|
|
511
|
+
this.updateFilterWithInfo();
|
|
512
|
+
this.filterSortGroupBy();
|
|
513
|
+
break;
|
|
514
|
+
default:
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
this.bShowFilterPopover$ = false;
|
|
519
|
+
|
|
520
|
+
window.removeEventListener('mouseup', this._clickAway.bind(this));
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
updateFilterWithInfo() {
|
|
524
|
+
let bFound = false;
|
|
525
|
+
for (const filterObj of this.filterByColumns) {
|
|
526
|
+
if (filterObj.ref === this.currentFilterRefData.config.name) {
|
|
527
|
+
filterObj.type = this.currentFilterRefData.type;
|
|
528
|
+
filterObj.containsFilter = this.filterContainsType$;
|
|
529
|
+
filterObj.containsFilterValue = this.filterContainsValue$;
|
|
530
|
+
|
|
531
|
+
bFound = true;
|
|
532
|
+
break;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
if (!bFound) {
|
|
537
|
+
// add in
|
|
538
|
+
const filterObj: any = {};
|
|
539
|
+
filterObj.ref = this.currentFilterRefData.config.name;
|
|
540
|
+
filterObj.type = this.currentFilterRefData.type;
|
|
541
|
+
filterObj.containsFilter = this.filterContainsType$;
|
|
542
|
+
filterObj.containsFilterValue = this.filterContainsValue$;
|
|
543
|
+
|
|
544
|
+
this.filterByColumns.push(filterObj);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// iterate through filters and update filterOn icon
|
|
548
|
+
for (const filterObj of this.filterByColumns) {
|
|
549
|
+
const containsFilterValue = filterObj.containsFilterValue;
|
|
550
|
+
const containsFilter = filterObj.containsFilter;
|
|
551
|
+
const filterRef = filterObj.ref;
|
|
552
|
+
const filterIndex = this.displayedColumns.indexOf(filterRef);
|
|
553
|
+
const arFilterImg = document.getElementsByName('filterOnIcon');
|
|
554
|
+
const filterImg: any = arFilterImg[filterIndex];
|
|
555
|
+
if (containsFilterValue == '' && containsFilter != 'null' && containsFilter != 'notnull') {
|
|
556
|
+
// clear icon
|
|
557
|
+
filterImg.src = '';
|
|
558
|
+
} else {
|
|
559
|
+
// show icon
|
|
560
|
+
filterImg.src = this.filterOnSvgIcon$;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
updateFilterVarsWithCurrent(columnData) {
|
|
566
|
+
// find current ref, if exists, move data to variable to display
|
|
567
|
+
|
|
568
|
+
let bFound = false;
|
|
569
|
+
for (const filterObj of this.filterByColumns) {
|
|
570
|
+
if (filterObj.ref === this.currentFilterRefData.config.name) {
|
|
571
|
+
this.filterContainsType$ = filterObj.containsFilter;
|
|
572
|
+
this.filterContainsValue$ = filterObj.containsFilterValue;
|
|
573
|
+
|
|
574
|
+
bFound = true;
|
|
575
|
+
break;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
if (!bFound) {
|
|
580
|
+
switch (columnData.type) {
|
|
581
|
+
case 'Date':
|
|
582
|
+
case 'DateTime':
|
|
583
|
+
case 'Time':
|
|
584
|
+
this.filterContainsType$ = 'notequal';
|
|
585
|
+
break;
|
|
586
|
+
default:
|
|
587
|
+
this.filterContainsType$ = 'contains';
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
this.filterContainsValue$ = '';
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
filterData(item: any) {
|
|
596
|
+
let bKeep = true;
|
|
597
|
+
for (const filterObj of this.filterByColumns) {
|
|
598
|
+
if (filterObj.containsFilterValue != '' || filterObj.containsFilter == 'null' || filterObj.containsFilter == 'notnull') {
|
|
599
|
+
switch (filterObj.type) {
|
|
600
|
+
case 'Date':
|
|
601
|
+
case 'DateTime':
|
|
602
|
+
case 'Time':
|
|
603
|
+
bKeep = filterDataByDate(item, filterObj);
|
|
604
|
+
break;
|
|
605
|
+
default:
|
|
606
|
+
bKeep = filterDataByCommonFields(item, filterObj);
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// if don't keep stop filtering
|
|
612
|
+
if (!bKeep) {
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
return bKeep;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
filterSortGroupBy() {
|
|
621
|
+
let theData = this.originalData.slice();
|
|
622
|
+
|
|
623
|
+
// last filter config data is global
|
|
624
|
+
theData = theData.filter(this.filterData.bind(this));
|
|
625
|
+
|
|
626
|
+
// last sort config data is global
|
|
627
|
+
theData.sort(this.sortCompare.bind(this));
|
|
628
|
+
this.rowData.data = theData;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
_headerSortClick(event, columnData) {
|
|
632
|
+
// images 0 - filter, 1 - arrow, 2 - more
|
|
633
|
+
|
|
634
|
+
/** Commenting this code for now as it is giving errors not sure if it ever worked */
|
|
635
|
+
// let arrowImage = event.srcElement.getElementsByTagName('img')[1];
|
|
636
|
+
// let arrowAttr = arrowImage.getAttribute('arrow');
|
|
637
|
+
|
|
638
|
+
// this.clearOutArrows(event, columnData);
|
|
639
|
+
|
|
640
|
+
// switch (arrowAttr) {
|
|
641
|
+
// case 'up':
|
|
642
|
+
// arrowImage.src = this.arrowDownSvgIcon$;
|
|
643
|
+
// arrowImage.setAttribute('arrow', 'down');
|
|
644
|
+
// break;
|
|
645
|
+
// case 'down':
|
|
646
|
+
// arrowImage.src = '';
|
|
647
|
+
// arrowImage.setAttribute('arrow', 'none');
|
|
648
|
+
// break;
|
|
649
|
+
// default:
|
|
650
|
+
// arrowImage.src = this.arrowUpSvgIcon$;
|
|
651
|
+
// arrowImage.setAttribute('arrow', 'up');
|
|
652
|
+
// break;
|
|
653
|
+
// }
|
|
654
|
+
|
|
655
|
+
this.compareType = columnData.type;
|
|
656
|
+
this.compareRef = columnData.config.name;
|
|
657
|
+
// this.arrowDirection = arrowImage.getAttribute('arrow');
|
|
658
|
+
this.arrowDirection = this.arrowDirection === 'up' ? 'down' : 'up';
|
|
659
|
+
|
|
660
|
+
this.filterSortGroupBy();
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
_showUnGroupBy(columnData): boolean {
|
|
664
|
+
for (const val of this.groupByColumns$) {
|
|
665
|
+
if (val == columnData.config.name) {
|
|
666
|
+
return true;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
return false;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
_groupBy(event, columnData) {
|
|
674
|
+
this.checkGroupByColumn(columnData.config.name, true);
|
|
675
|
+
|
|
676
|
+
this.filterSortGroupBy();
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
_unGroupBy(event, columnData) {
|
|
680
|
+
// event.stopPropagation();
|
|
681
|
+
this.checkGroupByColumn(columnData.config.name, false);
|
|
682
|
+
|
|
683
|
+
this.filterSortGroupBy();
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
checkGroupByColumn(field, add) {
|
|
687
|
+
let found: number | null = null;
|
|
688
|
+
for (const column of this.groupByColumns$) {
|
|
689
|
+
if (column === field) {
|
|
690
|
+
found = this.groupByColumns$.indexOf(column, 0);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
if (found != null && found >= 0) {
|
|
694
|
+
if (!add) {
|
|
695
|
+
this.groupByColumns$.splice(found, 1);
|
|
696
|
+
}
|
|
697
|
+
} else if (add) {
|
|
698
|
+
this.groupByColumns$.push(field);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
_getGroupName(fieldName) {
|
|
703
|
+
for (let fieldIndex = 0; fieldIndex < this.fields$.length; fieldIndex++) {
|
|
704
|
+
const field = this.fields$[fieldIndex];
|
|
705
|
+
if (field.config.name == fieldName) {
|
|
706
|
+
return field.config.label;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
return '';
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
addGroups(data: any[], groupByColumns: string[]): any[] {
|
|
713
|
+
const rootGroup = new Group();
|
|
714
|
+
rootGroup.expanded = true;
|
|
715
|
+
return this.getSublevel(data, 0, groupByColumns, rootGroup);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
getSublevel(data: any[], level: number, groupByColumns: string[], parent: Group): any[] {
|
|
719
|
+
if (level >= groupByColumns.length) {
|
|
720
|
+
return data;
|
|
721
|
+
}
|
|
722
|
+
const groups = this.uniqueBy(
|
|
723
|
+
data.map(row => {
|
|
724
|
+
const result = new Group();
|
|
725
|
+
result.level = level + 1;
|
|
726
|
+
result.parent = parent;
|
|
727
|
+
for (let i = 0; i <= level; i++) {
|
|
728
|
+
result[groupByColumns[i]] = row[groupByColumns[i]];
|
|
729
|
+
}
|
|
730
|
+
return result;
|
|
731
|
+
}),
|
|
732
|
+
JSON.stringify
|
|
733
|
+
);
|
|
734
|
+
|
|
735
|
+
const currentColumn = groupByColumns[level];
|
|
736
|
+
let subGroups: any = [];
|
|
737
|
+
groups.forEach(group => {
|
|
738
|
+
const rowsInGroup = data.filter(row => group[currentColumn] === row[currentColumn]);
|
|
739
|
+
group.totalCounts = rowsInGroup.length;
|
|
740
|
+
const subGroup = this.getSublevel(rowsInGroup, level + 1, groupByColumns, group);
|
|
741
|
+
subGroup.unshift(group);
|
|
742
|
+
subGroups = subGroups.concat(subGroup);
|
|
743
|
+
});
|
|
744
|
+
return subGroups;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
uniqueBy(a, key) {
|
|
748
|
+
const seen = {};
|
|
749
|
+
return a.filter(item => {
|
|
750
|
+
const k = key(item);
|
|
751
|
+
// eslint-disable-next-line no-return-assign, no-prototype-builtins
|
|
752
|
+
return seen.hasOwnProperty(k) ? false : (seen[k] = true);
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
isGroup(index, item): boolean {
|
|
757
|
+
return item.level;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
_groupHeaderClick(row) {
|
|
761
|
+
row.expanded = !row.expanded;
|
|
762
|
+
// this.repeatList$.filter = "";
|
|
763
|
+
this.perfFilter = performance.now().toString();
|
|
764
|
+
this.rowData.filter = this.perfFilter;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// below is for grid row grouping
|
|
768
|
+
customFilterPredicate(data: any | Group, filter: string): boolean {
|
|
769
|
+
return data instanceof Group ? data.visible : this.getDataRowVisibleWithFilter(data, filter);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
getDataRowVisible(data: any): boolean {
|
|
773
|
+
const groupRows = this.rowData.data.filter(row => {
|
|
774
|
+
if (!(row instanceof Group)) {
|
|
775
|
+
return false;
|
|
776
|
+
}
|
|
777
|
+
let match = true;
|
|
778
|
+
this.groupByColumns$.forEach(column => {
|
|
779
|
+
if (!row[column] || !data[column] || row[column] !== data[column]) {
|
|
780
|
+
match = false;
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
return match;
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
if (groupRows.length === 0) {
|
|
787
|
+
return true;
|
|
788
|
+
}
|
|
789
|
+
const parent = groupRows[0] as Group;
|
|
790
|
+
return parent.visible && parent.expanded;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
getDataRowVisibleWithFilter(data, filter) {
|
|
794
|
+
// fist check if row is visible with grouping
|
|
795
|
+
let bVisible = this.getDataRowVisible(data);
|
|
796
|
+
|
|
797
|
+
if (bVisible && filter && filter != '' && filter != this.perfFilter) {
|
|
798
|
+
// now check if row is filtered.
|
|
799
|
+
|
|
800
|
+
// assume not there unless we find it
|
|
801
|
+
bVisible = false;
|
|
802
|
+
for (const col of this.displayedColumns) {
|
|
803
|
+
// filter is lower case
|
|
804
|
+
if (data[col] && data[col].toString().toLowerCase().indexOf(filter) >= 0) {
|
|
805
|
+
bVisible = true;
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
return bVisible;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
getDisplayColumns(fields = []) {
|
|
815
|
+
return fields.map((field: any) => {
|
|
816
|
+
let theField = field.config.value.substring(field.config.value.indexOf(' ') + 1);
|
|
817
|
+
if (theField.indexOf('.') == 0) {
|
|
818
|
+
theField = theField.substring(1);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
return theField;
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
_getIconStyle(level): string {
|
|
826
|
+
let sReturn = '';
|
|
827
|
+
let nLevel = parseInt(level, 10);
|
|
828
|
+
nLevel--;
|
|
829
|
+
nLevel *= 15;
|
|
830
|
+
sReturn = `padding-left: ${nLevel}px; vertical-align: middle`;
|
|
831
|
+
|
|
832
|
+
return sReturn;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// Callback passed when subscribing to store change
|
|
836
|
+
onStateChange() {
|
|
837
|
+
this.checkAndUpdate();
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// return the value that should be shown as the contents for the given row data
|
|
841
|
+
// of the given row field
|
|
842
|
+
getRowValue(inRowData: Object, inColKey: string): any {
|
|
843
|
+
// See what data (if any) we have to display
|
|
844
|
+
const refKeys: string[] = inColKey.split('.');
|
|
845
|
+
let valBuilder = inRowData;
|
|
846
|
+
for (const key of refKeys) {
|
|
847
|
+
valBuilder = valBuilder[key];
|
|
848
|
+
}
|
|
849
|
+
return valBuilder;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
generateRowsData() {
|
|
853
|
+
const { dataPageName, referenceList } = this.configProps$;
|
|
854
|
+
const context = this.pConn$.getContextName();
|
|
855
|
+
// if dataPageName property value exists then make a datapage fetch call and get the list of data.
|
|
856
|
+
if (dataPageName) {
|
|
857
|
+
this.dataPageService.getDataPageData(dataPageName, this.parameters, context).then(listData => {
|
|
858
|
+
const data = this.formatRowsData(listData);
|
|
859
|
+
this.originalData = data;
|
|
860
|
+
this.rowData = new MatTableDataSource(data);
|
|
861
|
+
});
|
|
862
|
+
} else {
|
|
863
|
+
// The referenceList prop has the JSON data for each row to be displayed
|
|
864
|
+
// in the table. So, iterate over referenceList to create the dataRows that
|
|
865
|
+
// we're using as the table's dataSource
|
|
866
|
+
const data = this.formatRowsData(referenceList);
|
|
867
|
+
this.originalData = data;
|
|
868
|
+
this.rowData = new MatTableDataSource(data);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
formatRowsData(data) {
|
|
873
|
+
return data?.map(item => {
|
|
874
|
+
return this.displayedColumns.reduce((dataForRow, colKey) => {
|
|
875
|
+
dataForRow[colKey] = this.getRowValue(item, colKey);
|
|
876
|
+
return dataForRow;
|
|
877
|
+
}, {});
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
addRecord() {
|
|
882
|
+
if (this.allowEditingInModal && this.defaultView) {
|
|
883
|
+
this.pConn$
|
|
884
|
+
.getActionsApi()
|
|
885
|
+
.openEmbeddedDataModal(
|
|
886
|
+
this.defaultView,
|
|
887
|
+
this.pConn$,
|
|
888
|
+
this.referenceListStr,
|
|
889
|
+
this.referenceList.length,
|
|
890
|
+
PCore.getConstants().RESOURCE_STATUS.CREATE
|
|
891
|
+
);
|
|
892
|
+
} else if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
893
|
+
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length, this.pageReference);
|
|
894
|
+
} else {
|
|
895
|
+
// @ts-ignore - second parameter "pageRef" is optional for insert method
|
|
896
|
+
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceList.length);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
editRecord(data, index) {
|
|
901
|
+
if (data) {
|
|
902
|
+
this.pConn$
|
|
903
|
+
.getActionsApi()
|
|
904
|
+
.openEmbeddedDataModal(
|
|
905
|
+
this.bUseSeparateViewForEdit ? this.editView : this.defaultView,
|
|
906
|
+
this.pConn$,
|
|
907
|
+
this.referenceListStr,
|
|
908
|
+
index,
|
|
909
|
+
PCore.getConstants().RESOURCE_STATUS.UPDATE
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
deleteRecord(index) {
|
|
915
|
+
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
916
|
+
this.pConn$.getListActions().deleteEntry(index, this.pageReference);
|
|
917
|
+
} else {
|
|
918
|
+
// @ts-ignore - second parameter "pageRef" is optional for deleteEntry method
|
|
919
|
+
this.pConn$.getListActions().deleteEntry(index);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
buildElementsForTable() {
|
|
924
|
+
const context = this.pConn$.getContextName();
|
|
925
|
+
const eleData: any = [];
|
|
926
|
+
this.referenceList.forEach((element, index) => {
|
|
927
|
+
const data: any = [];
|
|
928
|
+
this.rawFields?.forEach(item => {
|
|
929
|
+
const referenceListData = getReferenceList(this.pConn$);
|
|
930
|
+
const isDatapage = referenceListData.startsWith('D_');
|
|
931
|
+
const pageReferenceValue = isDatapage
|
|
932
|
+
? `${referenceListData}[${index}]`
|
|
933
|
+
: `${this.pConn$.getPageReference()}${referenceListData.substring(referenceListData.lastIndexOf('.'))}[${index}]`;
|
|
934
|
+
const config = {
|
|
935
|
+
meta: item,
|
|
936
|
+
options: {
|
|
937
|
+
context,
|
|
938
|
+
pageReference: pageReferenceValue,
|
|
939
|
+
referenceList: referenceListData,
|
|
940
|
+
hasForm: true
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
const view = PCore.createPConnect(config);
|
|
944
|
+
data.push(view);
|
|
945
|
+
});
|
|
946
|
+
eleData.push(data);
|
|
947
|
+
});
|
|
948
|
+
this.elementsData = eleData;
|
|
949
|
+
}
|
|
950
|
+
}
|