@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,1408 @@
|
|
|
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 { MatDatepickerModule } from '@angular/material/datepicker';
|
|
5
|
+
import { MatOptionModule } from '@angular/material/core';
|
|
6
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
7
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
8
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
9
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
11
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
12
|
+
import { MatInputModule } from '@angular/material/input';
|
|
13
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
14
|
+
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
15
|
+
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
16
|
+
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
17
|
+
import { DragDropModule, CdkDragDrop, moveItemInArray, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
|
|
18
|
+
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
19
|
+
import { Utils } from '@pega/angular-sdk-components';
|
|
20
|
+
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
21
|
+
import { getCurrencyOptions } from '@pega/angular-sdk-components';
|
|
22
|
+
import { getLocale, getSeconds } from '@pega/angular-sdk-components';
|
|
23
|
+
import { formatters } from '@pega/angular-sdk-components';
|
|
24
|
+
|
|
25
|
+
import { useInit } from './listViewHelpers';
|
|
26
|
+
|
|
27
|
+
declare const window: any;
|
|
28
|
+
|
|
29
|
+
const SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };
|
|
30
|
+
|
|
31
|
+
interface ListViewProps {
|
|
32
|
+
// If any, enter additional props that only exist on this component
|
|
33
|
+
globalSearch?: boolean;
|
|
34
|
+
referenceList?: any;
|
|
35
|
+
rowClickAction?: any;
|
|
36
|
+
selectionMode?: string;
|
|
37
|
+
referenceType?: string;
|
|
38
|
+
compositeKeys?: any;
|
|
39
|
+
showDynamicFields?: boolean;
|
|
40
|
+
presets?: any;
|
|
41
|
+
reorderFields: string | boolean;
|
|
42
|
+
grouping: string | boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class Group {
|
|
46
|
+
level = 0;
|
|
47
|
+
parent: Group;
|
|
48
|
+
expanded = true;
|
|
49
|
+
totalCounts = 0;
|
|
50
|
+
get visible(): boolean {
|
|
51
|
+
return !this.parent || (this.parent.visible && this.parent.expanded);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Component({
|
|
56
|
+
selector: 'app-list-view',
|
|
57
|
+
templateUrl: './list-view.component.html',
|
|
58
|
+
styleUrls: ['./list-view.component.scss'],
|
|
59
|
+
standalone: true,
|
|
60
|
+
imports: [
|
|
61
|
+
CommonModule,
|
|
62
|
+
MatFormFieldModule,
|
|
63
|
+
MatInputModule,
|
|
64
|
+
MatTableModule,
|
|
65
|
+
MatSortModule,
|
|
66
|
+
DragDropModule,
|
|
67
|
+
CdkDropList,
|
|
68
|
+
CdkDrag,
|
|
69
|
+
MatButtonModule,
|
|
70
|
+
MatMenuModule,
|
|
71
|
+
MatIconModule,
|
|
72
|
+
MatRadioModule,
|
|
73
|
+
MatCheckboxModule,
|
|
74
|
+
MatPaginatorModule,
|
|
75
|
+
MatSelectModule,
|
|
76
|
+
MatOptionModule,
|
|
77
|
+
MatDatepickerModule,
|
|
78
|
+
forwardRef(() => ComponentMapperComponent)
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
export class ListViewComponent implements OnInit, OnDestroy {
|
|
82
|
+
@ViewChild(MatPaginator) paginator: MatPaginator;
|
|
83
|
+
@ViewChild(MatSort) sort: MatSort;
|
|
84
|
+
|
|
85
|
+
@Input() pConn$: typeof PConnect;
|
|
86
|
+
@Input() bInForm$ = true;
|
|
87
|
+
@Input() payload;
|
|
88
|
+
|
|
89
|
+
repeatList$: MatTableDataSource<any>;
|
|
90
|
+
fields$: any[];
|
|
91
|
+
|
|
92
|
+
displayedColumns$ = Array<any>();
|
|
93
|
+
groupByColumns$: string[] = [];
|
|
94
|
+
|
|
95
|
+
configProps$: ListViewProps;
|
|
96
|
+
|
|
97
|
+
updatedRefList: any;
|
|
98
|
+
|
|
99
|
+
repeatListData: any[] = [];
|
|
100
|
+
|
|
101
|
+
searchIcon$: string;
|
|
102
|
+
|
|
103
|
+
bShowSearch$ = false;
|
|
104
|
+
bColumnReorder$ = false;
|
|
105
|
+
bGrouping$ = false;
|
|
106
|
+
|
|
107
|
+
perfFilter: string;
|
|
108
|
+
searchFilter: string;
|
|
109
|
+
|
|
110
|
+
menuSvgIcon$: string;
|
|
111
|
+
arrowSvgIcon$ = '';
|
|
112
|
+
arrowDownSvgIcon$: string;
|
|
113
|
+
arrowUpSvgIcon$: string;
|
|
114
|
+
|
|
115
|
+
filterSvgIcon$: string;
|
|
116
|
+
filterOnSvgIcon$: string;
|
|
117
|
+
groupBySvgIcon$: string;
|
|
118
|
+
|
|
119
|
+
compareType: string;
|
|
120
|
+
compareRef: string;
|
|
121
|
+
arrowDirection = 'down';
|
|
122
|
+
|
|
123
|
+
filterByColumns: any[] = [];
|
|
124
|
+
bShowFilterPopover$ = false;
|
|
125
|
+
bContains$ = true;
|
|
126
|
+
bDateTime$ = false;
|
|
127
|
+
|
|
128
|
+
filterContainsLabel$ = '';
|
|
129
|
+
filterContainsType$ = 'contains';
|
|
130
|
+
filterContainsValue$: any;
|
|
131
|
+
|
|
132
|
+
bIsDate$ = false;
|
|
133
|
+
bIsDateTime$ = false;
|
|
134
|
+
bIsTime$ = false;
|
|
135
|
+
|
|
136
|
+
currentFilterRefData: any;
|
|
137
|
+
currentFilterImageEl: any;
|
|
138
|
+
|
|
139
|
+
arFilterMainButtons$: any[] = [];
|
|
140
|
+
arFilterSecondaryButtons$: any[] = [];
|
|
141
|
+
selectionMode?: string;
|
|
142
|
+
singleSelectionMode: boolean;
|
|
143
|
+
multiSelectionMode: boolean;
|
|
144
|
+
rowID: any;
|
|
145
|
+
response: any;
|
|
146
|
+
compositeKeys: any;
|
|
147
|
+
showDynamicFields: any;
|
|
148
|
+
filters: any = {};
|
|
149
|
+
selectParam: any[] = [];
|
|
150
|
+
filterPayload: any;
|
|
151
|
+
ref: any = {};
|
|
152
|
+
cosmosTableRef: any;
|
|
153
|
+
listContext: any = {};
|
|
154
|
+
query: any = null;
|
|
155
|
+
paging: any;
|
|
156
|
+
fieldDefs: any;
|
|
157
|
+
xRayApis = PCore.getDebugger().getXRayRuntime();
|
|
158
|
+
xRayUid = this.xRayApis.startXRay();
|
|
159
|
+
|
|
160
|
+
constructor(
|
|
161
|
+
private psService: ProgressSpinnerService,
|
|
162
|
+
private utils: Utils
|
|
163
|
+
) {}
|
|
164
|
+
|
|
165
|
+
ngOnInit(): void {
|
|
166
|
+
this.configProps$ = this.pConn$.getConfigProps() as ListViewProps;
|
|
167
|
+
/** By default, pyGUID is used for Data classes and pyID is for Work classes as row-id/key */
|
|
168
|
+
const defRowID = this.configProps$?.referenceType === 'Case' ? 'pyID' : 'pyGUID';
|
|
169
|
+
/** If compositeKeys is defined, use dynamic value, else fallback to pyID or pyGUID. */
|
|
170
|
+
this.compositeKeys = this.configProps$?.compositeKeys;
|
|
171
|
+
this.rowID = this.compositeKeys && this.compositeKeys?.length === 1 ? this.compositeKeys[0] : defRowID;
|
|
172
|
+
this.bShowSearch$ = this.utils.getBooleanValue(this.configProps$.globalSearch ? this.configProps$.globalSearch : this.payload.globalSearch);
|
|
173
|
+
this.bColumnReorder$ = this.utils.getBooleanValue(this.configProps$.reorderFields);
|
|
174
|
+
this.bGrouping$ = this.utils.getBooleanValue(this.configProps$.grouping);
|
|
175
|
+
this.showDynamicFields = this.configProps$?.showDynamicFields;
|
|
176
|
+
|
|
177
|
+
this.menuSvgIcon$ = this.utils.getImageSrc('more', this.utils.getSDKStaticContentUrl());
|
|
178
|
+
this.arrowDownSvgIcon$ = this.utils.getImageSrc('arrow-down', this.utils.getSDKStaticContentUrl());
|
|
179
|
+
this.arrowUpSvgIcon$ = this.utils.getImageSrc('arrow-up', this.utils.getSDKStaticContentUrl());
|
|
180
|
+
|
|
181
|
+
this.filterSvgIcon$ = this.utils.getImageSrc('filter', this.utils.getSDKStaticContentUrl());
|
|
182
|
+
this.filterOnSvgIcon$ = this.utils.getImageSrc('filter-on', this.utils.getSDKStaticContentUrl());
|
|
183
|
+
this.groupBySvgIcon$ = this.utils.getImageSrc('row', this.utils.getSDKStaticContentUrl());
|
|
184
|
+
|
|
185
|
+
this.selectionMode = this.configProps$.selectionMode;
|
|
186
|
+
|
|
187
|
+
this.arFilterMainButtons$.push({ actionID: 'submit', jsAction: 'submit', name: 'Submit' });
|
|
188
|
+
this.arFilterSecondaryButtons$.push({ actionID: 'cancel', jsAction: 'cancel', name: 'Cancel' });
|
|
189
|
+
|
|
190
|
+
this.searchIcon$ = this.utils.getImageSrc('search', this.utils.getSDKStaticContentUrl());
|
|
191
|
+
setTimeout(() => {
|
|
192
|
+
PCore.getPubSubUtils().subscribe(
|
|
193
|
+
PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CHANGE,
|
|
194
|
+
data => {
|
|
195
|
+
this.processFilterChange(data);
|
|
196
|
+
},
|
|
197
|
+
`dashboard-component-${'id'}`,
|
|
198
|
+
false,
|
|
199
|
+
this.pConn$.getContextName()
|
|
200
|
+
);
|
|
201
|
+
PCore.getPubSubUtils().subscribe(
|
|
202
|
+
PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CLEAR_ALL,
|
|
203
|
+
() => {
|
|
204
|
+
this.filters = {};
|
|
205
|
+
this.processFilterClear();
|
|
206
|
+
},
|
|
207
|
+
`dashboard-component-${'id'}`,
|
|
208
|
+
false,
|
|
209
|
+
this.pConn$.getContextName()
|
|
210
|
+
);
|
|
211
|
+
}, 0);
|
|
212
|
+
if (this.configProps$) {
|
|
213
|
+
if (!this.payload) {
|
|
214
|
+
this.payload = { referenceList: this.configProps$.referenceList };
|
|
215
|
+
}
|
|
216
|
+
useInit({
|
|
217
|
+
pConn$: this.pConn$,
|
|
218
|
+
bInForm$: this.bInForm$,
|
|
219
|
+
...this.payload,
|
|
220
|
+
listContext: this.listContext,
|
|
221
|
+
ref: this.ref,
|
|
222
|
+
showDynamicFields: this.showDynamicFields,
|
|
223
|
+
xRayUid: this.xRayUid,
|
|
224
|
+
cosmosTableRef: this.cosmosTableRef,
|
|
225
|
+
selectionMode: this.selectionMode
|
|
226
|
+
}).then(response => {
|
|
227
|
+
this.listContext = response;
|
|
228
|
+
this.getListData();
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
getFieldFromFilter(filter, dateRange = false) {
|
|
234
|
+
let fieldValue;
|
|
235
|
+
if (dateRange) {
|
|
236
|
+
fieldValue = filter?.AND[0]?.condition.lhs.field;
|
|
237
|
+
} else {
|
|
238
|
+
fieldValue = filter?.condition.lhs.field;
|
|
239
|
+
}
|
|
240
|
+
return fieldValue;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Will be triggered when EVENT_DASHBOARD_FILTER_CHANGE fires
|
|
244
|
+
processFilterChange(data) {
|
|
245
|
+
const { filterId, filterExpression } = data;
|
|
246
|
+
let dashboardFilterPayload: any = {
|
|
247
|
+
query: {
|
|
248
|
+
filter: {},
|
|
249
|
+
select: []
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
this.filters[filterId] = filterExpression;
|
|
254
|
+
let isDateRange = !!data.filterExpression?.AND;
|
|
255
|
+
// Will be AND by default but making it dynamic in case we support dynamic relational ops in future
|
|
256
|
+
const relationalOp = 'AND';
|
|
257
|
+
|
|
258
|
+
let field = this.getFieldFromFilter(filterExpression, isDateRange);
|
|
259
|
+
const selectParam: any[] = [];
|
|
260
|
+
// Constructing the select parameters list (will be sent in dashboardFilterPayload)
|
|
261
|
+
this.displayedColumns$?.forEach(col => {
|
|
262
|
+
selectParam.push({
|
|
263
|
+
field: col
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// Checking if the triggered filter is applicable for this list
|
|
268
|
+
if (data.filterExpression !== null && !(this.displayedColumns$?.length && this.displayedColumns$?.includes(field))) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
// This is a flag which will be used to reset dashboardFilterPayload in case we don't find any valid filters
|
|
272
|
+
let validFilter = false;
|
|
273
|
+
|
|
274
|
+
let index = 1;
|
|
275
|
+
// Iterating over the current filters list to create filter data which will be POSTed
|
|
276
|
+
const filterKeys: any[] = Object.keys(this.filters);
|
|
277
|
+
const filterValues: any[] = Object.values(this.filters);
|
|
278
|
+
for (let filterIndex = 0; filterIndex < filterKeys.length; filterIndex++) {
|
|
279
|
+
const filter = filterValues[filterIndex];
|
|
280
|
+
// If the filter is null then we can skip this iteration
|
|
281
|
+
if (filter === null) {
|
|
282
|
+
// eslint-disable-next-line no-continue
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Checking if the filter is of type- Date Range
|
|
287
|
+
isDateRange = !!filter?.AND;
|
|
288
|
+
field = this.getFieldFromFilter(filter, isDateRange);
|
|
289
|
+
|
|
290
|
+
if (!(this.displayedColumns$?.length && this.displayedColumns$?.includes(field))) {
|
|
291
|
+
// eslint-disable-next-line no-continue
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
// If we reach here that implies we've at least one valid filter, hence setting the flag
|
|
295
|
+
validFilter = true;
|
|
296
|
+
/** Below are the 2 cases for- Text & Date-Range filter types where we'll construct filter data which will be sent in the dashboardFilterPayload
|
|
297
|
+
* In Constellation DX Components, through Repeating Structures they might be using several APIs to do it. We're doing it here
|
|
298
|
+
*/
|
|
299
|
+
if (isDateRange) {
|
|
300
|
+
dashboardFilterPayload = this.filterBasedOnDateRange(dashboardFilterPayload, filter, relationalOp, selectParam, index);
|
|
301
|
+
} else {
|
|
302
|
+
dashboardFilterPayload.query.filter.filterConditions = {
|
|
303
|
+
...dashboardFilterPayload.query.filter.filterConditions,
|
|
304
|
+
[`T${index++}`]: { ...filter.condition, ignoreCase: true }
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
if (dashboardFilterPayload.query.filter.logic) {
|
|
308
|
+
dashboardFilterPayload.query.filter.logic = `${dashboardFilterPayload.query.filter.logic} ${relationalOp} T${index - 1}`;
|
|
309
|
+
} else {
|
|
310
|
+
dashboardFilterPayload.query.filter.logic = `T${index - 1}`;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
dashboardFilterPayload.query.select = selectParam;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Reset the dashboardFilterPayload if we end up with no valid filters for the list
|
|
318
|
+
if (!validFilter) {
|
|
319
|
+
dashboardFilterPayload = undefined;
|
|
320
|
+
}
|
|
321
|
+
this.filterPayload = dashboardFilterPayload;
|
|
322
|
+
this.getListData();
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
filterBasedOnDateRange(dashboardFilterPayload, filter, relationalOp, selectParam, index) {
|
|
326
|
+
const dateRelationalOp = filter?.AND ? 'AND' : 'OR';
|
|
327
|
+
dashboardFilterPayload.query.filter.filterConditions = {
|
|
328
|
+
...dashboardFilterPayload.query.filter.filterConditions,
|
|
329
|
+
[`T${index++}`]: { ...filter[relationalOp][0].condition },
|
|
330
|
+
[`T${index++}`]: { ...filter[relationalOp][1].condition }
|
|
331
|
+
};
|
|
332
|
+
if (dashboardFilterPayload.query.filter.logic) {
|
|
333
|
+
dashboardFilterPayload.query.filter.logic = `${dashboardFilterPayload.query.filter.logic} ${relationalOp} (T${index - 2} ${dateRelationalOp} T${
|
|
334
|
+
index - 1
|
|
335
|
+
})`;
|
|
336
|
+
} else {
|
|
337
|
+
dashboardFilterPayload.query.filter.logic = `(T${index - 2} ${relationalOp} T${index - 1})`;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
dashboardFilterPayload.query.select = selectParam;
|
|
341
|
+
|
|
342
|
+
return dashboardFilterPayload;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
processFilterClear() {
|
|
346
|
+
this.filterPayload = undefined;
|
|
347
|
+
this.getListData();
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
getFieldsMetadata(refList) {
|
|
351
|
+
// @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
|
|
352
|
+
return PCore.getAnalyticsUtils().getDataViewMetadata(refList, this.showDynamicFields);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
getListData() {
|
|
356
|
+
// @ts-ignore - Property 'getComponentConfig' is private and only accessible within class 'C11nEnv'
|
|
357
|
+
const componentConfig = this.pConn$.getComponentConfig();
|
|
358
|
+
if (this.configProps$) {
|
|
359
|
+
this.preparePayload();
|
|
360
|
+
const refList = this.configProps$.referenceList;
|
|
361
|
+
const fieldsMetaDataPromise = this.getFieldsMetadata(refList);
|
|
362
|
+
// returns a promise
|
|
363
|
+
const payload = this.payload || this.filterPayload || {};
|
|
364
|
+
const dataViewParameters = this.payload.parameters;
|
|
365
|
+
|
|
366
|
+
const workListDataPromise = !this.bInForm$
|
|
367
|
+
? // @ts-ignore - 3rd parameter "context" should be optional in getData method
|
|
368
|
+
PCore.getDataApiUtils().getData(refList, payload)
|
|
369
|
+
: PCore.getDataPageUtils().getDataAsync(
|
|
370
|
+
refList,
|
|
371
|
+
this.pConn$.getContextName(),
|
|
372
|
+
payload.dataViewParameters ? payload.dataViewParameters : dataViewParameters,
|
|
373
|
+
this.paging,
|
|
374
|
+
this.query
|
|
375
|
+
);
|
|
376
|
+
|
|
377
|
+
this.bShowFilterPopover$ = false;
|
|
378
|
+
|
|
379
|
+
this.psService.sendMessage(true);
|
|
380
|
+
|
|
381
|
+
Promise.all([fieldsMetaDataPromise, workListDataPromise])
|
|
382
|
+
.then((results: any) => {
|
|
383
|
+
const fieldsMetaData = results[0];
|
|
384
|
+
const workListData = results[1];
|
|
385
|
+
|
|
386
|
+
this.fields$ = this.configProps$.presets[0].children[0].children;
|
|
387
|
+
// this is an unresovled version of this.fields$, need unresolved, so can get the property reference
|
|
388
|
+
const columnFields = componentConfig.presets[0].children[0].children;
|
|
389
|
+
|
|
390
|
+
const tableDataResults = !this.bInForm$ ? workListData.data.data : workListData.data;
|
|
391
|
+
|
|
392
|
+
const columns = this.getHeaderCells(columnFields, this.fieldDefs);
|
|
393
|
+
this.fields$ = this.updateFields(this.fields$, fieldsMetaData.data.fields, columns);
|
|
394
|
+
this.displayedColumns$ = columns.map(col => {
|
|
395
|
+
return col.id;
|
|
396
|
+
});
|
|
397
|
+
this.response = tableDataResults;
|
|
398
|
+
this.updatedRefList = this.updateData(tableDataResults, this.fields$);
|
|
399
|
+
if (this.selectionMode === SELECTION_MODE.SINGLE && this.updatedRefList?.length > 0) {
|
|
400
|
+
this.displayedColumns$?.unshift('select');
|
|
401
|
+
this.singleSelectionMode = true;
|
|
402
|
+
} else if (this.selectionMode === SELECTION_MODE.MULTI && this.updatedRefList?.length > 0) {
|
|
403
|
+
this.displayedColumns$?.unshift('select');
|
|
404
|
+
this.multiSelectionMode = true;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
this.repeatList$ = new MatTableDataSource(this.updatedRefList);
|
|
408
|
+
this.repeatList$.filterPredicate = this.customFilterPredicate.bind(this);
|
|
409
|
+
|
|
410
|
+
// keeping an original copy to get back after possible sorts, filters and groupBy
|
|
411
|
+
this.repeatListData = this.repeatList$.data.slice();
|
|
412
|
+
|
|
413
|
+
this.repeatList$.paginator = this.paginator;
|
|
414
|
+
this.repeatList$.sort = this.sort;
|
|
415
|
+
this.psService.sendMessage(false);
|
|
416
|
+
})
|
|
417
|
+
.catch(() => {
|
|
418
|
+
console.error("Couldn't fetch either the fieldsMetaData or workListData");
|
|
419
|
+
this.psService.sendMessage(false);
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
preparePayload() {
|
|
425
|
+
const { fieldDefs, itemKey, patchQueryFields } = this.listContext.meta;
|
|
426
|
+
this.fieldDefs = fieldDefs;
|
|
427
|
+
let listFields = fieldDefs ? this.buildSelect(fieldDefs, undefined, patchQueryFields, this.payload?.compositeKeys) : [];
|
|
428
|
+
listFields = this.addItemKeyInSelect(fieldDefs, itemKey, listFields, this.payload?.compositeKeys);
|
|
429
|
+
if (this.payload.query) {
|
|
430
|
+
this.query = this.payload.query;
|
|
431
|
+
} else if (listFields?.length && this.listContext.meta.isQueryable) {
|
|
432
|
+
if (this.filterPayload) {
|
|
433
|
+
this.query = {
|
|
434
|
+
select: listFields,
|
|
435
|
+
filter: this.filterPayload?.query?.filter
|
|
436
|
+
};
|
|
437
|
+
} else {
|
|
438
|
+
this.query = { select: listFields };
|
|
439
|
+
}
|
|
440
|
+
} else if (this.filterPayload) {
|
|
441
|
+
this.query = this.filterPayload?.query;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
// ngOnChanges(changes) {
|
|
445
|
+
// if (changes && changes.payload) {
|
|
446
|
+
// const currentPayloadVal = changes.payload?.currentValue;
|
|
447
|
+
// const previousPayloadVal = changes.payload?.previousValue;
|
|
448
|
+
// if (currentPayloadVal !== previousPayloadVal) {
|
|
449
|
+
// this.getListData();
|
|
450
|
+
// }
|
|
451
|
+
// }
|
|
452
|
+
// }
|
|
453
|
+
|
|
454
|
+
ngOnDestroy() {
|
|
455
|
+
PCore.getPubSubUtils().unsubscribe(
|
|
456
|
+
PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CHANGE,
|
|
457
|
+
`dashboard-component-${'id'}`,
|
|
458
|
+
this.pConn$.getContextName()
|
|
459
|
+
);
|
|
460
|
+
PCore.getPubSubUtils().unsubscribe(
|
|
461
|
+
PCore.getConstants().PUB_SUB_EVENTS.EVENT_DASHBOARD_FILTER_CLEAR_ALL,
|
|
462
|
+
`dashboard-component-${'id'}`,
|
|
463
|
+
this.pConn$.getContextName()
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// ngAfterViewInit() {
|
|
468
|
+
// // paginator has to exist for this to work,
|
|
469
|
+
// // so called after init (paginator drawn)
|
|
470
|
+
// // Calls are now in workListData promise
|
|
471
|
+
// // this.repeatList$.paginator = this.paginator;
|
|
472
|
+
// // this.repeatList$.sort = this.sort;
|
|
473
|
+
// }
|
|
474
|
+
|
|
475
|
+
drop(event: CdkDragDrop<string[]>) {
|
|
476
|
+
moveItemInArray(this.displayedColumns$, event.previousIndex, event.currentIndex);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
updateFields(arFields: any[], arColumns, fields): any[] {
|
|
480
|
+
const arReturn = arFields;
|
|
481
|
+
arReturn.forEach((field, i) => {
|
|
482
|
+
field.config = { ...field.config, ...fields[i], name: fields[i].id };
|
|
483
|
+
});
|
|
484
|
+
return arReturn;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
applySearch(event: Event) {
|
|
488
|
+
const filterValue = (event.target as HTMLInputElement).value;
|
|
489
|
+
this.searchFilter = filterValue.trim().toLowerCase();
|
|
490
|
+
|
|
491
|
+
if (this.groupByColumns$.length > 0) {
|
|
492
|
+
this.repeatList$.data = this.repeatListData.slice();
|
|
493
|
+
this.repeatList$.filter = this.searchFilter;
|
|
494
|
+
const repeatData = this.repeatList$.sortData(this.repeatList$.filteredData, this.repeatList$.sort as MatSort);
|
|
495
|
+
this.repeatList$.data = this.addGroups(repeatData, this.groupByColumns$);
|
|
496
|
+
|
|
497
|
+
this.perfFilter = performance.now().toString();
|
|
498
|
+
this.repeatList$.filter = this.perfFilter;
|
|
499
|
+
} else {
|
|
500
|
+
this.repeatList$.filter = this.searchFilter;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (this.repeatList$.paginator) {
|
|
504
|
+
this.repeatList$.paginator.firstPage();
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
fieldOnChange(row) {
|
|
509
|
+
const value = row[this.rowID];
|
|
510
|
+
const reqObj = {};
|
|
511
|
+
if (this.compositeKeys?.length > 1) {
|
|
512
|
+
const index = this.response.findIndex(element => element[this.rowID] === value);
|
|
513
|
+
const selectedRow = this.response[index];
|
|
514
|
+
this.compositeKeys.forEach(element => {
|
|
515
|
+
reqObj[element] = selectedRow[element];
|
|
516
|
+
});
|
|
517
|
+
} else {
|
|
518
|
+
reqObj[this.rowID] = value;
|
|
519
|
+
}
|
|
520
|
+
this.pConn$?.getListActions?.()?.setSelectedRows([reqObj]);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
onCheckboxClick(row, event) {
|
|
524
|
+
const value = row[this.rowID];
|
|
525
|
+
const checked = event?.checked;
|
|
526
|
+
const reqObj: any = {};
|
|
527
|
+
if (this.compositeKeys?.length > 1) {
|
|
528
|
+
const index = this.response.findIndex(element => element[this.rowID] === value);
|
|
529
|
+
const selectedRow = this.response[index];
|
|
530
|
+
this.compositeKeys.forEach(element => {
|
|
531
|
+
reqObj[element] = selectedRow[element];
|
|
532
|
+
});
|
|
533
|
+
reqObj.$selected = checked;
|
|
534
|
+
} else {
|
|
535
|
+
reqObj[this.rowID] = value;
|
|
536
|
+
reqObj.$selected = checked;
|
|
537
|
+
}
|
|
538
|
+
this.pConn$?.getListActions()?.setSelectedRows([reqObj]);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// rowClick(row) {
|
|
542
|
+
// switch (this.configProps$.rowClickAction) {
|
|
543
|
+
// case 'openAssignment':
|
|
544
|
+
// this.psService.sendMessage(true);
|
|
545
|
+
// this.openAssignment(row);
|
|
546
|
+
// break;
|
|
547
|
+
// }
|
|
548
|
+
// }
|
|
549
|
+
|
|
550
|
+
_getIconStyle(level): string {
|
|
551
|
+
let sReturn = '';
|
|
552
|
+
let nLevel = parseInt(level, 10);
|
|
553
|
+
nLevel--;
|
|
554
|
+
nLevel *= 15;
|
|
555
|
+
sReturn = `padding-left: ${nLevel}px; vertical-align: middle`;
|
|
556
|
+
|
|
557
|
+
return sReturn;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
_getGroupName(fieldName) {
|
|
561
|
+
for (let fieldIndex = 0; fieldIndex < this.fields$.length; fieldIndex++) {
|
|
562
|
+
const field = this.fields$[fieldIndex];
|
|
563
|
+
if (field.config.name == fieldName) {
|
|
564
|
+
return field.config.label;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return '';
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
_showButton(name, row) {
|
|
571
|
+
let bReturn = false;
|
|
572
|
+
const { pxRefObjectClass, pzInsKey, pxRefObjectKey } = row;
|
|
573
|
+
switch (name) {
|
|
574
|
+
case 'pxTaskLabel':
|
|
575
|
+
if (pxRefObjectClass != '' && pzInsKey != '') {
|
|
576
|
+
bReturn = true;
|
|
577
|
+
}
|
|
578
|
+
break;
|
|
579
|
+
case 'pxRefObjectInsName':
|
|
580
|
+
if (pxRefObjectClass != '' && pxRefObjectKey != '') {
|
|
581
|
+
bReturn = true;
|
|
582
|
+
}
|
|
583
|
+
break;
|
|
584
|
+
default:
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return bReturn;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
_listViewClick(column, row) {
|
|
592
|
+
const name = column.id;
|
|
593
|
+
if (column.displayAsLink) {
|
|
594
|
+
const { pxObjClass } = row;
|
|
595
|
+
let { pzInsKey } = row;
|
|
596
|
+
if (column.isAssociation) {
|
|
597
|
+
const associationCategory = name.split(':')[0];
|
|
598
|
+
pzInsKey = row[`${associationCategory}:pzInsKey`];
|
|
599
|
+
}
|
|
600
|
+
if (column.isAssignmentLink) {
|
|
601
|
+
this.pConn$.getActionsApi().openAssignment(pzInsKey, pxObjClass, {
|
|
602
|
+
containerName: 'primary',
|
|
603
|
+
channelName: ''
|
|
604
|
+
});
|
|
605
|
+
} else {
|
|
606
|
+
this.pConn$.getActionsApi().openWorkByHandle(pzInsKey, pxObjClass);
|
|
607
|
+
}
|
|
608
|
+
} else {
|
|
609
|
+
switch (name) {
|
|
610
|
+
case 'pxTaskLabel':
|
|
611
|
+
this.openAssignment(row);
|
|
612
|
+
break;
|
|
613
|
+
case 'pxRefObjectInsName':
|
|
614
|
+
this.openWork(row);
|
|
615
|
+
break;
|
|
616
|
+
default:
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
compare(a: number | string, b: number | string, isAsc: boolean) {
|
|
623
|
+
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
_headerSortClick(event, columnData) {
|
|
627
|
+
// images 0 - filter, 1 - arrow, 2 - more
|
|
628
|
+
|
|
629
|
+
/** Commenting this code for now as it is giving errors not sure if it ever worked */
|
|
630
|
+
// let arrowImage = event.srcElement.getElementsByTagName('img')[1];
|
|
631
|
+
// let arrowAttr = arrowImage.getAttribute('arrow');
|
|
632
|
+
|
|
633
|
+
// this.clearOutArrows(event, columnData);
|
|
634
|
+
|
|
635
|
+
// switch (arrowAttr) {
|
|
636
|
+
// case 'up':
|
|
637
|
+
// arrowImage.src = this.arrowDownSvgIcon$;
|
|
638
|
+
// arrowImage.setAttribute('arrow', 'down');
|
|
639
|
+
// break;
|
|
640
|
+
// case 'down':
|
|
641
|
+
// arrowImage.src = '';
|
|
642
|
+
// arrowImage.setAttribute('arrow', 'none');
|
|
643
|
+
// break;
|
|
644
|
+
// default:
|
|
645
|
+
// arrowImage.src = this.arrowUpSvgIcon$;
|
|
646
|
+
// arrowImage.setAttribute('arrow', 'up');
|
|
647
|
+
// break;
|
|
648
|
+
// }
|
|
649
|
+
|
|
650
|
+
this.compareType = columnData.type;
|
|
651
|
+
this.compareRef = columnData.config.name;
|
|
652
|
+
// this.arrowDirection = arrowImage.getAttribute('arrow');
|
|
653
|
+
this.arrowDirection = this.arrowDirection === 'up' ? 'down' : 'up';
|
|
654
|
+
|
|
655
|
+
this.filterSortGroupBy();
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
clearOutArrows(event, columnData) {
|
|
659
|
+
const arImages = event.srcElement.parentElement.getElementsByTagName('img');
|
|
660
|
+
|
|
661
|
+
for (const theImage of arImages) {
|
|
662
|
+
// let theImage = arImages[i]
|
|
663
|
+
const arrow = theImage.getAttribute('arrow');
|
|
664
|
+
if (arrow) {
|
|
665
|
+
const arrowId = theImage.getAttribute('arrowid');
|
|
666
|
+
if (arrow != 'none' && arrowId != columnData.config.name) {
|
|
667
|
+
theImage.setAttribute('arrow', 'none');
|
|
668
|
+
theImage.src = '';
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
sortCompare(a, b): number {
|
|
675
|
+
let aValue = a[this.compareRef];
|
|
676
|
+
let bValue = b[this.compareRef];
|
|
677
|
+
|
|
678
|
+
if (this.compareType == 'Date' || this.compareType == 'DateTime') {
|
|
679
|
+
aValue = getSeconds(aValue);
|
|
680
|
+
bValue = getSeconds(bValue);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if (this.compareRef == 'pxRefObjectInsName') {
|
|
684
|
+
const result = this.compareByColumnPxRefObjectInsName(aValue, bValue);
|
|
685
|
+
if (result !== undefined) {
|
|
686
|
+
return result;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
switch (this.arrowDirection) {
|
|
691
|
+
case 'up':
|
|
692
|
+
if (aValue < bValue) {
|
|
693
|
+
return -1;
|
|
694
|
+
}
|
|
695
|
+
if (aValue > bValue) {
|
|
696
|
+
return 1;
|
|
697
|
+
}
|
|
698
|
+
break;
|
|
699
|
+
case 'down':
|
|
700
|
+
if (aValue > bValue) {
|
|
701
|
+
return -1;
|
|
702
|
+
}
|
|
703
|
+
if (aValue < bValue) {
|
|
704
|
+
return 1;
|
|
705
|
+
}
|
|
706
|
+
break;
|
|
707
|
+
default:
|
|
708
|
+
break;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
return 0;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
compareByColumnPxRefObjectInsName(aValue, bValue) {
|
|
715
|
+
const prefixX = aValue.split('-');
|
|
716
|
+
const prefixY = bValue.split('-');
|
|
717
|
+
switch (this.arrowDirection) {
|
|
718
|
+
case 'up':
|
|
719
|
+
if (prefixX[0] !== prefixY[0]) {
|
|
720
|
+
if (prefixX[0] < prefixY[0]) return -1;
|
|
721
|
+
if (prefixX[0] > prefixY[0]) return 1;
|
|
722
|
+
return 0;
|
|
723
|
+
}
|
|
724
|
+
return prefixX[1] - prefixY[1];
|
|
725
|
+
case 'down':
|
|
726
|
+
if (prefixX[0] !== prefixY[0]) {
|
|
727
|
+
if (prefixX[0] > prefixY[0]) return -1;
|
|
728
|
+
if (prefixX[0] < prefixY[0]) return 1;
|
|
729
|
+
return 0;
|
|
730
|
+
}
|
|
731
|
+
return prefixY[1] - prefixX[1];
|
|
732
|
+
default:
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
return undefined;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
updateFilterDisplay(type) {
|
|
740
|
+
switch (type) {
|
|
741
|
+
case 'Date':
|
|
742
|
+
this.filterContainsType$ = 'notequal';
|
|
743
|
+
this.bContains$ = false;
|
|
744
|
+
this.bDateTime$ = true;
|
|
745
|
+
this.bIsDate$ = true;
|
|
746
|
+
this.bIsDateTime$ = false;
|
|
747
|
+
this.bIsTime$ = false;
|
|
748
|
+
break;
|
|
749
|
+
case 'DateTime':
|
|
750
|
+
this.filterContainsType$ = 'notequal';
|
|
751
|
+
this.bContains$ = false;
|
|
752
|
+
this.bDateTime$ = true;
|
|
753
|
+
this.bIsDate$ = false;
|
|
754
|
+
this.bIsDateTime$ = true;
|
|
755
|
+
this.bIsTime$ = false;
|
|
756
|
+
break;
|
|
757
|
+
case 'Time':
|
|
758
|
+
this.filterContainsType$ = 'notequal';
|
|
759
|
+
this.bContains$ = false;
|
|
760
|
+
this.bDateTime$ = true;
|
|
761
|
+
this.bIsDate$ = false;
|
|
762
|
+
this.bIsDateTime$ = false;
|
|
763
|
+
this.bIsTime$ = true;
|
|
764
|
+
break;
|
|
765
|
+
default:
|
|
766
|
+
this.filterContainsType$ = 'contains';
|
|
767
|
+
this.bContains$ = true;
|
|
768
|
+
this.bDateTime$ = false;
|
|
769
|
+
this.bIsDate$ = false;
|
|
770
|
+
this.bIsDateTime$ = false;
|
|
771
|
+
this.bIsTime$ = false;
|
|
772
|
+
break;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
_filter(event, columnData) {
|
|
777
|
+
// add clickAway listener
|
|
778
|
+
window.addEventListener('mouseup', this._clickAway.bind(this));
|
|
779
|
+
|
|
780
|
+
this.currentFilterRefData = columnData;
|
|
781
|
+
this.filterContainsLabel$ = columnData.config.label;
|
|
782
|
+
|
|
783
|
+
setTimeout(() => {
|
|
784
|
+
this.updateFilterDisplay(columnData.type);
|
|
785
|
+
|
|
786
|
+
this.updateFilterVarsWithCurrent(columnData);
|
|
787
|
+
|
|
788
|
+
this.bShowFilterPopover$ = true;
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
_clickAway(event: any) {
|
|
793
|
+
let bInPopUp = false;
|
|
794
|
+
|
|
795
|
+
// run through list of elements in path, if menu not in th path, then want to
|
|
796
|
+
// hide (toggle) the menu
|
|
797
|
+
const eventPath = event.path;
|
|
798
|
+
for (let pathIndex = 0; pathIndex < eventPath.length; pathIndex++) {
|
|
799
|
+
if (
|
|
800
|
+
eventPath[pathIndex].className == 'psdk-modal-file-top' ||
|
|
801
|
+
eventPath[pathIndex].tagName == 'BUTTON' ||
|
|
802
|
+
eventPath[pathIndex].tagName == 'MAT-OPTION' ||
|
|
803
|
+
eventPath[pathIndex].tagName == 'MAT-INPUT'
|
|
804
|
+
) {
|
|
805
|
+
bInPopUp = true;
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (!bInPopUp) {
|
|
810
|
+
// this.bShowFilterPopover$ = false;
|
|
811
|
+
|
|
812
|
+
window.removeEventListener('mouseup', this._clickAway.bind(this));
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
_filterContainsType(event) {
|
|
817
|
+
this.filterContainsType$ = event.value;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
_filterContainsValue(event) {
|
|
821
|
+
this.filterContainsValue$ = event.target.value;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
_filterContainsDateValue(event, value) {
|
|
825
|
+
this.filterContainsValue$ = value;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
_filterContainsDateTimeValue(event) {
|
|
829
|
+
this.filterContainsValue$ = event.target.value;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
_filterContainsTimeValue(event) {
|
|
833
|
+
this.filterContainsValue$ = event.target.value;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
_onFilterActionButtonClick(event: any) {
|
|
837
|
+
// modal buttons
|
|
838
|
+
switch (event.action) {
|
|
839
|
+
case 'cancel':
|
|
840
|
+
this.currentFilterRefData = [];
|
|
841
|
+
break;
|
|
842
|
+
case 'submit':
|
|
843
|
+
this.updateFilterWithInfo();
|
|
844
|
+
this.filterSortGroupBy();
|
|
845
|
+
break;
|
|
846
|
+
default:
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
this.bShowFilterPopover$ = false;
|
|
851
|
+
|
|
852
|
+
window.removeEventListener('mouseup', this._clickAway.bind(this));
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
updateFilterWithInfo() {
|
|
856
|
+
let bFound = false;
|
|
857
|
+
for (const filterObj of this.filterByColumns) {
|
|
858
|
+
if (filterObj.ref === this.currentFilterRefData.config.name) {
|
|
859
|
+
filterObj.type = this.currentFilterRefData.type;
|
|
860
|
+
filterObj.containsFilter = this.filterContainsType$;
|
|
861
|
+
filterObj.containsFilterValue = this.filterContainsValue$;
|
|
862
|
+
|
|
863
|
+
bFound = true;
|
|
864
|
+
break;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
if (!bFound) {
|
|
869
|
+
// add in
|
|
870
|
+
const filterObj: any = {};
|
|
871
|
+
filterObj.ref = this.currentFilterRefData.config.name;
|
|
872
|
+
filterObj.type = this.currentFilterRefData.type;
|
|
873
|
+
filterObj.containsFilter = this.filterContainsType$;
|
|
874
|
+
filterObj.containsFilterValue = this.filterContainsValue$;
|
|
875
|
+
|
|
876
|
+
this.filterByColumns.push(filterObj);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// iterate through filters and update filterOn icon
|
|
880
|
+
for (const filterObj of this.filterByColumns) {
|
|
881
|
+
const containsFilterValue = filterObj.containsFilterValue;
|
|
882
|
+
const containsFilter = filterObj.containsFilter;
|
|
883
|
+
const filterRef = filterObj.ref;
|
|
884
|
+
const filterIndex = this.displayedColumns$.indexOf(filterRef);
|
|
885
|
+
const arFilterImg = document.getElementsByName('filterOnIcon');
|
|
886
|
+
const filterImg: any = arFilterImg[filterIndex];
|
|
887
|
+
if (containsFilterValue == '' && containsFilter != 'null' && containsFilter != 'notnull') {
|
|
888
|
+
// clear icon
|
|
889
|
+
filterImg.src = '';
|
|
890
|
+
} else {
|
|
891
|
+
// show icon
|
|
892
|
+
filterImg.src = this.filterOnSvgIcon$;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
updateFilterVarsWithCurrent(columnData) {
|
|
898
|
+
// find current ref, if exists, move data to variable to display
|
|
899
|
+
|
|
900
|
+
let bFound = false;
|
|
901
|
+
for (const filterObj of this.filterByColumns) {
|
|
902
|
+
if (filterObj.ref === this.currentFilterRefData.config.name) {
|
|
903
|
+
this.filterContainsType$ = filterObj.containsFilter;
|
|
904
|
+
this.filterContainsValue$ = filterObj.containsFilterValue;
|
|
905
|
+
|
|
906
|
+
bFound = true;
|
|
907
|
+
break;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
if (!bFound) {
|
|
912
|
+
switch (columnData.type) {
|
|
913
|
+
case 'Date':
|
|
914
|
+
case 'DateTime':
|
|
915
|
+
case 'Time':
|
|
916
|
+
this.filterContainsType$ = 'notequal';
|
|
917
|
+
break;
|
|
918
|
+
default:
|
|
919
|
+
this.filterContainsType$ = 'contains';
|
|
920
|
+
break;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
this.filterContainsValue$ = '';
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
filterData(item: any) {
|
|
928
|
+
let bKeep = true;
|
|
929
|
+
for (const filterObj of this.filterByColumns) {
|
|
930
|
+
if (filterObj.containsFilterValue != '' || filterObj.containsFilter == 'null' || filterObj.containsFilter == 'notnull') {
|
|
931
|
+
let filterValue: any;
|
|
932
|
+
|
|
933
|
+
switch (filterObj.type) {
|
|
934
|
+
case 'Date':
|
|
935
|
+
case 'DateTime':
|
|
936
|
+
case 'Time':
|
|
937
|
+
bKeep = this.filterDataWithDate(item, filterObj, filterValue);
|
|
938
|
+
break;
|
|
939
|
+
default:
|
|
940
|
+
bKeep = this.filterDataWithCommonTypes(item, filterObj, filterValue);
|
|
941
|
+
break;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// if don't keep stop filtering
|
|
946
|
+
if (!bKeep) {
|
|
947
|
+
break;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
return bKeep;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
filterDataWithDate(item, filterObj, filterValue) {
|
|
955
|
+
let bKeep;
|
|
956
|
+
let value = item[filterObj.ref] != null ?? item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
|
|
957
|
+
filterValue = filterObj.containsFilterValue != null && filterObj.containsFilterValue != '' ? getSeconds(filterObj.containsFilterValue) : null;
|
|
958
|
+
|
|
959
|
+
switch (filterObj.containsFilter) {
|
|
960
|
+
case 'notequal':
|
|
961
|
+
// becasue filterValue is in minutes, need to have a range of less than 60 secons
|
|
962
|
+
if (value != null && filterValue != null) {
|
|
963
|
+
// get rid of millisecons
|
|
964
|
+
value /= 1000;
|
|
965
|
+
filterValue /= 1000;
|
|
966
|
+
|
|
967
|
+
const diff = value - filterValue;
|
|
968
|
+
if (diff >= 0 && diff < 60) {
|
|
969
|
+
bKeep = false;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
break;
|
|
973
|
+
case 'after':
|
|
974
|
+
if (value < filterValue) {
|
|
975
|
+
bKeep = false;
|
|
976
|
+
}
|
|
977
|
+
break;
|
|
978
|
+
case 'before':
|
|
979
|
+
if (value > filterValue) {
|
|
980
|
+
bKeep = false;
|
|
981
|
+
}
|
|
982
|
+
break;
|
|
983
|
+
case 'null':
|
|
984
|
+
if (value != null) {
|
|
985
|
+
bKeep = false;
|
|
986
|
+
}
|
|
987
|
+
break;
|
|
988
|
+
case 'notnull':
|
|
989
|
+
if (value == null) {
|
|
990
|
+
bKeep = false;
|
|
991
|
+
}
|
|
992
|
+
break;
|
|
993
|
+
default:
|
|
994
|
+
break;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
return bKeep;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
filterDataWithCommonTypes(item, filterObj, filterValue) {
|
|
1001
|
+
let bKeep;
|
|
1002
|
+
const value = item[filterObj.ref].toLowerCase();
|
|
1003
|
+
filterValue = filterObj.containsFilterValue.toLowerCase();
|
|
1004
|
+
|
|
1005
|
+
switch (filterObj.containsFilter) {
|
|
1006
|
+
case 'contains':
|
|
1007
|
+
if (value.indexOf(filterValue) < 0) {
|
|
1008
|
+
bKeep = false;
|
|
1009
|
+
}
|
|
1010
|
+
break;
|
|
1011
|
+
case 'equals':
|
|
1012
|
+
if (value != filterValue) {
|
|
1013
|
+
bKeep = false;
|
|
1014
|
+
}
|
|
1015
|
+
break;
|
|
1016
|
+
case 'startswith':
|
|
1017
|
+
if (value.indexOf(filterValue) != 0) {
|
|
1018
|
+
bKeep = false;
|
|
1019
|
+
}
|
|
1020
|
+
break;
|
|
1021
|
+
default:
|
|
1022
|
+
break;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
return bKeep;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
filterSortGroupBy() {
|
|
1029
|
+
// get original data set
|
|
1030
|
+
let theData = this.repeatListData.slice();
|
|
1031
|
+
|
|
1032
|
+
// last filter config data is global
|
|
1033
|
+
theData = theData.filter(this.filterData.bind(this));
|
|
1034
|
+
|
|
1035
|
+
// last sort config data is global
|
|
1036
|
+
theData.sort(this.sortCompare.bind(this));
|
|
1037
|
+
|
|
1038
|
+
const reGroupData = this.addGroups(theData, this.groupByColumns$);
|
|
1039
|
+
|
|
1040
|
+
this.repeatList$.data = [];
|
|
1041
|
+
this.repeatList$.data.push(...reGroupData);
|
|
1042
|
+
|
|
1043
|
+
if (this.searchFilter && this.searchFilter != '') {
|
|
1044
|
+
this.repeatList$.filter = this.searchFilter;
|
|
1045
|
+
} else {
|
|
1046
|
+
this.perfFilter = performance.now().toString();
|
|
1047
|
+
this.repeatList$.filter = this.perfFilter;
|
|
1048
|
+
}
|
|
1049
|
+
this.repeatList$.filter = '';
|
|
1050
|
+
|
|
1051
|
+
if (this.repeatList$.paginator) {
|
|
1052
|
+
this.repeatList$.paginator.firstPage();
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
//
|
|
1057
|
+
// Grouping code inspired by this example
|
|
1058
|
+
// https://stackblitz.com/edit/angular-material-table-row-grouping
|
|
1059
|
+
//
|
|
1060
|
+
|
|
1061
|
+
_showUnGroupBy(columnData): boolean {
|
|
1062
|
+
for (const val of this.groupByColumns$) {
|
|
1063
|
+
if (val == columnData.config.name) {
|
|
1064
|
+
return true;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
return false;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
_groupBy(event, columnData) {
|
|
1072
|
+
this.checkGroupByColumn(columnData.config.name, true);
|
|
1073
|
+
|
|
1074
|
+
this.filterSortGroupBy();
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
_unGroupBy(event, columnData) {
|
|
1078
|
+
// event.stopPropagation();
|
|
1079
|
+
this.checkGroupByColumn(columnData.config.name, false);
|
|
1080
|
+
|
|
1081
|
+
this.filterSortGroupBy();
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
checkGroupByColumn(field, add) {
|
|
1085
|
+
let found: number | null = null;
|
|
1086
|
+
for (const column of this.groupByColumns$) {
|
|
1087
|
+
if (column === field) {
|
|
1088
|
+
found = this.groupByColumns$.indexOf(column, 0);
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
if (found != null && found >= 0) {
|
|
1092
|
+
if (!add) {
|
|
1093
|
+
this.groupByColumns$.splice(found, 1);
|
|
1094
|
+
}
|
|
1095
|
+
} else if (add) {
|
|
1096
|
+
this.groupByColumns$.push(field);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
addGroups(data: any[], groupByColumns: string[]): any[] {
|
|
1101
|
+
const rootGroup = new Group();
|
|
1102
|
+
rootGroup.expanded = true;
|
|
1103
|
+
return this.getSublevel(data, 0, groupByColumns, rootGroup);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
getSublevel(data: any[], level: number, groupByColumns: string[], parent: Group): any[] {
|
|
1107
|
+
if (level >= groupByColumns.length) {
|
|
1108
|
+
return data;
|
|
1109
|
+
}
|
|
1110
|
+
const groups = this.uniqueBy(
|
|
1111
|
+
data.map(row => {
|
|
1112
|
+
const result = new Group();
|
|
1113
|
+
result.level = level + 1;
|
|
1114
|
+
result.parent = parent;
|
|
1115
|
+
for (let i = 0; i <= level; i++) {
|
|
1116
|
+
result[groupByColumns[i]] = row[groupByColumns[i]];
|
|
1117
|
+
}
|
|
1118
|
+
return result;
|
|
1119
|
+
}),
|
|
1120
|
+
JSON.stringify
|
|
1121
|
+
);
|
|
1122
|
+
|
|
1123
|
+
const currentColumn = groupByColumns[level];
|
|
1124
|
+
let subGroups: any[] = [];
|
|
1125
|
+
groups.forEach(group => {
|
|
1126
|
+
const rowsInGroup = data.filter(row => group[currentColumn] === row[currentColumn]);
|
|
1127
|
+
group.totalCounts = rowsInGroup.length;
|
|
1128
|
+
const subGroup = this.getSublevel(rowsInGroup, level + 1, groupByColumns, group);
|
|
1129
|
+
subGroup.unshift(group);
|
|
1130
|
+
subGroups = subGroups.concat(subGroup);
|
|
1131
|
+
});
|
|
1132
|
+
return subGroups;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
uniqueBy(a, key) {
|
|
1136
|
+
const seen = {};
|
|
1137
|
+
return a.filter(item => {
|
|
1138
|
+
const k = key(item);
|
|
1139
|
+
// eslint-disable-next-line no-return-assign, no-prototype-builtins
|
|
1140
|
+
return seen.hasOwnProperty(k) ? false : (seen[k] = true);
|
|
1141
|
+
});
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
isGroup(index, item): boolean {
|
|
1145
|
+
return item.level;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
_groupHeaderClick(row) {
|
|
1149
|
+
row.expanded = !row.expanded;
|
|
1150
|
+
// this.repeatList$.filter = "";
|
|
1151
|
+
this.perfFilter = performance.now().toString();
|
|
1152
|
+
this.repeatList$.filter = this.perfFilter;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
// below is for grid row grouping
|
|
1156
|
+
customFilterPredicate(data: any | Group, filter: string): boolean {
|
|
1157
|
+
return data instanceof Group ? data.visible : this.getDataRowVisibleWithFilter(data, filter);
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
getDataRowVisible(data: any): boolean {
|
|
1161
|
+
const groupRows = this.repeatList$.data.filter(row => {
|
|
1162
|
+
if (!(row instanceof Group)) {
|
|
1163
|
+
return false;
|
|
1164
|
+
}
|
|
1165
|
+
let match = true;
|
|
1166
|
+
this.groupByColumns$.forEach(column => {
|
|
1167
|
+
if (!row[column] || !data[column] || row[column] !== data[column]) {
|
|
1168
|
+
match = false;
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
return match;
|
|
1172
|
+
});
|
|
1173
|
+
|
|
1174
|
+
if (groupRows.length === 0) {
|
|
1175
|
+
return true;
|
|
1176
|
+
}
|
|
1177
|
+
const parent = groupRows[0] as Group;
|
|
1178
|
+
return parent.visible && parent.expanded;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
getDataRowVisibleWithFilter(data, filter) {
|
|
1182
|
+
// fist check if row is visible with grouping
|
|
1183
|
+
let bVisible = this.getDataRowVisible(data);
|
|
1184
|
+
|
|
1185
|
+
if (bVisible && filter && filter != '' && filter != this.perfFilter) {
|
|
1186
|
+
// now check if row is filtered.
|
|
1187
|
+
|
|
1188
|
+
// assume not there unless we find it
|
|
1189
|
+
bVisible = false;
|
|
1190
|
+
for (const col of this.displayedColumns$) {
|
|
1191
|
+
// filter is lower case
|
|
1192
|
+
if (data[col] && data[col].toString().toLowerCase().indexOf(filter) >= 0) {
|
|
1193
|
+
bVisible = true;
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
return bVisible;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
updateData(listData: any[], fieldData: any[]): any[] {
|
|
1203
|
+
const returnList: any[] = new Array<any>();
|
|
1204
|
+
listData.forEach(row => {
|
|
1205
|
+
// copy
|
|
1206
|
+
const rowData = JSON.parse(JSON.stringify(row));
|
|
1207
|
+
|
|
1208
|
+
for (let fieldIndex = 0; fieldIndex < fieldData.length; fieldIndex++) {
|
|
1209
|
+
const config = fieldData[fieldIndex].config;
|
|
1210
|
+
let fieldName;
|
|
1211
|
+
let formattedDate;
|
|
1212
|
+
let myFormat;
|
|
1213
|
+
let theCurrencyOptions;
|
|
1214
|
+
|
|
1215
|
+
switch (fieldData[fieldIndex].type) {
|
|
1216
|
+
case 'Date':
|
|
1217
|
+
fieldName = config.name;
|
|
1218
|
+
myFormat = config.formatter;
|
|
1219
|
+
if (!myFormat) {
|
|
1220
|
+
myFormat = 'Date';
|
|
1221
|
+
}
|
|
1222
|
+
formattedDate = this.utils.generateDate(rowData[fieldName], myFormat);
|
|
1223
|
+
|
|
1224
|
+
rowData[fieldName] = formattedDate;
|
|
1225
|
+
break;
|
|
1226
|
+
case 'DateTime':
|
|
1227
|
+
fieldName = config.name;
|
|
1228
|
+
myFormat = config.formatter;
|
|
1229
|
+
if (!myFormat) {
|
|
1230
|
+
myFormat = 'DateTime-Long';
|
|
1231
|
+
}
|
|
1232
|
+
formattedDate = this.utils.generateDateTime(rowData[fieldName], myFormat);
|
|
1233
|
+
|
|
1234
|
+
rowData[fieldName] = formattedDate;
|
|
1235
|
+
break;
|
|
1236
|
+
case 'Currency':
|
|
1237
|
+
fieldName = config.name;
|
|
1238
|
+
theCurrencyOptions = getCurrencyOptions(PCore.getEnvironmentInfo().getLocale() as string);
|
|
1239
|
+
// eslint-disable-next-line no-case-declarations
|
|
1240
|
+
const defaultOptions = {
|
|
1241
|
+
locale: getLocale(),
|
|
1242
|
+
position: 'before',
|
|
1243
|
+
decPlaces: 2
|
|
1244
|
+
};
|
|
1245
|
+
// eslint-disable-next-line no-case-declarations
|
|
1246
|
+
const params = { ...defaultOptions, ...theCurrencyOptions };
|
|
1247
|
+
rowData[fieldName] = formatters.Currency(rowData[fieldName], params);
|
|
1248
|
+
// val = format(value, column.type, theCurrencyOptions);
|
|
1249
|
+
break;
|
|
1250
|
+
default:
|
|
1251
|
+
break;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
returnList.push(rowData);
|
|
1255
|
+
});
|
|
1256
|
+
|
|
1257
|
+
return returnList;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
openAssignment(row) {
|
|
1261
|
+
const { pxRefObjectClass, pzInsKey } = row;
|
|
1262
|
+
const sTarget = this.pConn$.getContainerName();
|
|
1263
|
+
const options: any = { containerName: sTarget };
|
|
1264
|
+
this.pConn$.getActionsApi().openAssignment(pzInsKey, pxRefObjectClass, options);
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
openWork(row) {
|
|
1268
|
+
const pxRefObjectClass = row.pxRefObjectClass || row.pxObjClass;
|
|
1269
|
+
const { pxRefObjectKey } = row;
|
|
1270
|
+
if (pxRefObjectClass !== '' && pxRefObjectKey !== '') {
|
|
1271
|
+
this.pConn$.getActionsApi().openWorkByHandle(pxRefObjectKey, pxRefObjectClass);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
initializeData(data) {
|
|
1276
|
+
data.forEach((item, idx) => {
|
|
1277
|
+
item.__original_index = idx;
|
|
1278
|
+
item.__level = 1;
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1281
|
+
return data;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
getType(field) {
|
|
1285
|
+
const { config = {}, type } = field;
|
|
1286
|
+
const { formatType } = config;
|
|
1287
|
+
if (formatType === 'datetime' || formatType === 'date') {
|
|
1288
|
+
// currently cosmos has only support for date ... it also need to support dateTime
|
|
1289
|
+
return 'date';
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
return type.toLowerCase();
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
initializeColumns(fields = []) {
|
|
1296
|
+
return fields.map((field: any, originalColIndex) => ({
|
|
1297
|
+
...field,
|
|
1298
|
+
type: this.getType(field),
|
|
1299
|
+
name: field.config.value.substring(4),
|
|
1300
|
+
label: field.config.label.substring(3),
|
|
1301
|
+
id: originalColIndex,
|
|
1302
|
+
groupingEnabled: true,
|
|
1303
|
+
grouped: false,
|
|
1304
|
+
minWidth: 50,
|
|
1305
|
+
cellRenderer: this.getType(field) === 'text' ? null : field.type,
|
|
1306
|
+
filter: true
|
|
1307
|
+
}));
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
getHeaderCells(colFields, fields) {
|
|
1311
|
+
const AssignDashObjects = ['Assign-Worklist', 'Assign-WorkBasket'];
|
|
1312
|
+
return colFields.map((field: any, index) => {
|
|
1313
|
+
let theField = field.config.value.substring(field.config.value.indexOf(' ') + 1);
|
|
1314
|
+
if (theField.indexOf('.') === 0) {
|
|
1315
|
+
theField = theField.substring(1);
|
|
1316
|
+
}
|
|
1317
|
+
const colIndex = fields.findIndex(ele => ele.name === theField);
|
|
1318
|
+
const displayAsLink = field.config.displayAsLink;
|
|
1319
|
+
const headerRow: any = {};
|
|
1320
|
+
headerRow.id = fields[index].id;
|
|
1321
|
+
headerRow.type = field.type;
|
|
1322
|
+
headerRow.displayAsLink = displayAsLink;
|
|
1323
|
+
headerRow.numeric = field.type === 'Decimal' || field.type === 'Integer' || field.type === 'Percentage' || field.type === 'Currency' || false;
|
|
1324
|
+
headerRow.disablePadding = false;
|
|
1325
|
+
headerRow.label = fields[index].label;
|
|
1326
|
+
if (colIndex > -1) {
|
|
1327
|
+
headerRow.classID = fields[colIndex].classID;
|
|
1328
|
+
}
|
|
1329
|
+
if (displayAsLink) {
|
|
1330
|
+
headerRow.isAssignmentLink = AssignDashObjects.includes(headerRow.classID);
|
|
1331
|
+
if (field.config.value?.startsWith('@CA')) {
|
|
1332
|
+
headerRow.isAssociation = true;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return headerRow;
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
buildSelect(fieldDefs, colId, patchQueryFields = [], compositeKeys = []) {
|
|
1340
|
+
const listFields: any = [];
|
|
1341
|
+
if (colId) {
|
|
1342
|
+
const field = this.getField(fieldDefs, colId);
|
|
1343
|
+
listFields.push({
|
|
1344
|
+
field: field.name
|
|
1345
|
+
});
|
|
1346
|
+
} else {
|
|
1347
|
+
// NOTE: If we ever decide to not set up all the `fieldDefs` on select, ensure that the fields
|
|
1348
|
+
// corresponding to `state.groups` are set up. Needed in Client-mode grouping/pagination.
|
|
1349
|
+
fieldDefs.forEach(field => {
|
|
1350
|
+
if (!listFields.find(f => f.field === field.name)) {
|
|
1351
|
+
listFields.push({
|
|
1352
|
+
field: field.name
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
patchQueryFields.forEach(k => {
|
|
1357
|
+
if (!listFields.find(f => f.field === k)) {
|
|
1358
|
+
listFields.push({
|
|
1359
|
+
field: k
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
compositeKeys.forEach(k => {
|
|
1366
|
+
if (!listFields.find(f => f.field === k)) {
|
|
1367
|
+
listFields.push({
|
|
1368
|
+
field: k
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
return listFields;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
getField(fieldDefs, columnId) {
|
|
1376
|
+
const fieldsMap = this.getFieldsMap(fieldDefs);
|
|
1377
|
+
return fieldsMap.get(columnId);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
getFieldsMap(fieldDefs) {
|
|
1381
|
+
const fieldsMap = new Map();
|
|
1382
|
+
fieldDefs.forEach(element => {
|
|
1383
|
+
fieldsMap.set(element.id, element);
|
|
1384
|
+
});
|
|
1385
|
+
return fieldsMap;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
addItemKeyInSelect(fieldDefs, itemKey, select, compositeKeys) {
|
|
1389
|
+
const elementFound = this.getField(fieldDefs, itemKey);
|
|
1390
|
+
|
|
1391
|
+
if (
|
|
1392
|
+
itemKey &&
|
|
1393
|
+
!elementFound &&
|
|
1394
|
+
Array.isArray(select) &&
|
|
1395
|
+
!(compositeKeys !== null && compositeKeys?.length) &&
|
|
1396
|
+
!select.find(sel => sel.field === itemKey)
|
|
1397
|
+
) {
|
|
1398
|
+
return [
|
|
1399
|
+
...select,
|
|
1400
|
+
{
|
|
1401
|
+
field: itemKey
|
|
1402
|
+
}
|
|
1403
|
+
];
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
return select;
|
|
1407
|
+
}
|
|
1408
|
+
}
|