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,294 +0,0 @@
|
|
|
1
|
-
## Merging SlickGrid into `Slickgrid-Universal` (dropping `6pac/slickgrid` dep)
|
|
2
|
-
### The aim of this release is to be standalone, improve best practices & move towards CSP compliance while also making the project leaner.
|
|
3
|
-
|
|
4
|
-
There are a few changes, but it's for good reasons 😉
|
|
5
|
-
|
|
6
|
-
This new major release is dropping SlickGrid dependency (`6pac/slickgrid`) dependency entirely and no longer relies on external SlickGrid code. All core files are now included into the Slickgrid-Universal project instead of being an external dependency which was sometime hard to troubleshoot (which was the case for the past couple years). The main reason to move the core lib into the Slickgrid-Universal project is for simplicity but it also allows us to drop code that we never really used in Slickgrid-Universal (e.g. SlickGrid had its own `autosize` which is different than our implementation in `ResizerService`, see Slickgrid-Universal [Example 31](https://ghiscoding.github.io/Angular-Slickgrid/#/resize-by-content)). Migrating SlickGrid to native JS (dropping jQuery) also required a few DOM utils that were duplicated in both projects, with this release we can now deduplicate these methods. It was hard or impossible to achieve earlier because SlickGrid was always written as a JavaScript library while our project was written in TypeScript, but now that SlickGrid core lib was also migrated to TypeScript (I'm actually the person who worked on that), this is now allowing me to simply copy the new TypeScript code and merge it in here without too much effort. It's also been tested in the wild for couple months already and all bugs were discovered and fixed already, so I know the new code is also stable already.
|
|
7
|
-
|
|
8
|
-
Another great feature of this new major release is that I made a lot of improvements on the library for CSP (Content Security Policy) compliance, or at least provide ways to be compliant. One of the biggest change in that regard is that you can now create custom Formatters to return native HTML element (I rewrote a few built-in Formatters with that approach) and this is mostly to avoid the use of `innerHTML` which is not CSP safe by default.
|
|
9
|
-
|
|
10
|
-
With this new major version release, we can now say that the journey to modernize the project is now, for the most part, completed (in summary the following was achieved in Slickgrid-Universal: 1. dropped jQueryUI in v2, dropped jQuery v3 and now in v4 Slickgrid-Universal is no longer relying on external 6pac/SlickGrid dependency and is fully written in TypeScript with full ESM builds) and with that said, I do not expect any major changes (aka breaking) for the foreseeable future... we're pretty much done with the big changes!!! This new release should be a little more performant too with more native code, e.g. some Formatters were rewritten as native.
|
|
11
|
-
|
|
12
|
-
#### Major Changes - Quick Summary
|
|
13
|
-
- minimum requirements bump
|
|
14
|
-
- Node 18 is now required
|
|
15
|
-
- Slickgrid-Universal >= 4.x is now required
|
|
16
|
-
- TypeScript builds are now targeting ES2021 (bumped from ES2018)
|
|
17
|
-
- more CSP (Content Security Policy) safe
|
|
18
|
-
- you can create custom Formatter with native HTML element (to be more CSP safe), HTML strings are still accepted
|
|
19
|
-
- migrate to [Excel-Builder-Vanilla](https://github.com/ghiscoding/excel-builder-vanilla) (since >=4.4.0)
|
|
20
|
-
- for CSP safe, you also need to add `worker-src 'self' blob:;`
|
|
21
|
-
|
|
22
|
-
> **Note** for the full internal list of code changes applied in this Slickgrid-Universal release, you can take a look at the [Discussion - Roadmap to 4.0](https://github.com/ghiscoding/slickgrid-universal/discussions/1108)
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
**NOTE:** if you come from an earlier version, please make sure to follow each migration in their respected order (see Wiki index)
|
|
27
|
-
|
|
28
|
-
> **Note** after following the migration, if you have some build errors with missing `slickgrid` that is because you did not upgrade all Slickgrid-Universal dependencies that you may have. So in short **do not install SlickGrid** manually, this is wrong and we are no longer depending on 6pac/slickgrid since Slickgrid-Universal now has its own SlickGrid/SlickDataView core files.
|
|
29
|
-
|
|
30
|
-
## Changes
|
|
31
|
-
|
|
32
|
-
### Slickgrid-Universal
|
|
33
|
-
If you use any of the Slickgrid-Universal extra dependencies then make sure to upgrade them as well to the new major `4.0.0` version so that they work with Angular-Slickgrid `7.0.0`
|
|
34
|
-
|
|
35
|
-
```diff
|
|
36
|
-
"dependencies": {
|
|
37
|
-
- "@slickgrid-universal/excel-export": "^3.7.1",
|
|
38
|
-
+ "@slickgrid-universal/excel-export": "^4.0.1",
|
|
39
|
-
- "angular-slickgrid": "^6.6.0",
|
|
40
|
-
+ "angular-slickgrid": "^7.0.0",
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### `angular.json` config
|
|
45
|
-
Since we moved all the code into the Slickgrid-Universal project and it is now written in TypeScript, we can now say for certain that SlickGrid is no longer detected as CommonJS, we also no longer need SortableJS to be preloaded. So you can do the following changes to your `angular.json` config
|
|
46
|
-
|
|
47
|
-
```diff
|
|
48
|
-
# angular.json
|
|
49
|
-
{
|
|
50
|
-
"allowedCommonJsDependencies": [
|
|
51
|
-
"autocompleter",
|
|
52
|
-
"dompurify",
|
|
53
|
-
- "excel-builder-webpacker",
|
|
54
|
-
"flatpickr",
|
|
55
|
-
- "slickgrid",
|
|
56
|
-
"stream"
|
|
57
|
-
],
|
|
58
|
-
// ...
|
|
59
|
-
"scripts": [
|
|
60
|
-
"node_modules/bootstrap/dist/js/bootstrap.min.js",
|
|
61
|
-
- "node_modules/sortablejs/Sortable.min.js"
|
|
62
|
-
],
|
|
63
|
-
// ...
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Distribution folder
|
|
68
|
-
The `dist/commonjs` folder was renamed as `dist/cjs` to make it shorter and also to follow the new convention used in the JS world.
|
|
69
|
-
- this should be transparent for most users
|
|
70
|
-
|
|
71
|
-
#### `Slick` namespace on the `window` object is gone
|
|
72
|
-
By migrating the SlickGrid core files into the project, we are now taking full advantage of TypeScript classes but that is also indirectly drops the `Slick` namespace on the `window` object. The main usage of the `Slick` namespace for most users, is when you have an editable grid with the "undo" functionality, you will need to update your code as shown below.
|
|
73
|
-
|
|
74
|
-
```diff
|
|
75
|
-
+ { SlickEventHandler, SlickGlobalEditorLock } from '@slickgrid-universal/common';
|
|
76
|
-
- declare const Slick: SlickNamespace;
|
|
77
|
-
|
|
78
|
-
// ..
|
|
79
|
-
- eventHandler = Slick.EventHandler();
|
|
80
|
-
+ eventHandler = SlickEventHandler();
|
|
81
|
-
|
|
82
|
-
// ..
|
|
83
|
-
undo() {
|
|
84
|
-
const command = this.editCommandQueue.pop();
|
|
85
|
-
- if (command && Slick.GlobalEditorLock.cancelCurrentEdit()) {
|
|
86
|
-
+ if (command && SlickGlobalEditorLock.cancelCurrentEdit()) {
|
|
87
|
-
command.undo();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Composite Editor
|
|
93
|
-
The `CompositeEditor` class got renamed to `SlickCompositeEditor`, so if you were using it with an `instanceof` then you will have to update your code.
|
|
94
|
-
```diff
|
|
95
|
-
- if (args.editor instanceof Slick.CompositeEditor) {
|
|
96
|
-
+ if (args.editor instanceof SlickCompositeEditor) {
|
|
97
|
-
// ...
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Deprecated code removed/renamed
|
|
102
|
-
##### Column
|
|
103
|
-
- `exportColumnWidth` was removed, just use `excelExportOptions` instead
|
|
104
|
-
|
|
105
|
-
##### Grid Options
|
|
106
|
-
- `defaultComponentEventPrefix` - no longer available
|
|
107
|
-
- `defaultSlickgridEventPrefix` - no longer available
|
|
108
|
-
- `sanitizeHtmlOptions` was renamed to `sanitizerOptions` (can be useful to provide extra sanitizer options like DOMPurify)
|
|
109
|
-
- `registerExternalResources` was renamed to `externalResources`
|
|
110
|
-
|
|
111
|
-
```diff
|
|
112
|
-
this.gridOptions = {
|
|
113
|
-
- registerExternalResources: [new ExcelExportService()]
|
|
114
|
-
+ externalResources: [new ExcelExportService()]
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
##### GraphQL Service
|
|
119
|
-
- `isWithCursor` was renamed to `useCursor`
|
|
120
|
-
|
|
121
|
-
##### Header Menu
|
|
122
|
-
- `items` list was renamed as `commandItems` to align with all other Menu extensions
|
|
123
|
-
|
|
124
|
-
##### Filter/Editor
|
|
125
|
-
Any Editor/Filter options (internal or 3rd party lib like Flatpickr, Autocompleter, ...) were migrated from `params` to `filterOptions` or `editorOptions`. You can still use `params` for other usage though.
|
|
126
|
-
```diff
|
|
127
|
-
this.columnDefinitions = {
|
|
128
|
-
{
|
|
129
|
-
id: 'duration', name: 'Duration', field: 'duration',
|
|
130
|
-
filterable: true,
|
|
131
|
-
filter: {
|
|
132
|
-
model: Filters.slider,
|
|
133
|
-
- params: { hideSliderNumber: true } as SliderOption
|
|
134
|
-
+ filterOptions: { hideSliderNumber: true } as SliderOption
|
|
135
|
-
},
|
|
136
|
-
editor: {
|
|
137
|
-
model: Editors.slider,
|
|
138
|
-
- params: { hideSliderNumber: true } as SliderOption
|
|
139
|
-
+ editorOptions: { hideSliderNumber: true } as SliderOption
|
|
140
|
-
},
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Package Location Change
|
|
145
|
-
_This should be transparent and irrelevant to most users..._
|
|
146
|
-
|
|
147
|
-
- `BindingEventService` moved from `@slickgrid-universal/common` to `@slickgrid-universal/binding`, you will also need to check your dependencies and apply changes if you have it installed.
|
|
148
|
-
```diff
|
|
149
|
-
- import { BindingEventService } from '@slickgrid-universal/common';
|
|
150
|
-
+ import { BindingEventService } from '@slickgrid-universal/binding';
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Removed functions
|
|
154
|
-
_This should be transparent and irrelevant to most users..._
|
|
155
|
-
- remove leftover jQuery slide/fade animations in all toggle methods, use CSS animation instead. We are removing the last `animate` boolean argument that was previously available on all of these methods:
|
|
156
|
-
- `setTopPanelVisibility`, `setHeaderRowVisibility`, `setColumnHeaderVisibility`, `setFooterRowVisibility`, `setPreHeaderPanelVisibility`
|
|
157
|
-
|
|
158
|
-
### Rename Util functions (shorter names)
|
|
159
|
-
_This should be transparent and irrelevant to most users..._
|
|
160
|
-
|
|
161
|
-
Some of the DomUtils Service function were renamed, if you use any of them then rename them (the first 2 are used in multiple places)
|
|
162
|
-
- `getHtmlElementOffset` renamed to `getOffset`
|
|
163
|
-
- `sanitizeHtmlToText` reimplemented as `stripTags`
|
|
164
|
-
- `destroyObjectDomElementProps` renamed to `destroyAllElementProps`
|
|
165
|
-
- `getElementOffsetRelativeToParent` renamed to `getOffsetRelativeToParent`
|
|
166
|
-
- `findFirstElementAttribute` renamed to `findFirstAttribute`
|
|
167
|
-
- `htmlEncodedStringWithPadding` renamed to `htmlEncodeWithPadding`
|
|
168
|
-
|
|
169
|
-
### Excel Export
|
|
170
|
-
_requires version >=7.4.0_
|
|
171
|
-
|
|
172
|
-
Migrate to a new [Excel-Builder-Vanilla](https://github.com/ghiscoding/excel-builder-vanilla) which is a fork of the `excel-builder.js` library. The new fork is all about modernizing Excel-Builder, it drops `Q`, `Lodash` and also replace `JSZip` to `fflate`.
|
|
173
|
-
|
|
174
|
-
By migrating from `JSZip` to `fflate`, the users should remove any `JSZip` references (like `tsconfig.json`)
|
|
175
|
-
|
|
176
|
-
```diff
|
|
177
|
-
{
|
|
178
|
-
"compilerOptions": {
|
|
179
|
-
- "paths": {
|
|
180
|
-
- "jszip": [
|
|
181
|
-
- "node_modules/jszip/dist/jszip.min.js"
|
|
182
|
-
- ]
|
|
183
|
-
- }
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
Also note that `fflate` could use Web Worker for performance reasons and by doing this you might have new CSP errors thrown. You simply need to add a CSP rule to avoid the error `worker-src 'self' blob:;`
|
|
189
|
-
|
|
190
|
-
## Formatters / CSP (Content Security Policy) Compliance
|
|
191
|
-
### Formatters Cleanup & Removals
|
|
192
|
-
I decided to remove a bunch of Formatters (like `Formatters.bold`, `Formatters.uppercase`, ...) because they could and should be using the column `cssClass` option. Basically, I did not myself use the best practice available when creating soo many Formatters and I did not realized that we could simply use `cssClass` which is a much more efficient way and so I'm correcting this inadvertence in this new release. With that in mind, I decided to do a big cleanup in the list of Formatters to make the project a little more lightweight with less code to support and replace some of them with more generic alternatives (see below).
|
|
193
|
-
|
|
194
|
-
The benefits of using `cssClass` are non negligible since it will slightly decrease the project size and code to support, but most importantly it is a lot more efficient, because applying CSS is a lot quicker in comparison to parse and apply a formatter on each cell. See below for the list of deleted (or replaced) Formatters and their equivalent Column `cssClass` property to use (when available).
|
|
195
|
-
|
|
196
|
-
> **Note** the CSS class name to use might be different depending on which framework you use in your project, i.e. Bootstrap/Bulma/Material
|
|
197
|
-
|
|
198
|
-
```diff
|
|
199
|
-
this.columnDefinitions = [
|
|
200
|
-
{
|
|
201
|
-
id: 'firstName', name: 'First Name', field: 'firstName',
|
|
202
|
-
- formatter: Formatters.bold
|
|
203
|
-
+ cssClass: 'text-bold'
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
id: 'lastName', name: 'Last Name', field: 'lastName',
|
|
207
|
-
- formatter: Formatters.multiple, params: { formatters: [Formatters.uppercase, Formatters.bold] },
|
|
208
|
-
+ cssClass: 'text-uppercase text-bold'
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
id: 'deleteIcon', name: '', field: '',
|
|
212
|
-
- formatter: Formatters.deleteIcon,
|
|
213
|
-
// NOTE: we previously accepted "icon" and "formatterIcon" in the past but these names are now removed
|
|
214
|
-
+ formatter: Formatters.icon, params: { iconCssClass: 'fa fa-trash pointer' }
|
|
215
|
-
},
|
|
216
|
-
];
|
|
217
|
-
```
|
|
218
|
-
| Formatter removed | `cssClass` equivalent | alternative |
|
|
219
|
-
| ------------------|-----------------------|------------------------|
|
|
220
|
-
| `Formatters.bold` | `cssClass: 'text-bold'` or `fw-bold` |
|
|
221
|
-
| `Formatters.center` | `cssClass: 'text-center'` |
|
|
222
|
-
| `Formatters.italic` | `cssClass: 'text-italic'` or `fst-italic` |
|
|
223
|
-
| `Formatters.alignRight` | `cssClass: 'text-right'` or `text-end` |
|
|
224
|
-
| `Formatters.lowercase` | `cssClass: 'text-lowercase'`|
|
|
225
|
-
| `Formatters.uppercase` | `cssClass: 'text-uppercase'`|
|
|
226
|
-
| `Formatters.fakeHyperlink` | `cssClass: 'text-underline cursor'` | `cssClass: 'fake-hyperlink'` |
|
|
227
|
-
| `Formatters.checkbox` | n/a ... removed | use the `Formatters.iconBoolean` |
|
|
228
|
-
| `Formatters.deleteIcon` | n/a ... removed | use the `Formatters.icon` (see above) |
|
|
229
|
-
| `Formatters.editIcon` | n/a ... removed | use the `Formatters.icon` (see above) |
|
|
230
|
-
| `Formatters.infoIcon` | n/a ... removed | use the `Formatters.icon` (see above) |
|
|
231
|
-
| `Formatters.yesNo` | n/a ... rarely used, so it was removed | create a custom Formatter |
|
|
232
|
-
|
|
233
|
-
### All Formatters were rewritten as native HTML (CSP Safe)
|
|
234
|
-
The previous Formatters implementation were all returning HTML strings (or `FormatterResultObject`), however that approach was not CSP safe by default and we have to do some extra transformations in order to be CSP safe. The transformation is to take the HTML string, sanitize it (DOMPurify is used by default unless a custom `sanitizer` is provided, for example in Salesforce DOMPurify doesn't work so a custom sanitizer is provided) and if you do use DOMPurify then its transformation will return `TrustedHTML` (when enabled with `RETURN_TRUSTED_TYPE: true` which is the default in here) which is CSP safe and we can finally assign it the cell content via `innerHTML` but as you can see, that required couple of extra steps. With that in mind, if we were to return native HTML directly from our Formatter, we could then bypass any transformations and simply use `.appendChild()` and that is exactly why I decided to rewrite some built-in Formatters as native code, the bonus is that this is much more efficient (no transformation) and is also 100% CSP safe since it's already native. For the most part this change shouldn't affect you too much **unless** you chained some of these Formatters (e.g. with `Formatters.multiple`) or if you were expecting an HTML string that you were then concatenating another string to a built-in Formatter result, then that might break your UI and you will have to update your code.
|
|
235
|
-
|
|
236
|
-
> **Note** prior to this release, Slickgrid-Universal only supported returning HTML string (or via an object of type `FormatterResultObject`). With this release, we still support returning HTML string but now we also support returning native HTML in addition (or as `FormatterResultWithHtml`)
|
|
237
|
-
|
|
238
|
-
**Since all Formatters were rewritten as HTML, you might get unexpected behavior in your UI, you will have to inspect your UI and make changes accordingly**. For example, I had to adjust [Example 30](https://ghiscoding.github.io/Angular-Slickgrid/#/composite-editor) `customEditableInputFormatter` because it was expecting all Formatters to return an HTML string and I was concatenating them to an HTML string but that code was now resulting in `[object HTMLElement]`, so I had to update the code and detect if Formatter output is a native element then do something or else do something else... Below is the adjustment I had to do to fix my own demo (your use case may vary)
|
|
239
|
-
|
|
240
|
-
> **Note** some Formatters now return `HTMLElement` or `DocumentFragment`, you can add a condition check with `instanceof HTMLElement` or `instanceof DocumentFragment`, however please also note that a `DocumentFragment` does not have `innerHTML`/`outerHTML` (you can write a simple function for loop to get them, see this [SO](https://stackoverflow.com/a/51017093/1212166) or use `getHTMLFromFragment(elm)` from Slickgrid-Universal)
|
|
241
|
-
|
|
242
|
-
```diff
|
|
243
|
-
const customEditableInputFormatter: Formatter = (_row, _cell, value, columnDef, dataContext, grid) => {
|
|
244
|
-
const isEditableLine = checkItemIsEditable(dataContext, columnDef, grid);
|
|
245
|
-
value = (value === null || value === undefined) ? '' : value;
|
|
246
|
-
- return isEditableLine ? `<div class="editing-field">${value}</div>` : value;
|
|
247
|
-
+ const divElm = document.createElement('div');
|
|
248
|
-
+ divElm.className = 'editing-field';
|
|
249
|
-
+ if (value instanceof HTMLElement) {
|
|
250
|
-
+ divElm.appendChild(value);
|
|
251
|
-
+ } else {
|
|
252
|
-
+ divElm.textContent = value;
|
|
253
|
-
+ }
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
init() {
|
|
257
|
-
// ...
|
|
258
|
-
this.gridOptions = {
|
|
259
|
-
editable: true,
|
|
260
|
-
autoAddCustomEditorFormatter: customEditableInputFormatter,
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
```
|
|
264
|
-
here's also another use case from [Example 18](https://ghiscoding.github.io/slickgrid-universal/#/example18) using a `DocumentFragment`
|
|
265
|
-
```diff
|
|
266
|
-
const priceFormatter: Formatter = (_cell, _row, value, _col, dataContext) => {
|
|
267
|
-
const direction = dataContext.priceChange >= 0 ? 'up' : 'down';
|
|
268
|
-
- return `<span class="mdi mdi-arrow-${direction} color-${direction === 'up' ? 'success' : 'danger'}"></span> ${value}`;
|
|
269
|
-
+ const fragment = document.createDocumentFragment();
|
|
270
|
-
+ const spanElm = document.createElement('span');
|
|
271
|
-
+ spanElm.className = `mdi mdi-arrow-${direction} color-${direction === 'up' ? 'success' : 'danger'}`;
|
|
272
|
-
+ fragment.appendChild(spanElm);
|
|
273
|
-
+ if (value instanceof HTMLElement) {
|
|
274
|
-
+ fragment.appendChild(value);
|
|
275
|
-
+ }
|
|
276
|
-
+ return fragment;
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
init() {
|
|
280
|
-
this.columnDefinitions = [
|
|
281
|
-
{
|
|
282
|
-
id: 'priceChange', name: 'Change', field: 'priceChange', filterable: true, sortable: true, minWidth: 80, width: 80,
|
|
283
|
-
filter: { model: Filters.compoundInputNumber }, type: FieldType.number,
|
|
284
|
-
formatter: Formatters.multiple,
|
|
285
|
-
params: {
|
|
286
|
-
formatters: [Formatters.dollarColored, priceFormatter],
|
|
287
|
-
maxDecimal: 2,
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
];
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
> **Note** you might be wondering, why do we use a `DocumentFragment` and not just `HTMLElement`? The reason is simply because in some cases you might just want to return multiple elements but without having to wrap them inside a div container... and so you probably guessed it that a `DocumentFragment` allows you to do just that. However please note that it might not be supported by all environment (e.g. Salesforce doesn't support it yet), so a grid option `preventDocumentFragmentUsage` flag was provided and it will instead wrap the elements inside a `span` instead of the fragment (e.g. Tree Formatter uses this technique).
|
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
## Version 8 - Better UI and Dark Mode with Pure CSS SVG icons ✨
|
|
2
|
-
This new release brings a lot of changes oriented towards better UI/UX, our SVG icons are now pure CSS and can be colorized like any other text via the native CSS `color` property (which helps a lot to improve the Dark Mode Theme).
|
|
3
|
-
|
|
4
|
-
Another noticeable UI change is the migration from [Flatpickr](https://flatpickr.js.org/) to [Vanilla-Calendar-Pro](https://vanilla-calendar.pro/), there are multiple reasons to migrate our date picker to another library as described below. Another change that is mostly internal but is also indirectly connected to the date picker is the migration from MomentJS to [Tempo](https://tempo.formkit.com/) which is modern and is packaged as ESM which is great for Tree Shaking.
|
|
5
|
-
|
|
6
|
-
##### Flatpickr cons:
|
|
7
|
-
- barely supported (lots of opened PRs but nothing merged for the past 2 years)
|
|
8
|
-
- not fully ESM ready (it's only partially ESM, for example it was detected as CJS in Angular-Slickgrid and required an exception in `allowedCommonJsDependencies`)
|
|
9
|
-
- styling could be a bit more modern (the use of native select/input to change year/month/time is a little outdated)
|
|
10
|
-
- date range selection is not very user friendly (UX)
|
|
11
|
-
|
|
12
|
-
##### Vanilla-Calendar (VC)
|
|
13
|
-
- pros:
|
|
14
|
-
- ESM ready
|
|
15
|
-
- modern styling and also includes Dark Mode theme
|
|
16
|
-
- date range selection is a lot easier by displaying 2 months at a time in the picker
|
|
17
|
-
- cons:
|
|
18
|
-
- build size is slightly larger but its UI/UX is just awesome (especially when changing month/year)
|
|
19
|
-
- settings are a bit different and are not using flat config (complex object settings) and requires code change
|
|
20
|
-
- for example Flatpickr `minDate: 'today'` becomes `range: { min: 'today' }` in VC
|
|
21
|
-
- some settings were missing, like the `'today'` shortcut, so I also contributed back to that project.
|
|
22
|
-
|
|
23
|
-
To summarize, the goal of this new release was mainly to improve UI/UX (mostly for Dark Mode) and also to make it fully ESM ready. Also noteworthy, the project is smaller in size (~100Kb smaller) compared to what it was in v2.x (that was when the user had to install jQuery/jQueryUI separately). So, considering that we're no longer requiring the install of jQuery/jQueryUI, and also considering that these 2 dependencies had a total of well over 200kb. We can safely assume that our project build size is in fact a lot smaller than it was 2 years ago, that is really nice to know considering that we kept adding features (like Dark Mode and other features) while still decreasing its size over the years :)
|
|
24
|
-
|
|
25
|
-
With this release, and after 7 years of development as a single developer (myself @ghiscoding), I believe that I have achieved all goals and even more than I originally planned. So with that being said, I am not foreseeing any new major releases for a while. As a recap, I think that the biggest challenge was the removal of jQuery/jQueryUI and transitioning to native code, that took 2-3 years to accomplish which I am of course very proud to have achieved. All dependencies are now also all ESM and the project is now CSP compliant as well. If the project is useful to you, give it a ⭐ and perhaps buy me a [☕ (ko-fi)](https://ko-fi.com/ghiscoding), thanks.
|
|
26
|
-
|
|
27
|
-
#### Major Changes - Quick Summary
|
|
28
|
-
- minimum requirements bump
|
|
29
|
-
- Angular v18.0+
|
|
30
|
-
- Node v18.0+
|
|
31
|
-
- Bootstrap v5.0+ (or any other UI framework)
|
|
32
|
-
- SASS v1.35+ (`dart-sass`)
|
|
33
|
-
- migrated from Flatpickr to Vanilla-Calendar-Pro (visit [Vanilla-Calendar-Pro](https://vanilla-calendar.pro/) for demos and docs)
|
|
34
|
-
- migrated from MomentJS to [Tempo](https://tempo.formkit.com/) (by the FormKit
|
|
35
|
-
team)
|
|
36
|
-
|
|
37
|
-
> **Note** for the entire list of tasks & code changes applied in this release, you may want to take a look at the [Roadmap to 5.0](https://github.com/ghiscoding/slickgrid-universal/discussions/1482) Discussion.
|
|
38
|
-
|
|
39
|
-
For most breaking changes, a quick Search & Replace in your code editor should suffice.
|
|
40
|
-
|
|
41
|
-
> **Note:** if you come from an earlier version, please make sure to follow each migrations in their respected order (review previous migration guides)
|
|
42
|
-
|
|
43
|
-
## Changes
|
|
44
|
-
|
|
45
|
-
### Slickgrid-Universal
|
|
46
|
-
If you use any of the Slickgrid-Universal extra dependencies then also make sure to upgrade them as well to the new major `5.0.0` version so that they work with Angular-Slickgrid `8.0.0`
|
|
47
|
-
|
|
48
|
-
```diff
|
|
49
|
-
"dependencies": {
|
|
50
|
-
- "@slickgrid-universal/excel-export": "^4.7.0",
|
|
51
|
-
+ "@slickgrid-universal/excel-export": "^5.0.0",
|
|
52
|
-
- "angular-slickgrid": "^7.7.0",
|
|
53
|
-
+ "angular-slickgrid": "^8.0.0",
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Styling
|
|
58
|
-
|
|
59
|
-
#### CSS classes `.color-xx` are all removed (use `.text-color-xx` or native `color` instead)
|
|
60
|
-
> **Note** these extra colors are only available in the Material & Salesforce Themes (it is not included in the Bootstrap Theme since Bootstrap have their own coloring utils).
|
|
61
|
-
|
|
62
|
-
Since the SVG icons are now pure CSS, we can now colorize any of them the same way that we would do for any other text via the `color` CSS property 🌈. For that reason, we no longer need any of the `.color-xx` CSS classes (which were created via CSS [filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter)). They were useful to override the SVG icon colors (by using CSS `filter`), but since we can now use the regular CSS `color` property, the `color-xx` are no longer necessary and were all removed (just use `text-color-xx` instead or plain CSS `color`s).
|
|
63
|
-
|
|
64
|
-
```diff
|
|
65
|
-
<button class="button is-small">
|
|
66
|
-
- <span class="mdi mdi-undo color-primary"></span>
|
|
67
|
-
+ <span class="mdi mdi-undo text-color-primary"></span>
|
|
68
|
-
<span class="text-color-primary">Undo Last Edit</span>
|
|
69
|
-
</button>
|
|
70
|
-
```
|
|
71
|
-
or move the class to the parent container and have both the icon & the text `inherit` the color :)
|
|
72
|
-
```diff
|
|
73
|
-
+ <button class="button is-small text-color-primary">
|
|
74
|
-
- <span class="mdi mdi-undo color-primary"></span>
|
|
75
|
-
+ <span class="mdi mdi-undo"></span>
|
|
76
|
-
- <span class="text-color-primary">Undo Last Edit</span>
|
|
77
|
-
</button>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
#### SASS variables
|
|
81
|
-
A lot of SASS variables got changed, we recommend that you take a look at the [_variables.scss](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/styles/_variables.scss) file to compare them with your SASS overrides and fix any SASS build issues. For example a lot of the ms-select variables and all Flatpickr related variables were deleted (note that Vanilla-Calendar doesn't actually have any variables). Also a lot of the icon related variables were renamed and updated (all icons now have the suffix `-icon-svg-path` for the SVG vector path, you can easily change them with SASS).
|
|
82
|
-
|
|
83
|
-
> **Note** if you want to create your own SVGs icons in pure CSS, you could use the `generateSvgStyle()` SASS function from Slickgrid-Universal [`svg-utilities.scss`](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/styles/svg-utilities.scss) (take a look at the [`slickgrid-icons.scss`](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/styles/slickgrid-icons.scss) for some usage)
|
|
84
|
-
|
|
85
|
-
#### SASS (dart-sass) `math` polyfills are removed
|
|
86
|
-
When SASS (dart-sass) released their version 1.33 (~3 years ago), it caused a ton of console warnings (and a lot of unhappy users) in projects that were using `/` in their SASS files (for math division) instead of their new `math.div()` function. To avoid seeing all these warnings, I added a temporary polyfill at the time (that piece of code was actually copied from the Bootstrap project). That polyfill patch was put in place about 3 years ago, so I'm assuming that most users have already upgraded their SASS version and already fixed all of these warnings... So, I think it's now safe to remove this polyfill, because like I said earlier, it was really meant to be a temp patch. If you see any warnings coming back, then a suggestion would be to use the SASS CLI `--quiet-upstream` option.
|
|
87
|
-
|
|
88
|
-
For reference, below is an example of these old Math warnings which were coming up when using the SASS CLI
|
|
89
|
-
|
|
90
|
-
```sh
|
|
91
|
-
Recommendation: math.div($m, $columns)
|
|
92
|
-
More info and automated migrator: https://sass-lang.com/d/slash-div
|
|
93
|
-
╷
|
|
94
|
-
94 │ margin-right: $m / $columns * 100%
|
|
95
|
-
│ ^^^^^^^^^^^^^^^^^^
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
#### Font-Awesome references are all removed
|
|
99
|
-
Since this release introduces pure CSS SVG icons, I went ahead and deleted all Font-Awesome references (which were mostly in the Bootstrap Theme). The reason is simple, the built-in icons are now all pure CSS SVG icons (sort, grouping, row detail, row move, row selection). You can also change these icons via SASS (or CSS variables with a bit more work). However, please note that there are a few plugins which use external icons via CSS classes (mostly all menu plugins like Header Menu, Grid Menu, Content Menu, ...) and for that reason **all Styling Themes** now include the Slickgrid-Universal Material icons subset (~200 icons) by default (not just Material & Salesforce but now also the Bootstrap Theme as well). In short, the grid is now using SVG icons by default and Font-Awesome icons will no longer be used internally (you can still use it in your project but it won't be used by the grid itself unless you set them in your grid options).
|
|
100
|
-
|
|
101
|
-
If you no longer need Font-Awesome, then consider removing it completely
|
|
102
|
-
|
|
103
|
-
```diff
|
|
104
|
-
# package.json
|
|
105
|
-
{
|
|
106
|
-
dependencies: {
|
|
107
|
-
- "font-awesome": "^4.7.0"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
What if you don't want to use the [Slickgrid-Universal icons](https://ghiscoding.github.io/slickgrid-universal/#/icons) (`.mdi`) subset and would rather use a different font/SVG library? In that case, I would suggest that you use the "lite" Themes (which do not include the colors & icons subset) and then make sure to update all the menu plugins with the correct CSS classes. For example the global grid options of the Grid Menu is now configured with the following icon classes (notice that we no longer provide any Font-Awesome "fa" icon references in our global grid options). Also note that what is shown below is just 1 of the multiple menu plugins to configure, make sure to review them all (you can review the [global-grid-options.ts](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/global-grid-options.ts) file).
|
|
113
|
-
|
|
114
|
-
```ts
|
|
115
|
-
// default global grid options
|
|
116
|
-
export const GlobalGridOptions = {
|
|
117
|
-
gridMenu: {
|
|
118
|
-
iconCssClass: 'mdi mdi-menu',
|
|
119
|
-
iconClearAllFiltersCommand: 'mdi mdi-filter-remove-outline',
|
|
120
|
-
iconClearAllSortingCommand: 'mdi mdi-sort-variant-off',
|
|
121
|
-
iconClearFrozenColumnsCommand: 'mdi mdi-pin-off-outline',
|
|
122
|
-
iconExportCsvCommand: 'mdi mdi-download',
|
|
123
|
-
iconExportExcelCommand: 'mdi mdi-file-excel-outline',
|
|
124
|
-
iconExportTextDelimitedCommand: 'mdi mdi-download',
|
|
125
|
-
iconRefreshDatasetCommand: 'mdi mdi-sync',
|
|
126
|
-
iconToggleDarkModeCommand: 'mdi mdi-brightness-4',
|
|
127
|
-
iconToggleFilterCommand: 'mdi mdi-flip-vertical',
|
|
128
|
-
iconTogglePreHeaderCommand: 'mdi mdi-flip-vertical',
|
|
129
|
-
},
|
|
130
|
-
headerMenu: {
|
|
131
|
-
// icon...
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
and below is a quick snapshot of the file size diff with the "lite" themes (without icons) vs the default themes (with colors & icons subset). However note that the built-in icons are of course always included even in the "lite" themes.
|
|
137
|
-
|
|
138
|
-

|
|
139
|
-
|
|
140
|
-
### Deprecated code removed/renamed
|
|
141
|
-
##### `getHTMLFromFragment()` removed
|
|
142
|
-
The util `getHTMLFromFragment()` function was removed in favor of `getHtmlStringOutput()`, the new function will auto-detect if it's a DocumentFragment, an HTMLElement or an HTML string and will execute the appropriate action.
|
|
143
|
-
|
|
144
|
-
##### jQueryUI CSS classes leftovers
|
|
145
|
-
There were a few remaining traces of jQueryUI CSS classes like `.ui-state-default` and other similar classes in the core lib, they were all removed in this release. If you were querying any of them in CSS for styling purposes, you can simply rename them to `.slick-state-*`
|
|
146
|
-
|
|
147
|
-
```diff
|
|
148
|
-
- .ui-state-default, .ui-state-hover {
|
|
149
|
-
+ .slick-state-default, .slick-state-hover {
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Formatters Cleanup & Removals
|
|
154
|
-
|
|
155
|
-
Since we now use SVGs everywhere and we got rid of any Font usage (no more Font-Awesome code anywhere), the `checkmark` Formatter no longer has any reason to exist and was removed. If you were using it and still plan to use Font-Awesome in your project, then you'll have to either recreate the Formatter yourself or use alternatives. You could use the `Formatters.icon` or `Formatters.iconBoolean` which require the CSS classes to be provided via `params`. Or as a last alternative, and if you are importing the optional SVG icons `.mdi` subset, then we recommend you simply switch to the `checkmarkMaterial` Formatter.
|
|
156
|
-
|
|
157
|
-
```diff
|
|
158
|
-
this.columnDefinitions = [
|
|
159
|
-
{
|
|
160
|
-
id: 'isActive', name: 'Active', field: 'isActive',
|
|
161
|
-
- formatter: Formatters.checkmark
|
|
162
|
-
+ formatter: Formatters.checkmarkMaterial
|
|
163
|
-
},
|
|
164
|
-
];
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
or create a Custom Formatter
|
|
168
|
-
|
|
169
|
-
```ts
|
|
170
|
-
// create a custom Formatter and returning a string and/or an object of type FormatterResultObject
|
|
171
|
-
const myCheckmarkFormatter: Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any) => {
|
|
172
|
-
// via native HTML (for CSP safe), you could also use our `createDomElement()` util for 1 liner
|
|
173
|
-
const iconElm = document.createElement('i');
|
|
174
|
-
iconElm.className = value ? 'mdi mdi-check' : '';
|
|
175
|
-
return iconElm;
|
|
176
|
-
|
|
177
|
-
// or via simple HTML string
|
|
178
|
-
return value ? '<i class="mdi mdi-check"></i>' : '';
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Column Functionalities
|
|
183
|
-
|
|
184
|
-
### Native Select Filter (removed)
|
|
185
|
-
I would be very surprised if anyone had ever used the `Filters.select`, which was a native `<select>`, and so it was removed in this release. You should simply use the `Filters.singleSelect` or `Filters.multipleSelect`
|
|
186
|
-
|
|
187
|
-
```diff
|
|
188
|
-
prepareGrid() {
|
|
189
|
-
this.columnDefinitions = [{
|
|
190
|
-
id: 'isActive', name: 'Active', field: 'isActive',
|
|
191
|
-
filter: {
|
|
192
|
-
- model: Filters.select,
|
|
193
|
-
+ model: Filters.singleSelect,
|
|
194
|
-
collection: [ { value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' } ],
|
|
195
|
-
}
|
|
196
|
-
}];
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Date Editor/Filter
|
|
201
|
-
Since we migrated from Flatpicker to Vanilla-Calendar-Pro, this requires some changes on your side because the setting option names are different. Same changes will be required for both the Filter and the Editor.
|
|
202
|
-
|
|
203
|
-
The biggest change that you will most probably have to update is the min/max date setting when using the `'today'` shortcut as shown below:
|
|
204
|
-
|
|
205
|
-
```diff
|
|
206
|
-
- import { type FlatpickrOption } from '@slickgrid-universal/common';
|
|
207
|
-
+ import { type VanillaCalendarOption } from '@slickgrid-universal/common';
|
|
208
|
-
|
|
209
|
-
prepareGrid() {
|
|
210
|
-
this.columnDefinitions = [{
|
|
211
|
-
id: 'finish', field: 'finish', name: 'Finish',
|
|
212
|
-
editor: {
|
|
213
|
-
model: Editors.date,
|
|
214
|
-
- editorOptions: { minDate: 'today' } as FlatpickrOption,
|
|
215
|
-
+ editorOptions: { range: { min: 'today' } } as VanillaCalendarOption,
|
|
216
|
-
}
|
|
217
|
-
}];
|
|
218
|
-
}
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
> **Note** visit `Vanilla-Calendar-Pro` [settings](https://vanilla-calendar.pro/docs/reference/additionally/settings) website for all other options.
|
|
222
|
-
|
|
223
|
-
> **Note** to keep docs available for older as well as newer versions, I renamed the old one doc as [Date-Picker (flatpickr)](https://ghiscoding.gitbook.io/slickgrid-universal/column-functionalities/editors/date-editor-flatpickr) and created a new one named [Date-Picker (vanilla-calendar)](https://ghiscoding.gitbook.io/slickgrid-universal/column-functionalities/editors/date-editor-vanilla-calendar).
|
|
224
|
-
|
|
225
|
-
### `internalColumnEditor` is completely removed
|
|
226
|
-
The work on this subject started over a month ago in version [v4.6.0](https://github.com/ghiscoding/slickgrid-universal/releases/tag/v4.6.0) to progressively remove `internalColumnEditor` because it was confusing and with this new release, it is now completely removed. This mean that the column `editor` property will remain untouched (in previous releases, the `editor` was moved to an `internalColumnEditor` prop and `editor` was then overriden with the `editor.model` and that was for SlickGrid to work properly... but that was extremely confusing to the user). So in short, the `internalColumnEditor` is now completely removed and the associated confusion is also gone with it.
|
|
227
|
-
|
|
228
|
-
A good example of the previous `internalColumnEditor` usage, was when you wanted to modify or push a new item to the editor collection array (see below). In the past, you could not simply push to the `collection.editor.collection` because the property was swapped internally. What you really had to do was to use the mapped `collection.internalColumnEditor.collection` 😵... and this is now thankfully gone, you can now use the same and original `collection.editor.collection` 👍
|
|
229
|
-
|
|
230
|
-
For example, previously, to add an item to the editor/filter collection
|
|
231
|
-
```diff
|
|
232
|
-
this.columnDefinitions = [{ id: 'complexity', editor: { model: Editors.singleSelect, collection: [{ value: 1, label: 'Simple' }, { value: 2, label: 'Hard' }] } }];
|
|
233
|
-
|
|
234
|
-
// then adding an item was previously requiring to use the `internalColumnEditor`
|
|
235
|
-
// that is, after the grid init our `editor` became `internalColumnEditor
|
|
236
|
-
- const complexityEditor = this.columnDefinitions[0].internalColumnEditor;
|
|
237
|
-
complexityEditor.collection.push({ value: 9, label: 'Hard' });
|
|
238
|
-
|
|
239
|
-
// NOW with this new release, adding a new item to the collection is as simple as referencing the original object
|
|
240
|
-
+ const complexityEditor = this.columnDefinitions[0].editor;
|
|
241
|
-
complexityEditor.collection.push({ value: 9, label: 'Hard' });
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
if you want to reference the Editor class (e.g. `Editors.longText`), you can now get it from either `column.editor.model` or `column.editorClass`
|
|
245
|
-
|
|
246
|
-
## Grid Functionalities
|
|
247
|
-
|
|
248
|
-
### Sanitizer (DOMPurify)
|
|
249
|
-
`DOMPurify` is now completely optional via the `sanitizer` grid option and you must now provide it yourself. The main reason to make it optional is because even though most users would prefer to use `dompurify`, some might prefer to use `isomorphic-dompurify` for SSR support. Consider that it is now optional, you could also technically speaking skip the `sanitizer` configuration completely, but that is not at all recommended.
|
|
250
|
-
|
|
251
|
-
> **⚠ Note** even if the `sanitizer` is now optional, we **strongly suggest** that you configure it as a global grid option to avoid any XSS attacks from your data and also to remain CSP compliant. Also note that for Salesforce users, you do not have to configure it since Salesforce already use DOMPurify internally.
|
|
252
|
-
|
|
253
|
-
```diff
|
|
254
|
-
// prefer the global grid options if possible
|
|
255
|
-
this.gridOptions = {
|
|
256
|
-
sanitizer: (dirtyHtml) => DOMPurify.sanitize(dirtyHtml, { ADD_ATTR: ['level'], RETURN_TRUSTED_TYPE: true })
|
|
257
|
-
};
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
> **Note** If you're wondering about the `ADD_ATTR: ['level']`, the "level" is a custom attribute used by SlickGrid Grouping/Draggable Grouping to track the grouping level depth and it must be kept for the group indentation to work properly.
|
|
261
|
-
|
|
262
|
-
### From MomentJS to [Tempo](https://tempo.formkit.com/)
|
|
263
|
-
I really wanted to replace MomentJS for a long timeeee... (it's been deprecated for years and is CJS only), but it was really hard to find a good replacement (I tried many alternatives like `DayJS`, `Luxon`, `date-fns` and they all had problems at least for a datagrid use case where parsing & formatting is important)... and here comes [Tempo](https://tempo.formkit.com/)! With Tempo, I was finally able to migrate by taking advantage of their `parse()` and `format()` functions, which are the most important in a datagrid usage. The library also has plenty of extra, and optional, functions as well, for example `addDay()`, `diffDays()`, ... Another great thing about Tempo is that they use the same format/parse [tokens](https://tempo.formkit.com/#format-tokens) as MomentJS, so the conversion on that side was super easy.
|
|
264
|
-
|
|
265
|
-
The migration to Tempo should be transparent to most users like you. **However** if you are currently using MomentJS in your project, then I would suggest you to consider trying [Tempo](https://tempo.formkit.com/) in order to modernize your project and also lower your dependencies count. The other great advantage of Tempo is that it's ESM and it helped a lot in decreasing our build size footprint because ESM also means that it is Tree Shakable (only import and build what you use). By using Bundlephobia and comparing [@slickgrid-universal@4.7.0](https://bundlephobia.com/package/@slickgrid-universal/common@4.7.0) we can see that `moment-mini` is taking 41.5Kb, while Tempo takes only 16.6Kb in [@slickgrid-universal@5.0.0](https://bundlephobia.com/package/@slickgrid-universal/common@5.0.0), that is a decrease of almost 25Kb (ESM makes a huge difference).
|
|
266
|
-
|
|
267
|
-
### `allowedCommonJsDependencies`
|
|
268
|
-
Lastly since we got rid of MomentJS and replaced Flatpickr, you can remove a few dependencies from your `allowedCommonJsDependencies` in your `angular.json`.
|
|
269
|
-
|
|
270
|
-
```diff
|
|
271
|
-
{
|
|
272
|
-
"allowedCommonJsDependencies": [
|
|
273
|
-
"dompurify",
|
|
274
|
-
- "flatpickr",
|
|
275
|
-
- "moment-mini",
|
|
276
|
-
"stream"
|
|
277
|
-
],
|
|
278
|
-
}
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
### Smaller Size - Full ESM
|
|
282
|
-
|
|
283
|
-
To compare size, you can take a look at BundlePhobia for the older [v1.4.0](https://bundlephobia.com/package/@slickgrid-universal/common@1.4.0) (when we required jQuery/jQueryUI) and [v5.0.0](https://bundlephobia.com/package/@slickgrid-universal/common@1.4.0) and you'll see that the gzip version went down by 17Kb (or 8.9%) and that's just for 1 dependency of the Slickgrid-Universal workspace (there's a few more installed behind the scene, like the footer component, binding, utils, ...). From that website you can also see that removing MomentJS & Flatpickr had a significant impact in decreasing build size, especially since the replacements are ESM and tree shakable.
|
|
284
|
-
|
|
285
|
-
### Excel Export `valueParserCallback`
|
|
286
|
-
I would be very suprised if anyone used this advanced feature BUT in case you do, I have decided to make some breaking in v5.1 and higher for the Excel cell value parser after creating the new [Example 36](https://ghiscoding.github.io/Angular-Slickgrid/#/excel-formula) and that is mostly because we now have way too many arguments provided to these value parsers. So, this mean that both `excelExportOptions.valueParserCallback` and `groupTotalsExcelExportOptions.valueParserCallback` signatures changed as shown below.
|
|
287
|
-
|
|
288
|
-
```diff
|
|
289
|
-
this.columnDefinitions = [
|
|
290
|
-
{
|
|
291
|
-
id: 'cost', name: 'Cost', field: 'cost', width: 80,
|
|
292
|
-
excelExportOptions: {
|
|
293
|
-
- valueParserCallback: (data, col, excelFormatId, excelStylesheet) => {
|
|
294
|
-
+ valueParserCallback: (data, { columnDef, excelFormatId, stylesheet }) => {
|
|
295
|
-
return `Total: ${data}`;
|
|
296
|
-
|
|
297
|
-
// to keep Excel style format, you can use detected "excelFormatId" OR use "stylesheet.createFormat()"
|
|
298
|
-
return {
|
|
299
|
-
value: isNaN(data as number) ? data : +data,
|
|
300
|
-
metadata: { style: excelFormatId } // the excelFormatId was created internally from the custom format
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
groupTotalsExcelExportOptions: {
|
|
305
|
-
- valueParserCallback: (totals, columnDef, groupType, excelFormatId) => {
|
|
306
|
-
+ valueParserCallback: (totals, { columnDef, excelFormatId, groupType, stylesheet }) => {
|
|
307
|
-
const fieldName = columnDef.field;
|
|
308
|
-
//return totals[groupType][fieldName];
|
|
309
|
-
|
|
310
|
-
// or with metadata
|
|
311
|
-
return { value: `totals[groupType][fieldName]`, metadata: { style: excelFormatId } };
|
|
312
|
-
},
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
];
|
|
316
|
-
```
|