angular-slickgrid 9.0.0 → 9.0.2
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/LICENSE +1 -1
- package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs +16 -16
- package/package.json +27 -14
- package/.gitbook.yaml +0 -5
- package/CHANGELOG.md +0 -1691
- package/CONTRIBUTING.md +0 -17
- package/angular.json +0 -133
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -1620
- package/coverage/coverage-final.json +0 -9
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -176
- package/coverage/library/components/angular-slickgrid.component.ts.html +0 -5074
- package/coverage/library/components/index.html +0 -116
- package/coverage/library/constants.ts.html +0 -397
- package/coverage/library/extensions/index.html +0 -116
- package/coverage/library/extensions/slickRowDetailView.ts.html +0 -1261
- package/coverage/library/index.html +0 -116
- package/coverage/library/modules/angular-slickgrid.module.ts.html +0 -166
- package/coverage/library/modules/index.html +0 -116
- package/coverage/library/services/angularUtil.service.ts.html +0 -445
- package/coverage/library/services/container.service.ts.html +0 -163
- package/coverage/library/services/index.html +0 -161
- package/coverage/library/services/translater.service.ts.html +0 -199
- package/coverage/library/services/utilities.ts.html +0 -142
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -142
- package/docs/README.md +0 -5
- package/docs/TOC.md +0 -105
- package/docs/backend-services/Custom-Backend-Service.md +0 -50
- package/docs/backend-services/GraphQL.md +0 -276
- package/docs/backend-services/OData.md +0 -245
- package/docs/backend-services/graphql/GraphQL-Filtering.md +0 -156
- package/docs/backend-services/graphql/GraphQL-JSON-Result.md +0 -85
- package/docs/backend-services/graphql/GraphQL-Pagination.md +0 -77
- package/docs/backend-services/graphql/GraphQL-Sorting.md +0 -78
- package/docs/column-functionalities/cell-menu.md +0 -212
- package/docs/column-functionalities/editors/autocomplete-editor.md +0 -466
- package/docs/column-functionalities/editors/date-editor-flatpickr.md +0 -71
- package/docs/column-functionalities/editors/date-editor-vanilla-calendar.md +0 -91
- package/docs/column-functionalities/editors/longtext-editor-textarea.md +0 -80
- package/docs/column-functionalities/editors/select-dropdown-editor.md +0 -227
- package/docs/column-functionalities/editors.md +0 -604
- package/docs/column-functionalities/filters/autocomplete-filter.md +0 -183
- package/docs/column-functionalities/filters/compound-filters.md +0 -234
- package/docs/column-functionalities/filters/custom-filter.md +0 -117
- package/docs/column-functionalities/filters/filter-intro.md +0 -81
- package/docs/column-functionalities/filters/input-filter.md +0 -260
- package/docs/column-functionalities/filters/range-filters.md +0 -188
- package/docs/column-functionalities/filters/select-filter.md +0 -695
- package/docs/column-functionalities/filters/single-search-filter.md +0 -77
- package/docs/column-functionalities/filters/styling-filled-filters.md +0 -45
- package/docs/column-functionalities/formatters.md +0 -325
- package/docs/column-functionalities/sorting.md +0 -200
- package/docs/developer-guides/csp-compliance.md +0 -64
- package/docs/events/Available-Events.md +0 -223
- package/docs/events/Grid-&-DataView-Events.md +0 -211
- package/docs/getting-started/quick-start.md +0 -230
- package/docs/getting-started/troubleshooting.md +0 -80
- package/docs/grid-functionalities/Column-Picker.md +0 -22
- package/docs/grid-functionalities/Composite-Editor-Modal.md +0 -627
- package/docs/grid-functionalities/Context-Menu.md +0 -226
- package/docs/grid-functionalities/Custom-Footer.md +0 -80
- package/docs/grid-functionalities/Custom-Tooltip-(plugin).md +0 -258
- package/docs/grid-functionalities/Export-to-Excel.md +0 -457
- package/docs/grid-functionalities/Export-to-Text-File.md +0 -165
- package/docs/grid-functionalities/FAQ.md +0 -53
- package/docs/grid-functionalities/Global-Options.md +0 -29
- package/docs/grid-functionalities/Grid-Auto-Resize.md +0 -218
- package/docs/grid-functionalities/Grid-Menu.md +0 -134
- package/docs/grid-functionalities/Grid-State-&-Preset.md +0 -245
- package/docs/grid-functionalities/Header-Menu-&-Header-Buttons.md +0 -125
- package/docs/grid-functionalities/Resize-by-Cell-Content.md +0 -138
- package/docs/grid-functionalities/Row-Selection.md +0 -247
- package/docs/grid-functionalities/Row-based-edit.md +0 -71
- package/docs/grid-functionalities/add-update-highlight.md +0 -258
- package/docs/grid-functionalities/column-row-spanning.md +0 -74
- package/docs/grid-functionalities/dynamic-item-metadata.md +0 -124
- package/docs/grid-functionalities/excel-copy-buffer.md +0 -145
- package/docs/grid-functionalities/frozen-columns-rows.md +0 -164
- package/docs/grid-functionalities/grouping-and-aggregators.md +0 -269
- package/docs/grid-functionalities/header-footer-slots.md +0 -22
- package/docs/grid-functionalities/infinite-scroll.md +0 -150
- package/docs/grid-functionalities/providing-grid-data.md +0 -61
- package/docs/grid-functionalities/row-detail.md +0 -530
- package/docs/grid-functionalities/tree-data-grid.md +0 -391
- package/docs/localization/Localization---Component-Sample.md +0 -87
- package/docs/localization/Localization-with-Custom-Locales.md +0 -66
- package/docs/localization/Localization-with-ngx-translate.md +0 -148
- package/docs/migrations/migration-to-2.x.md +0 -304
- package/docs/migrations/migration-to-3.x.md +0 -295
- package/docs/migrations/migration-to-4.x.md +0 -83
- package/docs/migrations/migration-to-5.x.md +0 -160
- package/docs/migrations/migration-to-6.x.md +0 -128
- package/docs/migrations/migration-to-7.x.md +0 -294
- package/docs/migrations/migration-to-8.x.md +0 -316
- package/docs/migrations/migration-to-9.x.md +0 -219
- package/docs/slick-grid-dataview-objects/slickgrid-dataview-objects.md +0 -79
- package/docs/styling/dark-mode.md +0 -100
- package/docs/styling/styling.md +0 -250
- package/docs/testing/testing-patterns.md +0 -73
- package/eslint.config.mjs +0 -60
- package/ng-package.json +0 -10
- package/src/assets/angular-logo.png +0 -0
- package/src/assets/angular-logo2.png +0 -0
- package/src/assets/data/collection_100_numbers.json +0 -12
- package/src/assets/data/collection_500_numbers.json +0 -52
- package/src/assets/data/countries.json +0 -245
- package/src/assets/data/country_names.json +0 -245
- package/src/assets/data/customers_100.json +0 -102
- package/src/assets/data/users.csv +0 -5
- package/src/assets/i18n/en.json +0 -102
- package/src/assets/i18n/fr.json +0 -103
- package/src/demos/app-routing.module.ts +0 -108
- package/src/demos/app.component.html +0 -187
- package/src/demos/app.component.scss +0 -79
- package/src/demos/app.component.ts +0 -11
- package/src/demos/app.module.ts +0 -196
- package/src/demos/environments/environment.dev.ts +0 -3
- package/src/demos/environments/environment.prod.ts +0 -3
- package/src/demos/environments/environment.ts +0 -8
- package/src/demos/examples/custom-angularComponentEditor.ts +0 -187
- package/src/demos/examples/custom-angularComponentFilter.ts +0 -123
- package/src/demos/examples/custom-buttonFormatter.component.ts +0 -13
- package/src/demos/examples/custom-inputEditor.ts +0 -132
- package/src/demos/examples/custom-inputFilter.ts +0 -134
- package/src/demos/examples/custom-titleFormatter.component.ts +0 -9
- package/src/demos/examples/data/collection_100_numbers.json +0 -12
- package/src/demos/examples/data/collection_500_numbers.json +0 -52
- package/src/demos/examples/data/countries.json +0 -245
- package/src/demos/examples/data/country_names.json +0 -245
- package/src/demos/examples/data/customers_100.json +0 -102
- package/src/demos/examples/data/users.csv +0 -5
- package/src/demos/examples/editor-ng-select.component.ts +0 -38
- package/src/demos/examples/example01.component.html +0 -48
- package/src/demos/examples/example01.component.ts +0 -109
- package/src/demos/examples/example02.component.html +0 -45
- package/src/demos/examples/example02.component.ts +0 -218
- package/src/demos/examples/example03.component.html +0 -118
- package/src/demos/examples/example03.component.ts +0 -694
- package/src/demos/examples/example04.component.html +0 -87
- package/src/demos/examples/example04.component.ts +0 -326
- package/src/demos/examples/example05.component.html +0 -151
- package/src/demos/examples/example05.component.ts +0 -474
- package/src/demos/examples/example06.component.html +0 -163
- package/src/demos/examples/example06.component.ts +0 -446
- package/src/demos/examples/example07.component.html +0 -56
- package/src/demos/examples/example07.component.scss +0 -10
- package/src/demos/examples/example07.component.ts +0 -216
- package/src/demos/examples/example08.component.html +0 -51
- package/src/demos/examples/example08.component.scss +0 -23
- package/src/demos/examples/example08.component.ts +0 -195
- package/src/demos/examples/example09.component.html +0 -55
- package/src/demos/examples/example09.component.scss +0 -22
- package/src/demos/examples/example09.component.ts +0 -302
- package/src/demos/examples/example10.component.html +0 -103
- package/src/demos/examples/example10.component.ts +0 -309
- package/src/demos/examples/example11.component.html +0 -91
- package/src/demos/examples/example11.component.ts +0 -276
- package/src/demos/examples/example12.component.html +0 -98
- package/src/demos/examples/example12.component.ts +0 -317
- package/src/demos/examples/example13.component.html +0 -96
- package/src/demos/examples/example13.component.ts +0 -370
- package/src/demos/examples/example14.component.html +0 -50
- package/src/demos/examples/example14.component.scss +0 -11
- package/src/demos/examples/example14.component.ts +0 -156
- package/src/demos/examples/example15.component.html +0 -56
- package/src/demos/examples/example15.component.ts +0 -304
- package/src/demos/examples/example16.component.html +0 -77
- package/src/demos/examples/example16.component.ts +0 -277
- package/src/demos/examples/example17.component.html +0 -50
- package/src/demos/examples/example17.component.ts +0 -109
- package/src/demos/examples/example18.component.html +0 -132
- package/src/demos/examples/example18.component.ts +0 -445
- package/src/demos/examples/example19-rowdetail.component.html +0 -40
- package/src/demos/examples/example19-rowdetail.component.ts +0 -54
- package/src/demos/examples/example19.component.html +0 -79
- package/src/demos/examples/example19.component.ts +0 -316
- package/src/demos/examples/example20.component.html +0 -76
- package/src/demos/examples/example20.component.scss +0 -11
- package/src/demos/examples/example20.component.ts +0 -341
- package/src/demos/examples/example21.component.html +0 -86
- package/src/demos/examples/example21.component.scss +0 -16
- package/src/demos/examples/example21.component.ts +0 -140
- package/src/demos/examples/example22.component.html +0 -41
- package/src/demos/examples/example22.component.ts +0 -117
- package/src/demos/examples/example23.component.html +0 -111
- package/src/demos/examples/example23.component.ts +0 -323
- package/src/demos/examples/example24.component.html +0 -120
- package/src/demos/examples/example24.component.scss +0 -62
- package/src/demos/examples/example24.component.ts +0 -641
- package/src/demos/examples/example25.component.html +0 -60
- package/src/demos/examples/example25.component.scss +0 -8
- package/src/demos/examples/example25.component.ts +0 -255
- package/src/demos/examples/example26.component.html +0 -98
- package/src/demos/examples/example26.component.scss +0 -42
- package/src/demos/examples/example26.component.ts +0 -383
- package/src/demos/examples/example27.component.html +0 -138
- package/src/demos/examples/example27.component.scss +0 -10
- package/src/demos/examples/example27.component.ts +0 -369
- package/src/demos/examples/example28.component.html +0 -143
- package/src/demos/examples/example28.component.scss +0 -54
- package/src/demos/examples/example28.component.ts +0 -453
- package/src/demos/examples/example29.component.html +0 -30
- package/src/demos/examples/example29.component.ts +0 -70
- package/src/demos/examples/example30.component.html +0 -116
- package/src/demos/examples/example30.component.scss +0 -20
- package/src/demos/examples/example30.component.ts +0 -1070
- package/src/demos/examples/example32.component.html +0 -77
- package/src/demos/examples/example32.component.scss +0 -8
- package/src/demos/examples/example32.component.ts +0 -905
- package/src/demos/examples/example33.component.html +0 -50
- package/src/demos/examples/example33.component.scss +0 -46
- package/src/demos/examples/example33.component.ts +0 -571
- package/src/demos/examples/example34.component.html +0 -82
- package/src/demos/examples/example34.component.scss +0 -77
- package/src/demos/examples/example34.component.ts +0 -434
- package/src/demos/examples/example35.component.html +0 -77
- package/src/demos/examples/example35.component.scss +0 -18
- package/src/demos/examples/example35.component.ts +0 -264
- package/src/demos/examples/example36.component.html +0 -56
- package/src/demos/examples/example36.component.scss +0 -26
- package/src/demos/examples/example36.component.ts +0 -504
- package/src/demos/examples/example37.component.html +0 -30
- package/src/demos/examples/example37.component.ts +0 -123
- package/src/demos/examples/example38.component.html +0 -104
- package/src/demos/examples/example38.component.scss +0 -8
- package/src/demos/examples/example38.component.ts +0 -420
- package/src/demos/examples/example39.component.html +0 -112
- package/src/demos/examples/example39.component.scss +0 -8
- package/src/demos/examples/example39.component.ts +0 -371
- package/src/demos/examples/example40.component.html +0 -76
- package/src/demos/examples/example40.component.ts +0 -226
- package/src/demos/examples/example41.component.html +0 -50
- package/src/demos/examples/example41.component.scss +0 -42
- package/src/demos/examples/example41.component.ts +0 -229
- package/src/demos/examples/example42.component.html +0 -47
- package/src/demos/examples/example42.component.ts +0 -203
- package/src/demos/examples/example43.component.html +0 -94
- package/src/demos/examples/example43.component.scss +0 -30
- package/src/demos/examples/example43.component.ts +0 -449
- package/src/demos/examples/example44.component.html +0 -78
- package/src/demos/examples/example44.component.scss +0 -50
- package/src/demos/examples/example44.component.ts +0 -375
- package/src/demos/examples/example45-detail.component.html +0 -15
- package/src/demos/examples/example45-detail.component.ts +0 -97
- package/src/demos/examples/example45.component.html +0 -110
- package/src/demos/examples/example45.component.scss +0 -50
- package/src/demos/examples/example45.component.ts +0 -243
- package/src/demos/examples/filter-ng-select.component.ts +0 -33
- package/src/demos/examples/grid-custom-pager.component.html +0 -60
- package/src/demos/examples/grid-custom-pager.component.scss +0 -57
- package/src/demos/examples/grid-custom-pager.component.ts +0 -107
- package/src/demos/examples/grid-remote.component.html +0 -44
- package/src/demos/examples/grid-remote.component.ts +0 -164
- package/src/demos/examples/home.component.html +0 -39
- package/src/demos/examples/home.component.ts +0 -10
- package/src/demos/examples/jsonp.ts +0 -89
- package/src/demos/examples/rowdetail-preload.component.ts +0 -10
- package/src/demos/examples/swt-common-grid-pagination.component.ts +0 -160
- package/src/demos/examples/swt-common-grid-test.component.html +0 -37
- package/src/demos/examples/swt-common-grid-test.component.ts +0 -214
- package/src/demos/examples/swt-common-grid.component.ts +0 -436
- package/src/demos/examples/swt-logger.service.ts +0 -173
- package/src/demos/examples/utilities.ts +0 -9
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -17
- package/src/library/components/__tests__/angular-slickgrid.component.spec.ts +0 -2638
- package/src/library/components/angular-slickgrid.component.html +0 -5
- package/src/library/components/angular-slickgrid.component.ts +0 -1662
- package/src/library/constants.ts +0 -105
- package/src/library/extensions/__tests__/slickRowDetailView.spec.ts +0 -751
- package/src/library/extensions/index.ts +0 -1
- package/src/library/extensions/slickRowDetailView.ts +0 -395
- package/src/library/global-grid-options.ts +0 -273
- package/src/library/index.ts +0 -11
- package/src/library/models/angularComponentOutput.interface.ts +0 -6
- package/src/library/models/angularGridInstance.interface.ts +0 -76
- package/src/library/models/externalTestingDependencies.interface.ts +0 -37
- package/src/library/models/gridOption.interface.ts +0 -15
- package/src/library/models/index.ts +0 -5
- package/src/library/models/rowDetailView.interface.ts +0 -16
- package/src/library/modules/angular-slickgrid.module.spec.ts +0 -25
- package/src/library/modules/angular-slickgrid.module.ts +0 -27
- package/src/library/services/__tests__/angularUtilService.spec.ts +0 -156
- package/src/library/services/__tests__/container.service.spec.ts +0 -25
- package/src/library/services/__tests__/translater.service.spec.ts +0 -43
- package/src/library/services/__tests__/utilities.spec.ts +0 -22
- package/src/library/services/angularUtil.service.ts +0 -120
- package/src/library/services/container.service.ts +0 -26
- package/src/library/services/index.ts +0 -4
- package/src/library/services/translater.service.ts +0 -38
- package/src/library/services/utilities.ts +0 -19
- package/src/library/slickgrid-config.ts +0 -10
- package/src/main.ts +0 -13
- package/src/public_api.ts +0 -1
- package/src/styles.scss +0 -178
- package/test/cypress/e2e/example01.cy.ts +0 -367
- package/test/cypress/e2e/example02.cy.ts +0 -60
- package/test/cypress/e2e/example03.cy.ts +0 -268
- package/test/cypress/e2e/example04.cy.ts +0 -254
- package/test/cypress/e2e/example05.cy.ts +0 -804
- package/test/cypress/e2e/example06.cy.ts +0 -890
- package/test/cypress/e2e/example07.cy.ts +0 -384
- package/test/cypress/e2e/example08.cy.ts +0 -190
- package/test/cypress/e2e/example09.cy.ts +0 -392
- package/test/cypress/e2e/example10.cy.ts +0 -650
- package/test/cypress/e2e/example11.cy.ts +0 -86
- package/test/cypress/e2e/example12.cy.ts +0 -269
- package/test/cypress/e2e/example13.cy.ts +0 -246
- package/test/cypress/e2e/example14.cy.ts +0 -122
- package/test/cypress/e2e/example15.cy.ts +0 -598
- package/test/cypress/e2e/example16.cy.ts +0 -427
- package/test/cypress/e2e/example17.cy.ts +0 -83
- package/test/cypress/e2e/example18.cy.ts +0 -431
- package/test/cypress/e2e/example19.cy.ts +0 -263
- package/test/cypress/e2e/example20.cy.ts +0 -264
- package/test/cypress/e2e/example21.cy.ts +0 -77
- package/test/cypress/e2e/example22.cy.ts +0 -94
- package/test/cypress/e2e/example23.cy.ts +0 -259
- package/test/cypress/e2e/example24.cy.ts +0 -707
- package/test/cypress/e2e/example25.cy.ts +0 -193
- package/test/cypress/e2e/example26.cy.ts +0 -111
- package/test/cypress/e2e/example27.cy.ts +0 -261
- package/test/cypress/e2e/example28.cy.ts +0 -740
- package/test/cypress/e2e/example29.cy.ts +0 -30
- package/test/cypress/e2e/example30.cy.ts +0 -757
- package/test/cypress/e2e/example31.cy.ts +0 -69
- package/test/cypress/e2e/example32.cy.ts +0 -272
- package/test/cypress/e2e/example33.cy.ts +0 -278
- package/test/cypress/e2e/example34.cy.ts +0 -84
- package/test/cypress/e2e/example35.cy.ts +0 -178
- package/test/cypress/e2e/example36.cy.ts +0 -219
- package/test/cypress/e2e/example37.cy.ts +0 -52
- package/test/cypress/e2e/example38.cy.ts +0 -160
- package/test/cypress/e2e/example39.cy.ts +0 -150
- package/test/cypress/e2e/example40.cy.ts +0 -126
- package/test/cypress/e2e/example41.cy.ts +0 -90
- package/test/cypress/e2e/example42.cy.ts +0 -82
- package/test/cypress/e2e/example43.cy.ts +0 -482
- package/test/cypress/e2e/example44.cy.ts +0 -458
- package/test/cypress/e2e/example45.cy.ts +0 -455
- package/test/cypress/e2e/home.cy.ts +0 -7
- package/test/cypress/fixtures/example.json +0 -5
- package/test/cypress/plugins/index.ts +0 -17
- package/test/cypress/plugins/utilities.ts +0 -28
- package/test/cypress/support/commands.ts +0 -88
- package/test/cypress/support/common.ts +0 -47
- package/test/cypress/support/drag.ts +0 -101
- package/test/cypress/support/index.ts +0 -20
- package/test/cypress/tsconfig.json +0 -9
- package/test/cypress.config.ts +0 -34
- package/test/mockSlickEvent.ts +0 -77
- package/test/rxjsResourceStub.ts +0 -69
- package/test/test-setup.ts +0 -6
- package/test/translateServiceStub.ts +0 -230
- package/test/translaterServiceStub.ts +0 -239
- package/test/tsconfig.json +0 -17
- package/test/vitest-global-mocks.ts +0 -41
- package/test/vitest-global-setup.ts +0 -3
- package/test/vitest-pretest.ts +0 -5
- package/tsconfig.app.json +0 -14
- package/tsconfig.json +0 -31
- package/tsconfig.spec.json +0 -11
- package/types/sortablejs.d.ts +0 -4
- package/vite.config.mts +0 -51
- /package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs.map +0 -0
- /package/{dist/i18n → i18n}/en.json +0 -0
- /package/{dist/i18n → i18n}/fr.json +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/library → library}/components/angular-slickgrid.component.d.ts +0 -0
- /package/{dist/library → library}/constants.d.ts +0 -0
- /package/{dist/library → library}/extensions/index.d.ts +0 -0
- /package/{dist/library → library}/extensions/slickRowDetailView.d.ts +0 -0
- /package/{dist/library → library}/global-grid-options.d.ts +0 -0
- /package/{dist/library → library}/index.d.ts +0 -0
- /package/{dist/library → library}/models/angularComponentOutput.interface.d.ts +0 -0
- /package/{dist/library → library}/models/angularGridInstance.interface.d.ts +0 -0
- /package/{dist/library → library}/models/externalTestingDependencies.interface.d.ts +0 -0
- /package/{dist/library → library}/models/gridOption.interface.d.ts +0 -0
- /package/{dist/library → library}/models/index.d.ts +0 -0
- /package/{dist/library → library}/models/rowDetailView.interface.d.ts +0 -0
- /package/{dist/library → library}/modules/angular-slickgrid.module.d.ts +0 -0
- /package/{dist/library → library}/services/angularUtil.service.d.ts +0 -0
- /package/{dist/library → library}/services/container.service.d.ts +0 -0
- /package/{dist/library → library}/services/index.d.ts +0 -0
- /package/{dist/library → library}/services/translater.service.d.ts +0 -0
- /package/{dist/library → library}/services/utilities.d.ts +0 -0
- /package/{dist/library → library}/slickgrid-config.d.ts +0 -0
- /package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
|
@@ -1,214 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,436 +0,0 @@
|
|
|
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
|
-
}
|