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.
Files changed (395) hide show
  1. package/LICENSE +1 -1
  2. package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs +16 -16
  3. package/package.json +27 -14
  4. package/.gitbook.yaml +0 -5
  5. package/CHANGELOG.md +0 -1691
  6. package/CONTRIBUTING.md +0 -17
  7. package/angular.json +0 -133
  8. package/coverage/base.css +0 -224
  9. package/coverage/block-navigation.js +0 -87
  10. package/coverage/clover.xml +0 -1620
  11. package/coverage/coverage-final.json +0 -9
  12. package/coverage/favicon.png +0 -0
  13. package/coverage/index.html +0 -176
  14. package/coverage/library/components/angular-slickgrid.component.ts.html +0 -5074
  15. package/coverage/library/components/index.html +0 -116
  16. package/coverage/library/constants.ts.html +0 -397
  17. package/coverage/library/extensions/index.html +0 -116
  18. package/coverage/library/extensions/slickRowDetailView.ts.html +0 -1261
  19. package/coverage/library/index.html +0 -116
  20. package/coverage/library/modules/angular-slickgrid.module.ts.html +0 -166
  21. package/coverage/library/modules/index.html +0 -116
  22. package/coverage/library/services/angularUtil.service.ts.html +0 -445
  23. package/coverage/library/services/container.service.ts.html +0 -163
  24. package/coverage/library/services/index.html +0 -161
  25. package/coverage/library/services/translater.service.ts.html +0 -199
  26. package/coverage/library/services/utilities.ts.html +0 -142
  27. package/coverage/prettify.css +0 -1
  28. package/coverage/prettify.js +0 -2
  29. package/coverage/sort-arrow-sprite.png +0 -0
  30. package/coverage/sorter.js +0 -196
  31. package/dist/LICENSE +0 -21
  32. package/dist/README.md +0 -142
  33. package/docs/README.md +0 -5
  34. package/docs/TOC.md +0 -105
  35. package/docs/backend-services/Custom-Backend-Service.md +0 -50
  36. package/docs/backend-services/GraphQL.md +0 -276
  37. package/docs/backend-services/OData.md +0 -245
  38. package/docs/backend-services/graphql/GraphQL-Filtering.md +0 -156
  39. package/docs/backend-services/graphql/GraphQL-JSON-Result.md +0 -85
  40. package/docs/backend-services/graphql/GraphQL-Pagination.md +0 -77
  41. package/docs/backend-services/graphql/GraphQL-Sorting.md +0 -78
  42. package/docs/column-functionalities/cell-menu.md +0 -212
  43. package/docs/column-functionalities/editors/autocomplete-editor.md +0 -466
  44. package/docs/column-functionalities/editors/date-editor-flatpickr.md +0 -71
  45. package/docs/column-functionalities/editors/date-editor-vanilla-calendar.md +0 -91
  46. package/docs/column-functionalities/editors/longtext-editor-textarea.md +0 -80
  47. package/docs/column-functionalities/editors/select-dropdown-editor.md +0 -227
  48. package/docs/column-functionalities/editors.md +0 -604
  49. package/docs/column-functionalities/filters/autocomplete-filter.md +0 -183
  50. package/docs/column-functionalities/filters/compound-filters.md +0 -234
  51. package/docs/column-functionalities/filters/custom-filter.md +0 -117
  52. package/docs/column-functionalities/filters/filter-intro.md +0 -81
  53. package/docs/column-functionalities/filters/input-filter.md +0 -260
  54. package/docs/column-functionalities/filters/range-filters.md +0 -188
  55. package/docs/column-functionalities/filters/select-filter.md +0 -695
  56. package/docs/column-functionalities/filters/single-search-filter.md +0 -77
  57. package/docs/column-functionalities/filters/styling-filled-filters.md +0 -45
  58. package/docs/column-functionalities/formatters.md +0 -325
  59. package/docs/column-functionalities/sorting.md +0 -200
  60. package/docs/developer-guides/csp-compliance.md +0 -64
  61. package/docs/events/Available-Events.md +0 -223
  62. package/docs/events/Grid-&-DataView-Events.md +0 -211
  63. package/docs/getting-started/quick-start.md +0 -230
  64. package/docs/getting-started/troubleshooting.md +0 -80
  65. package/docs/grid-functionalities/Column-Picker.md +0 -22
  66. package/docs/grid-functionalities/Composite-Editor-Modal.md +0 -627
  67. package/docs/grid-functionalities/Context-Menu.md +0 -226
  68. package/docs/grid-functionalities/Custom-Footer.md +0 -80
  69. package/docs/grid-functionalities/Custom-Tooltip-(plugin).md +0 -258
  70. package/docs/grid-functionalities/Export-to-Excel.md +0 -457
  71. package/docs/grid-functionalities/Export-to-Text-File.md +0 -165
  72. package/docs/grid-functionalities/FAQ.md +0 -53
  73. package/docs/grid-functionalities/Global-Options.md +0 -29
  74. package/docs/grid-functionalities/Grid-Auto-Resize.md +0 -218
  75. package/docs/grid-functionalities/Grid-Menu.md +0 -134
  76. package/docs/grid-functionalities/Grid-State-&-Preset.md +0 -245
  77. package/docs/grid-functionalities/Header-Menu-&-Header-Buttons.md +0 -125
  78. package/docs/grid-functionalities/Resize-by-Cell-Content.md +0 -138
  79. package/docs/grid-functionalities/Row-Selection.md +0 -247
  80. package/docs/grid-functionalities/Row-based-edit.md +0 -71
  81. package/docs/grid-functionalities/add-update-highlight.md +0 -258
  82. package/docs/grid-functionalities/column-row-spanning.md +0 -74
  83. package/docs/grid-functionalities/dynamic-item-metadata.md +0 -124
  84. package/docs/grid-functionalities/excel-copy-buffer.md +0 -145
  85. package/docs/grid-functionalities/frozen-columns-rows.md +0 -164
  86. package/docs/grid-functionalities/grouping-and-aggregators.md +0 -269
  87. package/docs/grid-functionalities/header-footer-slots.md +0 -22
  88. package/docs/grid-functionalities/infinite-scroll.md +0 -150
  89. package/docs/grid-functionalities/providing-grid-data.md +0 -61
  90. package/docs/grid-functionalities/row-detail.md +0 -530
  91. package/docs/grid-functionalities/tree-data-grid.md +0 -391
  92. package/docs/localization/Localization---Component-Sample.md +0 -87
  93. package/docs/localization/Localization-with-Custom-Locales.md +0 -66
  94. package/docs/localization/Localization-with-ngx-translate.md +0 -148
  95. package/docs/migrations/migration-to-2.x.md +0 -304
  96. package/docs/migrations/migration-to-3.x.md +0 -295
  97. package/docs/migrations/migration-to-4.x.md +0 -83
  98. package/docs/migrations/migration-to-5.x.md +0 -160
  99. package/docs/migrations/migration-to-6.x.md +0 -128
  100. package/docs/migrations/migration-to-7.x.md +0 -294
  101. package/docs/migrations/migration-to-8.x.md +0 -316
  102. package/docs/migrations/migration-to-9.x.md +0 -219
  103. package/docs/slick-grid-dataview-objects/slickgrid-dataview-objects.md +0 -79
  104. package/docs/styling/dark-mode.md +0 -100
  105. package/docs/styling/styling.md +0 -250
  106. package/docs/testing/testing-patterns.md +0 -73
  107. package/eslint.config.mjs +0 -60
  108. package/ng-package.json +0 -10
  109. package/src/assets/angular-logo.png +0 -0
  110. package/src/assets/angular-logo2.png +0 -0
  111. package/src/assets/data/collection_100_numbers.json +0 -12
  112. package/src/assets/data/collection_500_numbers.json +0 -52
  113. package/src/assets/data/countries.json +0 -245
  114. package/src/assets/data/country_names.json +0 -245
  115. package/src/assets/data/customers_100.json +0 -102
  116. package/src/assets/data/users.csv +0 -5
  117. package/src/assets/i18n/en.json +0 -102
  118. package/src/assets/i18n/fr.json +0 -103
  119. package/src/demos/app-routing.module.ts +0 -108
  120. package/src/demos/app.component.html +0 -187
  121. package/src/demos/app.component.scss +0 -79
  122. package/src/demos/app.component.ts +0 -11
  123. package/src/demos/app.module.ts +0 -196
  124. package/src/demos/environments/environment.dev.ts +0 -3
  125. package/src/demos/environments/environment.prod.ts +0 -3
  126. package/src/demos/environments/environment.ts +0 -8
  127. package/src/demos/examples/custom-angularComponentEditor.ts +0 -187
  128. package/src/demos/examples/custom-angularComponentFilter.ts +0 -123
  129. package/src/demos/examples/custom-buttonFormatter.component.ts +0 -13
  130. package/src/demos/examples/custom-inputEditor.ts +0 -132
  131. package/src/demos/examples/custom-inputFilter.ts +0 -134
  132. package/src/demos/examples/custom-titleFormatter.component.ts +0 -9
  133. package/src/demos/examples/data/collection_100_numbers.json +0 -12
  134. package/src/demos/examples/data/collection_500_numbers.json +0 -52
  135. package/src/demos/examples/data/countries.json +0 -245
  136. package/src/demos/examples/data/country_names.json +0 -245
  137. package/src/demos/examples/data/customers_100.json +0 -102
  138. package/src/demos/examples/data/users.csv +0 -5
  139. package/src/demos/examples/editor-ng-select.component.ts +0 -38
  140. package/src/demos/examples/example01.component.html +0 -48
  141. package/src/demos/examples/example01.component.ts +0 -109
  142. package/src/demos/examples/example02.component.html +0 -45
  143. package/src/demos/examples/example02.component.ts +0 -218
  144. package/src/demos/examples/example03.component.html +0 -118
  145. package/src/demos/examples/example03.component.ts +0 -694
  146. package/src/demos/examples/example04.component.html +0 -87
  147. package/src/demos/examples/example04.component.ts +0 -326
  148. package/src/demos/examples/example05.component.html +0 -151
  149. package/src/demos/examples/example05.component.ts +0 -474
  150. package/src/demos/examples/example06.component.html +0 -163
  151. package/src/demos/examples/example06.component.ts +0 -446
  152. package/src/demos/examples/example07.component.html +0 -56
  153. package/src/demos/examples/example07.component.scss +0 -10
  154. package/src/demos/examples/example07.component.ts +0 -216
  155. package/src/demos/examples/example08.component.html +0 -51
  156. package/src/demos/examples/example08.component.scss +0 -23
  157. package/src/demos/examples/example08.component.ts +0 -195
  158. package/src/demos/examples/example09.component.html +0 -55
  159. package/src/demos/examples/example09.component.scss +0 -22
  160. package/src/demos/examples/example09.component.ts +0 -302
  161. package/src/demos/examples/example10.component.html +0 -103
  162. package/src/demos/examples/example10.component.ts +0 -309
  163. package/src/demos/examples/example11.component.html +0 -91
  164. package/src/demos/examples/example11.component.ts +0 -276
  165. package/src/demos/examples/example12.component.html +0 -98
  166. package/src/demos/examples/example12.component.ts +0 -317
  167. package/src/demos/examples/example13.component.html +0 -96
  168. package/src/demos/examples/example13.component.ts +0 -370
  169. package/src/demos/examples/example14.component.html +0 -50
  170. package/src/demos/examples/example14.component.scss +0 -11
  171. package/src/demos/examples/example14.component.ts +0 -156
  172. package/src/demos/examples/example15.component.html +0 -56
  173. package/src/demos/examples/example15.component.ts +0 -304
  174. package/src/demos/examples/example16.component.html +0 -77
  175. package/src/demos/examples/example16.component.ts +0 -277
  176. package/src/demos/examples/example17.component.html +0 -50
  177. package/src/demos/examples/example17.component.ts +0 -109
  178. package/src/demos/examples/example18.component.html +0 -132
  179. package/src/demos/examples/example18.component.ts +0 -445
  180. package/src/demos/examples/example19-rowdetail.component.html +0 -40
  181. package/src/demos/examples/example19-rowdetail.component.ts +0 -54
  182. package/src/demos/examples/example19.component.html +0 -79
  183. package/src/demos/examples/example19.component.ts +0 -316
  184. package/src/demos/examples/example20.component.html +0 -76
  185. package/src/demos/examples/example20.component.scss +0 -11
  186. package/src/demos/examples/example20.component.ts +0 -341
  187. package/src/demos/examples/example21.component.html +0 -86
  188. package/src/demos/examples/example21.component.scss +0 -16
  189. package/src/demos/examples/example21.component.ts +0 -140
  190. package/src/demos/examples/example22.component.html +0 -41
  191. package/src/demos/examples/example22.component.ts +0 -117
  192. package/src/demos/examples/example23.component.html +0 -111
  193. package/src/demos/examples/example23.component.ts +0 -323
  194. package/src/demos/examples/example24.component.html +0 -120
  195. package/src/demos/examples/example24.component.scss +0 -62
  196. package/src/demos/examples/example24.component.ts +0 -641
  197. package/src/demos/examples/example25.component.html +0 -60
  198. package/src/demos/examples/example25.component.scss +0 -8
  199. package/src/demos/examples/example25.component.ts +0 -255
  200. package/src/demos/examples/example26.component.html +0 -98
  201. package/src/demos/examples/example26.component.scss +0 -42
  202. package/src/demos/examples/example26.component.ts +0 -383
  203. package/src/demos/examples/example27.component.html +0 -138
  204. package/src/demos/examples/example27.component.scss +0 -10
  205. package/src/demos/examples/example27.component.ts +0 -369
  206. package/src/demos/examples/example28.component.html +0 -143
  207. package/src/demos/examples/example28.component.scss +0 -54
  208. package/src/demos/examples/example28.component.ts +0 -453
  209. package/src/demos/examples/example29.component.html +0 -30
  210. package/src/demos/examples/example29.component.ts +0 -70
  211. package/src/demos/examples/example30.component.html +0 -116
  212. package/src/demos/examples/example30.component.scss +0 -20
  213. package/src/demos/examples/example30.component.ts +0 -1070
  214. package/src/demos/examples/example32.component.html +0 -77
  215. package/src/demos/examples/example32.component.scss +0 -8
  216. package/src/demos/examples/example32.component.ts +0 -905
  217. package/src/demos/examples/example33.component.html +0 -50
  218. package/src/demos/examples/example33.component.scss +0 -46
  219. package/src/demos/examples/example33.component.ts +0 -571
  220. package/src/demos/examples/example34.component.html +0 -82
  221. package/src/demos/examples/example34.component.scss +0 -77
  222. package/src/demos/examples/example34.component.ts +0 -434
  223. package/src/demos/examples/example35.component.html +0 -77
  224. package/src/demos/examples/example35.component.scss +0 -18
  225. package/src/demos/examples/example35.component.ts +0 -264
  226. package/src/demos/examples/example36.component.html +0 -56
  227. package/src/demos/examples/example36.component.scss +0 -26
  228. package/src/demos/examples/example36.component.ts +0 -504
  229. package/src/demos/examples/example37.component.html +0 -30
  230. package/src/demos/examples/example37.component.ts +0 -123
  231. package/src/demos/examples/example38.component.html +0 -104
  232. package/src/demos/examples/example38.component.scss +0 -8
  233. package/src/demos/examples/example38.component.ts +0 -420
  234. package/src/demos/examples/example39.component.html +0 -112
  235. package/src/demos/examples/example39.component.scss +0 -8
  236. package/src/demos/examples/example39.component.ts +0 -371
  237. package/src/demos/examples/example40.component.html +0 -76
  238. package/src/demos/examples/example40.component.ts +0 -226
  239. package/src/demos/examples/example41.component.html +0 -50
  240. package/src/demos/examples/example41.component.scss +0 -42
  241. package/src/demos/examples/example41.component.ts +0 -229
  242. package/src/demos/examples/example42.component.html +0 -47
  243. package/src/demos/examples/example42.component.ts +0 -203
  244. package/src/demos/examples/example43.component.html +0 -94
  245. package/src/demos/examples/example43.component.scss +0 -30
  246. package/src/demos/examples/example43.component.ts +0 -449
  247. package/src/demos/examples/example44.component.html +0 -78
  248. package/src/demos/examples/example44.component.scss +0 -50
  249. package/src/demos/examples/example44.component.ts +0 -375
  250. package/src/demos/examples/example45-detail.component.html +0 -15
  251. package/src/demos/examples/example45-detail.component.ts +0 -97
  252. package/src/demos/examples/example45.component.html +0 -110
  253. package/src/demos/examples/example45.component.scss +0 -50
  254. package/src/demos/examples/example45.component.ts +0 -243
  255. package/src/demos/examples/filter-ng-select.component.ts +0 -33
  256. package/src/demos/examples/grid-custom-pager.component.html +0 -60
  257. package/src/demos/examples/grid-custom-pager.component.scss +0 -57
  258. package/src/demos/examples/grid-custom-pager.component.ts +0 -107
  259. package/src/demos/examples/grid-remote.component.html +0 -44
  260. package/src/demos/examples/grid-remote.component.ts +0 -164
  261. package/src/demos/examples/home.component.html +0 -39
  262. package/src/demos/examples/home.component.ts +0 -10
  263. package/src/demos/examples/jsonp.ts +0 -89
  264. package/src/demos/examples/rowdetail-preload.component.ts +0 -10
  265. package/src/demos/examples/swt-common-grid-pagination.component.ts +0 -160
  266. package/src/demos/examples/swt-common-grid-test.component.html +0 -37
  267. package/src/demos/examples/swt-common-grid-test.component.ts +0 -214
  268. package/src/demos/examples/swt-common-grid.component.ts +0 -436
  269. package/src/demos/examples/swt-logger.service.ts +0 -173
  270. package/src/demos/examples/utilities.ts +0 -9
  271. package/src/favicon.ico +0 -0
  272. package/src/index.html +0 -17
  273. package/src/library/components/__tests__/angular-slickgrid.component.spec.ts +0 -2638
  274. package/src/library/components/angular-slickgrid.component.html +0 -5
  275. package/src/library/components/angular-slickgrid.component.ts +0 -1662
  276. package/src/library/constants.ts +0 -105
  277. package/src/library/extensions/__tests__/slickRowDetailView.spec.ts +0 -751
  278. package/src/library/extensions/index.ts +0 -1
  279. package/src/library/extensions/slickRowDetailView.ts +0 -395
  280. package/src/library/global-grid-options.ts +0 -273
  281. package/src/library/index.ts +0 -11
  282. package/src/library/models/angularComponentOutput.interface.ts +0 -6
  283. package/src/library/models/angularGridInstance.interface.ts +0 -76
  284. package/src/library/models/externalTestingDependencies.interface.ts +0 -37
  285. package/src/library/models/gridOption.interface.ts +0 -15
  286. package/src/library/models/index.ts +0 -5
  287. package/src/library/models/rowDetailView.interface.ts +0 -16
  288. package/src/library/modules/angular-slickgrid.module.spec.ts +0 -25
  289. package/src/library/modules/angular-slickgrid.module.ts +0 -27
  290. package/src/library/services/__tests__/angularUtilService.spec.ts +0 -156
  291. package/src/library/services/__tests__/container.service.spec.ts +0 -25
  292. package/src/library/services/__tests__/translater.service.spec.ts +0 -43
  293. package/src/library/services/__tests__/utilities.spec.ts +0 -22
  294. package/src/library/services/angularUtil.service.ts +0 -120
  295. package/src/library/services/container.service.ts +0 -26
  296. package/src/library/services/index.ts +0 -4
  297. package/src/library/services/translater.service.ts +0 -38
  298. package/src/library/services/utilities.ts +0 -19
  299. package/src/library/slickgrid-config.ts +0 -10
  300. package/src/main.ts +0 -13
  301. package/src/public_api.ts +0 -1
  302. package/src/styles.scss +0 -178
  303. package/test/cypress/e2e/example01.cy.ts +0 -367
  304. package/test/cypress/e2e/example02.cy.ts +0 -60
  305. package/test/cypress/e2e/example03.cy.ts +0 -268
  306. package/test/cypress/e2e/example04.cy.ts +0 -254
  307. package/test/cypress/e2e/example05.cy.ts +0 -804
  308. package/test/cypress/e2e/example06.cy.ts +0 -890
  309. package/test/cypress/e2e/example07.cy.ts +0 -384
  310. package/test/cypress/e2e/example08.cy.ts +0 -190
  311. package/test/cypress/e2e/example09.cy.ts +0 -392
  312. package/test/cypress/e2e/example10.cy.ts +0 -650
  313. package/test/cypress/e2e/example11.cy.ts +0 -86
  314. package/test/cypress/e2e/example12.cy.ts +0 -269
  315. package/test/cypress/e2e/example13.cy.ts +0 -246
  316. package/test/cypress/e2e/example14.cy.ts +0 -122
  317. package/test/cypress/e2e/example15.cy.ts +0 -598
  318. package/test/cypress/e2e/example16.cy.ts +0 -427
  319. package/test/cypress/e2e/example17.cy.ts +0 -83
  320. package/test/cypress/e2e/example18.cy.ts +0 -431
  321. package/test/cypress/e2e/example19.cy.ts +0 -263
  322. package/test/cypress/e2e/example20.cy.ts +0 -264
  323. package/test/cypress/e2e/example21.cy.ts +0 -77
  324. package/test/cypress/e2e/example22.cy.ts +0 -94
  325. package/test/cypress/e2e/example23.cy.ts +0 -259
  326. package/test/cypress/e2e/example24.cy.ts +0 -707
  327. package/test/cypress/e2e/example25.cy.ts +0 -193
  328. package/test/cypress/e2e/example26.cy.ts +0 -111
  329. package/test/cypress/e2e/example27.cy.ts +0 -261
  330. package/test/cypress/e2e/example28.cy.ts +0 -740
  331. package/test/cypress/e2e/example29.cy.ts +0 -30
  332. package/test/cypress/e2e/example30.cy.ts +0 -757
  333. package/test/cypress/e2e/example31.cy.ts +0 -69
  334. package/test/cypress/e2e/example32.cy.ts +0 -272
  335. package/test/cypress/e2e/example33.cy.ts +0 -278
  336. package/test/cypress/e2e/example34.cy.ts +0 -84
  337. package/test/cypress/e2e/example35.cy.ts +0 -178
  338. package/test/cypress/e2e/example36.cy.ts +0 -219
  339. package/test/cypress/e2e/example37.cy.ts +0 -52
  340. package/test/cypress/e2e/example38.cy.ts +0 -160
  341. package/test/cypress/e2e/example39.cy.ts +0 -150
  342. package/test/cypress/e2e/example40.cy.ts +0 -126
  343. package/test/cypress/e2e/example41.cy.ts +0 -90
  344. package/test/cypress/e2e/example42.cy.ts +0 -82
  345. package/test/cypress/e2e/example43.cy.ts +0 -482
  346. package/test/cypress/e2e/example44.cy.ts +0 -458
  347. package/test/cypress/e2e/example45.cy.ts +0 -455
  348. package/test/cypress/e2e/home.cy.ts +0 -7
  349. package/test/cypress/fixtures/example.json +0 -5
  350. package/test/cypress/plugins/index.ts +0 -17
  351. package/test/cypress/plugins/utilities.ts +0 -28
  352. package/test/cypress/support/commands.ts +0 -88
  353. package/test/cypress/support/common.ts +0 -47
  354. package/test/cypress/support/drag.ts +0 -101
  355. package/test/cypress/support/index.ts +0 -20
  356. package/test/cypress/tsconfig.json +0 -9
  357. package/test/cypress.config.ts +0 -34
  358. package/test/mockSlickEvent.ts +0 -77
  359. package/test/rxjsResourceStub.ts +0 -69
  360. package/test/test-setup.ts +0 -6
  361. package/test/translateServiceStub.ts +0 -230
  362. package/test/translaterServiceStub.ts +0 -239
  363. package/test/tsconfig.json +0 -17
  364. package/test/vitest-global-mocks.ts +0 -41
  365. package/test/vitest-global-setup.ts +0 -3
  366. package/test/vitest-pretest.ts +0 -5
  367. package/tsconfig.app.json +0 -14
  368. package/tsconfig.json +0 -31
  369. package/tsconfig.spec.json +0 -11
  370. package/types/sortablejs.d.ts +0 -4
  371. package/vite.config.mts +0 -51
  372. /package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs.map +0 -0
  373. /package/{dist/i18n → i18n}/en.json +0 -0
  374. /package/{dist/i18n → i18n}/fr.json +0 -0
  375. /package/{dist/index.d.ts → index.d.ts} +0 -0
  376. /package/{dist/library → library}/components/angular-slickgrid.component.d.ts +0 -0
  377. /package/{dist/library → library}/constants.d.ts +0 -0
  378. /package/{dist/library → library}/extensions/index.d.ts +0 -0
  379. /package/{dist/library → library}/extensions/slickRowDetailView.d.ts +0 -0
  380. /package/{dist/library → library}/global-grid-options.d.ts +0 -0
  381. /package/{dist/library → library}/index.d.ts +0 -0
  382. /package/{dist/library → library}/models/angularComponentOutput.interface.d.ts +0 -0
  383. /package/{dist/library → library}/models/angularGridInstance.interface.d.ts +0 -0
  384. /package/{dist/library → library}/models/externalTestingDependencies.interface.d.ts +0 -0
  385. /package/{dist/library → library}/models/gridOption.interface.d.ts +0 -0
  386. /package/{dist/library → library}/models/index.d.ts +0 -0
  387. /package/{dist/library → library}/models/rowDetailView.interface.d.ts +0 -0
  388. /package/{dist/library → library}/modules/angular-slickgrid.module.d.ts +0 -0
  389. /package/{dist/library → library}/services/angularUtil.service.d.ts +0 -0
  390. /package/{dist/library → library}/services/container.service.d.ts +0 -0
  391. /package/{dist/library → library}/services/index.d.ts +0 -0
  392. /package/{dist/library → library}/services/translater.service.d.ts +0 -0
  393. /package/{dist/library → library}/services/utilities.d.ts +0 -0
  394. /package/{dist/library → library}/slickgrid-config.d.ts +0 -0
  395. /package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
@@ -1,695 +0,0 @@
1
- ### index
2
- - [demo](#demo)
3
- - [SASS styling](#sass-styling)
4
- - [How to use Select Filter](#how-to-use-select-filter)
5
- - [Default Search Terms](#default-search-terms)
6
- - [How to add Translation](#how-to-add-translation)
7
- - [How to filter empty values](#how-to-filter-empty-values)
8
- - Collection Options
9
- - [Add Blank Entry](#collection-add-blank-entry)
10
- - [Add Custom Entry at Beginning/End of Collection](#collection-add-custom-entry-at-the-beginningend-of-the-collection)
11
- - [Custom Structure](#custom-structure-keylabel-pair)
12
- - [Custom Structure with Translation](#custom-structure-with-translation)
13
- - [Collection filterBy/sortBy](#collection-filterbysortby)
14
- - [Collection Label Prefix/Suffix](#collection-label-prefixsuffix)
15
- - [Collection Label Render HTML](#collection-label-render-html)
16
- - [Collection Async Load](#collection-async-load)
17
- - [Collection Lazy Load](#collection-lazy-load)
18
- - [Collection Watch](#collection-watch)
19
- - [`multiple-select.js` Options](#multiple-selectjs-options)
20
- - [Filter Options (`MultipleSelectOption` interface)](#filter-options-multipleselectoption-interface)
21
- - [Display shorter selected label text](#display-shorter-selected-label-text)
22
- - [Query against a different field](#query-against-another-field-property)
23
- - [Update Filters Dynamically](input-filter.md#update-filters-dynamically)
24
- - [Custom Filter Predicate](input-filter.md#custom-filter-predicate)
25
- - [Filter Shortcuts](input-filter.md#filter-shortcuts)
26
-
27
- ### Demo
28
- [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)
29
-
30
- ### Description
31
- Multiple Select (dropdown) filter is useful when we want to filter the grid 1 or more search term value.
32
-
33
- We use an external lib named [multiple-select-vanilla](https://github.com/ghiscoding/multiple-select-vanilla).
34
-
35
- #### Note
36
- For this filter to work you will need to add [Multiple-Select.js](http://wenzhixin.net.cn/p/multiple-select) to your project. This is a customized version of the original (thought all the original [lib options](http://wenzhixin.net.cn/p/multiple-select/docs/) are available so you can still consult the original site for all options). Couple of small options were added to suit SlickGrid-Universal needs, which is why it points to `slickgrid-universal/dist/lib` folder. This lib is required if you plan to use `multipleSelect` or `singleSelect` Filters. What was customized to (compare to the original)
37
- - `okButton` option was added to add an OK button for simpler closing of the dropdown after selecting multiple options.
38
- - `okButtonText` was also added for locale (i18n)
39
- - `offsetLeft` option was added to make it possible to offset the dropdown. By default it is set to 0 and is aligned to the left of the select element. This option is particularly helpful when used as the last right column, not to fall off the screen.
40
- - `autoDropWidth` option was added to automatically resize the dropdown with the same width as the select filter element.
41
-
42
- ##### UI Sample
43
- Scroll down below to see the [UI Print Screens](#ui-sample-1)
44
-
45
- ### Types
46
- There are 3 types of select filter
47
- 1. `Filters.singleSelect` which will filter the dataset with 1 value (uses `EQ` internally) with checkbox icons.
48
- 2. `Filters.multipleSelect` which will do a search with 1 or more values (uses `IN` internally) with radio icons.
49
-
50
- ##### Less recommended
51
- 3. `Filters.select` which will filter the dataset with 1 value (uses `EQ` internally), same as `singleSelect` but uses styling from the browser setup.
52
- - this one is less recommended, it is a simple and plain select dropdown. There are no styling applied and will be different in every browser. If you want a more consistent visual UI, it's suggested to use the other 2 filters (`multipleSelect` or `singleSelect`)
53
-
54
- ### SASS Styling
55
- You can change the `multipleSelect` and `singleSelect` styling with SASS [variables](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/styles/_variables.scss#L736) for styling. For more info on how to use SASS in your project, read the [Wiki - Styling](../../styling/styling.md)
56
-
57
- ### How to use Select Filter
58
- 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:
59
- ```ts
60
- // define you columns, in this demo Effort Driven will use a Select Filter
61
- this.columnDefinitions = [
62
- { id: 'title', name: 'Title', field: 'title' },
63
- { id: 'description', name: 'Description', field: 'description', filterable: true },
64
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
65
- type: 'boolean',
66
- filterable: true,
67
- filter: {
68
- collection: [ { value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' } ],
69
- model: Filters.multipleSelect,
70
-
71
- // you can add "multiple-select" plugin options like styling the first row
72
- // previously known as `filterOptions` for < 9.0
73
- options: {
74
- offsetLeft: 14,
75
- width: 100
76
- } as MultipleSelectOption,
77
-
78
- // you can also add an optional placeholder
79
- placeholder: 'choose an option'
80
- }
81
- ];
82
-
83
- // you also need to enable the filters in the Grid Options
84
- this.gridOptions = {
85
- enableFiltering: true
86
- };
87
- ```
88
-
89
- ### Default Search Term(s)
90
- If you want to load the grid with certain default filter(s), you can use the following optional property:
91
- - `searchTerms` (array of values)
92
-
93
- #### Note
94
- Even though the option of `searchTerms` it is much better to use the more powerful `presets` grid options, please refer to the [Grid State & Presets](../../grid-functionalities/Grid-State-&-Preset#grid-presets) for more info.
95
-
96
- **NOTE**
97
- If you also have `presets` in the grid options, then your `searchTerms` will be ignored completely (even if it's a different column) since `presets` have higher priority over `searchTerms`. See [Grid State & Grid Presets](../../grid-functionalities/Grid-State-&-Preset.md) from more info.
98
-
99
- #### Sample
100
- ```ts
101
- // define you columns, in this demo Effort Driven will use a Select Filter
102
- this.columnDefinitions = [
103
- { id: 'title', name: 'Title', field: 'title' },
104
- { id: 'description', name: 'Description', field: 'description', filterable: true },
105
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
106
- type: 'boolean',
107
- filterable: true,
108
- filter: {
109
- collection: [ { value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' } ],
110
- model: Filters.multipleSelect,
111
- searchTerms: [true],
112
- }
113
- ];
114
- ```
115
-
116
- ### How to add Translation?
117
- #### LabelKey
118
- For the Select (dropdown) filter, you can fill in the "labelKey" property, if found it will translate it right away. If no `labelKey` is provided nothing will be translated (unless you have `enableTranslateLabel` set to true), else it will use "label"
119
- ```typescript
120
- // define you columns, in this demo Effort Driven will use a Select Filter
121
- this.columnDefinitions = [
122
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
123
- formatter: Formatters.checkmarkMaterial,
124
- type: 'boolean',
125
- filterable: true,
126
- filter: {
127
- collection: [ { value: '', label: '' }, { value: true, labelKey: 'TRUE' }, { value: false, label: 'FALSE' } ],
128
- model: Filters.singleSelect,
129
- }
130
- ];
131
- ```
132
-
133
- #### enableTranslateLabel
134
- You could also use the `enableTranslateLabel` which will translate regardless of the label key name (so it could be used with `label`, `labelKey` or even a `customStructure` label).
135
- ```typescript
136
- // define you columns, in this demo Effort Driven will use a Select Filter
137
- this.columnDefinitions = [
138
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
139
- formatter: Formatters.checkmarkMaterial,
140
- type: 'boolean',
141
- filterable: true,
142
- filter: {
143
- collection: [ { value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' } ],
144
- model: Filters.singleSelect,
145
- enableTranslateLabel: true
146
- }
147
- ];
148
- ```
149
-
150
- ### Custom Structure (key/label pair)
151
- What if your select options (collection) have totally different value/label pair? In this case, you can use the `customStructure` to change the property name(s) to use. You can change the label and/or the value, they can be passed independently.
152
- ```typescript
153
- // define you columns, in this demo Effort Driven will use a Select Filter
154
- this.columnDefinitions = [
155
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
156
- formatter: Formatters.checkmarkMaterial,
157
- type: 'boolean',
158
- filterable: true,
159
- filter: {
160
- collection: [
161
- { customValue: '', customLabel: '' },
162
- { customValue: true, customLabel: 'true' },
163
- { customValue: false, customLabel: 'false' }
164
- ],
165
- customStructure: {
166
- label: 'customLabel',
167
- value: 'customValue'
168
- },
169
- model: Filters.multipleSelect,
170
- }
171
- ];
172
- ```
173
-
174
- ### Custom Structure with Translation
175
- What if you want to use `customStructure` and translate the labels? Simply pass the flag `enableTranslateLabel: true`
176
-
177
- ```typescript
178
- // define you columns, in this demo Effort Driven will use a Select Filter
179
- this.columnDefinitions = [
180
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
181
- formatter: Formatters.checkmarkMaterial,
182
- type: 'boolean',
183
- filterable: true,
184
- filter: {
185
- collection: [
186
- { customValue: '', customLabel: '' },
187
- { customValue: true, customLabel: 'TRUE' },
188
- { customValue: false, customLabel: 'FALSE' }
189
- ],
190
- customStructure: {
191
- label: 'customLabel',
192
- value: 'customValue'
193
- },
194
- enableTranslateLabel: true,
195
- model: Filters.multipleSelect,
196
- }
197
- ];
198
- ```
199
-
200
- ### How to filter empty values?
201
- By default you cannot filter empty dataset values (unless you use a `multipleSelect` Filter). You might be wondering, why though? By default an empty value in a `singleSelect` Filter is equal to returning **all values**. You could however use this option `emptySearchTermReturnAllValues` set to `false` to add the ability to really search only empty values.
202
-
203
- Note: the defaults for single & multiple select filters are different
204
- - single select filter default is `emptySearchTermReturnAllValues: true`
205
- - multiple select filter default is `emptySearchTermReturnAllValues: false`
206
-
207
- ```ts
208
- // define you columns, in this demo Effort Driven will use a Select Filter
209
- this.columnDefinitions = [
210
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
211
- formatter: Formatters.checkmarkMaterial,
212
- type: 'boolean',
213
- filterable: true,
214
- filter: {
215
- collection: [ { value: '', label: '' }, { value: true, labelKey: 'TRUE' }, { value: false, label: 'FALSE' } ],
216
- model: Filters.singleSelect,
217
- emptySearchTermReturnAllValues: false, // False when we really want to filter empty values
218
- }
219
- ];
220
- ```
221
-
222
- ### Collection FilterBy/SortBy
223
- You can also pre-sort or pre-filter the collection given to the multipleSelect/singleSelect Filters. Also note that if the `enableTranslateLabel` flag is set to `True`, it will use the translated value to filter or sort the collection. The supported filters are
224
- 1. `equal`: filters the collection for only the value provided in `collectionFilterBy.value`
225
- 2. `notEqual`: filters the collection for every value **EXCEPT** the value provided in `collectionFilterBy.value`
226
- 3. `in`: supports `collectionFilterBy.property` as a nested array, and if the `collectionFilterBy.value` exists in the nested array, the parent item will remain in the collection (**NOT** be filtered from the collection). For example: `columnDef.filter.collection: [{ foo: ['bar'] }, { foo: ['foo'] }]`, `collectionFilterBy.property: 'foo'`, `collectionFilterBy.value: 'bar'` will return the first item in the collection only
227
- 4. `notIn`:opposite of `in`
228
- 5. `contains`: assumes the `collectionFilterBy.value` is an array and will check if any of those values exists in the `collectionFilterBy.property`. For example: `collection: [{ foo: 'bar' }, { foo: 'foo' }]`, `collectionFilterBy.property: 'foo'`, `collectionFilterBy.value: [ 'bar', 'foo' ]` will return bot items
229
-
230
- Full example:
231
- ```typescript
232
- // define you columns, in this demo Effort Driven will use a Select Filter
233
- this.columnDefinitions = [
234
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
235
- formatter: Formatters.checkmarkMaterial,
236
- type: 'boolean',
237
- filterable: true,
238
- filter: {
239
- collection: [
240
- { value: '', label: '' },
241
- { value: true, label: 'true' },
242
- { value: false, label: 'false' },
243
- { value: undefined, label: 'undefined' }
244
- ],
245
- collectionFilterBy: {
246
- property: 'effortDriven',
247
- operator: OperatorType.notEqual,
248
- value: undefined
249
- },
250
- collectionSortBy: {
251
- property: 'effortDriven', // will sort by translated value since "enableTranslateLabel" is true
252
- sortDesc: false, // defaults to "false" when not provided
253
- fieldType: 'boolean' // defaults to 'string' when not provided
254
- },
255
- model: Filters.multipleSelect
256
- }
257
- ];
258
- ```
259
-
260
- #### Multiple FilterBy/SortBy
261
- You can also pass multiple `collectionFilterBy` or `collectionSortBy` simply by changing these object to array of objects.
262
-
263
- ```typescript
264
- // prepare a multiple-select array to filter with
265
- const multiSelectFilterArray = [];
266
- for (let i = 0; i < 365; i++) {
267
- multiSelectFilterArray.push({ value: i, label: i, labelSuffix: ' days' });
268
- }
269
-
270
- this.columnDefinitions = [
271
- { id: 'duration', name: 'Duration', field: 'duration',
272
- formatter: Formatters.checkmarkMaterial,
273
- type: 'boolean',
274
- filterable: true,
275
- filter: {
276
- collection: multiSelectFilterArray,
277
- collectionFilterBy: [{
278
- property: 'value',
279
- operator: OperatorType.notEqual, // remove day 1
280
- value: 1
281
- }, {
282
- property: 'value',
283
- operator: OperatorType.notEqual, // remove day 365
284
- value: 365
285
- }],
286
- model: Filters.multipleSelect
287
- }
288
- }
289
- ];
290
- ```
291
- However please note that by default the `collectionFilterBy` will **not** merge the result after each pass, it will instead chain them and use the new returned collection after each pass (which means that if original collection is 100 items and 20 items are returned after 1st pass, then the 2nd pass will filter out of these 20 items and so on).
292
-
293
- What if you wanted to merge the results instead? Then in this case, you can change the `filterResultAfterEachPass` flag defined in `collectionOptions
294
-
295
- ```typescript
296
- this.columnDefinitions = [
297
- { id: 'duration', name: 'Duration', field: 'duration',
298
- filter: {
299
- collection: [yourCollection],
300
- collectionFilterBy: [
301
- // ...
302
- ],
303
- collectionOptions: {
304
- filterResultAfterEachPass: 'chain' // options are "merge" or "chain" (defaults to "chain")
305
- },
306
- model: Filters.multipleSelect
307
- }
308
- }
309
- ];
310
- ```
311
-
312
- #### LabelPrefix / LabelSuffix
313
- `labelPrefix` and `labelSuffix` were recently added, they are also supported by the `customStructure` and can also be overridden. See [Collection Label Prefix/Suffix](#collection-label-prefixsuffix)
314
-
315
- ### Custom Structure with Translation
316
- What if you want to use `customStructure` and translate the labels? Simply pass the flag `enableTranslateLabel: true`
317
-
318
- ```typescript
319
- // define you columns, in this demo Effort Driven will use a Select Filter
320
- this.columnDefinitions = [
321
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
322
- formatter: Formatters.checkmarkMaterial,
323
- type: 'boolean',
324
- filterable: true,
325
- filter: {
326
- collection: [
327
- { customValue: '', customLabel: '' },
328
- { customValue: true, customLabel: 'TRUE' },
329
- { customValue: false, customLabel: 'FALSE' }
330
- ],
331
- customStructure: {
332
- label: 'customLabel',
333
- value: 'customValue'
334
- },
335
- enableTranslateLabel: true,
336
- model: Filters.multipleSelect,
337
- }
338
- ];
339
- ```
340
-
341
- ### Collection FilterBy/SortBy
342
- You can also pre-sort or pre-filter the collection given to the multipleSelect/singleSelect Filters. Also note that if the `enableTranslateLabel` flag is set to `True`, it will use the translated value to filter or sort the collection. For example:
343
- ```typescript
344
- // define you columns, in this demo Effort Driven will use a Select Filter
345
- this.columnDefinitions = [
346
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
347
- formatter: Formatters.checkmarkMaterial,
348
- type: 'boolean',
349
- filterable: true,
350
- filter: {
351
- collection: [
352
- { value: '', label: '' },
353
- { value: true, label: 'true' },
354
- { value: false, label: 'false' },
355
- { value: undefined, label: 'undefined' }
356
- ],
357
- collectionFilterBy: {
358
- property: 'effortDriven',
359
- operator: OperatorType.equal, // defaults to equal when not provided
360
- value: undefined
361
- },
362
- collectionSortBy: {
363
- property: 'effortDriven', // will sort by translated value since "enableTranslateLabel" is true
364
- sortDesc: false, // defaults to "false" when not provided
365
- fieldType: 'boolean' // defaults to 'string' when not provided
366
- },
367
- model: Filters.multipleSelect
368
- }
369
- ];
370
- ```
371
-
372
- ### Collection Label Prefix/Suffix
373
- You can use `labelPrefix` and/or `labelSuffix` which will concatenate the multiple properties together (`labelPrefix` + `label` + `labelSuffix`) which will used by each Select Filter option label. You can also use the property `separatorBetweenTextLabels` to define a separator between prefix, label & suffix.
374
-
375
- **Note**
376
- If `enableTranslateLabel` flag is set to `True`, it will also try to translate the Prefix / Suffix / OptionLabel texts.
377
-
378
- For example, say you have this collection
379
- ```typescript
380
- const currencies = [
381
- { symbol: '$', currency: 'USD', country: 'USA' },
382
- { symbol: '$', currency: 'CAD', country: 'Canada' }
383
- ];
384
- ```
385
-
386
- You can display all of these properties inside your dropdown labels, say you want to show (symbol with abbreviation and country name). Now you can.
387
-
388
- So you can create the `multipleSelect` Filter with a `customStructure` by using the symbol as prefix, and country as suffix. That would make up something like this:
389
- - $ USD USA
390
- - $ CAD Canada
391
-
392
- with a `customStructure` defined as
393
- ```typescript
394
- filter: {
395
- collection: this.currencies,
396
- customStructure: {
397
- value: 'currency',
398
- label: 'currency',
399
- labelPrefix: 'symbol',
400
- labelSuffix: 'country',
401
- },
402
- collectionOptions: {
403
- separatorBetweenTextLabels: ' ' // add white space between each text
404
- },
405
- model: Filters.multipleSelect
406
- }
407
- ```
408
-
409
-
410
- ### Collection Label Render HTML
411
- 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.
412
-
413
- **NOTE:** this is currently only used by the Filters that have a `collection` which are the `MultipleSelect` & `SingleSelect` Filters.
414
-
415
- ```typescript
416
- this.columnDefinitions = [
417
- {
418
- id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
419
- formatter: Formatters.checkmarkMaterial,
420
- type: 'boolean',
421
- filterable: true,
422
- filter: {
423
- // display checkmark icon when True
424
- enableRenderHtml: true,
425
- collection: [{ value: '', label: '' }, { value: true, label: 'True', labelPrefix: `<i class="mdi mdi-check"></i> ` }, { value: false, label: 'False' }],
426
- model: Filters.singleSelect
427
- }
428
- }
429
- ];
430
- ```
431
-
432
- ### Collection Add Blank Entry
433
- In some cases a blank entry at the beginning of the collection could be useful, the most common example for this is to use the first option as a blank entry to tell our Filter to show everything. So for that we can use the `addBlankEntry` flag in `collectionOptions
434
-
435
- ```typescript
436
- this.columnDefinitions = [
437
- { id: 'duration', name: 'Duration', field: 'duration',
438
- filter: {
439
- collection: [yourCollection],
440
- collectionOptions: {
441
- addBlankEntry: true
442
- },
443
- model: Filters.multipleSelect
444
- }
445
- }
446
- ];
447
- ```
448
-
449
- ### Collection Add Custom Entry at the Beginning/End of the Collection
450
- We can optionally add a custom entry at the beginning of the collection, the most common example for this is to use the first option as a blank entry to tell our Filter to show everything. So for that we can use the `addCustomFirstEntry` or `addCustomLastEntry` flag in `collectionOptions
451
-
452
- ```typescript
453
- this.columnDefinitions = [
454
- { id: 'duration', name: 'Duration', field: 'duration',
455
- filter: {
456
- collection: [yourCollection],
457
- collectionOptions: {
458
- addCustomFirstEntry: { value: '', label: '--n/a--' }
459
-
460
- // or at the end
461
- addCustomLastEntry: { value: 'end', label: 'end' }
462
- },
463
- model: Filters.multipleSelect
464
- }
465
- }
466
- ];
467
- ```
468
-
469
- ### Collection Async Load
470
- You can also load the collection asynchronously, but for that you will have to use the `collectionAsync` property, which expect either a Promise or an Observable to be provided.
471
-
472
- #### Load the collection through an Http call
473
-
474
- ```ts
475
- this.columnDefinitions = [
476
- {
477
- id: 'prerequisites', name: 'Prerequisites', field: 'prerequisites',
478
- filterable: true,
479
- filter: {
480
- collectionAsync: this.http.fetch('api/data/pre-requisites'),
481
- model: Filters.multipleSelect,
482
- }
483
- }
484
- ];
485
- ```
486
-
487
- #### Using Async Load when Collection is inside an Object Property
488
- What if my collection is nested under the response object? For that you can use `collectionInsideObjectProperty` to let the filter know how to get the collection.
489
-
490
- ```ts
491
- this.columnDefinitions = [
492
- {
493
- id: 'prerequisites', name: 'Prerequisites', field: 'prerequisites',
494
- filterable: true,
495
- filter: {
496
- model: Filters.multipleSelect,
497
-
498
- // this async call will return the collection inside the response object in this format
499
- // { data: { myCollection: [ /*...*/ ] } }
500
- collectionAsync: this.http.fetch('api/data/pre-requisites'),
501
- collectionOptions: {
502
- collectionInsideObjectProperty: 'data.myCollection' // with/without dot notation
503
- }
504
- }
505
- }
506
- ];
507
- ```
508
-
509
- #### Modifying the collection afterward
510
- If you want to modify the `collection` afterward, you simply need to find the associated Column reference from the Column Definition and modify the `collection` property (not `collectionAsync` since that is only meant to be used on page load).
511
-
512
- For example
513
- ```ts
514
- addItem() {
515
- const lastRowIndex = this.dataset.length;
516
- const newRows = this.mockData(1, lastRowIndex);
517
-
518
- // wrap into a timer to simulate a backend async call
519
- setTimeout(() => {
520
- const requisiteColumnDef = this.columnDefinitions.find((column: Column) => column.id === 'prerequisites');
521
- if (requisiteColumnDef) {
522
- const filterCollection = requisiteColumnDef.filter.collection;
523
-
524
- if (Array.isArray(collectionFilterAsync)) {
525
- // add the new row to the grid
526
- this.angularGrid.gridService.addItemToDatagrid(newRows[0]);
527
-
528
- // then refresh the Filter "collection", we have 2 ways of doing it
529
-
530
- // 1- Push to the Filter "collection"
531
- filterCollection.push({ value: lastRowIndex, label: lastRowIndex, prefix: 'Task' });
532
-
533
- // or 2- replace the entire "collection"
534
- filterCollection = [...collection, ...[{ value: lastRowIndex, label: lastRowIndex }]];
535
- }
536
- }
537
- }, 250);
538
- }
539
- ```
540
-
541
- ### Collection Lazy Load
542
- In some cases, you might have a grid with a lot of columns and loading the collection only after opening the select dropdown (or never in some cases) might help speeding up the initial grid loading. So for that use case, defining a `collectionLazy` callback can help.
543
-
544
- #### Load the collection through an Http callback
545
-
546
- ```ts
547
- this.columnDefinitions = [
548
- {
549
- id: 'prerequisites', name: 'Prerequisites', field: 'prerequisites',
550
- filterable: true,
551
- filter: {
552
- collectionLazy: (col: Column) => this.http.fetch('api/data/pre-requisites'),
553
- model: Filters.multipleSelect,
554
- }
555
- }
556
- ];
557
- ```
558
-
559
- ### Collection Watch
560
- We can enable the collection watch via the column filter `enableCollectionWatch` flag, or if you use a `collectionAsync` then this will be enabled by default. The collection watch will basically watch for any changes applied to the collection (any mutation changes like `push`, `pop`, `unshift`, ...) and will also watch for the `filter.collection` array replace, when any changes happens then it will re-render the Select Filter with the updated collection list.
561
-
562
- ```ts
563
- this.columnDefinitions = [
564
- {
565
- id: 'title', name: 'Title', field: 'title',
566
- filterable: true,
567
- filter: {
568
- collection: [ /* ... */ ],
569
- model: Filters.singleSelect,
570
- enableCollectionWatch: true,
571
- }
572
- }
573
- ];
574
- ```
575
-
576
- ### Filter Options (`MultipleSelectOption` interface)
577
- All the available options that can be provided as filter `options` to your column definitions can be found under this [multipleSelectOption interface](/ghiscoding/slickgrid-universal/tree/master/packages/common/src/interfaces/multipleSelectOption.interface.ts) and you should cast your filter `options` to that interface to make sure that you use only valid options of the `multiple-select.js` library.
578
-
579
- ```ts
580
- filter: {
581
- model: Filters.singleSelect,
582
- // previously known as `filterOptions` for < 9.0
583
- options: {
584
- maxHeight: 400
585
- } as MultipleSelectOption
586
- }
587
- ```
588
-
589
- #### Grid Option `defaultFilterOptions
590
- 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
591
- ```ts
592
- this.gridOptions = {
593
- defaultFilterOptions: {
594
- // Note: that `select` combines both multipleSelect & singleSelect
595
- select: { minHeight: 350 }, // typed as MultipleSelectOption
596
- }
597
- }
598
- ```
599
-
600
- ### Multiple-select.js Options
601
- You can use any options from [Multiple-Select.js](http://wenzhixin.net.cn/p/multiple-select) and add them to your filter `options` property. However please note that this is a customized version of the original (all original [lib options](http://wenzhixin.net.cn/p/multiple-select/docs/) are available so you can still consult the original site for all options).
602
-
603
- Couple of small options were added to suit SlickGrid-Universal needs, which is why we are using a fork [ghiscoding/multiple-select-modified](https://github.com/ghiscoding/multiple-select-modified) folder (which is our customized version of the original). This lib is required if you plan to use `multipleSelect` or `singleSelect` Filters. What was customized to (compare to the original) is the following:
604
- - `okButton` option was added to add an OK button for simpler closing of the dropdown after selecting multiple options.
605
- - `okButtonText` was also added for locale (i18n)
606
- - `offsetLeft` option was added to make it possible to offset the dropdown. By default it is set to 0 and is aligned to the left of the select element. This option is particularly helpful when used as the last right column, not to fall off the screen.
607
- - `autoDropWidth` option was added to automatically resize the dropdown with the same width as the select filter element.
608
- - `autoAdjustDropHeight` (defaults to true), when set will automatically adjust the drop (up or down) height
609
- - `autoAdjustDropPosition` (defaults to true), when set will automatically calculate the area with the most available space and use best possible choise for the drop to show (up or down)
610
- - `autoAdjustDropWidthByTextSize` (defaults to true), when set will automatically adjust the drop (up or down) width by the text size (it will use largest text width)
611
- - to extend the previous 3 autoAdjustX flags, the following options can be helpful
612
- - `minWidth` (defaults to null, to use when `autoAdjustDropWidthByTextSize` is enabled)
613
- - `maxWidth` (defaults to 500, to use when `autoAdjustDropWidthByTextSize` is enabled)
614
- - `adjustHeightPadding` (defaults to 10, to use when `autoAdjustDropHeight` is enabled), when using `autoAdjustDropHeight` we might want to add a bottom (or top) padding instead of taking the entire available space
615
- - `maxHeight` (defaults to 275, to use when `autoAdjustDropHeight` is enabled)
616
- - useSelectOptionLabel` to show different selected label text (on the input select element itself)
617
- - `useSelectOptionLabelToHtml` is also available if you wish to render label text as HTML for these to work, you have define the `optionLabel` in the `customStructure`
618
-
619
- ##### Code
620
- ```typescript
621
- this.columnDefinitions = [
622
- {
623
- id: 'isActive', name: 'Is Active', field: 'isActive',
624
- filterable: true,
625
- filter: {
626
- collection: [{ value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' }],
627
- model: Filters.singleSelect,
628
- // previously known as `filterOptions` for < 9.0
629
- options: {
630
- // add any multiple-select.js options (from original or custom version)
631
- autoAdjustDropPosition: false, // by default set to True, but you can disable it
632
- position: 'top'
633
- } as MultipleSelectOption
634
- }
635
- }
636
- ];
637
- ```
638
-
639
- #### Display shorter selected label text
640
- If we find that our text shown as selected text is too wide, we can choose change that by using `optionLabel` in Custom Structure.
641
- ```typescript
642
- this.columnDefinitions = [
643
- {
644
- id: 'isActive', name: 'Is Active', field: 'isActive',
645
- filterable: true,
646
- filter: {
647
- collection: [
648
- { value: 1, label: '1', suffix: 'day' },
649
- { value: 2, label: '2', suffix: 'days' },
650
- { value: 3, label: '3', suffix: 'days' },
651
- // ...
652
- ],
653
- model: Filters.multipleSelect,
654
- customStructure: {
655
- label: 'label',
656
- labelSuffix: 'suffix',
657
- value: 'value',
658
- optionLabel: 'value', // use value instead to show "1, 2" instead of "1 day, 2 days"
659
- },
660
- options: {
661
- // use different label to show as selected text
662
- // please note the Custom Structure with optionLabel defined
663
- // or use "useSelectOptionLabelToHtml" to render HTML
664
- useSelectOptionLabel: true
665
- } as MultipleSelectOption
666
- }
667
- }
668
- ];
669
- ```
670
-
671
- ### Query against another field property
672
- What if your grid is displaying a certain `field` but you wish to query against another field? Well you could do that with 1 of the following 3 options:
673
- - `queryField` (query on a specific field for both the Filter and Sort)
674
- - `queryFieldFilter` (query on a specific field for only the Filter)
675
- - `queryFieldSorter` (query on a specific field for only the Sort)
676
-
677
- ##### Example
678
- ```ts
679
- this.columnDefinitions = [
680
- {
681
- id: 'salesRepName',
682
- field: 'salesRepName', // display in Grid the sales rep name with "field"
683
- queryFieldFilter: 'salesRepId', // but query against a different field for our multi-select to work
684
- filterable: true,
685
- filter: {
686
- collection: this.salesRepList, // an array of Sales Rep
687
- model: Filters.multipleSelect,
688
- customStructure: {
689
- label: 'salesRepName',
690
- value: 'salesRepId'
691
- }
692
- }
693
- }
694
- ];
695
- ```