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,260 +0,0 @@
|
|
|
1
|
-
#### Index
|
|
2
|
-
- [Usage](#ui-usage)
|
|
3
|
-
- [Filtering with Localization](#filtering-with-localization-i18n)
|
|
4
|
-
- [Filter Complex Object](#how-to-filter-complex-objects)
|
|
5
|
-
- [Update Filters Dynamically](#update-filters-dynamically)
|
|
6
|
-
- [Query Different Field (Filter/Sort)](#query-different-field)
|
|
7
|
-
- [Dynamic Query Field](#dynamic-query-field)
|
|
8
|
-
- [Debounce/Throttle Text Search (wait for user to stop typing before filtering)](#debouncethrottle-text-search-wait-for-user-to-stop-typing-before-filtering)
|
|
9
|
-
- [Ignore Locale Accent in Text Filter/Sorting](#ignore-locale-accent-in-text-filtersorting)
|
|
10
|
-
- [Custom Filter Predicate](#custom-filter-predicate)
|
|
11
|
-
- [Filter Shortcuts](#filter-shortcuts)
|
|
12
|
-
|
|
13
|
-
### Description
|
|
14
|
-
Input filter is the default filter when enabling filters.
|
|
15
|
-
|
|
16
|
-
### Demo
|
|
17
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/clientside) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-clientside.component.ts)
|
|
18
|
-
|
|
19
|
-
### UI Usage
|
|
20
|
-
All column types support the following operators: (`>`, `>=`, `<`, `<=`, `<>`, `!=`, `=`, `==`, `*`), range filters can also have 1 of these options (`rangeInclusive` or `rangeExclusive`, the inclusive is default)
|
|
21
|
-
Example:
|
|
22
|
-
- Number type
|
|
23
|
-
- `>100` => bigger than 100
|
|
24
|
-
- `<>100` => not include number 100
|
|
25
|
-
- `15..44` => between 15 and 44 (you can also provide option `rangeInclusive` or `rangeExclusive`, inclusive is default)
|
|
26
|
-
- Date types
|
|
27
|
-
- `>=2001-01-01` => bigger or equal than date `2001-01-01`
|
|
28
|
-
- `<02/28/17` => smaller than date `02/28/17`
|
|
29
|
-
- `2001-01-01..2002-02-22` => between 2001-01-01 and 2002-02-22
|
|
30
|
-
- String type
|
|
31
|
-
- `<>John` => not containing the sub-string `John`
|
|
32
|
-
- `!=John` => not equal to the text `John` (note that this is **not** equivalent to `<>`)
|
|
33
|
-
- `John*` => starts with the sub-string `John`
|
|
34
|
-
- `*Doe` => ends with the sub-string `Doe`
|
|
35
|
-
- `ab..ef` => anything included between "af" and "ef"
|
|
36
|
-
- refer to the ASCII table for each character assigned index
|
|
37
|
-
- `!= ` => get defined only data and exclude any `undefined`, `null` or empty string `''`
|
|
38
|
-
- notice the empty string in the search value `' '`
|
|
39
|
-
|
|
40
|
-
Note that you could do the same functionality with a Compound Filter.
|
|
41
|
-
|
|
42
|
-
#### Note
|
|
43
|
-
For filters to work properly (default is `string`), make sure to provide a `FieldType` (type is against the dataset, not the Formatter), for example on a Date Filters, we can set the `FieldType` of dateUtc/date (from dataset) can use an extra option of `filterSearchType` to let user filter more easily. For example, with a column having a "UTC Date" coming from the dataset but has a `formatter: Formatters.dateUs`, you can type a date in US format `>02/28/2017`, also when dealing with UTC you have to take the time difference in consideration.
|
|
44
|
-
|
|
45
|
-
### How to use Input Filter
|
|
46
|
-
Simply set the flag `filterable` to True and and enable the filters in the Grid Options. Here is an example with a full column definition:
|
|
47
|
-
```ts
|
|
48
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
49
|
-
this.columnDefinitions = [
|
|
50
|
-
{ id: 'title', name: 'Title', field: 'title' },
|
|
51
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true }
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
// you also need to enable the filters in the Grid Options
|
|
55
|
-
this.gridOptions = {
|
|
56
|
-
enableFiltering: true
|
|
57
|
-
};
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Filtering with Localization (i18n)
|
|
61
|
-
When using a regular grid with a JSON dataset (that is without using Backend Service API), the filter might not working correctly on cell values that are translated (because it will try to filter against the translation key instead of the actual formatted value). So to bypass this problem, a new extra `params` was created to resolve this, you need to set `useFormatterOuputToFilter` to True and the filter will, has the name suggest, use the output of the Formatter to filter against. Example:
|
|
62
|
-
```ts
|
|
63
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
64
|
-
this.columnDefinitions = [
|
|
65
|
-
{ id: 'title', name: 'Title', field: 'id',
|
|
66
|
-
headerKey: 'TITLE',
|
|
67
|
-
formatter: this.taskTranslateFormatter, // <-- this could be a custom Formatter or the built-in translateFormatter
|
|
68
|
-
filterable: true,
|
|
69
|
-
params: { useFormatterOuputToFilter: true } // <-- set this flag to True
|
|
70
|
-
},
|
|
71
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true }
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
// you also need to enable the filters in the Grid Options
|
|
75
|
-
this.gridOptions = {
|
|
76
|
-
enableFiltering: true
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// using a custom translate Formatter OR translateFormatter
|
|
80
|
-
taskTranslateFormatter: Formatter = (row, cell, value, columnDef, dataContext) => {
|
|
81
|
-
return this.i18n.tr('TASK_X', { x: value });
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### How to Filter Complex Objects?
|
|
86
|
-
You can filter complex objects using the dot (.) notation inside the `field` property defined in your Columns Definition.
|
|
87
|
-
|
|
88
|
-
For example, let say that we have this dataset
|
|
89
|
-
```ts
|
|
90
|
-
const dataset = [
|
|
91
|
-
{ item: 'HP Desktop', buyer: { id: 1234, address: { street: '123 belleville', zip: 123456 }},
|
|
92
|
-
{ item: 'Lenovo Mouse', buyer: { id: 456, address: { street: '456 hollywood blvd', zip: 789123 }}
|
|
93
|
-
];
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
We can now filter the zip code from the buyer's address using this filter:
|
|
97
|
-
```ts
|
|
98
|
-
this.columnDefinitions = [
|
|
99
|
-
{
|
|
100
|
-
// the zip is a property of a complex object which is under the "buyer" property
|
|
101
|
-
// it will use the "field" property to explode (from "." notation) and find the child value
|
|
102
|
-
id: 'zip', name: 'ZIP', field: 'buyer.address.zip', filterable: true
|
|
103
|
-
// id: 'street', ...
|
|
104
|
-
];
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### Update Filters Dynamically
|
|
108
|
-
You can update/change the Filters dynamically (on the fly) via the `updateFilters` method from the `FilterService`. Note that calling this method will override all filters and replace them with the new array of filters provided. For example, you could update the filters from a button click or a select dropdown list with predefined filter set.
|
|
109
|
-
|
|
110
|
-
##### View
|
|
111
|
-
```html
|
|
112
|
-
<button class="btn btn-default btn-sm" data-test="set-dynamic-filter" click.delegate="setFiltersDynamically()">
|
|
113
|
-
Set Filters Dynamically
|
|
114
|
-
</button>
|
|
115
|
-
|
|
116
|
-
<angular-slickgrid gridId="grid1"
|
|
117
|
-
[columns]="columnDefinitions"
|
|
118
|
-
[options]="gridOptions"
|
|
119
|
-
[dataset]="dataset"
|
|
120
|
-
(onAngularGridCreated)="angularGridReady($event.detail)">
|
|
121
|
-
</angular-slickgrid>
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
##### Component
|
|
125
|
-
```ts
|
|
126
|
-
export class Example {
|
|
127
|
-
angularGrid: AngularGridInstance;
|
|
128
|
-
|
|
129
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
130
|
-
this.angularGrid = angularGrid;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
setFiltersDynamically() {
|
|
134
|
-
// we can Set Filters Dynamically (or different filters) afterward through the FilterService
|
|
135
|
-
this.angularGrid.filterService.updateFilters([
|
|
136
|
-
{ columnId: 'duration', searchTerms: [2, 25, 48, 50] },
|
|
137
|
-
{ columnId: 'complete', searchTerms: [95], operator: '<' },
|
|
138
|
-
{ columnId: 'effort-driven', searchTerms: [true] },
|
|
139
|
-
{ columnId: 'start', operator: '>=', searchTerms: ['2001-02-28'] },
|
|
140
|
-
]);
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
#### Extra Arguments
|
|
145
|
-
The `updateFilters` method has 2 extra arguments:
|
|
146
|
-
- 2nd argument, defaults to true, is to emit a filter changed event (the GridStateService uses this event)
|
|
147
|
-
- optional and defaults to true `updateFilters([], true)`
|
|
148
|
-
- 3rd argument is to trigger a backend query (when using a Backend Service like OData/GraphQL), this could be useful when using updateFilters & updateSorting and you wish to only send the backend query once.
|
|
149
|
-
- optional and defaults to true `updateFilters([], true, true)`
|
|
150
|
-
|
|
151
|
-
### Query Different Field
|
|
152
|
-
Sometime you want to display a certain column (let say `countryName`) but you want to filter from a different column (say `countryCode`), in such use case you can use 1 of these 4 optional
|
|
153
|
-
- `queryField`: this will affect both the Filter & Sort
|
|
154
|
-
- `queryFieldFilter`: this will affect only the Filter
|
|
155
|
-
- `queryFieldSorter`: this will affect only the Sort
|
|
156
|
-
- `queryFieldNameGetterFn`: dynamically change column to do Filter/Sort (see below)
|
|
157
|
-
|
|
158
|
-
### Dynamic Query Field
|
|
159
|
-
What if you a field that you only know which field to query only at run time and depending on the item object (`dataContext`)?
|
|
160
|
-
We can defined a `queryFieldNameGetterFn` callback that will be executed on each row when Filtering and/or Sorting.
|
|
161
|
-
```ts
|
|
162
|
-
queryFieldNameGetterFn: (dataContext) => {
|
|
163
|
-
// do your logic and return the field name will be queried
|
|
164
|
-
// for example let say that we query "profitRatio" when we have a profit else we query "lossRatio"
|
|
165
|
-
return dataContext.profit > 0 ? 'profitRatio' : 'lossRatio';
|
|
166
|
-
},
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Debounce/Throttle Text Search (wait for user to stop typing before filtering)
|
|
170
|
-
When having a large dataset, it might be useful to add a debounce delay so that typing multiple character successively won't affect the search time, you can use the `filterTypingDebounce` grid option for that use case. What it will do is simply wait for the user to finish typing before executing the filter condition, you typically don't want to put this number too high and I find that between 250-500 is a good number.
|
|
171
|
-
```ts
|
|
172
|
-
this.gridOptions = {
|
|
173
|
-
filterTypingDebounce: 250,
|
|
174
|
-
};
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Ignore Locale Accent in Text Filter/Sorting
|
|
178
|
-
You can ignore latin accent (or any other language accent) in text filter via the Grid Option `ignoreAccentOnStringFilterAndSort` flag (default is false)
|
|
179
|
-
```ts
|
|
180
|
-
this.gridOptions = {
|
|
181
|
-
ignoreAccentOnStringFilterAndSort: true,
|
|
182
|
-
};
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Custom Filter Predicate
|
|
186
|
-
You can provide a custom predicate by using the `filterPredicate` when defining your `filter`, the callback will provide you with 2 arguments (`dataContext` and `searchFilterArgs`). The `searchFilterArgs` has a type of `SearchColumnFilter` interface which will provide you more info about the filter itself (like parsed operator, search terms, column definition, column id and type as well). You can see a live demo at [Example 14](https://ghiscoding.github.io/slickgrid-universal/#/example14) and the associated [lines](https://github.com/ghiscoding/slickgrid-universal/blob/1a2c2ff4b72ac3f51b30b1d3d101e84ed9ec9ece/examples/vite-demo-vanilla-bundle/src/examples/example14.ts#L153-L178) of code.
|
|
187
|
-
|
|
188
|
-
```ts
|
|
189
|
-
this.columnDefinitions = [
|
|
190
|
-
{
|
|
191
|
-
id: 'title', name: 'Title', field: 'title', sortable: true,
|
|
192
|
-
filterable: true,
|
|
193
|
-
filter: {
|
|
194
|
-
model: Filters.inputText,
|
|
195
|
-
// you can use your own custom filter predicate when built-in filters aren't working for you
|
|
196
|
-
// for example the example below will function similarly to an SQL LIKE to answer this SO: https://stackoverflow.com/questions/78471412/angular-slickgrid-filter
|
|
197
|
-
filterPredicate: (dataContext, searchFilterArgs) => {
|
|
198
|
-
const searchVals = (searchFilterArgs.searchTerms || []) as SearchTerm[];
|
|
199
|
-
if (searchVals?.length) {
|
|
200
|
-
const columnId = searchFilterArgs.columnId;
|
|
201
|
-
const searchVal = searchVals[0] as string;
|
|
202
|
-
const likeMatches = searchVal.split('%');
|
|
203
|
-
if (likeMatches.length > 3) {
|
|
204
|
-
// for matches like "%Ta%10%" will return text that starts with "Ta" and ends with "10" (e.g. "Task 10", "Task 110", "Task 210")
|
|
205
|
-
const [_, start, end] = likeMatches;
|
|
206
|
-
return dataContext[columnId].startsWith(start) && dataContext[columnId].endsWith(end);
|
|
207
|
-
} else if (likeMatches.length > 2) {
|
|
208
|
-
// for matches like "%Ta%10" will return text that starts with "Ta" and contains "10" (e.g. "Task 10", "Task 100", "Task 101")
|
|
209
|
-
const [_, start, contain] = likeMatches;
|
|
210
|
-
return dataContext[columnId].startsWith(start) && dataContext[columnId].includes(contain);
|
|
211
|
-
}
|
|
212
|
-
// for anything else we'll simply expect a Contains
|
|
213
|
-
return dataContext[columnId].includes(searchVal);
|
|
214
|
-
}
|
|
215
|
-
// if we fall here then the value is not filtered out
|
|
216
|
-
return true;
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
];
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
The custom filter predicate above was to answer a Stack Overflow question and will work similarly to an SQL LIKE matcher (it's not perfect and probably requires more work but is enough to demo the usage of a custom filter predicate)
|
|
224
|
-
|
|
225
|
-

|
|
226
|
-
|
|
227
|
-
### Filter Shortcuts
|
|
228
|
-
|
|
229
|
-
User can declare some Filter Shortcuts, that will be added to the Header Menu of the Column it was assigned. These shortcuts are simply a list of filter search values (e.g. Filter the Blank/Non-Blanks Values), the end user can type the same search values themselves but the shortcuts are simply meant to be quicker without having to know what to type (e.g. Filter Current Year).
|
|
230
|
-
|
|
231
|
-
The shortcuts can be declared via an array that must include at least a `title` (or `titleKey`) a `searchTerms` array and lastly an optional `operator` can also be provided. The available properties of these shortcut is a merge of Header Menu Item interface (except `command` and `action` which are reserved and assigned internally) and of course the 3 properties mentioned above. The declaration is very similar to how we use it when declaring Grid Presets as shown below
|
|
232
|
-
|
|
233
|
-
```ts
|
|
234
|
-
this.columnDefinitions = [
|
|
235
|
-
{
|
|
236
|
-
id: 'country', name: 'Country', field: 'country',
|
|
237
|
-
filter: {
|
|
238
|
-
model: Filters.inputText,
|
|
239
|
-
filterShortcuts: [
|
|
240
|
-
{ title: 'Blank Values', searchTerms: ['A'], operator: '<', iconCssClass: 'mdi mdi-filter-minus-outline', },
|
|
241
|
-
{ title: 'Non-Blank Values', searchTerms: ['A'], operator: '>', iconCssClass: 'mdi mdi-filter-plus-outline', },
|
|
242
|
-
]
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
id: 'finish', name: 'Finish', field: 'finish',
|
|
247
|
-
filter: {
|
|
248
|
-
model: Filters.dateRange,
|
|
249
|
-
filterShortcuts: [
|
|
250
|
-
{
|
|
251
|
-
// using Locale translations & Tempo to calculate next 30 days
|
|
252
|
-
titleKey: 'NEXT_30_DAYS',
|
|
253
|
-
iconCssClass: 'mdi mdi-calendar',
|
|
254
|
-
searchTerms: [tempoFormat(new Date(), 'YYYY-MM-DD'), tempoFormat(addDay(new Date(), 30), 'YYYY-MM-DD')],
|
|
255
|
-
},
|
|
256
|
-
]
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
];
|
|
260
|
-
```
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
#### Index
|
|
2
|
-
- [Using an Inclusive Range](#using-an-inclusive-range-default-is-exclusive)
|
|
3
|
-
- [Using 2 dots (..) notation](#using-2-dots--notation)
|
|
4
|
-
- [Using a Slider Range](#using-a-slider-range-filter)
|
|
5
|
-
- [Filter Options](#filter-options)
|
|
6
|
-
- [Using a Date Range](#using-a-date-range-filter)
|
|
7
|
-
- [Update Filters Dynamically](input-filter.md#update-filters-dynamically)
|
|
8
|
-
- [Custom Filter Predicate](input-filter.md#custom-filter-predicate)
|
|
9
|
-
- [Filter Shortcuts](input-filter.md#filter-shortcuts)
|
|
10
|
-
|
|
11
|
-
### Introduction
|
|
12
|
-
Range filters allows you to search for a value between 2 min/max values, the 2 most common use case would be to filter between 2 numbers or dates, you can do that with the Slider & Date Range Filters. The range can also be defined as inclusive (`>= 0 and <= 10`) or exclusive (`> 0 and < 10`), the default is exclusive but you can change that, see below for more info.
|
|
13
|
-
|
|
14
|
-
### Using an Inclusive Range (default is Exclusive)
|
|
15
|
-
By default all the range filters are with exclusive range, which mean between value `x` and `y` but without including them. If you wish to include the `x` and `y` values, you can change that through the `operator` property.
|
|
16
|
-
|
|
17
|
-
For example
|
|
18
|
-
```ts
|
|
19
|
-
// your columns definition
|
|
20
|
-
this.columnDefinitions = [
|
|
21
|
-
{
|
|
22
|
-
id: 'duration', field: 'duration', name: 'Duration',
|
|
23
|
-
filterable: true,
|
|
24
|
-
filter: {
|
|
25
|
-
model: Filters.input,
|
|
26
|
-
operator: OperatorType.rangeInclusive // defaults to exclusive
|
|
27
|
-
|
|
28
|
-
// or use the string (case sensitive)
|
|
29
|
-
operator: 'RangeInclusive', // defaults to exclusive
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Using 2 dots (..) notation
|
|
36
|
-
You can use a regular input filter with the 2 dots (..) notation to represent a range, for example `5..90` would search between the value 5 and 90 (exclusive search unless specified).
|
|
37
|
-
|
|
38
|
-
##### Component
|
|
39
|
-
```ts
|
|
40
|
-
import { Filters, Formatters, GridOption, OperatorType } from '@slickgrid-universal/common';
|
|
41
|
-
|
|
42
|
-
export class GridBasicComponent {
|
|
43
|
-
columnDefinitions: Column[];
|
|
44
|
-
gridOptions: GridOption;
|
|
45
|
-
dataset: any[];
|
|
46
|
-
|
|
47
|
-
attached(): void {
|
|
48
|
-
// your columns definition
|
|
49
|
-
this.columnDefinitions = [
|
|
50
|
-
{
|
|
51
|
-
id: 'duration', field: 'duration', name: 'Duration',
|
|
52
|
-
type: 'number', // you can optionally specify that the data are numbers
|
|
53
|
-
filterable: true,
|
|
54
|
-
|
|
55
|
-
// input filter is the default, so you can skip this unless you want to specify the `operator`
|
|
56
|
-
filter: {
|
|
57
|
-
model: 'input',
|
|
58
|
-
operator: OperatorType.rangeInclusive // defaults to exclusive
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
this.gridOptions = {
|
|
64
|
-
// your grid options config
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Using a Slider Range Filter
|
|
71
|
-
The slider range filter is very useful if you can just want to use the mouse to drag/slide a cursor, you can also optionally show/hide the slider values on screen (hiding them would giving you more room without but without the precision).
|
|
72
|
-
|
|
73
|
-
##### Component
|
|
74
|
-
```ts
|
|
75
|
-
import { Filters, Formatters, GridOption, SliderRangeOption, OperatorType } from '@slickgrid-universal/commomn';
|
|
76
|
-
|
|
77
|
-
export class GridBasicComponent {
|
|
78
|
-
columnDefinitions: Column[];
|
|
79
|
-
gridOptions: GridOption;
|
|
80
|
-
dataset: any[];
|
|
81
|
-
|
|
82
|
-
attached(): void {
|
|
83
|
-
// your columns definition
|
|
84
|
-
this.columnDefinitions = [
|
|
85
|
-
{
|
|
86
|
-
id: 'complete', name: '% Complete', field: 'percentComplete', headerKey: 'PERCENT_COMPLETE', minWidth: 120,
|
|
87
|
-
sortable: true,
|
|
88
|
-
formatter: Formatters.progressBar,
|
|
89
|
-
type: 'number',
|
|
90
|
-
filterable: true,
|
|
91
|
-
filter: {
|
|
92
|
-
model: Filters.sliderRange,
|
|
93
|
-
maxValue: 100, // or you can use the options as well
|
|
94
|
-
operator: OperatorType.rangeInclusive, // optional, defaults to exclusive
|
|
95
|
-
params: { hideSliderNumbers: false }, // you can hide/show the slider numbers on both side
|
|
96
|
-
|
|
97
|
-
// you can also optionally pass any option of the Slider filter
|
|
98
|
-
// previously known as `filterOptions` for < 9.0
|
|
99
|
-
options: { sliderStartValue: 5 } as SliderRangeOption
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
];
|
|
103
|
-
|
|
104
|
-
this.gridOptions = {
|
|
105
|
-
// your grid options config
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
##### Filter Options
|
|
112
|
-
All the available options that can be provided as filter `options` to your column definitions and you should try to cast your filter `options` to the specific interface as much as possible to make sure that you use only valid options of allowed by the targeted filter
|
|
113
|
-
|
|
114
|
-
```ts
|
|
115
|
-
filter: {
|
|
116
|
-
model: Filters.sliderRange,
|
|
117
|
-
// previously known as `filterOptions` for < 9.0
|
|
118
|
-
options: {
|
|
119
|
-
sliderStartValue: 5
|
|
120
|
-
} as SliderOption
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
#### Grid Option `defaultFilterOptions
|
|
125
|
-
You could also define certain options as a global level (for the entire grid or even all grids) by taking advantage of the `defaultFilterOptions` Grid Option. Note that they are set via the filter type as a key name (`autocompleter`, `date`, ...) and then the content is the same as filter `options` (also note that each key is already typed with the correct filter option interface), for example
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
this.gridOptions = {
|
|
129
|
-
defaultFilterOptions: {
|
|
130
|
-
// Note: that `date`, `select` and `slider` are combining both compound & range filters together
|
|
131
|
-
date: { displayDateMin: 'today' },
|
|
132
|
-
select: { minHeight: 350 }, // typed as MultipleSelectOption
|
|
133
|
-
slider: { sliderStartValue: 10 }
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Using a Date Range Filter
|
|
139
|
-
The date range filter allows you to search data between 2 dates, it uses the [Vanilla-Calendar Range](https://vanilla-calendar.pro/) feature.
|
|
140
|
-
|
|
141
|
-
> **Note** we use [Tempo](https://tempo.formkit.com/) to parse and format Dates to the chosen format via the `type` option when provided in your column definition.
|
|
142
|
-
|
|
143
|
-
##### Component
|
|
144
|
-
import { Filters, Formatters, GridOption, OperatorType, VanillaCalendarOption } from '@slickgrid-universal/common';
|
|
145
|
-
|
|
146
|
-
```typescript
|
|
147
|
-
export class GridBasicComponent {
|
|
148
|
-
columnDefinitions: Column[];
|
|
149
|
-
gridOptions: GridOption;
|
|
150
|
-
dataset: any[];
|
|
151
|
-
|
|
152
|
-
attached(): void {
|
|
153
|
-
// your columns definition
|
|
154
|
-
this.columnDefinitions = [
|
|
155
|
-
{
|
|
156
|
-
id: 'finish', name: 'Finish', field: 'finish', headerKey: 'FINISH',
|
|
157
|
-
minWidth: 75, width: 120, exportWithFormatter: true,
|
|
158
|
-
formatter: Formatters.dateIso, sortable: true,
|
|
159
|
-
type: 'date',
|
|
160
|
-
filterable: true,
|
|
161
|
-
filter: {
|
|
162
|
-
model: Filters.dateRange,
|
|
163
|
-
|
|
164
|
-
// override any of the Vanilla-Calendar options through "options"
|
|
165
|
-
// previously known as `filterOptions` for < 9.0
|
|
166
|
-
options: { displayDateMin: 'today' } as VanillaCalendarOption
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
];
|
|
170
|
-
|
|
171
|
-
this.gridOptions = {
|
|
172
|
-
// your grid options config
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
#### Filter Options (`VanillaCalendarOption` interface)
|
|
179
|
-
All the available options that can be provided as filter `options` to your column definitions can be found under this [VanillaCalendarOption interface](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/vanillaCalendarOption.interface.ts) and you should cast your filter `options` with the expected interface to make sure that you use only valid settings of the [Vanilla-Calendar](https://vanilla-calendar.pro/docs/reference/additionally/settings) library.
|
|
180
|
-
|
|
181
|
-
```ts
|
|
182
|
-
filter: {
|
|
183
|
-
model: Filters.compoundDate,
|
|
184
|
-
options: {
|
|
185
|
-
displayDateMin: 'today'
|
|
186
|
-
} as VanillaCalendarOption
|
|
187
|
-
}
|
|
188
|
-
```
|