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