angular-slickgrid 4.2.0 → 4.2.3

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 (415) hide show
  1. package/LICENSE +20 -20
  2. package/{dist/app → app}/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +2 -2
  3. package/{dist/app → app}/modules/angular-slickgrid/constants.d.ts +0 -0
  4. package/{dist/app → app}/modules/angular-slickgrid/extensions/index.d.ts +0 -0
  5. package/{dist/app → app}/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -2
  6. package/{dist/app → app}/modules/angular-slickgrid/global-grid-options.d.ts +0 -0
  7. package/{dist/app → app}/modules/angular-slickgrid/index.d.ts +0 -0
  8. package/{dist/app → app}/modules/angular-slickgrid/models/angularComponentOutput.interface.d.ts +0 -0
  9. package/{dist/app → app}/modules/angular-slickgrid/models/angularGridInstance.interface.d.ts +0 -0
  10. package/{dist/app → app}/modules/angular-slickgrid/models/externalTestingDependencies.interface.d.ts +0 -0
  11. package/{dist/app → app}/modules/angular-slickgrid/models/gridOption.interface.d.ts +0 -0
  12. package/{dist/app → app}/modules/angular-slickgrid/models/index.d.ts +0 -0
  13. package/{dist/app → app}/modules/angular-slickgrid/models/rowDetailView.interface.d.ts +0 -0
  14. package/{dist/app → app}/modules/angular-slickgrid/models/slickGrid.interface.d.ts +0 -0
  15. package/{dist/app → app}/modules/angular-slickgrid/modules/angular-slickgrid.module.d.ts +0 -0
  16. package/{dist/app → app}/modules/angular-slickgrid/services/angularUtil.service.d.ts +0 -0
  17. package/{dist/app → app}/modules/angular-slickgrid/services/bsDropdown.service.d.ts +0 -0
  18. package/{dist/app → app}/modules/angular-slickgrid/services/container.service.d.ts +1 -0
  19. package/{dist/app → app}/modules/angular-slickgrid/services/index.d.ts +0 -0
  20. package/{dist/app → app}/modules/angular-slickgrid/services/translater.service.d.ts +0 -0
  21. package/{dist/app → app}/modules/angular-slickgrid/services/utilities.d.ts +0 -0
  22. package/{dist/app → app}/modules/angular-slickgrid/slickgrid-config.d.ts +0 -0
  23. package/docs/assets/lib/multiple-select/README.md +17 -0
  24. package/{dist/esm2020 → esm2020}/angular-slickgrid.mjs +0 -0
  25. package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +1170 -0
  26. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/constants.mjs +1 -1
  27. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/extensions/index.mjs +1 -1
  28. package/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +298 -0
  29. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/global-grid-options.mjs +1 -1
  30. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/index.mjs +1 -1
  31. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +1 -1
  32. package/esm2020/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +2 -0
  33. package/esm2020/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +2 -0
  34. package/esm2020/app/modules/angular-slickgrid/models/gridOption.interface.mjs +2 -0
  35. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/index.mjs +1 -1
  36. package/esm2020/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +2 -0
  37. package/esm2020/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +2 -0
  38. package/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +43 -0
  39. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/angularUtil.service.mjs +4 -4
  40. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +4 -4
  41. package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +29 -0
  42. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/index.mjs +1 -1
  43. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/translater.service.mjs +4 -4
  44. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/utilities.mjs +1 -1
  45. package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/slickgrid-config.mjs +1 -1
  46. package/{dist/esm2020 → esm2020}/public_api.mjs +1 -1
  47. package/{dist/fesm2015 → fesm2015}/angular-slickgrid.mjs +48 -51
  48. package/fesm2015/angular-slickgrid.mjs.map +1 -0
  49. package/{dist/fesm2020 → fesm2020}/angular-slickgrid.mjs +48 -51
  50. package/fesm2020/angular-slickgrid.mjs.map +1 -0
  51. package/{dist/i18n → i18n}/en.json +89 -89
  52. package/{dist/i18n → i18n}/fr.json +90 -90
  53. package/{dist/angular-slickgrid.d.ts → index.d.ts} +0 -0
  54. package/package.json +33 -118
  55. package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
  56. package/test/cypress/node_modules/@cypress/request/README.md +1038 -0
  57. package/test/cypress/node_modules/@cypress/xvfb/README.md +48 -0
  58. package/test/cypress/node_modules/@cypress/xvfb/node_modules/debug/README.md +437 -0
  59. package/test/cypress/node_modules/@types/node/README.md +16 -0
  60. package/test/cypress/node_modules/@types/sinonjs__fake-timers/README.md +16 -0
  61. package/test/cypress/node_modules/@types/sizzle/README.md +16 -0
  62. package/test/cypress/node_modules/@types/yauzl/README.md +16 -0
  63. package/test/cypress/node_modules/@types/yauzl/node_modules/@types/node/README.md +16 -0
  64. package/test/cypress/node_modules/aggregate-error/README.md +61 -0
  65. package/test/cypress/node_modules/ansi-colors/README.md +315 -0
  66. package/test/cypress/node_modules/ansi-escapes/README.md +245 -0
  67. package/test/cypress/node_modules/ansi-regex/README.md +78 -0
  68. package/test/cypress/node_modules/ansi-styles/README.md +152 -0
  69. package/test/cypress/node_modules/arch/README.md +71 -0
  70. package/test/cypress/node_modules/asn1/README.md +50 -0
  71. package/test/cypress/node_modules/assert-plus/README.md +162 -0
  72. package/test/cypress/node_modules/astral-regex/README.md +46 -0
  73. package/test/cypress/node_modules/async/README.md +60 -0
  74. package/test/cypress/node_modules/asynckit/README.md +233 -0
  75. package/test/cypress/node_modules/at-least-node/README.md +25 -0
  76. package/test/cypress/node_modules/aws-sign2/README.md +4 -0
  77. package/test/cypress/node_modules/aws4/README.md +183 -0
  78. package/test/cypress/node_modules/balanced-match/README.md +91 -0
  79. package/test/cypress/node_modules/base64-js/README.md +34 -0
  80. package/test/cypress/node_modules/bcrypt-pbkdf/README.md +45 -0
  81. package/test/cypress/node_modules/blob-util/README.md +623 -0
  82. package/test/cypress/node_modules/bluebird/README.md +57 -0
  83. package/test/cypress/node_modules/brace-expansion/README.md +129 -0
  84. package/test/cypress/node_modules/buffer/README.md +410 -0
  85. package/test/cypress/node_modules/buffer-crc32/README.md +47 -0
  86. package/test/cypress/node_modules/cachedir/README.md +27 -0
  87. package/test/cypress/node_modules/caseless/README.md +45 -0
  88. package/test/cypress/node_modules/chalk/README.md +293 -0
  89. package/test/cypress/node_modules/chalk/node_modules/supports-color/README.md +76 -0
  90. package/test/cypress/node_modules/check-more-types/README.md +952 -0
  91. package/test/cypress/node_modules/ci-info/README.md +114 -0
  92. package/test/cypress/node_modules/clean-stack/README.md +76 -0
  93. package/test/cypress/node_modules/cli-cursor/README.md +55 -0
  94. package/test/cypress/node_modules/cli-table3/README.md +218 -0
  95. package/test/cypress/node_modules/cli-truncate/README.md +139 -0
  96. package/test/cypress/node_modules/color-convert/README.md +68 -0
  97. package/test/cypress/node_modules/color-name/README.md +11 -0
  98. package/test/cypress/node_modules/colorette/README.md +102 -0
  99. package/test/cypress/node_modules/colors/README.md +221 -0
  100. package/test/cypress/node_modules/combined-stream/README.md +138 -0
  101. package/test/cypress/node_modules/commander/README.md +737 -0
  102. package/test/cypress/node_modules/common-tags/README.md +687 -0
  103. package/test/cypress/node_modules/core-util-is/README.md +3 -0
  104. package/test/cypress/node_modules/cross-spawn/README.md +96 -0
  105. package/test/cypress/node_modules/cypress/README.md +25 -0
  106. package/test/cypress/node_modules/cypress/mount-utils/README.md +14 -0
  107. package/test/cypress/node_modules/cypress/react/README.md +414 -0
  108. package/test/cypress/node_modules/cypress/vue/README.md +678 -0
  109. package/test/cypress/node_modules/cypress/vue2/README.md +693 -0
  110. package/test/cypress/node_modules/dashdash/README.md +574 -0
  111. package/test/cypress/node_modules/dayjs/README.md +128 -0
  112. package/test/cypress/node_modules/debug/README.md +455 -0
  113. package/test/cypress/node_modules/delayed-stream/README.md +141 -0
  114. package/test/cypress/node_modules/ecc-jsbn/README.md +8 -0
  115. package/test/cypress/node_modules/emoji-regex/README.md +73 -0
  116. package/test/cypress/node_modules/end-of-stream/README.md +54 -0
  117. package/test/cypress/node_modules/enquirer/README.md +1752 -0
  118. package/test/cypress/node_modules/escape-string-regexp/README.md +27 -0
  119. package/test/cypress/node_modules/eventemitter2/README.md +809 -0
  120. package/test/cypress/node_modules/execa/README.md +656 -0
  121. package/test/cypress/node_modules/executable/README.md +64 -0
  122. package/test/cypress/node_modules/extend/README.md +81 -0
  123. package/test/cypress/node_modules/extract-zip/README.md +57 -0
  124. package/test/cypress/node_modules/extract-zip/node_modules/debug/README.md +455 -0
  125. package/test/cypress/node_modules/extsprintf/README.md +46 -0
  126. package/test/cypress/node_modules/fd-slicer/README.md +199 -0
  127. package/test/cypress/node_modules/figures/README.md +139 -0
  128. package/test/cypress/node_modules/forever-agent/README.md +4 -0
  129. package/test/cypress/node_modules/form-data/README.md +234 -0
  130. package/test/cypress/node_modules/fs-extra/README.md +264 -0
  131. package/test/cypress/node_modules/fs.realpath/README.md +33 -0
  132. package/test/cypress/node_modules/get-stream/README.md +124 -0
  133. package/test/cypress/node_modules/getos/README.md +79 -0
  134. package/test/cypress/node_modules/getpass/README.md +32 -0
  135. package/test/cypress/node_modules/glob/README.md +375 -0
  136. package/test/cypress/node_modules/global-dirs/README.md +72 -0
  137. package/test/cypress/node_modules/graceful-fs/README.md +133 -0
  138. package/test/cypress/node_modules/has-flag/README.md +89 -0
  139. package/test/cypress/node_modules/http-signature/README.md +80 -0
  140. package/test/cypress/node_modules/human-signals/README.md +155 -0
  141. package/test/cypress/node_modules/ieee754/README.md +51 -0
  142. package/test/cypress/node_modules/indent-string/README.md +70 -0
  143. package/test/cypress/node_modules/inflight/README.md +37 -0
  144. package/test/cypress/node_modules/inherits/README.md +42 -0
  145. package/test/cypress/node_modules/ini/README.md +102 -0
  146. package/test/cypress/node_modules/is-ci/README.md +50 -0
  147. package/test/cypress/node_modules/is-fullwidth-code-point/README.md +39 -0
  148. package/test/cypress/node_modules/is-installed-globally/README.md +31 -0
  149. package/test/cypress/node_modules/is-path-inside/README.md +63 -0
  150. package/test/cypress/node_modules/is-stream/README.md +57 -0
  151. package/test/cypress/node_modules/is-typedarray/README.md +16 -0
  152. package/test/cypress/node_modules/isexe/README.md +51 -0
  153. package/test/cypress/node_modules/isstream/README.md +66 -0
  154. package/test/cypress/node_modules/jsbn/README.md +175 -0
  155. package/test/cypress/node_modules/json-schema/README.md +3 -0
  156. package/test/cypress/node_modules/json-stringify-safe/README.md +52 -0
  157. package/test/cypress/node_modules/jsonfile/README.md +205 -0
  158. package/test/cypress/node_modules/jsonfile/node_modules/universalify/README.md +76 -0
  159. package/test/cypress/node_modules/jsprim/README.md +287 -0
  160. package/test/cypress/node_modules/lazy-ass/README.md +269 -0
  161. package/test/cypress/node_modules/listr2/README.md +17 -0
  162. package/test/cypress/node_modules/lodash/README.md +39 -0
  163. package/test/cypress/node_modules/lodash.once/README.md +18 -0
  164. package/test/cypress/node_modules/log-symbols/README.md +51 -0
  165. package/test/cypress/node_modules/log-update/README.md +97 -0
  166. package/test/cypress/node_modules/log-update/node_modules/slice-ansi/README.md +66 -0
  167. package/test/cypress/node_modules/log-update/node_modules/wrap-ansi/README.md +97 -0
  168. package/test/cypress/node_modules/lru-cache/README.md +166 -0
  169. package/test/cypress/node_modules/merge-stream/README.md +78 -0
  170. package/test/cypress/node_modules/mime-db/README.md +102 -0
  171. package/test/cypress/node_modules/mime-types/README.md +123 -0
  172. package/test/cypress/node_modules/mimic-fn/README.md +69 -0
  173. package/test/cypress/node_modules/minimatch/README.md +209 -0
  174. package/test/cypress/node_modules/ms/README.md +60 -0
  175. package/test/cypress/node_modules/npm-run-path/README.md +115 -0
  176. package/test/cypress/node_modules/once/README.md +79 -0
  177. package/test/cypress/node_modules/onetime/README.md +94 -0
  178. package/test/cypress/node_modules/ospath/README.md +53 -0
  179. package/test/cypress/node_modules/p-map/README.md +89 -0
  180. package/test/cypress/node_modules/path-is-absolute/README.md +59 -0
  181. package/test/cypress/node_modules/path-key/README.md +61 -0
  182. package/test/cypress/node_modules/pend/README.md +41 -0
  183. package/test/cypress/node_modules/performance-now/README.md +30 -0
  184. package/test/cypress/node_modules/pify/README.md +119 -0
  185. package/test/cypress/node_modules/pretty-bytes/README.md +131 -0
  186. package/test/cypress/node_modules/proxy-from-env/README.md +131 -0
  187. package/test/cypress/node_modules/psl/README.md +215 -0
  188. package/test/cypress/node_modules/pump/README.md +65 -0
  189. package/test/cypress/node_modules/punycode/README.md +122 -0
  190. package/test/cypress/node_modules/qs/README.md +475 -0
  191. package/test/cypress/node_modules/request-progress/README.md +78 -0
  192. package/test/cypress/node_modules/restore-cursor/README.md +26 -0
  193. package/test/cypress/node_modules/rimraf/README.md +101 -0
  194. package/test/cypress/node_modules/rxjs/README.md +147 -0
  195. package/test/cypress/node_modules/rxjs/_esm2015/README.md +147 -0
  196. package/test/cypress/node_modules/rxjs/_esm5/README.md +147 -0
  197. package/test/cypress/node_modules/rxjs/src/README.md +147 -0
  198. package/test/cypress/node_modules/safe-buffer/README.md +584 -0
  199. package/test/cypress/node_modules/safer-buffer/README.md +156 -0
  200. package/test/cypress/node_modules/semver/README.md +566 -0
  201. package/test/cypress/node_modules/shebang-command/README.md +34 -0
  202. package/test/cypress/node_modules/shebang-regex/README.md +33 -0
  203. package/test/cypress/node_modules/signal-exit/README.md +39 -0
  204. package/test/cypress/node_modules/slice-ansi/README.md +72 -0
  205. package/test/cypress/node_modules/sshpk/README.md +804 -0
  206. package/test/cypress/node_modules/string-width/README.md +50 -0
  207. package/test/cypress/node_modules/strip-ansi/README.md +46 -0
  208. package/test/cypress/node_modules/strip-final-newline/README.md +30 -0
  209. package/test/cypress/node_modules/supports-color/README.md +77 -0
  210. package/test/cypress/node_modules/throttleit/README.md +32 -0
  211. package/test/cypress/node_modules/tmp/README.md +365 -0
  212. package/test/cypress/node_modules/tough-cookie/README.md +527 -0
  213. package/test/cypress/node_modules/tslib/README.md +142 -0
  214. package/test/cypress/node_modules/tunnel-agent/README.md +4 -0
  215. package/test/cypress/node_modules/tweetnacl/README.md +459 -0
  216. package/test/cypress/node_modules/type-fest/README.md +760 -0
  217. package/test/cypress/node_modules/universalify/README.md +76 -0
  218. package/test/cypress/node_modules/untildify/README.md +30 -0
  219. package/test/cypress/node_modules/uuid/README.md +505 -0
  220. package/test/cypress/node_modules/verror/README.md +528 -0
  221. package/test/cypress/node_modules/verror/node_modules/extsprintf/README.md +46 -0
  222. package/test/cypress/node_modules/which/README.md +54 -0
  223. package/test/cypress/node_modules/wrap-ansi/README.md +91 -0
  224. package/test/cypress/node_modules/wrappy/README.md +36 -0
  225. package/test/cypress/node_modules/yallist/README.md +204 -0
  226. package/test/cypress/node_modules/yauzl/README.md +658 -0
  227. package/.browserslistrc +0 -12
  228. package/.codecov.yml +0 -17
  229. package/.editorconfig +0 -18
  230. package/.eslintrc.json +0 -50
  231. package/.github/CODE_OF_CONDUCT.md +0 -76
  232. package/.github/FUNDING.yml +0 -8
  233. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -54
  234. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  235. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -44
  236. package/.github/renovate.json5 +0 -26
  237. package/.github/stale.yml +0 -7
  238. package/.github/workflows/main.yml +0 -83
  239. package/.vscode/extensions.json +0 -9
  240. package/.vscode/launch.json +0 -72
  241. package/.vscode/settings.json +0 -7
  242. package/.vscode/tasks.json +0 -77
  243. package/CHANGELOG.md +0 -1172
  244. package/angular.json +0 -148
  245. package/dist/LICENSE +0 -20
  246. package/dist/README.md +0 -182
  247. package/dist/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +0 -1171
  248. package/dist/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +0 -300
  249. package/dist/esm2020/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +0 -2
  250. package/dist/esm2020/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +0 -2
  251. package/dist/esm2020/app/modules/angular-slickgrid/models/gridOption.interface.mjs +0 -2
  252. package/dist/esm2020/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +0 -2
  253. package/dist/esm2020/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +0 -2
  254. package/dist/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +0 -46
  255. package/dist/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +0 -26
  256. package/dist/fesm2015/angular-slickgrid.mjs.map +0 -1
  257. package/dist/fesm2020/angular-slickgrid.mjs.map +0 -1
  258. package/dist/package.json +0 -79
  259. package/global.d.ts +0 -1
  260. package/ngcc.config.js +0 -13
  261. package/screenshots/column-picker.png +0 -0
  262. package/screenshots/composite-editor.png +0 -0
  263. package/screenshots/draggable-grouping.png +0 -0
  264. package/screenshots/editors.png +0 -0
  265. package/screenshots/export-to-file.png +0 -0
  266. package/screenshots/filter_and_sort.png +0 -0
  267. package/screenshots/formatters.png +0 -0
  268. package/screenshots/frozen.png +0 -0
  269. package/screenshots/multipleSelectFilter.png +0 -0
  270. package/screenshots/pagination.png +0 -0
  271. package/screenshots/selectFilter.png +0 -0
  272. package/screenshots/singleFilter.png +0 -0
  273. package/src/app/app-routing.module.ts +0 -83
  274. package/src/app/app.component.html +0 -160
  275. package/src/app/app.component.scss +0 -65
  276. package/src/app/app.component.ts +0 -10
  277. package/src/app/app.module.ts +0 -175
  278. package/src/app/examples/custom-angularComponentEditor.ts +0 -184
  279. package/src/app/examples/custom-angularComponentFilter.ts +0 -126
  280. package/src/app/examples/custom-inputEditor.ts +0 -124
  281. package/src/app/examples/custom-inputFilter.ts +0 -142
  282. package/src/app/examples/custom-titleFormatter.component.ts +0 -8
  283. package/src/app/examples/editor-ng-select.component.ts +0 -37
  284. package/src/app/examples/filter-ng-select.component.ts +0 -32
  285. package/src/app/examples/grid-additem.component.html +0 -48
  286. package/src/app/examples/grid-additem.component.ts +0 -272
  287. package/src/app/examples/grid-angular.component.html +0 -79
  288. package/src/app/examples/grid-angular.component.scss +0 -28
  289. package/src/app/examples/grid-angular.component.ts +0 -370
  290. package/src/app/examples/grid-autoheight.component.html +0 -52
  291. package/src/app/examples/grid-autoheight.component.ts +0 -147
  292. package/src/app/examples/grid-basic.component.html +0 -29
  293. package/src/app/examples/grid-basic.component.ts +0 -82
  294. package/src/app/examples/grid-clientside.component.html +0 -51
  295. package/src/app/examples/grid-clientside.component.ts +0 -293
  296. package/src/app/examples/grid-colspan.component.html +0 -39
  297. package/src/app/examples/grid-colspan.component.scss +0 -11
  298. package/src/app/examples/grid-colspan.component.ts +0 -155
  299. package/src/app/examples/grid-composite-editor.component.html +0 -79
  300. package/src/app/examples/grid-composite-editor.component.scss +0 -19
  301. package/src/app/examples/grid-composite-editor.component.ts +0 -948
  302. package/src/app/examples/grid-contextmenu.component.html +0 -62
  303. package/src/app/examples/grid-contextmenu.component.scss +0 -44
  304. package/src/app/examples/grid-contextmenu.component.ts +0 -473
  305. package/src/app/examples/grid-custom-tooltip.component.html +0 -25
  306. package/src/app/examples/grid-custom-tooltip.component.scss +0 -77
  307. package/src/app/examples/grid-custom-tooltip.component.ts +0 -483
  308. package/src/app/examples/grid-draggrouping.component.html +0 -93
  309. package/src/app/examples/grid-draggrouping.component.ts +0 -397
  310. package/src/app/examples/grid-editor.component.html +0 -88
  311. package/src/app/examples/grid-editor.component.ts +0 -699
  312. package/src/app/examples/grid-formatter.component.html +0 -26
  313. package/src/app/examples/grid-formatter.component.ts +0 -162
  314. package/src/app/examples/grid-frozen.component.html +0 -65
  315. package/src/app/examples/grid-frozen.component.scss +0 -11
  316. package/src/app/examples/grid-frozen.component.ts +0 -303
  317. package/src/app/examples/grid-graphql-nopage.component.html +0 -33
  318. package/src/app/examples/grid-graphql-nopage.component.scss +0 -9
  319. package/src/app/examples/grid-graphql-nopage.component.ts +0 -242
  320. package/src/app/examples/grid-graphql.component.html +0 -87
  321. package/src/app/examples/grid-graphql.component.ts +0 -304
  322. package/src/app/examples/grid-grouping.component.html +0 -80
  323. package/src/app/examples/grid-grouping.component.ts +0 -313
  324. package/src/app/examples/grid-headerbutton.component.html +0 -31
  325. package/src/app/examples/grid-headerbutton.component.scss +0 -10
  326. package/src/app/examples/grid-headerbutton.component.ts +0 -233
  327. package/src/app/examples/grid-headermenu.component.html +0 -31
  328. package/src/app/examples/grid-headermenu.component.scss +0 -25
  329. package/src/app/examples/grid-headermenu.component.ts +0 -159
  330. package/src/app/examples/grid-localization.component.html +0 -54
  331. package/src/app/examples/grid-localization.component.ts +0 -293
  332. package/src/app/examples/grid-menu.component.html +0 -37
  333. package/src/app/examples/grid-menu.component.scss +0 -28
  334. package/src/app/examples/grid-menu.component.ts +0 -229
  335. package/src/app/examples/grid-odata.component.html +0 -116
  336. package/src/app/examples/grid-odata.component.ts +0 -441
  337. package/src/app/examples/grid-range.component.html +0 -74
  338. package/src/app/examples/grid-range.component.ts +0 -291
  339. package/src/app/examples/grid-remote.component.html +0 -37
  340. package/src/app/examples/grid-remote.component.ts +0 -153
  341. package/src/app/examples/grid-resize-by-content.component.html +0 -62
  342. package/src/app/examples/grid-resize-by-content.component.scss +0 -19
  343. package/src/app/examples/grid-resize-by-content.component.ts +0 -780
  344. package/src/app/examples/grid-rowdetail.component.html +0 -35
  345. package/src/app/examples/grid-rowdetail.component.ts +0 -205
  346. package/src/app/examples/grid-rowmove.component.html +0 -49
  347. package/src/app/examples/grid-rowmove.component.ts +0 -234
  348. package/src/app/examples/grid-rowselection.component.html +0 -76
  349. package/src/app/examples/grid-rowselection.component.ts +0 -267
  350. package/src/app/examples/grid-state.component.html +0 -36
  351. package/src/app/examples/grid-state.component.ts +0 -259
  352. package/src/app/examples/grid-tabs.component.html +0 -35
  353. package/src/app/examples/grid-tabs.component.ts +0 -115
  354. package/src/app/examples/grid-trading.component.html +0 -58
  355. package/src/app/examples/grid-trading.component.scss +0 -49
  356. package/src/app/examples/grid-trading.component.ts +0 -319
  357. package/src/app/examples/grid-tree-data-hierarchical.component.html +0 -79
  358. package/src/app/examples/grid-tree-data-hierarchical.component.scss +0 -47
  359. package/src/app/examples/grid-tree-data-hierarchical.component.ts +0 -311
  360. package/src/app/examples/grid-tree-data-parent-child.component.html +0 -108
  361. package/src/app/examples/grid-tree-data-parent-child.component.scss +0 -10
  362. package/src/app/examples/grid-tree-data-parent-child.component.ts +0 -351
  363. package/src/app/examples/home.component.html +0 -41
  364. package/src/app/examples/home.component.ts +0 -9
  365. package/src/app/examples/rowdetail-preload.component.ts +0 -10
  366. package/src/app/examples/rowdetail-view.component.html +0 -36
  367. package/src/app/examples/rowdetail-view.component.ts +0 -54
  368. package/src/app/examples/swt-common-grid-pagination.component.ts +0 -156
  369. package/src/app/examples/swt-common-grid-test.component.html +0 -30
  370. package/src/app/examples/swt-common-grid-test.component.ts +0 -219
  371. package/src/app/examples/swt-common-grid.component.ts +0 -436
  372. package/src/app/examples/swt-logger.service.ts +0 -165
  373. package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.html +0 -4
  374. package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.ts +0 -1395
  375. package/src/app/modules/angular-slickgrid/constants.ts +0 -97
  376. package/src/app/modules/angular-slickgrid/extensions/index.ts +0 -1
  377. package/src/app/modules/angular-slickgrid/extensions/slickRowDetailView.ts +0 -375
  378. package/src/app/modules/angular-slickgrid/global-grid-options.ts +0 -245
  379. package/src/app/modules/angular-slickgrid/index.ts +0 -11
  380. package/src/app/modules/angular-slickgrid/models/angularComponentOutput.interface.ts +0 -6
  381. package/src/app/modules/angular-slickgrid/models/angularGridInstance.interface.ts +0 -68
  382. package/src/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.ts +0 -37
  383. package/src/app/modules/angular-slickgrid/models/gridOption.interface.ts +0 -12
  384. package/src/app/modules/angular-slickgrid/models/index.ts +0 -6
  385. package/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts +0 -33
  386. package/src/app/modules/angular-slickgrid/models/slickGrid.interface.ts +0 -7
  387. package/src/app/modules/angular-slickgrid/modules/angular-slickgrid.module.ts +0 -37
  388. package/src/app/modules/angular-slickgrid/services/angularUtil.service.ts +0 -48
  389. package/src/app/modules/angular-slickgrid/services/bsDropdown.service.ts +0 -142
  390. package/src/app/modules/angular-slickgrid/services/container.service.ts +0 -24
  391. package/src/app/modules/angular-slickgrid/services/index.ts +0 -5
  392. package/src/app/modules/angular-slickgrid/services/translater.service.ts +0 -38
  393. package/src/app/modules/angular-slickgrid/services/utilities.ts +0 -19
  394. package/src/app/modules/angular-slickgrid/slickgrid-config.ts +0 -10
  395. package/src/app/slickgrid-custom-variables.scss +0 -10
  396. package/src/assets/.gitkeep +0 -0
  397. package/src/assets/data/collection_100_numbers.json +0 -12
  398. package/src/assets/data/collection_500_numbers.json +0 -52
  399. package/src/assets/data/countries.json +0 -245
  400. package/src/assets/data/country_names.json +0 -245
  401. package/src/assets/data/customers_100.json +0 -102
  402. package/src/assets/i18n/en.json +0 -90
  403. package/src/assets/i18n/fr.json +0 -91
  404. package/src/environments/environment.prod.ts +0 -3
  405. package/src/environments/environment.ts +0 -8
  406. package/src/favicon.ico +0 -0
  407. package/src/index.html +0 -18
  408. package/src/main.ts +0 -13
  409. package/src/polyfills.ts +0 -52
  410. package/src/public_api.ts +0 -1
  411. package/src/styles.scss +0 -66
  412. package/src/typings.d.ts +0 -10
  413. package/tsconfig.app.json +0 -25
  414. package/tsconfig.json +0 -40
  415. package/tsconfig.spec.json +0 -23
@@ -1,948 +0,0 @@
1
- import { Component, OnInit, ViewEncapsulation } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { ExcelExportService } from '@slickgrid-universal/excel-export';
4
- import { SlickCompositeEditorComponent } from '@slickgrid-universal/composite-editor-component';
5
-
6
- import {
7
- AngularGridInstance,
8
- AutocompleteOption,
9
- Column,
10
- CompositeEditorModalType,
11
- EditCommand,
12
- Editors,
13
- FieldType,
14
- Filters,
15
- formatNumber,
16
- Formatter,
17
- Formatters,
18
- GridOption,
19
- GridStateChange,
20
- LongTextEditorOption,
21
- OnCompositeEditorChangeEventArgs,
22
- SlickGrid,
23
- SlickNamespace,
24
- SortComparers,
25
- } from '../modules/angular-slickgrid';
26
-
27
- const NB_ITEMS = 500;
28
- const URL_COUNTRIES_COLLECTION = 'assets/data/countries.json';
29
-
30
- // using external SlickGrid JS libraries
31
- declare const Slick: SlickNamespace;
32
-
33
- /**
34
- * Check if the current item (cell) is editable or not
35
- * @param {*} dataContext - item data context object
36
- * @param {*} columnDef - column definition
37
- * @param {*} grid - slickgrid grid object
38
- * @returns {boolean} isEditable
39
- */
40
- function checkItemIsEditable(dataContext: any, columnDef: Column, grid: SlickGrid) {
41
- const gridOptions = grid && grid.getOptions && grid.getOptions();
42
- const hasEditor = columnDef.editor;
43
- const isGridEditable = gridOptions.editable;
44
- let isEditable = !!(isGridEditable && hasEditor);
45
-
46
- if (dataContext && columnDef && gridOptions && gridOptions.editable) {
47
- switch (columnDef.id) {
48
- case 'finish':
49
- // case 'percentComplete':
50
- isEditable = !!dataContext?.completed;
51
- break;
52
- // case 'completed':
53
- // case 'duration':
54
- // case 'title':
55
- // case 'product':
56
- // case 'origin':
57
- // isEditable = dataContext.percentComplete < 50;
58
- // break;
59
- }
60
- }
61
- return isEditable;
62
- }
63
-
64
-
65
- const customEditableInputFormatter: Formatter = (_row, _cell, value, columnDef, _dataContext, grid) => {
66
- const gridOptions = grid && grid.getOptions && grid.getOptions();
67
- const isEditableLine = gridOptions.editable && columnDef.editor;
68
- value = (value === null || value === undefined) ? '' : value;
69
- return isEditableLine ? { text: value, addClasses: 'editable-field', toolTip: 'Click to Edit' } : value;
70
- };
71
-
72
- // you can create custom validator to pass to an inline editor
73
- const myCustomTitleValidator = (value: any, args: any) => {
74
- if ((value === null || value === undefined || !value.length) && (args.compositeEditorOptions && args.compositeEditorOptions.modalType === 'create' || args.compositeEditorOptions.modalType === 'edit')) {
75
- // we will only check if the field is supplied when it's an inline editing OR a composite editor of type create/edit
76
- return { valid: false, msg: 'This is a required field.' };
77
- } else if (!/^(task\s\d+)*$/i.test(value)) {
78
- return { valid: false, msg: 'Your title is invalid, it must start with "Task" followed by a number.' };
79
- }
80
- return { valid: true, msg: '' };
81
- };
82
-
83
- @Component({
84
- templateUrl: './grid-composite-editor.component.html',
85
- styleUrls: ['./grid-composite-editor.component.scss'],
86
- encapsulation: ViewEncapsulation.None,
87
- })
88
- export class GridCompositeEditorComponent implements OnInit {
89
- title = 'Example 30: Composite Editor Modal';
90
- subTitle = `Composite Editor allows you to Create, Clone, Edit, Mass Update & Mass Selection Changes inside a nice Modal Window.
91
- <br>The modal is simply populated by looping through your column definition list and also uses a lot of the same logic as inline editing (see <a href="https://github.com/ghiscoding/aurelia-slickgrid/wiki/Composite-Editor-Modal" target="_blank">Composite Editor - Wiki</a>.)`;
92
-
93
- angularGrid!: AngularGridInstance;
94
- compositeEditorInstance!: SlickCompositeEditorComponent;
95
- gridOptions!: GridOption;
96
- columnDefinitions: Column[] = [];
97
- dataset: any[] = [];
98
- editQueue: any[] = [];
99
- editedItems: any = {};
100
- isGridEditable = true;
101
- isCompositeDisabled = false;
102
- isMassSelectionDisabled = true;
103
- complexityLevelList = [
104
- { value: 0, label: 'Very Simple' },
105
- { value: 1, label: 'Simple' },
106
- { value: 2, label: 'Straightforward' },
107
- { value: 3, label: 'Complex' },
108
- { value: 4, label: 'Very Complex' },
109
- ];
110
-
111
- constructor(private http: HttpClient) {
112
- this.compositeEditorInstance = new SlickCompositeEditorComponent();
113
- }
114
-
115
- angularGridReady(angularGrid: AngularGridInstance) {
116
- this.angularGrid = angularGrid;
117
- }
118
-
119
- ngOnInit(): void {
120
- this.prepareGrid();
121
-
122
- // mock a dataset
123
- this.dataset = this.loadData(NB_ITEMS);
124
- }
125
-
126
- prepareGrid() {
127
- this.columnDefinitions = [
128
- {
129
- id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string, minWidth: 75,
130
- filterable: true, columnGroup: 'Common Factor',
131
- filter: { model: Filters.compoundInputText },
132
- formatter: Formatters.multiple, params: { formatters: [Formatters.uppercase, Formatters.bold] },
133
- editor: {
134
- model: Editors.longText, massUpdate: false, required: true, alwaysSaveOnEnterKey: true,
135
- maxLength: 12,
136
- editorOptions: {
137
- cols: 45,
138
- rows: 6,
139
- buttonTexts: {
140
- cancel: 'Close',
141
- save: 'Done'
142
- }
143
- } as LongTextEditorOption,
144
- validator: myCustomTitleValidator,
145
- },
146
- },
147
- {
148
- id: 'duration', name: 'Duration', field: 'duration', sortable: true, filterable: true, minWidth: 75,
149
- type: FieldType.number, columnGroup: 'Common Factor',
150
- formatter: (_row, _cell, value) => {
151
- if (value === null || value === undefined || value === '') {
152
- return '';
153
- }
154
- return value > 1 ? `${value} days` : `${value} day`;
155
- },
156
- editor: { model: Editors.float, massUpdate: true, decimal: 2, valueStep: 1, minValue: 0, maxValue: 10000, alwaysSaveOnEnterKey: true, required: true },
157
- },
158
- {
159
- id: 'cost', name: 'Cost', field: 'cost', width: 90, minWidth: 70,
160
- sortable: true, filterable: true, type: FieldType.number, columnGroup: 'Analysis',
161
- filter: { model: Filters.compoundInputNumber },
162
- formatter: Formatters.dollar,
163
- },
164
- {
165
- id: 'percentComplete', name: '% Complete', field: 'percentComplete', minWidth: 100,
166
- type: FieldType.number,
167
- sortable: true, filterable: true, columnGroup: 'Analysis',
168
- filter: { model: Filters.compoundSlider, operator: '>=' },
169
- editor: {
170
- model: Editors.slider,
171
- massUpdate: true, minValue: 0, maxValue: 100,
172
- },
173
- },
174
- // {
175
- // id: 'percentComplete2', name: '% Complete', field: 'analysis.percentComplete', minWidth: 100,
176
- // type: FieldType.number,
177
- // sortable: true, filterable: true, columnGroup: 'Analysis',
178
- // // filter: { model: Filters.compoundSlider, operator: '>=' },
179
- // formatter: Formatters.complex,
180
- // exportCustomFormatter: Formatters.complex, // without the Editing cell Formatter
181
- // editor: {
182
- // model: Editors.singleSelect,
183
- // serializeComplexValueFormat: 'flat', // if we keep "object" as the default it will apply { value: 2, label: 2 } which is not what we want in this case
184
- // collection: Array.from(Array(101).keys()).map(k => ({ value: k, label: k })),
185
- // collectionOptions: {
186
- // addCustomFirstEntry: { value: '', label: '--none--' }
187
- // },
188
- // collectionOverride: (_collectionInput, args) => {
189
- // const originalCollection = args.originalCollections || [];
190
- // const duration = args?.dataContext?.duration ?? args?.compositeEditorOptions?.formValues?.duration;
191
- // if (duration === 10) {
192
- // return originalCollection.filter(itemCollection => +itemCollection.value !== 1);
193
- // }
194
- // return originalCollection;
195
- // },
196
- // massUpdate: true, minValue: 0, maxValue: 100,
197
- // },
198
- // },
199
- {
200
- id: 'complexity', name: 'Complexity', field: 'complexity', minWidth: 100,
201
- type: FieldType.number,
202
- sortable: true, filterable: true, columnGroup: 'Analysis',
203
- formatter: (_row, _cell, value) => this.complexityLevelList[value].label,
204
- exportCustomFormatter: (_row, _cell, value) => this.complexityLevelList[value].label,
205
- filter: {
206
- model: Filters.multipleSelect,
207
- collection: this.complexityLevelList
208
- },
209
- editor: {
210
- model: Editors.singleSelect,
211
- collection: this.complexityLevelList,
212
- massUpdate: true
213
- },
214
- },
215
- {
216
- id: 'start', name: 'Start', field: 'start', sortable: true, minWidth: 100,
217
- formatter: Formatters.dateUs, columnGroup: 'Period',
218
- exportCustomFormatter: Formatters.dateUs,
219
- type: FieldType.date, outputType: FieldType.dateUs, saveOutputType: FieldType.dateUtc,
220
- filterable: true, filter: { model: Filters.compoundDate },
221
- editor: { model: Editors.date, massUpdate: true, params: { hideClearButton: false } },
222
- },
223
- {
224
- id: 'completed', name: 'Completed', field: 'completed', width: 80, minWidth: 75, maxWidth: 100,
225
- sortable: true, filterable: true, columnGroup: 'Period',
226
- formatter: Formatters.multiple,
227
- params: { formatters: [Formatters.checkmark, Formatters.center] },
228
- exportWithFormatter: false,
229
- filter: {
230
- collection: [{ value: '', label: '' }, { value: true, label: 'True' }, { value: false, label: 'False' }],
231
- model: Filters.singleSelect
232
- },
233
- editor: { model: Editors.checkbox, massUpdate: true, },
234
- // editor: { model: Editors.singleSelect, collection: [{ value: true, label: 'Yes' }, { value: false, label: 'No' }], },
235
- },
236
- {
237
- id: 'finish', name: 'Finish', field: 'finish', sortable: true, minWidth: 100,
238
- formatter: Formatters.dateUs, columnGroup: 'Period',
239
- type: FieldType.date, outputType: FieldType.dateUs, saveOutputType: FieldType.dateUtc,
240
- filterable: true, filter: { model: Filters.compoundDate },
241
- exportCustomFormatter: Formatters.dateUs,
242
- editor: {
243
- model: Editors.date,
244
- editorOptions: { minDate: 'today' },
245
- massUpdate: true,
246
- validator: (value, args) => {
247
- const dataContext = args && args.item;
248
- if (dataContext && (dataContext.completed && !value)) {
249
- return { valid: false, msg: 'You must provide a "Finish" date when "Completed" is checked.' };
250
- }
251
- return { valid: true, msg: '' };
252
- }
253
- },
254
- },
255
- {
256
- id: 'product', name: 'Product', field: 'product',
257
- filterable: true, columnGroup: 'Item',
258
- minWidth: 100,
259
- exportWithFormatter: true,
260
- dataKey: 'id',
261
- labelKey: 'itemName',
262
- formatter: Formatters.complexObject,
263
- exportCustomFormatter: Formatters.complex, // without the Editing cell Formatter
264
- type: FieldType.object,
265
- sortComparer: SortComparers.objectString,
266
- editor: {
267
- model: Editors.autoComplete,
268
- alwaysSaveOnEnterKey: true,
269
- massUpdate: true,
270
-
271
- // example with a Remote API call
272
- editorOptions: {
273
- minLength: 1,
274
- source: (request, response) => {
275
- // const items = require('c://TEMP/items.json');
276
- const products = this.mockProducts();
277
- response(products.filter(product => product.itemName.toLowerCase().includes(request.term.toLowerCase())));
278
- },
279
- renderItem: {
280
- // layout: 'twoRows',
281
- // templateCallback: (item: any) => this.renderItemCallbackWith2Rows(item),
282
-
283
- layout: 'fourCorners',
284
- templateCallback: (item: any) => this.renderItemCallbackWith4Corners(item),
285
- },
286
- } as AutocompleteOption,
287
- },
288
- filter: {
289
- model: Filters.inputText,
290
- // placeholder: '🔎︎ search city',
291
- type: FieldType.string,
292
- queryField: 'product.itemName',
293
- }
294
- },
295
- {
296
- id: 'origin', name: 'Country of Origin', field: 'origin',
297
- formatter: Formatters.complexObject, columnGroup: 'Item',
298
- exportCustomFormatter: Formatters.complex, // without the Editing cell Formatter
299
- dataKey: 'code',
300
- labelKey: 'name',
301
- type: FieldType.object,
302
- sortComparer: SortComparers.objectString,
303
- filterable: true,
304
- sortable: true,
305
- minWidth: 100,
306
- editor: {
307
- model: Editors.autoComplete,
308
- massUpdate: true,
309
- customStructure: { label: 'name', value: 'code' },
310
- collectionAsync: this.http.get(URL_COUNTRIES_COLLECTION),
311
- },
312
- filter: {
313
- model: Filters.inputText,
314
- type: 'string',
315
- queryField: 'origin.name',
316
- }
317
- },
318
- {
319
- id: 'action', name: 'Action', field: 'action', width: 70, minWidth: 70, maxWidth: 70,
320
- excludeFromExport: true,
321
- formatter: () => `<div class="button-style margin-auto" style="width: 35px;"><span class="fa fa-chevron-down text-primary"></span></div>`,
322
- cellMenu: {
323
- hideCloseButton: false,
324
- commandTitle: 'Commands',
325
- commandItems: [
326
- {
327
- command: 'edit',
328
- title: 'Edit Row',
329
- iconCssClass: 'fa fa-pencil',
330
- positionOrder: 66,
331
- action: () => this.openCompositeModal('edit'),
332
- },
333
- {
334
- command: 'clone',
335
- title: 'Clone Row',
336
- iconCssClass: 'fa fa-clone',
337
- positionOrder: 66,
338
- action: () => this.openCompositeModal('clone'),
339
- },
340
- 'divider',
341
- {
342
- command: 'delete-row', title: 'Delete Row', positionOrder: 64,
343
- iconCssClass: 'fa fa-times color-danger', cssClass: 'red', textCssClass: 'text-italic color-danger-light',
344
- // only show command to 'Delete Row' when the task is not completed
345
- itemVisibilityOverride: (args) => {
346
- return !args.dataContext?.completed;
347
- },
348
- action: (_event, args) => {
349
- const dataContext = args.dataContext;
350
- const row = args?.row ?? 0;
351
- if (confirm(`Do you really want to delete row (${row + 1}) with "${dataContext.title}"`)) {
352
- this.angularGrid.gridService.deleteItemById(dataContext.id);
353
- }
354
- }
355
- },
356
- ],
357
- }
358
- },
359
- ];
360
-
361
- this.gridOptions = {
362
- enableAddRow: true, // <-- this flag is required to work with the (create & clone) modal types
363
- enableCellNavigation: true,
364
- asyncEditorLoading: false,
365
- autoEdit: true,
366
- autoCommitEdit: true,
367
- editable: true,
368
- autoAddCustomEditorFormatter: customEditableInputFormatter,
369
- autoResize: {
370
- container: '#demo-container',
371
- rightPadding: 10
372
- },
373
- enableAutoSizeColumns: true,
374
- enableAutoResize: true,
375
- showCustomFooter: true,
376
- enablePagination: true,
377
- pagination: {
378
- pageSize: 10,
379
- pageSizes: [10, 200, 250, 500, 5000]
380
- },
381
- enableExcelExport: true,
382
- excelExportOptions: {
383
- exportWithFormatter: false
384
- },
385
- registerExternalResources: [new ExcelExportService(), this.compositeEditorInstance],
386
- enableFiltering: true,
387
- rowSelectionOptions: {
388
- // True (Single Selection), False (Multiple Selections)
389
- selectActiveRow: false
390
- },
391
- createPreHeaderPanel: true,
392
- showPreHeaderPanel: true,
393
- preHeaderPanelHeight: 28,
394
- enableCheckboxSelector: true,
395
- enableRowSelection: true,
396
- multiSelect: false,
397
- checkboxSelector: {
398
- hideInFilterHeaderRow: false,
399
- hideInColumnTitleRow: true,
400
- },
401
- enableCompositeEditor: true,
402
- editCommandHandler: (item, column, editCommand) => {
403
- // composite editors values are saved as array, so let's convert to array in any case and we'll loop through these values
404
- const prevSerializedValues = Array.isArray(editCommand.prevSerializedValue) ? editCommand.prevSerializedValue : [editCommand.prevSerializedValue];
405
- const serializedValues = Array.isArray(editCommand.serializedValue) ? editCommand.serializedValue : [editCommand.serializedValue];
406
- const editorColumns = this.columnDefinitions.filter((col) => col.editor !== undefined);
407
-
408
- const modifiedColumns: Column[] = [];
409
- prevSerializedValues.forEach((_val, index) => {
410
- const prevSerializedValue = prevSerializedValues[index];
411
- const serializedValue = serializedValues[index];
412
-
413
- if (prevSerializedValue !== serializedValue) {
414
- const finalColumn = Array.isArray(editCommand.prevSerializedValue) ? editorColumns[index] : column;
415
- this.editedItems[this.gridOptions.datasetIdPropertyName || 'id'] = item; // keep items by their row indexes, if the row got edited twice then we'll keep only the last change
416
- this.angularGrid.slickGrid.invalidate();
417
- editCommand.execute();
418
-
419
- this.renderUnsavedCellStyling(item, finalColumn, editCommand);
420
- modifiedColumns.push(finalColumn);
421
- }
422
- });
423
-
424
- // queued editor only keeps 1 item object even when it's a composite editor,
425
- // so we'll push only 1 change at the end but with all columns modified
426
- // this way we can undo the entire row change (for example if user changes 3 field in the editor modal, then doing a undo last change will undo all 3 in 1 shot)
427
- this.editQueue.push({ item, columns: modifiedColumns, editCommand });
428
- },
429
- // when using the cellMenu, you can change some of the default options and all use some of the callback methods
430
- enableCellMenu: true,
431
- };
432
- }
433
-
434
- loadData(count: number) {
435
- // mock data
436
- const tmpArray: any[] = [];
437
- for (let i = 0; i < count; i++) {
438
- const randomItemId = Math.floor(Math.random() * this.mockProducts().length);
439
- const randomYear = 2000 + Math.floor(Math.random() * 10);
440
- const randomFinishYear = (new Date().getFullYear()) + Math.floor(Math.random() * 10); // use only years not lower than 3 years ago
441
- const randomMonth = Math.floor(Math.random() * 11);
442
- const randomDay = Math.floor((Math.random() * 29));
443
- const randomTime = Math.floor((Math.random() * 59));
444
- const randomFinish = new Date(randomFinishYear, (randomMonth + 1), randomDay, randomTime, randomTime, randomTime);
445
- const randomPercentComplete = Math.floor(Math.random() * 100) + 15; // make it over 15 for E2E testing purposes
446
- const percentCompletion = randomPercentComplete > 100 ? (i > 5 ? 100 : 88) : randomPercentComplete; // don't use 100 unless it's over index 5, for E2E testing purposes
447
- const isCompleted = percentCompletion === 100;
448
-
449
- tmpArray[i] = {
450
- id: i,
451
- title: 'Task ' + i,
452
- duration: Math.floor(Math.random() * 100) + 10,
453
- percentComplete: percentCompletion,
454
- analysis: {
455
- percentComplete: percentCompletion,
456
- },
457
- complexity: i % 3 ? 0 : 2,
458
- start: new Date(randomYear, randomMonth, randomDay, randomDay, randomTime, randomTime, randomTime),
459
- finish: (isCompleted || (i % 3 === 0 && (randomFinish > new Date() && i > 3)) ? (isCompleted ? new Date() : randomFinish) : ''), // make sure the random date is earlier than today and it's index is bigger than 3
460
- cost: (i % 33 === 0) ? null : Math.round(Math.random() * 10000) / 100,
461
- completed: (isCompleted || (i % 3 === 0 && (randomFinish > new Date() && i > 3))),
462
- product: { id: this.mockProducts()[randomItemId]?.id, itemName: this.mockProducts()[randomItemId]?.itemName, },
463
- origin: (i % 2) ? { code: 'CA', name: 'Canada' } : { code: 'US', name: 'United States' },
464
- };
465
-
466
- if (!(i % 8)) {
467
- delete tmpArray[i].finish; // also test with undefined properties
468
- delete tmpArray[i].percentComplete; // also test with undefined properties
469
- }
470
- }
471
- return tmpArray;
472
- }
473
-
474
- // --
475
- // event handlers
476
- // ---------------
477
-
478
- handleValidationError(_e: Event, args: any) {
479
- if (args.validationResults) {
480
- let errorMsg = args.validationResults.msg || '';
481
- if (args.editor && (args.editor instanceof Slick.CompositeEditor)) {
482
- if (args.validationResults.errors) {
483
- errorMsg += '\n';
484
- for (const error of args.validationResults.errors) {
485
- const columnName = error.editor.args.column.name;
486
- errorMsg += `${columnName.toUpperCase()}: ${error.msg}`;
487
- }
488
- }
489
- console.log(errorMsg);
490
- }
491
- } else {
492
- alert(args.validationResults.msg);
493
- }
494
- return false;
495
- }
496
-
497
- handleItemDeleted(_e: Event, args: any) {
498
- console.log('item deleted with id:', args.itemId);
499
- }
500
-
501
- handleOnBeforeEditCell(e: Event, args: any) {
502
- const { column, item, grid } = args;
503
-
504
- if (column && item) {
505
- if (!checkItemIsEditable(item, column, grid)) {
506
- e.stopImmediatePropagation();
507
- return false;
508
- }
509
- }
510
- return true;
511
- }
512
-
513
- handleOnCellChange(_e: Event, args: any) {
514
- const dataContext = args?.item;
515
-
516
- // when the field "completed" changes to false, we also need to blank out the "finish" date
517
- if (dataContext && !dataContext.completed) {
518
- dataContext.finish = null;
519
- this.angularGrid.gridService.updateItem(dataContext);
520
- }
521
- }
522
-
523
- handleOnCellClicked(e: Event, args: any) {
524
- console.log(e, args);
525
- // if (eventData.target.classList.contains('fa-question-circle-o')) {
526
- // alert('please HELP!!!');
527
- // } else if (eventData.target.classList.contains('fa-chevron-down')) {
528
- // alert('do something else...');
529
- // }
530
- }
531
-
532
- handleOnCompositeEditorChange(_e: Event, args: OnCompositeEditorChangeEventArgs) {
533
- const columnDef = args.column;
534
- const formValues = args.formValues;
535
-
536
- // you can dynamically change a select dropdown collection,
537
- // if you need to re-render the editor for the list to be reflected
538
- // if (columnDef.id === 'duration') {
539
- // const editor = this.compositeEditorInstance.editors['percentComplete2'] as SelectEditor;
540
- // const newCollection = editor.finalCollection;
541
- // editor.renderDomElement(newCollection);
542
- // }
543
-
544
- // you can change any other form input values when certain conditions are met
545
- if (columnDef.id === 'percentComplete' && formValues.percentComplete === 100) {
546
- this.compositeEditorInstance.changeFormInputValue('completed', true);
547
- this.compositeEditorInstance.changeFormInputValue('finish', new Date());
548
- // this.compositeEditorInstance.changeFormInputValue('product', { id: 0, itemName: 'Sleek Metal Computer' });
549
-
550
- // you can even change a value that is not part of the form (but is part of the grid)
551
- // but you will have to bypass the error thrown by providing `true` as the 3rd argument
552
- // this.compositeEditorInstance.changeFormInputValue('cost', 9999.99, true);
553
- }
554
-
555
- // you can also change some editor options (not all Editors supports this functionality, so far only these Editors AutoComplete, Date MultipleSelect & SingleSelect)
556
- /*
557
- if (columnDef.id === 'completed') {
558
- this.compositeEditorInstance.changeFormEditorOption('percentComplete', 'filter', formValues.completed);
559
- this.compositeEditorInstance.changeFormEditorOption('product', 'minLength', 3);
560
- }
561
- */
562
- }
563
-
564
- handlePaginationChanged() {
565
- this.removeAllUnsavedStylingFromCell();
566
- this.renderUnsavedStylingOnAllVisibleCells();
567
- }
568
-
569
- handleOnGridStateChanged(gridStateChanges: GridStateChange) {
570
- if (Array.isArray(gridStateChanges.gridState?.rowSelection?.dataContextIds)) {
571
- this.isMassSelectionDisabled = gridStateChanges.gridState?.rowSelection?.dataContextIds.length === 0;
572
- }
573
- }
574
-
575
- openCompositeModal(modalType: CompositeEditorModalType) {
576
- // open the editor modal and we can also provide a header title with optional parsing pulled from the dataContext, via template {{ }}
577
- // for example {{title}} => display the item title, or even complex object works {{product.itemName}} => display item product name
578
-
579
- let modalTitle = '';
580
- switch (modalType) {
581
- case 'create':
582
- modalTitle = 'Inserting New Task';
583
- break;
584
- case 'clone':
585
- modalTitle = 'Clone - {{title}}';
586
- break;
587
- case 'edit':
588
- modalTitle = 'Editing - {{title}} (<span class="text-muted">id:</span> <span class="text-primary">{{id}}</span>)'; // 'Editing - {{title}} ({{product.itemName}})'
589
- break;
590
- case 'mass-update':
591
- modalTitle = 'Mass Update All Records';
592
- break;
593
- case 'mass-selection':
594
- modalTitle = 'Update Selected Records';
595
- break;
596
- }
597
-
598
- this.compositeEditorInstance?.openDetails({
599
- headerTitle: modalTitle,
600
- modalType,
601
- insertOptions: { highlightRow: false }, // disable highlight to avoid flaky tests in Cypress
602
- // showCloseButtonOutside: true,
603
- // backdrop: null,
604
- // viewColumnLayout: 2, // responsive layout, choose from 'auto', 1, 2, or 3 (defaults to 'auto')
605
- showFormResetButton: true,
606
- // showResetButtonOnEachEditor: true,
607
- onClose: () => Promise.resolve(confirm('You have unsaved changes, are you sure you want to close this window?')),
608
- onError: (error) => alert(error.message),
609
- onSave: (formValues, _selection, dataContext) => {
610
- const serverResponseDelay = 50;
611
-
612
- // simulate a backend server call which will reject if the "% Complete" is below 50%
613
- // when processing a mass update or mass selection
614
- if (modalType === 'mass-update' || modalType === 'mass-selection') {
615
- return new Promise((resolve, reject) => {
616
- setTimeout(() => {
617
- if (formValues.percentComplete >= 50) {
618
- resolve(true);
619
- } else {
620
- reject('Unfortunately we only accept a minimum of 50% Completion...');
621
- }
622
- }, serverResponseDelay);
623
- });
624
- } else {
625
- // also simulate a server cal for any other modal type (create/clone/edit)
626
- // we'll just apply the change without any rejection from the server and
627
- // note that we also have access to the "dataContext" which is only available for these modal
628
- console.log(`${modalType} item data context`, dataContext);
629
- return new Promise(resolve => setTimeout(() => resolve(true), serverResponseDelay));
630
- }
631
- }
632
- });
633
- }
634
-
635
- toggleGridEditReadonly() {
636
- // first need undo all edits
637
- this.undoAllEdits();
638
-
639
- // then change a single grid options to make the grid non-editable (readonly)
640
- this.isGridEditable = !this.isGridEditable;
641
- this.isCompositeDisabled = !this.isGridEditable;
642
- if (!this.isGridEditable) {
643
- this.isMassSelectionDisabled = true;
644
- }
645
- // dynamically change SlickGrid editable grid option
646
- this.angularGrid.slickGrid.setOptions({ editable: this.isGridEditable });
647
- }
648
-
649
- removeUnsavedStylingFromCell(_item: any, column: Column, row: number) {
650
- // remove unsaved css class from that cell
651
- this.angularGrid.slickGrid.removeCellCssStyles(`unsaved_highlight_${[column.id]}${row}`);
652
- }
653
-
654
- removeAllUnsavedStylingFromCell() {
655
- for (const lastEdit of this.editQueue) {
656
- const lastEditCommand = lastEdit?.editCommand;
657
- if (lastEditCommand) {
658
- // remove unsaved css class from that cell
659
- for (const lastEditColumn of lastEdit.columns) {
660
- this.removeUnsavedStylingFromCell(lastEdit.item, lastEditColumn, lastEditCommand.row);
661
- }
662
- }
663
- }
664
- }
665
-
666
- renderUnsavedStylingOnAllVisibleCells() {
667
- for (const lastEdit of this.editQueue) {
668
- if (lastEdit) {
669
- const { item, columns, editCommand } = lastEdit;
670
- if (Array.isArray(columns)) {
671
- columns.forEach((col) => {
672
- this.renderUnsavedCellStyling(item, col, editCommand);
673
- });
674
- }
675
- }
676
- }
677
- }
678
-
679
- renderUnsavedCellStyling(item: any, column: Column, editCommand: EditCommand) {
680
- if (editCommand && item && column) {
681
- const row = this.angularGrid.dataView.getRowByItem(item) as number;
682
- if (row >= 0) {
683
- const hash = { [row]: { [column.id]: 'unsaved-editable-field' } };
684
- this.angularGrid.slickGrid.setCellCssStyles(`unsaved_highlight_${[column.id]}${row}`, hash);
685
- }
686
- }
687
- }
688
-
689
- saveAll() {
690
- // Edit Queue (array increases every time a cell is changed, regardless of item object)
691
- console.log(this.editQueue);
692
-
693
- // Edit Items only keeps the merged data (an object with row index as the row properties)
694
- // if you change 2 different cells on 2 different cells then this editedItems will only contain 1 property
695
- // example: editedItems = { 0: { title: task 0, duration: 50, ... }}
696
- // ...means that row index 0 got changed and the final merged object is { title: task 0, duration: 50, ... }
697
- console.log(this.editedItems);
698
- // console.log(`We changed ${Object.keys(this.editedItems).length} rows`);
699
-
700
- // since we saved, we can now remove all the unsaved color styling and reset our array/object
701
- this.removeAllUnsavedStylingFromCell();
702
- this.editQueue = [];
703
- this.editedItems = {};
704
- }
705
-
706
- undoLastEdit(showLastEditor = false) {
707
- const lastEdit = this.editQueue.pop();
708
- const lastEditCommand = lastEdit?.editCommand;
709
- if (lastEdit && lastEditCommand && Slick.GlobalEditorLock.cancelCurrentEdit()) {
710
- lastEditCommand.undo();
711
-
712
- // remove unsaved css class from that cell
713
- for (const lastEditColumn of lastEdit.columns) {
714
- this.removeUnsavedStylingFromCell(lastEdit.item, lastEditColumn, lastEditCommand.row);
715
- }
716
- this.angularGrid.slickGrid.invalidate();
717
-
718
-
719
- // optionally open the last cell editor associated
720
- if (showLastEditor) {
721
- this.angularGrid.slickGrid.gotoCell(lastEditCommand.row, lastEditCommand.cell, false);
722
- }
723
- }
724
- }
725
-
726
- undoAllEdits() {
727
- for (const lastEdit of this.editQueue) {
728
- const lastEditCommand = lastEdit?.editCommand;
729
- if (lastEditCommand && Slick.GlobalEditorLock.cancelCurrentEdit()) {
730
- lastEditCommand.undo();
731
-
732
- // remove unsaved css class from that cell
733
- for (const lastEditColumn of lastEdit.columns) {
734
- this.removeUnsavedStylingFromCell(lastEdit.item, lastEditColumn, lastEditCommand.row);
735
- }
736
- }
737
- }
738
- this.angularGrid.slickGrid.invalidate(); // re-render the grid only after every cells got rolled back
739
- this.editQueue = [];
740
- }
741
-
742
- mockProducts() {
743
- return [
744
- {
745
- id: 0,
746
- itemName: 'Sleek Metal Computer',
747
- itemNameTranslated: 'some fantastic sleek metal computer description',
748
- listPrice: 2100.23,
749
- itemTypeName: 'I',
750
- image: 'http://i.stack.imgur.com/pC1Tv.jpg',
751
- icon: `fa ${this.getRandomIcon(0)}`,
752
- },
753
- {
754
- id: 1,
755
- itemName: 'Tasty Granite Table',
756
- itemNameTranslated: 'an extremely huge and heavy table',
757
- listPrice: 3200.12,
758
- itemTypeName: 'I',
759
- image: 'https://i.imgur.com/Fnm7j6h.jpg',
760
- icon: `fa ${this.getRandomIcon(1)}`,
761
- },
762
- {
763
- id: 2,
764
- itemName: 'Awesome Wooden Mouse',
765
- itemNameTranslated: 'super old mouse',
766
- listPrice: 15.00,
767
- itemTypeName: 'I',
768
- image: 'https://i.imgur.com/RaVJuLr.jpg',
769
- icon: `fa ${this.getRandomIcon(2)}`,
770
- },
771
- {
772
- id: 3,
773
- itemName: 'Gorgeous Fresh Shirt',
774
- itemNameTranslated: 'what a gorgeous shirt seriously',
775
- listPrice: 25.76,
776
- itemTypeName: 'I',
777
- image: 'http://i.stack.imgur.com/pC1Tv.jpg',
778
- icon: `fa ${this.getRandomIcon(3)}`,
779
- },
780
- {
781
- id: 4,
782
- itemName: 'Refined Cotton Table',
783
- itemNameTranslated: 'super light table that will fall apart amazingly fast',
784
- listPrice: 13.35,
785
- itemTypeName: 'I',
786
- image: 'https://i.imgur.com/Fnm7j6h.jpg',
787
- icon: `fa ${this.getRandomIcon(4)}`,
788
- },
789
- {
790
- id: 5,
791
- itemName: 'Intelligent Wooden Pizza',
792
- itemNameTranslated: 'wood not included',
793
- listPrice: 23.33,
794
- itemTypeName: 'I',
795
- image: 'https://i.imgur.com/RaVJuLr.jpg',
796
- icon: `fa ${this.getRandomIcon(5)}`,
797
- },
798
- {
799
- id: 6,
800
- itemName: 'Licensed Cotton Chips',
801
- itemNameTranslated: 'not sure what that is',
802
- listPrice: 71.21,
803
- itemTypeName: 'I',
804
- image: 'http://i.stack.imgur.com/pC1Tv.jpg',
805
- icon: `fa ${this.getRandomIcon(6)}`,
806
- },
807
- {
808
- id: 7,
809
- itemName: 'Ergonomic Rubber Soap',
810
- itemNameTranslated: `so good you'll want to use it every night`,
811
- listPrice: 2.43,
812
- itemTypeName: 'I',
813
- image: 'https://i.imgur.com/Fnm7j6h.jpg',
814
- icon: `fa ${this.getRandomIcon(7)}`,
815
- },
816
- {
817
- id: 8,
818
- itemName: 'Handcrafted Steel Car',
819
- itemNameTranslated: `aka tesla truck`,
820
- listPrice: 31288.39,
821
- itemTypeName: 'I',
822
- image: 'https://i.imgur.com/RaVJuLr.jpg',
823
- icon: `fa ${this.getRandomIcon(8)}`,
824
- },
825
- ];
826
- }
827
-
828
- /** List of icons that are supported in this lib Material Design Icons */
829
- getRandomIcon(iconIndex?: number) {
830
- const icons = [
831
- 'fa-500px',
832
- 'fa-address-book',
833
- 'fa-address-book-o',
834
- 'fa-address-card',
835
- 'fa-address-card-o',
836
- 'fa-adjust',
837
- 'fa-adn',
838
- 'fa-align-center',
839
- 'fa-align-justify',
840
- 'fa-align-left',
841
- 'fa-align-right',
842
- 'fa-amazon',
843
- 'fa-ambulance',
844
- 'fa-american-sign-language-interpreting',
845
- 'fa-anchor',
846
- 'fa-android',
847
- 'fa-angellist',
848
- 'fa-angle-double-down',
849
- 'fa-angle-double-left',
850
- 'fa-angle-double-right',
851
- 'fa-angle-double-up',
852
- 'fa-angle-down',
853
- 'fa-angle-left',
854
- 'fa-angle-right',
855
- 'fa-angle-up',
856
- 'fa-apple',
857
- 'fa-archive',
858
- 'fa-area-chart',
859
- 'fa-arrow-circle-down',
860
- 'fa-arrow-circle-left',
861
- 'fa-arrow-circle-o-down',
862
- 'fa-arrow-circle-o-left',
863
- 'fa-arrow-circle-o-right',
864
- 'fa-arrow-circle-o-up',
865
- 'fa-arrow-circle-right',
866
- 'fa-arrow-circle-up',
867
- 'fa-arrow-down',
868
- 'fa-arrow-left',
869
- 'fa-arrow-right',
870
- 'fa-arrow-up',
871
- 'fa-arrows',
872
- 'fa-arrows-alt',
873
- 'fa-arrows-h',
874
- 'fa-arrows-v',
875
- 'fa-assistive-listening-systems',
876
- 'fa-asterisk',
877
- 'fa-at',
878
- 'fa-audio-description',
879
- 'fa-backward',
880
- 'fa-balance-scale',
881
- 'fa-ban',
882
- 'fa-bandcamp',
883
- 'fa-bank (alias)',
884
- 'fa-bar-chart',
885
- 'fa-barcode',
886
- 'fa-bars',
887
- 'fa-bath',
888
- 'fa-battery-empty',
889
- 'fa-battery-full',
890
- 'fa-battery-half',
891
- 'fa-battery-quarter',
892
- 'fa-battery-three-quarters',
893
- 'fa-bed',
894
- 'fa-beer',
895
- 'fa-behance',
896
- 'fa-behance-square',
897
- 'fa-bell',
898
- 'fa-bell-o',
899
- 'fa-bell-slash',
900
- 'fa-bell-slash-o',
901
- 'fa-bicycle',
902
- 'fa-binoculars',
903
- 'fa-birthday-cake',
904
- 'fa-bitbucket',
905
- 'fa-bitbucket-square',
906
- ];
907
- const randomNumber = Math.floor((Math.random() * icons.length - 1));
908
- return icons[iconIndex ?? randomNumber];
909
- }
910
-
911
- renderItemCallbackWith2Rows(item: any): string {
912
- return `<div class="autocomplete-container-list">
913
- <div class="autocomplete-left">
914
- <!--<img src="http://i.stack.imgur.com/pC1Tv.jpg" width="50" />-->
915
- <span class="fa ${item.icon}"></span>
916
- </div>
917
- <div>
918
- <span class="autocomplete-top-left">
919
- <span class="mdfai ${item.itemTypeName === 'I' ? 'fa-info-circle' : 'fa-copy'}"></span>
920
- ${item.itemName}
921
- </span>
922
- <div>
923
- </div>
924
- <div>
925
- <div class="autocomplete-bottom-left">${item.itemNameTranslated}</div>
926
- </div>`;
927
- }
928
-
929
- renderItemCallbackWith4Corners(item: any): string {
930
- return `<div class="autocomplete-container-list">
931
- <div class="autocomplete-left">
932
- <!--<img src="http://i.stack.imgur.com/pC1Tv.jpg" width="50" />-->
933
- <span class="fa ${item.icon}"></span>
934
- </div>
935
- <div>
936
- <span class="autocomplete-top-left">
937
- <span class="fa ${item.itemTypeName === 'I' ? 'fa-info-circle' : 'fa-copy'}"></span>
938
- ${item.itemName}
939
- </span>
940
- <span class="autocomplete-top-right">${formatNumber(item.listPrice, 2, 2, false, '$')}</span>
941
- <div>
942
- </div>
943
- <div>
944
- <div class="autocomplete-bottom-left">${item.itemNameTranslated}</div>
945
- <span class="autocomplete-bottom-right">Type: <b>${item.itemTypeName === 'I' ? 'Item' : item.itemTypeName === 'C' ? 'PdCat' : 'Cat'}</b></span>
946
- </div>`;
947
- }
948
- }