angular-slickgrid 9.0.0 → 9.0.1

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 (394) hide show
  1. package/package.json +17 -4
  2. package/.gitbook.yaml +0 -5
  3. package/CHANGELOG.md +0 -1691
  4. package/CONTRIBUTING.md +0 -17
  5. package/angular.json +0 -133
  6. package/coverage/base.css +0 -224
  7. package/coverage/block-navigation.js +0 -87
  8. package/coverage/clover.xml +0 -1620
  9. package/coverage/coverage-final.json +0 -9
  10. package/coverage/favicon.png +0 -0
  11. package/coverage/index.html +0 -176
  12. package/coverage/library/components/angular-slickgrid.component.ts.html +0 -5074
  13. package/coverage/library/components/index.html +0 -116
  14. package/coverage/library/constants.ts.html +0 -397
  15. package/coverage/library/extensions/index.html +0 -116
  16. package/coverage/library/extensions/slickRowDetailView.ts.html +0 -1261
  17. package/coverage/library/index.html +0 -116
  18. package/coverage/library/modules/angular-slickgrid.module.ts.html +0 -166
  19. package/coverage/library/modules/index.html +0 -116
  20. package/coverage/library/services/angularUtil.service.ts.html +0 -445
  21. package/coverage/library/services/container.service.ts.html +0 -163
  22. package/coverage/library/services/index.html +0 -161
  23. package/coverage/library/services/translater.service.ts.html +0 -199
  24. package/coverage/library/services/utilities.ts.html +0 -142
  25. package/coverage/prettify.css +0 -1
  26. package/coverage/prettify.js +0 -2
  27. package/coverage/sort-arrow-sprite.png +0 -0
  28. package/coverage/sorter.js +0 -196
  29. package/dist/LICENSE +0 -21
  30. package/dist/README.md +0 -142
  31. package/docs/README.md +0 -5
  32. package/docs/TOC.md +0 -105
  33. package/docs/backend-services/Custom-Backend-Service.md +0 -50
  34. package/docs/backend-services/GraphQL.md +0 -276
  35. package/docs/backend-services/OData.md +0 -245
  36. package/docs/backend-services/graphql/GraphQL-Filtering.md +0 -156
  37. package/docs/backend-services/graphql/GraphQL-JSON-Result.md +0 -85
  38. package/docs/backend-services/graphql/GraphQL-Pagination.md +0 -77
  39. package/docs/backend-services/graphql/GraphQL-Sorting.md +0 -78
  40. package/docs/column-functionalities/cell-menu.md +0 -212
  41. package/docs/column-functionalities/editors/autocomplete-editor.md +0 -466
  42. package/docs/column-functionalities/editors/date-editor-flatpickr.md +0 -71
  43. package/docs/column-functionalities/editors/date-editor-vanilla-calendar.md +0 -91
  44. package/docs/column-functionalities/editors/longtext-editor-textarea.md +0 -80
  45. package/docs/column-functionalities/editors/select-dropdown-editor.md +0 -227
  46. package/docs/column-functionalities/editors.md +0 -604
  47. package/docs/column-functionalities/filters/autocomplete-filter.md +0 -183
  48. package/docs/column-functionalities/filters/compound-filters.md +0 -234
  49. package/docs/column-functionalities/filters/custom-filter.md +0 -117
  50. package/docs/column-functionalities/filters/filter-intro.md +0 -81
  51. package/docs/column-functionalities/filters/input-filter.md +0 -260
  52. package/docs/column-functionalities/filters/range-filters.md +0 -188
  53. package/docs/column-functionalities/filters/select-filter.md +0 -695
  54. package/docs/column-functionalities/filters/single-search-filter.md +0 -77
  55. package/docs/column-functionalities/filters/styling-filled-filters.md +0 -45
  56. package/docs/column-functionalities/formatters.md +0 -325
  57. package/docs/column-functionalities/sorting.md +0 -200
  58. package/docs/developer-guides/csp-compliance.md +0 -64
  59. package/docs/events/Available-Events.md +0 -223
  60. package/docs/events/Grid-&-DataView-Events.md +0 -211
  61. package/docs/getting-started/quick-start.md +0 -230
  62. package/docs/getting-started/troubleshooting.md +0 -80
  63. package/docs/grid-functionalities/Column-Picker.md +0 -22
  64. package/docs/grid-functionalities/Composite-Editor-Modal.md +0 -627
  65. package/docs/grid-functionalities/Context-Menu.md +0 -226
  66. package/docs/grid-functionalities/Custom-Footer.md +0 -80
  67. package/docs/grid-functionalities/Custom-Tooltip-(plugin).md +0 -258
  68. package/docs/grid-functionalities/Export-to-Excel.md +0 -457
  69. package/docs/grid-functionalities/Export-to-Text-File.md +0 -165
  70. package/docs/grid-functionalities/FAQ.md +0 -53
  71. package/docs/grid-functionalities/Global-Options.md +0 -29
  72. package/docs/grid-functionalities/Grid-Auto-Resize.md +0 -218
  73. package/docs/grid-functionalities/Grid-Menu.md +0 -134
  74. package/docs/grid-functionalities/Grid-State-&-Preset.md +0 -245
  75. package/docs/grid-functionalities/Header-Menu-&-Header-Buttons.md +0 -125
  76. package/docs/grid-functionalities/Resize-by-Cell-Content.md +0 -138
  77. package/docs/grid-functionalities/Row-Selection.md +0 -247
  78. package/docs/grid-functionalities/Row-based-edit.md +0 -71
  79. package/docs/grid-functionalities/add-update-highlight.md +0 -258
  80. package/docs/grid-functionalities/column-row-spanning.md +0 -74
  81. package/docs/grid-functionalities/dynamic-item-metadata.md +0 -124
  82. package/docs/grid-functionalities/excel-copy-buffer.md +0 -145
  83. package/docs/grid-functionalities/frozen-columns-rows.md +0 -164
  84. package/docs/grid-functionalities/grouping-and-aggregators.md +0 -269
  85. package/docs/grid-functionalities/header-footer-slots.md +0 -22
  86. package/docs/grid-functionalities/infinite-scroll.md +0 -150
  87. package/docs/grid-functionalities/providing-grid-data.md +0 -61
  88. package/docs/grid-functionalities/row-detail.md +0 -530
  89. package/docs/grid-functionalities/tree-data-grid.md +0 -391
  90. package/docs/localization/Localization---Component-Sample.md +0 -87
  91. package/docs/localization/Localization-with-Custom-Locales.md +0 -66
  92. package/docs/localization/Localization-with-ngx-translate.md +0 -148
  93. package/docs/migrations/migration-to-2.x.md +0 -304
  94. package/docs/migrations/migration-to-3.x.md +0 -295
  95. package/docs/migrations/migration-to-4.x.md +0 -83
  96. package/docs/migrations/migration-to-5.x.md +0 -160
  97. package/docs/migrations/migration-to-6.x.md +0 -128
  98. package/docs/migrations/migration-to-7.x.md +0 -294
  99. package/docs/migrations/migration-to-8.x.md +0 -316
  100. package/docs/migrations/migration-to-9.x.md +0 -219
  101. package/docs/slick-grid-dataview-objects/slickgrid-dataview-objects.md +0 -79
  102. package/docs/styling/dark-mode.md +0 -100
  103. package/docs/styling/styling.md +0 -250
  104. package/docs/testing/testing-patterns.md +0 -73
  105. package/eslint.config.mjs +0 -60
  106. package/ng-package.json +0 -10
  107. package/src/assets/angular-logo.png +0 -0
  108. package/src/assets/angular-logo2.png +0 -0
  109. package/src/assets/data/collection_100_numbers.json +0 -12
  110. package/src/assets/data/collection_500_numbers.json +0 -52
  111. package/src/assets/data/countries.json +0 -245
  112. package/src/assets/data/country_names.json +0 -245
  113. package/src/assets/data/customers_100.json +0 -102
  114. package/src/assets/data/users.csv +0 -5
  115. package/src/assets/i18n/en.json +0 -102
  116. package/src/assets/i18n/fr.json +0 -103
  117. package/src/demos/app-routing.module.ts +0 -108
  118. package/src/demos/app.component.html +0 -187
  119. package/src/demos/app.component.scss +0 -79
  120. package/src/demos/app.component.ts +0 -11
  121. package/src/demos/app.module.ts +0 -196
  122. package/src/demos/environments/environment.dev.ts +0 -3
  123. package/src/demos/environments/environment.prod.ts +0 -3
  124. package/src/demos/environments/environment.ts +0 -8
  125. package/src/demos/examples/custom-angularComponentEditor.ts +0 -187
  126. package/src/demos/examples/custom-angularComponentFilter.ts +0 -123
  127. package/src/demos/examples/custom-buttonFormatter.component.ts +0 -13
  128. package/src/demos/examples/custom-inputEditor.ts +0 -132
  129. package/src/demos/examples/custom-inputFilter.ts +0 -134
  130. package/src/demos/examples/custom-titleFormatter.component.ts +0 -9
  131. package/src/demos/examples/data/collection_100_numbers.json +0 -12
  132. package/src/demos/examples/data/collection_500_numbers.json +0 -52
  133. package/src/demos/examples/data/countries.json +0 -245
  134. package/src/demos/examples/data/country_names.json +0 -245
  135. package/src/demos/examples/data/customers_100.json +0 -102
  136. package/src/demos/examples/data/users.csv +0 -5
  137. package/src/demos/examples/editor-ng-select.component.ts +0 -38
  138. package/src/demos/examples/example01.component.html +0 -48
  139. package/src/demos/examples/example01.component.ts +0 -109
  140. package/src/demos/examples/example02.component.html +0 -45
  141. package/src/demos/examples/example02.component.ts +0 -218
  142. package/src/demos/examples/example03.component.html +0 -118
  143. package/src/demos/examples/example03.component.ts +0 -694
  144. package/src/demos/examples/example04.component.html +0 -87
  145. package/src/demos/examples/example04.component.ts +0 -326
  146. package/src/demos/examples/example05.component.html +0 -151
  147. package/src/demos/examples/example05.component.ts +0 -474
  148. package/src/demos/examples/example06.component.html +0 -163
  149. package/src/demos/examples/example06.component.ts +0 -446
  150. package/src/demos/examples/example07.component.html +0 -56
  151. package/src/demos/examples/example07.component.scss +0 -10
  152. package/src/demos/examples/example07.component.ts +0 -216
  153. package/src/demos/examples/example08.component.html +0 -51
  154. package/src/demos/examples/example08.component.scss +0 -23
  155. package/src/demos/examples/example08.component.ts +0 -195
  156. package/src/demos/examples/example09.component.html +0 -55
  157. package/src/demos/examples/example09.component.scss +0 -22
  158. package/src/demos/examples/example09.component.ts +0 -302
  159. package/src/demos/examples/example10.component.html +0 -103
  160. package/src/demos/examples/example10.component.ts +0 -309
  161. package/src/demos/examples/example11.component.html +0 -91
  162. package/src/demos/examples/example11.component.ts +0 -276
  163. package/src/demos/examples/example12.component.html +0 -98
  164. package/src/demos/examples/example12.component.ts +0 -317
  165. package/src/demos/examples/example13.component.html +0 -96
  166. package/src/demos/examples/example13.component.ts +0 -370
  167. package/src/demos/examples/example14.component.html +0 -50
  168. package/src/demos/examples/example14.component.scss +0 -11
  169. package/src/demos/examples/example14.component.ts +0 -156
  170. package/src/demos/examples/example15.component.html +0 -56
  171. package/src/demos/examples/example15.component.ts +0 -304
  172. package/src/demos/examples/example16.component.html +0 -77
  173. package/src/demos/examples/example16.component.ts +0 -277
  174. package/src/demos/examples/example17.component.html +0 -50
  175. package/src/demos/examples/example17.component.ts +0 -109
  176. package/src/demos/examples/example18.component.html +0 -132
  177. package/src/demos/examples/example18.component.ts +0 -445
  178. package/src/demos/examples/example19-rowdetail.component.html +0 -40
  179. package/src/demos/examples/example19-rowdetail.component.ts +0 -54
  180. package/src/demos/examples/example19.component.html +0 -79
  181. package/src/demos/examples/example19.component.ts +0 -316
  182. package/src/demos/examples/example20.component.html +0 -76
  183. package/src/demos/examples/example20.component.scss +0 -11
  184. package/src/demos/examples/example20.component.ts +0 -341
  185. package/src/demos/examples/example21.component.html +0 -86
  186. package/src/demos/examples/example21.component.scss +0 -16
  187. package/src/demos/examples/example21.component.ts +0 -140
  188. package/src/demos/examples/example22.component.html +0 -41
  189. package/src/demos/examples/example22.component.ts +0 -117
  190. package/src/demos/examples/example23.component.html +0 -111
  191. package/src/demos/examples/example23.component.ts +0 -323
  192. package/src/demos/examples/example24.component.html +0 -120
  193. package/src/demos/examples/example24.component.scss +0 -62
  194. package/src/demos/examples/example24.component.ts +0 -641
  195. package/src/demos/examples/example25.component.html +0 -60
  196. package/src/demos/examples/example25.component.scss +0 -8
  197. package/src/demos/examples/example25.component.ts +0 -255
  198. package/src/demos/examples/example26.component.html +0 -98
  199. package/src/demos/examples/example26.component.scss +0 -42
  200. package/src/demos/examples/example26.component.ts +0 -383
  201. package/src/demos/examples/example27.component.html +0 -138
  202. package/src/demos/examples/example27.component.scss +0 -10
  203. package/src/demos/examples/example27.component.ts +0 -369
  204. package/src/demos/examples/example28.component.html +0 -143
  205. package/src/demos/examples/example28.component.scss +0 -54
  206. package/src/demos/examples/example28.component.ts +0 -453
  207. package/src/demos/examples/example29.component.html +0 -30
  208. package/src/demos/examples/example29.component.ts +0 -70
  209. package/src/demos/examples/example30.component.html +0 -116
  210. package/src/demos/examples/example30.component.scss +0 -20
  211. package/src/demos/examples/example30.component.ts +0 -1070
  212. package/src/demos/examples/example32.component.html +0 -77
  213. package/src/demos/examples/example32.component.scss +0 -8
  214. package/src/demos/examples/example32.component.ts +0 -905
  215. package/src/demos/examples/example33.component.html +0 -50
  216. package/src/demos/examples/example33.component.scss +0 -46
  217. package/src/demos/examples/example33.component.ts +0 -571
  218. package/src/demos/examples/example34.component.html +0 -82
  219. package/src/demos/examples/example34.component.scss +0 -77
  220. package/src/demos/examples/example34.component.ts +0 -434
  221. package/src/demos/examples/example35.component.html +0 -77
  222. package/src/demos/examples/example35.component.scss +0 -18
  223. package/src/demos/examples/example35.component.ts +0 -264
  224. package/src/demos/examples/example36.component.html +0 -56
  225. package/src/demos/examples/example36.component.scss +0 -26
  226. package/src/demos/examples/example36.component.ts +0 -504
  227. package/src/demos/examples/example37.component.html +0 -30
  228. package/src/demos/examples/example37.component.ts +0 -123
  229. package/src/demos/examples/example38.component.html +0 -104
  230. package/src/demos/examples/example38.component.scss +0 -8
  231. package/src/demos/examples/example38.component.ts +0 -420
  232. package/src/demos/examples/example39.component.html +0 -112
  233. package/src/demos/examples/example39.component.scss +0 -8
  234. package/src/demos/examples/example39.component.ts +0 -371
  235. package/src/demos/examples/example40.component.html +0 -76
  236. package/src/demos/examples/example40.component.ts +0 -226
  237. package/src/demos/examples/example41.component.html +0 -50
  238. package/src/demos/examples/example41.component.scss +0 -42
  239. package/src/demos/examples/example41.component.ts +0 -229
  240. package/src/demos/examples/example42.component.html +0 -47
  241. package/src/demos/examples/example42.component.ts +0 -203
  242. package/src/demos/examples/example43.component.html +0 -94
  243. package/src/demos/examples/example43.component.scss +0 -30
  244. package/src/demos/examples/example43.component.ts +0 -449
  245. package/src/demos/examples/example44.component.html +0 -78
  246. package/src/demos/examples/example44.component.scss +0 -50
  247. package/src/demos/examples/example44.component.ts +0 -375
  248. package/src/demos/examples/example45-detail.component.html +0 -15
  249. package/src/demos/examples/example45-detail.component.ts +0 -97
  250. package/src/demos/examples/example45.component.html +0 -110
  251. package/src/demos/examples/example45.component.scss +0 -50
  252. package/src/demos/examples/example45.component.ts +0 -243
  253. package/src/demos/examples/filter-ng-select.component.ts +0 -33
  254. package/src/demos/examples/grid-custom-pager.component.html +0 -60
  255. package/src/demos/examples/grid-custom-pager.component.scss +0 -57
  256. package/src/demos/examples/grid-custom-pager.component.ts +0 -107
  257. package/src/demos/examples/grid-remote.component.html +0 -44
  258. package/src/demos/examples/grid-remote.component.ts +0 -164
  259. package/src/demos/examples/home.component.html +0 -39
  260. package/src/demos/examples/home.component.ts +0 -10
  261. package/src/demos/examples/jsonp.ts +0 -89
  262. package/src/demos/examples/rowdetail-preload.component.ts +0 -10
  263. package/src/demos/examples/swt-common-grid-pagination.component.ts +0 -160
  264. package/src/demos/examples/swt-common-grid-test.component.html +0 -37
  265. package/src/demos/examples/swt-common-grid-test.component.ts +0 -214
  266. package/src/demos/examples/swt-common-grid.component.ts +0 -436
  267. package/src/demos/examples/swt-logger.service.ts +0 -173
  268. package/src/demos/examples/utilities.ts +0 -9
  269. package/src/favicon.ico +0 -0
  270. package/src/index.html +0 -17
  271. package/src/library/components/__tests__/angular-slickgrid.component.spec.ts +0 -2638
  272. package/src/library/components/angular-slickgrid.component.html +0 -5
  273. package/src/library/components/angular-slickgrid.component.ts +0 -1662
  274. package/src/library/constants.ts +0 -105
  275. package/src/library/extensions/__tests__/slickRowDetailView.spec.ts +0 -751
  276. package/src/library/extensions/index.ts +0 -1
  277. package/src/library/extensions/slickRowDetailView.ts +0 -395
  278. package/src/library/global-grid-options.ts +0 -273
  279. package/src/library/index.ts +0 -11
  280. package/src/library/models/angularComponentOutput.interface.ts +0 -6
  281. package/src/library/models/angularGridInstance.interface.ts +0 -76
  282. package/src/library/models/externalTestingDependencies.interface.ts +0 -37
  283. package/src/library/models/gridOption.interface.ts +0 -15
  284. package/src/library/models/index.ts +0 -5
  285. package/src/library/models/rowDetailView.interface.ts +0 -16
  286. package/src/library/modules/angular-slickgrid.module.spec.ts +0 -25
  287. package/src/library/modules/angular-slickgrid.module.ts +0 -27
  288. package/src/library/services/__tests__/angularUtilService.spec.ts +0 -156
  289. package/src/library/services/__tests__/container.service.spec.ts +0 -25
  290. package/src/library/services/__tests__/translater.service.spec.ts +0 -43
  291. package/src/library/services/__tests__/utilities.spec.ts +0 -22
  292. package/src/library/services/angularUtil.service.ts +0 -120
  293. package/src/library/services/container.service.ts +0 -26
  294. package/src/library/services/index.ts +0 -4
  295. package/src/library/services/translater.service.ts +0 -38
  296. package/src/library/services/utilities.ts +0 -19
  297. package/src/library/slickgrid-config.ts +0 -10
  298. package/src/main.ts +0 -13
  299. package/src/public_api.ts +0 -1
  300. package/src/styles.scss +0 -178
  301. package/test/cypress/e2e/example01.cy.ts +0 -367
  302. package/test/cypress/e2e/example02.cy.ts +0 -60
  303. package/test/cypress/e2e/example03.cy.ts +0 -268
  304. package/test/cypress/e2e/example04.cy.ts +0 -254
  305. package/test/cypress/e2e/example05.cy.ts +0 -804
  306. package/test/cypress/e2e/example06.cy.ts +0 -890
  307. package/test/cypress/e2e/example07.cy.ts +0 -384
  308. package/test/cypress/e2e/example08.cy.ts +0 -190
  309. package/test/cypress/e2e/example09.cy.ts +0 -392
  310. package/test/cypress/e2e/example10.cy.ts +0 -650
  311. package/test/cypress/e2e/example11.cy.ts +0 -86
  312. package/test/cypress/e2e/example12.cy.ts +0 -269
  313. package/test/cypress/e2e/example13.cy.ts +0 -246
  314. package/test/cypress/e2e/example14.cy.ts +0 -122
  315. package/test/cypress/e2e/example15.cy.ts +0 -598
  316. package/test/cypress/e2e/example16.cy.ts +0 -427
  317. package/test/cypress/e2e/example17.cy.ts +0 -83
  318. package/test/cypress/e2e/example18.cy.ts +0 -431
  319. package/test/cypress/e2e/example19.cy.ts +0 -263
  320. package/test/cypress/e2e/example20.cy.ts +0 -264
  321. package/test/cypress/e2e/example21.cy.ts +0 -77
  322. package/test/cypress/e2e/example22.cy.ts +0 -94
  323. package/test/cypress/e2e/example23.cy.ts +0 -259
  324. package/test/cypress/e2e/example24.cy.ts +0 -707
  325. package/test/cypress/e2e/example25.cy.ts +0 -193
  326. package/test/cypress/e2e/example26.cy.ts +0 -111
  327. package/test/cypress/e2e/example27.cy.ts +0 -261
  328. package/test/cypress/e2e/example28.cy.ts +0 -740
  329. package/test/cypress/e2e/example29.cy.ts +0 -30
  330. package/test/cypress/e2e/example30.cy.ts +0 -757
  331. package/test/cypress/e2e/example31.cy.ts +0 -69
  332. package/test/cypress/e2e/example32.cy.ts +0 -272
  333. package/test/cypress/e2e/example33.cy.ts +0 -278
  334. package/test/cypress/e2e/example34.cy.ts +0 -84
  335. package/test/cypress/e2e/example35.cy.ts +0 -178
  336. package/test/cypress/e2e/example36.cy.ts +0 -219
  337. package/test/cypress/e2e/example37.cy.ts +0 -52
  338. package/test/cypress/e2e/example38.cy.ts +0 -160
  339. package/test/cypress/e2e/example39.cy.ts +0 -150
  340. package/test/cypress/e2e/example40.cy.ts +0 -126
  341. package/test/cypress/e2e/example41.cy.ts +0 -90
  342. package/test/cypress/e2e/example42.cy.ts +0 -82
  343. package/test/cypress/e2e/example43.cy.ts +0 -482
  344. package/test/cypress/e2e/example44.cy.ts +0 -458
  345. package/test/cypress/e2e/example45.cy.ts +0 -455
  346. package/test/cypress/e2e/home.cy.ts +0 -7
  347. package/test/cypress/fixtures/example.json +0 -5
  348. package/test/cypress/plugins/index.ts +0 -17
  349. package/test/cypress/plugins/utilities.ts +0 -28
  350. package/test/cypress/support/commands.ts +0 -88
  351. package/test/cypress/support/common.ts +0 -47
  352. package/test/cypress/support/drag.ts +0 -101
  353. package/test/cypress/support/index.ts +0 -20
  354. package/test/cypress/tsconfig.json +0 -9
  355. package/test/cypress.config.ts +0 -34
  356. package/test/mockSlickEvent.ts +0 -77
  357. package/test/rxjsResourceStub.ts +0 -69
  358. package/test/test-setup.ts +0 -6
  359. package/test/translateServiceStub.ts +0 -230
  360. package/test/translaterServiceStub.ts +0 -239
  361. package/test/tsconfig.json +0 -17
  362. package/test/vitest-global-mocks.ts +0 -41
  363. package/test/vitest-global-setup.ts +0 -3
  364. package/test/vitest-pretest.ts +0 -5
  365. package/tsconfig.app.json +0 -14
  366. package/tsconfig.json +0 -31
  367. package/tsconfig.spec.json +0 -11
  368. package/types/sortablejs.d.ts +0 -4
  369. package/vite.config.mts +0 -51
  370. /package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs +0 -0
  371. /package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs.map +0 -0
  372. /package/{dist/i18n → i18n}/en.json +0 -0
  373. /package/{dist/i18n → i18n}/fr.json +0 -0
  374. /package/{dist/index.d.ts → index.d.ts} +0 -0
  375. /package/{dist/library → library}/components/angular-slickgrid.component.d.ts +0 -0
  376. /package/{dist/library → library}/constants.d.ts +0 -0
  377. /package/{dist/library → library}/extensions/index.d.ts +0 -0
  378. /package/{dist/library → library}/extensions/slickRowDetailView.d.ts +0 -0
  379. /package/{dist/library → library}/global-grid-options.d.ts +0 -0
  380. /package/{dist/library → library}/index.d.ts +0 -0
  381. /package/{dist/library → library}/models/angularComponentOutput.interface.d.ts +0 -0
  382. /package/{dist/library → library}/models/angularGridInstance.interface.d.ts +0 -0
  383. /package/{dist/library → library}/models/externalTestingDependencies.interface.d.ts +0 -0
  384. /package/{dist/library → library}/models/gridOption.interface.d.ts +0 -0
  385. /package/{dist/library → library}/models/index.d.ts +0 -0
  386. /package/{dist/library → library}/models/rowDetailView.interface.d.ts +0 -0
  387. /package/{dist/library → library}/modules/angular-slickgrid.module.d.ts +0 -0
  388. /package/{dist/library → library}/services/angularUtil.service.d.ts +0 -0
  389. /package/{dist/library → library}/services/container.service.d.ts +0 -0
  390. /package/{dist/library → library}/services/index.d.ts +0 -0
  391. /package/{dist/library → library}/services/translater.service.d.ts +0 -0
  392. /package/{dist/library → library}/services/utilities.d.ts +0 -0
  393. /package/{dist/library → library}/slickgrid-config.d.ts +0 -0
  394. /package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
@@ -1,604 +0,0 @@
1
- #### index
2
- - [Inline Editors](#how-to-use-inline-editors)
3
- - [Demo with Float Editor & Dollar Formatter](#demo-with-float-editor-and-dollar-currency-formatter)
4
- - [Editor `outputType` and `saveOutputType`](#editor-output-type--save-output-type)
5
- - [Custom Editor](#custom-inline-editor)
6
- - [Perform an Action after Inline Edit](#perform-an-action-after-inline-edit)
7
- - [How to prevent Editor from going to the next bottom cell](#how-to-prevent-editor-from-going-to-the-next-bottom-cell)
8
- - [onClick Action Editor (icon click)](#onclick-action-editor-icon-click)
9
- - [AutoComplete Editor](editors/AutoComplete-Editor.md)
10
- - [Select (single/multi) Editors](editors/select-dropdown-editor.md)
11
- - [Editor Options](#editor-options)
12
- - [Validators](#validators)
13
- - [Custom Validator](#custom-validator)
14
- - [Disabling specific cell Edit](#disabling-specific-cell-edit)
15
- - [Editors on Mobile Phone](#editors-on-mobile-phone)
16
- - [Dynamically Change Column Editor](#dynamically-change-column-editor)
17
-
18
- ## Description
19
- `Slickgrid-Universal` ships with a few default inline editors (checkbox, dateEditor, float, integer, text, longText).
20
-
21
- **Note:** For the Float Editor, you can provide decimal places with `params: { decimals: 2 }` to your column definition else it will be 0 decimal places by default.
22
-
23
- ### Required Grid Option
24
- Editors won't work without these 2 flags `enableCellNavigation: true` and `editable: true` enabled in your Grid Options, so make sure to always to always defined them. Also note that you can toggle the grid to read only (not editable) via the `editable` grid option flag.
25
-
26
- ### Demo
27
- ##### with plain javascript/jQuery
28
- [Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/editor) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-editor.component.ts)
29
-
30
- ##### with Angular Component
31
- [Demo](https://ghiscoding.github.io/Angular-Slickgrid/#/angular-components) / [Demo Client Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-angular.component.ts)
32
-
33
- ### How to use Inline Editors
34
- Simply call the editor in your column definition with the `Editors` you want, as for example (`editor: { model: Editors.text }`). Here is an example with a full column definition:
35
- ```ts
36
- this.columnDefinitions = [
37
- { id: 'title', name: 'Title', field: 'title', editor: { model: Editors.longText } },
38
- { id: 'duration', name: 'Duration (days)', field: 'duration', type: 'number', editor: { model: Editors.text } },
39
- { id: 'complete', name: '% Complete', field: 'percentComplete', type: 'number', editor: { model: Editors.integer } },
40
- { id: 'start', name: 'Start', field: 'start', type: 'date', editor: { model: Editors.date } },
41
- {
42
- id: 'finish', name: 'Finish', field: 'finish', type: 'date',
43
- editor: {
44
- model: Editors.date,
45
-
46
- // you can also add an optional placeholder
47
- placeholder: 'choose a date'
48
- }
49
- },
50
- {
51
- id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: Formatters.checkmarkMaterial,
52
- type: 'number', editor: { model: Editors.checkbox }
53
- }
54
- ];
55
-
56
- this.gridOptions {
57
- enableCellNavigation: true, // <<-- VERY IMPORTANT, it won't work without this flag enabled
58
- editable: true,
59
- };
60
- ```
61
-
62
- #### Demo with Float Editor and Dollar Currency Formatter
63
- This probably comes often, so here's all the setting you would need for displaying & editing a dollar currency value with 2 decimal places.
64
- ```ts
65
- this.columnDefinitions = [
66
- {
67
- id: 'cost', name: 'Cost', field: 'cost',
68
- type: 'float',
69
- formatter: Formatters.dollar, // the Dollar Formatter will default to 2 decimals unless you provide a minDecimal/maxDecimal
70
- // params: { minDecimal: 2, maxDecimal: 4, }, // optionally provide different decimal places
71
-
72
- // the float editor has its own settings, `decimal` that will be used only in the editor
73
- // note: that it has nothing to do with the Dollar Formatter
74
- editor: { model: Editors.float, decimal: 2 },
75
- },
76
- ];
77
- ```
78
-
79
- #### Editor Output Type & Save Output Type
80
- You could also define an `outputType` and a `saveOutputType` to an inline editor. There is only 1 built-in Editor with this functionality for now which is the `dateEditor`. For example, on a date field, we can call this `outputType: 'dateIso'` (by default it uses `dateUtc` as the output):
81
- ```typescript
82
- this.columnDefinitions = [
83
- {
84
- id: 'start', name: 'Start', field: 'start',
85
- type: 'date',
86
- editor: { model: Editors.date },
87
- type: 'date', // dataset cell input format
88
- // outputType: 'dateUs', // date picker format
89
- saveOutputType: 'dateUtc', // save output date format
90
- }
91
- ];
92
- ```
93
-
94
- So to make it more clear, the `saveOutputType` is the format that will be sent to the `onCellChange` event, then the `outputType` is how the date will show up in the date picker (Vanilla-Calendar) and finally the `type` is basically the input format (coming from your dataset). Note however that each property are cascading, if 1 property is missing it will go to the next one until 1 is found... for example, on the `onCellChange` if you aren't defining `saveOutputType`, it will try to use `outputType`, if again none is provided it will try to use `type` and finally if none is provided it will use `'dateIso'` as the default.
95
-
96
- ## AutoComplete Editor
97
- The AutoComplete Editor has the same configuration (except for the `model: Editors.autoComplete`) as the AutoComplete Filter, so you can refer to the [AutoComplete Filter Wiki](filters/autocomplete-filter.md) for more info on how to use it.
98
-
99
- ## Select Editors
100
- The library ships with two select editors: `singleSelectEditor` and the `multipleSelectEditor`. Both support the [Multiple-Select-Vanilla](https://github.com/ghiscoding/multiple-select-vanilla) library, but fallback to the bootstrap form-control style if you decide to exclude this library from your build. These editors will work with a list of foreign key values (custom structure not supported) and can be displayed properly with the [collectionFormatter](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/formatters/collectionFormatter.ts). [example 3](https://ghiscoding.github.io/Angular-Slickgrid/#/editor) has all the details for you to get started with these editors.
101
-
102
- Here's an example with a `collection`, `collectionFilterBy` and `collectionSortBy`
103
-
104
- ```typescript
105
- this.columnDefinitions = [
106
- {
107
- id: 'prerequisites', name: 'Prerequisites', field: 'prerequisites',
108
- editor: {
109
- model: Editors.multipleSelect,
110
- collection: Array.from(Array(12).keys()).map(k => ({ value: `Task ${k}`, label: `Task ${k}` })),
111
- collectionSortBy: {
112
- property: 'label',
113
- sortDesc: true
114
- },
115
- collectionFilterBy: {
116
- property: 'label',
117
- value: 'Task 2'
118
- }
119
- }
120
- }
121
- ];
122
- ```
123
-
124
- ### Editor Options (`MultipleSelectOption` interface)
125
- All the available options that can be provided as editor `options` to your column definitions can be found under this [multipleSelectOption interface](https://ghiscoding.github.io/multiple-select-vanilla/) and you should cast your editor `options` to that interface to make sure that you use only valid options of the `multiple-select-vanilla` library.
126
-
127
- ```ts
128
- editor: {
129
- model: Editors.SingleSelect,
130
- // previously known as `editorOptions` for < 9.0
131
- options: {
132
- maxHeight: 400
133
- } as MultipleSelectOption
134
- }
135
- ```
136
-
137
- ### Collection Async Load
138
- You can also load the collection asynchronously, but for that you will have to use the `collectionAsync` property, which expect an Observable (`HttpClient`) to be passed.
139
-
140
- #### Load the collection through an Http call
141
-
142
- ```typescript
143
- this.columnDefinitions = [
144
- {
145
- id: 'prerequisites', name: 'Prerequisites', field: 'prerequisites',
146
- filterable: true,
147
- editor: {
148
- collectionAsync: this.http.get<{ value: string; label: string; }[]>('api/data/pre-requisites'),
149
- model: Editors.multipleSelect,
150
- }
151
- }
152
- ];
153
- ```
154
-
155
- #### Modifying the collection afterward
156
- If you want to modify the `collection` afterward (can be `collection` or even `collectionAsync`), you can simply push or modify the `collection` directly. You just need to find in your Column Definition and Angular-Slickgrid will take care of the rest for you.
157
-
158
- For example
159
- ```typescript
160
- addItem() {
161
- const lastRowIndex = this.dataset.length;
162
- const newRows = this.mockData(1, lastRowIndex);
163
-
164
- // wrap into a timer to simulate a backend async call
165
- setTimeout(() => {
166
- const requisiteColumnDef = this.columnDefinitions.find((column: Column) => column.id === 'prerequisites');
167
- if (requisiteColumnDef) {
168
- const collection = requisiteColumnDef.editor.collection;
169
-
170
- if (Array.isArray(collection )) {
171
- // add the new row to the grid
172
- this.angularGrid.gridService.addItemToDatagrid(newRows[0]);
173
-
174
- // then refresh the Filter "collection", we have 2 ways of doing it
175
-
176
- // 1- Push to the Filter "collection"
177
- collection.push({ value: lastRowIndex, label: lastRowIndex, prefix: 'Task' });
178
-
179
- // or 2- replace the entire "collection"
180
- // requisiteColumnDef.editor.collection = [...collection, ...[{ value: lastRowIndex, label: lastRowIndex }]];
181
- }
182
- }
183
- }, 250);
184
- }
185
- ```
186
-
187
- ### Collection Label Prefix/Suffix
188
- 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.
189
-
190
- **Note**
191
- If `enableTranslateLabel` flag is set to `True`, it will also try to translate the Prefix / Suffix / OptionLabel texts.
192
-
193
- For example, say you have this collection
194
- ```typescript
195
- const currencies = [
196
- { symbol: '$', currency: 'USD', country: 'USA' },
197
- { symbol: '$', currency: 'CAD', country: 'Canada' }
198
- ];
199
- ```
200
-
201
- 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.
202
-
203
- 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:
204
- - $ USD USA
205
- - $ CAD Canada
206
-
207
- with a `customStructure` defined as
208
- ```typescript
209
- editor: {
210
- collection: this.currencies,
211
- customStructure: {
212
- value: 'currency',
213
- label: 'currency',
214
- labelPrefix: 'symbol',
215
- labelSuffix: 'country',
216
- },
217
- collectionOptions: {
218
- separatorBetweenTextLabels: ' ' // add white space between each text
219
- },
220
- model: Editors.multipleSelect
221
- }
222
- ```
223
-
224
- ### Collection Label Render HTML
225
- 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.
226
-
227
- **NOTE:** this is currently only used by the Editors that have a `collection` which are the `MultipleSelect` & `SingleSelect` Editors.
228
-
229
- ```typescript
230
- this.columnDefinitions = [
231
- {
232
- id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven',
233
- formatter: Formatters.checkmarkMaterial,
234
- type: 'boolean',
235
- editor: {
236
- // display checkmark icon when True
237
- enableRenderHtml: true,
238
- collection: [{ value: '', label: '' }, { value: true, label: 'True', labelPrefix: `<i class="mdi mdi-check"></i> ` }, { value: false, label: 'False' }],
239
- model: Editors.singleSelect
240
- }
241
- }
242
- ];
243
- ```
244
-
245
- #### Default Sanitize-Html Options
246
- If you find that the HTML that you passed is being sanitized and you wish to change it, then you can change the default `sanitizeHtmlOptions` property defined in the Global Grid Options, for more info on how to change these global options, see the [Wiki - Global Grid Options](../grid-functionalities/Global-Options.md). The current defaults are:
247
-
248
- ```typescript
249
- sanitizeHtmlOptions: {
250
- allowedTags: [ 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
251
- 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
252
- 'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'iframe', 'span' ],
253
- allowedAttributes: { '*': ['*'] }
254
- },
255
- ```
256
-
257
- ### `multiple-select-vanilla` Options
258
- You can use any options from [Multiple-Select-Vanilla](https://github.com/ghiscoding/multiple-select-vanilla) and add them to your editor `options` property. However please note that this is a customized version of the original (all original [lib options](https://ghiscoding.github.io/multiple-select-vanilla/) are available so you can still consult the original site for all options).
259
-
260
- Couple of small options were added to suit Angular-SlickGrid needs, which is why it points to `angular-slickgrid/lib` 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:
261
- - `okButton` option was added to add an OK button for simpler closing of the dropdown after selecting multiple options.
262
- - `okButtonText` was also added for locale (i18n)
263
- - `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.
264
- - `autoDropWidth` option was added to automatically resize the dropdown with the same width as the select filter element.
265
- - `autoAdjustDropHeight` (defaults to true), when set will automatically adjust the drop (up or down) height
266
- - `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)
267
- - `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)
268
- - to extend the previous 3 autoAdjustX flags, the following options can be helpful
269
- - `minWidth` (defaults to null, to use when `autoAdjustDropWidthByTextSize` is enabled)
270
- - `maxWidth` (defaults to 500, to use when `autoAdjustDropWidthByTextSize` is enabled)
271
- - `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
272
- - `maxHeight` (defaults to 275, to use when `autoAdjustDropHeight` is enabled)
273
-
274
- ##### Code
275
- ```typescript
276
- this.columnDefinitions = [
277
- {
278
- id: 'isActive', name: 'Is Active', field: 'isActive',
279
- filterable: true,
280
- editor: {
281
- collection: [{ value: '', label: '' }, { value: true, label: 'true' }, { value: false, label: 'false' }],
282
- model: Editors.singleSelect,
283
- elementOptions: {
284
- // add any multiple-select.js options (from original or custom version)
285
- autoAdjustDropPosition: false, // by default set to True, but you can disable it
286
- position: 'top'
287
- }
288
- }
289
- }
290
- ];
291
- ```
292
-
293
- ## Perform an action after inline edit
294
- #### Recommended way
295
- What is ideal is to bind to a SlickGrid Event, for that you can take a look at this [Wiki - On Events](../events//Grid-&-DataView-Events.md)
296
-
297
- #### Not recommended
298
- You could also, perform an action after the item changed event with `onCellChange`. However, this is not the recommended way, since it would require to add a `onCellChange` on every every single column definition (while you can do with 1 onEvent).
299
-
300
- ### Custom Inline Editor
301
- To create a Custom Editor, you need to create a `class` that will extend the [`Editors` interface](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/editor.interface.ts) and then use it in your grid with `editor: { model: myCustomEditor }` and that should be it.
302
-
303
- **NOTE** Custom Editor accepts **only** regular HTML and/or `jQuery` 3rd party lib. It will **not work** with any Angular lib or template. I have no time to invest in this and not much use either since all embedded Editors are enough for my usage. However, if you wish to create a PR to support Angular lib/template, I certainly welcome PR (Pull Request).
304
-
305
- Once you are done with the class, just reference it's class name as the `editor`, for example:
306
-
307
- ##### Class implementing Editor
308
- ```typescript
309
- export class IntegerEditor implements Editor {
310
- constructor(private args: any) {
311
- this.init();
312
- }
313
-
314
- init(): void {}
315
- destroy() {}
316
- focus() {}
317
- loadValue(item: any) {}
318
- serializeValue() {}
319
- applyValue(item: any, state: any) {}
320
- isValueChanged() {}
321
- validate() {}
322
- }
323
- ```
324
-
325
- ##### Use it in your Column Definition
326
- For Custom Editor class example, take a look at [custom-inputEditor.ts](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/custom-inputEditor.ts)
327
-
328
- ```typescript
329
- this.columnDefinitions = [
330
- {
331
- id: 'title2', name: 'Title, Custom Editor', field: 'title',
332
- editor: {
333
- model: CustomInputEditor // reference your custom editor class
334
- },
335
- }
336
- ];
337
- ```
338
-
339
- ## Custom Editor with Angular Components
340
- You can see them in [Example 22](https://ghiscoding.github.io/Angular-Slickgrid/#/angular-components) which have both Custom Editors & Filters which uses Angular Components. The 2nd column "Assignee" is the column that uses both (it uses `ng-select` 3rd party lib wrapped in an Angular Components [here](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/editor-ng-select.component.ts)) and you need to create a Custom Editor like [here](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/custom-angularComponentEditor.ts) and use that Custom Editor in your column definition like
341
-
342
- Personally I don't find this very straightforward and I don't recommend using Angular Components for Editors/Filters as it adds a lot of boilerplate (compare to 1 step with a jQuery Custom Editor) but if you really wish to go that route, it's now possible following the steps shown below.
343
-
344
- The steps to use an Angular Component as a Custom Editor are the following:
345
- 1. Create a Custom Editor that will handle the creation or compilation of the Angular Component into a SlickGrid Editors. For that you can take a look at this [Custom Editor](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/custom-angularComponentEditor.ts)
346
- 2. Define your Angular Component, for example take a look at this simple [ng-select Editor](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/editor-ng-select.component.ts)
347
- 3. Use the Custom Editor inside your Column Definitions, for that you can see previous paragraph
348
-
349
- ## How to prevent Editor from going to the next bottom cell?
350
- The default behavior or SlickGrid is to go to the next cell at the bottom of the current cell that you are editing. You can change and remove this behavior by enabling `autoCommitEdit` which will save current editor and remain in the same cell
351
-
352
- ```ts
353
- this.gridOptions = {
354
- autoCommitEdit: true,
355
- editable: true,
356
- }
357
- ```
358
-
359
- ### OnClick Editor (icon click)
360
- Instead of an inline editor, you might want to simply click on an edit icon that could call a modal window, or a redirect URL, or whatever you wish to do. For that you can use the inline `onCellClick` event and define a callback function for the action (you could also create your [Custom Formatter](../column-functionalities/Formatters.md)).
361
- - The `Formatters.editIcon` will give you a pen icon, while a `Formatters.deleteIcon` is an "x" icon
362
- ```typescript
363
- this.columnDefinitions = [
364
- {
365
- id: 'edit', field: 'id',
366
- formatter: Formatters.editIcon,
367
- maxWidth: 30,
368
- onCellClick: (args: OnEventArgs) => {
369
- console.log(args);
370
- }
371
- },
372
- // ...
373
- ];
374
- ```
375
- The `args` returned to the `onCellClick` callback is of type `OnEventArgs` which is the following:
376
- ```typescript
377
- export interface OnEventArgs {
378
- row: number;
379
- cell: number;
380
- columnDef: Column;
381
- dataContext: any;
382
- dataView: any;
383
- grid: any;
384
- gridDefinition: GridOption;
385
- }
386
- ```
387
-
388
- ### Event through Slick Grid object
389
- You can also use the Slick Grid events as shown below
390
-
391
- ##### View
392
- ```html
393
- <angular-slickgrid gridId="grid2"
394
- (onAngularGridCreated)="angularGridReady($event.detail)"
395
- (onCellChange)="onCellChanged($event.detail.eventData, $event.detail.args)"
396
- (onClick)="onCellClicked($event.detail.eventData, $event.detail.args)"
397
- [columns]="columnDefinitions" [options]="gridOptions" [dataset]="dataset">
398
- </angular-slickgrid>
399
- ```
400
-
401
- ##### Component
402
- ```typescript
403
- onCellChanged(e, args) {
404
- this.updatedObject = args.item;
405
- this.angularGrid.resizerService.resizeGrid(10);
406
- }
407
-
408
- onCellClicked(e, args) {
409
- const metadata = this.angularGrid.gridService.getColumnFromEventArguments(args);
410
-
411
- if (metadata.columnDef.id === 'edit') {
412
- this.alertWarning = `open a modal window to edit: ${metadata.dataContext.title}`;
413
-
414
- // highlight the row, to customize the color, you can change the SASS variable $row-highlight-background-color
415
- this.angularGrid.gridService.highlightRow(args.row, 1500);
416
-
417
- // you could also select the row, when using "enableCellNavigation: true", it automatically selects the row
418
- // this.angularGrid.gridService.setSelectedRow(args.row);
419
- } else if (metadata.columnDef.id === 'delete') {
420
- if (confirm('Are you sure?')) {
421
- this.angularGrid.gridService.deleteDataGridItemById(metadata.dataContext.id);
422
- }
423
- }
424
- }
425
- ```
426
-
427
- ## Editor Options
428
-
429
- #### Column Editor `options`
430
- Some of the Editors could receive extra options, which is mostly the case for Editors using external dependencies (e.g. `autocompleter`, `date`, `multipleSelect`, ...) you can provide options via the editor `options`, for example
431
-
432
- ```ts
433
- this.columnDefinitions = [{
434
- id: 'start', name: 'Start Date', field: 'start',
435
- editor: {
436
- model: Editors.date,
437
- // previously known as `editorOptions` for < 9.0
438
- options: { minDate: 'today' }
439
- }
440
- }];
441
- ```
442
-
443
- #### Grid Option `defaultEditorOptions
444
- You could also define certain options as a global level (for the entire grid or even all grids) by taking advantage of the `defaultEditorOptions` Grid Option. Note that they are set via the editor type as a key name (`autocompleter`, `date`, ...) and then the content is the same as `editorOptions` (also note that each key is already typed with the correct editor option interface), for example
445
-
446
- ```ts
447
- this.gridOptions = {
448
- defaultEditorOptions: {
449
- autocompleter: { debounceWaitMs: 150 }, // typed as AutocompleterOption
450
- date: { minDate: 'today' },
451
- longText: { cols: 50, rows: 5 }
452
- }
453
- }
454
- ```
455
-
456
- ## Validators
457
- Each Editor needs to implement the `validate()` method which will be executed and validated before calling the `save()` method. Most Editor will simply validate that the value passed is correctly formed. The Float Editor is one of the more complex one and will first check if the number is a valid float then also check if `minValue` or `maxValue` was passed and if so validate against them. If any errors is found it will return an object of type `EditorValidatorOutput` (see the signature on top).
458
-
459
- ### Custom Validator
460
- If you want more complex validation then you can implement your own Custom Validator as long as it implements the following signature.
461
- ```ts
462
- export type EditorValidator = (value: any, args?: EditorArgs) => EditorValidatorOutput;
463
- ```
464
- So the `value` can be anything but the `args` is interesting since it provides multiple properties that you can hook into, which are the following
465
- ```ts
466
- export interface EditorArgs {
467
- column: Column;
468
- container: any;
469
- grid: any;
470
- gridPosition: ElementPosition;
471
- item: any;
472
- position: ElementPosition;
473
- cancelChanges?: () => void;
474
- commitChanges?: () => void;
475
- }
476
- ```
477
- And finally the Validator Output has the following signature
478
- ```ts
479
- export interface EditorValidatorOutput {
480
- valid: boolean;
481
- msg?: string | null;
482
- }
483
- ```
484
-
485
- So if we take all of these informations and we want to create our own Custom Editor to validate a Title field, we could create something like this:
486
- #### Component
487
- ```ts
488
- const myCustomTitleValidator: EditorValidator = (value: any, args: EditorArgs) => {
489
- // you can get the Editor Args which can be helpful, e.g. we can get the Translate Service from it
490
- const grid = args && args.grid;
491
- const columnDef = args.column;
492
- const dataContext = args.item;
493
- const gridOptions = (grid && grid.getOptions) ? grid.getOptions() : {};
494
- const i18n = gridOptions.i18n;
495
-
496
- if (value == null || value === undefined || !value.length) {
497
- return { valid: false, msg: 'This is a required field' };
498
- } else if (!/^Task\s\d+$/.test(value)) {
499
- return { valid: false, msg: 'Your title is invalid, it must start with "Task" followed by a number' };
500
- // OR use the Translate Service with your custom message
501
- // return { valid: false, msg: i18n.tr('YOUR_ERROR', { x: value }) };
502
- } else {
503
- return { valid: true, msg: '' };
504
- }
505
- };
506
- ```
507
- and use it in our Columns Definition like this:
508
- ```ts
509
- this.columnDefinition = [
510
- {
511
- id: 'title', name: 'Title', field: 'title',
512
- editor: {
513
- model: Editors.longText,
514
- validator: myCustomTitleValidator, // use our custom validator
515
- },
516
- onCellChange: (e: Event, args: OnEventArgs) => {
517
- // do something
518
- console.log(args.dataContext.title);
519
- }
520
- }
521
- ];
522
- ```
523
-
524
- ## Disabling specific cell edit
525
- This can be answered by searching on Stack Overflow Stack Overflow and this is the best [answer](https://stackoverflow.com/questions/10491676/disabling-specific-cell-edit-in-slick-grid) found.
526
-
527
- Based on that, the only difference in Angular-Slickgrid is that all SlickGrid event needs the `sg` prefix to differentiate SlickGrid Events (`sg` prefix) versus Angular-Slickgrid Events (`asg` prefix). More info can be found in this [Wiki - Grid & DataView Events](../events/Grid-&-DataView-Events.md).
528
-
529
- With that in mind and the code from the SO answer, we end up with the following code.
530
-
531
- #### View
532
- ```html
533
- <angular-slickgrid gridId="grid1"
534
- [columns]="columnDefinitions"
535
- [options]="gridOptions"
536
- (onBeforeEditCell)="verifyCellIsEditableBeforeEditing($event.detail.eventData, $event.detail.args)"
537
- >
538
- </angular-slickgrid>
539
- ```
540
-
541
- #### Component
542
- ```ts
543
- verifyCellIsEditableBeforeEditing(e, args): boolean {
544
- // you can call `event.preventDefault()` to make cell not editable
545
- // args contains the dataContext and other Slickgrid arguments
546
- }
547
- ```
548
-
549
- ### Editors on Mobile Phone
550
- If your grid uses the `autoResize` and you use Editors in your grid on a mobile phone, Android for example, you might have undesired behaviors. It might call a grid resize (and lose input focus) since the touch keyboard appears. This in term, is a bad user experience to your user, but there is a way to avoid this, you could use the `pauseResizer`
551
-
552
- ##### View
553
- ```html
554
- <div id="grid1">
555
- <angular-slickgrid gridId="grid1"
556
- [columns]="columnDefinitions"
557
- [options]="gridOptions"
558
- [dataset]="dataset"
559
- (onBeforeEditCell)="onBeforeEditCell($event)"
560
- (onBeforeCellEditorDestroy)="onAfterEditCell($event)"
561
- (onAngularGridCreated)="angularGridReady($event.detail)">
562
- </angular-slickgrid>
563
- </div>
564
- ```
565
- ##### Component
566
- ```ts
567
- angularGridReady(angularGrid: AngularGridInstance) {
568
- this.angularGrid = angularGrid;
569
- }
570
-
571
- onAfterEditCell($event) {
572
- // resume autoResize feature, and after leaving cell editing mode
573
- // force a resize to make sure the grid fits the current dimensions
574
- this.angularGrid.resizerService.pauseResizer(false);
575
- this.angularGrid.resizerService.resizeGrid();
576
- }
577
-
578
- onBeforeEditCell($event) {
579
- this.angularGrid.resizerService.pauseResizer(true);
580
- }
581
- ```
582
-
583
- ## Turning individual rows into edit mode
584
- Using the [Row Based Editing Plugin](../grid-functionalities/Row-based-edit.md) you can let the user toggle either one or multiple rows into edit mode, keep track of cell changes and either discard or save them on an individual basis using a custom `onBeforeRowUpdated` hook.
585
-
586
- ## Dynamically change Column Editor
587
-
588
- You can dynamically change a column editor by taking advantage of the `onBeforeEditCell` event and change the editor just before the cell editor opens. However please note that the library keeps 2 references and you need to update both references as shown below.
589
-
590
- With the code sample shown below, we are using an input checkbox to toggle the Editor between `Editors.longText` to `Editors.text` and vice/versa
591
-
592
- ```ts
593
- changeToInputTextEditor(checked: boolean) {
594
- this.isInputTextEditor = checked;
595
- }
596
-
597
- handleOnBeforeEditCell(args: CustomEvent<OnBeforeEditCellEventArgs>) {
598
- const args = event?.detail?.args;
599
- const { grid, column } = args;
600
- column.editor.model = this.isInputTextEditor ? Editors.text : Editors.longText;
601
- column.editorClass = column.editor.model;
602
- return true;
603
- }
604
- ```