@sd-angular/core 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (805) hide show
  1. package/api/package.json +1 -12
  2. package/api/sd-angular-core-api.d.ts +0 -2
  3. package/autocomplete/package.json +1 -12
  4. package/autocomplete/sd-angular-core-autocomplete.d.ts +0 -2
  5. package/badge/package.json +1 -12
  6. package/badge/sd-angular-core-badge.d.ts +0 -2
  7. package/bundles/sd-angular-core-api.umd.js +1 -2
  8. package/bundles/sd-angular-core-api.umd.js.map +1 -1
  9. package/bundles/sd-angular-core-autocomplete.umd.js +1 -2
  10. package/bundles/sd-angular-core-autocomplete.umd.js.map +1 -1
  11. package/bundles/sd-angular-core-badge.umd.js +1 -2
  12. package/bundles/sd-angular-core-badge.umd.js.map +1 -1
  13. package/bundles/sd-angular-core-button.umd.js +1 -2
  14. package/bundles/sd-angular-core-button.umd.js.map +1 -1
  15. package/bundles/sd-angular-core-cache.umd.js +1 -2
  16. package/bundles/sd-angular-core-cache.umd.js.map +1 -1
  17. package/bundles/sd-angular-core-chart.umd.js +1 -2
  18. package/bundles/sd-angular-core-chart.umd.js.map +1 -1
  19. package/bundles/sd-angular-core-checkbox.umd.js +1 -2
  20. package/bundles/sd-angular-core-checkbox.umd.js.map +1 -1
  21. package/bundles/sd-angular-core-chip.umd.js +1 -2
  22. package/bundles/sd-angular-core-chip.umd.js.map +1 -1
  23. package/bundles/sd-angular-core-comment.umd.js +1 -2
  24. package/bundles/sd-angular-core-comment.umd.js.map +1 -1
  25. package/bundles/sd-angular-core-common.umd.js +1 -2
  26. package/bundles/sd-angular-core-common.umd.js.map +1 -1
  27. package/bundles/sd-angular-core-confirm.umd.js +1 -2
  28. package/bundles/sd-angular-core-confirm.umd.js.map +1 -1
  29. package/bundles/sd-angular-core-date-month.umd.js +1 -2
  30. package/bundles/sd-angular-core-date-month.umd.js.map +1 -1
  31. package/bundles/sd-angular-core-date-range.umd.js +1 -2
  32. package/bundles/sd-angular-core-date-range.umd.js.map +1 -1
  33. package/bundles/sd-angular-core-date-time.umd.js +1 -2
  34. package/bundles/sd-angular-core-date-time.umd.js.map +1 -1
  35. package/bundles/sd-angular-core-db.umd.js +1 -2
  36. package/bundles/sd-angular-core-db.umd.js.map +1 -1
  37. package/bundles/sd-angular-core-dynamic-report.umd.js +1 -2
  38. package/bundles/sd-angular-core-dynamic-report.umd.js.map +1 -1
  39. package/bundles/sd-angular-core-editor.umd.js +1 -2
  40. package/bundles/sd-angular-core-editor.umd.js.map +1 -1
  41. package/bundles/sd-angular-core-excel.umd.js +1 -2
  42. package/bundles/sd-angular-core-excel.umd.js.map +1 -1
  43. package/bundles/sd-angular-core-export.umd.js +1 -2
  44. package/bundles/sd-angular-core-export.umd.js.map +1 -1
  45. package/bundles/sd-angular-core-filter.umd.js +1 -2
  46. package/bundles/sd-angular-core-filter.umd.js.map +1 -1
  47. package/bundles/sd-angular-core-form.umd.js +1 -2
  48. package/bundles/sd-angular-core-form.umd.js.map +1 -1
  49. package/bundles/sd-angular-core-grid-material.umd.js +29 -15
  50. package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
  51. package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
  52. package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
  53. package/bundles/sd-angular-core-grid.umd.js +1 -2
  54. package/bundles/sd-angular-core-grid.umd.js.map +1 -1
  55. package/bundles/sd-angular-core-group.umd.js +1 -2
  56. package/bundles/sd-angular-core-group.umd.js.map +1 -1
  57. package/bundles/sd-angular-core-header-title.umd.js +1 -2
  58. package/bundles/sd-angular-core-header-title.umd.js.map +1 -1
  59. package/bundles/sd-angular-core-image-preview.umd.js +1 -2
  60. package/bundles/sd-angular-core-image-preview.umd.js.map +1 -1
  61. package/bundles/sd-angular-core-input-currency.umd.js +1 -2
  62. package/bundles/sd-angular-core-input-currency.umd.js.map +1 -1
  63. package/bundles/sd-angular-core-input-dropdown.umd.js +1 -2
  64. package/bundles/sd-angular-core-input-dropdown.umd.js.map +1 -1
  65. package/bundles/sd-angular-core-input-number.umd.js +1 -2
  66. package/bundles/sd-angular-core-input-number.umd.js.map +1 -1
  67. package/bundles/sd-angular-core-input-upload-file.umd.js +1 -2
  68. package/bundles/sd-angular-core-input-upload-file.umd.js.map +1 -1
  69. package/bundles/sd-angular-core-input.umd.js +1 -2
  70. package/bundles/sd-angular-core-input.umd.js.map +1 -1
  71. package/bundles/sd-angular-core-json-editor.umd.js +1 -2
  72. package/bundles/sd-angular-core-json-editor.umd.js.map +1 -1
  73. package/bundles/sd-angular-core-konva.umd.js +1 -2
  74. package/bundles/sd-angular-core-konva.umd.js.map +1 -1
  75. package/bundles/sd-angular-core-label.umd.js +1 -2
  76. package/bundles/sd-angular-core-label.umd.js.map +1 -1
  77. package/bundles/sd-angular-core-loading.umd.js +1 -2
  78. package/bundles/sd-angular-core-loading.umd.js.map +1 -1
  79. package/bundles/sd-angular-core-modal-resizable.umd.js +1 -2
  80. package/bundles/sd-angular-core-modal-resizable.umd.js.map +1 -1
  81. package/bundles/sd-angular-core-modal.umd.js +1 -2
  82. package/bundles/sd-angular-core-modal.umd.js.map +1 -1
  83. package/bundles/sd-angular-core-notify.umd.js +1 -2
  84. package/bundles/sd-angular-core-notify.umd.js.map +1 -1
  85. package/bundles/sd-angular-core-popover.umd.js +1 -2
  86. package/bundles/sd-angular-core-popover.umd.js.map +1 -1
  87. package/bundles/sd-angular-core-quick-action.umd.js +1 -2
  88. package/bundles/sd-angular-core-quick-action.umd.js.map +1 -1
  89. package/bundles/sd-angular-core-radio.umd.js +1 -2
  90. package/bundles/sd-angular-core-radio.umd.js.map +1 -1
  91. package/bundles/sd-angular-core-select-badge.umd.js +1 -2
  92. package/bundles/sd-angular-core-select-badge.umd.js.map +1 -1
  93. package/bundles/sd-angular-core-select-editor.umd.js +1 -2
  94. package/bundles/sd-angular-core-select-editor.umd.js.map +1 -1
  95. package/bundles/sd-angular-core-select.umd.js +1 -2
  96. package/bundles/sd-angular-core-select.umd.js.map +1 -1
  97. package/bundles/sd-angular-core-service.umd.js +1 -2
  98. package/bundles/sd-angular-core-service.umd.js.map +1 -1
  99. package/bundles/sd-angular-core-setting.umd.js +1 -2
  100. package/bundles/sd-angular-core-setting.umd.js.map +1 -1
  101. package/bundles/sd-angular-core-side-drawer.umd.js +1 -2
  102. package/bundles/sd-angular-core-side-drawer.umd.js.map +1 -1
  103. package/bundles/sd-angular-core-switch.umd.js +1 -2
  104. package/bundles/sd-angular-core-switch.umd.js.map +1 -1
  105. package/bundles/sd-angular-core-tab-router.umd.js +1 -2
  106. package/bundles/sd-angular-core-tab-router.umd.js.map +1 -1
  107. package/bundles/sd-angular-core-textarea.umd.js +1 -2
  108. package/bundles/sd-angular-core-textarea.umd.js.map +1 -1
  109. package/bundles/sd-angular-core-time.umd.js +1 -2
  110. package/bundles/sd-angular-core-time.umd.js.map +1 -1
  111. package/bundles/sd-angular-core-timeline.umd.js +1 -2
  112. package/bundles/sd-angular-core-timeline.umd.js.map +1 -1
  113. package/bundles/sd-angular-core-translate.umd.js +1 -2
  114. package/bundles/sd-angular-core-translate.umd.js.map +1 -1
  115. package/bundles/sd-angular-core-upload-excel.umd.js +1 -2
  116. package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
  117. package/bundles/sd-angular-core-upload-file.umd.js +1 -2
  118. package/bundles/sd-angular-core-upload-file.umd.js.map +1 -1
  119. package/bundles/sd-angular-core-utility.umd.js +1 -2
  120. package/bundles/sd-angular-core-utility.umd.js.map +1 -1
  121. package/bundles/sd-angular-core-view.umd.js +1 -2
  122. package/bundles/sd-angular-core-view.umd.js.map +1 -1
  123. package/button/package.json +1 -12
  124. package/button/sd-angular-core-button.d.ts +0 -2
  125. package/cache/package.json +1 -12
  126. package/cache/sd-angular-core-cache.d.ts +0 -2
  127. package/chart/package.json +1 -12
  128. package/chart/sd-angular-core-chart.d.ts +0 -2
  129. package/checkbox/package.json +1 -12
  130. package/checkbox/sd-angular-core-checkbox.d.ts +0 -2
  131. package/chip/package.json +1 -12
  132. package/chip/sd-angular-core-chip.d.ts +0 -2
  133. package/comment/package.json +1 -12
  134. package/comment/sd-angular-core-comment.d.ts +0 -2
  135. package/common/package.json +1 -12
  136. package/common/sd-angular-core-common.d.ts +0 -2
  137. package/confirm/package.json +1 -12
  138. package/confirm/sd-angular-core-confirm.d.ts +0 -2
  139. package/date-month/package.json +1 -12
  140. package/date-month/sd-angular-core-date-month.d.ts +0 -2
  141. package/date-range/package.json +1 -12
  142. package/date-range/sd-angular-core-date-range.d.ts +0 -2
  143. package/date-time/package.json +1 -12
  144. package/date-time/sd-angular-core-date-time.d.ts +0 -2
  145. package/db/package.json +1 -12
  146. package/db/sd-angular-core-db.d.ts +0 -2
  147. package/dynamic-report/package.json +1 -12
  148. package/dynamic-report/sd-angular-core-dynamic-report.d.ts +0 -2
  149. package/editor/package.json +1 -12
  150. package/editor/sd-angular-core-editor.d.ts +0 -2
  151. package/esm2015/api/sd-angular-core-api.js +1 -1
  152. package/esm2015/autocomplete/sd-angular-core-autocomplete.js +1 -1
  153. package/esm2015/badge/sd-angular-core-badge.js +1 -1
  154. package/esm2015/button/sd-angular-core-button.js +1 -1
  155. package/esm2015/cache/sd-angular-core-cache.js +1 -1
  156. package/esm2015/chart/sd-angular-core-chart.js +1 -1
  157. package/esm2015/checkbox/sd-angular-core-checkbox.js +1 -1
  158. package/esm2015/chip/sd-angular-core-chip.js +1 -1
  159. package/esm2015/comment/sd-angular-core-comment.js +1 -1
  160. package/esm2015/common/sd-angular-core-common.js +1 -1
  161. package/esm2015/confirm/sd-angular-core-confirm.js +1 -1
  162. package/esm2015/date-month/sd-angular-core-date-month.js +1 -1
  163. package/esm2015/date-range/sd-angular-core-date-range.js +1 -1
  164. package/esm2015/date-time/sd-angular-core-date-time.js +1 -1
  165. package/esm2015/db/sd-angular-core-db.js +1 -1
  166. package/esm2015/dynamic-report/sd-angular-core-dynamic-report.js +1 -1
  167. package/esm2015/editor/sd-angular-core-editor.js +1 -1
  168. package/esm2015/excel/sd-angular-core-excel.js +1 -1
  169. package/esm2015/export/sd-angular-core-export.js +1 -1
  170. package/esm2015/filter/sd-angular-core-filter.js +1 -1
  171. package/esm2015/form/sd-angular-core-form.js +1 -1
  172. package/esm2015/grid/sd-angular-core-grid.js +1 -1
  173. package/esm2015/grid-material/sd-angular-core-grid-material.js +1 -1
  174. package/esm2015/grid-material/src/lib/grid-material.component.js +29 -15
  175. package/esm2015/group/sd-angular-core-group.js +1 -1
  176. package/esm2015/header-title/sd-angular-core-header-title.js +1 -1
  177. package/esm2015/image-preview/sd-angular-core-image-preview.js +1 -1
  178. package/esm2015/input/sd-angular-core-input.js +1 -1
  179. package/esm2015/input-currency/sd-angular-core-input-currency.js +1 -1
  180. package/esm2015/input-dropdown/sd-angular-core-input-dropdown.js +1 -1
  181. package/esm2015/input-number/sd-angular-core-input-number.js +1 -1
  182. package/esm2015/input-upload-file/sd-angular-core-input-upload-file.js +1 -1
  183. package/esm2015/json-editor/sd-angular-core-json-editor.js +1 -1
  184. package/esm2015/konva/sd-angular-core-konva.js +1 -1
  185. package/esm2015/label/sd-angular-core-label.js +1 -1
  186. package/esm2015/loading/sd-angular-core-loading.js +1 -1
  187. package/esm2015/modal/sd-angular-core-modal.js +1 -1
  188. package/esm2015/modal-resizable/sd-angular-core-modal-resizable.js +1 -1
  189. package/esm2015/notify/sd-angular-core-notify.js +1 -1
  190. package/esm2015/popover/sd-angular-core-popover.js +1 -1
  191. package/esm2015/quick-action/sd-angular-core-quick-action.js +1 -1
  192. package/esm2015/radio/sd-angular-core-radio.js +1 -1
  193. package/esm2015/select/sd-angular-core-select.js +1 -1
  194. package/esm2015/select-badge/sd-angular-core-select-badge.js +1 -1
  195. package/esm2015/select-editor/sd-angular-core-select-editor.js +1 -1
  196. package/esm2015/service/sd-angular-core-service.js +1 -1
  197. package/esm2015/setting/sd-angular-core-setting.js +1 -1
  198. package/esm2015/side-drawer/sd-angular-core-side-drawer.js +1 -1
  199. package/esm2015/switch/sd-angular-core-switch.js +1 -1
  200. package/esm2015/tab-router/sd-angular-core-tab-router.js +1 -1
  201. package/esm2015/textarea/sd-angular-core-textarea.js +1 -1
  202. package/esm2015/time/sd-angular-core-time.js +1 -1
  203. package/esm2015/timeline/sd-angular-core-timeline.js +1 -1
  204. package/esm2015/translate/sd-angular-core-translate.js +1 -1
  205. package/esm2015/upload-excel/sd-angular-core-upload-excel.js +1 -1
  206. package/esm2015/upload-file/sd-angular-core-upload-file.js +1 -1
  207. package/esm2015/utility/sd-angular-core-utility.js +1 -1
  208. package/esm2015/view/sd-angular-core-view.js +1 -1
  209. package/excel/package.json +1 -12
  210. package/excel/sd-angular-core-excel.d.ts +0 -2
  211. package/export/package.json +1 -12
  212. package/export/sd-angular-core-export.d.ts +0 -2
  213. package/fesm2015/sd-angular-core-api.js +1 -2
  214. package/fesm2015/sd-angular-core-api.js.map +1 -1
  215. package/fesm2015/sd-angular-core-autocomplete.js +1 -2
  216. package/fesm2015/sd-angular-core-autocomplete.js.map +1 -1
  217. package/fesm2015/sd-angular-core-badge.js +1 -2
  218. package/fesm2015/sd-angular-core-badge.js.map +1 -1
  219. package/fesm2015/sd-angular-core-button.js +1 -2
  220. package/fesm2015/sd-angular-core-button.js.map +1 -1
  221. package/fesm2015/sd-angular-core-cache.js +1 -2
  222. package/fesm2015/sd-angular-core-cache.js.map +1 -1
  223. package/fesm2015/sd-angular-core-chart.js +1 -2
  224. package/fesm2015/sd-angular-core-chart.js.map +1 -1
  225. package/fesm2015/sd-angular-core-checkbox.js +1 -2
  226. package/fesm2015/sd-angular-core-checkbox.js.map +1 -1
  227. package/fesm2015/sd-angular-core-chip.js +1 -2
  228. package/fesm2015/sd-angular-core-chip.js.map +1 -1
  229. package/fesm2015/sd-angular-core-comment.js +1 -2
  230. package/fesm2015/sd-angular-core-comment.js.map +1 -1
  231. package/fesm2015/sd-angular-core-common.js +1 -2
  232. package/fesm2015/sd-angular-core-common.js.map +1 -1
  233. package/fesm2015/sd-angular-core-confirm.js +1 -2
  234. package/fesm2015/sd-angular-core-confirm.js.map +1 -1
  235. package/fesm2015/sd-angular-core-date-month.js +1 -2
  236. package/fesm2015/sd-angular-core-date-month.js.map +1 -1
  237. package/fesm2015/sd-angular-core-date-range.js +1 -2
  238. package/fesm2015/sd-angular-core-date-range.js.map +1 -1
  239. package/fesm2015/sd-angular-core-date-time.js +1 -2
  240. package/fesm2015/sd-angular-core-date-time.js.map +1 -1
  241. package/fesm2015/sd-angular-core-db.js +1 -2
  242. package/fesm2015/sd-angular-core-db.js.map +1 -1
  243. package/fesm2015/sd-angular-core-dynamic-report.js +1 -2
  244. package/fesm2015/sd-angular-core-dynamic-report.js.map +1 -1
  245. package/fesm2015/sd-angular-core-editor.js +1 -2
  246. package/fesm2015/sd-angular-core-editor.js.map +1 -1
  247. package/fesm2015/sd-angular-core-excel.js +1 -2
  248. package/fesm2015/sd-angular-core-excel.js.map +1 -1
  249. package/fesm2015/sd-angular-core-export.js +1 -2
  250. package/fesm2015/sd-angular-core-export.js.map +1 -1
  251. package/fesm2015/sd-angular-core-filter.js +1 -2
  252. package/fesm2015/sd-angular-core-filter.js.map +1 -1
  253. package/fesm2015/sd-angular-core-form.js +1 -2
  254. package/fesm2015/sd-angular-core-form.js.map +1 -1
  255. package/fesm2015/sd-angular-core-grid-material.js +29 -16
  256. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  257. package/fesm2015/sd-angular-core-grid.js +1 -2
  258. package/fesm2015/sd-angular-core-grid.js.map +1 -1
  259. package/fesm2015/sd-angular-core-group.js +1 -2
  260. package/fesm2015/sd-angular-core-group.js.map +1 -1
  261. package/fesm2015/sd-angular-core-header-title.js +1 -2
  262. package/fesm2015/sd-angular-core-header-title.js.map +1 -1
  263. package/fesm2015/sd-angular-core-image-preview.js +1 -2
  264. package/fesm2015/sd-angular-core-image-preview.js.map +1 -1
  265. package/fesm2015/sd-angular-core-input-currency.js +1 -2
  266. package/fesm2015/sd-angular-core-input-currency.js.map +1 -1
  267. package/fesm2015/sd-angular-core-input-dropdown.js +1 -2
  268. package/fesm2015/sd-angular-core-input-dropdown.js.map +1 -1
  269. package/fesm2015/sd-angular-core-input-number.js +1 -2
  270. package/fesm2015/sd-angular-core-input-number.js.map +1 -1
  271. package/fesm2015/sd-angular-core-input-upload-file.js +1 -2
  272. package/fesm2015/sd-angular-core-input-upload-file.js.map +1 -1
  273. package/fesm2015/sd-angular-core-input.js +1 -2
  274. package/fesm2015/sd-angular-core-input.js.map +1 -1
  275. package/fesm2015/sd-angular-core-json-editor.js +1 -2
  276. package/fesm2015/sd-angular-core-json-editor.js.map +1 -1
  277. package/fesm2015/sd-angular-core-konva.js +1 -2
  278. package/fesm2015/sd-angular-core-konva.js.map +1 -1
  279. package/fesm2015/sd-angular-core-label.js +1 -2
  280. package/fesm2015/sd-angular-core-label.js.map +1 -1
  281. package/fesm2015/sd-angular-core-loading.js +1 -2
  282. package/fesm2015/sd-angular-core-loading.js.map +1 -1
  283. package/fesm2015/sd-angular-core-modal-resizable.js +1 -2
  284. package/fesm2015/sd-angular-core-modal-resizable.js.map +1 -1
  285. package/fesm2015/sd-angular-core-modal.js +1 -2
  286. package/fesm2015/sd-angular-core-modal.js.map +1 -1
  287. package/fesm2015/sd-angular-core-notify.js +1 -2
  288. package/fesm2015/sd-angular-core-notify.js.map +1 -1
  289. package/fesm2015/sd-angular-core-popover.js +1 -2
  290. package/fesm2015/sd-angular-core-popover.js.map +1 -1
  291. package/fesm2015/sd-angular-core-quick-action.js +1 -2
  292. package/fesm2015/sd-angular-core-quick-action.js.map +1 -1
  293. package/fesm2015/sd-angular-core-radio.js +1 -2
  294. package/fesm2015/sd-angular-core-radio.js.map +1 -1
  295. package/fesm2015/sd-angular-core-select-badge.js +1 -2
  296. package/fesm2015/sd-angular-core-select-badge.js.map +1 -1
  297. package/fesm2015/sd-angular-core-select-editor.js +1 -2
  298. package/fesm2015/sd-angular-core-select-editor.js.map +1 -1
  299. package/fesm2015/sd-angular-core-select.js +1 -2
  300. package/fesm2015/sd-angular-core-select.js.map +1 -1
  301. package/fesm2015/sd-angular-core-service.js +1 -2
  302. package/fesm2015/sd-angular-core-service.js.map +1 -1
  303. package/fesm2015/sd-angular-core-setting.js +1 -2
  304. package/fesm2015/sd-angular-core-setting.js.map +1 -1
  305. package/fesm2015/sd-angular-core-side-drawer.js +1 -2
  306. package/fesm2015/sd-angular-core-side-drawer.js.map +1 -1
  307. package/fesm2015/sd-angular-core-switch.js +1 -2
  308. package/fesm2015/sd-angular-core-switch.js.map +1 -1
  309. package/fesm2015/sd-angular-core-tab-router.js +1 -2
  310. package/fesm2015/sd-angular-core-tab-router.js.map +1 -1
  311. package/fesm2015/sd-angular-core-textarea.js +1 -2
  312. package/fesm2015/sd-angular-core-textarea.js.map +1 -1
  313. package/fesm2015/sd-angular-core-time.js +1 -2
  314. package/fesm2015/sd-angular-core-time.js.map +1 -1
  315. package/fesm2015/sd-angular-core-timeline.js +1 -2
  316. package/fesm2015/sd-angular-core-timeline.js.map +1 -1
  317. package/fesm2015/sd-angular-core-translate.js +1 -2
  318. package/fesm2015/sd-angular-core-translate.js.map +1 -1
  319. package/fesm2015/sd-angular-core-upload-excel.js +1 -2
  320. package/fesm2015/sd-angular-core-upload-excel.js.map +1 -1
  321. package/fesm2015/sd-angular-core-upload-file.js +1 -2
  322. package/fesm2015/sd-angular-core-upload-file.js.map +1 -1
  323. package/fesm2015/sd-angular-core-utility.js +1 -2
  324. package/fesm2015/sd-angular-core-utility.js.map +1 -1
  325. package/fesm2015/sd-angular-core-view.js +1 -2
  326. package/fesm2015/sd-angular-core-view.js.map +1 -1
  327. package/filter/package.json +1 -12
  328. package/filter/sd-angular-core-filter.d.ts +0 -2
  329. package/form/package.json +1 -12
  330. package/form/sd-angular-core-form.d.ts +0 -2
  331. package/grid/package.json +1 -12
  332. package/grid/sd-angular-core-grid.d.ts +0 -2
  333. package/grid-material/package.json +1 -12
  334. package/grid-material/sd-angular-core-grid-material.d.ts +0 -2
  335. package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
  336. package/group/package.json +1 -12
  337. package/group/sd-angular-core-group.d.ts +0 -2
  338. package/header-title/package.json +1 -12
  339. package/header-title/sd-angular-core-header-title.d.ts +0 -2
  340. package/image-preview/package.json +1 -12
  341. package/image-preview/sd-angular-core-image-preview.d.ts +0 -2
  342. package/input/package.json +1 -12
  343. package/input/sd-angular-core-input.d.ts +0 -2
  344. package/input-currency/package.json +1 -12
  345. package/input-currency/sd-angular-core-input-currency.d.ts +0 -2
  346. package/input-dropdown/package.json +1 -12
  347. package/input-dropdown/sd-angular-core-input-dropdown.d.ts +0 -2
  348. package/input-number/package.json +1 -12
  349. package/input-number/sd-angular-core-input-number.d.ts +0 -2
  350. package/input-upload-file/package.json +1 -12
  351. package/input-upload-file/sd-angular-core-input-upload-file.d.ts +0 -2
  352. package/json-editor/package.json +1 -12
  353. package/json-editor/sd-angular-core-json-editor.d.ts +0 -2
  354. package/konva/package.json +1 -12
  355. package/konva/sd-angular-core-konva.d.ts +0 -2
  356. package/label/package.json +1 -12
  357. package/label/sd-angular-core-label.d.ts +0 -2
  358. package/loading/package.json +1 -12
  359. package/loading/sd-angular-core-loading.d.ts +0 -2
  360. package/modal/package.json +1 -12
  361. package/modal/sd-angular-core-modal.d.ts +0 -2
  362. package/modal-resizable/package.json +1 -12
  363. package/modal-resizable/sd-angular-core-modal-resizable.d.ts +0 -2
  364. package/notify/package.json +1 -12
  365. package/notify/sd-angular-core-notify.d.ts +0 -2
  366. package/package.json +1 -1
  367. package/popover/package.json +1 -12
  368. package/popover/sd-angular-core-popover.d.ts +0 -2
  369. package/quick-action/package.json +1 -12
  370. package/quick-action/sd-angular-core-quick-action.d.ts +0 -2
  371. package/radio/package.json +1 -12
  372. package/radio/sd-angular-core-radio.d.ts +0 -2
  373. package/sd-angular-core-1.3.2.tgz +0 -0
  374. package/select/package.json +1 -12
  375. package/select/sd-angular-core-select.d.ts +0 -2
  376. package/select-badge/package.json +1 -12
  377. package/select-badge/sd-angular-core-select-badge.d.ts +0 -2
  378. package/select-editor/package.json +1 -12
  379. package/select-editor/sd-angular-core-select-editor.d.ts +0 -2
  380. package/service/package.json +1 -12
  381. package/service/sd-angular-core-service.d.ts +0 -2
  382. package/setting/package.json +1 -12
  383. package/setting/sd-angular-core-setting.d.ts +0 -2
  384. package/side-drawer/package.json +1 -12
  385. package/side-drawer/sd-angular-core-side-drawer.d.ts +0 -2
  386. package/switch/package.json +1 -12
  387. package/switch/sd-angular-core-switch.d.ts +0 -2
  388. package/tab-router/package.json +1 -12
  389. package/tab-router/sd-angular-core-tab-router.d.ts +0 -2
  390. package/textarea/package.json +1 -12
  391. package/textarea/sd-angular-core-textarea.d.ts +0 -2
  392. package/time/package.json +1 -12
  393. package/time/sd-angular-core-time.d.ts +0 -2
  394. package/timeline/package.json +1 -12
  395. package/timeline/sd-angular-core-timeline.d.ts +0 -2
  396. package/translate/package.json +1 -12
  397. package/translate/sd-angular-core-translate.d.ts +0 -2
  398. package/upload-excel/package.json +1 -12
  399. package/upload-excel/sd-angular-core-upload-excel.d.ts +0 -2
  400. package/upload-file/package.json +1 -12
  401. package/upload-file/sd-angular-core-upload-file.d.ts +0 -2
  402. package/utility/package.json +1 -12
  403. package/utility/sd-angular-core-utility.d.ts +0 -2
  404. package/view/package.json +1 -12
  405. package/view/sd-angular-core-view.d.ts +0 -2
  406. package/api/sd-angular-core-api.d.ts.__ivy_ngcc_bak +0 -4
  407. package/api/sd-angular-core-api.d.ts.map +0 -1
  408. package/autocomplete/sd-angular-core-autocomplete.d.ts.__ivy_ngcc_bak +0 -4
  409. package/autocomplete/sd-angular-core-autocomplete.d.ts.map +0 -1
  410. package/badge/sd-angular-core-badge.d.ts.__ivy_ngcc_bak +0 -4
  411. package/badge/sd-angular-core-badge.d.ts.map +0 -1
  412. package/bundles/sd-angular-core-api.umd.js.__ivy_ngcc_bak +0 -876
  413. package/bundles/sd-angular-core-api.umd.js.map.__ivy_ngcc_bak +0 -1
  414. package/bundles/sd-angular-core-autocomplete.umd.js.__ivy_ngcc_bak +0 -791
  415. package/bundles/sd-angular-core-autocomplete.umd.js.map.__ivy_ngcc_bak +0 -1
  416. package/bundles/sd-angular-core-badge.umd.js.__ivy_ngcc_bak +0 -89
  417. package/bundles/sd-angular-core-badge.umd.js.map.__ivy_ngcc_bak +0 -1
  418. package/bundles/sd-angular-core-button.umd.js.__ivy_ngcc_bak +0 -447
  419. package/bundles/sd-angular-core-button.umd.js.map.__ivy_ngcc_bak +0 -1
  420. package/bundles/sd-angular-core-cache.umd.js.__ivy_ngcc_bak +0 -623
  421. package/bundles/sd-angular-core-cache.umd.js.map.__ivy_ngcc_bak +0 -1
  422. package/bundles/sd-angular-core-chart.umd.js.__ivy_ngcc_bak +0 -1106
  423. package/bundles/sd-angular-core-chart.umd.js.map.__ivy_ngcc_bak +0 -1
  424. package/bundles/sd-angular-core-checkbox.umd.js.__ivy_ngcc_bak +0 -461
  425. package/bundles/sd-angular-core-checkbox.umd.js.map.__ivy_ngcc_bak +0 -1
  426. package/bundles/sd-angular-core-chip.umd.js.__ivy_ngcc_bak +0 -1051
  427. package/bundles/sd-angular-core-chip.umd.js.map.__ivy_ngcc_bak +0 -1
  428. package/bundles/sd-angular-core-comment.umd.js.__ivy_ngcc_bak +0 -456
  429. package/bundles/sd-angular-core-comment.umd.js.map.__ivy_ngcc_bak +0 -1
  430. package/bundles/sd-angular-core-common.umd.js.__ivy_ngcc_bak +0 -962
  431. package/bundles/sd-angular-core-common.umd.js.map.__ivy_ngcc_bak +0 -1
  432. package/bundles/sd-angular-core-confirm.umd.js.__ivy_ngcc_bak +0 -159
  433. package/bundles/sd-angular-core-confirm.umd.js.map.__ivy_ngcc_bak +0 -1
  434. package/bundles/sd-angular-core-date-month.umd.js.__ivy_ngcc_bak +0 -650
  435. package/bundles/sd-angular-core-date-month.umd.js.map.__ivy_ngcc_bak +0 -1
  436. package/bundles/sd-angular-core-date-range.umd.js.__ivy_ngcc_bak +0 -660
  437. package/bundles/sd-angular-core-date-range.umd.js.map.__ivy_ngcc_bak +0 -1
  438. package/bundles/sd-angular-core-date-time.umd.js.__ivy_ngcc_bak +0 -734
  439. package/bundles/sd-angular-core-date-time.umd.js.map.__ivy_ngcc_bak +0 -1
  440. package/bundles/sd-angular-core-db.umd.js.__ivy_ngcc_bak +0 -475
  441. package/bundles/sd-angular-core-db.umd.js.map.__ivy_ngcc_bak +0 -1
  442. package/bundles/sd-angular-core-dynamic-report.umd.js.__ivy_ngcc_bak +0 -96
  443. package/bundles/sd-angular-core-dynamic-report.umd.js.map.__ivy_ngcc_bak +0 -1
  444. package/bundles/sd-angular-core-editor.umd.js.__ivy_ngcc_bak +0 -943
  445. package/bundles/sd-angular-core-editor.umd.js.map.__ivy_ngcc_bak +0 -1
  446. package/bundles/sd-angular-core-excel.umd.js.__ivy_ngcc_bak +0 -500
  447. package/bundles/sd-angular-core-excel.umd.js.map.__ivy_ngcc_bak +0 -1
  448. package/bundles/sd-angular-core-export.umd.js.__ivy_ngcc_bak +0 -712
  449. package/bundles/sd-angular-core-export.umd.js.map.__ivy_ngcc_bak +0 -1
  450. package/bundles/sd-angular-core-filter.umd.js.__ivy_ngcc_bak +0 -703
  451. package/bundles/sd-angular-core-filter.umd.js.map.__ivy_ngcc_bak +0 -1
  452. package/bundles/sd-angular-core-form.umd.js.__ivy_ngcc_bak +0 -88
  453. package/bundles/sd-angular-core-form.umd.js.map.__ivy_ngcc_bak +0 -1
  454. package/bundles/sd-angular-core-grid-material.umd.js.__ivy_ngcc_bak +0 -5029
  455. package/bundles/sd-angular-core-grid-material.umd.js.map.__ivy_ngcc_bak +0 -1
  456. package/bundles/sd-angular-core-grid.umd.js.__ivy_ngcc_bak +0 -5125
  457. package/bundles/sd-angular-core-grid.umd.js.map.__ivy_ngcc_bak +0 -1
  458. package/bundles/sd-angular-core-group.umd.js.__ivy_ngcc_bak +0 -93
  459. package/bundles/sd-angular-core-group.umd.js.map.__ivy_ngcc_bak +0 -1
  460. package/bundles/sd-angular-core-header-title.umd.js.__ivy_ngcc_bak +0 -56
  461. package/bundles/sd-angular-core-header-title.umd.js.map.__ivy_ngcc_bak +0 -1
  462. package/bundles/sd-angular-core-image-preview.umd.js.__ivy_ngcc_bak +0 -121
  463. package/bundles/sd-angular-core-image-preview.umd.js.map.__ivy_ngcc_bak +0 -1
  464. package/bundles/sd-angular-core-input-currency.umd.js.__ivy_ngcc_bak +0 -737
  465. package/bundles/sd-angular-core-input-currency.umd.js.map.__ivy_ngcc_bak +0 -1
  466. package/bundles/sd-angular-core-input-dropdown.umd.js.__ivy_ngcc_bak +0 -634
  467. package/bundles/sd-angular-core-input-dropdown.umd.js.map.__ivy_ngcc_bak +0 -1
  468. package/bundles/sd-angular-core-input-number.umd.js.__ivy_ngcc_bak +0 -792
  469. package/bundles/sd-angular-core-input-number.umd.js.map.__ivy_ngcc_bak +0 -1
  470. package/bundles/sd-angular-core-input-upload-file.umd.js.__ivy_ngcc_bak +0 -648
  471. package/bundles/sd-angular-core-input-upload-file.umd.js.map.__ivy_ngcc_bak +0 -1
  472. package/bundles/sd-angular-core-input.umd.js.__ivy_ngcc_bak +0 -798
  473. package/bundles/sd-angular-core-input.umd.js.map.__ivy_ngcc_bak +0 -1
  474. package/bundles/sd-angular-core-json-editor.umd.js.__ivy_ngcc_bak +0 -523
  475. package/bundles/sd-angular-core-json-editor.umd.js.map.__ivy_ngcc_bak +0 -1
  476. package/bundles/sd-angular-core-konva.umd.js.__ivy_ngcc_bak +0 -605
  477. package/bundles/sd-angular-core-konva.umd.js.map.__ivy_ngcc_bak +0 -1
  478. package/bundles/sd-angular-core-label.umd.js.__ivy_ngcc_bak +0 -60
  479. package/bundles/sd-angular-core-label.umd.js.map.__ivy_ngcc_bak +0 -1
  480. package/bundles/sd-angular-core-loading.umd.js.__ivy_ngcc_bak +0 -413
  481. package/bundles/sd-angular-core-loading.umd.js.map.__ivy_ngcc_bak +0 -1
  482. package/bundles/sd-angular-core-modal-resizable.umd.js.__ivy_ngcc_bak +0 -487
  483. package/bundles/sd-angular-core-modal-resizable.umd.js.map.__ivy_ngcc_bak +0 -1
  484. package/bundles/sd-angular-core-modal.umd.js.__ivy_ngcc_bak +0 -307
  485. package/bundles/sd-angular-core-modal.umd.js.map.__ivy_ngcc_bak +0 -1
  486. package/bundles/sd-angular-core-notify.umd.js.__ivy_ngcc_bak +0 -719
  487. package/bundles/sd-angular-core-notify.umd.js.map.__ivy_ngcc_bak +0 -1
  488. package/bundles/sd-angular-core-popover.umd.js.__ivy_ngcc_bak +0 -752
  489. package/bundles/sd-angular-core-popover.umd.js.map.__ivy_ngcc_bak +0 -1
  490. package/bundles/sd-angular-core-quick-action.umd.js.__ivy_ngcc_bak +0 -66
  491. package/bundles/sd-angular-core-quick-action.umd.js.map.__ivy_ngcc_bak +0 -1
  492. package/bundles/sd-angular-core-radio.umd.js.__ivy_ngcc_bak +0 -535
  493. package/bundles/sd-angular-core-radio.umd.js.map.__ivy_ngcc_bak +0 -1
  494. package/bundles/sd-angular-core-select-badge.umd.js.__ivy_ngcc_bak +0 -486
  495. package/bundles/sd-angular-core-select-badge.umd.js.map.__ivy_ngcc_bak +0 -1
  496. package/bundles/sd-angular-core-select-editor.umd.js.__ivy_ngcc_bak +0 -431
  497. package/bundles/sd-angular-core-select-editor.umd.js.map.__ivy_ngcc_bak +0 -1
  498. package/bundles/sd-angular-core-select.umd.js.__ivy_ngcc_bak +0 -921
  499. package/bundles/sd-angular-core-select.umd.js.map.__ivy_ngcc_bak +0 -1
  500. package/bundles/sd-angular-core-service.umd.js.__ivy_ngcc_bak +0 -42
  501. package/bundles/sd-angular-core-service.umd.js.map.__ivy_ngcc_bak +0 -1
  502. package/bundles/sd-angular-core-setting.umd.js.__ivy_ngcc_bak +0 -664
  503. package/bundles/sd-angular-core-setting.umd.js.map.__ivy_ngcc_bak +0 -1
  504. package/bundles/sd-angular-core-side-drawer.umd.js.__ivy_ngcc_bak +0 -438
  505. package/bundles/sd-angular-core-side-drawer.umd.js.map.__ivy_ngcc_bak +0 -1
  506. package/bundles/sd-angular-core-switch.umd.js.__ivy_ngcc_bak +0 -454
  507. package/bundles/sd-angular-core-switch.umd.js.map.__ivy_ngcc_bak +0 -1
  508. package/bundles/sd-angular-core-tab-router.umd.js.__ivy_ngcc_bak +0 -941
  509. package/bundles/sd-angular-core-tab-router.umd.js.map.__ivy_ngcc_bak +0 -1
  510. package/bundles/sd-angular-core-textarea.umd.js.__ivy_ngcc_bak +0 -642
  511. package/bundles/sd-angular-core-textarea.umd.js.map.__ivy_ngcc_bak +0 -1
  512. package/bundles/sd-angular-core-time.umd.js.__ivy_ngcc_bak +0 -497
  513. package/bundles/sd-angular-core-time.umd.js.map.__ivy_ngcc_bak +0 -1
  514. package/bundles/sd-angular-core-timeline.umd.js.__ivy_ngcc_bak +0 -102
  515. package/bundles/sd-angular-core-timeline.umd.js.map.__ivy_ngcc_bak +0 -1
  516. package/bundles/sd-angular-core-translate.umd.js.__ivy_ngcc_bak +0 -119
  517. package/bundles/sd-angular-core-translate.umd.js.map.__ivy_ngcc_bak +0 -1
  518. package/bundles/sd-angular-core-upload-excel.umd.js.__ivy_ngcc_bak +0 -1114
  519. package/bundles/sd-angular-core-upload-excel.umd.js.map.__ivy_ngcc_bak +0 -1
  520. package/bundles/sd-angular-core-upload-file.umd.js.__ivy_ngcc_bak +0 -880
  521. package/bundles/sd-angular-core-upload-file.umd.js.map.__ivy_ngcc_bak +0 -1
  522. package/bundles/sd-angular-core-utility.umd.js.__ivy_ngcc_bak +0 -739
  523. package/bundles/sd-angular-core-utility.umd.js.map.__ivy_ngcc_bak +0 -1
  524. package/bundles/sd-angular-core-view.umd.js.__ivy_ngcc_bak +0 -32
  525. package/bundles/sd-angular-core-view.umd.js.map.__ivy_ngcc_bak +0 -1
  526. package/button/sd-angular-core-button.d.ts.__ivy_ngcc_bak +0 -4
  527. package/button/sd-angular-core-button.d.ts.map +0 -1
  528. package/cache/sd-angular-core-cache.d.ts.__ivy_ngcc_bak +0 -4
  529. package/cache/sd-angular-core-cache.d.ts.map +0 -1
  530. package/chart/sd-angular-core-chart.d.ts.__ivy_ngcc_bak +0 -4
  531. package/chart/sd-angular-core-chart.d.ts.map +0 -1
  532. package/checkbox/sd-angular-core-checkbox.d.ts.__ivy_ngcc_bak +0 -5
  533. package/checkbox/sd-angular-core-checkbox.d.ts.map +0 -1
  534. package/chip/sd-angular-core-chip.d.ts.__ivy_ngcc_bak +0 -5
  535. package/chip/sd-angular-core-chip.d.ts.map +0 -1
  536. package/comment/sd-angular-core-comment.d.ts.__ivy_ngcc_bak +0 -4
  537. package/comment/sd-angular-core-comment.d.ts.map +0 -1
  538. package/common/sd-angular-core-common.d.ts.__ivy_ngcc_bak +0 -4
  539. package/common/sd-angular-core-common.d.ts.map +0 -1
  540. package/confirm/sd-angular-core-confirm.d.ts.__ivy_ngcc_bak +0 -4
  541. package/confirm/sd-angular-core-confirm.d.ts.map +0 -1
  542. package/date-month/sd-angular-core-date-month.d.ts.__ivy_ngcc_bak +0 -5
  543. package/date-month/sd-angular-core-date-month.d.ts.map +0 -1
  544. package/date-range/sd-angular-core-date-range.d.ts.__ivy_ngcc_bak +0 -4
  545. package/date-range/sd-angular-core-date-range.d.ts.map +0 -1
  546. package/date-time/sd-angular-core-date-time.d.ts.__ivy_ngcc_bak +0 -4
  547. package/date-time/sd-angular-core-date-time.d.ts.map +0 -1
  548. package/db/sd-angular-core-db.d.ts.__ivy_ngcc_bak +0 -4
  549. package/db/sd-angular-core-db.d.ts.map +0 -1
  550. package/dynamic-report/sd-angular-core-dynamic-report.d.ts.__ivy_ngcc_bak +0 -4
  551. package/dynamic-report/sd-angular-core-dynamic-report.d.ts.map +0 -1
  552. package/editor/sd-angular-core-editor.d.ts.__ivy_ngcc_bak +0 -4
  553. package/editor/sd-angular-core-editor.d.ts.map +0 -1
  554. package/esm2015/api/sd-angular-core-api.js.__ivy_ngcc_bak +0 -5
  555. package/esm2015/autocomplete/sd-angular-core-autocomplete.js.__ivy_ngcc_bak +0 -5
  556. package/esm2015/badge/sd-angular-core-badge.js.__ivy_ngcc_bak +0 -5
  557. package/esm2015/button/sd-angular-core-button.js.__ivy_ngcc_bak +0 -5
  558. package/esm2015/cache/sd-angular-core-cache.js.__ivy_ngcc_bak +0 -5
  559. package/esm2015/chart/sd-angular-core-chart.js.__ivy_ngcc_bak +0 -5
  560. package/esm2015/checkbox/sd-angular-core-checkbox.js.__ivy_ngcc_bak +0 -6
  561. package/esm2015/chip/sd-angular-core-chip.js.__ivy_ngcc_bak +0 -6
  562. package/esm2015/comment/sd-angular-core-comment.js.__ivy_ngcc_bak +0 -5
  563. package/esm2015/common/sd-angular-core-common.js.__ivy_ngcc_bak +0 -5
  564. package/esm2015/confirm/sd-angular-core-confirm.js.__ivy_ngcc_bak +0 -5
  565. package/esm2015/date-month/sd-angular-core-date-month.js.__ivy_ngcc_bak +0 -6
  566. package/esm2015/date-range/sd-angular-core-date-range.js.__ivy_ngcc_bak +0 -5
  567. package/esm2015/date-time/sd-angular-core-date-time.js.__ivy_ngcc_bak +0 -5
  568. package/esm2015/db/sd-angular-core-db.js.__ivy_ngcc_bak +0 -5
  569. package/esm2015/dynamic-report/sd-angular-core-dynamic-report.js.__ivy_ngcc_bak +0 -5
  570. package/esm2015/editor/sd-angular-core-editor.js.__ivy_ngcc_bak +0 -5
  571. package/esm2015/excel/sd-angular-core-excel.js.__ivy_ngcc_bak +0 -5
  572. package/esm2015/export/sd-angular-core-export.js.__ivy_ngcc_bak +0 -5
  573. package/esm2015/filter/sd-angular-core-filter.js.__ivy_ngcc_bak +0 -8
  574. package/esm2015/form/sd-angular-core-form.js.__ivy_ngcc_bak +0 -5
  575. package/esm2015/grid/sd-angular-core-grid.js.__ivy_ngcc_bak +0 -5
  576. package/esm2015/grid-material/sd-angular-core-grid-material.js.__ivy_ngcc_bak +0 -47
  577. package/esm2015/group/sd-angular-core-group.js.__ivy_ngcc_bak +0 -6
  578. package/esm2015/header-title/sd-angular-core-header-title.js.__ivy_ngcc_bak +0 -6
  579. package/esm2015/image-preview/sd-angular-core-image-preview.js.__ivy_ngcc_bak +0 -7
  580. package/esm2015/input/sd-angular-core-input.js.__ivy_ngcc_bak +0 -6
  581. package/esm2015/input-currency/sd-angular-core-input-currency.js.__ivy_ngcc_bak +0 -5
  582. package/esm2015/input-dropdown/sd-angular-core-input-dropdown.js.__ivy_ngcc_bak +0 -5
  583. package/esm2015/input-number/sd-angular-core-input-number.js.__ivy_ngcc_bak +0 -5
  584. package/esm2015/input-upload-file/sd-angular-core-input-upload-file.js.__ivy_ngcc_bak +0 -5
  585. package/esm2015/json-editor/sd-angular-core-json-editor.js.__ivy_ngcc_bak +0 -5
  586. package/esm2015/konva/sd-angular-core-konva.js.__ivy_ngcc_bak +0 -5
  587. package/esm2015/label/sd-angular-core-label.js.__ivy_ngcc_bak +0 -6
  588. package/esm2015/loading/sd-angular-core-loading.js.__ivy_ngcc_bak +0 -5
  589. package/esm2015/modal/sd-angular-core-modal.js.__ivy_ngcc_bak +0 -5
  590. package/esm2015/modal-resizable/sd-angular-core-modal-resizable.js.__ivy_ngcc_bak +0 -5
  591. package/esm2015/notify/sd-angular-core-notify.js.__ivy_ngcc_bak +0 -5
  592. package/esm2015/popover/sd-angular-core-popover.js.__ivy_ngcc_bak +0 -5
  593. package/esm2015/quick-action/sd-angular-core-quick-action.js.__ivy_ngcc_bak +0 -5
  594. package/esm2015/radio/sd-angular-core-radio.js.__ivy_ngcc_bak +0 -5
  595. package/esm2015/select/sd-angular-core-select.js.__ivy_ngcc_bak +0 -5
  596. package/esm2015/select-badge/sd-angular-core-select-badge.js.__ivy_ngcc_bak +0 -5
  597. package/esm2015/select-editor/sd-angular-core-select-editor.js.__ivy_ngcc_bak +0 -5
  598. package/esm2015/service/sd-angular-core-service.js.__ivy_ngcc_bak +0 -5
  599. package/esm2015/setting/sd-angular-core-setting.js.__ivy_ngcc_bak +0 -5
  600. package/esm2015/side-drawer/sd-angular-core-side-drawer.js.__ivy_ngcc_bak +0 -5
  601. package/esm2015/switch/sd-angular-core-switch.js.__ivy_ngcc_bak +0 -5
  602. package/esm2015/tab-router/sd-angular-core-tab-router.js.__ivy_ngcc_bak +0 -7
  603. package/esm2015/textarea/sd-angular-core-textarea.js.__ivy_ngcc_bak +0 -5
  604. package/esm2015/time/sd-angular-core-time.js.__ivy_ngcc_bak +0 -6
  605. package/esm2015/timeline/sd-angular-core-timeline.js.__ivy_ngcc_bak +0 -6
  606. package/esm2015/translate/sd-angular-core-translate.js.__ivy_ngcc_bak +0 -5
  607. package/esm2015/upload-excel/sd-angular-core-upload-excel.js.__ivy_ngcc_bak +0 -7
  608. package/esm2015/upload-file/sd-angular-core-upload-file.js.__ivy_ngcc_bak +0 -5
  609. package/esm2015/utility/sd-angular-core-utility.js.__ivy_ngcc_bak +0 -5
  610. package/esm2015/view/sd-angular-core-view.js.__ivy_ngcc_bak +0 -5
  611. package/excel/sd-angular-core-excel.d.ts.__ivy_ngcc_bak +0 -4
  612. package/excel/sd-angular-core-excel.d.ts.map +0 -1
  613. package/export/sd-angular-core-export.d.ts.__ivy_ngcc_bak +0 -4
  614. package/export/sd-angular-core-export.d.ts.map +0 -1
  615. package/fesm2015/sd-angular-core-api.js.__ivy_ngcc_bak +0 -496
  616. package/fesm2015/sd-angular-core-api.js.map.__ivy_ngcc_bak +0 -1
  617. package/fesm2015/sd-angular-core-autocomplete.js.__ivy_ngcc_bak +0 -427
  618. package/fesm2015/sd-angular-core-autocomplete.js.map.__ivy_ngcc_bak +0 -1
  619. package/fesm2015/sd-angular-core-badge.js.__ivy_ngcc_bak +0 -70
  620. package/fesm2015/sd-angular-core-badge.js.map.__ivy_ngcc_bak +0 -1
  621. package/fesm2015/sd-angular-core-button.js.__ivy_ngcc_bak +0 -118
  622. package/fesm2015/sd-angular-core-button.js.map.__ivy_ngcc_bak +0 -1
  623. package/fesm2015/sd-angular-core-cache.js.__ivy_ngcc_bak +0 -259
  624. package/fesm2015/sd-angular-core-cache.js.map.__ivy_ngcc_bak +0 -1
  625. package/fesm2015/sd-angular-core-chart.js.__ivy_ngcc_bak +0 -727
  626. package/fesm2015/sd-angular-core-chart.js.map.__ivy_ngcc_bak +0 -1
  627. package/fesm2015/sd-angular-core-checkbox.js.__ivy_ngcc_bak +0 -120
  628. package/fesm2015/sd-angular-core-checkbox.js.map.__ivy_ngcc_bak +0 -1
  629. package/fesm2015/sd-angular-core-chip.js.__ivy_ngcc_bak +0 -632
  630. package/fesm2015/sd-angular-core-chip.js.map.__ivy_ngcc_bak +0 -1
  631. package/fesm2015/sd-angular-core-comment.js.__ivy_ngcc_bak +0 -118
  632. package/fesm2015/sd-angular-core-comment.js.map.__ivy_ngcc_bak +0 -1
  633. package/fesm2015/sd-angular-core-common.js.__ivy_ngcc_bak +0 -562
  634. package/fesm2015/sd-angular-core-common.js.map.__ivy_ngcc_bak +0 -1
  635. package/fesm2015/sd-angular-core-confirm.js.__ivy_ngcc_bak +0 -154
  636. package/fesm2015/sd-angular-core-confirm.js.map.__ivy_ngcc_bak +0 -1
  637. package/fesm2015/sd-angular-core-date-month.js.__ivy_ngcc_bak +0 -289
  638. package/fesm2015/sd-angular-core-date-month.js.map.__ivy_ngcc_bak +0 -1
  639. package/fesm2015/sd-angular-core-date-range.js.__ivy_ngcc_bak +0 -297
  640. package/fesm2015/sd-angular-core-date-range.js.map.__ivy_ngcc_bak +0 -1
  641. package/fesm2015/sd-angular-core-date-time.js.__ivy_ngcc_bak +0 -367
  642. package/fesm2015/sd-angular-core-date-time.js.map.__ivy_ngcc_bak +0 -1
  643. package/fesm2015/sd-angular-core-db.js.__ivy_ngcc_bak +0 -102
  644. package/fesm2015/sd-angular-core-db.js.map.__ivy_ngcc_bak +0 -1
  645. package/fesm2015/sd-angular-core-dynamic-report.js.__ivy_ngcc_bak +0 -82
  646. package/fesm2015/sd-angular-core-dynamic-report.js.map.__ivy_ngcc_bak +0 -1
  647. package/fesm2015/sd-angular-core-editor.js.__ivy_ngcc_bak +0 -576
  648. package/fesm2015/sd-angular-core-editor.js.map.__ivy_ngcc_bak +0 -1
  649. package/fesm2015/sd-angular-core-excel.js.__ivy_ngcc_bak +0 -100
  650. package/fesm2015/sd-angular-core-excel.js.map.__ivy_ngcc_bak +0 -1
  651. package/fesm2015/sd-angular-core-export.js.__ivy_ngcc_bak +0 -272
  652. package/fesm2015/sd-angular-core-export.js.map.__ivy_ngcc_bak +0 -1
  653. package/fesm2015/sd-angular-core-filter.js.__ivy_ngcc_bak +0 -323
  654. package/fesm2015/sd-angular-core-filter.js.map.__ivy_ngcc_bak +0 -1
  655. package/fesm2015/sd-angular-core-form.js.__ivy_ngcc_bak +0 -104
  656. package/fesm2015/sd-angular-core-form.js.map.__ivy_ngcc_bak +0 -1
  657. package/fesm2015/sd-angular-core-grid-material.js.__ivy_ngcc_bak +0 -3740
  658. package/fesm2015/sd-angular-core-grid-material.js.map.__ivy_ngcc_bak +0 -1
  659. package/fesm2015/sd-angular-core-grid.js.__ivy_ngcc_bak +0 -3935
  660. package/fesm2015/sd-angular-core-grid.js.map.__ivy_ngcc_bak +0 -1
  661. package/fesm2015/sd-angular-core-group.js.__ivy_ngcc_bak +0 -74
  662. package/fesm2015/sd-angular-core-group.js.map.__ivy_ngcc_bak +0 -1
  663. package/fesm2015/sd-angular-core-header-title.js.__ivy_ngcc_bak +0 -45
  664. package/fesm2015/sd-angular-core-header-title.js.map.__ivy_ngcc_bak +0 -1
  665. package/fesm2015/sd-angular-core-image-preview.js.__ivy_ngcc_bak +0 -107
  666. package/fesm2015/sd-angular-core-image-preview.js.map.__ivy_ngcc_bak +0 -1
  667. package/fesm2015/sd-angular-core-input-currency.js.__ivy_ngcc_bak +0 -330
  668. package/fesm2015/sd-angular-core-input-currency.js.map.__ivy_ngcc_bak +0 -1
  669. package/fesm2015/sd-angular-core-input-dropdown.js.__ivy_ngcc_bak +0 -268
  670. package/fesm2015/sd-angular-core-input-dropdown.js.map.__ivy_ngcc_bak +0 -1
  671. package/fesm2015/sd-angular-core-input-number.js.__ivy_ngcc_bak +0 -415
  672. package/fesm2015/sd-angular-core-input-number.js.map.__ivy_ngcc_bak +0 -1
  673. package/fesm2015/sd-angular-core-input-upload-file.js.__ivy_ngcc_bak +0 -274
  674. package/fesm2015/sd-angular-core-input-upload-file.js.map.__ivy_ngcc_bak +0 -1
  675. package/fesm2015/sd-angular-core-input.js.__ivy_ngcc_bak +0 -398
  676. package/fesm2015/sd-angular-core-input.js.map.__ivy_ngcc_bak +0 -1
  677. package/fesm2015/sd-angular-core-json-editor.js.__ivy_ngcc_bak +0 -180
  678. package/fesm2015/sd-angular-core-json-editor.js.map.__ivy_ngcc_bak +0 -1
  679. package/fesm2015/sd-angular-core-konva.js.__ivy_ngcc_bak +0 -237
  680. package/fesm2015/sd-angular-core-konva.js.map.__ivy_ngcc_bak +0 -1
  681. package/fesm2015/sd-angular-core-label.js.__ivy_ngcc_bak +0 -49
  682. package/fesm2015/sd-angular-core-label.js.map.__ivy_ngcc_bak +0 -1
  683. package/fesm2015/sd-angular-core-loading.js.__ivy_ngcc_bak +0 -83
  684. package/fesm2015/sd-angular-core-loading.js.map.__ivy_ngcc_bak +0 -1
  685. package/fesm2015/sd-angular-core-modal-resizable.js.__ivy_ngcc_bak +0 -161
  686. package/fesm2015/sd-angular-core-modal-resizable.js.map.__ivy_ngcc_bak +0 -1
  687. package/fesm2015/sd-angular-core-modal.js.__ivy_ngcc_bak +0 -284
  688. package/fesm2015/sd-angular-core-modal.js.map.__ivy_ngcc_bak +0 -1
  689. package/fesm2015/sd-angular-core-notify.js.__ivy_ngcc_bak +0 -402
  690. package/fesm2015/sd-angular-core-notify.js.map.__ivy_ngcc_bak +0 -1
  691. package/fesm2015/sd-angular-core-popover.js.__ivy_ngcc_bak +0 -415
  692. package/fesm2015/sd-angular-core-popover.js.map.__ivy_ngcc_bak +0 -1
  693. package/fesm2015/sd-angular-core-quick-action.js.__ivy_ngcc_bak +0 -53
  694. package/fesm2015/sd-angular-core-quick-action.js.map.__ivy_ngcc_bak +0 -1
  695. package/fesm2015/sd-angular-core-radio.js.__ivy_ngcc_bak +0 -188
  696. package/fesm2015/sd-angular-core-radio.js.map.__ivy_ngcc_bak +0 -1
  697. package/fesm2015/sd-angular-core-select-badge.js.__ivy_ngcc_bak +0 -156
  698. package/fesm2015/sd-angular-core-select-badge.js.map.__ivy_ngcc_bak +0 -1
  699. package/fesm2015/sd-angular-core-select-editor.js.__ivy_ngcc_bak +0 -110
  700. package/fesm2015/sd-angular-core-select-editor.js.map.__ivy_ngcc_bak +0 -1
  701. package/fesm2015/sd-angular-core-select.js.__ivy_ngcc_bak +0 -487
  702. package/fesm2015/sd-angular-core-select.js.map.__ivy_ngcc_bak +0 -1
  703. package/fesm2015/sd-angular-core-service.js.__ivy_ngcc_bak +0 -36
  704. package/fesm2015/sd-angular-core-service.js.map.__ivy_ngcc_bak +0 -1
  705. package/fesm2015/sd-angular-core-setting.js.__ivy_ngcc_bak +0 -290
  706. package/fesm2015/sd-angular-core-setting.js.map.__ivy_ngcc_bak +0 -1
  707. package/fesm2015/sd-angular-core-side-drawer.js.__ivy_ngcc_bak +0 -115
  708. package/fesm2015/sd-angular-core-side-drawer.js.map.__ivy_ngcc_bak +0 -1
  709. package/fesm2015/sd-angular-core-switch.js.__ivy_ngcc_bak +0 -116
  710. package/fesm2015/sd-angular-core-switch.js.map.__ivy_ngcc_bak +0 -1
  711. package/fesm2015/sd-angular-core-tab-router.js.__ivy_ngcc_bak +0 -531
  712. package/fesm2015/sd-angular-core-tab-router.js.map.__ivy_ngcc_bak +0 -1
  713. package/fesm2015/sd-angular-core-textarea.js.__ivy_ngcc_bak +0 -266
  714. package/fesm2015/sd-angular-core-textarea.js.map.__ivy_ngcc_bak +0 -1
  715. package/fesm2015/sd-angular-core-time.js.__ivy_ngcc_bak +0 -143
  716. package/fesm2015/sd-angular-core-time.js.map.__ivy_ngcc_bak +0 -1
  717. package/fesm2015/sd-angular-core-timeline.js.__ivy_ngcc_bak +0 -87
  718. package/fesm2015/sd-angular-core-timeline.js.map.__ivy_ngcc_bak +0 -1
  719. package/fesm2015/sd-angular-core-translate.js.__ivy_ngcc_bak +0 -101
  720. package/fesm2015/sd-angular-core-translate.js.map.__ivy_ngcc_bak +0 -1
  721. package/fesm2015/sd-angular-core-upload-excel.js.__ivy_ngcc_bak +0 -638
  722. package/fesm2015/sd-angular-core-upload-excel.js.map.__ivy_ngcc_bak +0 -1
  723. package/fesm2015/sd-angular-core-upload-file.js.__ivy_ngcc_bak +0 -462
  724. package/fesm2015/sd-angular-core-upload-file.js.map.__ivy_ngcc_bak +0 -1
  725. package/fesm2015/sd-angular-core-utility.js.__ivy_ngcc_bak +0 -384
  726. package/fesm2015/sd-angular-core-utility.js.map.__ivy_ngcc_bak +0 -1
  727. package/fesm2015/sd-angular-core-view.js.__ivy_ngcc_bak +0 -23
  728. package/fesm2015/sd-angular-core-view.js.map.__ivy_ngcc_bak +0 -1
  729. package/filter/sd-angular-core-filter.d.ts.__ivy_ngcc_bak +0 -7
  730. package/filter/sd-angular-core-filter.d.ts.map +0 -1
  731. package/form/sd-angular-core-form.d.ts.__ivy_ngcc_bak +0 -4
  732. package/form/sd-angular-core-form.d.ts.map +0 -1
  733. package/grid/sd-angular-core-grid.d.ts.__ivy_ngcc_bak +0 -4
  734. package/grid/sd-angular-core-grid.d.ts.map +0 -1
  735. package/grid-material/sd-angular-core-grid-material.d.ts.__ivy_ngcc_bak +0 -46
  736. package/grid-material/sd-angular-core-grid-material.d.ts.map +0 -1
  737. package/group/sd-angular-core-group.d.ts.__ivy_ngcc_bak +0 -5
  738. package/group/sd-angular-core-group.d.ts.map +0 -1
  739. package/header-title/sd-angular-core-header-title.d.ts.__ivy_ngcc_bak +0 -5
  740. package/header-title/sd-angular-core-header-title.d.ts.map +0 -1
  741. package/image-preview/sd-angular-core-image-preview.d.ts.__ivy_ngcc_bak +0 -6
  742. package/image-preview/sd-angular-core-image-preview.d.ts.map +0 -1
  743. package/input/sd-angular-core-input.d.ts.__ivy_ngcc_bak +0 -5
  744. package/input/sd-angular-core-input.d.ts.map +0 -1
  745. package/input-currency/sd-angular-core-input-currency.d.ts.__ivy_ngcc_bak +0 -4
  746. package/input-currency/sd-angular-core-input-currency.d.ts.map +0 -1
  747. package/input-dropdown/sd-angular-core-input-dropdown.d.ts.__ivy_ngcc_bak +0 -4
  748. package/input-dropdown/sd-angular-core-input-dropdown.d.ts.map +0 -1
  749. package/input-number/sd-angular-core-input-number.d.ts.__ivy_ngcc_bak +0 -4
  750. package/input-number/sd-angular-core-input-number.d.ts.map +0 -1
  751. package/input-upload-file/sd-angular-core-input-upload-file.d.ts.__ivy_ngcc_bak +0 -4
  752. package/input-upload-file/sd-angular-core-input-upload-file.d.ts.map +0 -1
  753. package/json-editor/sd-angular-core-json-editor.d.ts.__ivy_ngcc_bak +0 -4
  754. package/json-editor/sd-angular-core-json-editor.d.ts.map +0 -1
  755. package/konva/sd-angular-core-konva.d.ts.__ivy_ngcc_bak +0 -4
  756. package/konva/sd-angular-core-konva.d.ts.map +0 -1
  757. package/label/sd-angular-core-label.d.ts.__ivy_ngcc_bak +0 -5
  758. package/label/sd-angular-core-label.d.ts.map +0 -1
  759. package/loading/sd-angular-core-loading.d.ts.__ivy_ngcc_bak +0 -4
  760. package/loading/sd-angular-core-loading.d.ts.map +0 -1
  761. package/modal/sd-angular-core-modal.d.ts.__ivy_ngcc_bak +0 -4
  762. package/modal/sd-angular-core-modal.d.ts.map +0 -1
  763. package/modal-resizable/sd-angular-core-modal-resizable.d.ts.__ivy_ngcc_bak +0 -4
  764. package/modal-resizable/sd-angular-core-modal-resizable.d.ts.map +0 -1
  765. package/notify/sd-angular-core-notify.d.ts.__ivy_ngcc_bak +0 -4
  766. package/notify/sd-angular-core-notify.d.ts.map +0 -1
  767. package/popover/sd-angular-core-popover.d.ts.__ivy_ngcc_bak +0 -4
  768. package/popover/sd-angular-core-popover.d.ts.map +0 -1
  769. package/quick-action/sd-angular-core-quick-action.d.ts.__ivy_ngcc_bak +0 -4
  770. package/quick-action/sd-angular-core-quick-action.d.ts.map +0 -1
  771. package/radio/sd-angular-core-radio.d.ts.__ivy_ngcc_bak +0 -4
  772. package/radio/sd-angular-core-radio.d.ts.map +0 -1
  773. package/sd-angular-core-1.3.0.tgz +0 -0
  774. package/select/sd-angular-core-select.d.ts.__ivy_ngcc_bak +0 -4
  775. package/select/sd-angular-core-select.d.ts.map +0 -1
  776. package/select-badge/sd-angular-core-select-badge.d.ts.__ivy_ngcc_bak +0 -4
  777. package/select-badge/sd-angular-core-select-badge.d.ts.map +0 -1
  778. package/select-editor/sd-angular-core-select-editor.d.ts.__ivy_ngcc_bak +0 -4
  779. package/select-editor/sd-angular-core-select-editor.d.ts.map +0 -1
  780. package/service/sd-angular-core-service.d.ts.__ivy_ngcc_bak +0 -4
  781. package/service/sd-angular-core-service.d.ts.map +0 -1
  782. package/setting/sd-angular-core-setting.d.ts.__ivy_ngcc_bak +0 -4
  783. package/setting/sd-angular-core-setting.d.ts.map +0 -1
  784. package/side-drawer/sd-angular-core-side-drawer.d.ts.__ivy_ngcc_bak +0 -4
  785. package/side-drawer/sd-angular-core-side-drawer.d.ts.map +0 -1
  786. package/switch/sd-angular-core-switch.d.ts.__ivy_ngcc_bak +0 -4
  787. package/switch/sd-angular-core-switch.d.ts.map +0 -1
  788. package/tab-router/sd-angular-core-tab-router.d.ts.__ivy_ngcc_bak +0 -6
  789. package/tab-router/sd-angular-core-tab-router.d.ts.map +0 -1
  790. package/textarea/sd-angular-core-textarea.d.ts.__ivy_ngcc_bak +0 -4
  791. package/textarea/sd-angular-core-textarea.d.ts.map +0 -1
  792. package/time/sd-angular-core-time.d.ts.__ivy_ngcc_bak +0 -5
  793. package/time/sd-angular-core-time.d.ts.map +0 -1
  794. package/timeline/sd-angular-core-timeline.d.ts.__ivy_ngcc_bak +0 -5
  795. package/timeline/sd-angular-core-timeline.d.ts.map +0 -1
  796. package/translate/sd-angular-core-translate.d.ts.__ivy_ngcc_bak +0 -4
  797. package/translate/sd-angular-core-translate.d.ts.map +0 -1
  798. package/upload-excel/sd-angular-core-upload-excel.d.ts.__ivy_ngcc_bak +0 -6
  799. package/upload-excel/sd-angular-core-upload-excel.d.ts.map +0 -1
  800. package/upload-file/sd-angular-core-upload-file.d.ts.__ivy_ngcc_bak +0 -4
  801. package/upload-file/sd-angular-core-upload-file.d.ts.map +0 -1
  802. package/utility/sd-angular-core-utility.d.ts.__ivy_ngcc_bak +0 -4
  803. package/utility/sd-angular-core-utility.d.ts.map +0 -1
  804. package/view/sd-angular-core-view.d.ts.__ivy_ngcc_bak +0 -4
  805. package/view/sd-angular-core-view.d.ts.map +0 -1
@@ -1,3740 +0,0 @@
1
- import { SdScrollDirective, SdCommonModule } from '@sd-angular/core/common';
2
- import { Directive, TemplateRef, Input, InjectionToken, EventEmitter, Component, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild, Output, Injectable, Inject, Optional, Pipe, NgZone, QueryList, ContentChild, ContentChildren, HostListener, NgModule } from '@angular/core';
3
- import { __awaiter, __classPrivateFieldGet, __rest, __classPrivateFieldSet } from 'tslib';
4
- import { MatPaginator, MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator';
5
- import { MatSort, MatSortModule } from '@angular/material/sort';
6
- import { trigger, state, style, transition, animate } from '@angular/animations';
7
- import { v4 } from 'uuid';
8
- import { Subject, Subscription, isObservable } from 'rxjs';
9
- import { SdNotifyService } from '@sd-angular/core/notify';
10
- import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
11
- import { startWith, debounceTime, map, switchMap } from 'rxjs/operators';
12
- import hash from 'object-hash';
13
- import { SdSettingService } from '@sd-angular/core/setting';
14
- import { DeviceDetectorService } from 'ngx-device-detector';
15
- import { SdLoadingService } from '@sd-angular/core/loading';
16
- import { SdTranslateService } from '@sd-angular/core/translate';
17
- import { SdExportService } from '@sd-angular/core/export';
18
- import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
19
- import { SdQuickAction } from '@sd-angular/core/quick-action';
20
- import { CommonModule, DatePipe, DecimalPipe } from '@angular/common';
21
- import { MatFormFieldModule } from '@angular/material/form-field';
22
- import { MatIconModule } from '@angular/material/icon';
23
- import { MatInputModule } from '@angular/material/input';
24
- import { MatTableModule } from '@angular/material/table';
25
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
26
- import { CdkTableModule, CdkColumnDef } from '@angular/cdk/table';
27
- import { ScrollingModule } from '@angular/cdk/scrolling';
28
- import { MatMenuModule } from '@angular/material/menu';
29
- import { MatSliderModule } from '@angular/material/slider';
30
- import { MatButtonModule } from '@angular/material/button';
31
- import { SdServiceModule } from '@sd-angular/core/service';
32
- import { MatTooltipModule } from '@angular/material/tooltip';
33
- import { MatChipsModule } from '@angular/material/chips';
34
- import { MatRadioModule } from '@angular/material/radio';
35
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
36
- import { SdFormModule } from '@sd-angular/core/form';
37
- import { MatCheckboxModule } from '@angular/material/checkbox';
38
- import { MatListModule } from '@angular/material/list';
39
- import { MatDividerModule } from '@angular/material/divider';
40
- import { SdSideDrawer } from '@sd-angular/core/side-drawer';
41
- import { SdUtilityService } from '@sd-angular/core/utility';
42
-
43
- class SdMaterialCellDefDirective {
44
- constructor(templateRef) {
45
- this.templateRef = templateRef;
46
- }
47
- }
48
- SdMaterialCellDefDirective.decorators = [
49
- { type: Directive, args: [{
50
- selector: '[sdMaterialCellDef]'
51
- },] }
52
- ];
53
- SdMaterialCellDefDirective.ctorParameters = () => [
54
- { type: TemplateRef }
55
- ];
56
- SdMaterialCellDefDirective.propDecorators = {
57
- sdMaterialCellDef: [{ type: Input }]
58
- };
59
-
60
- class SdMaterialFilterDefDirective {
61
- constructor(templateRef) {
62
- this.templateRef = templateRef;
63
- }
64
- set showing(val) {
65
- this.defaultShowing = (val === '') || val;
66
- }
67
- }
68
- SdMaterialFilterDefDirective.decorators = [
69
- { type: Directive, args: [{
70
- selector: '[sdMaterialFilterDef]'
71
- },] }
72
- ];
73
- SdMaterialFilterDefDirective.ctorParameters = () => [
74
- { type: TemplateRef }
75
- ];
76
- SdMaterialFilterDefDirective.propDecorators = {
77
- sdMaterialFilterDef: [{ type: Input }],
78
- showing: [{ type: Input, args: ['defaultShowing',] }]
79
- };
80
-
81
- class SdMaterialFooterDefDirective {
82
- constructor(templateRef) {
83
- this.templateRef = templateRef;
84
- }
85
- }
86
- SdMaterialFooterDefDirective.decorators = [
87
- { type: Directive, args: [{
88
- selector: '[sdMaterialFooterDef]'
89
- },] }
90
- ];
91
- SdMaterialFooterDefDirective.ctorParameters = () => [
92
- { type: TemplateRef }
93
- ];
94
- SdMaterialFooterDefDirective.propDecorators = {
95
- sdMaterialFooterDef: [{ type: Input }]
96
- };
97
-
98
- class SdMaterialEmptyDataDefDirective {
99
- constructor(templateRef) {
100
- this.templateRef = templateRef;
101
- }
102
- }
103
- SdMaterialEmptyDataDefDirective.decorators = [
104
- { type: Directive, args: [{
105
- selector: '[sdMaterialEmptyDataDef]'
106
- },] }
107
- ];
108
- SdMaterialEmptyDataDefDirective.ctorParameters = () => [
109
- { type: TemplateRef }
110
- ];
111
-
112
- class SdMaterialSubInformationDefDirective {
113
- constructor(templateRef) {
114
- this.templateRef = templateRef;
115
- }
116
- }
117
- SdMaterialSubInformationDefDirective.decorators = [
118
- { type: Directive, args: [{
119
- selector: '[sdMaterialSubInformationDef]'
120
- },] }
121
- ];
122
- SdMaterialSubInformationDefDirective.ctorParameters = () => [
123
- { type: TemplateRef }
124
- ];
125
-
126
- const DEFAULT_GRID_MATERIAL_CONFIG = {
127
- paginate: {
128
- pageSize: 50,
129
- pages: [50, 100, 200]
130
- }
131
- };
132
- const GRID_MATERIAL_CONFIG = new InjectionToken('sd-grid-material.configuration');
133
-
134
- class SdPopupFilter {
135
- constructor(cdRef) {
136
- this.cdRef = cdRef;
137
- this.externalFilters = [];
138
- this.externalFilter = {};
139
- this.inlineExternal = {};
140
- this.columns = [];
141
- this.columnFilter = {};
142
- this.inlineColumn = {};
143
- this.filterDefs = [];
144
- this.filterDef = {};
145
- this.inlineFilterDef = {};
146
- this.changeFilter = new EventEmitter();
147
- this.clearFilter = new EventEmitter();
148
- this.open = (args) => {
149
- const { inlineColumn, columnFilter, inlineExternal, externalFilter, inlineFilterDef, filterDef } = args;
150
- this.inlineColumn = JSON.parse(JSON.stringify(inlineColumn || {}));
151
- this.columnFilter = JSON.parse(JSON.stringify(columnFilter || {}));
152
- this.inlineExternal = JSON.parse(JSON.stringify(inlineExternal || {}));
153
- this.externalFilter = JSON.parse(JSON.stringify(externalFilter || {}));
154
- this.inlineFilterDef = JSON.parse(JSON.stringify(inlineFilterDef || {}));
155
- this.filterDef = JSON.parse(JSON.stringify(filterDef || {}));
156
- this.modal.open();
157
- this.cdRef.markForCheck();
158
- };
159
- this.close = () => {
160
- this.modal.close();
161
- this.cdRef.markForCheck();
162
- };
163
- this.onApply = () => {
164
- this.changeFilter.emit({
165
- inlineColumn: this.inlineColumn || {},
166
- columnFilter: this.columnFilter || {},
167
- inlineExternal: this.inlineExternal || {},
168
- externalFilter: this.externalFilter || {},
169
- inlineFilterDef: this.inlineFilterDef || {},
170
- filterDef: this.filterDef || {}
171
- });
172
- this.modal.close();
173
- this.cdRef.markForCheck();
174
- };
175
- }
176
- onClear() {
177
- this.clearFilter.emit();
178
- this.modal.close();
179
- this.cdRef.markForCheck();
180
- }
181
- }
182
- SdPopupFilter.decorators = [
183
- { type: Component, args: [{
184
- selector: 'sd-popup-filter',
185
- template: "<sd-modal width=\"500px\" [title]=\"'Filter' | sdTranslate\" #modal>\r\n <sd-modal-body class=\"c-popup-filter\">\r\n <ng-container *ngFor=\"let column of columns | sdFilterColumn\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineColumn[column.field]\" color=\"primary\"></mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input *ngIf=\"column.type === 'string'\" [label]=\"column.title\" type=\"text\"\r\n [(model)]=\"columnFilter[column.field]\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input *ngIf=\"column.type === 'number'\" [label]=\"column.title\" type=\" number\"\r\n [(model)]=\"columnFilter[column.field]\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" [label]=\"column.title\" [items]=\"[{value:'1',display:column.trueValue || 'True' },\r\n {value:'0',display:column.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"columnFilter[column.field]\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values' && !column?.editor?.autocomplete\" [label]=\"column.title\"\r\n [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"columnFilter[column.field]\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"column.type === 'values' && column?.editor?.autocomplete\" [label]=\"column.title\"\r\n [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"columnFilter[column.field]\" appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"column.type ==='date' || column.type==='datetime' ||\r\n column.type==='time'\" [label]=\"column.title\" [(model)]=\" columnFilter[column.field]\" type=\"date\"\r\n appearance=\"outline\">\r\n </sd-date-time>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineExternal[item.field]\" color=\"primary\"></mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\"\r\n [(model)]=\"externalFilter[item.field]\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\" appearance=\"outline\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values'\">\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" appearance=\"outline\" multiple>\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\" appearance=\"outline\" [(model)]=\"externalFilter[item.field]\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\" appearance=\"outline\" [(model)]=\"externalFilter[item.field]\"\r\n filtered=\"true\" multiple>\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.option?.selection\" [label]=\"item.title\" [items]=\"item.values\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\" appearance=\"outline\" [(model)]=\"externalFilter[item.field]\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date' || item.type === 'datetime'\"\r\n [(model)]=\"externalFilter[item.field]\" [type]=\"item.type\" appearance=\"outline\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\" appearance=\"outline\">\r\n </sd-date-range>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngFor=\"let filter of filterDefs\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineFilterDef[filter.sdMaterialFilterDef]\" color=\"primary\">\r\n </mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <ng-container *ngTemplateOutlet=\"filter.templateRef;context:{filterDef:filterDef}\">\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </sd-modal-body>\r\n <sd-modal-footer *sdDesktop>\r\n <sd-button class=\"mr-auto\" (action)=\"onClear()\" icon=\"clear\" [title]=\"'Clear filter' | sdTranslate\" size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"onApply()\" icon=\"done\" [title]=\"'Apply' | sdTranslate\" color=\"primary\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" (action)=\"onClear()\" icon=\"clear\"\r\n [title]=\"'Clear filter' | sdTranslate\" width=\"100%\" size=\"sm\"></sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" (action)=\"onApply()\" icon=\"done\" [title]=\"'Apply' | sdTranslate\"\r\n color=\"primary\" width=\"100%\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>",
186
- changeDetection: ChangeDetectionStrategy.OnPush,
187
- styles: [".c-checkable{width:50px}.c-filterable{flex:1}::ng-deep sd-modal-body.c-popup-filter .mat-form-field-wrapper{padding-bottom:0}"]
188
- },] }
189
- ];
190
- SdPopupFilter.ctorParameters = () => [
191
- { type: ChangeDetectorRef }
192
- ];
193
- SdPopupFilter.propDecorators = {
194
- modal: [{ type: ViewChild, args: ['modal',] }],
195
- externalFilters: [{ type: Input }],
196
- columns: [{ type: Input }],
197
- filterDefs: [{ type: Input }],
198
- changeFilter: [{ type: Output }],
199
- clearFilter: [{ type: Output }]
200
- };
201
-
202
- var _prefix;
203
- class SdGridFilterService {
204
- constructor(settingService) {
205
- this.settingService = settingService;
206
- _prefix.set(this, '61d22e8e-eee8-4aad-8e1c-044a532fea91');
207
- this.get = (key) => __awaiter(this, void 0, void 0, function* () {
208
- var _a;
209
- if (!key) {
210
- return {
211
- selectedQuickFilter: null,
212
- quickFilters: [],
213
- inlineExternal: {},
214
- inlineColumn: {},
215
- inlineFilterDef: {}
216
- };
217
- }
218
- const { get } = this.settingService.create({
219
- prefix: __classPrivateFieldGet(this, _prefix),
220
- key
221
- });
222
- const configuration = yield get();
223
- return {
224
- selectedQuickFilter: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) !== null && _a !== void 0 ? _a : null,
225
- quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
226
- inlineExternal: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {},
227
- inlineColumn: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {},
228
- inlineFilterDef: (configuration === null || configuration === void 0 ? void 0 : configuration.inlineFilterDef) || {},
229
- };
230
- });
231
- this.set = (key, configuration) => __awaiter(this, void 0, void 0, function* () {
232
- configuration = {
233
- selectedQuickFilter: (configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || null,
234
- quickFilters: (configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters) || [],
235
- inlineExternal: configuration.inlineExternal || {},
236
- inlineColumn: configuration.inlineColumn || {},
237
- inlineFilterDef: configuration.inlineFilterDef || {}
238
- };
239
- if (!key) {
240
- return configuration;
241
- }
242
- const { set } = this.settingService.create({
243
- prefix: __classPrivateFieldGet(this, _prefix),
244
- key
245
- });
246
- key = hash({
247
- prefix: __classPrivateFieldGet(this, _prefix),
248
- key
249
- });
250
- yield set(configuration);
251
- return configuration;
252
- });
253
- }
254
- }
255
- _prefix = new WeakMap();
256
- SdGridFilterService.decorators = [
257
- { type: Injectable }
258
- ];
259
- SdGridFilterService.ctorParameters = () => [
260
- { type: SdSettingService }
261
- ];
262
-
263
- var _filterOptionChanges, _subscription, _loadDefault, _clearFilter;
264
- class SdGridFilter {
265
- constructor(ref, deviceService, gridFilterService) {
266
- this.ref = ref;
267
- this.deviceService = deviceService;
268
- this.gridFilterService = gridFilterService;
269
- this.isVisible = true;
270
- _filterOptionChanges.set(this, new Subject());
271
- this.columns = [];
272
- this.filterDefs = [];
273
- this.filterDef = {};
274
- this.inlineFilterDef = {};
275
- this.filterChange = new EventEmitter();
276
- _subscription.set(this, new Subscription());
277
- this.columnFilter = {};
278
- this.inlineColumn = {};
279
- this.externalFilters = [];
280
- this.externalFilter = {};
281
- this.inlineExternal = {};
282
- _loadDefault.set(this, () => {
283
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
284
- for (const column of this.columns) {
285
- this.inlineColumn[column.field] = (_a = this.inlineColumn[column.field]) !== null && _a !== void 0 ? _a : (_b = column === null || column === void 0 ? void 0 : column.filter) === null || _b === void 0 ? void 0 : _b.defaultShowing;
286
- this.columnFilter[column.field] = (_c = this.columnFilter[column.field]) !== null && _c !== void 0 ? _c : (_d = column === null || column === void 0 ? void 0 : column.filter) === null || _d === void 0 ? void 0 : _d.default;
287
- }
288
- for (const externalFilter of this.externalFilters) {
289
- this.inlineExternal[externalFilter.field] = (_e = this.inlineExternal[externalFilter.field]) !== null && _e !== void 0 ? _e : externalFilter === null || externalFilter === void 0 ? void 0 : externalFilter.defaultShowing;
290
- if (externalFilter.type === 'daterange') {
291
- this.externalFilter[externalFilter.field] = {
292
- from: (_j = (_g = (_f = this.externalFilter[externalFilter.field]) === null || _f === void 0 ? void 0 : _f.from) !== null && _g !== void 0 ? _g : (_h = externalFilter.default) === null || _h === void 0 ? void 0 : _h.from) !== null && _j !== void 0 ? _j : undefined,
293
- to: (_o = (_l = (_k = this.externalFilter[externalFilter.field]) === null || _k === void 0 ? void 0 : _k.to) !== null && _l !== void 0 ? _l : (_m = externalFilter.default) === null || _m === void 0 ? void 0 : _m.to) !== null && _o !== void 0 ? _o : undefined
294
- };
295
- }
296
- else {
297
- this.externalFilter[externalFilter.field] = (_p = this.externalFilter[externalFilter.field]) !== null && _p !== void 0 ? _p : externalFilter.default;
298
- }
299
- }
300
- for (const filterDef of this.filterDefs) {
301
- this.inlineFilterDef[filterDef.sdMaterialFilterDef] = (_q = this.inlineFilterDef[filterDef.sdMaterialFilterDef]) !== null && _q !== void 0 ? _q : filterDef === null || filterDef === void 0 ? void 0 : filterDef.defaultShowing;
302
- }
303
- });
304
- _clearFilter.set(this, () => {
305
- this.columnFilter = {};
306
- this.externalFilter = {};
307
- this.filterDef = {};
308
- for (const externalFilter of this.externalFilters) {
309
- if (externalFilter.type === 'daterange') {
310
- this.externalFilter[externalFilter.field] = {
311
- from: undefined,
312
- to: undefined
313
- };
314
- }
315
- }
316
- });
317
- this.onFilter = (item) => {
318
- this.filterChange.emit();
319
- };
320
- this.open = () => {
321
- this.popupFilter.open({
322
- columnFilter: this.columnFilter,
323
- externalFilter: this.externalFilter,
324
- filterDef: this.filterDef,
325
- inlineColumn: this.inlineColumn,
326
- inlineExternal: this.inlineExternal,
327
- inlineFilterDef: this.inlineFilterDef
328
- });
329
- };
330
- this.onChangeFilter = (args) => {
331
- var _a;
332
- const { inlineColumn, columnFilter, inlineExternal, externalFilter, inlineFilterDef, filterDef } = args;
333
- this.inlineColumn = inlineColumn;
334
- this.columnFilter = columnFilter;
335
- this.inlineExternal = inlineExternal;
336
- this.externalFilter = externalFilter;
337
- this.inlineFilterDef = inlineFilterDef;
338
- this.filterDef = filterDef;
339
- this.gridFilterService.set((_a = this.filter) === null || _a === void 0 ? void 0 : _a.key, {
340
- inlineColumn,
341
- inlineExternal,
342
- quickFilters: [],
343
- inlineFilterDef,
344
- selectedQuickFilter: null
345
- });
346
- this.filterChange.emit();
347
- };
348
- this.onReset = () => {
349
- var _a;
350
- this.inlineColumn = {};
351
- this.columnFilter = {};
352
- this.inlineExternal = {};
353
- this.externalFilter = {};
354
- this.inlineFilterDef = {};
355
- this.filterDef = {};
356
- __classPrivateFieldGet(this, _loadDefault).call(this);
357
- this.gridFilterService.set((_a = this.filter) === null || _a === void 0 ? void 0 : _a.key, {
358
- inlineColumn: this.inlineColumn,
359
- inlineExternal: this.columnFilter,
360
- inlineFilterDef: this.inlineFilterDef,
361
- quickFilters: [],
362
- selectedQuickFilter: null
363
- });
364
- this.filterChange.emit();
365
- this.ref.markForCheck();
366
- };
367
- this.onClearFilter = () => {
368
- var _a;
369
- __classPrivateFieldGet(this, _clearFilter).call(this);
370
- this.gridFilterService.set((_a = this.filter) === null || _a === void 0 ? void 0 : _a.key, {
371
- inlineColumn: this.inlineColumn,
372
- inlineExternal: this.columnFilter,
373
- inlineFilterDef: this.inlineFilterDef,
374
- quickFilters: [],
375
- selectedQuickFilter: null
376
- });
377
- this.filterChange.emit();
378
- };
379
- this.setFilter = (args) => {
380
- var _a, _b, _c, _d;
381
- const { columnFilter, externalFilter, filterDef } = args;
382
- if (columnFilter) {
383
- this.columnFilter = columnFilter;
384
- }
385
- if (externalFilter) {
386
- this.externalFilter = externalFilter;
387
- }
388
- if (filterDef) {
389
- this.filterDef = filterDef;
390
- }
391
- for (const externalFilter of this.externalFilters) {
392
- if (externalFilter.type === 'daterange') {
393
- this.externalFilter[externalFilter.field] = {
394
- from: (_b = (_a = this.externalFilter[externalFilter.field]) === null || _a === void 0 ? void 0 : _a.from) !== null && _b !== void 0 ? _b : undefined,
395
- to: (_d = (_c = this.externalFilter[externalFilter.field]) === null || _c === void 0 ? void 0 : _c.to) !== null && _d !== void 0 ? _d : undefined
396
- };
397
- }
398
- }
399
- this.ref.markForCheck();
400
- };
401
- this.isMobileOrTablet = !this.deviceService.isDesktop();
402
- this.ref.markForCheck();
403
- }
404
- set _filter(filter) {
405
- var _a;
406
- this.filter = filter;
407
- this.isVisible = !((_a = this.filter) === null || _a === void 0 ? void 0 : _a.disabled);
408
- __classPrivateFieldGet(this, _filterOptionChanges).next(this.filter);
409
- }
410
- ngAfterViewInit() {
411
- __classPrivateFieldGet(this, _subscription).add(__classPrivateFieldGet(this, _filterOptionChanges).pipe(startWith(this.filter)).subscribe(() => {
412
- var _a, _b;
413
- if (!this.isVisible) {
414
- this.filterChange.emit();
415
- return;
416
- }
417
- this.externalFilters = ((_a = this.filter) === null || _a === void 0 ? void 0 : _a.externalFilters) || [];
418
- this.gridFilterService.get((_b = this.filter) === null || _b === void 0 ? void 0 : _b.key).then(configuration => {
419
- this.inlineColumn = configuration.inlineColumn;
420
- this.inlineExternal = configuration.inlineExternal;
421
- this.inlineFilterDef = configuration.inlineFilterDef;
422
- __classPrivateFieldGet(this, _loadDefault).call(this);
423
- this.filterChange.emit();
424
- });
425
- this.ref.markForCheck();
426
- }));
427
- }
428
- ngOnDestroy() {
429
- __classPrivateFieldGet(this, _subscription).unsubscribe();
430
- }
431
- }
432
- _filterOptionChanges = new WeakMap(), _subscription = new WeakMap(), _loadDefault = new WeakMap(), _clearFilter = new WeakMap();
433
- SdGridFilter.decorators = [
434
- { type: Component, args: [{
435
- selector: 'sd-grid-filter',
436
- template: "<ng-container *ngIf=\"isVisible\">\r\n <div *ngIf=\"!isMobileOrTablet && ((columns?.length && !filter?.inlineColumn) || externalFilters?.length || filterDefs?.length)\"\r\n class=\"row mx-0 pb-10\">\r\n <ng-container *ngIf=\"filter?.sorts?.length\">\r\n <ng-container *ngFor=\"let field of filter?.sorts\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn:field\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal:field\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef] && item.sdMaterialFilterDef === field\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!filter?.sorts?.length\">\r\n <ng-container *ngIf=\"columns?.length && !filter?.inlineColumn\">\r\n <ng-container *ngFor=\"let item of columns | sdFilterColumn\">\r\n <ng-container *ngTemplateOutlet=\"filterColumn; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <ng-container *ngTemplateOutlet=\"filterExternal; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of filterDefs\">\r\n <div *ngIf=\"inlineFilterDef[item.sdMaterialFilterDef]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <ng-container *ngTemplateOutlet=\"item.templateRef;context:{filterDef:filterDef, isInline: true}\">\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-template #filterColumn let-item=\"item\">\r\n <div *ngIf=\"inlineColumn[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"columnFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-select *ngIf=\"item.type === 'values' && item?.option?.selection !== 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\"\r\n [displayField]=\"item.option.displayField\" [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\"\r\n [disabled]=\"item.filter?.disabled\"\r\n [multiple]=\"item?.option?.selection === 'MULTIPLE' || item?.item?.selection === 'MULTIPLEAUTOCOMPLETE'\"\r\n [filtered]=\"item?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" appearance=\"outline\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.type === 'values' && item?.option?.selection === 'AUTOCOMPLETE'\"\r\n [items]=\"item.option?.items\" [valueField]=\"item.option?.valueField\"\r\n [displayField]=\"item.option?.displayField\" [(model)]=\"columnFilter[item.field]\" (sdChange)=\"onFilter(item)\"\r\n [disabled]=\"item.filter?.disabled\" appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"item.type === 'date' || item.type === 'datetime' || item.type === 'time'\"\r\n [label]=\"item.title\" [(model)]=\"columnFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-date-time>\r\n </div>\r\n </ng-template>\r\n <ng-template #filterExternal let-item=\"item\">\r\n <div *ngIf=\"inlineExternal[item.field]\" class=\"col-lg-2 col-md-3 col-sm-6 px-8\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.option?.displayOnTrue || 'True' },\r\n {value:'0',display:item.option?.displayOnFalse || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values' && item.option\">\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" [selectAll]=\"item.option.selectAll\" appearance=\"outline\" multiple>\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\"\r\n [items]=\"item.option.items\" [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" filtered=\"true\" appearance=\"outline\" multiple>\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.option?.selection\" [label]=\"item.title\" [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\" [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date' || item.type ==='datetime'\"\r\n [(model)]=\"externalFilter[item.field]\" [type]=\"item.type\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\" (sdChange)=\"onFilter(item)\" appearance=\"outline\">\r\n </sd-date-range>\r\n </div>\r\n </ng-template>\r\n <sd-popup-filter [columns]=\"columns\" [externalFilters]=\"externalFilters\" (changeFilter)=\"onChangeFilter($event)\"\r\n (clearFilter)=\"onReset()\" [filterDefs]=\"filterDefs\">\r\n </sd-popup-filter>\r\n</ng-container>",
437
- changeDetection: ChangeDetectionStrategy.OnPush,
438
- styles: [":host{display:block;padding-left:0;padding-right:0}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}"]
439
- },] }
440
- ];
441
- SdGridFilter.ctorParameters = () => [
442
- { type: ChangeDetectorRef },
443
- { type: DeviceDetectorService },
444
- { type: SdGridFilterService }
445
- ];
446
- SdGridFilter.propDecorators = {
447
- popupFilter: [{ type: ViewChild, args: [SdPopupFilter,] }],
448
- _filter: [{ type: Input, args: ['filter',] }],
449
- columns: [{ type: Input }],
450
- filterDefs: [{ type: Input }],
451
- filterChange: [{ type: Output }]
452
- };
453
-
454
- var _getExportableColumns, _getExportableGroups, _getExportColumns, _initTemplate;
455
- class SdPopupExport {
456
- constructor(ref, loadingService, exportService, notifyService, translateService) {
457
- this.ref = ref;
458
- this.loadingService = loadingService;
459
- this.exportService = exportService;
460
- this.notifyService = notifyService;
461
- this.translateService = translateService;
462
- this.columns = [];
463
- this.groups = [];
464
- this.enableCreating = false;
465
- this.selected = {};
466
- this.files = [];
467
- this.export = new EventEmitter();
468
- this.form = new FormGroup({});
469
- _getExportableColumns.set(this, () => {
470
- return [...this.gridColumns, ...this.additionalColumns];
471
- });
472
- _getExportableGroups.set(this, () => {
473
- var _a, _b, _c;
474
- return ((_c = (_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.export) === null || _b === void 0 ? void 0 : _b.groups) === null || _c === void 0 ? void 0 : _c.filter(e => {
475
- const permission = e.permission;
476
- if (typeof (permission) === 'function') {
477
- return permission();
478
- }
479
- return permission;
480
- })) || [];
481
- });
482
- this.open = () => __awaiter(this, void 0, void 0, function* () {
483
- var _a, _b;
484
- if (!this.key) {
485
- this.exportDefault();
486
- return;
487
- }
488
- if (this.groups.length === 1 && ((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.export) === null || _b === void 0 ? void 0 : _b.hideMyTemplates)) {
489
- this.loadFiles(this.groups[0].code);
490
- }
491
- else {
492
- this.loadFiles(null);
493
- }
494
- this.selected = {};
495
- this.modal.open();
496
- this.ref.detectChanges();
497
- });
498
- _getExportColumns.set(this, () => {
499
- if (this.configuration) {
500
- const columns = [...this.gridColumns];
501
- const { firstColumns, secondColumns } = this.configuration;
502
- const displayColumns = [...firstColumns, ...secondColumns].reduce((first, next) => {
503
- const column = this.gridOption.columns.find(e => e.field === next.field);
504
- if (!column) {
505
- return first;
506
- }
507
- if (column.type !== 'children' && column.type !== 'children-col') {
508
- return [...first, column];
509
- }
510
- const children = column.children.filter(e1 => e1.type !== 'image');
511
- return [...first, ...children];
512
- }, []);
513
- const results = displayColumns.map(e => (Object.assign(Object.assign({}, e), { data: columns.find(e1 => e1.field === e.field) }))).filter(e => !!e.data)
514
- .map(e => e.data);
515
- return [...results, ...this.additionalColumns];
516
- }
517
- else {
518
- return this.columns;
519
- }
520
- });
521
- this.exportDefault = () => {
522
- this.export.emit({
523
- file: null,
524
- columns: __classPrivateFieldGet(this, _getExportColumns).call(this),
525
- isCSV: false
526
- });
527
- };
528
- this.exportCSV = () => {
529
- this.export.emit({
530
- file: null,
531
- columns: __classPrivateFieldGet(this, _getExportColumns).call(this),
532
- isCSV: true
533
- });
534
- };
535
- this.exportRaw = () => {
536
- this.export.emit({
537
- file: null,
538
- columns: __classPrivateFieldGet(this, _getExportColumns).call(this),
539
- isRaw: true
540
- });
541
- };
542
- this.loadFiles = (group = null) => __awaiter(this, void 0, void 0, function* () {
543
- this.selectedGroup = this.groups.find(e => e.code === group);
544
- this.files = yield this.exportService.filesInFolder({
545
- key: this.key,
546
- group
547
- });
548
- this.ref.markForCheck();
549
- });
550
- _initTemplate.set(this, (fileName) => __awaiter(this, void 0, void 0, function* () {
551
- var _c, _d, _e, _f;
552
- const sheets = [];
553
- if (Array.isArray((_d = (_c = this.gridOption) === null || _c === void 0 ? void 0 : _c.export) === null || _d === void 0 ? void 0 : _d.sheets)) {
554
- for (const sheet of this.gridOption.export.sheets) {
555
- if (sheet.name && sheet.items && sheet.fields) {
556
- if (Array.isArray(sheet.items)) {
557
- sheets.push({
558
- name: sheet.name,
559
- items: sheet.items,
560
- fields: sheet.fields
561
- });
562
- }
563
- else {
564
- sheets.push({
565
- name: sheet.name,
566
- items: yield sheet.items(),
567
- fields: sheet.fields
568
- });
569
- }
570
- }
571
- }
572
- }
573
- return yield this.exportService.generateTemplate({
574
- fileName: fileName || ((_f = (_e = this.gridOption) === null || _e === void 0 ? void 0 : _e.export) === null || _f === void 0 ? void 0 : _f.fileName),
575
- columns: this.columns,
576
- sheets
577
- });
578
- }));
579
- this.generateTemplate = () => __awaiter(this, void 0, void 0, function* () {
580
- this.loadingService.start();
581
- yield __classPrivateFieldGet(this, _initTemplate).call(this).finally(this.loadingService.stop);
582
- });
583
- this.generateAndUploadTemplate = (fileName) => __awaiter(this, void 0, void 0, function* () {
584
- var _g, _h, _j, _k, _l, _m, _o;
585
- const sheets = [];
586
- if (Array.isArray((_h = (_g = this.gridOption) === null || _g === void 0 ? void 0 : _g.export) === null || _h === void 0 ? void 0 : _h.sheets)) {
587
- for (const sheet of (_k = (_j = this.gridOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.sheets) {
588
- if (sheet.name && sheet.items && sheet.fields) {
589
- if (Array.isArray(sheet.items)) {
590
- sheets.push({
591
- name: sheet.name,
592
- items: sheet.items,
593
- fields: sheet.fields
594
- });
595
- }
596
- else {
597
- sheets.push({
598
- name: sheet.name,
599
- items: yield sheet.items(),
600
- fields: sheet.fields
601
- });
602
- }
603
- }
604
- }
605
- }
606
- return yield this.exportService.generateUploadTemplate({
607
- key: this.key,
608
- template: {
609
- fileName: fileName || ((_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.fileName),
610
- columns: this.columns.filter(e => this.selected[e.field]),
611
- sheets
612
- },
613
- group: (_o = this.selectedGroup) === null || _o === void 0 ? void 0 : _o.code
614
- });
615
- });
616
- this.onExport = (file) => {
617
- this.export.emit({
618
- file,
619
- columns: this.columns
620
- });
621
- this.ref.detectChanges();
622
- };
623
- this.uploadTemplate = () => __awaiter(this, void 0, void 0, function* () {
624
- var _p, _q, _r;
625
- const file = yield this.exportService.uploadTemplate({
626
- key: this.key,
627
- group: (_p = this.selectedGroup) === null || _p === void 0 ? void 0 : _p.code,
628
- validator: (_r = (_q = this.gridOption) === null || _q === void 0 ? void 0 : _q.export) === null || _r === void 0 ? void 0 : _r.validators
629
- });
630
- if (file) {
631
- this.files = [...this.files, file];
632
- this.ref.detectChanges();
633
- }
634
- });
635
- this.removeFile = (file) => {
636
- this.notifyService.confirm(this.translateService.translate('Remove template')).then(() => {
637
- var _a;
638
- this.exportService.removeFile({
639
- key: this.key,
640
- fileName: file.fileName,
641
- group: ((_a = this.selectedGroup) === null || _a === void 0 ? void 0 : _a.code) || null
642
- });
643
- const idx = this.files.indexOf(file);
644
- this.files.splice(idx, 1);
645
- this.files = [...this.files];
646
- this.ref.detectChanges();
647
- });
648
- };
649
- this.createTemplate = () => __awaiter(this, void 0, void 0, function* () {
650
- var _s, _t, _u, _v, _w;
651
- const { translate } = this.translateService;
652
- if (this.form.invalid) {
653
- this.form.markAllAsTouched();
654
- return;
655
- }
656
- if (!this.columns.some(e => this.selected[e.field])) {
657
- this.notifyService.notify.warning(translate('Please select columns'));
658
- return;
659
- }
660
- this.loadingService.start();
661
- const fileName = this.templateName + '.xlsx';
662
- try {
663
- if ((_u = (_t = (_s = this.gridOption) === null || _s === void 0 ? void 0 : _s.export) === null || _t === void 0 ? void 0 : _t.validators) === null || _u === void 0 ? void 0 : _u.call(_t, fileName)) {
664
- this.notifyService.notify.warning((_w = (_v = this.gridOption) === null || _v === void 0 ? void 0 : _v.export) === null || _w === void 0 ? void 0 : _w.validators(fileName));
665
- return;
666
- }
667
- const result = yield this.generateAndUploadTemplate(fileName);
668
- if (result === null || result === void 0 ? void 0 : result.filePath) {
669
- const file = {
670
- filePath: result.filePath,
671
- fileName: result.fileName
672
- };
673
- this.onExport(file);
674
- this.templateName = null;
675
- this.enableCreating = false;
676
- this.files = [...this.files, file];
677
- this.ref.detectChanges();
678
- }
679
- }
680
- finally {
681
- this.loadingService.stop();
682
- }
683
- });
684
- this.onChangeGroup = () => {
685
- var _a, _b, _c;
686
- this.loadFiles((_c = (_b = (_a = this.listGroups) === null || _a === void 0 ? void 0 : _a.selectedOptions) === null || _b === void 0 ? void 0 : _b.selected[0]) === null || _c === void 0 ? void 0 : _c.value);
687
- };
688
- this.validatorTemplateName = (val) => {
689
- const { translate } = this.translateService;
690
- const regex = /^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$/;
691
- if (!val) {
692
- return translate('Please enter your template name');
693
- }
694
- if (val.length > 50) {
695
- return translate('Template name is too long');
696
- }
697
- if (!regex.test(val)) {
698
- return translate('Template name only contains letters, numbers and spaces');
699
- }
700
- return null;
701
- };
702
- }
703
- set _gridOption(option) {
704
- this.gridOption = option;
705
- this.columns = __classPrivateFieldGet(this, _getExportableColumns).call(this);
706
- this.groups = __classPrivateFieldGet(this, _getExportableGroups).call(this);
707
- }
708
- get key() {
709
- var _a, _b, _c, _d;
710
- const prefix = '93889e78-f971-4a1d-8c73-fe2321af9233';
711
- if (!((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.export) === null || _b === void 0 ? void 0 : _b.key)) {
712
- return null;
713
- }
714
- return hash({
715
- prefix,
716
- key: (_d = (_c = this.gridOption) === null || _c === void 0 ? void 0 : _c.export) === null || _d === void 0 ? void 0 : _d.key
717
- });
718
- }
719
- get gridColumns() {
720
- const columns = [];
721
- this.gridOption.columns.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(column => {
722
- var _a, _b;
723
- if (column.type === 'image') {
724
- return;
725
- }
726
- if (column.type === 'children') {
727
- (_a = column.children) === null || _a === void 0 ? void 0 : _a.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(childColumn => {
728
- if (childColumn.type === 'image') {
729
- return;
730
- }
731
- columns.push(childColumn);
732
- });
733
- return;
734
- }
735
- if (column.type === 'children-col') {
736
- (_b = column.children) === null || _b === void 0 ? void 0 : _b.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(childColumn => {
737
- if (childColumn.type === 'image') {
738
- return;
739
- }
740
- columns.push(childColumn);
741
- });
742
- return;
743
- }
744
- columns.push(column);
745
- });
746
- return columns.map(e => ({
747
- field: e.field,
748
- title: e.title,
749
- description: e.description,
750
- width: e.width
751
- }));
752
- }
753
- get additionalColumns() {
754
- var _a, _b;
755
- return (((_b = (_a = this.gridOption.export) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })) || []).map(e => ({
756
- field: e.field,
757
- title: e.title,
758
- description: e.description,
759
- width: e.width
760
- }));
761
- }
762
- ngOnInit() {
763
- }
764
- ngAfterViewInit() {
765
- }
766
- }
767
- _getExportableColumns = new WeakMap(), _getExportableGroups = new WeakMap(), _getExportColumns = new WeakMap(), _initTemplate = new WeakMap();
768
- SdPopupExport.decorators = [
769
- { type: Component, args: [{
770
- selector: 'sd-popup-export',
771
- template: "<sd-modal width=\"907px\" [title]=\"'Exported template' | sdTranslate\" #modal>\r\n <sd-modal-body>\r\n <div class=\"row\">\r\n <ng-container\r\n *ngIf=\"groups?.length > 1 || (groups?.length === 1 && !gridOption?.export?.hideMyTemplates); else noSelection\">\r\n <div class=\"col-9\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n <div class=\"col-3\">\r\n <mat-selection-list [multiple]=\"false\" #listGroups>\r\n <mat-list-option *ngIf=\"!gridOption?.export?.hideMyTemplates\" [value]=\"\" (click)=\"loadFiles()\">\r\n <div mat-line>{{'My templates' | sdTranslate}}</div>\r\n </mat-list-option>\r\n <mat-list-option [value]=\"group.code\" *ngFor=\"let group of groups\" (click)=\"loadFiles(group.code)\">\r\n <div mat-line>{{group.title}}</div>\r\n </mat-list-option>\r\n </mat-selection-list>\r\n </div>\r\n </ng-container>\r\n <ng-template #noSelection>\r\n <div class=\"col-12\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n </ng-template>\r\n <ng-template #content>\r\n <div class=\"row\">\r\n <div *ngIf=\"!files?.length\" class=\"col-12\">\r\n <div class=\"c-empty\">\r\n <img class=\"c-empty-image\">\r\n <div class=\"T14R\">{{'There are no exported templates' | sdTranslate}}</div>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"files?.length\">\r\n <div class=\"col-12\">\r\n <div class=\"c-table\" style=\"max-height:50vh\">\r\n <table mat-table [dataSource]=\"files\">\r\n <ng-container matColumnDef=\"stt\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:50px\">#\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item; let idx = index\">\r\n {{idx + 1}}\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"fileName\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef>{{'File name' | sdTranslate}}\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n {{item.fileName}}\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"action\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef style=\"width:80px\">\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n <div class=\"d-flex\">\r\n <button *ngIf=\"!selectedGroup || selectedGroup?.permission === 'delete'\" mat-icon-button\r\n aria-label=\"delete\" (click)=\"removeFile(item)\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n <button mat-icon-button aria-label=\"download\" (click)=\"onExport(item)\">\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\"['stt', 'fileName', 'action']; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['stt', 'fileName', 'action'];\"></tr>\r\n </table>\r\n </div>\r\n </div>\r\n <div *ngIf=\"files.length < 5 && (!selectedGroup || selectedGroup?.permission === 'add' || selectedGroup?.permission === 'delete')\"\r\n class=\"col-12 mt-10\">\r\n <sd-button class=\"mr-5\" [title]=\"'New template' | sdTranslate\" (action)=\"enableCreating = true\"\r\n color=\"info\" [disabled]=\"enableCreating\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption?.export?.enableUpload\" [title]=\"'Upload template' | sdTranslate\"\r\n (action)=\"uploadTemplate()\" type=\"outline\">\r\n </sd-button>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"(enableCreating || !files?.length) && (!selectedGroup || selectedGroup?.permission === 'add' || selectedGroup?.permission === 'delete')\">\r\n <div class=\"col-12 mt-20\">\r\n <div class=\"T14R\">{{'Select columns for creating template' | sdTranslate}}:</div>\r\n </div>\r\n <div class=\"col-12\">\r\n <mat-chip-list selectable=\"true\" multiple=\"true\">\r\n <ng-container *ngFor=\"let column of columns\">\r\n <mat-chip [selected]=\"selected[column.field]\"\r\n (click)=\"selected[column.field] = !selected[column.field]\">\r\n {{column.title}}\r\n </mat-chip>\r\n </ng-container>\r\n </mat-chip-list>\r\n </div>\r\n <div class=\"col-12 row\">\r\n <div class=\"col-10\">\r\n <sd-input [form]=\"form\" [label]=\"'Template name' | sdTranslate\" [(model)]=\"templateName\"\r\n [validator]=\"validatorTemplateName\"></sd-input>\r\n </div>\r\n <div class=\"col-2 mt-7\">\r\n <sd-button width=\"100%\" [title]=\"'Save' | sdTranslate\" color=\"info\" (action)=\"createTemplate()\">\r\n </sd-button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </sd-modal-body>\r\n</sd-modal>",
772
- changeDetection: ChangeDetectionStrategy.OnPush,
773
- styles: [".c-radio-group{display:flex;flex-direction:column;margin:15px 0}.c-radio-button{margin:5px}.c-empty{align-items:center;background:#f6f6f6;border-radius:4px;display:flex;flex-direction:column;height:116px;justify-content:center;position:static}.c-empty .c-empty-image{content:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA6CAYAAAAHkoFsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABCiSURBVHgB7VtLj2VVFV5rn0tXJ902ktjppgEJ0iRAGgUsiQk/wJGPhBgxxJg4ZqYDRjqXmSMTTRyYGGYOYODE+AiI4RFaIDSgNII8BIzBQDdQdc/eru/71j637IKuOt0VGegJ1H2cffbda+31+Na3dpv9D18+Z/BzL/ztgeJezVrlw+6ju7XW8J21Ev/74GNreF+ae6utlFpiiHsZMRLj4k8tHvcLn6uYI2aL9xXjqtX4HA+55q14P8Rv4YePHL7sB7ZHV5k1urVSaxtClKFhyRYSNPOQqcQfzOUhSugHklSv8eq1hjSx8rEOLcfEg6XGBFAN1sA5+B7ThK4KNyVkj9fCNeZvzFzvngoP4WgrDYvighqFxTZCiFbGWHwbsVESqPK1lgKVSIgh9FZiOBRQugI0c0tB43PlZ/d8vmqtsyx1p2sxZ3CV9p37CxXQnOObkBsbWmH1xt2yOjbIi+3HomND427RW6v42nkDCqBjwNLhH6HPQv+pUFAMbXARTApr2tOdnyW8aefhudxFp7O6XDoExcqrVDMaNELDraM83cpQESwaNtPo5iWUJl+GKcQOx/8GN+dGw/fxeaB6EGagoT28ZmkSPie/azTxlr6o19ji2GvohP6JjY3Fj3ABbiq3daDS4vka30FYrzLnUBGMJuag2dM9sPvQUxgNrKqEWe2p2c8Sfuw+Df+GAuCvGayoBAaxSj+t8dpk2V6pkDpIga7flE+UDJaDy6ocOoxnOabRZaDHSkVWxYePR/jC5TnN03KxtgpEIQOc06kU7DwUYHSPVIBTKORCOLAr8EthfL5qp+M/KcD73IXPtmofn89nqsrYBi/gZ4bkBveGsTZleVf+dqXAijAHJw/rQS432QNiABwizCJdpUIBYfs1LWTU9wwEggJ7eM3SZO15GoENPtlo/hBZPmraTZ/SYCtENyMDuLcRO+9KX9BgSxwAK2lKldzlWrs7wVUKf0dZ4+NLdZYBzpiQw3rh1Q05nvmvNQXDZkJ0RjeA7RcMcw0IU5aVM9lVWAQxY9FfGk7MVQb4PIBCGldBuPHy6t//+U0bI5kMgfowehzasC/ySHxVLsFr7ELce9vG315z2WVv753wkJWmzhjN5Cw7Z9av2lG8tUHhypnFYgeZ+Og4sf3IgM3p7EiN0AJArf6LXF7g8sQJSvNIngOgBTa/1i8KW0SCGDHY2rhc1sEXdbm5iYfquLT6yYWdjJXsnfAnbrjm9o+6d+rUi1+Kff0uBG7KxonYGoVrehmRtgaaiQXSa2NxVQCNtUBtiWAz3zvDQ5q9AR0ZjQQ6M6ZFwYJwrbaEvTTrGGIX11yzP+9MLr81bbFkQPBHmuPeKlUQAQ0DANvkAo0WAMkR81AWuaocai1HxLeR6xn1VAtI1tAJiyT4T1yqBj74wHeMD3uWOkbspqv4YLbi3C1jBHe+EMgA9FIjLA9dGUFZP9MEdr3AdbdiBSbaQtDU06B3HCDADaeIaYZMw2s7r5k7/+ifnr9jKHas5X5RpQXRB3Vc/K0joSj8C86r71W2ItIUjBn9OBbBHI6QlTYsw6XDwk0htECq2+99sfhj24y3i/Kt2LHDwv0AzBjIsFmqfIJRsbE8gOw95aJm0HjgAMKAZYxZxI3Y+l0JH0PviJ+9DUiiCWHTbyu3I0EoLJkbUSs3DWuB7rU+eaSxXqnafcQ9onMnOHGG7FGI3n9x/Nor7tuyjkdffOn178fENwApsRqkAvhf7HNTUQhRWSF2nTR9QA5GRoEXML/A9PbvJHtGFxN0JH7OnGsTblfJyZRGM1bezRInc7PL+1jPZzmjWrynRiE4Exw+eHC4/9yFbLy//BWiP/ACY0cFlHYWC6I7BIUrEWRVOazwD+MqQp1V6HOXMJiDaiPoSojKEFJyAgkkNMfXSSkt8f2U+5172zokxULHRgJD5EWCnmZnjx49embbQvYvzoypKMQOhf3qElKECHF+romvtAzGhMKCqKr2xRo2fJdm/4Wbr7/zw24+/uRzP4+XdbmoiJUqLTBvmTSHH2PC0VMZ5wV7K7muFUQFkj10nvUwwEFiU+mL6E7YI0KjCGOTPfAqXsW6myjNoK4IlaztIuLtkOpo5hmdhc6xtCw89F4hjfVqU2nGIM7B2nU5g1xli5L+84qAe6BWoZia2YLQP+gvHxD8iYURiSsTuog/mBPrBlQD/Mx44GVj3LjYVMfbg2I7zTEBCbF5WZWySFFczfR58nU9W7zHivjuqdOnj5z7S3X0g5ZulySPu3d+IPg/YyxiLcD3I0KiqkE+z7K4V4O7Y3zOu/MBx34dOPVVMUgByYahMhu3JcGLq7r7chMMk2lzh13oQ0rBnhC+qQD4cIWP4xKIBgLTymhPoL4Y44HwQ1jWC8Iywr5GkNfEmvK3m4kls7WLNPvbbr7+Z7bDdfLpP38VLpkpZqBCalJ6hPp671vK4QN2YNs8IcKRpMSg3crYJkUxpIDjCBRfwgfAi4ESQ5ir4PVKYmH+Qk2mdxd5fg8Qnq8Y1/yiqTpzxQxXJphcoJXNzTNHz52lKnoTzeIZlcONmJjIMZFgY5wrSYsrtYrybtAKMwvl2gXCu3jhnWGu1+ODan4WsBTUJrzgSqOx2E3fjrtDqoNSFOBqh68r/6+ir8UbgNCFKZDhxe+OA+MBUmOmQd/YGdsv/vDY0/fHsKtcPHRVR0bbkGlbqE2lEv28JWifIKx4nJqkvq/YXWYmRm68xsAxarrim+3y+O7k1oXEHh9so6XiVAor6QFMZoLn91n1YUlJ65Y2+RYCBuolkoI7Ch+ruzqevKqJYBO8laMKhUfZ2Yi5CaWIevN+5fuqGOwENy4YwNRHNm6UBVgnbrBLiYPOMaBkaPkuKbLUYFM9LCuoYjcR/xDaWlNJS+RLnkThx5CkdhReCEwkBcGMfoZKSG6CqdSFL1pidu6tLN6yAccFqvuWnkiUqCissqwogFfb/MS5C4l21uUmEzcyQ6KHxI2QBof+AzIOnJx231haBQzO4sZVBWA/2rLsnOcj2pcHYqGHsgYXiaQqBZ5Fc2aGZpFlX7dONIq3ZLGuDcoGjGeN2RIMc1uFUJCbaSXDsE141SQZqQkjgOqiBHYVS5a1vXBAIw9QiuU6eEfFkGjvmG7fTrLb4vbbTtxju7weeeLUNxKlJd6nZFRR5y9SMUo6GpP5vxbhAlrD9skVQFwZrhVtv2pHcj/UkIhBlQrNROwwR0hgkmAqh31jVzs/42IxTm7WBKwoLxk6RSBx71tr+aaWnhAvZWSf79h24e1yuEkwB9huo9sRtNAmGYCtyCssLW2UGRDzTqoRDbQrjntWqmuryk8VXa8AFR3RVioKGFwAU4WnwpLe7qnvim1z13aI3UimjTZVjknJ4b1gNudadYY8sUDOOzBFRGj4sHR67jWvaYFNqdNhAsQHILrRlMeFwtMpO0RNX9YDMgJY5fpTz7x45003XnPfgw8++4lLP7X2nZD+UFOl1oVF7TJ2qtyI3RIoSeqsElV9gQNk5TSORJn7bPj86dMvH14sIqYPi3h+E+LS+t56ffnE+voVZ3eRDVfXw48/8yYZSBL2wleyUJKNLTGCgqQoCAhDfKNqT2mU6QuLLcO/FDD9oEpeYQcJRrWNptzZdF/PMQiqN9DH1twJzp8ltubSWhq6QPLbAu3ce+WVh5+ftfPMbuzHtSxNyTB7hmntBCkNyyRoQ0sqjDFA5JYWKNR2qYIg7cV6m1suLYvKcjixj2hsdsfUKMweHwBRtr+b+ELSf+L8yTq2mmxA6GBjY+Smz2xXRe+AdJKL3sruaptaTQxrGROMWASfGQOyHFZDw89sbtj3Pnvjteub7218zW34yRZKLPF9L4lZJbpgbOvtsdLHk8z0zjoJGtYV1+H9iIwSr2Dc2prS4IXw9lidNlboTTuWJ4kUryxrfiYAQmYOK9r30MK96zdf9xtMduut178WLz998tQL6zHvLdluyCRBMxtJJzeb4HTr7LC4MyFLKaTyOEgDgbv2ww/2LV/aXw9wynf55x1O/o93Ns7OF55mbIC7QbwgGKmfLOrIhQOT3LLOffEgQuJCpiOva4vxsW0aNXsg/tyqeCkd51EMlmyijUnSjr1uVyJI2iz5gsq1lGCuz7533aevfut84syv6trq0JAnm5tdSgKQ1qaSdlXVCaeL7Y3Fvbe8ZHuqMzsk8kNjV6xwm5hhmhGrutZPb6ha3DJe5wPCzPftAuHZjItaVTBr7DWJtMnslqQqF0SezbrAxoajD3qWTNDdMfjbfd5nn3352Pvjxl1qy7RsSfI8nwm7svE5kaJlRZnBFB4KP363yapiKDqcUdVVO7OTPLNS3UOPPHkmC5XVAcJeAdLsVAxNZS8/l57ueuqr2a1+Jeb4ZXwO7s6/EvcP9BppSmtEjyhcfUqDlu1x08A6LvbfddNnjrxhF3DNPIqm4tEY9FzkqXIubrvQ15SYkn3uZaqAUPbVoKirIvvc7dmSYDoUkNEeKp8zixoPPqA8ZkIDjixZWbqfnYdVLlj4rNOKyljV6TRjVsS8WbNXHynRxuz+qANWehZQ4ZOEY2+KmKCwdGwKdROaEx+g0po/Amhbyjjxgv8N4bPaShJWS9bBLBZUJfnmmpmQqYcmnvW4MoJqfMSPPHZpyR2YpfX0EO4EOCqhPeHxxA6nhYUE95x67q/o2SEOTa6ByQa1xVmBiOgY2QxCxh2GxTsXcAhRHRpXAKviywVlmYoyBzMgdfJWPt97dWQgkzBJgpNrhdmjTzcqbppMW2rPAichtXgVnVFzuwXfLRWNx3ym6fgeTURssDNtVHFMESvq8o3ZB5JUybXs8WUPPg8NaXfYRBy2NC4S7ZlITu9HCnqzg4C4HyoW38fU2KZGaaa1KWXKwwRmeppzz9jAA495zndilvMV+LrqwCRMbT62Fz8HUmmQGRPDVnHuHKOgZRJKNE+b/DurPzUfkqdSuuQW9XYW6STP4BIvr8Wsr/qAI72eZ12kGZrAwDjCswTOiMiQRO2RjZJVWslCTAGlvjlPeB2uLy3VbHmKyjM6p2JIPIhl6s0KT2ImfXdCcbKAPHuraC7UUFdpHcPK/Z87ce2PbY+vuYcQk05KvxdVCdOrna7KbncR9d3HswK0pLLp8+w2KrwL7QdfF9oaOU6dX0v0XPPgzp5fcwNep5BobVXAg7Ekd6tMMVlMpmVWaKvEnGnCLOtYpbgkUFOBxMia01YNgb2+Zk36u4dPtu0zuFAb9zfRH4ELdZPkg6KvkCpeV0jQtvwzE5XrBAFj8tdVvL29Ek70ik+nllipM21ZnvLhOR4SfUoUPix/dOL48b+cT56LP4omn83jVMQB6fsANiXJTXUUrBMevSTN/n3juTpGdbIwaHjCBTxpz/j6yrh/DIQCMbPpdI6zR6HUVdnBUHBzxeODOy19VqrzZGC72NP3mQXykFDJlgboE36u6vErU/QssOXcDxWoNEgyZCJI4rlsgGbj0voZoTyZrfP7OceQVSZ1ttzcawJzatgkLN2iF5PatfuyXxmEmnRjVny975b4RznReBZDViLBrJOiSVpSK/zHFkxbaowk2LEt1T8tjuTRJbvw6Hlm77a1D6OFKwAKbabdmdJ9dl5cDKzUlv8mR2J0lKas0HRnalqo6dfzRcg75leyPxVMiZrZuWHATbbHl9ELtv9fH339G/7DwlISq4BTAAAAAElFTkSuQmCC\")}.c-table{overflow:auto;position:relative}.c-table table{width:100%}.c-table .c-th{color:#000;font-size:14px;font-weight:500;line-height:20px}"]
774
- },] }
775
- ];
776
- SdPopupExport.ctorParameters = () => [
777
- { type: ChangeDetectorRef },
778
- { type: SdLoadingService },
779
- { type: SdExportService },
780
- { type: SdNotifyService },
781
- { type: SdTranslateService }
782
- ];
783
- SdPopupExport.propDecorators = {
784
- modal: [{ type: ViewChild, args: ['modal',] }],
785
- listGroups: [{ type: ViewChild, args: ['listGroups',] }],
786
- export: [{ type: Output }],
787
- _gridOption: [{ type: Input, args: ['gridOption',] }],
788
- configuration: [{ type: Input }]
789
- };
790
-
791
- var _COLUMNS, _cache, _getKey, _default, _load, _get, _set, _remove;
792
- class SdGridConfigurationService {
793
- constructor(settingService, gridMaterialConfiguration) {
794
- this.settingService = settingService;
795
- this.gridMaterialConfiguration = gridMaterialConfiguration;
796
- _COLUMNS.set(this, {
797
- EDITORVALIDATION: 'sdEditorValidation',
798
- EDITOR: 'sdEditor',
799
- SUBINFORMATION: 'sdSubInformationAction',
800
- COMMAND: 'sdCommand',
801
- SELECTION: 'sdSelection',
802
- GROUP: 'sdGroup'
803
- });
804
- _cache.set(this, {});
805
- this.init = (key, gridOption) => {
806
- if (!__classPrivateFieldGet(this, _cache)[key]) {
807
- const subject = new Subject();
808
- __classPrivateFieldGet(this, _cache)[key] = {
809
- load: __classPrivateFieldGet(this, _load).call(this, gridOption, subject),
810
- get: __classPrivateFieldGet(this, _get).call(this, gridOption),
811
- set: (configuration) => {
812
- configuration = __classPrivateFieldGet(this, _set).call(this, gridOption, configuration);
813
- subject.next(Object.assign({}, configuration));
814
- return configuration;
815
- },
816
- remove: () => {
817
- __classPrivateFieldGet(this, _remove).call(this, gridOption)();
818
- subject.next(__classPrivateFieldGet(this, _default).call(this, gridOption));
819
- },
820
- observer: subject
821
- };
822
- }
823
- return __classPrivateFieldGet(this, _cache)[key];
824
- };
825
- _getKey.set(this, (gridOption) => {
826
- var _a, _b;
827
- const prefix = 'c9e94836-6ace-4aeb-b148-4f0be63589ee';
828
- if (!((_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _a === void 0 ? void 0 : _a.key) && !(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)) {
829
- return null;
830
- }
831
- return hash({
832
- prefix,
833
- key: ((_b = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _b === void 0 ? void 0 : _b.key) || !(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)
834
- });
835
- });
836
- _default.set(this, (gridOption) => {
837
- var _a;
838
- const columns = ((_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.columns) === null || _a === void 0 ? void 0 : _a.filter(e => !e.hidden).map(e => ({
839
- origin: {
840
- field: e.field,
841
- title: e.title,
842
- width: e.width,
843
- invisible: e.invisible
844
- },
845
- invisible: e.invisible,
846
- fixed: false
847
- }))) || [];
848
- return {
849
- columns
850
- };
851
- });
852
- _load.set(this, (gridOption, subject) => {
853
- return () => __awaiter(this, void 0, void 0, function* () {
854
- const get = __classPrivateFieldGet(this, _get).call(this, gridOption);
855
- const configuration = yield get();
856
- subject.next(Object.assign({}, configuration));
857
- });
858
- });
859
- _get.set(this, (gridOption) => {
860
- return () => __awaiter(this, void 0, void 0, function* () {
861
- const key = __classPrivateFieldGet(this, _getKey).call(this, gridOption);
862
- if (!key) {
863
- return __classPrivateFieldGet(this, _default).call(this, gridOption);
864
- }
865
- const { columns, config } = gridOption;
866
- let configuration;
867
- if ((config === null || config === void 0 ? void 0 : config.storage) === 'server') {
868
- const { get, remove } = this.settingService.createServer(key, {
869
- args: config === null || config === void 0 ? void 0 : config.args
870
- });
871
- configuration = yield get().catch(() => undefined);
872
- if (!(configuration === null || configuration === void 0 ? void 0 : configuration.columns)) {
873
- remove().catch(console.error);
874
- return __classPrivateFieldGet(this, _default).call(this, gridOption);
875
- }
876
- }
877
- else {
878
- const { get, remove } = this.settingService.create(key, {
879
- type: config === null || config === void 0 ? void 0 : config.storage,
880
- args: config === null || config === void 0 ? void 0 : config.args
881
- });
882
- configuration = get();
883
- if (!(configuration === null || configuration === void 0 ? void 0 : configuration.columns)) {
884
- remove();
885
- return __classPrivateFieldGet(this, _default).call(this, gridOption);
886
- }
887
- }
888
- configuration.columns = configuration.columns
889
- .filter(column => column.isGeneratedColumn || columns.some(e => !e.hidden && e.field === column.origin.field));
890
- // Thêm những column mới vào storage nếu có
891
- columns.forEach(column => {
892
- const col = configuration.columns.find(e => { var _a; return ((_a = e.origin) === null || _a === void 0 ? void 0 : _a.field) === column.field; });
893
- if (!col) {
894
- configuration.columns.push({
895
- origin: {
896
- field: column.field,
897
- title: column.title,
898
- width: column.width,
899
- invisible: column.invisible,
900
- },
901
- invisible: column.invisible,
902
- fixed: false
903
- });
904
- }
905
- else {
906
- col.origin = {
907
- field: column.field,
908
- title: column.title,
909
- width: column.width,
910
- invisible: column.invisible
911
- };
912
- }
913
- });
914
- return configuration;
915
- });
916
- });
917
- _set.set(this, (gridOption, configuration) => {
918
- var _a, _b, _c, _d;
919
- const key = __classPrivateFieldGet(this, _getKey).call(this, gridOption);
920
- if (key) {
921
- if (((_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _a === void 0 ? void 0 : _a.storage) === 'server') {
922
- const { set } = this.settingService.createServer(key, {
923
- args: (_b = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _b === void 0 ? void 0 : _b.args
924
- });
925
- set(configuration);
926
- }
927
- else {
928
- const { set } = this.settingService.create(key, {
929
- type: (_c = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _c === void 0 ? void 0 : _c.storage,
930
- args: (_d = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _d === void 0 ? void 0 : _d.args
931
- });
932
- set(configuration);
933
- }
934
- }
935
- return JSON.parse(JSON.stringify(configuration));
936
- });
937
- _remove.set(this, (gridOption) => {
938
- return () => {
939
- var _a, _b, _c, _d;
940
- const key = __classPrivateFieldGet(this, _getKey).call(this, gridOption);
941
- if (key) {
942
- if (((_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _a === void 0 ? void 0 : _a.storage) === 'server') {
943
- const { remove } = this.settingService.createServer(key, {
944
- args: (_b = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _b === void 0 ? void 0 : _b.args
945
- });
946
- remove();
947
- }
948
- else {
949
- const { remove } = this.settingService.create(key, {
950
- type: (_c = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _c === void 0 ? void 0 : _c.storage,
951
- args: (_d = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _d === void 0 ? void 0 : _d.args
952
- });
953
- remove();
954
- }
955
- }
956
- };
957
- }
958
- // get = async (gridOption: SdGridMaterialOption): Promise<SdGridConfiguration> => {
959
- // if (!gridOption?.key) {
960
- // return this.#getDefaultConfiguration(gridOption);
961
- // }
962
- // const { key, columns } = gridOption;
963
- // const configuration: SdGridConfiguration = await this.settingService.get(this.#getKey(key)).catch(() => undefined);
964
- // if (!configuration?.columns) {
965
- // this.settingService.remove(this.#getKey(key)).catch(console.error);
966
- // return this.#getDefaultConfiguration(gridOption);
967
- // }
968
- // configuration.columns = configuration.columns
969
- // .filter(column => columns.some(e => !e.hidden && e.field === column.origin.field));
970
- // // Thêm những column mới vào storage nếu có
971
- // columns.forEach(column => {
972
- // const col = configuration.columns.find(e => e.origin?.field === column.field);
973
- // if (!col) {
974
- // configuration.columns.push({
975
- // origin: {
976
- // field: column.field,
977
- // title: column.title,
978
- // width: column.width,
979
- // invisible: column.invisible,
980
- // },
981
- // invisible: column.invisible,
982
- // fixed: false
983
- // });
984
- // } else {
985
- // col.origin = {
986
- // field: column.field,
987
- // title: column.title,
988
- // width: column.width,
989
- // invisible: column.invisible
990
- // };
991
- // }
992
- // });
993
- // return configuration;
994
- // }
995
- // set = async (key: string, configuration: SdGridConfiguration): Promise<SdGridConfiguration> => {
996
- // if (key) {
997
- // this.settingService.set(this.#getKey(key), configuration);
998
- // }
999
- // return configuration;
1000
- // }
1001
- // remove = (key: string) => {
1002
- // if (key) {
1003
- // this.settingService.remove(this.#getKey(key));
1004
- // }
1005
- // }
1006
- );
1007
- // get = async (gridOption: SdGridMaterialOption): Promise<SdGridConfiguration> => {
1008
- // if (!gridOption?.key) {
1009
- // return this.#getDefaultConfiguration(gridOption);
1010
- // }
1011
- // const { key, columns } = gridOption;
1012
- // const configuration: SdGridConfiguration = await this.settingService.get(this.#getKey(key)).catch(() => undefined);
1013
- // if (!configuration?.columns) {
1014
- // this.settingService.remove(this.#getKey(key)).catch(console.error);
1015
- // return this.#getDefaultConfiguration(gridOption);
1016
- // }
1017
- // configuration.columns = configuration.columns
1018
- // .filter(column => columns.some(e => !e.hidden && e.field === column.origin.field));
1019
- // // Thêm những column mới vào storage nếu có
1020
- // columns.forEach(column => {
1021
- // const col = configuration.columns.find(e => e.origin?.field === column.field);
1022
- // if (!col) {
1023
- // configuration.columns.push({
1024
- // origin: {
1025
- // field: column.field,
1026
- // title: column.title,
1027
- // width: column.width,
1028
- // invisible: column.invisible,
1029
- // },
1030
- // invisible: column.invisible,
1031
- // fixed: false
1032
- // });
1033
- // } else {
1034
- // col.origin = {
1035
- // field: column.field,
1036
- // title: column.title,
1037
- // width: column.width,
1038
- // invisible: column.invisible
1039
- // };
1040
- // }
1041
- // });
1042
- // return configuration;
1043
- // }
1044
- // set = async (key: string, configuration: SdGridConfiguration): Promise<SdGridConfiguration> => {
1045
- // if (key) {
1046
- // this.settingService.set(this.#getKey(key), configuration);
1047
- // }
1048
- // return configuration;
1049
- // }
1050
- // remove = (key: string) => {
1051
- // if (key) {
1052
- // this.settingService.remove(this.#getKey(key));
1053
- // }
1054
- // }
1055
- this.generateConfigurationResult = (configuration, gridOption, sdSubInformation) => {
1056
- var _a, _b;
1057
- const result = {
1058
- column: {},
1059
- fixedColumn: {},
1060
- firstColumns: [],
1061
- secondColumns: [],
1062
- firstHeaders: [],
1063
- secondHeaders: [],
1064
- displayedColumns: [],
1065
- displayedFooters: [],
1066
- multipleHeader: false
1067
- };
1068
- const { selection, commands, editor, group } = gridOption || {};
1069
- if ((editor === null || editor === void 0 ? void 0 : editor.addable) || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'inline' && ((editor === null || editor === void 0 ? void 0 : editor.removable) || typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function' || !(editor === null || editor === void 0 ? void 0 : editor.disabled)))
1070
- || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'focus' && (typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function' || !(editor === null || editor === void 0 ? void 0 : editor.disabled)))) {
1071
- result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).EDITORVALIDATION);
1072
- result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).EDITORVALIDATION);
1073
- }
1074
- if (selection === null || selection === void 0 ? void 0 : selection.visible) {
1075
- result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).SELECTION);
1076
- result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).SELECTION);
1077
- }
1078
- if (!(editor === null || editor === void 0 ? void 0 : editor.hidden)) {
1079
- if ((editor === null || editor === void 0 ? void 0 : editor.addable) || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'inline' && ((editor === null || editor === void 0 ? void 0 : editor.removable) || typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function' || !(editor === null || editor === void 0 ? void 0 : editor.disabled)))
1080
- || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'focus' && (typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function' || !(editor === null || editor === void 0 ? void 0 : editor.disabled)))
1081
- || ((editor === null || editor === void 0 ? void 0 : editor.type) === 'popup' && (typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function' || !(editor === null || editor === void 0 ? void 0 : editor.disabled)))) {
1082
- result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).EDITOR);
1083
- result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).EDITOR);
1084
- }
1085
- }
1086
- if (commands === null || commands === void 0 ? void 0 : commands.length) {
1087
- result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).COMMAND);
1088
- result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).COMMAND);
1089
- }
1090
- if ((_a = group === null || group === void 0 ? void 0 : group.fields) === null || _a === void 0 ? void 0 : _a.length) {
1091
- result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).GROUP);
1092
- result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).GROUP);
1093
- }
1094
- (_b = configuration === null || configuration === void 0 ? void 0 : configuration.columns) === null || _b === void 0 ? void 0 : _b.filter(col => !col.invisible).forEach(col => {
1095
- var _a;
1096
- if (col.isGeneratedColumn) {
1097
- result.column[col.origin.field] = {
1098
- title: col.title || col.origin.title,
1099
- width: col.width || col.origin.width,
1100
- };
1101
- if (col.fixed) {
1102
- result.fixedColumn[col.origin.field] = {
1103
- title: col.title || col.origin.title,
1104
- width: col.width || col.origin.width,
1105
- };
1106
- }
1107
- const generatedColumn = {
1108
- type: 'children',
1109
- field: col.origin.field,
1110
- title: col.origin.title,
1111
- children: []
1112
- };
1113
- for (const subColumn of gridOption === null || gridOption === void 0 ? void 0 : gridOption.columns.filter(e1 => col.generatedColumns.includes(e1.field))) {
1114
- if (subColumn.type === 'children' || subColumn.type === 'children-col') {
1115
- for (const childColumn of subColumn.children) {
1116
- generatedColumn.children.push(Object.assign(Object.assign({}, childColumn), { colSpan: 2 }));
1117
- }
1118
- }
1119
- else {
1120
- generatedColumn.children.push(Object.assign(Object.assign({}, subColumn), { colSpan: 2 }));
1121
- }
1122
- }
1123
- result.firstColumns.push(Object.assign(Object.assign({}, generatedColumn), { title: col.title || col.origin.title, width: col.width || col.origin.width }));
1124
- result.firstHeaders.push(col.origin.field);
1125
- result.displayedColumns.push(col.origin.field);
1126
- return;
1127
- }
1128
- const column = gridOption === null || gridOption === void 0 ? void 0 : gridOption.columns.find(e => e.field === col.origin.field);
1129
- if (column) {
1130
- result.column[col.origin.field] = {
1131
- title: col.title || col.origin.title,
1132
- width: col.width || col.origin.width,
1133
- };
1134
- if (col.fixed) {
1135
- result.fixedColumn[col.origin.field] = {
1136
- title: col.title || col.origin.title,
1137
- width: col.width || col.origin.width,
1138
- };
1139
- }
1140
- result.firstColumns.push(Object.assign(Object.assign({}, column), { title: col.title || col.origin.title, width: col.width || col.origin.width }));
1141
- result.firstHeaders.push(col.origin.field);
1142
- if (column.type === 'children-col') {
1143
- (_a = column.children) === null || _a === void 0 ? void 0 : _a.forEach(childColumn => {
1144
- result.secondColumns.push(childColumn);
1145
- result.secondHeaders.push(childColumn.field);
1146
- result.displayedColumns.push(childColumn.field);
1147
- });
1148
- }
1149
- else {
1150
- result.displayedColumns.push(col.origin.field);
1151
- }
1152
- }
1153
- });
1154
- if (sdSubInformation === null || sdSubInformation === void 0 ? void 0 : sdSubInformation.templateRef) {
1155
- result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).SUBINFORMATION);
1156
- result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).SUBINFORMATION);
1157
- }
1158
- result.multipleHeader = result.secondHeaders.length > 0;
1159
- // Sub infomation không thể có footer
1160
- result.displayedFooters = result.displayedColumns.filter(val => val !== __classPrivateFieldGet(this, _COLUMNS).SUBINFORMATION);
1161
- return result;
1162
- };
1163
- }
1164
- }
1165
- _COLUMNS = new WeakMap(), _cache = new WeakMap(), _getKey = new WeakMap(), _default = new WeakMap(), _load = new WeakMap(), _get = new WeakMap(), _set = new WeakMap(), _remove = new WeakMap();
1166
- SdGridConfigurationService.decorators = [
1167
- { type: Injectable }
1168
- ];
1169
- SdGridConfigurationService.ctorParameters = () => [
1170
- { type: SdSettingService },
1171
- { type: undefined, decorators: [{ type: Inject, args: [GRID_MATERIAL_CONFIG,] }, { type: Optional }] }
1172
- ];
1173
-
1174
- var _prefix$1, _cache$1;
1175
- class SdColumnValuesPipe {
1176
- constructor() {
1177
- _prefix$1.set(this, 'a1e67660-8aa2-4c11-b02d-71a32188719f');
1178
- _cache$1.set(this, {});
1179
- this.transform = (value, column) => __awaiter(this, void 0, void 0, function* () {
1180
- var _a, _b, _c, _d, _e;
1181
- if (column.type !== 'values' || !((_a = column.option) === null || _a === void 0 ? void 0 : _a.items) || !((_b = column.option) === null || _b === void 0 ? void 0 : _b.valueField) || !((_c = column.option) === null || _c === void 0 ? void 0 : _c.displayField)) {
1182
- return value;
1183
- }
1184
- const _f = column.option, { items, valueField, displayField } = _f, remain = __rest(_f, ["items", "valueField", "displayField"]);
1185
- const key = hash({
1186
- prefix: __classPrivateFieldGet(this, _prefix$1),
1187
- valueField,
1188
- displayField,
1189
- remain,
1190
- value
1191
- });
1192
- if (typeof (items) === 'function') {
1193
- if (!__classPrivateFieldGet(this, _cache$1)[key]) {
1194
- const values = yield items(value, true);
1195
- __classPrivateFieldGet(this, _cache$1)[key] = {
1196
- result: ((_d = values === null || values === void 0 ? void 0 : values.find(e => (e === null || e === void 0 ? void 0 : e[valueField]) === value)) === null || _d === void 0 ? void 0 : _d[displayField]) || value
1197
- };
1198
- }
1199
- }
1200
- else {
1201
- if (!__classPrivateFieldGet(this, _cache$1)[key]) {
1202
- __classPrivateFieldGet(this, _cache$1)[key] = {
1203
- result: ((_e = items === null || items === void 0 ? void 0 : items.find(e => (e === null || e === void 0 ? void 0 : e[valueField]) === value)) === null || _e === void 0 ? void 0 : _e[displayField]) || value
1204
- };
1205
- }
1206
- }
1207
- return __classPrivateFieldGet(this, _cache$1)[key].result;
1208
- });
1209
- }
1210
- }
1211
- _prefix$1 = new WeakMap(), _cache$1 = new WeakMap();
1212
- SdColumnValuesPipe.decorators = [
1213
- { type: Pipe, args: [{
1214
- name: 'columnValues'
1215
- },] }
1216
- ];
1217
-
1218
- const CalculateSdId = (item) => {
1219
- const { sdId, editorHandlerColumn, expandDetail, isExpanded, isExpanding, isSelected, sdGroup, selectable, actions, groupedActions, originItem, editorErrorMessage, editorHandlerRow } = item, remain = __rest(item, ["sdId", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "sdGroup", "selectable", "actions", "groupedActions", "originItem", "editorErrorMessage", "editorHandlerRow"]);
1220
- return hash(remain);
1221
- };
1222
-
1223
- var _visible;
1224
- class SdEditorHandlerColumnPipe {
1225
- constructor(zone) {
1226
- this.zone = zone;
1227
- _visible.set(this, (col, item) => {
1228
- if (col.type === 'children' || col.type === 'children-col') {
1229
- return false;
1230
- }
1231
- // Kiểm tra xem có bị disabled hay không?
1232
- if (col.editor) {
1233
- const isDisabled = typeof (col.editor.disabled) === 'function' ? col.editor.disabled(item) : col.editor.disabled;
1234
- if (isDisabled) {
1235
- return false;
1236
- }
1237
- }
1238
- return true;
1239
- });
1240
- }
1241
- transform(value, item, gridOption) {
1242
- const key = CalculateSdId(item);
1243
- if (item.sdId === key && item.editorHandlerColumn) {
1244
- return true;
1245
- }
1246
- item.editorHandlerColumn = item.editorHandlerColumn || {};
1247
- const { columns } = gridOption;
1248
- for (const col of columns) {
1249
- if (col.type === 'children-col') {
1250
- for (const childCol of col.children) {
1251
- item.editorHandlerColumn[childCol.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[childCol.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, childCol, item) });
1252
- }
1253
- }
1254
- else {
1255
- item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
1256
- }
1257
- }
1258
- this.zone.run(() => {
1259
- item.sdId = CalculateSdId(item);
1260
- });
1261
- item.sdId = key;
1262
- return true;
1263
- }
1264
- }
1265
- _visible = new WeakMap();
1266
- SdEditorHandlerColumnPipe.decorators = [
1267
- { type: Pipe, args: [{
1268
- name: 'sdEditorHandlerColumn'
1269
- },] },
1270
- { type: Injectable }
1271
- ];
1272
- SdEditorHandlerColumnPipe.ctorParameters = () => [
1273
- { type: NgZone }
1274
- ];
1275
-
1276
- var _paginator, _sort, _subscription$1, _optionChanges, _initCellDef, _initFilterDef, _initFooterDef, _filterExportInfo, _initConfiguration, _filterLocal, _getFilter, _load$1, _render, _exportedItems, _allColumns, _allExportedColumns, _onExport, _updateSelectedItems;
1277
- class SdGridMaterial {
1278
- constructor(ref, configuration, gridConfigurationService, exportService, notifyService, translateService, columnValuesPipe, editorHandlerColumnPipe) {
1279
- this.ref = ref;
1280
- this.configuration = configuration;
1281
- this.gridConfigurationService = gridConfigurationService;
1282
- this.exportService = exportService;
1283
- this.notifyService = notifyService;
1284
- this.translateService = translateService;
1285
- this.columnValuesPipe = columnValuesPipe;
1286
- this.editorHandlerColumnPipe = editorHandlerColumnPipe;
1287
- this.key = v4();
1288
- this.localItems = [];
1289
- this.items = [];
1290
- this.selectedItems = [];
1291
- // Loading
1292
- this.isLoading = false;
1293
- // Paginate
1294
- this.isHiddenPaginator = false;
1295
- _paginator.set(this, void 0);
1296
- // Sorting
1297
- _sort.set(this, void 0);
1298
- // Cell Def
1299
- this.sdCellDefs = new QueryList();
1300
- this.cellDef = {};
1301
- // Footer Def
1302
- this.sdFooterDefs = new QueryList();
1303
- this.footerDef = {};
1304
- this.hasFooter = false;
1305
- // Filter Def
1306
- this.sdFilterDefs = new QueryList();
1307
- this.filterDefs = [];
1308
- // Filter
1309
- this.columnFilter = {};
1310
- // Subcription
1311
- _subscription$1.set(this, new Subscription());
1312
- _optionChanges.set(this, new EventEmitter());
1313
- this.isExporting = false;
1314
- this.isSelectAll = false;
1315
- this.exportTitle = 'Export';
1316
- _initCellDef.set(this, () => {
1317
- this.cellDef = {};
1318
- for (const cellDef of this.sdCellDefs) {
1319
- if (cellDef.sdMaterialCellDef) {
1320
- this.cellDef[cellDef.sdMaterialCellDef] = cellDef;
1321
- }
1322
- }
1323
- });
1324
- _initFilterDef.set(this, () => {
1325
- this.filterDefs = [];
1326
- for (const filterDef of this.sdFilterDefs) {
1327
- this.filterDefs.push(filterDef);
1328
- }
1329
- });
1330
- _initFooterDef.set(this, () => {
1331
- this.footerDef = {};
1332
- this.hasFooter = false;
1333
- for (const footerDef of this.sdFooterDefs) {
1334
- if (footerDef.sdMaterialFooterDef) {
1335
- this.hasFooter = true;
1336
- this.footerDef[footerDef.sdMaterialFooterDef] = footerDef;
1337
- }
1338
- }
1339
- });
1340
- _filterExportInfo.set(this, (pageNumber, pageSize) => {
1341
- var _a, _b, _c, _d, _e, _f, _g;
1342
- return {
1343
- rawColumnFilter: (((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.inlineColumn) ? this.columnFilter : (_c = this.gridFilter) === null || _c === void 0 ? void 0 : _c.columnFilter) || {},
1344
- rawExternalFilter: ((_d = this.gridFilter) === null || _d === void 0 ? void 0 : _d.externalFilter) || {},
1345
- rawFilterDef: ((_e = this.gridFilter) === null || _e === void 0 ? void 0 : _e.filterDef) || {},
1346
- orderBy: ((_f = __classPrivateFieldGet(this, _sort)) === null || _f === void 0 ? void 0 : _f.active) || '',
1347
- orderDirection: ((_g = __classPrivateFieldGet(this, _sort)) === null || _g === void 0 ? void 0 : _g.direction) || '',
1348
- pageNumber,
1349
- pageSize,
1350
- isExported: true
1351
- };
1352
- });
1353
- _initConfiguration.set(this, (option) => {
1354
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1355
- option.paginate = {
1356
- hidden: (_a = option === null || option === void 0 ? void 0 : option.paginate) === null || _a === void 0 ? void 0 : _a.hidden,
1357
- pageSize: (_f = (_c = (_b = option === null || option === void 0 ? void 0 : option.paginate) === null || _b === void 0 ? void 0 : _b.pageSize) !== null && _c !== void 0 ? _c : (_e = (_d = this.configuration) === null || _d === void 0 ? void 0 : _d.paginate) === null || _e === void 0 ? void 0 : _e.pageSize) !== null && _f !== void 0 ? _f : (_g = DEFAULT_GRID_MATERIAL_CONFIG.paginate) === null || _g === void 0 ? void 0 : _g.pageSize,
1358
- pages: (_m = (_j = (_h = option === null || option === void 0 ? void 0 : option.paginate) === null || _h === void 0 ? void 0 : _h.pages) !== null && _j !== void 0 ? _j : (_l = (_k = this.configuration) === null || _k === void 0 ? void 0 : _k.paginate) === null || _l === void 0 ? void 0 : _l.pages) !== null && _m !== void 0 ? _m : (_o = DEFAULT_GRID_MATERIAL_CONFIG.paginate) === null || _o === void 0 ? void 0 : _o.pages,
1359
- showFirstLastButtons: (_q = (_p = option === null || option === void 0 ? void 0 : option.paginate) === null || _p === void 0 ? void 0 : _p.showFirstLastButtons) !== null && _q !== void 0 ? _q : false
1360
- };
1361
- return option;
1362
- });
1363
- _filterLocal.set(this, (localItems, filterInfo) => {
1364
- const { columns } = this.gridOption;
1365
- const { rawColumnFilter, orderBy, orderDirection, pageSize, pageNumber } = filterInfo;
1366
- const items = localItems.filter(item => {
1367
- var _a, _b, _c, _d;
1368
- for (const column of columns) {
1369
- const { field, type } = column;
1370
- const filterValue = (rawColumnFilter[field] || '').toString().trim().toLowerCase();
1371
- const columnValue = (item[field] || '').toString().trim().toLowerCase();
1372
- if (filterValue) {
1373
- if (!columnValue && type !== 'datetime' && type !== 'date' && type !== 'time') {
1374
- return false;
1375
- }
1376
- if (type === 'string') {
1377
- if (columnValue.indexOf(filterValue) === -1) {
1378
- return false;
1379
- }
1380
- }
1381
- else if (type === 'values') {
1382
- if (columnValue !== filterValue) {
1383
- return false;
1384
- }
1385
- }
1386
- else if (type === 'number') {
1387
- const fValue = +filterValue.replace('>=', '').replace('<=', '').replace('>', '').replace('<', '');
1388
- const cValue = +columnValue;
1389
- if (fValue || fValue === 0) {
1390
- if (!cValue && cValue !== 0) {
1391
- return false;
1392
- }
1393
- if (filterValue.indexOf('>=') > -1 && cValue < fValue) {
1394
- return false;
1395
- }
1396
- else if (filterValue.indexOf('<=') > -1 && cValue > fValue) {
1397
- return false;
1398
- }
1399
- else if (filterValue.indexOf('<') > -1 && cValue >= fValue) {
1400
- return false;
1401
- }
1402
- else if (filterValue.indexOf('>') > -1 && cValue <= fValue) {
1403
- return false;
1404
- }
1405
- else if (cValue !== fValue) {
1406
- return false;
1407
- }
1408
- }
1409
- }
1410
- else if (type === 'bool') {
1411
- if (filterValue === '1' && columnValue !== '1' && columnValue !== 'true') {
1412
- return false;
1413
- }
1414
- else if (filterValue === '0' && columnValue !== '0' && columnValue !== 'false') {
1415
- return false;
1416
- }
1417
- }
1418
- else if (type === 'datetime' || type === 'date' || type === 'time') {
1419
- const from = (_b = (_a = rawColumnFilter[field]) === null || _a === void 0 ? void 0 : _a.from) !== null && _b !== void 0 ? _b : rawColumnFilter[field];
1420
- const to = (_d = (_c = rawColumnFilter[field]) === null || _c === void 0 ? void 0 : _c.to) !== null && _d !== void 0 ? _d : rawColumnFilter[field];
1421
- const fromDate = Date.begin(from);
1422
- const toDate = Date.end(to);
1423
- if (fromDate && toDate) {
1424
- if (!columnValue) {
1425
- return false;
1426
- }
1427
- if (new Date(columnValue).getTime() < fromDate.getTime() || new Date(columnValue).getTime() >= toDate.getTime()) {
1428
- return false;
1429
- }
1430
- }
1431
- }
1432
- }
1433
- }
1434
- return true;
1435
- });
1436
- // Sort
1437
- if (orderBy && orderDirection) {
1438
- const column = columns.find(e => e.field === orderBy);
1439
- if (column) {
1440
- const { type, field } = column;
1441
- items.sort((current, next) => {
1442
- if (type === 'number') {
1443
- return (current[field] || 0) - (next[field] || 0);
1444
- }
1445
- if (type === 'date' || type === 'datetime' || type === 'time') {
1446
- const d1 = new Date(current[field] || '').getTime();
1447
- const d2 = new Date(current[field] || '').getTime();
1448
- return d1 - d2;
1449
- }
1450
- const s1 = (current[field] || '').toString();
1451
- const s2 = (next[field] || '').toString();
1452
- if (s1 > s2) {
1453
- return 1;
1454
- }
1455
- if (s1 < s2) {
1456
- return -1;
1457
- }
1458
- return 0;
1459
- });
1460
- if (orderDirection === 'desc') {
1461
- items.reverse();
1462
- }
1463
- }
1464
- }
1465
- return {
1466
- items: items.filter((item, index) => {
1467
- return index >= pageNumber * pageSize
1468
- && index < (pageNumber + 1) * pageSize;
1469
- }),
1470
- total: items.length
1471
- };
1472
- });
1473
- _getFilter.set(this, () => {
1474
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1475
- return ({
1476
- rawColumnFilter: (((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.inlineColumn) ? this.columnFilter : (_c = this.gridFilter) === null || _c === void 0 ? void 0 : _c.columnFilter) || {},
1477
- rawExternalFilter: ((_d = this.gridFilter) === null || _d === void 0 ? void 0 : _d.externalFilter) || {},
1478
- rawFilterDef: ((_e = this.gridFilter) === null || _e === void 0 ? void 0 : _e.filterDef) || {},
1479
- orderBy: ((_f = __classPrivateFieldGet(this, _sort)) === null || _f === void 0 ? void 0 : _f.active) || '',
1480
- orderDirection: ((_g = __classPrivateFieldGet(this, _sort)) === null || _g === void 0 ? void 0 : _g.direction) || '',
1481
- pageNumber: ((_h = __classPrivateFieldGet(this, _paginator)) === null || _h === void 0 ? void 0 : _h.pageIndex) || 0,
1482
- pageSize: ((_j = __classPrivateFieldGet(this, _paginator)) === null || _j === void 0 ? void 0 : _j.pageSize) || ((_l = (_k = this.gridOption) === null || _k === void 0 ? void 0 : _k.paginate) === null || _l === void 0 ? void 0 : _l.pageSize) || 50
1483
- });
1484
- });
1485
- _load$1.set(this, (filterReq, force = true) => __awaiter(this, void 0, void 0, function* () {
1486
- this.isLoading = true;
1487
- try {
1488
- if (this.gridOption.type === 'server') {
1489
- let result = this.gridOption.items(filterReq);
1490
- if (isObservable(result)) {
1491
- result = result.toPromise();
1492
- }
1493
- return yield result;
1494
- }
1495
- else {
1496
- if (force) {
1497
- const results = this.gridOption.items();
1498
- if (results instanceof Promise) {
1499
- this.localItems = yield results;
1500
- }
1501
- else {
1502
- this.localItems = results;
1503
- }
1504
- }
1505
- return __classPrivateFieldGet(this, _filterLocal).call(this, this.localItems, filterReq);
1506
- }
1507
- }
1508
- catch (error) {
1509
- this.notifyService.handle.error(error);
1510
- }
1511
- finally {
1512
- this.isLoading = false;
1513
- this.ref.detectChanges();
1514
- }
1515
- }));
1516
- _render.set(this, (args) => __awaiter(this, void 0, void 0, function* () {
1517
- var _a, _b, _c;
1518
- this.items = (args === null || args === void 0 ? void 0 : args.items) || [];
1519
- this.total = (args === null || args === void 0 ? void 0 : args.total) || 0;
1520
- // this.isHiddenPaginator = this.filterInfo.pageNumber === 0 && this.total <= this.filterInfo.pageSize;
1521
- this.items.forEach((item) => {
1522
- item.originItem = Object.assign({}, item);
1523
- });
1524
- yield ((_c = (_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.reload) === null || _b === void 0 ? void 0 : _b.onReload) === null || _c === void 0 ? void 0 : _c.call(_b, this.items));
1525
- this.isSelectAll = this.items.every(e => e.isSelected);
1526
- __classPrivateFieldGet(this, _updateSelectedItems).call(this);
1527
- }));
1528
- this.reload = (force = true) => __awaiter(this, void 0, void 0, function* () {
1529
- var _d;
1530
- const data = yield __classPrivateFieldGet(this, _load$1).call(this, __classPrivateFieldGet(this, _getFilter).call(this), force);
1531
- (_d = this.sdScroll) === null || _d === void 0 ? void 0 : _d.scrollTop();
1532
- __classPrivateFieldGet(this, _render).call(this, data);
1533
- });
1534
- _exportedItems.set(this, (pageNumber = 0, pageSize = 10000) => __awaiter(this, void 0, void 0, function* () {
1535
- var _e, _f;
1536
- if ((_e = this.gridOption.export) === null || _e === void 0 ? void 0 : _e.items) {
1537
- // const exportedItems = this.gridOption.export?.items(this.#filterExportInfo(pageNumber, pageSize));
1538
- let result = (_f = this.gridOption.export) === null || _f === void 0 ? void 0 : _f.items(__classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize));
1539
- if (Array.isArray(result)) {
1540
- return result;
1541
- }
1542
- if (isObservable(result)) {
1543
- result = result.toPromise();
1544
- }
1545
- if (isObservable(result)) {
1546
- result = result.toPromise();
1547
- }
1548
- return yield result;
1549
- }
1550
- else {
1551
- const filterInfo = __classPrivateFieldGet(this, _filterExportInfo).call(this, pageNumber, pageSize);
1552
- if (this.gridOption.type === 'server') {
1553
- let result = this.gridOption.items(filterInfo);
1554
- if (isObservable(result)) {
1555
- result = result.toPromise();
1556
- }
1557
- return yield result;
1558
- }
1559
- else {
1560
- let exportedItems = [];
1561
- if (typeof (this.gridOption.items) === 'function') {
1562
- const results = this.gridOption.items();
1563
- if (results instanceof Promise) {
1564
- exportedItems = yield results;
1565
- }
1566
- else {
1567
- exportedItems = results;
1568
- }
1569
- }
1570
- else {
1571
- exportedItems = this.gridOption.items;
1572
- }
1573
- return __classPrivateFieldGet(this, _filterLocal).call(this, exportedItems, filterInfo);
1574
- }
1575
- }
1576
- }));
1577
- _allColumns.set(this, () => {
1578
- const columns = [];
1579
- this.gridOption.columns.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(column => {
1580
- var _a, _b;
1581
- if (column.type === 'image') {
1582
- return;
1583
- }
1584
- if (column.type === 'children') {
1585
- (_a = column.children) === null || _a === void 0 ? void 0 : _a.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(childColumn => {
1586
- if (childColumn.type === 'image') {
1587
- return;
1588
- }
1589
- columns.push(childColumn);
1590
- });
1591
- return;
1592
- }
1593
- if (column.type === 'children-col') {
1594
- (_b = column.children) === null || _b === void 0 ? void 0 : _b.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); }).forEach(childColumn => {
1595
- if (childColumn.type === 'image') {
1596
- return;
1597
- }
1598
- columns.push(childColumn);
1599
- });
1600
- return;
1601
- }
1602
- columns.push(column);
1603
- });
1604
- return columns;
1605
- });
1606
- _allExportedColumns.set(this, () => {
1607
- var _a, _b;
1608
- return ((_b = (_a = this.gridOption.export) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.filter(e => { var _a; return !((_a = e.export) === null || _a === void 0 ? void 0 : _a.disabled); })) || [];
1609
- });
1610
- _onExport.set(this, (args) => __awaiter(this, void 0, void 0, function* () {
1611
- var _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1612
- try {
1613
- const { file, isCSV, isRaw } = args;
1614
- let { columns } = args;
1615
- const pageSize = ((_h = (_g = this.gridOption) === null || _g === void 0 ? void 0 : _g.export) === null || _h === void 0 ? void 0 : _h.maxItemsPerRequest) || 1000;
1616
- const batch = ((_k = (_j = this.gridOption) === null || _j === void 0 ? void 0 : _j.export) === null || _k === void 0 ? void 0 : _k.batch) || 1;
1617
- let total = this.total;
1618
- let pageNumber = 0;
1619
- let exportItems = [];
1620
- this.isExporting = true;
1621
- const items = [];
1622
- let promises = [];
1623
- const handleData = () => __awaiter(this, void 0, void 0, function* () {
1624
- var _u;
1625
- const results = yield Promise.all(promises);
1626
- promises = [];
1627
- exportItems = [];
1628
- for (const result of results) {
1629
- if ('items' in result) {
1630
- exportItems = [...exportItems, ...result.items];
1631
- total = result.total;
1632
- }
1633
- else {
1634
- exportItems = [...exportItems, ...result];
1635
- }
1636
- }
1637
- if ((_u = this.gridOption.export) === null || _u === void 0 ? void 0 : _u.mapping) {
1638
- const results = this.gridOption.export.mapping(exportItems);
1639
- if (results instanceof Promise) {
1640
- exportItems = yield results;
1641
- }
1642
- else {
1643
- exportItems = results;
1644
- }
1645
- }
1646
- const totalPage = total / pageSize;
1647
- const percent = Math.round((pageNumber - 1) * 100.0 / totalPage);
1648
- this.exportTitle = `Exporting...${percent}%`;
1649
- const allColumns = __classPrivateFieldGet(this, _allColumns).call(this);
1650
- const allExportedColumns = __classPrivateFieldGet(this, _allExportedColumns).call(this);
1651
- for (const item of exportItems) {
1652
- const obj = {};
1653
- const handle = (exportColumn) => __awaiter(this, void 0, void 0, function* () {
1654
- var _v, _w;
1655
- obj[exportColumn.field] = item[exportColumn.field];
1656
- const column = allColumns.find(e => e.field === exportColumn.field);
1657
- const exportedColumn = allExportedColumns.find(e => e.field === exportColumn.field);
1658
- if (exportedColumn === null || exportedColumn === void 0 ? void 0 : exportedColumn.transform) {
1659
- obj[exportedColumn.field] = exportedColumn.transform(item[exportedColumn.field], item);
1660
- return;
1661
- }
1662
- if (!column) {
1663
- return;
1664
- }
1665
- if (column.type === 'children' || column.type === 'children-col') {
1666
- column === null || column === void 0 ? void 0 : column.children.forEach(childColumn => handle(childColumn));
1667
- return;
1668
- }
1669
- if (!columns.some(e => e.field === column.field)) {
1670
- return;
1671
- }
1672
- if (column.transform) {
1673
- const transform = column.transform(item[column.field], item);
1674
- if (transform instanceof Promise) {
1675
- obj[column.field] = yield transform;
1676
- }
1677
- else {
1678
- obj[column.field] = transform;
1679
- }
1680
- }
1681
- else if (item[column.field] === undefined || item[column.field] === null || item[column.field] === '') {
1682
- obj[column.field] = '';
1683
- }
1684
- else if (column.type === 'string' || column.type === 'number') {
1685
- // Nếu cell là string hoặc number thì gán bằng chính nó
1686
- obj[column.field] = item[column.field];
1687
- }
1688
- else if (column.type === 'bool') {
1689
- // Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
1690
- if (item[column.field]) {
1691
- obj[column.field] = ((_v = column.option) === null || _v === void 0 ? void 0 : _v.displayOnTrue) || 'True';
1692
- }
1693
- else if (obj[column.field] !== undefined && obj[column.field] !== null) {
1694
- obj[column.field] = ((_w = column.option) === null || _w === void 0 ? void 0 : _w.displayOnFalse) || 'False';
1695
- }
1696
- }
1697
- else if (column.type === 'date') {
1698
- let date = item[column.field];
1699
- const { transformDate } = column;
1700
- if (transformDate) {
1701
- date = transformDate(date, item);
1702
- }
1703
- // Nếu là date thì convert theo đúng format
1704
- obj[column.field] = Date.toFormat(date, 'dd/MM/yyyy');
1705
- }
1706
- else if (column.type === 'datetime') {
1707
- let date = item[column.field];
1708
- const { transformDate } = column;
1709
- if (transformDate) {
1710
- date = transformDate(date, item);
1711
- }
1712
- // Nếu là datetime thì convert theo đúng format
1713
- obj[column.field] = Date.toFormat(date, 'dd/MM/yyyy HH:mm');
1714
- }
1715
- else if (column.type === 'time') {
1716
- let date = item[column.field];
1717
- const { transformDate } = column;
1718
- if (transformDate) {
1719
- date = transformDate(date, item);
1720
- }
1721
- // Nếu là time thì convert theo đúng format
1722
- obj[column.field] = Date.toFormat(date, 'HH:mm');
1723
- }
1724
- else if (column.type === 'values') {
1725
- // Nếu là values thì lấy giá trị của value được chọn
1726
- obj[column.field] = yield this.columnValuesPipe.transform(item[column.field], column);
1727
- }
1728
- else {
1729
- obj[column.field] = item[column.field];
1730
- }
1731
- });
1732
- // this.gridOption.columns.forEach(handle);
1733
- for (const exportColumn of columns) {
1734
- yield handle(exportColumn);
1735
- }
1736
- items.push(obj);
1737
- }
1738
- });
1739
- while (pageNumber * pageSize < total) {
1740
- promises.push(__classPrivateFieldGet(this, _exportedItems).call(this, pageNumber, pageSize));
1741
- pageNumber++;
1742
- if (promises.length < batch) {
1743
- continue;
1744
- }
1745
- yield handleData();
1746
- }
1747
- if (promises.length > 0) {
1748
- yield handleData();
1749
- }
1750
- if (!(file === null || file === void 0 ? void 0 : file.filePath)) {
1751
- if (isCSV) {
1752
- yield this.exportService.exportCSV({
1753
- columns,
1754
- items,
1755
- fileName: (_m = (_l = this.gridOption) === null || _l === void 0 ? void 0 : _l.export) === null || _m === void 0 ? void 0 : _m.fileName
1756
- });
1757
- return;
1758
- }
1759
- if (isRaw) {
1760
- yield this.exportService.exportExcelRaw({
1761
- columns,
1762
- items,
1763
- fileName: (_p = (_o = this.gridOption) === null || _o === void 0 ? void 0 : _o.export) === null || _p === void 0 ? void 0 : _p.fileName
1764
- });
1765
- return;
1766
- }
1767
- const sheets = [];
1768
- if (Array.isArray((_r = (_q = this.gridOption) === null || _q === void 0 ? void 0 : _q.export) === null || _r === void 0 ? void 0 : _r.sheets)) {
1769
- for (const sheet of this.gridOption.export.sheets) {
1770
- if (sheet.name && sheet.items && sheet.fields) {
1771
- if (Array.isArray(sheet.items)) {
1772
- sheets.push({
1773
- name: sheet.name,
1774
- items: sheet.items,
1775
- fields: sheet.fields
1776
- });
1777
- }
1778
- else {
1779
- sheets.push({
1780
- name: sheet.name,
1781
- items: yield sheet.items(),
1782
- fields: sheet.fields
1783
- });
1784
- }
1785
- }
1786
- }
1787
- }
1788
- yield this.exportService.export({
1789
- columns,
1790
- items,
1791
- fileName: (_t = (_s = this.gridOption) === null || _s === void 0 ? void 0 : _s.export) === null || _t === void 0 ? void 0 : _t.fileName,
1792
- sheets
1793
- });
1794
- return;
1795
- }
1796
- yield this.exportService.exportByTemplate({
1797
- filePath: file.filePath,
1798
- fileName: file.fileName,
1799
- columns,
1800
- items
1801
- });
1802
- }
1803
- finally {
1804
- this.isExporting = false;
1805
- this.exportTitle = `Export`;
1806
- this.ref.detectChanges();
1807
- }
1808
- }));
1809
- this.onExport = (args) => __awaiter(this, void 0, void 0, function* () {
1810
- const { translate } = this.translateService;
1811
- if (!args.isCSV && this.gridOption.export.max && this.total > this.gridOption.export.max) {
1812
- args.isRaw = true;
1813
- __classPrivateFieldGet(this, _onExport).call(this, args);
1814
- // this.notifyService.confirm(translate(`Total rows reach limit, do you want to export CSV`)).then(() => {
1815
- // args.isCSV = true;
1816
- // this.#onExport(args);
1817
- // });
1818
- return;
1819
- }
1820
- __classPrivateFieldGet(this, _onExport).call(this, args);
1821
- });
1822
- this.onFilterChange = () => {
1823
- __classPrivateFieldGet(this, _paginator).pageIndex = 0;
1824
- this.reload(false);
1825
- };
1826
- this.onExpand = (rowData) => __awaiter(this, void 0, void 0, function* () {
1827
- var _x, _y, _z, _0, _1;
1828
- if ((_x = this.gridOption.subInformation) === null || _x === void 0 ? void 0 : _x.always) {
1829
- return;
1830
- }
1831
- if (rowData.isExpanding) {
1832
- return;
1833
- }
1834
- if (rowData.isExpanded) {
1835
- rowData.isExpanded = false;
1836
- return;
1837
- }
1838
- const data = (_0 = (_z = (_y = this.gridOption) === null || _y === void 0 ? void 0 : _y.subInformation) === null || _z === void 0 ? void 0 : _z.onExpand) === null || _0 === void 0 ? void 0 : _0.call(_z, rowData);
1839
- if (!((_1 = this.gridOption.subInformation) === null || _1 === void 0 ? void 0 : _1.multiple)) {
1840
- this.items.forEach(item => item.isExpanding = item.isExpanded = false);
1841
- }
1842
- if (data instanceof Promise) {
1843
- rowData.isExpanding = true;
1844
- data.then(res => {
1845
- rowData.expandDetail = res;
1846
- rowData.isExpanded = true;
1847
- }).finally(() => rowData.isExpanding = false);
1848
- }
1849
- else {
1850
- rowData.expandDetail = data;
1851
- rowData.isExpanded = true;
1852
- }
1853
- });
1854
- this.onSelect = (rowData) => {
1855
- var _a, _b, _c, _d, _e, _f, _g, _h;
1856
- if ((_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length) {
1857
- (_c = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _c === void 0 ? void 0 : _c.items.forEach(e => e.isSelected = rowData.isSelected);
1858
- (_e = (_d = this.gridOption.selection) === null || _d === void 0 ? void 0 : _d.onSelect) === null || _e === void 0 ? void 0 : _e.call(_d, rowData, this.items.filter(e => e.isSelected));
1859
- this.isSelectAll = this.items.every(e => e.isSelected);
1860
- __classPrivateFieldGet(this, _updateSelectedItems).call(this);
1861
- }
1862
- else {
1863
- if ((_f = this.gridOption.selection) === null || _f === void 0 ? void 0 : _f.single) {
1864
- this.items.filter(e => e !== rowData).forEach(e => e.isSelected = false);
1865
- __classPrivateFieldGet(this, _updateSelectedItems).call(this);
1866
- return;
1867
- }
1868
- (_h = (_g = this.gridOption.selection) === null || _g === void 0 ? void 0 : _g.onSelect) === null || _h === void 0 ? void 0 : _h.call(_g, rowData, this.items.filter(e => e.isSelected));
1869
- this.isSelectAll = this.items.every(e => e.isSelected);
1870
- __classPrivateFieldGet(this, _updateSelectedItems).call(this);
1871
- }
1872
- };
1873
- this.onSelectAll = () => {
1874
- var _a, _b, _c;
1875
- (_a = this.items) === null || _a === void 0 ? void 0 : _a.forEach(e => {
1876
- var _a, _b, _c, _d;
1877
- if (e.selectable && (!((_c = (_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.selection) === null || _b === void 0 ? void 0 : _b.actions) === null || _c === void 0 ? void 0 : _c.length) || ((_d = e.actions) === null || _d === void 0 ? void 0 : _d.length))) {
1878
- e.isSelected = this.isSelectAll;
1879
- }
1880
- });
1881
- (_c = (_b = this.gridOption.selection) === null || _b === void 0 ? void 0 : _b.onSelectAll) === null || _c === void 0 ? void 0 : _c.call(_b, this.items.filter(e => e.isSelected));
1882
- __classPrivateFieldGet(this, _updateSelectedItems).call(this);
1883
- };
1884
- this.onClearSelection = (items) => {
1885
- items = items || this.items;
1886
- this.isSelectAll = false;
1887
- items === null || items === void 0 ? void 0 : items.forEach(e => e.isSelected = false);
1888
- __classPrivateFieldGet(this, _updateSelectedItems).call(this);
1889
- };
1890
- _updateSelectedItems.set(this, () => {
1891
- this.selectedItems = this.items.filter(item => item.isSelected)
1892
- .map(item => {
1893
- const { isSelected, isExpanded, isExpanding, expandDetail, editorErrorMessage, editorHandlerColumn, editorHandlerRow, editorStatus, originItem, sdId, sdVersion } = item,
1894
- // Giữ lại các trường thông tin cho selectable (action, groupedAction, sdGroup, selectable)
1895
- result = __rest(item, ["isSelected", "isExpanded", "isExpanding", "expandDetail", "editorErrorMessage", "editorHandlerColumn", "editorHandlerRow", "editorStatus", "originItem", "sdId", "sdVersion"]);
1896
- return result;
1897
- });
1898
- this.ref.detectChanges();
1899
- });
1900
- this.clearFilter = () => {
1901
- var _a;
1902
- (_a = this.gridFilter) === null || _a === void 0 ? void 0 : _a.onClearFilter();
1903
- };
1904
- this.setFilter = (args) => {
1905
- var _a;
1906
- (_a = this.gridFilter) === null || _a === void 0 ? void 0 : _a.setFilter(args);
1907
- };
1908
- this.onCreate = () => {
1909
- var _a, _b;
1910
- const { type, editor, columns } = this.gridOption;
1911
- if (!(editor === null || editor === void 0 ? void 0 : editor.addable)) {
1912
- return;
1913
- }
1914
- const item = {};
1915
- // Gán giá trị mặc định
1916
- columns.forEach(column => {
1917
- if (column.type === 'values') {
1918
- item[column.field] = '';
1919
- }
1920
- else if (column.type === 'bool') {
1921
- item[column.field] = true;
1922
- }
1923
- else if (column.type === 'number') {
1924
- item[column.field] = null;
1925
- }
1926
- });
1927
- if (type === 'local') {
1928
- (_a = editor.onAdd) === null || _a === void 0 ? void 0 : _a.call(editor, item, this.localItems);
1929
- }
1930
- else {
1931
- (_b = editor.onAdd) === null || _b === void 0 ? void 0 : _b.call(editor, item, this.items);
1932
- }
1933
- // Đưa item lên dòng đầu tiên nếu type khác popup
1934
- if (editor.type !== 'popup') {
1935
- if (editor.addToLast) {
1936
- if (type === 'local') {
1937
- this.localItems = [...this.localItems, item];
1938
- }
1939
- this.items = [...this.items, item];
1940
- }
1941
- else {
1942
- if (type === 'local') {
1943
- this.localItems = [item, ...this.localItems];
1944
- }
1945
- this.items = [item, ...this.items];
1946
- }
1947
- }
1948
- item.editorStatus = 'create';
1949
- item.editorHandlerRow = {
1950
- temporary: Object.assign({}, item)
1951
- };
1952
- };
1953
- this.onUpdate = (item) => {
1954
- const { editor } = this.gridOption;
1955
- item.editorStatus = 'update';
1956
- item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { temporary: Object.assign({}, item) });
1957
- // this.generateEditorHanlder(item);
1958
- if (editor.type === 'popup') {
1959
- // Xử lý case popup
1960
- // this.sdGridPopupEditor.open(item, columns, isModified);
1961
- }
1962
- this.ref.detectChanges();
1963
- };
1964
- this.onSave = (item) => __awaiter(this, void 0, void 0, function* () {
1965
- if (item.editorHandlerRow.saving) {
1966
- return;
1967
- }
1968
- const { editor } = this.gridOption;
1969
- try {
1970
- item.editorHandlerRow.saving = true;
1971
- if (editor.validate) {
1972
- const result = editor.validate(item, this.items.indexOf(item));
1973
- if (result instanceof Promise) {
1974
- const message = yield result;
1975
- if (message) {
1976
- throw message;
1977
- }
1978
- }
1979
- else {
1980
- if (result) {
1981
- throw result;
1982
- }
1983
- }
1984
- }
1985
- if (editor.onSave) {
1986
- const result = editor.onSave(item);
1987
- if (result instanceof Promise) {
1988
- yield result;
1989
- }
1990
- }
1991
- if (item.editorStatus === 'create' && editor.type === 'popup') {
1992
- if (this.gridOption.type === 'local') {
1993
- this.items.splice(0, 0, item);
1994
- }
1995
- // this.viewItems.splice(0, 0, item);
1996
- }
1997
- item.editorStatus = undefined;
1998
- // this.generateEditorHanlder(item);
1999
- }
2000
- catch (err) {
2001
- this.notifyService.notify.warning(err);
2002
- }
2003
- finally {
2004
- item.editorHandlerRow.saving = false;
2005
- this.ref.detectChanges();
2006
- }
2007
- });
2008
- this.onCancel = (item) => {
2009
- var _a, _b;
2010
- const { editor } = this.gridOption;
2011
- if (editor.type === 'inline') {
2012
- if (this.gridOption.type === 'local') {
2013
- const idx2 = this.localItems.indexOf(item);
2014
- this.localItems.splice(idx2, 1);
2015
- this.localItems = [...this.localItems];
2016
- }
2017
- const idx1 = this.items.indexOf(item);
2018
- this.items.splice(idx1, 1);
2019
- this.items = [...this.items];
2020
- if (this.gridOption.type === 'local') {
2021
- (_a = editor === null || editor === void 0 ? void 0 : editor.onCancel) === null || _a === void 0 ? void 0 : _a.call(editor, item, this.localItems);
2022
- }
2023
- else {
2024
- (_b = editor === null || editor === void 0 ? void 0 : editor.onCancel) === null || _b === void 0 ? void 0 : _b.call(editor, item, this.items);
2025
- }
2026
- this.ref.detectChanges();
2027
- return;
2028
- }
2029
- if (editor.type === 'focus') {
2030
- if (item.editorStatus === 'create') {
2031
- if (this.gridOption.type === 'local') {
2032
- const idx2 = this.localItems.indexOf(item);
2033
- this.localItems.splice(idx2, 1);
2034
- this.localItems = [...this.localItems];
2035
- }
2036
- const idx1 = this.items.indexOf(item);
2037
- this.items.splice(idx1, 1);
2038
- this.items = [...this.items];
2039
- }
2040
- else {
2041
- Object.assign(item, item.editorHandlerRow.temporary);
2042
- }
2043
- }
2044
- item.editorStatus = undefined;
2045
- this.ref.detectChanges();
2046
- };
2047
- this.onRemove = (item) => {
2048
- var _a, _b;
2049
- const { editor } = this.gridOption;
2050
- if (editor.type === 'inline') {
2051
- if (this.gridOption.type === 'local') {
2052
- const idx2 = this.localItems.indexOf(item);
2053
- this.localItems.splice(idx2, 1);
2054
- this.localItems = [...this.localItems];
2055
- }
2056
- const idx1 = this.items.indexOf(item);
2057
- this.items.splice(idx1, 1);
2058
- this.items = [...this.items];
2059
- if (this.gridOption.type === 'local') {
2060
- (_a = editor === null || editor === void 0 ? void 0 : editor.onRemove) === null || _a === void 0 ? void 0 : _a.call(editor, item, this.localItems);
2061
- }
2062
- else {
2063
- (_b = editor === null || editor === void 0 ? void 0 : editor.onRemove) === null || _b === void 0 ? void 0 : _b.call(editor, item, this.items);
2064
- }
2065
- this.ref.detectChanges();
2066
- return;
2067
- }
2068
- };
2069
- this.add = (idx, item) => {
2070
- if (this.items.length > idx) {
2071
- this.items.splice(idx, 0, item);
2072
- this.items = [...this.items];
2073
- }
2074
- else {
2075
- this.items = [...this.items, item];
2076
- }
2077
- };
2078
- this.update = (idx, item) => {
2079
- if (this.items[idx]) {
2080
- Object.assign(this.items[idx], item);
2081
- this.items = [...this.items];
2082
- }
2083
- };
2084
- this.remove = (idx) => {
2085
- if (this.items[idx]) {
2086
- this.items.splice(idx, 1);
2087
- this.items = [...this.items];
2088
- }
2089
- };
2090
- this.refreshItem = (idx) => {
2091
- const item = this.items[idx];
2092
- this.editorHandlerColumnPipe.transform(item.sdVersion, item, this.gridOption);
2093
- };
2094
- this.detectChanges = () => this.ref.detectChanges();
2095
- }
2096
- set _gridFilter(gridFilter) {
2097
- if (gridFilter && this.gridFilter !== gridFilter) {
2098
- this.gridFilter = gridFilter;
2099
- __classPrivateFieldGet(this, _subscription$1).add(gridFilter.filterChange.pipe(debounceTime(200), map(() => {
2100
- __classPrivateFieldGet(this, _paginator).pageIndex = 0;
2101
- return __classPrivateFieldGet(this, _getFilter).call(this);
2102
- }), switchMap(filterInfo => __classPrivateFieldGet(this, _load$1).call(this, filterInfo, false))).subscribe(__classPrivateFieldGet(this, _render)));
2103
- }
2104
- }
2105
- set option(option) {
2106
- var _a;
2107
- if (option) {
2108
- option = __classPrivateFieldGet(this, _initConfiguration).call(this, option);
2109
- this.gridOption = option;
2110
- __classPrivateFieldGet(this, _optionChanges).emit();
2111
- (_a = option === null || option === void 0 ? void 0 : option.columns) === null || _a === void 0 ? void 0 : _a.forEach(col => {
2112
- var _a;
2113
- if ((_a = col.filter) === null || _a === void 0 ? void 0 : _a.default) {
2114
- this.columnFilter[col.field] = col.filter.default;
2115
- }
2116
- });
2117
- const configuration = this.gridConfigurationService.init(this.key, this.gridOption);
2118
- this.gridConfigurationObserver = configuration.observer;
2119
- configuration.load();
2120
- }
2121
- }
2122
- set paginator(paginator) {
2123
- if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
2124
- __classPrivateFieldSet(this, _paginator, paginator);
2125
- __classPrivateFieldGet(this, _subscription$1).add(paginator.page.pipe(debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(filterInfo => __classPrivateFieldGet(this, _load$1).call(this, filterInfo, false))).subscribe(__classPrivateFieldGet(this, _render)));
2126
- }
2127
- }
2128
- set sort(sort) {
2129
- if (sort && __classPrivateFieldGet(this, _sort) !== sort) {
2130
- __classPrivateFieldSet(this, _sort, sort);
2131
- __classPrivateFieldGet(this, _subscription$1).add(sort.sortChange.pipe(debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(filterInfo => __classPrivateFieldGet(this, _load$1).call(this, filterInfo, false))).subscribe(__classPrivateFieldGet(this, _render)));
2132
- }
2133
- }
2134
- ngOnInit() {
2135
- __classPrivateFieldGet(this, _initCellDef).call(this);
2136
- }
2137
- ngAfterViewInit() {
2138
- __classPrivateFieldGet(this, _subscription$1).add(this.sdCellDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initCellDef)));
2139
- __classPrivateFieldGet(this, _subscription$1).add(this.sdFooterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFooterDef)));
2140
- __classPrivateFieldGet(this, _subscription$1).add(this.sdFilterDefs.changes.pipe(startWith([])).subscribe(__classPrivateFieldGet(this, _initFilterDef)));
2141
- __classPrivateFieldGet(this, _subscription$1).add(__classPrivateFieldGet(this, _optionChanges).pipe(startWith({}), debounceTime(200), map(__classPrivateFieldGet(this, _getFilter)), switchMap(filterInfo => __classPrivateFieldGet(this, _load$1).call(this, filterInfo, true))).subscribe(__classPrivateFieldGet(this, _render)));
2142
- this.ref.detectChanges();
2143
- }
2144
- ngOnDestroy() {
2145
- __classPrivateFieldGet(this, _subscription$1).unsubscribe();
2146
- }
2147
- drop(event, columns) {
2148
- moveItemInArray(columns, event.previousIndex, event.currentIndex);
2149
- }
2150
- get editedItems() {
2151
- return this.items.filter(item => {
2152
- if (!item.originItem) {
2153
- return true;
2154
- }
2155
- if (Object.keys(item.originItem).some(key => item.originItem[key] !== item[key])) {
2156
- return true;
2157
- }
2158
- return false;
2159
- }).map(item => {
2160
- const { editorStatus, editorHandlerRow, editorHandlerColumn, editorErrorMessage, expandDetail, isExpanded, isExpanding, isSelected, originItem, sdId, sdVersion, selectable, actions, groupedActions, sdGroup, temporary } = item, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "editorErrorMessage", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "sdVersion", "selectable", "actions", "groupedActions", "sdGroup", "temporary"]);
2161
- return Object.assign(Object.assign({}, result), { editorErrorMessage });
2162
- });
2163
- }
2164
- get gridItems() {
2165
- return this.items.map(item => {
2166
- const { editorStatus, editorHandlerRow, editorHandlerColumn, expandDetail, isExpanded, isExpanding, isSelected, originItem, sdId, sdVersion, selectable, actions, groupedActions, sdGroup, temporary } = item, result = __rest(item, ["editorStatus", "editorHandlerRow", "editorHandlerColumn", "expandDetail", "isExpanded", "isExpanding", "isSelected", "originItem", "sdId", "sdVersion", "selectable", "actions", "groupedActions", "sdGroup", "temporary"]);
2167
- return result;
2168
- });
2169
- }
2170
- get isEditing() {
2171
- return this.items.some(e => e.editorStatus !== undefined);
2172
- }
2173
- }
2174
- _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap(), _optionChanges = new WeakMap(), _initCellDef = new WeakMap(), _initFilterDef = new WeakMap(), _initFooterDef = new WeakMap(), _filterExportInfo = new WeakMap(), _initConfiguration = new WeakMap(), _filterLocal = new WeakMap(), _getFilter = new WeakMap(), _load$1 = new WeakMap(), _render = new WeakMap(), _exportedItems = new WeakMap(), _allColumns = new WeakMap(), _allExportedColumns = new WeakMap(), _onExport = new WeakMap(), _updateSelectedItems = new WeakMap();
2175
- SdGridMaterial.decorators = [
2176
- { type: Component, args: [{
2177
- selector: 'sd-grid-material',
2178
- template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <ng-container *ngIf=\"items | sdGroup:gridOption; $implicit as groupedItems\">\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" sdScroll [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': gridOption?.minHeight\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"groupedItems\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdSubInformation?.templateRef\">\r\n <ng-container *ngIf=\"gridOption?.subInformation?.always;else useExpandCollapse\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #useExpandCollapse>\r\n <div [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding && !gridOption?.subInformation?.always\" mat-icon-button\r\n aria-label=\"Expand & Collapse\" (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll: gridOption?.selection | async\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </th>\r\n <td class=\"text-center px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <ng-container *ngIf=\"item | selectionVisible:gridOption?.selection\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 2px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0 position-relative\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <sd-desktop-editor-validation [sdId]=\"item.sdId\" [item]=\"item\" [items]=\"items\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-editor-validation>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; index as idx\">\r\n <ng-container *sdLet=\"item.editorStatus | sdEditorHandlerRow:item:gridOption as editorHandler\">\r\n <div *ngIf=\"editorHandler\" class=\"d-flex align-items-center justify-content-center\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onRemove(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.savable\" class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.cancelable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"!item?.sdGroup ? 1 : configuration.displayedColumns.length\">\r\n <div [innerHtml]=\"item?.sdGroup?.htmlTemplate | safeHtml\">\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-0\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" *ngIf=\"!item?.sdGroup\" [sdId]=\"item.sdId\" [key]=\"key\"\r\n [value]=\"item[column.field]\" [column]=\"column\" [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\"\r\n [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-0\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell class=\"d-block px-8\" [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\"\r\n [column]=\"column\" [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\"\r\n [class.selected]=\"row.isSelected\" [style]=\"row | sdStyleRowCss:gridOption\"></tr>\r\n\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']\" class=\"c-detail-row\"></tr>\r\n <ng-container *ngIf=\"hasFooter && configuration.displayedFooters?.length\">\r\n <tr mat-footer-row *matFooterRowDef=\"configuration.displayedFooters; sticky: true\"></tr>\r\n </ng-container>\r\n </table>\r\n <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 4px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button class=\"c-btn-add\"\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon-add\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdGroup\">\r\n <th mat-header-cell *matHeaderCellDef class=\"px-8 py-8\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\"\r\n [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [class.text-right]=\"column.align === 'right' || (!column.align && column.type === 'number')\"\r\n [class.text-center]=\"column.align === 'center'\" [innerHTML]=\"column.titleHtml || column.title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleExcelRaw !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportRaw()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel raw\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportCSV()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-grid-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\"\r\n (clear)=\"onClearSelection(groupedItems)\">\r\n </sd-grid-quick-action>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [configuration]=\"configuration\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>",
2179
- animations: [
2180
- trigger('detailExpand', [
2181
- state('collapsed', style({ height: '0', minHeight: '0', visibility: 'hidden' })),
2182
- state('expanded', style({ height: '*', visibility: 'visible' })),
2183
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
2184
- ]),
2185
- ],
2186
- styles: [".text-black400{color:#757575}:host{display:flex;flex-direction:column;height:100%;overflow:auto}:host .c-container{display:flex;flex:1;flex-direction:column;min-height:200px;position:relative}:host .c-container .c-table{flex:1;min-height:300px;position:relative}:host .c-container .c-table table{border-collapse:separate;width:100%}:host .c-container .c-table table tr.c-first-header.mat-header-row,:host .c-container .c-table table tr.c-second-header.mat-header-row{height:40px}:host .c-container .c-table table tr.c-detail-row{height:0}:host .c-container .c-table table tr.c-row.activated{background-color:#e5ecff}:host .c-container .c-table table tr.c-row.selected{background-color:#eef2ff}:host .c-container .c-table table tr.c-row:not(.selected):not(.activated):hover{background-color:#f5f5f5}:host .c-container .c-table table tr.c-row td{border-bottom-width:0}:host .c-container .c-table table tr.c-row.c-expandable{cursor:pointer}:host .c-container .c-table table tr.c-row.c-expandable:hover{background:#f5f5f5}:host .c-container .c-table table th.mat-header-cell{background-color:#f2f3f4;border-bottom:0!important}:host .c-container .c-table table td.mat-cell,:host .c-container .c-table table td.mat-footer-cell,:host .c-container .c-table table th.mat-header-cell{border-bottom-color:#f2f2f2!important}:host .c-container .c-table .c-th{color:#212121;font-size:14px;font-weight:500;line-height:20px;vertical-align:middle}:host .c-container .c-table .c-td:first{padding-left:10px}:host .c-container .c-loading{align-items:center;background:rgba(0,0,0,.15);bottom:56px;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:2}:host .c-container .c-paginator{align-items:center;background-color:#fff;display:flex;flex-direction:row;justify-content:space-between}:host .c-container .c-paginator .c-action{padding:5px}:host .c-container .c-empty{background-color:#fff;border:none!important;text-align:center}:host .c-container .c-empty mat-icon{font-size:150px;height:auto;margin-bottom:30px;margin-top:30px;opacity:.2;width:auto}:host button.c-btn-add{background-color:#fff;box-shadow:0 2px 4px rgba(47,49,54,.16)}:host mat-icon.c-icon{color:rgba(0,0,0,.54)!important}:host mat-icon.c-icon-add{color:#2962ff!important}:host .lds-ring{display:inline-block;height:40px;position:relative;width:40px}:host .lds-ring div{-webkit-animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border:4px solid transparent;border-radius:50%;border-top-color:#cef;box-sizing:border-box;display:block;height:32px;margin:4px;position:absolute;width:32px}:host .lds-ring div:first-child{-webkit-animation-delay:-.45s;animation-delay:-.45s}:host .lds-ring div:nth-child(2){-webkit-animation-delay:-.3s;animation-delay:-.3s}:host .lds-ring div:nth-child(3){-webkit-animation-delay:-.15s;animation-delay:-.15s}:host .style1 .mat-table{border:1px solid #dde0e5}:host .style1 .mat-table tr.mat-header-row{background:#f2f3f4}:host .style1 .mat-table th.mat-header-cell{padding:10px 0}:host .style1 .c-paginator{border:1px solid #dde0e5;border-top:none!important}:host .style1 .mat-form-field-wrapper{background:#fff;padding:0}@-webkit-keyframes lds-ring{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes lds-ring{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}:host ::ng-deep .mat-sort-header-content{display:block;text-align:left;width:100%}:host ::ng-deep .mat-select-arrow{color:#a6a6a6}:host ::ng-deep .mat-sort-header-disabled{background-image:none!important;cursor:default!important;padding-right:0!important}:host ::ng-deep .mat-sort-header-container{align-items:start!important}:host ::ng-deep .mat-sort-header-arrow{margin-top:4px!important}:host ::ng-deep .mat-sort-header{cursor:pointer}:host ::ng-deep .mat-sort-header[aria-sort]{background-position:center right 0;background-repeat:no-repeat;background-size:16px 16px;cursor:pointer;padding-right:24px}:host ::ng-deep .mat-sort-header[aria-sort=none]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\")}:host ::ng-deep .mat-sort-header[aria-sort=ascending]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\")}:host ::ng-deep .mat-sort-header[aria-sort=descending]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\")}"]
2187
- },] }
2188
- ];
2189
- SdGridMaterial.ctorParameters = () => [
2190
- { type: ChangeDetectorRef },
2191
- { type: undefined, decorators: [{ type: Inject, args: [GRID_MATERIAL_CONFIG,] }, { type: Optional }] },
2192
- { type: SdGridConfigurationService },
2193
- { type: SdExportService },
2194
- { type: SdNotifyService },
2195
- { type: SdTranslateService },
2196
- { type: SdColumnValuesPipe },
2197
- { type: SdEditorHandlerColumnPipe }
2198
- ];
2199
- SdGridMaterial.propDecorators = {
2200
- sdScroll: [{ type: ViewChild, args: [SdScrollDirective,] }],
2201
- quickAction: [{ type: ViewChild, args: [SdQuickAction,] }],
2202
- _gridFilter: [{ type: ViewChild, args: [SdGridFilter,] }],
2203
- option: [{ type: Input }],
2204
- paginator: [{ type: ViewChild, args: [MatPaginator,] }],
2205
- sort: [{ type: ViewChild, args: [MatSort,] }],
2206
- sdPopupExport: [{ type: ViewChild, args: [SdPopupExport,] }],
2207
- sdSubInformation: [{ type: ContentChild, args: [SdMaterialSubInformationDefDirective,] }],
2208
- sdEmptyData: [{ type: ContentChild, args: [SdMaterialEmptyDataDefDirective,] }],
2209
- sdCellDefs: [{ type: ContentChildren, args: [SdMaterialCellDefDirective,] }],
2210
- sdFooterDefs: [{ type: ContentChildren, args: [SdMaterialFooterDefDirective,] }],
2211
- sdFilterDefs: [{ type: ContentChildren, args: [SdMaterialFilterDefDirective,] }]
2212
- };
2213
-
2214
- class SdCommandFilterPipe {
2215
- transform(item, commands) {
2216
- return __awaiter(this, void 0, void 0, function* () {
2217
- const results = [];
2218
- if (!commands) {
2219
- return results;
2220
- }
2221
- for (const command of commands) {
2222
- let flag = false;
2223
- const { hidden } = command;
2224
- if (hidden === undefined) {
2225
- flag = true;
2226
- }
2227
- else if (typeof (hidden) === 'boolean') {
2228
- if (!hidden) {
2229
- flag = true;
2230
- }
2231
- }
2232
- else {
2233
- const isHidden = hidden(item);
2234
- if (isHidden instanceof Promise) {
2235
- if (!(yield isHidden)) {
2236
- flag = true;
2237
- }
2238
- }
2239
- else {
2240
- if (!isHidden) {
2241
- flag = true;
2242
- }
2243
- }
2244
- }
2245
- if (flag) {
2246
- if ('children' in command) {
2247
- const children = [];
2248
- for (const childCommand of command.children) {
2249
- const { hidden } = childCommand;
2250
- if (hidden === undefined) {
2251
- children.push(childCommand);
2252
- }
2253
- else if (typeof (hidden) === 'boolean') {
2254
- if (!hidden) {
2255
- children.push(childCommand);
2256
- }
2257
- }
2258
- else {
2259
- const isHidden = hidden(item);
2260
- if (isHidden instanceof Promise) {
2261
- if (!(yield isHidden)) {
2262
- children.push(childCommand);
2263
- }
2264
- }
2265
- else {
2266
- if (!isHidden) {
2267
- children.push(childCommand);
2268
- }
2269
- }
2270
- }
2271
- }
2272
- if (children.length > 0) {
2273
- results.push(Object.assign(Object.assign({}, command), { children }));
2274
- }
2275
- }
2276
- else {
2277
- results.push(command);
2278
- }
2279
- }
2280
- }
2281
- return results;
2282
- });
2283
- }
2284
- }
2285
- SdCommandFilterPipe.decorators = [
2286
- { type: Pipe, args: [{
2287
- name: 'commandFilter'
2288
- },] }
2289
- ];
2290
-
2291
- class SdCommandDisablePipe {
2292
- transform(item, command) {
2293
- if (!(command === null || command === void 0 ? void 0 : command.disabled)) {
2294
- return false;
2295
- }
2296
- if (typeof (command.disabled) === 'boolean') {
2297
- return command.disabled;
2298
- }
2299
- return command.disabled(item);
2300
- }
2301
- }
2302
- SdCommandDisablePipe.decorators = [
2303
- { type: Pipe, args: [{
2304
- name: 'commandDisable'
2305
- },] }
2306
- ];
2307
-
2308
- class SdCommandIconPipe {
2309
- transform(command, item) {
2310
- if (!(command === null || command === void 0 ? void 0 : command.icon)) {
2311
- return '';
2312
- }
2313
- if (typeof (command.icon) === 'string') {
2314
- return command.icon;
2315
- }
2316
- return command.icon(item);
2317
- }
2318
- }
2319
- SdCommandIconPipe.decorators = [
2320
- { type: Pipe, args: [{
2321
- name: 'commandIcon'
2322
- },] }
2323
- ];
2324
-
2325
- class SdCommandTitlePipe {
2326
- transform(command, item) {
2327
- if (!(command === null || command === void 0 ? void 0 : command.title)) {
2328
- return '';
2329
- }
2330
- if (typeof (command.title) === 'string') {
2331
- return command.title;
2332
- }
2333
- return command.title(item);
2334
- }
2335
- }
2336
- SdCommandTitlePipe.decorators = [
2337
- { type: Pipe, args: [{
2338
- name: 'commandTitle'
2339
- },] }
2340
- ];
2341
-
2342
- class SdColumnHtmlTemplatePipe {
2343
- constructor(deviceService) {
2344
- this.isMobileOrTablet = false;
2345
- this.isMobileOrTablet = !deviceService.isDesktop();
2346
- }
2347
- transform(value, rowData, column) {
2348
- if (typeof (column === null || column === void 0 ? void 0 : column.htmlTemplate) !== 'function') {
2349
- return value;
2350
- }
2351
- return column === null || column === void 0 ? void 0 : column.htmlTemplate(value, rowData, this.isMobileOrTablet);
2352
- }
2353
- }
2354
- SdColumnHtmlTemplatePipe.decorators = [
2355
- { type: Pipe, args: [{
2356
- name: 'columnHtmlTemplate'
2357
- },] }
2358
- ];
2359
- SdColumnHtmlTemplatePipe.ctorParameters = () => [
2360
- { type: DeviceDetectorService }
2361
- ];
2362
-
2363
- class SdDesktopCellView {
2364
- constructor() { }
2365
- }
2366
- SdDesktopCellView.decorators = [
2367
- { type: Component, args: [{
2368
- selector: 'sd-desktop-cell-view',
2369
- template: "<ng-container *ngIf=\"item[column.field] | cellView:item:column:gridOption:key | async as view\">\r\n <ng-container *ngIf=\"view.display.hasHtml;else useValue\">\r\n <div *ngIf=\"view.click\" (click)=\"view.click()\" class=\"text-break cursor-pointer\" [matTooltip]=\"view.tooltip\"\r\n [class.text-center]=\"view.display.align === 'center'\" [class.text-right]=\"view.display.align === 'right'\"\r\n [innerHTML]=\"view.display.html | safeHtml\">\r\n </div>\r\n <div *ngIf=\"!view.click\" class=\"text-break\" [matTooltip]=\"view.tooltip\"\r\n [class.text-center]=\"view.display.align === 'center'\" [class.text-right]=\"view.display.align === 'right'\"\r\n [innerHTML]=\"view.display.html | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useValue>\r\n <ng-container *ngIf=\"!!view.badge; else noBadge\">\r\n <sd-badge *ngIf=\"view.display.value\" [type]=\"view.badge.type\" [title]=\"view.display.value\" [color]=\"view.badge.color\"\r\n [icon]=\"view.badge.icon\" [tooltip]=\"view.tooltip\" (sdClick)=\"!!view.click && view.click()\"></sd-badge>\r\n </ng-container>\r\n <ng-template #noBadge>\r\n <ng-container *ngIf=\"column.type !== 'children'; else childrenView\">\r\n <div *ngIf=\"column.type !== 'image'\" class=\"text-break\" [class.text-center]=\"view.display.align === 'center'\"\r\n [class.text-right]=\"view.display.align === 'right'\" [matTooltip]=\"view.tooltip\">\r\n <a *ngIf=\"!!view.click\" href=\"javascript:;\" (click)=\"view.click()\">{{view.display.value}}</a>\r\n <ng-container *ngIf=\"!view.click\">{{view.display.value}}\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'image'\" class=\"align-middle text-center\">\r\n <img *ngIf=\"view.display.value\" [src]=\"view.display.value\" [width]=\"column.option?.width\"\r\n [height]=\"column.option?.height\" class=\"c-image\" (click)=\"!!view.click && view.click()\"\r\n [class.cursor-pointer]=\"!!view.click\">\r\n <mat-icon *ngIf=\"!view.display.value\" class=\"c-img\" [class.cursor-pointer]=\"!!view.click\"\r\n (click)=\"!!view.click && view.click()\">\r\n image</mat-icon>\r\n </div>\r\n </ng-container>\r\n <ng-template #childrenView>\r\n <sd-desktop-cell-children-view [key]=\"key\" [item]=\"item\" [column]=\"column\">\r\n </sd-desktop-cell-children-view>\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n</ng-container>",
2370
- changeDetection: ChangeDetectionStrategy.OnPush,
2371
- styles: [".text-black400{color:#757575}.c-color-success{color:#4caf50}.c-color-danger{color:#f82c13}.c-image{-o-object-fit:contain;margin:5px 0;object-fit:contain}.c-img{font-size:30px;opacity:.5}.c-img.pointer:hover{opacity:.9}"]
2372
- },] }
2373
- ];
2374
- SdDesktopCellView.ctorParameters = () => [];
2375
- SdDesktopCellView.propDecorators = {
2376
- sdId: [{ type: Input }],
2377
- key: [{ type: Input }],
2378
- column: [{ type: Input }],
2379
- item: [{ type: Input }],
2380
- gridOption: [{ type: Input }]
2381
- };
2382
-
2383
- class SdColumnTransformPipe {
2384
- constructor(columnValuesPipe) {
2385
- this.columnValuesPipe = columnValuesPipe;
2386
- }
2387
- transform(value, rowData, column, key) {
2388
- var _a, _b;
2389
- return __awaiter(this, void 0, void 0, function* () {
2390
- if (column === null || column === void 0 ? void 0 : column.transform) {
2391
- return column.transform(value, rowData);
2392
- }
2393
- if (column.type === 'values') {
2394
- return yield this.columnValuesPipe.transform(value, column);
2395
- }
2396
- if (column.type === 'number' && Number.isNumber(value)) {
2397
- return Number.toVNCurrency(value); // this.decimalPipe.transform(value, '1.0-2');
2398
- }
2399
- if (column.type === 'bool') {
2400
- return value === true ? (((_a = column.option) === null || _a === void 0 ? void 0 : _a.displayOnTrue) || 'True') : (((_b = column.option) === null || _b === void 0 ? void 0 : _b.displayOnFalse) || 'False');
2401
- }
2402
- return value;
2403
- });
2404
- }
2405
- }
2406
- SdColumnTransformPipe.decorators = [
2407
- { type: Pipe, args: [{
2408
- name: 'columnTransform'
2409
- },] }
2410
- ];
2411
- SdColumnTransformPipe.ctorParameters = () => [
2412
- { type: SdColumnValuesPipe }
2413
- ];
2414
-
2415
- class SdFilterExternalPipe {
2416
- transform(externalFilters, field) {
2417
- const results = [];
2418
- if (!externalFilters) {
2419
- return results;
2420
- }
2421
- for (const filter of externalFilters) {
2422
- results.push(filter);
2423
- }
2424
- return results.filter(e => !field || e.field === field);
2425
- }
2426
- }
2427
- SdFilterExternalPipe.decorators = [
2428
- { type: Pipe, args: [{
2429
- name: 'sdFilterExternal'
2430
- },] }
2431
- ];
2432
-
2433
- class SdFilterColumnPipe {
2434
- transform(columns, field) {
2435
- var _a, _b;
2436
- const results = [];
2437
- if (!columns) {
2438
- return results;
2439
- }
2440
- for (const column of columns) {
2441
- if (column.type === 'image') {
2442
- continue;
2443
- }
2444
- if (column.type === 'children') {
2445
- for (const columnChildren of column === null || column === void 0 ? void 0 : column.children) {
2446
- if (!((_a = columnChildren.filter) === null || _a === void 0 ? void 0 : _a.disabled)) {
2447
- results.push(columnChildren);
2448
- }
2449
- }
2450
- continue;
2451
- }
2452
- if (!((_b = column.filter) === null || _b === void 0 ? void 0 : _b.disabled)) {
2453
- results.push(column);
2454
- }
2455
- }
2456
- return results.filter(e => !field || e.field === field);
2457
- }
2458
- }
2459
- SdFilterColumnPipe.decorators = [
2460
- { type: Pipe, args: [{
2461
- name: 'sdFilterColumn'
2462
- },] }
2463
- ];
2464
-
2465
- class SdDesktopCellChildrenView {
2466
- constructor() { }
2467
- }
2468
- SdDesktopCellChildrenView.decorators = [
2469
- { type: Component, args: [{
2470
- selector: 'sd-desktop-cell-children-view',
2471
- template: "<ng-container *ngIf=\"column.children?.length\">\r\n <div class=\"row mx-0\">\r\n <div *ngFor=\"let childColumn of column.children | columnChildrenFilter:item\" class=\"px-2\"\r\n [ngClass]=\"{'col-6': childColumn?.colSpan === 1, 'col-12': !childColumn?.colSpan || childColumn?.colSpan === 2}\">\r\n <span class=\"c-title\">\r\n {{item | columnTitle:childColumn | async}}:\r\n </span>\r\n <ng-container *ngIf=\"childColumn.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"\r\n style=\"display:inline-block ;overflow-wrap: break-word;\" [ngClass]=\"{'cursor-pointer':childColumn.click}\"\r\n [innerHTML]=\"(item[childColumn.field] | columnHtmlTemplate:item:childColumn) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <span *ngIf=\"childColumn.type === 'string'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'number'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n columnTransform:item:childColumn | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | columnTransform:item:childColumn | async}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy HH:mm'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'date'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy'\">{{item[childColumn.field] |\r\n sdTimeDifferent:'dd/MM/yyyy':childColumn.option?.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'time'\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'HH:mm'}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'bool'\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n <strong *ngIf=\"item[childColumn.field]\" class=\"text-success\">{{childColumn.option?.displayOnTrue ||\r\n 'True'}}</strong>\r\n <strong *ngIf=\"!item[childColumn.field]\" class=\"text-danger\">{{childColumn.option?.displayOnFalse ||\r\n 'False'}}</strong>\r\n </span>\r\n <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n <ng-container *ngIf=\"childColumn.transform\">{{item[childColumn.field] | columnTransform:item:childColumn | async}}</ng-container>\r\n <ng-container *ngIf=\"!childColumn.transform\">\r\n {{item[childColumn.field] | columnValues:childColumn | async}}\r\n <!-- <ng-container *ngIf=\"item[childColumn.field] | columnValues:childColumn | async; $implicit as valueData\">\r\n <div\r\n *ngIf=\"valueData[childColumn.option?.colorField] || valueData[childColumn.option?.backgroundColorField]; else elseNoStatus\"\r\n [ngStyle]=\"{'color':valueData[childColumn.option?.colorField], 'background-color': valueData[childColumn.option?.backgroundColorField]}\">\r\n {{valueData[childColumn.option?.displayField]}}\r\n </div>\r\n <ng-template #elseNoStatus>\r\n {{valueData[childColumn.option?.displayField]}}\r\n </ng-template>\r\n </ng-container> -->\r\n </ng-container>\r\n \r\n </ng-container>\r\n <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field] | columnTransform:item:childColumn | async\" [width]=\"childColumn.display?.width\"\r\n [height]=\"childColumn.display?.height\" style=\"margin: 5px 0\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n</ng-container>",
2472
- styles: [".c-title{color:#212529;font-size:13px;font-weight:700;line-height:1.7;margin-right:3px}.c-children{color:#212529;font-size:14px;overflow-wrap:break-word}"]
2473
- },] }
2474
- ];
2475
- SdDesktopCellChildrenView.ctorParameters = () => [];
2476
- SdDesktopCellChildrenView.propDecorators = {
2477
- key: [{ type: Input }],
2478
- column: [{ type: Input }],
2479
- item: [{ type: Input }]
2480
- };
2481
-
2482
- var _isMobileOrTablet;
2483
- class SdColumnChildrenFilterPipe {
2484
- constructor(deviceService) {
2485
- _isMobileOrTablet.set(this, false);
2486
- __classPrivateFieldSet(this, _isMobileOrTablet, !deviceService.isDesktop());
2487
- }
2488
- transform(columns, item) {
2489
- return columns.filter(column => {
2490
- var _a, _b;
2491
- const value = item === null || item === void 0 ? void 0 : item[column.field];
2492
- const transformValue = (_a = column.transform) === null || _a === void 0 ? void 0 : _a.call(column, item[column.field], item);
2493
- const templateValue = (_b = column.htmlTemplate) === null || _b === void 0 ? void 0 : _b.call(column, item[column.field], item, __classPrivateFieldGet(this, _isMobileOrTablet));
2494
- return (value !== undefined && value !== null && value !== '')
2495
- || (transformValue !== undefined && transformValue !== null && transformValue !== '')
2496
- || (templateValue !== undefined && templateValue !== null && templateValue !== '');
2497
- });
2498
- }
2499
- }
2500
- _isMobileOrTablet = new WeakMap();
2501
- SdColumnChildrenFilterPipe.decorators = [
2502
- { type: Pipe, args: [{
2503
- name: 'columnChildrenFilter'
2504
- },] }
2505
- ];
2506
- SdColumnChildrenFilterPipe.ctorParameters = () => [
2507
- { type: DeviceDetectorService }
2508
- ];
2509
-
2510
- class SdColumnTitlePipe {
2511
- transform(item, column) {
2512
- var _a;
2513
- return __awaiter(this, void 0, void 0, function* () {
2514
- if (!(column === null || column === void 0 ? void 0 : column.title)) {
2515
- return '';
2516
- }
2517
- const result = (_a = column === null || column === void 0 ? void 0 : column.dynamicTitle) === null || _a === void 0 ? void 0 : _a.call(column, item);
2518
- if (result instanceof Promise) {
2519
- return (yield result) || (column === null || column === void 0 ? void 0 : column.title);
2520
- }
2521
- return result || (column === null || column === void 0 ? void 0 : column.title);
2522
- });
2523
- }
2524
- }
2525
- SdColumnTitlePipe.decorators = [
2526
- { type: Pipe, args: [{
2527
- name: 'columnTitle'
2528
- },] }
2529
- ];
2530
-
2531
- class SdDesktopCommand {
2532
- constructor() {
2533
- this.commands = [];
2534
- }
2535
- }
2536
- SdDesktopCommand.decorators = [
2537
- { type: Component, args: [{
2538
- selector: 'sd-desktop-command',
2539
- template: "<ng-container *ngIf=\"item | commandFilter:commands | async; $implicit as filteredCommands\">\r\n <ng-container *ngFor=\"let command of filteredCommands\">\r\n <ng-container *ngIf=\"command?.click; else elseChildren\">\r\n <button (click)=\"command.click(item)\" [matTooltip]=\"command | commandTitle:item\" aria-hidden=\"true\"\r\n [disabled]=\"item | commandDisable:command\" mat-icon-button>\r\n <mat-icon class=\"c-icon\" [fontSet]=\"command.fontSet\">{{command | commandIcon:item}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-template #elseChildren>\r\n <button [matMenuTriggerFor]=\"menu\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon *ngIf=\"command?.icon\" class=\"c-icon\" [fontSet]=\"command.fontSet\">{{command | commandIcon:item}}\r\n </mat-icon>\r\n <mat-icon *ngIf=\"!command?.icon\" class=\"c-icon\">more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <span>\r\n <button *ngFor=\"let childCommand of command.children\" mat-menu-item (click)=\"childCommand.click(item)\"\r\n [disabled]=\"item | commandDisable:childCommand\">\r\n <ng-container *ngIf=\"!childCommand.htmlTemplate\">\r\n <mat-icon [fontSet]=\"command.fontSet\" class=\"c-icon\">{{childCommand | commandIcon:item}}\r\n </mat-icon>\r\n <span> {{childCommand | commandTitle:item}}</span>\r\n </ng-container>\r\n <ng-container *ngIf=\"childCommand.htmlTemplate\">\r\n <div [innerHTML]=\"childCommand.htmlTemplate(item)\"></div>\r\n </ng-container>\r\n </button>\r\n </span>\r\n </mat-menu>\r\n </ng-template>\r\n </ng-container>\r\n</ng-container>\r\n",
2540
- changeDetection: ChangeDetectionStrategy.OnPush,
2541
- styles: [":host{align-items:center;display:flex}mat-icon.c-icon{color:rgba(0,0,0,.54)!important}"]
2542
- },] }
2543
- ];
2544
- SdDesktopCommand.ctorParameters = () => [];
2545
- SdDesktopCommand.propDecorators = {
2546
- item: [{ type: Input }],
2547
- commands: [{ type: Input }]
2548
- };
2549
-
2550
- class SdColumnBadgePipe {
2551
- constructor() { }
2552
- transform(value, rowData, column) {
2553
- var _a, _b, _c;
2554
- if (column.type === 'string' && (column === null || column === void 0 ? void 0 : column.badge)) {
2555
- return {
2556
- type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
2557
- color: column.badge(value, rowData),
2558
- icon: (_a = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _a === void 0 ? void 0 : _a.call(column, value, rowData)
2559
- };
2560
- }
2561
- if (column.type === 'number' && (column === null || column === void 0 ? void 0 : column.badge)) {
2562
- return {
2563
- type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
2564
- color: column.badge(value, rowData),
2565
- icon: (_b = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _b === void 0 ? void 0 : _b.call(column, value, rowData)
2566
- };
2567
- }
2568
- if (column.type === 'bool') {
2569
- return {
2570
- type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
2571
- color: !!value ? 'success' : 'danger',
2572
- icon: null
2573
- };
2574
- }
2575
- if (column.type === 'values' && (column === null || column === void 0 ? void 0 : column.badge)) {
2576
- return {
2577
- type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
2578
- color: column.badge(value, rowData),
2579
- icon: (_c = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _c === void 0 ? void 0 : _c.call(column, value, rowData)
2580
- };
2581
- }
2582
- return null;
2583
- }
2584
- }
2585
- SdColumnBadgePipe.decorators = [
2586
- { type: Pipe, args: [{
2587
- name: 'columnBadge'
2588
- },] }
2589
- ];
2590
- SdColumnBadgePipe.ctorParameters = () => [];
2591
-
2592
- class SdGridConfigurationResultPipe {
2593
- constructor(gridConfigurationService) {
2594
- this.gridConfigurationService = gridConfigurationService;
2595
- }
2596
- transform(configuration, gridOption, sdSubInformation) {
2597
- return this.gridConfigurationService.generateConfigurationResult(configuration, gridOption, sdSubInformation);
2598
- }
2599
- }
2600
- SdGridConfigurationResultPipe.decorators = [
2601
- { type: Pipe, args: [{
2602
- name: 'sdGridConfigurationResult'
2603
- },] }
2604
- ];
2605
- SdGridConfigurationResultPipe.ctorParameters = () => [
2606
- { type: SdGridConfigurationService }
2607
- ];
2608
-
2609
- var _cache$2;
2610
- class SdPopupGridConfiguration {
2611
- constructor(ref, notifyService, translateService, gridConfigurationService) {
2612
- this.ref = ref;
2613
- this.notifyService = notifyService;
2614
- this.translateService = translateService;
2615
- this.gridConfigurationService = gridConfigurationService;
2616
- this.changes = new EventEmitter();
2617
- _cache$2.set(this, void 0);
2618
- this.isCreatingColumn = false;
2619
- this.selected = {};
2620
- this.disabledDrag = true;
2621
- this.open = () => __awaiter(this, void 0, void 0, function* () {
2622
- __classPrivateFieldSet(this, _cache$2, this.gridConfigurationService.init(this.key, this.gridOption));
2623
- this.configuration = yield __classPrivateFieldGet(this, _cache$2).get();
2624
- this.modal.open();
2625
- });
2626
- this.onSave = () => {
2627
- __classPrivateFieldGet(this, _cache$2).set(this.configuration);
2628
- this.modal.close();
2629
- this.ref.detectChanges();
2630
- };
2631
- this.onReset = () => __awaiter(this, void 0, void 0, function* () {
2632
- const { translate } = this.translateService;
2633
- this.notifyService.confirm(translate('Reset grid configuration to default')).then(() => {
2634
- __classPrivateFieldGet(this, _cache$2).remove();
2635
- this.modal.close();
2636
- this.ref.detectChanges();
2637
- });
2638
- });
2639
- this.createColumn = () => __awaiter(this, void 0, void 0, function* () {
2640
- this.selected = {};
2641
- this.isCreatingColumn = true;
2642
- });
2643
- this.confirm = () => __awaiter(this, void 0, void 0, function* () {
2644
- const generatedColumn = {
2645
- origin: {
2646
- field: v4(),
2647
- title: 'Generated',
2648
- width: '300px'
2649
- },
2650
- fixed: false,
2651
- invisible: false,
2652
- title: 'Generated',
2653
- width: '300px',
2654
- isGeneratedColumn: true,
2655
- generatedColumns: this.configuration.columns.filter(e => { var _a; return this.selected[(_a = e.origin) === null || _a === void 0 ? void 0 : _a.field]; }).map(e => { var _a; return (_a = e.origin) === null || _a === void 0 ? void 0 : _a.field; })
2656
- };
2657
- this.configuration.columns.push(generatedColumn);
2658
- this.configuration = __classPrivateFieldGet(this, _cache$2).set(this.configuration);
2659
- this.isCreatingColumn = false;
2660
- });
2661
- }
2662
- ngOnInit() {
2663
- }
2664
- mouseUp(event) {
2665
- this.disabledDrag = true;
2666
- }
2667
- dropTable(event) {
2668
- moveItemInArray(this.configuration.columns, event.previousIndex, event.currentIndex);
2669
- this.table.renderRows();
2670
- }
2671
- handleMouseDown() {
2672
- this.disabledDrag = false;
2673
- }
2674
- handleMouseUp() {
2675
- this.disabledDrag = true;
2676
- }
2677
- }
2678
- _cache$2 = new WeakMap();
2679
- SdPopupGridConfiguration.decorators = [
2680
- { type: Component, args: [{
2681
- selector: 'sd-popup-grid-configuration',
2682
- template: "<sd-modal width=\"sm\" [title]=\"'Configuration' | sdTranslate\" #modal>\r\n <sd-modal-body *ngIf=\"configuration\">\r\n <div *ngIf=\"!isCreatingColumn\" class=\"c-container\">\r\n <div class=\"c-table\" style=\"max-height:70vh\">\r\n <table #table mat-table [dataSource]=\"configuration.columns\"\r\n cdkDropList\r\n [cdkDropListData]=\"configuration.columns\"\r\n (cdkDropListDropped)=\"dropTable($event)\">\r\n >\r\n <ng-container matColumnDef=\"stt\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:50px\">#\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item; let idx = index\">\r\n <div class=\"c-handle\" (mousedown) = \"handleMouseDown()\" (mouseup)=\"handleMouseUp()\">\r\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z\"></path>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\r\n </svg>\r\n </div>\r\n\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"title\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef>{{'Title' | sdTranslate}}\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n <sd-input [placeholder]=\"item?.origin?.title\" [(model)]=\"item.title\" disableErrorMessage></sd-input>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"width\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef style=\"width:80px\">{{'Width' | sdTranslate}}\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n <!-- <span>{{item.width}}</span>\r\n <mat-slider\r\n step=\"1\"\r\n min=\"0\"\r\n [max]=\"+item?.origin?.width*3\"\r\n [(ngModel)]=\"+item.width\"\r\n aria-label=\"units\">\r\n </mat-slider> -->\r\n <sd-input [placeholder]=\"item?.origin?.width\" [(model)]=\"item.width\" disableErrorMessage></sd-input>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"invisible\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:80px\">{{'Hidden' |\r\n sdTranslate}}\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item;\">\r\n <mat-slide-toggle [(ngModel)]=\"item.invisible\" color=\"primary\">\r\n </mat-slide-toggle>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"fixed\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:80px\">{{'Freeze' |\r\n sdTranslate}}\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item;\">\r\n <mat-slide-toggle [(ngModel)]=\"item.fixed\" color=\"primary\"></mat-slide-toggle>\r\n </td>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\"['stt', 'title', 'width', 'invisible', 'fixed']; sticky: true\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['stt', 'title', 'width', 'invisible', 'fixed'];\" cdkDrag [cdkDragData]=\"row\" cdkDragLockAxis=\"y\" [cdkDragDisabled] = \"disabledDrag\"></tr>\r\n </table>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isCreatingColumn\">\r\n <div class=\"c-table\" style=\"max-height:50vh\">\r\n <table mat-table [dataSource]=\"configuration.columns\">\r\n <ng-container matColumnDef=\"stt\">\r\n <th mat-header-cell class=\"c-th text-center px-5\" *matHeaderCellDef style=\"width:50px\">#\r\n </th>\r\n <td class=\"text-center px-5\" mat-cell *matCellDef=\"let item; let idx = index\">\r\n <sd-checkbox *ngIf=\"isCreatingColumn\" [(model)]=\"selected[item.origin?.field]\"></sd-checkbox>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"title\">\r\n <th mat-header-cell class=\"c-th px-5\" *matHeaderCellDef>{{'Title' | sdTranslate}}\r\n </th>\r\n <td class=\"px-5\" mat-cell *matCellDef=\"let item;\">\r\n <span *ngIf=\"isCreatingColumn\">{{item.title || item?.origin?.title}}</span>\r\n </td>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\"['stt', 'title']; sticky: true\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['stt', 'title'];\"></tr>\r\n </table>\r\n </div>\r\n </div>\r\n </sd-modal-body>\r\n <sd-modal-footer>\r\n <ng-container *ngIf=\"!isCreatingColumn\">\r\n <!-- <sd-button class=\"mr-auto\" (action)=\"createColumn()\" [title]=\"'Create column' | sdTranslate\" color=\"info\"\r\n size=\"sm\">\r\n </sd-button> -->\r\n <sd-button class=\"mr-5\" (action)=\"onReset()\" [title]=\"'Default' | sdTranslate\" color=\"info\" size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"onSave()\" [title]=\"'Save' | sdTranslate\" type=\"fill\" color=\"info\" size=\"sm\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-container *ngIf=\"isCreatingColumn\">\r\n <sd-button class=\"mr-auto\" (action)=\"isCreatingColumn = false\" [title]=\"'Cancel' | sdTranslate\" color=\"info\"\r\n size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"confirm()\" [title]=\"'Confirm' | sdTranslate\" type=\"fill\" color=\"info\" size=\"sm\">\r\n </sd-button>\r\n </ng-container>\r\n </sd-modal-footer>\r\n</sd-modal>",
2683
- styles: [".c-table{overflow:auto;position:relative}.c-table table{width:100%}.c-table .c-th{color:#000;font-size:14px;font-weight:500;line-height:20px}.c-container{min-height:200px;position:relative}.c-handle{color:#ccc;cursor:move}"]
2684
- },] }
2685
- ];
2686
- SdPopupGridConfiguration.ctorParameters = () => [
2687
- { type: ChangeDetectorRef },
2688
- { type: SdNotifyService },
2689
- { type: SdTranslateService },
2690
- { type: SdGridConfigurationService }
2691
- ];
2692
- SdPopupGridConfiguration.propDecorators = {
2693
- gridOption: [{ type: Input }],
2694
- key: [{ type: Input }],
2695
- modal: [{ type: ViewChild, args: ['modal',] }],
2696
- table: [{ type: ViewChild, args: ['table',] }],
2697
- mouseUp: [{ type: HostListener, args: ['window:mouseup', ['$event'],] }]
2698
- };
2699
-
2700
- class SdColumnTooltipPipe {
2701
- constructor() { }
2702
- transform(value, rowData, column) {
2703
- if (column === null || column === void 0 ? void 0 : column.tooltip) {
2704
- return column.tooltip(value, rowData);
2705
- }
2706
- return null;
2707
- }
2708
- }
2709
- SdColumnTooltipPipe.decorators = [
2710
- { type: Pipe, args: [{
2711
- name: 'columnTooltip'
2712
- },] }
2713
- ];
2714
- SdColumnTooltipPipe.ctorParameters = () => [];
2715
-
2716
- var _convert;
2717
- class SdSelectionActionFilterPipe {
2718
- constructor() {
2719
- _convert.set(this, (action) => {
2720
- if ('children' in action) {
2721
- return {
2722
- title: action.title,
2723
- icon: action.icon,
2724
- fontSet: action.fontSet,
2725
- tooltip: action.tooltip,
2726
- color: action.color,
2727
- type: action.type,
2728
- children: action.children.map(e => ({
2729
- title: e.title,
2730
- icon: e.icon,
2731
- color: action.color,
2732
- type: action.type,
2733
- fontSet: e.fontSet,
2734
- tooltip: e.tooltip,
2735
- click: e.click
2736
- }))
2737
- };
2738
- }
2739
- return {
2740
- title: action.title,
2741
- icon: action.icon,
2742
- color: action.color,
2743
- type: action.type,
2744
- fontSet: action.fontSet,
2745
- tooltip: action.tooltip,
2746
- click: action.click
2747
- };
2748
- });
2749
- this.transform = (selectedItems, actions) => {
2750
- const results = [];
2751
- if (!(actions === null || actions === void 0 ? void 0 : actions.length) || !(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length)) {
2752
- return [];
2753
- }
2754
- for (const action of actions) {
2755
- if ('children' in action) {
2756
- const children = [];
2757
- for (const childAction of action.children) {
2758
- const key = hash(childAction);
2759
- if (selectedItems.every(e => e.actions.includes(key))) {
2760
- children.push(childAction);
2761
- }
2762
- }
2763
- if (children.length > 0) {
2764
- results.push(Object.assign(Object.assign({}, action), { children }));
2765
- }
2766
- }
2767
- else {
2768
- const key = hash(action);
2769
- if (selectedItems.every(e => e.actions.includes(key))) {
2770
- results.push(action);
2771
- }
2772
- }
2773
- }
2774
- return results.map(result => __classPrivateFieldGet(this, _convert).call(this, result));
2775
- };
2776
- }
2777
- }
2778
- _convert = new WeakMap();
2779
- SdSelectionActionFilterPipe.decorators = [
2780
- { type: Pipe, args: [{
2781
- name: 'selectionActionFilter'
2782
- },] }
2783
- ];
2784
-
2785
- class SdSelectionDisablePipe {
2786
- constructor() {
2787
- this.transform = (selectedItems, rowData, selection) => {
2788
- const { disabled, actions } = selection;
2789
- if (!(actions === null || actions === void 0 ? void 0 : actions.length)) {
2790
- if (!disabled) {
2791
- rowData.selectable = true;
2792
- return false;
2793
- }
2794
- rowData.selectable = !disabled(rowData, selectedItems);
2795
- return !rowData.selectable;
2796
- }
2797
- // Lọc các action theo selectedItems hiện tại
2798
- const availableActions = actions.filter(action => {
2799
- if ('children' in action) {
2800
- for (const childAction of action.children) {
2801
- const key = hash(childAction);
2802
- if (selectedItems.every(e => e.actions.includes(key))) {
2803
- return true;
2804
- }
2805
- }
2806
- return false;
2807
- }
2808
- else {
2809
- const key = hash(action);
2810
- return selectedItems.every(e => e.actions.includes(key));
2811
- }
2812
- });
2813
- // Kiểm tra rowData có action nào thỏa hay ko, nếu ko thì disabled
2814
- for (const action of availableActions) {
2815
- if ('children' in action) {
2816
- for (const childAction of action.children) {
2817
- if (rowData.actions.includes(hash(childAction))) {
2818
- return false;
2819
- }
2820
- }
2821
- }
2822
- else {
2823
- if (rowData.actions.includes(hash(action))) {
2824
- return false;
2825
- }
2826
- }
2827
- }
2828
- return true;
2829
- };
2830
- }
2831
- }
2832
- SdSelectionDisablePipe.decorators = [
2833
- { type: Pipe, args: [{
2834
- name: 'selectionDisable'
2835
- },] }
2836
- ];
2837
-
2838
- class SdSelectionVisibleSelectAllPipe {
2839
- constructor() {
2840
- this.transform = (items, selection) => __awaiter(this, void 0, void 0, function* () {
2841
- const { actions } = selection;
2842
- if (!(actions === null || actions === void 0 ? void 0 : actions.length)) {
2843
- return true;
2844
- }
2845
- if (!items.length) {
2846
- return false;
2847
- }
2848
- if (actions.some(e => ('children' in e && e.children.some(e1 => e1.isGrouped)) || e.isGrouped)) {
2849
- return false;
2850
- }
2851
- yield new Promise(resolve => setTimeout(resolve, 500));
2852
- const first = items.find(t => { var _a; return (_a = t.actions) === null || _a === void 0 ? void 0 : _a.length; });
2853
- if (first) {
2854
- for (const action of first.actions) {
2855
- if (items.filter(t => { var _a; return (_a = t.actions) === null || _a === void 0 ? void 0 : _a.length; }).every(e => e.actions.includes(action))) {
2856
- return true;
2857
- }
2858
- }
2859
- }
2860
- return false;
2861
- });
2862
- }
2863
- }
2864
- SdSelectionVisibleSelectAllPipe.decorators = [
2865
- { type: Pipe, args: [{
2866
- name: 'selectionVisibleSelectAll'
2867
- },] }
2868
- ];
2869
-
2870
- var _cache$3;
2871
- class SdGeneratedColumnService {
2872
- constructor(settingService) {
2873
- this.settingService = settingService;
2874
- _cache$3.set(this, {});
2875
- this.load = (configuration) => {
2876
- if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
2877
- return null;
2878
- }
2879
- const key = hash({
2880
- prefix: '260f5e94-5865-4425-8ced-b9c083c390dd',
2881
- key: configuration.key
2882
- });
2883
- if (!__classPrivateFieldGet(this, _cache$3)[key]) {
2884
- if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
2885
- __classPrivateFieldGet(this, _cache$3)[key] = this.settingService.createServer(key, {
2886
- args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
2887
- default: []
2888
- });
2889
- }
2890
- else {
2891
- __classPrivateFieldGet(this, _cache$3)[key] = this.settingService.create(key, {
2892
- type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
2893
- args: configuration === null || configuration === void 0 ? void 0 : configuration.args,
2894
- default: []
2895
- });
2896
- }
2897
- }
2898
- return __classPrivateFieldGet(this, _cache$3)[key];
2899
- };
2900
- this.loadSystem = (configuration) => {
2901
- var _a, _b;
2902
- if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
2903
- return null;
2904
- }
2905
- if (!(configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn)) {
2906
- return null;
2907
- }
2908
- const key = hash({
2909
- prefix: '8b8050ca-1f44-4860-bad3-20e646c0d68f',
2910
- key: configuration.key
2911
- });
2912
- if (!__classPrivateFieldGet(this, _cache$3)[key]) {
2913
- if ((configuration === null || configuration === void 0 ? void 0 : configuration.storage) === 'server') {
2914
- __classPrivateFieldGet(this, _cache$3)[key] = this.settingService.createServer(key, {
2915
- args: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _a === void 0 ? void 0 : _a.args,
2916
- default: []
2917
- });
2918
- }
2919
- else {
2920
- __classPrivateFieldGet(this, _cache$3)[key] = this.settingService.create(key, {
2921
- type: configuration === null || configuration === void 0 ? void 0 : configuration.storage,
2922
- args: (_b = configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn) === null || _b === void 0 ? void 0 : _b.args,
2923
- default: []
2924
- });
2925
- }
2926
- }
2927
- return __classPrivateFieldGet(this, _cache$3)[key];
2928
- };
2929
- }
2930
- }
2931
- _cache$3 = new WeakMap();
2932
- SdGeneratedColumnService.decorators = [
2933
- { type: Injectable }
2934
- ];
2935
- SdGeneratedColumnService.ctorParameters = () => [
2936
- { type: SdSettingService }
2937
- ];
2938
-
2939
- var _subscription$2;
2940
- class SdDynamicColumn {
2941
- constructor(ref, generatedColumnService, notifyService, translateService, gridConfigurationService) {
2942
- this.ref = ref;
2943
- this.generatedColumnService = generatedColumnService;
2944
- this.notifyService = notifyService;
2945
- this.translateService = translateService;
2946
- this.gridConfigurationService = gridConfigurationService;
2947
- _subscription$2.set(this, new Subscription());
2948
- this.columnTypes = ['string', 'number', 'bool', 'date', 'datetime', 'time', 'values', 'children', 'children-col'];
2949
- this.form = new FormGroup({});
2950
- this.isDetail = false;
2951
- this.originColumns = [];
2952
- this.onDetail = (column) => {
2953
- this.detail = column || {
2954
- field: v4(),
2955
- title: '',
2956
- type: 'string',
2957
- isSystem: false,
2958
- useTemplate: false
2959
- };
2960
- this.form.markAsUntouched();
2961
- this.form.markAsPristine();
2962
- this.isDetail = true;
2963
- };
2964
- this.onSave = () => {
2965
- var _a;
2966
- const systemSetting = this.generatedColumnService.loadSystem(this.gridOption.config);
2967
- const setting = this.generatedColumnService.load((_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.config);
2968
- if (this.detail.isSystem) {
2969
- if (!this.detail.id) {
2970
- systemSetting.set([...this.systemColumns, Object.assign(Object.assign({}, this.detail), { id: v4() })]);
2971
- }
2972
- else {
2973
- systemSetting.set([...this.systemColumns]);
2974
- }
2975
- }
2976
- else {
2977
- if (!this.detail.id) {
2978
- setting.set([...this.columns, Object.assign(Object.assign({}, this.detail), { id: v4() })]);
2979
- }
2980
- else {
2981
- setting.set([...this.columns]);
2982
- }
2983
- }
2984
- };
2985
- }
2986
- ngOnInit() {
2987
- var _a, _b, _c;
2988
- const systemSetting = this.generatedColumnService.loadSystem(this.gridOption.config);
2989
- const setting = this.generatedColumnService.load((_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.config);
2990
- if (systemSetting) {
2991
- (_b = __classPrivateFieldGet(this, _subscription$2)) === null || _b === void 0 ? void 0 : _b.add(systemSetting.observer.subscribe(columns => {
2992
- this.systemColumns = columns;
2993
- }));
2994
- }
2995
- if (setting) {
2996
- (_c = __classPrivateFieldGet(this, _subscription$2)) === null || _c === void 0 ? void 0 : _c.add(setting.observer.subscribe(columns => {
2997
- this.columns = columns;
2998
- }));
2999
- }
3000
- this.originColumns = this.gridOption.columns.filter(e => e.type !== 'children' && e.type !== 'children-col');
3001
- }
3002
- ngOnDestroy() {
3003
- __classPrivateFieldGet(this, _subscription$2).unsubscribe();
3004
- }
3005
- }
3006
- _subscription$2 = new WeakMap();
3007
- SdDynamicColumn.decorators = [
3008
- { type: Component, args: [{
3009
- selector: 'sd-dynamic-column',
3010
- template: "<sd-side-drawer width=\"400px\">\r\n <div sdTitle>{{'Manage dynamic column' | sdTranslate}}</div>\r\n <ng-container sdBody>\r\n <ng-container *ngIf=\"!isDetail\">\r\n <ng-container *ngIf=\"systemColumns\">\r\n <div *ngFor=\"let column of systemColumns\" (click)=\"onDetail(column)\">\r\n {{column.title}}\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"columns\">\r\n <div *ngFor=\"let column of columns\" (click)=\"onDetail(column)\">\r\n {{column.title}}\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"isDetail\">\r\n <sd-select [form]=\"form\" [label]=\"'Apply for' | sdTranslate\" [(model)]=\"detail.isSystem\"\r\n [items]=\"[{code: true, name: 'All users'},{code: false, name: 'Only me'}]\" [disabled]=\"!!detail.id\" required></sd-select>\r\n <sd-input [form]=\"form\" [label]=\"'Column field' | sdTranslate\" [(model)]=\"detail.field\" [disabled]=\"!!detail.id\"\r\n required></sd-input>\r\n <sd-input [form]=\"form\" [label]=\"'Column title' | sdTranslate\" [(model)]=\"detail.title\" required></sd-input>\r\n <sd-input-number [form]=\"form\" [label]=\"'Column width' | sdTranslate\" [(model)]=\"detail.width\" required>\r\n <ng-template sdInputSuffix>px</ng-template>\r\n </sd-input-number>\r\n <sd-select [form]=\"form\" [label]=\"'Column type' | sdTranslate\" [(model)]=\"detail.type\" [items]=\"columnTypes\"\r\n [disabled]=\"!!detail.id\" required></sd-select>\r\n <sd-select *ngIf=\"detail.type === 'children' || detail.type === 'children-col'\" [form]=\"form\"\r\n [label]=\"'Column fields' | sdTranslate\" [(model)]=\"detail.fields\" [items]=\"originColumns\" valueField=\"field\"\r\n displayField=\"title\" multiple></sd-select>\r\n <sd-select [form]=\"form\" [label]=\"'Use template' | sdTranslate\" [(model)]=\"detail.useTemplate\"\r\n [items]=\"[{code: true, name: 'Yes'},{code: false, name: 'No'}]\" required></sd-select>\r\n <sd-editor *ngIf=\"detail.useTemplate\" [form]=\"form\" [label]=\"'Html template' | sdTranslate\" [(model)]=\"detail.template\">\r\n </sd-editor>\r\n </ng-container>\r\n </ng-container>\r\n <div class=\"d-flex align-items-center justify-content-end\" sdFooter>\r\n <sd-button [title]=\"'Close' | sdTranslate\" (action)=\"sideDrawer.close()\"> </sd-button>\r\n <sd-button *ngIf=\"!isDetail\" [title]=\"'Create column' | sdTranslate\" color=\"primary\" class=\"mx-8\"\r\n (action)=\"onDetail()\">\r\n </sd-button>\r\n <sd-button *ngIf=\"isDetail\" [title]=\"'Save' | sdTranslate\" color=\"success\" class=\"mx-8\" (action)=\"onSave()\">\r\n </sd-button>\r\n </div>\r\n</sd-side-drawer>",
3011
- changeDetection: ChangeDetectionStrategy.OnPush,
3012
- styles: [".c-table{overflow:auto;position:relative}.c-table table{width:100%}.c-table .c-th{color:#000;font-size:14px;font-weight:500;line-height:20px}.c-container{min-height:200px;position:relative}.c-handle{color:#ccc;cursor:move}"]
3013
- },] }
3014
- ];
3015
- SdDynamicColumn.ctorParameters = () => [
3016
- { type: ChangeDetectorRef },
3017
- { type: SdGeneratedColumnService },
3018
- { type: SdNotifyService },
3019
- { type: SdTranslateService },
3020
- { type: SdGridConfigurationService }
3021
- ];
3022
- SdDynamicColumn.propDecorators = {
3023
- sideDrawer: [{ type: ViewChild, args: [SdSideDrawer,] }],
3024
- gridOption: [{ type: Input }]
3025
- };
3026
-
3027
- class SdDesktopCell {
3028
- constructor() {
3029
- this.cellDef = {};
3030
- }
3031
- }
3032
- SdDesktopCell.decorators = [
3033
- { type: Component, args: [{
3034
- selector: 'sd-desktop-cell',
3035
- template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <ng-container *sdLet=\"item[column.field] | sdEditorHandlerColumn:item:gridOption\">\r\n <ng-container *ngIf=\"item.editorHandlerColumn && item.editorHandlerColumn[column.field]?.visible;else useView\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx, isEdited: true }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-editor *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [column]=\"column\" [item]=\"item\">\r\n </sd-desktop-cell-editor>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #useView>\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-view *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [key]=\"key\" [column]=\"column\" [gridOption]=\"gridOption\" [item]=\"item\">\r\n </sd-desktop-cell-view>\r\n </ng-template>\r\n</ng-container>",
3036
- changeDetection: ChangeDetectionStrategy.OnPush
3037
- },] }
3038
- ];
3039
- SdDesktopCell.ctorParameters = () => [];
3040
- SdDesktopCell.propDecorators = {
3041
- sdId: [{ type: Input }],
3042
- value: [{ type: Input }],
3043
- key: [{ type: Input }],
3044
- column: [{ type: Input }],
3045
- item: [{ type: Input }],
3046
- gridOption: [{ type: Input }],
3047
- cellDef: [{ type: Input }],
3048
- idx: [{ type: Input }]
3049
- };
3050
-
3051
- class SdDesktopCellEditor {
3052
- constructor() {
3053
- this.onChange = (selected) => {
3054
- var _a, _b, _c;
3055
- if (this.column.type === 'children' || this.column.type === 'children-col') {
3056
- return;
3057
- }
3058
- (_c = (_b = (_a = this.column) === null || _a === void 0 ? void 0 : _a.editor) === null || _b === void 0 ? void 0 : _b.change) === null || _c === void 0 ? void 0 : _c.call(_b, this.item, selected);
3059
- };
3060
- this.editorOnAdd = () => {
3061
- var _a, _b;
3062
- if (this.column.type === 'children' || this.column.type === 'children-col') {
3063
- return;
3064
- }
3065
- if (this.column.type === 'values') {
3066
- (_b = (_a = this.column.editor) === null || _a === void 0 ? void 0 : _a.add) === null || _b === void 0 ? void 0 : _b.call(_a, this.item);
3067
- }
3068
- };
3069
- this.editorOnEdit = (option) => {
3070
- var _a, _b;
3071
- if (this.column.type === 'children' || this.column.type === 'children-col') {
3072
- return;
3073
- }
3074
- if (this.column.type === 'values') {
3075
- (_b = (_a = this.column.editor) === null || _a === void 0 ? void 0 : _a.edit) === null || _b === void 0 ? void 0 : _b.call(_a, option, this.item);
3076
- }
3077
- };
3078
- this.editorOnDelete = (option) => {
3079
- var _a, _b;
3080
- if (this.column.type === 'children' || this.column.type === 'children-col') {
3081
- return;
3082
- }
3083
- if (this.column.type === 'values') {
3084
- (_b = (_a = this.column.editor) === null || _a === void 0 ? void 0 : _a.delete) === null || _b === void 0 ? void 0 : _b.call(_a, option, this.item);
3085
- }
3086
- };
3087
- }
3088
- }
3089
- SdDesktopCellEditor.decorators = [
3090
- { type: Component, args: [{
3091
- selector: 'sd-desktop-cell-editor',
3092
- template: "<sd-input *ngIf=\"column.type === 'string'\" size=\"sm\" type=\"text\" [(model)]=\"item[column.field]\"\r\n (sdChange)=\"onChange($event)\" disableErrorMessage>\r\n</sd-input>\r\n<sd-input-number *ngIf=\"column.type === 'number'\" size=\"sm\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange($event)\"\r\n [min]=\"column?.editor?.minValue\" [max]=\"column?.editor?.maxValue\" disableErrorMessage>\r\n</sd-input-number>\r\n<sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [items]=\"[\r\n { value: true, display: column.option?.displayOnTrue || 'True' },\r\n { value: false, display: column.option?.displayOnFalse || 'False' }\r\n ]\" valueField=\"value\" displayField=\"display\" [(model)]=\"item[column.field]\" (sdSelection)=\"onChange($event)\"\r\n disableErrorMessage>\r\n</sd-select>\r\n<sd-date-time *ngIf=\"\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time'\r\n \" size=\"sm\" [(model)]=\"item[column.field]\" [type]=\"column.type\" (sdChange)=\"onChange($event)\" disableErrorMessage>\r\n</sd-date-time>\r\n\r\n<ng-container *ngIf=\"column.type === 'values'\">\r\n <sd-select *ngIf=\"!column?.option?.selection\" size=\"sm\" [items]=\"column.option.items\"\r\n [valueField]=\"column.option.valueField\" [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\"\r\n (sdSelection)=\"onChange($event)\" disableErrorMessage></sd-select>\r\n <sd-select *ngIf=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdSelection)=\"onChange($event)\"\r\n [multiple]=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \" [filtered]=\"column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\" disableErrorMessage>\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"\r\n column?.option?.selection === 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdChange)=\"onChange($event)\"\r\n disableErrorMessage>\r\n </sd-autocomplete>\r\n\r\n <!-- EDITOR -->\r\n <sd-select-editor *ngIf=\"\r\n column?.option?.selection === 'AUTOCOMPLETE_EDITOR'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdSelection)=\"onChange($event)\"\r\n filtered disableErrorMessage [addable]=\"column?.editor?.add\" [editable]=\"column?.editor?.edit\"\r\n [deletable]=\"column?.editor?.delete\" (sdAdd)=\"editorOnAdd()\" (sdEdit)=\"editorOnEdit($event)\"\r\n (sdDelete)=\"editorOnDelete($event)\">\r\n </sd-select-editor>\r\n <sd-select-editor *ngIf=\"\r\n column?.option?.selection === 'MULTIPLE_EDITOR'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdSelection)=\"onChange($event)\"\r\n multiple disableErrorMessage [addable]=\"column?.editor?.add\" [editable]=\"column?.editor?.edit\"\r\n [deletable]=\"column?.editor?.delete\" (sdAdd)=\"editorOnAdd()\" (sdEdit)=\"editorOnEdit($event)\"\r\n (sdDelete)=\"editorOnDelete($event)\">\r\n </sd-select-editor>\r\n <sd-select-editor *ngIf=\"\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE_EDITOR'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"item[column.field]\" (sdSelection)=\"onChange($event)\"\r\n multiple filtered disableErrorMessage [addable]=\"column?.editor?.add\" [editable]=\"column?.editor?.edit\"\r\n [deletable]=\"column?.editor?.delete\" (sdAdd)=\"editorOnAdd()\" (sdEdit)=\"editorOnEdit($event)\"\r\n (sdDelete)=\"editorOnDelete($event)\">\r\n </sd-select-editor>\r\n <!-- END EDITOR -->\r\n</ng-container>",
3093
- changeDetection: ChangeDetectionStrategy.OnPush
3094
- },] }
3095
- ];
3096
- SdDesktopCellEditor.ctorParameters = () => [];
3097
- SdDesktopCellEditor.propDecorators = {
3098
- sdId: [{ type: Input }],
3099
- column: [{ type: Input }],
3100
- item: [{ type: Input }]
3101
- };
3102
-
3103
- var _visible$1;
3104
- class SdEditorHandlerRowPipe {
3105
- constructor(zone) {
3106
- this.zone = zone;
3107
- _visible$1.set(this, (col, item) => {
3108
- if (col.type === 'children' || col.type === 'children-col') {
3109
- return false;
3110
- }
3111
- // Kiểm tra xem có bị disabled hay không?
3112
- if (col.editor) {
3113
- const isDisabled = typeof (col.editor.disabled) === 'function' ? col.editor.disabled(item) : col.editor.disabled;
3114
- if (isDisabled) {
3115
- return false;
3116
- }
3117
- }
3118
- return true;
3119
- });
3120
- }
3121
- transform(status, item, gridOption) {
3122
- const { editor } = gridOption;
3123
- if (!editor) {
3124
- return null;
3125
- }
3126
- let isDisabled = false;
3127
- if (typeof (editor === null || editor === void 0 ? void 0 : editor.disabled) === 'function') {
3128
- isDisabled = editor.disabled(item);
3129
- }
3130
- else {
3131
- isDisabled = editor === null || editor === void 0 ? void 0 : editor.disabled;
3132
- }
3133
- if (editor.type === 'inline') {
3134
- const removable = editor.removable;
3135
- item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !isDisabled, editable: false, removable: status !== 'create' && (typeof (removable) === 'function' ? removable(item) : removable), savable: false, cancelable: !isDisabled && status === 'create' });
3136
- }
3137
- else if (editor.type === 'focus') {
3138
- if (isDisabled) {
3139
- return null;
3140
- }
3141
- item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: !!status, editable: !status, removable: false, savable: !!status, cancelable: !!status });
3142
- }
3143
- else if (editor.type === 'popup') {
3144
- if (isDisabled) {
3145
- return null;
3146
- }
3147
- item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: false, editable: !status, removable: false, savable: false, cancelable: false });
3148
- }
3149
- item.editorHandlerColumn = item.editorHandlerColumn || {};
3150
- const { columns } = gridOption;
3151
- for (const col of columns) {
3152
- if (col.type === 'children-col') {
3153
- for (const childCol of col.children) {
3154
- item.editorHandlerColumn[childCol.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[childCol.field]), { visible: __classPrivateFieldGet(this, _visible$1).call(this, childCol, item) });
3155
- }
3156
- }
3157
- else {
3158
- item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible$1).call(this, col, item) });
3159
- }
3160
- }
3161
- this.zone.run(() => {
3162
- item.sdId = CalculateSdId(item);
3163
- });
3164
- return item.editorHandlerRow;
3165
- }
3166
- }
3167
- _visible$1 = new WeakMap();
3168
- SdEditorHandlerRowPipe.decorators = [
3169
- { type: Pipe, args: [{
3170
- name: 'sdEditorHandlerRow'
3171
- },] }
3172
- ];
3173
- SdEditorHandlerRowPipe.ctorParameters = () => [
3174
- { type: NgZone }
3175
- ];
3176
-
3177
- var _previous, _delay;
3178
- class SdEditorValidatePipe {
3179
- constructor() {
3180
- _previous.set(this, void 0);
3181
- _delay.set(this, 200); // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện validate
3182
- }
3183
- transform(sdId, item, items, gridOption) {
3184
- return __awaiter(this, void 0, void 0, function* () {
3185
- const { editor } = gridOption;
3186
- if (!editor.validate) {
3187
- item.editorErrorMessage = null;
3188
- return;
3189
- }
3190
- if (editor.type === 'popup') {
3191
- item.editorErrorMessage = null;
3192
- return;
3193
- }
3194
- if (editor.type === 'focus' && !item.editorStatus) {
3195
- item.editorErrorMessage = null;
3196
- return;
3197
- }
3198
- __classPrivateFieldSet(this, _previous, new Date());
3199
- yield new Promise(resolve => setTimeout(resolve, __classPrivateFieldGet(this, _delay)));
3200
- const now = new Date();
3201
- const dif = now.getTime() - __classPrivateFieldGet(this, _previous).getTime();
3202
- if (dif < __classPrivateFieldGet(this, _delay)) {
3203
- return;
3204
- }
3205
- const result = editor.validate(item, items === null || items === void 0 ? void 0 : items.indexOf(item));
3206
- if (result instanceof Promise) {
3207
- item.editorErrorMessage = yield result;
3208
- return;
3209
- }
3210
- else {
3211
- item.editorErrorMessage = result;
3212
- return;
3213
- }
3214
- });
3215
- }
3216
- }
3217
- _previous = new WeakMap(), _delay = new WeakMap();
3218
- SdEditorValidatePipe.decorators = [
3219
- { type: Pipe, args: [{
3220
- name: 'sdEditorValidate'
3221
- },] }
3222
- ];
3223
-
3224
- class SdStyleRowCss {
3225
- transform(item, gridOption) {
3226
- var _a, _b;
3227
- return ((_b = (_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.style) === null || _a === void 0 ? void 0 : _a.rowCss) === null || _b === void 0 ? void 0 : _b.call(_a, item)) || {};
3228
- }
3229
- }
3230
- SdStyleRowCss.decorators = [
3231
- { type: Pipe, args: [{
3232
- name: 'sdStyleRowCss'
3233
- },] }
3234
- ];
3235
-
3236
- class SdDesktopEditorValidation {
3237
- constructor() { }
3238
- }
3239
- SdDesktopEditorValidation.decorators = [
3240
- { type: Component, args: [{
3241
- selector: 'sd-desktop-editor-validation',
3242
- template: "<ng-container *sdLet=\"item.sdId | sdEditorValidate:item:items:gridOption | async\">\r\n <div class=\"c-editor-validation\" [class.c-danger]=\"!!item.editorErrorMessage\" matTooltipPosition=\"after\"\r\n [matTooltip]=\"item.editorErrorMessage\">\r\n </div>\r\n</ng-container>",
3243
- changeDetection: ChangeDetectionStrategy.OnPush,
3244
- styles: [".text-black400{color:#757575}:host{height:100%;left:0;padding:12px 0;position:absolute;top:0}:host .c-editor-validation{border-bottom-right-radius:2px;border-top-right-radius:2px;height:100%;max-width:4px;min-width:4px;width:4px}:host .c-danger{background-color:#f82c13}"]
3245
- },] }
3246
- ];
3247
- SdDesktopEditorValidation.ctorParameters = () => [];
3248
- SdDesktopEditorValidation.propDecorators = {
3249
- sdId: [{ type: Input }],
3250
- item: [{ type: Input }],
3251
- items: [{ type: Input }],
3252
- gridOption: [{ type: Input }]
3253
- };
3254
-
3255
- class SdColumnInlineFilter {
3256
- constructor() {
3257
- this.columnFilter = {};
3258
- this.filterChange = new EventEmitter();
3259
- this.onFilterChange = () => {
3260
- this.filterChange.emit();
3261
- };
3262
- }
3263
- ngOnInit() {
3264
- var _a, _b;
3265
- if (this.column.type === 'date' || this.column.type === 'time' || this.column.type === 'datetime') {
3266
- if (!((_b = (_a = this.column) === null || _a === void 0 ? void 0 : _a.option) === null || _b === void 0 ? void 0 : _b.useFilterDate)) {
3267
- this.columnFilter[this.column.field] = this.columnFilter[this.column.field] || {
3268
- from: null,
3269
- to: null
3270
- };
3271
- }
3272
- }
3273
- }
3274
- }
3275
- SdColumnInlineFilter.decorators = [
3276
- { type: Component, args: [{
3277
- selector: 'sd-column-inline-filter',
3278
- template: "<div class=\"c-inline-column\">\r\n <ng-container *ngIf=\"\r\n column.type === 'string' ||\r\n column.type === 'number' ||\r\n column.type === 'bool' ||\r\n column.type === 'values' ||\r\n column.type === 'date' ||\r\n column.type === 'datetime' ||\r\n column.type === 'time';\r\n else noFilter\">\r\n <sd-input *ngIf=\"column.type === 'string'\" size=\"sm\" type=\"text\" [(model)]=\"columnFilter[column.field]\"\r\n (keyupEnter)=\"onFilterChange()\" [disabled]=\"column.filter?.disabled\">\r\n </sd-input>\r\n <sd-input-number *ngIf=\"column.type === 'number'\" size=\"sm\" [(model)]=\"columnFilter[column.field]\"\r\n (keyupEnter)=\"onFilterChange()\" [disabled]=\"column.filter?.disabled\">\r\n </sd-input-number>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [items]=\"[\r\n { value: '1', display: column.option?.displayOnTrue || 'True' },\r\n { value: '0', display: column.option?.displayOnFalse || 'False' }\r\n ]\" valueField=\"value\" displayField=\"display\" [(model)]=\"columnFilter[column.field]\" (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n <ng-template sdSelectDisplayDef let-item=\"item\">\r\n <sd-badge *ngIf=\"item.value === '1'\" color=\"success\" [title]=\"column.option?.displayOnTrue || 'True'\">\r\n </sd-badge>\r\n <sd-badge *ngIf=\"item.value === '0'\" color=\"danger\" [title]=\"column.option?.displayOnFalse || 'False'\">\r\n </sd-badge>\r\n </ng-template>\r\n </sd-select>\r\n <sd-select *ngIf=\"\r\n column.type === 'values' && column?.option?.selection !== 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"columnFilter[column.field]\" (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\" [multiple]=\"\r\n column?.option?.selection === 'MULTIPLE' ||\r\n column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\r\n \" [filtered]=\"column?.option?.selection === 'MULTIPLEAUTOCOMPLETE'\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"\r\n column.type === 'values' && column?.option?.selection === 'AUTOCOMPLETE'\r\n \" size=\"sm\" [items]=\"column.option.items\" [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\" [(model)]=\"columnFilter[column.field]\" (sdChange)=\"onFilterChange()\"\r\n [disabled]=\"column.filter?.disabled\">\r\n </sd-autocomplete>\r\n <ng-container *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\">\r\n <sd-date-range *ngIf=\"!column.option?.useFilterDate\" size=\"sm\" [(from)]=\"columnFilter[column.field].from\"\r\n [(to)]=\"columnFilter[column.field].to\" (sdChange)=\"onFilterChange()\" [disabled]=\"column.filter?.disabled\">\r\n </sd-date-range>\r\n <sd-date-time *ngIf=\"column.option?.useFilterDate\" size=\"sm\" [(model)]=\"columnFilter[column.field]\"\r\n (sdChange)=\"onFilterChange()\" [disabled]=\"column.filter?.disabled\">\r\n </sd-date-time>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #noFilter>\r\n <sd-input type=\"text\" size=\"sm\" disabled> </sd-input>\r\n </ng-template>\r\n</div>",
3279
- changeDetection: ChangeDetectionStrategy.OnPush,
3280
- styles: [":host ::ng-deep .c-inline-column .mat-form-field-wrapper{background-color:#fff;border-radius:8px;margin:8px 0 0!important;padding:0!important}"]
3281
- },] }
3282
- ];
3283
- SdColumnInlineFilter.ctorParameters = () => [];
3284
- SdColumnInlineFilter.propDecorators = {
3285
- value: [{ type: Input }],
3286
- columnFilter: [{ type: Input }],
3287
- column: [{ type: Input }],
3288
- filterChange: [{ type: Output }]
3289
- };
3290
-
3291
- class SdSelectionVisiblePipe {
3292
- constructor() {
3293
- this.transform = (rowData, selection) => {
3294
- var _a, _b;
3295
- const { actions } = selection;
3296
- const groupedActions = [];
3297
- rowData.actions = rowData.actions || [];
3298
- if (!(actions === null || actions === void 0 ? void 0 : actions.length)) {
3299
- rowData.selectable = true;
3300
- return rowData.selectable;
3301
- }
3302
- for (const action of actions) {
3303
- if ('children' in action) {
3304
- let flag = false;
3305
- let hasGroup = false;
3306
- for (const childAction of action.children) {
3307
- const { hidden, isGrouped } = childAction;
3308
- const key = hash(childAction);
3309
- if (isGrouped) {
3310
- hasGroup = true;
3311
- }
3312
- if (typeof (hidden) === 'function') {
3313
- if (!hidden(rowData)) {
3314
- flag = true;
3315
- rowData.actions.push(key);
3316
- if (isGrouped) {
3317
- groupedActions.push(key);
3318
- }
3319
- }
3320
- }
3321
- else if (!hidden) {
3322
- flag = true;
3323
- rowData.actions.push(key);
3324
- if (isGrouped) {
3325
- groupedActions.push(key);
3326
- }
3327
- }
3328
- }
3329
- if (flag) {
3330
- rowData.actions.push(hash(action));
3331
- if (hasGroup) {
3332
- groupedActions.push(hash(action));
3333
- }
3334
- }
3335
- }
3336
- else {
3337
- const { hidden, isGrouped } = action;
3338
- const key = hash(action);
3339
- if (typeof (hidden) === 'function') {
3340
- if (!hidden(rowData)) {
3341
- rowData.actions.push(key);
3342
- if (isGrouped) {
3343
- groupedActions.push(key);
3344
- }
3345
- }
3346
- }
3347
- else if (!hidden) {
3348
- rowData.actions.push(key);
3349
- if (isGrouped) {
3350
- groupedActions.push(key);
3351
- }
3352
- }
3353
- }
3354
- }
3355
- rowData.selectable = !!rowData.actions.length;
3356
- if (!rowData.selectable || !groupedActions.length || ((_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.sdGroup) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length)) {
3357
- return rowData.selectable;
3358
- }
3359
- // Đối với trường hợp grouped, tuy selectable là true nhưng vẫn ẩn đi checkbox
3360
- // nếu các action đều thuộc groupedActions và rowData ko phải là dòng group
3361
- return rowData.actions.some(action => !groupedActions.includes(action));
3362
- };
3363
- }
3364
- }
3365
- SdSelectionVisiblePipe.decorators = [
3366
- { type: Pipe, args: [{
3367
- name: 'selectionVisible'
3368
- },] }
3369
- ];
3370
-
3371
- class SdGridQuickAction {
3372
- constructor() {
3373
- this.clear = new EventEmitter();
3374
- this.onClear = () => {
3375
- this.clear.emit();
3376
- };
3377
- }
3378
- }
3379
- SdGridQuickAction.decorators = [
3380
- { type: Component, args: [{
3381
- selector: 'sd-grid-quick-action',
3382
- template: "<sd-quick-action *ngIf=\"selectedItems | selectionActionFilter: gridOption?.selection?.actions as actions\"\r\n [isOpened]=\"actions?.length\">\r\n <div class=\"d-flex align-items-center\" sdMessage>\r\n <div class=\"c-bg-length\">\r\n <span class=\"c-length\">{{ selectedItems.length }}</span>\r\n </div>\r\n <div class=\"c-message\">{{ gridOption?.selection?.message || (\"selected items\" | sdTranslate) }}</div>\r\n </div>\r\n <div class=\"d-flex align-items-center mr-8\" sdAction>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <sd-button *ngIf=\"action.click\" class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" (action)=\"action.click(selectedItems)\"></sd-button>\r\n <ng-container *ngIf=\"action.children?.length\">\r\n <sd-button class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon || 'more_vert'\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" [matMenuTriggerFor]=\"menu\">\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <span>\r\n <button *ngFor=\"let childAction of action.children\" mat-menu-item (click)=\"childAction.click(selectedItems)\"\r\n [disabled]=\"childAction.disabled\">\r\n <mat-icon [fontSet]=\"childAction.fontSet\" class=\"c-icon\">{{ childAction.icon }}\r\n </mat-icon>\r\n <span> {{ childAction.title }}</span>\r\n </button>\r\n </span>\r\n </mat-menu>\r\n </ng-container>\r\n </ng-container>\r\n <sd-button class=\"ml-5\" icon=\"close\" color=\"secondary\" type=\"outline\" size=\"sm\"\r\n (action)=\"onClear()\" width=\"35px\"></sd-button>\r\n </div>\r\n</sd-quick-action>",
3383
- changeDetection: ChangeDetectionStrategy.OnPush,
3384
- styles: [".c-bg-length{align-items:flex-start;background:#2962ff;border-radius:4px 0 0 4px;display:flex;flex-direction:column;height:48px;left:0;min-width:48px;padding:12px 8px;position:static;top:0;width:auto}.c-bg-length .c-length{color:#fff;font-size:16px;font-weight:500;height:24px;left:8px;line-height:24px;min-width:32px;text-align:center;top:12px;width:auto}.c-bg-length .c-length,.c-message{font-family:Roboto;font-style:normal;position:static}.c-message{color:#000;font-size:14px;font-weight:400;height:20px;left:0;line-height:20px;margin:0 0 0 16px;min-width:200px;top:6px}"]
3385
- },] }
3386
- ];
3387
- SdGridQuickAction.ctorParameters = () => [];
3388
- SdGridQuickAction.propDecorators = {
3389
- gridOption: [{ type: Input }],
3390
- selectedItems: [{ type: Input }],
3391
- clear: [{ type: Output }]
3392
- };
3393
-
3394
- var _maxSecond, _maxMinute, _maxHour, _maxDay, _maxMonth, _isMobileOrTablet$1;
3395
- class SdCellViewPipe {
3396
- constructor(deviceService, utilityService, columnValuesPipe) {
3397
- this.utilityService = utilityService;
3398
- this.columnValuesPipe = columnValuesPipe;
3399
- _maxSecond.set(this, 60);
3400
- _maxMinute.set(this, __classPrivateFieldGet(this, _maxSecond) * 60);
3401
- _maxHour.set(this, __classPrivateFieldGet(this, _maxMinute) * 24);
3402
- _maxDay.set(this, __classPrivateFieldGet(this, _maxHour) * 30);
3403
- _maxMonth.set(this, __classPrivateFieldGet(this, _maxHour) * 365);
3404
- _isMobileOrTablet$1.set(this, false);
3405
- __classPrivateFieldSet(this, _isMobileOrTablet$1, !deviceService.isDesktop());
3406
- }
3407
- transform(value, rowData, column, gridOption, key) {
3408
- var _a;
3409
- return __awaiter(this, void 0, void 0, function* () {
3410
- const { displayOnEmpty } = gridOption;
3411
- const { align, click, tooltip, htmlTemplate, transform } = column;
3412
- const result = {
3413
- badge: null,
3414
- tooltip: null,
3415
- display: {
3416
- align: align || (column.type === 'number' ? 'right' : 'left'),
3417
- value
3418
- },
3419
- click: null
3420
- };
3421
- // Display
3422
- if (typeof (htmlTemplate) === 'function') {
3423
- result.display.hasHtml = true;
3424
- result.display.html = htmlTemplate(value, rowData, __classPrivateFieldGet(this, _isMobileOrTablet$1));
3425
- }
3426
- else {
3427
- if (column.type === 'datetime' || column.type === 'date' || column.type === 'time') {
3428
- const { transformDate } = column;
3429
- if (transformDate) {
3430
- value = transformDate(value, rowData);
3431
- }
3432
- }
3433
- if (typeof (transform) === 'function') {
3434
- const val = transform(value, rowData);
3435
- if (val instanceof Promise) {
3436
- result.display.value = yield val;
3437
- }
3438
- else {
3439
- result.display.value = val;
3440
- }
3441
- }
3442
- else {
3443
- if (column.type === 'date' || column.type === 'datetime') {
3444
- const { option } = column;
3445
- const seconds = Math.round((new Date().getTime() - new Date(value).getTime()) / 1000);
3446
- if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'month' && seconds < __classPrivateFieldGet(this, _maxMonth)) {
3447
- result.display.value = this.utilityService.timeDifference(value);
3448
- result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3449
- }
3450
- else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'day' && seconds < __classPrivateFieldGet(this, _maxDay)) {
3451
- result.display.value = this.utilityService.timeDifference(value);
3452
- result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3453
- }
3454
- else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'hour' && seconds < __classPrivateFieldGet(this, _maxHour)) {
3455
- result.display.value = this.utilityService.timeDifference(value);
3456
- result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3457
- }
3458
- else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'minute' && seconds < __classPrivateFieldGet(this, _maxMinute)) {
3459
- result.display.value = this.utilityService.timeDifference(value);
3460
- result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3461
- }
3462
- else if ((option === null || option === void 0 ? void 0 : option.timeDifferent) === 'second' && seconds < __classPrivateFieldGet(this, _maxSecond)) {
3463
- result.display.value = this.utilityService.timeDifference(value);
3464
- result.tooltip = Date.toFormat(value, column.type === 'date' ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm');
3465
- }
3466
- else {
3467
- const date = Date.toFormat(value, 'dd/MM/yyyy');
3468
- const time = Date.toFormat(value, 'HH:mm');
3469
- const dateTime = Date.toFormat(value, 'HH:mm');
3470
- if (column.type === 'datetime' && time && time !== '00:00') {
3471
- result.display.value = dateTime;
3472
- result.display.hasHtml = true;
3473
- result.display.html = `<span class="d-block T14R text-black400">${Date.toFormat(value, 'HH:mm')}</span><span class="d-block T14R">${Date.toFormat(value, 'dd/MM/yyyy')}</span>`;
3474
- }
3475
- else {
3476
- result.display.value = date;
3477
- }
3478
- }
3479
- }
3480
- if (column.type === 'time') {
3481
- result.display.value = Date.toFormat(value, 'HH:mm');
3482
- }
3483
- if (column.type === 'values') {
3484
- result.display.value = yield this.columnValuesPipe.transform(value, column);
3485
- }
3486
- else if (column.type === 'number' && Number.isNumber(value)) {
3487
- result.display.value = Number.toVNCurrency(value);
3488
- }
3489
- if (column.type === 'bool') {
3490
- const { option } = column;
3491
- if (value !== undefined && value !== null && value !== '') {
3492
- result.display.value = value === true ? ((option === null || option === void 0 ? void 0 : option.displayOnTrue) || 'True') : ((option === null || option === void 0 ? void 0 : option.displayOnFalse) || 'False');
3493
- }
3494
- else {
3495
- result.display.value = null;
3496
- }
3497
- }
3498
- }
3499
- if (displayOnEmpty) {
3500
- let values = [null, undefined, ''];
3501
- if (typeof (displayOnEmpty) === 'object') {
3502
- const { display, emptyValues } = displayOnEmpty;
3503
- values = [null, undefined, '', ...emptyValues];
3504
- if (values.includes(result.display.value)) {
3505
- if (typeof (display) === 'function') {
3506
- result.display.hasHtml = true;
3507
- result.display.html = display(rowData, column);
3508
- }
3509
- else {
3510
- result.display.hasHtml = true;
3511
- result.display.html = `<div class="T16R text-black400">--</div>`;
3512
- }
3513
- }
3514
- }
3515
- else {
3516
- if (values.includes(result.display.value)) {
3517
- if (typeof (displayOnEmpty) === 'function') {
3518
- result.display.hasHtml = true;
3519
- result.display.html = displayOnEmpty(rowData, column);
3520
- }
3521
- else {
3522
- result.display.hasHtml = true;
3523
- result.display.html = `<div class="T16R text-black400">--</div>`;
3524
- }
3525
- }
3526
- }
3527
- }
3528
- }
3529
- // Badge
3530
- if ((column.type === 'string' || column.type === 'number' || column.type === 'values') && column.badge) {
3531
- result.badge = {
3532
- type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
3533
- color: column.badge(value, rowData),
3534
- icon: (_a = column === null || column === void 0 ? void 0 : column.badgeIcon) === null || _a === void 0 ? void 0 : _a.call(column, value, rowData)
3535
- };
3536
- }
3537
- else if (column.type === 'bool') {
3538
- result.badge = {
3539
- type: !(column === null || column === void 0 ? void 0 : column.badgeType) ? 'round' : column.badgeType,
3540
- color: !!value ? 'success' : 'danger',
3541
- icon: null
3542
- };
3543
- }
3544
- // Tooltip
3545
- if (typeof (tooltip) === 'function') {
3546
- result.tooltip = tooltip(value, rowData);
3547
- }
3548
- // Clickable
3549
- if (typeof (click) === 'function') {
3550
- result.click = () => click(value, rowData);
3551
- }
3552
- return result;
3553
- });
3554
- }
3555
- }
3556
- _maxSecond = new WeakMap(), _maxMinute = new WeakMap(), _maxHour = new WeakMap(), _maxDay = new WeakMap(), _maxMonth = new WeakMap(), _isMobileOrTablet$1 = new WeakMap();
3557
- SdCellViewPipe.decorators = [
3558
- { type: Pipe, args: [{
3559
- name: 'cellView'
3560
- },] }
3561
- ];
3562
- SdCellViewPipe.ctorParameters = () => [
3563
- { type: DeviceDetectorService },
3564
- { type: SdUtilityService },
3565
- { type: SdColumnValuesPipe }
3566
- ];
3567
-
3568
- class SdGroupPipe {
3569
- transform(items, gridOption) {
3570
- var _a;
3571
- const { group } = gridOption;
3572
- if (!group) {
3573
- return items;
3574
- }
3575
- const { fields, htmlTemplate } = group;
3576
- if (!(fields === null || fields === void 0 ? void 0 : fields.length)) {
3577
- return items;
3578
- }
3579
- const groupItem = {};
3580
- for (const item of items) {
3581
- let obj = {};
3582
- for (const field of fields) {
3583
- obj = Object.assign(Object.assign({}, obj), ((_a = item[field]) !== null && _a !== void 0 ? _a : { [field]: item[field] }));
3584
- }
3585
- const key = hash(obj);
3586
- if (!groupItem[key]) {
3587
- groupItem[key] = [];
3588
- }
3589
- groupItem[key].push(item);
3590
- }
3591
- const results = [];
3592
- for (const key of Object.keys(groupItem)) {
3593
- results.push({
3594
- sdGroup: {
3595
- items: groupItem[key],
3596
- htmlTemplate: htmlTemplate(groupItem[key])
3597
- }
3598
- });
3599
- for (const item of groupItem[key]) {
3600
- results.push(item);
3601
- }
3602
- }
3603
- return results;
3604
- }
3605
- }
3606
- SdGroupPipe.decorators = [
3607
- { type: Pipe, args: [{
3608
- name: 'sdGroup'
3609
- },] }
3610
- ];
3611
-
3612
- class MatPaginatorIntlCro extends MatPaginatorIntl {
3613
- constructor() {
3614
- super(...arguments);
3615
- this.firstPageLabel = 'Trang đầu';
3616
- this.lastPageLabel = 'Trang cuối';
3617
- this.itemsPerPageLabel = 'Kích thước trang';
3618
- this.nextPageLabel = 'Trang sau';
3619
- this.previousPageLabel = 'Trang trước';
3620
- this.getRangeLabel = (page, pageSize, length) => {
3621
- if (length === 0 || pageSize === 0) {
3622
- return '';
3623
- }
3624
- const from = page * pageSize + 1;
3625
- const to = from + (length - page * pageSize > pageSize ? pageSize : length - page * pageSize) - 1;
3626
- return `${from}-${to} trên ${length}`;
3627
- };
3628
- }
3629
- }
3630
- MatPaginatorIntlCro.decorators = [
3631
- { type: Injectable }
3632
- ];
3633
- class SdGridMaterialModule {
3634
- }
3635
- SdGridMaterialModule.decorators = [
3636
- { type: NgModule, args: [{
3637
- imports: [
3638
- CommonModule,
3639
- FormsModule,
3640
- ReactiveFormsModule,
3641
- MatInputModule,
3642
- MatFormFieldModule,
3643
- MatSortModule,
3644
- MatPaginatorModule,
3645
- MatTableModule,
3646
- MatMenuModule,
3647
- MatIconModule,
3648
- MatButtonModule,
3649
- MatTooltipModule,
3650
- MatProgressSpinnerModule,
3651
- MatChipsModule,
3652
- MatRadioModule,
3653
- MatSlideToggleModule,
3654
- MatCheckboxModule,
3655
- MatListModule,
3656
- MatDividerModule,
3657
- CdkTableModule,
3658
- DragDropModule,
3659
- SdFormModule,
3660
- SdServiceModule,
3661
- MatSliderModule,
3662
- ScrollingModule,
3663
- SdCommonModule
3664
- ],
3665
- declarations: [
3666
- SdGridQuickAction,
3667
- SdDesktopCell,
3668
- SdDesktopCellEditor,
3669
- SdDesktopEditorValidation,
3670
- SdDesktopCellView,
3671
- SdDesktopCellChildrenView,
3672
- SdDesktopCommand,
3673
- SdColumnInlineFilter,
3674
- SdGridMaterial,
3675
- SdMaterialFooterDefDirective,
3676
- SdMaterialCellDefDirective,
3677
- SdMaterialFilterDefDirective,
3678
- SdMaterialSubInformationDefDirective,
3679
- SdMaterialEmptyDataDefDirective,
3680
- SdPopupExport,
3681
- SdPopupGridConfiguration,
3682
- SdGridFilter,
3683
- SdPopupFilter,
3684
- SdDynamicColumn,
3685
- // Pipes
3686
- SdGridConfigurationResultPipe,
3687
- SdColumnChildrenFilterPipe,
3688
- SdColumnTitlePipe,
3689
- SdCommandFilterPipe,
3690
- SdCommandDisablePipe,
3691
- SdCommandIconPipe,
3692
- SdCommandTitlePipe,
3693
- SdColumnValuesPipe,
3694
- SdColumnHtmlTemplatePipe,
3695
- SdColumnTransformPipe,
3696
- SdColumnTooltipPipe,
3697
- SdColumnBadgePipe,
3698
- SdFilterColumnPipe,
3699
- SdFilterExternalPipe,
3700
- SdSelectionActionFilterPipe,
3701
- SdSelectionVisiblePipe,
3702
- SdSelectionDisablePipe,
3703
- SdSelectionVisibleSelectAllPipe,
3704
- SdEditorHandlerRowPipe,
3705
- SdEditorHandlerColumnPipe,
3706
- SdEditorValidatePipe,
3707
- SdStyleRowCss,
3708
- SdCellViewPipe,
3709
- SdGroupPipe
3710
- ],
3711
- exports: [
3712
- SdGridMaterial,
3713
- SdMaterialFooterDefDirective,
3714
- SdMaterialCellDefDirective,
3715
- SdMaterialFilterDefDirective,
3716
- SdMaterialEmptyDataDefDirective,
3717
- SdMaterialSubInformationDefDirective
3718
- ],
3719
- providers: [
3720
- DatePipe,
3721
- DecimalPipe,
3722
- CdkColumnDef,
3723
- SdGridFilterService,
3724
- SdGridConfigurationService,
3725
- SdGeneratedColumnService,
3726
- SdColumnValuesPipe,
3727
- SdEditorHandlerColumnPipe,
3728
- {
3729
- provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro
3730
- }
3731
- ]
3732
- },] }
3733
- ];
3734
-
3735
- /**
3736
- * Generated bundle index. Do not edit.
3737
- */
3738
-
3739
- export { SdGridMaterial, SdGridMaterialModule, SdMaterialCellDefDirective, SdMaterialEmptyDataDefDirective, SdMaterialFilterDefDirective, SdMaterialFooterDefDirective, SdMaterialSubInformationDefDirective, MatPaginatorIntlCro as ɵa, SdGridFilter as ɵb, SdCommandIconPipe as ɵba, SdCommandTitlePipe as ɵbb, SdColumnHtmlTemplatePipe as ɵbc, SdColumnTransformPipe as ɵbd, SdColumnTooltipPipe as ɵbe, SdColumnBadgePipe as ɵbf, SdFilterColumnPipe as ɵbg, SdFilterExternalPipe as ɵbh, SdSelectionActionFilterPipe as ɵbi, SdSelectionVisiblePipe as ɵbj, SdSelectionDisablePipe as ɵbk, SdSelectionVisibleSelectAllPipe as ɵbl, SdEditorHandlerRowPipe as ɵbm, SdEditorValidatePipe as ɵbn, SdStyleRowCss as ɵbo, SdCellViewPipe as ɵbp, SdGroupPipe as ɵbq, SdPopupFilter as ɵc, SdGridFilterService as ɵd, SdPopupExport as ɵe, GRID_MATERIAL_CONFIG as ɵg, SdGridConfigurationService as ɵh, SdColumnValuesPipe as ɵi, SdEditorHandlerColumnPipe as ɵj, SdGridQuickAction as ɵk, SdDesktopCell as ɵl, SdDesktopCellEditor as ɵm, SdDesktopEditorValidation as ɵn, SdDesktopCellView as ɵo, SdDesktopCellChildrenView as ɵp, SdDesktopCommand as ɵq, SdColumnInlineFilter as ɵr, SdPopupGridConfiguration as ɵs, SdDynamicColumn as ɵt, SdGeneratedColumnService as ɵu, SdGridConfigurationResultPipe as ɵv, SdColumnChildrenFilterPipe as ɵw, SdColumnTitlePipe as ɵx, SdCommandFilterPipe as ɵy, SdCommandDisablePipe as ɵz };
3740
- //# sourceMappingURL=sd-angular-core-grid-material.js.map