@ng-matero/extensions 12.7.0 → 13.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/README.md +2 -16
  2. package/_all-color.scss +1 -1
  3. package/_index.scss +1 -1
  4. package/_theming.scss +1 -1
  5. package/alert/_alert-theme.scss +2 -2
  6. package/alert/alert.component.d.ts +3 -0
  7. package/alert/alert.module.d.ts +6 -0
  8. package/alert/mtxAlert.d.ts +1 -0
  9. package/alert/package.json +5 -6
  10. package/button/button-loading.directive.d.ts +3 -0
  11. package/button/button.module.d.ts +8 -0
  12. package/button/mtxButton.d.ts +1 -0
  13. package/button/package.json +5 -6
  14. package/checkbox-group/checkbox-group.component.d.ts +3 -0
  15. package/checkbox-group/checkbox-group.module.d.ts +9 -0
  16. package/checkbox-group/mtxCheckboxGroup.d.ts +1 -0
  17. package/checkbox-group/package.json +5 -6
  18. package/colorpicker/_colorpicker-theme.scss +2 -2
  19. package/colorpicker/colorpicker-input.d.ts +3 -0
  20. package/colorpicker/colorpicker-module.d.ts +13 -0
  21. package/colorpicker/colorpicker-toggle.d.ts +5 -0
  22. package/colorpicker/colorpicker.d.ts +6 -1
  23. package/colorpicker/mtxColorpicker.d.ts +1 -0
  24. package/colorpicker/package.json +5 -6
  25. package/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
  26. package/column-resize/column-resize-directives/column-resize.d.ts +3 -0
  27. package/column-resize/column-resize-module.d.ts +6 -7
  28. package/column-resize/column-resize-notifier.d.ts +5 -7
  29. package/column-resize/column-resize.d.ts +3 -0
  30. package/column-resize/column-size-store.d.ts +3 -7
  31. package/column-resize/event-dispatcher.d.ts +3 -0
  32. package/column-resize/mtxColumnResize.d.ts +1 -0
  33. package/column-resize/overlay-handle.d.ts +3 -0
  34. package/column-resize/package.json +5 -6
  35. package/column-resize/resizable.d.ts +3 -0
  36. package/column-resize/resize-strategy.d.ts +7 -0
  37. package/core/datetime/datetime.module.d.ts +8 -0
  38. package/core/datetime/native-datetime-adapter.d.ts +3 -0
  39. package/core/density/private/_compatibility.scss +74 -0
  40. package/core/mtxCore.d.ts +1 -0
  41. package/core/package.json +5 -6
  42. package/{pipes/public-api.d.ts → core/pipes/index.d.ts} +0 -0
  43. package/core/pipes/pipes.module.d.ts +8 -0
  44. package/{pipes → core/pipes}/to-observable.pipe.d.ts +3 -0
  45. package/core/public-api.d.ts +1 -0
  46. package/core/style/_elevation.scss +197 -0
  47. package/core/style/_private.scss +41 -0
  48. package/core/style/_variables.scss +44 -0
  49. package/core/style/_vendor-prefixes.scss +60 -0
  50. package/core/theming/_palette.scss +746 -0
  51. package/core/theming/_theming.scss +430 -0
  52. package/core/typography/_typography-utils.scss +101 -0
  53. package/core/typography/_typography.scss +273 -0
  54. package/datetimepicker/_datetimepicker-theme.scss +5 -5
  55. package/datetimepicker/calendar-body.d.ts +3 -0
  56. package/datetimepicker/calendar-body.scss +5 -4
  57. package/datetimepicker/calendar.d.ts +4 -1
  58. package/datetimepicker/clock.d.ts +3 -0
  59. package/datetimepicker/datetimepicker-input.d.ts +3 -0
  60. package/datetimepicker/datetimepicker-module.d.ts +18 -0
  61. package/datetimepicker/datetimepicker-toggle.d.ts +5 -0
  62. package/datetimepicker/datetimepicker-types.d.ts +1 -0
  63. package/datetimepicker/datetimepicker.d.ts +7 -2
  64. package/datetimepicker/month-view.d.ts +4 -1
  65. package/datetimepicker/mtxDatetimepicker.d.ts +1 -0
  66. package/datetimepicker/multi-year-view.d.ts +4 -1
  67. package/datetimepicker/package.json +5 -6
  68. package/datetimepicker/public-api.d.ts +1 -0
  69. package/datetimepicker/year-view.d.ts +4 -1
  70. package/dialog/dialog.component.d.ts +3 -0
  71. package/dialog/dialog.d.ts +3 -0
  72. package/dialog/dialog.module.d.ts +10 -0
  73. package/dialog/mtxDialog.d.ts +1 -0
  74. package/dialog/package.json +5 -6
  75. package/esm2020/alert/alert.component.mjs +52 -0
  76. package/esm2020/alert/alert.module.mjs +18 -0
  77. package/{esm2015/alert/mtxAlert.js → esm2020/alert/mtxAlert.mjs} +0 -0
  78. package/{esm2015/alert/public-api.js → esm2020/alert/public-api.mjs} +0 -0
  79. package/esm2020/button/button-loading.directive.mjs +79 -0
  80. package/esm2020/button/button.module.mjs +20 -0
  81. package/{esm2015/button/mtxButton.js → esm2020/button/mtxButton.mjs} +0 -0
  82. package/{esm2015/button/public-api.js → esm2020/button/public-api.mjs} +0 -0
  83. package/esm2020/checkbox-group/checkbox-group.component.mjs +234 -0
  84. package/{esm2015/checkbox-group/checkbox-group.interface.js → esm2020/checkbox-group/checkbox-group.interface.mjs} +0 -0
  85. package/esm2020/checkbox-group/checkbox-group.module.mjs +21 -0
  86. package/{esm2015/checkbox-group/mtxCheckboxGroup.js → esm2020/checkbox-group/mtxCheckboxGroup.mjs} +0 -0
  87. package/{esm2015/checkbox-group/public-api.js → esm2020/checkbox-group/public-api.mjs} +0 -0
  88. package/{esm2015/colorpicker/colorpicker-animations.js → esm2020/colorpicker/colorpicker-animations.mjs} +0 -0
  89. package/esm2020/colorpicker/colorpicker-input.mjs +228 -0
  90. package/esm2020/colorpicker/colorpicker-module.mjs +65 -0
  91. package/esm2020/colorpicker/colorpicker-toggle.mjs +90 -0
  92. package/esm2020/colorpicker/colorpicker.mjs +363 -0
  93. package/{esm2015/colorpicker/mtxColorpicker.js → esm2020/colorpicker/mtxColorpicker.mjs} +0 -0
  94. package/{esm2015/colorpicker/public-api.js → esm2020/colorpicker/public-api.mjs} +0 -0
  95. package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +45 -0
  96. package/esm2020/column-resize/column-resize-directives/column-resize.mjs +45 -0
  97. package/{esm2015/column-resize/column-resize-directives/constants.js → esm2020/column-resize/column-resize-directives/constants.mjs} +0 -0
  98. package/esm2020/column-resize/column-resize-module.mjs +28 -0
  99. package/esm2020/column-resize/column-resize-notifier.mjs +47 -0
  100. package/esm2020/column-resize/column-resize.mjs +82 -0
  101. package/esm2020/column-resize/column-size-store.mjs +20 -0
  102. package/esm2020/column-resize/event-dispatcher.mjs +67 -0
  103. package/{esm2015/column-resize/mtxColumnResize.js → esm2020/column-resize/mtxColumnResize.mjs} +0 -0
  104. package/esm2020/column-resize/overlay-handle.mjs +146 -0
  105. package/{esm2015/column-resize/polyfill.js → esm2020/column-resize/polyfill.mjs} +0 -0
  106. package/{esm2015/column-resize/public-api.js → esm2020/column-resize/public-api.mjs} +0 -0
  107. package/esm2020/column-resize/resizable.mjs +199 -0
  108. package/{esm2015/column-resize/resize-ref.js → esm2020/column-resize/resize-ref.mjs} +0 -0
  109. package/esm2020/column-resize/resize-strategy.mjs +232 -0
  110. package/{esm2015/column-resize/selectors.js → esm2020/column-resize/selectors.mjs} +0 -0
  111. package/{esm2015/core/datetime/datetime-adapter.js → esm2020/core/datetime/datetime-adapter.mjs} +0 -0
  112. package/{esm2015/core/datetime/datetime-formats.js → esm2020/core/datetime/datetime-formats.mjs} +0 -0
  113. package/esm2020/core/datetime/datetime.module.mjs +42 -0
  114. package/{esm2015/core/datetime/index.js → esm2020/core/datetime/index.mjs} +0 -0
  115. package/esm2020/core/datetime/native-datetime-adapter.mjs +138 -0
  116. package/{esm2015/core/datetime/native-datetime-formats.js → esm2020/core/datetime/native-datetime-formats.mjs} +0 -0
  117. package/{esm2015/core/mtxCore.js → esm2020/core/mtxCore.mjs} +0 -0
  118. package/esm2020/core/pipes/index.mjs +3 -0
  119. package/esm2020/core/pipes/pipes.module.mjs +18 -0
  120. package/esm2020/core/pipes/to-observable.pipe.mjs +15 -0
  121. package/{esm2015/core/public-api.js → esm2020/core/public-api.mjs} +2 -1
  122. package/esm2020/datetimepicker/calendar-body.mjs +78 -0
  123. package/esm2020/datetimepicker/calendar.mjs +618 -0
  124. package/esm2020/datetimepicker/clock.mjs +277 -0
  125. package/{esm2015/datetimepicker/datetimepicker-animations.js → esm2020/datetimepicker/datetimepicker-animations.mjs} +0 -0
  126. package/{esm2015/datetimepicker/datetimepicker-errors.js → esm2020/datetimepicker/datetimepicker-errors.mjs} +0 -0
  127. package/{esm2015/datetimepicker/datetimepicker-filtertype.js → esm2020/datetimepicker/datetimepicker-filtertype.mjs} +0 -0
  128. package/esm2020/datetimepicker/datetimepicker-input.mjs +344 -0
  129. package/esm2020/datetimepicker/datetimepicker-module.mjs +75 -0
  130. package/esm2020/datetimepicker/datetimepicker-toggle.mjs +94 -0
  131. package/esm2020/datetimepicker/datetimepicker-types.mjs +2 -0
  132. package/esm2020/datetimepicker/datetimepicker.mjs +492 -0
  133. package/esm2020/datetimepicker/month-view.mjs +148 -0
  134. package/{esm2015/datetimepicker/mtxDatetimepicker.js → esm2020/datetimepicker/mtxDatetimepicker.mjs} +0 -0
  135. package/esm2020/datetimepicker/multi-year-view.mjs +214 -0
  136. package/{esm2015/datetimepicker/public-api.js → esm2020/datetimepicker/public-api.mjs} +2 -1
  137. package/esm2020/datetimepicker/year-view.mjs +138 -0
  138. package/{esm2015/dialog/dialog-config.js → esm2020/dialog/dialog-config.mjs} +0 -0
  139. package/esm2020/dialog/dialog.component.mjs +33 -0
  140. package/esm2020/dialog/dialog.mjs +74 -0
  141. package/esm2020/dialog/dialog.module.mjs +24 -0
  142. package/{esm2015/dialog/mtxDialog.js → esm2020/dialog/mtxDialog.mjs} +0 -0
  143. package/{esm2015/dialog/public-api.js → esm2020/dialog/public-api.mjs} +0 -0
  144. package/esm2020/form-group/form-group.component.mjs +37 -0
  145. package/esm2020/form-group/form-group.module.mjs +18 -0
  146. package/{esm2015/form-group/mtxFormGroup.js → esm2020/form-group/mtxFormGroup.mjs} +0 -0
  147. package/{esm2015/form-group/public-api.js → esm2020/form-group/public-api.mjs} +0 -0
  148. package/esm2020/grid/cell.component.mjs +108 -0
  149. package/esm2020/grid/column-menu.component.mjs +95 -0
  150. package/esm2020/grid/column-resize/column-resize-directives/column-resize-flex.mjs +37 -0
  151. package/esm2020/grid/column-resize/column-resize-directives/column-resize.mjs +37 -0
  152. package/{esm2015/grid/column-resize/column-resize-directives/common.js → esm2020/grid/column-resize/column-resize-directives/common.mjs} +0 -0
  153. package/esm2020/grid/column-resize/column-resize-module.mjs +42 -0
  154. package/esm2020/grid/column-resize/overlay-handle.mjs +60 -0
  155. package/{esm2015/grid/column-resize/resizable-directives/common.js → esm2020/grid/column-resize/resizable-directives/common.mjs} +0 -0
  156. package/esm2020/grid/column-resize/resizable-directives/resizable.mjs +62 -0
  157. package/esm2020/grid/column-resize/resize-strategy.mjs +42 -0
  158. package/esm2020/grid/expansion-toggle.directive.mjs +64 -0
  159. package/esm2020/grid/grid.component.mjs +556 -0
  160. package/{esm2015/grid/grid.interface.js → esm2020/grid/grid.interface.mjs} +0 -0
  161. package/esm2020/grid/grid.module.mjs +117 -0
  162. package/esm2020/grid/grid.service.mjs +44 -0
  163. package/{esm2015/grid/mtxGrid.js → esm2020/grid/mtxGrid.mjs} +0 -0
  164. package/esm2020/grid/public-api.mjs +16 -0
  165. package/esm2020/loader/loader.component.mjs +63 -0
  166. package/esm2020/loader/loader.module.mjs +20 -0
  167. package/{esm2015/loader/mtxLoader.js → esm2020/loader/mtxLoader.mjs} +0 -0
  168. package/{esm2015/loader/public-api.js → esm2020/loader/public-api.mjs} +0 -0
  169. package/esm2020/ng-matero-extensions.mjs +5 -0
  170. package/{esm2015/popover/mtxPopover.js → esm2020/popover/mtxPopover.mjs} +0 -0
  171. package/{esm2015/popover/popover-animations.js → esm2020/popover/popover-animations.mjs} +0 -0
  172. package/{esm2015/popover/popover-errors.js → esm2020/popover/popover-errors.mjs} +0 -0
  173. package/{esm2015/popover/popover-interfaces.js → esm2020/popover/popover-interfaces.mjs} +0 -0
  174. package/esm2020/popover/popover-module.mjs +22 -0
  175. package/esm2020/popover/popover-target.mjs +17 -0
  176. package/esm2020/popover/popover-trigger.mjs +441 -0
  177. package/{esm2015/popover/popover-types.js → esm2020/popover/popover-types.mjs} +0 -0
  178. package/esm2020/popover/popover.mjs +334 -0
  179. package/{esm2015/popover/public-api.js → esm2020/popover/public-api.mjs} +0 -0
  180. package/{esm2015/progress/mtxProgress.js → esm2020/progress/mtxProgress.mjs} +0 -0
  181. package/esm2020/progress/progress.component.mjs +55 -0
  182. package/esm2020/progress/progress.module.mjs +18 -0
  183. package/{esm2015/progress/public-api.js → esm2020/progress/public-api.mjs} +0 -0
  184. package/esm2020/public-api.mjs +5 -0
  185. package/{esm2015/select/mtxSelect.js → esm2020/select/mtxSelect.mjs} +0 -0
  186. package/{esm2015/select/option.component.js → esm2020/select/option.component.mjs} +18 -26
  187. package/{esm2015/select/public-api.js → esm2020/select/public-api.mjs} +0 -0
  188. package/esm2020/select/select.component.mjs +459 -0
  189. package/esm2020/select/select.module.mjs +74 -0
  190. package/esm2020/select/templates.directive.mjs +124 -0
  191. package/{esm2015/slider/mtxSlider.js → esm2020/slider/mtxSlider.mjs} +0 -0
  192. package/{esm2015/slider/public-api.js → esm2020/slider/public-api.mjs} +0 -0
  193. package/esm2020/slider/slider-module.mjs +19 -0
  194. package/esm2020/slider/slider.mjs +1115 -0
  195. package/{esm2015/split/interface.js → esm2020/split/interface.mjs} +0 -0
  196. package/{esm2015/split/mtxSplit.js → esm2020/split/mtxSplit.mjs} +0 -0
  197. package/{esm2015/split/public-api.js → esm2020/split/public-api.mjs} +0 -0
  198. package/esm2020/split/split-pane.directive.mjs +149 -0
  199. package/esm2020/split/split.component.mjs +619 -0
  200. package/esm2020/split/split.module.mjs +19 -0
  201. package/{esm2015/split/utils.js → esm2020/split/utils.mjs} +0 -0
  202. package/{esm2015/text3d/mtxText3d.js → esm2020/text3d/mtxText3d.mjs} +0 -0
  203. package/{esm2015/text3d/public-api.js → esm2020/text3d/public-api.mjs} +0 -0
  204. package/esm2020/text3d/text3d.component.mjs +45 -0
  205. package/esm2020/text3d/text3d.module.mjs +18 -0
  206. package/{esm2015/tooltip/mtxTooltip.js → esm2020/tooltip/mtxTooltip.mjs} +0 -0
  207. package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
  208. package/{esm2015/tooltip/tooltip-animations.js → esm2020/tooltip/tooltip-animations.mjs} +0 -0
  209. package/esm2020/tooltip/tooltip-module.mjs +23 -0
  210. package/esm2020/tooltip/tooltip.mjs +674 -0
  211. package/fesm2015/mtxAlert.mjs +74 -0
  212. package/fesm2015/mtxAlert.mjs.map +1 -0
  213. package/fesm2015/mtxButton.mjs +102 -0
  214. package/fesm2015/mtxButton.mjs.map +1 -0
  215. package/fesm2015/mtxCheckboxGroup.mjs +257 -0
  216. package/fesm2015/mtxCheckboxGroup.mjs.map +1 -0
  217. package/fesm2015/mtxColorpicker.mjs +754 -0
  218. package/fesm2015/mtxColorpicker.mjs.map +1 -0
  219. package/fesm2015/{mtxColumnResize.js → mtxColumnResize.mjs} +108 -145
  220. package/fesm2015/mtxColumnResize.mjs.map +1 -0
  221. package/fesm2015/mtxCore.mjs +362 -0
  222. package/fesm2015/mtxCore.mjs.map +1 -0
  223. package/fesm2015/mtxDatetimepicker.mjs +2474 -0
  224. package/fesm2015/mtxDatetimepicker.mjs.map +1 -0
  225. package/fesm2015/mtxDialog.mjs +128 -0
  226. package/fesm2015/mtxDialog.mjs.map +1 -0
  227. package/fesm2015/mtxFormGroup.mjs +59 -0
  228. package/fesm2015/mtxFormGroup.mjs.map +1 -0
  229. package/fesm2015/mtxGrid.mjs +1271 -0
  230. package/fesm2015/mtxGrid.mjs.map +1 -0
  231. package/fesm2015/mtxLoader.mjs +87 -0
  232. package/fesm2015/mtxLoader.mjs.map +1 -0
  233. package/fesm2015/mtxPopover.mjs +865 -0
  234. package/fesm2015/mtxPopover.mjs.map +1 -0
  235. package/fesm2015/mtxProgress.mjs +77 -0
  236. package/fesm2015/mtxProgress.mjs.map +1 -0
  237. package/fesm2015/mtxSelect.mjs +713 -0
  238. package/fesm2015/mtxSelect.mjs.map +1 -0
  239. package/fesm2015/mtxSlider.mjs +1139 -0
  240. package/fesm2015/mtxSlider.mjs.map +1 -0
  241. package/fesm2015/{mtxSplit.js → mtxSplit.mjs} +75 -85
  242. package/fesm2015/mtxSplit.mjs.map +1 -0
  243. package/fesm2015/mtxText3d.mjs +67 -0
  244. package/fesm2015/mtxText3d.mjs.map +1 -0
  245. package/fesm2015/{mtxTooltip.js → mtxTooltip.mjs} +83 -86
  246. package/fesm2015/mtxTooltip.mjs.map +1 -0
  247. package/fesm2015/ng-matero-extensions.mjs +9 -0
  248. package/fesm2015/ng-matero-extensions.mjs.map +1 -0
  249. package/fesm2020/mtxAlert.mjs +74 -0
  250. package/fesm2020/mtxAlert.mjs.map +1 -0
  251. package/fesm2020/mtxButton.mjs +102 -0
  252. package/fesm2020/mtxButton.mjs.map +1 -0
  253. package/fesm2020/mtxCheckboxGroup.mjs +257 -0
  254. package/fesm2020/mtxCheckboxGroup.mjs.map +1 -0
  255. package/{fesm2015/mtxColorpicker.js → fesm2020/mtxColorpicker.mjs} +420 -413
  256. package/fesm2020/mtxColorpicker.mjs.map +1 -0
  257. package/fesm2020/mtxColumnResize.mjs +953 -0
  258. package/fesm2020/mtxColumnResize.mjs.map +1 -0
  259. package/{fesm2015/mtxCore.js → fesm2020/mtxCore.mjs} +75 -42
  260. package/fesm2020/mtxCore.mjs.map +1 -0
  261. package/{fesm2015/mtxDatetimepicker.js → fesm2020/mtxDatetimepicker.mjs} +1300 -1306
  262. package/fesm2020/mtxDatetimepicker.mjs.map +1 -0
  263. package/fesm2020/mtxDialog.mjs +129 -0
  264. package/fesm2020/mtxDialog.mjs.map +1 -0
  265. package/fesm2020/mtxFormGroup.mjs +59 -0
  266. package/fesm2020/mtxFormGroup.mjs.map +1 -0
  267. package/fesm2020/mtxGrid.mjs +1259 -0
  268. package/fesm2020/mtxGrid.mjs.map +1 -0
  269. package/fesm2020/mtxLoader.mjs +87 -0
  270. package/fesm2020/mtxLoader.mjs.map +1 -0
  271. package/{fesm2015/mtxPopover.js → fesm2020/mtxPopover.mjs} +120 -111
  272. package/fesm2020/mtxPopover.mjs.map +1 -0
  273. package/fesm2020/mtxProgress.mjs +77 -0
  274. package/fesm2020/mtxProgress.mjs.map +1 -0
  275. package/fesm2020/mtxSelect.mjs +710 -0
  276. package/fesm2020/mtxSelect.mjs.map +1 -0
  277. package/{fesm2015/mtxSlider.js → fesm2020/mtxSlider.mjs} +97 -94
  278. package/fesm2020/mtxSlider.mjs.map +1 -0
  279. package/fesm2020/mtxSplit.mjs +1007 -0
  280. package/fesm2020/mtxSplit.mjs.map +1 -0
  281. package/fesm2020/mtxText3d.mjs +67 -0
  282. package/fesm2020/mtxText3d.mjs.map +1 -0
  283. package/fesm2020/mtxTooltip.mjs +718 -0
  284. package/fesm2020/mtxTooltip.mjs.map +1 -0
  285. package/fesm2020/ng-matero-extensions.mjs +9 -0
  286. package/fesm2020/ng-matero-extensions.mjs.map +1 -0
  287. package/form-group/_form-group-theme.scss +1 -1
  288. package/form-group/form-group.component.d.ts +3 -0
  289. package/form-group/form-group.module.d.ts +6 -0
  290. package/form-group/mtxFormGroup.d.ts +1 -0
  291. package/form-group/package.json +5 -6
  292. package/grid/_grid-theme.scss +1 -1
  293. package/grid/cell.component.d.ts +3 -0
  294. package/grid/column-menu.component.d.ts +3 -0
  295. package/grid/column-menu.component.scss +1 -1
  296. package/grid/column-resize/_column-resize.scss +3 -3
  297. package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
  298. package/grid/column-resize/column-resize-directives/column-resize.d.ts +3 -0
  299. package/grid/column-resize/column-resize-module.d.ts +12 -7
  300. package/grid/column-resize/overlay-handle.d.ts +3 -0
  301. package/grid/column-resize/resizable-directives/resizable.d.ts +3 -0
  302. package/grid/column-resize/resize-strategy.d.ts +3 -0
  303. package/grid/expansion-toggle.directive.d.ts +3 -0
  304. package/grid/grid.component.d.ts +20 -1
  305. package/grid/grid.module.d.ts +26 -0
  306. package/grid/grid.service.d.ts +3 -0
  307. package/grid/mtxGrid.d.ts +1 -0
  308. package/grid/package.json +5 -6
  309. package/grid/public-api.d.ts +0 -1
  310. package/loader/_loader-theme.scss +1 -1
  311. package/loader/loader.component.d.ts +3 -0
  312. package/loader/loader.module.d.ts +8 -0
  313. package/loader/mtxLoader.d.ts +1 -0
  314. package/loader/package.json +5 -6
  315. package/{extensions.d.ts → ng-matero-extensions.d.ts} +1 -0
  316. package/package.json +178 -15
  317. package/popover/_popover-theme.scss +1 -1
  318. package/popover/mtxPopover.d.ts +1 -0
  319. package/popover/package.json +5 -6
  320. package/popover/popover-module.d.ts +10 -0
  321. package/popover/popover-target.d.ts +3 -0
  322. package/popover/popover-trigger.d.ts +3 -0
  323. package/popover/popover.d.ts +3 -0
  324. package/progress/_progress-theme.scss +2 -2
  325. package/progress/mtxProgress.d.ts +1 -0
  326. package/progress/package.json +5 -6
  327. package/progress/progress.component.d.ts +3 -0
  328. package/progress/progress.module.d.ts +6 -0
  329. package/public-api.d.ts +2 -19
  330. package/select/_select-theme.scss +1 -1
  331. package/select/mtxSelect.d.ts +1 -0
  332. package/select/option.component.d.ts +3 -0
  333. package/select/package.json +5 -6
  334. package/select/select.component.d.ts +3 -0
  335. package/select/select.component.scss +1 -1
  336. package/select/select.module.d.ts +10 -0
  337. package/select/templates.directive.d.ts +23 -0
  338. package/slider/_slider-theme.scss +4 -4
  339. package/slider/mtxSlider.d.ts +1 -0
  340. package/slider/package.json +5 -6
  341. package/slider/slider-module.d.ts +7 -0
  342. package/slider/slider.d.ts +4 -1
  343. package/slider/slider.scss +7 -7
  344. package/split/_split-theme.scss +1 -1
  345. package/split/mtxSplit.d.ts +1 -0
  346. package/split/package.json +5 -6
  347. package/split/split-pane.directive.d.ts +3 -0
  348. package/split/split.component.d.ts +4 -1
  349. package/split/split.module.d.ts +7 -0
  350. package/text3d/_text3d-theme.scss +2 -2
  351. package/text3d/mtxText3d.d.ts +1 -0
  352. package/text3d/package.json +5 -6
  353. package/text3d/text3d.component.d.ts +3 -0
  354. package/text3d/text3d.module.d.ts +6 -0
  355. package/tooltip/_tooltip-theme.scss +3 -3
  356. package/tooltip/mtxTooltip.d.ts +1 -0
  357. package/tooltip/package.json +5 -6
  358. package/tooltip/tooltip-module.d.ts +10 -0
  359. package/tooltip/tooltip.d.ts +5 -0
  360. package/tooltip/tooltip.scss +1 -1
  361. package/alert/mtxAlert.metadata.json +0 -1
  362. package/bundles/extensions.umd.js +0 -164
  363. package/bundles/extensions.umd.js.map +0 -1
  364. package/bundles/mtxAlert.umd.js +0 -101
  365. package/bundles/mtxAlert.umd.js.map +0 -1
  366. package/bundles/mtxButton.umd.js +0 -119
  367. package/bundles/mtxButton.umd.js.map +0 -1
  368. package/bundles/mtxCheckboxGroup.umd.js +0 -284
  369. package/bundles/mtxCheckboxGroup.umd.js.map +0 -1
  370. package/bundles/mtxColorpicker.umd.js +0 -1123
  371. package/bundles/mtxColorpicker.umd.js.map +0 -1
  372. package/bundles/mtxColumnResize.umd.js +0 -1339
  373. package/bundles/mtxColumnResize.umd.js.map +0 -1
  374. package/bundles/mtxCore.umd.js +0 -670
  375. package/bundles/mtxCore.umd.js.map +0 -1
  376. package/bundles/mtxDatetimepicker.umd.js +0 -3045
  377. package/bundles/mtxDatetimepicker.umd.js.map +0 -1
  378. package/bundles/mtxDialog.umd.js +0 -158
  379. package/bundles/mtxDialog.umd.js.map +0 -1
  380. package/bundles/mtxFormGroup.umd.js +0 -73
  381. package/bundles/mtxFormGroup.umd.js.map +0 -1
  382. package/bundles/mtxGrid.umd.js +0 -1581
  383. package/bundles/mtxGrid.umd.js.map +0 -1
  384. package/bundles/mtxLoader.umd.js +0 -107
  385. package/bundles/mtxLoader.umd.js.map +0 -1
  386. package/bundles/mtxPipes.umd.js +0 -44
  387. package/bundles/mtxPipes.umd.js.map +0 -1
  388. package/bundles/mtxPopover.umd.js +0 -1260
  389. package/bundles/mtxPopover.umd.js.map +0 -1
  390. package/bundles/mtxProgress.umd.js +0 -92
  391. package/bundles/mtxProgress.umd.js.map +0 -1
  392. package/bundles/mtxSelect.umd.js +0 -1097
  393. package/bundles/mtxSelect.umd.js.map +0 -1
  394. package/bundles/mtxSlider.umd.js +0 -1551
  395. package/bundles/mtxSlider.umd.js.map +0 -1
  396. package/bundles/mtxSplit.umd.js +0 -1431
  397. package/bundles/mtxSplit.umd.js.map +0 -1
  398. package/bundles/mtxText3d.umd.js +0 -84
  399. package/bundles/mtxText3d.umd.js.map +0 -1
  400. package/bundles/mtxTooltip.umd.js +0 -1083
  401. package/bundles/mtxTooltip.umd.js.map +0 -1
  402. package/button/mtxButton.metadata.json +0 -1
  403. package/checkbox-group/mtxCheckboxGroup.metadata.json +0 -1
  404. package/colorpicker/mtxColorpicker.metadata.json +0 -1
  405. package/column-resize/mtxColumnResize.metadata.json +0 -1
  406. package/core/mtxCore.metadata.json +0 -1
  407. package/datetimepicker/mtxDatetimepicker.metadata.json +0 -1
  408. package/dialog/mtxDialog.metadata.json +0 -1
  409. package/esm2015/alert/alert.component.js +0 -63
  410. package/esm2015/alert/alert.module.js +0 -14
  411. package/esm2015/button/button-loading.directive.js +0 -89
  412. package/esm2015/button/button.module.js +0 -16
  413. package/esm2015/checkbox-group/checkbox-group.component.js +0 -235
  414. package/esm2015/checkbox-group/checkbox-group.module.js +0 -17
  415. package/esm2015/colorpicker/colorpicker-input.js +0 -228
  416. package/esm2015/colorpicker/colorpicker-module.js +0 -41
  417. package/esm2015/colorpicker/colorpicker-toggle.js +0 -97
  418. package/esm2015/colorpicker/colorpicker.js +0 -372
  419. package/esm2015/column-resize/column-resize-directives/column-resize-flex.js +0 -54
  420. package/esm2015/column-resize/column-resize-directives/column-resize.js +0 -54
  421. package/esm2015/column-resize/column-resize-module.js +0 -24
  422. package/esm2015/column-resize/column-resize-notifier.js +0 -54
  423. package/esm2015/column-resize/column-resize.js +0 -80
  424. package/esm2015/column-resize/column-size-store.js +0 -18
  425. package/esm2015/column-resize/event-dispatcher.js +0 -75
  426. package/esm2015/column-resize/overlay-handle.js +0 -144
  427. package/esm2015/column-resize/resizable.js +0 -197
  428. package/esm2015/column-resize/resize-strategy.js +0 -245
  429. package/esm2015/core/datetime/datetime.module.js +0 -32
  430. package/esm2015/core/datetime/native-datetime-adapter.js +0 -144
  431. package/esm2015/datetimepicker/calendar-body.js +0 -76
  432. package/esm2015/datetimepicker/calendar.js +0 -614
  433. package/esm2015/datetimepicker/clock.js +0 -283
  434. package/esm2015/datetimepicker/datetimepicker-input.js +0 -336
  435. package/esm2015/datetimepicker/datetimepicker-module.js +0 -52
  436. package/esm2015/datetimepicker/datetimepicker-toggle.js +0 -103
  437. package/esm2015/datetimepicker/datetimepicker.js +0 -490
  438. package/esm2015/datetimepicker/month-view.js +0 -150
  439. package/esm2015/datetimepicker/multi-year-view.js +0 -215
  440. package/esm2015/datetimepicker/year-view.js +0 -141
  441. package/esm2015/dialog/dialog.component.js +0 -40
  442. package/esm2015/dialog/dialog.js +0 -81
  443. package/esm2015/dialog/dialog.module.js +0 -21
  444. package/esm2015/extensions-experimental.module.js +0 -13
  445. package/esm2015/extensions.js +0 -5
  446. package/esm2015/extensions.module.js +0 -40
  447. package/esm2015/form-group/form-group.component.js +0 -40
  448. package/esm2015/form-group/form-group.module.js +0 -14
  449. package/esm2015/grid/cell-selection.directive.js +0 -62
  450. package/esm2015/grid/cell.component.js +0 -115
  451. package/esm2015/grid/column-menu.component.js +0 -72
  452. package/esm2015/grid/column-resize/column-resize-directives/column-resize-flex.js +0 -47
  453. package/esm2015/grid/column-resize/column-resize-directives/column-resize.js +0 -47
  454. package/esm2015/grid/column-resize/column-resize-module.js +0 -36
  455. package/esm2015/grid/column-resize/overlay-handle.js +0 -68
  456. package/esm2015/grid/column-resize/resizable-directives/resizable.js +0 -75
  457. package/esm2015/grid/column-resize/resize-strategy.js +0 -45
  458. package/esm2015/grid/expansion-toggle.directive.js +0 -62
  459. package/esm2015/grid/grid.component.js +0 -418
  460. package/esm2015/grid/grid.module.js +0 -69
  461. package/esm2015/grid/grid.service.js +0 -50
  462. package/esm2015/grid/public-api.js +0 -17
  463. package/esm2015/loader/loader.component.js +0 -69
  464. package/esm2015/loader/loader.module.js +0 -16
  465. package/esm2015/pipes/mtxPipes.js +0 -5
  466. package/esm2015/pipes/pipes.module.js +0 -14
  467. package/esm2015/pipes/public-api.js +0 -3
  468. package/esm2015/pipes/to-observable.pipe.js +0 -12
  469. package/esm2015/popover/popover-module.js +0 -18
  470. package/esm2015/popover/popover-target.js +0 -24
  471. package/esm2015/popover/popover-trigger.js +0 -434
  472. package/esm2015/popover/popover.js +0 -326
  473. package/esm2015/progress/progress.component.js +0 -54
  474. package/esm2015/progress/progress.module.js +0 -14
  475. package/esm2015/public-api.js +0 -23
  476. package/esm2015/select/select.component.js +0 -380
  477. package/esm2015/select/select.module.js +0 -46
  478. package/esm2015/select/templates.directive.js +0 -211
  479. package/esm2015/slider/slider-module.js +0 -15
  480. package/esm2015/slider/slider.js +0 -1115
  481. package/esm2015/split/split-pane.directive.js +0 -156
  482. package/esm2015/split/split.component.js +0 -624
  483. package/esm2015/split/split.module.js +0 -15
  484. package/esm2015/text3d/text3d.component.js +0 -45
  485. package/esm2015/text3d/text3d.module.js +0 -14
  486. package/esm2015/tooltip/tooltip-module.js +0 -20
  487. package/esm2015/tooltip/tooltip.js +0 -683
  488. package/extensions-experimental.module.d.ts +0 -2
  489. package/extensions.metadata.json +0 -1
  490. package/extensions.module.d.ts +0 -2
  491. package/fesm2015/extensions.js +0 -80
  492. package/fesm2015/extensions.js.map +0 -1
  493. package/fesm2015/mtxAlert.js +0 -82
  494. package/fesm2015/mtxAlert.js.map +0 -1
  495. package/fesm2015/mtxButton.js +0 -108
  496. package/fesm2015/mtxButton.js.map +0 -1
  497. package/fesm2015/mtxCheckboxGroup.js +0 -255
  498. package/fesm2015/mtxCheckboxGroup.js.map +0 -1
  499. package/fesm2015/mtxColorpicker.js.map +0 -1
  500. package/fesm2015/mtxColumnResize.js.map +0 -1
  501. package/fesm2015/mtxCore.js.map +0 -1
  502. package/fesm2015/mtxDatetimepicker.js.map +0 -1
  503. package/fesm2015/mtxDialog.js +0 -141
  504. package/fesm2015/mtxDialog.js.map +0 -1
  505. package/fesm2015/mtxFormGroup.js +0 -59
  506. package/fesm2015/mtxFormGroup.js.map +0 -1
  507. package/fesm2015/mtxGrid.js +0 -1186
  508. package/fesm2015/mtxGrid.js.map +0 -1
  509. package/fesm2015/mtxLoader.js +0 -90
  510. package/fesm2015/mtxLoader.js.map +0 -1
  511. package/fesm2015/mtxPipes.js +0 -31
  512. package/fesm2015/mtxPipes.js.map +0 -1
  513. package/fesm2015/mtxPopover.js.map +0 -1
  514. package/fesm2015/mtxProgress.js +0 -73
  515. package/fesm2015/mtxProgress.js.map +0 -1
  516. package/fesm2015/mtxSelect.js +0 -700
  517. package/fesm2015/mtxSelect.js.map +0 -1
  518. package/fesm2015/mtxSlider.js.map +0 -1
  519. package/fesm2015/mtxSplit.js.map +0 -1
  520. package/fesm2015/mtxText3d.js +0 -64
  521. package/fesm2015/mtxText3d.js.map +0 -1
  522. package/fesm2015/mtxTooltip.js.map +0 -1
  523. package/form-group/mtxFormGroup.metadata.json +0 -1
  524. package/grid/cell-selection.directive.d.ts +0 -17
  525. package/grid/mtxGrid.metadata.json +0 -1
  526. package/loader/mtxLoader.metadata.json +0 -1
  527. package/pipes/mtxPipes.d.ts +0 -4
  528. package/pipes/mtxPipes.metadata.json +0 -1
  529. package/pipes/package.json +0 -11
  530. package/pipes/pipes.module.d.ts +0 -2
  531. package/popover/mtxPopover.metadata.json +0 -1
  532. package/progress/mtxProgress.metadata.json +0 -1
  533. package/select/mtxSelect.metadata.json +0 -1
  534. package/slider/mtxSlider.metadata.json +0 -1
  535. package/split/mtxSplit.metadata.json +0 -1
  536. package/text3d/mtxText3d.metadata.json +0 -1
  537. package/tooltip/mtxTooltip.metadata.json +0 -1
@@ -1,1186 +0,0 @@
1
- import { Injectable, EventEmitter, TemplateRef, Component, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild, ContentChildren, Input, Output, Directive, HostBinding, HostListener, Inject, ElementRef, NgZone, Injector, ViewContainerRef, NgModule } from '@angular/core';
2
- import { DOCUMENT, CommonModule } from '@angular/common';
3
- import { FormsModule } from '@angular/forms';
4
- import { MatTableDataSource, MatTable, MatRowDef, MatHeaderRowDef, MatFooterRow, MatTableModule } from '@angular/material/table';
5
- import { MatSort, MatSortModule } from '@angular/material/sort';
6
- import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
7
- import { MatCheckboxModule } from '@angular/material/checkbox';
8
- import { MatButtonModule } from '@angular/material/button';
9
- import { MatProgressBarModule } from '@angular/material/progress-bar';
10
- import { MatChipsModule } from '@angular/material/chips';
11
- import { MatTooltipModule } from '@angular/material/tooltip';
12
- import { MatIconModule } from '@angular/material/icon';
13
- import { MatSelectModule } from '@angular/material/select';
14
- import { MatFormFieldModule } from '@angular/material/form-field';
15
- import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
16
- import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
17
- import { MtxPipesModule } from '@ng-matero/extensions/pipes';
18
- import { MtxDialog, MtxDialogModule } from '@ng-matero/extensions/dialog';
19
- import { trigger, state, style, transition, animate } from '@angular/animations';
20
- import { SelectionModel } from '@angular/cdk/collections';
21
- import PhotoViewer from 'photoviewer';
22
- import { Overlay, OverlayModule } from '@angular/cdk/overlay';
23
- import { CdkFlexTableResizeStrategy, ColumnResize, ResizeStrategy, ColumnResizeNotifier, HeaderRowEventDispatcher, ColumnResizeNotifierSource, TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER, ResizeOverlayHandle, ResizeRef, Resizable } from '@ng-matero/extensions/column-resize';
24
- export { TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER as MAT_TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER } from '@ng-matero/extensions/column-resize';
25
- import { _CoalescedStyleScheduler, _COALESCED_STYLE_SCHEDULER, CdkTable, CdkColumnDef } from '@angular/cdk/table';
26
- import { Directionality } from '@angular/cdk/bidi';
27
-
28
- class MtxGridService {
29
- constructor() { }
30
- /**
31
- * Get cell value from column key e.g. `a.b.c`
32
- * @param rowData Row data
33
- * @param colDef Column definition
34
- */
35
- getCellValue(rowData, colDef) {
36
- const keyArr = colDef.field ? colDef.field.split('.') : [];
37
- let tmp = '';
38
- keyArr.forEach((key, i) => {
39
- if (i === 0) {
40
- tmp = rowData[key];
41
- }
42
- else {
43
- tmp = tmp && tmp[key];
44
- }
45
- });
46
- return tmp;
47
- }
48
- /**
49
- * Get all data of a col
50
- * @param data All data
51
- * @param colDef Column definition
52
- */
53
- getColData(data, colDef) {
54
- return data.map((rowData) => this.getCellValue(rowData, colDef));
55
- }
56
- /**
57
- * Remove white spaces in a string and convert string to array
58
- * @param str string
59
- */
60
- str2arr(str) {
61
- return str.replace(/[\r\n\s]/g, '').split(',');
62
- }
63
- }
64
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
65
- MtxGridService.decorators = [
66
- { type: Injectable }
67
- ];
68
- /**
69
- * @type {function(): !Array<(null|{
70
- * type: ?,
71
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
72
- * })>}
73
- * @nocollapse
74
- */
75
- MtxGridService.ctorParameters = () => [];
76
-
77
- class MtxGridComponent {
78
- constructor(_dataGridSrv, _changeDetectorRef) {
79
- this._dataGridSrv = _dataGridSrv;
80
- this._changeDetectorRef = _changeDetectorRef;
81
- this.dataSource = new MatTableDataSource();
82
- this.columns = [];
83
- this.data = [];
84
- this.length = 0;
85
- this.loading = false;
86
- this.columnResizable = false;
87
- // ===== Page =====
88
- this.pageOnFront = true;
89
- this.showPaginator = true;
90
- this.pageDisabled = false;
91
- this.showFirstLastButtons = true;
92
- this.pageIndex = 0;
93
- this.pageSize = 10;
94
- this.pageSizeOptions = [10, 50, 100];
95
- this.hidePageSize = false;
96
- this.page = new EventEmitter();
97
- // ===== Sort =====
98
- this.sortOnFront = true;
99
- this.sortDisableClear = false;
100
- this.sortDisabled = false;
101
- this.sortStart = 'asc';
102
- this.sortChange = new EventEmitter();
103
- // ===== Row =====
104
- this.rowHover = false;
105
- this.rowStriped = false;
106
- this.rowClick = new EventEmitter();
107
- // ===== Expandable Row =====
108
- this.expansionRowStates = [];
109
- this.expandable = false;
110
- this.expansionChange = new EventEmitter();
111
- // ===== Row Selection =====
112
- /** Whether support multiple row/cell selection. */
113
- this.multiSelectable = true;
114
- this.multiSelectionWithClick = false;
115
- this.rowSelection = new SelectionModel(true, []);
116
- this.rowSelected = [];
117
- this.rowSelectable = false;
118
- this.hideRowSelectionCheckbox = false;
119
- this.rowSelectionFormatter = {};
120
- this.rowSelectionChange = new EventEmitter();
121
- // ===== Cell Selection =====
122
- this.cellSelection = [];
123
- this.cellSelectable = true;
124
- this.cellSelectionChange = new EventEmitter();
125
- // ===== Toolbar =====
126
- this.showToolbar = false;
127
- this.toolbarTitle = '';
128
- // ===== Column Menu =====
129
- this.columnMenuData = [];
130
- this.showColumnMenuButton = true;
131
- this.columnMenuButtonText = '';
132
- this.columnMenuButtonType = 'stroked';
133
- this.columnMenuButtonClass = '';
134
- this.columnMenuButtonIcon = '';
135
- this.columnHideable = true;
136
- this.columnHideableChecked = 'show';
137
- this.columnMovable = true;
138
- this.columnPinnable = true;
139
- this.columnChange = new EventEmitter();
140
- this.showColumnMenuHeader = false;
141
- this.columnMenuHeaderText = 'Columns Header';
142
- this.showColumnMenuFooter = false;
143
- this.columnMenuFooterText = 'Columns Footer';
144
- // ===== No Result =====
145
- this.noResultText = 'No records found';
146
- // ===== Row Templates =====
147
- this.useContentRowTemplate = false;
148
- // TODO: It can't use together with `useContentRowTemplate`
149
- this.useContentHeaderRowTemplate = false;
150
- // TODO: It's not working
151
- this.useContentFooterRowTemplate = false;
152
- // ===== Summary =====
153
- this.showSummary = false;
154
- // ===== Side Bar =====
155
- this.showSidebar = false;
156
- // ===== Status Bar =====
157
- this.showStatusbar = false;
158
- }
159
- get _hasNoResult() {
160
- return (!this.data || this.data.length === 0) && !this.loading;
161
- }
162
- // TODO: Summary display conditions
163
- get _whetherShowSummary() {
164
- return this.showSummary;
165
- }
166
- detectChanges() {
167
- this._changeDetectorRef.detectChanges();
168
- }
169
- _isTemplateRef(obj) {
170
- return obj instanceof TemplateRef;
171
- }
172
- _getColData(data, colDef) {
173
- return this._dataGridSrv.getColData(data, colDef);
174
- }
175
- _getRowClassList(rowData, index) {
176
- const classList = {
177
- 'selected': this.rowSelection.isSelected(rowData),
178
- 'mat-row-odd': index % 2,
179
- };
180
- if (this.rowClassFormatter) {
181
- for (const key of Object.keys(this.rowClassFormatter)) {
182
- classList[key] = this.rowClassFormatter[key](rowData, index);
183
- }
184
- }
185
- return classList;
186
- }
187
- // Waiting for async data
188
- ngOnChanges(changes) {
189
- var _a;
190
- this._countPinnedPosition();
191
- this.displayedColumns = this.columns.filter(item => !item.hide).map(item => item.field);
192
- if (this.showColumnMenuButton) {
193
- this.columnMenuData = this.columns.map(item => {
194
- const newItem = {
195
- label: item.header,
196
- field: item.field,
197
- disabled: item.disabled,
198
- };
199
- if (this.columnHideableChecked === 'show') {
200
- newItem.show = !item.hide;
201
- }
202
- else {
203
- newItem.hide = item.hide;
204
- }
205
- return newItem;
206
- });
207
- }
208
- if (this.rowSelectable && !this.hideRowSelectionCheckbox) {
209
- this.displayedColumns.unshift('MtxGridCheckboxColumnDef');
210
- }
211
- // We should copy each item of data for expansion data
212
- if (this.expandable) {
213
- this.expansionRowStates = []; // reset
214
- (_a = this.data) === null || _a === void 0 ? void 0 : _a.forEach(_ => {
215
- this.expansionRowStates.push({ expanded: false });
216
- });
217
- }
218
- if (this.rowSelectable) {
219
- this.rowSelection = new SelectionModel(this.multiSelectable, this.rowSelected);
220
- }
221
- this.dataSource = new MatTableDataSource(this.data);
222
- this.dataSource.paginator = this.pageOnFront ? this.paginator : null;
223
- this.dataSource.sort = this.sortOnFront ? this.sort : null;
224
- // Only scroll top with data change
225
- if (changes.data) {
226
- this.scrollTop(0);
227
- }
228
- }
229
- ngAfterViewInit() {
230
- var _a, _b, _c;
231
- if (this.pageOnFront) {
232
- this.dataSource.paginator = this.paginator;
233
- }
234
- if (this.sortOnFront) {
235
- this.dataSource.sort = this.sort;
236
- }
237
- if (((_a = this.rowDefs) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.useContentRowTemplate) {
238
- this.rowDefs.forEach(rowDef => this.table.addRowDef(rowDef));
239
- }
240
- if (((_b = this.headerRowDefs) === null || _b === void 0 ? void 0 : _b.length) > 0 && this.useContentHeaderRowTemplate) {
241
- this.headerRowDefs.forEach(headerRowDef => this.table.addHeaderRowDef(headerRowDef));
242
- }
243
- if (((_c = this.footerRowDefs) === null || _c === void 0 ? void 0 : _c.length) > 0 && this.useContentFooterRowTemplate) {
244
- this.footerRowDefs.forEach(footerRowDef => this.table.addFooterRowDef(footerRowDef));
245
- }
246
- }
247
- ngOnDestroy() { }
248
- _countPinnedPosition() {
249
- const count = (acc, cur) => acc + parseFloat(cur.width || '80px');
250
- const pinnedLeftCols = this.columns.filter(col => col.pinned && col.pinned === 'left');
251
- pinnedLeftCols.forEach((item, idx) => {
252
- item.left = pinnedLeftCols.slice(0, idx).reduce(count, 0) + 'px';
253
- });
254
- const pinnedRightCols = this.columns
255
- .filter(col => col.pinned && col.pinned === 'right')
256
- .reverse();
257
- pinnedRightCols.forEach((item, idx) => {
258
- item.right = pinnedRightCols.slice(0, idx).reduce(count, 0) + 'px';
259
- });
260
- }
261
- _getIndex(index, dataIndex) {
262
- return typeof index === 'undefined' ? dataIndex : index;
263
- }
264
- _handleSortChange(sort) {
265
- this.sortChange.emit(sort);
266
- }
267
- /** Expansion change event */
268
- _handleExpansionChange(expansionRef, rowData, column, index) {
269
- this.expansionChange.emit({ expanded: expansionRef.expanded, data: rowData, index, column });
270
- }
271
- /** Cell select event */
272
- _selectCell(cellRef, rowData, colDef) {
273
- // If not the same cell
274
- if (this._selectedCell !== cellRef) {
275
- const colValue = this._dataGridSrv.getCellValue(rowData, colDef);
276
- this.cellSelection = []; // reset
277
- this.cellSelection.push({ cellData: colValue, rowData, colDef });
278
- this.cellSelectionChange.emit(this.cellSelection);
279
- if (this._selectedCell) {
280
- this._selectedCell.deselect(); // the selectedCell will be undefined
281
- }
282
- }
283
- this._selectedCell = cellRef.selected ? cellRef : undefined;
284
- }
285
- /** Row select event */
286
- _selectRow(event, rowData, index) {
287
- var _a, _b, _c, _d;
288
- if (this.rowSelectable &&
289
- !((_b = (_a = this.rowSelectionFormatter).disabled) === null || _b === void 0 ? void 0 : _b.call(_a, rowData, index)) &&
290
- !((_d = (_c = this.rowSelectionFormatter).hideCheckbox) === null || _d === void 0 ? void 0 : _d.call(_c, rowData, index))) {
291
- // metaKey -> command key
292
- if (!this.multiSelectionWithClick && !event.ctrlKey && !event.metaKey) {
293
- this.rowSelection.clear();
294
- }
295
- this._toggleNormalCheckbox(rowData);
296
- }
297
- this.rowClick.emit({ rowData, index });
298
- }
299
- /** Whether the number of selected elements matches the total number of rows. */
300
- _isAllSelected() {
301
- const numSelected = this.rowSelection.selected.length;
302
- const numRows = this.dataSource.data.filter((row, index) => { var _a, _b; return !((_b = (_a = this.rowSelectionFormatter).disabled) === null || _b === void 0 ? void 0 : _b.call(_a, row, index)); }).length;
303
- return numSelected === numRows;
304
- }
305
- /** Select all rows if they are not all selected; otherwise clear selection. */
306
- _toggleMasterCheckbox() {
307
- this._isAllSelected()
308
- ? this.rowSelection.clear()
309
- : this.dataSource.data.forEach((row, index) => {
310
- var _a, _b;
311
- if (!((_b = (_a = this.rowSelectionFormatter).disabled) === null || _b === void 0 ? void 0 : _b.call(_a, row, index))) {
312
- this.rowSelection.select(row);
313
- }
314
- });
315
- this.rowSelectionChange.emit(this.rowSelection.selected);
316
- }
317
- /** Select normal row */
318
- _toggleNormalCheckbox(row) {
319
- this.rowSelection.toggle(row);
320
- this.rowSelectionChange.emit(this.rowSelection.selected);
321
- }
322
- /** Column change event */
323
- _handleColumnChange(columns) {
324
- this.columnChange.emit(columns);
325
- this.displayedColumns = Object.assign([], this.getDisplayedColumnFields(columns));
326
- if (this.rowSelectable && !this.hideRowSelectionCheckbox) {
327
- this.displayedColumns.unshift('MtxGridCheckboxColumnDef');
328
- }
329
- }
330
- getDisplayedColumnFields(columns) {
331
- const fields = columns
332
- .filter((item) => this.columnHideableChecked === 'show' ? item.show : !item.hide)
333
- .map((item) => item.field);
334
- return fields;
335
- }
336
- /** Customize expansion event */
337
- toggleExpansion(index) {
338
- if (!this.expandable) {
339
- throw new Error('The `expandable` should be set true.');
340
- }
341
- this.expansionRowStates[index].expanded = !this.expansionRowStates[index].expanded;
342
- return this.expansionRowStates[index].expanded;
343
- }
344
- /** Scroll to top when turn to the next page. */
345
- _handlePage(e) {
346
- if (this.pageOnFront) {
347
- this.scrollTop(0);
348
- }
349
- this.page.emit(e);
350
- }
351
- scrollTop(value) {
352
- var _a;
353
- if (value == null) {
354
- return (_a = this.tableContainer) === null || _a === void 0 ? void 0 : _a.nativeElement.scrollTop;
355
- }
356
- if (this.tableContainer && !this.loading) {
357
- this.tableContainer.nativeElement.scrollTop = value;
358
- }
359
- }
360
- scrollLeft(value) {
361
- var _a;
362
- if (value == null) {
363
- return (_a = this.tableContainer) === null || _a === void 0 ? void 0 : _a.nativeElement.scrollLeft;
364
- }
365
- if (this.tableContainer && !this.loading) {
366
- this.tableContainer.nativeElement.scrollLeft = value;
367
- }
368
- }
369
- }
370
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
371
- MtxGridComponent.decorators = [
372
- { type: Component, args: [{
373
- selector: 'mtx-grid',
374
- exportAs: 'mtxGrid',
375
- template: "<!-- Progress bar-->\r\n<div class=\"mtx-grid-progress\" *ngIf=\"loading\">\r\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n</div>\r\n\r\n<!-- Toolbar -->\r\n<div class=\"mtx-grid-toolbar\" *ngIf=\"showToolbar\">\r\n <div class=\"mtx-grid-toolbar-content\">\r\n <ng-template [ngIf]=\"_isTemplateRef(toolbarTemplate)\" [ngIfElse]=\"defaultToolbarTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"toolbarTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultToolbarTemplate>\r\n <div class=\"mtx-grid-toolbar-title\" *ngIf=\"toolbarTitle\">{{toolbarTitle}}</div>\r\n </ng-template>\r\n </div>\r\n <div class=\"mtx-grid-toolbar-actions\">\r\n <mtx-grid-column-menu *ngIf=\"showColumnMenuButton\" #columnMenu\r\n [columns]=\"columnMenuData\"\r\n [buttonText]=\"columnMenuButtonText\"\r\n [buttonType]=\"columnMenuButtonType\"\r\n [buttonColor]=\"columnMenuButtonColor\"\r\n [buttonClass]=\"columnMenuButtonClass\"\r\n [buttonIcon]=\"columnMenuButtonIcon\"\r\n [selectable]=\"columnHideable\"\r\n [selectableChecked]=\"columnHideableChecked\"\r\n [sortable]=\"columnMovable\"\r\n (selectionChange)=\"_handleColumnChange($event)\"\r\n (sortChange)=\"_handleColumnChange($event)\"\r\n [showHeader]=\"showColumnMenuHeader\"\r\n [headerText]=\"columnMenuHeaderText\"\r\n [headerTemplate]=\"columnMenuHeaderTemplate\"\r\n [showFooter]=\"showColumnMenuFooter\"\r\n [footerText]=\"columnMenuFooterText\"\r\n [footerTemplate]=\"columnMenuFooterTemplate\">\r\n </mtx-grid-column-menu>\r\n </div>\r\n</div>\r\n\r\n<div class=\"mtx-grid-main mtx-grid-layout\">\r\n <!-- Table content -->\r\n <div class=\"mtx-grid-content mtx-grid-layout\">\r\n <div #tableContainer class=\"mat-table-container\"\r\n [ngClass]=\"{'mat-table-with-data': !_hasNoResult}\">\r\n <table mat-table *ngIf=\"!columnResizable\"\r\n [ngClass]=\"{'mat-table-hover': rowHover, 'mat-table-striped': rowStriped, 'mat-table-expandable': expandable}\"\r\n [dataSource]=\"dataSource\" [multiTemplateDataRows]=\"expandable\"\r\n matSort\r\n [matSortActive]=\"sortActive\"\r\n [matSortDirection]=\"sortDirection\"\r\n [matSortDisableClear]=\"sortDisableClear\"\r\n [matSortDisabled]=\"sortDisabled\"\r\n [matSortStart]=\"sortStart\"\r\n (matSortChange)=\"_handleSortChange($event)\"\r\n [trackBy]=\"trackBy\">\r\n\r\n <ng-container *ngIf=\"rowSelectable && !hideRowSelectionCheckbox\"\r\n matColumnDef=\"MtxGridCheckboxColumnDef\">\r\n <th mat-header-cell *matHeaderCellDef class=\"mtx-grid-checkbox-cell\">\r\n <mat-checkbox *ngIf=\"multiSelectable\"\r\n [checked]=\"rowSelection.hasValue() && _isAllSelected()\"\r\n [indeterminate]=\"rowSelection.hasValue() && !_isAllSelected()\"\r\n (change)=\"$event ? _toggleMasterCheckbox() : null\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row; let index = index; let dataIndex = dataIndex;\"\r\n class=\"mtx-grid-checkbox-cell\">\r\n <mat-checkbox *ngIf=\"!(rowSelectionFormatter.hideCheckbox && rowSelectionFormatter.hideCheckbox(row, _getIndex(index, dataIndex)))\"\r\n [disabled]=\"rowSelectionFormatter.disabled && rowSelectionFormatter.disabled(row, _getIndex(index, dataIndex))\"\r\n [checked]=\"rowSelection.isSelected(row)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? _toggleNormalCheckbox(row) : null\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef class=\"mtx-grid-checkbox-cell\"></td>\r\n </ng-container>\r\n\r\n <ng-container *ngFor=\"let col of columns;\">\r\n <ng-container [matColumnDef]=\"col.field\"\r\n [sticky]=\"col.pinned==='left'\" [stickyEnd]=\"col.pinned==='right'\">\r\n <th mat-header-cell *matHeaderCellDef\r\n [class]=\"col.class!\"\r\n [ngClass]=\"{'mat-table-sticky-left': col.pinned === 'left', 'mat-table-sticky-right': col.pinned === 'right'}\"\r\n [ngStyle]=\"{'width': col.width, 'min-width': col.width, 'left': col.left, 'right': col.right}\">\r\n <div class=\"mat-header-cell-inner\">\r\n <ng-template [ngIf]=\"_isTemplateRef(headerTemplate)\" [ngIfElse]=\"headerTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #headerTpl>\r\n <ng-template [ngIf]=\"headerTemplate && _isTemplateRef(headerTemplate[col.field])\"\r\n [ngIfElse]=\"defaultHeaderTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate[col.field]\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #defaultHeaderTpl>\r\n <div [mat-sort-header]=\"col.sortProp?.id || col.field\"\r\n [disabled]=\"!col.sortable\"\r\n [arrowPosition]=\"col.sortProp?.arrowPosition!\"\r\n [disableClear]=\"col.sortProp?.disableClear\"\r\n [start]=\"col.sortProp?.start!\">\r\n <span class=\"mtx-grid-expansion-placeholder\" *ngIf=\"col.showExpand\"></span>\r\n <span>{{col.header | toObservable | async}}</span>\r\n <mat-icon class=\"mat-sort-header-icon\" *ngIf=\"col.sortable\">sort</mat-icon>\r\n </div>\r\n <ng-template [ngTemplateOutlet]=\"headerExtraTplBase\"\r\n [ngTemplateOutletContext]=\"{ $implicit: headerExtraTemplate, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </div>\r\n </th>\r\n\r\n <td mat-cell *matCellDef=\"let row; let index = index; let dataIndex = dataIndex;\"\r\n [class]=\"col.class!\"\r\n [ngClass]=\"{'mat-table-sticky-left': col.pinned === 'left', 'mat-table-sticky-right': col.pinned === 'right'}\"\r\n [ngStyle]=\"{'width': col.width, 'min-width': col.width, 'left': col.left, 'right': col.right}\"\r\n mtx-grid-selectable-cell (cellSelectionChange)=\"_selectCell($event, row, col)\">\r\n <ng-template [ngIf]=\"_isTemplateRef(cellTemplate)\" [ngIfElse]=\"cellTpl\">\r\n <ng-template [ngTemplateOutlet]=\"cellTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: _getIndex(index, dataIndex), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #cellTpl>\r\n <ng-template [ngIf]=\"cellTemplate && _isTemplateRef(cellTemplate[col.field])\"\r\n [ngIfElse]=\"colDefCellTpl\">\r\n <ng-template [ngTemplateOutlet]=\"cellTemplate[col.field]\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: _getIndex(index, dataIndex), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #colDefCellTpl>\r\n <ng-template [ngIf]=\"col.cellTemplate\" [ngIfElse]=\"defaultCellTpl\"\r\n [ngTemplateOutlet]=\"col.cellTemplate!\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: _getIndex(index, dataIndex), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #defaultCellTpl>\r\n <button *ngIf=\"col.showExpand\" mat-icon-button mtx-grid-expansion-toggle\r\n [(opened)]=\"expansionRowStates[dataIndex].expanded\"\r\n (toggleChange)=\"_handleExpansionChange($event, row, col, dataIndex);\">\r\n <mat-icon>keyboard_arrow_right</mat-icon>\r\n </button>\r\n\r\n <mtx-grid-cell [rowData]=\"row\" [colDef]=\"col\"></mtx-grid-cell>\r\n </ng-template>\r\n </td>\r\n\r\n <td mat-footer-cell *matFooterCellDef\r\n [ngClass]=\"{'mat-table-sticky-left': col.pinned === 'left', 'mat-table-sticky-right': col.pinned === 'right'}\"\r\n [ngStyle]=\"{'width': col.width, 'min-width': col.width, 'left': col.left, 'right': col.right}\">\r\n <span class=\"mtx-grid-expansion-placeholder\" *ngIf=\"col.showExpand\"></span>\r\n\r\n <ng-template [ngIf]=\"_isTemplateRef(summaryTemplate)\" [ngIfElse]=\"summaryTpl\">\r\n <ng-template [ngTemplateOutlet]=\"summaryTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col, data: data }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #summaryTpl>\r\n <ng-template [ngIf]=\"summaryTemplate && _isTemplateRef(summaryTemplate[col.field])\"\r\n [ngIfElse]=\"defaultSummaryTpl\">\r\n <ng-template [ngTemplateOutlet]=\"summaryTemplate[col.field]\"\r\n [ngTemplateOutletContext]=\"{ $implicit: _getColData(data, col), colData: _getColData(data, col), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #defaultSummaryTpl>\r\n <mtx-grid-cell [summary]=\"true\" [data]=\"data\" [colDef]=\"col\">\r\n </mtx-grid-cell>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-template [ngIf]=\"useContentHeaderRowTemplate\" [ngIfElse]=\"defaultHeaderRowTpl\">\r\n </ng-template>\r\n <ng-template #defaultHeaderRowTpl>\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"useContentRowTemplate\" [ngIfElse]=\"defaultRowTpl\"></ng-template>\r\n <ng-template #defaultRowTpl>\r\n <tr mat-row\r\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: displayedColumns;\"\r\n [ngClass]=\"_getRowClassList(row, _getIndex(index, dataIndex))\"\r\n (click)=\"_selectRow($event, row, _getIndex(index, dataIndex))\">\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"_whetherShowSummary\">\r\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns; sticky: true\"></tr>\r\n </ng-template>\r\n <ng-template [ngIf]=\"useContentFooterRowTemplate\"></ng-template>\r\n\r\n <ng-container *ngIf=\"expandable\">\r\n <!-- Expanded Content Column - The expandable row is made up of this one column that spans across all columns -->\r\n <ng-container matColumnDef=\"MtxGridExpansionColumnDef\">\r\n <td mat-cell *matCellDef=\"let row; let dataIndex = dataIndex\"\r\n [attr.colspan]=\"displayedColumns.length\">\r\n <div class=\"mtx-grid-expansion-detail\"\r\n [@expansion]=\"expansionRowStates[dataIndex].expanded ? 'expanded' : 'collapsed'\">\r\n <ng-template [ngTemplateOutlet]=\"expansionTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: dataIndex, expanded: expansionRowStates[dataIndex].expanded }\">\r\n </ng-template>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-row\r\n *matRowDef=\"let row; columns: ['MtxGridExpansionColumnDef']; let dataIndex = dataIndex\"\r\n [ngClass]=\"['mtx-grid-expansion', expansionRowStates[dataIndex].expanded ? 'expanded' : 'collapsed']\">\r\n </tr>\r\n </ng-container>\r\n </table>\r\n\r\n <!-- TODO: Use flexbox-based mat-table -->\r\n <table mat-table *ngIf=\"columnResizable\"\r\n columnResize\r\n [ngClass]=\"{'mat-table-hover': rowHover, 'mat-table-striped': rowStriped, 'mat-table-expandable': expandable}\"\r\n [dataSource]=\"dataSource\" [multiTemplateDataRows]=\"expandable\"\r\n matSort\r\n [matSortActive]=\"sortActive\"\r\n [matSortDirection]=\"sortDirection\"\r\n [matSortDisableClear]=\"sortDisableClear\"\r\n [matSortDisabled]=\"sortDisabled\"\r\n [matSortStart]=\"sortStart\"\r\n (matSortChange)=\"_handleSortChange($event)\"\r\n [trackBy]=\"trackBy\">\r\n\r\n <ng-container *ngIf=\"rowSelectable && !hideRowSelectionCheckbox\"\r\n matColumnDef=\"MtxGridCheckboxColumnDef\">\r\n <th mat-header-cell *matHeaderCellDef class=\"mtx-grid-checkbox-cell\">\r\n <mat-checkbox *ngIf=\"multiSelectable\"\r\n [checked]=\"rowSelection.hasValue() && _isAllSelected()\"\r\n [indeterminate]=\"rowSelection.hasValue() && !_isAllSelected()\"\r\n (change)=\"$event ? _toggleMasterCheckbox() : null\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row; let index = index; let dataIndex = dataIndex;\"\r\n class=\"mtx-grid-checkbox-cell\">\r\n <mat-checkbox *ngIf=\"!(rowSelectionFormatter.hideCheckbox && rowSelectionFormatter.hideCheckbox(row, _getIndex(index, dataIndex)))\"\r\n [disabled]=\"rowSelectionFormatter.disabled && rowSelectionFormatter.disabled(row, _getIndex(index, dataIndex))\"\r\n [checked]=\"rowSelection.isSelected(row)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? _toggleNormalCheckbox(row) : null\">\r\n </mat-checkbox>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef class=\"mtx-grid-checkbox-cell\"></td>\r\n </ng-container>\r\n\r\n <ng-container *ngFor=\"let col of columns;\">\r\n <ng-container [matColumnDef]=\"col.field\"\r\n [sticky]=\"col.pinned==='left'\" [stickyEnd]=\"col.pinned==='right'\">\r\n <th mat-header-cell *matHeaderCellDef\r\n [class]=\"col.class!\"\r\n [ngClass]=\"{'mat-table-sticky-left': col.pinned === 'left', 'mat-table-sticky-right': col.pinned === 'right'}\"\r\n [ngStyle]=\"{'width': col.width, 'left': col.left, 'right': col.right}\"\r\n [resizable]=\"col.resizable\"\r\n [matResizableMinWidthPx]=\"col.minWidth\" [matResizableMaxWidthPx]=\"col.maxWidth\">\r\n <div class=\"mat-header-cell-inner\">\r\n <ng-template [ngIf]=\"_isTemplateRef(headerTemplate)\" [ngIfElse]=\"headerTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #headerTpl>\r\n <ng-template [ngIf]=\"headerTemplate && _isTemplateRef(headerTemplate[col.field])\"\r\n [ngIfElse]=\"defaultHeaderTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate[col.field]\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #defaultHeaderTpl>\r\n <div [mat-sort-header]=\"col.sortProp?.id || col.field\"\r\n [disabled]=\"!col.sortable\"\r\n [arrowPosition]=\"col.sortProp?.arrowPosition!\"\r\n [disableClear]=\"col.sortProp?.disableClear\"\r\n [start]=\"col.sortProp?.start!\">\r\n <span class=\"mtx-grid-expansion-placeholder\" *ngIf=\"col.showExpand\"></span>\r\n <span>{{col.header | toObservable | async}}</span>\r\n <mat-icon class=\"mat-sort-header-icon\" *ngIf=\"col.sortable\">sort</mat-icon>\r\n </div>\r\n <ng-template [ngTemplateOutlet]=\"headerExtraTplBase\"\r\n [ngTemplateOutletContext]=\"{ $implicit: headerExtraTemplate, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </div>\r\n </th>\r\n\r\n <td mat-cell *matCellDef=\"let row; let index = index; let dataIndex = dataIndex;\"\r\n [class]=\"col.class!\"\r\n [ngClass]=\"{'mat-table-sticky-left': col.pinned === 'left', 'mat-table-sticky-right': col.pinned === 'right'}\"\r\n [ngStyle]=\"{'width': col.width, 'left': col.left, 'right': col.right}\"\r\n mtx-grid-selectable-cell (cellSelectionChange)=\"_selectCell($event, row, col)\">\r\n <ng-template [ngIf]=\"_isTemplateRef(cellTemplate)\" [ngIfElse]=\"cellTpl\">\r\n <ng-template [ngTemplateOutlet]=\"cellTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: _getIndex(index, dataIndex), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #cellTpl>\r\n <ng-template [ngIf]=\"cellTemplate && _isTemplateRef(cellTemplate[col.field])\"\r\n [ngIfElse]=\"colDefCellTpl\">\r\n <ng-template [ngTemplateOutlet]=\"cellTemplate[col.field]\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: _getIndex(index, dataIndex), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #colDefCellTpl>\r\n <ng-template [ngIf]=\"col.cellTemplate\" [ngIfElse]=\"defaultCellTpl\"\r\n [ngTemplateOutlet]=\"col.cellTemplate!\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: _getIndex(index, dataIndex), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #defaultCellTpl>\r\n <button *ngIf=\"col.showExpand\" mat-icon-button mtx-grid-expansion-toggle\r\n [(opened)]=\"expansionRowStates[dataIndex].expanded\"\r\n (toggleChange)=\"_handleExpansionChange($event, row, col, dataIndex);\">\r\n <mat-icon>keyboard_arrow_right</mat-icon>\r\n </button>\r\n\r\n <mtx-grid-cell [rowData]=\"row\" [colDef]=\"col\"></mtx-grid-cell>\r\n </ng-template>\r\n </td>\r\n\r\n <td mat-footer-cell *matFooterCellDef\r\n [ngClass]=\"{'mat-table-sticky-left': col.pinned === 'left', 'mat-table-sticky-right': col.pinned === 'right'}\"\r\n [ngStyle]=\"{'width': col.width, 'left': col.left, 'right': col.right}\">\r\n <span class=\"mtx-grid-expansion-placeholder\" *ngIf=\"col.showExpand\"></span>\r\n\r\n <ng-template [ngIf]=\"_isTemplateRef(summaryTemplate)\" [ngIfElse]=\"summaryTpl\">\r\n <ng-template [ngTemplateOutlet]=\"summaryTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col, data: data }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #summaryTpl>\r\n <ng-template [ngIf]=\"summaryTemplate && _isTemplateRef(summaryTemplate[col.field])\"\r\n [ngIfElse]=\"defaultSummaryTpl\">\r\n <ng-template [ngTemplateOutlet]=\"summaryTemplate[col.field]\"\r\n [ngTemplateOutletContext]=\"{ $implicit: _getColData(data, col), colData: _getColData(data, col), colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #defaultSummaryTpl>\r\n <mtx-grid-cell [summary]=\"true\" [data]=\"data\" [colDef]=\"col\">\r\n </mtx-grid-cell>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-template [ngIf]=\"useContentHeaderRowTemplate\" [ngIfElse]=\"defaultHeaderRowTpl\">\r\n </ng-template>\r\n <ng-template #defaultHeaderRowTpl>\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky: true\"></tr>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"useContentRowTemplate\" [ngIfElse]=\"defaultRowTpl\"></ng-template>\r\n <ng-template #defaultRowTpl>\r\n <tr mat-row\r\n *matRowDef=\"let row; let index = index; let dataIndex = dataIndex; columns: displayedColumns;\"\r\n [ngClass]=\"_getRowClassList(row, _getIndex(index, dataIndex))\"\r\n (click)=\"_selectRow($event, row, _getIndex(index, dataIndex))\">\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template [ngIf]=\"_whetherShowSummary\">\r\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns; sticky: true\"></tr>\r\n </ng-template>\r\n <ng-template [ngIf]=\"useContentFooterRowTemplate\"></ng-template>\r\n\r\n <ng-container *ngIf=\"expandable\">\r\n <!-- Expanded Content Column - The expandable row is made up of this one column that spans across all columns -->\r\n <ng-container matColumnDef=\"MtxGridExpansionColumnDef\">\r\n <td mat-cell *matCellDef=\"let row; let dataIndex = dataIndex\"\r\n [attr.colspan]=\"displayedColumns.length\">\r\n <div class=\"mtx-grid-expansion-detail\"\r\n [@expansion]=\"expansionRowStates[dataIndex].expanded ? 'expanded' : 'collapsed'\">\r\n <ng-template [ngTemplateOutlet]=\"expansionTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: row, rowData: row, index: dataIndex, expanded: expansionRowStates[dataIndex].expanded }\">\r\n </ng-template>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-row\r\n *matRowDef=\"let row; columns: ['MtxGridExpansionColumnDef']; let dataIndex = dataIndex\"\r\n [ngClass]=\"['mtx-grid-expansion', expansionRowStates[dataIndex].expanded ? 'expanded' : 'collapsed']\">\r\n </tr>\r\n </ng-container>\r\n </table>\r\n </div>\r\n\r\n <!-- No result -->\r\n <div class=\"mtx-grid-no-result\" *ngIf=\"_hasNoResult\">\r\n <ng-template [ngIf]=\"_isTemplateRef(noResultTemplate)\" [ngIfElse]=\"defaultNoResultTpl\">\r\n <ng-template [ngTemplateOutlet]=\"noResultTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultNoResultTpl>{{noResultText}}</ng-template>\r\n </div>\r\n </div>\r\n\r\n <!-- Tool sidebar -->\r\n <div class=\"mtx-grid-sidebar\" *ngIf=\"showSidebar\">\r\n <ng-template [ngIf]=\"_isTemplateRef(sidebarTemplate)\">\r\n <ng-template [ngTemplateOutlet]=\"sidebarTemplate\"></ng-template>\r\n </ng-template>\r\n </div>\r\n</div>\r\n\r\n<div class=\"mtx-grid-footer\">\r\n <!-- Status Bar -->\r\n <div class=\"mtx-grid-statusbar\" *ngIf=\"showStatusbar\">\r\n <ng-template [ngIf]=\"_isTemplateRef(statusbarTemplate)\">\r\n <ng-template [ngTemplateOutlet]=\"statusbarTemplate\"></ng-template>\r\n </ng-template>\r\n </div>\r\n\r\n <!-- Pagination -->\r\n <div class=\"mtx-grid-pagination\">\r\n <ng-template [ngIf]=\"_isTemplateRef(paginationTemplate)\" [ngIfElse]=\"defaultPaginationTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"paginationTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultPaginationTemplate>\r\n <mat-paginator [class.mat-paginator-hidden]=\"!showPaginator || _hasNoResult\"\r\n [showFirstLastButtons]=\"showFirstLastButtons\"\r\n [length]=\"length\"\r\n [pageIndex]=\"pageIndex\"\r\n [pageSize]=\"pageSize\"\r\n [pageSizeOptions]=\"pageSizeOptions\"\r\n [hidePageSize]=\"hidePageSize\"\r\n (page)=\"_handlePage($event)\"\r\n [disabled]=\"pageDisabled\">\r\n </mat-paginator>\r\n </ng-template>\r\n </div>\r\n</div>\r\n\r\n<!-- Header template for extra content -->\r\n<ng-template #headerExtraTplBase let-headerExtraTemplate let-col=\"colDef\">\r\n <ng-template [ngIf]=\"_isTemplateRef(headerExtraTemplate)\" [ngIfElse]=\"headerExtraTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerExtraTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n <ng-template #headerExtraTpl>\r\n <ng-template [ngIf]=\"headerExtraTemplate && _isTemplateRef(headerExtraTemplate[col.field])\">\r\n <ng-template [ngTemplateOutlet]=\"headerExtraTemplate[col.field]\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col, colDef: col }\">\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n</ng-template>\r\n",
376
- host: {
377
- class: 'mtx-grid',
378
- },
379
- encapsulation: ViewEncapsulation.None,
380
- changeDetection: ChangeDetectionStrategy.OnPush,
381
- animations: [
382
- trigger('expansion', [
383
- state('collapsed', style({ height: '0', minHeight: '0', visibility: 'hidden' })),
384
- state('expanded', style({ height: '*', visibility: 'visible' })),
385
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
386
- ]),
387
- ],
388
- styles: [".mtx-grid{position:relative;display:flex;flex-direction:column;width:100%}.mtx-grid .mat-table-container{overflow:auto}.mtx-grid .mat-table-container.mat-table-with-data{flex:1}.mtx-grid .mat-table:not(.mat-column-resize-table){min-width:100%;border-collapse:separate}.mtx-grid .mat-table:not(.mat-column-resize-table) .mat-header-cell:not(.mtx-grid-checkbox-cell),.mtx-grid .mat-table:not(.mat-column-resize-table) .mat-footer-cell:not(.mtx-grid-checkbox-cell),.mtx-grid .mat-table:not(.mat-column-resize-table) .mat-cell:not(.mtx-grid-checkbox-cell){min-width:80px}.mtx-grid .mat-table-sticky-left{border-right-width:1px;border-right-style:solid}[dir=rtl] .mtx-grid .mat-table-sticky-left{border-right-width:0;border-left-width:1px;border-left-style:solid}.mtx-grid .mat-table-sticky-right{border-left-width:1px;border-left-style:solid}[dir=rtl] .mtx-grid .mat-table-sticky-right{border-left-width:0;border-right-width:1px;border-right-style:solid}.mtx-grid .mat-header-cell,.mtx-grid .mat-footer-cell,.mtx-grid .mat-cell{padding:4px 10px;box-sizing:border-box}.mtx-grid .mat-header-cell:first-of-type:not(:only-of-type),.mtx-grid .mat-footer-cell:first-of-type:not(:only-of-type),.mtx-grid .mat-cell:first-of-type:not(:only-of-type){padding-left:24px}.mtx-grid .mat-header-cell:first-of-type:not(:only-of-type).mtx-grid-checkbox-cell,.mtx-grid .mat-footer-cell:first-of-type:not(:only-of-type).mtx-grid-checkbox-cell,.mtx-grid .mat-cell:first-of-type:not(:only-of-type).mtx-grid-checkbox-cell{padding-left:10px;padding-right:10px}[dir=rtl] .mtx-grid .mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] .mtx-grid .mat-footer-cell:first-of-type:not(:only-of-type),[dir=rtl] .mtx-grid .mat-cell:first-of-type:not(:only-of-type){padding-left:10px;padding-right:24px}[dir=rtl] .mtx-grid .mat-header-cell:first-of-type:not(:only-of-type).mtx-grid-checkbox-cell,[dir=rtl] .mtx-grid .mat-footer-cell:first-of-type:not(:only-of-type).mtx-grid-checkbox-cell,[dir=rtl] .mtx-grid .mat-cell:first-of-type:not(:only-of-type).mtx-grid-checkbox-cell{padding-left:10px;padding-right:10px}.mtx-grid .mat-header-cell:last-of-type:not(:only-of-type),.mtx-grid .mat-footer-cell:last-of-type:not(:only-of-type),.mtx-grid .mat-cell:last-of-type:not(:only-of-type){padding-right:24px}[dir=rtl] .mtx-grid .mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] .mtx-grid .mat-footer-cell:last-of-type:not(:only-of-type),[dir=rtl] .mtx-grid .mat-cell:last-of-type:not(:only-of-type){padding-left:24px;padding-right:10px}.mtx-grid .mat-cell .mat-icon-button.expanded .mat-icon{transform:rotate(90deg)}.mtx-grid .mat-row.mtx-grid-expansion{height:0;overflow:hidden}.mtx-grid .mat-row.mtx-grid-expansion .mat-cell{padding-top:0;padding-bottom:0}.mtx-grid .mat-row.mtx-grid-expansion.collapsed .mat-cell{border-bottom-width:0}.mtx-grid .mat-row:last-of-type .mat-cell{border-bottom-width:0}.mtx-grid .mat-sort-header-icon{width:18px;height:18px;margin:0 4px;font-size:18px}.mtx-grid .mat-header-cell-inner{display:flex;align-items:center}.mtx-grid .mat-paginator-hidden{display:none}.mtx-grid-progress{position:absolute;top:0;z-index:120;width:100%}.mtx-grid-toolbar{display:flex;justify-content:space-between;align-items:center;min-height:48px;padding:8px;box-sizing:border-box}.mtx-grid-layout{display:flex;flex:1 1 auto;overflow:auto}.mtx-grid-content{flex-direction:column;width:0}.mtx-grid-sidebar{max-width:50%;border-left-width:1px;border-left-style:solid}[dir=rtl] .mtx-grid-sidebar{border-left-width:0;border-right-width:1px;border-right-style:solid}.mtx-grid-footer{position:relative;z-index:1}.mtx-grid-statusbar{display:flex;align-items:center;min-height:56px;padding:8px}.mtx-grid-no-result{display:flex;justify-content:center;align-items:center;flex:1;min-height:150px}.mtx-grid-expansion-placeholder{display:inline-block;width:40px;height:40px;vertical-align:middle}.mtx-grid-expansion-detail{display:flex;align-items:center;min-height:48px;overflow:hidden}.mtx-grid-checkbox-cell{flex:none;justify-content:center;width:56px;min-width:56px}.mtx-grid-checkbox-cell .mat-checkbox{display:flex;margin:0 10px}.mtx-grid-checkbox-cell .mat-checkbox-inner-container{margin-left:0}\n"]
389
- },] }
390
- ];
391
- /**
392
- * @type {function(): !Array<(null|{
393
- * type: ?,
394
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
395
- * })>}
396
- * @nocollapse
397
- */
398
- MtxGridComponent.ctorParameters = () => [
399
- { type: MtxGridService },
400
- { type: ChangeDetectorRef }
401
- ];
402
- /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
403
- MtxGridComponent.propDecorators = {
404
- table: [{ type: ViewChild, args: [MatTable,] }],
405
- paginator: [{ type: ViewChild, args: [MatPaginator,] }],
406
- sort: [{ type: ViewChild, args: [MatSort,] }],
407
- rowDefs: [{ type: ContentChildren, args: [MatRowDef,] }],
408
- headerRowDefs: [{ type: ContentChildren, args: [MatHeaderRowDef,] }],
409
- footerRowDefs: [{ type: ContentChildren, args: [MatFooterRow,] }],
410
- columnMenu: [{ type: ViewChild, args: ['columnMenu',] }],
411
- tableContainer: [{ type: ViewChild, args: ['tableContainer',] }],
412
- displayedColumns: [{ type: Input }],
413
- columns: [{ type: Input }],
414
- data: [{ type: Input }],
415
- length: [{ type: Input }],
416
- loading: [{ type: Input }],
417
- trackBy: [{ type: Input }],
418
- columnResizable: [{ type: Input }],
419
- pageOnFront: [{ type: Input }],
420
- showPaginator: [{ type: Input }],
421
- pageDisabled: [{ type: Input }],
422
- showFirstLastButtons: [{ type: Input }],
423
- pageIndex: [{ type: Input }],
424
- pageSize: [{ type: Input }],
425
- pageSizeOptions: [{ type: Input }],
426
- hidePageSize: [{ type: Input }],
427
- page: [{ type: Output }],
428
- paginationTemplate: [{ type: Input }],
429
- sortOnFront: [{ type: Input }],
430
- sortActive: [{ type: Input }],
431
- sortDirection: [{ type: Input }],
432
- sortDisableClear: [{ type: Input }],
433
- sortDisabled: [{ type: Input }],
434
- sortStart: [{ type: Input }],
435
- sortChange: [{ type: Output }],
436
- rowHover: [{ type: Input }],
437
- rowStriped: [{ type: Input }],
438
- rowClick: [{ type: Output }],
439
- expandable: [{ type: Input }],
440
- expansionTemplate: [{ type: Input }],
441
- expansionChange: [{ type: Output }],
442
- multiSelectable: [{ type: Input }],
443
- multiSelectionWithClick: [{ type: Input }],
444
- rowSelected: [{ type: Input }],
445
- rowSelectable: [{ type: Input }],
446
- hideRowSelectionCheckbox: [{ type: Input }],
447
- rowSelectionFormatter: [{ type: Input }],
448
- rowClassFormatter: [{ type: Input }],
449
- rowSelectionChange: [{ type: Output }],
450
- cellSelectable: [{ type: Input }],
451
- cellSelectionChange: [{ type: Output }],
452
- showToolbar: [{ type: Input }],
453
- toolbarTitle: [{ type: Input }],
454
- toolbarTemplate: [{ type: Input }],
455
- showColumnMenuButton: [{ type: Input }],
456
- columnMenuButtonText: [{ type: Input }],
457
- columnMenuButtonType: [{ type: Input }],
458
- columnMenuButtonColor: [{ type: Input }],
459
- columnMenuButtonClass: [{ type: Input }],
460
- columnMenuButtonIcon: [{ type: Input }],
461
- columnHideable: [{ type: Input }],
462
- columnHideableChecked: [{ type: Input }],
463
- columnMovable: [{ type: Input }],
464
- columnPinnable: [{ type: Input }],
465
- columnChange: [{ type: Output }],
466
- showColumnMenuHeader: [{ type: Input }],
467
- columnMenuHeaderText: [{ type: Input }],
468
- columnMenuHeaderTemplate: [{ type: Input }],
469
- showColumnMenuFooter: [{ type: Input }],
470
- columnMenuFooterText: [{ type: Input }],
471
- columnMenuFooterTemplate: [{ type: Input }],
472
- noResultText: [{ type: Input }],
473
- noResultTemplate: [{ type: Input }],
474
- headerTemplate: [{ type: Input }],
475
- headerExtraTemplate: [{ type: Input }],
476
- cellTemplate: [{ type: Input }],
477
- useContentRowTemplate: [{ type: Input }],
478
- useContentHeaderRowTemplate: [{ type: Input }],
479
- useContentFooterRowTemplate: [{ type: Input }],
480
- showSummary: [{ type: Input }],
481
- summaryTemplate: [{ type: Input }],
482
- showSidebar: [{ type: Input }],
483
- sidebarTemplate: [{ type: Input }],
484
- showStatusbar: [{ type: Input }],
485
- statusbarTemplate: [{ type: Input }]
486
- };
487
-
488
- class MtxGridCellComponent {
489
- constructor(_dialog, _dataGridSrv) {
490
- this._dialog = _dialog;
491
- this._dataGridSrv = _dataGridSrv;
492
- /** Row data */
493
- this.rowData = {};
494
- /** All data */
495
- this.data = [];
496
- /** Whether show summary */
497
- this.summary = false;
498
- }
499
- get _colValue() {
500
- return this._dataGridSrv.getCellValue(this.rowData, this.colDef);
501
- }
502
- _isString(fn) {
503
- return Object.prototype.toString.call(fn) === '[object String]';
504
- }
505
- _isFunction(fn) {
506
- return Object.prototype.toString.call(fn) === '[object Function]';
507
- }
508
- _isEmptyValue(value) {
509
- return value == null || value.toString() === '';
510
- }
511
- _isContainHTML(value) {
512
- return /<\/?[a-z][\s\S]*>/i.test(value);
513
- }
514
- _getText(value) {
515
- return this._isEmptyValue(value) ? '--' : value;
516
- }
517
- _getTooltip(value) {
518
- return this._isEmptyValue(value) ? '' : value;
519
- }
520
- _getFormatterTooltip(value) {
521
- return this._isContainHTML(value) || this._isEmptyValue(value) ? '' : value;
522
- }
523
- _formatSummary(data, colDef) {
524
- if (this._isString(colDef.summary)) {
525
- return colDef.summary;
526
- }
527
- else if (this._isFunction(colDef.summary)) {
528
- return colDef.summary(this._dataGridSrv.getColData(data, colDef), colDef);
529
- }
530
- }
531
- _handleActionConfirm(event, title, description = '', okColor = 'primary', okText = 'OK', closeColor, closeText = 'CLOSE', fn, data) {
532
- event.preventDefault();
533
- event.stopPropagation();
534
- this._dialog.open({
535
- title,
536
- description,
537
- buttons: [
538
- {
539
- color: okColor,
540
- text: okText,
541
- onClick: () => (fn ? fn(data) : {}),
542
- },
543
- { color: closeColor, text: closeText, onClick: () => { } },
544
- ],
545
- });
546
- }
547
- _handleActionClick(event, btn, rowData) {
548
- event.preventDefault();
549
- event.stopPropagation();
550
- if (btn.click) {
551
- btn.click(rowData);
552
- }
553
- }
554
- /** Preview enlarged image */
555
- _onPreview(urlStr) {
556
- const imgs = [];
557
- this._dataGridSrv.str2arr(urlStr).forEach((url, index) => {
558
- imgs.push({ title: index + 1 + '', src: url });
559
- });
560
- const footerToolbar = imgs.length > 1
561
- ? ['zoomIn', 'zoomOut', 'prev', 'next', 'rotateRight', 'rotateLeft', 'actualSize']
562
- : ['zoomIn', 'zoomOut', 'rotateRight', 'rotateLeft', 'actualSize'];
563
- const options = {
564
- title: imgs.length > 1,
565
- footerToolbar,
566
- };
567
- const viewer = new PhotoViewer(imgs, options);
568
- }
569
- }
570
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
571
- MtxGridCellComponent.decorators = [
572
- { type: Component, args: [{
573
- selector: 'mtx-grid-cell',
574
- exportAs: 'mtxGridCell',
575
- template: "<span *ngIf=\"summary; else customCellFormattingTpl\"\r\n [title]=\"_getFormatterTooltip(_formatSummary(data, colDef))\"\r\n [innerHTML]=\"_getText(_formatSummary(data, colDef))\">\r\n</span>\r\n\r\n<!-- Custom formatting -->\r\n<ng-template #customCellFormattingTpl>\r\n <span *ngIf=\"colDef.formatter; else defaultCellFormattingTpl\"\r\n [title]=\"_getFormatterTooltip(colDef.formatter(rowData, colDef))\"\r\n [innerHTML]=\"_getText(colDef.formatter(rowData, colDef))\">\r\n </span>\r\n</ng-template>\r\n\r\n<!-- Default formatting -->\r\n<ng-template #defaultCellFormattingTpl>\r\n <ng-container [ngSwitch]=\"colDef.type\">\r\n <!-- Tag -->\r\n <ng-container *ngSwitchCase=\"'tag'\">\r\n <mat-chip-list *ngIf=\"colDef.tag && colDef.tag[_colValue]; else tagEmptyTpl\">\r\n <mat-chip color=\"primary\" [ngClass]=\"['bg-' + colDef.tag[_colValue].color]\">\r\n {{colDef.tag[_colValue].text}}\r\n </mat-chip>\r\n </mat-chip-list>\r\n <ng-template #tagEmptyTpl>{{_colValue}}</ng-template>\r\n </ng-container>\r\n <!-- Buttons -->\r\n <ng-container *ngSwitchCase=\"'button'\">\r\n <ng-container *ngFor=\"let btn of colDef.buttons;\">\r\n <ng-container *ngIf=\"!btn.iif || btn.iif(rowData)\">\r\n <ng-container *ngIf=\"btn.pop; else btnDefaultTpl\">\r\n <button [ngClass]=\"['mtx-grid-action-button', btn.class||'']\"\r\n *ngIf=\"btn.type==='basic'\"\r\n mat-button\r\n [color]=\"btn.color || 'primary'\"\r\n [disabled]=\"btn.disabled\"\r\n [matTooltip]=\"btn.tooltip | toObservable | async\"\r\n (click)=\"_handleActionConfirm($event, btn.popTitle!, btn.popDescription,\r\n btn.popOkColor, btn.popOkText,\r\n btn.popCloseColor, btn.popCloseText,\r\n btn.click, rowData)\">\r\n <mat-icon *ngIf=\"btn.icon\">{{btn.icon}}</mat-icon>\r\n <span>{{btn.text | toObservable | async}}</span>\r\n </button>\r\n <button [ngClass]=\"['mtx-grid-action-button', btn.class||'']\"\r\n *ngIf=\"!btn.type || btn.type==='icon'\"\r\n mat-icon-button\r\n [color]=\"btn.color || 'primary'\"\r\n [disabled]=\"btn.disabled\"\r\n [matTooltip]=\"btn.tooltip | toObservable | async\"\r\n (click)=\"_handleActionConfirm($event, btn.popTitle!, btn.popDescription,\r\n btn.popOkColor, btn.popOkText,\r\n btn.popCloseColor, btn.popCloseText,\r\n btn.click, rowData)\">\r\n <mat-icon>{{btn.icon}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-template #btnDefaultTpl>\r\n <button [ngClass]=\"['mtx-grid-action-button', btn.class||'']\"\r\n *ngIf=\"btn.type==='basic'\"\r\n mat-button\r\n [color]=\"btn.color || 'primary'\"\r\n [disabled]=\"btn.disabled\"\r\n [matTooltip]=\"btn.tooltip | toObservable | async\"\r\n (click)=\"_handleActionClick($event, btn, rowData)\">\r\n <mat-icon *ngIf=\"btn.icon\">{{btn.icon}}</mat-icon>\r\n <span>{{btn.text | toObservable | async}}</span>\r\n </button>\r\n <button [ngClass]=\"['mtx-grid-action-button', btn.class||'']\"\r\n *ngIf=\"!btn.type || btn.type==='icon'\"\r\n mat-icon-button\r\n [color]=\"btn.color || 'primary'\"\r\n [disabled]=\"btn.disabled\"\r\n [matTooltip]=\"btn.tooltip | toObservable | async\"\r\n (click)=\"_handleActionClick($event, btn, rowData)\">\r\n <mat-icon>{{btn.icon}}</mat-icon>\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <!-- Link -->\r\n <ng-container *ngSwitchCase=\"'link'\">\r\n <a [href]=\"_colValue\" target=\"_blank\">{{_colValue}}</a>\r\n </ng-container>\r\n <!-- Image -->\r\n <ng-container *ngSwitchCase=\"'image'\">\r\n <img class=\"mtx-grid-img\" [src]=\"_colValue\" (click)=\"_onPreview(_colValue)\">\r\n </ng-container>\r\n <!-- Boolean -->\r\n <ng-container *ngSwitchCase=\"'boolean'\">\r\n <span [title]=\"_getTooltip(_colValue)\">{{_getText(_colValue)}}</span>\r\n </ng-container>\r\n <!-- Number -->\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <span [title]=\"_getTooltip(_colValue | number: colDef.typeParameter?.digitsInfo : colDef.typeParameter?.locale)\">\r\n {{_getText(_colValue | number: colDef.typeParameter?.digitsInfo : colDef.typeParameter?.locale)}}\r\n </span>\r\n </ng-container>\r\n <!-- Currency -->\r\n <ng-container *ngSwitchCase=\"'currency'\">\r\n <span [title]=\"_getTooltip(_colValue | currency: colDef.typeParameter?.currencyCode : colDef.typeParameter?.display : colDef.typeParameter?.digitsInfo : colDef.typeParameter?.locale)\">\r\n {{_getText(_colValue | currency: colDef.typeParameter?.currencyCode : colDef.typeParameter?.display : colDef.typeParameter?.digitsInfo : colDef.typeParameter?.locale)}}\r\n </span>\r\n </ng-container>\r\n <!-- Percent -->\r\n <ng-container *ngSwitchCase=\"'percent'\">\r\n <span [title]=\"_getTooltip(_colValue | percent: colDef.typeParameter?.digitsInfo : colDef.typeParameter?.locale)\">\r\n {{_getText(_colValue | percent: colDef.typeParameter?.digitsInfo : colDef.typeParameter?.locale)}}\r\n </span>\r\n </ng-container>\r\n <!-- Date -->\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n <span [title]=\"_getTooltip(_colValue | date: colDef.typeParameter?.format : colDef.typeParameter?.timezone : colDef.typeParameter?.locale)\">\r\n {{_getText(_colValue | date: colDef.typeParameter?.format : colDef.typeParameter?.timezone : colDef.typeParameter?.locale)}}\r\n </span>\r\n </ng-container>\r\n <!-- Default -->\r\n <ng-container *ngSwitchDefault>\r\n <span [title]=\"_getTooltip(_colValue)\">{{_getText(_colValue)}}</span>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n",
576
- encapsulation: ViewEncapsulation.None,
577
- styles: [".mtx-grid-action-button .mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.mtx-grid-img{display:block;width:30px;border-radius:4px;cursor:pointer}\n"]
578
- },] }
579
- ];
580
- /**
581
- * @type {function(): !Array<(null|{
582
- * type: ?,
583
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
584
- * })>}
585
- * @nocollapse
586
- */
587
- MtxGridCellComponent.ctorParameters = () => [
588
- { type: MtxDialog },
589
- { type: MtxGridService }
590
- ];
591
- /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
592
- MtxGridCellComponent.propDecorators = {
593
- rowData: [{ type: Input }],
594
- colDef: [{ type: Input }],
595
- data: [{ type: Input }],
596
- summary: [{ type: Input }]
597
- };
598
-
599
- class MtxGridColumnMenuComponent {
600
- constructor() {
601
- this.columns = [];
602
- this.selectable = true;
603
- this.selectableChecked = 'show';
604
- this.sortable = true;
605
- this.dndSortable = true;
606
- this._buttonText = '';
607
- this.buttonType = 'stroked';
608
- this.buttonClass = '';
609
- this.buttonIcon = '';
610
- this.showHeader = false;
611
- this.headerText = 'Columns Header';
612
- this.showFooter = false;
613
- this.footerText = 'Columns Footer';
614
- this.selectionChange = new EventEmitter();
615
- this.sortChange = new EventEmitter();
616
- }
617
- get buttonText() {
618
- const defaultText = `Columns ${this.selectableChecked === 'show' ? 'Shown' : 'Hidden'}`;
619
- const text = this._buttonText ? this._buttonText : defaultText;
620
- return text;
621
- }
622
- set buttonText(value) {
623
- this._buttonText = value;
624
- }
625
- _handleDroped(event) {
626
- moveItemInArray(this.columns, event.previousIndex, event.currentIndex);
627
- this.sortChange.emit(this.columns);
628
- }
629
- _handleSelection(e) {
630
- this.selectionChange.emit(this.columns);
631
- }
632
- }
633
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
634
- MtxGridColumnMenuComponent.decorators = [
635
- { type: Component, args: [{
636
- selector: 'mtx-grid-column-menu',
637
- exportAs: 'mtxGridColumnMenu',
638
- template: "<ng-container [ngSwitch]=\"buttonType\">\r\n <ng-container *ngSwitchCase=\"'raised'\">\r\n <button [ngClass]=\"buttonClass\" mat-raised-button [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'stroked'\">\r\n <button [ngClass]=\"buttonClass\" mat-stroked-button [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'flat'\">\r\n <button [ngClass]=\"buttonClass\" mat-flat-button [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <button [ngClass]=\"buttonClass\" mat-icon-button [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-fab [color]=\"buttonColor\" [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'mini-fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-mini-fab [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <button [ngClass]=\"buttonClass\" mat-button [color]=\"buttonColor\" [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"mtx-grid-column-menu\">\r\n <div class=\"mtx-grid-column-menu-content\"\r\n (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <div class=\"mtx-grid-column-menu-header\" *ngIf=\"showHeader\">\r\n <ng-template [ngIf]=\"headerTemplate\" [ngIfElse]=\"defaultHeaderTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultHeaderTpl>{{headerText}}</ng-template>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-body\">\r\n <div class=\"mtx-grid-column-menu-list\"\r\n cdkDropList (cdkDropListDropped)=\"_handleDroped($event)\"\r\n *ngIf=\"sortable\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\"\r\n cdkDrag [cdkDragDisabled]=\"selectableChecked === 'show'? !col.show : col.hide\">\r\n <mat-icon cdkDragHandle>drag_handle</mat-icon>\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"!sortable\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\">\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-footer\" *ngIf=\"showFooter\">\r\n <ng-template [ngIf]=\"footerTemplate\" [ngIfElse]=\"defaultFooterTpl\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultFooterTpl>{{footerText}}</ng-template>\r\n </div>\r\n </div>\r\n</mat-menu>\r\n\r\n<ng-template #checkboxList let-col>\r\n <mat-checkbox class=\"mtx-grid-column-menu-item-label\"\r\n *ngIf=\"selectable\"\r\n [(ngModel)]=\"col[selectableChecked]\"\r\n [disabled]=\"col.disabled\"\r\n (change)=\"_handleSelection($event)\">\r\n {{col.label | toObservable | async}}\r\n </mat-checkbox>\r\n <span class=\"mtx-grid-column-menu-item-label\" *ngIf=\"!selectable\">\r\n {{col.label | toObservable | async}}\r\n </span>\r\n</ng-template>\r\n",
639
- encapsulation: ViewEncapsulation.None,
640
- changeDetection: ChangeDetectionStrategy.OnPush,
641
- styles: [".mtx-grid-column-menu .mat-menu-content{padding:0}.mtx-grid-column-menu-body{padding:16px}.mtx-grid-column-menu-header,.mtx-grid-column-menu-footer{position:sticky;z-index:1;padding:8px 16px}.mtx-grid-column-menu-header{top:0}.mtx-grid-column-menu-footer{bottom:0}.mtx-grid-column-menu-list{display:block;max-width:100%}.mtx-grid-column-menu-list.cdk-drop-list-dragging .mtx-grid-column-menu-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-menu-list.cdk-drop-list .mtx-grid-column-menu-item-label{padding:0 4px}.mtx-grid-column-menu-item{display:flex;flex-direction:row;align-items:center;padding:4px 0}.mtx-grid-column-menu-item.cdk-drag-disabled .cdk-drag-handle{opacity:.35;cursor:no-drop}.mtx-grid-column-menu-item .cdk-drag-handle{cursor:move}.mtx-grid-column-menu-item.cdk-drag-preview{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.mtx-grid-column-menu-item.cdk-drag-placeholder{opacity:0}.mtx-grid-column-menu-item.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}\n"]
642
- },] }
643
- ];
644
- /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
645
- MtxGridColumnMenuComponent.propDecorators = {
646
- menuPanel: [{ type: ViewChild, args: ['menu', { static: true },] }],
647
- menuTrigger: [{ type: ViewChild, args: [MatMenuTrigger,] }],
648
- columns: [{ type: Input }],
649
- selectable: [{ type: Input }],
650
- selectableChecked: [{ type: Input }],
651
- sortable: [{ type: Input }],
652
- dndSortable: [{ type: Input }],
653
- buttonText: [{ type: Input }],
654
- buttonType: [{ type: Input }],
655
- buttonColor: [{ type: Input }],
656
- buttonClass: [{ type: Input }],
657
- buttonIcon: [{ type: Input }],
658
- showHeader: [{ type: Input }],
659
- headerText: [{ type: Input }],
660
- headerTemplate: [{ type: Input }],
661
- showFooter: [{ type: Input }],
662
- footerText: [{ type: Input }],
663
- footerTemplate: [{ type: Input }],
664
- selectionChange: [{ type: Output }],
665
- sortChange: [{ type: Output }]
666
- };
667
-
668
- class MtxGridExpansionToggleDirective {
669
- constructor() {
670
- this._opened = false;
671
- this.openedChange = new EventEmitter();
672
- this.toggleChange = new EventEmitter();
673
- }
674
- get opened() {
675
- return this._opened;
676
- }
677
- set opened(newValue) {
678
- this._opened = newValue;
679
- this.openedChange.emit(newValue);
680
- }
681
- get expanded() {
682
- return this._opened;
683
- }
684
- set expandableRow(value) {
685
- if (value !== this._row) {
686
- this._row = value;
687
- }
688
- }
689
- set template(value) {
690
- if (value !== this._tplRef) {
691
- this._tplRef = value;
692
- }
693
- }
694
- onClick(event) {
695
- event.preventDefault();
696
- event.stopPropagation();
697
- this.toggle();
698
- }
699
- toggle() {
700
- this.opened = !this.opened;
701
- this.toggleChange.emit(this);
702
- }
703
- }
704
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
705
- MtxGridExpansionToggleDirective.decorators = [
706
- { type: Directive, args: [{
707
- selector: '[mtx-grid-expansion-toggle]',
708
- },] }
709
- ];
710
- /**
711
- * @type {function(): !Array<(null|{
712
- * type: ?,
713
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
714
- * })>}
715
- * @nocollapse
716
- */
717
- MtxGridExpansionToggleDirective.ctorParameters = () => [];
718
- /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
719
- MtxGridExpansionToggleDirective.propDecorators = {
720
- opened: [{ type: Input }],
721
- openedChange: [{ type: Output }],
722
- expanded: [{ type: HostBinding, args: ['class.expanded',] }],
723
- expandableRow: [{ type: Input }],
724
- template: [{ type: Input, args: ['expansionRowTpl',] }],
725
- toggleChange: [{ type: Output }],
726
- onClick: [{ type: HostListener, args: ['click', ['$event'],] }]
727
- };
728
-
729
- class MtxGridCellSelectionDirective {
730
- constructor(_dataGrid) {
731
- this._dataGrid = _dataGrid;
732
- this._selected = false;
733
- this.shiftKeyPressed = false;
734
- this.ctrlKeyPressed = false;
735
- this.cellSelectionChange = new EventEmitter();
736
- }
737
- get selected() {
738
- return this._selected;
739
- }
740
- set matSelectableRowData(value) {
741
- if (value !== this._rowData) {
742
- this._rowData = value;
743
- }
744
- }
745
- onClick(event) {
746
- this.ctrlKeyPressed = event.ctrlKey;
747
- this.shiftKeyPressed = event.shiftKey;
748
- if (this._dataGrid.cellSelectable) {
749
- this.select();
750
- }
751
- }
752
- select() {
753
- this._selected = true;
754
- this.cellSelectionChange.emit(this);
755
- }
756
- deselect() {
757
- this._selected = false;
758
- this.cellSelectionChange.emit(this);
759
- }
760
- toggle() {
761
- this._selected = !this._selected;
762
- this.cellSelectionChange.emit(this);
763
- }
764
- }
765
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
766
- MtxGridCellSelectionDirective.decorators = [
767
- { type: Directive, args: [{
768
- selector: '[mtx-grid-selectable-cell]',
769
- },] }
770
- ];
771
- /**
772
- * @type {function(): !Array<(null|{
773
- * type: ?,
774
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
775
- * })>}
776
- * @nocollapse
777
- */
778
- MtxGridCellSelectionDirective.ctorParameters = () => [
779
- { type: MtxGridComponent }
780
- ];
781
- /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
782
- MtxGridCellSelectionDirective.propDecorators = {
783
- selected: [{ type: HostBinding, args: ['class.selected',] }],
784
- matSelectableRowData: [{ type: Input }],
785
- cellSelectionChange: [{ type: Output }],
786
- onClick: [{ type: HostListener, args: ['click', ['$event'],] }]
787
- };
788
-
789
- /**
790
- * @license
791
- * Copyright Google LLC All Rights Reserved.
792
- *
793
- * Use of this source code is governed by an MIT-style license that can be
794
- * found in the LICENSE file at https://angular.io/license
795
- */
796
- /**
797
- * Overrides CdkFlexTableResizeStrategy to match mat-column elements.
798
- */
799
- class MatFlexTableResizeStrategy extends CdkFlexTableResizeStrategy {
800
- constructor(columnResize, styleScheduler, table, document) {
801
- super(columnResize, styleScheduler, table, document);
802
- }
803
- getColumnCssClass(cssFriendlyColumnName) {
804
- return `mat-column-${cssFriendlyColumnName}`;
805
- }
806
- }
807
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
808
- MatFlexTableResizeStrategy.decorators = [
809
- { type: Injectable }
810
- ];
811
- /**
812
- * @type {function(): !Array<(null|{
813
- * type: ?,
814
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
815
- * })>}
816
- * @nocollapse
817
- */
818
- MatFlexTableResizeStrategy.ctorParameters = () => [
819
- { type: ColumnResize },
820
- { type: _CoalescedStyleScheduler, decorators: [{ type: Inject, args: [_COALESCED_STYLE_SCHEDULER,] }] },
821
- { type: CdkTable },
822
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
823
- ];
824
- const FLEX_RESIZE_STRATEGY_PROVIDER = {
825
- provide: ResizeStrategy,
826
- useClass: MatFlexTableResizeStrategy,
827
- };
828
-
829
- /**
830
- * @license
831
- * Copyright Google LLC All Rights Reserved.
832
- *
833
- * Use of this source code is governed by an MIT-style license that can be
834
- * found in the LICENSE file at https://angular.io/license
835
- */
836
- const PROVIDERS = [
837
- ColumnResizeNotifier,
838
- HeaderRowEventDispatcher,
839
- ColumnResizeNotifierSource,
840
- ];
841
- const TABLE_PROVIDERS = [
842
- ...PROVIDERS,
843
- TABLE_LAYOUT_FIXED_RESIZE_STRATEGY_PROVIDER,
844
- ];
845
- const FLEX_PROVIDERS = [...PROVIDERS, FLEX_RESIZE_STRATEGY_PROVIDER];
846
- const TABLE_HOST_BINDINGS = {
847
- class: 'mat-column-resize-table',
848
- };
849
- const FLEX_HOST_BINDINGS = {
850
- class: 'mat-column-resize-flex',
851
- };
852
- class AbstractMatColumnResize extends ColumnResize {
853
- getTableHeight() {
854
- const table = this.elementRef.nativeElement;
855
- const tableParent = table.parentNode;
856
- const isTableContainer = tableParent.classList.contains('mat-table-container');
857
- return isTableContainer ? tableParent.offsetHeight : table.offsetHeight;
858
- }
859
- }
860
-
861
- /**
862
- * @license
863
- * Copyright Google LLC All Rights Reserved.
864
- *
865
- * Use of this source code is governed by an MIT-style license that can be
866
- * found in the LICENSE file at https://angular.io/license
867
- */
868
- /**
869
- * Explicitly enables column resizing for a table-based mat-table.
870
- * Individual columns must be annotated specifically.
871
- */
872
- class MatColumnResize extends AbstractMatColumnResize {
873
- constructor(columnResizeNotifier, elementRef, eventDispatcher, ngZone, notifier) {
874
- super();
875
- this.columnResizeNotifier = columnResizeNotifier;
876
- this.elementRef = elementRef;
877
- this.eventDispatcher = eventDispatcher;
878
- this.ngZone = ngZone;
879
- this.notifier = notifier;
880
- }
881
- }
882
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
883
- MatColumnResize.decorators = [
884
- { type: Directive, args: [{
885
- selector: 'table[mat-table][columnResize]',
886
- host: TABLE_HOST_BINDINGS,
887
- providers: [...TABLE_PROVIDERS, { provide: ColumnResize, useExisting: MatColumnResize }],
888
- },] }
889
- ];
890
- /**
891
- * @type {function(): !Array<(null|{
892
- * type: ?,
893
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
894
- * })>}
895
- * @nocollapse
896
- */
897
- MatColumnResize.ctorParameters = () => [
898
- { type: ColumnResizeNotifier },
899
- { type: ElementRef },
900
- { type: HeaderRowEventDispatcher },
901
- { type: NgZone },
902
- { type: ColumnResizeNotifierSource }
903
- ];
904
-
905
- /**
906
- * @license
907
- * Copyright Google LLC All Rights Reserved.
908
- *
909
- * Use of this source code is governed by an MIT-style license that can be
910
- * found in the LICENSE file at https://angular.io/license
911
- */
912
- /**
913
- * Explicitly enables column resizing for a flexbox-based mat-table.
914
- * Individual columns must be annotated specifically.
915
- */
916
- class MatColumnResizeFlex extends AbstractMatColumnResize {
917
- constructor(columnResizeNotifier, elementRef, eventDispatcher, ngZone, notifier) {
918
- super();
919
- this.columnResizeNotifier = columnResizeNotifier;
920
- this.elementRef = elementRef;
921
- this.eventDispatcher = eventDispatcher;
922
- this.ngZone = ngZone;
923
- this.notifier = notifier;
924
- }
925
- }
926
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
927
- MatColumnResizeFlex.decorators = [
928
- { type: Directive, args: [{
929
- selector: 'mat-table[columnResize]',
930
- host: FLEX_HOST_BINDINGS,
931
- providers: [...FLEX_PROVIDERS, { provide: ColumnResize, useExisting: MatColumnResizeFlex }],
932
- },] }
933
- ];
934
- /**
935
- * @type {function(): !Array<(null|{
936
- * type: ?,
937
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
938
- * })>}
939
- * @nocollapse
940
- */
941
- MatColumnResizeFlex.ctorParameters = () => [
942
- { type: ColumnResizeNotifier },
943
- { type: ElementRef },
944
- { type: HeaderRowEventDispatcher },
945
- { type: NgZone },
946
- { type: ColumnResizeNotifierSource }
947
- ];
948
-
949
- /**
950
- * @license
951
- * Copyright Google LLC All Rights Reserved.
952
- *
953
- * Use of this source code is governed by an MIT-style license that can be
954
- * found in the LICENSE file at https://angular.io/license
955
- */
956
- /**
957
- * Component shown over the edge of a resizable column that is responsible
958
- * for handling column resize mouse events and displaying a vertical line along the column edge.
959
- */
960
- class MatColumnResizeOverlayHandle extends ResizeOverlayHandle {
961
- constructor(columnDef, columnResize, directionality, elementRef, eventDispatcher, ngZone, resizeNotifier, resizeRef, styleScheduler, document) {
962
- super();
963
- this.columnDef = columnDef;
964
- this.columnResize = columnResize;
965
- this.directionality = directionality;
966
- this.elementRef = elementRef;
967
- this.eventDispatcher = eventDispatcher;
968
- this.ngZone = ngZone;
969
- this.resizeNotifier = resizeNotifier;
970
- this.resizeRef = resizeRef;
971
- this.styleScheduler = styleScheduler;
972
- this.document = document;
973
- }
974
- updateResizeActive(active) {
975
- super.updateResizeActive(active);
976
- this.resizeRef.overlayRef.updateSize({
977
- height: active
978
- ? this.columnResize.getTableHeight()
979
- : this.resizeRef.origin.nativeElement.offsetHeight,
980
- });
981
- }
982
- }
983
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
984
- MatColumnResizeOverlayHandle.decorators = [
985
- { type: Component, args: [{
986
- changeDetection: ChangeDetectionStrategy.OnPush,
987
- encapsulation: ViewEncapsulation.None,
988
- host: { class: 'mat-column-resize-overlay-thumb' },
989
- template: ''
990
- },] }
991
- ];
992
- /**
993
- * @type {function(): !Array<(null|{
994
- * type: ?,
995
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
996
- * })>}
997
- * @nocollapse
998
- */
999
- MatColumnResizeOverlayHandle.ctorParameters = () => [
1000
- { type: CdkColumnDef },
1001
- { type: ColumnResize },
1002
- { type: Directionality },
1003
- { type: ElementRef },
1004
- { type: HeaderRowEventDispatcher },
1005
- { type: NgZone },
1006
- { type: ColumnResizeNotifierSource },
1007
- { type: ResizeRef },
1008
- { type: _CoalescedStyleScheduler, decorators: [{ type: Inject, args: [_COALESCED_STYLE_SCHEDULER,] }] },
1009
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
1010
- ];
1011
-
1012
- /**
1013
- * @license
1014
- * Copyright Google LLC All Rights Reserved.
1015
- *
1016
- * Use of this source code is governed by an MIT-style license that can be
1017
- * found in the LICENSE file at https://angular.io/license
1018
- */
1019
- class AbstractMatResizable extends Resizable {
1020
- constructor() {
1021
- super(...arguments);
1022
- this.minWidthPxInternal = 32;
1023
- }
1024
- getInlineHandleCssClassName() {
1025
- return 'mat-resizable-handle';
1026
- }
1027
- getOverlayHandleComponentType() {
1028
- return MatColumnResizeOverlayHandle;
1029
- }
1030
- }
1031
- const RESIZABLE_HOST_BINDINGS = {
1032
- class: 'mat-resizable',
1033
- };
1034
- const RESIZABLE_INPUTS = [
1035
- 'minWidthPx: matResizableMinWidthPx',
1036
- 'maxWidthPx: matResizableMaxWidthPx',
1037
- ];
1038
-
1039
- /**
1040
- * Explicitly enables column resizing for a mat-header-cell.
1041
- */
1042
- class MatResizable extends AbstractMatResizable {
1043
- constructor(columnDef, columnResize, directionality, document, elementRef, eventDispatcher, injector, ngZone, overlay, resizeNotifier, resizeStrategy, styleScheduler, viewContainerRef, changeDetectorRef) {
1044
- super();
1045
- this.columnDef = columnDef;
1046
- this.columnResize = columnResize;
1047
- this.directionality = directionality;
1048
- this.elementRef = elementRef;
1049
- this.eventDispatcher = eventDispatcher;
1050
- this.injector = injector;
1051
- this.ngZone = ngZone;
1052
- this.overlay = overlay;
1053
- this.resizeNotifier = resizeNotifier;
1054
- this.resizeStrategy = resizeStrategy;
1055
- this.styleScheduler = styleScheduler;
1056
- this.viewContainerRef = viewContainerRef;
1057
- this.changeDetectorRef = changeDetectorRef;
1058
- this.isResizable = true;
1059
- this.document = document;
1060
- }
1061
- get hasResizableClass() {
1062
- return this.isResizable ? RESIZABLE_HOST_BINDINGS.class : '';
1063
- }
1064
- get resizable() {
1065
- return this.isResizable;
1066
- }
1067
- set resizable(newValue) {
1068
- this.isResizable = newValue == null || newValue === '' || newValue;
1069
- }
1070
- }
1071
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1072
- MatResizable.decorators = [
1073
- { type: Directive, args: [{
1074
- selector: 'mat-header-cell[resizable], th[mat-header-cell][resizable]',
1075
- inputs: RESIZABLE_INPUTS,
1076
- },] }
1077
- ];
1078
- /**
1079
- * @type {function(): !Array<(null|{
1080
- * type: ?,
1081
- * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
1082
- * })>}
1083
- * @nocollapse
1084
- */
1085
- MatResizable.ctorParameters = () => [
1086
- { type: CdkColumnDef },
1087
- { type: ColumnResize },
1088
- { type: Directionality },
1089
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
1090
- { type: ElementRef },
1091
- { type: HeaderRowEventDispatcher },
1092
- { type: Injector },
1093
- { type: NgZone },
1094
- { type: Overlay },
1095
- { type: ColumnResizeNotifierSource },
1096
- { type: ResizeStrategy },
1097
- { type: _CoalescedStyleScheduler, decorators: [{ type: Inject, args: [_COALESCED_STYLE_SCHEDULER,] }] },
1098
- { type: ViewContainerRef },
1099
- { type: ChangeDetectorRef }
1100
- ];
1101
- /** @type {!Object<string, !Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
1102
- MatResizable.propDecorators = {
1103
- hasResizableClass: [{ type: HostBinding, args: ['class',] }],
1104
- resizable: [{ type: Input }]
1105
- };
1106
-
1107
- /**
1108
- * @license
1109
- * Copyright Google LLC All Rights Reserved.
1110
- *
1111
- * Use of this source code is governed by an MIT-style license that can be
1112
- * found in the LICENSE file at https://angular.io/license
1113
- */
1114
- const ENTRY_COMMON_COMPONENTS = [MatColumnResizeOverlayHandle];
1115
- class MatColumnResizeCommonModule {
1116
- }
1117
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1118
- MatColumnResizeCommonModule.decorators = [
1119
- { type: NgModule, args: [{
1120
- declarations: ENTRY_COMMON_COMPONENTS,
1121
- exports: ENTRY_COMMON_COMPONENTS,
1122
- entryComponents: ENTRY_COMMON_COMPONENTS,
1123
- },] }
1124
- ];
1125
- const IMPORTS = [OverlayModule, MatColumnResizeCommonModule];
1126
- class MatColumnResizeModule {
1127
- }
1128
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1129
- MatColumnResizeModule.decorators = [
1130
- { type: NgModule, args: [{
1131
- imports: IMPORTS,
1132
- declarations: [MatColumnResize, MatColumnResizeFlex, MatResizable],
1133
- exports: [MatColumnResize, MatColumnResizeFlex, MatResizable],
1134
- },] }
1135
- ];
1136
-
1137
- class MtxGridModule {
1138
- }
1139
- /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
1140
- MtxGridModule.decorators = [
1141
- { type: NgModule, args: [{
1142
- imports: [
1143
- CommonModule,
1144
- FormsModule,
1145
- MatTableModule,
1146
- MatSortModule,
1147
- MatPaginatorModule,
1148
- MatCheckboxModule,
1149
- MatButtonModule,
1150
- MatProgressBarModule,
1151
- MatChipsModule,
1152
- MatTooltipModule,
1153
- MatIconModule,
1154
- MatSelectModule,
1155
- MatFormFieldModule,
1156
- MatMenuModule,
1157
- DragDropModule,
1158
- MtxDialogModule,
1159
- MtxPipesModule,
1160
- MatColumnResizeModule,
1161
- ],
1162
- exports: [
1163
- MtxGridComponent,
1164
- MtxGridCellComponent,
1165
- MtxGridColumnMenuComponent,
1166
- MtxGridExpansionToggleDirective,
1167
- MtxGridCellSelectionDirective,
1168
- MatColumnResizeModule,
1169
- ],
1170
- declarations: [
1171
- MtxGridComponent,
1172
- MtxGridCellComponent,
1173
- MtxGridColumnMenuComponent,
1174
- MtxGridExpansionToggleDirective,
1175
- MtxGridCellSelectionDirective,
1176
- ],
1177
- providers: [MtxGridService],
1178
- },] }
1179
- ];
1180
-
1181
- /**
1182
- * Generated bundle index. Do not edit.
1183
- */
1184
-
1185
- export { AbstractMatColumnResize, AbstractMatResizable, FLEX_HOST_BINDINGS as MAT_FLEX_HOST_BINDINGS, FLEX_PROVIDERS as MAT_FLEX_PROVIDERS, FLEX_RESIZE_STRATEGY_PROVIDER as MAT_FLEX_RESIZE_STRATEGY_PROVIDER, RESIZABLE_HOST_BINDINGS as MAT_RESIZABLE_HOST_BINDINGS, RESIZABLE_INPUTS as MAT_RESIZABLE_INPUTS, TABLE_HOST_BINDINGS as MAT_TABLE_HOST_BINDINGS, TABLE_PROVIDERS as MAT_TABLE_PROVIDERS, MatColumnResize, MatColumnResizeCommonModule, MatColumnResizeFlex, MatColumnResizeModule, MatColumnResizeOverlayHandle, MatFlexTableResizeStrategy, MatResizable, MtxGridCellComponent, MtxGridCellSelectionDirective, MtxGridColumnMenuComponent, MtxGridComponent, MtxGridExpansionToggleDirective, MtxGridModule, MtxGridService };
1186
- //# sourceMappingURL=mtxGrid.js.map