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,77 +0,0 @@
1
- #### Index
2
- - [Update Filters Dynamically](input-filter.md#update-filters-dynamically)
3
- - [Custom Filter Predicate](input-filter.md#custom-filter-predicate)
4
-
5
- ### Description
6
- Some users might want to have 1 main single search for filtering the grid data instead of using multiple column filters. You can see a demo of that below
7
-
8
- ### Code Sample
9
- #### View
10
- ```html
11
- <angular-slickgrid gridId="grid23" [columns]="columnDefinitions" [options]="gridOptions"
12
- [dataset]="dataset" (onAngularGridCreated)="angularGridReady($event.detail)">
13
- </angular-slickgrid>
14
-
15
- <form class="form-inline">
16
- <div class="form-group">
17
- <label>Single Search: </label>
18
- <select class="form-control" name="selectedColumn" [(ngModel)]="selectedColumn"
19
- (ngModelChange)="updateFilter()">
20
- <option [ngValue]="field" *ngFor="let field of columnDefinitions">{{field.name}}</option>
21
- </select>
22
- <select class="form-control" name="selectedOperator" [(ngModel)]="selectedOperator"
23
- (ngModelChange)="updateFilter()">
24
- <option [ngValue]="operator" *ngFor="let operator of operatorList">{{operator}}</option>
25
- </select>
26
-
27
- <input type="text" class="form-control" name="searchValue" placeholder="search value" autocomplete="off"
28
- (input)="updateFilter()" [(ngModel)]="searchValue">
29
- </div>
30
- </form>
31
- ```
32
-
33
- ##### ViewModel
34
- ```ts
35
- export class MyComponent {
36
- angularGrid: AngularGridInstance;
37
- grid: any;
38
- dataView: any;
39
- columnDefinitions: Column[];
40
- gridOptions: GridOption;
41
- dataset: any[];
42
- operatorList: OperatorString[] = ['=', '<', '<=', '>', '>=', '<>'];
43
- selectedOperator = '=';
44
- searchValue = '';
45
- selectedColumn: Column;
46
-
47
- angularGridReady(angularGrid: AngularGridInstance) {
48
- this.angularGrid = angularGrid;
49
- }
50
-
51
- updateFilter() {
52
- if (this.selectedColumn && this.selectedOperator) {
53
- const fieldName = this.selectedColumn.field;
54
- const filter = {};
55
- const filterArg: FilterCallbackArg = {
56
- columnDef: this.selectedColumn,
57
- operator: this.selectedOperator as OperatorString, // or fix one yourself like '='
58
- searchTerms: [this.searchValue || '']
59
- };
60
-
61
- if (this.searchValue) {
62
- // pass a columnFilter object as an object which it's property name must be a column field name (e.g.: 'duration': {...} )
63
- filter[fieldName] = filterArg;
64
- }
65
-
66
- this.angularGrid.dataView.setFilterArgs({
67
- columnFilters: filter,
68
- grid: this.angularGrid.slickGrid
69
- });
70
- this.angularGrid.dataView.refresh();
71
- }
72
- }
73
- }
74
- ```
75
-
76
- ## Sample
77
- ![2019-04-16_15-42-05](https://user-images.githubusercontent.com/643976/56239148-3b530680-605e-11e9-99a2-e9a163abdd0c.gif)
@@ -1,45 +0,0 @@
1
- You can style any (or all) of the Filter(s) when they have value, the lib will automatically add a `filled` CSS class which you can style as you see fit. There is no style by default, if you wish to add styling, you will be required to add your own.
2
-
3
- ## Styled Example
4
- ![grid_filled_styling](https://user-images.githubusercontent.com/643976/51334569-14306d00-1a4e-11e9-816c-439796eb8a59.png)
5
-
6
- ## Code example
7
- For example, the print screen shown earlier was styled using this piece of SASS (`.scss`) code. You can customize the styling to your liking.
8
-
9
- ```scss
10
- $slick-filled-filter-color: $slick-form-control-focus-border-color;
11
- $slick-filled-filter-border: $slick-form-control-border;
12
- $slick-filled-filter-box-shadow: $slick-form-control-focus-border-color;
13
- $slick-filled-filter-font-weight: 400;
14
-
15
- .slick-headerrow {
16
- input.search-filter.filled,
17
- .search-filter.filled input,
18
- .search-filter.filled .date-picker input,
19
- .search-filter.filled .input-group-addon.slider-value,
20
- .search-filter.filled .input-group-addon.slider-range-value,
21
- .search-filter.filled .input-group-addon select {
22
- color: $slick-filled-filter-color;
23
- font-weight: $slick-filled-filter-font-weight;
24
- border: $slick-filled-filter-border;
25
- box-shadow: $slick-filled-filter-box-shadow;
26
- &.input-group-prepend {
27
- border-right: 0;
28
- }
29
- &.input-group-append {
30
- border-left: 0;
31
- }
32
- }
33
- .search-filter.filled .input-group-prepend select {
34
- border-right: 0;
35
- }
36
- .search-filter.filled .ms-choice {
37
- box-shadow: $slick-filled-filter-box-shadow;
38
- border:$slick-filled-filter-border;
39
- span {
40
- font-weight: $slick-filled-filter-font-weight;
41
- color: $slick-filled-filter-color;
42
- }
43
- }
44
- }
45
- ```
@@ -1,325 +0,0 @@
1
- # Formatters
2
-
3
- #### Index
4
-
5
- * [Built-in Formatter](#list-of-provided-formatters)
6
- * [Extra Params/Arguments](#extra-argumentsparams)
7
- * [Using Multiple Formatters](#using-multiple-formatters)
8
- * [Custom Formatter](#custom-formatter)
9
- - [Example of a Custom Formatter with HTML string](#example-of-a-custom-formatter-with-html-string)
10
- - [Example with `FormatterResultObject` instead of a string](#example-with-formatterresultobject-instead-of-a-string)
11
- - [Example of Custom Formatter with Native DOM Element](#example-of-custom-formatter-with-native-dom-element)
12
- * [Common Formatter Options](#common-formatter-options)
13
- * [PostRenderer Formatter](#postrender-formatter)
14
-
15
- #### Definition
16
-
17
- `Formatters` are functions that can be used to change and format certain column(s) in the grid. Please note that it does not alter the input data, it simply changes the styling by formatting the data differently to the screen (what the user visually see).
18
-
19
- A good example of a `Formatter` could be a timestamp or a `Date` object that we could format differently in the grid, for example using `Formatters.dateIso` or `Formatters.dateUs` which is more human readable.
20
-
21
- #### Provided Formatters
22
-
23
- `Slickgrid-Universal` ships with a few `Formatters` by default which helps with common fields, you can see the [entire list here](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/formatters/index.ts#L37).
24
-
25
- > **Note** you might not need a Formatter when simple CSS styling and class might be enough, think about using `cssClass` column property as much as possible since it has much better perf.
26
- > For example: `{ cssClass: 'text-right' }` on your column definition (or any other class) to align on the right.
27
-
28
- **List of provided `Formatters`**
29
-
30
- * `Formatters.arrayObjectToCsv`: Takes an array of complex objects and converts it to a comma delimited string.
31
- * you also need to pass the property name(s) for the complex object, i.e.: `formatter: Formatters.arrayObjectToCsv, params: { propertyNames: ['name'], useFormatterOuputToFilter: true }`
32
- * `Formatters.arrayToCsv` : takes an array of text and returns it as CSV string
33
- * `Formatters.checkmarkMaterial` will display a checkmark icon when value is truthy using Material Design icons
34
- * `Formatters.collection`: Looks up values from the columnDefinition.params.collection property and displays the label in CSV or string format
35
- * `Formatters.complexObject`: takes a complex object (with a `field` that has a `.` notation) and pull correct value, there are multiple ways to use it
36
- 1. `{ id: 'firstName', field: 'user.firstName', formatter: Formatters.complexObject}`, will display the user's first name
37
- 2. `{ id: 'firstName', field: 'user', labelKey: 'firstName', params: { complexField: 'user' }, ... }`
38
- 3. `{ id: 'firstName', field: 'user', params: { complexField: 'user.firstName' }, ... }`
39
- * `Formatters.currency`: will help with currency other than dollar (ie `€`), there are multiple `params` available for this formatter
40
- * `currencyPrefix`, `currencySuffix`, `minDecimal`, `maxDecimal`, `numberPrefix`, `numberSuffix`, `decimalSeparator`, `thousandSeparator` and `displayNegativeNumberWithParentheses`
41
- * the distinction between `numberPrefix` and `currencyPrefix` can be seen when using `displayNegativeNumberWithParentheses`, for example if we have a value of `-12.432` with the `Formatters.currency` and `params: { currencyPrefix: '€', numberPrefix: 'Price ', numberSuffix: 'EUR' }` the output will be `"Price (€12.432) EUR"`
42
- * `Formatters.dateEuro`: Takes a Date object and displays it as an Euro Date format (DD/MM/YYYY)
43
- * `Formatters.dateTimeEuro`: Takes a Date object and displays it as an Euro Date+Time format (DD/MM/YYYY HH:mm:ss)
44
- * `Formatters.dateTimeShortEuro`: Takes a Date object and displays it as an Euro Date+Time (without seconds) format (DD/MM/YYYY HH:mm)
45
- * `Formatters.dateTimeEuroAmPm`: Takes a Date object and displays it as an Euro Date+Time+(am/pm) format (DD/MM/YYYY hh:mm:ss a)
46
- * `Formatters.dateIso` : Takes a Date object and displays it as an ISO Date format (YYYY-MM-DD)
47
- * `Formatters.dateTimeIso` : Takes a Date object and displays it as an ISO Date+Time format (YYYY-MM-DD HH:mm:ss)
48
- * `Formatters.dateTimeIsoAmPm` : Takes a Date object and displays it as an ISO Date+Time+(am/pm) format (YYYY-MM-DD h:mm:ss a)
49
- * `Formatters.dateTimeShortIso`: Takes a Date object and displays it as an ISO Date+Time (without seconds) format (YYYY-MM-DD HH:mm)
50
- * `Formatters.dateUs` : Takes a Date object and displays it as an US Date format (MM/DD/YYYY)
51
- * `Formatters.dateTimeUs` : Takes a Date object and displays it as an US Date+Time format (MM/DD/YYYY HH:mm:ss)
52
- * `Formatters.dateTimeShortUs`: Takes a Date object and displays it as an US Date+Time (without seconds) format (MM/DD/YYYY HH:mm:ss)
53
- * `Formatters.dateTimeUsAmPm` : Takes a Date object and displays it as an US Date+Time+(am/pm) format (MM/DD/YYYY hh:mm:ss a)
54
- * `Formatters.dateUtc` : Takes a Date object and displays it as a TZ format (YYYY-MM-DDThh:mm:ssZ)
55
- * `Formatters.date`: Base Date Formatter, this formatter is a bit different compare to other date formatter since this one requires the user to provide a custom format in `params.dateFormat`
56
- - for example: `{ type: 'date', formatter: Formatters.date, params: { dateFormat: 'MMM DD, YYYY' }}`
57
- * `Formatters.decimal`: Display the value as x decimals formatted, defaults to 2 decimals. You can pass "minDecimal" and/or "maxDecimal" to the "params" property.
58
- * `Formatters.dollar`: Display the value as 2 decimals formatted with dollar sign '$' at the end of of the value.
59
- * `Formatters.dollarColored`: Display the value as 2 decimals formatted with dollar sign '$' at the end of of the value, change color of text to red/green on negative/positive value
60
- * `Formatters.dollarColoredBoldFormatter`: Display the value as 2 decimals formatted with dollar sign '$' at the end of of the value, change color of text to red/green on negative/positive value, show it in bold font weight as well
61
- * `Formatters.hyperlink`: takes a URL cell value and wraps it into a clickable hyperlink `<a href="value">value</a>`
62
- * the cell value **must contain** (`ftp://abc`, `http://abc` or `https://abc`), if it doesn't then use `fakeHyperlink`
63
- * `Formatters.hyperlinkUriPrefix`: format a URI prefix into an hyperlink
64
- * `Formatters.icon`: to display an icon with defined CSS class name, use `params` to pass a `cssClass` property
65
- * `Formatters.iconBoolean`: similar to `icon` but will only be displayed on a Boolean truthy value, use `params` to pass a `cssClass` property
66
- * `Formatters.mask`: to change the string output using a mask, use `params` to pass a `mask` property
67
- * example: `{ field: 'phone', formatter: Formatters.mask, params: { mask: '(000) 000-0000' }}`
68
- * `Formatters.multiple`: pipe multiple formatters (executed in sequence), use `params` to pass the list of formatters.
69
- * example: `{ field: 'title', formatter: Formatters.multiple, params: { formatters: [ Formatters.lowercase, Formatters.uppercase ] }`
70
- * `Formatters.percent`: Takes a cell value number (between 0.0-1.0) and displays a red (<50) or green (>=50) bar
71
- * `Formatters.percentComplete` : takes a percentage value (0-100%), displays a bar following this logic:
72
- * `red`: < 30%, `grey`: < 70%, `green`: >= 70%
73
- * `Formatters.percentCompleteBar` : same as `percentComplete` but uses [Bootstrap - Progress Bar with label](https://getbootstrap.com/docs/3.3/components/#progress-label).
74
- * `Formatters.percentCompleteBarWithText`: Takes a cell value number (between 0-100) and displays SlickGrid custom "percent-complete-bar" with Text a red (<30), silver (>30 & <70) or green (>=70) bar
75
- * `Formatters.percentSymbol`: Takes a cell value number (between 0-100) and add the "%" after the number
76
- * `Formatters.progressBar`: Takes a cell value number (between 0-100) and displays Bootstrap "progress-bar" a red (<30), silver (>30 & <70) or green (>=70) bar
77
- * `Formatters.translate`: Takes a cell value and translates it (i18n). Requires an instance of the Translate Service:: \`i18n: translate
78
- * `Formatters.translateBoolean`: Takes a boolean value, cast it to upperCase string and finally translates it (i18n).
79
- * `Formatters.tree`: Formatter that must be used when the column is a Tree Data column
80
-
81
- > **Note:** The list might not be up to date (especially for Dates), please refer to the [Formatters export](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/formatters/index.ts#L37) to know exactly which formatters are available.
82
-
83
- > **Note** all Date formatters are formatted using [Tempo](https://tempo.formkit.com/#format-tokens). There are also many more Date formats not shown above, simply visit the [formatters.index](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/formatters/formatters.index.ts#L101) to see all available Date/Time formats.
84
-
85
- ### Usage
86
- To use any of them, you simply need to import `Formatters` from `Slickgrid-Universal` and add a `formatter: Formatters.xyz` (where `xyx` is the name of the built-in formatter) in your column definitions as shown below:
87
-
88
- ```ts
89
- import { Formatters } from 'angular-slickgrid';
90
-
91
- export class GridBasicComponent implements OnInit {
92
- columnDefinitions: Column[];
93
- gridOptions: GridOption;
94
- dataset: any[];
95
-
96
- ngOnInit(): void {
97
- this.columnDefinitions = [
98
- { id: 'title', name: 'Title', field: 'title' },
99
- { id: 'duration', name: 'Duration (days)', field: 'duration' },
100
- { id: '%', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentComplete },
101
- { id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso },
102
- { id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso },
103
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: Formatters.checkmark }
104
- ];
105
- }
106
- }
107
- ```
108
-
109
- #### Extra Arguments/Params
110
-
111
- What if you want to pass extra arguments that you want to use within the Formatter? You can use `params` for that. For example, let say you have a custom formatter to build a select list (dropdown), you could do it this way:
112
-
113
- ```ts
114
- let optionList = ['True', 'False'];
115
-
116
- this.columnDefinitions = [
117
- { id: 'title', field: 'title',
118
- headerTranslate: 'TITLE',
119
- formatter: myCustomSelectFormatter,
120
- params: { options: optionList }
121
- },
122
- ```
123
-
124
- ### Using Multiple Formatters
125
-
126
- SlickGrid only has 1 `formatter` property but if you want to use more than 1 Formatter then you'll want to use the `Formatters.multiple` and pass every Formatters inside your column definition `params: { formatters: [] }` as shown below.
127
-
128
- **Note:** please note that combining multiple Formatters has the side effect of cascading the formatted `value` output to the next Formatter. So for example if you use the `complexObject` and `dollar` Formatters, you want to make sure to define them in the correct order in your `formatters: []` array as shown below.
129
-
130
- * what if you want to avoid overwriting the `value` with a Custom Formatter?
131
- * in that case you can have your Formatter return a [FormatterResultObject](#formatterresultobject), see below.
132
-
133
- ```ts
134
- // Data Example::
135
- // data = [{ shipping: { cost: 123.22, address: { zip: 123456 } } }];
136
-
137
- this.columnDefinitions = [
138
- {
139
- id: 'shippingCost', field: 'shipping.cost', name: 'Shipping Cost',
140
- formatter: Formatters.multiple,
141
- params: {
142
- // list of Formatters (the order is very important)
143
- formatters: [Formatters.complexObject, Formatters.dollar],
144
- }
145
- },
146
- ];
147
- ```
148
-
149
- ### Custom Formatter
150
-
151
- You could also create your own custom `Formatter` by simply following the structure shown below.
152
-
153
- #### TypeScript function signature
154
-
155
- ```ts
156
- export type Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any, grid?: any) => string | FormatterResultObject;
157
- ```
158
-
159
- #### FormatterResultObject
160
-
161
- The most common return result of a Formatter is a `string` but you could also use the `FormatterResultObject` which is an object with the interface signature shown below. The main difference is that it will allow to add CSS classes directly to the cell container instead of having to create an extra `<div>` container and since that is the main cell container, you can add multiple Formatters to add/remove multiple CSS classes on that same container.
162
-
163
- ```ts
164
- export interface FormatterResultObject {
165
- addClasses?: string;
166
- removeClasses?: string;
167
- text: string;
168
- toolTip?: string;
169
- }
170
- ```
171
-
172
- ### Example of a Custom Formatter with HTML string
173
-
174
- For example, we will use our optional SVG icons `.mdi` with a `boolean` as input data, and display a (fire) icon when `True` or a (snowflake) when `False`. This custom formatter is actually display in the [UI sample](#ui-sample) shown below.
175
- ```ts
176
- // create a custom Formatter with the Formatter type
177
- const myCustomCheckboxFormatter: Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any) =>
178
- value ? `<i class="mdi mdi-fire" aria-hidden="true"></i>` : '<i class="mdi mdi-snowflake" aria-hidden="true"></i>';
179
- ```
180
-
181
- #### Example with `FormatterResultObject` instead of a string
182
-
183
- Using this object return type will provide the user the same look and feel, it will actually be quite different. The major difference is that all of the options (`addClasses`, `tooltip`, ...) will be added the CSS container of the cell instead of the content of that container. For example a typically cell looks like the following `<div class="slick-cell l4 r4">Task 4</div>` and if use `addClasses: 'red'`, it will end up being `<div class="slick-cell l4 r4 red">Task 4</div>` while if we use a string output of let say `<span class="red">${value></span>`, then our final result of the cell will be `<div class="slick-cell l4 r4"><span class="red">Task 4</span></div>`. This can be useful if you plan to use multiple Formatters and don't want to lose or overwrite the previous Formatter result (we do that in our project).
184
-
185
- ```ts
186
- // create a custom Formatter and returning a string and/or an object of type FormatterResultObject
187
- const myCustomCheckboxFormatter: Formatter = (row: number, cell: number, value: any, columnDef: Column, dataContext: any, grid?: any) =>
188
- value ? { addClasses: 'mdi mdi-fire', text: '', tooltip: 'burning fire' } : '<i class="mdi mdi-snowflake" aria-hidden="true"></i>';
189
- ```
190
-
191
- ### Example of Custom Formatter with Native DOM Element
192
- Since version 4.x, you can now also return native DOM element instead of an HTML string. There are 2 main reasons for going with this approach:
193
- 1. CSP Safe by default, since it's native it is 100% CSP Safe (CSP: Content Security Policy)
194
- 2. Performance (the reasons are similar to point 1.)
195
- - since it's native it can be appended directly to the grid cell
196
- - when it's an HTML string, it has to do 2 extra steps (which is an overhead process)
197
- i. sanitize the string (when a sanitizer, for example [DOMPurify](https://github.com/cure53/DOMPurify))
198
- ii. SlickGrid then has to convert it to native element by using `innerHTML` on the grid cell
199
-
200
- Demo
201
- ```ts
202
- export const iconFormatter: Formatter = (_row, _cell, _value, columnDef) => {
203
- const iconElm = document.createElement('span');
204
- iconElm.className = 'mdi mdi-check';
205
-
206
- return iconElm;
207
- };
208
- ```
209
-
210
- > **Note** you could also use our helper `createDomElement` which allows to create a DOM element and pass properties like `className` in 1 liner (and it also works with intellisense). For example `createDomElement('span', { className: 'bold title', textContent: 'Hello World', title: 'some tooltip description' })` would equal to 4 lines of code.
211
-
212
- #### More Complex Example
213
-
214
- If you need to add more complex logic to a `Formatter`, you can take a look at the [percentCompleteBar](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/formatters/percentCompleteBarFormatter.ts) `Formatter` for more inspiration.
215
-
216
- ### Common Formatter Options
217
-
218
- You can set some defined common Formatter Options in your Grid Options through the `formatterOptions` in the Grid Options (locally or globally) as seen below, and/or independently through the column definition `params` (the option names are the same in both locations)
219
-
220
- ```ts
221
- loadGrid() {
222
- this.columnDefinitions = [
223
- // through the column definition "params"
224
- { id: 'price', field: 'price', params: { thousandSeparator: ',' } },
225
- ];
226
-
227
- // or through grid options to make it global
228
- this.gridOptions = {
229
- autoResize: {
230
- containerId: 'demo-container',
231
- sidePadding: 15
232
- },
233
- enableAutoResize: true,
234
-
235
- // you customize the date separator through "formatterOptions"
236
- formatterOptions: {
237
- // What separator to use to display a Date, for example using "." it could be "2002.01.01"
238
- dateSeparator: '/', // can be any of '/' | '-' | '.' | ' ' | ''
239
-
240
- // Defaults to dot ".", separator to use as the decimal separator, example $123.55 or $123,55
241
- decimalSeparator: ',', // can be any of '.' | ','
242
-
243
- // Defaults to false, option to display negative numbers wrapped in parentheses, example: -$12.50 becomes ($12.50)
244
- displayNegativeNumberWithParentheses: true,
245
-
246
- // Defaults to undefined, minimum number of decimals
247
- minDecimal: 2,
248
-
249
- // Defaults to undefined, maximum number of decimals
250
- maxDecimal: 4,
251
-
252
- // Defaults to undefined, add a prefix when using `Formatters.decimal` (only) which can be used for example to display a currency.
253
- // output: € 123.45'
254
- numberPrefix: '€ ',
255
-
256
- // Defaults to undefined, add a suffix when using `Formatters.decimal` (only) which can be used for example to display a currency.
257
- // output: '123.45 €'
258
- numberSuffix: ' €',
259
-
260
- // Defaults to empty string, thousand separator on a number. Example: 12345678 becomes 12,345,678
261
- thousandSeparator: '_', // can be any of ',' | '_' | ' ' | ''
262
- },
263
- }
264
- }
265
- ```
266
-
267
- ### Using Angular Component with `asyncPostRenderer`
268
-
269
- First of... Why can't we use Angular Component with Customer Formatters? Because of how Angular is built, it requires a full cycle for the component to be rendered with data, however SlickGrid Formatter requires only string output and it must be right away (synchronous) and Angular Component can only be returned in an async fashion (you could return it right away but the data won't be populated). That is the reason that it's not doable with a Formatter, however SlickGrid offers `asyncPostRender` which is similar to a Formatter and works in an async fashion. So that works, but it has some drawback, since it's async, it is slightly slower to render (you might visually see it rendering on the screen). All that to say, regular Formatters with jQuery and/or HTML is still the preferred way (at least to me)... but hey, if you really wish to use Angular Component, well then it's possible, just remember it's async though and slightly slower to render.
270
-
271
- Also note that the limitation that a Custom Formatters only accepts String comes from the core lib (SlickGrid) and there's nothing Angular-Slickgrid can change about that (or if you know how to overcome this issue then please create a PR), the only alternative, like I said earlier, is to use `asyncPostRender` with it's drawback (it's slightly slower to render).
272
-
273
- To avoid performance issues and memory leaks, it'd be preferable to use `asyncPostRenderCleanup`. When scrolling through your data, it allows Slickgrid to remove hidden lines' Angular Components. In your grid options, add `enableAsyncPostRenderCleanup: true` to activate it. Please note that it **doesn't** call `ngOnDestroy()`. If you want to, you can keep all Angular Component instances created in `asyncPostRender` and call the right instance's `destroy()` method in `asyncPostRenderCleanup`. The following implementation might add a heavy load on your RAM depending on the number of Angular component instances your grid needs.
274
-
275
- ```ts
276
- import { ComponentRef, Injectable } from '@angular/core';
277
- import { AngularComponentOutput, AngularUtilService, Column } from 'angular-slickgrid';
278
- import { MyCustomComponent } from 'my-custom-component/my-custom-component.component';
279
-
280
- export interface AngularCells {
281
- [id: string]: ComponentRef<any>
282
- }
283
-
284
- @Injectable()
285
- export class ColumnDefinitionsService {
286
- private _angularCells: AngularCells = {};
287
-
288
- constructor(private _angularUtilService: AngularUtilService) {}
289
-
290
- private _setColumnsConfiguration(columns: Column[]): void {
291
- columns.forEach(col => {
292
- col.asyncPostRender = this._renderAngularComponent.bind(this);
293
- col.asyncPostRenderCleanup = this._cleanupAngularComponent.bind(this);
294
- });
295
- }
296
-
297
- private _renderAngularComponent(cellNode: HTMLElement, row: number, dataContext: any, colDef: Column): void {
298
- const componentOutput: AngularComponentOutput = this._angularUtilService.createAngularComponent(MyCustomComponent );
299
- Object.assign(componentOutput.componentRef.instance, {
300
- [FILL YOUR INPUTS AND OUTPUTS HERE]
301
- myInput: row
302
- });
303
-
304
- const id: string = `${row}-${colDef.field}`; // Gives a unique id to each cell
305
- this._angularCells[id] = componentOutput.componentRef; // Assigns the component instance to the matching cell's id
306
- $(cellNode).empty();
307
- setTimeout(() => $(cellNode).html(componentOutput.domElement));
308
- }
309
-
310
- private _cleanupAngularComponent(cellNode: HTMLElement, row: number, colDef: Column): void {
311
- const id: string = `${row}-${colDef.field}`;
312
- const component: ComponentRef<any> = this._angularCells[id];
313
-
314
- component?.destroy();
315
- }
316
- }
317
- ```
318
-
319
- A **Better Solution** is to use Custom Formatters **as much as possible** because using an Angular Components with `asyncPostRender` are **SLOW** (you are warned). They are slow because they require a full cycle, cannot be cached and are rendered **after** each rows are rendered (because of their asynchronous nature), while Custom Formatters are rendered at the same time as the row itself since they are synchronous in nature.
320
-
321
- **Examples**
322
-
323
- * [Example 22](https://ghiscoding.github.io/Angular-Slickgrid/#/angular-components) | [Component](../../src/app/examples/grid-angular.component.ts) | [animated gif](https://user-images.githubusercontent.com/643976/53061045-87346580-348a-11e9-95f3-dfe33be6e966.gif)
324
-
325
- In the [animated gif](https://user-images.githubusercontent.com/643976/53061045-87346580-348a-11e9-95f3-dfe33be6e966.gif), you can see the 3rd column is using `asyncPostRender` and before it gets rendered we show 3 dots (...), and if you look carefully you can see them being rendered before the actual result, it's short but it is visible.
@@ -1,200 +0,0 @@
1
- #### Index
2
- - [Usage](#usage)
3
- - [Sorting Complex Objects](#how-to-sort-complex-objects)
4
- - [Custom Sort Comparer](#custom-sort-comparer)
5
- - [Update Sorting Dynamically](#update-sorting-dynamically)
6
- - [Dynamic Query Field](#dynamic-query-field)
7
- - [Sorting Dates](#sorting-dates)
8
- - [Pre-Parse Date Columns for better perf](#pre-parse-date-columns-for-better-perf)
9
-
10
- ### Demo
11
- [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)
12
-
13
- ### Description
14
- Sorting on the client side is really easy, you simply need to enable `sortable` (when not provided, it is considered as disabled) on each columns you want to sort and it will sort as a type string. Oh but wait, sorting as string might not always be ideal, what if we want to sort by number or by date? The answer is to simply pass a `type` as shown below.
15
-
16
- ### Usage
17
- To use any of them, you can use the `FieldType` interface or enter a type via a string as shown below. Also please note that `'string'` is the default and you don't necessarily need to define it, though you could if you wish to see it in your column definition.
18
-
19
- ```ts
20
- import { FieldType } from 'angular-slickgrid';
21
-
22
- export class GridBasicComponent implements OnInit {
23
- columnDefinitions: Column[];
24
- gridOptions: GridOption;
25
- dataset: any[];
26
-
27
- ngOnInit(): void {
28
- this.columnDefinitions = [
29
- { id: 'title', name: 'Title', field: 'title', sortable: true },
30
- { id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, type: 'number' },
31
- { id: '%', name: '% Complete', field: 'percentComplete', sortable: true, type: 'float'},
32
- { id: 'start', name: 'Start', field: 'start', sortable: true, type: 'dateIso' },
33
- { id: 'finish', name: 'Finish', field: 'finish', sortable: true, type: 'dateIso' },
34
- { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', sortable: true }
35
- ];
36
- }
37
- }
38
- ```
39
-
40
- ### How to Sort Complex Objects?
41
- You can sort complex objects using the dot (.) notation inside the `field` property defined in your Columns Definition.
42
-
43
- For example, let say that we have this dataset
44
- ```typescript
45
- const dataset = [
46
- { item: 'HP Desktop', buyer: { id: 1234, address: { street: '123 Belleville', zip: 123456 }} },
47
- { item: 'Lenovo Mouse', buyer: { id: 456, address: { street: '456 Hollywood blvd', zip: 789123 }} }
48
- ];
49
- ```
50
-
51
- We can now filter the zip code from the buyer's address using this filter:
52
- ```typescript
53
- this.columnDefinitions = [
54
- {
55
- // the zip is a property of a complex object which is under the "buyer" property
56
- // it will use the "field" property to explode (from "." notation) and find the child value
57
- id: 'zip', name: 'Zip Code', field: 'buyer.address.zip', sortable: true
58
- }
59
- // { id: 'street', ... },
60
- ];
61
- ```
62
-
63
- ### Custom Sort Comparer
64
- If the builtin sort comparer methods are not sufficient for your use case, you could add your own custom Sort Comparer in your Column Definitions as shown below. Note that we are only showing a simple numeric sort, just adjust it to your needs.
65
-
66
- ```ts
67
- this.columnDefinitions = [{
68
- id: 'myField', name: 'My Field',
69
- sorter: (a, b) => a > b ? 1 : -1,
70
- }];
71
- ```
72
-
73
- similarly with a complex object
74
-
75
- ```ts
76
- // data = { user: { firstName: 'John', lastName: 'Doe', fullName: 'John Doe' }, address: { zip: 123456 } }};
77
-
78
- this.columnDefinitions = [{
79
- id: 'firstName', name: 'First Name', field: 'user.firstName',
80
- sorter: (a, b) => a.fullName > b.fullName ? 1 : -1,
81
- }];
82
- ```
83
-
84
- ### Update Sorting Dynamically
85
- You can update/change the Sorting dynamically (on the fly) via the `updateSorting` method from the `SortService`. Note that calling this method will override all sorting (sorters) and replace them with the new array of sorters provided. For example, you could update the sorting from a button click or a select dropdown list with predefined filter set.
86
-
87
- ##### View
88
- ```html
89
- <button class="btn btn-default btn-sm" data-test="set-dynamic-sorting" (click)="setSortingDynamically()">
90
- Set Sorting Dynamically
91
- </button>
92
-
93
- <angular-slickgrid gridId="grid1"
94
- [columns]="columnDefinitions"
95
- [options]="gridOptions"
96
- [dataset]="dataset"
97
- (onAngularGridCreated)="angularGridReady($event.detail)">
98
- </angular-slickgrid>
99
- ```
100
-
101
- ##### Component
102
- ```ts
103
- export class Example {
104
- angularGrid: AngularGridInstance;
105
-
106
- angularGridReady(angularGrid: AngularGridInstance) {
107
- this.angularGrid = angularGrid;
108
- }
109
-
110
- setSortingDynamically() {
111
- this.angularGrid.sortService.updateSorting([
112
- // orders matter, whichever is first in array will be the first sorted column
113
- { columnId: 'duration', direction: 'ASC' },
114
- { columnId: 'start', direction: 'DESC' },
115
- ]);
116
- }
117
- }
118
- ```
119
-
120
- #### Extra Arguments
121
- The `updateSorting` method has 2 extra arguments:
122
- - 2nd argument, defaults to true, is to emit a sort changed event (the GridStateService uses this event)
123
- - optional and defaults to true `updateSorting([], true)`
124
- - 3rd argument is to trigger a backend query (when using a Backend Service like OData/GraphQL), this could be useful when using updateFilters & updateSorting and you wish to only send the backend query once.
125
- - optional and defaults to true `updateSorting([], true, true)`
126
-
127
- ### Dynamic Query Field
128
- What if you a field that you only know which field to query only at run time and depending on the item object (`dataContext`)?
129
- We can defined a `queryFieldNameGetterFn` callback that will be executed on each row when Filtering and/or Sorting.
130
- ```ts
131
- queryFieldNameGetterFn: (dataContext) => {
132
- // do your logic and return the field name will be queried
133
- // for example let say that we query "profitRatio" when we have a profit else we query "lossRatio"
134
- return dataContext.profit > 0 ? 'profitRatio' : 'lossRatio';
135
- },
136
- ```
137
-
138
- ### Sorting Dates
139
-
140
- Date sorting should work out of the box as long as you provide the correct column field type. Note that there are various field types that can be provided and they all do different things. For the Sorting to work properly, you need to make sure to use the correct type for Date parsing to work accordingly. Below is a list of column definition types that you can provide:
141
-
142
- - `type`: input/output of date fields, or in other words, parsing/formatting dates with the field `type` provided
143
- - `outputType`: when a `type` is provided for parsing (i.e. from your dataset), you could use a different `outputType` to format your date differently
144
- - `saveOutputType`: if you already have a `type` and an `outputType` but you wish to save your date (i.e. save to DB) in yet another format
145
-
146
- ### Pre-Parse Date Columns for better perf
147
- ##### requires v8.8.0 and higher
148
-
149
- Sorting very large dataset with dates can be extremely slow when dates formated date strings, the reason is because these strings need to first be parsed and converted to real JS Dates before the Sorting process can actually happen (i.e. US Date Format). However parsing a large dataset can be slow **and** to make it worst, a Sort will revisit the same items over and over which mean that the same date strings will have to be reparsed over and over (for example while trying to Sort a dataset of 100 items, I saw some items being revisit 10 times and I can only imagine that it is exponentially worst with a large dataset).
150
-
151
- So what can we do to make this faster with a more reasonable time? Well, we can simply pre-parse all date strings once and only once and convert them to JS Date objects. Then once we get Date objects, we'll simply read the UNIX timestamp which is what we need to Sort. The first pre-parse takes a bit of time and will be executed only on the first date column Sort (any sort afterward will read the pre-parsed Date objects).
152
-
153
- What perf do we get with pre-parsing versus regular non-parsing? The benchmark was pulled using 50K items with 2 date columns (with US date format)
154
- - without non-parsing: ~15sec
155
- - with pre-parsing: ~1.4sec (1st pre-parse) and any subsequent Date sort is about ~0.2sec => so about ~1.5sec total
156
-
157
- The summary, is that we get a 10x boost **but** not only that, we also get an extremely fast subsequent sort afterward (sorting Date objects is as fast as sorting Numbers).
158
-
159
- #### Usage
160
-
161
- You can use the `preParseDateColumns` grid option, it can be set as either a `boolean` or a `string` but there's a big distinction between the 2 approaches as shown below (note that both approaches will mutate the dataset).
162
- 1. `string` (i.e. set to `"__"`, it will parse a `"start"` date string and assign it as a `Date` object to a new `"__start"` prop)
163
- 2. `boolean` (i.e. parse `"start"` date string and reassign it as a `Date` object on the same `"start"` prop)
164
-
165
- > **Note** this option **does not work** with the Backend Service API because it simply has no effect.
166
-
167
- For example if our dataset has 2 columns named "start" and "finish", then pre-parse the dataset,
168
-
169
- with the 1nd approach (`string`), let's use `"__"` (which is in reality a prefix) it will mutate the dataset by adding new props (where `Date` is a `Date` object)
170
-
171
- ```diff
172
- data = [
173
- - { id: 0, start: '02/28/24', finish: '03/02/24' },
174
- - { id: 1, start: '01/14/24', finish: '02/13/24' },
175
- + { id: 0, start: '02/28/24', finish: '03/02/24', __start: Date, __finish: Date },
176
- + { id: 1, start: '01/14/24', finish: '02/13/24', __start: Date, __finish: Date },
177
- ]
178
- ```
179
-
180
- with the 2nd approach (`boolean`), it will instead mutate the dataset by overwriting the same properties
181
-
182
- ```diff
183
- data = [
184
- - { id: 0, start: '02/28/24', finish: '03/02/24' },
185
- - { id: 1, start: '01/14/24', finish: '02/13/24' },
186
- + { id: 0, start: Date, finish: Date },
187
- + { id: 1, start: Date, finish: Date },
188
- ]
189
- ```
190
-
191
- Which approach to choose? Both have pros and cons, overwriting the same props might cause problems with the column `type` that you use, you will have to give it a try yourself. On the other hand, with the other approach, it will duplicate all date properties and take a bit more memory usage and when changing cells we'll need to make sure to keep these props in sync, however you will likely have less `type` issues.
192
-
193
- What happens when we do any cell changes (for our use case, it would be Create/Update), for any Editors we simply subscribe to the `onCellChange` change event and we re-parse the date strings when detected. We also subscribe to certain CRUD functions as long as they come from the `GridService` then all is fine... However, if you use the DataView functions directly then we have no way of knowing when to parse because these functions from the DataView don't have any events. Lastly, if we overwrite the entire dataset, we will also detect this (via an internal flag) and the next time you sort a date then the pre-parse kicks in again.
194
-
195
- #### Can I call the pre-parse myself?
196
-
197
- Yes, if for example you want to pre-parse right after the grid is loaded, you could call the pre-parse yourself for either all items or a single item
198
- - all item pre-parsing: `this.sgb.sortService.preParseAllDateItems();`
199
- - the items will be read directly from the DataView
200
- - a single item parsing: `this.sgb.sortService.preParseSingleDateItem(item);`