angular-slickgrid 8.14.0 → 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 +175 -198
- 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 -301
- 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,370 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { ExcelExportService } from '@slickgrid-universal/excel-export';
|
|
3
|
+
import { TextExportService } from '@slickgrid-universal/text-export';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
AngularGridInstance,
|
|
7
|
+
Aggregators,
|
|
8
|
+
Column,
|
|
9
|
+
DelimiterType,
|
|
10
|
+
Filters,
|
|
11
|
+
Formatters,
|
|
12
|
+
GridOption,
|
|
13
|
+
Grouping,
|
|
14
|
+
GroupTotalFormatters,
|
|
15
|
+
SortDirectionNumber,
|
|
16
|
+
SortComparers,
|
|
17
|
+
} from '../../library';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
templateUrl: './example13.component.html',
|
|
21
|
+
standalone: false,
|
|
22
|
+
})
|
|
23
|
+
export class Example13Component implements OnInit {
|
|
24
|
+
angularGrid!: AngularGridInstance;
|
|
25
|
+
columnDefinitions!: Column[];
|
|
26
|
+
gridOptions!: GridOption;
|
|
27
|
+
dataset!: any[];
|
|
28
|
+
gridObj: any;
|
|
29
|
+
dataviewObj: any;
|
|
30
|
+
processing = false;
|
|
31
|
+
excelExportService = new ExcelExportService();
|
|
32
|
+
textExportService = new TextExportService();
|
|
33
|
+
|
|
34
|
+
ngOnInit(): void {
|
|
35
|
+
this.initializeGrid();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
initializeGrid() {
|
|
39
|
+
// add a simple button with event listener on 1st column for testing purposes
|
|
40
|
+
// a simple button with click event
|
|
41
|
+
const nameElementColumn1 = document.createElement('div');
|
|
42
|
+
const btn = document.createElement('button');
|
|
43
|
+
const btnLabel = document.createElement('span');
|
|
44
|
+
btnLabel.className = 'mdi mdi-help-circle no-padding';
|
|
45
|
+
btn.dataset.test = 'col1-hello-btn';
|
|
46
|
+
btn.className = 'btn btn-outline-secondary btn-xs btn-icon ms-1';
|
|
47
|
+
btn.textContent = 'Click me';
|
|
48
|
+
btn.title = 'simple column header test with a button click listener';
|
|
49
|
+
btn.addEventListener('click', () => alert('Hello World'));
|
|
50
|
+
btn.appendChild(btnLabel);
|
|
51
|
+
nameElementColumn1.appendChild(document.createTextNode('Id '));
|
|
52
|
+
nameElementColumn1.appendChild(btn);
|
|
53
|
+
|
|
54
|
+
this.columnDefinitions = [
|
|
55
|
+
{
|
|
56
|
+
id: 'sel',
|
|
57
|
+
name: nameElementColumn1,
|
|
58
|
+
field: 'num',
|
|
59
|
+
type: 'number',
|
|
60
|
+
columnPickerLabel: 'Custom Label', // add a custom label for the ColumnPicker/GridMenu when default header value extractor doesn't work for you ()
|
|
61
|
+
width: 140,
|
|
62
|
+
maxWidth: 150,
|
|
63
|
+
excludeFromExport: true,
|
|
64
|
+
resizable: true,
|
|
65
|
+
filterable: true,
|
|
66
|
+
selectable: false,
|
|
67
|
+
focusable: false,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'title',
|
|
71
|
+
name: 'Title',
|
|
72
|
+
field: 'title',
|
|
73
|
+
width: 50,
|
|
74
|
+
minWidth: 50,
|
|
75
|
+
cssClass: 'cell-title',
|
|
76
|
+
filterable: true,
|
|
77
|
+
sortable: true,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'duration',
|
|
81
|
+
name: 'Duration',
|
|
82
|
+
field: 'duration',
|
|
83
|
+
minWidth: 50,
|
|
84
|
+
width: 60,
|
|
85
|
+
filterable: true,
|
|
86
|
+
filter: { model: Filters.slider, operator: '>=' },
|
|
87
|
+
sortable: true,
|
|
88
|
+
type: 'number',
|
|
89
|
+
groupTotalsFormatter: GroupTotalFormatters.sumTotals,
|
|
90
|
+
params: { groupFormatterPrefix: 'Total: ' },
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: '%',
|
|
94
|
+
name: '% Complete',
|
|
95
|
+
field: 'percentComplete',
|
|
96
|
+
minWidth: 70,
|
|
97
|
+
width: 90,
|
|
98
|
+
formatter: Formatters.percentCompleteBar,
|
|
99
|
+
filterable: true,
|
|
100
|
+
filter: { model: Filters.compoundSlider },
|
|
101
|
+
sortable: true,
|
|
102
|
+
type: 'number',
|
|
103
|
+
groupTotalsFormatter: GroupTotalFormatters.avgTotalsPercentage,
|
|
104
|
+
params: { groupFormatterPrefix: '<i>Avg</i>: ' },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'start',
|
|
108
|
+
name: 'Start',
|
|
109
|
+
field: 'start',
|
|
110
|
+
minWidth: 60,
|
|
111
|
+
filterable: true,
|
|
112
|
+
filter: { model: Filters.compoundDate },
|
|
113
|
+
sortable: true,
|
|
114
|
+
type: 'dateIso',
|
|
115
|
+
formatter: Formatters.dateIso,
|
|
116
|
+
exportWithFormatter: true,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'finish',
|
|
120
|
+
name: 'Finish',
|
|
121
|
+
field: 'finish',
|
|
122
|
+
minWidth: 60,
|
|
123
|
+
filterable: true,
|
|
124
|
+
filter: { model: Filters.compoundDate },
|
|
125
|
+
sortable: true,
|
|
126
|
+
type: 'dateIso',
|
|
127
|
+
formatter: Formatters.dateIso,
|
|
128
|
+
exportWithFormatter: true,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: 'cost',
|
|
132
|
+
name: 'Cost',
|
|
133
|
+
field: 'cost',
|
|
134
|
+
minWidth: 70,
|
|
135
|
+
width: 80,
|
|
136
|
+
sortable: true,
|
|
137
|
+
filterable: true,
|
|
138
|
+
filter: { model: Filters.compoundInputNumber },
|
|
139
|
+
type: 'number',
|
|
140
|
+
formatter: Formatters.currency,
|
|
141
|
+
groupTotalsFormatter: GroupTotalFormatters.sumTotalsCurrency,
|
|
142
|
+
params: {
|
|
143
|
+
displayNegativeNumberWithParentheses: true,
|
|
144
|
+
currencyPrefix: '€',
|
|
145
|
+
groupFormatterCurrencyPrefix: '€',
|
|
146
|
+
minDecimal: 2,
|
|
147
|
+
maxDecimal: 4,
|
|
148
|
+
groupFormatterPrefix: '<b>Total</b>: ',
|
|
149
|
+
},
|
|
150
|
+
excelExportOptions: {
|
|
151
|
+
style: {
|
|
152
|
+
font: { outline: true, italic: true },
|
|
153
|
+
format: '€0.00##;[Red](€0.00##)',
|
|
154
|
+
},
|
|
155
|
+
width: 18,
|
|
156
|
+
},
|
|
157
|
+
groupTotalsExcelExportOptions: {
|
|
158
|
+
style: {
|
|
159
|
+
alignment: { horizontal: 'center' },
|
|
160
|
+
font: { bold: true, color: 'FF005289', underline: 'single', fontName: 'Consolas', size: 10 },
|
|
161
|
+
fill: { type: 'pattern', patternType: 'solid', fgColor: 'FFE6F2F6' },
|
|
162
|
+
border: {
|
|
163
|
+
top: { color: 'FFa500ff', style: 'thick' },
|
|
164
|
+
left: { color: 'FFa500ff', style: 'medium' },
|
|
165
|
+
right: { color: 'FFa500ff', style: 'dotted' },
|
|
166
|
+
bottom: { color: 'FFa500ff', style: 'double' },
|
|
167
|
+
},
|
|
168
|
+
format: '"Total: "€0.00##;[Red]"Total: "(€0.00##)',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'effort-driven',
|
|
174
|
+
name: 'Effort Driven',
|
|
175
|
+
minWidth: 20,
|
|
176
|
+
width: 80,
|
|
177
|
+
maxWidth: 80,
|
|
178
|
+
cssClass: 'cell-effort-driven',
|
|
179
|
+
field: 'effortDriven',
|
|
180
|
+
formatter: Formatters.checkmarkMaterial,
|
|
181
|
+
sortable: true,
|
|
182
|
+
filterable: true,
|
|
183
|
+
filter: {
|
|
184
|
+
collection: [
|
|
185
|
+
{ value: '', label: '' },
|
|
186
|
+
{ value: true, label: 'True' },
|
|
187
|
+
{ value: false, label: 'False' },
|
|
188
|
+
],
|
|
189
|
+
model: Filters.singleSelect,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
];
|
|
193
|
+
|
|
194
|
+
this.gridOptions = {
|
|
195
|
+
autoResize: {
|
|
196
|
+
container: '#demo-container',
|
|
197
|
+
rightPadding: 10,
|
|
198
|
+
},
|
|
199
|
+
enableExcelExport: true,
|
|
200
|
+
enableFiltering: true,
|
|
201
|
+
// you could debounce/throttle the input text filter if you have lots of data
|
|
202
|
+
// filterTypingDebounce: 250,
|
|
203
|
+
enableGrouping: true,
|
|
204
|
+
enableTextExport: true,
|
|
205
|
+
gridMenu: {
|
|
206
|
+
hideExportTextDelimitedCommand: false,
|
|
207
|
+
},
|
|
208
|
+
excelExportOptions: { sanitizeDataExport: true },
|
|
209
|
+
textExportOptions: { sanitizeDataExport: true },
|
|
210
|
+
externalResources: [this.excelExportService, this.textExportService],
|
|
211
|
+
showCustomFooter: true, // display some metrics in the bottom custom footer
|
|
212
|
+
customFooterOptions: {
|
|
213
|
+
// optionally display some text on the left footer container
|
|
214
|
+
hideMetrics: false,
|
|
215
|
+
hideTotalItemCount: false,
|
|
216
|
+
hideLastUpdateTimestamp: false,
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
this.loadData(500);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
angularGridReady(angularGrid: AngularGridInstance) {
|
|
224
|
+
this.angularGrid = angularGrid;
|
|
225
|
+
this.gridObj = angularGrid.slickGrid;
|
|
226
|
+
this.dataviewObj = angularGrid.dataView;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
loadData(rowCount: number) {
|
|
230
|
+
// mock a dataset
|
|
231
|
+
const tmpData = [];
|
|
232
|
+
for (let i = 0; i < rowCount; i++) {
|
|
233
|
+
const randomYear = 2000 + Math.floor(Math.random() * 10);
|
|
234
|
+
const randomMonth = Math.floor(Math.random() * 11);
|
|
235
|
+
const randomDay = Math.floor(Math.random() * 29);
|
|
236
|
+
const randomPercent = Math.round(Math.random() * 100);
|
|
237
|
+
const randomCost = i % 33 === 0 ? null : Math.round(Math.random() * 10000) / 100;
|
|
238
|
+
|
|
239
|
+
tmpData[i] = {
|
|
240
|
+
id: 'id_' + i,
|
|
241
|
+
num: i,
|
|
242
|
+
title: 'Task ' + i,
|
|
243
|
+
duration: Math.round(Math.random() * 100) + '',
|
|
244
|
+
percentComplete: randomPercent,
|
|
245
|
+
percentCompleteNumber: randomPercent,
|
|
246
|
+
start: new Date(randomYear, randomMonth, randomDay),
|
|
247
|
+
finish: new Date(randomYear, randomMonth + 1, randomDay),
|
|
248
|
+
cost: i % 3 ? randomCost : randomCost !== null ? -randomCost : null,
|
|
249
|
+
effortDriven: i % 5 === 0,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
this.dataset = tmpData;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
clearGrouping() {
|
|
256
|
+
this.dataviewObj.setGrouping([]);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
collapseAllGroups() {
|
|
260
|
+
this.dataviewObj.collapseAllGroups();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
expandAllGroups() {
|
|
264
|
+
this.dataviewObj.expandAllGroups();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
exportToExcel() {
|
|
268
|
+
this.excelExportService.exportToExcel({
|
|
269
|
+
filename: 'Export',
|
|
270
|
+
format: 'xlsx',
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
exportToFile(type = 'csv') {
|
|
275
|
+
this.textExportService.exportToFile({
|
|
276
|
+
delimiter: type === 'csv' ? DelimiterType.comma : DelimiterType.tab,
|
|
277
|
+
filename: 'myExport',
|
|
278
|
+
format: type === 'csv' ? 'csv' : 'txt',
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
groupByDuration() {
|
|
283
|
+
// you need to manually add the sort icon(s) in UI
|
|
284
|
+
this.angularGrid.filterService.setSortColumnIcons([{ columnId: 'duration', sortAsc: true }]);
|
|
285
|
+
this.dataviewObj.setGrouping({
|
|
286
|
+
getter: 'duration',
|
|
287
|
+
formatter: (g) => `Duration: ${g.value} <span style="color:green">(${g.count} items)</span>`,
|
|
288
|
+
aggregators: [new Aggregators.Avg('percentComplete'), new Aggregators.Sum('cost')],
|
|
289
|
+
comparer: (a, b) => SortComparers.numeric(a.value, b.value, SortDirectionNumber.asc),
|
|
290
|
+
aggregateCollapsed: false,
|
|
291
|
+
lazyTotalsCalculation: true,
|
|
292
|
+
} as Grouping);
|
|
293
|
+
this.gridObj.invalidate(); // invalidate all rows and re-render
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
groupByDurationOrderByCount(aggregateCollapsed: boolean) {
|
|
297
|
+
this.angularGrid.filterService.setSortColumnIcons([]);
|
|
298
|
+
this.dataviewObj.setGrouping({
|
|
299
|
+
getter: 'duration',
|
|
300
|
+
formatter: (g) => `Duration: ${g.value} <span style="color:green">(${g.count} items)</span>`,
|
|
301
|
+
comparer: (a, b) => {
|
|
302
|
+
return a.count - b.count;
|
|
303
|
+
},
|
|
304
|
+
aggregators: [new Aggregators.Avg('percentComplete'), new Aggregators.Sum('cost')],
|
|
305
|
+
aggregateCollapsed,
|
|
306
|
+
lazyTotalsCalculation: true,
|
|
307
|
+
} as Grouping);
|
|
308
|
+
this.gridObj.invalidate(); // invalidate all rows and re-render
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
groupByDurationEffortDriven() {
|
|
312
|
+
// you need to manually add the sort icon(s) in UI
|
|
313
|
+
const sortColumns = [
|
|
314
|
+
{ columnId: 'duration', sortAsc: true },
|
|
315
|
+
{ columnId: 'effortDriven', sortAsc: true },
|
|
316
|
+
];
|
|
317
|
+
this.angularGrid.filterService.setSortColumnIcons(sortColumns);
|
|
318
|
+
this.dataviewObj.setGrouping([
|
|
319
|
+
{
|
|
320
|
+
getter: 'duration',
|
|
321
|
+
formatter: (g) => `Duration: ${g.value} <span style="color:green">(${g.count} items)</span>`,
|
|
322
|
+
aggregators: [new Aggregators.Sum('duration'), new Aggregators.Sum('cost')],
|
|
323
|
+
aggregateCollapsed: true,
|
|
324
|
+
lazyTotalsCalculation: true,
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
getter: 'effortDriven',
|
|
328
|
+
formatter: (g) => `Effort-Driven: ${g.value ? 'True' : 'False'} <span style="color:green">(${g.count} items)</span>`,
|
|
329
|
+
aggregators: [new Aggregators.Avg('percentComplete'), new Aggregators.Sum('cost')],
|
|
330
|
+
collapsed: true,
|
|
331
|
+
lazyTotalsCalculation: true,
|
|
332
|
+
},
|
|
333
|
+
] as Grouping[]);
|
|
334
|
+
this.gridObj.invalidate(); // invalidate all rows and re-render
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
groupByDurationEffortDrivenPercent() {
|
|
338
|
+
// you need to manually add the sort icon(s) in UI
|
|
339
|
+
const sortColumns = [
|
|
340
|
+
{ columnId: 'duration', sortAsc: true },
|
|
341
|
+
{ columnId: 'effortDriven', sortAsc: true },
|
|
342
|
+
{ columnId: 'percentComplete', sortAsc: true },
|
|
343
|
+
];
|
|
344
|
+
this.angularGrid.filterService.setSortColumnIcons(sortColumns);
|
|
345
|
+
this.dataviewObj.setGrouping([
|
|
346
|
+
{
|
|
347
|
+
getter: 'duration',
|
|
348
|
+
formatter: (g) => `Duration: ${g.value} <span style="color:green">(${g.count} items)</span>`,
|
|
349
|
+
aggregators: [new Aggregators.Sum('duration'), new Aggregators.Sum('cost')],
|
|
350
|
+
aggregateCollapsed: true,
|
|
351
|
+
lazyTotalsCalculation: true,
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
getter: 'effortDriven',
|
|
355
|
+
formatter: (g) => `Effort-Driven: ${g.value ? 'True' : 'False'} <span style="color:green">(${g.count} items)</span>`,
|
|
356
|
+
aggregators: [new Aggregators.Sum('duration'), new Aggregators.Sum('cost')],
|
|
357
|
+
lazyTotalsCalculation: true,
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
getter: 'percentComplete',
|
|
361
|
+
formatter: (g) => `% Complete: ${g.value} <span style="color:green">(${g.count} items)</span>`,
|
|
362
|
+
aggregators: [new Aggregators.Avg('percentComplete')],
|
|
363
|
+
aggregateCollapsed: true,
|
|
364
|
+
collapsed: true,
|
|
365
|
+
lazyTotalsCalculation: true,
|
|
366
|
+
},
|
|
367
|
+
] as Grouping[]);
|
|
368
|
+
this.gridObj.invalidate(); // invalidate all rows and re-render
|
|
369
|
+
}
|
|
370
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<div id="demo-container" class="container-fluid">
|
|
2
|
+
<h2>
|
|
3
|
+
Example 14: Column Span & Header Grouping
|
|
4
|
+
<span class="float-end">
|
|
5
|
+
<a
|
|
6
|
+
style="font-size: 18px"
|
|
7
|
+
target="_blank"
|
|
8
|
+
href="https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-colspan.component.ts"
|
|
9
|
+
>
|
|
10
|
+
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
+
</a>
|
|
12
|
+
</span>
|
|
13
|
+
</h2>
|
|
14
|
+
<div class="subtitle">
|
|
15
|
+
This example demonstrates how to easily span a row over multiple columns & how to group header titles.
|
|
16
|
+
<ul>
|
|
17
|
+
<li>
|
|
18
|
+
Note that you can add Sort but remember that it will sort by the data which the row contains, even if the data is visually hidden by
|
|
19
|
+
colspan it will still sort it
|
|
20
|
+
</li>
|
|
21
|
+
<li>
|
|
22
|
+
Header Grouping spanning accross multiple columns is working but has some UI issues on window resize. If anyone can fix it, probably
|
|
23
|
+
some CSS issues, please let us know.
|
|
24
|
+
</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<h3>Grid 1 <small>(with Header Grouping & Colspan)</small></h3>
|
|
29
|
+
<angular-slickgrid gridId="grid1" [columns]="columnDefinitions1" [options]="gridOptions1" [dataset]="dataset1"> </angular-slickgrid>
|
|
30
|
+
|
|
31
|
+
<hr />
|
|
32
|
+
|
|
33
|
+
<h3>Grid 2 <small>(with Header Grouping & Frozen/Pinned Columns)</small></h3>
|
|
34
|
+
<div class="col-sm 12">
|
|
35
|
+
<button class="btn btn-outline-secondary btn-sm btn-icon" (click)="setFrozenColumns2(-1)" data-test="remove-frozen-column-button">
|
|
36
|
+
<i class="mdi mdi-close"></i> Remove Frozen Columns
|
|
37
|
+
</button>
|
|
38
|
+
<button class="btn btn-outline-secondary btn-sm btn-icon" (click)="setFrozenColumns2(2)" data-test="set-3frozen-columns">
|
|
39
|
+
<i class="mdi mdi-pin-outline"></i> Set 3 Frozen Columns
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
<angular-slickgrid
|
|
43
|
+
gridId="grid2"
|
|
44
|
+
[columns]="columnDefinitions2"
|
|
45
|
+
[options]="gridOptions2"
|
|
46
|
+
[dataset]="dataset2"
|
|
47
|
+
(onAngularGridCreated)="angularGridReady2($event.detail)"
|
|
48
|
+
>
|
|
49
|
+
</angular-slickgrid>
|
|
50
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** You can change the pinned/frozen border styling through this css override */
|
|
2
|
+
|
|
3
|
+
.slick-row .slick-cell.frozen:last-child,
|
|
4
|
+
.slick-headerrow-column.frozen:last-child,
|
|
5
|
+
.slick-footerrow-column.frozen:last-child {
|
|
6
|
+
border-right: 1px solid #969696 !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.slick-pane-bottom {
|
|
10
|
+
border-top: 1px solid #969696 !important;
|
|
11
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { ExcelExportService } from '@slickgrid-universal/excel-export';
|
|
3
|
+
|
|
4
|
+
import { AngularGridInstance, Column, GridOption, ItemMetadata } from '../../library';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
templateUrl: './example14.component.html',
|
|
8
|
+
styleUrls: ['./example14.component.scss'],
|
|
9
|
+
standalone: false,
|
|
10
|
+
})
|
|
11
|
+
export class Example14Component implements OnInit {
|
|
12
|
+
angularGrid2!: AngularGridInstance;
|
|
13
|
+
gridObj2: any;
|
|
14
|
+
columnDefinitions1!: Column[];
|
|
15
|
+
columnDefinitions2!: Column[];
|
|
16
|
+
gridOptions1!: GridOption;
|
|
17
|
+
gridOptions2!: GridOption;
|
|
18
|
+
dataset1: any[] = [];
|
|
19
|
+
dataset2: any[] = [];
|
|
20
|
+
|
|
21
|
+
ngOnInit(): void {
|
|
22
|
+
this.prepareGrid1();
|
|
23
|
+
this.prepareGrid2();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
angularGridReady2(angularGrid: AngularGridInstance) {
|
|
27
|
+
this.angularGrid2 = angularGrid;
|
|
28
|
+
this.gridObj2 = angularGrid.slickGrid;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
prepareGrid1() {
|
|
32
|
+
this.columnDefinitions1 = [
|
|
33
|
+
{ id: 'title', name: 'Title', field: 'title', sortable: true, columnGroup: 'Common Factor' },
|
|
34
|
+
{ id: 'duration', name: 'Duration', field: 'duration', columnGroup: 'Common Factor' },
|
|
35
|
+
{ id: 'start', name: 'Start', field: 'start', columnGroup: 'Period' },
|
|
36
|
+
{ id: 'finish', name: 'Finish', field: 'finish', columnGroup: 'Period' },
|
|
37
|
+
{ id: '%', name: '% Complete', field: 'percentComplete', selectable: false, columnGroup: 'Analysis' },
|
|
38
|
+
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', type: 'boolean', columnGroup: 'Analysis' },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
this.gridOptions1 = {
|
|
42
|
+
gridHeight: 275,
|
|
43
|
+
gridWidth: 800,
|
|
44
|
+
enableAutoResize: false,
|
|
45
|
+
enableCellNavigation: true,
|
|
46
|
+
enableSorting: true,
|
|
47
|
+
createPreHeaderPanel: true,
|
|
48
|
+
showPreHeaderPanel: true,
|
|
49
|
+
preHeaderPanelHeight: 28,
|
|
50
|
+
explicitInitialization: true,
|
|
51
|
+
dataView: {
|
|
52
|
+
globalItemMetadataProvider: {
|
|
53
|
+
getRowMetadata: (item: any) => this.renderDifferentColspan(item),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
gridMenu: {
|
|
57
|
+
iconButtonContainer: 'preheader', // we can display the grid menu icon in either the preheader or in the column header (default)
|
|
58
|
+
},
|
|
59
|
+
enableExcelExport: true,
|
|
60
|
+
excelExportOptions: {
|
|
61
|
+
exportWithFormatter: false,
|
|
62
|
+
},
|
|
63
|
+
externalResources: [new ExcelExportService()],
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
this.dataset1 = this.getData(500);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
prepareGrid2() {
|
|
70
|
+
this.columnDefinitions2 = [
|
|
71
|
+
{
|
|
72
|
+
id: 'sel',
|
|
73
|
+
name: '#',
|
|
74
|
+
field: 'num',
|
|
75
|
+
behavior: 'select',
|
|
76
|
+
cssClass: 'cell-selection',
|
|
77
|
+
width: 40,
|
|
78
|
+
resizable: false,
|
|
79
|
+
selectable: false,
|
|
80
|
+
},
|
|
81
|
+
{ id: 'title', name: 'Title', field: 'title', sortable: true, columnGroup: 'Common Factor' },
|
|
82
|
+
{ id: 'duration', name: 'Duration', field: 'duration', columnGroup: 'Common Factor' },
|
|
83
|
+
{ id: 'start', name: 'Start', field: 'start', columnGroup: 'Period' },
|
|
84
|
+
{ id: 'finish', name: 'Finish', field: 'finish', columnGroup: 'Period' },
|
|
85
|
+
{ id: '%', name: '% Complete', field: 'percentComplete', selectable: false, columnGroup: 'Analysis' },
|
|
86
|
+
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', type: 'boolean', columnGroup: 'Analysis' },
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
this.gridOptions2 = {
|
|
90
|
+
gridHeight: 275,
|
|
91
|
+
gridWidth: 800,
|
|
92
|
+
enableCellNavigation: true,
|
|
93
|
+
createPreHeaderPanel: true,
|
|
94
|
+
showPreHeaderPanel: true,
|
|
95
|
+
preHeaderPanelHeight: 25,
|
|
96
|
+
explicitInitialization: true,
|
|
97
|
+
frozenColumn: 2,
|
|
98
|
+
gridMenu: { hideClearFrozenColumnsCommand: false },
|
|
99
|
+
headerMenu: { hideFreezeColumnsCommand: false },
|
|
100
|
+
enableExcelExport: true,
|
|
101
|
+
excelExportOptions: {
|
|
102
|
+
exportWithFormatter: false,
|
|
103
|
+
},
|
|
104
|
+
externalResources: [new ExcelExportService()],
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
this.dataset2 = this.getData(500);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
getData(count: number) {
|
|
111
|
+
// Set up some test columns.
|
|
112
|
+
const mockDataset = [];
|
|
113
|
+
for (let i = 0; i < count; i++) {
|
|
114
|
+
mockDataset[i] = {
|
|
115
|
+
id: i,
|
|
116
|
+
num: i,
|
|
117
|
+
title: 'Task ' + i,
|
|
118
|
+
duration: '5 days',
|
|
119
|
+
percentComplete: Math.round(Math.random() * 100),
|
|
120
|
+
start: '01/01/2009',
|
|
121
|
+
finish: '01/05/2009',
|
|
122
|
+
effortDriven: i % 5 === 0,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return mockDataset;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
setFrozenColumns2(frozenCols: number) {
|
|
129
|
+
this.gridObj2.setOptions({ frozenColumn: frozenCols });
|
|
130
|
+
this.gridOptions2 = this.gridObj2.getOptions();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* A callback to render different row column span
|
|
135
|
+
* Your callback will always have the "item" argument which you can use to decide on the colspan
|
|
136
|
+
* Your return must always be in the form of:: return { columns: {}}
|
|
137
|
+
*/
|
|
138
|
+
renderDifferentColspan(item: any): ItemMetadata {
|
|
139
|
+
if (item.id % 2 === 1) {
|
|
140
|
+
return {
|
|
141
|
+
columns: {
|
|
142
|
+
duration: {
|
|
143
|
+
colspan: 3, // "duration" will span over 3 columns
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
columns: {
|
|
150
|
+
0: {
|
|
151
|
+
colspan: '*', // starting at column index 0, we will span accross all column (*)
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<div id="demo-container" class="container-fluid">
|
|
2
|
+
<h2>
|
|
3
|
+
Example 15: Grid State & Presets using Local Storage
|
|
4
|
+
<span class="float-end">
|
|
5
|
+
<a
|
|
6
|
+
style="font-size: 18px"
|
|
7
|
+
target="_blank"
|
|
8
|
+
href="https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-state.component.ts"
|
|
9
|
+
>
|
|
10
|
+
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
+
</a>
|
|
12
|
+
</span>
|
|
13
|
+
</h2>
|
|
14
|
+
<div class="subtitle">
|
|
15
|
+
Grid State & Preset (<a
|
|
16
|
+
href="https://ghiscoding.gitbook.io/angular-slickgrid/grid-functionalities/grid-state-and-preset"
|
|
17
|
+
target="_blank"
|
|
18
|
+
>Wiki docs</a
|
|
19
|
+
>)
|
|
20
|
+
<br />
|
|
21
|
+
<ul class="small">
|
|
22
|
+
<li>Uses Local Storage to persist the Grid State and uses Grid Options "presets" to put the grid back to it's previous state</li>
|
|
23
|
+
<ul>
|
|
24
|
+
<li>
|
|
25
|
+
to demo this, simply change any columns (position reorder, visibility, size, filter, sort), then refresh your browser with (F5)
|
|
26
|
+
</li>
|
|
27
|
+
</ul>
|
|
28
|
+
<li>Local Storage is just one option, you can use whichever is more convenient for you (Local Storage, Session Storage, DB, ...)</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<button class="btn btn-outline-secondary btn-sm btn-icon" data-test="reset-button" (click)="clearGridStateFromLocalStorage()">
|
|
33
|
+
<i class="mdi mdi-close"></i>
|
|
34
|
+
Clear Grid State from Local Storage & Reset Grid
|
|
35
|
+
</button>
|
|
36
|
+
|
|
37
|
+
<button class="btn btn-outline-secondary btn-sm btn-icon" (click)="switchLanguage()" data-test="language-button">
|
|
38
|
+
<i class="mdi mdi-translate"></i>
|
|
39
|
+
Switch Language
|
|
40
|
+
</button>
|
|
41
|
+
<b>Locale:</b>
|
|
42
|
+
<span style="font-style: italic" data-test="selected-locale">
|
|
43
|
+
{{ selectedLanguage + '.json' }}
|
|
44
|
+
</span>
|
|
45
|
+
|
|
46
|
+
<angular-slickgrid
|
|
47
|
+
gridId="grid15"
|
|
48
|
+
[columns]="columnDefinitions"
|
|
49
|
+
[options]="gridOptions"
|
|
50
|
+
[dataset]="dataset"
|
|
51
|
+
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
52
|
+
(onGridStateChanged)="gridStateChanged($event.detail)"
|
|
53
|
+
(onBeforeGridDestroy)="saveCurrentGridState()"
|
|
54
|
+
>
|
|
55
|
+
</angular-slickgrid>
|
|
56
|
+
</div>
|