@mediusinc/mng-commons 6.0.0-rc.5 → 6.0.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/core/components/notification/notification-wrapper.component.d.ts +4 -4
- package/core/data-list/data-list-params-helpers.d.ts +1 -0
- package/core/directives/component.directive.d.ts +11 -13
- package/core/directives/rerender.directive.d.ts +1 -1
- package/core/directives/template.directive.d.ts +3 -7
- package/core/error/error.model.d.ts +4 -4
- package/core/helpers/notification.d.ts +2 -2
- package/core/i18n/i18n-common.d.ts +2 -2
- package/core/provide.d.ts +3 -3
- package/core/styles/style-constants.d.ts +9 -8
- package/core/styles/style.model.d.ts +2 -1
- package/fesm2022/mediusinc-mng-commons-core.mjs +167 -201
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +8 -9
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +151 -52
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-a8KG1NIX.mjs +30 -0
- package/fesm2022/mediusinc-mng-commons-table-column-toggle.component-a8KG1NIX.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-C2vrMoNL.mjs +2130 -0
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-C2vrMoNL.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs +1 -2154
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +97 -49
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +332 -293
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons.mjs.map +1 -1
- package/form/api/index.d.ts +1 -0
- package/form/api/models/empty-value.model.d.ts +7 -0
- package/form/components/autocomplete/autocomplete.component.d.ts +1 -2
- package/form/components/date-range/date-range.component.d.ts +4 -3
- package/form/components/dropdown/dropdown.component.d.ts +3 -2
- package/form/components/number-range/number-range.component.d.ts +3 -2
- package/form/directives/input-empty-value.directive.d.ts +40 -0
- package/form/directives/input-trim.directive.d.ts +3 -5
- package/form/index.d.ts +1 -0
- package/i18n/en.json +57 -8
- package/i18n/sl.json +1 -3
- package/package.json +10 -36
- package/provide.d.ts +2 -2
- package/table/components/column-toggle/column-toggle.component.d.ts +12 -0
- package/table/components/filter/filter-form/filter-form.component.d.ts +2 -2
- package/table/components/table/table.component.d.ts +0 -1
- package/table/helpers/filters.d.ts +3 -2
- package/table/helpers/notification.d.ts +2 -2
- package/table/provide.d.ts +7 -0
- package/table/services/table-metadata.service.d.ts +3 -3
- package/tableview/action/components/action/action.component.d.ts +1 -0
- package/tableview/action/components/editor/action-editor.component.d.ts +1 -1
- package/tableview/action/components/table/action-table.component.d.ts +2 -1
- package/tableview/action/helpers/notification.d.ts +3 -3
- package/tableview/action/models/execution/action-context.model.d.ts +2 -2
- package/tableview/action/services/action-executor.service.d.ts +1 -1
- package/tableview/api/action/descriptors/action.descriptor.d.ts +3 -3
- package/tableview/api/action/models/action-confirmation.model.d.ts +4 -2
- package/tableview/api/action/models/execution/action-context.model.d.ts +2 -2
- package/tableview/api/editor/descriptors/editor.descriptor.d.ts +5 -0
- package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +14 -10
- package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +10 -0
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +36 -9
- package/tableview/api/editor/descriptors/wrappers/editor-descriptor-nested-object-wrapper.d.ts +1 -1
- package/tableview/api/editor/models/field-action-context.model.d.ts +1 -1
- package/tableview/api/editor/models/field.model.d.ts +1 -2
- package/tableview/api/editor/models/form-editor.interface.d.ts +2 -2
- package/tableview/api/editor/models/formly-custom-field.model.d.ts +1 -1
- package/tableview/api/editor/models/formly-field.model.d.ts +2 -2
- package/tableview/editor/components/editor/form-editor.component.d.ts +2 -2
- package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +1 -1
- package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +2 -1
- package/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +4 -6
- package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +0 -2
- package/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +2 -2
- package/tableview/editor/components/formly/fields/formly-field-type.abstract.component.d.ts +8 -15
- package/tableview/editor/components/formly/fields/formly-group-type.abstract.component.d.ts +7 -0
- package/tableview/editor/components/formly/fields/formly-type.abstract.component.d.ts +20 -0
- package/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.d.ts +11 -4
- package/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +2 -1
- package/tableview/editor/helpers/formly-config.d.ts +1 -1
- package/tableview/editor/helpers/notification.d.ts +3 -3
- package/tableview/editor/models/formly-config.model.d.ts +10 -1
- package/tableview/editor/models/formly.model.d.ts +23 -0
- package/tableview/editor/services/form-editor.service.d.ts +2 -2
- package/tableview/tableview/router/tableview-route-builder.d.ts +10 -3
- package/tableview/tableview/services/tableview-feature-config.token.d.ts +1 -1
- package/version-info.json +3 -3
- package/esm2022/core/action/action-data.model.mjs +0 -2
- package/esm2022/core/action/action-parameters.model.mjs +0 -2
- package/esm2022/core/components/notification/notification-wrapper.component.mjs +0 -50
- package/esm2022/core/data-list/data-list-params-helpers.mjs +0 -465
- package/esm2022/core/data-list/data-list.model.mjs +0 -2
- package/esm2022/core/data-list/filter-match.model.mjs +0 -105
- package/esm2022/core/data-list/filter-metadata.model.mjs +0 -2
- package/esm2022/core/data-providers/base.data-provider.mjs +0 -16
- package/esm2022/core/data-providers/lookup.data-provider.mjs +0 -2
- package/esm2022/core/descriptors/action.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/column.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/editor.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/enum.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/filter.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/lookup.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/model.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/table.descriptor.mjs +0 -2
- package/esm2022/core/descriptors/tableview.descriptor.mjs +0 -2
- package/esm2022/core/directives/component.directive.mjs +0 -75
- package/esm2022/core/directives/rerender.directive.mjs +0 -25
- package/esm2022/core/directives/template.directive.mjs +0 -29
- package/esm2022/core/enum/enum-helpers.mjs +0 -90
- package/esm2022/core/enum/enum.model.mjs +0 -2
- package/esm2022/core/error/error-handler.mjs +0 -20
- package/esm2022/core/error/error-helpers.mjs +0 -273
- package/esm2022/core/error/error.model.mjs +0 -33
- package/esm2022/core/helpers/coercion.mjs +0 -55
- package/esm2022/core/helpers/date.mjs +0 -119
- package/esm2022/core/helpers/notification.mjs +0 -21
- package/esm2022/core/helpers/number.mjs +0 -19
- package/esm2022/core/helpers/object.mjs +0 -152
- package/esm2022/core/helpers/route.mjs +0 -58
- package/esm2022/core/helpers/string.mjs +0 -57
- package/esm2022/core/helpers/templates.mjs +0 -4
- package/esm2022/core/helpers/type-helpers.mjs +0 -2
- package/esm2022/core/i18n/i18n-common.mjs +0 -24
- package/esm2022/core/i18n/i18n-error.mjs +0 -29
- package/esm2022/core/i18n/i18n-type.mjs +0 -46
- package/esm2022/core/index.mjs +0 -107
- package/esm2022/core/log/log-publisher-console.service.mjs +0 -40
- package/esm2022/core/log/log.model.mjs +0 -10
- package/esm2022/core/log/logger.service.mjs +0 -131
- package/esm2022/core/mediusinc-mng-commons-core.mjs +0 -5
- package/esm2022/core/models/class-attribute.model.mjs +0 -2
- package/esm2022/core/models/class-service.model.mjs +0 -2
- package/esm2022/core/models/getter.model.mjs +0 -2
- package/esm2022/core/models/i18n.model.mjs +0 -2
- package/esm2022/core/models/menu.model.mjs +0 -2
- package/esm2022/core/models/user.model.mjs +0 -2
- package/esm2022/core/models/version.model.mjs +0 -2
- package/esm2022/core/pipes/boolean.pipe.mjs +0 -34
- package/esm2022/core/pipes/class-map.pipe.mjs +0 -23
- package/esm2022/core/pipes/enum.pipe.mjs +0 -38
- package/esm2022/core/pipes/enumerate-async.pipe.mjs +0 -36
- package/esm2022/core/pipes/enumerate.pipe.mjs +0 -49
- package/esm2022/core/pipes/getter.pipe.mjs +0 -21
- package/esm2022/core/pipes/i18n-property.pipe.mjs +0 -19
- package/esm2022/core/pipes/json-path.pipe.mjs +0 -25
- package/esm2022/core/pipes/parametrize.pipe.mjs +0 -86
- package/esm2022/core/pipes/template.pipe.mjs +0 -25
- package/esm2022/core/provide.mjs +0 -79
- package/esm2022/core/reactivity/effect.mjs +0 -22
- package/esm2022/core/reflect/type-enum-decorator.mjs +0 -12
- package/esm2022/core/reflect/type-enum-metadata.mjs +0 -62
- package/esm2022/core/registry/registry.model.mjs +0 -2
- package/esm2022/core/registry/type-registry.mjs +0 -106
- package/esm2022/core/router/route-builder.mjs +0 -431
- package/esm2022/core/router/router.model.mjs +0 -2
- package/esm2022/core/router/routes-builder.mjs +0 -52
- package/esm2022/core/rxjs/map-data-list-result-operator.mjs +0 -22
- package/esm2022/core/security/permission-helpers.mjs +0 -14
- package/esm2022/core/security/permission.guard.mjs +0 -15
- package/esm2022/core/security/permission.service.mjs +0 -101
- package/esm2022/core/security/permissions.model.mjs +0 -93
- package/esm2022/core/services/commons-configuration.service.mjs +0 -189
- package/esm2022/core/services/commons-init.service.mjs +0 -111
- package/esm2022/core/services/commons-router.service.mjs +0 -181
- package/esm2022/core/services/commons-storage.service.mjs +0 -31
- package/esm2022/core/services/commons.service.mjs +0 -324
- package/esm2022/core/services/providers/commons-init.provider.mjs +0 -4
- package/esm2022/core/services/tokens/browser-storage.token.mjs +0 -3
- package/esm2022/core/services/tokens/commons-init.token.mjs +0 -3
- package/esm2022/core/services/tokens/log-publisher.token.mjs +0 -3
- package/esm2022/core/services/tokens/module-config.token.mjs +0 -3
- package/esm2022/core/styles/style-constants.mjs +0 -11
- package/esm2022/core/styles/style.model.mjs +0 -20
- package/esm2022/filter/descriptors/filter-generic.descriptor.mjs +0 -31
- package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +0 -168
- package/esm2022/filter/descriptors/filter.descriptor.mjs +0 -421
- package/esm2022/filter/index.mjs +0 -8
- package/esm2022/filter/mediusinc-mng-commons-filter.mjs +0 -5
- package/esm2022/filter/models/filter-generic-property.model.mjs +0 -2
- package/esm2022/filter/models/filter.model.mjs +0 -20
- package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +0 -15
- package/esm2022/form/api/data-providers/lookup.data-provider.mjs +0 -15
- package/esm2022/form/api/descriptors/action-button.descriptor.mjs +0 -56
- package/esm2022/form/api/descriptors/button-style.builder.mjs +0 -153
- package/esm2022/form/api/index.mjs +0 -10
- package/esm2022/form/api/mediusinc-mng-commons-form-api.mjs +0 -5
- package/esm2022/form/api/models/button.model.mjs +0 -2
- package/esm2022/form/api/models/trim.model.mjs +0 -2
- package/esm2022/form/components/autocomplete/autocomplete.component.mjs +0 -436
- package/esm2022/form/components/date-range/date-range.component.mjs +0 -147
- package/esm2022/form/components/dropdown/dropdown.component.mjs +0 -372
- package/esm2022/form/components/number-range/number-range.component.mjs +0 -123
- package/esm2022/form/directives/input-trim.directive.mjs +0 -50
- package/esm2022/form/index.mjs +0 -8
- package/esm2022/form/mediusinc-mng-commons-form.mjs +0 -5
- package/esm2022/index.mjs +0 -2
- package/esm2022/mediusinc-mng-commons.mjs +0 -5
- package/esm2022/model/class/data-providers/base-from-class-data-provider.factory.mjs +0 -5
- package/esm2022/model/class/descriptors/model-class.descriptor.mjs +0 -28
- package/esm2022/model/class/descriptors/type-class.descriptor.mjs +0 -6
- package/esm2022/model/class/helpers/model.mjs +0 -53
- package/esm2022/model/class/index.mjs +0 -8
- package/esm2022/model/class/mediusinc-mng-commons-model-class.mjs +0 -5
- package/esm2022/model/data-providers/base-from-type-data-provider.factory.mjs +0 -13
- package/esm2022/model/descriptors/enum.descriptor.mjs +0 -28
- package/esm2022/model/descriptors/model.descriptor.mjs +0 -53
- package/esm2022/model/descriptors/type.descriptor.mjs +0 -7
- package/esm2022/model/helpers/i18n.mjs +0 -47
- package/esm2022/model/index.mjs +0 -9
- package/esm2022/model/mediusinc-mng-commons-model.mjs +0 -5
- package/esm2022/provide.mjs +0 -6
- package/esm2022/table/api/class/class-table-attribute-converter.mjs +0 -80
- package/esm2022/table/api/class/class-table-attribute.model.mjs +0 -2
- package/esm2022/table/api/class/class-table-data-provider.factory.mjs +0 -5
- package/esm2022/table/api/class/class-table-descriptor-helpers.mjs +0 -99
- package/esm2022/table/api/class/class-table-descriptor.factory.mjs +0 -21
- package/esm2022/table/api/class/index.mjs +0 -6
- package/esm2022/table/api/class/mediusinc-mng-commons-table-api-class.mjs +0 -5
- package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +0 -15
- package/esm2022/table/api/data-providers/table.data-provider.mjs +0 -33
- package/esm2022/table/api/descriptors/column.descriptor.mjs +0 -475
- package/esm2022/table/api/descriptors/sort.descriptor.mjs +0 -67
- package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +0 -22
- package/esm2022/table/api/descriptors/table.descriptor.mjs +0 -1116
- package/esm2022/table/api/helpers/column-converter.mjs +0 -25
- package/esm2022/table/api/helpers/table-data-provider-descriptor-convert.mjs +0 -7
- package/esm2022/table/api/index.mjs +0 -19
- package/esm2022/table/api/mediusinc-mng-commons-table-api.mjs +0 -5
- package/esm2022/table/api/models/column-value.model.mjs +0 -2
- package/esm2022/table/api/models/column.model.mjs +0 -21
- package/esm2022/table/api/models/row-expandable-component.model.mjs +0 -2
- package/esm2022/table/api/models/table-columns.model.mjs +0 -2
- package/esm2022/table/api/models/table-event.model.mjs +0 -2
- package/esm2022/table/api/models/table.model.mjs +0 -21
- package/esm2022/table/components/column-filter/column-filter.component.mjs +0 -389
- package/esm2022/table/components/column-value/column-value.component.mjs +0 -78
- package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +0 -55
- package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +0 -226
- package/esm2022/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.mjs +0 -219
- package/esm2022/table/components/table/table.component.mjs +0 -319
- package/esm2022/table/helpers/filters.mjs +0 -312
- package/esm2022/table/helpers/notification.mjs +0 -21
- package/esm2022/table/helpers/table-layout-prefs.mjs +0 -10
- package/esm2022/table/helpers/table.mjs +0 -24
- package/esm2022/table/index.mjs +0 -24
- package/esm2022/table/mediusinc-mng-commons-table.mjs +0 -5
- package/esm2022/table/models/column-preferences.model.mjs +0 -2
- package/esm2022/table/models/filter.model.mjs +0 -2
- package/esm2022/table/pipes/filter-value.pipe.mjs +0 -77
- package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +0 -27
- package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +0 -25
- package/esm2022/table/provide.mjs +0 -19
- package/esm2022/table/services/table-data.service.mjs +0 -194
- package/esm2022/table/services/table-feature-config.token.mjs +0 -3
- package/esm2022/table/services/table-metadata.service.mjs +0 -136
- package/esm2022/table/services/table-preferences.service.mjs +0 -142
- package/esm2022/tableview/action/components/action/action.component.mjs +0 -277
- package/esm2022/tableview/action/components/editor/action-editor.component.mjs +0 -86
- package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +0 -428
- package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +0 -35
- package/esm2022/tableview/action/components/route/action-route.component.mjs +0 -146
- package/esm2022/tableview/action/components/table/action-table.component.mjs +0 -102
- package/esm2022/tableview/action/guards/unsaved-changes.guard.mjs +0 -4
- package/esm2022/tableview/action/helpers/action-execution.mjs +0 -25
- package/esm2022/tableview/action/helpers/i18n.mjs +0 -102
- package/esm2022/tableview/action/helpers/notification.mjs +0 -78
- package/esm2022/tableview/action/helpers/styles.mjs +0 -32
- package/esm2022/tableview/action/models/action-editor-dialog-data.model.mjs +0 -2
- package/esm2022/tableview/action/models/can-component-deactivate.model.mjs +0 -2
- package/esm2022/tableview/action/models/execution/action-context.model.mjs +0 -64
- package/esm2022/tableview/action/models/execution/action-instance.model.mjs +0 -169
- package/esm2022/tableview/action/services/action-error-mapper.service.mjs +0 -20
- package/esm2022/tableview/action/services/action-executor.service.mjs +0 -772
- package/esm2022/tableview/action/services/component-action-executor.service.mjs +0 -19
- package/esm2022/tableview/action/services/data-provider-executor.service.mjs +0 -41
- package/esm2022/tableview/action/services/navigation.service.mjs +0 -53
- package/esm2022/tableview/action/services/providers/provide-action-executor.mjs +0 -9
- package/esm2022/tableview/action/services/providers/provide-view-container.mjs +0 -17
- package/esm2022/tableview/action/services/root-action-executor.service.mjs +0 -18
- package/esm2022/tableview/action/services/tokens/action-editor.token.mjs +0 -3
- package/esm2022/tableview/action/services/view-container.service.mjs +0 -40
- package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +0 -28
- package/esm2022/tableview/api/action/descriptors/action-editor-descriptor.factory.mjs +0 -30
- package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +0 -223
- package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +0 -32
- package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +0 -74
- package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +0 -302
- package/esm2022/tableview/api/action/descriptors/editor-action-descriptor.factory.mjs +0 -21
- package/esm2022/tableview/api/action/descriptors/editor-action-editor-descriptor.factory.mjs +0 -21
- package/esm2022/tableview/api/action/descriptors/table-action-descriptor.factory.mjs +0 -37
- package/esm2022/tableview/api/action/descriptors/table-action-editor-descriptor.factory.mjs +0 -40
- package/esm2022/tableview/api/action/helpers/data-provider-executors.mjs +0 -100
- package/esm2022/tableview/api/action/models/action-component.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/action-confirmation.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/action-descriptor.types.mjs +0 -2
- package/esm2022/tableview/api/action/models/action-editor.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/action-error.model.mjs +0 -14
- package/esm2022/tableview/api/action/models/action.type.mjs +0 -26
- package/esm2022/tableview/api/action/models/execution/action-context-validation.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/execution/action-context.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/execution/action-execution-error.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/execution/action-instance-state.model.mjs +0 -32
- package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/execution/view-container.model.mjs +0 -2
- package/esm2022/tableview/api/action/models/tableview-action-default-categories.model.mjs +0 -11
- package/esm2022/tableview/api/action/services/data-provider-executor.service.mjs +0 -28
- package/esm2022/tableview/api/action/services/tokens/data-language-dropdown.token.mjs +0 -3
- package/esm2022/tableview/api/class/editor/class-editor-attribute-converter.mjs +0 -85
- package/esm2022/tableview/api/class/editor/class-editor-attribute.model.mjs +0 -2
- package/esm2022/tableview/api/class/editor/class-editor-data-provider.factory.mjs +0 -5
- package/esm2022/tableview/api/class/editor/class-editor-descriptor-helpers.mjs +0 -95
- package/esm2022/tableview/api/class/editor/class-editor-descriptor.factory.mjs +0 -21
- package/esm2022/tableview/api/class/index.mjs +0 -13
- package/esm2022/tableview/api/class/mediusinc-mng-commons-tableview-api-class.mjs +0 -5
- package/esm2022/tableview/api/class/tableview/class-tableview-attribute-converter.mjs +0 -35
- package/esm2022/tableview/api/class/tableview/class-tableview-attribute.model.mjs +0 -2
- package/esm2022/tableview/api/class/tableview/class-tableview-data-provider.factory.mjs +0 -5
- package/esm2022/tableview/api/class/tableview/class-tableview-descriptor-helpers.mjs +0 -111
- package/esm2022/tableview/api/class/tableview/class-tableview-descriptor.factory.mjs +0 -26
- package/esm2022/tableview/api/editor/data-providers/editor-data-provider.factory.mjs +0 -15
- package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +0 -114
- package/esm2022/tableview/api/editor/descriptors/editor-descriptor.factory.mjs +0 -15
- package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +0 -437
- package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +0 -51
- package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +0 -314
- package/esm2022/tableview/api/editor/descriptors/field-group.descriptor.mjs +0 -103
- package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +0 -211
- package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +0 -142
- package/esm2022/tableview/api/editor/descriptors/field-validation.descriptor.mjs +0 -25
- package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +0 -402
- package/esm2022/tableview/api/editor/descriptors/wrappers/editor-descriptor-nested-object-wrapper.mjs +0 -51
- package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +0 -2
- package/esm2022/tableview/api/editor/models/editor.model.mjs +0 -9
- package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +0 -2
- package/esm2022/tableview/api/editor/models/field-image-preview.model.mjs +0 -2
- package/esm2022/tableview/api/editor/models/field-validation.model.mjs +0 -2
- package/esm2022/tableview/api/editor/models/field.model.mjs +0 -57
- package/esm2022/tableview/api/editor/models/form-editor.event.mjs +0 -28
- package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +0 -2
- package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +0 -70
- package/esm2022/tableview/api/editor/models/formly-field.model.mjs +0 -2
- package/esm2022/tableview/api/editor/models/formly-options.model.mjs +0 -2
- package/esm2022/tableview/api/editor/models/radio.model.mjs +0 -2
- package/esm2022/tableview/api/index.mjs +0 -76
- package/esm2022/tableview/api/mediusinc-mng-commons-tableview-api.mjs +0 -5
- package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +0 -18
- package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +0 -84
- package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +0 -34
- package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +0 -377
- package/esm2022/tableview/api/tableview/helpers/files-export.mjs +0 -34
- package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +0 -26
- package/esm2022/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.mjs +0 -7
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +0 -324
- package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +0 -319
- package/esm2022/tableview/api/tableview/models/tableview-descriptor-fields-manage-helper.type.mjs +0 -2
- package/esm2022/tableview/api/tableview/models/tableview-descriptor-helper.type.mjs +0 -2
- package/esm2022/tableview/api/tableview/models/tableview-input.model.mjs +0 -2
- package/esm2022/tableview/api/tableview/models/tableview-route.model.mjs +0 -2
- package/esm2022/tableview/editor/components/editor/auto-save-status/auto-save-status.component.mjs +0 -82
- package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +0 -480
- package/esm2022/tableview/editor/components/formly/constants.mjs +0 -2
- package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +0 -66
- package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +0 -47
- package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +0 -39
- package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +0 -165
- package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +0 -42
- package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +0 -34
- package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +0 -211
- package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +0 -23
- package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +0 -195
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +0 -239
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +0 -205
- package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +0 -28
- package/esm2022/tableview/editor/components/formly/fields/formly-field-type.abstract.component.mjs +0 -46
- package/esm2022/tableview/editor/components/formly/pipes/formly-field-label.pipe.mjs +0 -19
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +0 -33
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +0 -59
- package/esm2022/tableview/editor/helpers/editor-autosave.mjs +0 -49
- package/esm2022/tableview/editor/helpers/editor-field.mjs +0 -39
- package/esm2022/tableview/editor/helpers/editor-formly.mjs +0 -388
- package/esm2022/tableview/editor/helpers/editor-validators.mjs +0 -25
- package/esm2022/tableview/editor/helpers/field-create.mjs +0 -21
- package/esm2022/tableview/editor/helpers/formly-config.mjs +0 -260
- package/esm2022/tableview/editor/helpers/notification.mjs +0 -11
- package/esm2022/tableview/editor/models/editor-auto-save-preview.model.mjs +0 -2
- package/esm2022/tableview/editor/models/formly-config.model.mjs +0 -2
- package/esm2022/tableview/editor/services/form-editor.service.mjs +0 -96
- package/esm2022/tableview/editor/services/formly-config.provider.mjs +0 -31
- package/esm2022/tableview/index.mjs +0 -67
- package/esm2022/tableview/mediusinc-mng-commons-tableview.mjs +0 -5
- package/esm2022/tableview/provide.mjs +0 -105
- package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +0 -15
- package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +0 -59
- package/esm2022/tableview/tableview/router/tableview-route-builder.mjs +0 -175
- package/esm2022/tableview/tableview/services/tableview-feature-config.token.mjs +0 -3
|
@@ -0,0 +1,2130 @@
|
|
|
1
|
+
import { trigger, transition, style, animate } from '@angular/animations';
|
|
2
|
+
import { NgTemplateOutlet, DecimalPipe, CurrencyPipe, DatePipe, AsyncPipe, NgClass, NgStyle } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, Injector, signal, computed, Injectable, ElementRef, Renderer2, ChangeDetectorRef, DestroyRef, input, viewChild, untracked, Component, ViewEncapsulation, ChangeDetectionStrategy, LOCALE_ID, Pipe, output, booleanAttribute, contentChildren, viewChildren, afterNextRender } from '@angular/core';
|
|
5
|
+
import { toSignal, toObservable, takeUntilDestroyed, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
6
|
+
import * as i1 from '@angular/forms';
|
|
7
|
+
import { FormsModule } from '@angular/forms';
|
|
8
|
+
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
9
|
+
import { OverlayService, TranslationKeys, MessageService } from 'primeng/api';
|
|
10
|
+
import { ButtonDirective, ButtonIcon, Button } from 'primeng/button';
|
|
11
|
+
import { Checkbox } from 'primeng/checkbox';
|
|
12
|
+
import { DatePicker } from 'primeng/datepicker';
|
|
13
|
+
import { DomHandler, ConnectedOverlayScrollHandler } from 'primeng/dom';
|
|
14
|
+
import { FilterIcon } from 'primeng/icons/filter';
|
|
15
|
+
import { InputNumber } from 'primeng/inputnumber';
|
|
16
|
+
import { InputText } from 'primeng/inputtext';
|
|
17
|
+
import * as i1$1 from 'primeng/table';
|
|
18
|
+
import { Table, TableModule } from 'primeng/table';
|
|
19
|
+
import { ZIndexUtils } from 'primeng/utils';
|
|
20
|
+
import { combineLatest, switchMap, of, Subject, debounceTime, distinctUntilChanged, ReplaySubject, NEVER, BehaviorSubject, skip, filter } from 'rxjs';
|
|
21
|
+
import { FilterMatchMode, dateToIsoString, angularDateFormatHasTime, fromAngularDateFormatToPrime, angularDateFormatHasSeconds, fromAngularNumberFormatToFractions, COMMONS_MODULE_CONFIG_IT, effectWithDeps, toObservable as toObservable$1, CommonsService, RerenderDirective, GetterPipe, TemplatePipe, JsonPathPipe, BooleanPipe, EnumPipe, ComponentDirective, getI18nTypePropertyKey, TemplateDirective, findTemplateByName, getI18nForError, getI18nErrorParams, toastMessage, CommonsStorageService, LoggerService, booleanOrUndefinedAttribute, mergeDataListParamsWithDefaults, fromTableLoadToDataListParams, dataListParamsToUrlQuery, fromSubscribeError, getErrorLogLevel, fromUrlQueryToDataListParams, I18nPropertyPipe, ClassMapPipe, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
22
|
+
import { FilterTypeEnum, FilterDescriptor, FilterDisplayTypeEnum, FilterLookupTypeEnum, FilterLookupDescriptor } from '@mediusinc/mng-commons/filter';
|
|
23
|
+
import { DateRangeComponent, AutocompleteComponent, DropdownComponent, InputTrimDirective, NumberRangeComponent } from '@mediusinc/mng-commons/form';
|
|
24
|
+
import { tableDescriptor, TableDynamicDescriptorInst, TablePaginationModeEnum, ColumnDisplayTypeEnum, TableSizeEnum } from '@mediusinc/mng-commons/table/api';
|
|
25
|
+
import { PrimeNG } from 'primeng/config';
|
|
26
|
+
import { Tooltip } from 'primeng/tooltip';
|
|
27
|
+
import { Tag, TagModule } from 'primeng/tag';
|
|
28
|
+
import { Message } from 'primeng/message';
|
|
29
|
+
import { ToggleButton } from 'primeng/togglebutton';
|
|
30
|
+
import { lookupDataProvider } from '@mediusinc/mng-commons/form/api';
|
|
31
|
+
import { IconField } from 'primeng/iconfield';
|
|
32
|
+
import { InputIcon } from 'primeng/inputicon';
|
|
33
|
+
import { Popover } from 'primeng/popover';
|
|
34
|
+
import { Router, ActivatedRoute, NavigationStart, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
|
|
35
|
+
import { Skeleton } from 'primeng/skeleton';
|
|
36
|
+
import { getI18nForModel } from '@mediusinc/mng-commons/model';
|
|
37
|
+
|
|
38
|
+
function filterGenerateMatchModeOptions(primeConfig, descriptor, cmpSerCfg) {
|
|
39
|
+
let options = undefined;
|
|
40
|
+
if (descriptor == null || descriptor.filterType === FilterTypeEnum.String) {
|
|
41
|
+
options = [
|
|
42
|
+
{ value: FilterMatchMode.Contains, label: primeConfig.getTranslation(FilterMatchMode.Contains) },
|
|
43
|
+
{ value: FilterMatchMode.NotContains, label: primeConfig.getTranslation(FilterMatchMode.NotContains) },
|
|
44
|
+
{ value: FilterMatchMode.Equals, label: primeConfig.getTranslation(FilterMatchMode.Equals) },
|
|
45
|
+
{ value: FilterMatchMode.NotEquals, label: primeConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
46
|
+
{ value: FilterMatchMode.StartsWith, label: primeConfig.getTranslation(FilterMatchMode.StartsWith) },
|
|
47
|
+
{ value: FilterMatchMode.EndsWith, label: primeConfig.getTranslation(FilterMatchMode.EndsWith) }
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
else if (descriptor.filterType === FilterTypeEnum.Boolean) {
|
|
51
|
+
options = [{ value: FilterMatchMode.Equals, label: primeConfig.getTranslation(FilterMatchMode.Equals) }];
|
|
52
|
+
}
|
|
53
|
+
else if (descriptor.filterType === FilterTypeEnum.Number) {
|
|
54
|
+
options = [
|
|
55
|
+
{ value: FilterMatchMode.Equals, label: primeConfig.getTranslation(FilterMatchMode.Equals) },
|
|
56
|
+
{ value: FilterMatchMode.NotEquals, label: primeConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
57
|
+
{ value: FilterMatchMode.LessThan, label: primeConfig.getTranslation(FilterMatchMode.LessThan) },
|
|
58
|
+
{ value: FilterMatchMode.LessThanOrEqualTo, label: primeConfig.getTranslation(FilterMatchMode.LessThanOrEqualTo) },
|
|
59
|
+
{ value: FilterMatchMode.GreaterThan, label: primeConfig.getTranslation(FilterMatchMode.GreaterThan) },
|
|
60
|
+
{ value: FilterMatchMode.GreaterThanOrEqualTo, label: primeConfig.getTranslation(FilterMatchMode.GreaterThanOrEqualTo) },
|
|
61
|
+
{ value: FilterMatchMode.Between, label: primeConfig.getTranslation(FilterMatchMode.Between) }
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
else if (descriptor.filterType === FilterTypeEnum.Lookup || descriptor.filterType === FilterTypeEnum.LookupEnum) {
|
|
65
|
+
options = [
|
|
66
|
+
{ value: FilterMatchMode.Equals, label: primeConfig.getTranslation(FilterMatchMode.Equals) },
|
|
67
|
+
{ value: FilterMatchMode.NotEquals, label: primeConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
68
|
+
{ value: FilterMatchMode.In, label: primeConfig.getTranslation(FilterMatchMode.In) },
|
|
69
|
+
{ value: FilterMatchMode.NotIn, label: primeConfig.getTranslation(FilterMatchMode.NotIn) }
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
else if (descriptor.filterType === FilterTypeEnum.Date) {
|
|
73
|
+
if (!descriptor.datePickerShowTime && !descriptor.dateValueNoTime && !cmpSerCfg?.filtersDateOnlyDisabled) {
|
|
74
|
+
options = [
|
|
75
|
+
{ value: FilterMatchMode.Equals, label: primeConfig.getTranslation(FilterMatchMode.Equals) },
|
|
76
|
+
{ value: FilterMatchMode.NotEquals, label: primeConfig.getTranslation(FilterMatchMode.NotEquals) },
|
|
77
|
+
{ value: FilterMatchMode.LessThanOrEqualTo, label: primeConfig.getTranslation(FilterMatchMode.LessThanOrEqualTo) },
|
|
78
|
+
{ value: FilterMatchMode.GreaterThanOrEqualTo, label: primeConfig.getTranslation(FilterMatchMode.GreaterThanOrEqualTo) },
|
|
79
|
+
{ value: FilterMatchMode.Between, label: primeConfig.getTranslation(FilterMatchMode.Between) }
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
options = [
|
|
84
|
+
{ value: FilterMatchMode.Equals, label: primeConfig.getTranslation(FilterMatchMode.Equals) },
|
|
85
|
+
{ value: FilterMatchMode.LessThanOrEqualTo, label: primeConfig.getTranslation(FilterMatchMode.LessThanOrEqualTo) },
|
|
86
|
+
{ value: FilterMatchMode.GreaterThanOrEqualTo, label: primeConfig.getTranslation(FilterMatchMode.GreaterThanOrEqualTo) },
|
|
87
|
+
{ value: FilterMatchMode.Between, label: primeConfig.getTranslation(FilterMatchMode.Between) }
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
options?.push({ value: FilterMatchMode.Exists, label: primeConfig.getTranslation(FilterMatchMode.Exists) }, { value: FilterMatchMode.DoesNotExist, label: primeConfig.getTranslation(FilterMatchMode.DoesNotExist) });
|
|
92
|
+
if (descriptor?.matchModes) {
|
|
93
|
+
options = descriptor.matchModes.map(mm => ({ value: mm, label: primeConfig.getTranslation(mm) }));
|
|
94
|
+
}
|
|
95
|
+
return options || [];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Gets the default match mode for a filter.
|
|
99
|
+
*
|
|
100
|
+
* @param {FilterDescriptor<any, any>} [descriptor] - The filter descriptor.
|
|
101
|
+
* @param {SelectItem[]} [matchModes=[]] - The available match modes options.
|
|
102
|
+
*
|
|
103
|
+
* @return {FilterMatchModeExtendedType} The default match mode for the filter.
|
|
104
|
+
*/
|
|
105
|
+
function filterGetDefaultMatchMode(descriptor, matchModes = []) {
|
|
106
|
+
let defaultMatchMode = FilterMatchMode.Equals;
|
|
107
|
+
if (descriptor?.filterType === FilterTypeEnum.String)
|
|
108
|
+
defaultMatchMode = FilterMatchMode.StartsWith;
|
|
109
|
+
// overwrite type default set in descriptor
|
|
110
|
+
if (descriptor?.defaultMatchMode) {
|
|
111
|
+
defaultMatchMode = descriptor.defaultMatchMode;
|
|
112
|
+
}
|
|
113
|
+
// check if default mode exists!
|
|
114
|
+
if (matchModes.length > 0 && !matchModes.some(m => m.value === defaultMatchMode)) {
|
|
115
|
+
defaultMatchMode = matchModes[0].value;
|
|
116
|
+
}
|
|
117
|
+
return defaultMatchMode;
|
|
118
|
+
}
|
|
119
|
+
function filterSetMetadataOnChange(filter, matchMode, value, filterType, filterDateCfg) {
|
|
120
|
+
let displayValue = filter?.displayValue ?? value;
|
|
121
|
+
let displayMatchMode = filter?.displayMatchMode ?? matchMode;
|
|
122
|
+
// when equals is used on dates with time, the actual filter will be between, but displayed as equals
|
|
123
|
+
if (filterType === FilterTypeEnum.Date && !filterDateCfg?.valueNoTime) {
|
|
124
|
+
if (matchMode === FilterMatchMode.Between &&
|
|
125
|
+
Array.isArray(value) &&
|
|
126
|
+
value.length === 2 &&
|
|
127
|
+
value.every(v => v instanceof Date || typeof v === 'string' || typeof v === 'number')) {
|
|
128
|
+
if (filterAreDatesEqual(value[0], value[1], filterDateCfg)) {
|
|
129
|
+
displayMatchMode = FilterMatchMode.Equals;
|
|
130
|
+
displayValue = new Date(value[0]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else if (matchMode === FilterMatchMode.Equals && !value) {
|
|
134
|
+
matchMode = FilterMatchMode.Between;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (filterType === FilterTypeEnum.Date && displayValue) {
|
|
138
|
+
// display value for calendar cannot be string, convert to date
|
|
139
|
+
displayValue = Array.isArray(displayValue)
|
|
140
|
+
? displayValue.map(v => (!(v instanceof Date) ? new Date(v) : v))
|
|
141
|
+
: displayValue instanceof Date
|
|
142
|
+
? displayValue
|
|
143
|
+
: new Date(displayValue);
|
|
144
|
+
}
|
|
145
|
+
if (filterType === FilterTypeEnum.Boolean && displayValue != null && typeof displayValue !== 'boolean') {
|
|
146
|
+
displayValue = (typeof displayValue === 'string' && displayValue.toLowerCase() === 'true') || displayValue === 1;
|
|
147
|
+
}
|
|
148
|
+
if (filterType === FilterTypeEnum.Number && displayValue != null && typeof displayValue !== 'number') {
|
|
149
|
+
const numValue = +displayValue;
|
|
150
|
+
if (!isNaN(numValue)) {
|
|
151
|
+
displayValue = numValue;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
...filter,
|
|
156
|
+
matchMode,
|
|
157
|
+
value: value,
|
|
158
|
+
displayMatchMode,
|
|
159
|
+
displayValue
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function filterSetMetadataOnDisplayChange(filter, displayMatchMode, displayValue, filterType, filterDateCfg) {
|
|
163
|
+
let matchMode = displayMatchMode;
|
|
164
|
+
let value = displayValue;
|
|
165
|
+
if (filterType === FilterTypeEnum.Date) {
|
|
166
|
+
if (!filterDateCfg?.valueNoTime && displayValue !== null) {
|
|
167
|
+
if (displayMatchMode === FilterMatchMode.Equals) {
|
|
168
|
+
if (value instanceof Date || typeof value === 'string' || typeof value === 'number') {
|
|
169
|
+
const fromDate = new Date(value);
|
|
170
|
+
const toDate = new Date(value);
|
|
171
|
+
if (filterDateCfg?.showTime) {
|
|
172
|
+
if (filterDateCfg?.showSeconds) {
|
|
173
|
+
fromDate.setMilliseconds(0);
|
|
174
|
+
toDate.setMilliseconds(999);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
fromDate.setSeconds(0, 0);
|
|
178
|
+
toDate.setSeconds(59, 999);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
fromDate.setHours(0, 0, 0, 0);
|
|
183
|
+
toDate.setHours(23, 59, 59, 999);
|
|
184
|
+
}
|
|
185
|
+
value = [fromDate, toDate];
|
|
186
|
+
matchMode = FilterMatchMode.Between;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
value = null;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else if (displayMatchMode === FilterMatchMode.Between) {
|
|
193
|
+
if (Array.isArray(value) && value.length === 2 && value.every(i => i instanceof Date || typeof i === 'string' || typeof i === 'number')) {
|
|
194
|
+
const fromDate = new Date(value[0]);
|
|
195
|
+
let toDate = new Date(value[1]);
|
|
196
|
+
if (filterAreDatesEqual(fromDate, toDate, filterDateCfg)) {
|
|
197
|
+
toDate = new Date(fromDate);
|
|
198
|
+
if (filterDateCfg?.showTime) {
|
|
199
|
+
if (filterDateCfg?.showSeconds) {
|
|
200
|
+
toDate.setSeconds(toDate.getSeconds() + 1);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
toDate.setMinutes(toDate.getMinutes() + 1);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
toDate.setDate(toDate.getDate() + 1);
|
|
208
|
+
}
|
|
209
|
+
value = [fromDate, toDate];
|
|
210
|
+
matchMode = FilterMatchMode.Between;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
value = null;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const convertDateType = filterDateCfg?.valueNoTime ? 'date' : 'date-time';
|
|
219
|
+
const convertDateTimeOpts = {
|
|
220
|
+
utc: filterDateCfg?.valueUtc,
|
|
221
|
+
noMillis: filterDateCfg?.valueNoMillis,
|
|
222
|
+
noTimezone: filterDateCfg?.valueNoTimezone
|
|
223
|
+
};
|
|
224
|
+
value =
|
|
225
|
+
value == null
|
|
226
|
+
? value
|
|
227
|
+
: Array.isArray(value)
|
|
228
|
+
? value.filter(i => i != null).map(i => dateToIsoString(i, convertDateType, convertDateTimeOpts))
|
|
229
|
+
: dateToIsoString(value, convertDateType, convertDateTimeOpts);
|
|
230
|
+
}
|
|
231
|
+
if (matchMode === FilterMatchMode.Exists || matchMode === FilterMatchMode.DoesNotExist) {
|
|
232
|
+
value = null;
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
...filter,
|
|
236
|
+
displayMatchMode: displayMatchMode,
|
|
237
|
+
matchMode: matchMode,
|
|
238
|
+
displayValue: displayValue,
|
|
239
|
+
value: value,
|
|
240
|
+
caseSensitive: filterType === FilterTypeEnum.String ? filter?.caseSensitive : undefined
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function filterAreDatesEqual(fromDate, toDate, filterDateCfg) {
|
|
244
|
+
const startDate = dateToIsoString(fromDate);
|
|
245
|
+
const endDate = dateToIsoString(toDate);
|
|
246
|
+
// 2020-11-02T11:12:12.000
|
|
247
|
+
const cmpLength = filterDateCfg?.showTime ? (filterDateCfg?.showSeconds ? 19 : 16) : 10;
|
|
248
|
+
return startDate.substring(0, cmpLength) === endDate.substring(0, cmpLength);
|
|
249
|
+
}
|
|
250
|
+
function filterApplySerializationConfigToCmp(config, cmpSerCfg) {
|
|
251
|
+
// set default
|
|
252
|
+
cmpSerCfg.dateTimeInUtc = false;
|
|
253
|
+
cmpSerCfg.dateTimeWithTimezone = true;
|
|
254
|
+
cmpSerCfg.dateTimeWithMillis = true;
|
|
255
|
+
cmpSerCfg.filtersDateOnlyDisabled = false;
|
|
256
|
+
// set customizations
|
|
257
|
+
if (config?.serialization) {
|
|
258
|
+
if (config.serialization.dateTimeInUtc !== undefined)
|
|
259
|
+
cmpSerCfg.dateTimeInUtc = config.serialization.dateTimeInUtc;
|
|
260
|
+
if (config.serialization.dateTimeWithTimezone !== undefined)
|
|
261
|
+
cmpSerCfg.dateTimeWithTimezone = config.serialization.dateTimeWithTimezone;
|
|
262
|
+
if (config.serialization.dateTimeWithMillis !== undefined)
|
|
263
|
+
cmpSerCfg.dateTimeWithMillis = config.serialization.dateTimeWithMillis;
|
|
264
|
+
if (config.serialization.filtersDateOnlyDisabled !== undefined)
|
|
265
|
+
cmpSerCfg.filtersDateOnlyDisabled = config.serialization.filtersDateOnlyDisabled;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function filterAdjustDisplayValueOnMatchModeChange(matchMode, value) {
|
|
269
|
+
if (matchMode == null || matchMode === FilterMatchMode.Exists || matchMode === FilterMatchMode.DoesNotExist) {
|
|
270
|
+
return value; // never change, only change later if something else changes here
|
|
271
|
+
}
|
|
272
|
+
if (matchMode === FilterMatchMode.Between) {
|
|
273
|
+
if (!Array.isArray(value)) {
|
|
274
|
+
return value != null ? [value, value] : [];
|
|
275
|
+
}
|
|
276
|
+
else if (value.length === 0 || value.length === 2) {
|
|
277
|
+
return value;
|
|
278
|
+
}
|
|
279
|
+
else if (value.length === 1) {
|
|
280
|
+
return [value[0], value[0]];
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return [value[0], value[1]];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (matchMode === FilterMatchMode.In || matchMode === FilterMatchMode.NotIn) {
|
|
287
|
+
return Array.isArray(value) ? value : value == null ? [] : [value];
|
|
288
|
+
}
|
|
289
|
+
return Array.isArray(value) && value.length > 0 ? value[0] : value;
|
|
290
|
+
}
|
|
291
|
+
function filterGetDateConfig(descriptor, serCfg) {
|
|
292
|
+
if (!descriptor || descriptor.filterType !== FilterTypeEnum.Date) {
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
const showTime = descriptor.datePickerShowTime ?? (descriptor.displayFormatApplyToField && descriptor.displayFormat ? angularDateFormatHasTime(descriptor.displayFormat) : false);
|
|
296
|
+
return {
|
|
297
|
+
valueNoTime: descriptor.dateValueNoTime || (!serCfg?.filtersDateOnlyDisabled && !showTime),
|
|
298
|
+
valueUtc: descriptor.dateValueUtc ?? serCfg?.dateTimeInUtc,
|
|
299
|
+
valueNoTimezone: descriptor.dateValueNoTimezone ?? !serCfg?.dateTimeWithTimezone,
|
|
300
|
+
valueNoMillis: !serCfg?.dateTimeWithMillis,
|
|
301
|
+
format: descriptor.datePickerFormat ?? (descriptor.displayFormatApplyToField && descriptor.displayFormat ? fromAngularDateFormatToPrime(descriptor.displayFormat) : undefined),
|
|
302
|
+
showTime: showTime,
|
|
303
|
+
showSeconds: showTime &&
|
|
304
|
+
(descriptor.datePickerShowSeconds ?? (descriptor.displayFormatApplyToField && descriptor.displayFormat ? angularDateFormatHasSeconds(descriptor.displayFormat) : false))
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function filterGetNumberConfig(descriptor) {
|
|
308
|
+
if (!descriptor || descriptor.filterType !== FilterTypeEnum.Number) {
|
|
309
|
+
return undefined;
|
|
310
|
+
}
|
|
311
|
+
const displayCfg = descriptor.displayFormatApplyToField && descriptor.displayFormat ? fromAngularNumberFormatToFractions(descriptor.displayFormat) : undefined;
|
|
312
|
+
return {
|
|
313
|
+
fractionsMin: descriptor.numberMinFractionDigits ?? displayCfg?.fractionsMin,
|
|
314
|
+
fractionsMax: descriptor.numberMaxFractionDigits ?? displayCfg?.fractionsMax
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Creates an array of filter descriptors from an array of generic filter properties.
|
|
319
|
+
*
|
|
320
|
+
* @param {FilterGenericProperty[]} properties - The array of filterable properties, their types and options.
|
|
321
|
+
* @param {LookupDataProviderInst<string, any, any, 'field'>} [valueLookup] - The lookup data provider for value suggestions.
|
|
322
|
+
*/
|
|
323
|
+
function createFilterDescriptorsFromGeneric(properties, valueLookup) {
|
|
324
|
+
return properties.reduce((createdFilterDescriptors, genericFilter) => {
|
|
325
|
+
// when no generic value lookup is provided, lookup enum filters are treated as string filters
|
|
326
|
+
const filterType = genericFilter.type === FilterTypeEnum.LookupEnum && valueLookup === undefined ? FilterTypeEnum.String : genericFilter.type;
|
|
327
|
+
const filterDescriptor = new FilterDescriptor(genericFilter.property).asFilterType(filterType).asGenericFilter();
|
|
328
|
+
if ((genericFilter.type === FilterTypeEnum.String || genericFilter.type === FilterTypeEnum.LookupEnum) && valueLookup) {
|
|
329
|
+
filterDescriptor.withGenericValueProvider(valueLookup);
|
|
330
|
+
}
|
|
331
|
+
if (filterDescriptor && genericFilter.opts !== undefined) {
|
|
332
|
+
switch (genericFilter.type) {
|
|
333
|
+
case FilterTypeEnum.Number:
|
|
334
|
+
filterDescriptor.asNumber(genericFilter.opts);
|
|
335
|
+
break;
|
|
336
|
+
case FilterTypeEnum.Date:
|
|
337
|
+
filterDescriptor.asDate(genericFilter.opts);
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (filterDescriptor) {
|
|
342
|
+
createdFilterDescriptors.push(filterDescriptor);
|
|
343
|
+
}
|
|
344
|
+
return createdFilterDescriptors;
|
|
345
|
+
}, []);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function tableCreateFilterMeta(paramsWithDefaults) {
|
|
349
|
+
const primeFilterMeta = {};
|
|
350
|
+
// if any filter is present, no default filters should be applied!
|
|
351
|
+
if (paramsWithDefaults?.filters) {
|
|
352
|
+
Object.entries(paramsWithDefaults.filters).forEach(([key, value]) => {
|
|
353
|
+
primeFilterMeta[key] = {
|
|
354
|
+
value: value?.value,
|
|
355
|
+
matchMode: value?.matchMode,
|
|
356
|
+
caseSensitive: value?.caseSensitive
|
|
357
|
+
};
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
return primeFilterMeta;
|
|
361
|
+
}
|
|
362
|
+
function tableCreateSortMeta(paramsWithDefaults) {
|
|
363
|
+
if (paramsWithDefaults?.sort !== undefined && Array.isArray(paramsWithDefaults?.sort) && paramsWithDefaults?.sort.length > 0) {
|
|
364
|
+
return paramsWithDefaults?.sort.map(s => ({
|
|
365
|
+
field: s.property,
|
|
366
|
+
order: s.ascending ? 1 : -1
|
|
367
|
+
}));
|
|
368
|
+
}
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const COMMONS_TABLE_FEATURE_CONFIG_IT = new InjectionToken('COMMONS_TABLE_FEATURE_CONFIG');
|
|
373
|
+
|
|
374
|
+
class TableMetadataService {
|
|
375
|
+
static { this.cmpTypeName = 'TableComponent'; }
|
|
376
|
+
#injector;
|
|
377
|
+
#translationObserver;
|
|
378
|
+
// signal sources
|
|
379
|
+
#signalSources;
|
|
380
|
+
#descriptor;
|
|
381
|
+
#updateDescriptorFromSourceEffect;
|
|
382
|
+
#genericFilters;
|
|
383
|
+
// search
|
|
384
|
+
#searchFieldsFromSignalSource;
|
|
385
|
+
#searchFields;
|
|
386
|
+
#searchFieldsEffect;
|
|
387
|
+
constructor() {
|
|
388
|
+
this.#injector = inject(Injector);
|
|
389
|
+
this.primeConfig = inject(PrimeNG);
|
|
390
|
+
this.moduleConfig = inject(COMMONS_MODULE_CONFIG_IT, { optional: true });
|
|
391
|
+
this.tableModuleConfig = inject(COMMONS_TABLE_FEATURE_CONFIG_IT, { optional: true });
|
|
392
|
+
this.serializationCfg = {};
|
|
393
|
+
this.#translationObserver = toSignal(this.primeConfig.translationObserver);
|
|
394
|
+
this.defaultFilterDisplayType = this.tableModuleConfig?.filterDisplayType ?? FilterDisplayTypeEnum.Column;
|
|
395
|
+
// signal sources
|
|
396
|
+
this.#signalSources = signal({});
|
|
397
|
+
// descriptors
|
|
398
|
+
this.descriptorFromSource = computed(() => this.#signalSources().descriptor?.());
|
|
399
|
+
this.#descriptor = signal(tableDescriptor());
|
|
400
|
+
this.descriptor = this.#descriptor.asReadonly();
|
|
401
|
+
this.#updateDescriptorFromSourceEffect = effectWithDeps([this.descriptorFromSource], ([d]) => {
|
|
402
|
+
if (d != null) {
|
|
403
|
+
this.#descriptor.set(d);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
// pagination
|
|
407
|
+
this.rowsPerPageOptions = computed(() => {
|
|
408
|
+
const descriptor = this.descriptor();
|
|
409
|
+
if (Array.isArray(descriptor.rowsPerPageOptions) && descriptor.rowsPerPageOptions.length > 0) {
|
|
410
|
+
return descriptor.rowsPerPageOptions;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
return [25, 50, 100];
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
// filters
|
|
417
|
+
this.filterDescriptors = computed(() => this.descriptor().filters);
|
|
418
|
+
this.filters = computed(() => {
|
|
419
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
420
|
+
const observer = this.#translationObserver(); // need this one to track language changes
|
|
421
|
+
return this.filterDescriptors().map(d => this.mapDescriptorToMetadata(d));
|
|
422
|
+
});
|
|
423
|
+
this.genericFilterDescriptor = computed(() => this.descriptor().genericFilter);
|
|
424
|
+
this.#genericFilters = signal([]);
|
|
425
|
+
this.genericFilters = this.#genericFilters.asReadonly();
|
|
426
|
+
// search
|
|
427
|
+
this.#searchFieldsFromSignalSource = computed(() => this.#signalSources().searchFields?.());
|
|
428
|
+
this.#searchFields = signal([]);
|
|
429
|
+
this.searchFields = this.#searchFields.asReadonly();
|
|
430
|
+
this.#searchFieldsEffect = effectWithDeps([this.descriptor, this.#searchFieldsFromSignalSource], ([descriptor, searchFieldsFromSignalSource]) => {
|
|
431
|
+
this.#searchFields.set(searchFieldsFromSignalSource ?? (descriptor.search && descriptor.searchFields ? descriptor.searchFields : this.descriptor().columns.map(c => c.property)));
|
|
432
|
+
});
|
|
433
|
+
// params
|
|
434
|
+
this.defaultParams = computed(() => {
|
|
435
|
+
const params = {
|
|
436
|
+
offset: 0,
|
|
437
|
+
limit: this.rowsPerPageOptions()[0],
|
|
438
|
+
sort: this.descriptor()
|
|
439
|
+
.sorts.filter(s => s.defaultIsEnabled)
|
|
440
|
+
.sort((s1, s2) => (s1.defaultOrder ?? 1000) - (s2.defaultOrder ?? 1000))
|
|
441
|
+
.map(s => ({
|
|
442
|
+
property: s.property,
|
|
443
|
+
ascending: s.defaultIsAscending
|
|
444
|
+
})),
|
|
445
|
+
filters: {}
|
|
446
|
+
};
|
|
447
|
+
this.filters()
|
|
448
|
+
.filter(f => f.descriptor.hasDefaultValue)
|
|
449
|
+
.forEach(f => {
|
|
450
|
+
params.filters[f.descriptor.property] = {
|
|
451
|
+
value: f.descriptor.defaultValue,
|
|
452
|
+
matchMode: f.defaultMatchMode
|
|
453
|
+
};
|
|
454
|
+
});
|
|
455
|
+
return params;
|
|
456
|
+
});
|
|
457
|
+
filterApplySerializationConfigToCmp(this.moduleConfig, this.serializationCfg);
|
|
458
|
+
combineLatest([toObservable(this.genericFilterDescriptor), toObservable(this.#translationObserver)])
|
|
459
|
+
.pipe(switchMap(([genericFilterDescriptor]) => {
|
|
460
|
+
if (genericFilterDescriptor) {
|
|
461
|
+
const dataProvider = this.genericFilterDescriptor()?.propertyLookup;
|
|
462
|
+
const genericFilterService = dataProvider?.serviceType ? this.#injector.get(dataProvider.serviceType) : null;
|
|
463
|
+
// fetch filterable properties
|
|
464
|
+
return toObservable$1(genericFilterDescriptor.propertyLookup.lookup({}, genericFilterService));
|
|
465
|
+
}
|
|
466
|
+
return of([]);
|
|
467
|
+
}), takeUntilDestroyed())
|
|
468
|
+
.subscribe({
|
|
469
|
+
next: genericFilters => {
|
|
470
|
+
// set descriptors from generic filter data
|
|
471
|
+
this.#genericFilters.set(createFilterDescriptorsFromGeneric(genericFilters, this.genericFilterDescriptor()?.valueLookup).map(d => this.mapDescriptorToMetadata(d)));
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
setSignalSources(descriptor, searchFields) {
|
|
476
|
+
this.#signalSources.set({ descriptor, searchFields });
|
|
477
|
+
}
|
|
478
|
+
setDescriptor(descriptor) {
|
|
479
|
+
if (this.descriptorFromSource() instanceof TableDynamicDescriptorInst) {
|
|
480
|
+
this.#descriptor.set(descriptor);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
mapDescriptorToMetadata(descriptor) {
|
|
484
|
+
const matchModes = filterGenerateMatchModeOptions(this.primeConfig, descriptor, this.serializationCfg);
|
|
485
|
+
return {
|
|
486
|
+
descriptor: descriptor,
|
|
487
|
+
matchModes: matchModes,
|
|
488
|
+
defaultMatchMode: filterGetDefaultMatchMode(descriptor, matchModes),
|
|
489
|
+
dateConfig: filterGetDateConfig(descriptor, this.serializationCfg),
|
|
490
|
+
numberConfig: filterGetNumberConfig(descriptor)
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableMetadataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
494
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableMetadataService }); }
|
|
495
|
+
}
|
|
496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableMetadataService, decorators: [{
|
|
497
|
+
type: Injectable
|
|
498
|
+
}], ctorParameters: () => [] });
|
|
499
|
+
|
|
500
|
+
class TableDataService {
|
|
501
|
+
constructor() {
|
|
502
|
+
this.#injector = inject(Injector);
|
|
503
|
+
this.#commons = inject(CommonsService);
|
|
504
|
+
this.#metadata = inject(TableMetadataService);
|
|
505
|
+
// signal sources
|
|
506
|
+
this.#dataSources = signal({});
|
|
507
|
+
// data sources
|
|
508
|
+
this.#manualLoading = computed(() => this.#dataSources()?.manualLoading?.());
|
|
509
|
+
// results that are set directly via input and are not result of a asynchronous operation (aka data provider)
|
|
510
|
+
this.#synchronousResult = computed(() => {
|
|
511
|
+
const dataSources = this.#dataSources();
|
|
512
|
+
if (dataSources?.dataProvider?.() !== undefined) {
|
|
513
|
+
return undefined;
|
|
514
|
+
}
|
|
515
|
+
if (dataSources?.dataListResult?.() !== undefined) {
|
|
516
|
+
return dataSources?.dataListResult();
|
|
517
|
+
}
|
|
518
|
+
if (dataSources?.arrayItems?.() !== undefined) {
|
|
519
|
+
return { data: dataSources.arrayItems(), totalCount: dataSources.arrayItems()?.length ?? 0 };
|
|
520
|
+
}
|
|
521
|
+
return undefined;
|
|
522
|
+
});
|
|
523
|
+
this.#dataProvider = computed(() => this.#dataSources()?.dataProvider?.());
|
|
524
|
+
this.#dataProviderService = computed(() => {
|
|
525
|
+
const dataProvider = this.#dataProvider();
|
|
526
|
+
return dataProvider?.serviceType ? this.#injector.get(dataProvider.serviceType) : null;
|
|
527
|
+
});
|
|
528
|
+
this.#synchronousResultEffect = effectWithDeps([this.#synchronousResult], ([res]) => {
|
|
529
|
+
if (res != null) {
|
|
530
|
+
this.#setData(res.data ?? [], res.totalCount);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
this.#synchronousLoadingEffect = effectWithDeps([this.#synchronousResult, this.#manualLoading], ([res, manualLoading]) => {
|
|
534
|
+
if (res != null && manualLoading == null) {
|
|
535
|
+
this.#loading.set(false);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
this.#manualLoadingEffect = effectWithDeps([this.#manualLoading], ([manualLoading]) => {
|
|
539
|
+
if (manualLoading != null) {
|
|
540
|
+
this.#loading.set(manualLoading);
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
// pagination
|
|
544
|
+
this.#params = signal(undefined);
|
|
545
|
+
this.params = this.#params.asReadonly();
|
|
546
|
+
this.#sortMeta = signal(undefined);
|
|
547
|
+
this.sortMeta = this.#sortMeta.asReadonly();
|
|
548
|
+
this.#filterMeta = signal({});
|
|
549
|
+
this.filterMeta = this.#filterMeta.asReadonly();
|
|
550
|
+
this.#isSortAndFilterMetaInitialized = signal(false);
|
|
551
|
+
this.#defaultParamsEffect = effectWithDeps([this.#metadata.defaultParams], ([defaultParams]) => {
|
|
552
|
+
this.#sortMeta.set(tableCreateSortMeta(defaultParams));
|
|
553
|
+
this.#filterMeta.set(tableCreateFilterMeta(defaultParams));
|
|
554
|
+
this.#isSortAndFilterMetaInitialized.set(true);
|
|
555
|
+
}, { firstOnly: true });
|
|
556
|
+
this.#isSearchMetaInitialized = signal(false);
|
|
557
|
+
this.#searchMeta = signal(undefined);
|
|
558
|
+
this.searchMeta = this.#searchMeta.asReadonly();
|
|
559
|
+
this.isAllPaginationMetaInitialized = computed(() => this.#isSortAndFilterMetaInitialized() && this.#isSortAndFilterMetaInitialized());
|
|
560
|
+
this.paginationMode = computed(() => {
|
|
561
|
+
const descriptor = this.#metadata.descriptor();
|
|
562
|
+
if (descriptor.paginationMode != null) {
|
|
563
|
+
// descriptor choice is the strongest - if defined, use this value
|
|
564
|
+
return descriptor.paginationMode;
|
|
565
|
+
}
|
|
566
|
+
else if (this.#dataProvider() != null) {
|
|
567
|
+
// when data provider is used, use pagination
|
|
568
|
+
return TablePaginationModeEnum.Pagination;
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
return TablePaginationModeEnum.None;
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
this.offset = computed(() => this.params()?.offset ?? 0);
|
|
575
|
+
this.rows = computed(() => {
|
|
576
|
+
if (this.params()?.limit) {
|
|
577
|
+
return this.params()?.limit;
|
|
578
|
+
}
|
|
579
|
+
const descriptor = this.#metadata.descriptor();
|
|
580
|
+
const rowsPerPageOptions = this.#metadata.rowsPerPageOptions();
|
|
581
|
+
if (descriptor.defaultNumRows && rowsPerPageOptions.includes(descriptor.defaultNumRows)) {
|
|
582
|
+
return descriptor.defaultNumRows;
|
|
583
|
+
}
|
|
584
|
+
return rowsPerPageOptions[0];
|
|
585
|
+
});
|
|
586
|
+
// data
|
|
587
|
+
this.#data = signal([]);
|
|
588
|
+
this.data = this.#data.asReadonly();
|
|
589
|
+
this.#count = signal(0);
|
|
590
|
+
this.count = this.#count.asReadonly();
|
|
591
|
+
this.#loading = signal(true);
|
|
592
|
+
this.loading = this.#loading.asReadonly();
|
|
593
|
+
}
|
|
594
|
+
#injector;
|
|
595
|
+
#commons;
|
|
596
|
+
#metadata;
|
|
597
|
+
// signal sources
|
|
598
|
+
#dataSources;
|
|
599
|
+
// data sources
|
|
600
|
+
#manualLoading;
|
|
601
|
+
// results that are set directly via input and are not result of a asynchronous operation (aka data provider)
|
|
602
|
+
#synchronousResult;
|
|
603
|
+
#dataProvider;
|
|
604
|
+
#dataProviderService;
|
|
605
|
+
#synchronousResultEffect;
|
|
606
|
+
#synchronousLoadingEffect;
|
|
607
|
+
#manualLoadingEffect;
|
|
608
|
+
#dataProviderSubscription;
|
|
609
|
+
// pagination
|
|
610
|
+
#params;
|
|
611
|
+
#sortMeta;
|
|
612
|
+
#filterMeta;
|
|
613
|
+
#isSortAndFilterMetaInitialized;
|
|
614
|
+
#defaultParamsEffect;
|
|
615
|
+
#isSearchMetaInitialized;
|
|
616
|
+
#searchMeta;
|
|
617
|
+
// data
|
|
618
|
+
#data;
|
|
619
|
+
#count;
|
|
620
|
+
#loading;
|
|
621
|
+
setDataSources(arrayItems, dataListResult, dataProvider, manualLoading) {
|
|
622
|
+
this.#dataSources.set({ arrayItems, dataListResult, dataProvider, manualLoading });
|
|
623
|
+
}
|
|
624
|
+
fetchWithDataProvider(params, onErrorFn) {
|
|
625
|
+
const dataProvider = this.#dataProvider();
|
|
626
|
+
if (!dataProvider || params.limit === 0) {
|
|
627
|
+
return false;
|
|
628
|
+
}
|
|
629
|
+
this.#dataProviderSubscription?.unsubscribe();
|
|
630
|
+
this.#loading.set(true);
|
|
631
|
+
this.#dataProviderSubscription = toObservable$1(dataProvider.getAll(params, this.#dataProviderService(), this.#metadata.descriptor().isLocalized ? (this.#commons.appDataLocale() ?? undefined) : undefined)).subscribe({
|
|
632
|
+
next: res => {
|
|
633
|
+
const descriptorInput = this.#metadata.descriptorFromSource();
|
|
634
|
+
if (descriptorInput instanceof TableDynamicDescriptorInst) {
|
|
635
|
+
this.#metadata.setDescriptor(descriptorInput.toTableDescriptorFromData(res));
|
|
636
|
+
}
|
|
637
|
+
this.#setData(res?.data ?? [], res?.totalCount);
|
|
638
|
+
this.#loading.set(false);
|
|
639
|
+
},
|
|
640
|
+
error: err => {
|
|
641
|
+
onErrorFn(err);
|
|
642
|
+
this.#setData([]);
|
|
643
|
+
this.#loading.set(false);
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
return true;
|
|
647
|
+
}
|
|
648
|
+
setParams(params, fromQueryParams = false) {
|
|
649
|
+
if (!fromQueryParams && this.compareWithCurrentParams(params)) {
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
this.#params.set(params);
|
|
653
|
+
this.#sortMeta.set(tableCreateSortMeta(params));
|
|
654
|
+
this.#filterMeta.set(tableCreateFilterMeta(params));
|
|
655
|
+
this.#isSortAndFilterMetaInitialized.set(true);
|
|
656
|
+
if (fromQueryParams && !this.#isSearchMetaInitialized() && params?.search) {
|
|
657
|
+
this.#searchMeta.set({ value: params.search, caseSensitive: params.filters?.['global']?.caseSensitive ?? false });
|
|
658
|
+
}
|
|
659
|
+
this.#isSearchMetaInitialized.set(true);
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Compare the given params with the stored params in the DataListService.
|
|
663
|
+
*
|
|
664
|
+
* @param {DataListParams} params - The params to compare with the stored params.
|
|
665
|
+
*
|
|
666
|
+
* @return {boolean} - True if the given params match the stored params, otherwise false.
|
|
667
|
+
*/
|
|
668
|
+
compareWithCurrentParams(params) {
|
|
669
|
+
return (params.offset === this.offset() &&
|
|
670
|
+
params.limit === this.rows() &&
|
|
671
|
+
JSON.stringify(tableCreateSortMeta(params)) === JSON.stringify(this.#sortMeta()) &&
|
|
672
|
+
JSON.stringify(tableCreateFilterMeta(params)) === JSON.stringify(this.#filterMeta()));
|
|
673
|
+
}
|
|
674
|
+
#setData(data, count) {
|
|
675
|
+
this.#data.set([...data]);
|
|
676
|
+
this.#count.set(count ?? data.length);
|
|
677
|
+
}
|
|
678
|
+
ngOnDestroy() {
|
|
679
|
+
this.#dataProviderSubscription?.unsubscribe();
|
|
680
|
+
}
|
|
681
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
682
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableDataService }); }
|
|
683
|
+
}
|
|
684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableDataService, decorators: [{
|
|
685
|
+
type: Injectable
|
|
686
|
+
}] });
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Cannot be on push change detection strategy because of filter updates triggered from route which causes to force update values in force metadata
|
|
690
|
+
* and these must be propagated through to this component and beyond to primeNG.
|
|
691
|
+
*/
|
|
692
|
+
class TableColumnFilterComponent {
|
|
693
|
+
constructor() {
|
|
694
|
+
this.lookupTypeDropdown = FilterLookupTypeEnum.Dropdown;
|
|
695
|
+
this.lookupTypeAutocomplete = FilterLookupTypeEnum.Autocomplete;
|
|
696
|
+
this.FilterTypeEnum = FilterTypeEnum;
|
|
697
|
+
this.FilterMatchMode = FilterMatchMode;
|
|
698
|
+
this.el = inject(ElementRef);
|
|
699
|
+
this.primeTable = inject(Table);
|
|
700
|
+
this.renderer = inject(Renderer2);
|
|
701
|
+
this.overlayService = inject(OverlayService);
|
|
702
|
+
this.cd = inject(ChangeDetectorRef);
|
|
703
|
+
this.destroyRef = inject(DestroyRef);
|
|
704
|
+
this.tableData = inject((TableDataService));
|
|
705
|
+
this.tableMetadata = inject(TableMetadataService);
|
|
706
|
+
this.document = window.document;
|
|
707
|
+
this.metadata = input.required();
|
|
708
|
+
this.descriptorAsLookup = computed(() => this.metadata().descriptor instanceof FilterLookupDescriptor ? this.metadata().descriptor : undefined);
|
|
709
|
+
this.icon = viewChild('icon');
|
|
710
|
+
this.matchModes = computed(() => this.metadata().matchModes);
|
|
711
|
+
this.filterConstraint = signal(undefined);
|
|
712
|
+
this.isFilterSet = computed(() => this.filterConstraint()?.matchMode === FilterMatchMode.Exists ||
|
|
713
|
+
this.filterConstraint()?.matchMode === FilterMatchMode.DoesNotExist ||
|
|
714
|
+
!this.primeTable.isFilterBlank(this.filterConstraint()?.value));
|
|
715
|
+
this.isInputDisabled = computed(() => this.filterConstraint()?.matchMode === FilterMatchMode.Exists || this.filterConstraint()?.matchMode === FilterMatchMode.DoesNotExist);
|
|
716
|
+
this.overlayVisible = signal(false);
|
|
717
|
+
// display configs
|
|
718
|
+
this.isMultiselect = computed(() => {
|
|
719
|
+
const ft = this.filterConstraint();
|
|
720
|
+
const matchMode = ft?.displayMatchMode ?? this.metadata().defaultMatchMode;
|
|
721
|
+
return (matchMode === FilterMatchMode.In || matchMode === FilterMatchMode.NotIn) && (ft?.displayValue == null || Array.isArray(ft.displayValue));
|
|
722
|
+
});
|
|
723
|
+
this.window = this.document.defaultView;
|
|
724
|
+
this.numericValueFromModelChange = null;
|
|
725
|
+
this.dateDebounceSubject = new Subject();
|
|
726
|
+
this.dateDebounceSubject.pipe(debounceTime(500), distinctUntilChanged(), takeUntilDestroyed()).subscribe(v => this.updateFilterOnDisplayValueChange(v));
|
|
727
|
+
effectWithDeps([this.metadata, this.filterConstraint], ([metadata]) => {
|
|
728
|
+
const fieldFilterMeta = this.tableData.filterMeta()?.[metadata.descriptor.property];
|
|
729
|
+
const filterConstraint = this.filterConstraint();
|
|
730
|
+
if (fieldFilterMeta && (!filterConstraint || filterConstraint.value !== fieldFilterMeta.value || filterConstraint.matchMode !== fieldFilterMeta.matchMode)) {
|
|
731
|
+
this.setFilterConstraint(filterSetMetadataOnChange(fieldFilterMeta, fieldFilterMeta.matchMode, fieldFilterMeta.value, untracked(() => this.metadata().descriptor.filterType), untracked(() => this.metadata().dateConfig)));
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
ngOnDestroy() {
|
|
736
|
+
if (this.overlay) {
|
|
737
|
+
this.renderer.appendChild(this.el.nativeElement, this.overlay);
|
|
738
|
+
ZIndexUtils.clear(this.overlay);
|
|
739
|
+
this.onOverlayHide();
|
|
740
|
+
}
|
|
741
|
+
this.resetSubscription?.unsubscribe();
|
|
742
|
+
this.overlaySubscription?.unsubscribe();
|
|
743
|
+
}
|
|
744
|
+
onTextModelChange(event) {
|
|
745
|
+
const value = event.target.value;
|
|
746
|
+
if (value === '') {
|
|
747
|
+
this.updateFilterOnDisplayValueChange(value);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
onTextInputEnterKeyDown(event) {
|
|
751
|
+
const value = event.target.value;
|
|
752
|
+
this.updateFilterOnDisplayValueChange(value);
|
|
753
|
+
event.preventDefault();
|
|
754
|
+
}
|
|
755
|
+
onNumericModelChange(value) {
|
|
756
|
+
this.numericValueFromModelChange = value;
|
|
757
|
+
if (value === null) {
|
|
758
|
+
this.updateFilterOnDisplayValueChange(value);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
onNumericInputKeyDown(event) {
|
|
762
|
+
if (event.key === 'Enter') {
|
|
763
|
+
if (this.filterConstraint()?.displayMatchMode === FilterMatchMode.Between && Array.isArray(this.numericValueFromModelChange)) {
|
|
764
|
+
const numberValues = this.numericValueFromModelChange.filter(v => typeof v === 'number');
|
|
765
|
+
if (numberValues.length !== 2) {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
this.updateFilterOnDisplayValueChange(this.numericValueFromModelChange);
|
|
770
|
+
event.preventDefault();
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
onCheckboxModelChange(value) {
|
|
774
|
+
this.updateFilterOnDisplayValueChange(value);
|
|
775
|
+
}
|
|
776
|
+
onDateFilterModelChange(value) {
|
|
777
|
+
if (this.filterConstraint()?.displayMatchMode === FilterMatchMode.Between && Array.isArray(value)) {
|
|
778
|
+
const dateValues = value.filter(v => v instanceof Date);
|
|
779
|
+
if (dateValues.length !== 2) {
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
this.dateDebounceSubject.next(value);
|
|
784
|
+
}
|
|
785
|
+
autocompleteFilter(value) {
|
|
786
|
+
this.updateFilterOnDisplayValueChange(value);
|
|
787
|
+
}
|
|
788
|
+
dropdownFilter(value) {
|
|
789
|
+
this.updateFilterOnDisplayValueChange(value);
|
|
790
|
+
}
|
|
791
|
+
onMatchModeChange(displayMatchMode) {
|
|
792
|
+
if (this.filterConstraint()?.displayMatchMode === displayMatchMode) {
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
this.setFilterConstraint(filterSetMetadataOnDisplayChange(this.filterConstraint(), displayMatchMode, filterAdjustDisplayValueOnMatchModeChange(displayMatchMode, this.filterConstraint()?.displayValue), this.metadata().descriptor.filterType, this.metadata().dateConfig));
|
|
796
|
+
this.hideOverlay();
|
|
797
|
+
}
|
|
798
|
+
onMatchModeKeyDown(event) {
|
|
799
|
+
const item = event.target;
|
|
800
|
+
switch (event.key) {
|
|
801
|
+
case 'ArrowDown':
|
|
802
|
+
// eslint-disable-next-line no-case-declarations
|
|
803
|
+
const nextItem = this.findNextMenuModeItem(item);
|
|
804
|
+
if (nextItem) {
|
|
805
|
+
item.removeAttribute('tabindex');
|
|
806
|
+
nextItem.tabIndex = '0';
|
|
807
|
+
nextItem.focus();
|
|
808
|
+
}
|
|
809
|
+
event.preventDefault();
|
|
810
|
+
break;
|
|
811
|
+
case 'ArrowUp':
|
|
812
|
+
// eslint-disable-next-line no-case-declarations
|
|
813
|
+
const prevItem = this.findPrevMenuModeItem(item);
|
|
814
|
+
if (prevItem) {
|
|
815
|
+
item.removeAttribute('tabindex');
|
|
816
|
+
prevItem.tabIndex = '0';
|
|
817
|
+
prevItem.focus();
|
|
818
|
+
}
|
|
819
|
+
event.preventDefault();
|
|
820
|
+
break;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
onRowClearItemClick() {
|
|
824
|
+
this.clearFilter();
|
|
825
|
+
this.hideOverlay();
|
|
826
|
+
}
|
|
827
|
+
toggleMenu(event) {
|
|
828
|
+
this.overlayVisible.set(!this.overlayVisible());
|
|
829
|
+
event.stopPropagation();
|
|
830
|
+
}
|
|
831
|
+
onToggleButtonKeyDown(event) {
|
|
832
|
+
switch (event.key) {
|
|
833
|
+
case 'Escape':
|
|
834
|
+
case 'Tab':
|
|
835
|
+
this.overlayVisible.set(false);
|
|
836
|
+
break;
|
|
837
|
+
case 'ArrowDown':
|
|
838
|
+
if (this.overlayVisible()) {
|
|
839
|
+
const focusable = DomHandler.getFocusableElements(this.overlay);
|
|
840
|
+
if (focusable) {
|
|
841
|
+
focusable[0].focus();
|
|
842
|
+
}
|
|
843
|
+
event.preventDefault();
|
|
844
|
+
}
|
|
845
|
+
else if (event.altKey) {
|
|
846
|
+
this.overlayVisible.set(true);
|
|
847
|
+
event.preventDefault();
|
|
848
|
+
}
|
|
849
|
+
break;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
onEscape() {
|
|
853
|
+
this.overlayVisible.set(false);
|
|
854
|
+
}
|
|
855
|
+
onContentClick() {
|
|
856
|
+
this.selfClick = true;
|
|
857
|
+
}
|
|
858
|
+
// onOverlayAnimationStart(event: AnimationEvent) {
|
|
859
|
+
onOverlayAnimationStart(event) {
|
|
860
|
+
switch (event.toState) {
|
|
861
|
+
case 'visible':
|
|
862
|
+
this.overlay = event.element;
|
|
863
|
+
this.renderer.appendChild(this.document.body, this.overlay);
|
|
864
|
+
ZIndexUtils.set('overlay', this.overlay, this.tableMetadata.primeConfig.zIndex.overlay);
|
|
865
|
+
DomHandler.absolutePosition(this.overlay, this.icon()?.nativeElement);
|
|
866
|
+
this.bindDocumentClickListener();
|
|
867
|
+
this.bindDocumentResizeListener();
|
|
868
|
+
this.bindScrollListener();
|
|
869
|
+
this.overlayEventListener = (e) => {
|
|
870
|
+
if (this.overlay && this.overlay.contains(e.target)) {
|
|
871
|
+
this.selfClick = true;
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
this.overlaySubscription = this.overlayService.clickObservable.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(this.overlayEventListener);
|
|
875
|
+
break;
|
|
876
|
+
case 'void':
|
|
877
|
+
this.onOverlayHide();
|
|
878
|
+
this.overlaySubscription?.unsubscribe();
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
// onOverlayAnimationEnd(event: AnimationEvent) {
|
|
883
|
+
onOverlayAnimationEnd(event) {
|
|
884
|
+
switch (event.toState) {
|
|
885
|
+
case 'void':
|
|
886
|
+
ZIndexUtils.clear(event.element);
|
|
887
|
+
break;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
get noFilterLabel() {
|
|
891
|
+
return this.tableMetadata.primeConfig.getTranslation(TranslationKeys.NO_FILTER);
|
|
892
|
+
}
|
|
893
|
+
clearFilter() {
|
|
894
|
+
this.initFilterConstraint(true);
|
|
895
|
+
this.primeTable._filter();
|
|
896
|
+
this.hideOverlay();
|
|
897
|
+
}
|
|
898
|
+
findNextMenuModeItem(item) {
|
|
899
|
+
const nextItem = item.nextElementSibling;
|
|
900
|
+
if (nextItem)
|
|
901
|
+
return DomHandler.hasClass(nextItem, 'p-column-filter-separator') ? this.findNextMenuModeItem(nextItem) : nextItem;
|
|
902
|
+
else
|
|
903
|
+
return item.parentElement?.firstElementChild;
|
|
904
|
+
}
|
|
905
|
+
findPrevMenuModeItem(item) {
|
|
906
|
+
const prevItem = item.previousElementSibling;
|
|
907
|
+
if (prevItem)
|
|
908
|
+
return DomHandler.hasClass(prevItem, 'p-column-filter-separator') ? this.findPrevMenuModeItem(prevItem) : prevItem;
|
|
909
|
+
else
|
|
910
|
+
return item.parentElement?.lastElementChild;
|
|
911
|
+
}
|
|
912
|
+
isOutsideClicked(event) {
|
|
913
|
+
return !(this.overlay?.isSameNode(event.target) ||
|
|
914
|
+
this.overlay?.contains(event.target) ||
|
|
915
|
+
this.icon()?.nativeElement.isSameNode(event.target) ||
|
|
916
|
+
this.icon()?.nativeElement.contains(event.target) ||
|
|
917
|
+
DomHandler.hasClass(event.target, 'p-column-filter-add-button') ||
|
|
918
|
+
DomHandler.hasClass(event.target.parentElement, 'p-column-filter-add-button') ||
|
|
919
|
+
DomHandler.hasClass(event.target, 'p-column-filter-remove-button') ||
|
|
920
|
+
DomHandler.hasClass(event.target.parentElement, 'p-column-filter-remove-button'));
|
|
921
|
+
}
|
|
922
|
+
bindDocumentClickListener() {
|
|
923
|
+
if (!this.documentClickListener) {
|
|
924
|
+
const documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';
|
|
925
|
+
this.documentClickListener = this.renderer.listen(documentTarget, 'click', event => {
|
|
926
|
+
if (this.overlayVisible() && !this.selfClick && this.isOutsideClicked(event)) {
|
|
927
|
+
this.hideOverlay();
|
|
928
|
+
}
|
|
929
|
+
this.selfClick = false;
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
unbindDocumentClickListener() {
|
|
934
|
+
if (this.documentClickListener) {
|
|
935
|
+
this.documentClickListener();
|
|
936
|
+
this.documentClickListener = null;
|
|
937
|
+
this.selfClick = false;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
bindDocumentResizeListener() {
|
|
941
|
+
if (!this.documentResizeListener) {
|
|
942
|
+
this.documentResizeListener = this.renderer.listen(this.window, 'resize', () => {
|
|
943
|
+
if (this.overlayVisible() && !DomHandler.isTouchDevice()) {
|
|
944
|
+
this.hideOverlay();
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
unbindDocumentResizeListener() {
|
|
950
|
+
if (this.documentResizeListener) {
|
|
951
|
+
this.documentResizeListener();
|
|
952
|
+
this.documentResizeListener = null;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
bindScrollListener() {
|
|
956
|
+
if (!this.scrollHandler) {
|
|
957
|
+
this.scrollHandler = new ConnectedOverlayScrollHandler(this.icon()?.nativeElement, () => {
|
|
958
|
+
if (this.overlayVisible()) {
|
|
959
|
+
this.hideOverlay();
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
this.scrollHandler.bindScrollListener();
|
|
964
|
+
}
|
|
965
|
+
unbindScrollListener() {
|
|
966
|
+
if (this.scrollHandler) {
|
|
967
|
+
this.scrollHandler.unbindScrollListener();
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
hideOverlay() {
|
|
971
|
+
this.overlayVisible.set(false);
|
|
972
|
+
this.cd.markForCheck();
|
|
973
|
+
}
|
|
974
|
+
onOverlayHide() {
|
|
975
|
+
this.unbindDocumentClickListener();
|
|
976
|
+
this.unbindDocumentResizeListener();
|
|
977
|
+
this.unbindScrollListener();
|
|
978
|
+
this.overlay = null;
|
|
979
|
+
}
|
|
980
|
+
updateFilterOnDisplayValueChange(displayValue) {
|
|
981
|
+
this.setFilterConstraint(filterSetMetadataOnDisplayChange(this.filterConstraint(), this.filterConstraint()?.displayMatchMode ?? this.metadata().defaultMatchMode, displayValue, this.metadata().descriptor.filterType, this.metadata().dateConfig));
|
|
982
|
+
}
|
|
983
|
+
initFilterConstraint(reset = false) {
|
|
984
|
+
if (reset) {
|
|
985
|
+
this.primeTable.filters[this.metadata().descriptor.property] = { value: null, matchMode: this.metadata().defaultMatchMode };
|
|
986
|
+
}
|
|
987
|
+
// set internal filter constraint
|
|
988
|
+
let metadata = this.primeTable.filters[this.metadata().descriptor.property];
|
|
989
|
+
if (Array.isArray(metadata)) {
|
|
990
|
+
metadata = metadata[0];
|
|
991
|
+
}
|
|
992
|
+
this.setFilterConstraint(filterSetMetadataOnChange(metadata, metadata?.matchMode, metadata?.value, this.metadata().descriptor.filterType, this.metadata().dateConfig));
|
|
993
|
+
}
|
|
994
|
+
setFilterConstraint(metadata) {
|
|
995
|
+
if (metadata && !metadata.displayMatchMode)
|
|
996
|
+
metadata.displayMatchMode = metadata.matchMode;
|
|
997
|
+
if (metadata && !metadata.displayValue)
|
|
998
|
+
metadata.displayValue = metadata.value;
|
|
999
|
+
this.filterConstraint.set(metadata);
|
|
1000
|
+
this.primeTable.filters[this.metadata().descriptor.property] = this.filterConstraint();
|
|
1001
|
+
this.primeTable._filter();
|
|
1002
|
+
}
|
|
1003
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableColumnFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1004
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: TableColumnFilterComponent, isStandalone: true, selector: "mng-table-column-filter", inputs: { metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "icon", first: true, predicate: ["icon"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex items-center\">\n @switch (metadata().descriptor.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filterConstraint()?.displayMatchMode === 'between') {\n <mng-number-range\n vertical=\"true\"\n className=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"metadata().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"metadata().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"metadata().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"metadata().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"metadata().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"metadata().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [ngModel]=\"filterConstraint()?.displayValue\" binary=\"true\" (ngModelChange)=\"onCheckboxModelChange($event)\"></p-checkbox>\n }\n @case (FilterTypeEnum.Date) {\n @if (filterConstraint()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n vertical=\"true\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [showTime]=\"metadata().dateConfig?.showTime ?? false\"\n [showSeconds]=\"metadata().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"metadata().dateConfig?.format\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [disabled]=\"isInputDisabled()\"></mng-date-range>\n } @else {\n <p-date-picker\n appendTo=\"body\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"metadata().dateConfig?.showTime ?? false\"\n [showSeconds]=\"metadata().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"metadata().dateConfig?.format\"\n [firstDayOfWeek]=\"1\">\n </p-date-picker>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @default {\n <input\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input\"\n [value]=\"filterConstraint()?.displayValue\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [mngInputTrim]=\"metadata().descriptor.trimOption\" />\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.autocompleteInlineSearch ?? false\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"metadata().descriptor.trimOption\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"isMultiselect()\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n @if (matchModes().length > 1) {\n <button\n #icon\n pButton\n type=\"button\"\n class=\"mng-button-xs mx-1\"\n [class.!hidden]=\"!isFilterSet()\"\n rounded=\"true\"\n severity=\"primary\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\">\n <FilterIcon pButtonIcon />\n </button>\n }\n @if (overlayVisible()) {\n <div\n class=\"p-datatable-filter-overlay\"\n (click)=\"onContentClick()\"\n [@overlayAnimation]=\"'visible'\"\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\n (keydown.escape)=\"onEscape()\">\n <ul class=\"p-datatable-filter-constraint-list\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-datatable-filter-constraint-selected]=\"matchMode.value === filterConstraint()?.displayMatchMode\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"this.onMatchModeChange(matchMode.value)\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n <li class=\"p-datatable-filter-constraint-separator\"></li>\n <li class=\"p-datatable-filter-constraint\" (click)=\"onRowClearItemClick()\" (keydown)=\"onMatchModeKeyDown($event)\" (keydown.enter)=\"onRowClearItemClick()\">\n {{ noFilterLabel }}\n </li>\n </ul>\n </div>\n }\n</div>\n", styles: [".mng-column-filter-string{min-width:135px}.mng-column-filter-number{min-width:165px}.mng-column-filter-date{min-width:170px}.mng-column-filter-boolean{min-width:80px}.mng-column-filter-lookup,.mng-column-filter-lookupenum{min-width:180px}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat", "className", "required", "disabled", "vertical"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "searchTrim", "disabled"], outputs: ["valueChange", "blur"] }, { kind: "component", type: DropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "options", "optionsTrackProperty", "optionsLabelProperty", "optionsLabelTranslate", "optionsValueProperty", "optionsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur", "loading", "disabled", "allowInput", "appendTo", "inlineSearch", "searchTrim"], outputs: ["valueChange", "blur"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled", "fluid"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: FilterIcon, selector: "FilterIcon" }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled", "vertical"], outputs: ["keyDown"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "directive", type: RerenderDirective, selector: "[mngRerender]", inputs: ["mngRerender"] }, { kind: "component", type: DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "size", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "directive", type: ButtonIcon, selector: "[pButtonIcon]" }], animations: [
|
|
1005
|
+
trigger('overlayAnimation', [
|
|
1006
|
+
transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('.12s cubic-bezier(0, 0, 0.2, 1)')]),
|
|
1007
|
+
transition(':leave', [animate('.1s linear', style({ opacity: 0 }))])
|
|
1008
|
+
])
|
|
1009
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1010
|
+
}
|
|
1011
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableColumnFilterComponent, decorators: [{
|
|
1012
|
+
type: Component,
|
|
1013
|
+
args: [{ selector: 'mng-table-column-filter', imports: [
|
|
1014
|
+
TableModule,
|
|
1015
|
+
TranslatePipe,
|
|
1016
|
+
DateRangeComponent,
|
|
1017
|
+
FormsModule,
|
|
1018
|
+
AutocompleteComponent,
|
|
1019
|
+
DropdownComponent,
|
|
1020
|
+
InputNumber,
|
|
1021
|
+
InputText,
|
|
1022
|
+
FilterIcon,
|
|
1023
|
+
InputTrimDirective,
|
|
1024
|
+
NumberRangeComponent,
|
|
1025
|
+
NgTemplateOutlet,
|
|
1026
|
+
Checkbox,
|
|
1027
|
+
RerenderDirective,
|
|
1028
|
+
DatePicker,
|
|
1029
|
+
ButtonDirective,
|
|
1030
|
+
ButtonIcon
|
|
1031
|
+
], animations: [
|
|
1032
|
+
trigger('overlayAnimation', [
|
|
1033
|
+
transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('.12s cubic-bezier(0, 0, 0.2, 1)')]),
|
|
1034
|
+
transition(':leave', [animate('.1s linear', style({ opacity: 0 }))])
|
|
1035
|
+
])
|
|
1036
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex items-center\">\n @switch (metadata().descriptor.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (filterConstraint()?.displayMatchMode === 'between') {\n <mng-number-range\n vertical=\"true\"\n className=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (keyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"metadata().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"metadata().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"metadata().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onNumericModelChange($event)\"\n (onKeyDown)=\"onNumericInputKeyDown($event)\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [useGrouping]=\"metadata().descriptor.numberUseGrouping\"\n [minFractionDigits]=\"metadata().numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"metadata().numberConfig?.fractionsMax\"\n [disabled]=\"isInputDisabled()\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [ngModel]=\"filterConstraint()?.displayValue\" binary=\"true\" (ngModelChange)=\"onCheckboxModelChange($event)\"></p-checkbox>\n }\n @case (FilterTypeEnum.Date) {\n @if (filterConstraint()?.displayMatchMode === FilterMatchMode.Between) {\n <mng-date-range\n vertical=\"true\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [showTime]=\"metadata().dateConfig?.showTime ?? false\"\n [showSeconds]=\"metadata().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"metadata().dateConfig?.format\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [disabled]=\"isInputDisabled()\"></mng-date-range>\n } @else {\n <p-date-picker\n appendTo=\"body\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n (ngModelChange)=\"onDateFilterModelChange($event)\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"metadata().dateConfig?.showTime ?? false\"\n [showSeconds]=\"metadata().dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"metadata().dateConfig?.format\"\n [firstDayOfWeek]=\"1\">\n </p-date-picker>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\" />\n }\n @default {\n <input\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input\"\n [value]=\"filterConstraint()?.displayValue\"\n [disabled]=\"isInputDisabled()\"\n (input)=\"onTextModelChange($event)\"\n (keydown.enter)=\"onTextInputEnterKeyDown($event)\"\n [attr.placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.typeToFilter' | translate\"\n [mngInputTrim]=\"metadata().descriptor.trimOption\" />\n }\n }\n\n <ng-template #lookupFilter>\n @if (descriptorAsLookup(); as lookup) {\n @switch (lookup.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsTrackProperty]=\"lookup.optionsValueProperty\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookup.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookup.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookup.autocompleteInlineSearch ?? false\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.searchToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"autocompleteFilter($event)\"\n [searchTrim]=\"metadata().descriptor.trimOption\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n *mngRerender=\"isMultiselect()\"\n [ngModel]=\"filterConstraint()?.displayValue\"\n [dataProvider]=\"lookup.dataProvider\"\n [optionsValueProperty]=\"lookup.optionsValueProperty\"\n [optionsLabelProperty]=\"lookup.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookup.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"metadata().descriptor.placeholder ?? 'mngTable.selectToFilter' | translate\"\n [className]=\"lookup.className\"\n [dropdownClassName]=\"lookup.dropdownClassName\"\n [showClear]=\"false\"\n [changeValueOnBlur]=\"isMultiselect()\"\n [disabled]=\"isInputDisabled()\"\n (valueChange)=\"dropdownFilter($event)\">\n </mng-dropdown>\n }\n }\n }\n </ng-template>\n\n @if (matchModes().length > 1) {\n <button\n #icon\n pButton\n type=\"button\"\n class=\"mng-button-xs mx-1\"\n [class.!hidden]=\"!isFilterSet()\"\n rounded=\"true\"\n severity=\"primary\"\n (click)=\"toggleMenu($event)\"\n (keydown)=\"onToggleButtonKeyDown($event)\">\n <FilterIcon pButtonIcon />\n </button>\n }\n @if (overlayVisible()) {\n <div\n class=\"p-datatable-filter-overlay\"\n (click)=\"onContentClick()\"\n [@overlayAnimation]=\"'visible'\"\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\n (keydown.escape)=\"onEscape()\">\n <ul class=\"p-datatable-filter-constraint-list\">\n @for (matchMode of matchModes(); track matchMode; let i = $index) {\n <li\n class=\"p-datatable-filter-constraint\"\n [class.p-datatable-filter-constraint-selected]=\"matchMode.value === filterConstraint()?.displayMatchMode\"\n (click)=\"onMatchModeChange(matchMode.value)\"\n (keydown)=\"onMatchModeKeyDown($event)\"\n (keydown.enter)=\"this.onMatchModeChange(matchMode.value)\"\n [attr.tabindex]=\"i === 0 ? '0' : null\">\n {{ matchMode.label }}\n </li>\n }\n <li class=\"p-datatable-filter-constraint-separator\"></li>\n <li class=\"p-datatable-filter-constraint\" (click)=\"onRowClearItemClick()\" (keydown)=\"onMatchModeKeyDown($event)\" (keydown.enter)=\"onRowClearItemClick()\">\n {{ noFilterLabel }}\n </li>\n </ul>\n </div>\n }\n</div>\n", styles: [".mng-column-filter-string{min-width:135px}.mng-column-filter-number{min-width:165px}.mng-column-filter-date{min-width:170px}.mng-column-filter-boolean{min-width:80px}.mng-column-filter-lookup,.mng-column-filter-lookupenum{min-width:180px}\n"] }]
|
|
1037
|
+
}], ctorParameters: () => [] });
|
|
1038
|
+
|
|
1039
|
+
var columnFilter_component = /*#__PURE__*/Object.freeze({
|
|
1040
|
+
__proto__: null,
|
|
1041
|
+
TableColumnFilterComponent: TableColumnFilterComponent
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
class TableColumnValueComponent {
|
|
1045
|
+
constructor() {
|
|
1046
|
+
this.columnDisplayTypeString = ColumnDisplayTypeEnum.String;
|
|
1047
|
+
this.columnDisplayTypeNumber = ColumnDisplayTypeEnum.Number;
|
|
1048
|
+
this.columnDisplayTypeCurrency = ColumnDisplayTypeEnum.Currency;
|
|
1049
|
+
this.columnDisplayTypeBoolean = ColumnDisplayTypeEnum.Boolean;
|
|
1050
|
+
this.columnDisplayTypeDate = ColumnDisplayTypeEnum.Date;
|
|
1051
|
+
this.columnDisplayTypeEnum = ColumnDisplayTypeEnum.Enum;
|
|
1052
|
+
this.columnDisplayTypeComponent = ColumnDisplayTypeEnum.Component;
|
|
1053
|
+
this.columnDisplayTypeHtml = ColumnDisplayTypeEnum.Html;
|
|
1054
|
+
this.elementRef = inject(ElementRef);
|
|
1055
|
+
this.messageService = inject(MessageService);
|
|
1056
|
+
this.translate = inject(TranslateService);
|
|
1057
|
+
this.getterPipe = new GetterPipe();
|
|
1058
|
+
this.templatePipe = new TemplatePipe();
|
|
1059
|
+
this.jsonPathPipe = new JsonPathPipe();
|
|
1060
|
+
this.descriptor = input.required();
|
|
1061
|
+
this.item = input.required();
|
|
1062
|
+
this.styleMaxWidth = computed(() => this.descriptor().maxWidth ?? null);
|
|
1063
|
+
this.className = computed(() => {
|
|
1064
|
+
let className = 'nowrap';
|
|
1065
|
+
if (this.descriptor().columnDisplayType === ColumnDisplayTypeEnum.String && this.descriptor().isMultiline) {
|
|
1066
|
+
className += ' multiline';
|
|
1067
|
+
}
|
|
1068
|
+
return className;
|
|
1069
|
+
});
|
|
1070
|
+
this.value = computed(() => {
|
|
1071
|
+
let value = this.jsonPathPipe.transform(this.item(), `$.${this.descriptor().property}`);
|
|
1072
|
+
if (typeof this.descriptor().getter === 'function') {
|
|
1073
|
+
value = this.getterPipe.transform(value, this.descriptor().getter, this.item());
|
|
1074
|
+
}
|
|
1075
|
+
if (this.descriptor().template) {
|
|
1076
|
+
value = this.templatePipe.transform(value, this.descriptor().template);
|
|
1077
|
+
}
|
|
1078
|
+
return value;
|
|
1079
|
+
});
|
|
1080
|
+
this.currency = computed(() => {
|
|
1081
|
+
if (this.descriptor().columnDisplayType === ColumnDisplayTypeEnum.Currency) {
|
|
1082
|
+
return this.descriptor().currencyProperty ? this.item()[this.descriptor().currencyProperty] : (this.descriptor().currencyCode ?? 'EUR');
|
|
1083
|
+
}
|
|
1084
|
+
return;
|
|
1085
|
+
});
|
|
1086
|
+
this.hasCopyToClipboard = computed(() => this.descriptor().hasCopyToClipboard && this.value() != null);
|
|
1087
|
+
}
|
|
1088
|
+
copyToClipboard(event) {
|
|
1089
|
+
event.stopPropagation();
|
|
1090
|
+
let value = this.elementRef.nativeElement.innerText.trim();
|
|
1091
|
+
const clipboardValueGetter = this.descriptor().clipboardValueGetter;
|
|
1092
|
+
if (clipboardValueGetter) {
|
|
1093
|
+
value = clipboardValueGetter(this.value(), this.item());
|
|
1094
|
+
}
|
|
1095
|
+
navigator.clipboard.writeText(value);
|
|
1096
|
+
const title = this.translate.instant('mngTable.copyNotificationTitle');
|
|
1097
|
+
const message = this.translate.instant('mngTable.copyNotificationMessage', { value });
|
|
1098
|
+
this.messageService.add({ severity: 'info', summary: title, detail: message });
|
|
1099
|
+
}
|
|
1100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableColumnValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: TableColumnValueComponent, isStandalone: true, selector: "mng-table-column-value", inputs: { descriptor: { classPropertyName: "descriptor", publicName: "descriptor", isSignal: true, isRequired: true, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "className()", "style.max-width.px": "styleMaxWidth()" } }, ngImport: i0, template: "@if (descriptor().localizationExistsProperty && !item()[descriptor().localizationExistsProperty!]) {\n <i class=\"pi pi-exclamation-circle\" [pTooltip]=\"'mngTable.translationMissing' | translate\"></i>\n}\n@switch (descriptor().columnDisplayType) {\n @case (columnDisplayTypeString) {\n @if (descriptor().hasValueAsTooltip) {\n <span [pTooltip]=\"value()\" tooltipPosition=\"left\">{{ value() }}</span>\n } @else {\n {{ value() }}\n }\n }\n @case (columnDisplayTypeHtml) {\n <span [innerHTML]=\"value()\"></span>\n }\n @case (columnDisplayTypeNumber) {\n {{ value() | number: descriptor().displayFormat : descriptor().locale }}\n }\n @case (columnDisplayTypeCurrency) {\n {{ value() | currency: currency() : descriptor().currencyDisplay : descriptor().displayFormat : descriptor().locale }}\n }\n @case (columnDisplayTypeDate) {\n {{ value() | date: descriptor().displayFormat }}\n }\n @case (columnDisplayTypeBoolean) {\n @if (descriptor().booleanAsIcon) {\n <i [class]=\"value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo : true\"></i>\n } @else {\n {{ value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo | translate }}\n }\n }\n @case (columnDisplayTypeEnum) {\n {{ value() | mngEnum: descriptor().enum | translate }}\n }\n @case (columnDisplayTypeComponent) {\n <ng-container\n [mngComponent]=\"descriptor().customComponentType!\"\n [inputs]=\"{\n value: value(),\n item: item(),\n descriptor: descriptor()\n }\"></ng-container>\n }\n}\n@if (hasCopyToClipboard()) {\n <div class=\"help-buttons\">\n <button pButton type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (click)=\"copyToClipboard($event)\"></button>\n </div>\n}\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host.multiline{white-space:pre-wrap;word-wrap:break-word}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"], dependencies: [{ kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: BooleanPipe, name: "mngBoolean" }, { kind: "pipe", type: EnumPipe, name: "mngEnum" }, { kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: CurrencyPipe, name: "currency" }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1102
|
+
}
|
|
1103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableColumnValueComponent, decorators: [{
|
|
1104
|
+
type: Component,
|
|
1105
|
+
args: [{ selector: 'mng-table-column-value', imports: [TranslatePipe, BooleanPipe, EnumPipe, ComponentDirective, DecimalPipe, CurrencyPipe, DatePipe, ButtonDirective, Tooltip], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class]': 'className()', '[style.max-width.px]': 'styleMaxWidth()' }, template: "@if (descriptor().localizationExistsProperty && !item()[descriptor().localizationExistsProperty!]) {\n <i class=\"pi pi-exclamation-circle\" [pTooltip]=\"'mngTable.translationMissing' | translate\"></i>\n}\n@switch (descriptor().columnDisplayType) {\n @case (columnDisplayTypeString) {\n @if (descriptor().hasValueAsTooltip) {\n <span [pTooltip]=\"value()\" tooltipPosition=\"left\">{{ value() }}</span>\n } @else {\n {{ value() }}\n }\n }\n @case (columnDisplayTypeHtml) {\n <span [innerHTML]=\"value()\"></span>\n }\n @case (columnDisplayTypeNumber) {\n {{ value() | number: descriptor().displayFormat : descriptor().locale }}\n }\n @case (columnDisplayTypeCurrency) {\n {{ value() | currency: currency() : descriptor().currencyDisplay : descriptor().displayFormat : descriptor().locale }}\n }\n @case (columnDisplayTypeDate) {\n {{ value() | date: descriptor().displayFormat }}\n }\n @case (columnDisplayTypeBoolean) {\n @if (descriptor().booleanAsIcon) {\n <i [class]=\"value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo : true\"></i>\n } @else {\n {{ value() | mngBoolean: descriptor().booleanYes : descriptor().booleanNo | translate }}\n }\n }\n @case (columnDisplayTypeEnum) {\n {{ value() | mngEnum: descriptor().enum | translate }}\n }\n @case (columnDisplayTypeComponent) {\n <ng-container\n [mngComponent]=\"descriptor().customComponentType!\"\n [inputs]=\"{\n value: value(),\n item: item(),\n descriptor: descriptor()\n }\"></ng-container>\n }\n}\n@if (hasCopyToClipboard()) {\n <div class=\"help-buttons\">\n <button pButton type=\"button\" icon=\"pi pi-copy\" class=\"p-button-rounded p-button-info p-button-sm\" (click)=\"copyToClipboard($event)\"></button>\n </div>\n}\n", styles: [":host{display:inline-block;overflow:hidden}:host.nowrap{white-space:nowrap;text-overflow:ellipsis}:host.multiline{white-space:pre-wrap;word-wrap:break-word}.help-buttons{display:none;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-buttons .p-button{height:1.9rem;width:1.9rem;padding:0}\n"] }]
|
|
1106
|
+
}] });
|
|
1107
|
+
|
|
1108
|
+
class FilterValuePipe {
|
|
1109
|
+
constructor() {
|
|
1110
|
+
this.locale = inject(LOCALE_ID);
|
|
1111
|
+
this.translate = inject(TranslateService);
|
|
1112
|
+
this.enumPipe = new EnumPipe();
|
|
1113
|
+
this.subject = new ReplaySubject(1);
|
|
1114
|
+
}
|
|
1115
|
+
transform(value, descriptor) {
|
|
1116
|
+
const valTransform = this.prepareValueTransform(value, descriptor);
|
|
1117
|
+
this.subscription?.unsubscribe();
|
|
1118
|
+
if (valTransform.translate) {
|
|
1119
|
+
this.subscription = this.translate.stream(valTransform.valueArr).subscribe((i18n) => {
|
|
1120
|
+
this.subject.next(valTransform.valueArr.map(k => i18n[k]).join(', '));
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
else {
|
|
1124
|
+
this.subject.next(valTransform.valueArr.join(', '));
|
|
1125
|
+
}
|
|
1126
|
+
return this.subject.asObservable();
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* If returns a string, this represents i18n key that must go through translation. If translation is not needed, undefined is returned.
|
|
1130
|
+
*/
|
|
1131
|
+
prepareValueTransform(value, descriptor) {
|
|
1132
|
+
const result = {
|
|
1133
|
+
translate: false,
|
|
1134
|
+
valueArr: Array.isArray(value) ? value : [value]
|
|
1135
|
+
};
|
|
1136
|
+
switch (descriptor?.filterType) {
|
|
1137
|
+
case FilterTypeEnum.Date:
|
|
1138
|
+
// eslint-disable-next-line no-case-declarations
|
|
1139
|
+
const datePipe = new DatePipe(this.locale);
|
|
1140
|
+
result.valueArr = result.valueArr.map(v => datePipe.transform(v, descriptor.displayFormat, descriptor.locale));
|
|
1141
|
+
break;
|
|
1142
|
+
case FilterTypeEnum.Number:
|
|
1143
|
+
// eslint-disable-next-line no-case-declarations
|
|
1144
|
+
const decimalPipe = new DecimalPipe(this.locale);
|
|
1145
|
+
result.valueArr = result.valueArr.map(v => decimalPipe.transform(v, descriptor.displayFormat, descriptor.locale));
|
|
1146
|
+
break;
|
|
1147
|
+
case FilterTypeEnum.Boolean:
|
|
1148
|
+
// eslint-disable-next-line no-case-declarations
|
|
1149
|
+
const booleanPipe = new BooleanPipe();
|
|
1150
|
+
result.valueArr = result.valueArr.map(v => booleanPipe.transform(v));
|
|
1151
|
+
result.translate = true;
|
|
1152
|
+
break;
|
|
1153
|
+
case FilterTypeEnum.LookupEnum:
|
|
1154
|
+
// eslint-disable-next-line no-case-declarations
|
|
1155
|
+
const enumPipe = new EnumPipe();
|
|
1156
|
+
result.valueArr = result.valueArr.map(v => enumPipe.transform(v, descriptor.enum));
|
|
1157
|
+
result.translate = true;
|
|
1158
|
+
break;
|
|
1159
|
+
}
|
|
1160
|
+
return result;
|
|
1161
|
+
}
|
|
1162
|
+
ngOnDestroy() {
|
|
1163
|
+
this.subscription?.unsubscribe();
|
|
1164
|
+
this.subject.complete();
|
|
1165
|
+
}
|
|
1166
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: FilterValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1167
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: FilterValuePipe, isStandalone: true, name: "mngFilterValue" }); }
|
|
1168
|
+
}
|
|
1169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: FilterValuePipe, decorators: [{
|
|
1170
|
+
type: Pipe,
|
|
1171
|
+
args: [{
|
|
1172
|
+
name: 'mngFilterValue',
|
|
1173
|
+
pure: true
|
|
1174
|
+
}]
|
|
1175
|
+
}] });
|
|
1176
|
+
|
|
1177
|
+
class TableFilterActiveTagComponent {
|
|
1178
|
+
constructor() {
|
|
1179
|
+
this.FilterMatchMode = FilterMatchMode;
|
|
1180
|
+
this.model = input.required();
|
|
1181
|
+
this.filter = input.required();
|
|
1182
|
+
this.edit = output();
|
|
1183
|
+
this.remove = output();
|
|
1184
|
+
this.label = computed(() => this.getPropertyLabelKey(this.filter().metadata.descriptor));
|
|
1185
|
+
this.matchMode = computed(() => this.filter().displayMatchMode);
|
|
1186
|
+
this.matchModeSymbol = computed(() => `mngFilterActiveTag.matchMode.${this.matchMode()}`);
|
|
1187
|
+
this.value = computed(() => this.filter().displayValue);
|
|
1188
|
+
}
|
|
1189
|
+
onRemove(event) {
|
|
1190
|
+
event.stopPropagation();
|
|
1191
|
+
this.remove.emit({
|
|
1192
|
+
filter: this.filter(),
|
|
1193
|
+
event: event
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
onEdit(event) {
|
|
1197
|
+
this.edit.emit({
|
|
1198
|
+
filter: this.filter(),
|
|
1199
|
+
event: event
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
getPropertyLabelKey(filterDescriptor) {
|
|
1203
|
+
if (filterDescriptor.isGenericFilter) {
|
|
1204
|
+
return filterDescriptor.property;
|
|
1205
|
+
}
|
|
1206
|
+
let labelKey;
|
|
1207
|
+
if (filterDescriptor.title !== undefined && !filterDescriptor.titleUseModelBase) {
|
|
1208
|
+
labelKey = filterDescriptor.title;
|
|
1209
|
+
}
|
|
1210
|
+
else {
|
|
1211
|
+
labelKey = getI18nTypePropertyKey(this.model().i18nBaseKey, filterDescriptor.title ?? filterDescriptor.property);
|
|
1212
|
+
}
|
|
1213
|
+
return labelKey;
|
|
1214
|
+
}
|
|
1215
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableFilterActiveTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1216
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: TableFilterActiveTagComponent, isStandalone: true, selector: "mng-table-filter-active-tag", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { edit: "edit", remove: "remove" }, ngImport: i0, template: "<p-tag severity=\"secondary\" styleClass=\"mr-1 mng-tag-outlined\">\n <div class=\"flex items-center gap-2 p-1 cursor-pointer\" (click)=\"onEdit($event)\">\n <span>{{ label() | translate }}</span>\n @if (matchMode() === FilterMatchMode.Between) {\n <span class=\"font-semibold\">{{ value()?.[0] | mngFilterValue: filter().metadata.descriptor | async }}</span>\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value()?.[1] | mngFilterValue: filter().metadata.descriptor | async }}</span>\n } @else {\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value() | mngFilterValue: filter().metadata.descriptor | async }}</span>\n @if (filter().caseSensitive) {\n <small class=\"border-solid border rounded px-1 text-primary-400\">Aa</small>\n }\n }\n <span class=\"pi pi-times text-xs\" (click)=\"onRemove($event)\"></span>\n </div>\n</p-tag>\n", styles: ["mng-table-filter-active-tag.p-tag.p-tag-secondary.mng-tag-outlined{background-color:unset;border:1px solid var(--mng-tag-secondary-outlined-border)}\n"], dependencies: [{ kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: FilterValuePipe, name: "mngFilterValue" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1217
|
+
}
|
|
1218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableFilterActiveTagComponent, decorators: [{
|
|
1219
|
+
type: Component,
|
|
1220
|
+
args: [{ selector: 'mng-table-filter-active-tag', imports: [TranslatePipe, FilterValuePipe, AsyncPipe, Tag], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<p-tag severity=\"secondary\" styleClass=\"mr-1 mng-tag-outlined\">\n <div class=\"flex items-center gap-2 p-1 cursor-pointer\" (click)=\"onEdit($event)\">\n <span>{{ label() | translate }}</span>\n @if (matchMode() === FilterMatchMode.Between) {\n <span class=\"font-semibold\">{{ value()?.[0] | mngFilterValue: filter().metadata.descriptor | async }}</span>\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value()?.[1] | mngFilterValue: filter().metadata.descriptor | async }}</span>\n } @else {\n <span class=\"text-primary\">{{ matchModeSymbol() | translate }}</span>\n <span class=\"font-semibold\">{{ value() | mngFilterValue: filter().metadata.descriptor | async }}</span>\n @if (filter().caseSensitive) {\n <small class=\"border-solid border rounded px-1 text-primary-400\">Aa</small>\n }\n }\n <span class=\"pi pi-times text-xs\" (click)=\"onRemove($event)\"></span>\n </div>\n</p-tag>\n", styles: ["mng-table-filter-active-tag.p-tag.p-tag-secondary.mng-tag-outlined{background-color:unset;border:1px solid var(--mng-tag-secondary-outlined-border)}\n"] }]
|
|
1221
|
+
}] });
|
|
1222
|
+
|
|
1223
|
+
class TableFilterFormComponent {
|
|
1224
|
+
constructor() {
|
|
1225
|
+
this.lookupTypeDropdown = FilterLookupTypeEnum.Dropdown;
|
|
1226
|
+
this.lookupTypeAutocomplete = FilterLookupTypeEnum.Autocomplete;
|
|
1227
|
+
this.FilterTypeEnum = FilterTypeEnum;
|
|
1228
|
+
this.FilterMatchMode = FilterMatchMode;
|
|
1229
|
+
this.elementRef = inject(ElementRef);
|
|
1230
|
+
this.translate = inject(TranslateService);
|
|
1231
|
+
this.title = input();
|
|
1232
|
+
this.metadata = input.required();
|
|
1233
|
+
this.genericDescriptor = input();
|
|
1234
|
+
this.model = input.required();
|
|
1235
|
+
this.filter = input();
|
|
1236
|
+
this.overlay = input();
|
|
1237
|
+
this.disabledProperties = input([]);
|
|
1238
|
+
this.enableCaseSensitive = input(true);
|
|
1239
|
+
this.propertySearch = input(false, { transform: booleanAttribute });
|
|
1240
|
+
this.apply = output();
|
|
1241
|
+
this.propertyOptionsWithTranslations = computed(() => {
|
|
1242
|
+
const disabledProperties = this.disabledProperties();
|
|
1243
|
+
const filter = this.filter();
|
|
1244
|
+
return (this.metadata()?.map(d => {
|
|
1245
|
+
return {
|
|
1246
|
+
property: d.descriptor.property,
|
|
1247
|
+
label: d.descriptor.isGenericFilter ? d.descriptor.property : this.getPropertyLabelKey(d.descriptor),
|
|
1248
|
+
disabled: !filter && disabledProperties.includes(d.descriptor.property)
|
|
1249
|
+
};
|
|
1250
|
+
}) ?? []);
|
|
1251
|
+
});
|
|
1252
|
+
this.selectedFilterMetadata = computed(() => {
|
|
1253
|
+
const property = this.propertyModel();
|
|
1254
|
+
return this.metadata().find(d => d.descriptor.property === property);
|
|
1255
|
+
});
|
|
1256
|
+
// change value lookup function to include the property name of the generic filter
|
|
1257
|
+
this.genericValueDataProvider = computed(() => {
|
|
1258
|
+
const genericValueProvider = this.genericDescriptor()?.valueLookup;
|
|
1259
|
+
if (genericValueProvider && genericValueProvider.serviceType) {
|
|
1260
|
+
const lookupFn = genericValueProvider.lookup;
|
|
1261
|
+
return lookupDataProvider({ service: genericValueProvider.serviceType }).withLookup((params, service, search) => {
|
|
1262
|
+
params = {
|
|
1263
|
+
...params,
|
|
1264
|
+
filters: {
|
|
1265
|
+
...params?.filters,
|
|
1266
|
+
field: {
|
|
1267
|
+
value: this.selectedFilterMetadata()?.descriptor.property,
|
|
1268
|
+
matchMode: this.selectedFilterMetadata()?.descriptor.filterType === FilterTypeEnum.LookupEnum ? FilterMatchMode.In : FilterMatchMode.StartsWith
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
return lookupFn(params, service, search);
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
return;
|
|
1276
|
+
});
|
|
1277
|
+
this.selectedDescriptorAsLookup = computed(() => {
|
|
1278
|
+
const filterDescriptor = this.selectedFilterMetadata()?.descriptor;
|
|
1279
|
+
return filterDescriptor !== undefined &&
|
|
1280
|
+
!filterDescriptor.isGenericFilter &&
|
|
1281
|
+
(filterDescriptor.filterType === FilterTypeEnum.Lookup || filterDescriptor.filterType === FilterTypeEnum.LookupEnum)
|
|
1282
|
+
? filterDescriptor
|
|
1283
|
+
: undefined;
|
|
1284
|
+
});
|
|
1285
|
+
this.isEdit = computed(() => this.filter() != null);
|
|
1286
|
+
this.formSubmitted = signal(false);
|
|
1287
|
+
this.formErrorMessage = signal([]);
|
|
1288
|
+
// UI utilities
|
|
1289
|
+
this.filterForm = viewChild.required('filterForm');
|
|
1290
|
+
// Filter form model and form utilities
|
|
1291
|
+
this.propertyModel = signal(null);
|
|
1292
|
+
this.matchModeModel = signal(null);
|
|
1293
|
+
this.valueModel = signal(null);
|
|
1294
|
+
this.caseSensitiveModel = signal(false);
|
|
1295
|
+
this.isMultiselect = computed(() => this.matchModeModel() === FilterMatchMode.In || this.matchModeModel() === FilterMatchMode.NotIn);
|
|
1296
|
+
effectWithDeps([this.filter], ([edit]) => {
|
|
1297
|
+
if (edit) {
|
|
1298
|
+
this.resetForm({
|
|
1299
|
+
property: edit.metadata.descriptor.property,
|
|
1300
|
+
matchMode: edit.displayMatchMode ?? edit.matchMode ?? null,
|
|
1301
|
+
value: edit.displayValue ?? edit.value,
|
|
1302
|
+
caseSensitive: edit.caseSensitive ?? false
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
else {
|
|
1306
|
+
this.resetForm();
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
effectWithDeps([this.selectedFilterMetadata], ([selectedFilterMetadata]) => {
|
|
1310
|
+
const descriptor = selectedFilterMetadata?.descriptor;
|
|
1311
|
+
const value = this.valueModel();
|
|
1312
|
+
if (value != null) {
|
|
1313
|
+
// reset value if filter type and value type mismatch
|
|
1314
|
+
if ((descriptor?.filterType === FilterTypeEnum.String && (value === true || value === false || value === 'true' || value === 'false' || value instanceof Date)) ||
|
|
1315
|
+
(descriptor?.filterType === FilterTypeEnum.Number && typeof value !== 'number' && isNaN(+value)) ||
|
|
1316
|
+
(descriptor?.filterType === FilterTypeEnum.Date && !(value instanceof Date)) ||
|
|
1317
|
+
descriptor?.filterType === FilterTypeEnum.Lookup ||
|
|
1318
|
+
descriptor?.filterType === FilterTypeEnum.LookupEnum) {
|
|
1319
|
+
this.valueModel.set(null);
|
|
1320
|
+
}
|
|
1321
|
+
else if (descriptor?.filterType === FilterTypeEnum.Boolean && typeof value !== 'boolean') {
|
|
1322
|
+
this.valueModel.set(false);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
const matchModeOptions = selectedFilterMetadata?.matchModes ?? [];
|
|
1326
|
+
const matchMode = this.matchModeModel();
|
|
1327
|
+
const filterForm = this.filterForm();
|
|
1328
|
+
if (matchModeOptions.length > 0 &&
|
|
1329
|
+
(!matchMode || filterForm.controls['matchMode']?.pristine || filterForm.controls['matchMode']?.untouched || !matchModeOptions.find(o => o.value === matchMode))) {
|
|
1330
|
+
this.matchModeModel.set(filterGetDefaultMatchMode(this.selectedFilterMetadata()?.descriptor, matchModeOptions));
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
effectWithDeps([this.matchModeModel], ([matchModeModel]) => this.valueModel.set(filterAdjustDisplayValueOnMatchModeChange(matchModeModel ?? undefined, this.valueModel())));
|
|
1334
|
+
toObservable(this.overlay)
|
|
1335
|
+
.pipe(switchMap(o => (o ? o.onShow : NEVER)), takeUntilDestroyed())
|
|
1336
|
+
.subscribe(() => {
|
|
1337
|
+
const formFields = this.elementRef.nativeElement.querySelectorAll('input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [role="combobox"]:not([disabled])');
|
|
1338
|
+
const activeEl = document.activeElement;
|
|
1339
|
+
const activeInputIdx = activeEl ? [...formFields].findIndex(el => activeEl.isEqualNode(el)) : 0;
|
|
1340
|
+
if (activeInputIdx <= 0) {
|
|
1341
|
+
formFields[0].focus();
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
onFormSubmit(form) {
|
|
1346
|
+
this.formSubmitted.set(true);
|
|
1347
|
+
// mark all as dirty
|
|
1348
|
+
for (const key in form.controls) {
|
|
1349
|
+
form.controls[key].markAsDirty();
|
|
1350
|
+
}
|
|
1351
|
+
const property = this.propertyModel();
|
|
1352
|
+
const matchMode = this.matchModeModel();
|
|
1353
|
+
if (form.invalid || !property || !matchMode) {
|
|
1354
|
+
this.formErrorMessage.set([
|
|
1355
|
+
{
|
|
1356
|
+
severity: 'warn',
|
|
1357
|
+
summary: this.translate.instant('mngFilter.messages.invalidFormTitle'),
|
|
1358
|
+
detail: this.translate.instant('mngFilter.messages.invalidFormMessage')
|
|
1359
|
+
}
|
|
1360
|
+
]);
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
this.apply.emit({
|
|
1364
|
+
property: property,
|
|
1365
|
+
matchMode: matchMode,
|
|
1366
|
+
value: this.valueModel(),
|
|
1367
|
+
caseSensitive: this.caseSensitiveModel()
|
|
1368
|
+
});
|
|
1369
|
+
// resetting the form is done from the parent component (filter-overlay-with-tag) for smoother animations
|
|
1370
|
+
}
|
|
1371
|
+
resetForm(value) {
|
|
1372
|
+
this.filterForm().resetForm(value);
|
|
1373
|
+
// somehow have to set case sensitivity manually
|
|
1374
|
+
this.caseSensitiveModel.set(value?.caseSensitive ?? false);
|
|
1375
|
+
this.formSubmitted.set(false);
|
|
1376
|
+
}
|
|
1377
|
+
getPropertyLabelKey(filterDescriptor) {
|
|
1378
|
+
let labelKey;
|
|
1379
|
+
if (filterDescriptor.title !== undefined && !filterDescriptor.titleUseModelBase) {
|
|
1380
|
+
labelKey = filterDescriptor.title;
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
labelKey = getI18nTypePropertyKey(this.model().i18nBaseKey, filterDescriptor.title ?? filterDescriptor.property);
|
|
1384
|
+
}
|
|
1385
|
+
return labelKey;
|
|
1386
|
+
}
|
|
1387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableFilterFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1388
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: TableFilterFormComponent, isStandalone: true, selector: "mng-table-filter-form", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null }, genericDescriptor: { classPropertyName: "genericDescriptor", publicName: "genericDescriptor", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, overlay: { classPropertyName: "overlay", publicName: "overlay", isSignal: true, isRequired: false, transformFunction: null }, disabledProperties: { classPropertyName: "disabledProperties", publicName: "disabledProperties", isSignal: true, isRequired: false, transformFunction: null }, enableCaseSensitive: { classPropertyName: "enableCaseSensitive", publicName: "enableCaseSensitive", isSignal: true, isRequired: false, transformFunction: null }, propertySearch: { classPropertyName: "propertySearch", publicName: "propertySearch", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply" }, host: { classAttribute: "flex grow" }, viewQueries: [{ propertyName: "filterForm", first: true, predicate: ["filterForm"], descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <div>\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-col items-center lg:flex-row gap-4\">\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"property\"\n id=\"property\"\n tabindex=\"1\"\n #propertyControl=\"ngModel\"\n [(ngModel)]=\"propertyModel\"\n [options]=\"propertyOptionsWithTranslations()\"\n optionsValueProperty=\"property\"\n optionsDisabledProperty=\"disabled\"\n optionsLabelProperty=\"label\"\n [placeholder]=\"'mngFilter.property' | translate\"\n [optionsLabelTranslate]=\"!propertySearch()\"\n [inlineSearch]=\"propertySearch()\"\n required=\"true\"\n className=\"w-full\"\n [disabled]=\"isEdit()\"\n [appendTo]=\"null\" />\n </div>\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"matchMode\"\n id=\"matchMode\"\n [(ngModel)]=\"matchModeModel\"\n className=\"w-full\"\n [options]=\"selectedFilterMetadata()?.matchModes ?? []\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"self-end\"\n required=\"true\"\n [appendTo]=\"null\" />\n </div>\n @if (!(matchModeModel() === FilterMatchMode.Exists || matchModeModel() === FilterMatchMode.DoesNotExist)) {\n <div class=\"w-full lg:w-auto flex flex-col\">\n @switch (selectedFilterMetadata()?.descriptor?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [(ngModel)]=\"valueModel\" [disabled]=\"!matchModeModel()\" name=\"value\" binary=\"true\" required=\"true\" />\n }\n @case (FilterTypeEnum.Date) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-date-range\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime ?? false\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\"></mng-date-range>\n } @else {\n <p-date-picker\n appendTo=\"body\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime ?? false\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [firstDayOfWeek]=\"1\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </p-date-picker>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @default {\n @if (selectedFilterMetadata()?.descriptor?.genericValueProvider && genericValueDataProvider()) {\n <div class=\"flex\">\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedFilterMetadata()?.descriptor?.className + ' ' + (enableCaseSensitive() ? '!rounded-r-none' : '')\"\n [dropdownClassName]=\"selectedFilterMetadata()?.descriptor?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n } @else {\n <div class=\"flex\">\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input w-full\"\n [class.!rounded-r-none]=\"enableCaseSensitive()\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n }\n }\n }\n <ng-template #lookupFilter>\n @if (selectedDescriptorAsLookup(); as lookupFilterDescriptor) {\n @switch (lookupFilterDescriptor.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsTrackProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.autocompleteInlineSearch ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className + ' w-full'\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n }\n } @else if (selectedFilterMetadata()?.descriptor?.isGenericFilter && genericValueDataProvider()) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n </ng-template>\n </div>\n }\n <div class=\"flex justify-end\">\n <button pButton type=\"submit\" class=\"self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n @for (message of formErrorMessage(); track message) {\n <p-message [severity]=\"message.severity\" [text]=\"message.detail\" [icon]=\"message.icon\" styleClass=\"mt-2\" />\n }\n }\n</div>\n", styles: ["::ng-deep .mng-toggle-button-addon-right button,::ng-deep .mng-toggle-button-addon-right button.p-togglebutton-checked{border-color:var(--p-select-border-color)!important;border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}\n"], dependencies: [{ kind: "component", type: DropdownComponent, selector: "mng-dropdown", inputs: ["dataProvider", "options", "optionsTrackProperty", "optionsLabelProperty", "optionsLabelTranslate", "optionsValueProperty", "optionsDisabledProperty", "multiselect", "placeholder", "showClear", "selectFirstItem", "className", "dropdownClassName", "changeValueOnBlur", "loading", "disabled", "allowInput", "appendTo", "inlineSearch", "searchTrim"], outputs: ["valueChange", "blur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: InputTrimDirective, selector: "[mngInputTrim]", inputs: ["mngInputTrim"] }, { kind: "component", type: NumberRangeComponent, selector: "mng-number-range", inputs: ["placeholder", "useGrouping", "minFractionDigits", "maxFractionDigits", "required", "disabled", "vertical"], outputs: ["keyDown"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled", "fluid"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: DateRangeComponent, selector: "mng-date-range", inputs: ["placeholder", "showTime", "showSeconds", "dateFormat", "className", "required", "disabled", "vertical"] }, { kind: "component", type: AutocompleteComponent, selector: "mng-autocomplete", inputs: ["dataProvider", "optionsTrackProperty", "optionsValueProperty", "optionsLabelProperty", "optionsLabelTranslate", "inlineSearch", "openOnFocus", "multiselect", "placeholder", "className", "dropdownClassName", "showClear", "autoClear", "selectFirst", "searchTrim", "disabled"], outputs: ["valueChange", "blur"] }, { kind: "component", type: Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "disabled", "style", "styleClass", "inputId", "tabindex", "size", "iconPos", "autofocus", "allowEmpty"], outputs: ["onChange"] }, { kind: "component", type: DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "size", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1389
|
+
}
|
|
1390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableFilterFormComponent, decorators: [{
|
|
1391
|
+
type: Component,
|
|
1392
|
+
args: [{ selector: 'mng-table-filter-form', imports: [
|
|
1393
|
+
DropdownComponent,
|
|
1394
|
+
FormsModule,
|
|
1395
|
+
TranslatePipe,
|
|
1396
|
+
InputTrimDirective,
|
|
1397
|
+
NumberRangeComponent,
|
|
1398
|
+
InputNumber,
|
|
1399
|
+
DateRangeComponent,
|
|
1400
|
+
AutocompleteComponent,
|
|
1401
|
+
Checkbox,
|
|
1402
|
+
Message,
|
|
1403
|
+
InputText,
|
|
1404
|
+
NgTemplateOutlet,
|
|
1405
|
+
ToggleButton,
|
|
1406
|
+
DatePicker,
|
|
1407
|
+
ButtonDirective
|
|
1408
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1409
|
+
class: 'flex grow'
|
|
1410
|
+
}, template: "<div>\n <div>\n <h5>{{ filter() ? ('mngFilter.titleEdit' | translate) : ('mngFilter.titleAdd' | translate) }}</h5>\n </div>\n <form #filterForm=\"ngForm\" (ngSubmit)=\"onFormSubmit(filterForm)\" class=\"flex flex-col items-center lg:flex-row gap-4\">\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"property\"\n id=\"property\"\n tabindex=\"1\"\n #propertyControl=\"ngModel\"\n [(ngModel)]=\"propertyModel\"\n [options]=\"propertyOptionsWithTranslations()\"\n optionsValueProperty=\"property\"\n optionsDisabledProperty=\"disabled\"\n optionsLabelProperty=\"label\"\n [placeholder]=\"'mngFilter.property' | translate\"\n [optionsLabelTranslate]=\"!propertySearch()\"\n [inlineSearch]=\"propertySearch()\"\n required=\"true\"\n className=\"w-full\"\n [disabled]=\"isEdit()\"\n [appendTo]=\"null\" />\n </div>\n <div class=\"w-full lg:w-auto\">\n <mng-dropdown\n name=\"matchMode\"\n id=\"matchMode\"\n [(ngModel)]=\"matchModeModel\"\n className=\"w-full\"\n [options]=\"selectedFilterMetadata()?.matchModes ?? []\"\n [placeholder]=\"'mngFilter.matchMode' | translate\"\n [disabled]=\"!propertyControl.value\"\n class=\"self-end\"\n required=\"true\"\n [appendTo]=\"null\" />\n </div>\n @if (!(matchModeModel() === FilterMatchMode.Exists || matchModeModel() === FilterMatchMode.DoesNotExist)) {\n <div class=\"w-full lg:w-auto flex flex-col\">\n @switch (selectedFilterMetadata()?.descriptor?.filterType) {\n @case (FilterTypeEnum.Number) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-number-range\n className=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping ?? false\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n required=\"true\" />\n } @else {\n <p-inputNumber\n inputStyleClass=\"mng-column-filter-number-input\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [useGrouping]=\"selectedFilterMetadata()?.descriptor?.numberUseGrouping\"\n [minFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMin\"\n [maxFractionDigits]=\"selectedFilterMetadata()?.numberConfig?.fractionsMax\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\" />\n }\n }\n\n @case (FilterTypeEnum.Boolean) {\n <p-checkbox [(ngModel)]=\"valueModel\" [disabled]=\"!matchModeModel()\" name=\"value\" binary=\"true\" required=\"true\" />\n }\n @case (FilterTypeEnum.Date) {\n @if (matchModeModel() === FilterMatchMode.Between) {\n <mng-date-range\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime ?? false\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\"></mng-date-range>\n } @else {\n <p-date-picker\n appendTo=\"body\"\n name=\"value\"\n [(ngModel)]=\"valueModel\"\n [styleClass]=\"'w-full'\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [showIcon]=\"true\"\n [showTime]=\"selectedFilterMetadata()?.dateConfig?.showTime ?? false\"\n [showSeconds]=\"selectedFilterMetadata()?.dateConfig?.showSeconds ?? false\"\n [dateFormat]=\"selectedFilterMetadata()?.dateConfig?.format\"\n [firstDayOfWeek]=\"1\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </p-date-picker>\n }\n }\n @case (FilterTypeEnum.Lookup) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @case (FilterTypeEnum.LookupEnum) {\n <ng-container *ngTemplateOutlet=\"lookupFilter\"></ng-container>\n }\n @default {\n @if (selectedFilterMetadata()?.descriptor?.genericValueProvider && genericValueDataProvider()) {\n <div class=\"flex\">\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [className]=\"selectedFilterMetadata()?.descriptor?.className + ' ' + (enableCaseSensitive() ? '!rounded-r-none' : '')\"\n [dropdownClassName]=\"selectedFilterMetadata()?.descriptor?.dropdownClassName\"\n [placeholder]=\"valueModel() ? undefined : ('mngFilter.value' | translate)\"\n allowInput=\"true\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n } @else {\n <div class=\"flex\">\n <input\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n type=\"text\"\n pInputText\n class=\"mng-column-filter-string-input w-full\"\n [class.!rounded-r-none]=\"enableCaseSensitive()\"\n [attr.placeholder]=\"'mngFilter.value' | translate\"\n [mngInputTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n required=\"true\" />\n @if (enableCaseSensitive()) {\n <p-toggle-button\n [(ngModel)]=\"caseSensitiveModel\"\n [disabled]=\"!matchModeModel()\"\n name=\"caseSensitive\"\n styleClass=\"mng-button-xs mng-toggle-button-addon-right\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n }\n </div>\n }\n }\n }\n <ng-template #lookupFilter>\n @if (selectedDescriptorAsLookup(); as lookupFilterDescriptor) {\n @switch (lookupFilterDescriptor.lookupType) {\n @case (lookupTypeAutocomplete) {\n <mng-autocomplete\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsTrackProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [autoClear]=\"lookupFilterDescriptor.autocompleteAutoClear ?? false\"\n [openOnFocus]=\"lookupFilterDescriptor.autocompleteAutoClear ?? true\"\n [inlineSearch]=\"lookupFilterDescriptor.autocompleteInlineSearch ?? false\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n [searchTrim]=\"selectedFilterMetadata()?.descriptor?.trimOption\"\n [disabled]=\"!matchModeModel()\"\n required=\"true\">\n </mng-autocomplete>\n }\n @case (lookupTypeDropdown) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"lookupFilterDescriptor.dataProvider\"\n [optionsValueProperty]=\"lookupFilterDescriptor.optionsValueProperty\"\n [optionsLabelProperty]=\"lookupFilterDescriptor.optionsLabelProperty\"\n [optionsLabelTranslate]=\"lookupFilterDescriptor.optionsLabelTranslate\"\n [multiselect]=\"isMultiselect()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n [className]=\"lookupFilterDescriptor.className + ' w-full'\"\n [dropdownClassName]=\"lookupFilterDescriptor.dropdownClassName\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n }\n } @else if (selectedFilterMetadata()?.descriptor?.isGenericFilter && genericValueDataProvider()) {\n <mng-dropdown\n [(ngModel)]=\"valueModel\"\n name=\"value\"\n [dataProvider]=\"genericValueDataProvider()\"\n [placeholder]=\"'mngFilter.value' | translate\"\n showClear=\"false\"\n [disabled]=\"!matchModeModel()\"\n [appendTo]=\"null\"\n required=\"true\">\n </mng-dropdown>\n }\n </ng-template>\n </div>\n }\n <div class=\"flex justify-end\">\n <button pButton type=\"submit\" class=\"self-end\">\n {{ (filter() ? 'general.apply' : 'general.add') | translate }}\n </button>\n </div>\n </form>\n @if (formSubmitted() && filterForm.invalid) {\n @for (message of formErrorMessage(); track message) {\n <p-message [severity]=\"message.severity\" [text]=\"message.detail\" [icon]=\"message.icon\" styleClass=\"mt-2\" />\n }\n }\n</div>\n", styles: ["::ng-deep .mng-toggle-button-addon-right button,::ng-deep .mng-toggle-button-addon-right button.p-togglebutton-checked{border-color:var(--p-select-border-color)!important;border-left:none!important;border-top-left-radius:0!important;border-bottom-left-radius:0!important}\n"] }]
|
|
1411
|
+
}], ctorParameters: () => [] });
|
|
1412
|
+
|
|
1413
|
+
class TableFilterOverlayWithTagComponent {
|
|
1414
|
+
static { this.SEARCH_WORD_LIMIT_MAX = 4; }
|
|
1415
|
+
constructor() {
|
|
1416
|
+
this.primeTable = inject(Table);
|
|
1417
|
+
this.tableData = inject((TableDataService));
|
|
1418
|
+
this.tableConfig = inject(COMMONS_TABLE_FEATURE_CONFIG_IT, { optional: true });
|
|
1419
|
+
this.metadata = input.required();
|
|
1420
|
+
this.genericFilterDescriptor = input();
|
|
1421
|
+
this.model = input.required();
|
|
1422
|
+
this.enableSearch = input(false, { transform: booleanAttribute });
|
|
1423
|
+
this.search = input();
|
|
1424
|
+
this.searchLimitWordMax = input(undefined);
|
|
1425
|
+
this.enableCaseSensitive = input(true, { transform: booleanAttribute });
|
|
1426
|
+
this.filterOverlay = viewChild.required(Popover);
|
|
1427
|
+
this.filterFormComponent = viewChild(TableFilterFormComponent);
|
|
1428
|
+
this.templates = contentChildren(TemplateDirective);
|
|
1429
|
+
this.titleTemplate = computed(() => findTemplateByName([...this.templates()], 'title'));
|
|
1430
|
+
this.filters = computed(() => {
|
|
1431
|
+
return this.getInitialFilters(this.tableData.filterMeta(), this.metadata());
|
|
1432
|
+
});
|
|
1433
|
+
this.showFilterButton = computed(() => this.metadata().length > 0);
|
|
1434
|
+
this.activeFilters = computed(() => {
|
|
1435
|
+
const filterEntry = this.filters();
|
|
1436
|
+
return this.metadata()
|
|
1437
|
+
.filter(d => {
|
|
1438
|
+
const filter = filterEntry[d.descriptor.property];
|
|
1439
|
+
return (filter &&
|
|
1440
|
+
filter.matchMode !== undefined &&
|
|
1441
|
+
filter.displayMatchMode !== undefined &&
|
|
1442
|
+
(filter.matchMode === FilterMatchMode.Exists ||
|
|
1443
|
+
filter.matchMode === FilterMatchMode.DoesNotExist ||
|
|
1444
|
+
(filter.value !== undefined && filter.displayValue !== undefined)));
|
|
1445
|
+
})
|
|
1446
|
+
.map(d => filterEntry[d.descriptor.property]);
|
|
1447
|
+
});
|
|
1448
|
+
this.activeFilterProperties = computed(() => this.activeFilters().map(f => f.metadata.descriptor.property));
|
|
1449
|
+
this.filterEdit = signal(undefined);
|
|
1450
|
+
// global search model
|
|
1451
|
+
this.searchValue = computed(() => this.search()?.value);
|
|
1452
|
+
this.searchCaseSensitive = computed(() => this.search()?.caseSensitive);
|
|
1453
|
+
this.searchWordLimitMaxError = signal(false);
|
|
1454
|
+
this.searchWordLimitMaxCmp = computed(() => {
|
|
1455
|
+
const inputLimit = this.searchLimitWordMax();
|
|
1456
|
+
if (inputLimit !== undefined) {
|
|
1457
|
+
return inputLimit;
|
|
1458
|
+
}
|
|
1459
|
+
return this.tableConfig?.searchLimitMaxWords !== undefined ? this.tableConfig?.searchLimitMaxWords : TableFilterOverlayWithTagComponent.SEARCH_WORD_LIMIT_MAX;
|
|
1460
|
+
});
|
|
1461
|
+
this.searchValueSubject = new BehaviorSubject(undefined);
|
|
1462
|
+
this.searchCaseSensitiveSubject = new BehaviorSubject(undefined);
|
|
1463
|
+
// UI utilities
|
|
1464
|
+
this.clickedOnFilterEvent = undefined;
|
|
1465
|
+
combineLatest([this.searchValueSubject.pipe(debounceTime(500), distinctUntilChanged()), this.searchCaseSensitiveSubject])
|
|
1466
|
+
// NOTE: skip is used to ignore propagating the initial value of the subjects
|
|
1467
|
+
.pipe(skip(1), takeUntilDestroyed())
|
|
1468
|
+
.subscribe(([value, caseSensitive]) => {
|
|
1469
|
+
this.updatePrimeTableGlobalFilter(value == null ? (this.search()?.value ?? '') : value, caseSensitive == null ? (this.search()?.caseSensitive ?? undefined) : caseSensitive);
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
onFilterFormApply(event) {
|
|
1473
|
+
const filterMetadata = this.metadata().find(d => d.descriptor.property === event.property);
|
|
1474
|
+
if (!filterMetadata) {
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
const filterData = {
|
|
1478
|
+
...filterSetMetadataOnDisplayChange({ caseSensitive: event.caseSensitive }, event.matchMode, event.value, filterMetadata.descriptor.filterType, filterMetadata.dateConfig),
|
|
1479
|
+
metadata: filterMetadata
|
|
1480
|
+
};
|
|
1481
|
+
this.updatePrimeTableFilter(filterData);
|
|
1482
|
+
// this keeps the UI updated properly before closing the overlay
|
|
1483
|
+
this.filterEdit.set(filterData);
|
|
1484
|
+
// Resetting the form is done in the onOverlayHide callback because resetting the
|
|
1485
|
+
// values here renders empty inputs for a split second before closing the overlay
|
|
1486
|
+
this.filterOverlay().hide();
|
|
1487
|
+
}
|
|
1488
|
+
onFilterRemove(event) {
|
|
1489
|
+
this.updatePrimeTableFilter({
|
|
1490
|
+
...this.filters()[event.filter.metadata.descriptor.property],
|
|
1491
|
+
matchMode: undefined,
|
|
1492
|
+
displayMatchMode: undefined,
|
|
1493
|
+
value: undefined,
|
|
1494
|
+
displayValue: undefined
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
onFilterEdit(event) {
|
|
1498
|
+
this.onFilterAddOrEdit(event.filter, event.event);
|
|
1499
|
+
}
|
|
1500
|
+
onFilterAdd(event) {
|
|
1501
|
+
this.onFilterAddOrEdit(undefined, event);
|
|
1502
|
+
}
|
|
1503
|
+
onSearchChange(value) {
|
|
1504
|
+
const searchWordLimitMax = this.searchWordLimitMaxCmp();
|
|
1505
|
+
if (searchWordLimitMax !== null) {
|
|
1506
|
+
const wordCount = value.split(/\s+/).filter(word => word.length > 0).length;
|
|
1507
|
+
this.searchWordLimitMaxError.set(wordCount > searchWordLimitMax);
|
|
1508
|
+
}
|
|
1509
|
+
else {
|
|
1510
|
+
this.searchWordLimitMaxError.set(false);
|
|
1511
|
+
}
|
|
1512
|
+
if (!this.searchWordLimitMaxError()) {
|
|
1513
|
+
this.searchValueSubject.next(value);
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
onSearchCaseSensitiveChange(value) {
|
|
1517
|
+
this.searchCaseSensitiveSubject.next(value);
|
|
1518
|
+
}
|
|
1519
|
+
onOverlayHide() {
|
|
1520
|
+
// resetting the form is done here for a smoother animation
|
|
1521
|
+
if (this.filterFormComponent !== undefined) {
|
|
1522
|
+
this.filterFormComponent()?.resetForm();
|
|
1523
|
+
}
|
|
1524
|
+
if (this.clickedOnFilterEvent) {
|
|
1525
|
+
// show the overlay again if the user clicked another filter
|
|
1526
|
+
setTimeout(() => {
|
|
1527
|
+
this.filterEdit.set(this.clickedOnFilterEvent?.filter);
|
|
1528
|
+
this.filterOverlay().show(this.clickedOnFilterEvent?.event);
|
|
1529
|
+
this.clickedOnFilterEvent = undefined;
|
|
1530
|
+
}, 0);
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
else {
|
|
1534
|
+
// clean state
|
|
1535
|
+
this.filterEdit.set(undefined);
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
onFilterAddOrEdit(filter, event) {
|
|
1539
|
+
// If user clicks on the same filter or add that is already open, close the overlay
|
|
1540
|
+
if (this.filterOverlay().overlayVisible && this.filterEdit()?.metadata.descriptor.property === filter?.metadata.descriptor.property) {
|
|
1541
|
+
this.filterOverlay().hide();
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
if (this.filterOverlay().overlayVisible) {
|
|
1545
|
+
// In case the user clicks another filter, 're-showing' the overlay in
|
|
1546
|
+
// the new position is done in the onOverlayHide callback
|
|
1547
|
+
this.clickedOnFilterEvent = { event, filter };
|
|
1548
|
+
this.filterOverlay().hide();
|
|
1549
|
+
}
|
|
1550
|
+
else {
|
|
1551
|
+
this.filterEdit.set(filter);
|
|
1552
|
+
this.filterOverlay().show(event);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
getInitialFilters(filtersInit, metadata) {
|
|
1556
|
+
const filtersResult = {};
|
|
1557
|
+
if (filtersInit) {
|
|
1558
|
+
for (const property in filtersInit) {
|
|
1559
|
+
const filterInit = filtersInit[property];
|
|
1560
|
+
const filterMetadata = metadata.find(m => m.descriptor.property === property);
|
|
1561
|
+
if (!filterMetadata) {
|
|
1562
|
+
continue;
|
|
1563
|
+
}
|
|
1564
|
+
filtersResult[property] = {
|
|
1565
|
+
...filterSetMetadataOnChange(filterInit, filterInit.matchMode, filterInit.value, filterMetadata.descriptor.filterType, filterMetadata.dateConfig),
|
|
1566
|
+
metadata: filterMetadata
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
return filtersResult;
|
|
1571
|
+
}
|
|
1572
|
+
updatePrimeTableFilter(filter) {
|
|
1573
|
+
this.primeTable.filters[filter.metadata.descriptor.property] = { ...filter };
|
|
1574
|
+
this.primeTable._filter();
|
|
1575
|
+
}
|
|
1576
|
+
updatePrimeTableGlobalFilter(searchQuery, caseSensitive = false) {
|
|
1577
|
+
// match mode needs to be set for inline search
|
|
1578
|
+
this.primeTable.filters['global'] = { ...{ value: searchQuery, matchMode: 'contains', caseSensitive: caseSensitive } };
|
|
1579
|
+
this.primeTable._filter();
|
|
1580
|
+
}
|
|
1581
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableFilterOverlayWithTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1582
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: TableFilterOverlayWithTagComponent, isStandalone: true, selector: "mng-table-filter-overlay-with-tag", inputs: { metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: true, transformFunction: null }, genericFilterDescriptor: { classPropertyName: "genericFilterDescriptor", publicName: "genericFilterDescriptor", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, searchLimitWordMax: { classPropertyName: "searchLimitWordMax", publicName: "searchLimitWordMax", isSignal: true, isRequired: false, transformFunction: null }, enableCaseSensitive: { classPropertyName: "enableCaseSensitive", publicName: "enableCaseSensitive", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "templates", predicate: TemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "filterOverlay", first: true, predicate: Popover, descendants: true, isSignal: true }, { propertyName: "filterFormComponent", first: true, predicate: TableFilterFormComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex items-center grow\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n @if (showFilterButton()) {\n <p-button\n icon=\"pi pi-filter\"\n rounded=\"true\"\n [severity]=\"activeFilters().length > 0 ? 'primary' : 'secondary'\"\n size=\"small\"\n (click)=\"onFilterAdd($event)\"\n [styleClass]=\"'my-1 mr-2' + (titleTemplate() ? ' ml-3' : '')\">\n </p-button>\n }\n @if (enableSearch()) {\n <div class=\"col-span-4\" [ngClass]=\"{'ml-3': !showFilterButton() && titleTemplate()}\">\n <span class=\"p-input-icon-left w-full\">\n <p-iconfield>\n <p-inputicon class=\"pi pi-search\" />\n <input\n [ngModel]=\"searchValue()\"\n (ngModelChange)=\"onSearchChange($event)\"\n name=\"globalSearch\"\n type=\"text\"\n pInputText\n class=\"search-input w-full\"\n [ngClass]=\"{'ng-invalid': searchWordLimitMaxError()}\"\n [attr.placeholder]=\"'mngFilter.search.input' | translate\"\n [placeholder]=\"'mngFilter.search.input' | translate\" />\n </p-iconfield>\n @if (enableCaseSensitive()) {\n <span class=\"toggle-button-input\">\n <p-toggleButton\n styleClass=\"ml-1 p-1 p-button-sm\"\n [ngModel]=\"searchCaseSensitive()\"\n (ngModelChange)=\"onSearchCaseSensitiveChange($event)\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n </span>\n }\n </span>\n @if (searchWordLimitMaxError()) {\n <small class=\"p-error block\">\n {{ 'mngFilter.search.maxWordsExceededMessage' | translate }}\n </small>\n }\n </div>\n }\n</div>\n@if (activeFilters().length > 0) {\n <div class=\"flex items-center flex-wrap mt-2\">\n @for (filter of activeFilters(); track filter.metadata.descriptor.property) {\n <mng-table-filter-active-tag [model]=\"model()\" [filter]=\"filter\" (edit)=\"onFilterEdit($event)\" (remove)=\"onFilterRemove($event)\" />\n }\n </div>\n}\n<p-popover #op showCloseIcon=\"true\" (onHide)=\"onOverlayHide()\" appendTo=\"body\">\n <mng-table-filter-form\n [model]=\"model()\"\n [metadata]=\"metadata()\"\n [genericDescriptor]=\"genericFilterDescriptor()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [propertySearch]=\"genericFilterDescriptor()?.propertySearch\"\n [overlay]=\"op\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n (apply)=\"onFilterFormApply($event)\" />\n</p-popover>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}\n"], dependencies: [{ kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: TableFilterFormComponent, selector: "mng-table-filter-form", inputs: ["title", "metadata", "genericDescriptor", "model", "filter", "overlay", "disabledProperties", "enableCaseSensitive", "propertySearch"], outputs: ["apply"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TableFilterActiveTagComponent, selector: "mng-table-filter-active-tag", inputs: ["model", "filter"], outputs: ["edit", "remove"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "disabled", "style", "styleClass", "inputId", "tabindex", "size", "iconPos", "autofocus", "allowEmpty"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1583
|
+
}
|
|
1584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableFilterOverlayWithTagComponent, decorators: [{
|
|
1585
|
+
type: Component,
|
|
1586
|
+
args: [{ selector: 'mng-table-filter-overlay-with-tag', imports: [
|
|
1587
|
+
TranslatePipe,
|
|
1588
|
+
TagModule,
|
|
1589
|
+
TableFilterFormComponent,
|
|
1590
|
+
Button,
|
|
1591
|
+
TableFilterActiveTagComponent,
|
|
1592
|
+
NgTemplateOutlet,
|
|
1593
|
+
InputText,
|
|
1594
|
+
NgClass,
|
|
1595
|
+
ToggleButton,
|
|
1596
|
+
FormsModule,
|
|
1597
|
+
IconField,
|
|
1598
|
+
InputIcon,
|
|
1599
|
+
Popover
|
|
1600
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex items-center grow\">\n @if (titleTemplate()) {\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n }\n @if (showFilterButton()) {\n <p-button\n icon=\"pi pi-filter\"\n rounded=\"true\"\n [severity]=\"activeFilters().length > 0 ? 'primary' : 'secondary'\"\n size=\"small\"\n (click)=\"onFilterAdd($event)\"\n [styleClass]=\"'my-1 mr-2' + (titleTemplate() ? ' ml-3' : '')\">\n </p-button>\n }\n @if (enableSearch()) {\n <div class=\"col-span-4\" [ngClass]=\"{'ml-3': !showFilterButton() && titleTemplate()}\">\n <span class=\"p-input-icon-left w-full\">\n <p-iconfield>\n <p-inputicon class=\"pi pi-search\" />\n <input\n [ngModel]=\"searchValue()\"\n (ngModelChange)=\"onSearchChange($event)\"\n name=\"globalSearch\"\n type=\"text\"\n pInputText\n class=\"search-input w-full\"\n [ngClass]=\"{'ng-invalid': searchWordLimitMaxError()}\"\n [attr.placeholder]=\"'mngFilter.search.input' | translate\"\n [placeholder]=\"'mngFilter.search.input' | translate\" />\n </p-iconfield>\n @if (enableCaseSensitive()) {\n <span class=\"toggle-button-input\">\n <p-toggleButton\n styleClass=\"ml-1 p-1 p-button-sm\"\n [ngModel]=\"searchCaseSensitive()\"\n (ngModelChange)=\"onSearchCaseSensitiveChange($event)\"\n onLabel=\"Aa\"\n offLabel=\"Aa\" />\n </span>\n }\n </span>\n @if (searchWordLimitMaxError()) {\n <small class=\"p-error block\">\n {{ 'mngFilter.search.maxWordsExceededMessage' | translate }}\n </small>\n }\n </div>\n }\n</div>\n@if (activeFilters().length > 0) {\n <div class=\"flex items-center flex-wrap mt-2\">\n @for (filter of activeFilters(); track filter.metadata.descriptor.property) {\n <mng-table-filter-active-tag [model]=\"model()\" [filter]=\"filter\" (edit)=\"onFilterEdit($event)\" (remove)=\"onFilterRemove($event)\" />\n }\n </div>\n}\n<p-popover #op showCloseIcon=\"true\" (onHide)=\"onOverlayHide()\" appendTo=\"body\">\n <mng-table-filter-form\n [model]=\"model()\"\n [metadata]=\"metadata()\"\n [genericDescriptor]=\"genericFilterDescriptor()\"\n [filter]=\"filterEdit()\"\n [disabledProperties]=\"activeFilterProperties()\"\n [propertySearch]=\"genericFilterDescriptor()?.propertySearch\"\n [overlay]=\"op\"\n [enableCaseSensitive]=\"enableCaseSensitive()\"\n (apply)=\"onFilterFormApply($event)\" />\n</p-popover>\n", styles: [".toggle-button-input{position:absolute;right:.35rem;top:50%;transform:translateY(-50%)}\n"] }]
|
|
1601
|
+
}], ctorParameters: () => [] });
|
|
1602
|
+
|
|
1603
|
+
var filterOverlayWithTag_component = /*#__PURE__*/Object.freeze({
|
|
1604
|
+
__proto__: null,
|
|
1605
|
+
TableFilterOverlayWithTagComponent: TableFilterOverlayWithTagComponent
|
|
1606
|
+
});
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* Generates and displays a notification for a table-related error with localized error messages and details.
|
|
1610
|
+
*
|
|
1611
|
+
* @param {TranslateService} translate - The service used to handle localization and translations.
|
|
1612
|
+
* @param {MessageService} messageService - The service used to manage and display messages.
|
|
1613
|
+
* @param {TableDescriptorInst<any>} table - The table descriptor containing table-specific information and model data.
|
|
1614
|
+
* @param {Error} error - The error object providing details about the error that occurred.
|
|
1615
|
+
* @return {Message | null} The generated message object for the error notification or null if no notification was created.
|
|
1616
|
+
*/
|
|
1617
|
+
function tableNotificationError(translate, messageService, table, error) {
|
|
1618
|
+
const params = {
|
|
1619
|
+
errorMessage: getI18nForError(translate, error) ?? error.message,
|
|
1620
|
+
...getI18nErrorParams(error)
|
|
1621
|
+
};
|
|
1622
|
+
const tableErrorTitle = getI18nForModel(translate, table.model, 'table.error.title', { fallbackKey: 'general.error', params }) ?? undefined;
|
|
1623
|
+
const tableErrorMessage = getI18nForModel(translate, table.model, 'table.error.message', { fallbackKey: 'general.errorMessage', params }) ?? undefined;
|
|
1624
|
+
return toastMessage(tableErrorMessage ?? error.message, 'error', { messageService: messageService, title: tableErrorTitle, icon: 'pi-exclamation-triangle' });
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
class LocaleDefaultRowClassPipe {
|
|
1628
|
+
constructor(injector) {
|
|
1629
|
+
this.injector = injector;
|
|
1630
|
+
}
|
|
1631
|
+
transform(value, descriptor, item) {
|
|
1632
|
+
if (descriptor?.isLocalized) {
|
|
1633
|
+
if (item[descriptor.localizationLocaleProperty] === this.injector.get(CommonsService).getDefaultLocale()) {
|
|
1634
|
+
return value + ' mng-table-row-localization-default-locale';
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
return value ?? '';
|
|
1638
|
+
}
|
|
1639
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: LocaleDefaultRowClassPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1640
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: LocaleDefaultRowClassPipe, isStandalone: true, name: "mngLocaleDefaultRowClass" }); }
|
|
1641
|
+
}
|
|
1642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: LocaleDefaultRowClassPipe, decorators: [{
|
|
1643
|
+
type: Pipe,
|
|
1644
|
+
args: [{
|
|
1645
|
+
name: 'mngLocaleDefaultRowClass',
|
|
1646
|
+
pure: true
|
|
1647
|
+
}]
|
|
1648
|
+
}], ctorParameters: () => [{ type: i0.Injector }] });
|
|
1649
|
+
|
|
1650
|
+
class TableColumnFilterClassPipe {
|
|
1651
|
+
transform(value, filter, isEnabled) {
|
|
1652
|
+
const strValue = typeof value === 'string' ? value : '';
|
|
1653
|
+
if (isEnabled && filter?.filterType !== undefined) {
|
|
1654
|
+
return `${strValue} mng-column-filter-${FilterTypeEnum[filter.filterType].toLowerCase()}`;
|
|
1655
|
+
}
|
|
1656
|
+
else {
|
|
1657
|
+
return strValue;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableColumnFilterClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1661
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.7", ngImport: i0, type: TableColumnFilterClassPipe, isStandalone: true, name: "mngTableColumnFilterClass" }); }
|
|
1662
|
+
}
|
|
1663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableColumnFilterClassPipe, decorators: [{
|
|
1664
|
+
type: Pipe,
|
|
1665
|
+
args: [{
|
|
1666
|
+
pure: true,
|
|
1667
|
+
name: 'mngTableColumnFilterClass'
|
|
1668
|
+
}]
|
|
1669
|
+
}] });
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* generates table layout preferences key used when saving preferences to localstorage
|
|
1673
|
+
* @param typeName string, required
|
|
1674
|
+
* @param url string, required
|
|
1675
|
+
* @param trackProperty string, not required
|
|
1676
|
+
*/
|
|
1677
|
+
function generateTableLayoutPrefsKey(typeName, url, trackProperty) {
|
|
1678
|
+
return `commonsTableLayoutPrefs~~${typeName}~~${trackProperty ?? url.split('?')[0].split('#')[0]}`;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
class TablePreferencesService {
|
|
1682
|
+
constructor() {
|
|
1683
|
+
this.#router = inject(Router);
|
|
1684
|
+
this.#storageService = inject(CommonsStorageService);
|
|
1685
|
+
this.#metadata = inject(TableMetadataService);
|
|
1686
|
+
this.localstorageKey = computed(() => {
|
|
1687
|
+
const descriptor = this.#metadata.descriptor();
|
|
1688
|
+
return descriptor.model.i18nBaseKey ? generateTableLayoutPrefsKey(descriptor.model.i18nBaseKey, this.#router.url, descriptor.identifier) : null;
|
|
1689
|
+
});
|
|
1690
|
+
this.#layoutPrefsSaveCnt = signal(0);
|
|
1691
|
+
this.layoutPreferences = computed(() => {
|
|
1692
|
+
const lsKey = this.localstorageKey();
|
|
1693
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1694
|
+
const cnt = this.#layoutPrefsSaveCnt(); // needed to force updates on user changes
|
|
1695
|
+
const layoutPrefs = lsKey ? this.#storageService.getItem(TableMetadataService.cmpTypeName, lsKey) : undefined;
|
|
1696
|
+
return layoutPrefs ?? { columnWidths: {} };
|
|
1697
|
+
});
|
|
1698
|
+
// columns
|
|
1699
|
+
this.columnsWithPrefs = computed(() => this.#computeColumnsWithLayout());
|
|
1700
|
+
}
|
|
1701
|
+
#router;
|
|
1702
|
+
#storageService;
|
|
1703
|
+
#metadata;
|
|
1704
|
+
#layoutPrefsSaveCnt;
|
|
1705
|
+
/**
|
|
1706
|
+
* Method is called on column resize
|
|
1707
|
+
* @param element event's element
|
|
1708
|
+
*/
|
|
1709
|
+
onColumnResize({ element }) {
|
|
1710
|
+
const fieldId = element.id;
|
|
1711
|
+
const width = element.offsetWidth;
|
|
1712
|
+
const layoutPrefs = this.layoutPreferences();
|
|
1713
|
+
const col = this.columnsWithPrefs().find(el => el.descriptor.property === fieldId);
|
|
1714
|
+
if (col)
|
|
1715
|
+
col.width = width;
|
|
1716
|
+
if (!layoutPrefs.columnWidths)
|
|
1717
|
+
layoutPrefs.columnWidths = {};
|
|
1718
|
+
layoutPrefs.columnWidths[fieldId] = width;
|
|
1719
|
+
this.#saveLayoutPreferences(layoutPrefs);
|
|
1720
|
+
}
|
|
1721
|
+
onColumnToggle(event) {
|
|
1722
|
+
const layoutPrefs = this.layoutPreferences();
|
|
1723
|
+
const selectedColumns = event.value.map(v => v.descriptor.property);
|
|
1724
|
+
layoutPrefs.columnHidden = this.columnsWithPrefs()
|
|
1725
|
+
.filter(c => selectedColumns.indexOf(c.descriptor.property) < 0)
|
|
1726
|
+
.map(c => c.descriptor.property);
|
|
1727
|
+
this.#saveLayoutPreferences(layoutPrefs, true);
|
|
1728
|
+
}
|
|
1729
|
+
onColumnToggleAll() {
|
|
1730
|
+
const layoutPrefs = this.layoutPreferences();
|
|
1731
|
+
const columns = [...this.columnsWithPrefs()];
|
|
1732
|
+
const isVisible = !this.columnsWithPrefs().some(c => c.isVisible);
|
|
1733
|
+
for (const col of columns) {
|
|
1734
|
+
if (isVisible !== col.isVisible) {
|
|
1735
|
+
col.isVisible = isVisible;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
layoutPrefs.columnHidden = columns.filter(c => !c.isVisible).map(c => c.descriptor.property);
|
|
1739
|
+
this.#saveLayoutPreferences(layoutPrefs, true);
|
|
1740
|
+
}
|
|
1741
|
+
onColumnReorder(event) {
|
|
1742
|
+
if (event.dropIndex !== undefined && event.dropIndex >= 0 && event.dragIndex !== undefined && event.dragIndex >= 0 && event.dropIndex !== event.dragIndex) {
|
|
1743
|
+
const eventDropIndex = event.dropIndex;
|
|
1744
|
+
const eventDragIndex = event.dragIndex;
|
|
1745
|
+
const prevVisibleColumns = this.columnsWithPrefs().filter(c => c.isVisible);
|
|
1746
|
+
const colAtDrop = prevVisibleColumns[eventDropIndex];
|
|
1747
|
+
const colAtDrag = prevVisibleColumns[eventDragIndex];
|
|
1748
|
+
const colAtDropIndex = this.columnsWithPrefs().findIndex(el => el.id === colAtDrop.id);
|
|
1749
|
+
const colAtDragIndex = this.columnsWithPrefs().findIndex(el => el.id === colAtDrag.id);
|
|
1750
|
+
if (colAtDropIndex > -1 && colAtDragIndex > -1) {
|
|
1751
|
+
let columns = [...this.columnsWithPrefs()];
|
|
1752
|
+
columns.splice(colAtDragIndex, 1);
|
|
1753
|
+
const dropIndex = columns.findIndex(el => el.id === colAtDrop.id) + (eventDropIndex > eventDragIndex ? 1 : 0);
|
|
1754
|
+
columns = [...columns.slice(0, dropIndex), colAtDrag, ...columns.slice(dropIndex)];
|
|
1755
|
+
const layoutPrefs = this.layoutPreferences();
|
|
1756
|
+
layoutPrefs.columnOrder = columns.map(el => el.descriptor.property);
|
|
1757
|
+
this.#saveLayoutPreferences(layoutPrefs);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Reset column order and column visibility to default settings
|
|
1763
|
+
*/
|
|
1764
|
+
clearLayoutPreferences() {
|
|
1765
|
+
const key = this.localstorageKey();
|
|
1766
|
+
if (key) {
|
|
1767
|
+
this.#storageService.removeItem(TableMetadataService.cmpTypeName, key);
|
|
1768
|
+
this.#layoutPrefsSaveCnt.update(v => v + 1);
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
#saveLayoutPreferences(layoutPrefs, forceUpdate = false) {
|
|
1772
|
+
const key = this.localstorageKey();
|
|
1773
|
+
if (key) {
|
|
1774
|
+
this.#storageService.setItem(TableMetadataService.cmpTypeName, key, layoutPrefs);
|
|
1775
|
+
if (forceUpdate) {
|
|
1776
|
+
this.#layoutPrefsSaveCnt.update(v => v + 1);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
#computeColumnsWithLayout() {
|
|
1781
|
+
const descriptor = this.#metadata.descriptor();
|
|
1782
|
+
const layoutPrefs = this.layoutPreferences();
|
|
1783
|
+
// initialize columns with additional properties
|
|
1784
|
+
const timestamp = new Date().getTime();
|
|
1785
|
+
const columns = descriptor.columns.map(col => ({
|
|
1786
|
+
id: `${col.property}-${timestamp}`,
|
|
1787
|
+
descriptor: col,
|
|
1788
|
+
filter: this.#metadata
|
|
1789
|
+
.filters()
|
|
1790
|
+
.find(f => f.descriptor.showOnColumn === col.property &&
|
|
1791
|
+
((f.descriptor.displayType == null && this.#metadata.defaultFilterDisplayType === FilterDisplayTypeEnum.Column) ||
|
|
1792
|
+
f.descriptor.displayType === FilterDisplayTypeEnum.Column)),
|
|
1793
|
+
sort: descriptor.sorts.find(f => f.showOnColumn === col.property),
|
|
1794
|
+
disabled: !col.isToggleable,
|
|
1795
|
+
isVisible: layoutPrefs.columnHidden ? !layoutPrefs.columnHidden.includes(col.property) : col.isVisible,
|
|
1796
|
+
width: layoutPrefs.columnWidths?.[col.property]
|
|
1797
|
+
}));
|
|
1798
|
+
if (layoutPrefs.columnOrder) {
|
|
1799
|
+
for (let i = 0; i < layoutPrefs.columnOrder.length; i++) {
|
|
1800
|
+
const colName = layoutPrefs.columnOrder[i];
|
|
1801
|
+
const colWithPrefs = columns.find(el => el.descriptor.property === colName);
|
|
1802
|
+
if (colWithPrefs) {
|
|
1803
|
+
colWithPrefs.orderIdx = i;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
return columns.sort((a, b) => (a.orderIdx !== undefined && b.orderIdx !== undefined ? a.orderIdx - b.orderIdx : 0));
|
|
1808
|
+
}
|
|
1809
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TablePreferencesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1810
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TablePreferencesService }); }
|
|
1811
|
+
}
|
|
1812
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TablePreferencesService, decorators: [{
|
|
1813
|
+
type: Injectable
|
|
1814
|
+
}] });
|
|
1815
|
+
|
|
1816
|
+
class TableComponent {
|
|
1817
|
+
// subscriptions and refs
|
|
1818
|
+
#previousDataProvider;
|
|
1819
|
+
#dataProviderEagerFirstLoad;
|
|
1820
|
+
#dataProviderReloadSubscription;
|
|
1821
|
+
#routeQueryParamsSubscription;
|
|
1822
|
+
#routerEventsSubscription;
|
|
1823
|
+
#afterNextRenderRef;
|
|
1824
|
+
constructor() {
|
|
1825
|
+
this.filterKeyPrepend = 'f_';
|
|
1826
|
+
this.logger = inject(LoggerService).create(TableMetadataService.cmpTypeName);
|
|
1827
|
+
this.router = inject(Router);
|
|
1828
|
+
this.route = inject(ActivatedRoute);
|
|
1829
|
+
this.translate = inject(TranslateService);
|
|
1830
|
+
this.messageService = inject(MessageService);
|
|
1831
|
+
this.metadata = inject(TableMetadataService);
|
|
1832
|
+
this.prefs = inject(TablePreferencesService);
|
|
1833
|
+
this.data = inject((TableDataService));
|
|
1834
|
+
// descriptor
|
|
1835
|
+
this.descriptorInput = input.required({ alias: 'descriptor' });
|
|
1836
|
+
// data source inputs
|
|
1837
|
+
this.items = input();
|
|
1838
|
+
this.result = input();
|
|
1839
|
+
this.loadingInput = input(undefined, { alias: 'loading', transform: booleanOrUndefinedAttribute });
|
|
1840
|
+
this.dataProvider = input();
|
|
1841
|
+
// extra features input
|
|
1842
|
+
this.useQueryParams = input(false, { transform: booleanAttribute });
|
|
1843
|
+
this.cellClickEnabled = input(true, { transform: booleanAttribute });
|
|
1844
|
+
this.selectionMode = input('multiple');
|
|
1845
|
+
this.selectionEnabled = input(false, { transform: booleanAttribute });
|
|
1846
|
+
this.rowReorderEnabledInput = input(true, { alias: 'rowReorderEnabled', transform: booleanAttribute });
|
|
1847
|
+
this.rowReorderEnabled = computed(() => this.rowReorderEnabledInput() && this.metadata.descriptor().rowReorderable);
|
|
1848
|
+
this.expandedRowKeys = computed(() => {
|
|
1849
|
+
const descriptor = this.metadata.descriptor();
|
|
1850
|
+
if (typeof descriptor.isRowExpanded === 'string') {
|
|
1851
|
+
return this.data.data()?.reduce((acc, item) => {
|
|
1852
|
+
acc[item[descriptor.trackProperty]] = !!item[descriptor.isRowExpanded];
|
|
1853
|
+
return acc;
|
|
1854
|
+
}, {});
|
|
1855
|
+
}
|
|
1856
|
+
else if (typeof descriptor.isRowExpanded === 'function') {
|
|
1857
|
+
return this.data.data()?.reduce((acc, item) => {
|
|
1858
|
+
acc[item[descriptor.trackProperty]] = descriptor.isRowExpanded(item);
|
|
1859
|
+
return acc;
|
|
1860
|
+
}, {});
|
|
1861
|
+
}
|
|
1862
|
+
return {};
|
|
1863
|
+
});
|
|
1864
|
+
// styling
|
|
1865
|
+
this.columnLastMinWidth = input();
|
|
1866
|
+
this.columnsColspan = computed(() => this.visibleColumns().length + (this.hasLastColumn() ? 1 : 0) + (this.selectionEnabled() ? 1 : 0) + (this.rowReorderEnabled() ? 1 : 0));
|
|
1867
|
+
this.hasTitleDisplay = computed(() => this.captionTemplate() || this.captionComponent() || this.metadata.descriptor().title);
|
|
1868
|
+
this.isCaptionVisible = computed(() => this.hasTitleDisplay() || this.overlayWithTagFilters().length > 0 || this.metadata.descriptor().search);
|
|
1869
|
+
// component inputs
|
|
1870
|
+
this.captionComponent = input();
|
|
1871
|
+
this.columnCustomLastComponent = input();
|
|
1872
|
+
this.globalFilterFieldsInput = input(undefined, { alias: 'globalFilterFields' });
|
|
1873
|
+
// cell click
|
|
1874
|
+
this.cellClickSubject = new Subject();
|
|
1875
|
+
this.isCellClickObserved = signal(this.cellClickSubject.observed);
|
|
1876
|
+
this.isCellClickEnabled = computed(() => this.cellClickEnabled() && this.isCellClickObserved());
|
|
1877
|
+
// event outputs
|
|
1878
|
+
this.tableLoad = output();
|
|
1879
|
+
this.cellClick = outputFromObservable(this.cellClickSubject);
|
|
1880
|
+
this.selectionChange = output();
|
|
1881
|
+
this.captionComponentInstance = output();
|
|
1882
|
+
this.columnCustomLastComponentInstance = output();
|
|
1883
|
+
this.rowReorder = output();
|
|
1884
|
+
// content and view queries
|
|
1885
|
+
this.templates = contentChildren(TemplateDirective);
|
|
1886
|
+
this.components = viewChildren((ComponentDirective));
|
|
1887
|
+
this.primeTable = viewChild(Table);
|
|
1888
|
+
// templates
|
|
1889
|
+
this.captionTemplate = computed(() => findTemplateByName([...this.templates()], 'caption'));
|
|
1890
|
+
this.columnCustomLastTemplate = computed(() => findTemplateByName([...this.templates()], 'columnCustomLast'));
|
|
1891
|
+
this.footerTemplate = computed(() => findTemplateByName([...this.templates()], 'footer'));
|
|
1892
|
+
this.rowExpandTemplate = computed(() => findTemplateByName([...this.templates()], 'rowExpandContent'));
|
|
1893
|
+
// data provider and items
|
|
1894
|
+
this.isLazy = computed(() => this.dataProvider()?.isLazy === true);
|
|
1895
|
+
this.isPagination = computed(() => this.data.paginationMode() === TablePaginationModeEnum.Pagination);
|
|
1896
|
+
this.useQueryParamsInitialized = signal(false);
|
|
1897
|
+
// visual
|
|
1898
|
+
this.className = computed(() => {
|
|
1899
|
+
let className = this.metadata.descriptor().className ?? '';
|
|
1900
|
+
switch (this.metadata.descriptor().size) {
|
|
1901
|
+
case TableSizeEnum.Small:
|
|
1902
|
+
className += ' p-datatable-sm';
|
|
1903
|
+
break;
|
|
1904
|
+
case TableSizeEnum.Large:
|
|
1905
|
+
className += ' p-datatable-lg';
|
|
1906
|
+
break;
|
|
1907
|
+
}
|
|
1908
|
+
if (this.metadata.descriptor().hasGridlines) {
|
|
1909
|
+
className += ' p-datatable-gridlines';
|
|
1910
|
+
}
|
|
1911
|
+
return className;
|
|
1912
|
+
});
|
|
1913
|
+
// columns
|
|
1914
|
+
this.visibleColumns = computed(() => this.prefs.columnsWithPrefs().filter(col => col.isVisible));
|
|
1915
|
+
this.areColumnsReorderable = computed(() => this.prefs.columnsWithPrefs().some(col => col.descriptor.isReorderable));
|
|
1916
|
+
this.areColumnsToggleable = computed(() => this.prefs.columnsWithPrefs().some(col => col.descriptor.isToggleable));
|
|
1917
|
+
// filter, sort
|
|
1918
|
+
this.hasColumnFilters = computed(() => (this.metadata.defaultFilterDisplayType === FilterDisplayTypeEnum.OverlayWithTag &&
|
|
1919
|
+
this.metadata.filterDescriptors().some(d => d.displayType === FilterDisplayTypeEnum.Column)) ||
|
|
1920
|
+
(this.metadata.defaultFilterDisplayType === FilterDisplayTypeEnum.Column && this.metadata.filterDescriptors().some(d => d.displayType == null)));
|
|
1921
|
+
this.overlayWithTagFilters = computed(() => {
|
|
1922
|
+
// statically defined filters AND generic filters
|
|
1923
|
+
const filters = this.metadata
|
|
1924
|
+
.filters()
|
|
1925
|
+
.filter(d => (d.descriptor.displayType == null && this.metadata.defaultFilterDisplayType === FilterDisplayTypeEnum.OverlayWithTag) ||
|
|
1926
|
+
d.descriptor.displayType === FilterDisplayTypeEnum.OverlayWithTag);
|
|
1927
|
+
return filters.concat(this.metadata.genericFilters());
|
|
1928
|
+
});
|
|
1929
|
+
this.hasCustomLastColumn = computed(() => this.columnCustomLastComponent() || this.columnCustomLastTemplate());
|
|
1930
|
+
this.hasLastColumn = computed(() => this.hasCustomLastColumn() || this.areColumnsToggleable() || this.areColumnsReorderable());
|
|
1931
|
+
// other
|
|
1932
|
+
this.navigationOutOfTableInProgress = false;
|
|
1933
|
+
this.navigationInTableInProgress = false;
|
|
1934
|
+
this.#dataProviderEagerFirstLoad = effectWithDeps([this.dataProvider], ([dataProvider]) => {
|
|
1935
|
+
if (dataProvider?.isLazy === false) {
|
|
1936
|
+
this.loadTableWithDataProvider(this.metadata.defaultParams());
|
|
1937
|
+
}
|
|
1938
|
+
else if (this.#previousDataProvider && dataProvider) {
|
|
1939
|
+
this.reload();
|
|
1940
|
+
}
|
|
1941
|
+
this.#previousDataProvider = dataProvider;
|
|
1942
|
+
});
|
|
1943
|
+
this.#dataProviderReloadSubscription = toObservable(this.dataProvider)
|
|
1944
|
+
.pipe(switchMap(dp => dp?.tableReload$ ?? of({})), takeUntilDestroyed())
|
|
1945
|
+
.subscribe({
|
|
1946
|
+
next: e => {
|
|
1947
|
+
this.reload(e);
|
|
1948
|
+
}
|
|
1949
|
+
});
|
|
1950
|
+
this.#routeQueryParamsSubscription = toObservable(this.useQueryParams)
|
|
1951
|
+
.pipe(switchMap(useQp => (useQp ? this.route.queryParams : NEVER)), takeUntilDestroyed())
|
|
1952
|
+
.subscribe(qp => {
|
|
1953
|
+
this.loadTableFromRouteUpdate(qp);
|
|
1954
|
+
});
|
|
1955
|
+
this.#routerEventsSubscription = toObservable(this.useQueryParams)
|
|
1956
|
+
.pipe(switchMap(useQp => (useQp ? this.router.events : NEVER)), filter(e => (e instanceof NavigationStart && e.url.split('?')[0].split('#')[0] !== this.router.url.split('?')[0].split('#')[0]) ||
|
|
1957
|
+
e instanceof NavigationEnd ||
|
|
1958
|
+
e instanceof NavigationCancel ||
|
|
1959
|
+
e instanceof NavigationError), takeUntilDestroyed())
|
|
1960
|
+
.subscribe(e => {
|
|
1961
|
+
this.navigationOutOfTableInProgress = e instanceof NavigationStart;
|
|
1962
|
+
});
|
|
1963
|
+
this.#afterNextRenderRef = afterNextRender(() => {
|
|
1964
|
+
this.isCellClickObserved.set(this.cellClickSubject.observed);
|
|
1965
|
+
});
|
|
1966
|
+
this.metadata.setSignalSources(this.descriptorInput, this.globalFilterFieldsInput);
|
|
1967
|
+
this.data.setDataSources(this.items, this.result, this.dataProvider, this.loadingInput);
|
|
1968
|
+
}
|
|
1969
|
+
reload(emitEvent) {
|
|
1970
|
+
const params = emitEvent?.params ? emitEvent?.params : emitEvent?.resetParams ? undefined : this.lastParamsWithDefaults;
|
|
1971
|
+
const reloadParams = mergeDataListParamsWithDefaults(params ?? {}, this.metadata.defaultParams());
|
|
1972
|
+
this.loadTableWithDataProvider(reloadParams, emitEvent?.emitEvent ?? false);
|
|
1973
|
+
}
|
|
1974
|
+
onTableLazyLoad(event) {
|
|
1975
|
+
this.lastLazyLoadEvent = event;
|
|
1976
|
+
const params = fromTableLoadToDataListParams(event);
|
|
1977
|
+
if (this.useQueryParams()) {
|
|
1978
|
+
if (!this.navigationOutOfTableInProgress && !this.navigationInTableInProgress) {
|
|
1979
|
+
// this check is necessary: from some reason, primeNG commits one last lazy load event whenever any angular router navigation occurs
|
|
1980
|
+
this.navigationInTableInProgress = true;
|
|
1981
|
+
const newParams = dataListParamsToUrlQuery(params, this.metadata.defaultParams(), { prependFilterName: this.filterKeyPrepend, skipPresetDefaultsLimit: true });
|
|
1982
|
+
const newParamsWithParamsToRemove = { ...newParams };
|
|
1983
|
+
const currentQp = this.route.snapshot.queryParams;
|
|
1984
|
+
if (currentQp) {
|
|
1985
|
+
Object.keys(currentQp)
|
|
1986
|
+
.filter(k => (k.startsWith(this.filterKeyPrepend) || ['offset', 'limit', 'sort', 'q'].indexOf(k) >= 0) && newParams[k] === undefined)
|
|
1987
|
+
.forEach(k => (newParamsWithParamsToRemove[k] = null));
|
|
1988
|
+
}
|
|
1989
|
+
this.router
|
|
1990
|
+
.navigate([], {
|
|
1991
|
+
relativeTo: this.route,
|
|
1992
|
+
replaceUrl: true,
|
|
1993
|
+
queryParams: newParamsWithParamsToRemove,
|
|
1994
|
+
queryParamsHandling: 'merge'
|
|
1995
|
+
})
|
|
1996
|
+
.then(() => {
|
|
1997
|
+
this.navigationInTableInProgress = false;
|
|
1998
|
+
});
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
else {
|
|
2002
|
+
const paramsWithDefaults = mergeDataListParamsWithDefaults(params, this.metadata.defaultParams());
|
|
2003
|
+
this.data.setParams(paramsWithDefaults);
|
|
2004
|
+
this.loadTableWithDataProvider(paramsWithDefaults);
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
onTableFilter(event) {
|
|
2008
|
+
if (this.useQueryParams()) {
|
|
2009
|
+
return;
|
|
2010
|
+
}
|
|
2011
|
+
const params = fromTableLoadToDataListParams({ filters: event.filters });
|
|
2012
|
+
const paramsWithDefaults = mergeDataListParamsWithDefaults(params, this.metadata.defaultParams());
|
|
2013
|
+
// if table doesn't use lazy loading, filter params need to be set here
|
|
2014
|
+
// because the onTableLazyLoad event is not emitted
|
|
2015
|
+
if (!this.isLazy()) {
|
|
2016
|
+
this.data.setParams(paramsWithDefaults);
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
onCellClick(event, col, item, idx) {
|
|
2020
|
+
if (!this.isCellClickEnabled()) {
|
|
2021
|
+
return;
|
|
2022
|
+
}
|
|
2023
|
+
const tableEvent = {
|
|
2024
|
+
column: col,
|
|
2025
|
+
rowItem: item,
|
|
2026
|
+
rowIndex: idx,
|
|
2027
|
+
event: event
|
|
2028
|
+
};
|
|
2029
|
+
this.cellClickSubject.next(tableEvent);
|
|
2030
|
+
}
|
|
2031
|
+
onSelectionChange(event) {
|
|
2032
|
+
this.selectionChange.emit(event);
|
|
2033
|
+
}
|
|
2034
|
+
onRowReorder(event) {
|
|
2035
|
+
this.rowReorder.emit(event);
|
|
2036
|
+
}
|
|
2037
|
+
loadTableWithDataProvider(paramsWithDefaults, emitEvent = true) {
|
|
2038
|
+
const isFetched = this.data.fetchWithDataProvider(paramsWithDefaults, error => {
|
|
2039
|
+
tableNotificationError(this.translate, this.messageService, this.metadata.descriptor(), error);
|
|
2040
|
+
const commonsError = fromSubscribeError(error, 'TableComponentError', {
|
|
2041
|
+
params: paramsWithDefaults
|
|
2042
|
+
});
|
|
2043
|
+
this.logger.log(commonsError, getErrorLogLevel(commonsError));
|
|
2044
|
+
});
|
|
2045
|
+
if (isFetched) {
|
|
2046
|
+
this.lastParamsWithDefaults = paramsWithDefaults;
|
|
2047
|
+
if (emitEvent) {
|
|
2048
|
+
const tableEvent = {
|
|
2049
|
+
originalEvent: this.lastLazyLoadEvent,
|
|
2050
|
+
params: paramsWithDefaults
|
|
2051
|
+
};
|
|
2052
|
+
this.tableLoad.emit(tableEvent);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
loadTableFromRouteUpdate(urlParams) {
|
|
2057
|
+
const paramsWithDefaults = mergeDataListParamsWithDefaults(fromUrlQueryToDataListParams(urlParams, {
|
|
2058
|
+
prependFilterName: this.filterKeyPrepend,
|
|
2059
|
+
searchAsGlobal: true
|
|
2060
|
+
}), this.metadata.defaultParams());
|
|
2061
|
+
this.data.setParams(paramsWithDefaults, true);
|
|
2062
|
+
this.loadTableWithDataProvider(paramsWithDefaults);
|
|
2063
|
+
}
|
|
2064
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2065
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.7", type: TableComponent, isStandalone: true, selector: "mng-table", inputs: { descriptorInput: { classPropertyName: "descriptorInput", publicName: "descriptor", isSignal: true, isRequired: true, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, result: { classPropertyName: "result", publicName: "result", isSignal: true, isRequired: false, transformFunction: null }, loadingInput: { classPropertyName: "loadingInput", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: false, transformFunction: null }, useQueryParams: { classPropertyName: "useQueryParams", publicName: "useQueryParams", isSignal: true, isRequired: false, transformFunction: null }, cellClickEnabled: { classPropertyName: "cellClickEnabled", publicName: "cellClickEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectionEnabled: { classPropertyName: "selectionEnabled", publicName: "selectionEnabled", isSignal: true, isRequired: false, transformFunction: null }, rowReorderEnabledInput: { classPropertyName: "rowReorderEnabledInput", publicName: "rowReorderEnabled", isSignal: true, isRequired: false, transformFunction: null }, columnLastMinWidth: { classPropertyName: "columnLastMinWidth", publicName: "columnLastMinWidth", isSignal: true, isRequired: false, transformFunction: null }, captionComponent: { classPropertyName: "captionComponent", publicName: "captionComponent", isSignal: true, isRequired: false, transformFunction: null }, columnCustomLastComponent: { classPropertyName: "columnCustomLastComponent", publicName: "columnCustomLastComponent", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFieldsInput: { classPropertyName: "globalFilterFieldsInput", publicName: "globalFilterFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tableLoad: "tableLoad", cellClick: "cellClick", selectionChange: "selectionChange", captionComponentInstance: "captionComponentInstance", columnCustomLastComponentInstance: "columnCustomLastComponentInstance", rowReorder: "rowReorder" }, host: { properties: { "class.mng-table-no-header": "!isCaptionVisible()" } }, providers: [TableMetadataService, TableDataService, TablePreferencesService], queries: [{ propertyName: "templates", predicate: TemplateDirective, isSignal: true }], viewQueries: [{ propertyName: "components", predicate: (ComponentDirective), descendants: true, isSignal: true }, { propertyName: "primeTable", first: true, predicate: Table, descendants: true, isSignal: true }], ngImport: i0, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (data.isAllPaginationMetaInitialized()) {\n <p-table\n [value]=\"data.data()\"\n [dataKey]=\"metadata.descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"data.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"data.rows()\"\n [first]=\"data.offset()\"\n [totalRecords]=\"data.count()\"\n [rowsPerPageOptions]=\"metadata.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"data.sortMeta()\"\n [filters]=\"data.filterMeta()\"\n [globalFilterFields]=\"metadata.searchFields()\"\n sortMode=\"multiple\"\n [selection]=\"[]\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"metadata.descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"metadata.descriptor().hasResizableColumns\"\n [columnResizeMode]=\"metadata.descriptor().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n [expandedRowKeys]=\"expandedRowKeys()\"\n (onColResize)=\"prefs.onColumnResize($event)\"\n (onColReorder)=\"prefs.onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onFilter)=\"onTableFilter($event)\"\n (onRowReorder)=\"onRowReorder($event)\">\n <ng-template #caption>\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (overlayWithTagFilters().length > 0 || metadata.descriptor().search) {\n @defer (on idle) {\n <mng-table-filter-overlay-with-tag\n [title]=\"metadata.descriptor().title\"\n [metadata]=\"overlayWithTagFilters()\"\n [genericFilterDescriptor]=\"metadata.genericFilterDescriptor()\"\n [model]=\"metadata.descriptor().model\"\n [enableSearch]=\"metadata.descriptor().search\"\n [search]=\"data.searchMeta()\"\n [searchLimitWordMax]=\"metadata.descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTemplate=\"title\">\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n </ng-template>\n }\n </mng-table-filter-overlay-with-tag>\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n }\n <ng-template #captionTemplateOrComponentOrTitle>\n @if (captionTemplate()) {\n <ng-container *ngTemplateOutlet=\"captionTemplate()\"></ng-container>\n } @else if (captionComponent()) {\n <ng-container [mngComponent]=\"captionComponent()\" (instanceCreated)=\"captionComponentInstance.emit($event)\"></ng-container>\n } @else if (metadata.descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ metadata.descriptor().title! | translate }}</h5>\n }\n </ng-template>\n </div>\n }\n </ng-template>\n <ng-template #header>\n @if (!metadata.descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"metadata.descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox />\n </th>\n } @else {\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\" pFrozenColumn [frozen]=\"true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <ng-template #sortableColumnTHTemplate>\n <div class=\"flex justify-between items-center\">\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n <p-sortIcon [field]=\"col.sort?.property\" class=\"flex\"></p-sortIcon>\n </div>\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n </ng-template>\n @if (col.descriptor.isReorderable) {\n <th\n pResizableColumn\n pReorderableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n } @else {\n <th\n pResizableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n }\n }\n @if (hasLastColumn()) {\n <th\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"mng-table-column-custom-last !text-right\">\n @if (areColumnsToggleable()) {\n @defer (on idle) {\n <mng-table-column-toggle [columns]=\"visibleColumns()\" />\n }\n }\n </th>\n }\n </tr>\n }\n @if (hasColumnFilters()) {\n <tr class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n @if (selectionEnabled()) {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"'!px-1 ' + col.filter?.descriptor?.columnClassName | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : (col.filter?.descriptor?.columnWidth ?? col.descriptor.width ?? null)\"\n [style.min-width.px]=\"col.width ? null : (col.filter?.descriptor?.columnMinWidth ?? col.descriptor.minWidth)\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter) {\n @defer (on idle) {\n <mng-table-column-filter [metadata]=\"col.filter\"></mng-table-column-filter>\n }\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th pFrozenColumn alignFrozen=\"right\" class=\"mng-table-column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template #body let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n [pReorderableRow]=\"idx\"\n [ngClass]=\"\n metadata.descriptor().rowClassName | mngClassMap: metadata.descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: metadata.descriptor() : item\n \">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <td>\n @let expandProp = metadata.descriptor().rowExpandableProperty;\n @if (!expandProp || item[expandProp]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n rounded=\"true\"\n text=\"true\"\n class=\"mng-button-sm\"\n [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></button>\n }\n </td>\n }\n @if (rowReorderEnabled()) {\n <td>\n <span class=\"pi pi-bars\" pReorderableRowHandle></span>\n </td>\n }\n @for (col of visibleColumns(); track col.id) {\n <td\n (click)=\"onCellClick($event, col.descriptor, item, idx)\"\n [class]=\"\n col.descriptor.className\n | mngClassMap: col.descriptor.classNameMapFn : item\n | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\n \"\n [class.clickable]=\"isCellClickEnabled()\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"mng-table-column-custom-last justify-end !text-right\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n alignFrozen=\"right\"\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? true\">\n @if (columnCustomLastTemplate()) {\n <ng-container *ngTemplateOutlet=\"columnCustomLastTemplate(); context: {rowItem: item, rowIndex: idx}\"></ng-container>\n } @else if (columnCustomLastComponent()) {\n <div [mngComponent]=\"columnCustomLastComponent()\" (instanceCreated)=\"columnCustomLastComponentInstance.emit($event)\"></div>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #expandedrow let-item>\n @if (metadata.descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"metadata.descriptor().rowExpandableColSpan\">\n @if (metadata.descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"metadata.descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"rowExpandTemplate(); context: {rowItem: item}\"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #loadingicon>\n <div class=\"flex flex-col items-center\">\n @if (metadata.descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + metadata.descriptor().loadingIcon\"></i>\n }\n @if (metadata.descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': metadata.descriptor().loadingIcon}\">\n {{ metadata.descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template #loadingbody>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template #summary>\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: data.data(), totalCount: data.count()}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", styles: ["mng-table .p-datatable .p-datatable-header{border-top:0}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td{cursor:auto}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td.clickable{cursor:pointer}mng-table .p-datatable :is(.p-datatable-thead>tr>th,.p-datatable-tbody>tr>td):hover mng-table-column-value .help-buttons{display:block}mng-table .p-datatable .p-datatable-thead>tr>th.mng-table-column-custom-last{padding:var(--mng-table-column-head-custom-last, .1rem 1rem)}mng-table .p-datatable .p-datatable-tbody>tr>td{position:relative}mng-table .p-datatable .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding-top:.1rem;padding-bottom:.1rem}mng-table .p-datatable .p-datatable-tbody>tr>td.p-datatable-frozen-column{position:sticky;z-index:1;background:transparent}mng-table .p-datatable.p-datatable-lg .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-column-body-custom-last, .15rem 1rem)}mng-table .p-datatable.p-datatable-sm .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-sm-column-body-custom-last, .05rem 1rem)}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-thead>tr>th{overflow:hidden;text-overflow:ellipsis}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-tbody>tr>td{overflow:hidden}mng-table .p-datatable .mng-table-row-localization-default-locale{background:var(--p-surface-100)!important}mng-table .mng-table-header>th:not(:first-child):not(:last-child){border-radius:0!important}mng-table .mng-table-header>th:first-child{border-top-right-radius:0!important;border-bottom-right-radius:0!important}mng-table .mng-table-header>th:last-child{border-radius:0!important}mng-table .mng-table-header .mng-table-columns-multiselect{width:36px}mng-table .mng-table-header .mng-table-columns-multiselect .p-multiselect-label-container{width:0}mng-table.mng-table-no-header p-datatable .p-datatable-header{display:none}mng-table.mng-table-header-compact .p-datatable-header{padding:var(--mng-table-header-compact-padding, 0 0 .5rem 0)}\n"], dependencies: [{ kind: "directive", type: ComponentDirective, selector: "[mngComponent]", inputs: ["mngComponent", "injectionToken", "inputs", "attachToHost", "parentInjector"], outputs: ["instanceCreated"] }, { kind: "pipe", type: I18nPropertyPipe, name: "mngI18nProperty" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TableColumnValueComponent, selector: "mng-table-column-value", inputs: ["descriptor", "item"] }, { kind: "pipe", type: ClassMapPipe, name: "mngClassMap" }, { kind: "pipe", type: LocaleDefaultRowClassPipe, name: "mngLocaleDefaultRowClass" }, { kind: "pipe", type: TableColumnFilterClassPipe, name: "mngTableColumnFilterClass" }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$1.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i1$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$1.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "directive", type: i1$1.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i1$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i1$1.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i1$1.TableRadioButton, selector: "p-tableRadioButton", inputs: ["disabled", "value", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i1$1.TableCheckbox, selector: "p-tableCheckbox", inputs: ["disabled", "value", "index", "inputId", "name", "required", "ariaLabel"] }, { kind: "component", type: i1$1.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i1$1.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$1.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "directive", type: ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [NgTemplateOutlet, Promise.resolve().then(function () { return filterOverlayWithTag_component; }).then(m => m.TableFilterOverlayWithTagComponent), TemplateDirective], () => [import('./mediusinc-mng-commons-table-column-toggle.component-a8KG1NIX.mjs').then(m => m.TableColumnToggleComponent)], () => [Promise.resolve().then(function () { return columnFilter_component; }).then(m => m.TableColumnFilterComponent)]] }); }
|
|
2066
|
+
}
|
|
2067
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "19.0.7", ngImport: i0, type: TableComponent, resolveDeferredDeps: () => [Promise.resolve().then(function () { return filterOverlayWithTag_component; }).then(m => m.TableFilterOverlayWithTagComponent), import('./mediusinc-mng-commons-table-column-toggle.component-a8KG1NIX.mjs').then(m => m.TableColumnToggleComponent), Promise.resolve().then(function () { return columnFilter_component; }).then(m => m.TableColumnFilterComponent)], resolveMetadata: (TableFilterOverlayWithTagComponent, TableColumnToggleComponent, TableColumnFilterComponent) => ({ decorators: [{
|
|
2068
|
+
type: Component,
|
|
2069
|
+
args: [{ selector: 'mng-table', imports: [
|
|
2070
|
+
ComponentDirective,
|
|
2071
|
+
I18nPropertyPipe,
|
|
2072
|
+
TranslatePipe,
|
|
2073
|
+
NgClass,
|
|
2074
|
+
NgStyle,
|
|
2075
|
+
NgTemplateOutlet,
|
|
2076
|
+
TableColumnValueComponent,
|
|
2077
|
+
ClassMapPipe,
|
|
2078
|
+
LocaleDefaultRowClassPipe,
|
|
2079
|
+
TableColumnFilterComponent,
|
|
2080
|
+
TableColumnFilterClassPipe,
|
|
2081
|
+
TableFilterOverlayWithTagComponent,
|
|
2082
|
+
FormsModule,
|
|
2083
|
+
TemplateDirective,
|
|
2084
|
+
TableModule,
|
|
2085
|
+
Skeleton,
|
|
2086
|
+
TableColumnToggleComponent,
|
|
2087
|
+
ButtonDirective
|
|
2088
|
+
], providers: [TableMetadataService, TableDataService, TablePreferencesService], host: {
|
|
2089
|
+
'[class.mng-table-no-header]': '!isCaptionVisible()'
|
|
2090
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div>\n <!-- MUST NOT use observable for value when using virtual scroll - does not work for some reason -->\n @if (data.isAllPaginationMetaInitialized()) {\n <p-table\n [value]=\"data.data()\"\n [dataKey]=\"metadata.descriptor().trackProperty\"\n [lazy]=\"isLazy()\"\n [loading]=\"data.loading()\"\n [paginator]=\"isPagination()\"\n [rows]=\"data.rows()\"\n [first]=\"data.offset()\"\n [totalRecords]=\"data.count()\"\n [rowsPerPageOptions]=\"metadata.rowsPerPageOptions()\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"'mngTable.paginationMsg' | translate\"\n [multiSortMeta]=\"data.sortMeta()\"\n [filters]=\"data.filterMeta()\"\n [globalFilterFields]=\"metadata.searchFields()\"\n sortMode=\"multiple\"\n [selection]=\"[]\"\n (selectionChange)=\"onSelectionChange($event)\"\n [selectionMode]=\"selectionEnabled() ? selectionMode() : null\"\n [scrollable]=\"true\"\n scrollHeight=\"flex\"\n [rowHover]=\"metadata.descriptor().hasHover\"\n [styleClass]=\"className()\"\n [resizableColumns]=\"metadata.descriptor().hasResizableColumns\"\n [columnResizeMode]=\"metadata.descriptor().columnResizeMode ?? 'expand'\"\n [reorderableColumns]=\"areColumnsReorderable()\"\n paginatorDropdownAppendTo=\"body\"\n [columns]=\"visibleColumns()\"\n [expandedRowKeys]=\"expandedRowKeys()\"\n (onColResize)=\"prefs.onColumnResize($event)\"\n (onColReorder)=\"prefs.onColumnReorder($event)\"\n (onLazyLoad)=\"onTableLazyLoad($event)\"\n (onFilter)=\"onTableFilter($event)\"\n (onRowReorder)=\"onRowReorder($event)\">\n <ng-template #caption>\n @if (isCaptionVisible()) {\n <div class=\"table-header\">\n @if (overlayWithTagFilters().length > 0 || metadata.descriptor().search) {\n @defer (on idle) {\n <mng-table-filter-overlay-with-tag\n [title]=\"metadata.descriptor().title\"\n [metadata]=\"overlayWithTagFilters()\"\n [genericFilterDescriptor]=\"metadata.genericFilterDescriptor()\"\n [model]=\"metadata.descriptor().model\"\n [enableSearch]=\"metadata.descriptor().search\"\n [search]=\"data.searchMeta()\"\n [searchLimitWordMax]=\"metadata.descriptor().searchLimitMaxWords\"\n [enableCaseSensitive]=\"isLazy()\">\n @if (hasTitleDisplay()) {\n <ng-template mngTemplate=\"title\">\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n </ng-template>\n }\n </mng-table-filter-overlay-with-tag>\n }\n } @else {\n <ng-container *ngTemplateOutlet=\"captionTemplateOrComponentOrTitle\"></ng-container>\n }\n <ng-template #captionTemplateOrComponentOrTitle>\n @if (captionTemplate()) {\n <ng-container *ngTemplateOutlet=\"captionTemplate()\"></ng-container>\n } @else if (captionComponent()) {\n <ng-container [mngComponent]=\"captionComponent()\" (instanceCreated)=\"captionComponentInstance.emit($event)\"></ng-container>\n } @else if (metadata.descriptor().title) {\n <h5 class=\"p-0 m-0\">{{ metadata.descriptor().title! | translate }}</h5>\n }\n </ng-template>\n </div>\n }\n </ng-template>\n <ng-template #header>\n @if (!metadata.descriptor().hideHeader) {\n <tr class=\"mng-table-header\" [class]=\"metadata.descriptor().headerClassName\">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableHeaderCheckbox />\n </th>\n } @else {\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\" pFrozenColumn [frozen]=\"true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <ng-template #sortableColumnTHTemplate>\n <div class=\"flex justify-between items-center\">\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n <p-sortIcon [field]=\"col.sort?.property\" class=\"flex\"></p-sortIcon>\n </div>\n </ng-template>\n <ng-template #nonSortableColumnTHTemplate>\n {{\n (col.descriptor.title && !col.descriptor.titleUseModelBase\n ? col.descriptor.title\n : (col.descriptor.title ?? col.descriptor.property | mngI18nProperty: metadata.descriptor().model)\n ) | translate\n }}\n </ng-template>\n @if (col.descriptor.isReorderable) {\n <th\n pResizableColumn\n pReorderableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n } @else {\n <th\n pResizableColumn\n [id]=\"col.descriptor.property\"\n [pSortableColumn]=\"col.sort?.property\"\n [pSortableColumnDisabled]=\"!col.sort\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\"\n [class]=\"col.descriptor.headerClassName | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\">\n <ng-container *ngTemplateOutlet=\"col.sort ? sortableColumnTHTemplate : nonSortableColumnTHTemplate\"></ng-container>\n </th>\n }\n }\n @if (hasLastColumn()) {\n <th\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? areColumnsToggleable()\"\n alignFrozen=\"right\"\n class=\"mng-table-column-custom-last !text-right\">\n @if (areColumnsToggleable()) {\n @defer (on idle) {\n <mng-table-column-toggle [columns]=\"visibleColumns()\" />\n }\n }\n </th>\n }\n </tr>\n }\n @if (hasColumnFilters()) {\n <tr class=\"mng-column-filter-row\">\n <!-- We need the line below, because otherwise p-tableRadioButton shifts the rest of the columns in table -->\n @if (selectionEnabled()) {\n <th style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\"></th>\n }\n @if (rowReorderEnabled()) {\n <th scope=\"col\"></th>\n }\n @if (metadata.descriptor().rowExpandable) {\n <th scope=\"col\"></th>\n }\n @for (col of visibleColumns(); track col.id) {\n <th\n [class]=\"'!px-1 ' + col.filter?.descriptor?.columnClassName | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\"\n [style.width.px]=\"col.width\"\n [style.width.%]=\"col.width ? null : (col.filter?.descriptor?.columnWidth ?? col.descriptor.width ?? null)\"\n [style.min-width.px]=\"col.width ? null : (col.filter?.descriptor?.columnMinWidth ?? col.descriptor.minWidth)\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n @if (col.filter) {\n @defer (on idle) {\n <mng-table-column-filter [metadata]=\"col.filter\"></mng-table-column-filter>\n }\n }\n </th>\n }\n @if (hasLastColumn()) {\n <th pFrozenColumn alignFrozen=\"right\" class=\"mng-table-column-custom-last\" [style.min-width.px]=\"columnLastMinWidth()\"></th>\n }\n </tr>\n }\n </ng-template>\n <ng-template #body let-item let-idx=\"rowIndex\" let-expanded=\"expanded\">\n <tr\n [pReorderableRow]=\"idx\"\n [ngClass]=\"\n metadata.descriptor().rowClassName | mngClassMap: metadata.descriptor().rowClassNameMapFn : item | mngLocaleDefaultRowClass: metadata.descriptor() : item\n \">\n @if (selectionEnabled()) {\n @if (selectionMode() === 'multiple') {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableCheckbox [value]=\"item\"></p-tableCheckbox>\n </td>\n } @else {\n <td style=\"min-width: 36px\" pFrozenColumn [frozen]=\"metadata.descriptor().selectionColumnFrozen ?? true\">\n <p-tableRadioButton [value]=\"item\"></p-tableRadioButton>\n </td>\n }\n }\n @if (metadata.descriptor().rowExpandable) {\n <td>\n @let expandProp = metadata.descriptor().rowExpandableProperty;\n @if (!expandProp || item[expandProp]) {\n <button\n pButton\n type=\"button\"\n [pRowToggler]=\"item\"\n rounded=\"true\"\n text=\"true\"\n class=\"mng-button-sm\"\n [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"></button>\n }\n </td>\n }\n @if (rowReorderEnabled()) {\n <td>\n <span class=\"pi pi-bars\" pReorderableRowHandle></span>\n </td>\n }\n @for (col of visibleColumns(); track col.id) {\n <td\n (click)=\"onCellClick($event, col.descriptor, item, idx)\"\n [class]=\"\n col.descriptor.className\n | mngClassMap: col.descriptor.classNameMapFn : item\n | mngTableColumnFilterClass: col.filter?.descriptor : hasColumnFilters() && !col.width\n \"\n [class.clickable]=\"isCellClickEnabled()\"\n [style.width]=\"col.width ? col.width + 'px' : col.descriptor.width + '%'\"\n [style.min-width.px]=\"col.width ? null : col.descriptor.minWidth\"\n [style.max-width.px]=\"col.width ?? col.descriptor.maxWidth\">\n <mng-table-column-value [descriptor]=\"col.descriptor\" [item]=\"item\"></mng-table-column-value>\n </td>\n }\n @if (hasLastColumn()) {\n <td\n class=\"mng-table-column-custom-last justify-end !text-right\"\n [style.min-width.px]=\"columnLastMinWidth()\"\n pFrozenColumn\n alignFrozen=\"right\"\n [frozen]=\"metadata.descriptor().actionColumnFrozen ?? true\">\n @if (columnCustomLastTemplate()) {\n <ng-container *ngTemplateOutlet=\"columnCustomLastTemplate(); context: {rowItem: item, rowIndex: idx}\"></ng-container>\n } @else if (columnCustomLastComponent()) {\n <div [mngComponent]=\"columnCustomLastComponent()\" (instanceCreated)=\"columnCustomLastComponentInstance.emit($event)\"></div>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #expandedrow let-item>\n @if (metadata.descriptor().rowExpandable) {\n <tr>\n <td></td>\n <td [colSpan]=\"metadata.descriptor().rowExpandableColSpan\">\n @if (metadata.descriptor().rowExpandableComponentType !== undefined) {\n <ng-container [mngComponent]=\"metadata.descriptor().rowExpandableComponentType\" [inputs]=\"{item}\"> </ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"rowExpandTemplate(); context: {rowItem: item}\"></ng-container>\n }\n </td>\n </tr>\n }\n </ng-template>\n <ng-template #loadingicon>\n <div class=\"flex flex-col items-center\">\n @if (metadata.descriptor().loadingIcon) {\n <i [class]=\"'text-white text-4xl pi-spin ' + metadata.descriptor().loadingIcon\"></i>\n }\n @if (metadata.descriptor().loadingText) {\n <div class=\"text text-white text-lg font-semibold\" [ngClass]=\"{'mt-3': metadata.descriptor().loadingIcon}\">\n {{ metadata.descriptor().loadingText ?? '' | translate }}\n </div>\n }\n </div>\n </ng-template>\n <ng-template #loadingbody>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n <div class=\"loading-text\"></div>\n <p-skeleton [ngStyle]=\"{width: '100%'}\"></p-skeleton>\n </td>\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnsColspan()\">\n {{ 'mngTable.noItems' | translate }}\n </td>\n </tr>\n </ng-template>\n @if (footerTemplate()) {\n <ng-template #summary>\n <ng-container *ngTemplateOutlet=\"footerTemplate(); context: {data: data.data(), totalCount: data.count()}\"></ng-container>\n </ng-template>\n }\n </p-table>\n }\n</div>\n", styles: ["mng-table .p-datatable .p-datatable-header{border-top:0}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td{cursor:auto}mng-table .p-datatable:not(.p-datatable-gridlines) .p-datatable-tbody>tr>td.clickable{cursor:pointer}mng-table .p-datatable :is(.p-datatable-thead>tr>th,.p-datatable-tbody>tr>td):hover mng-table-column-value .help-buttons{display:block}mng-table .p-datatable .p-datatable-thead>tr>th.mng-table-column-custom-last{padding:var(--mng-table-column-head-custom-last, .1rem 1rem)}mng-table .p-datatable .p-datatable-tbody>tr>td{position:relative}mng-table .p-datatable .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding-top:.1rem;padding-bottom:.1rem}mng-table .p-datatable .p-datatable-tbody>tr>td.p-datatable-frozen-column{position:sticky;z-index:1;background:transparent}mng-table .p-datatable.p-datatable-lg .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-column-body-custom-last, .15rem 1rem)}mng-table .p-datatable.p-datatable-sm .p-datatable-tbody>tr>td.mng-table-column-custom-last{padding:var(--mng-table-sm-column-body-custom-last, .05rem 1rem)}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-thead>tr>th{overflow:hidden;text-overflow:ellipsis}mng-table .p-datatable.p-datatable-flex-scrollable .p-datatable-tbody>tr>td{overflow:hidden}mng-table .p-datatable .mng-table-row-localization-default-locale{background:var(--p-surface-100)!important}mng-table .mng-table-header>th:not(:first-child):not(:last-child){border-radius:0!important}mng-table .mng-table-header>th:first-child{border-top-right-radius:0!important;border-bottom-right-radius:0!important}mng-table .mng-table-header>th:last-child{border-radius:0!important}mng-table .mng-table-header .mng-table-columns-multiselect{width:36px}mng-table .mng-table-header .mng-table-columns-multiselect .p-multiselect-label-container{width:0}mng-table.mng-table-no-header p-datatable .p-datatable-header{display:none}mng-table.mng-table-header-compact .p-datatable-header{padding:var(--mng-table-header-compact-padding, 0 0 .5rem 0)}\n"] }]
|
|
2091
|
+
}], ctorParameters: () => [], propDecorators: null }) });
|
|
2092
|
+
|
|
2093
|
+
/**
|
|
2094
|
+
* Prepares providers for usage of the tableview functionalities.
|
|
2095
|
+
*
|
|
2096
|
+
* @returns {CommonsFeature} The `CommonsFeature` object with the layout configuration.
|
|
2097
|
+
*/
|
|
2098
|
+
function withTable(config) {
|
|
2099
|
+
return {
|
|
2100
|
+
type: CommonsFeatureTypeEnum.Table,
|
|
2101
|
+
providers: [
|
|
2102
|
+
{
|
|
2103
|
+
provide: COMMONS_TABLE_FEATURE_CONFIG_IT,
|
|
2104
|
+
useValue: config
|
|
2105
|
+
}
|
|
2106
|
+
]
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* Provides a list of providers for configuring a table feature. Useful for lazy-loading table chunk in child (lazy loaded routes).
|
|
2111
|
+
*
|
|
2112
|
+
* @param {TableFeatureConfig} [config] - An optional configuration object for the table feature.
|
|
2113
|
+
*/
|
|
2114
|
+
function provideTableChild(config) {
|
|
2115
|
+
return [
|
|
2116
|
+
{
|
|
2117
|
+
provide: COMMONS_TABLE_FEATURE_CONFIG_IT,
|
|
2118
|
+
useValue: config
|
|
2119
|
+
}
|
|
2120
|
+
];
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
// components
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Generated bundle index. Do not edit.
|
|
2127
|
+
*/
|
|
2128
|
+
|
|
2129
|
+
export { COMMONS_TABLE_FEATURE_CONFIG_IT as C, FilterValuePipe as F, LocaleDefaultRowClassPipe as L, TableMetadataService as T, TablePreferencesService as a, TableColumnFilterComponent as b, TableColumnValueComponent as c, TableFilterActiveTagComponent as d, TableFilterFormComponent as e, TableFilterOverlayWithTagComponent as f, TableComponent as g, filterGenerateMatchModeOptions as h, filterGetDefaultMatchMode as i, filterSetMetadataOnChange as j, filterSetMetadataOnDisplayChange as k, filterAreDatesEqual as l, filterApplySerializationConfigToCmp as m, filterAdjustDisplayValueOnMatchModeChange as n, filterGetDateConfig as o, filterGetNumberConfig as p, createFilterDescriptorsFromGeneric as q, generateTableLayoutPrefsKey as r, TableColumnFilterClassPipe as s, tableNotificationError as t, TableDataService as u, provideTableChild as v, withTable as w };
|
|
2130
|
+
//# sourceMappingURL=mediusinc-mng-commons-table-mediusinc-mng-commons-table-C2vrMoNL.mjs.map
|