@delon/abc 12.3.0 → 13.0.0-beta.1

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 (729) hide show
  1. package/abc.d.ts +1 -0
  2. package/auto-focus/auto-focus.directive.d.ts +7 -2
  3. package/auto-focus/auto-focus.module.d.ts +5 -0
  4. package/auto-focus/autoFocus.d.ts +1 -0
  5. package/auto-focus/package.json +5 -6
  6. package/avatar-list/avatar-list-item.component.d.ts +7 -4
  7. package/avatar-list/avatar-list.component.d.ts +4 -1
  8. package/avatar-list/avatar-list.module.d.ts +9 -0
  9. package/avatar-list/avatarList.d.ts +1 -0
  10. package/avatar-list/package.json +5 -6
  11. package/avatar-list/style/index.less +6 -0
  12. package/count-down/count-down.component.d.ts +4 -1
  13. package/count-down/count-down.d.ts +1 -0
  14. package/count-down/count-down.module.d.ts +7 -0
  15. package/count-down/package.json +5 -6
  16. package/date-picker/date-picker.module.d.ts +9 -0
  17. package/date-picker/datePicker.d.ts +1 -1
  18. package/date-picker/package.json +5 -6
  19. package/date-picker/public_api.d.ts +1 -0
  20. package/date-picker/range-shortcut.component.d.ts +3 -0
  21. package/date-picker/range.directive.d.ts +3 -0
  22. package/down-file/down-file.directive.d.ts +5 -2
  23. package/down-file/down-file.module.d.ts +7 -0
  24. package/down-file/downFile.d.ts +1 -0
  25. package/down-file/package.json +5 -6
  26. package/ellipsis/ellipsis.component.d.ts +5 -2
  27. package/ellipsis/ellipsis.d.ts +1 -0
  28. package/ellipsis/ellipsis.module.d.ts +8 -0
  29. package/ellipsis/package.json +5 -6
  30. package/ellipsis/style/index.less +4 -0
  31. package/error-collect/error-collect.component.d.ts +3 -0
  32. package/error-collect/error-collect.module.d.ts +7 -0
  33. package/error-collect/errorCollect.d.ts +1 -0
  34. package/error-collect/package.json +5 -6
  35. package/error-collect/style/index.less +1 -0
  36. package/{esm2015/abc.js → esm2020/abc.mjs} +0 -0
  37. package/esm2020/auto-focus/auto-focus.directive.mjs +48 -0
  38. package/esm2020/auto-focus/auto-focus.module.mjs +17 -0
  39. package/{esm2015/auto-focus/autoFocus.js → esm2020/auto-focus/autoFocus.mjs} +0 -0
  40. package/{esm2015/auto-focus/index.js → esm2020/auto-focus/index.mjs} +0 -0
  41. package/esm2020/avatar-list/avatar-list-item.component.mjs +26 -0
  42. package/esm2020/avatar-list/avatar-list.component.mjs +89 -0
  43. package/esm2020/avatar-list/avatar-list.module.mjs +22 -0
  44. package/{esm2015/avatar-list/avatarList.js → esm2020/avatar-list/avatarList.mjs} +0 -0
  45. package/{esm2015/avatar-list/public_api.js → esm2020/avatar-list/public_api.mjs} +0 -0
  46. package/esm2020/count-down/count-down.component.mjs +45 -0
  47. package/{esm2015/count-down/count-down.js → esm2020/count-down/count-down.mjs} +0 -0
  48. package/esm2020/count-down/count-down.module.mjs +20 -0
  49. package/{esm2015/count-down/public_api.js → esm2020/count-down/public_api.mjs} +0 -0
  50. package/esm2020/date-picker/date-picker.module.mjs +22 -0
  51. package/esm2020/date-picker/datePicker.mjs +5 -0
  52. package/{esm2015/date-picker/public_api.js → esm2020/date-picker/public_api.mjs} +2 -1
  53. package/esm2020/date-picker/range-shortcut.component.mjs +40 -0
  54. package/esm2020/date-picker/range.directive.mjs +174 -0
  55. package/esm2020/down-file/down-file.directive.mjs +114 -0
  56. package/esm2020/down-file/down-file.module.mjs +20 -0
  57. package/{esm2015/down-file/downFile.js → esm2020/down-file/downFile.mjs} +0 -0
  58. package/{esm2015/down-file/public_api.js → esm2020/down-file/public_api.mjs} +0 -0
  59. package/esm2020/ellipsis/ellipsis.component.mjs +229 -0
  60. package/{esm2015/ellipsis/ellipsis.js → esm2020/ellipsis/ellipsis.mjs} +0 -0
  61. package/esm2020/ellipsis/ellipsis.module.mjs +21 -0
  62. package/{esm2015/ellipsis/public_api.js → esm2020/ellipsis/public_api.mjs} +0 -0
  63. package/esm2020/error-collect/error-collect.component.mjs +118 -0
  64. package/esm2020/error-collect/error-collect.module.mjs +20 -0
  65. package/{esm2015/error-collect/errorCollect.js → esm2020/error-collect/errorCollect.mjs} +0 -0
  66. package/{esm2015/error-collect/public_api.js → esm2020/error-collect/public_api.mjs} +0 -0
  67. package/esm2020/exception/exception.component.mjs +105 -0
  68. package/{esm2015/exception/exception.js → esm2020/exception/exception.mjs} +0 -0
  69. package/esm2020/exception/exception.module.mjs +23 -0
  70. package/{esm2015/exception/public_api.js → esm2020/exception/public_api.mjs} +0 -0
  71. package/esm2020/footer-toolbar/footer-toolbar.component.mjs +44 -0
  72. package/esm2020/footer-toolbar/footer-toolbar.module.mjs +21 -0
  73. package/{esm2015/footer-toolbar/footerToolbar.js → esm2020/footer-toolbar/footerToolbar.mjs} +0 -0
  74. package/{esm2015/footer-toolbar/public_api.js → esm2020/footer-toolbar/public_api.mjs} +0 -0
  75. package/esm2020/full-content/full-content-toggle.directive.mjs +24 -0
  76. package/esm2020/full-content/full-content.component.mjs +138 -0
  77. package/esm2020/full-content/full-content.module.mjs +20 -0
  78. package/esm2020/full-content/full-content.service.mjs +23 -0
  79. package/{esm2015/full-content/fullContent.js → esm2020/full-content/fullContent.mjs} +0 -0
  80. package/{esm2015/full-content/public_api.js → esm2020/full-content/public_api.mjs} +0 -0
  81. package/esm2020/global-footer/global-footer-item.component.mjs +30 -0
  82. package/esm2020/global-footer/global-footer.component.mjs +73 -0
  83. package/esm2020/global-footer/global-footer.module.mjs +21 -0
  84. package/{esm2015/global-footer/global-footer.types.js → esm2020/global-footer/global-footer.types.mjs} +0 -0
  85. package/{esm2015/global-footer/globalFooter.js → esm2020/global-footer/globalFooter.mjs} +0 -0
  86. package/{esm2015/global-footer/public_api.js → esm2020/global-footer/public_api.mjs} +0 -0
  87. package/esm2020/image/image.directive.mjs +146 -0
  88. package/{esm2015/image/image.js → esm2020/image/image.mjs} +0 -0
  89. package/esm2020/image/image.module.mjs +20 -0
  90. package/{esm2015/image/public_api.js → esm2020/image/public_api.mjs} +0 -0
  91. package/{esm2015/let/index.js → esm2020/let/index.mjs} +0 -0
  92. package/esm2020/let/let.directive.mjs +36 -0
  93. package/{esm2015/let/let.js → esm2020/let/let.mjs} +0 -0
  94. package/esm2020/let/let.module.mjs +17 -0
  95. package/esm2020/loading/loading.component.mjs +26 -0
  96. package/{esm2015/loading/loading.js → esm2020/loading/loading.mjs} +0 -0
  97. package/esm2020/loading/loading.module.mjs +24 -0
  98. package/esm2020/loading/loading.service.mjs +88 -0
  99. package/{esm2015/loading/loading.types.js → esm2020/loading/loading.types.mjs} +0 -0
  100. package/{esm2015/loading/public_api.js → esm2020/loading/public_api.mjs} +0 -0
  101. package/{esm2015/lodop/lodop.js → esm2020/lodop/lodop.mjs} +0 -0
  102. package/esm2020/lodop/lodop.module.mjs +12 -0
  103. package/esm2020/lodop/lodop.service.mjs +222 -0
  104. package/esm2020/lodop/lodop.types.mjs +2 -0
  105. package/{esm2015/lodop/public_api.js → esm2020/lodop/public_api.mjs} +0 -0
  106. package/esm2020/media/media.component.mjs +106 -0
  107. package/{esm2015/media/media.js → esm2020/media/media.mjs} +0 -0
  108. package/esm2020/media/media.module.mjs +19 -0
  109. package/esm2020/media/media.service.mjs +46 -0
  110. package/{esm2015/media/plyr.types.js → esm2020/media/plyr.types.mjs} +0 -0
  111. package/{esm2015/media/public_api.js → esm2020/media/public_api.mjs} +0 -0
  112. package/esm2020/notice-icon/notice-icon-tab.component.mjs +34 -0
  113. package/esm2020/notice-icon/notice-icon.component.mjs +80 -0
  114. package/esm2020/notice-icon/notice-icon.module.mjs +60 -0
  115. package/{esm2015/notice-icon/notice-icon.types.js → esm2020/notice-icon/notice-icon.types.mjs} +0 -0
  116. package/{esm2015/notice-icon/noticeIcon.js → esm2020/notice-icon/noticeIcon.mjs} +0 -0
  117. package/{esm2015/notice-icon/public_api.js → esm2020/notice-icon/public_api.mjs} +0 -0
  118. package/esm2020/onboarding/onboarding.component.mjs +134 -0
  119. package/{esm2015/onboarding/onboarding.js → esm2020/onboarding/onboarding.mjs} +0 -0
  120. package/esm2020/onboarding/onboarding.module.mjs +25 -0
  121. package/esm2020/onboarding/onboarding.service.mjs +185 -0
  122. package/{esm2015/onboarding/onboarding.types.js → esm2020/onboarding/onboarding.types.mjs} +0 -0
  123. package/{esm2015/onboarding/public_api.js → esm2020/onboarding/public_api.mjs} +0 -0
  124. package/esm2020/page-header/page-header.component.mjs +247 -0
  125. package/esm2020/page-header/page-header.module.mjs +24 -0
  126. package/{esm2015/page-header/pageHeader.js → esm2020/page-header/pageHeader.mjs} +0 -0
  127. package/{esm2015/page-header/public_api.js → esm2020/page-header/public_api.mjs} +0 -0
  128. package/esm2020/pdf/pdf.component.mjs +460 -0
  129. package/{esm2015/pdf/pdf.config.js → esm2020/pdf/pdf.config.mjs} +2 -2
  130. package/{esm2015/pdf/pdf.js → esm2020/pdf/pdf.mjs} +0 -0
  131. package/esm2020/pdf/pdf.module.mjs +20 -0
  132. package/{esm2015/pdf/pdf.types.js → esm2020/pdf/pdf.types.mjs} +0 -0
  133. package/{esm2015/pdf/public_api.js → esm2020/pdf/public_api.mjs} +0 -0
  134. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  135. package/{esm2015/qr/public_api.js → esm2020/qr/public_api.mjs} +0 -0
  136. package/esm2020/qr/qr.component.mjs +136 -0
  137. package/{esm2015/qr/qr.config.js → esm2020/qr/qr.config.mjs} +2 -2
  138. package/{esm2015/qr/qr.js → esm2020/qr/qr.mjs} +0 -0
  139. package/esm2020/qr/qr.module.mjs +19 -0
  140. package/{esm2015/qr/qr.types.js → esm2020/qr/qr.types.mjs} +0 -0
  141. package/{esm2015/quick-menu/public_api.js → esm2020/quick-menu/public_api.mjs} +0 -0
  142. package/esm2020/quick-menu/quick-menu.component.mjs +89 -0
  143. package/esm2020/quick-menu/quick-menu.module.mjs +21 -0
  144. package/{esm2015/quick-menu/quickMenu.js → esm2020/quick-menu/quickMenu.mjs} +0 -0
  145. package/{esm2015/result/public_api.js → esm2020/result/public_api.mjs} +0 -0
  146. package/esm2020/result/result.component.mjs +61 -0
  147. package/{esm2015/result/result.js → esm2020/result/result.mjs} +0 -0
  148. package/esm2020/result/result.module.mjs +21 -0
  149. package/{esm2015/reuse-tab/lifecycle_hooks.js → esm2020/reuse-tab/lifecycle_hooks.mjs} +0 -0
  150. package/{esm2015/reuse-tab/public_api.js → esm2020/reuse-tab/public_api.mjs} +0 -0
  151. package/esm2020/reuse-tab/reuse-tab-context-menu.component.mjs +76 -0
  152. package/esm2020/reuse-tab/reuse-tab-context.component.mjs +33 -0
  153. package/esm2020/reuse-tab/reuse-tab-context.directive.mjs +35 -0
  154. package/esm2020/reuse-tab/reuse-tab-context.service.mjs +55 -0
  155. package/esm2020/reuse-tab/reuse-tab.component.mjs +318 -0
  156. package/{esm2015/reuse-tab/reuse-tab.interfaces.js → esm2020/reuse-tab/reuse-tab.interfaces.mjs} +0 -0
  157. package/esm2020/reuse-tab/reuse-tab.module.mjs +29 -0
  158. package/esm2020/reuse-tab/reuse-tab.service.mjs +533 -0
  159. package/{esm2015/reuse-tab/reuse-tab.strategy.js → esm2020/reuse-tab/reuse-tab.strategy.mjs} +0 -0
  160. package/{esm2015/reuse-tab/reuseTab.js → esm2020/reuse-tab/reuseTab.mjs} +0 -0
  161. package/{esm2015/se/edit.js → esm2020/se/edit.mjs} +0 -0
  162. package/esm2020/se/public_api.mjs +5 -0
  163. package/esm2020/se/se-container.component.mjs +173 -0
  164. package/esm2020/se/se.component.mjs +233 -0
  165. package/esm2020/se/se.module.mjs +23 -0
  166. package/{esm2015/se/se.types.js → esm2020/se/se.types.mjs} +0 -0
  167. package/{esm2015/sg/grid.js → esm2020/sg/grid.mjs} +0 -0
  168. package/{esm2015/sg/public_api.js → esm2020/sg/public_api.mjs} +0 -0
  169. package/esm2020/sg/sg-container.component.mjs +52 -0
  170. package/esm2020/sg/sg.component.mjs +67 -0
  171. package/esm2020/sg/sg.module.mjs +20 -0
  172. package/{esm2015/st/public_api.js → esm2020/st/public_api.mjs} +0 -0
  173. package/esm2020/st/st-column-source.mjs +470 -0
  174. package/esm2020/st/st-data-source.mjs +448 -0
  175. package/esm2020/st/st-export.mjs +89 -0
  176. package/esm2020/st/st-filter.component.mjs +262 -0
  177. package/esm2020/st/st-row.directive.mjs +45 -0
  178. package/esm2020/st/st-widget-host.directive.mjs +31 -0
  179. package/esm2020/st/st-widget.mjs +26 -0
  180. package/esm2020/st/st.component.mjs +969 -0
  181. package/{esm2015/st/st.config.js → esm2020/st/st.config.mjs} +1 -2
  182. package/esm2020/st/st.interfaces.mjs +2 -0
  183. package/esm2020/st/st.module.mjs +98 -0
  184. package/esm2020/st/st.types.mjs +2 -0
  185. package/esm2020/st/table.mjs +5 -0
  186. package/esm2020/sv/public_api.mjs +5 -0
  187. package/esm2020/sv/sv-container.component.mjs +125 -0
  188. package/esm2020/sv/sv-value.component.mjs +44 -0
  189. package/esm2020/sv/sv.component.mjs +113 -0
  190. package/esm2020/sv/sv.module.mjs +25 -0
  191. package/{esm2015/sv/view.js → esm2020/sv/view.mjs} +0 -0
  192. package/{esm2015/tag-select/public_api.js → esm2020/tag-select/public_api.mjs} +0 -0
  193. package/esm2020/tag-select/tag-select.component.mjs +64 -0
  194. package/esm2020/tag-select/tag-select.module.mjs +21 -0
  195. package/{esm2015/tag-select/tagSelect.js → esm2020/tag-select/tagSelect.mjs} +0 -0
  196. package/{esm2015/xlsx/public_api.js → esm2020/xlsx/public_api.mjs} +0 -0
  197. package/esm2020/xlsx/xlsx.directive.mjs +27 -0
  198. package/{esm2015/xlsx/xlsx.js → esm2020/xlsx/xlsx.mjs} +0 -0
  199. package/esm2020/xlsx/xlsx.module.mjs +19 -0
  200. package/esm2020/xlsx/xlsx.service.mjs +128 -0
  201. package/{esm2015/xlsx/xlsx.types.js → esm2020/xlsx/xlsx.types.mjs} +0 -0
  202. package/{esm2015/zip/public_api.js → esm2020/zip/public_api.mjs} +0 -0
  203. package/{esm2015/zip/zip.js → esm2020/zip/zip.mjs} +0 -0
  204. package/esm2020/zip/zip.module.mjs +15 -0
  205. package/esm2020/zip/zip.service.mjs +114 -0
  206. package/{esm2015/zip/zip.types.js → esm2020/zip/zip.types.mjs} +0 -0
  207. package/exception/exception.component.d.ts +6 -2
  208. package/exception/exception.d.ts +1 -0
  209. package/exception/exception.module.d.ts +10 -0
  210. package/exception/package.json +5 -6
  211. package/exception/style/index.less +9 -0
  212. package/fesm2015/{abc.js → abc.mjs} +1 -1
  213. package/fesm2015/abc.mjs.map +1 -0
  214. package/fesm2015/autoFocus.mjs +69 -0
  215. package/fesm2015/autoFocus.mjs.map +1 -0
  216. package/fesm2015/avatarList.mjs +140 -0
  217. package/fesm2015/avatarList.mjs.map +1 -0
  218. package/fesm2015/count-down.mjs +69 -0
  219. package/fesm2015/count-down.mjs.map +1 -0
  220. package/fesm2015/{datePicker.js → datePicker.mjs} +63 -40
  221. package/fesm2015/datePicker.mjs.map +1 -0
  222. package/fesm2015/downFile.mjs +141 -0
  223. package/fesm2015/downFile.mjs.map +1 -0
  224. package/fesm2015/edit.mjs +443 -0
  225. package/fesm2015/edit.mjs.map +1 -0
  226. package/fesm2015/ellipsis.mjs +255 -0
  227. package/fesm2015/ellipsis.mjs.map +1 -0
  228. package/fesm2015/errorCollect.mjs +144 -0
  229. package/fesm2015/errorCollect.mjs.map +1 -0
  230. package/fesm2015/exception.mjs +135 -0
  231. package/fesm2015/exception.mjs.map +1 -0
  232. package/fesm2015/footerToolbar.mjs +70 -0
  233. package/fesm2015/footerToolbar.mjs.map +1 -0
  234. package/fesm2015/fullContent.mjs +202 -0
  235. package/fesm2015/fullContent.mjs.map +1 -0
  236. package/fesm2015/globalFooter.mjs +127 -0
  237. package/fesm2015/globalFooter.mjs.map +1 -0
  238. package/fesm2015/grid.mjs +139 -0
  239. package/fesm2015/grid.mjs.map +1 -0
  240. package/fesm2015/image.mjs +165 -0
  241. package/fesm2015/image.mjs.map +1 -0
  242. package/fesm2015/let.mjs +59 -0
  243. package/fesm2015/let.mjs.map +1 -0
  244. package/fesm2015/loading.mjs +140 -0
  245. package/fesm2015/loading.mjs.map +1 -0
  246. package/fesm2015/{lodop.js → lodop.mjs} +15 -15
  247. package/fesm2015/lodop.mjs.map +1 -0
  248. package/fesm2015/media.mjs +170 -0
  249. package/fesm2015/media.mjs.map +1 -0
  250. package/fesm2015/noticeIcon.mjs +173 -0
  251. package/fesm2015/noticeIcon.mjs.map +1 -0
  252. package/fesm2015/onboarding.mjs +335 -0
  253. package/fesm2015/onboarding.mjs.map +1 -0
  254. package/fesm2015/pageHeader.mjs +277 -0
  255. package/fesm2015/pageHeader.mjs.map +1 -0
  256. package/fesm2015/{pdf.js → pdf.mjs} +81 -54
  257. package/fesm2015/pdf.mjs.map +1 -0
  258. package/fesm2015/qr.mjs +171 -0
  259. package/fesm2015/qr.mjs.map +1 -0
  260. package/fesm2015/quickMenu.mjs +114 -0
  261. package/fesm2015/quickMenu.mjs.map +1 -0
  262. package/fesm2015/result.mjs +89 -0
  263. package/fesm2015/result.mjs.map +1 -0
  264. package/fesm2015/{reuseTab.js → reuseTab.mjs} +188 -174
  265. package/fesm2015/reuseTab.mjs.map +1 -0
  266. package/fesm2015/table.mjs +2426 -0
  267. package/fesm2015/table.mjs.map +1 -0
  268. package/fesm2015/tagSelect.mjs +92 -0
  269. package/fesm2015/tagSelect.mjs.map +1 -0
  270. package/fesm2015/view.mjs +302 -0
  271. package/fesm2015/view.mjs.map +1 -0
  272. package/fesm2015/{xlsx.js → xlsx.mjs} +42 -42
  273. package/fesm2015/xlsx.mjs.map +1 -0
  274. package/fesm2015/{zip.js → zip.mjs} +35 -32
  275. package/fesm2015/zip.mjs.map +1 -0
  276. package/fesm2020/abc.mjs +7 -0
  277. package/fesm2020/abc.mjs.map +1 -0
  278. package/fesm2020/autoFocus.mjs +69 -0
  279. package/fesm2020/autoFocus.mjs.map +1 -0
  280. package/fesm2020/avatarList.mjs +137 -0
  281. package/fesm2020/avatarList.mjs.map +1 -0
  282. package/fesm2020/count-down.mjs +69 -0
  283. package/fesm2020/count-down.mjs.map +1 -0
  284. package/fesm2020/datePicker.mjs +236 -0
  285. package/fesm2020/datePicker.mjs.map +1 -0
  286. package/fesm2020/downFile.mjs +138 -0
  287. package/fesm2020/downFile.mjs.map +1 -0
  288. package/fesm2020/edit.mjs +436 -0
  289. package/fesm2020/edit.mjs.map +1 -0
  290. package/fesm2020/ellipsis.mjs +253 -0
  291. package/fesm2020/ellipsis.mjs.map +1 -0
  292. package/fesm2020/errorCollect.mjs +141 -0
  293. package/fesm2020/errorCollect.mjs.map +1 -0
  294. package/fesm2020/exception.mjs +132 -0
  295. package/fesm2020/exception.mjs.map +1 -0
  296. package/fesm2020/footerToolbar.mjs +68 -0
  297. package/fesm2020/footerToolbar.mjs.map +1 -0
  298. package/fesm2020/fullContent.mjs +199 -0
  299. package/fesm2020/fullContent.mjs.map +1 -0
  300. package/fesm2020/globalFooter.mjs +124 -0
  301. package/fesm2020/globalFooter.mjs.map +1 -0
  302. package/fesm2020/grid.mjs +137 -0
  303. package/fesm2020/grid.mjs.map +1 -0
  304. package/fesm2020/image.mjs +170 -0
  305. package/fesm2020/image.mjs.map +1 -0
  306. package/fesm2020/let.mjs +57 -0
  307. package/fesm2020/let.mjs.map +1 -0
  308. package/fesm2020/loading.mjs +138 -0
  309. package/fesm2020/loading.mjs.map +1 -0
  310. package/fesm2020/lodop.mjs +239 -0
  311. package/fesm2020/lodop.mjs.map +1 -0
  312. package/fesm2020/media.mjs +172 -0
  313. package/fesm2020/media.mjs.map +1 -0
  314. package/fesm2020/noticeIcon.mjs +173 -0
  315. package/fesm2020/noticeIcon.mjs.map +1 -0
  316. package/fesm2020/onboarding.mjs +343 -0
  317. package/fesm2020/onboarding.mjs.map +1 -0
  318. package/fesm2020/pageHeader.mjs +274 -0
  319. package/fesm2020/pageHeader.mjs.map +1 -0
  320. package/fesm2020/pdf.mjs +506 -0
  321. package/fesm2020/pdf.mjs.map +1 -0
  322. package/fesm2020/qr.mjs +171 -0
  323. package/fesm2020/qr.mjs.map +1 -0
  324. package/fesm2020/quickMenu.mjs +114 -0
  325. package/fesm2020/quickMenu.mjs.map +1 -0
  326. package/fesm2020/result.mjs +86 -0
  327. package/fesm2020/result.mjs.map +1 -0
  328. package/fesm2020/reuseTab.mjs +1106 -0
  329. package/fesm2020/reuseTab.mjs.map +1 -0
  330. package/fesm2020/table.mjs +2469 -0
  331. package/fesm2020/table.mjs.map +1 -0
  332. package/fesm2020/tagSelect.mjs +89 -0
  333. package/fesm2020/tagSelect.mjs.map +1 -0
  334. package/fesm2020/view.mjs +298 -0
  335. package/fesm2020/view.mjs.map +1 -0
  336. package/fesm2020/xlsx.mjs +175 -0
  337. package/fesm2020/xlsx.mjs.map +1 -0
  338. package/fesm2020/zip.mjs +134 -0
  339. package/fesm2020/zip.mjs.map +1 -0
  340. package/footer-toolbar/footer-toolbar.component.d.ts +4 -1
  341. package/footer-toolbar/footer-toolbar.module.d.ts +8 -0
  342. package/footer-toolbar/footerToolbar.d.ts +1 -0
  343. package/footer-toolbar/package.json +5 -6
  344. package/footer-toolbar/style/index.less +1 -0
  345. package/full-content/full-content-toggle.directive.d.ts +3 -0
  346. package/full-content/full-content.component.d.ts +6 -3
  347. package/full-content/full-content.module.d.ts +7 -0
  348. package/full-content/full-content.service.d.ts +3 -0
  349. package/full-content/fullContent.d.ts +1 -0
  350. package/full-content/package.json +5 -6
  351. package/full-content/style/index.less +1 -0
  352. package/global-footer/global-footer-item.component.d.ts +5 -2
  353. package/global-footer/global-footer.component.d.ts +3 -0
  354. package/global-footer/global-footer.module.d.ts +8 -0
  355. package/global-footer/globalFooter.d.ts +1 -0
  356. package/global-footer/package.json +5 -6
  357. package/global-footer/style/index.less +5 -0
  358. package/image/image.d.ts +1 -0
  359. package/image/image.directive.d.ts +4 -1
  360. package/image/image.module.d.ts +7 -0
  361. package/image/package.json +5 -6
  362. package/let/let.d.ts +1 -0
  363. package/let/let.directive.d.ts +3 -0
  364. package/let/let.module.d.ts +5 -0
  365. package/let/package.json +5 -6
  366. package/loading/loading.component.d.ts +3 -0
  367. package/loading/loading.d.ts +1 -0
  368. package/loading/loading.module.d.ts +10 -0
  369. package/loading/loading.service.d.ts +4 -1
  370. package/loading/package.json +5 -6
  371. package/loading/style/index.less +3 -0
  372. package/lodop/lodop.d.ts +1 -0
  373. package/lodop/lodop.module.d.ts +4 -0
  374. package/lodop/lodop.service.d.ts +3 -0
  375. package/lodop/lodop.types.d.ts +4 -0
  376. package/lodop/package.json +5 -6
  377. package/media/media.component.d.ts +4 -1
  378. package/media/media.d.ts +1 -0
  379. package/media/media.module.d.ts +6 -0
  380. package/media/media.service.d.ts +3 -0
  381. package/media/package.json +5 -6
  382. package/notice-icon/notice-icon-tab.component.d.ts +3 -0
  383. package/notice-icon/notice-icon.component.d.ts +4 -1
  384. package/notice-icon/notice-icon.module.d.ts +16 -0
  385. package/notice-icon/noticeIcon.d.ts +1 -0
  386. package/notice-icon/package.json +5 -6
  387. package/notice-icon/style/index.less +17 -0
  388. package/onboarding/onboarding.component.d.ts +4 -1
  389. package/onboarding/onboarding.d.ts +1 -0
  390. package/onboarding/onboarding.module.d.ts +11 -0
  391. package/onboarding/onboarding.service.d.ts +3 -0
  392. package/onboarding/package.json +5 -6
  393. package/onboarding/schema.json +1 -1
  394. package/onboarding/style/index.less +6 -0
  395. package/package.json +274 -14
  396. package/page-header/package.json +5 -6
  397. package/page-header/page-header.component.d.ts +4 -1
  398. package/page-header/page-header.module.d.ts +11 -0
  399. package/page-header/pageHeader.d.ts +1 -0
  400. package/page-header/style/index.less +10 -0
  401. package/page-header/style/rtl.less +3 -0
  402. package/pdf/package.json +5 -6
  403. package/pdf/pdf.component.d.ts +5 -2
  404. package/pdf/pdf.d.ts +1 -0
  405. package/pdf/pdf.module.d.ts +7 -0
  406. package/qr/package.json +5 -6
  407. package/qr/qr.component.d.ts +13 -10
  408. package/qr/qr.d.ts +1 -0
  409. package/qr/qr.module.d.ts +6 -0
  410. package/quick-menu/package.json +5 -6
  411. package/quick-menu/quick-menu.component.d.ts +6 -3
  412. package/quick-menu/quick-menu.module.d.ts +8 -0
  413. package/quick-menu/quickMenu.d.ts +1 -0
  414. package/quick-menu/style/index.less +2 -0
  415. package/result/package.json +5 -6
  416. package/result/result.component.d.ts +6 -3
  417. package/result/result.d.ts +1 -0
  418. package/result/result.module.d.ts +8 -0
  419. package/result/style/index.less +7 -0
  420. package/reuse-tab/package.json +5 -6
  421. package/reuse-tab/reuse-tab-context-menu.component.d.ts +3 -0
  422. package/reuse-tab/reuse-tab-context.component.d.ts +4 -1
  423. package/reuse-tab/reuse-tab-context.directive.d.ts +3 -0
  424. package/reuse-tab/reuse-tab-context.service.d.ts +4 -1
  425. package/reuse-tab/reuse-tab.component.d.ts +14 -11
  426. package/reuse-tab/reuse-tab.module.d.ts +15 -0
  427. package/reuse-tab/reuse-tab.service.d.ts +7 -4
  428. package/reuse-tab/reuseTab.d.ts +1 -0
  429. package/reuse-tab/style/index.less +4 -0
  430. package/se/edit.d.ts +1 -0
  431. package/se/package.json +5 -6
  432. package/se/public_api.d.ts +0 -1
  433. package/se/se-container.component.d.ts +18 -4
  434. package/se/se.component.d.ts +13 -8
  435. package/se/se.module.d.ts +10 -0
  436. package/se/style/index.less +2 -0
  437. package/sg/grid.d.ts +1 -0
  438. package/sg/package.json +5 -6
  439. package/sg/sg-container.component.d.ts +4 -1
  440. package/sg/sg.component.d.ts +4 -1
  441. package/sg/sg.module.d.ts +7 -0
  442. package/st/package.json +5 -6
  443. package/st/st-column-source.d.ts +4 -1
  444. package/st/st-data-source.d.ts +3 -0
  445. package/st/st-export.d.ts +3 -0
  446. package/st/st-filter.component.d.ts +21 -0
  447. package/st/st-row.directive.d.ts +7 -2
  448. package/st/st-widget-host.directive.d.ts +5 -3
  449. package/st/st-widget.d.ts +3 -0
  450. package/st/st.component.d.ts +44 -31
  451. package/st/st.interfaces.d.ts +59 -5
  452. package/st/st.module.d.ts +27 -0
  453. package/st/st.types.d.ts +6 -0
  454. package/st/style/index.less +16 -0
  455. package/st/table.d.ts +1 -1
  456. package/sv/package.json +5 -6
  457. package/sv/public_api.d.ts +0 -1
  458. package/sv/style/index.less +9 -0
  459. package/sv/sv-container.component.d.ts +16 -3
  460. package/sv/sv-value.component.d.ts +3 -0
  461. package/sv/sv.component.d.ts +13 -10
  462. package/sv/sv.module.d.ts +12 -0
  463. package/sv/view.d.ts +1 -0
  464. package/tag-select/package.json +5 -6
  465. package/tag-select/style/index.less +4 -0
  466. package/tag-select/style/rtl.less +3 -0
  467. package/tag-select/tag-select.component.d.ts +3 -0
  468. package/tag-select/tag-select.module.d.ts +8 -0
  469. package/tag-select/tagSelect.d.ts +1 -0
  470. package/xlsx/package.json +5 -6
  471. package/xlsx/xlsx.d.ts +1 -0
  472. package/xlsx/xlsx.directive.d.ts +3 -0
  473. package/xlsx/xlsx.module.d.ts +6 -0
  474. package/xlsx/xlsx.service.d.ts +3 -0
  475. package/zip/package.json +5 -6
  476. package/zip/zip.d.ts +1 -0
  477. package/zip/zip.module.d.ts +5 -0
  478. package/zip/zip.service.d.ts +3 -0
  479. package/abc.metadata.json +0 -1
  480. package/auto-focus/autoFocus.metadata.json +0 -1
  481. package/avatar-list/avatarList.metadata.json +0 -1
  482. package/bundles/abc.umd.js +0 -19
  483. package/bundles/abc.umd.js.map +0 -1
  484. package/bundles/autoFocus.umd.js +0 -394
  485. package/bundles/autoFocus.umd.js.map +0 -1
  486. package/bundles/avatarList.umd.js +0 -465
  487. package/bundles/avatarList.umd.js.map +0 -1
  488. package/bundles/count-down.umd.js +0 -75
  489. package/bundles/count-down.umd.js.map +0 -1
  490. package/bundles/datePicker.umd.js +0 -552
  491. package/bundles/datePicker.umd.js.map +0 -1
  492. package/bundles/downFile.umd.js +0 -474
  493. package/bundles/downFile.umd.js.map +0 -1
  494. package/bundles/edit.umd.js +0 -776
  495. package/bundles/edit.umd.js.map +0 -1
  496. package/bundles/ellipsis.umd.js +0 -578
  497. package/bundles/ellipsis.umd.js.map +0 -1
  498. package/bundles/errorCollect.umd.js +0 -461
  499. package/bundles/errorCollect.umd.js.map +0 -1
  500. package/bundles/exception.umd.js +0 -147
  501. package/bundles/exception.umd.js.map +0 -1
  502. package/bundles/footerToolbar.umd.js +0 -401
  503. package/bundles/footerToolbar.umd.js.map +0 -1
  504. package/bundles/fullContent.umd.js +0 -550
  505. package/bundles/fullContent.umd.js.map +0 -1
  506. package/bundles/globalFooter.umd.js +0 -455
  507. package/bundles/globalFooter.umd.js.map +0 -1
  508. package/bundles/grid.umd.js +0 -470
  509. package/bundles/grid.umd.js.map +0 -1
  510. package/bundles/image.umd.js +0 -482
  511. package/bundles/image.umd.js.map +0 -1
  512. package/bundles/let.umd.js +0 -76
  513. package/bundles/let.umd.js.map +0 -1
  514. package/bundles/loading.umd.js +0 -181
  515. package/bundles/loading.umd.js.map +0 -1
  516. package/bundles/lodop.umd.js +0 -605
  517. package/bundles/lodop.umd.js.map +0 -1
  518. package/bundles/media.umd.js +0 -536
  519. package/bundles/media.umd.js.map +0 -1
  520. package/bundles/noticeIcon.umd.js +0 -468
  521. package/bundles/noticeIcon.umd.js.map +0 -1
  522. package/bundles/onboarding.umd.js +0 -370
  523. package/bundles/onboarding.umd.js.map +0 -1
  524. package/bundles/pageHeader.umd.js +0 -570
  525. package/bundles/pageHeader.umd.js.map +0 -1
  526. package/bundles/pdf.umd.js +0 -863
  527. package/bundles/pdf.umd.js.map +0 -1
  528. package/bundles/qr.umd.js +0 -491
  529. package/bundles/qr.umd.js.map +0 -1
  530. package/bundles/quickMenu.umd.js +0 -442
  531. package/bundles/quickMenu.umd.js.map +0 -1
  532. package/bundles/result.umd.js +0 -100
  533. package/bundles/result.umd.js.map +0 -1
  534. package/bundles/reuseTab.umd.js +0 -1531
  535. package/bundles/reuseTab.umd.js.map +0 -1
  536. package/bundles/table.umd.js +0 -2489
  537. package/bundles/table.umd.js.map +0 -1
  538. package/bundles/tagSelect.umd.js +0 -419
  539. package/bundles/tagSelect.umd.js.map +0 -1
  540. package/bundles/view.umd.js +0 -592
  541. package/bundles/view.umd.js.map +0 -1
  542. package/bundles/xlsx.umd.js +0 -529
  543. package/bundles/xlsx.umd.js.map +0 -1
  544. package/bundles/zip.umd.js +0 -482
  545. package/bundles/zip.umd.js.map +0 -1
  546. package/count-down/count-down.metadata.json +0 -1
  547. package/date-picker/datePicker.metadata.json +0 -1
  548. package/down-file/downFile.metadata.json +0 -1
  549. package/ellipsis/ellipsis.metadata.json +0 -1
  550. package/error-collect/errorCollect.metadata.json +0 -1
  551. package/esm2015/auto-focus/auto-focus.directive.js +0 -42
  552. package/esm2015/auto-focus/auto-focus.module.js +0 -12
  553. package/esm2015/avatar-list/avatar-list-item.component.js +0 -20
  554. package/esm2015/avatar-list/avatar-list.component.js +0 -89
  555. package/esm2015/avatar-list/avatar-list.module.js +0 -17
  556. package/esm2015/count-down/count-down.component.js +0 -36
  557. package/esm2015/count-down/count-down.module.js +0 -15
  558. package/esm2015/date-picker/date-picker.module.js +0 -17
  559. package/esm2015/date-picker/datePicker.js +0 -6
  560. package/esm2015/date-picker/range-shortcut.component.js +0 -26
  561. package/esm2015/date-picker/range.directive.js +0 -171
  562. package/esm2015/down-file/down-file.directive.js +0 -103
  563. package/esm2015/down-file/down-file.module.js +0 -15
  564. package/esm2015/ellipsis/ellipsis.component.js +0 -224
  565. package/esm2015/ellipsis/ellipsis.module.js +0 -16
  566. package/esm2015/error-collect/error-collect.component.js +0 -112
  567. package/esm2015/error-collect/error-collect.module.js +0 -15
  568. package/esm2015/exception/exception.component.js +0 -100
  569. package/esm2015/exception/exception.module.js +0 -17
  570. package/esm2015/footer-toolbar/footer-toolbar.component.js +0 -46
  571. package/esm2015/footer-toolbar/footer-toolbar.module.js +0 -16
  572. package/esm2015/full-content/full-content-toggle.directive.js +0 -23
  573. package/esm2015/full-content/full-content.component.js +0 -135
  574. package/esm2015/full-content/full-content.module.js +0 -15
  575. package/esm2015/full-content/full-content.service.js +0 -21
  576. package/esm2015/global-footer/global-footer-item.component.js +0 -24
  577. package/esm2015/global-footer/global-footer.component.js +0 -77
  578. package/esm2015/global-footer/global-footer.module.js +0 -16
  579. package/esm2015/image/image.directive.js +0 -133
  580. package/esm2015/image/image.module.js +0 -15
  581. package/esm2015/let/let.directive.js +0 -31
  582. package/esm2015/let/let.module.js +0 -12
  583. package/esm2015/loading/loading.component.js +0 -26
  584. package/esm2015/loading/loading.module.js +0 -19
  585. package/esm2015/loading/loading.service.js +0 -92
  586. package/esm2015/lodop/lodop.module.js +0 -7
  587. package/esm2015/lodop/lodop.service.js +0 -219
  588. package/esm2015/lodop/lodop.types.js +0 -2
  589. package/esm2015/media/media.component.js +0 -104
  590. package/esm2015/media/media.module.js +0 -14
  591. package/esm2015/media/media.service.js +0 -53
  592. package/esm2015/notice-icon/notice-icon-tab.component.js +0 -30
  593. package/esm2015/notice-icon/notice-icon.component.js +0 -74
  594. package/esm2015/notice-icon/notice-icon.module.js +0 -35
  595. package/esm2015/onboarding/onboarding.component.js +0 -130
  596. package/esm2015/onboarding/onboarding.module.js +0 -20
  597. package/esm2015/onboarding/onboarding.service.js +0 -178
  598. package/esm2015/page-header/page-header.component.js +0 -216
  599. package/esm2015/page-header/page-header.module.js +0 -19
  600. package/esm2015/pdf/pdf.component.js +0 -433
  601. package/esm2015/pdf/pdf.module.js +0 -15
  602. package/esm2015/qr/qr.component.js +0 -128
  603. package/esm2015/qr/qr.module.js +0 -14
  604. package/esm2015/quick-menu/quick-menu.component.js +0 -90
  605. package/esm2015/quick-menu/quick-menu.module.js +0 -16
  606. package/esm2015/result/result.component.js +0 -62
  607. package/esm2015/result/result.module.js +0 -16
  608. package/esm2015/reuse-tab/reuse-tab-context-menu.component.js +0 -74
  609. package/esm2015/reuse-tab/reuse-tab-context.component.js +0 -32
  610. package/esm2015/reuse-tab/reuse-tab-context.directive.js +0 -33
  611. package/esm2015/reuse-tab/reuse-tab-context.service.js +0 -62
  612. package/esm2015/reuse-tab/reuse-tab.component.js +0 -300
  613. package/esm2015/reuse-tab/reuse-tab.module.js +0 -24
  614. package/esm2015/reuse-tab/reuse-tab.service.js +0 -534
  615. package/esm2015/se/public_api.js +0 -6
  616. package/esm2015/se/se-container.component.js +0 -115
  617. package/esm2015/se/se-title.component.js +0 -40
  618. package/esm2015/se/se.component.js +0 -214
  619. package/esm2015/se/se.module.js +0 -19
  620. package/esm2015/sg/sg-container.component.js +0 -49
  621. package/esm2015/sg/sg.component.js +0 -65
  622. package/esm2015/sg/sg.module.js +0 -15
  623. package/esm2015/st/st-column-source.js +0 -410
  624. package/esm2015/st/st-data-source.js +0 -429
  625. package/esm2015/st/st-export.js +0 -90
  626. package/esm2015/st/st-row.directive.js +0 -40
  627. package/esm2015/st/st-widget-host.directive.js +0 -34
  628. package/esm2015/st/st-widget.js +0 -24
  629. package/esm2015/st/st.component.js +0 -874
  630. package/esm2015/st/st.interfaces.js +0 -2
  631. package/esm2015/st/st.module.js +0 -50
  632. package/esm2015/st/st.types.js +0 -2
  633. package/esm2015/st/table.js +0 -6
  634. package/esm2015/sv/public_api.js +0 -6
  635. package/esm2015/sv/sv-container.component.js +0 -63
  636. package/esm2015/sv/sv-title.component.js +0 -40
  637. package/esm2015/sv/sv-value.component.js +0 -32
  638. package/esm2015/sv/sv.component.js +0 -105
  639. package/esm2015/sv/sv.module.js +0 -21
  640. package/esm2015/tag-select/tag-select.component.js +0 -70
  641. package/esm2015/tag-select/tag-select.module.js +0 -16
  642. package/esm2015/xlsx/xlsx.directive.js +0 -26
  643. package/esm2015/xlsx/xlsx.module.js +0 -14
  644. package/esm2015/xlsx/xlsx.service.js +0 -129
  645. package/esm2015/zip/zip.module.js +0 -10
  646. package/esm2015/zip/zip.service.js +0 -115
  647. package/exception/exception.metadata.json +0 -1
  648. package/fesm2015/abc.js.map +0 -1
  649. package/fesm2015/autoFocus.js +0 -59
  650. package/fesm2015/autoFocus.js.map +0 -1
  651. package/fesm2015/avatarList.js +0 -128
  652. package/fesm2015/avatarList.js.map +0 -1
  653. package/fesm2015/count-down.js +0 -56
  654. package/fesm2015/count-down.js.map +0 -1
  655. package/fesm2015/datePicker.js.map +0 -1
  656. package/fesm2015/downFile.js +0 -122
  657. package/fesm2015/downFile.js.map +0 -1
  658. package/fesm2015/edit.js +0 -396
  659. package/fesm2015/edit.js.map +0 -1
  660. package/fesm2015/ellipsis.js +0 -244
  661. package/fesm2015/ellipsis.js.map +0 -1
  662. package/fesm2015/errorCollect.js +0 -131
  663. package/fesm2015/errorCollect.js.map +0 -1
  664. package/fesm2015/exception.js +0 -121
  665. package/fesm2015/exception.js.map +0 -1
  666. package/fesm2015/footerToolbar.js +0 -66
  667. package/fesm2015/footerToolbar.js.map +0 -1
  668. package/fesm2015/fullContent.js +0 -191
  669. package/fesm2015/fullContent.js.map +0 -1
  670. package/fesm2015/globalFooter.js +0 -118
  671. package/fesm2015/globalFooter.js.map +0 -1
  672. package/fesm2015/grid.js +0 -129
  673. package/fesm2015/grid.js.map +0 -1
  674. package/fesm2015/image.js +0 -152
  675. package/fesm2015/image.js.map +0 -1
  676. package/fesm2015/let.js +0 -48
  677. package/fesm2015/let.js.map +0 -1
  678. package/fesm2015/loading.js +0 -138
  679. package/fesm2015/loading.js.map +0 -1
  680. package/fesm2015/lodop.js.map +0 -1
  681. package/fesm2015/media.js +0 -174
  682. package/fesm2015/media.js.map +0 -1
  683. package/fesm2015/noticeIcon.js +0 -141
  684. package/fesm2015/noticeIcon.js.map +0 -1
  685. package/fesm2015/onboarding.js +0 -328
  686. package/fesm2015/onboarding.js.map +0 -1
  687. package/fesm2015/pageHeader.js +0 -239
  688. package/fesm2015/pageHeader.js.map +0 -1
  689. package/fesm2015/pdf.js.map +0 -1
  690. package/fesm2015/qr.js +0 -159
  691. package/fesm2015/qr.js.map +0 -1
  692. package/fesm2015/quickMenu.js +0 -111
  693. package/fesm2015/quickMenu.js.map +0 -1
  694. package/fesm2015/result.js +0 -83
  695. package/fesm2015/result.js.map +0 -1
  696. package/fesm2015/reuseTab.js.map +0 -1
  697. package/fesm2015/table.js +0 -2002
  698. package/fesm2015/table.js.map +0 -1
  699. package/fesm2015/tagSelect.js +0 -90
  700. package/fesm2015/tagSelect.js.map +0 -1
  701. package/fesm2015/view.js +0 -256
  702. package/fesm2015/view.js.map +0 -1
  703. package/fesm2015/xlsx.js.map +0 -1
  704. package/fesm2015/zip.js.map +0 -1
  705. package/footer-toolbar/footerToolbar.metadata.json +0 -1
  706. package/full-content/fullContent.metadata.json +0 -1
  707. package/global-footer/globalFooter.metadata.json +0 -1
  708. package/image/image.metadata.json +0 -1
  709. package/let/let.metadata.json +0 -1
  710. package/loading/loading.metadata.json +0 -1
  711. package/lodop/lodop.metadata.json +0 -1
  712. package/media/media.metadata.json +0 -1
  713. package/notice-icon/noticeIcon.metadata.json +0 -1
  714. package/onboarding/onboarding.metadata.json +0 -1
  715. package/page-header/pageHeader.metadata.json +0 -1
  716. package/pdf/pdf.metadata.json +0 -1
  717. package/qr/qr.metadata.json +0 -1
  718. package/quick-menu/quickMenu.metadata.json +0 -1
  719. package/result/result.metadata.json +0 -1
  720. package/reuse-tab/reuseTab.metadata.json +0 -1
  721. package/se/edit.metadata.json +0 -1
  722. package/se/se-title.component.d.ts +0 -10
  723. package/sg/grid.metadata.json +0 -1
  724. package/st/table.metadata.json +0 -1
  725. package/sv/sv-title.component.d.ts +0 -10
  726. package/sv/view.metadata.json +0 -1
  727. package/tag-select/tagSelect.metadata.json +0 -1
  728. package/xlsx/xlsx.metadata.json +0 -1
  729. package/zip/zip.metadata.json +0 -1
package/fesm2015/table.js DELETED
@@ -1,2002 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Directive, TemplateRef, Host, Input, Optional, Inject, ViewContainerRef, ComponentFactoryResolver, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef, ElementRef, ViewChild, Output, NgModule } from '@angular/core';
3
- import { DomSanitizer } from '@angular/platform-browser';
4
- import { ACLService, DelonACLModule } from '@delon/acl';
5
- import { ALAIN_I18N_TOKEN, _HttpClient, DatePipe, YNPipe, ModalHelper, DrawerHelper, DelonLocaleService } from '@delon/theme';
6
- import { warn, deepCopy, deepGet, deepMergeKey } from '@delon/util/other';
7
- import { DecimalPipe, DOCUMENT, CommonModule } from '@angular/common';
8
- import { HttpParams } from '@angular/common/http';
9
- import { of, Subject, from, isObservable } from 'rxjs';
10
- import { map, takeUntil, filter } from 'rxjs/operators';
11
- import { CurrencyService } from '@delon/util/format';
12
- import { __awaiter, __decorate } from 'tslib';
13
- import { XlsxService } from '@delon/abc/xlsx';
14
- import { Router } from '@angular/router';
15
- import { AlainConfigService } from '@delon/util/config';
16
- import { toBoolean, InputNumber, InputBoolean } from '@delon/util/decorator';
17
- import { NzContextMenuService, NzDropDownModule } from 'ng-zorro-antd/dropdown';
18
- import { FormsModule } from '@angular/forms';
19
- import { LetModule } from '@delon/abc/let';
20
- import { NzBadgeModule } from 'ng-zorro-antd/badge';
21
- import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
22
- import { NzDividerModule } from 'ng-zorro-antd/divider';
23
- import { NzIconModule } from 'ng-zorro-antd/icon';
24
- import { NzInputModule } from 'ng-zorro-antd/input';
25
- import { NzMenuModule } from 'ng-zorro-antd/menu';
26
- import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';
27
- import { NzRadioModule } from 'ng-zorro-antd/radio';
28
- import { NzResizableModule } from 'ng-zorro-antd/resizable';
29
- import { NzTableModule } from 'ng-zorro-antd/table';
30
- import { NzTagModule } from 'ng-zorro-antd/tag';
31
- import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
32
-
33
- class STRowSource {
34
- constructor() {
35
- this.titles = {};
36
- this.rows = {};
37
- }
38
- add(type, path, ref) {
39
- this[type === 'title' ? 'titles' : 'rows'][path] = ref;
40
- }
41
- getTitle(path) {
42
- return this.titles[path];
43
- }
44
- getRow(path) {
45
- return this.rows[path];
46
- }
47
- }
48
- STRowSource.decorators = [
49
- { type: Injectable }
50
- ];
51
- class STRowDirective {
52
- constructor(ref, source) {
53
- this.ref = ref;
54
- this.source = source;
55
- }
56
- ngOnInit() {
57
- this.source.add(this.type, this.id, this.ref);
58
- }
59
- }
60
- STRowDirective.decorators = [
61
- { type: Directive, args: [{ selector: '[st-row]' },] }
62
- ];
63
- STRowDirective.ctorParameters = () => [
64
- { type: TemplateRef },
65
- { type: STRowSource, decorators: [{ type: Host }] }
66
- ];
67
- STRowDirective.propDecorators = {
68
- id: [{ type: Input, args: ['st-row',] }],
69
- type: [{ type: Input }]
70
- };
71
-
72
- class STWidgetRegistry {
73
- constructor() {
74
- this._widgets = {};
75
- }
76
- get widgets() {
77
- return this._widgets;
78
- }
79
- register(type, widget) {
80
- this._widgets[type] = widget;
81
- }
82
- has(type) {
83
- return this._widgets.hasOwnProperty(type);
84
- }
85
- get(type) {
86
- return this._widgets[type];
87
- }
88
- }
89
- STWidgetRegistry.ɵprov = i0.ɵɵdefineInjectable({ factory: function STWidgetRegistry_Factory() { return new STWidgetRegistry(); }, token: STWidgetRegistry, providedIn: "root" });
90
- STWidgetRegistry.decorators = [
91
- { type: Injectable, args: [{ providedIn: 'root' },] }
92
- ];
93
-
94
- class STColumnSource {
95
- constructor(dom, rowSource, acl, i18nSrv, stWidgetRegistry) {
96
- this.dom = dom;
97
- this.rowSource = rowSource;
98
- this.acl = acl;
99
- this.i18nSrv = i18nSrv;
100
- this.stWidgetRegistry = stWidgetRegistry;
101
- }
102
- setCog(val) {
103
- this.cog = val;
104
- }
105
- fixPop(i, def) {
106
- if (i.pop == null || i.pop === false) {
107
- i.pop = false;
108
- return;
109
- }
110
- let pop = Object.assign({}, def);
111
- if (typeof i.pop === 'string') {
112
- pop.title = i.pop;
113
- }
114
- else if (typeof i.pop === 'object') {
115
- pop = Object.assign(Object.assign({}, pop), i.pop);
116
- }
117
- if (typeof pop.condition !== 'function') {
118
- pop.condition = () => false;
119
- }
120
- i.pop = pop;
121
- }
122
- btnCoerce(list) {
123
- if (!list)
124
- return [];
125
- const ret = [];
126
- const { modal, drawer, pop, btnIcon } = this.cog;
127
- for (const item of list) {
128
- if (this.acl && item.acl && !this.acl.can(item.acl)) {
129
- continue;
130
- }
131
- if (item.type === 'modal' || item.type === 'static') {
132
- if (item.modal == null || item.modal.component == null) {
133
- console.warn(`[st] Should specify modal parameter when type is modal or static`);
134
- item.type = 'none';
135
- }
136
- else {
137
- item.modal = Object.assign(Object.assign({ paramsName: 'record', size: 'lg' }, modal), item.modal);
138
- }
139
- }
140
- if (item.type === 'drawer') {
141
- if (item.drawer == null || item.drawer.component == null) {
142
- console.warn(`[st] Should specify drawer parameter when type is drawer`);
143
- item.type = 'none';
144
- }
145
- else {
146
- item.drawer = Object.assign(Object.assign({ paramsName: 'record', size: 'lg' }, drawer), item.drawer);
147
- }
148
- }
149
- if (item.type === 'del' && typeof item.pop === 'undefined') {
150
- item.pop = true;
151
- }
152
- // pop
153
- this.fixPop(item, pop);
154
- if (item.icon) {
155
- item.icon = Object.assign(Object.assign({}, btnIcon), (typeof item.icon === 'string' ? { type: item.icon } : item.icon));
156
- }
157
- item.children = item.children && item.children.length > 0 ? this.btnCoerce(item.children) : [];
158
- // i18n
159
- if (item.i18n && this.i18nSrv) {
160
- item.text = this.i18nSrv.fanyi(item.i18n);
161
- }
162
- ret.push(item);
163
- }
164
- this.btnCoerceIf(ret);
165
- return ret;
166
- }
167
- btnCoerceIf(list) {
168
- for (const item of list) {
169
- if (!item.iif)
170
- item.iif = () => true;
171
- item.iifBehavior = item.iifBehavior || this.cog.iifBehavior;
172
- if (item.children && item.children.length > 0) {
173
- this.btnCoerceIf(item.children);
174
- }
175
- else {
176
- item.children = [];
177
- }
178
- }
179
- }
180
- fixedCoerce(list) {
181
- const countReduce = (a, b) => a + +b.width.toString().replace('px', '');
182
- // left width
183
- list
184
- .filter(w => w.fixed && w.fixed === 'left' && w.width)
185
- .forEach((item, idx) => (item._left = `${list.slice(0, idx).reduce(countReduce, 0)}px`));
186
- // right width
187
- list
188
- .filter(w => w.fixed && w.fixed === 'right' && w.width)
189
- .reverse()
190
- .forEach((item, idx) => (item._right = `${idx > 0 ? list.slice(-idx).reduce(countReduce, 0) : 0}px`));
191
- }
192
- sortCoerce(item) {
193
- const res = this.fixSortCoerce(item);
194
- res.reName = Object.assign(Object.assign({}, this.cog.sortReName), res.reName);
195
- return res;
196
- }
197
- fixSortCoerce(item) {
198
- if (typeof item.sort === 'undefined') {
199
- return { enabled: false };
200
- }
201
- let res = {};
202
- if (typeof item.sort === 'string') {
203
- res.key = item.sort;
204
- }
205
- else if (typeof item.sort !== 'boolean') {
206
- res = item.sort;
207
- }
208
- else if (typeof item.sort === 'boolean') {
209
- res.compare = (a, b) => a[item.indexKey] - b[item.indexKey];
210
- }
211
- if (!res.key) {
212
- res.key = item.indexKey;
213
- }
214
- res.enabled = true;
215
- return res;
216
- }
217
- filterCoerce(item) {
218
- if (item.filter == null) {
219
- return null;
220
- }
221
- let res = item.filter;
222
- res.type = res.type || 'default';
223
- let icon = 'filter';
224
- let iconTheme = 'fill';
225
- if (res.type === 'keyword') {
226
- if (res.menus == null || res.menus.length === 0) {
227
- res.menus = [{ value: '' }];
228
- }
229
- icon = 'search';
230
- iconTheme = 'outline';
231
- }
232
- if (res.menus.length === 0) {
233
- return null;
234
- }
235
- if (typeof res.multiple === 'undefined') {
236
- res.multiple = true;
237
- }
238
- res.confirmText = res.confirmText || this.cog.filterConfirmText;
239
- res.clearText = res.clearText || this.cog.filterClearText;
240
- res.key = res.key || item.indexKey;
241
- res.icon = res.icon || icon;
242
- const baseIcon = { type: icon, theme: iconTheme };
243
- if (typeof res.icon === 'string') {
244
- res.icon = Object.assign(Object.assign({}, baseIcon), { type: res.icon });
245
- }
246
- else {
247
- res.icon = Object.assign(Object.assign({}, baseIcon), res.icon);
248
- }
249
- this.updateDefault(res);
250
- if (this.acl) {
251
- res.menus = res.menus.filter(w => this.acl.can(w.acl));
252
- }
253
- if (res.menus.length <= 0) {
254
- res = null;
255
- }
256
- return res;
257
- }
258
- restoreRender(item) {
259
- if (item.renderTitle) {
260
- item.__renderTitle =
261
- typeof item.renderTitle === 'string'
262
- ? this.rowSource.getTitle(item.renderTitle)
263
- : item.renderTitle;
264
- }
265
- if (item.render) {
266
- item.__render =
267
- typeof item.render === 'string' ? this.rowSource.getRow(item.render) : item.render;
268
- }
269
- }
270
- widgetCoerce(item) {
271
- var _a;
272
- if (item.type !== 'widget')
273
- return;
274
- if (item.widget == null || !this.stWidgetRegistry.has(item.widget.type)) {
275
- delete item.type;
276
- warn(`st: No widget for type "${(_a = item.widget) === null || _a === void 0 ? void 0 : _a.type}"`);
277
- }
278
- }
279
- genHeaders(rootColumns) {
280
- const rows = [];
281
- const widths = [];
282
- const fillRowCells = (columns, colIndex, rowIndex = 0) => {
283
- // Init rows
284
- rows[rowIndex] = rows[rowIndex] || [];
285
- let currentColIndex = colIndex;
286
- const colSpans = columns.map(column => {
287
- const cell = {
288
- column,
289
- colStart: currentColIndex,
290
- hasSubColumns: false
291
- };
292
- let colSpan = 1;
293
- const subColumns = column.children;
294
- if (Array.isArray(subColumns) && subColumns.length > 0) {
295
- colSpan = fillRowCells(subColumns, currentColIndex, rowIndex + 1).reduce((total, count) => total + count, 0);
296
- cell.hasSubColumns = true;
297
- }
298
- else {
299
- widths.push(cell.column.width || '');
300
- }
301
- if ('colSpan' in column) {
302
- colSpan = column.colSpan;
303
- }
304
- if ('rowSpan' in column) {
305
- cell.rowSpan = column.rowSpan;
306
- }
307
- cell.colSpan = colSpan;
308
- cell.colEnd = cell.colStart + colSpan - 1;
309
- rows[rowIndex].push(cell);
310
- currentColIndex += colSpan;
311
- return colSpan;
312
- });
313
- return colSpans;
314
- };
315
- fillRowCells(rootColumns, 0);
316
- // Handle `rowSpan`
317
- const rowCount = rows.length;
318
- for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
319
- rows[rowIndex].forEach(cell => {
320
- if (!('rowSpan' in cell) && !cell.hasSubColumns) {
321
- cell.rowSpan = rowCount - rowIndex;
322
- }
323
- });
324
- }
325
- return { headers: rows, headerWidths: rowCount > 1 ? widths : null };
326
- }
327
- cleanCond(list) {
328
- const res = [];
329
- const copyList = deepCopy(list);
330
- for (const item of copyList) {
331
- if (item.iif && !item.iif(item)) {
332
- continue;
333
- }
334
- if (this.acl && item.acl && !this.acl.can(item.acl)) {
335
- continue;
336
- }
337
- if (Array.isArray(item.children) && item.children.length > 0) {
338
- item.children = this.cleanCond(item.children);
339
- }
340
- res.push(item);
341
- }
342
- return res;
343
- }
344
- process(list, options) {
345
- if (!list || list.length === 0)
346
- throw new Error(`[st]: the columns property muse be define!`);
347
- const { noIndex } = this.cog;
348
- let checkboxCount = 0;
349
- let radioCount = 0;
350
- let point = 0;
351
- const columns = [];
352
- const processItem = (item) => {
353
- var _a, _b;
354
- // index
355
- if (item.index) {
356
- if (!Array.isArray(item.index)) {
357
- item.index = item.index.toString().split('.');
358
- }
359
- item.indexKey = item.index.join('.');
360
- }
361
- // #region title
362
- const tit = (typeof item.title === 'string' ? { text: item.title } : item.title) || {};
363
- if (tit.i18n && this.i18nSrv) {
364
- tit.text = this.i18nSrv.fanyi(tit.i18n);
365
- }
366
- if (tit.text) {
367
- tit._text = this.dom.bypassSecurityTrustHtml(tit.text);
368
- }
369
- item.title = tit;
370
- // #endregion
371
- // no
372
- if (item.type === 'no') {
373
- item.noIndex = item.noIndex == null ? noIndex : item.noIndex;
374
- }
375
- // checkbox
376
- if (item.selections == null) {
377
- item.selections = [];
378
- }
379
- if (item.type === 'checkbox') {
380
- ++checkboxCount;
381
- if (!item.width) {
382
- item.width = `${item.selections.length > 0 ? 62 : 50}px`;
383
- }
384
- }
385
- if (this.acl) {
386
- item.selections = item.selections.filter(w => this.acl.can(w.acl));
387
- }
388
- // radio
389
- if (item.type === 'radio') {
390
- ++radioCount;
391
- item.selections = [];
392
- if (!item.width) {
393
- item.width = '50px';
394
- }
395
- }
396
- // types
397
- if (item.type === 'yn') {
398
- item.yn = Object.assign(Object.assign({ truth: true }, this.cog.yn), item.yn);
399
- }
400
- // date
401
- if (item.type === 'date') {
402
- item.dateFormat = item.dateFormat || ((_a = this.cog.date) === null || _a === void 0 ? void 0 : _a.format);
403
- }
404
- if ((item.type === 'link' && typeof item.click !== 'function') ||
405
- (item.type === 'badge' && item.badge == null) ||
406
- (item.type === 'tag' && item.tag == null) ||
407
- (item.type === 'enum' && item.enum == null)) {
408
- item.type = '';
409
- }
410
- item._isTruncate = !!item.width && options.widthMode.strictBehavior === 'truncate' && item.type !== 'img';
411
- // className
412
- if (!item.className) {
413
- item.className = {
414
- number: 'text-right',
415
- currency: 'text-right',
416
- date: 'text-center'
417
- }[item.type];
418
- }
419
- item._className = item.className || (item._isTruncate ? 'text-truncate' : null);
420
- // width
421
- if (typeof item.width === 'number') {
422
- item._width = item.width;
423
- item.width = `${item.width}px`;
424
- }
425
- item._left = false;
426
- item._right = false;
427
- item.safeType = (_b = item.safeType) !== null && _b !== void 0 ? _b : options.safeType;
428
- // sorter
429
- item._sort = this.sortCoerce(item);
430
- // filter
431
- item.filter = this.filterCoerce(item);
432
- // buttons
433
- item.buttons = this.btnCoerce(item.buttons);
434
- // widget
435
- this.widgetCoerce(item);
436
- // restore custom row
437
- this.restoreRender(item);
438
- // resizable
439
- item.resizable = Object.assign(Object.assign({ disabled: true, bounds: 'window', minWidth: 60, maxWidth: 360, preview: true }, options.resizable), (typeof item.resizable === 'boolean' ? { disabled: !item.resizable } : item.resizable));
440
- item.__point = point++;
441
- return item;
442
- };
443
- const processList = (data) => {
444
- for (const item of data) {
445
- columns.push(processItem(item));
446
- if (Array.isArray(item.children)) {
447
- processList(item.children);
448
- }
449
- }
450
- };
451
- const copyList = this.cleanCond(list);
452
- processList(copyList);
453
- if (checkboxCount > 1) {
454
- throw new Error(`[st]: just only one column checkbox`);
455
- }
456
- if (radioCount > 1) {
457
- throw new Error(`[st]: just only one column radio`);
458
- }
459
- this.fixedCoerce(columns);
460
- return Object.assign({ columns: columns.filter(w => !Array.isArray(w.children) || w.children.length === 0) }, this.genHeaders(copyList));
461
- }
462
- restoreAllRender(columns) {
463
- columns.forEach(i => this.restoreRender(i));
464
- }
465
- updateDefault(filter) {
466
- if (filter.type === 'default') {
467
- filter.default = filter.menus.findIndex(w => w.checked) !== -1;
468
- }
469
- else {
470
- filter.default = !!filter.menus[0].value;
471
- }
472
- return this;
473
- }
474
- cleanFilter(col) {
475
- const f = col.filter;
476
- f.default = false;
477
- if (f.type === 'default') {
478
- f.menus.forEach(i => (i.checked = false));
479
- }
480
- else {
481
- f.menus[0].value = undefined;
482
- }
483
- return this;
484
- }
485
- }
486
- STColumnSource.decorators = [
487
- { type: Injectable }
488
- ];
489
- STColumnSource.ctorParameters = () => [
490
- { type: DomSanitizer },
491
- { type: STRowSource, decorators: [{ type: Host }] },
492
- { type: ACLService, decorators: [{ type: Optional }] },
493
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [ALAIN_I18N_TOKEN,] }] },
494
- { type: STWidgetRegistry }
495
- ];
496
-
497
- class STDataSource {
498
- constructor(http, datePipe, ynPipe, numberPipe, currencySrv, dom) {
499
- this.http = http;
500
- this.datePipe = datePipe;
501
- this.ynPipe = ynPipe;
502
- this.numberPipe = numberPipe;
503
- this.currencySrv = currencySrv;
504
- this.dom = dom;
505
- this.sortTick = 0;
506
- }
507
- process(options) {
508
- let data$;
509
- let isRemote = false;
510
- const { data, res, total, page, pi, ps, paginator, columns } = options;
511
- let retTotal;
512
- let retPs;
513
- let retList;
514
- let retPi;
515
- let rawData;
516
- let showPage = page.show;
517
- if (typeof data === 'string') {
518
- isRemote = true;
519
- data$ = this.getByRemote(data, options).pipe(map(result => {
520
- rawData = result;
521
- let ret;
522
- if (Array.isArray(result)) {
523
- ret = result;
524
- retTotal = ret.length;
525
- retPs = retTotal;
526
- showPage = false;
527
- }
528
- else {
529
- // list
530
- ret = deepGet(result, res.reName.list, []);
531
- if (ret == null || !Array.isArray(ret)) {
532
- ret = [];
533
- }
534
- // total
535
- const resultTotal = res.reName.total && deepGet(result, res.reName.total, null);
536
- retTotal = resultTotal == null ? total || 0 : +resultTotal;
537
- }
538
- return deepCopy(ret);
539
- }));
540
- }
541
- else if (Array.isArray(data)) {
542
- data$ = of(data);
543
- }
544
- else {
545
- // a cold observable
546
- data$ = data;
547
- }
548
- if (!isRemote) {
549
- data$ = data$.pipe(
550
- // sort
551
- map((result) => {
552
- rawData = result;
553
- let copyResult = deepCopy(result);
554
- const sorterFn = this.getSorterFn(columns);
555
- if (sorterFn) {
556
- copyResult = copyResult.sort(sorterFn);
557
- }
558
- return copyResult;
559
- }),
560
- // filter
561
- map((result) => {
562
- columns
563
- .filter(w => w.filter)
564
- .forEach(c => {
565
- const filter = c.filter;
566
- const values = this.getFilteredData(filter);
567
- if (values.length === 0)
568
- return;
569
- const onFilter = filter.fn;
570
- if (typeof onFilter !== 'function') {
571
- console.warn(`[st] Muse provide the fn function in filter`);
572
- return;
573
- }
574
- result = result.filter(record => values.some(v => onFilter(v, record)));
575
- });
576
- return result;
577
- }),
578
- // paging
579
- map((result) => {
580
- if (paginator && page.front) {
581
- const maxPageIndex = Math.ceil(result.length / ps);
582
- retPi = Math.max(1, pi > maxPageIndex ? maxPageIndex : pi);
583
- retTotal = result.length;
584
- if (page.show === true) {
585
- return result.slice((retPi - 1) * ps, retPi * ps);
586
- }
587
- }
588
- return result;
589
- }));
590
- }
591
- // pre-process
592
- if (typeof res.process === 'function') {
593
- data$ = data$.pipe(map(result => res.process(result, rawData)));
594
- }
595
- data$ = data$.pipe(map(result => this.optimizeData({ result, columns, rowClassName: options.rowClassName })));
596
- return data$.pipe(map(result => {
597
- retList = result;
598
- const realTotal = retTotal || total;
599
- const realPs = retPs || ps;
600
- return {
601
- pi: retPi,
602
- ps: retPs,
603
- total: retTotal,
604
- list: retList,
605
- statistical: this.genStatistical(columns, retList, rawData),
606
- pageShow: typeof showPage === 'undefined' ? realTotal > realPs : showPage
607
- };
608
- }));
609
- }
610
- get(item, col, idx) {
611
- var _a;
612
- try {
613
- const safeHtml = col.safeType === 'safeHtml';
614
- if (col.format) {
615
- const formatRes = col.format(item, col, idx) || '';
616
- return {
617
- text: formatRes,
618
- _text: safeHtml ? this.dom.bypassSecurityTrustHtml(formatRes) : formatRes,
619
- org: formatRes,
620
- safeType: col.safeType
621
- };
622
- }
623
- const value = deepGet(item, col.index, col.default);
624
- let text = value;
625
- let color;
626
- switch (col.type) {
627
- case 'no':
628
- text = this.getNoIndex(item, col, idx);
629
- break;
630
- case 'img':
631
- text = value ? `<img src="${value}" class="img">` : '';
632
- break;
633
- case 'number':
634
- text = this.numberPipe.transform(value, col.numberDigits);
635
- break;
636
- case 'currency':
637
- text = this.currencySrv.format(value, (_a = col.currency) === null || _a === void 0 ? void 0 : _a.format);
638
- break;
639
- case 'date':
640
- text = value === col.default ? col.default : this.datePipe.transform(value, col.dateFormat);
641
- break;
642
- case 'yn':
643
- text = this.ynPipe.transform(value === col.yn.truth, col.yn.yes, col.yn.no, col.yn.mode, false);
644
- break;
645
- case 'enum':
646
- text = col.enum[value];
647
- break;
648
- case 'tag':
649
- case 'badge':
650
- const data = col.type === 'tag' ? col.tag : col.badge;
651
- if (data && data[text]) {
652
- const dataItem = data[text];
653
- text = dataItem.text;
654
- color = dataItem.color;
655
- }
656
- else {
657
- text = '';
658
- }
659
- break;
660
- }
661
- if (text == null)
662
- text = '';
663
- return {
664
- text,
665
- _text: safeHtml ? this.dom.bypassSecurityTrustHtml(text) : text,
666
- org: value,
667
- color,
668
- safeType: col.safeType,
669
- buttons: []
670
- };
671
- }
672
- catch (ex) {
673
- const text = `INVALID DATA`;
674
- console.error(`Failed to get data`, item, col, ex);
675
- return { text, _text: text, org: text, buttons: [], safeType: 'text' };
676
- }
677
- }
678
- getByRemote(url, options) {
679
- const { req, page, paginator, pi, ps, singleSort, multiSort, columns } = options;
680
- const method = (req.method || 'GET').toUpperCase();
681
- let params = {};
682
- const reName = req.reName;
683
- if (paginator) {
684
- if (req.type === 'page') {
685
- params = {
686
- [reName.pi]: page.zeroIndexed ? pi - 1 : pi,
687
- [reName.ps]: ps
688
- };
689
- }
690
- else {
691
- params = {
692
- [reName.skip]: (pi - 1) * ps,
693
- [reName.limit]: ps
694
- };
695
- }
696
- }
697
- params = Object.assign(Object.assign(Object.assign(Object.assign({}, params), req.params), this.getReqSortMap(singleSort, multiSort, columns)), this.getReqFilterMap(columns));
698
- let reqOptions = {
699
- params,
700
- body: req.body,
701
- headers: req.headers
702
- };
703
- if (method === 'POST' && req.allInBody === true) {
704
- reqOptions = {
705
- body: Object.assign(Object.assign({}, req.body), params),
706
- headers: req.headers
707
- };
708
- }
709
- if (typeof req.process === 'function') {
710
- reqOptions = req.process(reqOptions);
711
- }
712
- if (!(reqOptions.params instanceof HttpParams)) {
713
- reqOptions.params = new HttpParams({ fromObject: reqOptions.params });
714
- }
715
- if (typeof options.customRequest === 'function') {
716
- return options.customRequest({ method, url, options: reqOptions });
717
- }
718
- return this.http.request(method, url, reqOptions);
719
- }
720
- optimizeData(options) {
721
- const { result, columns, rowClassName } = options;
722
- for (let i = 0, len = result.length; i < len; i++) {
723
- result[i]._values = columns.map(c => {
724
- if (Array.isArray(c.buttons) && c.buttons.length > 0) {
725
- return { buttons: this.genButtons(c.buttons, result[i], c), _text: '' };
726
- }
727
- return this.get(result[i], c, i);
728
- });
729
- if (rowClassName) {
730
- result[i]._rowClassName = rowClassName(result[i], i);
731
- }
732
- }
733
- return result;
734
- }
735
- getNoIndex(item, col, idx) {
736
- return typeof col.noIndex === 'function' ? col.noIndex(item, col, idx) : col.noIndex + idx;
737
- }
738
- genButtons(_btns, item, col) {
739
- const fn = (btns) => {
740
- return deepCopy(btns).filter(btn => {
741
- const result = btn.iif(item, btn, col);
742
- const isRenderDisabled = btn.iifBehavior === 'disabled';
743
- btn._result = result;
744
- btn._disabled = !result && isRenderDisabled;
745
- if (btn.children.length > 0) {
746
- btn.children = fn(btn.children);
747
- }
748
- delete btn.iif;
749
- return result || isRenderDisabled;
750
- });
751
- };
752
- const res = fn(_btns);
753
- const fnText = (btns) => {
754
- for (const btn of btns) {
755
- btn._text = typeof btn.text === 'function' ? btn.text(item, btn) : btn.text || '';
756
- if (btn.children.length > 0) {
757
- btn.children = fnText(btn.children);
758
- }
759
- }
760
- return btns;
761
- };
762
- return fnText(res);
763
- }
764
- // #region sort
765
- getValidSort(columns) {
766
- return columns.filter(item => item._sort && item._sort.enabled && item._sort.default).map(item => item._sort);
767
- }
768
- getSorterFn(columns) {
769
- const sortList = this.getValidSort(columns);
770
- if (sortList.length === 0) {
771
- return;
772
- }
773
- const sortItem = sortList[0];
774
- if (sortItem.compare === null) {
775
- return;
776
- }
777
- if (typeof sortItem.compare !== 'function') {
778
- console.warn(`[st] Muse provide the compare function in sort`);
779
- return;
780
- }
781
- return (a, b) => {
782
- const result = sortItem.compare(a, b);
783
- if (result !== 0) {
784
- return sortItem.default === 'descend' ? -result : result;
785
- }
786
- return 0;
787
- };
788
- }
789
- get nextSortTick() {
790
- return ++this.sortTick;
791
- }
792
- getReqSortMap(singleSort, multiSort, columns) {
793
- let ret = {};
794
- const sortList = this.getValidSort(columns);
795
- if (multiSort) {
796
- const ms = Object.assign({ key: 'sort', separator: '-', nameSeparator: '.', keepEmptyKey: true, arrayParam: false }, multiSort);
797
- const sortMap = sortList
798
- .sort((a, b) => a.tick - b.tick)
799
- .map(item => item.key + ms.nameSeparator + ((item.reName || {})[item.default] || item.default));
800
- ret = { [ms.key]: ms.arrayParam ? sortMap : sortMap.join(ms.separator) };
801
- return sortMap.length === 0 && ms.keepEmptyKey === false ? {} : ret;
802
- }
803
- if (sortList.length === 0)
804
- return ret;
805
- const mapData = sortList[0];
806
- let sortFiled = mapData.key;
807
- let sortValue = (sortList[0].reName || {})[mapData.default] || mapData.default;
808
- if (singleSort) {
809
- sortValue = sortFiled + (singleSort.nameSeparator || '.') + sortValue;
810
- sortFiled = singleSort.key || 'sort';
811
- }
812
- ret[sortFiled] = sortValue;
813
- return ret;
814
- }
815
- // #endregion
816
- // #region filter
817
- getFilteredData(filter) {
818
- return filter.type === 'default' ? filter.menus.filter(f => f.checked === true) : filter.menus.slice(0, 1);
819
- }
820
- getReqFilterMap(columns) {
821
- let ret = {};
822
- columns
823
- .filter(w => w.filter && w.filter.default === true)
824
- .forEach(col => {
825
- const filter = col.filter;
826
- const values = this.getFilteredData(filter);
827
- let obj = {};
828
- if (filter.reName) {
829
- obj = filter.reName(filter.menus, col);
830
- }
831
- else {
832
- obj[filter.key] = values.map(i => i.value).join(',');
833
- }
834
- ret = Object.assign(Object.assign({}, ret), obj);
835
- });
836
- return ret;
837
- }
838
- // #endregion
839
- // #region statistical
840
- genStatistical(columns, list, rawData) {
841
- const res = {};
842
- columns.forEach((col, index) => {
843
- res[col.key || col.indexKey || index] =
844
- col.statistical == null ? {} : this.getStatistical(col, index, list, rawData);
845
- });
846
- return res;
847
- }
848
- getStatistical(col, index, list, rawData) {
849
- var _a;
850
- const val = col.statistical;
851
- const item = Object.assign({ digits: 2, currency: undefined }, (typeof val === 'string' ? { type: val } : val));
852
- let res = { value: 0 };
853
- let currency = false;
854
- if (typeof item.type === 'function') {
855
- res = item.type(this.getValues(index, list), col, list, rawData);
856
- currency = true;
857
- }
858
- else {
859
- switch (item.type) {
860
- case 'count':
861
- res.value = list.length;
862
- break;
863
- case 'distinctCount':
864
- res.value = this.getValues(index, list).filter((value, idx, self) => self.indexOf(value) === idx).length;
865
- break;
866
- case 'sum':
867
- res.value = this.toFixed(this.getSum(index, list), item.digits);
868
- currency = true;
869
- break;
870
- case 'average':
871
- res.value = this.toFixed(this.getSum(index, list) / list.length, item.digits);
872
- currency = true;
873
- break;
874
- case 'max':
875
- res.value = Math.max(...this.getValues(index, list));
876
- currency = true;
877
- break;
878
- case 'min':
879
- res.value = Math.min(...this.getValues(index, list));
880
- currency = true;
881
- break;
882
- }
883
- }
884
- if (item.currency === true || (item.currency == null && currency === true)) {
885
- res.text = this.currencySrv.format(res.value, (_a = col.currency) === null || _a === void 0 ? void 0 : _a.format);
886
- }
887
- else {
888
- res.text = String(res.value);
889
- }
890
- return res;
891
- }
892
- toFixed(val, digits) {
893
- if (isNaN(val) || !isFinite(val)) {
894
- return 0;
895
- }
896
- return parseFloat(val.toFixed(digits));
897
- }
898
- getValues(index, list) {
899
- return list.map(i => i._values[index].org).map(i => (i === '' || i == null ? 0 : i));
900
- }
901
- getSum(index, list) {
902
- return this.getValues(index, list).reduce((p, i) => (p += parseFloat(String(i))), 0);
903
- }
904
- }
905
- STDataSource.decorators = [
906
- { type: Injectable }
907
- ];
908
- STDataSource.ctorParameters = () => [
909
- { type: _HttpClient },
910
- { type: DatePipe, decorators: [{ type: Host }] },
911
- { type: YNPipe, decorators: [{ type: Host }] },
912
- { type: DecimalPipe, decorators: [{ type: Host }] },
913
- { type: CurrencyService },
914
- { type: DomSanitizer }
915
- ];
916
-
917
- class STExport {
918
- constructor(xlsxSrv) {
919
- this.xlsxSrv = xlsxSrv;
920
- }
921
- _stGet(item, col, index, colIndex) {
922
- const ret = { t: 's', v: '' };
923
- if (col.format) {
924
- ret.v = col.format(item, col, index);
925
- }
926
- else {
927
- const val = item._values ? item._values[colIndex].text : deepGet(item, col.index, '');
928
- ret.v = val;
929
- if (val != null) {
930
- switch (col.type) {
931
- case 'currency':
932
- ret.t = 'n';
933
- break;
934
- case 'date':
935
- // Can't be a empty value, it will cause `#NULL!`
936
- // See https://github.com/SheetJS/sheetjs/blob/master/docbits/52_datatype.md
937
- if (`${val}`.length > 0) {
938
- ret.t = 'd';
939
- // Number Formats: https://github.com/SheetJS/sheetjs/blob/master/docbits/63_numfmt.md
940
- ret.z = col.dateFormat;
941
- }
942
- break;
943
- case 'yn':
944
- const yn = col.yn;
945
- ret.v = val === yn.truth ? yn.yes : yn.no;
946
- break;
947
- }
948
- }
949
- }
950
- ret.v = ret.v || '';
951
- return ret;
952
- }
953
- genSheet(opt) {
954
- const sheets = {};
955
- const sheet = (sheets[opt.sheetname || 'Sheet1'] = {});
956
- const dataLen = opt.data.length;
957
- let validColCount = 0;
958
- let loseCount = 0;
959
- const columns = opt.columens;
960
- if (columns.findIndex(w => w._width != null) !== -1) {
961
- // wpx: width in screen pixels https://github.com/SheetJS/sheetjs#column-properties
962
- sheet['!cols'] = columns.map(col => ({ wpx: col._width }));
963
- }
964
- for (let colIdx = 0; colIdx < columns.length; colIdx++) {
965
- const col = columns[colIdx];
966
- if (col.exported === false || !col.index || !(!col.buttons || col.buttons.length === 0)) {
967
- ++loseCount;
968
- continue;
969
- }
970
- ++validColCount;
971
- const columnName = this.xlsxSrv.numberToSchema(colIdx + 1 - loseCount);
972
- sheet[`${columnName}1`] = {
973
- t: 's',
974
- v: typeof col.title === 'object' ? col.title.text : col.title
975
- };
976
- for (let dataIdx = 0; dataIdx < dataLen; dataIdx++) {
977
- sheet[`${columnName}${dataIdx + 2}`] = this._stGet(opt.data[dataIdx], col, dataIdx, colIdx);
978
- }
979
- }
980
- if (validColCount > 0 && dataLen > 0) {
981
- sheet['!ref'] = `A1:${this.xlsxSrv.numberToSchema(validColCount)}${dataLen + 1}`;
982
- }
983
- return sheets;
984
- }
985
- export(opt) {
986
- return __awaiter(this, void 0, void 0, function* () {
987
- const sheets = this.genSheet(opt);
988
- return this.xlsxSrv.export({
989
- sheets,
990
- filename: opt.filename,
991
- callback: opt.callback
992
- });
993
- });
994
- }
995
- }
996
- STExport.decorators = [
997
- { type: Injectable }
998
- ];
999
- STExport.ctorParameters = () => [
1000
- { type: XlsxService, decorators: [{ type: Optional }] }
1001
- ];
1002
-
1003
- class STWidgetHostDirective {
1004
- constructor(stWidgetRegistry, viewContainerRef, componentFactoryResolver) {
1005
- this.stWidgetRegistry = stWidgetRegistry;
1006
- this.viewContainerRef = viewContainerRef;
1007
- this.componentFactoryResolver = componentFactoryResolver;
1008
- }
1009
- ngOnInit() {
1010
- const widget = this.column.widget;
1011
- const componentType = this.stWidgetRegistry.get(widget.type);
1012
- const componentFactory = this.componentFactoryResolver.resolveComponentFactory(componentType);
1013
- this.viewContainerRef.clear();
1014
- const componentRef = this.viewContainerRef.createComponent(componentFactory);
1015
- const { record, column } = this;
1016
- const data = widget.params ? widget.params({ record, column }) : { record };
1017
- Object.keys(data).forEach(key => {
1018
- componentRef.instance[key] = data[key];
1019
- });
1020
- }
1021
- }
1022
- STWidgetHostDirective.decorators = [
1023
- { type: Directive, args: [{ selector: '[st-widget-host]' },] }
1024
- ];
1025
- STWidgetHostDirective.ctorParameters = () => [
1026
- { type: STWidgetRegistry },
1027
- { type: ViewContainerRef },
1028
- { type: ComponentFactoryResolver }
1029
- ];
1030
- STWidgetHostDirective.propDecorators = {
1031
- record: [{ type: Input }],
1032
- column: [{ type: Input }]
1033
- };
1034
-
1035
- const ST_DEFAULT_CONFIG = {
1036
- pi: 1,
1037
- ps: 10,
1038
- size: 'default',
1039
- responsive: true,
1040
- responsiveHideHeaderFooter: false,
1041
- req: {
1042
- type: 'page',
1043
- method: 'GET',
1044
- allInBody: false,
1045
- lazyLoad: false,
1046
- reName: { pi: 'pi', ps: 'ps', skip: 'skip', limit: 'limit' }
1047
- },
1048
- res: {
1049
- reName: { list: ['list'], total: ['total'] }
1050
- },
1051
- page: {
1052
- front: true,
1053
- zeroIndexed: false,
1054
- position: 'bottom',
1055
- placement: 'right',
1056
- show: true,
1057
- showSize: false,
1058
- pageSizes: [10, 20, 30, 40, 50],
1059
- showQuickJumper: false,
1060
- total: true,
1061
- toTop: true,
1062
- toTopOffset: 100,
1063
- itemRender: null,
1064
- simple: false
1065
- },
1066
- modal: {
1067
- paramsName: 'record',
1068
- size: 'lg',
1069
- exact: true
1070
- },
1071
- drawer: {
1072
- paramsName: 'record',
1073
- size: 'md',
1074
- footer: true,
1075
- footerHeight: 55
1076
- },
1077
- pop: {
1078
- title: '确认删除吗?',
1079
- trigger: 'click',
1080
- placement: 'top'
1081
- },
1082
- rowClickTime: 200,
1083
- btnIcon: {
1084
- theme: 'outline',
1085
- spin: false
1086
- },
1087
- noIndex: 1,
1088
- expandRowByClick: false,
1089
- expandAccordion: false,
1090
- widthMode: {
1091
- type: 'default',
1092
- strictBehavior: 'truncate'
1093
- },
1094
- virtualItemSize: 54,
1095
- virtualMaxBufferPx: 200,
1096
- virtualMinBufferPx: 100,
1097
- iifBehavior: 'hide',
1098
- loadingDelay: 0,
1099
- safeType: 'safeHtml',
1100
- date: {
1101
- format: `yyyy-MM-dd HH:mm`
1102
- },
1103
- yn: {
1104
- truth: true,
1105
- yes: '是',
1106
- mode: 'icon'
1107
- }
1108
- };
1109
-
1110
- class STComponent {
1111
- constructor(i18nSrv, cdr, router, el, exportSrv, modalHelper, drawerHelper, doc, columnSource, dataSource, delonI18n, configSrv, cms) {
1112
- this.cdr = cdr;
1113
- this.router = router;
1114
- this.el = el;
1115
- this.exportSrv = exportSrv;
1116
- this.modalHelper = modalHelper;
1117
- this.drawerHelper = drawerHelper;
1118
- this.doc = doc;
1119
- this.columnSource = columnSource;
1120
- this.dataSource = dataSource;
1121
- this.delonI18n = delonI18n;
1122
- this.cms = cms;
1123
- this.destroy$ = new Subject();
1124
- this.totalTpl = ``;
1125
- this.rowClickCount = 0;
1126
- this.customWidthConfig = false;
1127
- this._widthConfig = [];
1128
- this.locale = {};
1129
- this._loading = false;
1130
- this._data = [];
1131
- this._statistical = {};
1132
- this._isPagination = true;
1133
- this._allChecked = false;
1134
- this._allCheckedDisabled = false;
1135
- this._indeterminate = false;
1136
- this._headers = [];
1137
- this._columns = [];
1138
- this.contextmenuList = [];
1139
- this.columns = [];
1140
- this.ps = 10;
1141
- this.pi = 1;
1142
- this.total = 0;
1143
- this.loading = null;
1144
- this.loadingDelay = 0;
1145
- this.bordered = false;
1146
- this.showHeader = true;
1147
- this.expandRowByClick = false;
1148
- this.expandAccordion = false;
1149
- this.rowClickTime = 200;
1150
- this.responsive = true;
1151
- this.error = new EventEmitter();
1152
- this.change = new EventEmitter();
1153
- this.virtualScroll = false;
1154
- this.virtualItemSize = 54;
1155
- this.virtualMaxBufferPx = 200;
1156
- this.virtualMinBufferPx = 100;
1157
- this.virtualForTrackBy = index => index;
1158
- this.setCog(configSrv.merge('st', ST_DEFAULT_CONFIG));
1159
- this.delonI18n.change.pipe(takeUntil(this.destroy$)).subscribe(() => {
1160
- this.locale = this.delonI18n.getData('st');
1161
- if (this._columns.length > 0) {
1162
- this.updateTotalTpl();
1163
- this.cd();
1164
- }
1165
- });
1166
- i18nSrv.change
1167
- .pipe(takeUntil(this.destroy$), filter(() => this._columns.length > 0))
1168
- .subscribe(() => this.refreshColumns());
1169
- }
1170
- get req() {
1171
- return this._req;
1172
- }
1173
- set req(value) {
1174
- this._req = deepMergeKey({}, true, this.cog.req, value);
1175
- }
1176
- /** 返回体配置 */
1177
- get res() {
1178
- return this._res;
1179
- }
1180
- set res(value) {
1181
- const item = (this._res = deepMergeKey({}, true, this.cog.res, value));
1182
- const reName = item.reName;
1183
- if (!Array.isArray(reName.list))
1184
- reName.list = reName.list.split('.');
1185
- if (!Array.isArray(reName.total))
1186
- reName.total = reName.total.split('.');
1187
- this._res = item;
1188
- }
1189
- get page() {
1190
- return this._page;
1191
- }
1192
- set page(value) {
1193
- this._page = Object.assign(Object.assign({}, this.cog.page), value);
1194
- this.updateTotalTpl();
1195
- }
1196
- get multiSort() {
1197
- return this._multiSort;
1198
- }
1199
- set multiSort(value) {
1200
- if ((typeof value === 'boolean' && !toBoolean(value)) ||
1201
- (typeof value === 'object' && Object.keys(value).length === 0)) {
1202
- this._multiSort = undefined;
1203
- return;
1204
- }
1205
- this._multiSort = Object.assign({}, (typeof value === 'object' ? value : {}));
1206
- }
1207
- set widthMode(value) {
1208
- this._widthMode = Object.assign(Object.assign({}, this.cog.widthMode), value);
1209
- }
1210
- get widthMode() {
1211
- return this._widthMode;
1212
- }
1213
- set widthConfig(val) {
1214
- this._widthConfig = val;
1215
- this.customWidthConfig = val && val.length > 0;
1216
- }
1217
- set resizable(val) {
1218
- this._resizable = typeof val === 'object' ? val : { disabled: !toBoolean(val) };
1219
- }
1220
- /**
1221
- * Get the number of the current page
1222
- */
1223
- get count() {
1224
- return this._data.length;
1225
- }
1226
- /**
1227
- * Get the data of the current page
1228
- */
1229
- get list() {
1230
- return this._data;
1231
- }
1232
- get routerState() {
1233
- const { pi, ps, total } = this;
1234
- return { pi, ps, total };
1235
- }
1236
- setCog(cog) {
1237
- const copyMultiSort = Object.assign({}, cog.multiSort);
1238
- // Because multiSort.global will affect the result, it should be removed first, and multiSort will be operated again after processing.
1239
- delete cog.multiSort;
1240
- this.cog = cog;
1241
- Object.assign(this, cog);
1242
- if (copyMultiSort.global !== false) {
1243
- this.multiSort = copyMultiSort;
1244
- }
1245
- this.columnSource.setCog(cog);
1246
- }
1247
- cd() {
1248
- this.cdr.detectChanges();
1249
- return this;
1250
- }
1251
- renderTotal(total, range) {
1252
- return this.totalTpl
1253
- ? this.totalTpl.replace('{{total}}', total).replace('{{range[0]}}', range[0]).replace('{{range[1]}}', range[1])
1254
- : '';
1255
- }
1256
- changeEmit(type, data) {
1257
- const res = {
1258
- type,
1259
- pi: this.pi,
1260
- ps: this.ps,
1261
- total: this.total
1262
- };
1263
- if (data != null) {
1264
- res[type] = data;
1265
- }
1266
- this.change.emit(res);
1267
- }
1268
- // #region data
1269
- /**
1270
- * 获取过滤后所有数据
1271
- * - 本地数据:包含排序、过滤后不分页数据
1272
- * - 远程数据:不传递 `pi`、`ps` 两个参数
1273
- */
1274
- get filteredData() {
1275
- return this.loadData({ paginator: false }).then(res => res.list);
1276
- }
1277
- updateTotalTpl() {
1278
- const { total } = this.page;
1279
- if (typeof total === 'string' && total.length) {
1280
- this.totalTpl = total;
1281
- }
1282
- else if (toBoolean(total)) {
1283
- this.totalTpl = this.locale.total;
1284
- }
1285
- else {
1286
- this.totalTpl = '';
1287
- }
1288
- }
1289
- setLoading(val) {
1290
- if (this.loading == null) {
1291
- this._loading = val;
1292
- this.cdr.detectChanges();
1293
- }
1294
- }
1295
- loadData(options) {
1296
- const { pi, ps, data, req, res, page, total, singleSort, multiSort, rowClassName } = this;
1297
- return new Promise((resolvePromise, rejectPromise) => {
1298
- if (this.data$) {
1299
- this.data$.unsubscribe();
1300
- }
1301
- this.data$ = this.dataSource
1302
- .process(Object.assign({ pi,
1303
- ps,
1304
- total,
1305
- data,
1306
- req,
1307
- res,
1308
- page, columns: this._columns, singleSort,
1309
- multiSort,
1310
- rowClassName, paginator: true, customRequest: this.customRequest || this.cog.customRequest }, options))
1311
- .pipe(takeUntil(this.destroy$))
1312
- .subscribe(result => resolvePromise(result), error => {
1313
- console.warn('st.loadDate', error);
1314
- rejectPromise(error);
1315
- });
1316
- });
1317
- }
1318
- loadPageData() {
1319
- return __awaiter(this, void 0, void 0, function* () {
1320
- this.setLoading(true);
1321
- try {
1322
- const result = yield this.loadData();
1323
- this.setLoading(false);
1324
- if (typeof result.pi !== 'undefined') {
1325
- this.pi = result.pi;
1326
- }
1327
- if (typeof result.ps !== 'undefined') {
1328
- this.ps = result.ps;
1329
- }
1330
- if (typeof result.total !== 'undefined') {
1331
- this.total = result.total;
1332
- }
1333
- if (typeof result.pageShow !== 'undefined') {
1334
- this._isPagination = result.pageShow;
1335
- }
1336
- this._data = result.list;
1337
- this._statistical = result.statistical;
1338
- this.changeEmit('loaded', result.list);
1339
- // Should be re-render in next tike when using virtual scroll
1340
- // https://github.com/ng-alain/ng-alain/issues/1836
1341
- if (this.cdkVirtualScrollViewport) {
1342
- Promise.resolve().then(() => this.cdkVirtualScrollViewport.checkViewportSize());
1343
- }
1344
- return this._refCheck();
1345
- }
1346
- catch (error) {
1347
- this.setLoading(false);
1348
- if (!this.destroy$.isStopped) {
1349
- this.cdr.detectChanges();
1350
- this.error.emit({ type: 'req', error });
1351
- }
1352
- return this;
1353
- }
1354
- });
1355
- }
1356
- /** 清空所有数据 */
1357
- clear(cleanStatus = true) {
1358
- if (cleanStatus) {
1359
- this.clearStatus();
1360
- }
1361
- this._data = [];
1362
- return this.cd();
1363
- }
1364
- /** 清空所有状态 */
1365
- clearStatus() {
1366
- return this.clearCheck().clearRadio().clearFilter().clearSort();
1367
- }
1368
- /**
1369
- * 根据页码重新加载数据
1370
- *
1371
- * @param pi 指定当前页码,默认:`1`
1372
- * @param extraParams 重新指定 `extraParams` 值
1373
- * @param options 选项
1374
- */
1375
- load(pi = 1, extraParams, options) {
1376
- if (pi !== -1)
1377
- this.pi = pi;
1378
- if (typeof extraParams !== 'undefined') {
1379
- this.req.params = options && options.merge ? Object.assign(Object.assign({}, this.req.params), extraParams) : extraParams;
1380
- }
1381
- this._change('pi', options);
1382
- return this;
1383
- }
1384
- /**
1385
- * 重新刷新当前页
1386
- *
1387
- * @param extraParams 重新指定 `extraParams` 值
1388
- */
1389
- reload(extraParams, options) {
1390
- return this.load(-1, extraParams, options);
1391
- }
1392
- /**
1393
- * 重置且重新设置 `pi` 为 `1`,包含以下值:
1394
- * - `check` 数据
1395
- * - `radio` 数据
1396
- * - `sort` 数据
1397
- * - `fileter` 数据
1398
- *
1399
- * @param extraParams 重新指定 `extraParams` 值
1400
- */
1401
- reset(extraParams, options) {
1402
- this.clearStatus().load(1, extraParams, options);
1403
- return this;
1404
- }
1405
- _toTop(enforce) {
1406
- var _a;
1407
- if (!(enforce == null ? this.page.toTop : enforce))
1408
- return;
1409
- const el = this.el.nativeElement;
1410
- el.scrollIntoView();
1411
- // fix header height
1412
- this.doc.documentElement.scrollTop -= this.page.toTopOffset;
1413
- if (this.scroll) {
1414
- if (this.cdkVirtualScrollViewport) {
1415
- this.cdkVirtualScrollViewport.scrollTo({
1416
- top: 0,
1417
- left: 0
1418
- });
1419
- }
1420
- else {
1421
- (_a = el.querySelector('.ant-table-body, .ant-table-content')) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
1422
- }
1423
- }
1424
- }
1425
- _change(type, options) {
1426
- if (type === 'pi' || (type === 'ps' && this.pi <= Math.ceil(this.total / this.ps))) {
1427
- this.loadPageData().then(() => this._toTop(options === null || options === void 0 ? void 0 : options.toTop));
1428
- }
1429
- this.changeEmit(type);
1430
- }
1431
- _click(e, item, col) {
1432
- e.preventDefault();
1433
- e.stopPropagation();
1434
- const res = col.click(item, this);
1435
- if (typeof res === 'string') {
1436
- this.router.navigateByUrl(res, { state: this.routerState });
1437
- }
1438
- return false;
1439
- }
1440
- closeOtherExpand(item) {
1441
- if (this.expandAccordion === false)
1442
- return;
1443
- this._data.filter(i => i !== item).forEach(i => (i.expand = false));
1444
- }
1445
- _rowClick(e, item, index) {
1446
- const el = e.target;
1447
- if (el.nodeName === 'INPUT')
1448
- return;
1449
- const { expand, expandRowByClick, rowClickTime } = this;
1450
- if (!!expand && item.showExpand !== false && expandRowByClick) {
1451
- item.expand = !item.expand;
1452
- this.closeOtherExpand(item);
1453
- this.changeEmit('expand', item);
1454
- return;
1455
- }
1456
- ++this.rowClickCount;
1457
- if (this.rowClickCount !== 1)
1458
- return;
1459
- setTimeout(() => {
1460
- const data = { e, item, index };
1461
- if (this.rowClickCount === 1) {
1462
- this._clickRowClassName(el, item, index);
1463
- this.changeEmit('click', data);
1464
- }
1465
- else {
1466
- this.changeEmit('dblClick', data);
1467
- }
1468
- this.rowClickCount = 0;
1469
- }, rowClickTime);
1470
- }
1471
- _clickRowClassName(el, item, index) {
1472
- const cr = this.clickRowClassName;
1473
- if (cr == null)
1474
- return;
1475
- const config = Object.assign({ exclusive: false }, (typeof cr === 'string' ? { fn: () => cr } : cr));
1476
- const className = config.fn(item, index);
1477
- const trEl = el.closest('tr');
1478
- if (config.exclusive) {
1479
- trEl.parentElement.querySelectorAll('tr').forEach((a) => a.classList.remove(className));
1480
- }
1481
- if (trEl.classList.contains(className)) {
1482
- trEl.classList.remove(className);
1483
- }
1484
- else {
1485
- trEl.classList.add(className);
1486
- }
1487
- }
1488
- _expandChange(item, expand) {
1489
- item.expand = expand;
1490
- this.closeOtherExpand(item);
1491
- this.changeEmit('expand', item);
1492
- }
1493
- _stopPropagation(ev) {
1494
- ev.stopPropagation();
1495
- }
1496
- /**
1497
- * Remove a row in the table, like this:
1498
- *
1499
- * ```
1500
- * this.st.removeRow(0)
1501
- * this.st.removeRow(stDataItem)
1502
- * ```
1503
- */
1504
- removeRow(data) {
1505
- if (typeof data === 'number') {
1506
- this._data.splice(data, 1);
1507
- }
1508
- else {
1509
- if (!Array.isArray(data)) {
1510
- data = [data];
1511
- }
1512
- data
1513
- .map(item => this._data.indexOf(item))
1514
- .filter(pos => pos !== -1)
1515
- .forEach(pos => this._data.splice(pos, 1));
1516
- }
1517
- // recalculate no
1518
- this._columns
1519
- .filter(w => w.type === 'no')
1520
- .forEach(c => this._data.forEach((i, idx) => {
1521
- const text = `${this.dataSource.getNoIndex(i, c, idx)}`;
1522
- i._values[c.__point] = { text, _text: text, org: idx, safeType: 'text' };
1523
- }));
1524
- return this.cd();
1525
- }
1526
- /**
1527
- * Sets the row value for the `index` in the table, like this:
1528
- *
1529
- * - `optinos.refreshSchema` Whether to refresh of st schemas
1530
- * - `optinos.emitReload` Whether to trigger a reload http request when data is url
1531
- *
1532
- * ```
1533
- * this.st.setRow(0, { price: 100 })
1534
- * this.st.setRow(0, { price: 100, name: 'asdf' })
1535
- * this.st.setRow(item, { price: 100 })
1536
- * ```
1537
- */
1538
- setRow(index, item, options) {
1539
- options = Object.assign({ refreshSchema: false, emitReload: false }, options);
1540
- if (typeof index !== 'number') {
1541
- index = this._data.indexOf(index);
1542
- }
1543
- this._data[index] = deepMergeKey(this._data[index], false, item);
1544
- this.optimizeData();
1545
- if (options.refreshSchema) {
1546
- this.resetColumns({ emitReload: options.emitReload });
1547
- return this;
1548
- }
1549
- this.cdr.detectChanges();
1550
- return this;
1551
- }
1552
- // #endregion
1553
- // #region sort
1554
- sort(col, idx, value) {
1555
- if (this.multiSort) {
1556
- col._sort.default = value;
1557
- col._sort.tick = this.dataSource.nextSortTick;
1558
- }
1559
- else {
1560
- this._columns.forEach((item, index) => (item._sort.default = index === idx ? value : null));
1561
- }
1562
- this.cdr.detectChanges();
1563
- this.loadPageData();
1564
- const res = {
1565
- value,
1566
- map: this.dataSource.getReqSortMap(this.singleSort, this.multiSort, this._columns),
1567
- column: col
1568
- };
1569
- this.changeEmit('sort', res);
1570
- }
1571
- clearSort() {
1572
- this._columns.forEach(item => (item._sort.default = null));
1573
- return this;
1574
- }
1575
- // #endregion
1576
- // #region filter
1577
- handleFilter(col) {
1578
- // 过滤表示一种数据的变化应重置页码为 `1`
1579
- this.pi = 1;
1580
- this.columnSource.updateDefault(col.filter);
1581
- this.loadPageData();
1582
- this.changeEmit('filter', col);
1583
- }
1584
- _filterConfirm(col) {
1585
- this.handleFilter(col);
1586
- }
1587
- _filterRadio(col, item, checked) {
1588
- col.filter.menus.forEach(i => (i.checked = false));
1589
- item.checked = checked;
1590
- }
1591
- _filterClear(col) {
1592
- this.columnSource.cleanFilter(col);
1593
- this.handleFilter(col);
1594
- }
1595
- clearFilter() {
1596
- this._columns.filter(w => w.filter && w.filter.default === true).forEach(col => this.columnSource.cleanFilter(col));
1597
- return this;
1598
- }
1599
- _filterClick($event) {
1600
- $event.stopPropagation();
1601
- }
1602
- // #endregion
1603
- // #region checkbox
1604
- /** 清除所有 `checkbox` */
1605
- clearCheck() {
1606
- return this._checkAll(false);
1607
- }
1608
- _refCheck() {
1609
- const validData = this._data.filter(w => !w.disabled);
1610
- const checkedList = validData.filter(w => w.checked === true);
1611
- this._allChecked = checkedList.length > 0 && checkedList.length === validData.length;
1612
- const allUnChecked = validData.every(value => !value.checked);
1613
- this._indeterminate = !this._allChecked && !allUnChecked;
1614
- this._allCheckedDisabled = this._data.length === this._data.filter(w => w.disabled).length;
1615
- return this.cd();
1616
- }
1617
- _checkAll(checked) {
1618
- checked = typeof checked === 'undefined' ? this._allChecked : checked;
1619
- this._data.filter(w => !w.disabled).forEach(i => (i.checked = checked));
1620
- return this._refCheck()._checkNotify();
1621
- }
1622
- _checkSelection(i, value) {
1623
- i.checked = value;
1624
- return this._refCheck()._checkNotify();
1625
- }
1626
- _rowSelection(row) {
1627
- row.select(this._data);
1628
- return this._refCheck()._checkNotify();
1629
- }
1630
- _checkNotify() {
1631
- const res = this._data.filter(w => !w.disabled && w.checked === true);
1632
- this.changeEmit('checkbox', res);
1633
- return this;
1634
- }
1635
- // #endregion
1636
- // #region radio
1637
- /** 清除所有 `radio` */
1638
- clearRadio() {
1639
- this._data.filter(w => w.checked).forEach(item => (item.checked = false));
1640
- this.changeEmit('radio', null);
1641
- return this;
1642
- }
1643
- _refRadio(checked, item) {
1644
- // if (item.disabled === true) return;
1645
- this._data.filter(w => !w.disabled).forEach(i => (i.checked = false));
1646
- item.checked = checked;
1647
- this.changeEmit('radio', item);
1648
- return this;
1649
- }
1650
- // #endregion
1651
- // #region buttons
1652
- _btnClick(record, btn, ev) {
1653
- if (ev) {
1654
- ev.stopPropagation();
1655
- }
1656
- if (btn.type === 'modal' || btn.type === 'static') {
1657
- const { modal } = btn;
1658
- const obj = { [modal.paramsName]: record };
1659
- this.modalHelper[btn.type === 'modal' ? 'create' : 'createStatic'](modal.component, Object.assign(Object.assign({}, obj), (modal.params && modal.params(record))), deepMergeKey({}, true, this.cog.modal, modal))
1660
- .pipe(filter(w => typeof w !== 'undefined'))
1661
- .subscribe((res) => this.btnCallback(record, btn, res));
1662
- return;
1663
- }
1664
- else if (btn.type === 'drawer') {
1665
- const { drawer } = btn;
1666
- const obj = { [drawer.paramsName]: record };
1667
- this.drawerHelper
1668
- .create(drawer.title, drawer.component, Object.assign(Object.assign({}, obj), (drawer.params && drawer.params(record))), deepMergeKey({}, true, this.cog.drawer, drawer))
1669
- .pipe(filter(w => typeof w !== 'undefined'))
1670
- .subscribe(res => this.btnCallback(record, btn, res));
1671
- return;
1672
- }
1673
- else if (btn.type === 'link') {
1674
- const clickRes = this.btnCallback(record, btn);
1675
- if (typeof clickRes === 'string') {
1676
- this.router.navigateByUrl(clickRes, { state: this.routerState });
1677
- }
1678
- return;
1679
- }
1680
- this.btnCallback(record, btn);
1681
- }
1682
- btnCallback(record, btn, modal) {
1683
- if (!btn.click)
1684
- return;
1685
- if (typeof btn.click === 'string') {
1686
- switch (btn.click) {
1687
- case 'load':
1688
- this.load();
1689
- break;
1690
- case 'reload':
1691
- this.reload();
1692
- break;
1693
- }
1694
- }
1695
- else {
1696
- return btn.click(record, modal, this);
1697
- }
1698
- }
1699
- // #endregion
1700
- // #region export
1701
- /**
1702
- * 导出当前页,确保已经注册 `XlsxModule`
1703
- *
1704
- * @param newData 重新指定数据;若为 `true` 表示使用 `filteredData` 数据
1705
- * @param opt 额外参数
1706
- */
1707
- export(newData, opt) {
1708
- const data = Array.isArray(newData)
1709
- ? this.dataSource.optimizeData({ columns: this._columns, result: newData })
1710
- : this._data;
1711
- (newData === true ? from(this.filteredData) : of(data)).subscribe((res) => this.exportSrv.export(Object.assign(Object.assign({ columens: this._columns }, opt), { data: res })));
1712
- }
1713
- // #endregion
1714
- // #region resizable
1715
- colResize({ width }, column) {
1716
- column.width = `${width}px`;
1717
- this.changeEmit('resize', column);
1718
- }
1719
- // #endregion
1720
- // #region contextmenu
1721
- onContextmenu(event) {
1722
- if (!this.contextmenu) {
1723
- return;
1724
- }
1725
- event.preventDefault();
1726
- event.stopPropagation();
1727
- const colEl = event.target.closest('[data-col-index]');
1728
- if (!colEl) {
1729
- return;
1730
- }
1731
- const colIndex = Number(colEl.dataset.colIndex);
1732
- const rowIndex = Number(colEl.closest('tr').dataset.index);
1733
- const isTitle = isNaN(rowIndex);
1734
- const obs$ = this.contextmenu({
1735
- event,
1736
- type: isTitle ? 'head' : 'body',
1737
- rowIndex: isTitle ? null : rowIndex,
1738
- colIndex,
1739
- data: isTitle ? null : this.list[rowIndex],
1740
- column: this._columns[colIndex]
1741
- });
1742
- (isObservable(obs$) ? obs$ : of(obs$))
1743
- .pipe(takeUntil(this.destroy$), filter(res => res.length > 0))
1744
- .subscribe(res => {
1745
- this.contextmenuList = res.map(i => {
1746
- if (!Array.isArray(i.children)) {
1747
- i.children = [];
1748
- }
1749
- return i;
1750
- });
1751
- this.cdr.detectChanges();
1752
- this.cms.create(event, this.contextmenuTpl);
1753
- });
1754
- }
1755
- // #endregion
1756
- get cdkVirtualScrollViewport() {
1757
- return this.orgTable.cdkVirtualScrollViewport;
1758
- }
1759
- resetColumns(options) {
1760
- options = Object.assign({ emitReload: true, preClearData: false }, options);
1761
- if (typeof options.columns !== 'undefined') {
1762
- this.columns = options.columns;
1763
- }
1764
- if (typeof options.pi !== 'undefined') {
1765
- this.pi = options.pi;
1766
- }
1767
- if (typeof options.ps !== 'undefined') {
1768
- this.ps = options.ps;
1769
- }
1770
- if (options.emitReload) {
1771
- // Should clean data, Because of changing columns may cause inaccurate data
1772
- options.preClearData = true;
1773
- }
1774
- if (options.preClearData) {
1775
- this._data = [];
1776
- }
1777
- this.refreshColumns();
1778
- if (options.emitReload) {
1779
- return this.loadPageData();
1780
- }
1781
- else {
1782
- this.cd();
1783
- return Promise.resolve(this);
1784
- }
1785
- }
1786
- refreshColumns() {
1787
- const res = this.columnSource.process(this.columns, {
1788
- widthMode: this.widthMode,
1789
- resizable: this._resizable,
1790
- safeType: this.cog.safeType
1791
- });
1792
- this._columns = res.columns;
1793
- this._headers = res.headers;
1794
- if (this.customWidthConfig === false && res.headerWidths != null) {
1795
- this._widthConfig = res.headerWidths;
1796
- }
1797
- return this;
1798
- }
1799
- optimizeData() {
1800
- this._data = this.dataSource.optimizeData({
1801
- columns: this._columns,
1802
- result: this._data,
1803
- rowClassName: this.rowClassName
1804
- });
1805
- }
1806
- /**
1807
- * Return pure data, `st` internally maintains a set of data for caching, this part of data may affect the backend
1808
- *
1809
- * 返回纯净数据,`st` 内部会维护一组用于缓存的数据,这部分数据可能会影响后端
1810
- */
1811
- pureItem(itemOrIndex) {
1812
- if (typeof itemOrIndex === 'number') {
1813
- itemOrIndex = this._data[itemOrIndex];
1814
- }
1815
- if (!itemOrIndex) {
1816
- return null;
1817
- }
1818
- const copyItem = deepCopy(itemOrIndex);
1819
- delete copyItem._values;
1820
- return copyItem;
1821
- }
1822
- ngAfterViewInit() {
1823
- this.columnSource.restoreAllRender(this._columns);
1824
- }
1825
- ngOnChanges(changes) {
1826
- if (changes.columns) {
1827
- this.refreshColumns().optimizeData();
1828
- }
1829
- const changeData = changes.data;
1830
- if (changeData && changeData.currentValue && !(this.req.lazyLoad && changeData.firstChange)) {
1831
- this.loadPageData();
1832
- }
1833
- if (changes.loading) {
1834
- this._loading = changes.loading.currentValue;
1835
- }
1836
- }
1837
- ngOnDestroy() {
1838
- this.destroy$.next();
1839
- this.destroy$.complete();
1840
- }
1841
- }
1842
- STComponent.decorators = [
1843
- { type: Component, args: [{
1844
- selector: 'st',
1845
- exportAs: 'st',
1846
- template: "<ng-template #btnTpl let-i let-btn=\"btn\">\n <ng-container *ngIf=\"!btn.tooltip\">\n <ng-template [ngTemplateOutlet]=\"btnItemTpl\" [ngTemplateOutletContext]=\"{ $implicit: i, btn: btn }\"></ng-template>\n </ng-container>\n <span *ngIf=\"btn.tooltip\" nz-tooltip [nzTooltipTitle]=\"btn.tooltip\">\n <ng-template [ngTemplateOutlet]=\"btnItemTpl\" [ngTemplateOutletContext]=\"{ $implicit: i, btn: btn }\"></ng-template>\n </span>\n</ng-template>\n<ng-template #btnItemTpl let-i let-btn=\"btn\">\n <a\n *ngIf=\"btn.pop\"\n nz-popconfirm\n [nzPopconfirmTitle]=\"btn.pop.title\"\n [nzIcon]=\"btn.pop.icon\"\n [nzCondition]=\"btn.pop.condition(i)\"\n [nzCancelText]=\"btn.pop.cancelText\"\n [nzOkText]=\"btn.pop.okText\"\n [nzOkType]=\"btn.pop.okType\"\n (nzOnConfirm)=\"_btnClick(i, btn)\"\n class=\"st__btn-text\"\n [ngClass]=\"btn.className\"\n (click)=\"_stopPropagation($event)\"\n >\n <ng-template [ngTemplateOutlet]=\"btnTextTpl\" [ngTemplateOutletContext]=\"{ $implicit: i, btn: btn }\"></ng-template>\n </a>\n <a *ngIf=\"!btn.pop\" (click)=\"_btnClick(i, btn, $event)\" class=\"st__btn-text\" [ngClass]=\"btn.className\">\n <ng-template [ngTemplateOutlet]=\"btnTextTpl\" [ngTemplateOutletContext]=\"{ $implicit: i, btn: btn }\"></ng-template>\n </a>\n</ng-template>\n<ng-template #btnTextTpl let-i let-btn=\"btn\">\n <ng-container *ngIf=\"btn.icon\">\n <i\n *ngIf=\"!btn.icon.iconfont\"\n nz-icon\n [nzType]=\"btn.icon.type\"\n [nzTheme]=\"btn.icon.theme\"\n [nzSpin]=\"btn.icon.spin\"\n [nzTwotoneColor]=\"btn.icon.twoToneColor\"\n ></i>\n <i *ngIf=\"btn.icon.iconfont\" nz-icon [nzIconfont]=\"btn.icon.iconfont\"></i>\n </ng-container>\n <span [innerHTML]=\"btn._text\" [ngClass]=\"{ 'pl-xs': btn.icon }\"></span>\n</ng-template>\n<ng-template #titleTpl let-i>\n <span [innerHTML]=\"i._text\"></span>\n <small *ngIf=\"i.optional\" class=\"st__head-optional\" [innerHTML]=\"i.optional\"></small>\n <i\n *ngIf=\"i.optionalHelp\"\n class=\"st__head-tip\"\n nz-tooltip\n [nzTooltipTitle]=\"i.optionalHelp\"\n nz-icon\n nzType=\"question-circle\"\n ></i>\n</ng-template>\n<ng-template #chkAllTpl let-custom>\n <label\n nz-checkbox\n class=\"st__checkall\"\n [nzDisabled]=\"_allCheckedDisabled\"\n [(ngModel)]=\"_allChecked\"\n [nzIndeterminate]=\"_indeterminate\"\n (ngModelChange)=\"_checkAll()\"\n [class.ant-table-selection-select-all-custom]=\"custom\"\n ></label>\n</ng-template>\n<nz-table\n #table\n [nzData]=\"_data\"\n [(nzPageIndex)]=\"pi\"\n (nzPageIndexChange)=\"_change('pi')\"\n [(nzPageSize)]=\"ps\"\n (nzPageSizeChange)=\"_change('ps')\"\n [nzTotal]=\"total\"\n [nzShowPagination]=\"_isPagination\"\n [nzFrontPagination]=\"false\"\n [nzBordered]=\"bordered\"\n [nzSize]=\"size\"\n [nzLoading]=\"_loading\"\n [nzLoadingDelay]=\"loadingDelay\"\n [nzLoadingIndicator]=\"loadingIndicator\"\n [nzTitle]=\"header!\"\n [nzFooter]=\"footer!\"\n [nzScroll]=\"scroll\"\n [nzVirtualItemSize]=\"virtualItemSize\"\n [nzVirtualMaxBufferPx]=\"virtualMaxBufferPx\"\n [nzVirtualMinBufferPx]=\"virtualMinBufferPx\"\n [nzVirtualForTrackBy]=\"virtualForTrackBy\"\n [nzNoResult]=\"noResult!\"\n [nzPageSizeOptions]=\"page.pageSizes!\"\n [nzShowQuickJumper]=\"page.showQuickJumper\"\n [nzShowSizeChanger]=\"page.showSize\"\n [nzPaginationPosition]=\"page.position!\"\n [nzPaginationType]=\"page.type!\"\n [nzItemRender]=\"page.itemRender!\"\n [nzSimple]=\"page.simple\"\n [nzShowTotal]=\"totalTpl\"\n [nzWidthConfig]=\"_widthConfig\"\n (contextmenu)=\"onContextmenu($event)\"\n>\n <thead *ngIf=\"showHeader\">\n <tr *ngFor=\"let row of _headers; let rowFirst = first\">\n <th *ngIf=\"rowFirst && expand\" nzWidth=\"50px\" [rowSpan]=\"_headers.length\"></th>\n <ng-container *ngFor=\"let h of row; let index = index; let last = last\">\n <th\n *let=\"h.column as _c\"\n [colSpan]=\"h.colSpan\"\n [rowSpan]=\"h.rowSpan\"\n [nzWidth]=\"$any(_c).width\"\n [nzLeft]=\"_c._left!\"\n [nzRight]=\"_c._right!\"\n [ngClass]=\"_c.className!\"\n [attr.data-col]=\"_c.indexKey\"\n [attr.data-col-index]=\"index\"\n [nzShowSort]=\"_c._sort.enabled\"\n [nzSortOrder]=\"$any(_c)._sort.default\"\n (nzSortOrderChange)=\"sort(_c, index, $event)\"\n [nzCustomFilter]=\"$any(_c).filter\"\n nz-resizable\n [nzDisabled]=\"last || $any(_c).resizable.disabled\"\n [nzMaxWidth]=\"$any(_c).resizable.maxWidth\"\n [nzMinWidth]=\"$any(_c).resizable.minWidth\"\n [nzBounds]=\"$any(_c).resizable.bounds\"\n [nzPreview]=\"$any(_c).resizable.preview\"\n (nzResizeEnd)=\"colResize($event, _c)\"\n >\n <nz-resize-handle *ngIf=\"$any(!last && !$any(_c).resizable.disabled)\" nzDirection=\"right\">\n <i></i>\n </nz-resize-handle>\n <ng-template\n #renderTitle\n [ngTemplateOutlet]=\"_c.__renderTitle!\"\n [ngTemplateOutletContext]=\"{ $implicit: h.column, index: index }\"\n ></ng-template>\n <ng-container *ngIf=\"!_c.__renderTitle; else renderTitle\">\n <ng-container [ngSwitch]=\"_c.type\">\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <ng-container *ngIf=\"_c.selections!.length === 0\">\n <ng-template [ngTemplateOutlet]=\"chkAllTpl\" [ngTemplateOutletContext]=\"{ $implicit: false }\">\n </ng-template>\n </ng-container>\n <div *ngIf=\"_c.selections!.length > 0\" class=\"ant-table-selection\">\n <ng-template [ngTemplateOutlet]=\"chkAllTpl\" [ngTemplateOutletContext]=\"{ $implicit: true }\">\n </ng-template>\n <div\n *ngIf=\"_c.selections!.length\"\n nz-dropdown\n nzPlacement=\"bottomLeft\"\n [nzDropdownMenu]=\"selectionMenu\"\n class=\"ant-table-selection-down st__checkall-selection\"\n >\n <i nz-icon nzType=\"down\"></i>\n </div>\n <nz-dropdown-menu #selectionMenu=\"nzDropdownMenu\">\n <ul nz-menu class=\"ant-table-selection-menu\">\n <li\n nz-menu-item\n *ngFor=\"let rw of _c.selections\"\n (click)=\"_rowSelection(rw)\"\n [innerHTML]=\"rw.text\"\n ></li>\n </ul>\n </nz-dropdown-menu>\n </div>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-template\n [ngTemplateOutlet]=\"titleTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: _c.title }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"_c.filter\">\n <div\n nz-th-extra\n *let=\"_c.filter as _f\"\n class=\"ant-table-filter-trigger-container st__filter\"\n [class.ant-table-filter-trigger-container-open]=\"$any(_f).visible\"\n >\n <span\n class=\"ant-table-filter-trigger\"\n [class.active]=\"$any(_f).visible || _f.default\"\n nz-dropdown\n [nzDropdownMenu]=\"filterMenu\"\n nzTrigger=\"click\"\n [nzClickHide]=\"false\"\n [(nzVisible)]=\"$any(_f).visible\"\n nzOverlayClassName=\"st__filter-wrap\"\n (click)=\"_filterClick($event)\"\n >\n <i nz-icon [nzType]=\"$any(_f).icon.type\" [nzTheme]=\"$any(_f).icon.theme\"></i>\n </span>\n <nz-dropdown-menu #filterMenu=\"nzDropdownMenu\">\n <div class=\"ant-table-filter-dropdown\">\n <ng-container [ngSwitch]=\"_f.type\">\n <div *ngSwitchCase=\"'keyword'\" class=\"st__filter-keyword\">\n <input\n type=\"text\"\n nz-input\n [attr.placeholder]=\"$any(_f).menus[0].text\"\n [(ngModel)]=\"$any(_f).menus[0].value\"\n />\n </div>\n <ul *ngSwitchDefault nz-menu>\n <ng-container *ngIf=\"_f.multiple\">\n <li nz-menu-item *ngFor=\"let filter of _f.menus\">\n <label nz-checkbox [(ngModel)]=\"filter.checked\">{{ filter.text }}</label>\n </li>\n </ng-container>\n <ng-container *ngIf=\"!_f.multiple\">\n <li nz-menu-item *ngFor=\"let filter of _f.menus\">\n <label\n nz-radio\n [ngModel]=\"filter.checked\"\n (ngModelChange)=\"_filterRadio(h.column, filter, $event)\"\n >{{ filter.text }}</label\n >\n </li>\n </ng-container>\n </ul>\n </ng-container>\n <div class=\"ant-table-filter-dropdown-btns\">\n <a class=\"ant-table-filter-dropdown-link confirm\" (click)=\"$any(_f).visible = false\">\n <span (click)=\"_filterConfirm(h.column)\">{{ _f.confirmText || locale.filterConfirm }}</span>\n </a>\n <a class=\"ant-table-filter-dropdown-link clear\" (click)=\"$any(_f).visible = false\">\n <span (click)=\"_filterClear(h.column)\">{{ _f.clearText || locale.filterReset }}</span>\n </a>\n </div>\n </div>\n </nz-dropdown-menu>\n </div>\n </ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n <tbody class=\"st__body\">\n <ng-container *ngIf=\"!_loading\">\n <ng-template\n [ngTemplateOutlet]=\"bodyHeader!\"\n [ngTemplateOutletContext]=\"{ $implicit: _statistical }\"\n ></ng-template>\n </ng-container>\n <ng-template #bodyTpl let-i let-index=\"index\">\n <tr [attr.data-index]=\"index\" (click)=\"_rowClick($event, i, index)\" [ngClass]=\"i._rowClassName\">\n <td\n *ngIf=\"expand\"\n [nzShowExpand]=\"expand && i.showExpand !== false\"\n [nzExpand]=\"i.expand\"\n (nzExpandChange)=\"_expandChange(i, $event)\"\n (click)=\"_stopPropagation($event)\"\n nzWidth=\"50px\"\n ></td>\n <td\n *ngFor=\"let c of _columns; let cIdx = index\"\n [nzLeft]=\"!!c._left\"\n [nzRight]=\"!!c._right\"\n [attr.data-col-index]=\"cIdx\"\n [ngClass]=\"c._className!\"\n [attr.colspan]=\"c.colSpan\"\n >\n <span *ngIf=\"responsive\" class=\"ant-table-rep__title\">\n <ng-template [ngTemplateOutlet]=\"titleTpl\" [ngTemplateOutletContext]=\"{ $implicit: c.title }\"></ng-template>\n </span>\n <span>\n <ng-template\n #render\n [ngTemplateOutlet]=\"c.__render!\"\n [ngTemplateOutletContext]=\"{ $implicit: i, index: index, column: c }\"\n ></ng-template>\n <ng-container *ngIf=\"!c.__render; else render\">\n <ng-container [ngSwitch]=\"c.type\">\n <label\n *ngSwitchCase=\"'checkbox'\"\n nz-checkbox\n [nzDisabled]=\"i.disabled\"\n [ngModel]=\"i.checked\"\n (ngModelChange)=\"_checkSelection(i, $event)\"\n ></label>\n <label\n *ngSwitchCase=\"'radio'\"\n nz-radio\n [nzDisabled]=\"i.disabled\"\n [ngModel]=\"i.checked\"\n (ngModelChange)=\"_refRadio($event, i)\"\n ></label>\n <a\n *ngSwitchCase=\"'link'\"\n (click)=\"_click($event, i, c)\"\n [innerHTML]=\"i._values[cIdx]._text\"\n [attr.title]=\"i._values[cIdx].text\"\n ></a>\n <ng-container *ngIf=\"i._values[cIdx].text\">\n <nz-tag *ngSwitchCase=\"'tag'\" [nzColor]=\"i._values[cIdx].color\">\n <span [innerHTML]=\"i._values[cIdx]._text\"></span>\n </nz-tag>\n <nz-badge\n *ngSwitchCase=\"'badge'\"\n [nzStatus]=\"i._values[cIdx].color\"\n [nzText]=\"i._values[cIdx].text\"\n ></nz-badge>\n </ng-container>\n <ng-template *ngSwitchCase=\"'widget'\" st-widget-host [record]=\"i\" [column]=\"c\"></ng-template>\n <ng-container *ngSwitchDefault>\n <span\n *ngIf=\"c.safeType !== 'text'\"\n [innerHTML]=\"i._values[cIdx]._text\"\n [attr.title]=\"c._isTruncate ? i._values[cIdx].text : null\"\n ></span>\n <span\n *ngIf=\"c.safeType === 'text'\"\n [innerText]=\"i._values[cIdx]._text\"\n [attr.title]=\"c._isTruncate ? i._values[cIdx].text : null\"\n ></span>\n </ng-container>\n </ng-container>\n <ng-container *ngFor=\"let btn of i._values[cIdx].buttons; let last = last\">\n <a\n *ngIf=\"btn.children!.length > 0\"\n nz-dropdown\n [nzDropdownMenu]=\"btnMenu\"\n nzOverlayClassName=\"st__btn-sub\"\n >\n <span [innerHTML]=\"btn._text\"></span>\n <i nz-icon nzType=\"down\"></i>\n </a>\n <nz-dropdown-menu #btnMenu=\"nzDropdownMenu\">\n <ul nz-menu>\n <ng-container *ngFor=\"let subBtn of btn.children!\">\n <li *ngIf=\"subBtn.type !== 'divider'\" nz-menu-item [class.st__btn-disabled]=\"subBtn._disabled\">\n <ng-template\n [ngTemplateOutlet]=\"btnTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: i, btn: subBtn }\"\n >\n </ng-template>\n </li>\n <li *ngIf=\"subBtn.type === 'divider'\" nz-menu-divider></li>\n </ng-container>\n </ul>\n </nz-dropdown-menu>\n <span *ngIf=\"btn.children!.length === 0\" [class.st__btn-disabled]=\"btn._disabled\">\n <ng-template [ngTemplateOutlet]=\"btnTpl\" [ngTemplateOutletContext]=\"{ $implicit: i, btn: btn }\">\n </ng-template>\n </span>\n <nz-divider *ngIf=\"!last\" nzType=\"vertical\"></nz-divider>\n </ng-container>\n </ng-container>\n </span>\n </td>\n </tr>\n <tr [nzExpand]=\"i.expand\">\n <ng-template\n [ngTemplateOutlet]=\"expand\"\n [ngTemplateOutletContext]=\"{ $implicit: i, index: index }\"\n ></ng-template>\n </tr>\n </ng-template>\n <ng-container *ngIf=\"!virtualScroll\">\n <ng-container *ngFor=\"let i of _data; let index = index\">\n <ng-template [ngTemplateOutlet]=\"bodyTpl\" [ngTemplateOutletContext]=\"{ $implicit: i, index: index }\">\n </ng-template>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"virtualScroll\">\n <ng-template nz-virtual-scroll let-i let-index=\"index\">\n <ng-template [ngTemplateOutlet]=\"bodyTpl\" [ngTemplateOutletContext]=\"{ $implicit: i, index: index }\">\n </ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!_loading\">\n <ng-template [ngTemplateOutlet]=\"body!\" [ngTemplateOutletContext]=\"{ $implicit: _statistical }\"></ng-template>\n </ng-container>\n </tbody>\n <ng-template #totalTpl let-range=\"range\" let-total>{{ renderTotal(total, range) }}</ng-template>\n</nz-table>\n<nz-dropdown-menu #contextmenuTpl=\"nzDropdownMenu\">\n <ul nz-menu class=\"st__contextmenu\">\n <ng-container *ngFor=\"let i of contextmenuList\">\n <li nz-menu-item *ngIf=\"i.children!.length === 0\" (click)=\"i.fn!(i)\" [innerHTML]=\"i.text\"></li>\n <li nz-submenu *ngIf=\"i.children!.length > 0\" [nzTitle]=\"i.text\">\n <ul>\n <li nz-menu-item *ngFor=\"let ci of i.children\" (click)=\"ci.fn!(ci)\" [innerHTML]=\"ci.text\"></li>\n </ul>\n </li>\n </ng-container>\n </ul>\n</nz-dropdown-menu>\n",
1847
- providers: [STDataSource, STRowSource, STColumnSource, STExport, DatePipe, YNPipe, DecimalPipe],
1848
- host: {
1849
- '[class.st]': `true`,
1850
- '[class.st__p-left]': `page.placement === 'left'`,
1851
- '[class.st__p-center]': `page.placement === 'center'`,
1852
- '[class.st__width-strict]': `widthMode.type === 'strict'`,
1853
- '[class.ant-table-rep]': `responsive`,
1854
- '[class.ant-table-rep__hide-header-footer]': `responsiveHideHeaderFooter`
1855
- },
1856
- preserveWhitespaces: false,
1857
- changeDetection: ChangeDetectionStrategy.OnPush,
1858
- encapsulation: ViewEncapsulation.None
1859
- },] }
1860
- ];
1861
- STComponent.ctorParameters = () => [
1862
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [ALAIN_I18N_TOKEN,] }] },
1863
- { type: ChangeDetectorRef },
1864
- { type: Router },
1865
- { type: ElementRef },
1866
- { type: STExport },
1867
- { type: ModalHelper },
1868
- { type: DrawerHelper },
1869
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
1870
- { type: STColumnSource },
1871
- { type: STDataSource },
1872
- { type: DelonLocaleService },
1873
- { type: AlainConfigService },
1874
- { type: NzContextMenuService }
1875
- ];
1876
- STComponent.propDecorators = {
1877
- orgTable: [{ type: ViewChild, args: ['table',] }],
1878
- contextmenuTpl: [{ type: ViewChild, args: ['contextmenuTpl',] }],
1879
- req: [{ type: Input }],
1880
- res: [{ type: Input }],
1881
- page: [{ type: Input }],
1882
- data: [{ type: Input }],
1883
- columns: [{ type: Input }],
1884
- contextmenu: [{ type: Input }],
1885
- ps: [{ type: Input }],
1886
- pi: [{ type: Input }],
1887
- total: [{ type: Input }],
1888
- loading: [{ type: Input }],
1889
- loadingDelay: [{ type: Input }],
1890
- loadingIndicator: [{ type: Input }],
1891
- bordered: [{ type: Input }],
1892
- size: [{ type: Input }],
1893
- scroll: [{ type: Input }],
1894
- singleSort: [{ type: Input }],
1895
- multiSort: [{ type: Input }],
1896
- rowClassName: [{ type: Input }],
1897
- clickRowClassName: [{ type: Input }],
1898
- widthMode: [{ type: Input }],
1899
- widthConfig: [{ type: Input }],
1900
- resizable: [{ type: Input }],
1901
- header: [{ type: Input }],
1902
- showHeader: [{ type: Input }],
1903
- footer: [{ type: Input }],
1904
- bodyHeader: [{ type: Input }],
1905
- body: [{ type: Input }],
1906
- expandRowByClick: [{ type: Input }],
1907
- expandAccordion: [{ type: Input }],
1908
- expand: [{ type: Input }],
1909
- noResult: [{ type: Input }],
1910
- rowClickTime: [{ type: Input }],
1911
- responsive: [{ type: Input }],
1912
- responsiveHideHeaderFooter: [{ type: Input }],
1913
- error: [{ type: Output }],
1914
- change: [{ type: Output }],
1915
- virtualScroll: [{ type: Input }],
1916
- virtualItemSize: [{ type: Input }],
1917
- virtualMaxBufferPx: [{ type: Input }],
1918
- virtualMinBufferPx: [{ type: Input }],
1919
- customRequest: [{ type: Input }],
1920
- virtualForTrackBy: [{ type: Input }]
1921
- };
1922
- __decorate([
1923
- InputNumber()
1924
- ], STComponent.prototype, "ps", void 0);
1925
- __decorate([
1926
- InputNumber()
1927
- ], STComponent.prototype, "pi", void 0);
1928
- __decorate([
1929
- InputNumber()
1930
- ], STComponent.prototype, "total", void 0);
1931
- __decorate([
1932
- InputNumber()
1933
- ], STComponent.prototype, "loadingDelay", void 0);
1934
- __decorate([
1935
- InputBoolean()
1936
- ], STComponent.prototype, "bordered", void 0);
1937
- __decorate([
1938
- InputBoolean()
1939
- ], STComponent.prototype, "showHeader", void 0);
1940
- __decorate([
1941
- InputBoolean()
1942
- ], STComponent.prototype, "expandRowByClick", void 0);
1943
- __decorate([
1944
- InputBoolean()
1945
- ], STComponent.prototype, "expandAccordion", void 0);
1946
- __decorate([
1947
- InputNumber()
1948
- ], STComponent.prototype, "rowClickTime", void 0);
1949
- __decorate([
1950
- InputBoolean()
1951
- ], STComponent.prototype, "responsive", void 0);
1952
- __decorate([
1953
- InputBoolean()
1954
- ], STComponent.prototype, "responsiveHideHeaderFooter", void 0);
1955
- __decorate([
1956
- InputBoolean()
1957
- ], STComponent.prototype, "virtualScroll", void 0);
1958
- __decorate([
1959
- InputNumber()
1960
- ], STComponent.prototype, "virtualItemSize", void 0);
1961
- __decorate([
1962
- InputNumber()
1963
- ], STComponent.prototype, "virtualMaxBufferPx", void 0);
1964
- __decorate([
1965
- InputNumber()
1966
- ], STComponent.prototype, "virtualMinBufferPx", void 0);
1967
-
1968
- const COMPONENTS = [STComponent, STRowDirective, STWidgetHostDirective];
1969
- class STModule {
1970
- }
1971
- STModule.decorators = [
1972
- { type: NgModule, args: [{
1973
- imports: [
1974
- CommonModule,
1975
- FormsModule,
1976
- DelonACLModule,
1977
- LetModule,
1978
- NzPopconfirmModule,
1979
- NzTableModule,
1980
- NzIconModule,
1981
- NzBadgeModule,
1982
- NzCheckboxModule,
1983
- NzDividerModule,
1984
- NzDropDownModule,
1985
- NzMenuModule,
1986
- NzRadioModule,
1987
- NzTagModule,
1988
- NzInputModule,
1989
- NzToolTipModule,
1990
- NzResizableModule
1991
- ],
1992
- declarations: COMPONENTS,
1993
- exports: COMPONENTS
1994
- },] }
1995
- ];
1996
-
1997
- /**
1998
- * Generated bundle index. Do not edit.
1999
- */
2000
-
2001
- export { STColumnSource, STComponent, STDataSource, STExport, STModule, STRowDirective, STWidgetHostDirective, STWidgetRegistry, ST_DEFAULT_CONFIG, STRowSource as ɵa };
2002
- //# sourceMappingURL=table.js.map