angular-slickgrid 8.14.1 → 9.0.0
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/.gitbook.yaml +5 -0
- package/CHANGELOG.md +1691 -0
- package/CONTRIBUTING.md +17 -0
- package/README.md +13 -50
- package/angular.json +133 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +1620 -0
- package/coverage/coverage-final.json +9 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +176 -0
- package/coverage/library/components/angular-slickgrid.component.ts.html +5074 -0
- package/coverage/library/components/index.html +116 -0
- package/coverage/library/constants.ts.html +397 -0
- package/coverage/library/extensions/index.html +116 -0
- package/coverage/library/extensions/slickRowDetailView.ts.html +1261 -0
- package/coverage/library/index.html +116 -0
- package/coverage/library/modules/angular-slickgrid.module.ts.html +166 -0
- package/coverage/library/modules/index.html +116 -0
- package/coverage/library/services/angularUtil.service.ts.html +445 -0
- package/coverage/library/services/container.service.ts.html +163 -0
- package/coverage/library/services/index.html +161 -0
- package/coverage/library/services/translater.service.ts.html +199 -0
- package/coverage/library/services/utilities.ts.html +142 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +142 -0
- package/{fesm2022 → dist/fesm2022}/angular-slickgrid.mjs +168 -194
- package/dist/fesm2022/angular-slickgrid.mjs.map +1 -0
- package/{i18n → dist/i18n}/en.json +2 -1
- package/{i18n → dist/i18n}/fr.json +2 -1
- package/{app/modules/angular-slickgrid → dist/library}/components/angular-slickgrid.component.d.ts +9 -9
- package/{app/modules/angular-slickgrid → dist/library}/extensions/slickRowDetailView.d.ts +4 -4
- package/{app/modules/angular-slickgrid → dist/library}/models/angularGridInstance.interface.d.ts +0 -2
- package/dist/library/models/index.d.ts +5 -0
- package/{app/modules/angular-slickgrid → dist/library}/models/rowDetailView.interface.d.ts +1 -1
- package/{app/modules/angular-slickgrid → dist/library}/modules/angular-slickgrid.module.d.ts +1 -1
- package/dist/public_api.d.ts +1 -0
- package/docs/README.md +5 -0
- package/docs/TOC.md +105 -0
- package/docs/backend-services/Custom-Backend-Service.md +50 -0
- package/docs/backend-services/GraphQL.md +276 -0
- package/docs/backend-services/OData.md +245 -0
- package/docs/backend-services/graphql/GraphQL-Filtering.md +156 -0
- package/docs/backend-services/graphql/GraphQL-JSON-Result.md +85 -0
- package/docs/backend-services/graphql/GraphQL-Pagination.md +77 -0
- package/docs/backend-services/graphql/GraphQL-Sorting.md +78 -0
- package/docs/column-functionalities/cell-menu.md +212 -0
- package/docs/column-functionalities/editors/autocomplete-editor.md +466 -0
- package/docs/column-functionalities/editors/date-editor-flatpickr.md +71 -0
- package/docs/column-functionalities/editors/date-editor-vanilla-calendar.md +91 -0
- package/docs/column-functionalities/editors/longtext-editor-textarea.md +80 -0
- package/docs/column-functionalities/editors/select-dropdown-editor.md +227 -0
- package/docs/column-functionalities/editors.md +604 -0
- package/docs/column-functionalities/filters/autocomplete-filter.md +183 -0
- package/docs/column-functionalities/filters/compound-filters.md +234 -0
- package/docs/column-functionalities/filters/custom-filter.md +117 -0
- package/docs/column-functionalities/filters/filter-intro.md +81 -0
- package/docs/column-functionalities/filters/input-filter.md +260 -0
- package/docs/column-functionalities/filters/range-filters.md +188 -0
- package/docs/column-functionalities/filters/select-filter.md +695 -0
- package/docs/column-functionalities/filters/single-search-filter.md +77 -0
- package/docs/column-functionalities/filters/styling-filled-filters.md +45 -0
- package/docs/column-functionalities/formatters.md +325 -0
- package/docs/column-functionalities/sorting.md +200 -0
- package/docs/developer-guides/csp-compliance.md +64 -0
- package/docs/events/Available-Events.md +223 -0
- package/docs/events/Grid-&-DataView-Events.md +211 -0
- package/docs/getting-started/quick-start.md +230 -0
- package/docs/getting-started/troubleshooting.md +80 -0
- package/docs/grid-functionalities/Column-Picker.md +22 -0
- package/docs/grid-functionalities/Composite-Editor-Modal.md +627 -0
- package/docs/grid-functionalities/Context-Menu.md +226 -0
- package/docs/grid-functionalities/Custom-Footer.md +80 -0
- package/docs/grid-functionalities/Custom-Tooltip-(plugin).md +258 -0
- package/docs/grid-functionalities/Export-to-Excel.md +457 -0
- package/docs/grid-functionalities/Export-to-Text-File.md +165 -0
- package/docs/grid-functionalities/FAQ.md +53 -0
- package/docs/grid-functionalities/Global-Options.md +29 -0
- package/docs/grid-functionalities/Grid-Auto-Resize.md +218 -0
- package/docs/grid-functionalities/Grid-Menu.md +134 -0
- package/docs/grid-functionalities/Grid-State-&-Preset.md +245 -0
- package/docs/grid-functionalities/Header-Menu-&-Header-Buttons.md +125 -0
- package/docs/grid-functionalities/Resize-by-Cell-Content.md +138 -0
- package/docs/grid-functionalities/Row-Selection.md +247 -0
- package/docs/grid-functionalities/Row-based-edit.md +71 -0
- package/docs/grid-functionalities/add-update-highlight.md +258 -0
- package/docs/grid-functionalities/column-row-spanning.md +74 -0
- package/docs/grid-functionalities/dynamic-item-metadata.md +124 -0
- package/docs/grid-functionalities/excel-copy-buffer.md +145 -0
- package/docs/grid-functionalities/frozen-columns-rows.md +164 -0
- package/docs/grid-functionalities/grouping-and-aggregators.md +269 -0
- package/docs/grid-functionalities/header-footer-slots.md +22 -0
- package/docs/grid-functionalities/infinite-scroll.md +150 -0
- package/docs/grid-functionalities/providing-grid-data.md +61 -0
- package/docs/grid-functionalities/row-detail.md +530 -0
- package/docs/grid-functionalities/tree-data-grid.md +391 -0
- package/docs/localization/Localization---Component-Sample.md +87 -0
- package/docs/localization/Localization-with-Custom-Locales.md +66 -0
- package/docs/localization/Localization-with-ngx-translate.md +148 -0
- package/docs/migrations/migration-to-2.x.md +304 -0
- package/docs/migrations/migration-to-3.x.md +295 -0
- package/docs/migrations/migration-to-4.x.md +83 -0
- package/docs/migrations/migration-to-5.x.md +160 -0
- package/docs/migrations/migration-to-6.x.md +128 -0
- package/docs/migrations/migration-to-7.x.md +294 -0
- package/docs/migrations/migration-to-8.x.md +316 -0
- package/docs/migrations/migration-to-9.x.md +219 -0
- package/docs/slick-grid-dataview-objects/slickgrid-dataview-objects.md +79 -0
- package/docs/styling/dark-mode.md +100 -0
- package/docs/styling/styling.md +250 -0
- package/docs/testing/testing-patterns.md +73 -0
- package/eslint.config.mjs +60 -0
- package/ng-package.json +10 -0
- package/package.json +24 -48
- package/src/assets/angular-logo.png +0 -0
- package/src/assets/angular-logo2.png +0 -0
- package/src/assets/data/collection_100_numbers.json +12 -0
- package/src/assets/data/collection_500_numbers.json +52 -0
- package/src/assets/data/countries.json +245 -0
- package/src/assets/data/country_names.json +245 -0
- package/src/assets/data/customers_100.json +102 -0
- package/src/assets/data/users.csv +5 -0
- package/src/assets/i18n/en.json +102 -0
- package/src/assets/i18n/fr.json +103 -0
- package/src/demos/app-routing.module.ts +108 -0
- package/src/demos/app.component.html +187 -0
- package/src/demos/app.component.scss +79 -0
- package/src/demos/app.component.ts +11 -0
- package/src/demos/app.module.ts +196 -0
- package/src/demos/environments/environment.dev.ts +3 -0
- package/src/demos/environments/environment.prod.ts +3 -0
- package/src/demos/environments/environment.ts +8 -0
- package/src/demos/examples/custom-angularComponentEditor.ts +187 -0
- package/src/demos/examples/custom-angularComponentFilter.ts +123 -0
- package/src/demos/examples/custom-buttonFormatter.component.ts +13 -0
- package/src/demos/examples/custom-inputEditor.ts +132 -0
- package/src/demos/examples/custom-inputFilter.ts +134 -0
- package/src/demos/examples/custom-titleFormatter.component.ts +9 -0
- package/src/demos/examples/data/collection_100_numbers.json +12 -0
- package/src/demos/examples/data/collection_500_numbers.json +52 -0
- package/src/demos/examples/data/countries.json +245 -0
- package/src/demos/examples/data/country_names.json +245 -0
- package/src/demos/examples/data/customers_100.json +102 -0
- package/src/demos/examples/data/users.csv +5 -0
- package/src/demos/examples/editor-ng-select.component.ts +38 -0
- package/src/demos/examples/example01.component.html +48 -0
- package/src/demos/examples/example01.component.ts +109 -0
- package/src/demos/examples/example02.component.html +45 -0
- package/src/demos/examples/example02.component.ts +218 -0
- package/src/demos/examples/example03.component.html +118 -0
- package/src/demos/examples/example03.component.ts +694 -0
- package/src/demos/examples/example04.component.html +87 -0
- package/src/demos/examples/example04.component.ts +326 -0
- package/src/demos/examples/example05.component.html +151 -0
- package/src/demos/examples/example05.component.ts +474 -0
- package/src/demos/examples/example06.component.html +163 -0
- package/src/demos/examples/example06.component.ts +446 -0
- package/src/demos/examples/example07.component.html +56 -0
- package/src/demos/examples/example07.component.scss +10 -0
- package/src/demos/examples/example07.component.ts +216 -0
- package/src/demos/examples/example08.component.html +51 -0
- package/src/demos/examples/example08.component.scss +23 -0
- package/src/demos/examples/example08.component.ts +195 -0
- package/src/demos/examples/example09.component.html +55 -0
- package/src/demos/examples/example09.component.scss +22 -0
- package/src/demos/examples/example09.component.ts +302 -0
- package/src/demos/examples/example10.component.html +103 -0
- package/src/demos/examples/example10.component.ts +309 -0
- package/src/demos/examples/example11.component.html +91 -0
- package/src/demos/examples/example11.component.ts +276 -0
- package/src/demos/examples/example12.component.html +98 -0
- package/src/demos/examples/example12.component.ts +317 -0
- package/src/demos/examples/example13.component.html +96 -0
- package/src/demos/examples/example13.component.ts +370 -0
- package/src/demos/examples/example14.component.html +50 -0
- package/src/demos/examples/example14.component.scss +11 -0
- package/src/demos/examples/example14.component.ts +156 -0
- package/src/demos/examples/example15.component.html +56 -0
- package/src/demos/examples/example15.component.ts +304 -0
- package/src/demos/examples/example16.component.html +77 -0
- package/src/demos/examples/example16.component.ts +277 -0
- package/src/demos/examples/example17.component.html +50 -0
- package/src/demos/examples/example17.component.ts +109 -0
- package/src/demos/examples/example18.component.html +132 -0
- package/src/demos/examples/example18.component.ts +445 -0
- package/src/demos/examples/example19-rowdetail.component.html +40 -0
- package/src/demos/examples/example19-rowdetail.component.ts +54 -0
- package/src/demos/examples/example19.component.html +79 -0
- package/src/demos/examples/example19.component.ts +316 -0
- package/src/demos/examples/example20.component.html +76 -0
- package/src/demos/examples/example20.component.scss +11 -0
- package/src/demos/examples/example20.component.ts +341 -0
- package/src/demos/examples/example21.component.html +86 -0
- package/src/demos/examples/example21.component.scss +16 -0
- package/src/demos/examples/example21.component.ts +140 -0
- package/src/demos/examples/example22.component.html +41 -0
- package/src/demos/examples/example22.component.ts +117 -0
- package/src/demos/examples/example23.component.html +111 -0
- package/src/demos/examples/example23.component.ts +323 -0
- package/src/demos/examples/example24.component.html +120 -0
- package/src/demos/examples/example24.component.scss +62 -0
- package/src/demos/examples/example24.component.ts +641 -0
- package/src/demos/examples/example25.component.html +60 -0
- package/src/demos/examples/example25.component.scss +8 -0
- package/src/demos/examples/example25.component.ts +255 -0
- package/src/demos/examples/example26.component.html +98 -0
- package/src/demos/examples/example26.component.scss +42 -0
- package/src/demos/examples/example26.component.ts +383 -0
- package/src/demos/examples/example27.component.html +138 -0
- package/src/demos/examples/example27.component.scss +10 -0
- package/src/demos/examples/example27.component.ts +369 -0
- package/src/demos/examples/example28.component.html +143 -0
- package/src/demos/examples/example28.component.scss +54 -0
- package/src/demos/examples/example28.component.ts +453 -0
- package/src/demos/examples/example29.component.html +30 -0
- package/src/demos/examples/example29.component.ts +70 -0
- package/src/demos/examples/example30.component.html +116 -0
- package/src/demos/examples/example30.component.scss +20 -0
- package/src/demos/examples/example30.component.ts +1070 -0
- package/src/demos/examples/example32.component.html +77 -0
- package/src/demos/examples/example32.component.scss +8 -0
- package/src/demos/examples/example32.component.ts +905 -0
- package/src/demos/examples/example33.component.html +50 -0
- package/src/demos/examples/example33.component.scss +46 -0
- package/src/demos/examples/example33.component.ts +571 -0
- package/src/demos/examples/example34.component.html +82 -0
- package/src/demos/examples/example34.component.scss +77 -0
- package/src/demos/examples/example34.component.ts +434 -0
- package/src/demos/examples/example35.component.html +77 -0
- package/src/demos/examples/example35.component.scss +18 -0
- package/src/demos/examples/example35.component.ts +264 -0
- package/src/demos/examples/example36.component.html +56 -0
- package/src/demos/examples/example36.component.scss +26 -0
- package/src/demos/examples/example36.component.ts +504 -0
- package/src/demos/examples/example37.component.html +30 -0
- package/src/demos/examples/example37.component.ts +123 -0
- package/src/demos/examples/example38.component.html +104 -0
- package/src/demos/examples/example38.component.scss +8 -0
- package/src/demos/examples/example38.component.ts +420 -0
- package/src/demos/examples/example39.component.html +112 -0
- package/src/demos/examples/example39.component.scss +8 -0
- package/src/demos/examples/example39.component.ts +371 -0
- package/src/demos/examples/example40.component.html +76 -0
- package/src/demos/examples/example40.component.ts +226 -0
- package/src/demos/examples/example41.component.html +50 -0
- package/src/demos/examples/example41.component.scss +42 -0
- package/src/demos/examples/example41.component.ts +229 -0
- package/src/demos/examples/example42.component.html +47 -0
- package/src/demos/examples/example42.component.ts +203 -0
- package/src/demos/examples/example43.component.html +94 -0
- package/src/demos/examples/example43.component.scss +30 -0
- package/src/demos/examples/example43.component.ts +449 -0
- package/src/demos/examples/example44.component.html +78 -0
- package/src/demos/examples/example44.component.scss +50 -0
- package/src/demos/examples/example44.component.ts +375 -0
- package/src/demos/examples/example45-detail.component.html +15 -0
- package/src/demos/examples/example45-detail.component.ts +97 -0
- package/src/demos/examples/example45.component.html +110 -0
- package/src/demos/examples/example45.component.scss +50 -0
- package/src/demos/examples/example45.component.ts +243 -0
- package/src/demos/examples/filter-ng-select.component.ts +33 -0
- package/src/demos/examples/grid-custom-pager.component.html +60 -0
- package/src/demos/examples/grid-custom-pager.component.scss +57 -0
- package/src/demos/examples/grid-custom-pager.component.ts +107 -0
- package/src/demos/examples/grid-remote.component.html +44 -0
- package/src/demos/examples/grid-remote.component.ts +164 -0
- package/src/demos/examples/home.component.html +39 -0
- package/src/demos/examples/home.component.ts +10 -0
- package/src/demos/examples/jsonp.ts +89 -0
- package/src/demos/examples/rowdetail-preload.component.ts +10 -0
- package/src/demos/examples/swt-common-grid-pagination.component.ts +160 -0
- package/src/demos/examples/swt-common-grid-test.component.html +37 -0
- package/src/demos/examples/swt-common-grid-test.component.ts +214 -0
- package/src/demos/examples/swt-common-grid.component.ts +436 -0
- package/src/demos/examples/swt-logger.service.ts +173 -0
- package/src/demos/examples/utilities.ts +9 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +17 -0
- package/src/library/components/__tests__/angular-slickgrid.component.spec.ts +2638 -0
- package/src/library/components/angular-slickgrid.component.html +5 -0
- package/src/library/components/angular-slickgrid.component.ts +1662 -0
- package/src/library/constants.ts +105 -0
- package/src/library/extensions/__tests__/slickRowDetailView.spec.ts +751 -0
- package/src/library/extensions/index.ts +1 -0
- package/src/library/extensions/slickRowDetailView.ts +395 -0
- package/src/library/global-grid-options.ts +273 -0
- package/src/library/index.ts +11 -0
- package/src/library/models/angularComponentOutput.interface.ts +6 -0
- package/src/library/models/angularGridInstance.interface.ts +76 -0
- package/src/library/models/externalTestingDependencies.interface.ts +37 -0
- package/src/library/models/gridOption.interface.ts +15 -0
- package/src/library/models/index.ts +5 -0
- package/src/library/models/rowDetailView.interface.ts +16 -0
- package/src/library/modules/angular-slickgrid.module.spec.ts +25 -0
- package/src/library/modules/angular-slickgrid.module.ts +27 -0
- package/src/library/services/__tests__/angularUtilService.spec.ts +156 -0
- package/src/library/services/__tests__/container.service.spec.ts +25 -0
- package/src/library/services/__tests__/translater.service.spec.ts +43 -0
- package/src/library/services/__tests__/utilities.spec.ts +22 -0
- package/src/library/services/angularUtil.service.ts +120 -0
- package/src/library/services/container.service.ts +26 -0
- package/src/library/services/index.ts +4 -0
- package/src/library/services/translater.service.ts +38 -0
- package/src/library/services/utilities.ts +19 -0
- package/src/library/slickgrid-config.ts +10 -0
- package/src/main.ts +13 -0
- package/src/public_api.ts +1 -0
- package/src/styles.scss +178 -0
- package/test/cypress/e2e/example01.cy.ts +367 -0
- package/test/cypress/e2e/example02.cy.ts +60 -0
- package/test/cypress/e2e/example03.cy.ts +268 -0
- package/test/cypress/e2e/example04.cy.ts +254 -0
- package/test/cypress/e2e/example05.cy.ts +804 -0
- package/test/cypress/e2e/example06.cy.ts +890 -0
- package/test/cypress/e2e/example07.cy.ts +384 -0
- package/test/cypress/e2e/example08.cy.ts +190 -0
- package/test/cypress/e2e/example09.cy.ts +392 -0
- package/test/cypress/e2e/example10.cy.ts +650 -0
- package/test/cypress/e2e/example11.cy.ts +86 -0
- package/test/cypress/e2e/example12.cy.ts +269 -0
- package/test/cypress/e2e/example13.cy.ts +246 -0
- package/test/cypress/e2e/example14.cy.ts +122 -0
- package/test/cypress/e2e/example15.cy.ts +598 -0
- package/test/cypress/e2e/example16.cy.ts +427 -0
- package/test/cypress/e2e/example17.cy.ts +83 -0
- package/test/cypress/e2e/example18.cy.ts +431 -0
- package/test/cypress/e2e/example19.cy.ts +263 -0
- package/test/cypress/e2e/example20.cy.ts +264 -0
- package/test/cypress/e2e/example21.cy.ts +77 -0
- package/test/cypress/e2e/example22.cy.ts +94 -0
- package/test/cypress/e2e/example23.cy.ts +259 -0
- package/test/cypress/e2e/example24.cy.ts +707 -0
- package/test/cypress/e2e/example25.cy.ts +193 -0
- package/test/cypress/e2e/example26.cy.ts +111 -0
- package/test/cypress/e2e/example27.cy.ts +261 -0
- package/test/cypress/e2e/example28.cy.ts +740 -0
- package/test/cypress/e2e/example29.cy.ts +30 -0
- package/test/cypress/e2e/example30.cy.ts +757 -0
- package/test/cypress/e2e/example31.cy.ts +69 -0
- package/test/cypress/e2e/example32.cy.ts +272 -0
- package/test/cypress/e2e/example33.cy.ts +278 -0
- package/test/cypress/e2e/example34.cy.ts +84 -0
- package/test/cypress/e2e/example35.cy.ts +178 -0
- package/test/cypress/e2e/example36.cy.ts +219 -0
- package/test/cypress/e2e/example37.cy.ts +52 -0
- package/test/cypress/e2e/example38.cy.ts +160 -0
- package/test/cypress/e2e/example39.cy.ts +150 -0
- package/test/cypress/e2e/example40.cy.ts +126 -0
- package/test/cypress/e2e/example41.cy.ts +90 -0
- package/test/cypress/e2e/example42.cy.ts +82 -0
- package/test/cypress/e2e/example43.cy.ts +482 -0
- package/test/cypress/e2e/example44.cy.ts +458 -0
- package/test/cypress/e2e/example45.cy.ts +455 -0
- package/test/cypress/e2e/home.cy.ts +7 -0
- package/test/cypress/fixtures/example.json +5 -0
- package/test/cypress/plugins/index.ts +17 -0
- package/test/cypress/plugins/utilities.ts +28 -0
- package/test/cypress/support/commands.ts +88 -0
- package/test/cypress/support/common.ts +47 -0
- package/test/cypress/support/drag.ts +101 -0
- package/test/cypress/support/index.ts +20 -0
- package/test/cypress/tsconfig.json +9 -0
- package/test/cypress.config.ts +34 -0
- package/test/mockSlickEvent.ts +77 -0
- package/test/rxjsResourceStub.ts +69 -0
- package/test/test-setup.ts +6 -0
- package/test/translateServiceStub.ts +230 -0
- package/test/translaterServiceStub.ts +239 -0
- package/test/tsconfig.json +17 -0
- package/test/vitest-global-mocks.ts +41 -0
- package/test/vitest-global-setup.ts +3 -0
- package/test/vitest-pretest.ts +5 -0
- package/tsconfig.app.json +14 -0
- package/tsconfig.json +31 -0
- package/tsconfig.spec.json +11 -0
- package/types/sortablejs.d.ts +4 -0
- package/vite.config.mts +51 -0
- package/app/modules/angular-slickgrid/models/index.d.ts +0 -5
- package/esm2022/angular-slickgrid.mjs +0 -5
- package/esm2022/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +0 -1407
- package/esm2022/app/modules/angular-slickgrid/constants.mjs +0 -96
- package/esm2022/app/modules/angular-slickgrid/extensions/index.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +0 -304
- package/esm2022/app/modules/angular-slickgrid/global-grid-options.mjs +0 -263
- package/esm2022/app/modules/angular-slickgrid/index.mjs +0 -8
- package/esm2022/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/gridOption.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/index.mjs +0 -6
- package/esm2022/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +0 -32
- package/esm2022/app/modules/angular-slickgrid/services/angularUtil.service.mjs +0 -88
- package/esm2022/app/modules/angular-slickgrid/services/container.service.mjs +0 -27
- package/esm2022/app/modules/angular-slickgrid/services/index.mjs +0 -5
- package/esm2022/app/modules/angular-slickgrid/services/translater.service.mjs +0 -45
- package/esm2022/app/modules/angular-slickgrid/services/utilities.mjs +0 -19
- package/esm2022/app/modules/angular-slickgrid/slickgrid-config.mjs +0 -8
- package/esm2022/public_api.mjs +0 -2
- package/fesm2022/angular-slickgrid.mjs.map +0 -1
- package/public_api.d.ts +0 -1
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/constants.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/extensions/index.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/global-grid-options.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/index.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/models/angularComponentOutput.interface.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/models/externalTestingDependencies.interface.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/models/gridOption.interface.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/angularUtil.service.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/container.service.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/index.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/translater.service.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/utilities.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/slickgrid-config.d.ts +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
|
|
4
|
+
import { SwtCommonGridComponent } from './swt-common-grid.component';
|
|
5
|
+
import { SwtCommonGridPaginationComponent } from './swt-common-grid-pagination.component';
|
|
6
|
+
import { FilterChangedArgs, PaginationChangedArgs } from '../../library';
|
|
7
|
+
|
|
8
|
+
import { Logger } from './swt-logger.service';
|
|
9
|
+
/**
|
|
10
|
+
* Main test Component
|
|
11
|
+
*
|
|
12
|
+
* @author Saber Chebka, saber.chebka@gmail.com
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'swt-common-grid-test',
|
|
16
|
+
templateUrl: './swt-common-grid-test.component.html',
|
|
17
|
+
standalone: false,
|
|
18
|
+
})
|
|
19
|
+
export class SwtCommonGridTestComponent implements OnInit, AfterViewInit {
|
|
20
|
+
testurl = 'http://127.0.0.1:8080/grid!display.do?';
|
|
21
|
+
currentUrl = this.testurl;
|
|
22
|
+
|
|
23
|
+
@ViewChild('commonGrid1', { static: true }) commonGrid!: SwtCommonGridComponent;
|
|
24
|
+
@ViewChild('commonGridPag1', { static: true }) commonGridPag!: SwtCommonGridPaginationComponent;
|
|
25
|
+
|
|
26
|
+
private logger: Logger;
|
|
27
|
+
|
|
28
|
+
constructor(private httpClient: HttpClient) {
|
|
29
|
+
this.logger = new Logger('test', undefined);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
ngOnInit() {
|
|
33
|
+
// Link pagination component into the current Grid
|
|
34
|
+
if (this.commonGridPag) {
|
|
35
|
+
this.commonGrid.paginationComponent = this.commonGridPag;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ngAfterViewInit() {
|
|
40
|
+
this.logger.info('method [ngAfterViewInit] - START');
|
|
41
|
+
|
|
42
|
+
setTimeout(() => {
|
|
43
|
+
// Init datagrid example:
|
|
44
|
+
this.commonGridPag.processing = true;
|
|
45
|
+
|
|
46
|
+
// Real HTTP call
|
|
47
|
+
this.currentUrl = this.testurl + '¤tPage=1';
|
|
48
|
+
/*
|
|
49
|
+
this.httpClient.get(this.currentUrl).subscribe(
|
|
50
|
+
(data: any) => {
|
|
51
|
+
this.commonGrid.CustomGrid(data.suspectManagement.grid.metadata);
|
|
52
|
+
this.commonGrid.gridData = data.suspectManagement.grid.rows;
|
|
53
|
+
this.commonGridPag.pageCount = data.suspectManagement.singletons.maxpage;
|
|
54
|
+
this.commonGridPag.processing = false;
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
*/
|
|
58
|
+
this.commonGrid.CustomGrid(data_sample.pagination_samples.grid.metadata);
|
|
59
|
+
this.commonGrid.gridData = data_sample.pagination_samples.grid.rows;
|
|
60
|
+
this.commonGridPag.pageCount = data_sample.pagination_samples.grid.rows.maxpage;
|
|
61
|
+
|
|
62
|
+
this.commonGridPag.processing = false;
|
|
63
|
+
}, 0);
|
|
64
|
+
this.logger.info('method [ngAfterViewInit] - END');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
filterChanged(_event: FilterChangedArgs) {
|
|
68
|
+
this.commonGridPag.processing = true;
|
|
69
|
+
this.updateGridData();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
paginationChanged(_event: PaginationChangedArgs) {
|
|
73
|
+
this.commonGridPag.processing = true;
|
|
74
|
+
this.updateGridData();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
sortChanged(_event: any) {
|
|
78
|
+
this.commonGridPag.processing = true;
|
|
79
|
+
this.updateGridData();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
updateGridData() {
|
|
83
|
+
this.currentUrl =
|
|
84
|
+
this.testurl +
|
|
85
|
+
'¤tPage=' +
|
|
86
|
+
this.commonGrid.currentPage +
|
|
87
|
+
'&selectedSort=' +
|
|
88
|
+
this.commonGrid.sortedGridColumn +
|
|
89
|
+
'&selectedFilter=' +
|
|
90
|
+
this.commonGrid.filteredGridColumns;
|
|
91
|
+
// Real HTTP call
|
|
92
|
+
/*this.httpClient.get(this.currentUrl).subscribe(
|
|
93
|
+
(data: any) => {
|
|
94
|
+
this.commonGrid.gridData = data.suspectManagement?data.suspectManagement.grid.rows:[];
|
|
95
|
+
this.commonGridPag.pageCount = data.suspectManagement?data.suspectManagement.singletons.maxpage:1;
|
|
96
|
+
this.commonGridPag.processing = false;
|
|
97
|
+
}
|
|
98
|
+
);*/
|
|
99
|
+
setTimeout(() => {
|
|
100
|
+
this.commonGrid.gridData = data_sample.pagination_samples.grid.rows;
|
|
101
|
+
this.commonGridPag.pageCount = data_sample.pagination_samples.grid.rows.maxpage;
|
|
102
|
+
}, 750);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const data_sample = {
|
|
107
|
+
pagination_samples: {
|
|
108
|
+
grid: {
|
|
109
|
+
metadata: {
|
|
110
|
+
columns: {
|
|
111
|
+
column: [
|
|
112
|
+
{
|
|
113
|
+
sort: true,
|
|
114
|
+
filterable: false,
|
|
115
|
+
width: 60,
|
|
116
|
+
dataelement: 'hasNote',
|
|
117
|
+
heading: 'Note',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
sort: true,
|
|
121
|
+
filterable: true,
|
|
122
|
+
width: 125,
|
|
123
|
+
dataelement: 'status',
|
|
124
|
+
heading: 'Status',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
sort: true,
|
|
128
|
+
visible: true,
|
|
129
|
+
filterable: true,
|
|
130
|
+
width: 125,
|
|
131
|
+
dataelement: 'currency',
|
|
132
|
+
heading: 'Currency',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
sort: true,
|
|
136
|
+
visible: true,
|
|
137
|
+
filterable: true,
|
|
138
|
+
width: 125,
|
|
139
|
+
dataelement: 'amount',
|
|
140
|
+
heading: 'Amount',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
sort: true,
|
|
144
|
+
visible: true,
|
|
145
|
+
filterable: true,
|
|
146
|
+
width: 125,
|
|
147
|
+
dataelement: 'inputDate',
|
|
148
|
+
heading: 'Input Date',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
sort: true,
|
|
152
|
+
visible: true,
|
|
153
|
+
filterable: true,
|
|
154
|
+
width: 125,
|
|
155
|
+
dataelement: 'inputTime',
|
|
156
|
+
heading: 'Input Time',
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
rows: {
|
|
162
|
+
row: [
|
|
163
|
+
{
|
|
164
|
+
currency: {
|
|
165
|
+
content: 'EUR',
|
|
166
|
+
},
|
|
167
|
+
amount: {
|
|
168
|
+
content: '2 203 677,000',
|
|
169
|
+
},
|
|
170
|
+
startTime: {
|
|
171
|
+
content: '06/19/2017 11:52:51',
|
|
172
|
+
},
|
|
173
|
+
inputDate: {
|
|
174
|
+
content: '06/19/2017',
|
|
175
|
+
},
|
|
176
|
+
status: {
|
|
177
|
+
content: 'New',
|
|
178
|
+
},
|
|
179
|
+
inputTime: {
|
|
180
|
+
content: '11:52:51',
|
|
181
|
+
},
|
|
182
|
+
hasNote: {
|
|
183
|
+
content: 'False',
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
currency: {
|
|
188
|
+
content: 'USD',
|
|
189
|
+
},
|
|
190
|
+
amount: {
|
|
191
|
+
content: '6 203 677,000',
|
|
192
|
+
},
|
|
193
|
+
startTime: {
|
|
194
|
+
content: '06/28/2017 10:42:00',
|
|
195
|
+
},
|
|
196
|
+
inputDate: {
|
|
197
|
+
content: '06/28/2017',
|
|
198
|
+
},
|
|
199
|
+
status: {
|
|
200
|
+
content: 'New',
|
|
201
|
+
},
|
|
202
|
+
inputTime: {
|
|
203
|
+
content: '10:40:12',
|
|
204
|
+
},
|
|
205
|
+
hasNote: {
|
|
206
|
+
content: 'True',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
maxpage: 5,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
};
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
2
|
+
/* eslint-disable @angular-eslint/no-output-on-prefix */
|
|
3
|
+
import { Component, OnInit, AfterViewInit, Input, EventEmitter, Output, ViewChild, ElementRef, Renderer2 } from '@angular/core';
|
|
4
|
+
import { HttpClient } from '@angular/common/http';
|
|
5
|
+
import type {
|
|
6
|
+
AngularGridInstance,
|
|
7
|
+
AngularSlickgridComponent,
|
|
8
|
+
Column,
|
|
9
|
+
GridOption,
|
|
10
|
+
BackendService,
|
|
11
|
+
BackendServiceOption,
|
|
12
|
+
FilterChangedArgs,
|
|
13
|
+
PaginationChangedArgs,
|
|
14
|
+
Pagination,
|
|
15
|
+
SlickDataView,
|
|
16
|
+
} from '../../library';
|
|
17
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
18
|
+
import { Logger } from './swt-logger.service';
|
|
19
|
+
import { SwtCommonGridPaginationComponent } from './swt-common-grid-pagination.component';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Custom wrapper of angular-slickgrid components, allows easily interacting with SwtCommonGridPaginationComponent
|
|
23
|
+
*
|
|
24
|
+
* @author Saber Chebka, saber.chebka@gmail.com
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
let timer: any;
|
|
28
|
+
const DEFAULT_FILTER_TYPING_DEBOUNCE = 750;
|
|
29
|
+
|
|
30
|
+
@Component({
|
|
31
|
+
selector: 'swt-common-grid',
|
|
32
|
+
template: `<angular-slickgrid
|
|
33
|
+
gridId="common-grid"
|
|
34
|
+
#angularSlickGrid
|
|
35
|
+
(onAngularGridCreated)="gridReady($event.detail)"
|
|
36
|
+
[columns]="columnDefinitions"
|
|
37
|
+
[options]="gridOptions"
|
|
38
|
+
[dataset]="dataset"
|
|
39
|
+
>
|
|
40
|
+
</angular-slickgrid>`,
|
|
41
|
+
styles: [
|
|
42
|
+
`
|
|
43
|
+
:host ::ng-deep .gridPane {
|
|
44
|
+
width: 100% !important;
|
|
45
|
+
}
|
|
46
|
+
:host ::ng-deep .slickgrid-container {
|
|
47
|
+
width: 100% !important;
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
],
|
|
51
|
+
standalone: false,
|
|
52
|
+
})
|
|
53
|
+
export class SwtCommonGridComponent implements OnInit, AfterViewInit, BackendService {
|
|
54
|
+
private logger: Logger;
|
|
55
|
+
private defaultPageSize = 20;
|
|
56
|
+
|
|
57
|
+
@Input() gridHeight = 100;
|
|
58
|
+
@Input() gridWidth = 600;
|
|
59
|
+
|
|
60
|
+
gridHeightString!: string;
|
|
61
|
+
gridWidthString!: string;
|
|
62
|
+
|
|
63
|
+
@ViewChild('angularSlickGrid', { static: true }) angularSlickGrid!: AngularSlickgridComponent;
|
|
64
|
+
|
|
65
|
+
columnDefinitions: Column[] = [];
|
|
66
|
+
dataset!: any[];
|
|
67
|
+
gridObj: any;
|
|
68
|
+
dataviewObj: any;
|
|
69
|
+
isAutoEdit = false;
|
|
70
|
+
updatedObject: any;
|
|
71
|
+
isMultiSelect = true;
|
|
72
|
+
selectedObjects!: any[];
|
|
73
|
+
selectedObject: any;
|
|
74
|
+
|
|
75
|
+
// Slick grid
|
|
76
|
+
metaData: any;
|
|
77
|
+
columnData: any;
|
|
78
|
+
rowsData: any;
|
|
79
|
+
selects: any;
|
|
80
|
+
id: any;
|
|
81
|
+
|
|
82
|
+
options!: BackendServiceOption;
|
|
83
|
+
pagination?: Pagination;
|
|
84
|
+
|
|
85
|
+
@Output() onFilterChanged: EventEmitter<FilterChangedArgs> = new EventEmitter<FilterChangedArgs>();
|
|
86
|
+
@Output() onPaginationChanged: EventEmitter<PaginationChangedArgs> = new EventEmitter<PaginationChangedArgs>();
|
|
87
|
+
@Output() onSortChanged: EventEmitter<any> = new EventEmitter<any>();
|
|
88
|
+
|
|
89
|
+
sortedGridColumn = '';
|
|
90
|
+
currentPage = 1;
|
|
91
|
+
filteredGridColumns = '';
|
|
92
|
+
|
|
93
|
+
// Data
|
|
94
|
+
|
|
95
|
+
// Injected functions
|
|
96
|
+
private _onRowDoubleClick: Function = new Function();
|
|
97
|
+
private _onRowClick: Function = new Function();
|
|
98
|
+
|
|
99
|
+
private _selectedRow: any;
|
|
100
|
+
|
|
101
|
+
gridOptions: GridOption = {
|
|
102
|
+
asyncEditorLoading: false,
|
|
103
|
+
autoEdit: this.isAutoEdit,
|
|
104
|
+
autoResize: {
|
|
105
|
+
container: '#common-grid-container',
|
|
106
|
+
rightPadding: 10,
|
|
107
|
+
},
|
|
108
|
+
gridHeight: 200,
|
|
109
|
+
enableColumnPicker: true,
|
|
110
|
+
enableCellNavigation: true,
|
|
111
|
+
enableRowSelection: true,
|
|
112
|
+
enableCheckboxSelector: false,
|
|
113
|
+
enableFiltering: true,
|
|
114
|
+
rowHeight: 23,
|
|
115
|
+
forceFitColumns: true,
|
|
116
|
+
enableAutoTooltip: true,
|
|
117
|
+
enableGridMenu: true,
|
|
118
|
+
enablePagination: false,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Initialized to a fake pagination object
|
|
122
|
+
private _paginationComponent: any = {
|
|
123
|
+
processing: false,
|
|
124
|
+
realPagination: false,
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
@Input()
|
|
128
|
+
set paginationComponent(value: SwtCommonGridPaginationComponent) {
|
|
129
|
+
this.logger!.info('method [pagination] - START, assigned datagrid pagination object: ', value.realPagination);
|
|
130
|
+
if (value.realPagination) {
|
|
131
|
+
this._paginationComponent = value;
|
|
132
|
+
this.gridOptions.backendServiceApi = {
|
|
133
|
+
service: this,
|
|
134
|
+
preProcess: () => {},
|
|
135
|
+
process: () => {
|
|
136
|
+
return null;
|
|
137
|
+
},
|
|
138
|
+
postProcess: () => {},
|
|
139
|
+
} as any;
|
|
140
|
+
this._paginationComponent.gridPaginationOptions = this.gridOptions;
|
|
141
|
+
this.angularSlickGrid.createBackendApiInternalPostProcessCallback(this.gridOptions);
|
|
142
|
+
}
|
|
143
|
+
this.logger!.info('method [pagination] - START');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
get paginationComponent(): SwtCommonGridPaginationComponent {
|
|
147
|
+
return this._paginationComponent;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @param gridService
|
|
153
|
+
* @param resizer
|
|
154
|
+
* @param httpClient
|
|
155
|
+
*/
|
|
156
|
+
constructor(
|
|
157
|
+
private httpClient: HttpClient,
|
|
158
|
+
private translate: TranslateService,
|
|
159
|
+
private el: ElementRef,
|
|
160
|
+
private renderer: Renderer2
|
|
161
|
+
) {
|
|
162
|
+
this.logger = new Logger('grid', httpClient);
|
|
163
|
+
|
|
164
|
+
this.logger.info('method [constructor] - START/END');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
*
|
|
169
|
+
*/
|
|
170
|
+
ngOnInit() {
|
|
171
|
+
this.logger.info('method [ngOnInit] - START/END');
|
|
172
|
+
// this.gridHeightString = `${this.gridHeight}px`;
|
|
173
|
+
// this.gridWidthString = `${this.gridWidth}px`;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
*/
|
|
179
|
+
ngAfterViewInit() {
|
|
180
|
+
this.logger.info('method [ngAfterViewInit] - START/END');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* CustomGrid constructor
|
|
185
|
+
* @param columnData
|
|
186
|
+
*/
|
|
187
|
+
CustomGrid(columnData: any) {
|
|
188
|
+
this.logger.info('method [CustomGrid] - START');
|
|
189
|
+
|
|
190
|
+
this.id = 'grid' + Math.floor(Math.random() * Math.floor(100));
|
|
191
|
+
|
|
192
|
+
// get metadata from input JSON
|
|
193
|
+
this.metaData = columnData;
|
|
194
|
+
|
|
195
|
+
// COLUMNS DATA
|
|
196
|
+
const rowData: any = [];
|
|
197
|
+
|
|
198
|
+
// check if allcolumns tag contains any children
|
|
199
|
+
if (this.metaData.columns.column) {
|
|
200
|
+
// set columnsData and columnDefinitions
|
|
201
|
+
this.columnData = this.metaData.columns.column;
|
|
202
|
+
|
|
203
|
+
for (const colData of this.columnData) {
|
|
204
|
+
const type = 'string';
|
|
205
|
+
const editor = null;
|
|
206
|
+
const formatter = null;
|
|
207
|
+
const filter = null;
|
|
208
|
+
const outputType = null;
|
|
209
|
+
const params = null;
|
|
210
|
+
|
|
211
|
+
const col: any = {
|
|
212
|
+
id: colData.dataelement,
|
|
213
|
+
name: colData.heading,
|
|
214
|
+
field: colData.dataelement,
|
|
215
|
+
sortable: colData.sort,
|
|
216
|
+
filterable: colData.filterable,
|
|
217
|
+
type,
|
|
218
|
+
editor,
|
|
219
|
+
formatter,
|
|
220
|
+
filter,
|
|
221
|
+
outputType,
|
|
222
|
+
params,
|
|
223
|
+
width: colData.width,
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
this.columnDefinitions.push(col);
|
|
227
|
+
rowData[col.id] = '';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Columns are not visible, seems to be a bug ? next line fixed it..
|
|
231
|
+
this.gridObj.setColumns(this.columnDefinitions);
|
|
232
|
+
this.angularSlickGrid.showPagination = false;
|
|
233
|
+
|
|
234
|
+
// Show filters when grid starts; this could be parametrized
|
|
235
|
+
// this.gridObj.setHeaderRowVisibility(false);
|
|
236
|
+
// this.gridObj.setTopPanelVisibility(false);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Dummy dataset
|
|
240
|
+
this.dataset = rowData;
|
|
241
|
+
|
|
242
|
+
this.logger.info('method [CustomGrid] - END, this.columnDefinitions=', this.columnDefinitions);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* CommonGrid constructor
|
|
247
|
+
* @param _columnsData
|
|
248
|
+
* @param _lockedColumnCount
|
|
249
|
+
* @param _uniqueColumn
|
|
250
|
+
* @param _baseURL
|
|
251
|
+
* @param _programId
|
|
252
|
+
* @param _componentId
|
|
253
|
+
* @param _enableRenders
|
|
254
|
+
* @param _colValidationMap
|
|
255
|
+
* @param _checkHeader
|
|
256
|
+
* @param _cboLinked
|
|
257
|
+
*/
|
|
258
|
+
CommonGrid(
|
|
259
|
+
_columnsData: any,
|
|
260
|
+
_lockedColumnCount: number,
|
|
261
|
+
_uniqueColumn: string,
|
|
262
|
+
_baseURL: string,
|
|
263
|
+
_programId: string,
|
|
264
|
+
_componentId: string,
|
|
265
|
+
_enableRenders = true,
|
|
266
|
+
_colValidationMap = null,
|
|
267
|
+
_checkHeader = false,
|
|
268
|
+
_cboLinked = false
|
|
269
|
+
) {}
|
|
270
|
+
|
|
271
|
+
set gridData(rawData: any) {
|
|
272
|
+
this.logger.info('method [gridData] - START');
|
|
273
|
+
const dataProvider: any = [];
|
|
274
|
+
|
|
275
|
+
for (let index = 0; rawData.row && index < rawData.row.length; index++) {
|
|
276
|
+
const row = rawData.row[index] as object;
|
|
277
|
+
const idObj = {
|
|
278
|
+
id: index,
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
let key: string;
|
|
282
|
+
const rowData: any = [];
|
|
283
|
+
for (key in row) {
|
|
284
|
+
if (key in row) {
|
|
285
|
+
rowData[key] = (row as any)[key].content;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
dataProvider[index] = Object.assign(rowData, idObj);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
this.dataset = dataProvider;
|
|
292
|
+
this.paginationComponent.processing = false;
|
|
293
|
+
this.logger.info('method [gridData] - END, all data size=' + (rawData && 'size' in rawData ? rawData.size : 0));
|
|
294
|
+
|
|
295
|
+
// this.gridObj.setSortColumn('excludeType', true);
|
|
296
|
+
// this.dataviewObj.reSort();
|
|
297
|
+
// this.gridObj.setSortColumns([{'columnId':'excludeType','sortAsc':true}]);
|
|
298
|
+
|
|
299
|
+
// this.gridObj.invalidate();
|
|
300
|
+
// this.gridObj.render();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
get gridData(): any {
|
|
304
|
+
return this.dataset;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
gridReady(instance: AngularGridInstance) {
|
|
308
|
+
this.logger.info('method [gridReady] - START');
|
|
309
|
+
this.gridObj = instance.slickGrid;
|
|
310
|
+
this.dataviewObj = instance.dataView;
|
|
311
|
+
this.logger.info('method [gridReady] - END');
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
dataviewReady(dataview: SlickDataView) {
|
|
315
|
+
this.logger.info('method [dataviewReady] - START/END', dataview);
|
|
316
|
+
this.dataviewObj = dataview;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/********************************************************/
|
|
320
|
+
/******** Pagination+Sot+Filter service : START *********/
|
|
321
|
+
/********************************************************/
|
|
322
|
+
buildQuery(): string {
|
|
323
|
+
return 'buildQuery...';
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
init(serviceOptions: BackendServiceOption, pagination?: Pagination): void {
|
|
327
|
+
this.options = serviceOptions;
|
|
328
|
+
this.pagination = pagination;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
resetPaginationOptions() {}
|
|
332
|
+
|
|
333
|
+
updateOptions(serviceOptions?: Partial<BackendServiceOption>) {
|
|
334
|
+
this.options = { ...this.options, ...serviceOptions };
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* FILTERING EMIT EVENT
|
|
339
|
+
* @param event
|
|
340
|
+
* @param args
|
|
341
|
+
*/
|
|
342
|
+
processOnFilterChanged(event: Event | undefined, args: FilterChangedArgs): string {
|
|
343
|
+
this.logger.info('method [onFilterChanged] - START', args);
|
|
344
|
+
this.filteredGridColumns = '';
|
|
345
|
+
let timing = 0;
|
|
346
|
+
if (event && (event.type === 'keyup' || event.type === 'keydown')) {
|
|
347
|
+
timing = DEFAULT_FILTER_TYPING_DEBOUNCE;
|
|
348
|
+
clearTimeout(timer);
|
|
349
|
+
}
|
|
350
|
+
timer = setTimeout(() => {
|
|
351
|
+
this.filteredGridColumns = '';
|
|
352
|
+
for (const column of this.columnDefinitions) {
|
|
353
|
+
if (column.field in args.columnFilters) {
|
|
354
|
+
this.filteredGridColumns += args.columnFilters[column.field].searchTerms[0] + '|';
|
|
355
|
+
} else {
|
|
356
|
+
this.filteredGridColumns += 'All|';
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Reset to the first page
|
|
361
|
+
this.paginationComponent.pageNumber = 1;
|
|
362
|
+
this.currentPage = 1;
|
|
363
|
+
|
|
364
|
+
// dispatch event
|
|
365
|
+
this.onFilterChanged.emit(args);
|
|
366
|
+
this.logger.info('method [onFilterChanged] - onFilterChanged.emit(args) performed, filteredGridColumns=' + this.filteredGridColumns);
|
|
367
|
+
}, timing);
|
|
368
|
+
|
|
369
|
+
this.logger.info('method [onFilterChanged] - END');
|
|
370
|
+
return '';
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* PAGINATION EMIT EVENT
|
|
375
|
+
* @param _event
|
|
376
|
+
* @param args
|
|
377
|
+
*/
|
|
378
|
+
processOnPaginationChanged(_event: Event | undefined, args: PaginationChangedArgs) {
|
|
379
|
+
this.logger.info('method [onPaginationChanged] - START');
|
|
380
|
+
this.currentPage = args.newPage;
|
|
381
|
+
this.onPaginationChanged.emit(args);
|
|
382
|
+
this.logger.info('method [onPaginationChanged] - END, currentPage=' + this.currentPage);
|
|
383
|
+
return 'onPaginationChanged';
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* SORT EMIT EVENT
|
|
388
|
+
* @param _event
|
|
389
|
+
* @param args
|
|
390
|
+
*/
|
|
391
|
+
processOnSortChanged(_event: Event | undefined, args: any) {
|
|
392
|
+
this.logger.info('method [onSortChanged] - START');
|
|
393
|
+
this.sortedGridColumn = '';
|
|
394
|
+
const sortDirection = '|' + args!.sortCols![0].sortAsc + '|';
|
|
395
|
+
for (let idx = 0; idx < this.columnDefinitions.length; idx++) {
|
|
396
|
+
if (this.columnDefinitions[idx].field === args!.sortCols![0].sortCol.field) {
|
|
397
|
+
this.sortedGridColumn = '' + idx + sortDirection;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
this.onSortChanged.emit(args);
|
|
401
|
+
this.logger.info('method [onSortChanged] - END, sortedGridColumn=' + this.sortedGridColumn);
|
|
402
|
+
return 'onSortChanged';
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
getFilteredGridColumns() {
|
|
406
|
+
return this.filteredGridColumns;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
getSortedGridColumn() {
|
|
410
|
+
return this.sortedGridColumn;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/******** Pagination+Sot+Filter service: END *****************/
|
|
414
|
+
|
|
415
|
+
// Getters and Setters
|
|
416
|
+
get selectedRow() {
|
|
417
|
+
return this._selectedRow;
|
|
418
|
+
}
|
|
419
|
+
set selectedRow(row: any) {
|
|
420
|
+
this._selectedRow = row;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
get onRowDoubleClick() {
|
|
424
|
+
return this._onRowDoubleClick;
|
|
425
|
+
}
|
|
426
|
+
set onRowDoubleClick(event: Function) {
|
|
427
|
+
this._onRowDoubleClick = event;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
get onRowClick() {
|
|
431
|
+
return this._onRowClick;
|
|
432
|
+
}
|
|
433
|
+
set onRowClick(event: Function) {
|
|
434
|
+
this._onRowClick = event;
|
|
435
|
+
}
|
|
436
|
+
}
|