angular-slickgrid 8.14.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitbook.yaml +5 -0
- package/CHANGELOG.md +1691 -0
- package/CONTRIBUTING.md +17 -0
- package/README.md +13 -50
- package/angular.json +133 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +1620 -0
- package/coverage/coverage-final.json +9 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +176 -0
- package/coverage/library/components/angular-slickgrid.component.ts.html +5074 -0
- package/coverage/library/components/index.html +116 -0
- package/coverage/library/constants.ts.html +397 -0
- package/coverage/library/extensions/index.html +116 -0
- package/coverage/library/extensions/slickRowDetailView.ts.html +1261 -0
- package/coverage/library/index.html +116 -0
- package/coverage/library/modules/angular-slickgrid.module.ts.html +166 -0
- package/coverage/library/modules/index.html +116 -0
- package/coverage/library/services/angularUtil.service.ts.html +445 -0
- package/coverage/library/services/container.service.ts.html +163 -0
- package/coverage/library/services/index.html +161 -0
- package/coverage/library/services/translater.service.ts.html +199 -0
- package/coverage/library/services/utilities.ts.html +142 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +142 -0
- package/{fesm2022 → dist/fesm2022}/angular-slickgrid.mjs +168 -194
- package/dist/fesm2022/angular-slickgrid.mjs.map +1 -0
- package/{i18n → dist/i18n}/en.json +2 -1
- package/{i18n → dist/i18n}/fr.json +2 -1
- package/{app/modules/angular-slickgrid → dist/library}/components/angular-slickgrid.component.d.ts +9 -9
- package/{app/modules/angular-slickgrid → dist/library}/extensions/slickRowDetailView.d.ts +4 -4
- package/{app/modules/angular-slickgrid → dist/library}/models/angularGridInstance.interface.d.ts +0 -2
- package/dist/library/models/index.d.ts +5 -0
- package/{app/modules/angular-slickgrid → dist/library}/models/rowDetailView.interface.d.ts +1 -1
- package/{app/modules/angular-slickgrid → dist/library}/modules/angular-slickgrid.module.d.ts +1 -1
- package/dist/public_api.d.ts +1 -0
- package/docs/README.md +5 -0
- package/docs/TOC.md +105 -0
- package/docs/backend-services/Custom-Backend-Service.md +50 -0
- package/docs/backend-services/GraphQL.md +276 -0
- package/docs/backend-services/OData.md +245 -0
- package/docs/backend-services/graphql/GraphQL-Filtering.md +156 -0
- package/docs/backend-services/graphql/GraphQL-JSON-Result.md +85 -0
- package/docs/backend-services/graphql/GraphQL-Pagination.md +77 -0
- package/docs/backend-services/graphql/GraphQL-Sorting.md +78 -0
- package/docs/column-functionalities/cell-menu.md +212 -0
- package/docs/column-functionalities/editors/autocomplete-editor.md +466 -0
- package/docs/column-functionalities/editors/date-editor-flatpickr.md +71 -0
- package/docs/column-functionalities/editors/date-editor-vanilla-calendar.md +91 -0
- package/docs/column-functionalities/editors/longtext-editor-textarea.md +80 -0
- package/docs/column-functionalities/editors/select-dropdown-editor.md +227 -0
- package/docs/column-functionalities/editors.md +604 -0
- package/docs/column-functionalities/filters/autocomplete-filter.md +183 -0
- package/docs/column-functionalities/filters/compound-filters.md +234 -0
- package/docs/column-functionalities/filters/custom-filter.md +117 -0
- package/docs/column-functionalities/filters/filter-intro.md +81 -0
- package/docs/column-functionalities/filters/input-filter.md +260 -0
- package/docs/column-functionalities/filters/range-filters.md +188 -0
- package/docs/column-functionalities/filters/select-filter.md +695 -0
- package/docs/column-functionalities/filters/single-search-filter.md +77 -0
- package/docs/column-functionalities/filters/styling-filled-filters.md +45 -0
- package/docs/column-functionalities/formatters.md +325 -0
- package/docs/column-functionalities/sorting.md +200 -0
- package/docs/developer-guides/csp-compliance.md +64 -0
- package/docs/events/Available-Events.md +223 -0
- package/docs/events/Grid-&-DataView-Events.md +211 -0
- package/docs/getting-started/quick-start.md +230 -0
- package/docs/getting-started/troubleshooting.md +80 -0
- package/docs/grid-functionalities/Column-Picker.md +22 -0
- package/docs/grid-functionalities/Composite-Editor-Modal.md +627 -0
- package/docs/grid-functionalities/Context-Menu.md +226 -0
- package/docs/grid-functionalities/Custom-Footer.md +80 -0
- package/docs/grid-functionalities/Custom-Tooltip-(plugin).md +258 -0
- package/docs/grid-functionalities/Export-to-Excel.md +457 -0
- package/docs/grid-functionalities/Export-to-Text-File.md +165 -0
- package/docs/grid-functionalities/FAQ.md +53 -0
- package/docs/grid-functionalities/Global-Options.md +29 -0
- package/docs/grid-functionalities/Grid-Auto-Resize.md +218 -0
- package/docs/grid-functionalities/Grid-Menu.md +134 -0
- package/docs/grid-functionalities/Grid-State-&-Preset.md +245 -0
- package/docs/grid-functionalities/Header-Menu-&-Header-Buttons.md +125 -0
- package/docs/grid-functionalities/Resize-by-Cell-Content.md +138 -0
- package/docs/grid-functionalities/Row-Selection.md +247 -0
- package/docs/grid-functionalities/Row-based-edit.md +71 -0
- package/docs/grid-functionalities/add-update-highlight.md +258 -0
- package/docs/grid-functionalities/column-row-spanning.md +74 -0
- package/docs/grid-functionalities/dynamic-item-metadata.md +124 -0
- package/docs/grid-functionalities/excel-copy-buffer.md +145 -0
- package/docs/grid-functionalities/frozen-columns-rows.md +164 -0
- package/docs/grid-functionalities/grouping-and-aggregators.md +269 -0
- package/docs/grid-functionalities/header-footer-slots.md +22 -0
- package/docs/grid-functionalities/infinite-scroll.md +150 -0
- package/docs/grid-functionalities/providing-grid-data.md +61 -0
- package/docs/grid-functionalities/row-detail.md +530 -0
- package/docs/grid-functionalities/tree-data-grid.md +391 -0
- package/docs/localization/Localization---Component-Sample.md +87 -0
- package/docs/localization/Localization-with-Custom-Locales.md +66 -0
- package/docs/localization/Localization-with-ngx-translate.md +148 -0
- package/docs/migrations/migration-to-2.x.md +304 -0
- package/docs/migrations/migration-to-3.x.md +295 -0
- package/docs/migrations/migration-to-4.x.md +83 -0
- package/docs/migrations/migration-to-5.x.md +160 -0
- package/docs/migrations/migration-to-6.x.md +128 -0
- package/docs/migrations/migration-to-7.x.md +294 -0
- package/docs/migrations/migration-to-8.x.md +316 -0
- package/docs/migrations/migration-to-9.x.md +219 -0
- package/docs/slick-grid-dataview-objects/slickgrid-dataview-objects.md +79 -0
- package/docs/styling/dark-mode.md +100 -0
- package/docs/styling/styling.md +250 -0
- package/docs/testing/testing-patterns.md +73 -0
- package/eslint.config.mjs +60 -0
- package/ng-package.json +10 -0
- package/package.json +24 -48
- package/src/assets/angular-logo.png +0 -0
- package/src/assets/angular-logo2.png +0 -0
- package/src/assets/data/collection_100_numbers.json +12 -0
- package/src/assets/data/collection_500_numbers.json +52 -0
- package/src/assets/data/countries.json +245 -0
- package/src/assets/data/country_names.json +245 -0
- package/src/assets/data/customers_100.json +102 -0
- package/src/assets/data/users.csv +5 -0
- package/src/assets/i18n/en.json +102 -0
- package/src/assets/i18n/fr.json +103 -0
- package/src/demos/app-routing.module.ts +108 -0
- package/src/demos/app.component.html +187 -0
- package/src/demos/app.component.scss +79 -0
- package/src/demos/app.component.ts +11 -0
- package/src/demos/app.module.ts +196 -0
- package/src/demos/environments/environment.dev.ts +3 -0
- package/src/demos/environments/environment.prod.ts +3 -0
- package/src/demos/environments/environment.ts +8 -0
- package/src/demos/examples/custom-angularComponentEditor.ts +187 -0
- package/src/demos/examples/custom-angularComponentFilter.ts +123 -0
- package/src/demos/examples/custom-buttonFormatter.component.ts +13 -0
- package/src/demos/examples/custom-inputEditor.ts +132 -0
- package/src/demos/examples/custom-inputFilter.ts +134 -0
- package/src/demos/examples/custom-titleFormatter.component.ts +9 -0
- package/src/demos/examples/data/collection_100_numbers.json +12 -0
- package/src/demos/examples/data/collection_500_numbers.json +52 -0
- package/src/demos/examples/data/countries.json +245 -0
- package/src/demos/examples/data/country_names.json +245 -0
- package/src/demos/examples/data/customers_100.json +102 -0
- package/src/demos/examples/data/users.csv +5 -0
- package/src/demos/examples/editor-ng-select.component.ts +38 -0
- package/src/demos/examples/example01.component.html +48 -0
- package/src/demos/examples/example01.component.ts +109 -0
- package/src/demos/examples/example02.component.html +45 -0
- package/src/demos/examples/example02.component.ts +218 -0
- package/src/demos/examples/example03.component.html +118 -0
- package/src/demos/examples/example03.component.ts +694 -0
- package/src/demos/examples/example04.component.html +87 -0
- package/src/demos/examples/example04.component.ts +326 -0
- package/src/demos/examples/example05.component.html +151 -0
- package/src/demos/examples/example05.component.ts +474 -0
- package/src/demos/examples/example06.component.html +163 -0
- package/src/demos/examples/example06.component.ts +446 -0
- package/src/demos/examples/example07.component.html +56 -0
- package/src/demos/examples/example07.component.scss +10 -0
- package/src/demos/examples/example07.component.ts +216 -0
- package/src/demos/examples/example08.component.html +51 -0
- package/src/demos/examples/example08.component.scss +23 -0
- package/src/demos/examples/example08.component.ts +195 -0
- package/src/demos/examples/example09.component.html +55 -0
- package/src/demos/examples/example09.component.scss +22 -0
- package/src/demos/examples/example09.component.ts +302 -0
- package/src/demos/examples/example10.component.html +103 -0
- package/src/demos/examples/example10.component.ts +309 -0
- package/src/demos/examples/example11.component.html +91 -0
- package/src/demos/examples/example11.component.ts +276 -0
- package/src/demos/examples/example12.component.html +98 -0
- package/src/demos/examples/example12.component.ts +317 -0
- package/src/demos/examples/example13.component.html +96 -0
- package/src/demos/examples/example13.component.ts +370 -0
- package/src/demos/examples/example14.component.html +50 -0
- package/src/demos/examples/example14.component.scss +11 -0
- package/src/demos/examples/example14.component.ts +156 -0
- package/src/demos/examples/example15.component.html +56 -0
- package/src/demos/examples/example15.component.ts +304 -0
- package/src/demos/examples/example16.component.html +77 -0
- package/src/demos/examples/example16.component.ts +277 -0
- package/src/demos/examples/example17.component.html +50 -0
- package/src/demos/examples/example17.component.ts +109 -0
- package/src/demos/examples/example18.component.html +132 -0
- package/src/demos/examples/example18.component.ts +445 -0
- package/src/demos/examples/example19-rowdetail.component.html +40 -0
- package/src/demos/examples/example19-rowdetail.component.ts +54 -0
- package/src/demos/examples/example19.component.html +79 -0
- package/src/demos/examples/example19.component.ts +316 -0
- package/src/demos/examples/example20.component.html +76 -0
- package/src/demos/examples/example20.component.scss +11 -0
- package/src/demos/examples/example20.component.ts +341 -0
- package/src/demos/examples/example21.component.html +86 -0
- package/src/demos/examples/example21.component.scss +16 -0
- package/src/demos/examples/example21.component.ts +140 -0
- package/src/demos/examples/example22.component.html +41 -0
- package/src/demos/examples/example22.component.ts +117 -0
- package/src/demos/examples/example23.component.html +111 -0
- package/src/demos/examples/example23.component.ts +323 -0
- package/src/demos/examples/example24.component.html +120 -0
- package/src/demos/examples/example24.component.scss +62 -0
- package/src/demos/examples/example24.component.ts +641 -0
- package/src/demos/examples/example25.component.html +60 -0
- package/src/demos/examples/example25.component.scss +8 -0
- package/src/demos/examples/example25.component.ts +255 -0
- package/src/demos/examples/example26.component.html +98 -0
- package/src/demos/examples/example26.component.scss +42 -0
- package/src/demos/examples/example26.component.ts +383 -0
- package/src/demos/examples/example27.component.html +138 -0
- package/src/demos/examples/example27.component.scss +10 -0
- package/src/demos/examples/example27.component.ts +369 -0
- package/src/demos/examples/example28.component.html +143 -0
- package/src/demos/examples/example28.component.scss +54 -0
- package/src/demos/examples/example28.component.ts +453 -0
- package/src/demos/examples/example29.component.html +30 -0
- package/src/demos/examples/example29.component.ts +70 -0
- package/src/demos/examples/example30.component.html +116 -0
- package/src/demos/examples/example30.component.scss +20 -0
- package/src/demos/examples/example30.component.ts +1070 -0
- package/src/demos/examples/example32.component.html +77 -0
- package/src/demos/examples/example32.component.scss +8 -0
- package/src/demos/examples/example32.component.ts +905 -0
- package/src/demos/examples/example33.component.html +50 -0
- package/src/demos/examples/example33.component.scss +46 -0
- package/src/demos/examples/example33.component.ts +571 -0
- package/src/demos/examples/example34.component.html +82 -0
- package/src/demos/examples/example34.component.scss +77 -0
- package/src/demos/examples/example34.component.ts +434 -0
- package/src/demos/examples/example35.component.html +77 -0
- package/src/demos/examples/example35.component.scss +18 -0
- package/src/demos/examples/example35.component.ts +264 -0
- package/src/demos/examples/example36.component.html +56 -0
- package/src/demos/examples/example36.component.scss +26 -0
- package/src/demos/examples/example36.component.ts +504 -0
- package/src/demos/examples/example37.component.html +30 -0
- package/src/demos/examples/example37.component.ts +123 -0
- package/src/demos/examples/example38.component.html +104 -0
- package/src/demos/examples/example38.component.scss +8 -0
- package/src/demos/examples/example38.component.ts +420 -0
- package/src/demos/examples/example39.component.html +112 -0
- package/src/demos/examples/example39.component.scss +8 -0
- package/src/demos/examples/example39.component.ts +371 -0
- package/src/demos/examples/example40.component.html +76 -0
- package/src/demos/examples/example40.component.ts +226 -0
- package/src/demos/examples/example41.component.html +50 -0
- package/src/demos/examples/example41.component.scss +42 -0
- package/src/demos/examples/example41.component.ts +229 -0
- package/src/demos/examples/example42.component.html +47 -0
- package/src/demos/examples/example42.component.ts +203 -0
- package/src/demos/examples/example43.component.html +94 -0
- package/src/demos/examples/example43.component.scss +30 -0
- package/src/demos/examples/example43.component.ts +449 -0
- package/src/demos/examples/example44.component.html +78 -0
- package/src/demos/examples/example44.component.scss +50 -0
- package/src/demos/examples/example44.component.ts +375 -0
- package/src/demos/examples/example45-detail.component.html +15 -0
- package/src/demos/examples/example45-detail.component.ts +97 -0
- package/src/demos/examples/example45.component.html +110 -0
- package/src/demos/examples/example45.component.scss +50 -0
- package/src/demos/examples/example45.component.ts +243 -0
- package/src/demos/examples/filter-ng-select.component.ts +33 -0
- package/src/demos/examples/grid-custom-pager.component.html +60 -0
- package/src/demos/examples/grid-custom-pager.component.scss +57 -0
- package/src/demos/examples/grid-custom-pager.component.ts +107 -0
- package/src/demos/examples/grid-remote.component.html +44 -0
- package/src/demos/examples/grid-remote.component.ts +164 -0
- package/src/demos/examples/home.component.html +39 -0
- package/src/demos/examples/home.component.ts +10 -0
- package/src/demos/examples/jsonp.ts +89 -0
- package/src/demos/examples/rowdetail-preload.component.ts +10 -0
- package/src/demos/examples/swt-common-grid-pagination.component.ts +160 -0
- package/src/demos/examples/swt-common-grid-test.component.html +37 -0
- package/src/demos/examples/swt-common-grid-test.component.ts +214 -0
- package/src/demos/examples/swt-common-grid.component.ts +436 -0
- package/src/demos/examples/swt-logger.service.ts +173 -0
- package/src/demos/examples/utilities.ts +9 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +17 -0
- package/src/library/components/__tests__/angular-slickgrid.component.spec.ts +2638 -0
- package/src/library/components/angular-slickgrid.component.html +5 -0
- package/src/library/components/angular-slickgrid.component.ts +1662 -0
- package/src/library/constants.ts +105 -0
- package/src/library/extensions/__tests__/slickRowDetailView.spec.ts +751 -0
- package/src/library/extensions/index.ts +1 -0
- package/src/library/extensions/slickRowDetailView.ts +395 -0
- package/src/library/global-grid-options.ts +273 -0
- package/src/library/index.ts +11 -0
- package/src/library/models/angularComponentOutput.interface.ts +6 -0
- package/src/library/models/angularGridInstance.interface.ts +76 -0
- package/src/library/models/externalTestingDependencies.interface.ts +37 -0
- package/src/library/models/gridOption.interface.ts +15 -0
- package/src/library/models/index.ts +5 -0
- package/src/library/models/rowDetailView.interface.ts +16 -0
- package/src/library/modules/angular-slickgrid.module.spec.ts +25 -0
- package/src/library/modules/angular-slickgrid.module.ts +27 -0
- package/src/library/services/__tests__/angularUtilService.spec.ts +156 -0
- package/src/library/services/__tests__/container.service.spec.ts +25 -0
- package/src/library/services/__tests__/translater.service.spec.ts +43 -0
- package/src/library/services/__tests__/utilities.spec.ts +22 -0
- package/src/library/services/angularUtil.service.ts +120 -0
- package/src/library/services/container.service.ts +26 -0
- package/src/library/services/index.ts +4 -0
- package/src/library/services/translater.service.ts +38 -0
- package/src/library/services/utilities.ts +19 -0
- package/src/library/slickgrid-config.ts +10 -0
- package/src/main.ts +13 -0
- package/src/public_api.ts +1 -0
- package/src/styles.scss +178 -0
- package/test/cypress/e2e/example01.cy.ts +367 -0
- package/test/cypress/e2e/example02.cy.ts +60 -0
- package/test/cypress/e2e/example03.cy.ts +268 -0
- package/test/cypress/e2e/example04.cy.ts +254 -0
- package/test/cypress/e2e/example05.cy.ts +804 -0
- package/test/cypress/e2e/example06.cy.ts +890 -0
- package/test/cypress/e2e/example07.cy.ts +384 -0
- package/test/cypress/e2e/example08.cy.ts +190 -0
- package/test/cypress/e2e/example09.cy.ts +392 -0
- package/test/cypress/e2e/example10.cy.ts +650 -0
- package/test/cypress/e2e/example11.cy.ts +86 -0
- package/test/cypress/e2e/example12.cy.ts +269 -0
- package/test/cypress/e2e/example13.cy.ts +246 -0
- package/test/cypress/e2e/example14.cy.ts +122 -0
- package/test/cypress/e2e/example15.cy.ts +598 -0
- package/test/cypress/e2e/example16.cy.ts +427 -0
- package/test/cypress/e2e/example17.cy.ts +83 -0
- package/test/cypress/e2e/example18.cy.ts +431 -0
- package/test/cypress/e2e/example19.cy.ts +263 -0
- package/test/cypress/e2e/example20.cy.ts +264 -0
- package/test/cypress/e2e/example21.cy.ts +77 -0
- package/test/cypress/e2e/example22.cy.ts +94 -0
- package/test/cypress/e2e/example23.cy.ts +259 -0
- package/test/cypress/e2e/example24.cy.ts +707 -0
- package/test/cypress/e2e/example25.cy.ts +193 -0
- package/test/cypress/e2e/example26.cy.ts +111 -0
- package/test/cypress/e2e/example27.cy.ts +261 -0
- package/test/cypress/e2e/example28.cy.ts +740 -0
- package/test/cypress/e2e/example29.cy.ts +30 -0
- package/test/cypress/e2e/example30.cy.ts +757 -0
- package/test/cypress/e2e/example31.cy.ts +69 -0
- package/test/cypress/e2e/example32.cy.ts +272 -0
- package/test/cypress/e2e/example33.cy.ts +278 -0
- package/test/cypress/e2e/example34.cy.ts +84 -0
- package/test/cypress/e2e/example35.cy.ts +178 -0
- package/test/cypress/e2e/example36.cy.ts +219 -0
- package/test/cypress/e2e/example37.cy.ts +52 -0
- package/test/cypress/e2e/example38.cy.ts +160 -0
- package/test/cypress/e2e/example39.cy.ts +150 -0
- package/test/cypress/e2e/example40.cy.ts +126 -0
- package/test/cypress/e2e/example41.cy.ts +90 -0
- package/test/cypress/e2e/example42.cy.ts +82 -0
- package/test/cypress/e2e/example43.cy.ts +482 -0
- package/test/cypress/e2e/example44.cy.ts +458 -0
- package/test/cypress/e2e/example45.cy.ts +455 -0
- package/test/cypress/e2e/home.cy.ts +7 -0
- package/test/cypress/fixtures/example.json +5 -0
- package/test/cypress/plugins/index.ts +17 -0
- package/test/cypress/plugins/utilities.ts +28 -0
- package/test/cypress/support/commands.ts +88 -0
- package/test/cypress/support/common.ts +47 -0
- package/test/cypress/support/drag.ts +101 -0
- package/test/cypress/support/index.ts +20 -0
- package/test/cypress/tsconfig.json +9 -0
- package/test/cypress.config.ts +34 -0
- package/test/mockSlickEvent.ts +77 -0
- package/test/rxjsResourceStub.ts +69 -0
- package/test/test-setup.ts +6 -0
- package/test/translateServiceStub.ts +230 -0
- package/test/translaterServiceStub.ts +239 -0
- package/test/tsconfig.json +17 -0
- package/test/vitest-global-mocks.ts +41 -0
- package/test/vitest-global-setup.ts +3 -0
- package/test/vitest-pretest.ts +5 -0
- package/tsconfig.app.json +14 -0
- package/tsconfig.json +31 -0
- package/tsconfig.spec.json +11 -0
- package/types/sortablejs.d.ts +4 -0
- package/vite.config.mts +51 -0
- package/app/modules/angular-slickgrid/models/index.d.ts +0 -5
- package/esm2022/angular-slickgrid.mjs +0 -5
- package/esm2022/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +0 -1407
- package/esm2022/app/modules/angular-slickgrid/constants.mjs +0 -96
- package/esm2022/app/modules/angular-slickgrid/extensions/index.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +0 -304
- package/esm2022/app/modules/angular-slickgrid/global-grid-options.mjs +0 -263
- package/esm2022/app/modules/angular-slickgrid/index.mjs +0 -8
- package/esm2022/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/gridOption.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/models/index.mjs +0 -6
- package/esm2022/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +0 -2
- package/esm2022/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +0 -32
- package/esm2022/app/modules/angular-slickgrid/services/angularUtil.service.mjs +0 -88
- package/esm2022/app/modules/angular-slickgrid/services/container.service.mjs +0 -27
- package/esm2022/app/modules/angular-slickgrid/services/index.mjs +0 -5
- package/esm2022/app/modules/angular-slickgrid/services/translater.service.mjs +0 -45
- package/esm2022/app/modules/angular-slickgrid/services/utilities.mjs +0 -19
- package/esm2022/app/modules/angular-slickgrid/slickgrid-config.mjs +0 -8
- package/esm2022/public_api.mjs +0 -2
- package/fesm2022/angular-slickgrid.mjs.map +0 -1
- package/public_api.d.ts +0 -1
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/constants.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/extensions/index.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/global-grid-options.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/index.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/models/angularComponentOutput.interface.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/models/externalTestingDependencies.interface.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/models/gridOption.interface.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/angularUtil.service.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/container.service.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/index.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/translater.service.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/services/utilities.d.ts +0 -0
- /package/{app/modules/angular-slickgrid → dist/library}/slickgrid-config.d.ts +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
AngularGridInstance,
|
|
4
|
+
Column,
|
|
5
|
+
ColumnEditorDualInput,
|
|
6
|
+
Editors,
|
|
7
|
+
formatNumber,
|
|
8
|
+
Formatters,
|
|
9
|
+
Filters,
|
|
10
|
+
GridOption,
|
|
11
|
+
SlickEventHandler,
|
|
12
|
+
} from '../../library';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
templateUrl: './example20.component.html',
|
|
16
|
+
styleUrls: ['./example20.component.scss'],
|
|
17
|
+
encapsulation: ViewEncapsulation.None,
|
|
18
|
+
standalone: false,
|
|
19
|
+
})
|
|
20
|
+
export class Example20Component implements OnInit, OnDestroy {
|
|
21
|
+
angularGrid!: AngularGridInstance;
|
|
22
|
+
columnDefinitions!: Column[];
|
|
23
|
+
gridOptions!: GridOption;
|
|
24
|
+
dataset!: any[];
|
|
25
|
+
frozenColumnCount = 2;
|
|
26
|
+
frozenRowCount = 3;
|
|
27
|
+
isFrozenBottom = false;
|
|
28
|
+
gridObj: any;
|
|
29
|
+
slickEventHandler: any;
|
|
30
|
+
|
|
31
|
+
constructor() {
|
|
32
|
+
this.slickEventHandler = new SlickEventHandler();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
ngOnInit(): void {
|
|
36
|
+
this.prepareDataGrid();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ngOnDestroy() {
|
|
40
|
+
// unsubscribe all SlickGrid events
|
|
41
|
+
this.slickEventHandler.unsubscribeAll();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
angularGridReady(angularGrid: AngularGridInstance) {
|
|
45
|
+
this.angularGrid = angularGrid;
|
|
46
|
+
this.gridObj = angularGrid.slickGrid;
|
|
47
|
+
|
|
48
|
+
// with frozen (pinned) grid, in order to see the entire row being highlighted when hovering
|
|
49
|
+
// we need to do some extra tricks (that is because frozen grids use 2 separate div containers)
|
|
50
|
+
// the trick is to use row selection to highlight when hovering current row and remove selection once we're not
|
|
51
|
+
this.slickEventHandler.subscribe(this.gridObj.onMouseEnter, (event: Event) => this.colorizeHoveringRow(event, true));
|
|
52
|
+
this.slickEventHandler.subscribe(this.gridObj.onMouseLeave, (event: Event) => this.colorizeHoveringRow(event, false));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
colorizeHoveringRow(event: Event, isMouseEnter: boolean) {
|
|
56
|
+
const cell = this.gridObj.getCellFromEvent(event);
|
|
57
|
+
const rows = isMouseEnter ? [cell?.row ?? 0] : [];
|
|
58
|
+
this.gridObj.setSelectedRows(rows); // highlight current row
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
prepareDataGrid() {
|
|
63
|
+
this.columnDefinitions = [
|
|
64
|
+
{
|
|
65
|
+
id: 'sel',
|
|
66
|
+
name: '#',
|
|
67
|
+
field: 'id',
|
|
68
|
+
minWidth: 40,
|
|
69
|
+
width: 40,
|
|
70
|
+
maxWidth: 40,
|
|
71
|
+
cannotTriggerInsert: true,
|
|
72
|
+
resizable: false,
|
|
73
|
+
unselectable: true,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'title',
|
|
77
|
+
name: 'Title',
|
|
78
|
+
field: 'title',
|
|
79
|
+
minWidth: 100,
|
|
80
|
+
width: 120,
|
|
81
|
+
filterable: true,
|
|
82
|
+
sortable: true,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'percentComplete',
|
|
86
|
+
name: '% Complete',
|
|
87
|
+
field: 'percentComplete',
|
|
88
|
+
resizable: false,
|
|
89
|
+
minWidth: 130,
|
|
90
|
+
width: 140,
|
|
91
|
+
formatter: Formatters.percentCompleteBar,
|
|
92
|
+
type: 'number',
|
|
93
|
+
filterable: true,
|
|
94
|
+
filter: { model: Filters.slider, operator: '>=' },
|
|
95
|
+
sortable: true,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'start',
|
|
99
|
+
name: 'Start',
|
|
100
|
+
field: 'start',
|
|
101
|
+
minWidth: 100,
|
|
102
|
+
width: 120,
|
|
103
|
+
filterable: true,
|
|
104
|
+
sortable: true,
|
|
105
|
+
formatter: Formatters.dateIso,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'finish',
|
|
109
|
+
name: 'Finish',
|
|
110
|
+
field: 'finish',
|
|
111
|
+
minWidth: 100,
|
|
112
|
+
width: 120,
|
|
113
|
+
filterable: true,
|
|
114
|
+
sortable: true,
|
|
115
|
+
formatter: Formatters.dateIso,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'cost',
|
|
119
|
+
name: 'Cost | Duration',
|
|
120
|
+
field: 'cost',
|
|
121
|
+
formatter: this.costDurationFormatter.bind(this),
|
|
122
|
+
minWidth: 150,
|
|
123
|
+
width: 170,
|
|
124
|
+
sortable: true,
|
|
125
|
+
// filterable: true,
|
|
126
|
+
filter: {
|
|
127
|
+
model: Filters.compoundSlider,
|
|
128
|
+
},
|
|
129
|
+
editor: {
|
|
130
|
+
model: Editors.dualInput,
|
|
131
|
+
// the DualInputEditor is of Type ColumnEditorDualInput and MUST include (leftInput/rightInput) in its params object
|
|
132
|
+
// in each of these 2 properties, you can pass any regular properties of a column editor
|
|
133
|
+
// and they will be executed following the options defined in each
|
|
134
|
+
params: {
|
|
135
|
+
leftInput: {
|
|
136
|
+
field: 'cost',
|
|
137
|
+
type: 'float',
|
|
138
|
+
decimal: 2,
|
|
139
|
+
minValue: 0,
|
|
140
|
+
maxValue: 50000,
|
|
141
|
+
placeholder: '< 50K',
|
|
142
|
+
errorMessage: 'Cost must be positive and below $50K.',
|
|
143
|
+
},
|
|
144
|
+
rightInput: {
|
|
145
|
+
field: 'duration',
|
|
146
|
+
type: 'float', // you could have 2 different input type as well
|
|
147
|
+
minValue: 0,
|
|
148
|
+
maxValue: 100,
|
|
149
|
+
title: 'make sure Duration is withing its range of 0 to 100',
|
|
150
|
+
errorMessage: 'Duration must be between 0 and 100.',
|
|
151
|
+
|
|
152
|
+
// Validator Option #1
|
|
153
|
+
// You could also optionally define a custom validator in 1 or both inputs
|
|
154
|
+
/*
|
|
155
|
+
validator: (value, args) => {
|
|
156
|
+
let isValid = true;
|
|
157
|
+
let errorMsg = '';
|
|
158
|
+
if (value < 0 || value > 120) {
|
|
159
|
+
isValid = false;
|
|
160
|
+
errorMsg = 'Duration MUST be between 0 and 120.';
|
|
161
|
+
}
|
|
162
|
+
return { valid: isValid, msg: errorMsg };
|
|
163
|
+
}
|
|
164
|
+
*/
|
|
165
|
+
},
|
|
166
|
+
} as ColumnEditorDualInput,
|
|
167
|
+
|
|
168
|
+
// Validator Option #2 (shared Validator) - this is the last alternative, option #1 (independent Validators) is still the recommended way
|
|
169
|
+
// You can also optionally use a common Validator (if you do then you cannot use the leftInput/rightInput validators at same time)
|
|
170
|
+
// to compare both values at the same time.
|
|
171
|
+
/*
|
|
172
|
+
validator: (values, args) => {
|
|
173
|
+
let isValid = true;
|
|
174
|
+
let errorMsg = '';
|
|
175
|
+
if (values.cost < 0 || values.cost > 50000) {
|
|
176
|
+
isValid = false;
|
|
177
|
+
errorMsg = 'Cost MUST be between 0 and 50k.';
|
|
178
|
+
}
|
|
179
|
+
if (values.duration < 0 || values.duration > 120) {
|
|
180
|
+
isValid = false;
|
|
181
|
+
errorMsg = 'Duration MUST be between 0 and 120.';
|
|
182
|
+
}
|
|
183
|
+
if (values.cost < values.duration) {
|
|
184
|
+
isValid = false;
|
|
185
|
+
errorMsg = 'Cost can never be lower than its Duration.';
|
|
186
|
+
}
|
|
187
|
+
return { valid: isValid, msg: errorMsg };
|
|
188
|
+
}
|
|
189
|
+
*/
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'effortDriven',
|
|
194
|
+
name: 'Effort Driven',
|
|
195
|
+
field: 'effortDriven',
|
|
196
|
+
minWidth: 100,
|
|
197
|
+
width: 120,
|
|
198
|
+
formatter: Formatters.checkmarkMaterial,
|
|
199
|
+
filterable: true,
|
|
200
|
+
filter: {
|
|
201
|
+
collection: [
|
|
202
|
+
{ value: '', label: '' },
|
|
203
|
+
{ value: true, label: 'True' },
|
|
204
|
+
{ value: false, label: 'False' },
|
|
205
|
+
],
|
|
206
|
+
model: Filters.singleSelect,
|
|
207
|
+
},
|
|
208
|
+
sortable: true,
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: 'title1',
|
|
212
|
+
name: 'Title 1',
|
|
213
|
+
field: 'title1',
|
|
214
|
+
minWidth: 100,
|
|
215
|
+
width: 120,
|
|
216
|
+
filterable: true,
|
|
217
|
+
sortable: true,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 'title2',
|
|
221
|
+
name: 'Title 2',
|
|
222
|
+
field: 'title2',
|
|
223
|
+
minWidth: 100,
|
|
224
|
+
width: 120,
|
|
225
|
+
filterable: true,
|
|
226
|
+
sortable: true,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: 'title3',
|
|
230
|
+
name: 'Title 3',
|
|
231
|
+
field: 'title3',
|
|
232
|
+
minWidth: 100,
|
|
233
|
+
width: 120,
|
|
234
|
+
filterable: true,
|
|
235
|
+
sortable: true,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: 'title4',
|
|
239
|
+
name: 'Title 4',
|
|
240
|
+
field: 'title4',
|
|
241
|
+
minWidth: 100,
|
|
242
|
+
width: 120,
|
|
243
|
+
filterable: true,
|
|
244
|
+
sortable: true,
|
|
245
|
+
},
|
|
246
|
+
];
|
|
247
|
+
|
|
248
|
+
this.gridOptions = {
|
|
249
|
+
autoResize: {
|
|
250
|
+
container: '#demo-container',
|
|
251
|
+
rightPadding: 10,
|
|
252
|
+
},
|
|
253
|
+
enableExcelCopyBuffer: true,
|
|
254
|
+
enableCellNavigation: true,
|
|
255
|
+
editable: true,
|
|
256
|
+
autoEdit: true,
|
|
257
|
+
asyncEditorLoading: true,
|
|
258
|
+
frozenColumn: this.frozenColumnCount,
|
|
259
|
+
frozenRow: this.frozenRowCount,
|
|
260
|
+
// frozenBottom: true, // if you want to freeze the bottom instead of the top, you can enable this property
|
|
261
|
+
|
|
262
|
+
gridMenu: { hideClearFrozenColumnsCommand: false },
|
|
263
|
+
headerMenu: { hideFreezeColumnsCommand: false },
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// mock a dataset
|
|
267
|
+
this.dataset = this.getData();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
getData() {
|
|
271
|
+
// Set up some test columns.
|
|
272
|
+
const mockDataset = [];
|
|
273
|
+
for (let i = 0; i < 500; i++) {
|
|
274
|
+
mockDataset[i] = {
|
|
275
|
+
id: i,
|
|
276
|
+
title: 'Task ' + i,
|
|
277
|
+
cost: i % 33 === 0 ? null : Math.random() * 10000,
|
|
278
|
+
duration: i % 8 ? Math.round(Math.random() * 100) + '' : null,
|
|
279
|
+
percentComplete: Math.round(Math.random() * 100),
|
|
280
|
+
start: new Date(2009, 0, 1),
|
|
281
|
+
finish: new Date(2009, 4, 5),
|
|
282
|
+
effortDriven: i % 5 === 0,
|
|
283
|
+
title1: `Some Text ${Math.round(Math.random() * 25)}`,
|
|
284
|
+
title2: `Some Text ${Math.round(Math.random() * 25)}`,
|
|
285
|
+
title3: `Some Text ${Math.round(Math.random() * 25)}`,
|
|
286
|
+
title4: `Some Text ${Math.round(Math.random() * 25)}`,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
return mockDataset;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** change dynamically, through slickgrid "setOptions()" the number of pinned columns */
|
|
293
|
+
changeFrozenColumnCount() {
|
|
294
|
+
if (this.gridObj && this.gridObj.setOptions) {
|
|
295
|
+
this.gridObj.setOptions({
|
|
296
|
+
frozenColumn: this.frozenColumnCount,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** change dynamically, through slickgrid "setOptions()" the number of pinned rows */
|
|
302
|
+
changeFrozenRowCount() {
|
|
303
|
+
if (this.gridObj && this.gridObj.setOptions) {
|
|
304
|
+
this.gridObj.setOptions({
|
|
305
|
+
frozenRow: this.frozenRowCount,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
costDurationFormatter(_row: number, _cell: number, _value: any, _columnDef: Column, dataContext: any) {
|
|
311
|
+
const costText = this.isNullUndefinedOrEmpty(dataContext.cost) ? 'n/a' : formatNumber(dataContext.cost, 0, 2, false, '$', '', '.', ',');
|
|
312
|
+
let durationText = 'n/a';
|
|
313
|
+
if (!this.isNullUndefinedOrEmpty(dataContext.duration) && dataContext.duration >= 0) {
|
|
314
|
+
durationText = `${dataContext.duration} ${dataContext.duration > 1 ? 'days' : 'day'}`;
|
|
315
|
+
}
|
|
316
|
+
return `<b>${costText}</b> | ${durationText}`;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
isNullUndefinedOrEmpty(data: any) {
|
|
320
|
+
return data === '' || data === null || data === undefined;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
onValidationError(e: Event, args: any) {
|
|
324
|
+
alert(args.validationResults.msg);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
setFrozenColumns(frozenCols: number) {
|
|
328
|
+
this.gridObj.setOptions({ frozenColumn: frozenCols });
|
|
329
|
+
this.gridOptions = this.gridObj.getOptions();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** toggle dynamically, through slickgrid "setOptions()" the top/bottom pinned location */
|
|
333
|
+
toggleFrozenBottomRows() {
|
|
334
|
+
if (this.gridObj && this.gridObj.setOptions) {
|
|
335
|
+
this.gridObj.setOptions({
|
|
336
|
+
frozenBottom: !this.isFrozenBottom,
|
|
337
|
+
});
|
|
338
|
+
this.isFrozenBottom = !this.isFrozenBottom; // toggle the variable
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<div class="container-fluid">
|
|
2
|
+
<h2>
|
|
3
|
+
Example 21: Grid AutoHeight
|
|
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-autoheight.component.ts"
|
|
9
|
+
>
|
|
10
|
+
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
+
</a>
|
|
12
|
+
</span>
|
|
13
|
+
</h2>
|
|
14
|
+
<div class="subtitle">
|
|
15
|
+
The SlickGrid option "autoHeight" can be used if you wish to keep the full height of the grid without any scrolling
|
|
16
|
+
<ul>
|
|
17
|
+
<li>You define a fixed grid width via "gridWidth" in the View</li>
|
|
18
|
+
<li>You can still use the "autoResize" for the width to be resized automatically (the height will never change in this case)</li>
|
|
19
|
+
<li>
|
|
20
|
+
This dataset has 25 rows, if you scroll down the page you can see the entire set is shown without any grid scrolling (though you
|
|
21
|
+
might have browser scrolling)
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="row row-cols-lg-auto g-1 align-items-center">
|
|
27
|
+
<div class="col">
|
|
28
|
+
<label for="columnSelect">Single Search:</label>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="col">
|
|
31
|
+
<select
|
|
32
|
+
class="form-select"
|
|
33
|
+
data-test="search-column-list"
|
|
34
|
+
name="selectedColumn"
|
|
35
|
+
[(ngModel)]="selectedColumn"
|
|
36
|
+
(ngModelChange)="updateFilter()"
|
|
37
|
+
>
|
|
38
|
+
<option [ngValue]="field" *ngFor="let field of columnDefinitions">{{ field.name }}</option>
|
|
39
|
+
</select>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="col">
|
|
42
|
+
<select
|
|
43
|
+
class="form-select"
|
|
44
|
+
data-test="search-operator-list"
|
|
45
|
+
name="selectedOperator"
|
|
46
|
+
[(ngModel)]="selectedOperator"
|
|
47
|
+
(ngModelChange)="updateFilter()"
|
|
48
|
+
>
|
|
49
|
+
<option [ngValue]="operator" *ngFor="let operator of operatorList">{{ operator }}</option>
|
|
50
|
+
</select>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="col">
|
|
54
|
+
<div class="input-group">
|
|
55
|
+
<input
|
|
56
|
+
type="text"
|
|
57
|
+
class="form-control"
|
|
58
|
+
data-test="search-value-input"
|
|
59
|
+
name="searchValue"
|
|
60
|
+
placeholder="search value"
|
|
61
|
+
autocomplete="off"
|
|
62
|
+
(input)="updateFilter()"
|
|
63
|
+
[(ngModel)]="searchValue"
|
|
64
|
+
/>
|
|
65
|
+
<button
|
|
66
|
+
class="btn btn-outline-secondary d-flex align-items-center pl-2 pr-2"
|
|
67
|
+
data-test="clear-search-value"
|
|
68
|
+
(click)="clearGridSearchInput()"
|
|
69
|
+
>
|
|
70
|
+
<span class="mdi mdi-close"></span>
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<hr />
|
|
77
|
+
|
|
78
|
+
<angular-slickgrid
|
|
79
|
+
gridId="grid21"
|
|
80
|
+
[columns]="columnDefinitions"
|
|
81
|
+
[options]="gridOptions"
|
|
82
|
+
[dataset]="dataset"
|
|
83
|
+
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
84
|
+
>
|
|
85
|
+
</angular-slickgrid>
|
|
86
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// sort indication will show behind Grid Menu since we don't have scroll,
|
|
2
|
+
// we can offset these icons to fix that
|
|
3
|
+
#grid23 {
|
|
4
|
+
.slick-header-column:last-child {
|
|
5
|
+
.slick-header-menu-button,
|
|
6
|
+
.slick-resizable-handle,
|
|
7
|
+
.slick-sort-indicator,
|
|
8
|
+
.slick-sort-indicator-numbered {
|
|
9
|
+
margin-right: 18px; // grid menu icon width
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.duration-bg {
|
|
15
|
+
background-color: #e9d4f1 !important;
|
|
16
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { AngularGridInstance, Column, Formatters, GridOption, OperatorString, SlickDataView, SlickGrid } from '../../library';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
encapsulation: ViewEncapsulation.None,
|
|
6
|
+
styleUrls: ['./example21.component.scss'],
|
|
7
|
+
templateUrl: './example21.component.html',
|
|
8
|
+
standalone: false,
|
|
9
|
+
})
|
|
10
|
+
export class Example21Component implements OnInit {
|
|
11
|
+
angularGrid!: AngularGridInstance;
|
|
12
|
+
grid!: SlickGrid;
|
|
13
|
+
dataView!: SlickDataView;
|
|
14
|
+
columnDefinitions: Column[] = [];
|
|
15
|
+
gridOptions!: GridOption;
|
|
16
|
+
dataset!: any[];
|
|
17
|
+
operatorList: OperatorString[] = ['=', '<', '<=', '>', '>=', '<>', 'StartsWith', 'EndsWith'];
|
|
18
|
+
selectedOperator = '=';
|
|
19
|
+
searchValue = '';
|
|
20
|
+
selectedColumn?: Column;
|
|
21
|
+
|
|
22
|
+
ngOnInit() {
|
|
23
|
+
this.prepareGrid();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
angularGridReady(angularGrid: AngularGridInstance) {
|
|
27
|
+
this.angularGrid = angularGrid;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
prepareGrid() {
|
|
31
|
+
this.columnDefinitions = [
|
|
32
|
+
{
|
|
33
|
+
id: 'title',
|
|
34
|
+
name: 'Title',
|
|
35
|
+
field: 'title',
|
|
36
|
+
sortable: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'duration',
|
|
40
|
+
name: 'Duration (days)',
|
|
41
|
+
field: 'duration',
|
|
42
|
+
sortable: true,
|
|
43
|
+
type: 'number',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'complete',
|
|
47
|
+
name: '% Complete',
|
|
48
|
+
field: 'percentComplete',
|
|
49
|
+
formatter: Formatters.percentCompleteBar,
|
|
50
|
+
sortable: true,
|
|
51
|
+
type: 'number',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'start',
|
|
55
|
+
name: 'Start',
|
|
56
|
+
field: 'start',
|
|
57
|
+
formatter: Formatters.dateIso,
|
|
58
|
+
sortable: true,
|
|
59
|
+
type: 'date',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'finish',
|
|
63
|
+
name: 'Finish',
|
|
64
|
+
field: 'finish',
|
|
65
|
+
formatter: Formatters.dateIso,
|
|
66
|
+
sortable: true,
|
|
67
|
+
type: 'date',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'effort-driven',
|
|
71
|
+
name: 'Effort Driven',
|
|
72
|
+
field: 'effortDriven',
|
|
73
|
+
formatter: Formatters.checkmarkMaterial,
|
|
74
|
+
sortable: true,
|
|
75
|
+
type: 'number',
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
this.selectedColumn = this.columnDefinitions[0];
|
|
79
|
+
|
|
80
|
+
this.gridOptions = {
|
|
81
|
+
// if you want to disable autoResize and use a fixed width which requires horizontal scrolling
|
|
82
|
+
// it's advised to disable the autoFitColumnsOnFirstLoad as well
|
|
83
|
+
// enableAutoResize: false,
|
|
84
|
+
// autoFitColumnsOnFirstLoad: false,
|
|
85
|
+
|
|
86
|
+
autoHeight: true,
|
|
87
|
+
autoResize: {
|
|
88
|
+
container: '#demo-container',
|
|
89
|
+
rightPadding: 10,
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// enable the filtering but hide the user filter row since we use our own single filter
|
|
93
|
+
enableFiltering: true,
|
|
94
|
+
showHeaderRow: false, // hide the filter row (header row)
|
|
95
|
+
|
|
96
|
+
alwaysShowVerticalScroll: false,
|
|
97
|
+
enableColumnPicker: true,
|
|
98
|
+
enableCellNavigation: true,
|
|
99
|
+
enableRowSelection: true,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// mock a dataset
|
|
103
|
+
const mockedDataset = [];
|
|
104
|
+
for (let i = 0; i < 25; i++) {
|
|
105
|
+
const randomYear = 2000 + Math.floor(Math.random() * 10);
|
|
106
|
+
const randomMonth = Math.floor(Math.random() * 11);
|
|
107
|
+
const randomDay = Math.floor(Math.random() * 29);
|
|
108
|
+
const randomPercent = Math.round(Math.random() * 100);
|
|
109
|
+
|
|
110
|
+
mockedDataset[i] = {
|
|
111
|
+
id: i,
|
|
112
|
+
title: 'Task ' + i,
|
|
113
|
+
duration: Math.round(Math.random() * 100) + '',
|
|
114
|
+
percentComplete: randomPercent,
|
|
115
|
+
percentCompleteNumber: randomPercent,
|
|
116
|
+
start: new Date(randomYear, randomMonth, randomDay),
|
|
117
|
+
finish: new Date(randomYear, randomMonth + 1, randomDay),
|
|
118
|
+
effortDriven: i % 5 === 0,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
this.dataset = mockedDataset;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
//
|
|
125
|
+
// -- if any of the Search form input changes, we'll call the updateFilter() method
|
|
126
|
+
//
|
|
127
|
+
|
|
128
|
+
clearGridSearchInput() {
|
|
129
|
+
this.searchValue = '';
|
|
130
|
+
this.updateFilter();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
updateFilter() {
|
|
134
|
+
this.angularGrid.filterService.updateSingleFilter({
|
|
135
|
+
columnId: `${this.selectedColumn!.id || ''}`,
|
|
136
|
+
operator: this.selectedOperator as OperatorString,
|
|
137
|
+
searchTerms: [this.searchValue || ''],
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<div class="container-fluid">
|
|
2
|
+
<h2>
|
|
3
|
+
Example 22: Grids in Bootstrap Tabs
|
|
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-tabs.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 demonstrate the creation of multiple grids in Bootstrap Tabs
|
|
16
|
+
<ol>
|
|
17
|
+
<li>Regular mocked data with javascript</li>
|
|
18
|
+
<li>Load dataset through Http-Client. Also note we need to call a "resizeGrid()" after focusing on this tab</li>
|
|
19
|
+
</ol>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div>
|
|
23
|
+
<tabset>
|
|
24
|
+
<tab heading="Javascript" id="javascript" data-test="javascript-tab">
|
|
25
|
+
<h4>Grid 1 - Load Local Data</h4>
|
|
26
|
+
<angular-slickgrid gridId="grid1" [columns]="columnDefinitions1" [options]="gridOptions1" [dataset]="dataset1"> </angular-slickgrid>
|
|
27
|
+
</tab>
|
|
28
|
+
<tab heading="Http-Client" data-test="http-tab" (selectTab)="resizeGrid2()">
|
|
29
|
+
<h4>Grid 2 - Load a JSON dataset through Http-Client</h4>
|
|
30
|
+
<angular-slickgrid
|
|
31
|
+
gridId="grid2"
|
|
32
|
+
[columns]="columnDefinitions2"
|
|
33
|
+
[options]="gridOptions2"
|
|
34
|
+
[dataset]="dataset2"
|
|
35
|
+
(onAngularGridCreated)="angularGrid2Ready($event.detail)"
|
|
36
|
+
>
|
|
37
|
+
</angular-slickgrid>
|
|
38
|
+
</tab>
|
|
39
|
+
</tabset>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|