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,466 +0,0 @@
|
|
|
1
|
-
#### Index
|
|
2
|
-
- [Using fixed `collection` or `collectionAsync`](#using-collection-or-collectionasync)
|
|
3
|
-
- [Editor Options (`AutocompleterOption` interface)](#editor-options-autocompleteroption-interface)
|
|
4
|
-
- [Using Remote API](#using-external-remote-api)
|
|
5
|
-
- [Basic Usage](#remote-api-basic)
|
|
6
|
-
- [Basic Usage with Object Result (**preferred way**)](#remote-api-basic-with-object-result)
|
|
7
|
-
- [with `renderItem` + custom Layout (`twoRows` or `fourCorners`)](#remote-api-renderitem-callback--custom-layout-tworows-or-fourcorners)
|
|
8
|
-
- [Custom Styling - SASS variables](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/styles/_variables.scss#L141)
|
|
9
|
-
- [Force User Input](#autocomplete---force-user-input)
|
|
10
|
-
- [How to change drop container dimensions?](#how-to-change-drop-container-dimensions)
|
|
11
|
-
- [Animated Gif Demo](#animated-gif-demo)
|
|
12
|
-
- See the [Editors - Wiki](../Editors.md) for more general info about Editors (validators, event handlers, ...)
|
|
13
|
-
|
|
14
|
-
### Demo
|
|
15
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/editor) | [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-editor.component.ts)
|
|
16
|
-
|
|
17
|
-
### Introduction
|
|
18
|
-
AutoComplete is a functionality that let the user start typing characters and the autocomplete will try to give suggestions according to the characters entered. The collection can be a fixed JSON files (collection of strings or objects) or can also be an external remote resource to an external API. For a demo of what that could look like, take a look at the [animated gif demo](#animated-gif-demo) below.
|
|
19
|
-
|
|
20
|
-
We use an external lib named [Autocomplete](https://github.com/kraaden/autocomplete) (aka `autocompleter` on npm) by Kraaden.
|
|
21
|
-
|
|
22
|
-
## Using `collection` or `collectionAsync`
|
|
23
|
-
If you want to pass the entire list to the AutoComplete (like a JSON file or a Web API call), you can do so using the `collection` or the `collectionAsync` (the latter will load it asynchronously). You can also see that the Editor and Filter have almost the exact same configuration (apart from the `model` that is obviously different).
|
|
24
|
-
|
|
25
|
-
##### Component
|
|
26
|
-
```typescript
|
|
27
|
-
export class GridBasicComponent {
|
|
28
|
-
columnDefinitions: Column[];
|
|
29
|
-
gridOptions: GridOption;
|
|
30
|
-
dataset: any[];
|
|
31
|
-
|
|
32
|
-
defineGrid(): void {
|
|
33
|
-
// your columns definition
|
|
34
|
-
this.columnDefinitions = [
|
|
35
|
-
{
|
|
36
|
-
id: 'countryOfOrigin', name: 'Country of Origin', field: 'countryOfOrigin',
|
|
37
|
-
formatter: Formatters.complexObject,
|
|
38
|
-
dataKey: 'code', // our list of objects has the structure { code: 'CA', name: 'Canada' }, since we want to use the code`, we will set the dataKey to "code"
|
|
39
|
-
labelKey: 'name', // while the displayed value is "name"
|
|
40
|
-
type: 'object',
|
|
41
|
-
sorter: Sorters.objectString, // since we have set dataKey to "code" our output type will be a string, and so we can use this objectString, this sorter always requires the dataKey
|
|
42
|
-
filterable: true,
|
|
43
|
-
sortable: true,
|
|
44
|
-
minWidth: 100,
|
|
45
|
-
editor: {
|
|
46
|
-
model: Editors.autocompleter,
|
|
47
|
-
customStructure: { label: 'name', value: 'code' },
|
|
48
|
-
collectionAsync: this.http.get('assets/data/countries.json'), // this demo will load the JSON file asynchronously
|
|
49
|
-
},
|
|
50
|
-
filter: {
|
|
51
|
-
model: Filters.autocompleter,
|
|
52
|
-
customStructure: { label: 'name', value: 'code' },
|
|
53
|
-
collectionAsync: this.http.get('assets/data/countries.json'),
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
this.gridOptions = {
|
|
59
|
-
// your grid options config
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Collection Label Render HTML
|
|
66
|
-
By default HTML is not rendered and the `label` will simply show HTML as text. But in some cases you might want to render it, you can do so by enabling the `enableRenderHtml` flag.
|
|
67
|
-
|
|
68
|
-
**NOTE:** this is currently only used by the Editors that have a `collection` which are the `MultipleSelect` & `SingleSelect` Editors.
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
this.columnDefinitions = [
|
|
72
|
-
{
|
|
73
|
-
id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
|
|
74
|
-
formatter: Formatters.checkmarkMaterial,
|
|
75
|
-
type: 'boolean',
|
|
76
|
-
editor: {
|
|
77
|
-
model: Editors.autocompleter,
|
|
78
|
-
placeholder: '🔍 search city',
|
|
79
|
-
|
|
80
|
-
// example with a fixed Collection (or collectionAsync)
|
|
81
|
-
// previously known as `editorOptions` for < 9.0
|
|
82
|
-
options: {
|
|
83
|
-
showOnFocus: true, // display the list on focus of the autocomplete (without the need to type anything)
|
|
84
|
-
} as AutocompleterOption,
|
|
85
|
-
enableRenderHtml: true, // this flag only works with a fixed Collection
|
|
86
|
-
// collectionAsync: this.http.get(URL_COUNTRIES_COLLECTION),
|
|
87
|
-
collection: [
|
|
88
|
-
{ value: '', label: '' },
|
|
89
|
-
{ value: true, label: 'True', labelPrefix: `<i class="mdi mdi-plus"></i> ` },
|
|
90
|
-
{ value: false, label: 'False', labelPrefix: `<i class="mdi mdi-minus"></i> ` }
|
|
91
|
-
],
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
];
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Editor Options (`AutocompleterOption` interface)
|
|
98
|
-
All the available options that can be provided as editor `options` to your column definitions can be found under this [AutocompleterOption interface](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/autocompleterOption.interface.ts) and you should cast your editor `options` to that interface to make sure that you use only valid options of the autocomplete library.
|
|
99
|
-
|
|
100
|
-
```ts
|
|
101
|
-
editor: {
|
|
102
|
-
model: Editors.autocompleter,
|
|
103
|
-
// previously known as `editorOptions` for < 9.0
|
|
104
|
-
options: {
|
|
105
|
-
minLength: 3,
|
|
106
|
-
} as AutocompleterOption
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
#### Grid Option `defaultEditorOptions
|
|
111
|
-
You could also define certain options as a global level (for the entire grid or even all grids) by taking advantage of the `defaultEditorOptions` Grid Option. Note that they are set via the editor type as a key name (`autocompleter`, `date`, ...) and then the content is the same as editor `options` (also note that each key is already typed with the correct editor option interface), for example
|
|
112
|
-
|
|
113
|
-
```ts
|
|
114
|
-
this.gridOptions = {
|
|
115
|
-
defaultEditorOptions: {
|
|
116
|
-
autocompleter: { debounceWaitMs: 150 }, // typed as AutocompleterOption
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Using External Remote API
|
|
122
|
-
You could also use external 3rd party Web API (can be JSONP query or regular JSON). This will make a much shorter result since it will only return a small subset of what will be displayed in the AutoComplete Editor or Filter. For example, we could use GeoBytes which provide a JSONP Query API for the cities of the world, you can imagine the entire list of cities would be way too big to download locally, so this is why we use such API.
|
|
123
|
-
|
|
124
|
-
### Remote API (basic)
|
|
125
|
-
The basic functionality will use built-in 3rd party lib styling that is to display a label/value pair item result.
|
|
126
|
-
|
|
127
|
-
##### Component
|
|
128
|
-
```typescript
|
|
129
|
-
export class GridBasicComponent {
|
|
130
|
-
columnDefinitions: Column[];
|
|
131
|
-
gridOptions: GridOption;
|
|
132
|
-
dataset: any[];
|
|
133
|
-
|
|
134
|
-
defineGrid() {
|
|
135
|
-
// your columns definition
|
|
136
|
-
this.columnDefinitions = [
|
|
137
|
-
{
|
|
138
|
-
id: 'product', name: 'Product', field: 'product',
|
|
139
|
-
filterable: true,
|
|
140
|
-
minWidth: 100,
|
|
141
|
-
editor: {
|
|
142
|
-
model: Editors.autocompleter,
|
|
143
|
-
alwaysSaveOnEnterKey: true,
|
|
144
|
-
// previously known as `editorOptions` for < 9.0
|
|
145
|
-
options: {
|
|
146
|
-
showOnFocus: true,
|
|
147
|
-
minLength: 1,
|
|
148
|
-
fetch: (searchText, updateCallback) => {
|
|
149
|
-
// assuming your API call returns a label/value pair
|
|
150
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
151
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
152
|
-
.catch(error => console.log('Error:', error));
|
|
153
|
-
},
|
|
154
|
-
}
|
|
155
|
-
} as AutocompleterOption,
|
|
156
|
-
},
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
this.gridOptions = {
|
|
160
|
-
// your grid options config
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Remote API (basic with object result)
|
|
167
|
-
This is the preferred way of dealing with the AutoComplete, the main reason is because the AutoComplete uses an `<input/>` and that means we can only keep 1 value and if we do then we lose the text label and so using an Object Result makes more sense. Note however that you'll need a bit more code that is because we'll use the `'object'` and so we need to provide a custom `SortComparer` and also a custom `Formatters` and for them to work we also need to provide a `dataKey` (the value) and a `labelKey` (text label) as shown below.
|
|
168
|
-
```ts
|
|
169
|
-
this.columnDefinitions = [
|
|
170
|
-
{
|
|
171
|
-
id: 'product', name: 'Product', field: 'product',
|
|
172
|
-
dataKey: 'id',
|
|
173
|
-
labelKey: 'name', // (id/name) pair to override default (value/label) pair
|
|
174
|
-
editor: {
|
|
175
|
-
model: Editors.autocompleter,
|
|
176
|
-
alwaysSaveOnEnterKey: true,
|
|
177
|
-
type: 'object',
|
|
178
|
-
sortComparer: SortComparers.objectString,
|
|
179
|
-
options: {
|
|
180
|
-
showOnFocus: true,
|
|
181
|
-
minLength: 1,
|
|
182
|
-
fetch: (searchText, updateCallback) => {
|
|
183
|
-
// assuming your API call returns a label/value pair
|
|
184
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
185
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
186
|
-
.catch(error => console.log('Error:', error));
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
} as AutocompleterOption,
|
|
190
|
-
}
|
|
191
|
-
];
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Remote API with `renderItem` + custom layout (`twoRows` or `fourCorners`)
|
|
195
|
-
#### See animated gif ([twoRows](#with-tworows-custom-layout-without-optional-left-icon) or [fourCorners](#with-fourcorners-custom-layout-with-extra-optional-left-icon))
|
|
196
|
-
The lib comes with 2 built-in custom layouts, these 2 layouts also have SASS variables if anyone wants to style it differently. When using the `renderItem`, it will require the user to provide a `layout` (2 possible options `twoRows` or `fourCorners`) and also a `templateCallback` that will be executed when rendering the AutoComplete Search List Item. For example:
|
|
197
|
-
|
|
198
|
-
##### Component
|
|
199
|
-
```typescript
|
|
200
|
-
export class GridBasicComponent {
|
|
201
|
-
columnDefinitions: Column[];
|
|
202
|
-
gridOptions: GridOption;
|
|
203
|
-
dataset: any[];
|
|
204
|
-
|
|
205
|
-
defineGrid() {
|
|
206
|
-
// your columns definition
|
|
207
|
-
this.columnDefinitions = [
|
|
208
|
-
{
|
|
209
|
-
id: 'product', name: 'Product', field: 'product',
|
|
210
|
-
filterable: true,
|
|
211
|
-
minWidth: 100,
|
|
212
|
-
editor: {
|
|
213
|
-
model: Editors.autocompleter,
|
|
214
|
-
alwaysSaveOnEnterKey: true,
|
|
215
|
-
customStructure: {
|
|
216
|
-
label: 'itemName',
|
|
217
|
-
value: 'id'
|
|
218
|
-
},
|
|
219
|
-
// previously known as `editorOptions` for < 9.0
|
|
220
|
-
options: {
|
|
221
|
-
showOnFocus: true,
|
|
222
|
-
minLength: 1,
|
|
223
|
-
fetch: (searchText, updateCallback) => {
|
|
224
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
225
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
226
|
-
.catch(error => console.log('Error:', error));
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
renderItem: {
|
|
230
|
-
layout: 'twoRows',
|
|
231
|
-
templateCallback: (item: any) => `<div class="autocomplete-container-list">
|
|
232
|
-
<div class="autocomplete-left">
|
|
233
|
-
<span class="mdi ${item.icon} mdi-26px"></span>
|
|
234
|
-
</div>
|
|
235
|
-
<div>
|
|
236
|
-
<span class="autocomplete-top-left">
|
|
237
|
-
<span class="mdi ${item.itemTypeName === 'I' ? 'mdi-information-outline' : 'mdi-content-copy'} mdi-14px"></span>
|
|
238
|
-
${item.itemName}
|
|
239
|
-
</span>
|
|
240
|
-
<div>
|
|
241
|
-
</div>
|
|
242
|
-
<div>
|
|
243
|
-
<div class="autocomplete-bottom-left">${item.itemNameTranslated}</div>
|
|
244
|
-
</div>`,
|
|
245
|
-
},
|
|
246
|
-
} as AutocompleterOption,
|
|
247
|
-
},
|
|
248
|
-
];
|
|
249
|
-
|
|
250
|
-
this.gridOptions = {
|
|
251
|
-
// your grid options config
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### Remote API `renderItem` callback + custom layout (`twoRows` or `fourCorners`)
|
|
258
|
-
#### See animated gif ([twoRows](#with-tworows-custom-layout-without-optional-left-icon) or [fourCorners](#with-fourcorners-custom-layout-with-extra-optional-left-icon))
|
|
259
|
-
The previous example can also be written using the `renderItem` callback and adding `classes`, this is actually what Slickgrid-Universal does internally, you can do it yourself if you wish to have more control on the render callback result.
|
|
260
|
-
|
|
261
|
-
##### Component
|
|
262
|
-
```typescript
|
|
263
|
-
export class GridBasicComponent {
|
|
264
|
-
columnDefinitions: Column[];
|
|
265
|
-
gridOptions: GridOption;
|
|
266
|
-
dataset: any[];
|
|
267
|
-
|
|
268
|
-
defineGrid() {
|
|
269
|
-
// your columns definition
|
|
270
|
-
this.columnDefinitions = [
|
|
271
|
-
{
|
|
272
|
-
id: 'product', name: 'Product', field: 'product',
|
|
273
|
-
filterable: true,
|
|
274
|
-
minWidth: 100,
|
|
275
|
-
editor: {
|
|
276
|
-
model: Editors.autocompleter,
|
|
277
|
-
alwaysSaveOnEnterKey: true,
|
|
278
|
-
customStructure: {
|
|
279
|
-
label: 'itemName',
|
|
280
|
-
value: 'id'
|
|
281
|
-
},
|
|
282
|
-
// previously known as `editorOptions` for < 9.0
|
|
283
|
-
options: {
|
|
284
|
-
showOnFocus: true,
|
|
285
|
-
minLength: 1,
|
|
286
|
-
classes: {
|
|
287
|
-
// choose a custom style layout
|
|
288
|
-
// 'ui-autocomplete': 'autocomplete-custom-two-rows',
|
|
289
|
-
'ui-autocomplete': 'autocomplete-custom-four-corners',
|
|
290
|
-
},
|
|
291
|
-
fetch: (searchText, updateCallback) => {
|
|
292
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
293
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
294
|
-
.catch(error => console.log('Error:', error);
|
|
295
|
-
},
|
|
296
|
-
renderItem: {
|
|
297
|
-
layout: 'twoRows',
|
|
298
|
-
templateCallback: (item: any) => `<div class="autocomplete-container-list">
|
|
299
|
-
<div class="autocomplete-left">
|
|
300
|
-
<span class="mdi ${item.icon} mdi-26px"></span>
|
|
301
|
-
</div>
|
|
302
|
-
<div>
|
|
303
|
-
<span class="autocomplete-top-left">
|
|
304
|
-
<span class="mdi ${item.itemTypeName === 'I' ? 'mdi-information-outline' : 'mdi-content-copy'} mdi-14px"></span>
|
|
305
|
-
${item.itemName}
|
|
306
|
-
</span>
|
|
307
|
-
<div>
|
|
308
|
-
</div>
|
|
309
|
-
<div>
|
|
310
|
-
<div class="autocomplete-bottom-left">${item.itemNameTranslated}</div>
|
|
311
|
-
</div>`,
|
|
312
|
-
},
|
|
313
|
-
} as AutocompleterOption,
|
|
314
|
-
callbacks: {
|
|
315
|
-
// callback on the AutoComplete on the instance
|
|
316
|
-
renderItem: {
|
|
317
|
-
templateCallback: (item: any) => {
|
|
318
|
-
return `<div class="autocomplete-container-list">
|
|
319
|
-
<div class="autocomplete-left">
|
|
320
|
-
<!--<img src="http://i.stack.imgur.com/pC1Tv.jpg" width="50" />-->
|
|
321
|
-
<span class="mdi ${item.icon} mdi-26px"></span>
|
|
322
|
-
</div>
|
|
323
|
-
<div>
|
|
324
|
-
<span class="autocomplete-top-left">
|
|
325
|
-
<span class="mdi ${item.itemTypeName === 'I' ? 'mdi-information-outline' : 'mdi-content-copy'} mdi-14px"></span>
|
|
326
|
-
${item.itemName}
|
|
327
|
-
</span>
|
|
328
|
-
<span class="autocomplete-top-right">${formatNumber(item.listPrice, 2, 2, false, '$')}</span>
|
|
329
|
-
<div>
|
|
330
|
-
</div>
|
|
331
|
-
<div>
|
|
332
|
-
<div class="autocomplete-bottom-left">${item.itemNameTranslated}</div>
|
|
333
|
-
<span class="autocomplete-bottom-right">Type: <b>${item.itemTypeName === 'I' ? 'Item' : item.itemTypeName === 'C' ? 'PdCat' : 'Cat'}</b></span>
|
|
334
|
-
</div>`;
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
}
|
|
339
|
-
];
|
|
340
|
-
|
|
341
|
-
this.gridOptions = {
|
|
342
|
-
// your grid options config
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
#### with JSONP
|
|
349
|
-
Example from an external remote API (geobytes) returning a JSONP response.
|
|
350
|
-
|
|
351
|
-
##### Component
|
|
352
|
-
```typescript
|
|
353
|
-
export class GridBasicComponent {
|
|
354
|
-
columnDefinitions: Column[];
|
|
355
|
-
gridOptions: GridOption;
|
|
356
|
-
dataset: any[];
|
|
357
|
-
|
|
358
|
-
defineGrid(): void {
|
|
359
|
-
// your columns definition
|
|
360
|
-
this.columnDefinitions = [
|
|
361
|
-
{
|
|
362
|
-
id: 'cityOfOrigin', name: 'City of Origin', field: 'cityOfOrigin',
|
|
363
|
-
filterable: true,
|
|
364
|
-
minWidth: 100,
|
|
365
|
-
editor: {
|
|
366
|
-
model: Editors.autocompleter,
|
|
367
|
-
placeholder: 'search city', // you can provide an optional placeholder to help your users
|
|
368
|
-
|
|
369
|
-
// use your own autocomplete options, instead of $.ajax, use http
|
|
370
|
-
// here we use $.ajax just because I'm not sure how to configure http with JSONP and CORS
|
|
371
|
-
options: {
|
|
372
|
-
minLength: 3, // minimum count of character that the user needs to type before it queries to the remote
|
|
373
|
-
fetch: (searchText, updateCallback) => {
|
|
374
|
-
// assuming your API call returns a label/value pair
|
|
375
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
376
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
377
|
-
.catch(error => console.log('Error:', error));
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
filter: {
|
|
382
|
-
model: Editors.autocompleter,
|
|
383
|
-
// placeholder: '🔍 search city', // 🔍 is a search icon, this provide an option placeholder
|
|
384
|
-
|
|
385
|
-
// use your own autocomplete options, instead of $.ajax, use http
|
|
386
|
-
// here we use $.ajax just because I'm not sure how to configure http with JSONP and CORS
|
|
387
|
-
options: {
|
|
388
|
-
minLength: 3, // minimum count of character that the user needs to type before it queries to the remote
|
|
389
|
-
fetch: (searchText, updateCallback) => {
|
|
390
|
-
// assuming your API call returns a label/value pair
|
|
391
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
392
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
393
|
-
.catch(error => console.log('Error:', error));
|
|
394
|
-
}
|
|
395
|
-
},
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
];
|
|
399
|
-
|
|
400
|
-
this.gridOptions = {
|
|
401
|
-
// your grid options config
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
## Autocomplete - force user input
|
|
408
|
-
If you want to add the autocomplete functionality but want the user to be able to input a new option, then follow the example below:
|
|
409
|
-
|
|
410
|
-
```ts
|
|
411
|
-
this.columnDefinitions = [{
|
|
412
|
-
id: 'area',
|
|
413
|
-
name: 'Area',
|
|
414
|
-
field: 'area',
|
|
415
|
-
editor: {
|
|
416
|
-
model: Editors.autocompleter,
|
|
417
|
-
options: {
|
|
418
|
-
minLength: 0,
|
|
419
|
-
forceUserInput: true,
|
|
420
|
-
fetch: (searchText, updateCallback) => {
|
|
421
|
-
updateCallback(this.areas); // add here the array
|
|
422
|
-
},
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
];
|
|
427
|
-
```
|
|
428
|
-
You can also use the `minLength` to limit the autocomplete text to `0` characters or more, the default number is `3`.
|
|
429
|
-
|
|
430
|
-
### How to change drop container dimensions?
|
|
431
|
-
You might want to change the dimensions of the drop container, this 3rd party library has a `customize` method to deal with such a thing. Slickgrid-Universal itself is removing the width using this method, you can however override this method to change the drop container dimensions
|
|
432
|
-
|
|
433
|
-
```ts
|
|
434
|
-
this.columnDefinitions = [
|
|
435
|
-
{
|
|
436
|
-
id: 'product', name: 'Product', field: 'product', filterable: true,
|
|
437
|
-
editor: {
|
|
438
|
-
model: Editors.autocompleter,
|
|
439
|
-
alwaysSaveOnEnterKey: true,
|
|
440
|
-
|
|
441
|
-
// example with a Remote API call
|
|
442
|
-
options: {
|
|
443
|
-
minLength: 1,
|
|
444
|
-
fetch: (searchTerm, callback) => {
|
|
445
|
-
// ...
|
|
446
|
-
},
|
|
447
|
-
customize: (_input, _inputRect, container) => {
|
|
448
|
-
// change drop container dimensions
|
|
449
|
-
container.style.width = '250px';
|
|
450
|
-
container.style.height = '325px';
|
|
451
|
-
},
|
|
452
|
-
} as AutocompleterOption,
|
|
453
|
-
},
|
|
454
|
-
}
|
|
455
|
-
];
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
## Animated Gif Demo
|
|
459
|
-
### Basic (default layout)
|
|
460
|
-

|
|
461
|
-
|
|
462
|
-
### with `twoRows` custom layout (without optional left icon)
|
|
463
|
-

|
|
464
|
-
|
|
465
|
-
### with `fourCorners` custom layout (with extra optional left icon)
|
|
466
|
-

|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
##### index
|
|
2
|
-
- [Editor Options](#editor-options)
|
|
3
|
-
- [Custom Validator](#custom-validator)
|
|
4
|
-
- See the [Editors - Wiki](../Editors.md) for more general info about Editors (validators, event handlers, ...)
|
|
5
|
-
|
|
6
|
-
### Information
|
|
7
|
-
The Date Editor is provided through an external library named [Flatpickr](https://flatpickr.js.org/examples/) and all options from that library can be added to your `editorOptions` (see below), so in order to add things like minimum date, disabling dates, ... just review all the [Flatpickr Examples](https://flatpickr.js.org/examples/) and then add them into `editorOptions`. Also just so you know, `editorOptions` is use by all other editors as well to expose external library like Flatpickr, Multiple-Select.js, etc...
|
|
8
|
-
|
|
9
|
-
### Demo
|
|
10
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/editor) | [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-editor.component.ts)
|
|
11
|
-
|
|
12
|
-
### Editor Options
|
|
13
|
-
You can use any of the Flatpickr [options](https://flatpickr.js.org/options/) by adding them to `editorOptions` as shown below.
|
|
14
|
-
|
|
15
|
-
#### [FlatpickrOption](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/flatpickrOption.interface.ts) Interface.
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
defineGrid() {
|
|
19
|
-
this.columnDefinitions = [
|
|
20
|
-
{
|
|
21
|
-
id: 'title', name: 'Title', field: 'title',
|
|
22
|
-
editor: {
|
|
23
|
-
model: Editors.date,
|
|
24
|
-
editorOptions: {
|
|
25
|
-
minDate: 'today',
|
|
26
|
-
disable: [(date: Date) => this.isWeekendDay(date)], // disable weekend days (Sat, Sunday)
|
|
27
|
-
} as FlatpickrOption,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Returns true when it's a weekend day (Saturday, Sunday) */
|
|
34
|
-
isWeekendDay(date: Date): boolean {
|
|
35
|
-
return (date.getDay() === 0 || date.getDay() === 6);
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
#### Grid Option `defaultEditorOptions
|
|
40
|
-
You could also define certain options as a global level (for the entire grid or even all grids) by taking advantage of the `defaultEditorOptions` Grid Option. Note that they are set via the editor type as a key name (`autocompleter`, `date`, ...) and then the content is the same as `editorOptions` (also note that each key is already typed with the correct editor option interface), for example
|
|
41
|
-
|
|
42
|
-
```ts
|
|
43
|
-
this.gridOptions = {
|
|
44
|
-
defaultEditorOptions: {
|
|
45
|
-
date: { minDate: 'today' }, // typed as FlatpickrOption
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Custom Validator
|
|
51
|
-
You can add a Custom Validator from an external function or inline (inline is shown below and comes from [Example 3](https://ghiscoding.github.io/Angular-Slickgrid/#/editor))
|
|
52
|
-
```ts
|
|
53
|
-
defineGrid() {
|
|
54
|
-
this.columnDefinitions = [
|
|
55
|
-
{
|
|
56
|
-
id: 'title', name: 'Title', field: 'title',
|
|
57
|
-
editor: {
|
|
58
|
-
model: Editors.date,
|
|
59
|
-
required: true,
|
|
60
|
-
validator: (value, args) => {
|
|
61
|
-
const dataContext = args && args.item;
|
|
62
|
-
if (dataContext && (dataContext.completed && !value)) {
|
|
63
|
-
return { valid: false, msg: 'You must provide a "Finish" date when "Completed" is checked.' };
|
|
64
|
-
}
|
|
65
|
-
return { valid: true, msg: '' };
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
```
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
##### index
|
|
2
|
-
- [Editor Options](#editor-options)
|
|
3
|
-
- [Custom Validator](#custom-validator)
|
|
4
|
-
- [Date Format](#date-format)
|
|
5
|
-
- See the [Editors - Wiki](../Editors.md) for more general info about Editors (validators, event handlers, ...)
|
|
6
|
-
|
|
7
|
-
### Information
|
|
8
|
-
The Date Editor is provided through an external library named [Vanilla-Calendar-Pro](https://vanilla-calendar.pro) and all options from that library can be added to your `options` (see below), so in order to add things like minimum date, disabling dates, ... just review all the [Vanilla-Calendar-Pro](https://vanilla-calendar.pro/docs/reference/additionally/settings) and then add them into `options`. We use [Tempo](https://tempo.formkit.com/) to parse and format Dates to the chosen format (when `type`, `outputType` and/or `saveType` are provided in your column definition)
|
|
9
|
-
|
|
10
|
-
> **Note** Also just so you know, `options` is used by all other editors as well to expose external library like Autocompleter, Multiple-Select, etc...
|
|
11
|
-
|
|
12
|
-
### Demo
|
|
13
|
-
[Demo Page](https://ghiscoding.github.io/slickgrid-universal/#/example12) | [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/examples/webpack-demo-vanilla-bundle/src/examples/example12.ts)
|
|
14
|
-
|
|
15
|
-
### Editor Options
|
|
16
|
-
You can use any of the Vanilla-Calendar [settings](https://vanilla-calendar.pro/docs/reference/additionally/settings) by adding them to `options` as shown below.
|
|
17
|
-
|
|
18
|
-
> **Note** for easier implementation, you should import `VanillaCalendarOption` from Slickgrid-Universal common package.
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
import { type VanillaCalendarOption } from '@slickgrid-universal/common';
|
|
22
|
-
|
|
23
|
-
prepareGrid() {
|
|
24
|
-
this.columnDefinitions = [
|
|
25
|
-
{
|
|
26
|
-
id: 'title', name: 'Title', field: 'title',
|
|
27
|
-
type: 'dateIso', // if your type has hours/minutes, then the date picker will include date+time
|
|
28
|
-
editor: {
|
|
29
|
-
model: Editors.date,
|
|
30
|
-
// previously known as `editorOptions` for < 9.0
|
|
31
|
-
// also vanilla-calendar was previously v2
|
|
32
|
-
// see their migration: https://github.com/uvarov-frontend/vanilla-calendar-pro/wiki/%5BMigration-from-v2.*.*%5D-New-API-for-all-options-and-actions-in-v3.0.0)
|
|
33
|
-
options: {
|
|
34
|
-
displayDateMin: 'today',
|
|
35
|
-
disableDates: ['2022-08-15', '2022-08-20'],
|
|
36
|
-
} as VanillaCalendarOption,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
#### Grid Option `defaultEditorOptions
|
|
44
|
-
You could also define certain options as a global level (for the entire grid or even all grids) by taking advantage of the `defaultEditorOptions` Grid Option. Note that they are set via the editor type as a key name (`autocompleter`, `date`, ...) and then the content is the same as editor `options` (also note that each key is already typed with the correct editor option interface), for example
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
this.gridOptions = {
|
|
48
|
-
defaultEditorOptions: {
|
|
49
|
-
date: { displayDateMin: 'today' }, // typed as VanillaCalendarOption
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Custom Validator
|
|
55
|
-
You can add a Custom Validator from an external function or inline (inline is shown below and comes from [Example 12](https://ghiscoding.github.io/slickgrid-universal/#/example12))
|
|
56
|
-
```ts
|
|
57
|
-
initializeGrid() {
|
|
58
|
-
this.columnDefinitions = [
|
|
59
|
-
{
|
|
60
|
-
id: 'title', name: 'Title', field: 'title',
|
|
61
|
-
editor: {
|
|
62
|
-
model: Editors.date,
|
|
63
|
-
required: true,
|
|
64
|
-
validator: (value, args) => {
|
|
65
|
-
const dataContext = args && args.item;
|
|
66
|
-
if (dataContext && (dataContext.completed && !value)) {
|
|
67
|
-
return { valid: false, msg: 'You must provide a "Finish" date when "Completed" is checked.' };
|
|
68
|
-
}
|
|
69
|
-
return { valid: true, msg: '' };
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Date Format
|
|
78
|
-
Your column definitions may include a `type` to tell Formatters how to formate your date, this `type` is also used by the Editor when saving.
|
|
79
|
-
|
|
80
|
-
##### What if I want to use a different format when saving?
|
|
81
|
-
There are 3 types you can provide to inform the Editor on how to save:
|
|
82
|
-
1. `type` inform the entire column what its type is (used by Formatter, Filter, Editor, Export)
|
|
83
|
-
2. `outputType` what type to display in the Editor vs saving format.
|
|
84
|
-
3. `saveOutputType` the type to use when saving which is different than the one used on cell input (rarely used).
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
The `type` and `outputType` are often used when you want to save something different compare to what you show to the user (for example, show a date in the US Format but save it as ISO or UTC).
|
|
88
|
-
|
|
89
|
-
The difference between `outputType` and `saveOutputType` when you wish to display a certain format in the date editor input (while editing), but wish to save in a different format. You will rarely need the `saveOutputType` and for most use cases, the use of both `type` and `outputType` should be enough.
|
|
90
|
-
|
|
91
|
-
> **Note** the type detection when saving is the inverse of the list above, whichever comes first from 3 to 1.
|