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,627 +0,0 @@
1
- ##### index
2
- - Composite Editor Modal Window Actions/Types
3
- - [Create Item](#create-new-item)
4
- - [Edit Item](#edit-item)
5
- - [Clone Item](#clone-item)
6
- - [Mass Update](#mass-update)
7
- - [Mass Selection](#mass-selection) _(similar to Mass Update but apply changes only to selected rows)_
8
- - Modal Options
9
- - [Customize Text Labels](#customize-text-labels)
10
- - [UI Options & Responsive Design](#ui-options--responsive-design)
11
- - Callback Functions
12
- - [onBeforeOpen](#onBeforeOpen) - allows the user to optionally execute something before opening the modal
13
- - [onClose](#onclose) - allows to warn/confirm with the user when leaving the form with unsaved data
14
- - [onError](#onerror) - allows you to customize what to do when the modal throws an error (show an alert or toast notification)
15
- - [onSave](#onsave) - typically used with a Backend Service API
16
- - [How to Skip a Mass Change](#how-to-skip-a-mass-change)
17
- - Dynamic Events/Methods
18
- - [Dynamically Change a Form Input](#dynamically-change-form-input) - for example when 1 input value affect 1 or more other input(s).
19
- - [Dynamically Change `options`](#dynamically-change-editor-options-like-mindate-on-a-date-picker) - for example, date picker `minDate` based on other field values
20
- - [Dynamically Update Select Editor Collection](#dynamically-update-select-editor-collection)
21
- - [Disabling Form Inputs (readonly)](#disabling-form-inputs-readonly)
22
-
23
- ### Demo
24
- [Demo](https://ghiscoding.github.io/Angular-Slickgrid/#/slickgrid/example30) / [Demo Component](https://github.com/ghiscoding/angular-slickgrid/blob/master/src/examples/slickgrid/example30.ts)
25
-
26
- ### Description
27
- The Composite Editor Modal allows you to (create, clone, edit, mass update & mass selection changes). I believe the SlickGrid author names it as Composite Editor because it loops through each editor of all the column definitions and displays them in one composed form, hence the name Composite Editors. Also note that each editor are pulled directly from the column definition itself (their column title as well), so for example if you use `Editors.longText` then you will have a text area input associated to that field with the appropriate input label.
28
-
29
- The following 5 modal types (6 if we include the `auto-mass`) are available (via `CompositeEditorModalType` interface):
30
- - `create` - create a new row/item
31
- - `clone` - clone allows to copy & possibly edit some inputs before cloning
32
- - `edit` - edit a row/item
33
- - `mass-update` - apply changes on the entire dataset
34
- - `mass-selection` - apply changes on all the selected row (similar to mass update but only on the selection)
35
- - `auto-mass` - will auto-detect if it should do a Mass Update (no row selected) or a Mass Selection Changes (with rows selected)
36
- - most user find this one approach confusing, our users prefer to have 2 separate buttons (which is a lot less confusing)
37
-
38
- ## Create New Item
39
- You can Create a new row/item via the composite editor modal window, it will display all editors as blank input field. Also note that this feature requires the `enableAddRow` grid option to be enabled or else it will throw an error.
40
-
41
- Note: the new item will be added to the top of the grid by default, if you wish to change that you can use `insertOptions`. The options are the same as calling `addItem()` from the Grid Service, so if you wish to add the new item to the bottom then you use this `insertOptions: { position: 'bottom' }`
42
-
43
- ##### with TypeScript
44
- ```ts
45
- import { Column, CompositeEditorModalType } from 'angular-slickgrid';
46
- import { SlickCompositeEditorComponent } from '@slickgrid-universal/composite-editor-component';
47
-
48
- example class MyCompositeDemo {
49
- compositeEditorInstance: SlickCompositeEditorComponent;
50
-
51
- constructor() {
52
- this.compositeEditorInstance = new SlickCompositeEditorComponent();
53
- }
54
-
55
- prepareGrid() {
56
- this.columnDefinitions = [ /*...*/ ];
57
-
58
- this.gridOptions = {
59
- enableAddRow: true, // required for Create/Clone
60
- enableCellNavigation: true,
61
- autoEdit: true,
62
- autoCommitEdit: true,
63
- enableCompositeEditor: true,
64
- registerExternalResources: [new ExcelExportService(), this.compositeEditorInstance],
65
- };
66
- }
67
-
68
- openCompositeModal(modalType: CompositeEditorModalType = 'create') {
69
- // you can use a switch/case when using the Composite Modal for more than 1 modal type
70
- const modalTitle = 'Create Item';
71
-
72
- this.compositeEditorInstance?.openDetails({
73
- headerTitle: modalTitle,
74
- modalType,
75
- // insertNewId: 1234, // you can provide a custom Id (defaults to last Id+1)
76
- // insertOptions: { position: 'bottom' }, // if you wish to add the item to the bottom (defaults to top of the grid)
77
- onError: (error) => alert(error.message), // you should define how to deal with error coming from the modal
78
-
79
- // you can optionally provide an async callback method when dealing with a backend server
80
- onSave: (formValues, selection, dataContext) => {
81
- // simulate a backend server call which returns true (successful) after 30sec
82
- return new Promise(resolve => setTimeout(() => resolve(true), 500));
83
- });
84
- }
85
- }
86
- ```
87
-
88
- ## Clone Item
89
- You can Clone an existing row/item via the composite editor modal window (basically allows you to copy a row but also to make edits before cloning it). The setup is nearly identical to the Create Item, just make sure to display appropriate modal title. Also note that this feature requires the `enableAddRow` grid option to be enabled or else it will throw an error.
90
-
91
- Refer to the [Create Item](#create-new-item) section for code sample
92
-
93
- Just a side note on the UI, a good way to use this composite editor feature is probably with a [Cell Menu](../column-functionalities/Cell-Menu.md) (aka Action Menu)
94
-
95
- ![image](https://user-images.githubusercontent.com/643976/106016610-a03dec00-608d-11eb-80bd-1f6e0a404eb5.png)
96
-
97
-
98
- ## Edit Item
99
- You can Edit an existing row/item via the composite editor modal window. The setup is nearly identical to the Create Item, just make sure to display appropriate modal title.
100
-
101
- Refer to the [Create Item](#create-new-item) section for code sample
102
-
103
- Similar to the Clone Item, a good way to use this composite editor feature is probably with a [Cell Menu](../column-functionalities/Cell-Menu.md) (aka Action Menu)
104
-
105
- ## Mass Update
106
- Mass Update allows you to apply changes (from the modal form) to the entire dataset, internally it will apply the changes to all the items in the grid via the DataView. However, you could also choose to refresh the grid yourself after calling the backend and if you choose to do that then you'll want to do that via the `onSave` async callback (once backend is done, refresh the grid).
107
-
108
- Note however that there is a subtle difference compare to the Create Item action, you need to specifically tag which column will show up in the Mass Update and you need to do that by adding `massUpdate: true` flag inside the `editor` property of each column definition that you wish to be included in the form.
109
-
110
- `auto-mass` option: If you decide to use Mass Update and Mass Selection and wish to only expose 1 button to do the action and let the system decide if it's doing a Mass Update or a Mass Selection change, you can use the modal type `auto-mass` (if it detect that some rows are selected it will use Mass Selection or else Mass Update). From our experience, user prefer to expose the 2 separate action buttons (less confusion), but this for you to decide, you have the option.
111
-
112
- ##### with TypeScript
113
- ```ts
114
- import { Column, CompositeEditorModalType } from 'angular-slickgrid';
115
- import { SlickCompositeEditorComponent } from '@slickgrid-universal/composite-editor-component';
116
-
117
- example class MyCompositeDemo {
118
- compositeEditorInstance: SlickCompositeEditorComponent;
119
-
120
- constructor() {
121
- this.compositeEditorInstance = new SlickCompositeEditorComponent();
122
- }
123
-
124
- prepareGrid() {
125
- this.columnDefinitions = [
126
- {
127
- id: 'percentComplete', name: '% Complete', field: 'percentComplete',
128
- type: 'number', sortable: true, filterable: true,
129
- filter: { model: Filters.compoundSlider, operator: '>=' },
130
- editor: {
131
- model: Editors.slider,
132
- massUpdate: true, // <-- this flag is required for Mass Update
133
- minValue: 0, maxValue: 100,
134
- },
135
- },
136
- ];
137
-
138
- this.gridOptions = {
139
- enableCellNavigation: true,
140
- autoEdit: true,
141
- autoCommitEdit: true,
142
- enableCompositeEditor: true,
143
- registerExternalResources: [new ExcelExportService(), this.compositeEditorInstance],
144
- };
145
- }
146
-
147
- openCompositeModal(modalType: CompositeEditorModalType = 'mass-update') {
148
- // you can use a switch/case when using the Composite Modal for more than 1 modal type
149
- const modalTitle = 'Mass Update';
150
-
151
- this.compositeEditorInstance?.openDetails({
152
- headerTitle: modalTitle,
153
- modalType,
154
- onError: (error) => alert(error.message), // you should define how to deal with error coming from the modal
155
-
156
- // you can optionally provide an async callback method when dealing with a backend server
157
- onSave: (formValues, selection, dataContext) => {
158
- // simulate a backend server call which returns true (successful) after 30sec
159
- return new Promise(resolve => setTimeout(() => resolve(true), 500));
160
- });
161
- }
162
- }
163
- ```
164
-
165
- ## Mass Selection
166
- Similar to the Mass Update but apply changes only on the selected rows. The setup is nearly identical to the Mass Update, just make sure to display appropriate modal title. Also note that you also need to add `massUpdate: true` flag inside the `editor` property of each column definition that you wish to be included in the Mass Selection changes form.
167
-
168
- Refer to the [Mass Update](#mass-update) section for code sample.
169
-
170
- `auto-mass` option: If you decide to use Mass Update and Mass Selection and wish to only expose 1 button to do the action and let the system decide if it's doing a Mass Update or a Mass Selection change, you can use the modal type `auto-mass` (if it detect that some rows are selected it will use Mass Selection or else Mass Update). From our experience, user prefer to expose the 2 separate action buttons (less confusion), but this for you to decide, you have the option.
171
-
172
- ## Callback Functions
173
-
174
- ### onBeforeOpen
175
- The `onBeforeOpen` callback function allows the user to optionally execute something before opening the modal. This is synchronous call and it won't wait until proceeding to opening the modal, it just allows you to possibly do something before opening the modal (for example cancel any batch edits, or change/reset some validations in column definitions).
176
-
177
- ```ts
178
- this.compositeEditorInstance?.openDetails({
179
- headerTitle: 'Create Item',
180
- modalType: 'create',
181
- onBeforeOpen: () => this.rollbackAllUnsavedEdits(), // for example if we have any unsaved editors in the grids, we can roll them back before doing a Mass Update
182
- });
183
- ```
184
-
185
- ### onClose
186
- The `onClose` callback function allows you to show a warning or confirm dialog to the user if there's any form input that were left unsaved. For example, when the user opens the modal window and start changing a few inputs in the form but then decides to the form, this is when the `onClose` gets executed (and to be clear, it only gets executed when there's changes in the form and a close action is clicked, it won't execute when there's no changes).
187
-
188
- You can return a synchronous or asynchronous function (typically the latter), for example we could display an alert when leaving with unsaved data.
189
- ```ts
190
- this.compositeEditorInstance?.openDetails({
191
- headerTitle: 'Create Item',
192
- modalType: 'create',
193
- onClose: () => Promise.resolve(confirm('You have unsaved changes, are you sure you want to close this window?')),
194
- });
195
- ```
196
-
197
- ### onError
198
- The `onError` callback function will execute anytime an error is thrown by the modal window.
199
- You can return a synchronous or asynchronous function (typically the latter), for example we could display an alert when leaving with unsaved data.
200
-
201
- ```ts
202
- this.compositeEditorInstance?.openDetails({
203
- headerTitle: 'Create Item',
204
- modalType: 'create',
205
- onError: (error) => alert(error.message),
206
- });
207
- ```
208
-
209
- The `onError` error follows the `OnErrorOption` which includes the interface shown below (and if you want to customize the text or use translation, you will want to use the `code`)
210
-
211
- ```ts
212
- export type OnErrorOption = {
213
- code?: string; // Error code (typically an uppercase error code key like: "NO_RECORD_FOUND")
214
- message: string; // Error Message
215
- type: 'error' | 'info' | 'warning'; // Error Type (info, error, warning)
216
- };
217
- ```
218
- The available error `code` are the following:
219
- - `EDITABLE_GRID_REQUIRED`: with default text of `"Your grid must be editable in order to use the Composite Editor Modal."`
220
- - `ENABLE_ADD_ROW_REQUIRED`: with default text of `"Composite Editor requires the flag "enableAddRow" to be set to True in your Grid Options when cloning/creating a new item."`
221
- - `ENABLE_CELL_NAVIGATION_REQUIRED`: with default text of `"Composite Editor requires the flag "enableCellNavigation" to be set to True in your Grid Options."`
222
- - `ITEM_ALREADY_EXIST`: with default text of `"The item object which you are trying to add already exist with the same Id:: ${newId}"`
223
- - `NO_CHANGES_DETECTED`: with default text of `"Sorry we could not detect any changes."`
224
- - `NO_EDITOR_FOUND`: with default text of `"We could not find any Editor in your Column Definition"`
225
- - `NO_RECORD_FOUND`: with default text of `"No records selected for edit or clone operation."`
226
- - `ROW_NOT_EDITABLE`: with default text of `"Current row is not editable."`
227
- - `ROW_SELECTION_REQUIRED`: with default text of `"You must select some rows before trying to apply new value(s)."`
228
-
229
- ### onSave
230
- The `onSave` callback function is optional and is very useful whenever you have a backend API (which I assume is most of the time). This callback will provide you with 3 arguments `(formValues, selection, dataContext)`
231
- 1. `formValues`: all the input values changed in the modal window form
232
- 2. `selection`: selected rows (commonly used with Mass Update/Mass Selection)
233
- 3. `dataContext`: item data context object (commonly used with Create/Clone/Edit)
234
-
235
- **Note:** the `onSave` must return a `boolean` or a `Promise<boolean>` and if the returned result is `true` it will apply the changes to the data in the grid. However if it returns `false` then it assumes that an error occurred and no changes be applied in the grid.
236
-
237
- You can return a synchronous or asynchronous function (typically the latter), we can take the example below when creating an item
238
-
239
- ##### Create Item demo
240
- ```ts
241
- this.compositeEditorInstance.openDetails({
242
- headerTitle: 'Create Item',
243
- modalType: 'create',
244
- onSave: (formValues, selection, dataContext) => {
245
- return new Promise(async (resolve, reject) => {
246
- try {
247
- const success = await this.createUser(dataContext);
248
- resolve(success);
249
- } catch (backendError) {
250
- // when your backend API throws an error, we can reject the promise and that will show as a validation summary on top of the modal
251
- reject(backendError);
252
- }
253
- });
254
- }
255
- }
256
- ```
257
-
258
- ##### Mass Selection changes demo
259
- Note that the `formValues` is an object with a very simple structure, the object properties are the column `id` with their new values. For example if we changed the column id of `percentCompleted` with a value of 100% and we also changed another column id `isCompleted` to `true`, then our `formValues` will be:
260
-
261
- `const formValues = { percentCompleted: 100, isCompleted: true };`
262
-
263
- ```ts
264
- this.compositeEditorInstance.openDetails({
265
- headerTitle: 'Update Selected Items',
266
- modalType: 'mass-selection',
267
- onSave: (formValues, selection, dataContext) => {
268
- return new Promise(async (resolve, reject) => {
269
- try {
270
- const success = await this.updateUsers(selection.dataContextIds, formValues);
271
- resolve(success);
272
- } catch (backendError) {
273
- // when your backend API throws an error, we can reject the promise and that will show as a validation summary on top of the modal
274
- reject(backendError);
275
- }
276
- });
277
- }
278
- }
279
- ```
280
-
281
- #### onSave validation error/rejection
282
- When adding a backend API to the `onSave` you can (and should) wrap your code in a try/catch and use the Promise rejection to send it back to the modal. If the modal finds any errors when saving, it will keep the modal window open and display the error as a validation summary on top of the modal as shown below (as you can see below the backend rejected the save because the value is below 50%)
283
-
284
- ![image](https://user-images.githubusercontent.com/643976/106039582-477b4d00-60a7-11eb-88e1-269790a77852.png)
285
-
286
- ## How to Skip a Mass Change
287
- ### Mass Change (Mass-Update / Mass-Selection) - Skipping according to certain condition(s)
288
- The use case would be to skip a change, in silent without any errors shown, if another column or property has value(s) that do not match our condition expectaation. A possible use case could be found under [Example 12](https://github.com/ghiscoding/slickgrid-universal/blob/eb1d5069e10b8b2cb2f14ac964f2c6e2b8f006a9/examples/webpack-demo-vanilla-bundle/src/examples/example12.ts#L949-L956), the use case that we could do is the following: "Do not apply a mass change on the 'Duration' column that is below 5 days if its 'Complexity' column is set to 'Complex' or 'Very Complex'", the code do this use case is shown below. Also note that the 3rd argument of `onSave` (in our case `dataContextOrUpdatedDatasetPreview`) will have the updated dataset but without the change(s) that got skipped
289
-
290
- ```ts
291
- this.compositeEditorInstance.openDetails({
292
- headerTitle: 'My Modal',
293
- modalType,
294
-
295
- // you can validate each row item dataContext before applying a Mass Update/Selection changes
296
- // via this validation callback (returning false would skip the change)
297
- validateMassUpdateChange: (fieldName, dataContext, formValues) => {
298
- const levelComplex = this.complexityLevelList.find(level => level.label === 'Complex');
299
- if (fieldName === 'duration' && (dataContext.complexity === levelComplex?.value || formValues.complexity === levelComplex?.value) && formValues.duration < 5) {
300
- // below expectation (it's "Complex" and it doesn't have at least 5 days of work (duration))
301
- return false;
302
- }
303
- return true; //expectation met, apply the mass change
304
- },
305
-
306
- // you can optionally provide an async callback method when dealing with a backend server
307
- onSave: (formValues, selection, dataContextOrUpdatedDatasetPreview) => {
308
- // simulate a backend server call which returns true (successful) after 30sec
309
- return new Promise(resolve => setTimeout(() => resolve(true), 500));
310
- }
311
- });
312
- ```
313
- With that same use case, let say that we try changing the first 4 rows with a "Duration" of 4 days, it will apply the changes to all the rows except the first row where the change is skipped because its complexity is set to "Complex" and we don't want a duration to be below 5 days for our use case.
314
-
315
- ![image](https://user-images.githubusercontent.com/643976/171494716-60d32059-c212-4b13-b90d-1342d0999e38.png)
316
-
317
- ## Customize Text Labels
318
- You can customize many of the text labels used in the modal window, they are all regrouped under the `labels` options
319
-
320
- #### Regular text labels (without translations)
321
- - `cancelButton`: defaults to `"Cancel"`, override the Cancel button label
322
- - `cloneButton`: defaults to `"Clone"`, override the Clone button label used by a modal type of "clone"
323
- - `massSelectionButton`: defaults to `"Update Selection"`, override the Mass Selection button label
324
- - `massSelectionStatus`: defaults to `"{{selectedRowCount}} of {{totalItems}} selected"`, override the Mass Selection status text on the footer left side
325
- - `massUpdateButton`: defaults to `"Mass Update"`, override the Mass Update button label
326
- - `massUpdateStatus`: defaults to `"all {{totalItems}} items"`, override the Mass Update status text on the footer left side
327
- - `saveButton`: defaults to `"Save"`, override the Save button label used by a modal type of "create" or "edit"
328
-
329
- #### with a Translation Service (I18N)
330
- As all other features using translation in this library, you can provide a translation key with the `Key` suffix and the available keys are the following
331
- - `cancelButtonKey`: defaults to `"CANCEL"`, translation key used for the Cancel button label.
332
- - `cloneButtonKey`: defaults to `"CLONE"`, translation key used for the Clone button label used by a modal type of "clone"
333
- - `massSelectionButtonKey`: defaults to `"APPLY_TO_SELECTION"`, translation key used for the Mass Selection button label.
334
- - `massSelectionStatusKey`: defaults to `"X_OF_Y_MASS_SELECTED"`, translation key used for the Mass Selection status text on the footer left side
335
- - `massUpdateButtonKey`: defaults to `"APPLY_MASS_UPDATE"`, translation key used for the Mass Update button label.
336
- - `massUpdateStatusKey`: defaults to `"ALL_X_RECORDS_SELECTED"`, translation key used for the Mass Update status text on the footer left side
337
- - `saveButtonKey`: defaults to `"SAVE"`, translation key used for the Save button label used by a modal type of "create" or "edit"
338
-
339
- For example
340
- ```ts
341
- this.compositeEditorInstance?.openDetails({
342
- headerTitle: 'Create New Item',
343
- modalType: 'create',
344
- labels: {
345
- // without translations
346
- cancelButton: 'Leave',
347
- saveButton: 'Create Item',
348
-
349
- // with translations
350
- cancelButtonKey: 'CANCEL',
351
- saveButtonKey: 'SAVE'
352
- },
353
- // ...
354
- });
355
- ```
356
-
357
- ## UI Options & Responsive Design
358
- There are multiple options that you can change to change the UI design a bit, here's a lit of things you can change with their defaults
359
- - `backdrop`: allows you add/remove the modal backdrop (options are `'static' | null`, default is `static`)
360
- - `showCloseButtonOutside`: boolean value to show the close (icon) button inside or outside the modal window (defaults to `true`)
361
- - note that the modal has some minimal responsive design styling and will automatically show the close icon inside the modal when available space is small
362
- - `viewColumnLayout`: how many columns do we want to show in the view layout (options are `1 | 2 | 3 | 'auto'`, defaults to `auto`)
363
- - for example if you wish to see your form split in a 2 columns layout (split view) then use `2`
364
- - the `auto` mode will display a 1 column layout for 8 or less Editors, 2 columns layout for less than 15 Editors or 3 columns when more than 15 Editors
365
-
366
- ## Dynamic Methods
367
-
368
- ### Dynamically Change Form Input
369
-
370
- ##### View
371
- ```html
372
- <angular-slickgrid grid-id="grid30"
373
- columns.bind="columnDefinitions"
374
- options.bind="gridOptions"
375
- dataset.bind="dataset"
376
- on-composite-editor-change.delegate="handleOnCompositeEditorChange($event.detail.eventData, $event.detail.args)">
377
- </angular-slickgrid>
378
- ```
379
-
380
- ##### ViewModel
381
- ```ts
382
- export class GridExample {
383
- compositeEditorInstance: SlickCompositeEditorComponent;
384
-
385
- /** Composite Editor on change handler */
386
- handleOnCompositeEditorChange(event) {
387
- const args = event.detail.args as OnCompositeEditorChangeEventArgs;
388
- const columnDef = args.column as Column;
389
- const formValues = args.formValues;
390
-
391
- // you can change any other form input values when certain conditions are met
392
- if (columnDef.id === 'percentComplete' && formValues.percentComplete === 100) {
393
- this.compositeEditorInstance.changeFormInputValue('completed', true);
394
- this.compositeEditorInstance.changeFormInputValue('finish', new Date());
395
- // this.compositeEditorInstance.changeFormInputValue('product', { id: 0, itemName: 'Sleek Metal Computer' });
396
-
397
- // you can even change a value that is not part of the form values (but is part of the grid)
398
- // BUT you will have to bypass the error that will be thrown, you can provide `true` as the 3rd argument to bypass any error
399
- // this.compositeEditorInstance.changeFormInputValue('cost', 9999.99, true);
400
- }
401
-
402
- // you can also change some editor options (not all Editors supports this functionality, so far only these Editors AutoComplete, Date MultipleSelect & SingleSelect)
403
- if (columnDef.id === 'completed') {
404
- this.compositeEditorInstance.changeFormEditorOption('percentComplete', 'filter', formValues.completed);
405
- this.compositeEditorInstance.changeFormEditorOption('product', 'minLength', 3);
406
- this.compositeEditorInstance.changeFormEditorOption('finish', 'displayDateMin', 'today');
407
- }
408
- }
409
- }
410
- ```
411
-
412
- ### Dynamically Change Editor Options (like `minDate` on a date picker)
413
- For example, say that you have a Date1 and that when the user changes the Date1 to let say "2020-02-02" and you wish to use this new date as the `minDate` of the Date2, you can do it via the `changeFormEditorOption()` method as shown below.
414
-
415
- The example below shows code sample for all 3 supported editors AutoComplete, Date (picker), Single/Multiple Select (dropdown)
416
-
417
- ##### View
418
- ```html
419
- <angular-slickgrid grid-id="grid30"
420
- columns.bind="columnDefinitions"
421
- options.bind="gridOptions"
422
- dataset.bind="dataset"
423
- on-composite-editor-change.delegate="handleOnCompositeEditorChange($event.detail.eventData, $event.detail.args)">
424
- </angular-slickgrid>
425
- ```
426
-
427
- ##### ViewModel
428
- ```ts
429
- export class GridExample {
430
- compositeEditorInstance: SlickCompositeEditorComponent;
431
-
432
- /** Composite Editor on change handler */
433
- handleOnCompositeEditorChange(event) {
434
- const args = event.detail.args as OnCompositeEditorChangeEventArgs;
435
- const columnDef = args.column as Column;
436
- const formValues = args.formValues;
437
-
438
- // you can also change some editor options
439
- // not all Editors supports this functionality, so far only these Editors are supported: AutoComplete, Date, Single/Multiple Select
440
- if (columnDef.id === 'completed') {
441
- this.compositeEditorInstance.changeFormEditorOption('percentComplete', 'filter', true); // multiple-select.js, show filter in dropdown
442
- this.compositeEditorInstance.changeFormEditorOption('product', 'minLength', 3); // autocomplete, change minLength char to type
443
- this.compositeEditorInstance.changeFormEditorOption('finish', 'displayDateMin', 'today');
444
- }
445
- }
446
- }
447
- ```
448
-
449
- ### Dynamically Update Select Editor Collection
450
- What if you need to change the collection array of a single/multiple select editor but based on another field input in the form?
451
-
452
- There are 2 ways to do it
453
-
454
- 1. When you use `collectionOverride` (this will work in both the grid and the modal window)
455
- - _the important thing to know is that the `collectionOverride` defined in the column definition below will return `finalCollection` and that is what we refer to as `editor.finalCollection` inside the `handleOnCompositeEditorChange` event handler_
456
-
457
- ##### View
458
- ```html
459
- <angular-slickgrid grid-id="grid30"
460
- columns.bind="columnDefinitions"
461
- options.bind="gridOptions"
462
- dataset.bind="dataset"
463
- on-composite-editor-change.delegate="handleOnCompositeEditorChange($event.detail.eventData, $event.detail.args)">
464
- </angular-slickgrid>
465
- ```
466
-
467
- ##### ViewModel
468
- ```ts
469
- export class GridExample {
470
- compositeEditorInstance: SlickCompositeEditorComponent;
471
-
472
- prepareGrid() {
473
- this.columnDefinitions = [
474
- {
475
- id: 'duration', name: 'Duration', field: 'duration', sortable: true, filterable: true, type: 'number',
476
- editor: { model: Editors.float, massUpdate: true, decimal: 2, required: true },
477
- },
478
- {
479
- id: 'percentComplete', name: '% Complete', field: 'percentComplete', type: 'number',
480
- editor: {
481
- model: Editors.singleSelect,
482
- collection: [ /*...*/ ],
483
- collectionOverride: (_collectionInput, args) => {
484
- const originalCollection = args.originalCollections || [];
485
- const duration = args.dataContext.duration || args.compositeEditorOptions.formValues.duration;
486
- if (duration === 10) {
487
- // a simple filter, when "duration" is 10, we'll remove value "1" from the final collection
488
- return originalCollection.filter(itemCollection => +itemCollection.value !== 1);
489
- }
490
- return originalCollection;
491
- },
492
- minValue: 0, maxValue: 100,
493
- }
494
- },
495
- ];
496
- }
497
-
498
- /** Composite Editor on change handler */
499
- handleOnCompositeEditorChange(event) {
500
- const args = event.detail.args as OnCompositeEditorChangeEventArgs;
501
- const columnDef = args.column as Column;
502
- const formValues = args.formValues;
503
-
504
- // you can dynamically change a select dropdown collection,
505
- // if the collection already got changed but you just need to re-render the editor
506
- // you can just call the `renderDomElement()` method to refresh the dropdown list
507
- if (columnDef.id === 'duration') {
508
- const editor = this.compositeEditorInstance.editors['percentComplete'] as SelectEditor;
509
- const newCollection = editor.finalCollection; // the finalCollection is what is return by the collectionOverride
510
- editor.renderDomElement(newCollection);
511
- }
512
- }
513
- }
514
- ```
515
-
516
- 2. When you simply want to replace the entire collection (this will NOT work in the grid, this will only work in the modal window)
517
- - this is not recommended unless you only care about what happens in the modal window and not in the grid (editing), so option (1) with `collectionOverride` is preferable
518
-
519
- ```ts
520
- export class GridExample {
521
- compositeEditorInstance: SlickCompositeEditorComponent;
522
-
523
- prepareGrid() {
524
- this.columnDefinitions = [
525
- {
526
- id: 'duration', name: 'Duration', field: 'duration', sortable: true, filterable: true, type: 'number',
527
- editor: { model: Editors.float, massUpdate: true, decimal: 2, required: true },
528
- },
529
- {
530
- id: 'percentComplete', name: '% Complete', field: 'percentComplete', type: 'number',
531
- editor: {
532
- model: Editors.singleSelect,
533
- collection: [ /*...*/ ],
534
- minValue: 0, maxValue: 100,
535
- }
536
- },
537
- ];
538
- }
539
-
540
- /** Composite Editor on change handler */
541
- handleOnCompositeEditorChange(event) {
542
- const args = event.detail.args as OnCompositeEditorChangeEventArgs;
543
- const columnDef = args.column as Column;
544
- const formValues = args.formValues;
545
-
546
- // you can dynamically change a select dropdown collection with a completely new collection
547
- // you still need to call the `renderDomElement()` method to refresh the dropdown list
548
- if (columnDef.id === 'duration') {
549
- const editor = this.compositeEditorInstance.editors['percentComplete'] as SelectEditor;
550
- const newCollection = [ /*... */ ];
551
- editor.renderDomElement(newCollection);
552
- }
553
- }
554
- }
555
- ```
556
-
557
- ### Disabling Form Inputs (readonly)
558
- Disabling field(s) is done through the exact same way that you would do it in the grid, which is through the `onBeforeEditCell` SlickGrid event and you can find more in depth info at this other [Wiki - Disabling specific cell edit](../column-functionalities/Editors.md#disabling-specific-cell-edit)
559
-
560
- ```ts
561
- handleOnBeforeEditCell(event) {
562
- const eventData = event.detail.eventData;
563
- const args = event && event.detail && event.detail.args;
564
- const { column, item, grid } = args;
565
-
566
- if (column && item) {
567
- if (!checkItemIsEditable(item, column, grid)) {
568
- event.preventDefault(); // OR eventData.preventDefault();
569
- return false;
570
- }
571
- }
572
- return false;
573
- }
574
-
575
- checkItemIsEditable(dataContext: any, columnDef: Column, grid: SlickGrid) {
576
- const gridOptions = grid?.getOptions();
577
- const hasEditor = columnDef.editor;
578
- const isGridEditable = gridOptions.editable;
579
- let isEditable = (isGridEditable && hasEditor);
580
-
581
- if (dataContext && columnDef && gridOptions && gridOptions.editable) {
582
- switch (columnDef.id) {
583
- case 'finish':
584
- isEditable = !!dataContext?.completed;
585
- break;
586
- // ... some other cases
587
- }
588
- }
589
-
590
- return isEditable;
591
- }
592
- ```
593
- #### Disabling Form Inputs but only in Composite Editor
594
- What if you want to disable certain form inputs but only in the Composite Editor, or use different logic in the grid. For that we added an extra `target` (`target` will return either "grid" or "composite") in the returned `args`, so you could apply different logic based on the target being the grid or the composite editor. For example:
595
-
596
- ```ts
597
- handleOnBeforeEditCell(event) {
598
- const eventData = event.detail.eventData;
599
- const args = event && event.detail && event.detail.args;
600
- const { column, item, grid, target } = args;
601
-
602
- if (column && item) {
603
- if (!checkItemIsEditable(item, column, grid, target )) {
604
- event.preventDefault(); // OR eventData.preventDefault();
605
- return false;
606
- }
607
- }
608
- return false;
609
- }
610
-
611
- checkItemIsEditable(dataContext: any, columnDef: Column, grid: SlickGrid, target: 'grid' | 'composite') {
612
- const gridOptions = grid?.getOptions();
613
- const hasEditor = columnDef.editor;
614
- const isGridEditable = gridOptions.editable;
615
- let isEditable = (isGridEditable && hasEditor);
616
-
617
- if (target === 'composite') {
618
- // ... do composite checks
619
- // isEditable = true;
620
- } else {
621
- // ... do grid checks
622
- // isEditable = true;
623
- }
624
-
625
- return isEditable;
626
- }
627
- ```