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,216 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { AngularGridInstance, Column, GridOption } from '../../library';
|
|
4
|
-
|
|
5
|
-
// create a custom Formatter to highlight negative values in red
|
|
6
|
-
let columns1WithHighlightingById: any = {};
|
|
7
|
-
let columns2WithHighlightingById: any = {};
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
styleUrls: ['./example07.component.scss'],
|
|
11
|
-
encapsulation: ViewEncapsulation.None,
|
|
12
|
-
templateUrl: './example07.component.html',
|
|
13
|
-
standalone: false,
|
|
14
|
-
})
|
|
15
|
-
export class Example7Component implements OnInit {
|
|
16
|
-
columnDefinitions1: Column[] = [];
|
|
17
|
-
columnDefinitions2: Column[] = [];
|
|
18
|
-
gridOptions1!: GridOption;
|
|
19
|
-
gridOptions2!: GridOption;
|
|
20
|
-
dataset1: any[] = [];
|
|
21
|
-
dataset2: any[] = [];
|
|
22
|
-
angularGrid1!: AngularGridInstance;
|
|
23
|
-
angularGrid2!: AngularGridInstance;
|
|
24
|
-
|
|
25
|
-
constructor() {
|
|
26
|
-
columns1WithHighlightingById = {};
|
|
27
|
-
columns2WithHighlightingById = {};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
ngOnInit(): void {
|
|
31
|
-
this.defineGrid();
|
|
32
|
-
|
|
33
|
-
// populate the dataset once the grid is ready
|
|
34
|
-
this.dataset1 = this.loadData(200, 1);
|
|
35
|
-
this.dataset2 = this.loadData(200, 2);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
angularGrid1Ready(angularGrid: AngularGridInstance) {
|
|
39
|
-
this.angularGrid1 = angularGrid;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
angularGrid2Ready(angularGrid: AngularGridInstance) {
|
|
43
|
-
this.angularGrid2 = angularGrid;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
defineGrid() {
|
|
47
|
-
this.gridOptions1 = {
|
|
48
|
-
enableAutoResize: true,
|
|
49
|
-
enableHeaderButton: true,
|
|
50
|
-
enableHeaderMenu: false,
|
|
51
|
-
autoResize: {
|
|
52
|
-
container: '#demo-container',
|
|
53
|
-
rightPadding: 10,
|
|
54
|
-
},
|
|
55
|
-
enableFiltering: false,
|
|
56
|
-
enableExcelCopyBuffer: true,
|
|
57
|
-
excelCopyBufferOptions: {
|
|
58
|
-
onCopyCells: (e, args) => console.log('onCopyCells', e, args),
|
|
59
|
-
onPasteCells: (e, args) => console.log('onPasteCells', e, args),
|
|
60
|
-
onCopyCancelled: (e, args) => console.log('onCopyCancelled', e, args),
|
|
61
|
-
},
|
|
62
|
-
enableCellNavigation: true,
|
|
63
|
-
gridHeight: 275,
|
|
64
|
-
headerButton: {
|
|
65
|
-
// you can use the "onCommand" (in Grid Options) and/or the "action" callback (in Column Definition)
|
|
66
|
-
onCommand: (_e, args) => this.handleOnCommand(_e, args, 1),
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// grid 2 options, same as grid 1 + extras
|
|
71
|
-
this.gridOptions2 = {
|
|
72
|
-
...this.gridOptions1,
|
|
73
|
-
enableHeaderMenu: true,
|
|
74
|
-
enableFiltering: true,
|
|
75
|
-
// frozenColumn: 2,
|
|
76
|
-
// frozenRow: 2,
|
|
77
|
-
headerButton: {
|
|
78
|
-
// when floating to left, you might want to inverse the icon orders
|
|
79
|
-
onCommand: (_e, args) => this.handleOnCommand(_e, args, 2),
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
handleOnCommand(_e: any, args: any, gridNo: 1 | 2) {
|
|
85
|
-
const column = args.column;
|
|
86
|
-
const button = args.button;
|
|
87
|
-
const command = args.command;
|
|
88
|
-
|
|
89
|
-
if (command === 'toggle-highlight') {
|
|
90
|
-
if (button.cssClass === 'mdi mdi-lightbulb-on text-danger') {
|
|
91
|
-
if (gridNo === 1) {
|
|
92
|
-
delete columns1WithHighlightingById[column.id];
|
|
93
|
-
} else {
|
|
94
|
-
delete columns2WithHighlightingById[column.id];
|
|
95
|
-
}
|
|
96
|
-
button.cssClass = 'mdi mdi-lightbulb-outline text-warning faded';
|
|
97
|
-
button.tooltip = 'Highlight negative numbers.';
|
|
98
|
-
} else {
|
|
99
|
-
if (gridNo === 1) {
|
|
100
|
-
columns1WithHighlightingById[column.id] = true;
|
|
101
|
-
} else {
|
|
102
|
-
columns2WithHighlightingById[column.id] = true;
|
|
103
|
-
}
|
|
104
|
-
button.cssClass = 'mdi mdi-lightbulb-on text-danger';
|
|
105
|
-
button.tooltip = 'Remove highlight.';
|
|
106
|
-
}
|
|
107
|
-
((this as any)[`angularGrid${gridNo}`] as AngularGridInstance).slickGrid.invalidate();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
loadData(count: number, gridNo: 1 | 2) {
|
|
112
|
-
// Set up some test columns.
|
|
113
|
-
for (let i = 0; i < 10; i++) {
|
|
114
|
-
(this as any)[`columnDefinitions${gridNo}`].push({
|
|
115
|
-
id: i,
|
|
116
|
-
name: 'Column ' + String.fromCharCode('A'.charCodeAt(0) + i),
|
|
117
|
-
field: i + '',
|
|
118
|
-
width: i === 0 ? 70 : 100, // have the 2 first columns wider
|
|
119
|
-
filterable: true,
|
|
120
|
-
sortable: true,
|
|
121
|
-
formatter: (_row: number, _cell: number, value: any, columnDef: Column) => {
|
|
122
|
-
if (gridNo === 1 && columns1WithHighlightingById[columnDef.id] && value < 0) {
|
|
123
|
-
return `<div style="color:red; font-weight:bold;">${value}</div>`;
|
|
124
|
-
} else if (gridNo === 2 && columns2WithHighlightingById[columnDef.id] && value < 0) {
|
|
125
|
-
return `<div style="color:red; font-weight:bold;">${value}</div>`;
|
|
126
|
-
}
|
|
127
|
-
return value;
|
|
128
|
-
},
|
|
129
|
-
header: {
|
|
130
|
-
buttons: [
|
|
131
|
-
{
|
|
132
|
-
cssClass: 'mdi mdi-lightbulb-outline text-warning faded',
|
|
133
|
-
command: 'toggle-highlight',
|
|
134
|
-
tooltip: 'Highlight negative numbers.',
|
|
135
|
-
itemVisibilityOverride: (args: any) => {
|
|
136
|
-
// for example don't show the header button on column "E"
|
|
137
|
-
return args.column.name !== 'Column E';
|
|
138
|
-
},
|
|
139
|
-
itemUsabilityOverride: (args: any) => {
|
|
140
|
-
// for example the button usable everywhere except on last column ='J"
|
|
141
|
-
return args.column.name !== 'Column J';
|
|
142
|
-
},
|
|
143
|
-
action: (_e: Event, args: any) => {
|
|
144
|
-
// you can use the "action" callback and/or subscribe to the "onCallback" event, they both have the same arguments
|
|
145
|
-
// do something
|
|
146
|
-
console.log(`execute a callback action to "${args.command}" on ${args.column.name}`);
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
},
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Set multiple buttons on the first column to demonstrate overflow.
|
|
155
|
-
(this as any)[`columnDefinitions${gridNo}`][0].name = 'Resize me!';
|
|
156
|
-
(this as any)[`columnDefinitions${gridNo}`][0].header = {
|
|
157
|
-
buttons: [
|
|
158
|
-
{
|
|
159
|
-
cssClass: 'mdi mdi-message-text',
|
|
160
|
-
handler: () => {
|
|
161
|
-
alert('Tag');
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
cssClass: 'mdi mdi-forum-outline',
|
|
166
|
-
handler: () => {
|
|
167
|
-
alert('Comment');
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
cssClass: 'mdi mdi-information',
|
|
172
|
-
handler: () => {
|
|
173
|
-
alert('Info');
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
cssClass: 'mdi mdi-help-circle',
|
|
178
|
-
handler: () => {
|
|
179
|
-
alert('Help');
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// when floating to left, you might want to inverse the icon orders
|
|
186
|
-
if (gridNo === 2) {
|
|
187
|
-
this.columnDefinitions2[0].header?.buttons?.reverse();
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// Set a button on the second column to demonstrate hover.
|
|
191
|
-
(this as any)[`columnDefinitions${gridNo}`][1].name = 'Hover me!';
|
|
192
|
-
(this as any)[`columnDefinitions${gridNo}`][1].header = {
|
|
193
|
-
buttons: [
|
|
194
|
-
{
|
|
195
|
-
cssClass: 'mdi mdi-help-circle',
|
|
196
|
-
showOnHover: true,
|
|
197
|
-
tooltip: 'This button only appears on hover.',
|
|
198
|
-
handler: () => {
|
|
199
|
-
alert('Help');
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
// mock a dataset
|
|
206
|
-
const mockDataset = [];
|
|
207
|
-
for (let i = 0; i < count; i++) {
|
|
208
|
-
const d: any = (mockDataset[i] = {});
|
|
209
|
-
d['id'] = i;
|
|
210
|
-
for (let j = 0; j < (this as any)[`columnDefinitions${gridNo}`].length; j++) {
|
|
211
|
-
d[j] = Math.round(Math.random() * 10) - 5;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return mockDataset;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<div id="demo-container" class="container-fluid">
|
|
2
|
-
<h2>
|
|
3
|
-
Example 8: Header Menu Plugin
|
|
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-headermenu.component.ts"
|
|
9
|
-
>
|
|
10
|
-
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
-
</a>
|
|
12
|
-
</span>
|
|
13
|
-
</h2>
|
|
14
|
-
<div class="subtitle">
|
|
15
|
-
This example demonstrates using the <b>Slick.Plugins.HeaderMenu</b> plugin to easily add menus to colum headers.<br />
|
|
16
|
-
These menus can be specified directly in the column definition, and are very easy to configure and use. (<a
|
|
17
|
-
href="https://ghiscoding.gitbook.io/angular-slickgrid/grid-functionalities/header-menu-and-header-buttons"
|
|
18
|
-
target="_blank"
|
|
19
|
-
>Wiki docs</a
|
|
20
|
-
>)
|
|
21
|
-
<ul>
|
|
22
|
-
<li>Now enabled by default in the Global Grid Options, it will add the default commands of (hide column, sort asc/desc)</li>
|
|
23
|
-
<li>Hover over any column header to see an arrow showing up on the right</li>
|
|
24
|
-
<li>Try Sorting (multi-sort) the 2 columns "Duration" and "% Complete" (the other ones are disabled)</li>
|
|
25
|
-
<li>Try hiding any columns (you use the "Column Picker" plugin by doing a right+click on the header to show the column back)</li>
|
|
26
|
-
<li>Note: The "Header Button" & "Header Menu" Plugins cannot be used at the same time</li>
|
|
27
|
-
<li>You can change the menu icon via SASS variables as shown in this demo (check all SASS variables)</li>
|
|
28
|
-
<li>
|
|
29
|
-
Use override callback functions to change the properties of show/hide, enable/disable the menu or certain item(s) from the list
|
|
30
|
-
</li>
|
|
31
|
-
<ol>
|
|
32
|
-
<li>These callbacks are: "itemVisibilityOverride", "itemUsabilityOverride"</li>
|
|
33
|
-
<li>for example if we want to disable the "Help" command over the "Title" and "Completed" column</li>
|
|
34
|
-
<li>for example don't show Help on column "% Complete"</li>
|
|
35
|
-
</ol>
|
|
36
|
-
</ul>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" (click)="switchLanguage()">
|
|
40
|
-
<i class="mdi mdi-translate"></i>
|
|
41
|
-
Switch Language
|
|
42
|
-
</button>
|
|
43
|
-
<strong>Locale:</strong>
|
|
44
|
-
<span style="font-style: italic" data-test="selected-locale">
|
|
45
|
-
{{ selectedLanguage + '.json' }}
|
|
46
|
-
</span>
|
|
47
|
-
|
|
48
|
-
<div class="col-sm-12">
|
|
49
|
-
<angular-slickgrid gridId="grid8" [columns]="columnDefinitions" [options]="gridOptions" [dataset]="dataset"> </angular-slickgrid>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
@use '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-bootstrap.scss' with (
|
|
2
|
-
$slick-header-menu-button-border-width: 0px 1px,
|
|
3
|
-
$slick-header-menu-button-icon-svg-path: "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M7,10L12,15L17,10H7Z",
|
|
4
|
-
$slick-header-menu-button-icon-size: 16px,
|
|
5
|
-
$slick-header-menu-button-padding: 10px 0 0 3px,
|
|
6
|
-
$slick-sort-indicator-hint-opacity: 0,
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
.blue {
|
|
10
|
-
color: rgb(73, 73, 255);
|
|
11
|
-
}
|
|
12
|
-
.orange {
|
|
13
|
-
color: orange;
|
|
14
|
-
}
|
|
15
|
-
.red {
|
|
16
|
-
color: red;
|
|
17
|
-
}
|
|
18
|
-
.bold {
|
|
19
|
-
font-weight: bold;
|
|
20
|
-
}
|
|
21
|
-
.italic {
|
|
22
|
-
font-style: italic;
|
|
23
|
-
}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
import { Column, GridOption, unsubscribeAllObservables } from '../../library';
|
|
3
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
-
import { Subscription } from 'rxjs';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
templateUrl: './example08.component.html',
|
|
8
|
-
styleUrls: ['./example08.component.scss'],
|
|
9
|
-
encapsulation: ViewEncapsulation.None,
|
|
10
|
-
standalone: false,
|
|
11
|
-
})
|
|
12
|
-
export class Example8Component implements OnInit, OnDestroy {
|
|
13
|
-
private subscriptions: Subscription[] = [];
|
|
14
|
-
columnDefinitions!: Column[];
|
|
15
|
-
gridOptions!: GridOption;
|
|
16
|
-
dataset!: any[];
|
|
17
|
-
selectedLanguage: string;
|
|
18
|
-
|
|
19
|
-
constructor(private translate: TranslateService) {
|
|
20
|
-
// always start with English for Cypress E2E tests to be consistent
|
|
21
|
-
const defaultLang = 'en';
|
|
22
|
-
this.translate.use(defaultLang);
|
|
23
|
-
this.selectedLanguage = defaultLang;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
ngOnDestroy() {
|
|
27
|
-
// also unsubscribe all Angular Subscriptions
|
|
28
|
-
unsubscribeAllObservables(this.subscriptions);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
ngOnInit(): void {
|
|
32
|
-
this.columnDefinitions = [
|
|
33
|
-
{ id: 'title', name: 'Title', field: 'title', nameKey: 'TITLE' },
|
|
34
|
-
{ id: 'duration', name: 'Duration', field: 'duration', nameKey: 'DURATION', sortable: true },
|
|
35
|
-
{ id: 'percentComplete', name: '% Complete', field: 'percentComplete', nameKey: 'PERCENT_COMPLETE', sortable: true },
|
|
36
|
-
{ id: 'start', name: 'Start', field: 'start', nameKey: 'START' },
|
|
37
|
-
{ id: 'finish', name: 'Finish', field: 'finish', nameKey: 'FINISH' },
|
|
38
|
-
{ id: 'completed', name: 'Completed', field: 'completed', nameKey: 'COMPLETED' },
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
this.columnDefinitions.forEach((columnDef) => {
|
|
42
|
-
columnDef.header = {
|
|
43
|
-
menu: {
|
|
44
|
-
commandItems: [
|
|
45
|
-
// add Custom Header Menu Item Commands which will be appended to the existing internal custom items
|
|
46
|
-
// you cannot override an internal command but you can hide them and create your own
|
|
47
|
-
// also note that the internal custom commands are in the positionOrder range of 50-60,
|
|
48
|
-
// if you want yours at the bottom then start with 61, below 50 will make your command(s) show on top
|
|
49
|
-
{
|
|
50
|
-
iconCssClass: 'mdi mdi-help-circle',
|
|
51
|
-
|
|
52
|
-
// you can disable a command with certain logic
|
|
53
|
-
// HOWEVER note that if you use "itemUsabilityOverride" has precedence when it is defined
|
|
54
|
-
// disabled: (columnDef.id === 'completed'),
|
|
55
|
-
|
|
56
|
-
titleKey: 'HELP', // use "title" as plain string OR "titleKey" when using a translation key
|
|
57
|
-
command: 'help',
|
|
58
|
-
tooltip: 'Need assistance?',
|
|
59
|
-
cssClass: 'bold', // container css class
|
|
60
|
-
textCssClass: columnDef.id === 'title' || columnDef.id === 'completed' ? '' : 'blue', // just the text css class
|
|
61
|
-
positionOrder: 99,
|
|
62
|
-
itemUsabilityOverride: (args) => {
|
|
63
|
-
// for example if we want to disable the "Help" command over the "Title" and "Completed" column
|
|
64
|
-
return !(args.column.id === 'title' || args.column.id === 'completed');
|
|
65
|
-
},
|
|
66
|
-
itemVisibilityOverride: (args) => {
|
|
67
|
-
// for example don't show Help on column "% Complete"
|
|
68
|
-
return args.column.id !== 'percentComplete';
|
|
69
|
-
},
|
|
70
|
-
action: (e, args) => {
|
|
71
|
-
// you can use the "action" callback and/or subscribe to the "onCallback" event, they both have the same arguments
|
|
72
|
-
console.log('execute an action on Help', args);
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
// you can also add divider between commands (command is a required property but you can set it to empty string)
|
|
76
|
-
{ divider: true, command: '', positionOrder: 98 },
|
|
77
|
-
|
|
78
|
-
// you can use "divider" as a string too, but if you do then make sure it's the correct position in the list
|
|
79
|
-
// (since there's no positionOrder when using 'divider')
|
|
80
|
-
// 'divider',
|
|
81
|
-
{
|
|
82
|
-
// we can also have multiple nested sub-menus
|
|
83
|
-
command: 'custom-actions',
|
|
84
|
-
title: 'Hello',
|
|
85
|
-
positionOrder: 99,
|
|
86
|
-
commandItems: [
|
|
87
|
-
{ command: 'hello-world', title: 'Hello World' },
|
|
88
|
-
{ command: 'hello-slickgrid', title: 'Hello SlickGrid' },
|
|
89
|
-
{
|
|
90
|
-
command: 'sub-menu',
|
|
91
|
-
title: `Let's play`,
|
|
92
|
-
cssClass: 'green',
|
|
93
|
-
subMenuTitle: 'choose your game',
|
|
94
|
-
subMenuTitleCssClass: 'text-italic salmon',
|
|
95
|
-
commandItems: [
|
|
96
|
-
{ command: 'sport-badminton', title: 'Badminton' },
|
|
97
|
-
{ command: 'sport-tennis', title: 'Tennis' },
|
|
98
|
-
{ command: 'sport-racquetball', title: 'Racquetball' },
|
|
99
|
-
{ command: 'sport-squash', title: 'Squash' },
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
command: 'feedback',
|
|
106
|
-
title: 'Feedback',
|
|
107
|
-
positionOrder: 100,
|
|
108
|
-
commandItems: [
|
|
109
|
-
{
|
|
110
|
-
command: 'request-update',
|
|
111
|
-
title: 'Request update from supplier',
|
|
112
|
-
iconCssClass: 'mdi mdi-star',
|
|
113
|
-
tooltip: 'this will automatically send an alert to the shipping team to contact the user for an update',
|
|
114
|
-
},
|
|
115
|
-
'divider',
|
|
116
|
-
{
|
|
117
|
-
command: 'sub-menu',
|
|
118
|
-
title: 'Contact Us',
|
|
119
|
-
iconCssClass: 'mdi mdi-account',
|
|
120
|
-
subMenuTitle: 'contact us...',
|
|
121
|
-
subMenuTitleCssClass: 'italic',
|
|
122
|
-
commandItems: [
|
|
123
|
-
{ command: 'contact-email', title: 'Email us', iconCssClass: 'mdi mdi-pencil-outline' },
|
|
124
|
-
{ command: 'contact-chat', title: 'Chat with us', iconCssClass: 'mdi mdi-message-text-outline' },
|
|
125
|
-
{ command: 'contact-meeting', title: 'Book an appointment', iconCssClass: 'mdi mdi-coffee' },
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
this.gridOptions = {
|
|
136
|
-
enableAutoResize: true,
|
|
137
|
-
enableHeaderMenu: true,
|
|
138
|
-
autoResize: {
|
|
139
|
-
container: '#demo-container',
|
|
140
|
-
rightPadding: 10,
|
|
141
|
-
},
|
|
142
|
-
enableFiltering: false,
|
|
143
|
-
enableCellNavigation: true,
|
|
144
|
-
headerMenu: {
|
|
145
|
-
hideSortCommands: false,
|
|
146
|
-
hideColumnHideCommand: false,
|
|
147
|
-
subItemChevronClass: 'mdi mdi-chevron-down mdi-rotate-270',
|
|
148
|
-
// you can use the "onCommand" (in Grid Options) and/or the "action" callback (in Column Definition)
|
|
149
|
-
onCommand: (_e, args) => {
|
|
150
|
-
// e.preventDefault(); // preventing default event would keep the menu open after the execution
|
|
151
|
-
const command = args.item?.command;
|
|
152
|
-
if (command.includes('hello-')) {
|
|
153
|
-
alert(args?.item.title);
|
|
154
|
-
} else if (command.includes('sport-')) {
|
|
155
|
-
alert('Just do it, play ' + args?.item?.title);
|
|
156
|
-
} else if (command.includes('contact-')) {
|
|
157
|
-
alert('Command: ' + args?.item?.command);
|
|
158
|
-
} else if (args.command === 'help') {
|
|
159
|
-
alert('Please help!!!');
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
enableTranslate: true,
|
|
164
|
-
i18n: this.translate,
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
this.getData();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
getData() {
|
|
171
|
-
// Set up some test columns.
|
|
172
|
-
const mockDataset = [];
|
|
173
|
-
for (let i = 0; i < 1000; i++) {
|
|
174
|
-
mockDataset[i] = {
|
|
175
|
-
id: i,
|
|
176
|
-
title: 'Task ' + i,
|
|
177
|
-
duration: Math.round(Math.random() * 25) + ' days',
|
|
178
|
-
percentComplete: Math.round(Math.random() * 100),
|
|
179
|
-
start: '01/01/2009',
|
|
180
|
-
finish: '01/05/2009',
|
|
181
|
-
completed: i % 5 === 0,
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
this.dataset = mockDataset;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
switchLanguage() {
|
|
188
|
-
const nextLanguage = this.selectedLanguage === 'en' ? 'fr' : 'en';
|
|
189
|
-
this.subscriptions.push(
|
|
190
|
-
this.translate.use(nextLanguage).subscribe(() => {
|
|
191
|
-
this.selectedLanguage = nextLanguage;
|
|
192
|
-
})
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<div id="demo-container" class="container-fluid">
|
|
2
|
-
<h2>
|
|
3
|
-
Example 9: Grid Menu Control
|
|
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-menu.component.ts"
|
|
9
|
-
>
|
|
10
|
-
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
-
</a>
|
|
12
|
-
</span>
|
|
13
|
-
</h2>
|
|
14
|
-
<div class="subtitle">
|
|
15
|
-
This example demonstrates using the <b>Slick.Controls.GridMenu</b> plugin to easily add a Grid Menu (aka hamburger menu) on the top
|
|
16
|
-
right corner of the grid. (<a href="https://ghiscoding.gitbook.io/angular-slickgrid/grid-functionalities/grid-menu" target="_blank"
|
|
17
|
-
>Wiki docs</a
|
|
18
|
-
>)
|
|
19
|
-
<br />
|
|
20
|
-
<ul>
|
|
21
|
-
<li>
|
|
22
|
-
You can change the Grid Menu icon, for example "mdi-dots-vertical" <span class="mdi mdi-dots-vertical"></span
|
|
23
|
-
> (which is shown in this example)
|
|
24
|
-
</li>
|
|
25
|
-
<li>By default the Grid Menu shows all columns which you can show/hide them</li>
|
|
26
|
-
<li>You can configure multiple custom "commands" to show up in the Grid Menu and use the "onGridMenuCommand()" callback</li>
|
|
27
|
-
<li>Doing a "right + click" over any column header will also provide a way to show/hide a column (via the Column Picker Plugin)</li>
|
|
28
|
-
<li>You can change the icons of both picker via SASS variables as shown in this demo (check all SASS variables)</li>
|
|
29
|
-
<li><i class="mdi mdi-arrow-down"></i> You can also show the Grid Menu anywhere on your page</li>
|
|
30
|
-
</ul>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" data-test="external-gridmenu" (click)="toggleGridMenu($event)">
|
|
34
|
-
<i class="mdi mdi-menu"></i>
|
|
35
|
-
Grid Menu
|
|
36
|
-
</button>
|
|
37
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" data-test="language" (click)="switchLanguage()">
|
|
38
|
-
<i class="mdi mdi-translate"></i>
|
|
39
|
-
Switch Language
|
|
40
|
-
</button>
|
|
41
|
-
|
|
42
|
-
<strong>Locale:</strong>
|
|
43
|
-
<span style="font-style: italic" data-test="selected-locale">{{ selectedLanguage + '.json' }} </span>
|
|
44
|
-
|
|
45
|
-
<div class="col-sm-12">
|
|
46
|
-
<angular-slickgrid
|
|
47
|
-
gridId="grid9"
|
|
48
|
-
[columns]="columnDefinitions"
|
|
49
|
-
[options]="gridOptions"
|
|
50
|
-
[dataset]="dataset"
|
|
51
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
52
|
-
>
|
|
53
|
-
</angular-slickgrid>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
@use '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-bootstrap.scss' with (
|
|
2
|
-
$slick-column-picker-icon-checked-svg-path: "M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,5V19H5V5H19M10,17L6,13L7.41,11.58L10,14.17L16.59,7.58L18,9",
|
|
3
|
-
$slick-column-picker-icon-unchecked-svg-path: "M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z",
|
|
4
|
-
$slick-column-picker-icon-font-size: 16px,
|
|
5
|
-
$slick-checkbox-opacity-hover: 0.35,
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
.blue {
|
|
9
|
-
color: rgb(73, 73, 255);
|
|
10
|
-
}
|
|
11
|
-
.orange {
|
|
12
|
-
color: orange;
|
|
13
|
-
}
|
|
14
|
-
.red {
|
|
15
|
-
color: red;
|
|
16
|
-
}
|
|
17
|
-
.bold {
|
|
18
|
-
font-weight: bold;
|
|
19
|
-
}
|
|
20
|
-
.italic {
|
|
21
|
-
font-style: italic;
|
|
22
|
-
}
|