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,82 +0,0 @@
|
|
|
1
|
-
<div class="container-fluid">
|
|
2
|
-
<h2>
|
|
3
|
-
Example 34: Real-Time Trading Platform
|
|
4
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon ms-3" (click)="toggleDarkMode()" data-test="toggle-dark-mode">
|
|
5
|
-
<span class="mdi mdi-theme-light-dark"></span>
|
|
6
|
-
<span>Toggle Dark Mode</span>
|
|
7
|
-
</button>
|
|
8
|
-
<span class="float-end">
|
|
9
|
-
<a
|
|
10
|
-
style="font-size: 18px"
|
|
11
|
-
target="_blank"
|
|
12
|
-
href="https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-trading.component.ts"
|
|
13
|
-
>
|
|
14
|
-
<span class="mdi mdi-link-variant"></span> code
|
|
15
|
-
</a>
|
|
16
|
-
</span>
|
|
17
|
-
</h2>
|
|
18
|
-
<div class="subtitle">
|
|
19
|
-
Simulate a stock trading platform with lot of price changes, it is strongly suggested to disable the
|
|
20
|
-
<code>autoResize.autoHeight</code> grid option for this type of grid.
|
|
21
|
-
<ul>
|
|
22
|
-
<li>
|
|
23
|
-
you can start/stop the simulation, you can see SlickGrid huge perf by setting: (1) lower Changes Rate, (2) increase both Changes per
|
|
24
|
-
Cycle, and (3) lower Highlight Duration
|
|
25
|
-
</li>
|
|
26
|
-
<li>optionally change random numbers, between 0 and 10 symbols, per cycle (higher numbers means more changes)</li>
|
|
27
|
-
<li>optionally change the simulation changes refresh rate in ms (lower number means more changes).</li>
|
|
28
|
-
<li>you can Group by 1 of these columns: Currency, Market or Type</li>
|
|
29
|
-
</ul>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div class="trading-platform">
|
|
33
|
-
<div class="row mb-4 simulation-form">
|
|
34
|
-
<div class="col-sm-12 d-flex align-items-center">
|
|
35
|
-
<div class="range">
|
|
36
|
-
<label for="refreshRateRange" class="form-label me-1">Changes Rate(ms)</label>
|
|
37
|
-
<input type="range" class="form-range" id="refreshRateRange" min="0" max="250" [(ngModel)]="refreshRate" />
|
|
38
|
-
<span class="refresh-rate">
|
|
39
|
-
<input type="number" [(ngModel)]="refreshRate" />
|
|
40
|
-
</span>
|
|
41
|
-
</div>
|
|
42
|
-
<span class="ms-3 me-1">
|
|
43
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" data-test="start-btn" (click)="startSimulation()">
|
|
44
|
-
<li class="mdi mdi-play-circle-outline"></li>
|
|
45
|
-
Start Simulation
|
|
46
|
-
</button>
|
|
47
|
-
</span>
|
|
48
|
-
<span class="me-3">
|
|
49
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" data-test="stop-btn" (click)="stopSimulation()">
|
|
50
|
-
<li class="mdi mdi-stop-circle-outline"></li>
|
|
51
|
-
Stop Simulation
|
|
52
|
-
</button>
|
|
53
|
-
</span>
|
|
54
|
-
<span class="mx-1">
|
|
55
|
-
<label for="change-per-cycle-input">Changes p/Cycle</label>
|
|
56
|
-
<input type="number" id="change-per-cycle-input" [(ngModel)]="minChangePerCycle" [max]="maxChangePerCycle" />
|
|
57
|
-
to
|
|
58
|
-
<input type="number" [(ngModel)]="maxChangePerCycle" [min]="minChangePerCycle" />
|
|
59
|
-
</span>
|
|
60
|
-
<span class="ms-2">
|
|
61
|
-
<label for="highlight-input">Highlight Duration(ms)</label>
|
|
62
|
-
<input type="number" id="highlight-input" data-test="highlight-input" [(ngModel)]="highlightDuration" />
|
|
63
|
-
</span>
|
|
64
|
-
<div class="ms-auto">
|
|
65
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" (click)="toggleFullScreen()">
|
|
66
|
-
<li [class]="isFullScreen ? 'mdi mdi-arrow-collapse' : 'mdi mdi-arrow-expand'"></li>
|
|
67
|
-
Toggle Full-Screen
|
|
68
|
-
</button>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<angular-slickgrid
|
|
74
|
-
gridId="grid34"
|
|
75
|
-
[columns]="columnDefinitions"
|
|
76
|
-
[options]="gridOptions"
|
|
77
|
-
[dataset]="dataset"
|
|
78
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
79
|
-
>
|
|
80
|
-
</angular-slickgrid>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// @use '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-salesforce.lite.scss';
|
|
2
|
-
|
|
3
|
-
$sparkline-color: #00b78d;
|
|
4
|
-
// $sparkline-color: #573585;
|
|
5
|
-
|
|
6
|
-
.trading-platform.full-screen {
|
|
7
|
-
position: absolute;
|
|
8
|
-
top: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
right: 0;
|
|
11
|
-
bottom: 0;
|
|
12
|
-
padding: 10px 12px 0 10px;
|
|
13
|
-
background-color: white;
|
|
14
|
-
z-index: 1040;
|
|
15
|
-
position: fixed;
|
|
16
|
-
}
|
|
17
|
-
.changed-gain {
|
|
18
|
-
background-color: #eafae8 !important;
|
|
19
|
-
}
|
|
20
|
-
.changed-loss {
|
|
21
|
-
background-color: #ffeae8 !important;
|
|
22
|
-
}
|
|
23
|
-
.simulation-form {
|
|
24
|
-
input[type=number] {
|
|
25
|
-
height: 32px;
|
|
26
|
-
width: 50px;
|
|
27
|
-
border: 1px solid #c0c0c0;
|
|
28
|
-
border-radius: 3px;
|
|
29
|
-
}
|
|
30
|
-
div.range {
|
|
31
|
-
display: contents;
|
|
32
|
-
width: 200px;
|
|
33
|
-
label.form-label {
|
|
34
|
-
margin: 0;
|
|
35
|
-
}
|
|
36
|
-
input.form-range {
|
|
37
|
-
width: 120px;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
.refresh-rate input {
|
|
41
|
-
height: 30px;
|
|
42
|
-
width: 46px;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
.sparkline {
|
|
46
|
-
stroke: $sparkline-color;
|
|
47
|
-
fill: rgba($sparkline-color, 0.05);
|
|
48
|
-
}
|
|
49
|
-
*[hidden] {
|
|
50
|
-
display: none;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.trading-tooltip {
|
|
54
|
-
position: absolute;
|
|
55
|
-
background: rgba(0, 0, 0, .7);
|
|
56
|
-
color: #fff;
|
|
57
|
-
padding: 2px 5px;
|
|
58
|
-
font-size: 12px;
|
|
59
|
-
white-space: nowrap;
|
|
60
|
-
z-index: 9999;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.slick-dark-mode,
|
|
64
|
-
.dark-mode {
|
|
65
|
-
.text-success {
|
|
66
|
-
color: #42b47f !important
|
|
67
|
-
}
|
|
68
|
-
.changed-gain {
|
|
69
|
-
background-color: #00ff001d !important;
|
|
70
|
-
}
|
|
71
|
-
.changed-loss {
|
|
72
|
-
background-color: #ff00001b !important;
|
|
73
|
-
}
|
|
74
|
-
.trading-platform.full-screen {
|
|
75
|
-
background-color: #33393e;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
import { faker } from '@faker-js/faker';
|
|
3
|
-
import sparkline from '@fnando/sparkline';
|
|
4
|
-
import {
|
|
5
|
-
Aggregators,
|
|
6
|
-
AngularGridInstance,
|
|
7
|
-
Column,
|
|
8
|
-
createDomElement,
|
|
9
|
-
deepCopy,
|
|
10
|
-
Filters,
|
|
11
|
-
Formatter,
|
|
12
|
-
Formatters,
|
|
13
|
-
GridOption,
|
|
14
|
-
GroupTotalFormatters,
|
|
15
|
-
} from '../../library';
|
|
16
|
-
|
|
17
|
-
const NB_ROWS = 200;
|
|
18
|
-
|
|
19
|
-
const currencyFormatter: Formatter = (cell: number, row: number, value: string) =>
|
|
20
|
-
`<img src="https://flags.fmcdn.net/data/flags/mini/${value.substr(0, 2).toLowerCase()}.png" width="20"/> ${value}`;
|
|
21
|
-
|
|
22
|
-
const priceFormatter: Formatter = (_cell, _row, value, _col, dataContext) => {
|
|
23
|
-
const direction = dataContext.priceChange >= 0 ? 'up' : 'down';
|
|
24
|
-
const fragment = new DocumentFragment();
|
|
25
|
-
const divElm = document.createElement('div');
|
|
26
|
-
divElm.className = `d-inline-flex align-items-center text-${direction === 'up' ? 'success' : 'danger'}`;
|
|
27
|
-
const spanElm = document.createElement('span');
|
|
28
|
-
spanElm.className = `mdi mdi-arrow-${direction}`;
|
|
29
|
-
divElm.appendChild(spanElm);
|
|
30
|
-
fragment.appendChild(divElm);
|
|
31
|
-
if (value instanceof HTMLElement) {
|
|
32
|
-
divElm.appendChild(value);
|
|
33
|
-
} else {
|
|
34
|
-
divElm.appendChild(document.createTextNode(value));
|
|
35
|
-
}
|
|
36
|
-
return fragment;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const transactionTypeFormatter: Formatter = (_row, _cell, value: string) =>
|
|
40
|
-
`<div class="d-inline-flex align-items-center"><span class="me-1 mdi mdi-16px mdi-${value === 'Buy' ? 'plus' : 'minus'}-circle ${value === 'Buy' ? 'text-info' : 'text-warning'}"></span> ${value}</div>`;
|
|
41
|
-
|
|
42
|
-
const historicSparklineFormatter: Formatter = (_row, _cell, _value: string, _col, dataContext) => {
|
|
43
|
-
if (dataContext.historic.length < 2) {
|
|
44
|
-
return '';
|
|
45
|
-
}
|
|
46
|
-
const svgElem = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
47
|
-
svgElem.setAttributeNS(null, 'width', '135');
|
|
48
|
-
svgElem.setAttributeNS(null, 'height', '30');
|
|
49
|
-
svgElem.setAttributeNS(null, 'stroke-width', '2');
|
|
50
|
-
svgElem.classList.add('sparkline');
|
|
51
|
-
sparkline(svgElem, dataContext.historic, {
|
|
52
|
-
cursorwidth: 2,
|
|
53
|
-
onmousemove: (event, datapoint) => {
|
|
54
|
-
const svg = (event.target as HTMLElement).closest('svg');
|
|
55
|
-
const tooltip = svg?.nextElementSibling as HTMLElement;
|
|
56
|
-
if (tooltip) {
|
|
57
|
-
tooltip.hidden = false;
|
|
58
|
-
tooltip.textContent = `$${((datapoint.value * 100) / 100).toFixed(2)}`;
|
|
59
|
-
tooltip.style.top = `${event.offsetY}px`;
|
|
60
|
-
tooltip.style.left = `${event.offsetX + 20}px`;
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
onmouseout: (event) => {
|
|
64
|
-
const svg = (event.target as HTMLElement).closest('svg');
|
|
65
|
-
const tooltip = svg?.nextElementSibling as HTMLElement;
|
|
66
|
-
if (tooltip) {
|
|
67
|
-
tooltip.hidden = true;
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
const div = document.createElement('div');
|
|
72
|
-
div.appendChild(svgElem);
|
|
73
|
-
div.appendChild(createDomElement('div', { className: 'trading-tooltip', hidden: true }));
|
|
74
|
-
return div;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
@Component({
|
|
78
|
-
templateUrl: './example34.component.html',
|
|
79
|
-
styleUrls: ['./example34.component.scss'],
|
|
80
|
-
encapsulation: ViewEncapsulation.None,
|
|
81
|
-
standalone: false,
|
|
82
|
-
})
|
|
83
|
-
export class Example34Component implements OnDestroy, OnInit {
|
|
84
|
-
private _darkMode = false;
|
|
85
|
-
angularGrid!: AngularGridInstance;
|
|
86
|
-
gridOptions!: GridOption;
|
|
87
|
-
columnDefinitions: Column[] = [];
|
|
88
|
-
dataset: any[] = [];
|
|
89
|
-
isFullScreen = false;
|
|
90
|
-
highlightDuration = 150;
|
|
91
|
-
itemCount = 200;
|
|
92
|
-
minChangePerCycle = 0;
|
|
93
|
-
maxChangePerCycle = 10;
|
|
94
|
-
refreshRate = 75;
|
|
95
|
-
timer: any;
|
|
96
|
-
|
|
97
|
-
ngOnInit(): void {
|
|
98
|
-
this.defineGrid();
|
|
99
|
-
|
|
100
|
-
// mock a dataset
|
|
101
|
-
this.dataset = this.loadData(NB_ROWS);
|
|
102
|
-
|
|
103
|
-
setTimeout(() => {
|
|
104
|
-
this.startSimulation();
|
|
105
|
-
}, this.refreshRate);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
ngOnDestroy(): void {
|
|
109
|
-
this.stopSimulation();
|
|
110
|
-
document.querySelector('.panel-wm-content')!.classList.remove('dark-mode');
|
|
111
|
-
document.querySelector<HTMLDivElement>('#demo-container')!.dataset.bsTheme = 'light';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
115
|
-
this.angularGrid = angularGrid;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/* Define grid Options and Columns */
|
|
119
|
-
defineGrid() {
|
|
120
|
-
// the columns field property is type-safe, try to add a different string not representing one of DataItems properties
|
|
121
|
-
this.columnDefinitions = [
|
|
122
|
-
{
|
|
123
|
-
id: 'currency',
|
|
124
|
-
name: 'Currency',
|
|
125
|
-
field: 'currency',
|
|
126
|
-
filterable: true,
|
|
127
|
-
sortable: true,
|
|
128
|
-
minWidth: 65,
|
|
129
|
-
width: 65,
|
|
130
|
-
formatter: currencyFormatter,
|
|
131
|
-
filter: {
|
|
132
|
-
model: Filters.singleSelect,
|
|
133
|
-
collection: [
|
|
134
|
-
{ label: '', value: '' },
|
|
135
|
-
{ label: 'CAD', value: 'CAD' },
|
|
136
|
-
{ label: 'USD', value: 'USD' },
|
|
137
|
-
],
|
|
138
|
-
},
|
|
139
|
-
grouping: {
|
|
140
|
-
getter: 'currency',
|
|
141
|
-
formatter: (g) =>
|
|
142
|
-
`Currency: <span style="var(--slick-primary-color); font-weight: bold;">${g.value}</span> <span style="color: #659bff;">(${g.count} items)</span>`,
|
|
143
|
-
aggregators: [new Aggregators.Sum('amount')],
|
|
144
|
-
aggregateCollapsed: true,
|
|
145
|
-
collapsed: false,
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
{ id: 'symbol', name: 'Symbol', field: 'symbol', filterable: true, sortable: true, minWidth: 65, width: 65 },
|
|
149
|
-
{
|
|
150
|
-
id: 'market',
|
|
151
|
-
name: 'Market',
|
|
152
|
-
field: 'market',
|
|
153
|
-
filterable: true,
|
|
154
|
-
sortable: true,
|
|
155
|
-
minWidth: 75,
|
|
156
|
-
width: 75,
|
|
157
|
-
grouping: {
|
|
158
|
-
getter: 'market',
|
|
159
|
-
formatter: (g) =>
|
|
160
|
-
`Market: <span style="var(--slick-primary-color); font-weight: bold;">${g.value}</span> <span style="color: #659bff;">(${g.count} items)</span>`,
|
|
161
|
-
aggregators: [new Aggregators.Sum('amount')],
|
|
162
|
-
aggregateCollapsed: true,
|
|
163
|
-
collapsed: false,
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
{ id: 'company', name: 'Company', field: 'company', filterable: true, sortable: true, minWidth: 80, width: 130 },
|
|
167
|
-
{
|
|
168
|
-
id: 'trsnType',
|
|
169
|
-
name: 'Type',
|
|
170
|
-
field: 'trsnType',
|
|
171
|
-
filterable: true,
|
|
172
|
-
sortable: true,
|
|
173
|
-
minWidth: 60,
|
|
174
|
-
width: 60,
|
|
175
|
-
formatter: transactionTypeFormatter,
|
|
176
|
-
filter: {
|
|
177
|
-
model: Filters.singleSelect,
|
|
178
|
-
collection: [
|
|
179
|
-
{ label: '', value: '' },
|
|
180
|
-
{ label: 'Buy', value: 'Buy' },
|
|
181
|
-
{ label: 'Sell', value: 'Sell' },
|
|
182
|
-
],
|
|
183
|
-
},
|
|
184
|
-
grouping: {
|
|
185
|
-
getter: 'trsnType',
|
|
186
|
-
formatter: (g) =>
|
|
187
|
-
`Type: <span style="var(--slick-primary-color); font-weight: bold;">${g.value}</span> <span style="color: #659bff;">(${g.count} items)</span>`,
|
|
188
|
-
aggregators: [new Aggregators.Sum('amount')],
|
|
189
|
-
aggregateCollapsed: true,
|
|
190
|
-
collapsed: false,
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
id: 'priceChange',
|
|
195
|
-
name: 'Change',
|
|
196
|
-
field: 'priceChange',
|
|
197
|
-
filterable: true,
|
|
198
|
-
sortable: true,
|
|
199
|
-
minWidth: 80,
|
|
200
|
-
width: 80,
|
|
201
|
-
filter: { model: Filters.compoundInputNumber },
|
|
202
|
-
type: 'number',
|
|
203
|
-
formatter: Formatters.multiple,
|
|
204
|
-
params: {
|
|
205
|
-
formatters: [Formatters.dollar, priceFormatter],
|
|
206
|
-
maxDecimal: 2,
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
id: 'price',
|
|
211
|
-
name: 'Price',
|
|
212
|
-
field: 'price',
|
|
213
|
-
filterable: true,
|
|
214
|
-
sortable: true,
|
|
215
|
-
minWidth: 70,
|
|
216
|
-
width: 70,
|
|
217
|
-
filter: { model: Filters.compoundInputNumber },
|
|
218
|
-
type: 'number',
|
|
219
|
-
formatter: Formatters.dollar,
|
|
220
|
-
params: { maxDecimal: 2 },
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
id: 'quantity',
|
|
224
|
-
name: 'Quantity',
|
|
225
|
-
field: 'quantity',
|
|
226
|
-
filterable: true,
|
|
227
|
-
sortable: true,
|
|
228
|
-
minWidth: 70,
|
|
229
|
-
width: 70,
|
|
230
|
-
filter: { model: Filters.compoundInputNumber },
|
|
231
|
-
type: 'number',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
id: 'amount',
|
|
235
|
-
name: 'Amount',
|
|
236
|
-
field: 'amount',
|
|
237
|
-
filterable: true,
|
|
238
|
-
sortable: true,
|
|
239
|
-
minWidth: 70,
|
|
240
|
-
width: 60,
|
|
241
|
-
filter: { model: Filters.compoundInputNumber },
|
|
242
|
-
type: 'number',
|
|
243
|
-
formatter: Formatters.dollar,
|
|
244
|
-
params: { maxDecimal: 2 },
|
|
245
|
-
groupTotalsFormatter: GroupTotalFormatters.sumTotalsDollarBold,
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
id: 'historic',
|
|
249
|
-
name: 'Price History',
|
|
250
|
-
field: 'historic',
|
|
251
|
-
minWidth: 100,
|
|
252
|
-
width: 150,
|
|
253
|
-
maxWidth: 150,
|
|
254
|
-
formatter: historicSparklineFormatter,
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
id: 'execution',
|
|
258
|
-
name: 'Execution Timestamp',
|
|
259
|
-
field: 'execution',
|
|
260
|
-
filterable: true,
|
|
261
|
-
sortable: true,
|
|
262
|
-
minWidth: 125,
|
|
263
|
-
formatter: Formatters.dateTimeIsoAmPm,
|
|
264
|
-
exportWithFormatter: true,
|
|
265
|
-
type: 'dateTimeIsoAM_PM',
|
|
266
|
-
filter: { model: Filters.compoundDate },
|
|
267
|
-
},
|
|
268
|
-
];
|
|
269
|
-
|
|
270
|
-
this.gridOptions = {
|
|
271
|
-
autoResize: {
|
|
272
|
-
container: '.trading-platform',
|
|
273
|
-
autoHeight: false,
|
|
274
|
-
rightPadding: 0,
|
|
275
|
-
bottomPadding: 10,
|
|
276
|
-
},
|
|
277
|
-
formatterOptions: {
|
|
278
|
-
displayNegativeNumberWithParentheses: true,
|
|
279
|
-
thousandSeparator: ',',
|
|
280
|
-
},
|
|
281
|
-
draggableGrouping: {
|
|
282
|
-
dropPlaceHolderText: 'Drop a column header here to group by any of these available columns: Currency, Market or Type',
|
|
283
|
-
deleteIconCssClass: 'mdi mdi-close',
|
|
284
|
-
},
|
|
285
|
-
enableDraggableGrouping: true,
|
|
286
|
-
createPreHeaderPanel: true,
|
|
287
|
-
darkMode: this._darkMode,
|
|
288
|
-
showPreHeaderPanel: true,
|
|
289
|
-
preHeaderPanelHeight: 40,
|
|
290
|
-
enableCellNavigation: true,
|
|
291
|
-
enableFiltering: true,
|
|
292
|
-
cellHighlightCssClass: 'changed',
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
loadData(itemCount: number): any[] {
|
|
297
|
-
// mock a dataset
|
|
298
|
-
const tmpDataset = [];
|
|
299
|
-
for (let i = 0; i < itemCount; i++) {
|
|
300
|
-
const randomPercent = Math.round(Math.random() * 100);
|
|
301
|
-
const randomLowQty = this.randomNumber(1, 50);
|
|
302
|
-
const randomHighQty = this.randomNumber(125, 255);
|
|
303
|
-
const priceChange = this.randomNumber(-25, 35, false);
|
|
304
|
-
const price = this.randomNumber(priceChange, 300);
|
|
305
|
-
const quantity = price < 5 ? randomHighQty : randomLowQty;
|
|
306
|
-
const amount = price * quantity;
|
|
307
|
-
const now = new Date();
|
|
308
|
-
now.setHours(9, 30, 0);
|
|
309
|
-
const currency = Math.floor(Math.random() * 10) % 2 ? 'CAD' : 'USD';
|
|
310
|
-
const company = faker.company.name();
|
|
311
|
-
|
|
312
|
-
tmpDataset[i] = {
|
|
313
|
-
id: i,
|
|
314
|
-
currency,
|
|
315
|
-
trsnType: Math.round(Math.random() * 100) % 2 ? 'Buy' : 'Sell',
|
|
316
|
-
company,
|
|
317
|
-
symbol: currency === 'CAD' ? company.substr(0, 3).toUpperCase() + '.TO' : company.substr(0, 4).toUpperCase(),
|
|
318
|
-
market: currency === 'CAD' ? 'TSX' : price > 200 ? 'Nasdaq' : 'S&P 500',
|
|
319
|
-
duration: i % 33 === 0 ? null : Math.random() * 100 + '',
|
|
320
|
-
percentCompleteNumber: randomPercent,
|
|
321
|
-
priceChange,
|
|
322
|
-
price,
|
|
323
|
-
quantity,
|
|
324
|
-
amount,
|
|
325
|
-
execution: now,
|
|
326
|
-
historic: [price],
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
return tmpDataset;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
startSimulation() {
|
|
334
|
-
const changes: any = {};
|
|
335
|
-
const numberOfUpdates = this.randomNumber(this.minChangePerCycle, this.maxChangePerCycle);
|
|
336
|
-
|
|
337
|
-
for (let i = 0; i < numberOfUpdates; i++) {
|
|
338
|
-
const randomLowQty = this.randomNumber(1, 50);
|
|
339
|
-
const randomHighQty = this.randomNumber(125, 255);
|
|
340
|
-
const rowNumber = Math.round(Math.random() * (this.dataset.length - 1));
|
|
341
|
-
const priceChange = this.randomNumber(-25, 25, false);
|
|
342
|
-
const prevItem = deepCopy(this.dataset[rowNumber]);
|
|
343
|
-
const itemTmp = { ...this.dataset[rowNumber] };
|
|
344
|
-
itemTmp.priceChange = priceChange;
|
|
345
|
-
itemTmp.price = itemTmp.price + priceChange < 0 ? 0 : itemTmp.price + priceChange;
|
|
346
|
-
itemTmp.quantity = itemTmp.price < 5 ? randomHighQty : randomLowQty;
|
|
347
|
-
itemTmp.amount = itemTmp.price * itemTmp.quantity;
|
|
348
|
-
itemTmp.trsnType = Math.round(Math.random() * 100) % 2 ? 'Buy' : 'Sell';
|
|
349
|
-
itemTmp.execution = new Date();
|
|
350
|
-
itemTmp.historic.push(itemTmp.price);
|
|
351
|
-
itemTmp.historic = itemTmp.historic.slice(-20); // keep a max of X historic values
|
|
352
|
-
|
|
353
|
-
if (!changes[rowNumber]) {
|
|
354
|
-
changes[rowNumber] = {};
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// highlight whichever cell is being changed
|
|
358
|
-
changes[rowNumber]['id'] = 'changed';
|
|
359
|
-
this.renderCellHighlighting(itemTmp, this.findColumnById('priceChange'), priceChange);
|
|
360
|
-
if ((prevItem.priceChange < 0 && itemTmp.priceChange > 0) || (prevItem.priceChange > 0 && itemTmp.priceChange < 0)) {
|
|
361
|
-
this.renderCellHighlighting(itemTmp, this.findColumnById('price'), priceChange);
|
|
362
|
-
}
|
|
363
|
-
// if (prevItem.trsnType !== itemTmp.trsnType) {
|
|
364
|
-
// this.renderCellHighlighting(itemTmp, this.findColumnById('trsnType'), priceChange);
|
|
365
|
-
// }
|
|
366
|
-
|
|
367
|
-
// update the data
|
|
368
|
-
this.angularGrid.dataView.updateItem(itemTmp.id, itemTmp);
|
|
369
|
-
// NOTE: we should also invalidate/render the row after updating cell data to see the new data rendered in the UI
|
|
370
|
-
// but the cell highlight actually does that for us so we can skip it
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
this.timer = setTimeout(this.startSimulation.bind(this), this.refreshRate || 0);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
stopSimulation() {
|
|
377
|
-
clearTimeout(this.timer);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
findColumnById(columnName: string): Column {
|
|
381
|
-
return this.columnDefinitions.find((col) => col.field === columnName) as Column;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
renderCellHighlighting(item: any, column: Column, priceChange: number) {
|
|
385
|
-
if (item && column) {
|
|
386
|
-
const row = this.angularGrid.dataView.getRowByItem(item) as number;
|
|
387
|
-
if (row >= 0) {
|
|
388
|
-
const hash = { [row]: { [column.id]: priceChange >= 0 ? 'changed-gain' : 'changed-loss' } };
|
|
389
|
-
this.angularGrid.slickGrid.setCellCssStyles(`highlight_${[column.id]}${row}`, hash);
|
|
390
|
-
|
|
391
|
-
// remove highlight after x amount of time
|
|
392
|
-
setTimeout(() => this.removeCellStyling(item, column, row), this.highlightDuration);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/** remove change highlight css class from that cell */
|
|
398
|
-
removeCellStyling(_item: any, column: Column, row: number) {
|
|
399
|
-
this.angularGrid?.slickGrid?.removeCellCssStyles(`highlight_${[column.id]}${row}`);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
toggleFullScreen() {
|
|
403
|
-
const container = document.querySelector('.trading-platform');
|
|
404
|
-
if (container?.classList.contains('full-screen')) {
|
|
405
|
-
container.classList.remove('full-screen');
|
|
406
|
-
this.isFullScreen = false;
|
|
407
|
-
} else if (container) {
|
|
408
|
-
container.classList.add('full-screen');
|
|
409
|
-
this.isFullScreen = true;
|
|
410
|
-
}
|
|
411
|
-
this.angularGrid.resizerService.resizeGrid();
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
toggleDarkMode() {
|
|
415
|
-
this._darkMode = !this._darkMode;
|
|
416
|
-
this.toggleBodyBackground();
|
|
417
|
-
this.angularGrid.slickGrid?.setOptions({ darkMode: this._darkMode });
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
toggleBodyBackground() {
|
|
421
|
-
if (this._darkMode) {
|
|
422
|
-
document.querySelector<HTMLDivElement>('.panel-wm-content')!.classList.add('dark-mode');
|
|
423
|
-
document.querySelector<HTMLDivElement>('#demo-container')!.dataset.bsTheme = 'dark';
|
|
424
|
-
} else {
|
|
425
|
-
document.querySelector('.panel-wm-content')!.classList.remove('dark-mode');
|
|
426
|
-
document.querySelector<HTMLDivElement>('#demo-container')!.dataset.bsTheme = 'light';
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
private randomNumber(min: number, max: number, floor = true) {
|
|
431
|
-
const number = Math.random() * (max - min + 1) + min;
|
|
432
|
-
return floor ? Math.floor(number) : number;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<h2>
|
|
2
|
-
Example 35: Row Based Editing
|
|
3
|
-
<span class="float-end">
|
|
4
|
-
<a
|
|
5
|
-
style="font-size: 18px"
|
|
6
|
-
target="_blank"
|
|
7
|
-
href="https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-base-row-editing.component.ts"
|
|
8
|
-
>
|
|
9
|
-
<span class="mdi mdi-link-variant"></span> code
|
|
10
|
-
</a>
|
|
11
|
-
</span>
|
|
12
|
-
</h2>
|
|
13
|
-
|
|
14
|
-
<div class="subtitle">
|
|
15
|
-
<ul>
|
|
16
|
-
<li>
|
|
17
|
-
The Row Based Edit plugin allows you to edit either a single or multiple specific rows at a time, while disabling the rest of the grid
|
|
18
|
-
rows.
|
|
19
|
-
</li>
|
|
20
|
-
<li>
|
|
21
|
-
Editedable rows, as well as modified cells are highlighted with a different color, which you can customize using css variables (see
|
|
22
|
-
<a
|
|
23
|
-
target="_blank"
|
|
24
|
-
href="https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-base-row-editing.component.scss"
|
|
25
|
-
>
|
|
26
|
-
grid-base-row-editing.component.scss </a
|
|
27
|
-
>)
|
|
28
|
-
</li>
|
|
29
|
-
<li>Modifications are kept track of and if the cancel button is pressed, all modifications are rolled back.</li>
|
|
30
|
-
<li>
|
|
31
|
-
If the save button is pressed, a custom "onBeforeRowUpdated" callback is called, which you can use to save the data with your
|
|
32
|
-
backend.<br />
|
|
33
|
-
The callback needs to return a Promise<boolean> and if the promise resolves to true, then the row will be updated, otherwise it
|
|
34
|
-
will be cancelled and stays in edit mode. You can try out the later by defining a Duration value <b>larger than 40</b>.
|
|
35
|
-
<br />
|
|
36
|
-
<small
|
|
37
|
-
><span class="has-text-danger">NOTE:</span> You can also combine this with e.g. Batch Editing like shown
|
|
38
|
-
<a href="#/example30">in Example 30</a></small
|
|
39
|
-
>
|
|
40
|
-
</li>
|
|
41
|
-
<li>
|
|
42
|
-
This example additionally uses the ExcelCopyBuffer Plugin, which you can see also in Slickgrid-Universal
|
|
43
|
-
<a href="https://ghiscoding.github.io/slickgrid-universal/#/example19">example 19</a>. The example defines a rule that pastes in the
|
|
44
|
-
first column are prohibited. In combination with the Row Based Editing Plugin though, this rule gets enhanced with the fact that only
|
|
45
|
-
the edited rows are allowed to be pasted into, while still respecting the original rule.
|
|
46
|
-
</li>
|
|
47
|
-
</ul>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<section>
|
|
51
|
-
<div class="row mb-4">
|
|
52
|
-
<div class="col-sm-8">
|
|
53
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="single-multi-toggle" (click)="toggleSingleMultiRowEdit()">
|
|
54
|
-
Toggle Single/Multi Row Edit
|
|
55
|
-
</button>
|
|
56
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" data-test="toggle-language" (click)="switchLanguage()">
|
|
57
|
-
<i class="mdi mdi-translate"></i>
|
|
58
|
-
Switch Language
|
|
59
|
-
</button>
|
|
60
|
-
<b>Locale:</b> <span style="font-style: italic" data-test="selected-locale">{{ selectedLanguage + '.json' }}</span>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<div class="col-sm-4" [class]="statusClass">
|
|
64
|
-
<strong>Status: </strong>
|
|
65
|
-
<span data-test="fetch-result" [textContent]="fetchResult"></span>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</section>
|
|
69
|
-
|
|
70
|
-
<angular-slickgrid
|
|
71
|
-
gridId="grid35"
|
|
72
|
-
[columns]="columnDefinitions"
|
|
73
|
-
[options]="gridOptions"
|
|
74
|
-
[dataset]="dataset"
|
|
75
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
76
|
-
>
|
|
77
|
-
</angular-slickgrid>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
// turn on/off the following variables to see the difference in styling
|
|
3
|
-
|
|
4
|
-
// --slick-row-based-edit-editmode-bgcolor: rgb(82, 235, 158);
|
|
5
|
-
// --slick-row-based-edit-editmode-hover-bgcolor: cyan;
|
|
6
|
-
// --slick-row-based-edit-unsaved-cell-bgcolor: rgb(190, 114, 127);
|
|
7
|
-
// --slick-row-based-edit-editmode-active-bgcolor: rgb(82, 235, 158);
|
|
8
|
-
// --slick-row-based-edit-editmode-active-hover-bgcolor: cyan;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.alert {
|
|
12
|
-
padding: 8px;
|
|
13
|
-
margin-bottom: 10px
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.status-container {
|
|
17
|
-
min-height: 50px;
|
|
18
|
-
}
|