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,453 @@
|
|
|
1
|
+
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { ExcelExportService } from '@slickgrid-universal/excel-export';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
addWhiteSpaces,
|
|
6
|
+
AngularGridInstance,
|
|
7
|
+
Aggregators,
|
|
8
|
+
Column,
|
|
9
|
+
decimalFormatted,
|
|
10
|
+
Filters,
|
|
11
|
+
findItemInTreeStructure,
|
|
12
|
+
Formatter,
|
|
13
|
+
Formatters,
|
|
14
|
+
GridOption,
|
|
15
|
+
isNumber,
|
|
16
|
+
SlickDataView,
|
|
17
|
+
} from '../../library';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
templateUrl: './example28.component.html',
|
|
21
|
+
styleUrls: ['example28.component.scss'],
|
|
22
|
+
encapsulation: ViewEncapsulation.None,
|
|
23
|
+
standalone: false,
|
|
24
|
+
})
|
|
25
|
+
export class Example28Component implements OnInit {
|
|
26
|
+
angularGrid!: AngularGridInstance;
|
|
27
|
+
dataViewObj: any;
|
|
28
|
+
gridObj: any;
|
|
29
|
+
gridOptions!: GridOption;
|
|
30
|
+
columnDefinitions!: Column[];
|
|
31
|
+
datasetHierarchical: any[] = [];
|
|
32
|
+
isExcludingChildWhenFiltering = false;
|
|
33
|
+
isAutoApproveParentItemWhenTreeColumnIsValid = true;
|
|
34
|
+
isAutoRecalcTotalsOnFilterChange = false;
|
|
35
|
+
isRemoveLastInsertedPopSongDisabled = true;
|
|
36
|
+
lastInsertedPopSongId: number | undefined;
|
|
37
|
+
searchString = '';
|
|
38
|
+
|
|
39
|
+
ngOnInit(): void {
|
|
40
|
+
// define the grid options & columns and then create the grid itself
|
|
41
|
+
this.defineGrid();
|
|
42
|
+
|
|
43
|
+
// mock a dataset
|
|
44
|
+
this.datasetHierarchical = this.mockDataset();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
defineGrid() {
|
|
48
|
+
this.columnDefinitions = [
|
|
49
|
+
{
|
|
50
|
+
id: 'file',
|
|
51
|
+
name: 'Files',
|
|
52
|
+
field: 'file',
|
|
53
|
+
width: 150,
|
|
54
|
+
formatter: this.treeFormatter,
|
|
55
|
+
filterable: true,
|
|
56
|
+
sortable: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'dateModified',
|
|
60
|
+
name: 'Date Modified',
|
|
61
|
+
field: 'dateModified',
|
|
62
|
+
formatter: Formatters.dateIso,
|
|
63
|
+
type: 'dateUtc',
|
|
64
|
+
outputType: 'dateIso',
|
|
65
|
+
minWidth: 90,
|
|
66
|
+
exportWithFormatter: true,
|
|
67
|
+
filterable: true,
|
|
68
|
+
filter: { model: Filters.compoundDate },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'description',
|
|
72
|
+
name: 'Description',
|
|
73
|
+
field: 'description',
|
|
74
|
+
minWidth: 90,
|
|
75
|
+
filterable: true,
|
|
76
|
+
sortable: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'size',
|
|
80
|
+
name: 'Size',
|
|
81
|
+
field: 'size',
|
|
82
|
+
minWidth: 90,
|
|
83
|
+
type: 'number',
|
|
84
|
+
exportWithFormatter: true,
|
|
85
|
+
excelExportOptions: { autoDetectCellFormat: false },
|
|
86
|
+
filterable: true,
|
|
87
|
+
filter: { model: Filters.compoundInputNumber },
|
|
88
|
+
|
|
89
|
+
// Formatter option #1 (treeParseTotalFormatters)
|
|
90
|
+
// if you wish to use any of the GroupTotalFormatters (or even regular Formatters), we can do so with the code below
|
|
91
|
+
// use `treeTotalsFormatter` or `groupTotalsFormatter` to show totals in a Tree Data grid
|
|
92
|
+
// provide any regular formatters inside the params.formatters
|
|
93
|
+
|
|
94
|
+
// formatter: Formatters.treeParseTotals,
|
|
95
|
+
// treeTotalsFormatter: GroupTotalFormatters.sumTotalsBold,
|
|
96
|
+
// // groupTotalsFormatter: GroupTotalFormatters.sumTotalsBold,
|
|
97
|
+
// params: {
|
|
98
|
+
// // we can also supply extra params for Formatters/GroupTotalFormatters like min/max decimals
|
|
99
|
+
// groupFormatterSuffix: ' MB', minDecimal: 0, maxDecimal: 2,
|
|
100
|
+
// },
|
|
101
|
+
|
|
102
|
+
// OR option #2 (custom Formatter)
|
|
103
|
+
formatter: (_row, _cell, value, column, dataContext) => {
|
|
104
|
+
// parent items will a "__treeTotals" property (when creating the Tree and running Aggregation, it mutates all items, all extra props starts with "__" prefix)
|
|
105
|
+
const fieldId = column.field;
|
|
106
|
+
|
|
107
|
+
// Tree Totals, if exists, will be found under `__treeTotals` prop
|
|
108
|
+
if (dataContext?.__treeTotals !== undefined) {
|
|
109
|
+
const treeLevel = dataContext[this.gridOptions?.treeDataOptions?.levelPropName || '__treeLevel'];
|
|
110
|
+
const sumVal = dataContext?.__treeTotals?.['sum'][fieldId];
|
|
111
|
+
const avgVal = dataContext?.__treeTotals?.['avg'][fieldId];
|
|
112
|
+
|
|
113
|
+
if (avgVal !== undefined && sumVal !== undefined) {
|
|
114
|
+
// when found Avg & Sum, we'll display both
|
|
115
|
+
return isNaN(sumVal)
|
|
116
|
+
? ''
|
|
117
|
+
: `<span class="text-primary bold">sum: ${decimalFormatted(sumVal, 0, 2)} MB</span> / <span class="avg-total">avg: ${decimalFormatted(avgVal, 0, 2)} MB</span> <span class="total-suffix">(${treeLevel === 0 ? 'total' : 'sub-total'})</span>`;
|
|
118
|
+
} else if (sumVal !== undefined) {
|
|
119
|
+
// or when only Sum is aggregated, then just show Sum
|
|
120
|
+
return isNaN(sumVal)
|
|
121
|
+
? ''
|
|
122
|
+
: `<span class="text-primary bold">sum: ${decimalFormatted(sumVal, 0, 2)} MB</span> <span class="total-suffix">(${treeLevel === 0 ? 'total' : 'sub-total'})</span>`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// reaching this line means it's a regular dataContext without totals, so regular formatter output will be used
|
|
126
|
+
return !isNumber(value) ? '' : `${value} MB`;
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
this.gridOptions = {
|
|
132
|
+
autoResize: {
|
|
133
|
+
autoHeight: false,
|
|
134
|
+
container: '#demo-container',
|
|
135
|
+
rightPadding: 10,
|
|
136
|
+
},
|
|
137
|
+
enableAutoSizeColumns: true,
|
|
138
|
+
enableAutoResize: true,
|
|
139
|
+
enableExcelExport: true,
|
|
140
|
+
excelExportOptions: {
|
|
141
|
+
exportWithFormatter: true,
|
|
142
|
+
sanitizeDataExport: true,
|
|
143
|
+
},
|
|
144
|
+
externalResources: [new ExcelExportService()],
|
|
145
|
+
enableFiltering: true,
|
|
146
|
+
enableTreeData: true, // you must enable this flag for the filtering & sorting to work as expected
|
|
147
|
+
multiColumnSort: false, // multi-column sorting is not supported with Tree Data, so you need to disable it
|
|
148
|
+
treeDataOptions: {
|
|
149
|
+
columnId: 'file',
|
|
150
|
+
childrenPropName: 'files',
|
|
151
|
+
excludeChildrenWhenFilteringTree: this.isExcludingChildWhenFiltering, // defaults to false
|
|
152
|
+
|
|
153
|
+
// skip any other filter criteria(s) if the column holding the Tree (file) passes its own filter criteria
|
|
154
|
+
// (e.g. filtering with "Files = music AND Size > 7", the row "Music" and children will only show up when this flag is enabled
|
|
155
|
+
// this flag only works with the other flag set to `excludeChildrenWhenFilteringTree: false`
|
|
156
|
+
autoApproveParentItemWhenTreeColumnIsValid: this.isAutoApproveParentItemWhenTreeColumnIsValid,
|
|
157
|
+
|
|
158
|
+
// you can also optionally sort by a different column and/or change sort direction
|
|
159
|
+
// initialSort: {
|
|
160
|
+
// columnId: 'file',
|
|
161
|
+
// direction: 'DESC'
|
|
162
|
+
// },
|
|
163
|
+
|
|
164
|
+
// Aggregators are also supported and must always be an array even when single one is provided
|
|
165
|
+
// Note: only 5 are currently supported: Avg, Sum, Min, Max and Count
|
|
166
|
+
// Note 2: also note that Avg Aggregator will automatically give you the "avg", "count" and "sum" so if you need these 3 then simply calling Avg will give you better perf
|
|
167
|
+
// aggregators: [new Aggregators.Sum('size')]
|
|
168
|
+
aggregators: [
|
|
169
|
+
new Aggregators.Avg('size'),
|
|
170
|
+
new Aggregators.Sum('size') /* , new Aggregators.Min('size'), new Aggregators.Max('size') */,
|
|
171
|
+
],
|
|
172
|
+
|
|
173
|
+
// should we auto-recalc Tree Totals (when using Aggregators) anytime a filter changes
|
|
174
|
+
// it is disabled by default for perf reason, by default it will only calculate totals on first load
|
|
175
|
+
autoRecalcTotalsOnFilterChange: this.isAutoRecalcTotalsOnFilterChange,
|
|
176
|
+
|
|
177
|
+
// add optional debounce time to limit number of execution that recalc is called, mostly useful on large dataset
|
|
178
|
+
// autoRecalcTotalsDebounce: 250
|
|
179
|
+
},
|
|
180
|
+
// change header/cell row height
|
|
181
|
+
headerRowHeight: 35,
|
|
182
|
+
rowHeight: 33,
|
|
183
|
+
showCustomFooter: true,
|
|
184
|
+
|
|
185
|
+
// we can also preset collapsed items via Grid Presets (parentId: 4 => is the "pdf" folder)
|
|
186
|
+
presets: {
|
|
187
|
+
treeData: { toggledItems: [{ itemId: 4, isCollapsed: true }] },
|
|
188
|
+
},
|
|
189
|
+
// use Material Design SVG icons
|
|
190
|
+
contextMenu: {
|
|
191
|
+
iconCollapseAllGroupsCommand: 'mdi mdi-arrow-collapse',
|
|
192
|
+
iconExpandAllGroupsCommand: 'mdi mdi-arrow-expand',
|
|
193
|
+
iconClearGroupingCommand: 'mdi mdi-close',
|
|
194
|
+
iconCopyCellValueCommand: 'mdi mdi-content-copy',
|
|
195
|
+
iconExportCsvCommand: 'mdi mdi-download',
|
|
196
|
+
iconExportExcelCommand: 'mdi mdi-file-excel-outline',
|
|
197
|
+
iconExportTextDelimitedCommand: 'mdi mdi-download',
|
|
198
|
+
},
|
|
199
|
+
gridMenu: {
|
|
200
|
+
iconCssClass: 'mdi mdi-menu',
|
|
201
|
+
iconClearAllFiltersCommand: 'mdi mdi-filter-remove-outline',
|
|
202
|
+
iconClearAllSortingCommand: 'mdi mdi-swap-vertical',
|
|
203
|
+
iconExportCsvCommand: 'mdi mdi-download',
|
|
204
|
+
iconExportExcelCommand: 'mdi mdi-file-excel-outline',
|
|
205
|
+
iconExportTextDelimitedCommand: 'mdi mdi-download',
|
|
206
|
+
iconRefreshDatasetCommand: 'mdi mdi-sync',
|
|
207
|
+
iconToggleFilterCommand: 'mdi mdi-flip-vertical',
|
|
208
|
+
iconTogglePreHeaderCommand: 'mdi mdi-flip-vertical',
|
|
209
|
+
},
|
|
210
|
+
headerMenu: {
|
|
211
|
+
iconClearFilterCommand: 'mdi mdi mdi-filter-remove-outline',
|
|
212
|
+
iconClearSortCommand: 'mdi mdi-swap-vertical',
|
|
213
|
+
iconSortAscCommand: 'mdi mdi-sort-ascending',
|
|
214
|
+
iconSortDescCommand: 'mdi mdi-flip-v mdi-sort-descending',
|
|
215
|
+
iconColumnHideCommand: 'mdi mdi-close',
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
angularGridReady(angularGrid: AngularGridInstance) {
|
|
221
|
+
this.angularGrid = angularGrid;
|
|
222
|
+
this.gridObj = angularGrid.slickGrid;
|
|
223
|
+
this.dataViewObj = angularGrid.dataView;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
changeAutoApproveParentItem() {
|
|
227
|
+
this.isAutoApproveParentItemWhenTreeColumnIsValid = !this.isAutoApproveParentItemWhenTreeColumnIsValid;
|
|
228
|
+
this.gridOptions.treeDataOptions!.autoApproveParentItemWhenTreeColumnIsValid = this.isAutoApproveParentItemWhenTreeColumnIsValid;
|
|
229
|
+
this.angularGrid.slickGrid.setOptions(this.gridOptions);
|
|
230
|
+
this.angularGrid.filterService.refreshTreeDataFilters();
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
changeAutoRecalcTotalsOnFilterChange() {
|
|
235
|
+
this.isAutoRecalcTotalsOnFilterChange = !this.isAutoRecalcTotalsOnFilterChange;
|
|
236
|
+
this.gridOptions.treeDataOptions!.autoRecalcTotalsOnFilterChange = this.isAutoRecalcTotalsOnFilterChange;
|
|
237
|
+
this.angularGrid.slickGrid?.setOptions(this.gridOptions);
|
|
238
|
+
|
|
239
|
+
// since it doesn't take current filters in consideration, we better clear them
|
|
240
|
+
this.angularGrid.filterService.clearFilters();
|
|
241
|
+
this.angularGrid.treeDataService.enableAutoRecalcTotalsFeature();
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
changeExcludeChildWhenFiltering() {
|
|
246
|
+
this.isExcludingChildWhenFiltering = !this.isExcludingChildWhenFiltering;
|
|
247
|
+
this.gridOptions.treeDataOptions!.excludeChildrenWhenFilteringTree = this.isExcludingChildWhenFiltering;
|
|
248
|
+
this.angularGrid.slickGrid.setOptions(this.gridOptions);
|
|
249
|
+
this.angularGrid.filterService.refreshTreeDataFilters();
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
clearSearch() {
|
|
254
|
+
this.searchString = '';
|
|
255
|
+
this.updateFilter();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
searchStringChanged() {
|
|
259
|
+
this.updateFilter();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
updateFilter() {
|
|
263
|
+
this.angularGrid.filterService.updateFilters([{ columnId: 'file', searchTerms: [this.searchString] }], true, false, true);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
treeFormatter: Formatter = (_row, _cell, value, _columnDef, dataContext, grid) => {
|
|
267
|
+
const gridOptions = grid.getOptions();
|
|
268
|
+
const treeLevelPropName = (gridOptions.treeDataOptions && gridOptions.treeDataOptions.levelPropName) || '__treeLevel';
|
|
269
|
+
if (value === null || value === undefined || dataContext === undefined) {
|
|
270
|
+
return '';
|
|
271
|
+
}
|
|
272
|
+
const dataView = grid.getData<SlickDataView>();
|
|
273
|
+
const data = dataView.getItems();
|
|
274
|
+
const identifierPropName = dataView.getIdPropertyName() || 'id';
|
|
275
|
+
const idx = dataView.getIdxById(dataContext[identifierPropName]) as number;
|
|
276
|
+
const prefix = this.getFileIcon(value);
|
|
277
|
+
const treeLevel = dataContext[treeLevelPropName];
|
|
278
|
+
const exportIndentationLeadingChar = '.';
|
|
279
|
+
|
|
280
|
+
value = value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
281
|
+
const spacer = `<span style="display:inline-block; width:${15 * treeLevel}px;"></span>`;
|
|
282
|
+
const indentSpacer = addWhiteSpaces(5 * treeLevel);
|
|
283
|
+
|
|
284
|
+
if (data[idx + 1]?.[treeLevelPropName] > data[idx][treeLevelPropName] || data[idx]['__hasChildren']) {
|
|
285
|
+
const folderPrefix = `<span class="mdi icon ${dataContext.__collapsed ? 'mdi-folder' : 'mdi-folder-open'}"></span>`;
|
|
286
|
+
if (dataContext.__collapsed) {
|
|
287
|
+
return `<span class="hidden">${exportIndentationLeadingChar}</span>${spacer}${indentSpacer} <span class="slick-group-toggle collapsed" level="${treeLevel}"></span>${folderPrefix} ${prefix} ${value}`;
|
|
288
|
+
} else {
|
|
289
|
+
return `<span class="hidden">${exportIndentationLeadingChar}</span>${spacer}${indentSpacer} <span class="slick-group-toggle expanded" level="${treeLevel}"></span>${folderPrefix} ${prefix} ${value}`;
|
|
290
|
+
}
|
|
291
|
+
} else {
|
|
292
|
+
return `<span class="hidden">${exportIndentationLeadingChar}</span>${spacer}${indentSpacer} <span class="slick-group-toggle" level="${treeLevel}"></span>${prefix} ${value}`;
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
getFileIcon(value: string) {
|
|
297
|
+
let prefix = '';
|
|
298
|
+
if (value.includes('.pdf')) {
|
|
299
|
+
prefix = '<span class="mdi icon mdi-file-pdf-outline"></span>';
|
|
300
|
+
} else if (value.includes('.txt')) {
|
|
301
|
+
prefix = '<span class="mdi icon mdi-file-document-outline"></span>';
|
|
302
|
+
} else if (value.includes('.xls')) {
|
|
303
|
+
prefix = '<span class="mdi icon mdi-file-excel-outline"></span>';
|
|
304
|
+
} else if (value.includes('.mp3')) {
|
|
305
|
+
prefix = '<span class="mdi icon mdi-file-music-outline"></span>';
|
|
306
|
+
}
|
|
307
|
+
return prefix;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* A simple method to add a new item inside the first group that we find.
|
|
312
|
+
* After adding the item, it will sort by parent/child recursively
|
|
313
|
+
*/
|
|
314
|
+
addNewFile() {
|
|
315
|
+
const newId = this.dataViewObj.getLength() + 50;
|
|
316
|
+
|
|
317
|
+
// find first parent object and add the new item as a child
|
|
318
|
+
const tmpDatasetHierarchical = [...this.datasetHierarchical];
|
|
319
|
+
const popFolderItem = findItemInTreeStructure(tmpDatasetHierarchical, (x) => x.file === 'pop', 'files');
|
|
320
|
+
|
|
321
|
+
if (popFolderItem && Array.isArray(popFolderItem.files)) {
|
|
322
|
+
popFolderItem.files.push({
|
|
323
|
+
id: newId,
|
|
324
|
+
file: `pop-${newId}.mp3`,
|
|
325
|
+
dateModified: new Date(),
|
|
326
|
+
size: newId + 3,
|
|
327
|
+
});
|
|
328
|
+
this.lastInsertedPopSongId = newId;
|
|
329
|
+
this.isRemoveLastInsertedPopSongDisabled = false;
|
|
330
|
+
|
|
331
|
+
// overwrite hierarchical dataset which will also trigger a grid sort and rendering
|
|
332
|
+
this.datasetHierarchical = tmpDatasetHierarchical;
|
|
333
|
+
|
|
334
|
+
// scroll into the position, after insertion cycle, where the item was added
|
|
335
|
+
setTimeout(() => {
|
|
336
|
+
const rowIndex = this.dataViewObj.getRowById(popFolderItem.id);
|
|
337
|
+
this.gridObj.scrollRowIntoView(rowIndex + 3);
|
|
338
|
+
}, 10);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
deleteFile() {
|
|
343
|
+
const tmpDatasetHierarchical = [...this.datasetHierarchical];
|
|
344
|
+
const popFolderItem = findItemInTreeStructure(this.datasetHierarchical, (x) => x.file === 'pop', 'files');
|
|
345
|
+
const songItemFound = findItemInTreeStructure(this.datasetHierarchical, (x) => x.id === this.lastInsertedPopSongId, 'files');
|
|
346
|
+
|
|
347
|
+
if (popFolderItem && songItemFound) {
|
|
348
|
+
const songIdx = popFolderItem.files.findIndex((f: any) => f.id === songItemFound.id);
|
|
349
|
+
if (songIdx >= 0) {
|
|
350
|
+
popFolderItem.files.splice(songIdx, 1);
|
|
351
|
+
this.lastInsertedPopSongId = undefined;
|
|
352
|
+
this.isRemoveLastInsertedPopSongDisabled = true;
|
|
353
|
+
|
|
354
|
+
// overwrite hierarchical dataset which will also trigger a grid sort and rendering
|
|
355
|
+
this.datasetHierarchical = tmpDatasetHierarchical;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
clearFilters() {
|
|
361
|
+
this.angularGrid.filterService.clearFilters();
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
collapseAll() {
|
|
365
|
+
this.angularGrid.treeDataService.toggleTreeDataCollapse(true);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
expandAll() {
|
|
369
|
+
this.angularGrid.treeDataService.toggleTreeDataCollapse(false);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
logHierarchicalStructure() {
|
|
373
|
+
console.log('exploded array', this.angularGrid.treeDataService.datasetHierarchical);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
logFlatStructure() {
|
|
377
|
+
console.log('flat array', this.angularGrid.treeDataService.dataset);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
mockDataset() {
|
|
381
|
+
return [
|
|
382
|
+
{ id: 24, file: 'bucket-list.txt', dateModified: '2012-03-05T12:44:00.123Z', size: 0.5 },
|
|
383
|
+
{ id: 18, file: 'something.txt', dateModified: '2015-03-03T03:50:00.123Z', size: 90 },
|
|
384
|
+
{
|
|
385
|
+
id: 21,
|
|
386
|
+
file: 'documents',
|
|
387
|
+
files: [
|
|
388
|
+
{
|
|
389
|
+
id: 2,
|
|
390
|
+
file: 'txt',
|
|
391
|
+
files: [
|
|
392
|
+
{ id: 3, file: 'todo.txt', description: 'things to do someday maybe', dateModified: '2015-05-12T14:50:00.123Z', size: 0.7 },
|
|
393
|
+
],
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: 4,
|
|
397
|
+
file: 'pdf',
|
|
398
|
+
files: [
|
|
399
|
+
{ id: 22, file: 'map2.pdf', dateModified: '2015-07-21T08:22:00.123Z', size: 2.9 },
|
|
400
|
+
{ id: 5, file: 'map.pdf', dateModified: '2015-05-21T10:22:00.123Z', size: 3.1 },
|
|
401
|
+
{ id: 6, file: 'internet-bill.pdf', dateModified: '2015-05-12T14:50:00.123Z', size: 1.3 },
|
|
402
|
+
{ id: 23, file: 'phone-bill.pdf', dateModified: '2015-05-01T07:50:00.123Z', size: 1.5 },
|
|
403
|
+
],
|
|
404
|
+
},
|
|
405
|
+
{ id: 9, file: 'misc', files: [{ id: 10, file: 'warranties.txt', dateModified: '2015-02-26T16:50:00.123Z', size: 0.4 }] },
|
|
406
|
+
{ id: 7, file: 'xls', files: [{ id: 8, file: 'compilation.xls', dateModified: '2014-10-02T14:50:00.123Z', size: 2.3 }] },
|
|
407
|
+
{ id: 55, file: 'unclassified.csv', dateModified: '2015-04-08T03:44:12.333Z', size: 0.25 },
|
|
408
|
+
{ id: 56, file: 'unresolved.csv', dateModified: '2015-04-03T03:21:12.000Z', size: 0.79 },
|
|
409
|
+
{ id: 57, file: 'zebra.dll', dateModified: '2016-12-08T13:22:12.432', size: 1.22 },
|
|
410
|
+
],
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
id: 11,
|
|
414
|
+
file: 'music',
|
|
415
|
+
files: [
|
|
416
|
+
{
|
|
417
|
+
id: 12,
|
|
418
|
+
file: 'mp3',
|
|
419
|
+
files: [
|
|
420
|
+
{ id: 16, file: 'rock', files: [{ id: 17, file: 'soft.mp3', dateModified: '2015-05-13T13:50:00Z', size: 98 }] },
|
|
421
|
+
{
|
|
422
|
+
id: 14,
|
|
423
|
+
file: 'pop',
|
|
424
|
+
files: [
|
|
425
|
+
{ id: 15, file: 'theme.mp3', description: 'Movie Theme Song', dateModified: '2015-03-01T17:05:00Z', size: 47 },
|
|
426
|
+
{ id: 25, file: 'song.mp3', description: 'it is a song...', dateModified: '2016-10-04T06:33:44Z', size: 6.3 },
|
|
427
|
+
],
|
|
428
|
+
},
|
|
429
|
+
{ id: 33, file: 'other', files: [] },
|
|
430
|
+
],
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
id: 26,
|
|
436
|
+
file: 'recipes',
|
|
437
|
+
description: 'Cake Recipes',
|
|
438
|
+
dateModified: '2012-03-05T12:44:00.123Z',
|
|
439
|
+
files: [
|
|
440
|
+
{ id: 29, file: 'cheesecake', description: 'strawberry cheesecake', dateModified: '2012-04-04T13:52:00.123Z', size: 0.2 },
|
|
441
|
+
{
|
|
442
|
+
id: 30,
|
|
443
|
+
file: 'chocolate-cake',
|
|
444
|
+
description: 'tasty sweet chocolate cake',
|
|
445
|
+
dateModified: '2012-05-05T09:22:00.123Z',
|
|
446
|
+
size: 0.2,
|
|
447
|
+
},
|
|
448
|
+
{ id: 31, file: 'coffee-cake', description: 'chocolate coffee cake', dateModified: '2012-01-01T08:08:48.123Z', size: 0.2 },
|
|
449
|
+
],
|
|
450
|
+
},
|
|
451
|
+
];
|
|
452
|
+
}
|
|
453
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div id="demo-container" class="container-fluid">
|
|
2
|
+
<h2>
|
|
3
|
+
Example 29: Custom header & footer Templates
|
|
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-header-footer.component.ts"
|
|
9
|
+
>
|
|
10
|
+
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
+
</a>
|
|
12
|
+
</span>
|
|
13
|
+
</h2>
|
|
14
|
+
<div class="subtitle">
|
|
15
|
+
Basic Grid with templates for custom headers and footers
|
|
16
|
+
<ul>
|
|
17
|
+
<li>Pass in custom templates to be rendered at predefined header and footer destinations</li>
|
|
18
|
+
</ul>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<angular-slickgrid gridId="grid1" [columns]="columnDefinitions" [options]="gridOptions" [dataset]="dataset">
|
|
22
|
+
<ng-template #slickgridHeader>
|
|
23
|
+
<h3>Grid with header and footer slot</h3>
|
|
24
|
+
</ng-template>
|
|
25
|
+
|
|
26
|
+
<ng-template #slickgridFooter>
|
|
27
|
+
<custom-footer></custom-footer>
|
|
28
|
+
</ng-template>
|
|
29
|
+
</angular-slickgrid>
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { Column, GridOption, Formatters } from '../../library';
|
|
3
|
+
|
|
4
|
+
const NB_ITEMS = 995;
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
template: `<button (click)="clickMe()">I'm a button from an Angular component (click me)</button>
|
|
8
|
+
<div *ngIf="clickedTimes">You've clicked me {{ clickedTimes }} time(s)</div>`,
|
|
9
|
+
selector: 'custom-footer',
|
|
10
|
+
standalone: false,
|
|
11
|
+
})
|
|
12
|
+
export class CustomFooterComponent {
|
|
13
|
+
clickedTimes = 0;
|
|
14
|
+
|
|
15
|
+
clickMe() {
|
|
16
|
+
this.clickedTimes++;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
templateUrl: './example29.component.html',
|
|
22
|
+
standalone: false,
|
|
23
|
+
})
|
|
24
|
+
export class Example29Component implements OnInit {
|
|
25
|
+
columnDefinitions: Column[] = [];
|
|
26
|
+
gridOptions!: GridOption;
|
|
27
|
+
dataset!: any[];
|
|
28
|
+
|
|
29
|
+
ngOnInit(): void {
|
|
30
|
+
this.columnDefinitions = [
|
|
31
|
+
{ id: 'title', name: 'Title', field: 'title', sortable: true },
|
|
32
|
+
{ id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true },
|
|
33
|
+
{ id: '%', name: '% Complete', field: 'percentComplete', sortable: true },
|
|
34
|
+
{ id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso },
|
|
35
|
+
{ id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso },
|
|
36
|
+
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', sortable: true },
|
|
37
|
+
];
|
|
38
|
+
this.gridOptions = {
|
|
39
|
+
enableAutoResize: false,
|
|
40
|
+
enableSorting: true,
|
|
41
|
+
gridHeight: 225,
|
|
42
|
+
gridWidth: 800,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
this.dataset = this.mockData(NB_ITEMS);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
mockData(count: number) {
|
|
49
|
+
// mock a dataset
|
|
50
|
+
const mockDataset = [];
|
|
51
|
+
for (let i = 0; i < count; i++) {
|
|
52
|
+
const randomYear = 2000 + Math.floor(Math.random() * 10);
|
|
53
|
+
const randomMonth = Math.floor(Math.random() * 11);
|
|
54
|
+
const randomDay = Math.floor(Math.random() * 29);
|
|
55
|
+
const randomPercent = Math.round(Math.random() * 100);
|
|
56
|
+
|
|
57
|
+
mockDataset[i] = {
|
|
58
|
+
id: i,
|
|
59
|
+
title: 'Task ' + i,
|
|
60
|
+
duration: Math.round(Math.random() * 100) + '',
|
|
61
|
+
percentComplete: randomPercent,
|
|
62
|
+
start: new Date(randomYear, randomMonth + 1, randomDay),
|
|
63
|
+
finish: new Date(randomYear + 1, randomMonth + 1, randomDay),
|
|
64
|
+
effortDriven: i % 5 === 0,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return mockDataset;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<div id="demo-container" class="container-fluid">
|
|
2
|
+
<h2>
|
|
3
|
+
Example 30: Composite Editor Modal
|
|
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-composite-editor.component.ts"
|
|
9
|
+
>
|
|
10
|
+
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
+
</a>
|
|
12
|
+
</span>
|
|
13
|
+
<button class="ms-2 btn btn-outline-secondary btn-sm btn-icon" type="button" data-test="toggle-subtitle" (click)="toggleSubTitle()">
|
|
14
|
+
<span class="mdi mdi-information-outline" title="Toggle example sub-title details"></span>
|
|
15
|
+
</button>
|
|
16
|
+
<button class="btn btn-outline-secondary btn-sm" (click)="toggleDarkMode()" data-test="toggle-dark-mode">
|
|
17
|
+
<span class="mdi mdi-theme-light-dark"></span>
|
|
18
|
+
<span>Toggle Dark Mode</span>
|
|
19
|
+
</button>
|
|
20
|
+
</h2>
|
|
21
|
+
<div class="subtitle">
|
|
22
|
+
Composite Editor allows you to Create, Clone, Edit, Mass Update & Mass Selection Changes inside a nice Modal Window.
|
|
23
|
+
<br />The modal is simply populated by looping through your column definition list and also uses a lot of the same logic as inline
|
|
24
|
+
editing (see
|
|
25
|
+
<a href="https://ghiscoding.gitbook.io/angular-slickgrid/grid-functionalities/composite-editor-modal" target="_blank"
|
|
26
|
+
>Composite Editor - Wiki</a
|
|
27
|
+
>.)
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="mb-2">
|
|
31
|
+
<div class="btn-group btn-group-sm" role="group" aria-label="Basic Editing Commands">
|
|
32
|
+
<button type="button" class="btn btn-outline-secondary btn-icon" data-test="toggle-readonly-btn" (click)="toggleGridEditReadonly()">
|
|
33
|
+
<i class="mdi mdi-table-edit"></i> Toggle Edit/Readonly Grid
|
|
34
|
+
</button>
|
|
35
|
+
<button type="button" class="btn btn-outline-secondary btn-icon" data-test="undo-last-edit-btn" (click)="undoLastEdit()">
|
|
36
|
+
<i class="mdi mdi-undo"></i> Undo Last Edit
|
|
37
|
+
</button>
|
|
38
|
+
<button type="button" class="btn btn-outline-secondary btn-icon" data-test="undo-open-editor-btn" (click)="undoLastEdit(true)">
|
|
39
|
+
<i class="mdi mdi-undo"></i> Undo Last Edit & Open Editor
|
|
40
|
+
</button>
|
|
41
|
+
<button type="button" class="btn btn-outline-secondary btn-icon" data-test="undo-all-edits-btn" (click)="undoAllEdits()">
|
|
42
|
+
<i class="mdi mdi-history"></i> Undo All Edits
|
|
43
|
+
</button>
|
|
44
|
+
<button type="button" class="btn btn-outline-secondary btn-icon" data-test="save-all-btn" (click)="saveAll()">
|
|
45
|
+
<span>Save All</span>
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="mb-3">
|
|
51
|
+
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
|
|
52
|
+
<button
|
|
53
|
+
type="button"
|
|
54
|
+
class="btn btn-outline-secondary btn-icon"
|
|
55
|
+
data-test="open-modal-create-btn"
|
|
56
|
+
(click)="openCompositeModal('create')"
|
|
57
|
+
[disabled]="isCompositeDisabled"
|
|
58
|
+
>
|
|
59
|
+
<i class="mdi mdi-shape-square-plus"></i> Item Create
|
|
60
|
+
</button>
|
|
61
|
+
<button
|
|
62
|
+
type="button"
|
|
63
|
+
class="btn btn-outline-secondary btn-icon"
|
|
64
|
+
data-test="open-modal-clone-btn"
|
|
65
|
+
(click)="openCompositeModal('clone')"
|
|
66
|
+
[disabled]="isCompositeDisabled"
|
|
67
|
+
>
|
|
68
|
+
<i class="mdi mdi-content-copy"></i> Item Clone
|
|
69
|
+
</button>
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
class="btn btn-outline-secondary btn-icon"
|
|
73
|
+
data-test="open-modal-edit-btn"
|
|
74
|
+
(click)="openCompositeModal('edit')"
|
|
75
|
+
[disabled]="isCompositeDisabled"
|
|
76
|
+
>
|
|
77
|
+
<i class="mdi mdi-pencil"></i> Item Edit
|
|
78
|
+
</button>
|
|
79
|
+
<button
|
|
80
|
+
type="button"
|
|
81
|
+
class="btn btn-outline-secondary btn-icon"
|
|
82
|
+
data-test="open-modal-mass-update-btn"
|
|
83
|
+
(click)="openCompositeModal('mass-update')"
|
|
84
|
+
[disabled]="isCompositeDisabled"
|
|
85
|
+
>
|
|
86
|
+
<i class="mdi mdi-pencil-box-multiple-outline"></i> Mass Update
|
|
87
|
+
</button>
|
|
88
|
+
<button
|
|
89
|
+
type="button"
|
|
90
|
+
class="btn btn-outline-secondary btn-icon"
|
|
91
|
+
data-test="open-modal-mass-selection-btn"
|
|
92
|
+
(click)="openCompositeModal('mass-selection')"
|
|
93
|
+
[disabled]="isMassSelectionDisabled"
|
|
94
|
+
>
|
|
95
|
+
<i class="mdi mdi-order-bool-ascending-variant"></i> Update Selected
|
|
96
|
+
</button>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<angular-slickgrid
|
|
101
|
+
gridId="grid30"
|
|
102
|
+
[columns]="columnDefinitions"
|
|
103
|
+
[options]="gridOptions"
|
|
104
|
+
[dataset]="dataset"
|
|
105
|
+
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
106
|
+
(onBeforeEditCell)="handleOnBeforeEditCell($event.detail.eventData, $event.detail.args)"
|
|
107
|
+
(onCellChange)="handleOnCellChange($event.detail.eventData, $event.detail.args)"
|
|
108
|
+
(onClick)="handleOnCellClicked($event.detail.eventData, $event.detail.args)"
|
|
109
|
+
(onCompositeEditorChange)="handleOnCompositeEditorChange($event.detail.eventData, $event.detail.args)"
|
|
110
|
+
(onItemsDeleted)="handleItemDeleted($event.detail)"
|
|
111
|
+
(onGridStateChanged)="handleOnGridStateChanged($event.detail)"
|
|
112
|
+
(onRowsOrCountChanged)="handleReRenderUnsavedStyling()"
|
|
113
|
+
(onValidationError)="handleValidationError($event.detail.eventData, $event.detail.args)"
|
|
114
|
+
>
|
|
115
|
+
</angular-slickgrid>
|
|
116
|
+
</div>
|