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,780 +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
-
5
- import { AngularGridInstance, Column, GridOption, Filters, Formatter, LongTextEditorOption, FieldType, Editors, Formatters, AutocompleteOption, EditCommand, formatNumber, SortComparers, SlickGrid, SlickNamespace } from '../modules/angular-slickgrid';
6
-
7
- const URL_COUNTRIES_COLLECTION = 'assets/data/countries.json';
8
- declare const Slick: SlickNamespace;
9
-
10
- /**
11
- * Check if the current item (cell) is editable or not
12
- * @param {*} dataContext - item data context object
13
- * @param {*} columnDef - column definition
14
- * @param {*} grid - slickgrid grid object
15
- * @returns {boolean} isEditable
16
- */
17
- function checkItemIsEditable(dataContext: any, columnDef: Column, grid: SlickGrid) {
18
- const gridOptions = grid && grid.getOptions && grid.getOptions();
19
- const hasEditor = columnDef.editor;
20
- const isGridEditable = gridOptions.editable;
21
- let isEditable = !!(isGridEditable && hasEditor);
22
-
23
- if (dataContext && columnDef && gridOptions && gridOptions.editable) {
24
- switch (columnDef.id) {
25
- case 'finish':
26
- isEditable = !!dataContext?.completed;
27
- break;
28
- }
29
- }
30
- return isEditable;
31
- }
32
-
33
- const customEditableInputFormatter: Formatter = (_row, _cell, value, columnDef, _dataContext, grid) => {
34
- const gridOptions = grid && grid.getOptions && grid.getOptions();
35
- const isEditableLine = gridOptions.editable && columnDef.editor;
36
- value = (value === null || value === undefined) ? '' : value;
37
- return isEditableLine ? { text: value, addClasses: 'editable-field', toolTip: 'Click to Edit' } : value;
38
- };
39
-
40
- // you can create custom validator to pass to an inline editor
41
- const myCustomTitleValidator = (value: any, args: any) => {
42
- if ((value === null || value === undefined || !value.length) && (args.compositeEditorOptions && args.compositeEditorOptions.modalType === 'create' || args.compositeEditorOptions.modalType === 'edit')) {
43
- // we will only check if the field is supplied when it's an inline editing OR a composite editor of type create/edit
44
- return { valid: false, msg: 'This is a required field.' };
45
- } else if (!/^(task\s\d+)*$/i.test(value)) {
46
- return { valid: false, msg: 'Your title is invalid, it must start with "Task" followed by a number.' };
47
- }
48
- return { valid: true, msg: '' };
49
- };
50
-
51
- @Component({
52
- templateUrl: './grid-resize-by-content.component.html',
53
- styleUrls: ['./grid-resize-by-content.component.scss'],
54
- encapsulation: ViewEncapsulation.None,
55
- })
56
- export class GridResizeByContentComponent implements OnInit {
57
- title = 'Example 31: Columns Resize by Content';
58
- subTitle = `The grid below uses the optional resize by cell content (with a fixed 950px for demo purposes), you can click on the 2 buttons to see the difference. The "autosizeColumns" is really the default option used by Angular-SlickGrid, the resize by cell content is optional because it requires to read the first thousand rows and do extra width calculation.`;
59
-
60
- angularGrid!: AngularGridInstance;
61
- gridOptions!: GridOption;
62
- columnDefinitions: Column[] = [];
63
- dataset: any[] = [];
64
- editQueue: any[] = [];
65
- editedItems: any = {};
66
- isUsingDefaultResize = false;
67
- isGridEditable = true;
68
- isCompositeDisabled = false;
69
- isMassSelectionDisabled = true;
70
- complexityLevelList = [
71
- { value: 0, label: 'Very Simple' },
72
- { value: 1, label: 'Simple' },
73
- { value: 2, label: 'Straightforward' },
74
- { value: 3, label: 'Complex' },
75
- { value: 4, label: 'Very Complex' },
76
- ];
77
-
78
- constructor(private http: HttpClient) { }
79
-
80
- angularGridReady(angularGrid: AngularGridInstance) {
81
- this.angularGrid = angularGrid;
82
- }
83
-
84
- ngOnInit(): void {
85
- this.defineGrid();
86
- this.dataset = this.loadData(5000);
87
- }
88
-
89
- // Grid2 definition
90
- defineGrid() {
91
- this.columnDefinitions = [
92
- {
93
- id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string, minWidth: 65,
94
- // you can adjust the resize calculation via multiple options
95
- resizeExtraWidthPadding: 4,
96
- resizeCharWidthInPx: 7.6,
97
- resizeCalcWidthRatio: 1,
98
- resizeMaxWidthThreshold: 200,
99
- filterable: true, columnGroup: 'Common Factor',
100
- filter: { model: Filters.compoundInputText },
101
- formatter: Formatters.multiple, params: { formatters: [Formatters.uppercase, Formatters.bold] },
102
- editor: {
103
- model: Editors.longText, required: true, alwaysSaveOnEnterKey: true,
104
- maxLength: 12,
105
- editorOptions: {
106
- cols: 45,
107
- rows: 6,
108
- buttonTexts: {
109
- cancel: 'Close',
110
- save: 'Done'
111
- }
112
- } as LongTextEditorOption,
113
- validator: myCustomTitleValidator,
114
- },
115
- },
116
- {
117
- id: 'duration', name: 'Duration', field: 'duration', sortable: true, filterable: true, minWidth: 65,
118
- type: FieldType.number, columnGroup: 'Common Factor',
119
- formatter: (_row, _cell, value) => {
120
- if (value === null || value === undefined || value === '') {
121
- return '';
122
- }
123
- return value > 1 ? `${value} days` : `${value} day`;
124
- },
125
- editor: { model: Editors.float, decimal: 2, valueStep: 1, minValue: 0, maxValue: 10000, alwaysSaveOnEnterKey: true, required: true },
126
- },
127
- {
128
- id: 'cost', name: 'Cost', field: 'cost', minWidth: 65,
129
- sortable: true, filterable: true, type: FieldType.number, columnGroup: 'Analysis',
130
- filter: { model: Filters.compoundInputNumber },
131
- formatter: Formatters.dollar,
132
- },
133
- {
134
- id: 'percentComplete', name: '% Complete', field: 'percentComplete', minWidth: 100,
135
- type: FieldType.number,
136
- sortable: true, filterable: true, columnGroup: 'Analysis',
137
- filter: { model: Filters.compoundSlider, operator: '>=' },
138
- editor: {
139
- model: Editors.slider,
140
- minValue: 0, maxValue: 100,
141
- },
142
- },
143
- {
144
- id: 'complexity', name: 'Complexity', field: 'complexity',
145
- resizeCalcWidthRatio: 0.82, // default calc ratio is 1 or 0.95 for field type of string
146
- sortable: true, filterable: true, columnGroup: 'Analysis',
147
- formatter: (_row, _cell, value) => this.complexityLevelList[value].label,
148
- exportCustomFormatter: (_row, _cell, value) => this.complexityLevelList[value].label,
149
- filter: {
150
- model: Filters.multipleSelect,
151
- collection: this.complexityLevelList
152
- },
153
- editor: {
154
- model: Editors.singleSelect,
155
- collection: this.complexityLevelList,
156
- },
157
- },
158
- {
159
- id: 'start', name: 'Start', field: 'start', sortable: true,
160
- formatter: Formatters.dateUs, columnGroup: 'Period',
161
- exportCustomFormatter: Formatters.dateUs,
162
- type: FieldType.date, outputType: FieldType.dateUs, saveOutputType: FieldType.dateUtc,
163
- filterable: true, filter: { model: Filters.compoundDate },
164
- editor: { model: Editors.date, params: { hideClearButton: false } },
165
- },
166
- {
167
- id: 'completed', name: 'Completed', field: 'completed', width: 80, minWidth: 75, maxWidth: 100,
168
- sortable: true, filterable: true, columnGroup: 'Period',
169
- formatter: Formatters.multiple,
170
- params: { formatters: [Formatters.checkmark, Formatters.center] },
171
- exportWithFormatter: false,
172
- filter: {
173
- collection: [{ value: '', label: '' }, { value: true, label: 'True' }, { value: false, label: 'False' }],
174
- model: Filters.singleSelect
175
- },
176
- editor: { model: Editors.checkbox, },
177
- // editor: { model: Editors.singleSelect, collection: [{ value: true, label: 'Yes' }, { value: false, label: 'No' }], },
178
- },
179
- {
180
- id: 'finish', name: 'Finish', field: 'finish', sortable: true,
181
- formatter: Formatters.dateUs, columnGroup: 'Period',
182
- type: FieldType.date, outputType: FieldType.dateUs, saveOutputType: FieldType.dateUtc,
183
- filterable: true, filter: { model: Filters.compoundDate },
184
- exportCustomFormatter: Formatters.dateUs,
185
- editor: {
186
- model: Editors.date,
187
- editorOptions: { minDate: 'today' },
188
- validator: (value, args) => {
189
- const dataContext = args && args.item;
190
- if (dataContext && (dataContext.completed && !value)) {
191
- return { valid: false, msg: 'You must provide a "Finish" date when "Completed" is checked.' };
192
- }
193
- return { valid: true, msg: '' };
194
- }
195
- },
196
- },
197
- {
198
- id: 'product', name: 'Product', field: 'product',
199
- filterable: true, columnGroup: 'Item',
200
- minWidth: 100,
201
- resizeCharWidthInPx: 8,
202
- exportWithFormatter: true,
203
- dataKey: 'id',
204
- labelKey: 'itemName',
205
- formatter: Formatters.complexObject,
206
- exportCustomFormatter: Formatters.complex, // without the Editing cell Formatter
207
- type: FieldType.object,
208
- sortComparer: SortComparers.objectString,
209
- editor: {
210
- model: Editors.autoComplete,
211
- alwaysSaveOnEnterKey: true,
212
-
213
- // example with a Remote API call
214
- editorOptions: {
215
- minLength: 1,
216
- source: (request, response) => {
217
- // const items = require('c://TEMP/items.json');
218
- const products = this.mockProducts();
219
- response(products.filter(product => product.itemName.toLowerCase().includes(request.term.toLowerCase())));
220
- },
221
- renderItem: {
222
- // layout: 'twoRows',
223
- // templateCallback: (item: any) => this.renderItemCallbackWith2Rows(item),
224
-
225
- layout: 'fourCorners',
226
- templateCallback: (item: any) => this.renderItemCallbackWith4Corners(item),
227
- },
228
- } as AutocompleteOption,
229
- },
230
- filter: {
231
- model: Filters.inputText,
232
- // placeholder: '🔎︎ search city',
233
- type: FieldType.string,
234
- queryField: 'product.itemName',
235
- }
236
- },
237
- {
238
- id: 'origin', name: 'Country of Origin', field: 'origin',
239
- formatter: Formatters.complexObject, columnGroup: 'Item',
240
- exportCustomFormatter: Formatters.complex, // without the Editing cell Formatter
241
- dataKey: 'code',
242
- labelKey: 'name',
243
- type: FieldType.object,
244
- sortComparer: SortComparers.objectString,
245
- filterable: true,
246
- sortable: true,
247
- minWidth: 100,
248
- editor: {
249
- model: Editors.autoComplete,
250
- customStructure: { label: 'name', value: 'code' },
251
- collectionAsync: this.http.get(URL_COUNTRIES_COLLECTION),
252
- },
253
- filter: {
254
- model: Filters.inputText,
255
- type: FieldType.string,
256
- queryField: 'origin.name',
257
- }
258
- },
259
- {
260
- id: 'action', name: 'Action', field: 'action', width: 70, minWidth: 70, maxWidth: 70,
261
- excludeFromExport: true,
262
- formatter: () => `<div class="button-style margin-auto" style="width: 35px;"><span class="fa fa-chevron-down text-primary"></span></div>`,
263
- cellMenu: {
264
- hideCloseButton: false,
265
- commandTitle: 'Commands',
266
- commandItems: [
267
- {
268
- command: 'help',
269
- title: 'Help!',
270
- iconCssClass: 'fa fa-question-circle',
271
- positionOrder: 66,
272
- action: () => alert('Please Help!'),
273
- },
274
- 'divider',
275
- {
276
- command: 'delete-row', title: 'Delete Row', positionOrder: 64,
277
- iconCssClass: 'fa fa-times color-danger', cssClass: 'red', textCssClass: 'text-italic color-danger-light',
278
- // only show command to 'Delete Row' when the task is not completed
279
- itemVisibilityOverride: (args) => {
280
- return !args.dataContext?.completed;
281
- },
282
- action: (_event, args) => {
283
- const dataContext = args.dataContext;
284
- const row = args?.row ?? 0;
285
- if (confirm(`Do you really want to delete row (${row + 1}) with "${dataContext.title}"`)) {
286
- this.angularGrid.gridService.deleteItemById(dataContext.id);
287
- }
288
- }
289
- },
290
- ],
291
- }
292
- },
293
- ];
294
-
295
- this.gridOptions = {
296
- editable: true,
297
- autoAddCustomEditorFormatter: customEditableInputFormatter,
298
- enableCellNavigation: true,
299
- autoEdit: true,
300
- autoCommitEdit: true,
301
- autoResize: {
302
- container: '#smaller-container',
303
- rightPadding: 10
304
- },
305
- enableAutoResize: true,
306
-
307
- // resizing by cell content is opt-in
308
- // we first need to disable the 2 default flags to autoFit/autosize
309
- autoFitColumnsOnFirstLoad: false,
310
- enableAutoSizeColumns: false,
311
- // then enable resize by content with these 2 flags
312
- autosizeColumnsByCellContentOnFirstLoad: true,
313
- enableAutoResizeColumnsByCellContent: true,
314
-
315
- resizeByContentOptions: {
316
- // optional resize calculation options
317
- defaultRatioForStringType: 0.92,
318
- formatterPaddingWidthInPx: 8, // optional editor formatter padding for resize calculation
319
- },
320
-
321
- enableExcelExport: true,
322
- excelExportOptions: {
323
- exportWithFormatter: false
324
- },
325
- registerExternalResources: [new ExcelExportService()],
326
- enableFiltering: true,
327
- enableRowSelection: true,
328
- enableCheckboxSelector: true,
329
- checkboxSelector: {
330
- hideInFilterHeaderRow: false,
331
- hideInColumnTitleRow: true,
332
- },
333
- rowSelectionOptions: {
334
- // True (Single Selection), False (Multiple Selections)
335
- selectActiveRow: false
336
- },
337
- createPreHeaderPanel: true,
338
- showPreHeaderPanel: true,
339
- preHeaderPanelHeight: 28,
340
- rowHeight: 33,
341
- headerRowHeight: 35,
342
- editCommandHandler: (item, column, editCommand) => {
343
- // composite editors values are saved as array, so let's convert to array in any case and we'll loop through these values
344
- const prevSerializedValues = Array.isArray(editCommand.prevSerializedValue) ? editCommand.prevSerializedValue : [editCommand.prevSerializedValue];
345
- const serializedValues = Array.isArray(editCommand.serializedValue) ? editCommand.serializedValue : [editCommand.serializedValue];
346
- const editorColumns = this.columnDefinitions.filter((col) => col.editor !== undefined);
347
-
348
- const modifiedColumns: Column[] = [];
349
- prevSerializedValues.forEach((_val, index) => {
350
- const prevSerializedValue = prevSerializedValues[index];
351
- const serializedValue = serializedValues[index];
352
-
353
- if (prevSerializedValue !== serializedValue) {
354
- const finalColumn = Array.isArray(editCommand.prevSerializedValue) ? editorColumns[index] : column;
355
- 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
356
- this.angularGrid.slickGrid.invalidate();
357
- editCommand.execute();
358
-
359
- this.renderUnsavedCellStyling(item, finalColumn, editCommand);
360
- modifiedColumns.push(finalColumn);
361
- }
362
- });
363
-
364
- // queued editor only keeps 1 item object even when it's a composite editor,
365
- // so we'll push only 1 change at the end but with all columns modified
366
- // 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)
367
- this.editQueue.push({ item, columns: modifiedColumns, editCommand });
368
- },
369
- // when using the cellMenu, you can change some of the default options and all use some of the callback methods
370
- enableCellMenu: true,
371
- };
372
- }
373
-
374
- loadData(count: number) {
375
- // mock data
376
- const tmpArray: any[] = [];
377
- for (let i = 0; i < count; i++) {
378
- const randomItemId = Math.floor(Math.random() * this.mockProducts().length);
379
- const randomYear = 2000 + Math.floor(Math.random() * 10);
380
- const randomFinishYear = (new Date().getFullYear()) + Math.floor(Math.random() * 10); // use only years not lower than 3 years ago
381
- const randomMonth = Math.floor(Math.random() * 11);
382
- const randomDay = Math.floor((Math.random() * 29));
383
- const randomTime = Math.floor((Math.random() * 59));
384
- const randomFinish = new Date(randomFinishYear, (randomMonth + 1), randomDay, randomTime, randomTime, randomTime);
385
- const randomPercentComplete = Math.floor(Math.random() * 100) + 15; // make it over 15 for E2E testing purposes
386
- const percentCompletion = randomPercentComplete > 100 ? (i > 5 ? 100 : 88) : randomPercentComplete; // don't use 100 unless it's over index 5, for E2E testing purposes
387
- const isCompleted = percentCompletion === 100;
388
-
389
- tmpArray[i] = {
390
- id: i,
391
- title: 'Task ' + i,
392
- duration: Math.floor(Math.random() * 100) + 10,
393
- percentComplete: percentCompletion,
394
- analysis: {
395
- percentComplete: percentCompletion,
396
- },
397
- complexity: i % 3 ? 0 : 2,
398
- start: new Date(randomYear, randomMonth, randomDay, randomDay, randomTime, randomTime, randomTime),
399
- 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
400
- cost: (i % 33 === 0) ? null : Math.round(Math.random() * 10000) / 100,
401
- completed: (isCompleted || (i % 3 === 0 && (randomFinish > new Date() && i > 3))),
402
- product: { id: this.mockProducts()[randomItemId]?.id, itemName: this.mockProducts()[randomItemId]?.itemName, },
403
- origin: (i % 2) ? { code: 'CA', name: 'Canada' } : { code: 'US', name: 'United States' },
404
- };
405
-
406
- if (!(i % 8)) {
407
- delete tmpArray[i].finish; // also test with undefined properties
408
- delete tmpArray[i].percentComplete; // also test with undefined properties
409
- }
410
- }
411
- return tmpArray;
412
- }
413
-
414
- handleValidationError(_e: Event, args: any) {
415
- if (args.validationResults) {
416
- alert(args.validationResults.msg);
417
- }
418
- return false;
419
- }
420
-
421
- handleItemDeleted(_e: Event, args: any) {
422
- console.log('item deleted with id:', args.itemId);
423
- }
424
-
425
- handleOnBeforeEditCell(e: Event, args: any) {
426
- const { column, item, grid } = args;
427
-
428
- if (column && item) {
429
- if (!checkItemIsEditable(item, column, grid)) {
430
- // event.preventDefault();
431
- e.stopImmediatePropagation();
432
- }
433
- }
434
- return false;
435
- }
436
-
437
- handleOnCellChange(_e: Event, args: any) {
438
- const dataContext = args?.item;
439
-
440
- // when the field "completed" changes to false, we also need to blank out the "finish" date
441
- if (dataContext && !dataContext.completed) {
442
- dataContext.finish = null;
443
- this.angularGrid.gridService.updateItem(dataContext);
444
- }
445
- }
446
-
447
- handlePaginationChanged() {
448
- this.removeAllUnsavedStylingFromCell();
449
- this.renderUnsavedStylingOnAllVisibleCells();
450
- }
451
-
452
- handleDefaultResizeColumns() {
453
- // just for demo purposes, set it back to its original width
454
- const columns = this.angularGrid.slickGrid.getColumns() as Column[];
455
- columns.forEach(col => col.width = col.originalWidth);
456
- this.angularGrid.slickGrid.setColumns(columns);
457
- this.angularGrid.slickGrid.autosizeColumns();
458
- this.isUsingDefaultResize = true;
459
- }
460
-
461
- handleNewResizeColumns() {
462
- this.angularGrid.resizerService.resizeColumnsByCellContent(true);
463
- this.isUsingDefaultResize = false;
464
- }
465
-
466
- toggleGridEditReadonly() {
467
- // first need undo all edits
468
- this.undoAllEdits();
469
-
470
- // then change a single grid options to make the grid non-editable (readonly)
471
- this.isGridEditable = !this.isGridEditable;
472
- this.isCompositeDisabled = !this.isGridEditable;
473
- if (!this.isGridEditable) {
474
- this.isMassSelectionDisabled = true;
475
- }
476
- // dynamically change SlickGrid editable grid option
477
- this.angularGrid.slickGrid.setOptions({ editable: this.isGridEditable });
478
- }
479
-
480
- removeUnsavedStylingFromCell(_item: any, column: Column, row: number) {
481
- // remove unsaved css class from that cell
482
- this.angularGrid.slickGrid.removeCellCssStyles(`unsaved_highlight_${[column.id]}${row}`);
483
- }
484
-
485
- removeAllUnsavedStylingFromCell() {
486
- for (const lastEdit of this.editQueue) {
487
- const lastEditCommand = lastEdit?.editCommand;
488
- if (lastEditCommand) {
489
- // remove unsaved css class from that cell
490
- for (const lastEditColumn of lastEdit.columns) {
491
- this.removeUnsavedStylingFromCell(lastEdit.item, lastEditColumn, lastEditCommand.row);
492
- }
493
- }
494
- }
495
- }
496
-
497
- renderUnsavedStylingOnAllVisibleCells() {
498
- for (const lastEdit of this.editQueue) {
499
- if (lastEdit) {
500
- const { item, columns, editCommand } = lastEdit;
501
- if (Array.isArray(columns)) {
502
- columns.forEach((col) => {
503
- this.renderUnsavedCellStyling(item, col, editCommand);
504
- });
505
- }
506
- }
507
- }
508
- }
509
-
510
- renderUnsavedCellStyling(item: any, column: Column, editCommand: EditCommand) {
511
- if (editCommand && item && column) {
512
- const row = this.angularGrid.dataView.getRowByItem(item) as number;
513
- if (row >= 0) {
514
- const hash = { [row]: { [column.id]: 'unsaved-editable-field' } };
515
- this.angularGrid.slickGrid.setCellCssStyles(`unsaved_highlight_${[column.id]}${row}`, hash);
516
- }
517
- }
518
- }
519
-
520
-
521
- saveAll() {
522
- // Edit Queue (array increases every time a cell is changed, regardless of item object)
523
- console.log(this.editQueue);
524
-
525
- // Edit Items only keeps the merged data (an object with row index as the row properties)
526
- // if you change 2 different cells on 2 different cells then this editedItems will only contain 1 property
527
- // example: editedItems = { 0: { title: task 0, duration: 50, ... }}
528
- // ...means that row index 0 got changed and the final merged object is { title: task 0, duration: 50, ... }
529
- console.log(this.editedItems);
530
- // console.log(`We changed ${Object.keys(this.editedItems).length} rows`);
531
-
532
- // since we saved, we can now remove all the unsaved color styling and reset our array/object
533
- this.removeAllUnsavedStylingFromCell();
534
- this.editQueue = [];
535
- this.editedItems = {};
536
- }
537
-
538
- undoLastEdit(showLastEditor = false) {
539
- const lastEdit = this.editQueue.pop();
540
- const lastEditCommand = lastEdit?.editCommand;
541
- if (lastEdit && lastEditCommand && Slick.GlobalEditorLock.cancelCurrentEdit()) {
542
- lastEditCommand.undo();
543
-
544
- // remove unsaved css class from that cell
545
- for (const lastEditColumn of lastEdit.columns) {
546
- this.removeUnsavedStylingFromCell(lastEdit.item, lastEditColumn, lastEditCommand.row);
547
- }
548
- this.angularGrid.slickGrid.invalidate();
549
-
550
-
551
- // optionally open the last cell editor associated
552
- if (showLastEditor) {
553
- this.angularGrid?.slickGrid.gotoCell(lastEditCommand.row, lastEditCommand.cell, false);
554
- }
555
- }
556
- }
557
-
558
- undoAllEdits() {
559
- for (const lastEdit of this.editQueue) {
560
- const lastEditCommand = lastEdit?.editCommand;
561
- if (lastEditCommand && Slick.GlobalEditorLock.cancelCurrentEdit()) {
562
- lastEditCommand.undo();
563
-
564
- // remove unsaved css class from that cell
565
- for (const lastEditColumn of lastEdit.columns) {
566
- this.removeUnsavedStylingFromCell(lastEdit.item, lastEditColumn, lastEditCommand.row);
567
- }
568
- }
569
- }
570
- this.angularGrid.slickGrid.invalidate(); // re-render the grid only after every cells got rolled back
571
- this.editQueue = [];
572
- }
573
-
574
- mockProducts() {
575
- return [
576
- {
577
- id: 0,
578
- itemName: 'Sleek Metal Computer',
579
- itemNameTranslated: 'some fantastic sleek metal computer description',
580
- listPrice: 2100.23,
581
- itemTypeName: 'I',
582
- image: 'http://i.stack.imgur.com/pC1Tv.jpg',
583
- icon: `mdi ${this.getRandomIcon(0)}`,
584
- },
585
- {
586
- id: 1,
587
- itemName: 'Tasty Granite Table',
588
- itemNameTranslated: 'an extremely huge and heavy table',
589
- listPrice: 3200.12,
590
- itemTypeName: 'I',
591
- image: 'https://i.imgur.com/Fnm7j6h.jpg',
592
- icon: `mdi ${this.getRandomIcon(1)}`,
593
- },
594
- {
595
- id: 2,
596
- itemName: 'Awesome Wooden Mouse',
597
- itemNameTranslated: 'super old mouse',
598
- listPrice: 15.00,
599
- itemTypeName: 'I',
600
- image: 'https://i.imgur.com/RaVJuLr.jpg',
601
- icon: `mdi ${this.getRandomIcon(2)}`,
602
- },
603
- {
604
- id: 3,
605
- itemName: 'Gorgeous Fresh Shirt',
606
- itemNameTranslated: 'what a gorgeous shirt seriously',
607
- listPrice: 25.76,
608
- itemTypeName: 'I',
609
- image: 'http://i.stack.imgur.com/pC1Tv.jpg',
610
- icon: `mdi ${this.getRandomIcon(3)}`,
611
- },
612
- {
613
- id: 4,
614
- itemName: 'Refined Cotton Table',
615
- itemNameTranslated: 'super light table that will fall apart amazingly fast',
616
- listPrice: 13.35,
617
- itemTypeName: 'I',
618
- image: 'https://i.imgur.com/Fnm7j6h.jpg',
619
- icon: `mdi ${this.getRandomIcon(4)}`,
620
- },
621
- {
622
- id: 5,
623
- itemName: 'Intelligent Wooden Pizza',
624
- itemNameTranslated: 'wood not included',
625
- listPrice: 23.33,
626
- itemTypeName: 'I',
627
- image: 'https://i.imgur.com/RaVJuLr.jpg',
628
- icon: `mdi ${this.getRandomIcon(5)}`,
629
- },
630
- {
631
- id: 6,
632
- itemName: 'Licensed Cotton Chips',
633
- itemNameTranslated: 'not sure what that is',
634
- listPrice: 71.21,
635
- itemTypeName: 'I',
636
- image: 'http://i.stack.imgur.com/pC1Tv.jpg',
637
- icon: `mdi ${this.getRandomIcon(6)}`,
638
- },
639
- {
640
- id: 7,
641
- itemName: 'Ergonomic Rubber Soap',
642
- itemNameTranslated: `so good you'll want to use it every night`,
643
- listPrice: 2.43,
644
- itemTypeName: 'I',
645
- image: 'https://i.imgur.com/Fnm7j6h.jpg',
646
- icon: `mdi ${this.getRandomIcon(7)}`,
647
- },
648
- {
649
- id: 8,
650
- itemName: 'Handcrafted Steel Car',
651
- itemNameTranslated: `aka tesla truck`,
652
- listPrice: 31288.39,
653
- itemTypeName: 'I',
654
- image: 'https://i.imgur.com/RaVJuLr.jpg',
655
- icon: `mdi ${this.getRandomIcon(8)}`,
656
- },
657
- ];
658
- }
659
-
660
- /** List of icons that are supported in this lib Material Design Icons */
661
- getRandomIcon(iconIndex?: number) {
662
- const icons = [
663
- 'fa-500px',
664
- 'fa-address-book',
665
- 'fa-address-book-o',
666
- 'fa-address-card',
667
- 'fa-address-card-o',
668
- 'fa-adjust',
669
- 'fa-adn',
670
- 'fa-align-center',
671
- 'fa-align-justify',
672
- 'fa-align-left',
673
- 'fa-align-right',
674
- 'fa-amazon',
675
- 'fa-ambulance',
676
- 'fa-american-sign-language-interpreting',
677
- 'fa-anchor',
678
- 'fa-android',
679
- 'fa-angellist',
680
- 'fa-angle-double-down',
681
- 'fa-angle-double-left',
682
- 'fa-angle-double-right',
683
- 'fa-angle-double-up',
684
- 'fa-angle-down',
685
- 'fa-angle-left',
686
- 'fa-angle-right',
687
- 'fa-angle-up',
688
- 'fa-apple',
689
- 'fa-archive',
690
- 'fa-area-chart',
691
- 'fa-arrow-circle-down',
692
- 'fa-arrow-circle-left',
693
- 'fa-arrow-circle-o-down',
694
- 'fa-arrow-circle-o-left',
695
- 'fa-arrow-circle-o-right',
696
- 'fa-arrow-circle-o-up',
697
- 'fa-arrow-circle-right',
698
- 'fa-arrow-circle-up',
699
- 'fa-arrow-down',
700
- 'fa-arrow-left',
701
- 'fa-arrow-right',
702
- 'fa-arrow-up',
703
- 'fa-arrows',
704
- 'fa-arrows-alt',
705
- 'fa-arrows-h',
706
- 'fa-arrows-v',
707
- 'fa-assistive-listening-systems',
708
- 'fa-asterisk',
709
- 'fa-at',
710
- 'fa-audio-description',
711
- 'fa-backward',
712
- 'fa-balance-scale',
713
- 'fa-ban',
714
- 'fa-bandcamp',
715
- 'fa-bank (alias)',
716
- 'fa-bar-chart',
717
- 'fa-barcode',
718
- 'fa-bars',
719
- 'fa-bath',
720
- 'fa-battery-empty',
721
- 'fa-battery-full',
722
- 'fa-battery-half',
723
- 'fa-battery-quarter',
724
- 'fa-battery-three-quarters',
725
- 'fa-bed',
726
- 'fa-beer',
727
- 'fa-behance',
728
- 'fa-behance-square',
729
- 'fa-bell',
730
- 'fa-bell-o',
731
- 'fa-bell-slash',
732
- 'fa-bell-slash-o',
733
- 'fa-bicycle',
734
- 'fa-binoculars',
735
- 'fa-birthday-cake',
736
- 'fa-bitbucket',
737
- 'fa-bitbucket-square',
738
- ];
739
- const randomNumber = Math.floor((Math.random() * icons.length - 1));
740
- return icons[iconIndex ?? randomNumber];
741
- }
742
-
743
- renderItemCallbackWith2Rows(item: any): string {
744
- return `<div class="autocomplete-container-list">
745
- <div class="autocomplete-left">
746
- <!--<img src="http://i.stack.imgur.com/pC1Tv.jpg" width="50" />-->
747
- <span class="fa ${item.icon}"></span>
748
- </div>
749
- <div>
750
- <span class="autocomplete-top-left">
751
- <span class="mdfai ${item.itemTypeName === 'I' ? 'fa-info-circle' : 'fa-copy'}"></span>
752
- ${item.itemName}
753
- </span>
754
- <div>
755
- </div>
756
- <div>
757
- <div class="autocomplete-bottom-left">${item.itemNameTranslated}</div>
758
- </div>`;
759
- }
760
-
761
- renderItemCallbackWith4Corners(item: any): string {
762
- return `<div class="autocomplete-container-list">
763
- <div class="autocomplete-left">
764
- <!--<img src="http://i.stack.imgur.com/pC1Tv.jpg" width="50" />-->
765
- <span class="fa ${item.icon}"></span>
766
- </div>
767
- <div>
768
- <span class="autocomplete-top-left">
769
- <span class="fa ${item.itemTypeName === 'I' ? 'fa-info-circle' : 'fa-copy'}"></span>
770
- ${item.itemName}
771
- </span>
772
- <span class="autocomplete-top-right">${formatNumber(item.listPrice, 2, 2, false, '$')}</span>
773
- <div>
774
- </div>
775
- <div>
776
- <div class="autocomplete-bottom-left">${item.itemNameTranslated}</div>
777
- <span class="autocomplete-bottom-right">Type: <b>${item.itemTypeName === 'I' ? 'Item' : item.itemTypeName === 'C' ? 'PdCat' : 'Cat'}</b></span>
778
- </div>`;
779
- }
780
- }