@masterteam/components 0.0.263 → 0.0.265

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 (755) hide show
  1. package/.angular/cache/21.2.7/@masterteam/components/.tsbuildinfo +1 -0
  2. package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db +0 -0
  3. package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db-lock +0 -0
  4. package/.angular/cache/21.2.7/ng-packagr/045efd332b9db1d21b3a595a37ae03ebb11b457a5dc6e2d1cbc561b694e17f1a +1 -0
  5. package/.angular/cache/21.2.7/ng-packagr/0727b170af3d53236c0cafe16ea670d089e48d4c5c525b1dbcc1c684bb6e99c7 +1 -0
  6. package/.angular/cache/21.2.7/ng-packagr/0873bc9048494ebc33fe0a7b856324c7c4ca681b0dcaa87338e3290186906d49 +1 -0
  7. package/.angular/cache/21.2.7/ng-packagr/1010cd8fc996d0c2df519ed60085f4b1f38ccfc873900055bc75fc20a3c26bab +1 -0
  8. package/.angular/cache/21.2.7/ng-packagr/12379a8ab7254ad3df2635823a358cfce32e6d0f390be68596cc97e02307e6c4 +1 -0
  9. package/.angular/cache/21.2.7/ng-packagr/1239e7a937657b62f858d17d47738ed30facbdaa91032511e29ed148b748400b +1 -0
  10. package/.angular/cache/21.2.7/ng-packagr/133b9ecf47ba424244902da90d77cd3f135b85f95c01b16de7b2247f57518f01 +1 -0
  11. package/.angular/cache/21.2.7/ng-packagr/175d45dc6da51834e7fe937c09d23dbf28d2a823f838ef5271fd3e148776d6ec +1 -0
  12. package/.angular/cache/21.2.7/ng-packagr/19d99ad4d927324b03cdbef34331ba2c58bd580f1f0ca591cb5f8dbf436c913c +1 -0
  13. package/.angular/cache/21.2.7/ng-packagr/1a86918763f95c1c2b9fa781bda1ceedf15aead87f0e11ea1324318af43a897a +1 -0
  14. package/.angular/cache/21.2.7/ng-packagr/1f08100dbc280be7da64c809315376eb7d0cfd074916a6042f609f03f4276a8e +1 -0
  15. package/.angular/cache/21.2.7/ng-packagr/2224877a7e762b86541428e4c40d61f54f505867c305769ae42e67e4aa81bd93 +1 -0
  16. package/.angular/cache/21.2.7/ng-packagr/24957fb7ec060692ebcf1471e1bdce39f40aed938959e580048ade58015762d2 +1 -0
  17. package/.angular/cache/21.2.7/ng-packagr/295fcdc1c4462e7feae96a24255369508a559faaecc4676267749a7ce23e4b6d +1 -0
  18. package/.angular/cache/21.2.7/ng-packagr/2b37e2f2d6564d10bad1fd0ecc16453962fd855cd1e36ad7aa24baf3e4f2e8b3 +1 -0
  19. package/.angular/cache/21.2.7/ng-packagr/2c20f0929771e857b570ba2beffe91f598f299ce26d4825fe4315bfe5a3dd40a +1 -0
  20. package/.angular/cache/21.2.7/ng-packagr/37dea2e5798cad4a21d66292eeed5be26d04500d9a1534332ad42ce664a058c2 +1 -0
  21. package/.angular/cache/21.2.7/ng-packagr/3b6239b640fcb5ea7067a2655a2901d32f55372812b586aa008e77c59e8f2090 +1 -0
  22. package/.angular/cache/21.2.7/ng-packagr/3beb1b4dfe75d1e6749cf91f05d51ba4eece939f5c15f6f33ed587bfd198f0a3 +1 -0
  23. package/.angular/cache/21.2.7/ng-packagr/3f161e6c2ead4519d0663dd79199dafceb2cc22da7ce92a72b809b93bfce0bb0 +1 -0
  24. package/.angular/cache/21.2.7/ng-packagr/43551862d17cd02626e18b30243390081a6247784485660048b060a3d4ab7fa7 +1 -0
  25. package/.angular/cache/21.2.7/ng-packagr/47aedf032519b41d96866fcf8fbd4f1dfd29f9e9a534b39dee0e44d402227d2d +1 -0
  26. package/.angular/cache/21.2.7/ng-packagr/4a1768888c60921955bfdfba8b31c8d853bd7b2a7d3a7b83934de049e1e6e6a2 +1 -0
  27. package/.angular/cache/21.2.7/ng-packagr/4a783e339117597607bff17eeca0ad24d84b8cbc1e28927e7e453ccfa6223180 +1 -0
  28. package/.angular/cache/21.2.7/ng-packagr/4d9331b2050326f586cd8f6593a9e04e1c7944b2f9e98023649023c099597a5d +1 -0
  29. package/.angular/cache/21.2.7/ng-packagr/4e379f506919d47af7008658c75242aa05f0056c1caec4061d7fa5746f776049 +1 -0
  30. package/.angular/cache/21.2.7/ng-packagr/55009bb7d44552dd816ce32fa2b0f7985f3f08fefd6409c2b4f6b9ffe35dad83 +1 -0
  31. package/.angular/cache/21.2.7/ng-packagr/58ae3f1f9664f7b16844d2e4a279dd4ca9371de014cf5687320c2d5cb259a74f +1 -0
  32. package/.angular/cache/21.2.7/ng-packagr/5c08e906bd3fe1aa6c1d62f2bbb2b3f276e1c17fe45ef081e76bd1b865ac3dfa +1 -0
  33. package/.angular/cache/21.2.7/ng-packagr/5ce333a40ad635188347fa9bc601d5fd14be6baacbae7d096259d725ac9757af +1 -0
  34. package/.angular/cache/21.2.7/ng-packagr/5f32cceaee6a6ea19cc6cbff5ea089b752f13a0fdcd32597d4c99d5e1e031bb5 +1 -0
  35. package/.angular/cache/21.2.7/ng-packagr/691ad4ccdc0a8ede36e1f4e5e97638c20c2d3142916ffac3a1b172178c139205 +1 -0
  36. package/.angular/cache/21.2.7/ng-packagr/6b57160e0d2da3f31693831e84a3f4209c1f33a04abd636e34af03956e7329d8 +1 -0
  37. package/.angular/cache/21.2.7/ng-packagr/70bc711a1d7b631845885c26adc2d6b1bff47d11332b2625cedfa11e9d5ac79a +1 -0
  38. package/.angular/cache/21.2.7/ng-packagr/7427c266237012afaef486c2af94ee08a491e8d7b6fc7e5ee887980830bbd333 +1 -0
  39. package/.angular/cache/21.2.7/ng-packagr/7e8fa7c61cf9a932ba3a0e65eb73c7412e81666b7a8f923dac7b75acfbb94b1d +1 -0
  40. package/.angular/cache/21.2.7/ng-packagr/81aab7fdab43cbdfa869db759d6113ae01ec6f5e0e9061d7fc089c260886e4d1 +1 -0
  41. package/.angular/cache/21.2.7/ng-packagr/83a81758045ff710a34ea3cf6f54435a1f5dea9839d8c0adda0bbce7c3fb6e8b +1 -0
  42. package/.angular/cache/21.2.7/ng-packagr/883eae810a4c09f06617bdc2e4bc30a69f09726401b2a051840969f635d076f1 +1 -0
  43. package/.angular/cache/21.2.7/ng-packagr/8a6b9be66de40c57054dca5fde376c3cec1bec1ae191a16f1ae6a83306d9ebfe +1 -0
  44. package/.angular/cache/21.2.7/ng-packagr/8d42c8144f6929de46984094bf390a0c4168404ab13a5194839f6ba5e42bc3ce +1 -0
  45. package/.angular/cache/21.2.7/ng-packagr/91093656c61a5404f0d576f872247eeb480dd938e6999d481a97893c72b5f3d0 +1 -0
  46. package/.angular/cache/21.2.7/ng-packagr/91e881172037c63d819e30d30e390e0d7dc0dee9808b3902275ccc8b1887d864 +1 -0
  47. package/.angular/cache/21.2.7/ng-packagr/9ef28cf3a676e7bd0d37762c4868b4810efca2f241ed0dae75ebca41988e2c00 +1 -0
  48. package/.angular/cache/21.2.7/ng-packagr/a07cbea405c1831b3f686a8e57c4b500d89cbab2b95e110487890269945feeaa +1 -0
  49. package/.angular/cache/21.2.7/ng-packagr/a463deba940880d9461612c9cd00d90062bf97aa31b1c4556b8b47a967cb6882 +1 -0
  50. package/.angular/cache/21.2.7/ng-packagr/ab03ed1e4a371113b41b663d526d2b06565ceb062e6f033f726f1e455fc5d1d6 +1 -0
  51. package/.angular/cache/21.2.7/ng-packagr/ad0e84be4f2211aff6187b4bec9adbe15f0e8b36851e9c6c63b38303c2daad37 +1 -0
  52. package/.angular/cache/21.2.7/ng-packagr/aece79242dae70eb748605e37483e75e122e4ce414fa8be875499e8af26ee5d6 +1 -0
  53. package/.angular/cache/21.2.7/ng-packagr/aff32db91ce03de30d2bbc84f266fe3fb2c6629d5eeb39a364204d9499484368 +1 -0
  54. package/.angular/cache/21.2.7/ng-packagr/b0671e73a162927d28ef1742ec008e514264bc2ce29f2255bedaea553492fe5d +1 -0
  55. package/.angular/cache/21.2.7/ng-packagr/bb50d71f3cdeebbb85fd983be8103f9c216060464f8e7e534271197391e6dcf7 +1 -0
  56. package/.angular/cache/21.2.7/ng-packagr/c64241290ab30d8761b2f5493a039427f5cda1a48b5be88ce62ee5c714c0f690 +1 -0
  57. package/.angular/cache/21.2.7/ng-packagr/c794d2e79b26ab378c0dbf8afa7b8ac1337ba9afb288941d44a086cb1bd4bad2 +1 -0
  58. package/.angular/cache/21.2.7/ng-packagr/d942edf8fd8e8e884138ffcdb1a07ad14a0b5e211f8ccea1dc9ea0b48f50cfc9 +1 -0
  59. package/.angular/cache/21.2.7/ng-packagr/dbe0b9b9f18ba7b96d9c84f4fd16cde158c9701c202d00113e6f88ba93407bce +1 -0
  60. package/.angular/cache/21.2.7/ng-packagr/f564395a410a2723aac48e582f5fe416bfeaa48677cea47b10c5152d4f2b6672 +1 -0
  61. package/.angular/cache/21.2.7/ng-packagr/fc9b0d27f081ca7b2a4cbefa75136d7bd7a8c341dbaa0587855071a6003906b8 +1 -0
  62. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar-text.tsbuildinfo +1 -0
  63. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar.tsbuildinfo +1 -0
  64. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-breadcrumb.tsbuildinfo +1 -0
  65. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-business-fields.tsbuildinfo +1 -0
  66. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button-group.tsbuildinfo +1 -0
  67. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button.tsbuildinfo +1 -0
  68. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-card.tsbuildinfo +1 -0
  69. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-checkbox-field.tsbuildinfo +1 -0
  70. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-chip.tsbuildinfo +1 -0
  71. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page-menu.tsbuildinfo +1 -0
  72. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page.tsbuildinfo +1 -0
  73. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-color-picker-field.tsbuildinfo +1 -0
  74. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-confirmation.tsbuildinfo +1 -0
  75. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-date-field.tsbuildinfo +1 -0
  76. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dialog.tsbuildinfo +1 -0
  77. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-drawer.tsbuildinfo +1 -0
  78. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dynamic-drawer.tsbuildinfo +1 -0
  79. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-editor-field.tsbuildinfo +1 -0
  80. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-empty-state.tsbuildinfo +1 -0
  81. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-entities.tsbuildinfo +1 -0
  82. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-field-validation.tsbuildinfo +1 -0
  83. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-formula.tsbuildinfo +1 -0
  84. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-icon-field.tsbuildinfo +1 -0
  85. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-list.tsbuildinfo +1 -0
  86. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-location-field.tsbuildinfo +1 -0
  87. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-menu.tsbuildinfo +1 -0
  88. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-modal.tsbuildinfo +1 -0
  89. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-module-summary-card.tsbuildinfo +1 -0
  90. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-multi-select-field.tsbuildinfo +1 -0
  91. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-number-field.tsbuildinfo +1 -0
  92. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page-header.tsbuildinfo +1 -0
  93. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page.tsbuildinfo +1 -0
  94. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-paginator.tsbuildinfo +1 -0
  95. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-pick-list-field.tsbuildinfo +1 -0
  96. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-progress.tsbuildinfo +1 -0
  97. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-property-filter-builder.tsbuildinfo +1 -0
  98. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-button-field.tsbuildinfo +1 -0
  99. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards-field.tsbuildinfo +1 -0
  100. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards.tsbuildinfo +1 -0
  101. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-runtime-action.tsbuildinfo +1 -0
  102. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-select-field.tsbuildinfo +1 -0
  103. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-sidebar.tsbuildinfo +1 -0
  104. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-slider-field.tsbuildinfo +1 -0
  105. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-statistic-card.tsbuildinfo +1 -0
  106. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-table.tsbuildinfo +1 -0
  107. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tabs.tsbuildinfo +1 -0
  108. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-text-field.tsbuildinfo +1 -0
  109. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-textarea-field.tsbuildinfo +1 -0
  110. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toast.tsbuildinfo +1 -0
  111. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toggle-field.tsbuildinfo +1 -0
  112. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tooltip.tsbuildinfo +1 -0
  113. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-topbar.tsbuildinfo +1 -0
  114. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tree.tsbuildinfo +1 -0
  115. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-treeselect-field.tsbuildinfo +1 -0
  116. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-upload-field.tsbuildinfo +1 -0
  117. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-uploader.tsbuildinfo +1 -0
  118. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-user-search-field.tsbuildinfo +1 -0
  119. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components.tsbuildinfo +1 -0
  120. package/angular.json +32 -0
  121. package/api/api.ts +1 -0
  122. package/api/public-api.ts +5 -0
  123. package/assets/common.css +309 -2
  124. package/assets/i18n/ar.json +10 -2
  125. package/assets/i18n/en.json +10 -2
  126. package/avatar/avatar.html +32 -0
  127. package/avatar/avatar.scss +0 -0
  128. package/avatar/avatar.ts +54 -0
  129. package/avatar/ng-package.json +6 -0
  130. package/avatar/public-api.ts +1 -0
  131. package/avatar-text/avatar-text.html +26 -0
  132. package/avatar-text/avatar-text.scss +0 -0
  133. package/avatar-text/avatar-text.ts +52 -0
  134. package/avatar-text/ng-package.json +6 -0
  135. package/avatar-text/public-api.ts +1 -0
  136. package/breadcrumb/breadcrumb.html +53 -0
  137. package/breadcrumb/breadcrumb.scss +0 -0
  138. package/breadcrumb/breadcrumb.ts +26 -0
  139. package/breadcrumb/ng-package.json +6 -0
  140. package/breadcrumb/public-api.ts +1 -0
  141. package/business-fields/entity-list-field/entity-list-add-token.ts +25 -0
  142. package/business-fields/entity-list-field/entity-list-field.html +70 -0
  143. package/business-fields/entity-list-field/entity-list-field.scss +3 -0
  144. package/business-fields/entity-list-field/entity-list-field.ts +1067 -0
  145. package/business-fields/lookup-matrix-field/lookup-matrix-field.html +38 -0
  146. package/business-fields/lookup-matrix-field/lookup-matrix-field.spec.ts +183 -0
  147. package/business-fields/lookup-matrix-field/lookup-matrix-field.ts +239 -0
  148. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.html +95 -0
  149. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.ts +336 -0
  150. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-form-token.ts +42 -0
  151. package/business-fields/ng-package.json +6 -0
  152. package/business-fields/public-api.ts +8 -0
  153. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.html +32 -0
  154. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.ts +272 -0
  155. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.html +89 -0
  156. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.ts +441 -0
  157. package/business-fields/schema-connection-field/schema-connection-field.html +58 -0
  158. package/business-fields/schema-connection-field/schema-connection-field.scss +0 -0
  159. package/business-fields/schema-connection-field/schema-connection-field.ts +456 -0
  160. package/button/button.html +44 -0
  161. package/button/button.scss +0 -0
  162. package/button/button.ts +120 -0
  163. package/button/ng-package.json +6 -0
  164. package/button/public-api.ts +1 -0
  165. package/button-group/button-group.html +3 -0
  166. package/button-group/button-group.scss +20 -0
  167. package/button-group/button-group.ts +12 -0
  168. package/button-group/ng-package.json +6 -0
  169. package/button-group/public-api.ts +1 -0
  170. package/card/card.html +26 -0
  171. package/card/card.scss +0 -0
  172. package/card/card.ts +29 -0
  173. package/card/ng-package.json +6 -0
  174. package/card/public-api.ts +1 -0
  175. package/checkbox-field/checkbox-field.html +31 -0
  176. package/checkbox-field/checkbox-field.scss +0 -0
  177. package/checkbox-field/checkbox-field.spec.ts +21 -0
  178. package/checkbox-field/checkbox-field.ts +123 -0
  179. package/checkbox-field/ng-package.json +6 -0
  180. package/checkbox-field/public-api.ts +1 -0
  181. package/chip/chip.html +16 -0
  182. package/chip/chip.scss +19 -0
  183. package/chip/chip.ts +45 -0
  184. package/chip/ng-package.json +6 -0
  185. package/chip/public-api.ts +1 -0
  186. package/client-page/client-page.html +232 -0
  187. package/client-page/client-page.ts +588 -0
  188. package/client-page/index.ts +2 -0
  189. package/client-page/ng-package.json +6 -0
  190. package/client-page/public-api.ts +1 -0
  191. package/client-page-menu/client-page-menu.html +142 -0
  192. package/client-page-menu/client-page-menu.ts +199 -0
  193. package/client-page-menu/index.ts +2 -0
  194. package/client-page-menu/ng-package.json +6 -0
  195. package/client-page-menu/public-api.ts +1 -0
  196. package/color-picker-field/color-picker-field.html +45 -0
  197. package/color-picker-field/color-picker-field.scss +52 -0
  198. package/color-picker-field/color-picker-field.ts +131 -0
  199. package/color-picker-field/ng-package.json +6 -0
  200. package/color-picker-field/public-api.ts +1 -0
  201. package/confirmation/confirmation-dialog.html +83 -0
  202. package/confirmation/confirmation-dialog.scss +0 -0
  203. package/confirmation/confirmation-dialog.ts +15 -0
  204. package/confirmation/confirmation.spec.ts +43 -0
  205. package/confirmation/confirmation.ts +103 -0
  206. package/confirmation/ng-package.json +6 -0
  207. package/confirmation/public-api.ts +2 -0
  208. package/date-field/date-field.html +65 -0
  209. package/date-field/date-field.scss +0 -0
  210. package/date-field/date-field.spec.ts +118 -0
  211. package/date-field/date-field.ts +196 -0
  212. package/date-field/ng-package.json +6 -0
  213. package/date-field/public-api.ts +1 -0
  214. package/dialog/dialog.ts +29 -0
  215. package/dialog/ng-package.json +6 -0
  216. package/dialog/public-api.ts +1 -0
  217. package/drawer/drawer.html +67 -0
  218. package/drawer/drawer.scss +1 -0
  219. package/drawer/drawer.ts +348 -0
  220. package/drawer/ng-package.json +5 -0
  221. package/drawer/public-api.ts +1 -0
  222. package/dynamic-drawer/dynamic-drawer-host.ts +476 -0
  223. package/dynamic-drawer/dynamic-drawer.spec.ts +204 -0
  224. package/dynamic-drawer/dynamic-drawer.ts +235 -0
  225. package/dynamic-drawer/ng-package.json +6 -0
  226. package/dynamic-drawer/public-api.ts +2 -0
  227. package/editor-field/editor-field.html +38 -0
  228. package/editor-field/editor-field.scss +219 -0
  229. package/editor-field/editor-field.ts +126 -0
  230. package/editor-field/ng-package.json +6 -0
  231. package/editor-field/public-api.ts +1 -0
  232. package/empty-state/empty-state.html +236 -0
  233. package/empty-state/empty-state.ts +85 -0
  234. package/empty-state/ng-package.json +6 -0
  235. package/empty-state/public-api.ts +1 -0
  236. package/entities/comparison/comparison-entity-list/comparison-entity-list.html +87 -0
  237. package/entities/comparison/comparison-entity-list/comparison-entity-list.ts +93 -0
  238. package/entities/comparison/comparison-value/comparison-value.html +31 -0
  239. package/entities/comparison/comparison-value/comparison-value.ts +53 -0
  240. package/entities/currency-display.utils.spec.ts +94 -0
  241. package/entities/currency-display.utils.ts +92 -0
  242. package/entities/entities-manage/entities-manage.html +74 -0
  243. package/entities/entities-manage/entities-manage.scss +72 -0
  244. package/entities/entities-manage/entities-manage.ts +121 -0
  245. package/entities/entities-manage/entities-resize-base.ts +153 -0
  246. package/entities/entities-preview/entities-preview.css +77 -0
  247. package/entities/entities-preview/entities-preview.html +56 -0
  248. package/entities/entities-preview/entities-preview.ts +281 -0
  249. package/entities/entity-attachment/entity-attachment.html +49 -0
  250. package/entities/entity-attachment/entity-attachment.ts +462 -0
  251. package/entities/entity-checkbox/entity-checkbox.html +28 -0
  252. package/entities/entity-checkbox/entity-checkbox.ts +65 -0
  253. package/entities/entity-comparison.model.ts +39 -0
  254. package/entities/entity-connection/entity-connection.html +12 -0
  255. package/entities/entity-connection/entity-connection.ts +75 -0
  256. package/entities/entity-currency/entity-currency.html +12 -0
  257. package/entities/entity-currency/entity-currency.ts +59 -0
  258. package/entities/entity-date/entity-date.html +16 -0
  259. package/entities/entity-date/entity-date.ts +50 -0
  260. package/entities/entity-display.utils.ts +94 -0
  261. package/entities/entity-field/entity-field.ts +94 -0
  262. package/entities/entity-leaf-details/entity-leaf-details.html +35 -0
  263. package/entities/entity-leaf-details/entity-leaf-details.ts +56 -0
  264. package/entities/entity-location/entity-location.html +34 -0
  265. package/entities/entity-location/entity-location.ts +98 -0
  266. package/entities/entity-long-text/entity-long-text.html +9 -0
  267. package/entities/entity-long-text/entity-long-text.ts +45 -0
  268. package/entities/entity-lookup/entity-lookup.html +25 -0
  269. package/entities/entity-lookup/entity-lookup.ts +68 -0
  270. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html +39 -0
  271. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.spec.ts +148 -0
  272. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts +152 -0
  273. package/entities/entity-percentage/entity-percentage.html +22 -0
  274. package/entities/entity-percentage/entity-percentage.ts +163 -0
  275. package/entities/entity-phase-gate/entity-phase-gate.html +20 -0
  276. package/entities/entity-phase-gate/entity-phase-gate.ts +129 -0
  277. package/entities/entity-preview/entity-preview-body.html +8 -0
  278. package/entities/entity-preview/entity-preview-body.ts +19 -0
  279. package/entities/entity-preview/entity-preview.html +14 -0
  280. package/entities/entity-preview/entity-preview.ts +33 -0
  281. package/entities/entity-preview/entity-value-preview.html +62 -0
  282. package/entities/entity-preview/entity-value-preview.spec.ts +191 -0
  283. package/entities/entity-preview/entity-value-preview.ts +69 -0
  284. package/entities/entity-schedule-item/entity-schedule-item.html +19 -0
  285. package/entities/entity-schedule-item/entity-schedule-item.ts +41 -0
  286. package/entities/entity-sections.util.ts +103 -0
  287. package/entities/entity-status/entity-status.html +20 -0
  288. package/entities/entity-status/entity-status.ts +60 -0
  289. package/entities/entity-text/entity-text.html +20 -0
  290. package/entities/entity-text/entity-text.ts +35 -0
  291. package/entities/entity-user/entity-user.html +181 -0
  292. package/entities/entity-user/entity-user.ts +179 -0
  293. package/entities/entity.model.ts +407 -0
  294. package/entities/leaf-details-display.utils.ts +269 -0
  295. package/entities/ng-package.json +6 -0
  296. package/entities/percentage-color.utils.spec.ts +94 -0
  297. package/entities/percentage-color.utils.ts +80 -0
  298. package/entities/public-api.ts +30 -0
  299. package/field-validation/character-limit.validator.ts +22 -0
  300. package/field-validation/error-message.pipe.spec.ts +184 -0
  301. package/field-validation/error-message.pipe.ts +80 -0
  302. package/field-validation/field-validation.ts +168 -0
  303. package/field-validation/ng-package.json +6 -0
  304. package/field-validation/public-api.ts +2 -0
  305. package/formula/formula-editor/formula-editor.html +89 -0
  306. package/formula/formula-editor/formula-editor.scss +25 -0
  307. package/formula/formula-editor/formula-editor.ts +467 -0
  308. package/formula/formula-editor/index.ts +1 -0
  309. package/formula/formula-editor-code/formula-autocomplete-normalization.util.spec.ts +58 -0
  310. package/formula/formula-editor-code/formula-autocomplete-normalization.util.ts +64 -0
  311. package/formula/formula-editor-code/formula-completion-range.util.spec.ts +62 -0
  312. package/formula/formula-editor-code/formula-completion-range.util.ts +71 -0
  313. package/formula/formula-editor-code/formula-completion-suggestion.util.spec.ts +23 -0
  314. package/formula/formula-editor-code/formula-completion-suggestion.util.ts +18 -0
  315. package/formula/formula-editor-code/formula-editor-code.html +15 -0
  316. package/formula/formula-editor-code/formula-editor-code.scss +90 -0
  317. package/formula/formula-editor-code/formula-editor-code.ts +1095 -0
  318. package/formula/formula-editor-code/index.ts +1 -0
  319. package/formula/formula-status-bar/formula-status-bar.html +119 -0
  320. package/formula/formula-status-bar/formula-status-bar.ts +66 -0
  321. package/formula/formula-status-bar/index.ts +1 -0
  322. package/formula/formula-toolbar/formula-toolbar.html +361 -0
  323. package/formula/formula-toolbar/formula-toolbar.ts +532 -0
  324. package/formula/formula-toolbar/index.ts +2 -0
  325. package/formula/formula-toolbar/operators.ts +122 -0
  326. package/formula/models/formula-block.model.ts +61 -0
  327. package/formula/models/formula-token.model.spec.ts +57 -0
  328. package/formula/models/formula-token.model.ts +852 -0
  329. package/formula/models/index.ts +5 -0
  330. package/formula/models/smart-block.model.ts +132 -0
  331. package/formula/models/validation-result.model.ts +80 -0
  332. package/formula/ng-package.json +6 -0
  333. package/formula/public-api.ts +8 -0
  334. package/formula/runtime/formula-runtime-catalogs.ts +554 -0
  335. package/formula/runtime/formula-runtime-engine.spec.ts +328 -0
  336. package/formula/runtime/formula-runtime-engine.ts +794 -0
  337. package/formula/runtime/formula-runtime.model.ts +53 -0
  338. package/formula/runtime/index.ts +3 -0
  339. package/formula/toolbar-item/index.ts +1 -0
  340. package/formula/toolbar-item/toolbar-item.html +143 -0
  341. package/formula/toolbar-item/toolbar-item.scss +14 -0
  342. package/formula/toolbar-item/toolbar-item.ts +223 -0
  343. package/icon-field/icon-field.html +58 -0
  344. package/icon-field/icon-field.scss +24 -0
  345. package/icon-field/icon-field.spec.ts +77 -0
  346. package/icon-field/icon-field.ts +205 -0
  347. package/icon-field/ng-package.json +6 -0
  348. package/icon-field/public-api.ts +1 -0
  349. package/list/list.html +22 -0
  350. package/list/list.ts +36 -0
  351. package/list/ng-package.json +6 -0
  352. package/list/public-api.ts +1 -0
  353. package/location-field/location-field.html +86 -0
  354. package/location-field/location-field.spec.ts +295 -0
  355. package/location-field/location-field.ts +662 -0
  356. package/location-field/location-manual-dialog.html +43 -0
  357. package/location-field/location-manual-dialog.ts +104 -0
  358. package/location-field/location-value.ts +67 -0
  359. package/location-field/ng-package.json +6 -0
  360. package/location-field/public-api.ts +3 -0
  361. package/menu/menu.html +71 -0
  362. package/menu/menu.scss +3 -0
  363. package/menu/menu.ts +186 -0
  364. package/menu/ng-package.json +6 -0
  365. package/menu/public-api.ts +1 -0
  366. package/modal/modal.ts +127 -0
  367. package/modal/ng-package.json +6 -0
  368. package/modal/public-api.ts +1 -0
  369. package/module-summary-card/module-summary-card.html +43 -0
  370. package/module-summary-card/module-summary-card.scss +0 -0
  371. package/module-summary-card/module-summary-card.ts +40 -0
  372. package/module-summary-card/ng-package.json +6 -0
  373. package/module-summary-card/public-api.ts +1 -0
  374. package/multi-select-field/multi-select-field.html +140 -0
  375. package/multi-select-field/multi-select-field.scss +0 -0
  376. package/multi-select-field/multi-select-field.spec.ts +21 -0
  377. package/multi-select-field/multi-select-field.ts +397 -0
  378. package/multi-select-field/ng-package.json +6 -0
  379. package/multi-select-field/public-api.ts +1 -0
  380. package/ng-package.json +9 -0
  381. package/number-field/ng-package.json +6 -0
  382. package/number-field/number-field.html +39 -0
  383. package/number-field/number-field.scss +8 -0
  384. package/number-field/number-field.spec.ts +21 -0
  385. package/number-field/number-field.ts +124 -0
  386. package/number-field/public-api.ts +1 -0
  387. package/package.json +54 -274
  388. package/page/index.ts +1 -0
  389. package/page/ng-package.json +6 -0
  390. package/page/page.html +37 -0
  391. package/page/page.ts +43 -0
  392. package/page/public-api.ts +1 -0
  393. package/page-header/index.ts +2 -0
  394. package/page-header/ng-package.json +6 -0
  395. package/page-header/page-header.html +60 -0
  396. package/page-header/page-header.ts +54 -0
  397. package/page-header/public-api.ts +1 -0
  398. package/paginator/ng-package.json +6 -0
  399. package/paginator/paginator.html +50 -0
  400. package/paginator/paginator.scss +0 -0
  401. package/paginator/paginator.ts +53 -0
  402. package/paginator/public-api.ts +1 -0
  403. package/pick-list-field/ng-package.json +6 -0
  404. package/pick-list-field/pick-list-field.html +39 -0
  405. package/pick-list-field/pick-list-field.scss +26 -0
  406. package/pick-list-field/pick-list-field.ts +259 -0
  407. package/pick-list-field/public-api.ts +1 -0
  408. package/progress/ng-package.json +6 -0
  409. package/progress/progress.html +36 -0
  410. package/progress/progress.ts +61 -0
  411. package/progress/public-api.ts +1 -0
  412. package/property-filter-builder/ng-package.json +6 -0
  413. package/property-filter-builder/property-filter-builder.html +192 -0
  414. package/property-filter-builder/property-filter-builder.ts +548 -0
  415. package/property-filter-builder/public-api.ts +1 -0
  416. package/radio-button-field/ng-package.json +6 -0
  417. package/radio-button-field/public-api.ts +1 -0
  418. package/radio-button-field/radio-button-field.html +44 -0
  419. package/radio-button-field/radio-button-field.scss +0 -0
  420. package/radio-button-field/radio-button-field.ts +114 -0
  421. package/radio-cards/ng-package.json +6 -0
  422. package/radio-cards/public-api.ts +1 -0
  423. package/radio-cards/radio-cards.css +3 -0
  424. package/radio-cards/radio-cards.html +54 -0
  425. package/radio-cards/radio-cards.spec.ts +22 -0
  426. package/radio-cards/radio-cards.ts +92 -0
  427. package/radio-cards-field/ng-package.json +6 -0
  428. package/radio-cards-field/public-api.ts +1 -0
  429. package/radio-cards-field/radio-cards-field.css +0 -0
  430. package/radio-cards-field/radio-cards-field.html +38 -0
  431. package/radio-cards-field/radio-cards-field.spec.ts +22 -0
  432. package/radio-cards-field/radio-cards-field.ts +182 -0
  433. package/runtime-action/ng-package.json +6 -0
  434. package/runtime-action/payload-builder.ts +246 -0
  435. package/runtime-action/public-api.ts +4 -0
  436. package/runtime-action/runtime-action-context.store.ts +26 -0
  437. package/runtime-action/runtime-action.runner.ts +302 -0
  438. package/runtime-action/runtime-action.types.ts +82 -0
  439. package/select-field/current-user.util.ts +54 -0
  440. package/select-field/ng-package.json +6 -0
  441. package/select-field/public-api.ts +1 -0
  442. package/select-field/select-field.html +142 -0
  443. package/select-field/select-field.scss +0 -0
  444. package/select-field/select-field.spec.ts +21 -0
  445. package/select-field/select-field.ts +471 -0
  446. package/sidebar/ng-package.json +6 -0
  447. package/sidebar/public-api.ts +1 -0
  448. package/sidebar/sidebar.html +368 -0
  449. package/sidebar/sidebar.ts +303 -0
  450. package/slider-field/ng-package.json +7 -0
  451. package/slider-field/public-api.ts +1 -0
  452. package/slider-field/slider-field.html +33 -0
  453. package/slider-field/slider-field.scss +11 -0
  454. package/slider-field/slider-field.spec.ts +44 -0
  455. package/slider-field/slider-field.ts +166 -0
  456. package/src/lib/base/base.facade.ts +159 -0
  457. package/src/lib/base/crud-base.state.ts +248 -0
  458. package/src/lib/config/date-format.config.ts +55 -0
  459. package/src/lib/config/ds-identity.preset.ts +538 -0
  460. package/src/lib/config/ds-identity.tokens.ts +209 -0
  461. package/src/lib/config/dynamic-form.model.ts +1162 -0
  462. package/src/lib/config/povide-messages.ts +5 -0
  463. package/src/lib/config/provide-confirmation.ts +5 -0
  464. package/src/lib/config/providemt.ts +506 -0
  465. package/src/lib/config/public-api.ts +0 -0
  466. package/src/lib/pipes/mt-date-format.pipe.spec.ts +60 -0
  467. package/src/lib/pipes/mt-date-format.pipe.ts +81 -0
  468. package/src/lib/utils/api-request.helper.ts +59 -0
  469. package/src/lib/utils/clock-time.util.ts +58 -0
  470. package/src/lib/utils/color.utils.ts +187 -0
  471. package/src/lib/utils/entity-adapter.ts +50 -0
  472. package/src/lib/utils/field-id.ts +42 -0
  473. package/src/lib/utils/http-context.ts +35 -0
  474. package/src/lib/utils/inputs.ts +6 -0
  475. package/src/lib/utils/state-helpers.ts +49 -0
  476. package/src/lib/utils/theme.ts +281 -0
  477. package/src/public-api.ts +30 -0
  478. package/statistic-card/ng-package.json +6 -0
  479. package/statistic-card/public-api.ts +1 -0
  480. package/statistic-card/statistic-card.html +31 -0
  481. package/statistic-card/statistic-card.scss +0 -0
  482. package/statistic-card/statistic-card.ts +59 -0
  483. package/table/ng-package.json +7 -0
  484. package/table/public-api.ts +10 -0
  485. package/table/table-actions-menu/public-api.ts +1 -0
  486. package/table/table-actions-menu/table-actions-menu.html +75 -0
  487. package/table/table-actions-menu/table-actions-menu.ts +171 -0
  488. package/table/table-caption/public-api.ts +1 -0
  489. package/table/table-caption/table-caption.html +118 -0
  490. package/table/table-caption/table-caption.ts +221 -0
  491. package/table/table-column-filter/public-api.ts +1 -0
  492. package/table/table-column-filter/table-column-filter.html +44 -0
  493. package/table/table-column-filter/table-column-filter.ts +106 -0
  494. package/table/table-export/html-to-text.util.ts +67 -0
  495. package/table/table-export/public-api.ts +1 -0
  496. package/table/table-export/table-export.service.spec.ts +186 -0
  497. package/table/table-export/table-export.service.ts +325 -0
  498. package/table/table-filter/public-api.ts +1 -0
  499. package/table/table-filter/table-filter.css +9 -0
  500. package/table/table-filter/table-filter.html +63 -0
  501. package/table/table-filter/table-filter.ts +126 -0
  502. package/table/table-filter-field/public-api.ts +1 -0
  503. package/table/table-filter-field/table-filter-field.html +182 -0
  504. package/table/table-filter-field/table-filter-field.ts +208 -0
  505. package/table/table-grouping/public-api.ts +1 -0
  506. package/table/table-grouping/table-grouping.spec.ts +218 -0
  507. package/table/table-grouping/table-grouping.ts +237 -0
  508. package/table/table-types.ts +242 -0
  509. package/table/table-value.utils.spec.ts +63 -0
  510. package/table/table-value.utils.ts +1014 -0
  511. package/table/table.css +145 -0
  512. package/table/table.html +572 -0
  513. package/table/table.ts +2042 -0
  514. package/tabs/ng-package.json +6 -0
  515. package/tabs/public-api.ts +1 -0
  516. package/tabs/tabs.html +417 -0
  517. package/tabs/tabs.scss +3 -0
  518. package/tabs/tabs.spec.ts +79 -0
  519. package/tabs/tabs.ts +397 -0
  520. package/text-field/ng-package.json +6 -0
  521. package/text-field/public-api.ts +1 -0
  522. package/text-field/text-field.html +75 -0
  523. package/text-field/text-field.scss +56 -0
  524. package/text-field/text-field.ts +251 -0
  525. package/textarea-field/ng-package.json +6 -0
  526. package/textarea-field/public-api.ts +1 -0
  527. package/textarea-field/textarea-field.html +37 -0
  528. package/textarea-field/textarea-field.scss +0 -0
  529. package/textarea-field/textarea-field.spec.ts +21 -0
  530. package/textarea-field/textarea-field.ts +169 -0
  531. package/toast/ng-package.json +6 -0
  532. package/toast/public-api.ts +2 -0
  533. package/toast/toast.html +18 -0
  534. package/toast/toast.service.ts +67 -0
  535. package/toast/toast.ts +21 -0
  536. package/toggle-field/ng-package.json +6 -0
  537. package/toggle-field/public-api.ts +1 -0
  538. package/toggle-field/toggle-field.html +78 -0
  539. package/toggle-field/toggle-field.scss +24 -0
  540. package/toggle-field/toggle-field.ts +150 -0
  541. package/tooltip/ng-package.json +6 -0
  542. package/tooltip/public-api.ts +2 -0
  543. package/tooltip/tooltip.ts +30 -0
  544. package/tooltip/truncate-tooltip.ts +124 -0
  545. package/topbar/ng-package.json +6 -0
  546. package/topbar/public-api.ts +1 -0
  547. package/topbar/topbar.html +52 -0
  548. package/topbar/topbar.ts +27 -0
  549. package/tree/ng-package.json +6 -0
  550. package/tree/public-api.ts +2 -0
  551. package/tree/tree-types.ts +55 -0
  552. package/tree/tree.html +126 -0
  553. package/tree/tree.scss +1 -0
  554. package/tree/tree.ts +303 -0
  555. package/treeselect-field/ng-package.json +6 -0
  556. package/treeselect-field/public-api.ts +1 -0
  557. package/treeselect-field/treeselect-field.html +71 -0
  558. package/treeselect-field/treeselect-field.ts +348 -0
  559. package/tsconfig.check.json +20 -0
  560. package/tsconfig.json +16 -0
  561. package/tsconfig.spec.json +24 -0
  562. package/upload-field/ng-package.json +6 -0
  563. package/upload-field/public-api.ts +2 -0
  564. package/upload-field/secure-image.pipe.ts +258 -0
  565. package/upload-field/upload-field.html +274 -0
  566. package/upload-field/upload-field.scss +0 -0
  567. package/upload-field/upload-field.spec.ts +169 -0
  568. package/upload-field/upload-field.ts +764 -0
  569. package/upload-field/upload-file-preview/upload-file-preview.html +41 -0
  570. package/upload-field/upload-file-preview/upload-file-preview.scss +0 -0
  571. package/upload-field/upload-file-preview/upload-file-preview.ts +57 -0
  572. package/upload-field/upload-user-preview/upload-user-preview.css +0 -0
  573. package/upload-field/upload-user-preview/upload-user-preview.html +73 -0
  574. package/upload-field/upload-user-preview/upload-user-preview.ts +54 -0
  575. package/uploader/ng-package.json +6 -0
  576. package/uploader/public-api.ts +1 -0
  577. package/uploader/uploader.service.spec.ts +271 -0
  578. package/uploader/uploader.service.ts +733 -0
  579. package/user-search-field/ng-package.json +6 -0
  580. package/user-search-field/public-api.ts +1 -0
  581. package/user-search-field/user-search-field.html +88 -0
  582. package/user-search-field/user-search-field.scss +4 -0
  583. package/user-search-field/user-search-field.spec.ts +176 -0
  584. package/user-search-field/user-search-field.ts +483 -0
  585. package/fesm2022/masterteam-components-avatar-text.mjs +0 -46
  586. package/fesm2022/masterteam-components-avatar-text.mjs.map +0 -1
  587. package/fesm2022/masterteam-components-avatar.mjs +0 -50
  588. package/fesm2022/masterteam-components-avatar.mjs.map +0 -1
  589. package/fesm2022/masterteam-components-breadcrumb.mjs +0 -27
  590. package/fesm2022/masterteam-components-breadcrumb.mjs.map +0 -1
  591. package/fesm2022/masterteam-components-business-fields.mjs +0 -1902
  592. package/fesm2022/masterteam-components-business-fields.mjs.map +0 -1
  593. package/fesm2022/masterteam-components-button-group.mjs +0 -20
  594. package/fesm2022/masterteam-components-button-group.mjs.map +0 -1
  595. package/fesm2022/masterteam-components-button.mjs +0 -52
  596. package/fesm2022/masterteam-components-button.mjs.map +0 -1
  597. package/fesm2022/masterteam-components-card.mjs +0 -28
  598. package/fesm2022/masterteam-components-card.mjs.map +0 -1
  599. package/fesm2022/masterteam-components-checkbox-field.mjs +0 -88
  600. package/fesm2022/masterteam-components-checkbox-field.mjs.map +0 -1
  601. package/fesm2022/masterteam-components-chip.mjs +0 -39
  602. package/fesm2022/masterteam-components-chip.mjs.map +0 -1
  603. package/fesm2022/masterteam-components-client-page-menu.mjs +0 -152
  604. package/fesm2022/masterteam-components-client-page-menu.mjs.map +0 -1
  605. package/fesm2022/masterteam-components-client-page.mjs +0 -371
  606. package/fesm2022/masterteam-components-client-page.mjs.map +0 -1
  607. package/fesm2022/masterteam-components-color-picker-field.mjs +0 -102
  608. package/fesm2022/masterteam-components-color-picker-field.mjs.map +0 -1
  609. package/fesm2022/masterteam-components-confirmation.mjs +0 -98
  610. package/fesm2022/masterteam-components-confirmation.mjs.map +0 -1
  611. package/fesm2022/masterteam-components-date-field.mjs +0 -154
  612. package/fesm2022/masterteam-components-date-field.mjs.map +0 -1
  613. package/fesm2022/masterteam-components-dialog.mjs +0 -33
  614. package/fesm2022/masterteam-components-dialog.mjs.map +0 -1
  615. package/fesm2022/masterteam-components-drawer.mjs +0 -268
  616. package/fesm2022/masterteam-components-drawer.mjs.map +0 -1
  617. package/fesm2022/masterteam-components-dynamic-drawer.mjs +0 -608
  618. package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +0 -1
  619. package/fesm2022/masterteam-components-editor-field.mjs +0 -99
  620. package/fesm2022/masterteam-components-editor-field.mjs.map +0 -1
  621. package/fesm2022/masterteam-components-entities.mjs +0 -2033
  622. package/fesm2022/masterteam-components-entities.mjs.map +0 -1
  623. package/fesm2022/masterteam-components-field-validation.mjs +0 -158
  624. package/fesm2022/masterteam-components-field-validation.mjs.map +0 -1
  625. package/fesm2022/masterteam-components-formula.mjs +0 -3848
  626. package/fesm2022/masterteam-components-formula.mjs.map +0 -1
  627. package/fesm2022/masterteam-components-icon-field.mjs +0 -161
  628. package/fesm2022/masterteam-components-icon-field.mjs.map +0 -1
  629. package/fesm2022/masterteam-components-list.mjs +0 -31
  630. package/fesm2022/masterteam-components-list.mjs.map +0 -1
  631. package/fesm2022/masterteam-components-location-field.mjs +0 -603
  632. package/fesm2022/masterteam-components-location-field.mjs.map +0 -1
  633. package/fesm2022/masterteam-components-menu.mjs +0 -135
  634. package/fesm2022/masterteam-components-menu.mjs.map +0 -1
  635. package/fesm2022/masterteam-components-modal.mjs +0 -108
  636. package/fesm2022/masterteam-components-modal.mjs.map +0 -1
  637. package/fesm2022/masterteam-components-module-summary-card.mjs +0 -34
  638. package/fesm2022/masterteam-components-module-summary-card.mjs.map +0 -1
  639. package/fesm2022/masterteam-components-multi-select-field.mjs +0 -317
  640. package/fesm2022/masterteam-components-multi-select-field.mjs.map +0 -1
  641. package/fesm2022/masterteam-components-number-field.mjs +0 -98
  642. package/fesm2022/masterteam-components-number-field.mjs.map +0 -1
  643. package/fesm2022/masterteam-components-page-header.mjs +0 -42
  644. package/fesm2022/masterteam-components-page-header.mjs.map +0 -1
  645. package/fesm2022/masterteam-components-page.mjs +0 -35
  646. package/fesm2022/masterteam-components-page.mjs.map +0 -1
  647. package/fesm2022/masterteam-components-paginator.mjs +0 -43
  648. package/fesm2022/masterteam-components-paginator.mjs.map +0 -1
  649. package/fesm2022/masterteam-components-pick-list-field.mjs +0 -206
  650. package/fesm2022/masterteam-components-pick-list-field.mjs.map +0 -1
  651. package/fesm2022/masterteam-components-progress.mjs +0 -63
  652. package/fesm2022/masterteam-components-progress.mjs.map +0 -1
  653. package/fesm2022/masterteam-components-property-filter-builder.mjs +0 -386
  654. package/fesm2022/masterteam-components-property-filter-builder.mjs.map +0 -1
  655. package/fesm2022/masterteam-components-radio-button-field.mjs +0 -85
  656. package/fesm2022/masterteam-components-radio-button-field.mjs.map +0 -1
  657. package/fesm2022/masterteam-components-radio-cards-field.mjs +0 -126
  658. package/fesm2022/masterteam-components-radio-cards-field.mjs.map +0 -1
  659. package/fesm2022/masterteam-components-radio-cards.mjs +0 -74
  660. package/fesm2022/masterteam-components-radio-cards.mjs.map +0 -1
  661. package/fesm2022/masterteam-components-runtime-action.mjs +0 -406
  662. package/fesm2022/masterteam-components-runtime-action.mjs.map +0 -1
  663. package/fesm2022/masterteam-components-select-field.mjs +0 -411
  664. package/fesm2022/masterteam-components-select-field.mjs.map +0 -1
  665. package/fesm2022/masterteam-components-sidebar.mjs +0 -155
  666. package/fesm2022/masterteam-components-sidebar.mjs.map +0 -1
  667. package/fesm2022/masterteam-components-slider-field.mjs +0 -128
  668. package/fesm2022/masterteam-components-slider-field.mjs.map +0 -1
  669. package/fesm2022/masterteam-components-statistic-card.mjs +0 -42
  670. package/fesm2022/masterteam-components-statistic-card.mjs.map +0 -1
  671. package/fesm2022/masterteam-components-table.mjs +0 -3197
  672. package/fesm2022/masterteam-components-table.mjs.map +0 -1
  673. package/fesm2022/masterteam-components-tabs.mjs +0 -289
  674. package/fesm2022/masterteam-components-tabs.mjs.map +0 -1
  675. package/fesm2022/masterteam-components-text-field.mjs +0 -198
  676. package/fesm2022/masterteam-components-text-field.mjs.map +0 -1
  677. package/fesm2022/masterteam-components-textarea-field.mjs +0 -122
  678. package/fesm2022/masterteam-components-textarea-field.mjs.map +0 -1
  679. package/fesm2022/masterteam-components-toast.mjs +0 -80
  680. package/fesm2022/masterteam-components-toast.mjs.map +0 -1
  681. package/fesm2022/masterteam-components-toggle-field.mjs +0 -116
  682. package/fesm2022/masterteam-components-toggle-field.mjs.map +0 -1
  683. package/fesm2022/masterteam-components-tooltip.mjs +0 -147
  684. package/fesm2022/masterteam-components-tooltip.mjs.map +0 -1
  685. package/fesm2022/masterteam-components-topbar.mjs +0 -32
  686. package/fesm2022/masterteam-components-topbar.mjs.map +0 -1
  687. package/fesm2022/masterteam-components-tree.mjs +0 -260
  688. package/fesm2022/masterteam-components-tree.mjs.map +0 -1
  689. package/fesm2022/masterteam-components-treeselect-field.mjs +0 -265
  690. package/fesm2022/masterteam-components-treeselect-field.mjs.map +0 -1
  691. package/fesm2022/masterteam-components-upload-field.mjs +0 -841
  692. package/fesm2022/masterteam-components-upload-field.mjs.map +0 -1
  693. package/fesm2022/masterteam-components-uploader.mjs +0 -425
  694. package/fesm2022/masterteam-components-uploader.mjs.map +0 -1
  695. package/fesm2022/masterteam-components-user-search-field.mjs +0 -370
  696. package/fesm2022/masterteam-components-user-search-field.mjs.map +0 -1
  697. package/fesm2022/masterteam-components.mjs +0 -2334
  698. package/fesm2022/masterteam-components.mjs.map +0 -1
  699. package/types/masterteam-components-avatar-text.d.ts +0 -23
  700. package/types/masterteam-components-avatar.d.ts +0 -23
  701. package/types/masterteam-components-breadcrumb.d.ts +0 -18
  702. package/types/masterteam-components-business-fields.d.ts +0 -671
  703. package/types/masterteam-components-button-group.d.ts +0 -8
  704. package/types/masterteam-components-button.d.ts +0 -36
  705. package/types/masterteam-components-card.d.ts +0 -14
  706. package/types/masterteam-components-checkbox-field.d.ts +0 -34
  707. package/types/masterteam-components-chip.d.ts +0 -21
  708. package/types/masterteam-components-client-page-menu.d.ts +0 -55
  709. package/types/masterteam-components-client-page.d.ts +0 -109
  710. package/types/masterteam-components-color-picker-field.d.ts +0 -35
  711. package/types/masterteam-components-confirmation.d.ts +0 -41
  712. package/types/masterteam-components-date-field.d.ts +0 -53
  713. package/types/masterteam-components-dialog.d.ts +0 -12
  714. package/types/masterteam-components-drawer.d.ts +0 -62
  715. package/types/masterteam-components-dynamic-drawer.d.ts +0 -159
  716. package/types/masterteam-components-editor-field.d.ts +0 -35
  717. package/types/masterteam-components-entities.d.ts +0 -1030
  718. package/types/masterteam-components-field-validation.d.ts +0 -23
  719. package/types/masterteam-components-formula.d.ts +0 -759
  720. package/types/masterteam-components-icon-field.d.ts +0 -40
  721. package/types/masterteam-components-list.d.ts +0 -18
  722. package/types/masterteam-components-location-field.d.ts +0 -169
  723. package/types/masterteam-components-menu.d.ts +0 -55
  724. package/types/masterteam-components-modal.d.ts +0 -30
  725. package/types/masterteam-components-module-summary-card.d.ts +0 -18
  726. package/types/masterteam-components-multi-select-field.d.ts +0 -100
  727. package/types/masterteam-components-number-field.d.ts +0 -43
  728. package/types/masterteam-components-page-header.d.ts +0 -30
  729. package/types/masterteam-components-page.d.ts +0 -26
  730. package/types/masterteam-components-paginator.d.ts +0 -20
  731. package/types/masterteam-components-pick-list-field.d.ts +0 -61
  732. package/types/masterteam-components-progress.d.ts +0 -30
  733. package/types/masterteam-components-property-filter-builder.d.ts +0 -90
  734. package/types/masterteam-components-radio-button-field.d.ts +0 -41
  735. package/types/masterteam-components-radio-cards-field.d.ts +0 -35
  736. package/types/masterteam-components-radio-cards.d.ts +0 -33
  737. package/types/masterteam-components-runtime-action.d.ts +0 -105
  738. package/types/masterteam-components-select-field.d.ts +0 -132
  739. package/types/masterteam-components-sidebar.d.ts +0 -71
  740. package/types/masterteam-components-slider-field.d.ts +0 -41
  741. package/types/masterteam-components-statistic-card.d.ts +0 -28
  742. package/types/masterteam-components-table.d.ts +0 -827
  743. package/types/masterteam-components-tabs.d.ts +0 -80
  744. package/types/masterteam-components-text-field.d.ts +0 -56
  745. package/types/masterteam-components-textarea-field.d.ts +0 -41
  746. package/types/masterteam-components-toast.d.ts +0 -27
  747. package/types/masterteam-components-toggle-field.d.ts +0 -44
  748. package/types/masterteam-components-tooltip.d.ts +0 -26
  749. package/types/masterteam-components-topbar.d.ts +0 -20
  750. package/types/masterteam-components-tree.d.ts +0 -106
  751. package/types/masterteam-components-treeselect-field.d.ts +0 -79
  752. package/types/masterteam-components-upload-field.d.ts +0 -108
  753. package/types/masterteam-components-uploader.d.ts +0 -53
  754. package/types/masterteam-components-user-search-field.d.ts +0 -106
  755. package/types/masterteam-components.d.ts +0 -1181
@@ -1,3197 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, output, viewChild, computed, signal, ChangeDetectionStrategy, Component, model, inject, DestroyRef, forwardRef, Injectable, contentChild, effect } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import { Card } from '@masterteam/components/card';
5
- import * as i1$1 from '@angular/forms';
6
- import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
7
- import * as i2 from '@jsverse/transloco';
8
- import { TranslocoModule, TranslocoService } from '@jsverse/transloco';
9
- import { Button } from '@masterteam/components/button';
10
- import { Tabs } from '@masterteam/components/tabs';
11
- import { TextField } from '@masterteam/components/text-field';
12
- import { Avatar } from '@masterteam/components/avatar';
13
- import { Icon } from '@masterteam/icons';
14
- import * as i1 from 'primeng/tieredmenu';
15
- import { TieredMenuModule } from 'primeng/tieredmenu';
16
- import * as i1$2 from 'primeng/popover';
17
- import { PopoverModule } from 'primeng/popover';
18
- import { parseClockTime, clockTimeToSeconds, toClockTimeParts, MTDateFormatPipe } from '@masterteam/components';
19
- import { DateField } from '@masterteam/components/date-field';
20
- import { NumberField } from '@masterteam/components/number-field';
21
- import { MultiSelectField } from '@masterteam/components/multi-select-field';
22
- import { SelectField } from '@masterteam/components/select-field';
23
- import { TreeSelectField } from '@masterteam/components/treeselect-field';
24
- import { UserSearchField } from '@masterteam/components/user-search-field';
25
- import * as XLSX from 'xlsx';
26
- import { ToggleField } from '@masterteam/components/toggle-field';
27
- import { Paginator } from '@masterteam/components/paginator';
28
- import { CheckboxField } from '@masterteam/components/checkbox-field';
29
- import * as i1$3 from 'primeng/table';
30
- import { TableModule } from 'primeng/table';
31
- import * as i3 from 'primeng/skeleton';
32
- import { SkeletonModule } from 'primeng/skeleton';
33
- import * as i4 from 'primeng/progressbar';
34
- import { ProgressBarModule } from 'primeng/progressbar';
35
- import { ConfirmationService } from '@masterteam/components/confirmation';
36
- import { EntityPreview } from '@masterteam/components/entities';
37
-
38
- /**
39
- * Up to this many actions render as their own buttons instead of hiding behind
40
- * the `⋯`. Export / print / group-by is exactly three, so the common table
41
- * shows them all at a glance; anything richer keeps the menu rather than
42
- * crowding the caption.
43
- */
44
- const FLAT_ACTION_LIMIT = 3;
45
- /**
46
- * Top-right `⋯` menu. Uses PrimeNG TieredMenu (popup mode) so submenu
47
- * cascading, keyboard navigation, and outside-click-to-close come for free.
48
- * Item rendering is overridden via the `#item` template so each row shows
49
- * either a flat tone chip (main actions) or an `mt-avatar` (column picker).
50
- */
51
- class TableActionsMenu {
52
- exportable = input(false, { ...(ngDevMode ? { debugName: "exportable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
53
- printable = input(false, { ...(ngDevMode ? { debugName: "printable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
54
- groupable = input(false, { ...(ngDevMode ? { debugName: "groupable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
55
- groupColumns = input([], ...(ngDevMode ? [{ debugName: "groupColumns" }] : /* istanbul ignore next */ []));
56
- activeGroup = input(null, ...(ngDevMode ? [{ debugName: "activeGroup" }] : /* istanbul ignore next */ []));
57
- exportRequested = output();
58
- printRequested = output();
59
- groupChange = output();
60
- menu = viewChild('menu', ...(ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []));
61
- /** Tailwind classes for flat tone chips, keyed by `iconTone`. */
62
- toneClass = {
63
- emerald: 'bg-emerald-50 text-emerald-700',
64
- sky: 'bg-sky-50 text-sky-700',
65
- indigo: 'bg-indigo-50 text-indigo-700',
66
- secondary: 'bg-gray-100 text-gray-700',
67
- };
68
- items = computed(() => {
69
- const items = [];
70
- if (this.exportable()) {
71
- items.push({
72
- labelKey: 'components.table.exportExcel',
73
- iconKey: 'file.file-download-02',
74
- iconTone: 'emerald',
75
- command: () => this.exportRequested.emit(),
76
- });
77
- }
78
- if (this.printable()) {
79
- items.push({
80
- labelKey: 'components.table.printPdf',
81
- iconKey: 'media.printer',
82
- iconTone: 'sky',
83
- command: () => this.printRequested.emit(),
84
- });
85
- }
86
- if (this.groupable()) {
87
- const activeKey = this.activeGroup();
88
- const activeLabel = this.groupColumns().find((c) => c.key === activeKey)?.label ??
89
- activeKey ??
90
- null;
91
- items.push({
92
- labelKey: 'components.table.groupBy',
93
- iconKey: 'layout.columns-03',
94
- iconTone: 'indigo',
95
- badge: activeLabel ?? undefined,
96
- items: [
97
- {
98
- labelKey: 'components.table.noGrouping',
99
- iconKey: 'general.x-close',
100
- iconTone: 'secondary',
101
- useAvatar: true,
102
- selected: !activeKey,
103
- command: () => this.groupChange.emit(null),
104
- },
105
- ...this.groupColumns().map((col) => ({
106
- rawLabel: col.label,
107
- iconKey: 'layout.columns-03',
108
- iconTone: 'secondary',
109
- useAvatar: true,
110
- selected: activeKey === col.key,
111
- command: () => this.groupChange.emit(col.key),
112
- })),
113
- ],
114
- });
115
- }
116
- return items;
117
- }, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
118
- /** True while the actions render as individual buttons. */
119
- isFlat = computed(() => this.items().length > 0 && this.items().length <= FLAT_ACTION_LIMIT, ...(ngDevMode ? [{ debugName: "isFlat" }] : /* istanbul ignore next */ []));
120
- /**
121
- * What the popup renders. In `⋯` mode that's the whole action list; in flat
122
- * mode the buttons *are* the top level, so the popup only ever shows the
123
- * children of the button that opened it (the group-by column list).
124
- */
125
- openSubmenu = signal(null, ...(ngDevMode ? [{ debugName: "openSubmenu" }] : /* istanbul ignore next */ []));
126
- menuModel = computed(() => this.openSubmenu() ?? this.items(), ...(ngDevMode ? [{ debugName: "menuModel" }] : /* istanbul ignore next */ []));
127
- toggle(event) {
128
- this.openSubmenu.set(null);
129
- this.menu()?.toggle(event);
130
- }
131
- /** Flat-mode click: run a leaf action, or open a parent's submenu. */
132
- activate(event, item) {
133
- const children = item.items;
134
- if (!children?.length) {
135
- item.command?.({});
136
- return;
137
- }
138
- this.openSubmenu.set(children);
139
- this.menu()?.toggle(event);
140
- }
141
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableActionsMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
142
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableActionsMenu, isStandalone: true, selector: "mt-table-actions-menu", inputs: { exportable: { classPropertyName: "exportable", publicName: "exportable", isSignal: true, isRequired: false, transformFunction: null }, printable: { classPropertyName: "printable", publicName: "printable", isSignal: true, isRequired: false, transformFunction: null }, groupable: { classPropertyName: "groupable", publicName: "groupable", isSignal: true, isRequired: false, transformFunction: null }, groupColumns: { classPropertyName: "groupColumns", publicName: "groupColumns", isSignal: true, isRequired: false, transformFunction: null }, activeGroup: { classPropertyName: "activeGroup", publicName: "activeGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { exportRequested: "exportRequested", printRequested: "printRequested", groupChange: "groupChange" }, host: { classAttribute: "flex items-center gap-2" }, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isFlat()) {\r\n @for (item of items(); track item.labelKey ?? item.rawLabel) {\r\n <mt-button\r\n (click)=\"activate($event, item)\"\r\n [icon]=\"item.iconKey\"\r\n [label]=\"item.badge\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [tooltip]=\"\r\n item.labelKey ? (item.labelKey | transloco) : (item.rawLabel ?? '')\r\n \"\r\n />\r\n }\r\n} @else {\r\n <mt-button\r\n (click)=\"toggle($event)\"\r\n icon=\"general.dots-horizontal\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [tooltip]=\"'components.table.actions' | transloco\"\r\n />\r\n}\r\n\r\n<p-tieredMenu\r\n #menu\r\n [model]=\"menuModel()\"\r\n [popup]=\"true\"\r\n appendTo=\"body\"\r\n styleClass=\"mt-table-actions-menu\"\r\n>\r\n <ng-template #item let-item let-hasSubmenu=\"hasSubmenu\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-center gap-2.5 w-full px-2.5 py-2 text-sm cursor-pointer text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-surface-700 transition-colors\"\r\n [class.bg-primary-50]=\"item.selected\"\r\n [class.dark:bg-primary-950]=\"item.selected\"\r\n [class.text-primary-700]=\"item.selected\"\r\n >\r\n @if (item.iconKey) {\r\n @if (item.useAvatar) {\r\n <mt-avatar [icon]=\"item.iconKey\" shape=\"circle\" />\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center justify-center w-7 h-7 rounded-full shrink-0\"\r\n [class]=\"toneClass[item.iconTone ?? 'secondary']\"\r\n >\r\n <mt-icon [icon]=\"item.iconKey\" class=\"text-sm\" />\r\n </span>\r\n }\r\n }\r\n <span class=\"flex-1 text-start truncate\">\r\n @if (item.labelKey) {\r\n {{ item.labelKey | transloco }}\r\n } @else {\r\n {{ item.rawLabel }}\r\n }\r\n </span>\r\n @if (item.badge) {\r\n <span\r\n class=\"text-xs px-1.5 py-0.5 rounded-full bg-primary-50 text-primary-700 dark:bg-primary-950 dark:text-primary-300 shrink-0\"\r\n >\r\n {{ item.badge }}\r\n </span>\r\n }\r\n @if (hasSubmenu) {\r\n <mt-icon\r\n icon=\"arrow.chevron-right\"\r\n class=\"text-xs text-gray-400 shrink-0\"\r\n />\r\n }\r\n </button>\r\n </ng-template>\r\n</p-tieredMenu>\r\n", dependencies: [{ kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "ngmodule", type: TieredMenuModule }, { kind: "component", type: i1.TieredMenu, selector: "p-tieredMenu, p-tieredmenu, p-tiered-menu", inputs: ["model", "popup", "style", "styleClass", "breakpoint", "autoZIndex", "baseZIndex", "autoDisplay", "showTransitionOptions", "hideTransitionOptions", "id", "ariaLabel", "ariaLabelledBy", "disabled", "tabindex", "appendTo", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
143
- }
144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableActionsMenu, decorators: [{
145
- type: Component,
146
- args: [{ selector: 'mt-table-actions-menu', standalone: true, imports: [Avatar, Button, Icon, TieredMenuModule, TranslocoModule], host: { class: 'flex items-center gap-2' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (isFlat()) {\r\n @for (item of items(); track item.labelKey ?? item.rawLabel) {\r\n <mt-button\r\n (click)=\"activate($event, item)\"\r\n [icon]=\"item.iconKey\"\r\n [label]=\"item.badge\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [tooltip]=\"\r\n item.labelKey ? (item.labelKey | transloco) : (item.rawLabel ?? '')\r\n \"\r\n />\r\n }\r\n} @else {\r\n <mt-button\r\n (click)=\"toggle($event)\"\r\n icon=\"general.dots-horizontal\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [tooltip]=\"'components.table.actions' | transloco\"\r\n />\r\n}\r\n\r\n<p-tieredMenu\r\n #menu\r\n [model]=\"menuModel()\"\r\n [popup]=\"true\"\r\n appendTo=\"body\"\r\n styleClass=\"mt-table-actions-menu\"\r\n>\r\n <ng-template #item let-item let-hasSubmenu=\"hasSubmenu\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-center gap-2.5 w-full px-2.5 py-2 text-sm cursor-pointer text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-surface-700 transition-colors\"\r\n [class.bg-primary-50]=\"item.selected\"\r\n [class.dark:bg-primary-950]=\"item.selected\"\r\n [class.text-primary-700]=\"item.selected\"\r\n >\r\n @if (item.iconKey) {\r\n @if (item.useAvatar) {\r\n <mt-avatar [icon]=\"item.iconKey\" shape=\"circle\" />\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center justify-center w-7 h-7 rounded-full shrink-0\"\r\n [class]=\"toneClass[item.iconTone ?? 'secondary']\"\r\n >\r\n <mt-icon [icon]=\"item.iconKey\" class=\"text-sm\" />\r\n </span>\r\n }\r\n }\r\n <span class=\"flex-1 text-start truncate\">\r\n @if (item.labelKey) {\r\n {{ item.labelKey | transloco }}\r\n } @else {\r\n {{ item.rawLabel }}\r\n }\r\n </span>\r\n @if (item.badge) {\r\n <span\r\n class=\"text-xs px-1.5 py-0.5 rounded-full bg-primary-50 text-primary-700 dark:bg-primary-950 dark:text-primary-300 shrink-0\"\r\n >\r\n {{ item.badge }}\r\n </span>\r\n }\r\n @if (hasSubmenu) {\r\n <mt-icon\r\n icon=\"arrow.chevron-right\"\r\n class=\"text-xs text-gray-400 shrink-0\"\r\n />\r\n }\r\n </button>\r\n </ng-template>\r\n</p-tieredMenu>\r\n" }]
147
- }], propDecorators: { exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], printable: [{ type: i0.Input, args: [{ isSignal: true, alias: "printable", required: false }] }], groupable: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupable", required: false }] }], groupColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupColumns", required: false }] }], activeGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeGroup", required: false }] }], exportRequested: [{ type: i0.Output, args: ["exportRequested"] }], printRequested: [{ type: i0.Output, args: ["printRequested"] }], groupChange: [{ type: i0.Output, args: ["groupChange"] }], menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }] } });
148
-
149
- class TableValueResolver {
150
- /**
151
- * View types the table knows how to filter/sort/export. Deliberately a
152
- * subset of `EntityViewType` — the richer ones (`Location`, `Connection`,
153
- * `LookupModuleCheckList`, `LeafDetails`) have no scalar the table could
154
- * compare, so they stay out and simply render. Anything listed here also
155
- * needs a branch in `getColumnFilterType` and `getEntityValueByType`.
156
- */
157
- static ALL_ENTITY_VIEW_TYPES = [
158
- 'Text',
159
- 'LongText',
160
- 'Date',
161
- 'DateTime',
162
- 'Time',
163
- 'Number',
164
- 'Percentage',
165
- 'Status',
166
- 'Currency',
167
- 'Checkbox',
168
- 'User',
169
- 'MultiUser',
170
- 'Lookup',
171
- 'LookupMatrix',
172
- 'PhaseGate',
173
- 'Attachment',
174
- ];
175
- static UNSORTABLE_ENTITY_VIEW_TYPES = new Set(['Attachment', 'Checkbox']);
176
- static EXPORTABLE_ENTITY_VIEW_TYPES = new Set([
177
- 'Text',
178
- 'LongText',
179
- 'Date',
180
- 'DateTime',
181
- 'Time',
182
- 'Number',
183
- 'Percentage',
184
- 'Status',
185
- 'Currency',
186
- 'Checkbox',
187
- 'User',
188
- 'MultiUser',
189
- 'Lookup',
190
- 'LookupMatrix',
191
- 'PhaseGate',
192
- ]);
193
- /**
194
- * `Time` is sortable and exportable but not filterable: a time-of-day has no
195
- * meaningful date-range filter, and a date picker cannot express one — it
196
- * would silently filter by day instead of by clock time.
197
- */
198
- static FILTERABLE_ENTITY_VIEW_TYPES = new Set(TableValueResolver.ALL_ENTITY_VIEW_TYPES.filter((viewType) => viewType !== 'Attachment' &&
199
- viewType !== 'Time' &&
200
- viewType !== 'MultiUser'));
201
- /**
202
- * Sentinel `key` value that resolves to the whole row instead of a property
203
- * path. Use it when a cell renderer (e.g. `type: 'user'`) needs the full
204
- * record, not a single field — `key: '{{record}}'` in the column def.
205
- */
206
- static RECORD_KEY = '{{record}}';
207
- static getProperty(obj, key) {
208
- if (key === TableValueResolver.RECORD_KEY) {
209
- return obj;
210
- }
211
- return key.split('.').reduce((current, segment) => {
212
- if (!current || typeof current !== 'object') {
213
- return undefined;
214
- }
215
- return current[segment];
216
- }, obj);
217
- }
218
- /**
219
- * Recursively scans `value` for any string field that contains `searchTerm`.
220
- * Used by the general-search box so nested displays (e.g. `name.display` on a
221
- * lookup row, where the row's top-level `name` is an object) are still
222
- * matched. `searchTerm` is expected to be lowercase.
223
- */
224
- static matchesSearchTerm(value, searchTerm, depth = 0) {
225
- if (value === null || value === undefined) {
226
- return false;
227
- }
228
- if (typeof value === 'string') {
229
- return value.toLowerCase().includes(searchTerm);
230
- }
231
- if (depth >= 4) {
232
- return false;
233
- }
234
- if (Array.isArray(value)) {
235
- return value.some((entry) => TableValueResolver.matchesSearchTerm(entry, searchTerm, depth + 1));
236
- }
237
- if (typeof value === 'object') {
238
- return Object.values(value).some((entry) => TableValueResolver.matchesSearchTerm(entry, searchTerm, depth + 1));
239
- }
240
- return false;
241
- }
242
- static getColumnFilterType(column, row) {
243
- if (column.filterConfig?.type) {
244
- return column.filterConfig.type;
245
- }
246
- if (column.type === 'date' || column.type === 'dateTime') {
247
- return 'date';
248
- }
249
- if (column.type === 'number') {
250
- return 'numberRange';
251
- }
252
- if (column.type === 'boolean') {
253
- return 'boolean';
254
- }
255
- if (column.type === 'user') {
256
- return 'user';
257
- }
258
- if (column.type === 'status') {
259
- return 'select';
260
- }
261
- if (column.type !== 'entity') {
262
- return null;
263
- }
264
- const viewType = TableValueResolver.getEntityViewType(column, row);
265
- if (!viewType ||
266
- !TableValueResolver.FILTERABLE_ENTITY_VIEW_TYPES.has(viewType)) {
267
- return null;
268
- }
269
- switch (viewType) {
270
- case 'Date':
271
- case 'DateTime':
272
- return 'date';
273
- case 'Checkbox':
274
- return 'boolean';
275
- case 'Status':
276
- case 'Lookup':
277
- case 'LookupMatrix':
278
- case 'PhaseGate':
279
- return 'select';
280
- case 'User':
281
- return 'userSelect';
282
- case 'Percentage':
283
- case 'Number':
284
- return 'numberRange';
285
- case 'Text':
286
- case 'LongText':
287
- case 'Currency':
288
- default:
289
- return 'text';
290
- }
291
- }
292
- /**
293
- * Returns a column with its filterConfig normalized for rendering:
294
- * - `type` is resolved via `getColumnFilterType`
295
- * - `options` for `select` filters are auto-generated from `data` when not provided
296
- *
297
- * Used by both popover and per-column filter modes so option-building stays in one place.
298
- */
299
- static buildFilterableColumn(column, data) {
300
- const sampleRow = data[0];
301
- const filterType = TableValueResolver.getColumnFilterType(column, sampleRow);
302
- if ((filterType === 'select' || filterType === 'userSelect') &&
303
- !column.filterConfig?.options?.length) {
304
- const uniqueOptions = Array.from(data.reduce((options, row) => {
305
- const value = TableValueResolver.getColumnFilterValue(row, column);
306
- if (value === null || value === undefined || value === '') {
307
- return options;
308
- }
309
- const optionKey = `${typeof value}:${String(value)}`;
310
- if (!options.has(optionKey)) {
311
- options.set(optionKey, {
312
- label: String(value),
313
- value,
314
- });
315
- }
316
- return options;
317
- }, new Map()))
318
- .map(([, option]) => option)
319
- .sort((a, b) => a.label.localeCompare(b.label));
320
- return {
321
- ...column,
322
- filterConfig: {
323
- ...column.filterConfig,
324
- type: filterType,
325
- options: uniqueOptions,
326
- },
327
- };
328
- }
329
- return {
330
- ...column,
331
- filterConfig: {
332
- ...column.filterConfig,
333
- type: filterType ?? column.filterConfig?.type ?? 'text',
334
- },
335
- };
336
- }
337
- /**
338
- * Returns true when `item` passes the filter for `key`. Pure function — callers
339
- * pass `column` so the resolver can apply type-aware normalisation (entity,
340
- * status, user, date, boolean). Shared by `mt-table` row-filtering and
341
- * `client-list-cards-view` card-filtering.
342
- */
343
- static matchesFilter(item, key, filterValue, column) {
344
- if (filterValue === null ||
345
- filterValue === undefined ||
346
- filterValue === '' ||
347
- (typeof filterValue === 'string' && filterValue.trim() === '')) {
348
- return true;
349
- }
350
- if (Array.isArray(filterValue)) {
351
- if (filterValue.length === 0)
352
- return true;
353
- return filterValue.some((entry) => TableValueResolver.matchesFilter(item, key, entry, column));
354
- }
355
- const itemValue = TableValueResolver.getProperty(item, key);
356
- const normalizedFilterValue = column
357
- ? TableValueResolver.getColumnFilterValue(item, column)
358
- : TableValueResolver.resolveDisplayValue(itemValue);
359
- const filterType = column
360
- ? TableValueResolver.getColumnFilterType(column, item)
361
- : null;
362
- if (typeof filterValue === 'object' && filterValue !== null) {
363
- const objectFilter = filterValue;
364
- if (filterType === 'numberRange' &&
365
- (objectFilter.from != null || objectFilter.to != null)) {
366
- const itemNumericValue = column?.type === 'entity'
367
- ? TableValueResolver.normalizeNumericSortValue(itemValue
368
- ?.rawValue ??
369
- itemValue?.value ??
370
- itemValue)
371
- : TableValueResolver.normalizeNumericSortValue(itemValue);
372
- if (itemNumericValue === null) {
373
- return true;
374
- }
375
- const fromNumeric = objectFilter.from != null ? Number(objectFilter.from) : null;
376
- const toNumeric = objectFilter.to != null ? Number(objectFilter.to) : null;
377
- if (fromNumeric !== null &&
378
- !Number.isNaN(fromNumeric) &&
379
- itemNumericValue < fromNumeric) {
380
- return false;
381
- }
382
- if (toNumeric !== null &&
383
- !Number.isNaN(toNumeric) &&
384
- itemNumericValue > toNumeric) {
385
- return false;
386
- }
387
- return true;
388
- }
389
- if (objectFilter.from || objectFilter.to) {
390
- const itemDateValue = filterType === 'date'
391
- ? typeof normalizedFilterValue === 'number'
392
- ? normalizedFilterValue
393
- : normalizedFilterValue != null && normalizedFilterValue !== ''
394
- ? new Date(String(normalizedFilterValue)).getTime()
395
- : null
396
- : itemValue instanceof Date
397
- ? itemValue.getTime()
398
- : new Date(String(itemValue)).getTime();
399
- if (itemDateValue === null ||
400
- itemDateValue === undefined ||
401
- Number.isNaN(itemDateValue)) {
402
- return true;
403
- }
404
- if (objectFilter.from &&
405
- itemDateValue < new Date(objectFilter.from).getTime()) {
406
- return false;
407
- }
408
- if (objectFilter.to) {
409
- const toDate = new Date(objectFilter.to);
410
- toDate.setHours(23, 59, 59, 999);
411
- if (itemDateValue > toDate.getTime()) {
412
- return false;
413
- }
414
- }
415
- return true;
416
- }
417
- if (objectFilter.userName) {
418
- const normalizedItemUser = itemValue;
419
- if (!normalizedItemUser)
420
- return false;
421
- return (normalizedItemUser['id'] === objectFilter.id ||
422
- normalizedItemUser['userName'] === objectFilter.userName ||
423
- normalizedItemUser['displayName'] === objectFilter.displayName);
424
- }
425
- if (filterType === 'treeSelect') {
426
- const filterLabel = TableValueResolver.resolveTreeFilterLabel(filterValue);
427
- if (!filterLabel) {
428
- return true;
429
- }
430
- const itemLabel = normalizedFilterValue ??
431
- TableValueResolver.resolveTreeFilterLabel(itemValue);
432
- return itemLabel === null || itemLabel === undefined
433
- ? false
434
- : String(itemLabel).toLowerCase().includes(filterLabel.toLowerCase());
435
- }
436
- }
437
- if (typeof filterValue === 'boolean') {
438
- return normalizedFilterValue === filterValue;
439
- }
440
- if (filterType === 'select' || filterType === 'userSelect') {
441
- return (String(normalizedFilterValue).toLowerCase() ===
442
- String(filterValue).trim().toLowerCase());
443
- }
444
- if (typeof normalizedFilterValue === 'string' ||
445
- typeof normalizedFilterValue === 'number') {
446
- // Trim the query so " john " matches "john smith"; the whitespace-only
447
- // case already short-circuited via the guard above.
448
- return String(normalizedFilterValue)
449
- .toLowerCase()
450
- .includes(String(filterValue).trim().toLowerCase());
451
- }
452
- return normalizedFilterValue === filterValue;
453
- }
454
- /**
455
- * Applies every entry of `filters` against `item` — used by cards view and
456
- * anywhere else that consumes the same filter shape as mt-table.
457
- */
458
- static matchesAllFilters(item, filters, columns) {
459
- return Object.keys(filters).every((key) => {
460
- if (key === 'generalSearch')
461
- return true;
462
- const column = columns.find((col) => col.key === key);
463
- return TableValueResolver.matchesFilter(item, key, filters[key], column);
464
- });
465
- }
466
- /**
467
- * True when a filter slot holds a meaningful value (scalar, text, date-range bounds,
468
- * or user lookup). Shared by popover and per-column modes to compute active counts.
469
- */
470
- static hasFilterValue(value) {
471
- if (value === null || value === undefined || value === '') {
472
- return false;
473
- }
474
- // A whitespace-only text filter is not a real value — keeps it out of the
475
- // active-filter count and makes the column-filter Apply clear instead of
476
- // committing " ".
477
- if (typeof value === 'string') {
478
- return value.trim().length > 0;
479
- }
480
- if (Array.isArray(value)) {
481
- return value.length > 0;
482
- }
483
- if (typeof value === 'object') {
484
- const filterValue = value;
485
- return (filterValue.from != null ||
486
- filterValue.to != null ||
487
- filterValue.value != null ||
488
- filterValue.userName != null ||
489
- filterValue.id != null ||
490
- filterValue.key != null ||
491
- filterValue.label != null ||
492
- filterValue.data != null);
493
- }
494
- return true;
495
- }
496
- /**
497
- * Produces the filter payload a cell-click should apply for `column`.
498
- * Returns null when the cell type is not click-filterable.
499
- *
500
- * Shapes match `Table.matchesFilter` branches:
501
- * - user / entity(User) → `{ id, userName, displayName }`
502
- * - status / entity(Status|Lookup) → scalar display string
503
- * - boolean → boolean
504
- */
505
- static buildClickFilterValue(row, column) {
506
- const cellValue = TableValueResolver.getProperty(row, column.key);
507
- if (cellValue === null || cellValue === undefined || cellValue === '') {
508
- return null;
509
- }
510
- const filterType = TableValueResolver.getColumnFilterType(column, row);
511
- if (column.type === 'user' || filterType === 'user') {
512
- // Entity(User) envelopes store the user object under `.value`; plain user
513
- // columns may hold it directly. Both paths produce the {id,userName,displayName} shape.
514
- const source = column.type === 'entity' &&
515
- cellValue &&
516
- typeof cellValue === 'object' &&
517
- 'value' in cellValue
518
- ? cellValue['value']
519
- : cellValue;
520
- return TableValueResolver.extractUserFilterValue(source);
521
- }
522
- // Entity-typed columns carry a `{ viewType, value, rawValue, ... }` envelope.
523
- // Unwrap once so boolean / scalar branches below operate on the inner value,
524
- // matching what `matchesFilter` -> `getColumnFilterValue` compares against.
525
- const normalized = column.type === 'entity'
526
- ? TableValueResolver.getEntityValueByType(cellValue, 'filter')
527
- : cellValue;
528
- if (normalized === null || normalized === undefined || normalized === '') {
529
- return null;
530
- }
531
- if (filterType === 'boolean') {
532
- return TableValueResolver.resolveBooleanValue(normalized);
533
- }
534
- if (filterType === 'select' ||
535
- filterType === 'userSelect' ||
536
- filterType === 'text') {
537
- if (column.type === 'entity') {
538
- return String(normalized);
539
- }
540
- const display = TableValueResolver.resolveDisplayValue(cellValue);
541
- return display === null ? null : String(display);
542
- }
543
- return null;
544
- }
545
- /**
546
- * True when two filter values refer to the same thing. Mirrors the branches
547
- * in `Table.matchesFilter`: scalar equality, boolean equality, or user-object
548
- * identity on id / userName / displayName.
549
- */
550
- static isFilterValueEqual(a, b) {
551
- if (a === b)
552
- return true;
553
- if (a === null || a === undefined || b === null || b === undefined) {
554
- return false;
555
- }
556
- if (typeof a === 'object' && typeof b === 'object') {
557
- const left = a;
558
- const right = b;
559
- if (left['id'] != null && left['id'] === right['id'])
560
- return true;
561
- if (left['key'] != null && left['key'] === right['key'])
562
- return true;
563
- if (left['userName'] != null && left['userName'] === right['userName']) {
564
- return true;
565
- }
566
- if (left['displayName'] != null &&
567
- left['displayName'] === right['displayName']) {
568
- return true;
569
- }
570
- return false;
571
- }
572
- return String(a) === String(b);
573
- }
574
- static extractUserFilterValue(value) {
575
- if (value === null || value === undefined)
576
- return null;
577
- if (typeof value === 'object') {
578
- const record = value;
579
- const inner = record['value'] && typeof record['value'] === 'object'
580
- ? record['value']
581
- : record;
582
- const id = inner['id'];
583
- const userName = inner['userName'] ?? inner['username'];
584
- const displayName = inner['displayName'] ?? inner['name'];
585
- if (id == null && userName == null && displayName == null) {
586
- const fallback = TableValueResolver.resolveDisplayValue(value);
587
- return fallback === null ? null : String(fallback);
588
- }
589
- return {
590
- ...(id != null ? { id } : {}),
591
- ...(userName != null ? { userName } : {}),
592
- ...(displayName != null ? { displayName } : {}),
593
- };
594
- }
595
- return String(value);
596
- }
597
- static getColumnFilterValue(row, column) {
598
- const cellValue = TableValueResolver.getProperty(row, column.key);
599
- if (cellValue === null || cellValue === undefined) {
600
- return null;
601
- }
602
- if (column.type === 'entity') {
603
- const filterType = TableValueResolver.getColumnFilterType(column, row);
604
- if (filterType === 'date') {
605
- return TableValueResolver.getEntityValueByType(cellValue, 'sort');
606
- }
607
- return TableValueResolver.getEntityValueByType(cellValue, 'filter');
608
- }
609
- if (column.type === 'date' || column.type === 'dateTime') {
610
- return TableValueResolver.normalizeDateSortValue(cellValue);
611
- }
612
- if (column.type === 'number') {
613
- return TableValueResolver.normalizeNumericSortValue(cellValue);
614
- }
615
- if (column.type === 'boolean') {
616
- return TableValueResolver.resolveBooleanValue(cellValue);
617
- }
618
- return TableValueResolver.resolveDisplayValue(cellValue);
619
- }
620
- static resolveDateValue(value) {
621
- if (value === null || value === undefined || value === '') {
622
- return null;
623
- }
624
- if (typeof value === 'string' ||
625
- typeof value === 'number' ||
626
- value instanceof Date) {
627
- return value;
628
- }
629
- if (typeof value === 'object') {
630
- const objectValue = value;
631
- return TableValueResolver.resolveDateValue(objectValue['actualValue'] ??
632
- objectValue['rawValue'] ??
633
- objectValue['value'] ??
634
- objectValue['displayValue']);
635
- }
636
- return String(value);
637
- }
638
- static getEntityValueByType(value, usage) {
639
- if (value === null || value === undefined) {
640
- return null;
641
- }
642
- if (typeof value !== 'object') {
643
- return TableValueResolver.resolveDisplayValue(value);
644
- }
645
- const entityData = value;
646
- // ChangeRequest snapshot cells carry a frozen old→new comparison. On screen
647
- // the cell renders the "after" side (see EntityPreview/ComparisonValue), so
648
- // export/sort/filter must resolve that same new value — not `entityData.value`,
649
- // which is the pre-change base and would export identically for every row.
650
- if (entityData.comparison?.kind === 'Value') {
651
- const after = entityData.comparison.newValue;
652
- return TableValueResolver.getEntityValueByType({
653
- ...entityData,
654
- value: (after.display ?? after.value ?? ''),
655
- comparison: undefined,
656
- }, usage);
657
- }
658
- if (usage === 'sort' &&
659
- TableValueResolver.UNSORTABLE_ENTITY_VIEW_TYPES.has(entityData.viewType)) {
660
- return null;
661
- }
662
- if (usage === 'export' &&
663
- !TableValueResolver.EXPORTABLE_ENTITY_VIEW_TYPES.has(entityData.viewType)) {
664
- return TableValueResolver.resolveDisplayValue(entityData.value);
665
- }
666
- switch (entityData.viewType) {
667
- case 'Currency':
668
- case 'Percentage':
669
- case 'Number':
670
- return usage === 'sort'
671
- ? TableValueResolver.normalizeNumericSortValue(entityData.rawValue ?? entityData.value)
672
- : TableValueResolver.resolveDisplayValue(entityData.value);
673
- case 'Date':
674
- case 'DateTime':
675
- return usage === 'sort'
676
- ? TableValueResolver.normalizeDateSortValue(entityData.rawValue ?? entityData.value)
677
- : TableValueResolver.resolveDisplayValue(entityData.value);
678
- // `Time` sorts by clock, not by instant — a time of day has no calendar
679
- // date to order by. Its export runs through `mtDateFormat` in the
680
- // table/cards date path, not here, because the backend `value` for a Time
681
- // property is the unformatted stored value.
682
- case 'Time':
683
- return usage === 'sort'
684
- ? TableValueResolver.normalizeClockSortValue(entityData.rawValue ?? entityData.value)
685
- : TableValueResolver.resolveDisplayValue(entityData.value);
686
- case 'Checkbox':
687
- return TableValueResolver.resolveBooleanValue(entityData.rawValue ?? entityData.value);
688
- case 'LongText':
689
- // Rich-text value holds HTML (rendered via [innerHTML] on screen).
690
- // Strip tags so the export shows clean text instead of <p>…</p> markup.
691
- return TableValueResolver.stripHtml(TableValueResolver.resolveDisplayValue(entityData.value));
692
- case 'MultiUser': {
693
- const users = Array.isArray(entityData.value)
694
- ? entityData.value
695
- : [];
696
- const names = users
697
- .map((user) => user.displayName ?? user.name ?? user.userName)
698
- .filter((name) => typeof name === 'string' && name.trim().length > 0);
699
- return names.length ? names.join(', ') : null;
700
- }
701
- case 'Status':
702
- case 'Lookup':
703
- case 'PhaseGate':
704
- case 'User':
705
- case 'Text':
706
- default:
707
- return TableValueResolver.resolveDisplayValue(entityData.value);
708
- }
709
- }
710
- // Export cells use simple rich-text markup. Keep this lightweight unless
711
- // nested or encoded markup requires a DOM parser later.
712
- static stripHtml(value) {
713
- if (typeof value !== 'string') {
714
- return value;
715
- }
716
- const text = value
717
- .replace(/<br\s*\/?>/gi, ' ')
718
- .replace(/<\/(p|div|li|h[1-6])>/gi, ' ')
719
- .replace(/<[^>]*>/g, '')
720
- .replace(/&nbsp;/gi, ' ')
721
- .replace(/&amp;/gi, '&')
722
- .replace(/&lt;/gi, '<')
723
- .replace(/&gt;/gi, '>')
724
- .replace(/&quot;/gi, '"')
725
- .replace(/&#39;/gi, "'")
726
- .replace(/\s+/g, ' ')
727
- .trim();
728
- return text === '' ? null : text;
729
- }
730
- static resolveDisplayValue(value) {
731
- if (value === null || value === undefined || value === '') {
732
- return null;
733
- }
734
- if (typeof value === 'string' ||
735
- typeof value === 'number' ||
736
- typeof value === 'boolean') {
737
- return value;
738
- }
739
- if (value instanceof Date) {
740
- return value.toISOString();
741
- }
742
- if (typeof value === 'object') {
743
- const objectValue = value;
744
- const displayCandidate = objectValue['display'] ??
745
- objectValue['displayValue'] ??
746
- objectValue['displayName'] ??
747
- objectValue['pathLabel'] ??
748
- objectValue['name'] ??
749
- objectValue['label'] ??
750
- objectValue['code'] ??
751
- objectValue['value'];
752
- return TableValueResolver.resolveDisplayValue(displayCandidate);
753
- }
754
- return String(value);
755
- }
756
- static resolveBooleanValue(value) {
757
- if (value === null || value === undefined || value === '') {
758
- return null;
759
- }
760
- if (typeof value === 'boolean') {
761
- return value;
762
- }
763
- if (typeof value === 'string') {
764
- return ['true', '1', 'yes', 'on'].includes(value.toLowerCase());
765
- }
766
- if (typeof value === 'number') {
767
- return value === 1;
768
- }
769
- return null;
770
- }
771
- static normalizeTextSortValue(value) {
772
- if (value === null || value === undefined || value === '') {
773
- return null;
774
- }
775
- return String(value).toLocaleLowerCase();
776
- }
777
- static normalizeNumericSortValue(value) {
778
- if (value === null || value === undefined || value === '') {
779
- return null;
780
- }
781
- const numericValue = typeof value === 'number'
782
- ? value
783
- : Number.parseFloat(String(value).replace(/[^0-9.-]/g, ''));
784
- return Number.isNaN(numericValue) ? null : numericValue;
785
- }
786
- static normalizeDateSortValue(value) {
787
- const resolvedValue = TableValueResolver.resolveDateValue(value);
788
- if (resolvedValue === null ||
789
- resolvedValue === undefined ||
790
- resolvedValue === '') {
791
- return null;
792
- }
793
- const timestamp = resolvedValue instanceof Date
794
- ? resolvedValue.getTime()
795
- : new Date(String(resolvedValue)).getTime();
796
- return Number.isNaN(timestamp) ? null : timestamp;
797
- }
798
- /**
799
- * Order a `Time` cell by seconds since midnight. The stored shape is a
800
- * wall-clock `HH:mm:ss`, which `Date` cannot parse at all; values still held
801
- * as a full instant contribute their local clock, so a column holding both
802
- * shapes still sorts by time of day rather than by the date part.
803
- */
804
- static normalizeClockSortValue(value) {
805
- const resolvedValue = TableValueResolver.resolveDateValue(value);
806
- if (resolvedValue === null ||
807
- resolvedValue === undefined ||
808
- resolvedValue === '') {
809
- return null;
810
- }
811
- const clockTime = parseClockTime(resolvedValue);
812
- if (clockTime)
813
- return clockTimeToSeconds(clockTime);
814
- const parsed = resolvedValue instanceof Date
815
- ? resolvedValue
816
- : new Date(String(resolvedValue));
817
- const parsedClockTime = toClockTimeParts(parsed);
818
- return parsedClockTime ? clockTimeToSeconds(parsedClockTime) : null;
819
- }
820
- /**
821
- * Resolves an entity column's view type from the column def, falling back to
822
- * a sample row's cell. Public because grouping decides what it can bucket
823
- * from the entity view type, which is finer-grained than the filter type
824
- * (`Lookup` and `LookupMatrix` both filter as `select`-ish but only the view
825
- * type says whether the values are categorical).
826
- */
827
- static getEntityViewType(column, row) {
828
- const explicitViewType = column.viewType;
829
- if (TableValueResolver.isEntityViewType(explicitViewType)) {
830
- return explicitViewType;
831
- }
832
- const cellValue = row
833
- ? TableValueResolver.getProperty(row, column.key)
834
- : undefined;
835
- if (cellValue &&
836
- typeof cellValue === 'object' &&
837
- 'viewType' in cellValue) {
838
- const viewType = cellValue.viewType;
839
- if (TableValueResolver.isEntityViewType(viewType)) {
840
- return viewType;
841
- }
842
- }
843
- return null;
844
- }
845
- static isEntityViewType(value) {
846
- return (typeof value === 'string' &&
847
- TableValueResolver.ALL_ENTITY_VIEW_TYPES.includes(value));
848
- }
849
- static resolveTreeFilterLabel(value) {
850
- if (!value || typeof value !== 'object') {
851
- return null;
852
- }
853
- const record = value;
854
- const data = record['data'];
855
- if (data && typeof data === 'object') {
856
- const pathLabel = data['pathLabel'];
857
- if (typeof pathLabel === 'string' && pathLabel.trim().length > 0) {
858
- return pathLabel.trim();
859
- }
860
- }
861
- const pathLabel = record['pathLabel'];
862
- if (typeof pathLabel === 'string' && pathLabel.trim().length > 0) {
863
- return pathLabel.trim();
864
- }
865
- const label = record['label'];
866
- if (typeof label === 'string' && label.trim().length > 0) {
867
- return label.trim();
868
- }
869
- const key = record['key'];
870
- return typeof key === 'string' && key.trim().length > 0 ? key.trim() : null;
871
- }
872
- }
873
-
874
- /**
875
- * Renders a single filter control for one `ColumnDef`, dispatching on
876
- * `column.filterConfig.type` (`text` | `select` | `treeSelect` | `date`
877
- * | `boolean` | `user` | `numberRange`).
878
- *
879
- * Two-way binds the filter value via `value` / `valueChange`. Shared by both
880
- * filter UX modes (popover + per-column) so field rendering lives in one place.
881
- * Add a new filter type by adding a `@case` in the template and extending
882
- * `FilterConfig['type']`.
883
- */
884
- const EMPTY_MULTI_VALUE = Object.freeze([]);
885
- const DEFAULT_NUMBER_RANGE_MIN = -999999999999999;
886
- const DEFAULT_NUMBER_RANGE_MAX = 999999999999999;
887
- const PERCENTAGE_RANGE_MIN = 0;
888
- const PERCENTAGE_RANGE_MAX = 100;
889
- class TableFilterField {
890
- column = input.required(...(ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []));
891
- value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
892
- transloco = inject(TranslocoService);
893
- booleanOptions = computed(() => [
894
- { label: this.transloco.translate('components.table.yes'), value: true },
895
- { label: this.transloco.translate('components.table.no'), value: false },
896
- ], ...(ngDevMode ? [{ debugName: "booleanOptions" }] : /* istanbul ignore next */ []));
897
- multiValue = computed(() => {
898
- const current = this.value();
899
- if (Array.isArray(current))
900
- return current;
901
- if (current === null || current === undefined || current === '') {
902
- return EMPTY_MULTI_VALUE;
903
- }
904
- return [current];
905
- }, ...(ngDevMode ? [{ debugName: "multiValue" }] : /* istanbul ignore next */ []));
906
- filterOptions = computed(() => this.column().filterConfig?.options ?? EMPTY_MULTI_VALUE, ...(ngDevMode ? [{ debugName: "filterOptions" }] : /* istanbul ignore next */ []));
907
- treeOptions = computed(() => this.column().filterConfig?.treeOptions ?? [], ...(ngDevMode ? [{ debugName: "treeOptions" }] : /* istanbul ignore next */ []));
908
- getFilterType() {
909
- return this.column().filterConfig?.type ?? 'text';
910
- }
911
- /**
912
- * `select` / `userSelect` filters default to multi-select unless the caller
913
- * opts out with `filterConfig.multiple: false`.
914
- */
915
- isMultiple() {
916
- return this.column().filterConfig?.multiple !== false;
917
- }
918
- getScalarValue() {
919
- const current = this.value();
920
- return current?.value ?? current ?? null;
921
- }
922
- getDateRangeValue(part) {
923
- const current = this.value();
924
- if (!current || typeof current !== 'object')
925
- return null;
926
- const raw = part === 'from' ? current.from : current.to;
927
- if (raw == null)
928
- return null;
929
- return raw instanceof Date ? raw : new Date(raw);
930
- }
931
- getNumberRangeValue(part) {
932
- const current = this.value();
933
- if (!current || typeof current !== 'object')
934
- return null;
935
- const raw = part === 'from' ? current.from : current.to;
936
- return typeof raw === 'number' ? raw : raw == null ? null : Number(raw);
937
- }
938
- getNumberRangeMin() {
939
- const configured = this.resolveConfiguredNumber('min');
940
- if (configured !== null)
941
- return configured;
942
- return this.isPercentageColumn()
943
- ? PERCENTAGE_RANGE_MIN
944
- : DEFAULT_NUMBER_RANGE_MIN;
945
- }
946
- getNumberRangeMax() {
947
- const configured = this.resolveConfiguredNumber('max');
948
- if (configured !== null)
949
- return configured;
950
- return this.isPercentageColumn()
951
- ? PERCENTAGE_RANGE_MAX
952
- : DEFAULT_NUMBER_RANGE_MAX;
953
- }
954
- updateScalar(next) {
955
- this.value.set(next);
956
- }
957
- getTreePlaceholder() {
958
- const configured = this.column().filterConfig?.['placeholder'];
959
- if (typeof configured === 'string' && configured.trim().length > 0) {
960
- return configured;
961
- }
962
- return `${this.transloco.translate('components.table.select')} ${this.column().filterConfig?.label || this.column().label}`;
963
- }
964
- getTreeFilterBy() {
965
- const configured = this.column().filterConfig?.['filterBy'];
966
- return typeof configured === 'string' && configured.trim().length > 0
967
- ? configured
968
- : 'label,data.pathLabel';
969
- }
970
- getTreeFilterPlaceholder() {
971
- const configured = this.column().filterConfig?.['filterPlaceholder'];
972
- return typeof configured === 'string' && configured.trim().length > 0
973
- ? configured
974
- : this.transloco.translate('components.table.search');
975
- }
976
- getTreeScrollHeight() {
977
- const configured = this.column().filterConfig?.['scrollHeight'];
978
- return typeof configured === 'string' && configured.trim().length > 0
979
- ? configured
980
- : '20rem';
981
- }
982
- getTreePanelStyleClass() {
983
- const configured = this.column().filterConfig?.['panelStyleClass'];
984
- return typeof configured === 'string' && configured.trim().length > 0
985
- ? configured
986
- : undefined;
987
- }
988
- updateDate(part, next) {
989
- const current = this.value() ?? {};
990
- this.value.set({ ...current, [part]: next });
991
- }
992
- updateNumber(part, next) {
993
- const current = this.value() ?? {};
994
- this.value.set({ ...current, [part]: this.clampNumberRangeValue(next) });
995
- }
996
- isPercentageColumn() {
997
- return this.column().viewType === 'Percentage';
998
- }
999
- resolveConfiguredNumber(key) {
1000
- const configured = this.column().filterConfig?.[key];
1001
- if (typeof configured === 'number' && Number.isFinite(configured)) {
1002
- return configured;
1003
- }
1004
- if (typeof configured === 'string' && configured.trim()) {
1005
- const parsed = Number(configured);
1006
- return Number.isFinite(parsed) ? parsed : null;
1007
- }
1008
- return null;
1009
- }
1010
- clampNumberRangeValue(value) {
1011
- if (value === null || value === undefined)
1012
- return null;
1013
- const numericValue = Number(value);
1014
- if (!Number.isFinite(numericValue))
1015
- return null;
1016
- return Math.min(this.getNumberRangeMax(), Math.max(this.getNumberRangeMin(), numericValue));
1017
- }
1018
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilterField, deps: [], target: i0.ɵɵFactoryTarget.Component });
1019
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableFilterField, isStandalone: true, selector: "mt-table-filter-field", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "@switch (getFilterType()) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n />\r\n }\r\n @case (\"select\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"userSelect\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [markCurrentUser]=\"true\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"treeSelect\") {\r\n <mt-treeselect-field\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"treeOptions()\"\r\n [placeholder]=\"getTreePlaceholder()\"\r\n [selectionMode]=\"$any(column().filterConfig)?.selectionMode || 'single'\"\r\n [scrollHeight]=\"getTreeScrollHeight()\"\r\n [panelStyleClass]=\"getTreePanelStyleClass()\"\r\n [filter]=\"column().filterConfig?.['filter'] !== false\"\r\n [filterBy]=\"getTreeFilterBy()\"\r\n [filterPlaceholder]=\"getTreeFilterPlaceholder()\"\r\n [showClear]=\"column().filterConfig?.['showClear'] !== false\"\r\n [resetFilterOnHide]=\"\r\n column().filterConfig?.['resetFilterOnHide'] !== false\r\n \"\r\n [overlayOptions]=\"$any(column().filterConfig)?.overlayOptions\"\r\n />\r\n }\r\n @case (\"date\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('from')\"\r\n (ngModelChange)=\"updateDate('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('to')\"\r\n (ngModelChange)=\"updateDate('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n @case (\"boolean\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"booleanOptions()\"\r\n [placeholder]=\"'components.table.select' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n @case (\"user\") {\r\n <mt-user-search-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"column().filterConfig?.label || column().label\"\r\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\r\n [context]=\"column().filterConfig?.context\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('from')\"\r\n (ngModelChange)=\"updateNumber('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('to')\"\r\n (ngModelChange)=\"updateNumber('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: DateField, selector: "mt-date-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "showIcon", "showOnFocus", "showClear", "showTime", "timeOnly", "minDate", "maxDate", "pInputs", "required"] }, { kind: "component", type: UserSearchField, selector: "mt-user-search-field", inputs: ["hint", "hideUnlinkedHint", "label", "placeholder", "class", "readonly", "required", "isMultiple", "apiUrl", "dataKey", "paramName", "minLength", "context", "size"] }, { kind: "component", type: TreeSelectField, selector: "mt-treeselect-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "required", "pInputs", "options", "selectionMode", "display", "scrollHeight", "panelStyleClass", "containerStyleClass", "overlayOptions", "filter", "filterBy", "filterMode", "filterPlaceholder", "filterLocale", "filterInputAutoFocus", "showClear", "resetFilterOnHide", "propagateSelectionDown", "propagateSelectionUp", "virtualScroll", "virtualScrollItemSize", "loading", "loadingMode", "size", "variant", "fluid", "appendTo", "selectedLabelPath"], outputs: ["onChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1020
- }
1021
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilterField, decorators: [{
1022
- type: Component,
1023
- args: [{ selector: 'mt-table-filter-field', standalone: true, imports: [
1024
- FormsModule,
1025
- TextField,
1026
- NumberField,
1027
- SelectField,
1028
- MultiSelectField,
1029
- DateField,
1030
- UserSearchField,
1031
- TreeSelectField,
1032
- TranslocoModule,
1033
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@switch (getFilterType()) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n />\r\n }\r\n @case (\"select\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"userSelect\") {\r\n @if (isMultiple()) {\r\n <mt-multi-select-field\r\n [ngModel]=\"multiValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [showClear]=\"true\"\r\n [filter]=\"true\"\r\n filterBy=\"label\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"filterOptions()\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [markCurrentUser]=\"true\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n }\r\n @case (\"treeSelect\") {\r\n <mt-treeselect-field\r\n [ngModel]=\"value()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"treeOptions()\"\r\n [placeholder]=\"getTreePlaceholder()\"\r\n [selectionMode]=\"$any(column().filterConfig)?.selectionMode || 'single'\"\r\n [scrollHeight]=\"getTreeScrollHeight()\"\r\n [panelStyleClass]=\"getTreePanelStyleClass()\"\r\n [filter]=\"column().filterConfig?.['filter'] !== false\"\r\n [filterBy]=\"getTreeFilterBy()\"\r\n [filterPlaceholder]=\"getTreeFilterPlaceholder()\"\r\n [showClear]=\"column().filterConfig?.['showClear'] !== false\"\r\n [resetFilterOnHide]=\"\r\n column().filterConfig?.['resetFilterOnHide'] !== false\r\n \"\r\n [overlayOptions]=\"$any(column().filterConfig)?.overlayOptions\"\r\n />\r\n }\r\n @case (\"date\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('from')\"\r\n (ngModelChange)=\"updateDate('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('to')\"\r\n (ngModelChange)=\"updateDate('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n @case (\"boolean\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"booleanOptions()\"\r\n [placeholder]=\"'components.table.select' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n showClear\r\n />\r\n }\r\n @case (\"user\") {\r\n <mt-user-search-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"column().filterConfig?.label || column().label\"\r\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\r\n [context]=\"column().filterConfig?.context\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('from')\"\r\n (ngModelChange)=\"updateNumber('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-number-field\r\n [ngModel]=\"getNumberRangeValue('to')\"\r\n (ngModelChange)=\"updateNumber('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n [min]=\"getNumberRangeMin()\"\r\n [max]=\"getNumberRangeMax()\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n}\r\n" }]
1034
- }], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
1035
-
1036
- const OVERLAY_SELECTOR$1 = '.p-popover, .p-select-overlay, .p-multiselect-overlay, .p-treeselect-overlay, .p-datepicker-panel, .p-autocomplete-overlay';
1037
- // Field overlays only (no popover). A select/multiselect/autocomplete/datepicker
1038
- // opened inside the popover anchors its own scroll-to-close listener to the
1039
- // popover's inner scroll container, so a page-level scroll never reaches it.
1040
- const FIELD_OVERLAY_SELECTOR = '.p-select-overlay, .p-multiselect-overlay, .p-treeselect-overlay, .p-datepicker-panel, .p-autocomplete-overlay';
1041
- class TableFilter {
1042
- columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1043
- data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1044
- filterApplied = output();
1045
- filterReset = output();
1046
- popoverRef = viewChild('popover', ...(ngDevMode ? [{ debugName: "popoverRef" }] : /* istanbul ignore next */ []));
1047
- pendingFilters = signal({}, ...(ngDevMode ? [{ debugName: "pendingFilters" }] : /* istanbul ignore next */ []));
1048
- appliedFilters = signal({}, ...(ngDevMode ? [{ debugName: "appliedFilters" }] : /* istanbul ignore next */ []));
1049
- onChange = () => { };
1050
- onTouched = () => { };
1051
- constructor() {
1052
- // Body-appended overlays (multi-select, datepicker, etc.) inside the
1053
- // popover don't get a scroll signal when the page's inner scroll
1054
- // container moves under them. Listening on window in capture phase
1055
- // catches scroll on any container; we close the popover when the
1056
- // scroll happens outside the popover or any open dropdown overlay.
1057
- const onScroll = (event) => {
1058
- const popover = this.popoverRef();
1059
- if (!popover?.container)
1060
- return;
1061
- const target = event.target;
1062
- if (target instanceof Element && target.closest(OVERLAY_SELECTOR$1)) {
1063
- return;
1064
- }
1065
- // An open field dropdown is body-appended and would be left orphaned when
1066
- // we hide the popover below (its scroll listener is bound to the popover's
1067
- // inner scroll container, not the window). A window resize makes PrimeNG
1068
- // self-close those overlays before the popover goes away.
1069
- if (document.querySelector(FIELD_OVERLAY_SELECTOR)) {
1070
- window.dispatchEvent(new Event('resize'));
1071
- }
1072
- popover.hide();
1073
- };
1074
- window.addEventListener('scroll', onScroll, true);
1075
- inject(DestroyRef).onDestroy(() => {
1076
- window.removeEventListener('scroll', onScroll, true);
1077
- });
1078
- }
1079
- filterableColumns = computed(() => this.columns()
1080
- .filter((col) => TableValueResolver.getColumnFilterType(col, this.data()[0]) !== null)
1081
- .map((col) => TableValueResolver.buildFilterableColumn(col, this.data())), ...(ngDevMode ? [{ debugName: "filterableColumns" }] : /* istanbul ignore next */ []));
1082
- activeFilterCount = computed(() => Object.entries(this.appliedFilters()).filter(([key, value]) =>
1083
- // `generalSearch` is the table's global search term, not a column
1084
- // filter — it's injected into the filters map for lazy fetches but
1085
- // must not light up the filter button's active badge.
1086
- key !== 'generalSearch' && TableValueResolver.hasFilterValue(value)).length, ...(ngDevMode ? [{ debugName: "activeFilterCount" }] : /* istanbul ignore next */ []));
1087
- updateFilter(key, value) {
1088
- this.pendingFilters.update((filters) => ({
1089
- ...filters,
1090
- [key]: value,
1091
- }));
1092
- this.onTouched();
1093
- }
1094
- apply() {
1095
- const filters = { ...this.pendingFilters() };
1096
- this.appliedFilters.set(filters);
1097
- this.onChange(filters);
1098
- this.filterApplied.emit(filters);
1099
- }
1100
- reset() {
1101
- this.pendingFilters.set({});
1102
- this.appliedFilters.set({});
1103
- this.onChange({});
1104
- this.filterReset.emit();
1105
- }
1106
- // ControlValueAccessor
1107
- writeValue(value) {
1108
- const filters = value ?? {};
1109
- this.pendingFilters.set(filters);
1110
- this.appliedFilters.set(filters);
1111
- }
1112
- registerOnChange(fn) {
1113
- this.onChange = fn;
1114
- }
1115
- registerOnTouched(fn) {
1116
- this.onTouched = fn;
1117
- }
1118
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilter, deps: [], target: i0.ɵɵFactoryTarget.Component });
1119
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableFilter, isStandalone: true, selector: "mt-table-filter", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterApplied: "filterApplied", filterReset: "filterReset" }, providers: [
1120
- {
1121
- provide: NG_VALUE_ACCESSOR,
1122
- useExisting: forwardRef(() => TableFilter),
1123
- multi: true,
1124
- },
1125
- ], viewQueries: [{ propertyName: "popoverRef", first: true, predicate: ["popover"], descendants: true, isSignal: true }], ngImport: i0, template: "<mt-button\r\n (click)=\"popover.toggle($event)\"\r\n [label]=\"'components.table.filter' | transloco\"\r\n [badge]=\"activeFilterCount()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n icon=\"general.filter-funnel-01\"\r\n/>\r\n\r\n<p-popover #popover [style]=\"{ width: '320px' }\" appendTo=\"body\">\r\n <div class=\"flex flex-col max-h-[50vh]\">\r\n <h4\r\n class=\"text-lg py-2 font-semibold border-b border-surface-200 dark:border-surface-700 shrink-0\"\r\n >\r\n {{ \"components.table.filterOptions\" | transloco }}\r\n </h4>\r\n\r\n <div\r\n class=\"space-y-3 overflow-y-auto flex-1 py-3\"\r\n (keydown.enter)=\"apply(); popover.hide()\"\r\n >\r\n @for (col of filterableColumns(); track col.key) {\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ col.filterConfig?.label || col.label }}\r\n </label>\r\n <mt-table-filter-field\r\n [column]=\"col\"\r\n [value]=\"pendingFilters()[col.key]\"\r\n (valueChange)=\"updateFilter(col.key, $event)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex justify-end gap-2 pt-4 border-t border-surface-200 dark:border-surface-700 shrink-0\"\r\n >\r\n <mt-button\r\n variant=\"outlined\"\r\n (click)=\"reset(); popover.hide()\"\r\n [label]=\"'components.table.reset' | transloco\"\r\n />\r\n <mt-button\r\n (click)=\"apply(); popover.hide()\"\r\n [label]=\"'components.table.apply' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n</p-popover>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i1$2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TableFilterField, selector: "mt-table-filter-field", inputs: ["column", "value"], outputs: ["valueChange"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1126
- }
1127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilter, decorators: [{
1128
- type: Component,
1129
- args: [{ selector: 'mt-table-filter', standalone: true, imports: [
1130
- FormsModule,
1131
- Button,
1132
- PopoverModule,
1133
- TranslocoModule,
1134
- TableFilterField,
1135
- ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1136
- {
1137
- provide: NG_VALUE_ACCESSOR,
1138
- useExisting: forwardRef(() => TableFilter),
1139
- multi: true,
1140
- },
1141
- ], template: "<mt-button\r\n (click)=\"popover.toggle($event)\"\r\n [label]=\"'components.table.filter' | transloco\"\r\n [badge]=\"activeFilterCount()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n icon=\"general.filter-funnel-01\"\r\n/>\r\n\r\n<p-popover #popover [style]=\"{ width: '320px' }\" appendTo=\"body\">\r\n <div class=\"flex flex-col max-h-[50vh]\">\r\n <h4\r\n class=\"text-lg py-2 font-semibold border-b border-surface-200 dark:border-surface-700 shrink-0\"\r\n >\r\n {{ \"components.table.filterOptions\" | transloco }}\r\n </h4>\r\n\r\n <div\r\n class=\"space-y-3 overflow-y-auto flex-1 py-3\"\r\n (keydown.enter)=\"apply(); popover.hide()\"\r\n >\r\n @for (col of filterableColumns(); track col.key) {\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ col.filterConfig?.label || col.label }}\r\n </label>\r\n <mt-table-filter-field\r\n [column]=\"col\"\r\n [value]=\"pendingFilters()[col.key]\"\r\n (valueChange)=\"updateFilter(col.key, $event)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"flex justify-end gap-2 pt-4 border-t border-surface-200 dark:border-surface-700 shrink-0\"\r\n >\r\n <mt-button\r\n variant=\"outlined\"\r\n (click)=\"reset(); popover.hide()\"\r\n [label]=\"'components.table.reset' | transloco\"\r\n />\r\n <mt-button\r\n (click)=\"apply(); popover.hide()\"\r\n [label]=\"'components.table.apply' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n</p-popover>\r\n" }]
1142
- }], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], filterApplied: [{ type: i0.Output, args: ["filterApplied"] }], filterReset: [{ type: i0.Output, args: ["filterReset"] }], popoverRef: [{ type: i0.ViewChild, args: ['popover', { isSignal: true }] }] } });
1143
-
1144
- /**
1145
- * Stateless, controlled toolbar used by `mt-table` and by list-style consumers
1146
- * (e.g. `client-list-cards-view`) so the two share one caption UI without
1147
- * duplicating the search/filter/actions markup.
1148
- *
1149
- * The caption only renders the popover-mode filter button — per-column filter
1150
- * icons live in the table header itself (cards have no columns).
1151
- */
1152
- class TableCaption {
1153
- // Capability flags
1154
- generalSearch = input(false, { ...(ngDevMode ? { debugName: "generalSearch" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1155
- showFilters = input(false, { ...(ngDevMode ? { debugName: "showFilters" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1156
- filterMode = input('popover', ...(ngDevMode ? [{ debugName: "filterMode" }] : /* istanbul ignore next */ []));
1157
- exportable = input(false, { ...(ngDevMode ? { debugName: "exportable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1158
- printable = input(false, { ...(ngDevMode ? { debugName: "printable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1159
- groupable = input(false, { ...(ngDevMode ? { debugName: "groupable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1160
- // Context for pickers
1161
- columns = input([], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1162
- data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1163
- groupColumns = input([], ...(ngDevMode ? [{ debugName: "groupColumns" }] : /* istanbul ignore next */ []));
1164
- // Tabs
1165
- tabs = input(...(ngDevMode ? [undefined, { debugName: "tabs" }] : /* istanbul ignore next */ []));
1166
- tabsOptionLabel = input('label', ...(ngDevMode ? [{ debugName: "tabsOptionLabel" }] : /* istanbul ignore next */ []));
1167
- tabsOptionValue = input('value', ...(ngDevMode ? [{ debugName: "tabsOptionValue" }] : /* istanbul ignore next */ []));
1168
- // Toolbar-level action buttons rendered inline (not the dots menu)
1169
- actions = input([], ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
1170
- // Projected caption slots
1171
- captionStart = input(null, ...(ngDevMode ? [{ debugName: "captionStart" }] : /* istanbul ignore next */ []));
1172
- captionEnd = input(null, ...(ngDevMode ? [{ debugName: "captionEnd" }] : /* istanbul ignore next */ []));
1173
- // Two-way state (the caption is a controlled component)
1174
- activeTab = model(...(ngDevMode ? [undefined, { debugName: "activeTab" }] : /* istanbul ignore next */ []));
1175
- filters = model({}, ...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
1176
- filterTerm = model('', ...(ngDevMode ? [{ debugName: "filterTerm" }] : /* istanbul ignore next */ []));
1177
- groupBy = model(null, ...(ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []));
1178
- // Events
1179
- exportRequested = output();
1180
- printRequested = output();
1181
- onTabChange = output();
1182
- searchChange = output();
1183
- filterApplied = output();
1184
- filterReset = output();
1185
- showsAnything = computed(() => !!this.captionStart() ||
1186
- !!this.captionEnd() ||
1187
- this.generalSearch() ||
1188
- (this.showFilters() && this.filterMode() === 'popover') ||
1189
- this.exportable() ||
1190
- this.printable() ||
1191
- this.groupable() ||
1192
- (this.tabs()?.length ?? 0) > 0 ||
1193
- this.actions().length > 0, ...(ngDevMode ? [{ debugName: "showsAnything" }] : /* istanbul ignore next */ []));
1194
- onSearch(term) {
1195
- // Single source of truth for the search box shared by mt-table and the
1196
- // cards view. A whitespace-only query is meaningless, so collapse it to
1197
- // '' here — otherwise a literal " " substring-matches almost every row
1198
- // (local) or is sent verbatim as `generalSearch` (lazy). `.trim()` is
1199
- // idempotent against typing multi-word terms ("John Doe"): a trailing
1200
- // space yields the same value as before, the model signal doesn't
1201
- // re-emit, and the input keeps the space the user just typed.
1202
- const normalized = term.trim();
1203
- this.filterTerm.set(normalized);
1204
- this.searchChange.emit(normalized);
1205
- }
1206
- onFilterApplied(next) {
1207
- this.filters.set(next);
1208
- this.filterApplied.emit(next);
1209
- }
1210
- onFilterReset() {
1211
- this.filters.set({});
1212
- this.filterReset.emit();
1213
- }
1214
- onGroupChange(key) {
1215
- this.groupBy.set(key);
1216
- }
1217
- tabChanged(tab) {
1218
- this.onTabChange.emit(tab);
1219
- }
1220
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCaption, deps: [], target: i0.ɵɵFactoryTarget.Component });
1221
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableCaption, isStandalone: true, selector: "mt-table-caption", inputs: { generalSearch: { classPropertyName: "generalSearch", publicName: "generalSearch", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, exportable: { classPropertyName: "exportable", publicName: "exportable", isSignal: true, isRequired: false, transformFunction: null }, printable: { classPropertyName: "printable", publicName: "printable", isSignal: true, isRequired: false, transformFunction: null }, groupable: { classPropertyName: "groupable", publicName: "groupable", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, groupColumns: { classPropertyName: "groupColumns", publicName: "groupColumns", isSignal: true, isRequired: false, transformFunction: null }, tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionLabel: { classPropertyName: "tabsOptionLabel", publicName: "tabsOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionValue: { classPropertyName: "tabsOptionValue", publicName: "tabsOptionValue", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, captionStart: { classPropertyName: "captionStart", publicName: "captionStart", isSignal: true, isRequired: false, transformFunction: null }, captionEnd: { classPropertyName: "captionEnd", publicName: "captionEnd", isSignal: true, isRequired: false, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "activeTab", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, filterTerm: { classPropertyName: "filterTerm", publicName: "filterTerm", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeTab: "activeTabChange", filters: "filtersChange", filterTerm: "filterTermChange", groupBy: "groupByChange", exportRequested: "exportRequested", printRequested: "printRequested", onTabChange: "onTabChange", searchChange: "searchChange", filterApplied: "filterApplied", filterReset: "filterReset" }, ngImport: i0, template: "@if (showsAnything()) {\r\n <div class=\"mt-table-caption\">\r\n <div\r\n class=\"flex relative items-center gap-2 pb-4\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n @if (captionStart(); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\"></ng-container>\r\n }\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [ngModel]=\"filterTerm()\"\r\n (ngModelChange)=\"onSearch($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters() && filterMode() === \"popover\") {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable() || printable() || groupable()) {\r\n <mt-table-actions-menu\r\n [exportable]=\"exportable()\"\r\n [printable]=\"printable()\"\r\n [groupable]=\"groupable()\"\r\n [groupColumns]=\"groupColumns()\"\r\n [activeGroup]=\"groupBy()\"\r\n (exportRequested)=\"exportRequested.emit()\"\r\n (printRequested)=\"printRequested.emit()\"\r\n (groupChange)=\"onGroupChange($event)\"\r\n />\r\n }\r\n @if (actions().length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"$any(action).size || 'small'\"\r\n (click)=\"action.action(null)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n @if (captionEnd(); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\"></ng-container>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TableFilter, selector: "mt-table-filter", inputs: ["columns", "data"], outputs: ["filterApplied", "filterReset"] }, { kind: "component", type: TableActionsMenu, selector: "mt-table-actions-menu", inputs: ["exportable", "printable", "groupable", "groupColumns", "activeGroup"], outputs: ["exportRequested", "printRequested", "groupChange"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1222
- }
1223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCaption, decorators: [{
1224
- type: Component,
1225
- args: [{ selector: 'mt-table-caption', standalone: true, imports: [
1226
- NgTemplateOutlet,
1227
- FormsModule,
1228
- TranslocoModule,
1229
- Button,
1230
- Tabs,
1231
- TextField,
1232
- TableFilter,
1233
- TableActionsMenu,
1234
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (showsAnything()) {\r\n <div class=\"mt-table-caption\">\r\n <div\r\n class=\"flex relative items-center gap-2 pb-4\"\r\n [class]=\"!generalSearch() ? 'justify-end' : 'justify-between'\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n @if (captionStart(); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\"></ng-container>\r\n }\r\n @if (tabs()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabs()\"\r\n [optionLabel]=\"tabsOptionLabel()\"\r\n [optionValue]=\"tabsOptionValue()\"\r\n (onChange)=\"tabChanged($event)\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n }\r\n @if (generalSearch()) {\r\n <mt-text-field\r\n [ngModel]=\"filterTerm()\"\r\n (ngModelChange)=\"onSearch($event)\"\r\n icon=\"general.search-lg\"\r\n [placeholder]=\"'components.table.search' | transloco\"\r\n ></mt-text-field>\r\n }\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (showFilters() && filterMode() === \"popover\") {\r\n <mt-table-filter\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [ngModel]=\"filters()\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n }\r\n @if (exportable() || printable() || groupable()) {\r\n <mt-table-actions-menu\r\n [exportable]=\"exportable()\"\r\n [printable]=\"printable()\"\r\n [groupable]=\"groupable()\"\r\n [groupColumns]=\"groupColumns()\"\r\n [activeGroup]=\"groupBy()\"\r\n (exportRequested)=\"exportRequested.emit()\"\r\n (printRequested)=\"printRequested.emit()\"\r\n (groupChange)=\"onGroupChange($event)\"\r\n />\r\n }\r\n @if (actions().length > 0) {\r\n <div class=\"flex items-center space-x-2\">\r\n @for (action of actions(); track action.label) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"$any(action).size || 'small'\"\r\n (click)=\"action.action(null)\"\r\n [label]=\"action.label\"\r\n [tooltip]=\"action.tooltip\"\r\n ></mt-button>\r\n }\r\n </div>\r\n }\r\n @if (captionEnd(); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\"></ng-container>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n" }]
1235
- }], propDecorators: { generalSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "generalSearch", required: false }] }], showFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilters", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMode", required: false }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], printable: [{ type: i0.Input, args: [{ isSignal: true, alias: "printable", required: false }] }], groupable: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupable", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], groupColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupColumns", required: false }] }], tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], tabsOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionLabel", required: false }] }], tabsOptionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionValue", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], captionStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionStart", required: false }] }], captionEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionEnd", required: false }] }], activeTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTab", required: false }] }, { type: i0.Output, args: ["activeTabChange"] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], filterTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterTerm", required: false }] }, { type: i0.Output, args: ["filterTermChange"] }], groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }, { type: i0.Output, args: ["groupByChange"] }], exportRequested: [{ type: i0.Output, args: ["exportRequested"] }], printRequested: [{ type: i0.Output, args: ["printRequested"] }], onTabChange: [{ type: i0.Output, args: ["onTabChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], filterApplied: [{ type: i0.Output, args: ["filterApplied"] }], filterReset: [{ type: i0.Output, args: ["filterReset"] }] } });
1236
-
1237
- const OVERLAY_SELECTOR = '.p-popover, .p-select-overlay, .p-multiselect-overlay, .p-treeselect-overlay, .p-datepicker-panel, .p-autocomplete-panel, .p-autocomplete-overlay';
1238
- /**
1239
- * Per-column filter affordance: a small funnel icon in the column header that
1240
- * opens a popover with a single `TableFilterField`.
1241
- *
1242
- * Buffers edits in `pendingValue` until the user hits Apply — matches the
1243
- * popover-mode UX so behavior is predictable between modes. Emits `filterChange`
1244
- * with either the new value or `null` to clear.
1245
- */
1246
- class TableColumnFilter {
1247
- column = input.required(...(ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []));
1248
- value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1249
- filterChange = output();
1250
- pendingValue = signal(null, ...(ngDevMode ? [{ debugName: "pendingValue" }] : /* istanbul ignore next */ []));
1251
- hasActiveValue = computed(() => TableValueResolver.hasFilterValue(this.value()), ...(ngDevMode ? [{ debugName: "hasActiveValue" }] : /* istanbul ignore next */ []));
1252
- popoverRef = viewChild('popover', ...(ngDevMode ? [{ debugName: "popoverRef" }] : /* istanbul ignore next */ []));
1253
- constructor() {
1254
- // See TableFilter: body-appended child overlays don't dismiss on inner
1255
- // container scroll. Close the popover when the scroll happens outside
1256
- // the popover or any open dropdown overlay.
1257
- const onScroll = (event) => {
1258
- const popover = this.popoverRef();
1259
- if (!popover?.container)
1260
- return;
1261
- const target = event.target;
1262
- if (target instanceof Element && target.closest(OVERLAY_SELECTOR)) {
1263
- return;
1264
- }
1265
- popover.hide();
1266
- };
1267
- window.addEventListener('scroll', onScroll, true);
1268
- inject(DestroyRef).onDestroy(() => {
1269
- window.removeEventListener('scroll', onScroll, true);
1270
- });
1271
- }
1272
- open(popover, event) {
1273
- event.stopPropagation();
1274
- this.pendingValue.set(this.cloneValue(this.value()));
1275
- popover.toggle(event);
1276
- }
1277
- apply(popover) {
1278
- const next = this.pendingValue();
1279
- this.filterChange.emit(TableValueResolver.hasFilterValue(next) ? next : null);
1280
- popover.hide();
1281
- }
1282
- clear(popover) {
1283
- this.pendingValue.set(null);
1284
- this.filterChange.emit(null);
1285
- popover.hide();
1286
- }
1287
- cloneValue(value) {
1288
- if (value === null || value === undefined)
1289
- return null;
1290
- // Arrays must stay arrays — `{ ...array }` would turn a multi-select
1291
- // value (e.g. ["a","b"]) into {0:"a",1:"b"}, which then matches no
1292
- // option when the popover is reopened, dropping the selection.
1293
- if (Array.isArray(value))
1294
- return [...value];
1295
- if (typeof value === 'object')
1296
- return { ...value };
1297
- return value;
1298
- }
1299
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableColumnFilter, deps: [], target: i0.ɵɵFactoryTarget.Component });
1300
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.8", type: TableColumnFilter, isStandalone: true, selector: "mt-table-column-filter", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, viewQueries: [{ propertyName: "popoverRef", first: true, predicate: ["popover"], descendants: true, isSignal: true }], ngImport: i0, template: "<mt-button\r\n (onClick)=\"open(popover, $event)\"\r\n [icon]=\"\r\n hasActiveValue() ? 'general.filter-funnel-02' : 'general.filter-funnel-01'\r\n \"\r\n [severity]=\"hasActiveValue() ? 'primary' : 'secondary'\"\r\n variant=\"text\"\r\n size=\"small\"\r\n [tooltip]=\"'components.table.filter' | transloco\"\r\n styleClass=\"!p-1 !text-sm\"\r\n/>\r\n\r\n<p-popover #popover [style]=\"{ width: '280px' }\" appendTo=\"body\">\r\n <div class=\"flex flex-col gap-3\" (keydown.enter)=\"apply(popover)\">\r\n <h4\r\n class=\"text-sm font-semibold text-gray-700 dark:text-gray-300 truncate\"\r\n [title]=\"column().filterConfig?.label || column().label\"\r\n >\r\n {{ column().filterConfig?.label || column().label }}\r\n </h4>\r\n\r\n <mt-table-filter-field\r\n [column]=\"column()\"\r\n [value]=\"pendingValue()\"\r\n (valueChange)=\"pendingValue.set($event)\"\r\n />\r\n\r\n <div\r\n class=\"flex justify-end gap-2 pt-2 border-t border-surface-200 dark:border-surface-700\"\r\n >\r\n <mt-button\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clear(popover)\"\r\n [label]=\"'components.table.reset' | transloco\"\r\n />\r\n <mt-button\r\n size=\"small\"\r\n (onClick)=\"apply(popover)\"\r\n [label]=\"'components.table.apply' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n</p-popover>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i1$2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TableFilterField, selector: "mt-table-filter-field", inputs: ["column", "value"], outputs: ["valueChange"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1301
- }
1302
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableColumnFilter, decorators: [{
1303
- type: Component,
1304
- args: [{ selector: 'mt-table-column-filter', standalone: true, imports: [
1305
- FormsModule,
1306
- Button,
1307
- PopoverModule,
1308
- TranslocoModule,
1309
- TableFilterField,
1310
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mt-button\r\n (onClick)=\"open(popover, $event)\"\r\n [icon]=\"\r\n hasActiveValue() ? 'general.filter-funnel-02' : 'general.filter-funnel-01'\r\n \"\r\n [severity]=\"hasActiveValue() ? 'primary' : 'secondary'\"\r\n variant=\"text\"\r\n size=\"small\"\r\n [tooltip]=\"'components.table.filter' | transloco\"\r\n styleClass=\"!p-1 !text-sm\"\r\n/>\r\n\r\n<p-popover #popover [style]=\"{ width: '280px' }\" appendTo=\"body\">\r\n <div class=\"flex flex-col gap-3\" (keydown.enter)=\"apply(popover)\">\r\n <h4\r\n class=\"text-sm font-semibold text-gray-700 dark:text-gray-300 truncate\"\r\n [title]=\"column().filterConfig?.label || column().label\"\r\n >\r\n {{ column().filterConfig?.label || column().label }}\r\n </h4>\r\n\r\n <mt-table-filter-field\r\n [column]=\"column()\"\r\n [value]=\"pendingValue()\"\r\n (valueChange)=\"pendingValue.set($event)\"\r\n />\r\n\r\n <div\r\n class=\"flex justify-end gap-2 pt-2 border-t border-surface-200 dark:border-surface-700\"\r\n >\r\n <mt-button\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clear(popover)\"\r\n [label]=\"'components.table.reset' | transloco\"\r\n />\r\n <mt-button\r\n size=\"small\"\r\n (onClick)=\"apply(popover)\"\r\n [label]=\"'components.table.apply' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n</p-popover>\r\n" }]
1311
- }], ctorParameters: () => [], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], popoverRef: [{ type: i0.ViewChild, args: ['popover', { isSignal: true }] }] } });
1312
-
1313
- function stripHtmlToPlainText(value) {
1314
- if (value === null || value === undefined) {
1315
- return '';
1316
- }
1317
- const raw = String(value);
1318
- if (raw === '') {
1319
- return '';
1320
- }
1321
- if (!/[<&]/.test(raw)) {
1322
- return raw.trim();
1323
- }
1324
- const withoutTags = raw
1325
- .replace(/<\s*(?:br|\/p|\/div|\/li|\/tr|\/h[1-6]|\/pre|\/blockquote)\b[^>]*>/gi, ' ')
1326
- .replace(/<[^>]*>/g, '');
1327
- const decoded = decodeHtmlEntities(withoutTags);
1328
- return decoded.replace(/\s+/g, ' ').trim();
1329
- }
1330
- const NAMED_ENTITIES = {
1331
- nbsp: ' ',
1332
- amp: '&',
1333
- lt: '<',
1334
- gt: '>',
1335
- quot: '"',
1336
- apos: "'",
1337
- };
1338
- function decodeHtmlEntities(text) {
1339
- if (!text.includes('&')) {
1340
- return text;
1341
- }
1342
- return text.replace(/&(#x?[0-9a-f]+|[a-z][a-z0-9]*);/gi, (match, entity) => {
1343
- const token = entity.toLowerCase();
1344
- if (token[0] === '#') {
1345
- const codePoint = token[1] === 'x'
1346
- ? Number.parseInt(token.slice(2), 16)
1347
- : Number.parseInt(token.slice(1), 10);
1348
- if (Number.isNaN(codePoint) || codePoint <= 0) {
1349
- return match;
1350
- }
1351
- try {
1352
- return String.fromCodePoint(codePoint);
1353
- }
1354
- catch {
1355
- return match;
1356
- }
1357
- }
1358
- const named = NAMED_ENTITIES[token];
1359
- return named === undefined ? match : named;
1360
- });
1361
- }
1362
-
1363
- /**
1364
- * Centralises table export/print so any `mt-table` (and future tables) can
1365
- * drop in the behaviour without reimplementing XLSX serialisation or print
1366
- * DOM cloning. Injected schema-agnostically via `resolveValue` on the config.
1367
- */
1368
- class TableExportService {
1369
- static PRINT_ROOT_CLASS = 'mt-printing';
1370
- static PRINT_REGION_CLASS = 'mt-print-region';
1371
- static PRINT_STYLE_ID = 'mt-table-print-style';
1372
- static MAX_PRINT_COLUMNS_PER_TABLE = 8;
1373
- static RTL_LANGUAGES = /^(ar|fa|he|ur)(?:-|$)/i;
1374
- transloco = inject(TranslocoService);
1375
- static PRINT_CSS = `
1376
- @media print {
1377
- html.mt-printing body > *:not(.mt-print-region) { display: none !important; }
1378
- html.mt-printing, html.mt-printing body { width: 100% !important; height: auto !important;
1379
- overflow: visible !important; background: #ffffff !important; }
1380
- .mt-print-region { display: block !important; width: 100%; max-width: 100%;
1381
- box-sizing: border-box; overflow: visible !important; padding: 16px; color: #111827;
1382
- font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
1383
- .mt-print-region h1 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
1384
- .mt-print-region table { width: 100%; max-width: 100%; table-layout: fixed;
1385
- border-collapse: collapse; font-size: 12px; }
1386
- .mt-print-region table + table { margin-top: 16px; }
1387
- .mt-print-region th, .mt-print-region td { text-align: start; padding: 6px 8px;
1388
- border: 1px solid #e5e7eb; vertical-align: top; white-space: normal;
1389
- overflow-wrap: anywhere; word-break: break-word; }
1390
- .mt-print-region thead th { background: #f3f4f6; font-weight: 600; }
1391
- .mt-print-region tbody tr { break-inside: avoid; page-break-inside: avoid; }
1392
- }
1393
- .mt-print-region { display: none; }
1394
- `;
1395
- exportToExcel(config) {
1396
- const workbook = this.buildExcelWorkbook(config);
1397
- XLSX.writeFileXLSX(workbook, `${this.normalizeFilename(config.filename)}.xlsx`);
1398
- }
1399
- buildExcelWorkbook(config) {
1400
- const columns = this.getExcelExportableColumns(config.columns, config.rows);
1401
- const labeledRows = this.buildLabeledRows(config.rows, columns, config.resolveValue);
1402
- const worksheet = XLSX.utils.json_to_sheet(labeledRows, {
1403
- header: columns.map((column) => column.label),
1404
- });
1405
- this.configureWorksheet(worksheet, columns, labeledRows);
1406
- const workbook = XLSX.utils.book_new();
1407
- XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
1408
- if (this.isRtlExport()) {
1409
- workbook.Workbook = {
1410
- Views: [{ RTL: true }],
1411
- };
1412
- }
1413
- return workbook;
1414
- }
1415
- printPdf(config) {
1416
- if (typeof document === 'undefined' || typeof window === 'undefined') {
1417
- return;
1418
- }
1419
- const columns = this.getExportableColumns(config.columns);
1420
- const region = this.buildPrintRegion(config, columns);
1421
- this.ensurePrintStyles();
1422
- document.body.appendChild(region);
1423
- document.documentElement.classList.add(TableExportService.PRINT_ROOT_CLASS);
1424
- const cleanup = () => {
1425
- document.documentElement.classList.remove(TableExportService.PRINT_ROOT_CLASS);
1426
- region.remove();
1427
- window.removeEventListener('afterprint', cleanup);
1428
- };
1429
- window.addEventListener('afterprint', cleanup);
1430
- window.print();
1431
- }
1432
- ensurePrintStyles() {
1433
- if (document.getElementById(TableExportService.PRINT_STYLE_ID)) {
1434
- return;
1435
- }
1436
- const style = document.createElement('style');
1437
- style.id = TableExportService.PRINT_STYLE_ID;
1438
- style.textContent = TableExportService.PRINT_CSS;
1439
- document.head.appendChild(style);
1440
- }
1441
- getExportableColumns(columns) {
1442
- return columns.filter((column) => !column.filterOnly &&
1443
- (column.type !== 'custom' ||
1444
- column.exportable === true ||
1445
- !!column.exportValue));
1446
- }
1447
- getExcelExportableColumns(columns, rows) {
1448
- return this.getExportableColumns(columns).filter((column) => {
1449
- if (column.type !== 'entity')
1450
- return true;
1451
- const sampleRow = rows.find((row) => TableValueResolver.getProperty(row, column.key) !== null &&
1452
- TableValueResolver.getProperty(row, column.key) !== undefined);
1453
- return (TableValueResolver.getEntityViewType(column, sampleRow) !== 'Attachment');
1454
- });
1455
- }
1456
- /**
1457
- * Resolves a single cell's exported/printed scalar. A column-level
1458
- * `exportValue` always wins; everything else defers to the caller-supplied
1459
- * resolver. The caller owns entity formatting too so Date/DateTime/Time can
1460
- * use the configured MT formats instead of leaking raw ISO strings.
1461
- */
1462
- resolveCellValue(row, column, resolveValue) {
1463
- if (column.exportValue) {
1464
- return column.exportValue(row);
1465
- }
1466
- return resolveValue(row, column);
1467
- }
1468
- /**
1469
- * Produces rows keyed by column label (Excel header row).
1470
- * Values already passed through the caller's type-aware resolver.
1471
- */
1472
- buildLabeledRows(rows, columns, resolveValue) {
1473
- return rows.map((row) => {
1474
- const labeledRow = {};
1475
- columns.forEach((column) => {
1476
- const cellValue = this.resolveCellValue(row, column, resolveValue);
1477
- labeledRow[column.label] = this.toPlainExportValue(cellValue, true);
1478
- });
1479
- return labeledRow;
1480
- });
1481
- }
1482
- buildPrintRegion(config, columns) {
1483
- const region = document.createElement('section');
1484
- region.className = TableExportService.PRINT_REGION_CLASS;
1485
- region.dir = this.isRtlExport() ? 'rtl' : 'ltr';
1486
- if (config.title) {
1487
- const heading = document.createElement('h1');
1488
- heading.textContent = config.title;
1489
- region.appendChild(heading);
1490
- }
1491
- this.getPrintColumnGroups(columns).forEach((columnGroup) => {
1492
- region.appendChild(this.buildPrintTable(config, columnGroup));
1493
- });
1494
- return region;
1495
- }
1496
- buildPrintTable(config, columns) {
1497
- const table = document.createElement('table');
1498
- const thead = document.createElement('thead');
1499
- const headerRow = document.createElement('tr');
1500
- columns.forEach((column) => {
1501
- const th = document.createElement('th');
1502
- th.textContent = column.label;
1503
- headerRow.appendChild(th);
1504
- });
1505
- thead.appendChild(headerRow);
1506
- table.appendChild(thead);
1507
- const tbody = document.createElement('tbody');
1508
- config.rows.forEach((row) => {
1509
- const tr = document.createElement('tr');
1510
- columns.forEach((column) => {
1511
- const td = document.createElement('td');
1512
- const cellValue = this.resolveCellValue(row, column, config.resolveValue);
1513
- const plainValue = this.toPlainExportValue(cellValue, true);
1514
- td.textContent = plainValue === null ? '' : String(plainValue);
1515
- tr.appendChild(td);
1516
- });
1517
- tbody.appendChild(tr);
1518
- });
1519
- table.appendChild(tbody);
1520
- return table;
1521
- }
1522
- /**
1523
- * A browser cannot paginate a table horizontally. Keep wide exports inside
1524
- * the printable page by splitting them into readable tables and repeating
1525
- * the first (normally identifying) column in every continuation group.
1526
- */
1527
- getPrintColumnGroups(columns) {
1528
- if (columns.length <= TableExportService.MAX_PRINT_COLUMNS_PER_TABLE) {
1529
- return [columns];
1530
- }
1531
- const [identityColumn, ...remainingColumns] = columns;
1532
- const continuationSize = TableExportService.MAX_PRINT_COLUMNS_PER_TABLE - 1;
1533
- const groups = [];
1534
- for (let index = 0; index < remainingColumns.length; index += continuationSize) {
1535
- groups.push([
1536
- identityColumn,
1537
- ...remainingColumns.slice(index, index + continuationSize),
1538
- ]);
1539
- }
1540
- return groups;
1541
- }
1542
- /**
1543
- * Normalises a resolved cell value for export. Rich-text columns surface their
1544
- * value as an HTML string, so string cells are stripped to plain text (tags
1545
- * removed, entities decoded) before they reach an Excel cell or a PDF table
1546
- * cell. Non-string values (numbers, booleans, dates) pass through untouched.
1547
- */
1548
- toPlainExportValue(value, localizeBoolean) {
1549
- if (localizeBoolean &&
1550
- typeof value === 'boolean' &&
1551
- this.isArabicExport()) {
1552
- return this.transloco.translate(value ? 'components.table.yes' : 'components.table.no');
1553
- }
1554
- return typeof value === 'string'
1555
- ? stripHtmlToPlainText(value)
1556
- : (value ?? null);
1557
- }
1558
- configureWorksheet(worksheet, columns, rows) {
1559
- if (worksheet['!ref']) {
1560
- worksheet['!autofilter'] = { ref: worksheet['!ref'] };
1561
- }
1562
- worksheet['!cols'] = columns.map((column) => {
1563
- const contentWidth = rows.reduce((width, row) => Math.max(width, String(row[column.label] ?? '').length), column.label.length);
1564
- return { wch: Math.min(50, Math.max(10, contentWidth + 2)) };
1565
- });
1566
- }
1567
- isArabicExport() {
1568
- return /^ar(?:-|$)/i.test(this.transloco.getActiveLang());
1569
- }
1570
- isRtlExport() {
1571
- const language = this.transloco.getActiveLang();
1572
- const documentIsRtl = typeof document !== 'undefined' &&
1573
- document.documentElement.dir.toLowerCase() === 'rtl';
1574
- return TableExportService.RTL_LANGUAGES.test(language) || documentIsRtl;
1575
- }
1576
- normalizeFilename(value) {
1577
- const sanitized = (value ?? '').trim().replace(/[\\/:*?"<>|]+/g, '-');
1578
- return sanitized.length ? sanitized : 'download';
1579
- }
1580
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableExportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1581
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableExportService, providedIn: 'root' });
1582
- }
1583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableExportService, decorators: [{
1584
- type: Injectable,
1585
- args: [{ providedIn: 'root' }]
1586
- }] });
1587
-
1588
- /**
1589
- * Column filter types that produce useful (low-cardinality) row groups.
1590
- * Unique-valued columns (plain text, dates) would create a group per row —
1591
- * pointless visually and slow — so we exclude them from the group picker.
1592
- */
1593
- const GROUPABLE_FILTER_TYPES = new Set([
1594
- 'select',
1595
- 'boolean',
1596
- 'user',
1597
- ]);
1598
- /**
1599
- * Entity view types whose values are categorical enough to bucket rows by.
1600
- * Entity columns are judged on this rather than their filter type: a
1601
- * `LookupMatrix` (e.g. a risk Classification) filters as free text but its
1602
- * values are a small fixed set, so it groups perfectly well.
1603
- */
1604
- const GROUPABLE_ENTITY_VIEW_TYPES = new Set([
1605
- 'Status',
1606
- 'Lookup',
1607
- 'LookupMatrix',
1608
- 'PhaseGate',
1609
- 'User',
1610
- 'Checkbox',
1611
- ]);
1612
- /** Bucket every row whose grouped value is missing/empty falls into. */
1613
- const EMPTY_GROUP_KEY = '__mt_group_empty__';
1614
- /**
1615
- * Pure controller owning all row-grouping concerns. Table instantiates one and
1616
- * binds its signals — keeps grouping logic out of table.ts.
1617
- *
1618
- * PrimeNG's subheader grouping renders only when `sortField === groupRowsBy`.
1619
- * `setGroup` therefore also pins the sort to the grouped column; clearing the
1620
- * group leaves the user's sort untouched.
1621
- */
1622
- class TableGroupingController {
1623
- columns;
1624
- rows;
1625
- groupBy;
1626
- sortField;
1627
- sortDirection;
1628
- transloco;
1629
- constructor(columns, rows, groupBy, sortField, sortDirection, transloco) {
1630
- this.columns = columns;
1631
- this.rows = rows;
1632
- this.groupBy = groupBy;
1633
- this.sortField = sortField;
1634
- this.sortDirection = sortDirection;
1635
- this.transloco = transloco;
1636
- }
1637
- translate(key) {
1638
- return this.transloco ? this.transloco.translate(key) : key;
1639
- }
1640
- groupableColumns = computed(() => {
1641
- const sampleRow = this.rows()[0];
1642
- return this.columns().filter((col) => {
1643
- if (col.filterOnly)
1644
- return false;
1645
- // Explicit `groupable` wins over the cardinality heuristic in both
1646
- // directions — the host knows when a high-cardinality column is still
1647
- // worth grouping (backend-ordered) or when a low-cardinality one isn't.
1648
- if (typeof col.groupable === 'boolean')
1649
- return col.groupable;
1650
- if (col.type === 'custom')
1651
- return false;
1652
- if (col.type === 'entity') {
1653
- const viewType = TableValueResolver.getEntityViewType(col, sampleRow);
1654
- return !!viewType && GROUPABLE_ENTITY_VIEW_TYPES.has(viewType);
1655
- }
1656
- const filterType = TableValueResolver.getColumnFilterType(col, sampleRow);
1657
- return filterType !== null && GROUPABLE_FILTER_TYPES.has(filterType);
1658
- });
1659
- }, ...(ngDevMode ? [{ debugName: "groupableColumns" }] : /* istanbul ignore next */ []));
1660
- /**
1661
- * Row counts per group key — consumed by the group header template so each
1662
- * subheader can show "Status: Active (12)".
1663
- */
1664
- groupCounts = computed(() => {
1665
- const column = this.activeGroupColumn();
1666
- if (!column)
1667
- return new Map();
1668
- const counts = new Map();
1669
- for (const row of this.rows()) {
1670
- const key = this.getGroupKey(row, column);
1671
- counts.set(key, (counts.get(key) ?? 0) + 1);
1672
- }
1673
- return counts;
1674
- }, ...(ngDevMode ? [{ debugName: "groupCounts" }] : /* istanbul ignore next */ []));
1675
- getGroupCount(row) {
1676
- const column = this.activeGroupColumn();
1677
- if (!column)
1678
- return 0;
1679
- return this.groupCounts().get(this.getGroupKey(row, column)) ?? 0;
1680
- }
1681
- activeGroupColumn = computed(() => {
1682
- const key = this.groupBy();
1683
- if (!key)
1684
- return null;
1685
- return this.columns().find((col) => col.key === key) ?? null;
1686
- }, ...(ngDevMode ? [{ debugName: "activeGroupColumn" }] : /* istanbul ignore next */ []));
1687
- groupingActive = computed(() => this.activeGroupColumn() !== null, ...(ngDevMode ? [{ debugName: "groupingActive" }] : /* istanbul ignore next */ []));
1688
- /**
1689
- * Whether the group header repeats the grouped column's name before the
1690
- * value. Opt-out per column via `ColumnDef.showGroupColumnLabel`.
1691
- */
1692
- showsGroupColumnLabel = computed(() => this.activeGroupColumn()?.showGroupColumnLabel !== false, ...(ngDevMode ? [{ debugName: "showsGroupColumnLabel" }] : /* istanbul ignore next */ []));
1693
- /**
1694
- * Returns true when the given column is the active group column and
1695
- * therefore cannot have its sort cleared (PrimeNG requirement).
1696
- */
1697
- isGroupLockedSort(columnKey) {
1698
- return this.groupingActive() && this.activeGroupColumn()?.key === columnKey;
1699
- }
1700
- setGroup(key) {
1701
- this.groupBy.set(key && key.length > 0 ? key : null);
1702
- if (key) {
1703
- this.sortField.set(key);
1704
- if (this.sortDirection() === null) {
1705
- this.sortDirection.set('asc');
1706
- }
1707
- }
1708
- }
1709
- /**
1710
- * Display label for a row's grouped value — used by the `#groupheader`
1711
- * template. Leverages the same resolver pipeline the cells use, so status
1712
- * maps / user display names render consistently.
1713
- */
1714
- getGroupLabel(row) {
1715
- const column = this.activeGroupColumn();
1716
- if (!column)
1717
- return '';
1718
- const cellValue = TableValueResolver.getProperty(row, column.key);
1719
- if (cellValue === null || cellValue === undefined || cellValue === '') {
1720
- return '—';
1721
- }
1722
- if (column.type === 'entity') {
1723
- const entityValue = TableValueResolver.getEntityValueByType(cellValue, 'export');
1724
- return entityValue === null ? '—' : String(entityValue);
1725
- }
1726
- const display = TableValueResolver.resolveDisplayValue(cellValue);
1727
- if (display === null || display === undefined)
1728
- return '—';
1729
- if (typeof display === 'boolean')
1730
- return display
1731
- ? this.translate('components.table.yes')
1732
- : this.translate('components.table.no');
1733
- return String(display);
1734
- }
1735
- /**
1736
- * Accent color for status/entity-Status group headers. Reused from the
1737
- * cell renderer's status-map pipeline so tint is consistent with the cell.
1738
- */
1739
- getGroupAccentColor(row) {
1740
- const column = this.activeGroupColumn();
1741
- if (!column)
1742
- return null;
1743
- if (column.type !== 'status' && column.type !== 'entity')
1744
- return null;
1745
- const cellValue = TableValueResolver.getProperty(row, column.key);
1746
- if (cellValue === null || cellValue === undefined)
1747
- return null;
1748
- if (typeof cellValue === 'object') {
1749
- const obj = cellValue;
1750
- const color = obj['color'];
1751
- if (typeof color === 'string' && color.length > 0)
1752
- return color;
1753
- // Entity cells carry the color on the resolved value, not the wrapper.
1754
- const value = obj['value'];
1755
- if (value && typeof value === 'object') {
1756
- const valueColor = value['color'];
1757
- if (typeof valueColor === 'string' && valueColor.length > 0) {
1758
- return valueColor;
1759
- }
1760
- }
1761
- }
1762
- return null;
1763
- }
1764
- /**
1765
- * Returns the stable string key for the active group column on this row.
1766
- * Used to add a synthetic `__mt_group__` field so PrimeNG compares a plain
1767
- * string rather than a complex entity object (whose JSON representation is
1768
- * not stable across rows).
1769
- */
1770
- getGroupSortKey(row) {
1771
- const column = this.activeGroupColumn();
1772
- if (!column)
1773
- return '';
1774
- return this.getGroupKey(row, column);
1775
- }
1776
- /** Stable key used to bucket rows into groups — normalised to string. */
1777
- getGroupKey(row, column) {
1778
- // A column can name its own identity field, so rows sharing a display
1779
- // label still split into separate groups (and vice versa).
1780
- if (column.groupKey) {
1781
- const identity = TableValueResolver.getProperty(row, column.groupKey);
1782
- return identity === null || identity === undefined || identity === ''
1783
- ? EMPTY_GROUP_KEY
1784
- : String(identity);
1785
- }
1786
- const cellValue = TableValueResolver.getProperty(row, column.key);
1787
- if (cellValue === null || cellValue === undefined || cellValue === '') {
1788
- return EMPTY_GROUP_KEY;
1789
- }
1790
- if (column.type === 'entity') {
1791
- const entityValue = TableValueResolver.getEntityValueByType(cellValue, 'filter');
1792
- return entityValue === null ? EMPTY_GROUP_KEY : String(entityValue);
1793
- }
1794
- const display = TableValueResolver.resolveDisplayValue(cellValue);
1795
- return display === null || display === undefined
1796
- ? EMPTY_GROUP_KEY
1797
- : String(display);
1798
- }
1799
- }
1800
-
1801
- const DEFAULT_PERSIST_STATE_EXCLUDE = ['pagePosition'];
1802
- class Table {
1803
- static LOADING_COLUMN_COUNT = 5;
1804
- selectionChange = output();
1805
- cellChange = output();
1806
- lazyLoad = output();
1807
- columnReorder = output();
1808
- rowReorder = output();
1809
- rowClick = output();
1810
- /**
1811
- * Fires when the per-row actions popover is opened (3-dots click) so the
1812
- * parent can lazy-load row-specific actions instead of fetching for every
1813
- * visible row up front. Only emitted when `actionShape` is `popover`.
1814
- */
1815
- rowActionsRequested = output();
1816
- filters = model({}, ...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
1817
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1818
- columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1819
- rowActions = input([], ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
1820
- size = input(undefined, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
1821
- showGridlines = input(false, { ...(ngDevMode ? { debugName: "showGridlines" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1822
- stripedRows = input(false, { ...(ngDevMode ? { debugName: "stripedRows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1823
- selectableRows = input(false, { ...(ngDevMode ? { debugName: "selectableRows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1824
- clickableRows = input(false, { ...(ngDevMode ? { debugName: "clickableRows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1825
- generalSearch = input(false, { ...(ngDevMode ? { debugName: "generalSearch" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1826
- lazyLocalSearch = input(false, { ...(ngDevMode ? { debugName: "lazyLocalSearch" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1827
- showFilters = input(false, { ...(ngDevMode ? { debugName: "showFilters" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1828
- filterMode = input('popover', ...(ngDevMode ? [{ debugName: "filterMode" }] : /* istanbul ignore next */ []));
1829
- loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1830
- updating = input(false, { ...(ngDevMode ? { debugName: "updating" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1831
- lazy = input(false, { ...(ngDevMode ? { debugName: "lazy" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1832
- lazyLocalSort = input(false, { ...(ngDevMode ? { debugName: "lazyLocalSort" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1833
- lazyTotalRecords = input(...(ngDevMode ? [undefined, { debugName: "lazyTotalRecords" }] : /* istanbul ignore next */ []));
1834
- reorderableColumns = input(false, { ...(ngDevMode ? { debugName: "reorderableColumns" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1835
- reorderableRows = input(false, { ...(ngDevMode ? { debugName: "reorderableRows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1836
- dataKey = input(...(ngDevMode ? [undefined, { debugName: "dataKey" }] : /* istanbul ignore next */ []));
1837
- storageKey = input(null, ...(ngDevMode ? [{ debugName: "storageKey" }] : /* istanbul ignore next */ []));
1838
- storageMode = input('local', ...(ngDevMode ? [{ debugName: "storageMode" }] : /* istanbul ignore next */ []));
1839
- persistStateExclude = input(DEFAULT_PERSIST_STATE_EXCLUDE, ...(ngDevMode ? [{ debugName: "persistStateExclude" }] : /* istanbul ignore next */ []));
1840
- exportable = input(false, { ...(ngDevMode ? { debugName: "exportable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1841
- printable = input(false, { ...(ngDevMode ? { debugName: "printable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1842
- groupable = input(false, { ...(ngDevMode ? { debugName: "groupable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1843
- /**
1844
- * Optional external group-count map keyed by the group display label
1845
- * (e.g. `"Approved" → 42`). When provided, the group header shows these
1846
- * totals instead of the local page row count. Use this in lazy tables where
1847
- * the backend provides total-count-per-group via KPI/stats data.
1848
- */
1849
- groupCountMap = input(null, ...(ngDevMode ? [{ debugName: "groupCountMap" }] : /* istanbul ignore next */ []));
1850
- cellClickFilter = input(false, { ...(ngDevMode ? { debugName: "cellClickFilter" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1851
- /**
1852
- * When true and `rowActions` is non-empty, the trailing actions column is
1853
- * pinned to the right via PrimeNG's frozen-column support. The table also
1854
- * switches to scrollable mode so horizontal scrolling reveals the rest of
1855
- * the columns while the actions stay visible. Off by default to preserve
1856
- * existing layout for tables that don't opt in.
1857
- */
1858
- freezeActions = input(false, { ...(ngDevMode ? { debugName: "freezeActions" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1859
- virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1860
- virtualScrollItemSize = input(52, ...(ngDevMode ? [{ debugName: "virtualScrollItemSize" }] : /* istanbul ignore next */ []));
1861
- scrollHeight = input('520px', ...(ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []));
1862
- printTitle = input('', ...(ngDevMode ? [{ debugName: "printTitle" }] : /* istanbul ignore next */ []));
1863
- exportFilename = input('download', ...(ngDevMode ? [{ debugName: "exportFilename" }] : /* istanbul ignore next */ []));
1864
- actionShape = input('flat', ...(ngDevMode ? [{ debugName: "actionShape" }] : /* istanbul ignore next */ []));
1865
- /**
1866
- * Optional per-row predicate. When it returns true for a given row, the
1867
- * row-actions popover renders a small skeleton block instead of the action
1868
- * list — used while a parent is fetching that row's actions on demand.
1869
- */
1870
- rowActionsLoadingFn = input(null, ...(ngDevMode ? [{ debugName: "rowActionsLoadingFn" }] : /* istanbul ignore next */ []));
1871
- tableLayout = input('fixed', ...(ngDevMode ? [{ debugName: "tableLayout" }] : /* istanbul ignore next */ []));
1872
- noCard = input(false, { ...(ngDevMode ? { debugName: "noCard" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1873
- dateFormat = inject(MTDateFormatPipe);
1874
- // Tabs inputs and outputs
1875
- tabs = input(...(ngDevMode ? [undefined, { debugName: "tabs" }] : /* istanbul ignore next */ []));
1876
- tabsOptionLabel = input('label', ...(ngDevMode ? [{ debugName: "tabsOptionLabel" }] : /* istanbul ignore next */ []));
1877
- tabsOptionValue = input('value', ...(ngDevMode ? [{ debugName: "tabsOptionValue" }] : /* istanbul ignore next */ []));
1878
- activeTab = model(...(ngDevMode ? [undefined, { debugName: "activeTab" }] : /* istanbul ignore next */ []));
1879
- onTabChange = output();
1880
- // Table actions inputs and outputs
1881
- actions = input([], ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
1882
- // Content TemplateRefs
1883
- captionStartContent = contentChild('captionStart', ...(ngDevMode ? [{ debugName: "captionStartContent" }] : /* istanbul ignore next */ []));
1884
- captionEndContent = contentChild('captionEnd', ...(ngDevMode ? [{ debugName: "captionEndContent" }] : /* istanbul ignore next */ []));
1885
- emptyContent = contentChild('empty', ...(ngDevMode ? [{ debugName: "emptyContent" }] : /* istanbul ignore next */ []));
1886
- paginatorPosition = input('end', ...(ngDevMode ? [{ debugName: "paginatorPosition" }] : /* istanbul ignore next */ []));
1887
- alwaysShowPaginator = input(true, { ...(ngDevMode ? { debugName: "alwaysShowPaginator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1888
- rowsPerPageOptions = input([5, 10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "rowsPerPageOptions" }] : /* istanbul ignore next */ []));
1889
- pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
1890
- currentPage = model(0, ...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
1891
- first = model(0, ...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
1892
- filterTerm = model('', ...(ngDevMode ? [{ debugName: "filterTerm" }] : /* istanbul ignore next */ []));
1893
- groupBy = model(null, ...(ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []));
1894
- /**
1895
- * Sort state is a `model` so a lazy host that owns sort itself (URL / store)
1896
- * can push its value in instead of letting the table drift out of sync with
1897
- * the query it actually sent.
1898
- */
1899
- sortField = model(null, ...(ngDevMode ? [{ debugName: "sortField" }] : /* istanbul ignore next */ []));
1900
- sortDirection = model(null, ...(ngDevMode ? [{ debugName: "sortDirection" }] : /* istanbul ignore next */ []));
1901
- confirmationService = inject(ConfirmationService);
1902
- exportService = inject(TableExportService);
1903
- transloco = inject(TranslocoService);
1904
- grouping;
1905
- selectedRowKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "selectedRowKeys" }] : /* istanbul ignore next */ []));
1906
- transientSelectedRows = signal(new Set(), ...(ngDevMode ? [{ debugName: "transientSelectedRows" }] : /* istanbul ignore next */ []));
1907
- hydratedStorageKey = signal(null, ...(ngDevMode ? [{ debugName: "hydratedStorageKey" }] : /* istanbul ignore next */ []));
1908
- storageHydrated = signal(false, ...(ngDevMode ? [{ debugName: "storageHydrated" }] : /* istanbul ignore next */ []));
1909
- isColumnFilterMode = computed(() => this.showFilters() && this.filterMode() === 'column', ...(ngDevMode ? [{ debugName: "isColumnFilterMode" }] : /* istanbul ignore next */ []));
1910
- filterableColumnMap = computed(() => {
1911
- if (!this.isColumnFilterMode()) {
1912
- return new Map();
1913
- }
1914
- const data = this.data();
1915
- const map = new Map();
1916
- this.columns().forEach((col) => {
1917
- if (TableValueResolver.getColumnFilterType(col, data[0]) === null) {
1918
- return;
1919
- }
1920
- map.set(col.key, TableValueResolver.buildFilterableColumn(col, data));
1921
- });
1922
- return map;
1923
- }, ...(ngDevMode ? [{ debugName: "filterableColumnMap" }] : /* istanbul ignore next */ []));
1924
- getFilterableColumn(key) {
1925
- return this.filterableColumnMap().get(key);
1926
- }
1927
- onColumnFilterChange(key, value) {
1928
- const next = { ...this.filters() };
1929
- if (value === null || value === undefined) {
1930
- delete next[key];
1931
- }
1932
- else {
1933
- next[key] = value;
1934
- }
1935
- this.onFilterApplied(next);
1936
- }
1937
- activeFilterCount = computed(() => {
1938
- const filters = this.filters();
1939
- return Object.values(filters).filter((value) => value !== null && value !== undefined && value !== '').length;
1940
- }, ...(ngDevMode ? [{ debugName: "activeFilterCount" }] : /* istanbul ignore next */ []));
1941
- filteredData = computed(() => {
1942
- const data = this.data();
1943
- const applyLocalSearch = !this.lazy() || this.lazyLocalSearch();
1944
- const applyLocalSort = !this.lazy() || this.lazyLocalSort();
1945
- const searchTerm = applyLocalSearch
1946
- ? this.filterTerm().trim().toLowerCase()
1947
- : '';
1948
- const filters = this.filters();
1949
- const filterKeys = this.lazy() ? [] : Object.keys(filters);
1950
- let result = data;
1951
- // Apply search term — recurse into nested objects/arrays so column keys
1952
- // that point at a nested display (e.g. `name.display` on a lookup row)
1953
- // are still searched. Top-level-only matching used to drop multi-word
1954
- // queries on tables whose display string lives one level deep.
1955
- if (searchTerm !== '') {
1956
- result = result.filter((item) => TableValueResolver.matchesSearchTerm(item, searchTerm));
1957
- }
1958
- // Apply column filters
1959
- if (filterKeys.length > 0) {
1960
- result = result.filter((item) => filterKeys.every((key) => this.matchesFilter(item, key, filters[key])));
1961
- }
1962
- return applyLocalSort ? this.sortData(result) : result;
1963
- }, ...(ngDevMode ? [{ debugName: "filteredData" }] : /* istanbul ignore next */ []));
1964
- renderedColumns = computed(() => {
1965
- const visible = this.columns().filter((column) => !column.filterOnly);
1966
- // The grouped column's value is already the group header — repeating it in
1967
- // every row is noise. Never hide the last one, or the table would render
1968
- // with no columns at all. Export/print still read the full `columns()`.
1969
- const groupedKey = this.groupBy();
1970
- const withoutGrouped = groupedKey
1971
- ? visible.filter((column) => column.key !== groupedKey)
1972
- : visible;
1973
- const columns = withoutGrouped.length ? withoutGrouped : visible;
1974
- if (columns.length > 0 || !this.loading()) {
1975
- return columns;
1976
- }
1977
- return Array.from({ length: Table.LOADING_COLUMN_COUNT }, (_, index) => ({
1978
- key: `__loading-${index}`,
1979
- label: '',
1980
- type: 'text',
1981
- }));
1982
- }, ...(ngDevMode ? [{ debugName: "renderedColumns" }] : /* istanbul ignore next */ []));
1983
- /**
1984
- * Synthetic field name added to each row so PrimeNG's `groupRowsBy`
1985
- * compares a stable primitive string instead of a complex entity object.
1986
- */
1987
- static GROUP_KEY_FIELD = '__mt_group__';
1988
- groupKeyField = Table.GROUP_KEY_FIELD;
1989
- displayData = computed(() => {
1990
- if (this.loading()) {
1991
- return Array.from({ length: this.pageSize() }, () => ({}));
1992
- }
1993
- return this.filteredData();
1994
- }, ...(ngDevMode ? [{ debugName: "displayData" }] : /* istanbul ignore next */ []));
1995
- /**
1996
- * Display data enriched with a stable group key field so PrimeNG groups
1997
- * rows correctly. Without this, PrimeNG JSON-stringifies the full entity
1998
- * object (spread of column + backend value), which may differ between rows
1999
- * even when they share the same status display.
2000
- */
2001
- groupKeyedData = computed(() => {
2002
- const data = this.displayData();
2003
- if (!this.grouping.groupingActive())
2004
- return data;
2005
- return data.map((row) => ({
2006
- ...row,
2007
- [Table.GROUP_KEY_FIELD]: this.grouping.getGroupSortKey(row),
2008
- }));
2009
- }, ...(ngDevMode ? [{ debugName: "groupKeyedData" }] : /* istanbul ignore next */ []));
2010
- totalRecords = computed(() => {
2011
- if (this.lazy() && this.lazyTotalRecords() !== undefined) {
2012
- return this.lazyTotalRecords();
2013
- }
2014
- return this.filteredData().length;
2015
- }, ...(ngDevMode ? [{ debugName: "totalRecords" }] : /* istanbul ignore next */ []));
2016
- usesVirtualScroll = computed(() => {
2017
- if (!this.virtualScroll()) {
2018
- return false;
2019
- }
2020
- const rowCount = this.displayData().length;
2021
- if (rowCount === 0) {
2022
- return false;
2023
- }
2024
- const itemSize = this.virtualScrollItemSize();
2025
- if (!Number.isFinite(itemSize) || itemSize <= 0) {
2026
- return false;
2027
- }
2028
- const scrollHeightPx = this.resolveScrollHeightPixels(this.scrollHeight());
2029
- if (scrollHeightPx === null) {
2030
- return rowCount > this.pageSize();
2031
- }
2032
- return rowCount * itemSize > scrollHeightPx;
2033
- }, ...(ngDevMode ? [{ debugName: "usesVirtualScroll" }] : /* istanbul ignore next */ []));
2034
- showPaginator = computed(() => {
2035
- if (this.virtualScroll()) {
2036
- return false;
2037
- }
2038
- if (this.alwaysShowPaginator()) {
2039
- return true;
2040
- }
2041
- const pageSize = this.pageSize();
2042
- return pageSize > 0 && this.totalRecords() > pageSize;
2043
- }, ...(ngDevMode ? [{ debugName: "showPaginator" }] : /* istanbul ignore next */ []));
2044
- // TODO: remove after updating the toggle and checkbox logic
2045
- paginatedData = computed(() => {
2046
- const data = this.filteredData();
2047
- const first = this.first();
2048
- const pageSize = this.pageSize();
2049
- if (this.lazy() || this.virtualScroll()) {
2050
- return data;
2051
- }
2052
- return data.slice(first, first + pageSize);
2053
- }, ...(ngDevMode ? [{ debugName: "paginatedData" }] : /* istanbul ignore next */ []));
2054
- allSelectedOnPage = computed(() => {
2055
- const pageData = this.paginatedData();
2056
- if (pageData.length === 0)
2057
- return false;
2058
- return pageData.every((row) => this.isRowSelected(row));
2059
- }, ...(ngDevMode ? [{ debugName: "allSelectedOnPage" }] : /* istanbul ignore next */ []));
2060
- totalColumnSpan = computed(() => this.renderedColumns().length +
2061
- (this.reorderableRows() ? 1 : 0) +
2062
- (this.selectableRows() ? 1 : 0) +
2063
- (this.rowActions().length > 0 ? 1 : 0), ...(ngDevMode ? [{ debugName: "totalColumnSpan" }] : /* istanbul ignore next */ []));
2064
- constructor() {
2065
- this.grouping = new TableGroupingController(this.columns, this.filteredData, this.groupBy, this.sortField, this.sortDirection, this.transloco);
2066
- effect(() => {
2067
- const storageKey = this.getNormalizedStorageKey();
2068
- const storage = this.getStorage();
2069
- const previousStorageKey = this.hydratedStorageKey();
2070
- this.storageHydrated.set(false);
2071
- if (!storageKey || !storage) {
2072
- this.hydratedStorageKey.set(storageKey);
2073
- this.storageHydrated.set(true);
2074
- return;
2075
- }
2076
- if (previousStorageKey === storageKey) {
2077
- this.storageHydrated.set(true);
2078
- return;
2079
- }
2080
- const persistedState = this.getRestorablePersistedState(this.readPersistedState(storage, storageKey));
2081
- this.applyPersistedState(persistedState);
2082
- this.hydratedStorageKey.set(storageKey);
2083
- this.storageHydrated.set(true);
2084
- if (this.lazy() && this.shouldEmitLazyLoadAfterRestore(persistedState)) {
2085
- queueMicrotask(() => this.emitLazyLoad({}));
2086
- }
2087
- });
2088
- effect(() => {
2089
- const storageKey = this.getNormalizedStorageKey();
2090
- const storage = this.getStorage();
2091
- if (!storageKey ||
2092
- !storage ||
2093
- !this.storageHydrated() ||
2094
- this.hydratedStorageKey() !== storageKey) {
2095
- return;
2096
- }
2097
- this.writePersistedState(storage, storageKey, this.buildPersistedState());
2098
- });
2099
- // Drop filters / groupBy whose column no longer exists. Dynamic tables
2100
- // (e.g. runtime schemas) can drop columns between fetches, which would
2101
- // otherwise strand a filter the user can't clear from the UI.
2102
- effect(() => {
2103
- const columns = this.columns();
2104
- if (columns.length === 0 || this.loading()) {
2105
- return;
2106
- }
2107
- const validKeys = new Set(columns.map((c) => c.key));
2108
- const currentFilters = this.filters();
2109
- const staleFilterKeys = Object.keys(currentFilters).filter((key) => key !== 'generalSearch' && !validKeys.has(key));
2110
- if (staleFilterKeys.length > 0) {
2111
- const next = { ...currentFilters };
2112
- staleFilterKeys.forEach((key) => delete next[key]);
2113
- this.filters.set(next);
2114
- }
2115
- const currentGroup = this.groupBy();
2116
- if (currentGroup && !validKeys.has(currentGroup)) {
2117
- this.groupBy.set(null);
2118
- }
2119
- });
2120
- effect(() => {
2121
- if (this.lazy()) {
2122
- return;
2123
- }
2124
- const totalRecords = this.totalRecords();
2125
- const pageSize = this.pageSize();
2126
- const currentFirst = this.first();
2127
- if (pageSize <= 0) {
2128
- return;
2129
- }
2130
- const maxFirst = totalRecords > 0
2131
- ? Math.floor((totalRecords - 1) / pageSize) * pageSize
2132
- : 0;
2133
- const normalizedFirst = Math.min(currentFirst, maxFirst);
2134
- const normalizedPage = Math.floor(normalizedFirst / pageSize);
2135
- if (normalizedFirst !== currentFirst) {
2136
- this.first.set(normalizedFirst);
2137
- }
2138
- if (this.currentPage() !== normalizedPage) {
2139
- this.currentPage.set(normalizedPage);
2140
- }
2141
- });
2142
- }
2143
- /**
2144
- * Returns the count for a group row — uses `groupCountMap` when provided
2145
- * (e.g. backend KPI totals) so lazy tables show the real total instead of
2146
- * the current-page row count.
2147
- */
2148
- getDisplayGroupCount(row) {
2149
- const map = this.groupCountMap();
2150
- if (map) {
2151
- const label = this.grouping.getGroupLabel(row);
2152
- const count = map.get(label);
2153
- if (count !== undefined)
2154
- return count;
2155
- }
2156
- return this.grouping.getGroupCount(row);
2157
- }
2158
- /**
2159
- * Called when the user picks a group column from the caption's actions menu.
2160
- * Syncs PrimeNG grouping sort state and asks lazy tables to reload grouped
2161
- * rows consecutively from the backend.
2162
- */
2163
- onGroupByChange(key) {
2164
- this.groupBy.set(key);
2165
- if (key) {
2166
- this.sortField.set(key);
2167
- if (this.sortDirection() === null) {
2168
- this.sortDirection.set('asc');
2169
- }
2170
- }
2171
- else {
2172
- this.sortField.set(null);
2173
- this.sortDirection.set(null);
2174
- }
2175
- // Grouping re-orders the whole result set, so the current offset points at
2176
- // unrelated rows — restart at page 1 like a filter change does.
2177
- this.first.set(0);
2178
- this.currentPage.set(0);
2179
- if (this.lazy()) {
2180
- queueMicrotask(() => this.emitLazyLoad({}));
2181
- }
2182
- }
2183
- onFilterApplied(filters) {
2184
- this.filters.set(this.withoutGeneralSearch(filters));
2185
- this.first.set(0);
2186
- this.currentPage.set(0);
2187
- if (this.lazy()) {
2188
- this.emitLazyLoad({});
2189
- }
2190
- }
2191
- onFilterReset() {
2192
- this.filters.set({});
2193
- this.first.set(0);
2194
- this.currentPage.set(0);
2195
- if (this.lazy()) {
2196
- this.emitLazyLoad({});
2197
- }
2198
- }
2199
- matchesFilter(item, key, filterValue) {
2200
- const column = this.columns().find((col) => col.key === key);
2201
- return TableValueResolver.matchesFilter(item, key, filterValue, column);
2202
- }
2203
- toggleRow(row) {
2204
- const rowKey = this.getRowSelectionKey(row);
2205
- if (rowKey !== null) {
2206
- const nextSelection = new Set(this.selectedRowKeys());
2207
- if (nextSelection.has(rowKey)) {
2208
- nextSelection.delete(rowKey);
2209
- }
2210
- else {
2211
- nextSelection.add(rowKey);
2212
- }
2213
- this.selectedRowKeys.set(nextSelection);
2214
- }
2215
- else {
2216
- const nextSelection = new Set(this.transientSelectedRows());
2217
- if (nextSelection.has(row)) {
2218
- nextSelection.delete(row);
2219
- }
2220
- else {
2221
- nextSelection.add(row);
2222
- }
2223
- this.transientSelectedRows.set(nextSelection);
2224
- }
2225
- this.emitSelectionChange();
2226
- }
2227
- toggleAllRowsOnPage() {
2228
- const pageData = this.paginatedData();
2229
- const allSelected = this.allSelectedOnPage();
2230
- const nextSelectedRowKeys = new Set(this.selectedRowKeys());
2231
- const nextTransientSelection = new Set(this.transientSelectedRows());
2232
- pageData.forEach((row) => {
2233
- const rowKey = this.getRowSelectionKey(row);
2234
- if (rowKey !== null) {
2235
- if (allSelected) {
2236
- nextSelectedRowKeys.delete(rowKey);
2237
- }
2238
- else {
2239
- nextSelectedRowKeys.add(rowKey);
2240
- }
2241
- return;
2242
- }
2243
- if (allSelected) {
2244
- nextTransientSelection.delete(row);
2245
- }
2246
- else {
2247
- nextTransientSelection.add(row);
2248
- }
2249
- });
2250
- this.selectedRowKeys.set(nextSelectedRowKeys);
2251
- this.transientSelectedRows.set(nextTransientSelection);
2252
- this.emitSelectionChange();
2253
- }
2254
- getProperty(obj, key) {
2255
- return TableValueResolver.getProperty(obj, key);
2256
- }
2257
- getDateProperty(obj, key) {
2258
- return TableValueResolver.resolveDateValue(this.getProperty(obj, key));
2259
- }
2260
- getEntityPreviewData(row, col) {
2261
- const cellValue = this.getProperty(row, col.key);
2262
- if (col.type === 'user') {
2263
- return this.buildUserEntityData(cellValue, col.label);
2264
- }
2265
- if (col.type === 'status') {
2266
- return this.buildStatusEntityData(cellValue, col);
2267
- }
2268
- return null;
2269
- }
2270
- /**
2271
- * Entity data resolver that abstracts over the `user` / `status` vs `entity`
2272
- * distinction — used by the shared filterable-cell template so the three
2273
- * cases don't duplicate markup.
2274
- */
2275
- resolveCellEntityData(row, col) {
2276
- if (col.type === 'entity') {
2277
- return this.getEntityColumnData(row, col);
2278
- }
2279
- if (col.type === 'user' || col.type === 'status') {
2280
- return this.getEntityPreviewData(row, col);
2281
- }
2282
- return null;
2283
- }
2284
- tabChanged(tab) {
2285
- this.filterTerm.set('');
2286
- this.first.set(0);
2287
- this.currentPage.set(0);
2288
- this.onTabChange.emit(tab);
2289
- }
2290
- onTablePage(event) {
2291
- if (this.lazy()) {
2292
- this.handleLazyLoad(event);
2293
- return;
2294
- }
2295
- this.updatePagingFromEvent(event);
2296
- }
2297
- handleLazyLoad(event) {
2298
- this.updatePagingFromEvent(event);
2299
- this.emitLazyLoad(event);
2300
- }
2301
- onPaginatorPage(event) {
2302
- if (this.lazy()) {
2303
- this.handleLazyLoad(event);
2304
- return;
2305
- }
2306
- this.updatePagingFromEvent(event);
2307
- }
2308
- onSearchChange(searchTerm) {
2309
- this.filterTerm.set(searchTerm);
2310
- this.first.set(0);
2311
- this.currentPage.set(0);
2312
- if (this.lazy() && !this.lazyLocalSearch()) {
2313
- this.emitLazyLoad({});
2314
- }
2315
- }
2316
- toggleSort(column) {
2317
- if (!this.isColumnSortable(column)) {
2318
- return;
2319
- }
2320
- if (this.sortField() !== column.key) {
2321
- this.sortField.set(column.key);
2322
- this.sortDirection.set('asc');
2323
- return;
2324
- }
2325
- const direction = this.sortDirection();
2326
- if (direction === 'asc') {
2327
- this.sortDirection.set('desc');
2328
- return;
2329
- }
2330
- if (direction === 'desc') {
2331
- // Tri-state reset. PrimeNG subheader grouping breaks without a matching
2332
- // sort, so when this column is the active group we wrap to 'asc' instead.
2333
- if (this.grouping.isGroupLockedSort(column.key)) {
2334
- this.sortDirection.set('asc');
2335
- }
2336
- else {
2337
- this.sortField.set(null);
2338
- this.sortDirection.set(null);
2339
- }
2340
- return;
2341
- }
2342
- this.sortDirection.set('asc');
2343
- }
2344
- isColumnSortable(column) {
2345
- return column.sortable === true && (!this.lazy() || this.lazyLocalSort());
2346
- }
2347
- getSortIcon(column) {
2348
- if (this.sortField() !== column.key || !this.sortDirection()) {
2349
- return 'arrow.chevron-selector-vertical';
2350
- }
2351
- return this.sortDirection() === 'asc'
2352
- ? 'arrow.arrow-up'
2353
- : 'arrow.arrow-down';
2354
- }
2355
- onCellChange(row, columnKey, newValue, type) {
2356
- this.setProperty(row, columnKey, newValue);
2357
- this.cellChange.emit({
2358
- row,
2359
- column: columnKey,
2360
- value: newValue,
2361
- type: type,
2362
- });
2363
- }
2364
- resolveActionLoading(action, row) {
2365
- if (typeof action.loading === 'function') {
2366
- return action.loading(row);
2367
- }
2368
- return action.loading;
2369
- }
2370
- getVisibleRowActions(row) {
2371
- return this.rowActions().filter((action) => !action.hidden?.(row));
2372
- }
2373
- getInlineRowActions(row) {
2374
- return this.getVisibleRowActions(row).filter((action) => action.placement === 'inline');
2375
- }
2376
- getMenuRowActions(row) {
2377
- return this.getVisibleRowActions(row).filter((action) => action.placement !== 'inline');
2378
- }
2379
- shouldShowRowActionsPopover(row) {
2380
- return (this.isRowActionsLoading(row) || this.getMenuRowActions(row).length > 0);
2381
- }
2382
- isRowActionsLoading(row) {
2383
- return this.rowActionsLoadingFn()?.(row) ?? false;
2384
- }
2385
- onRowActionsToggle(event, popover, row) {
2386
- this.rowActionsRequested.emit(row);
2387
- popover.toggle(event);
2388
- }
2389
- onColumnReorder(event) {
2390
- this.columnReorder.emit(event);
2391
- }
2392
- onRowReorder(event) {
2393
- this.rowReorder.emit({
2394
- ...event,
2395
- value: event.value ?? this.data(),
2396
- });
2397
- }
2398
- onRowClick(event, row) {
2399
- if (!this.clickableRows() || this.loading()) {
2400
- return;
2401
- }
2402
- const target = event.target;
2403
- if (target?.closest('button, a, input, textarea, select, label, [role="button"], [data-row-click-ignore="true"]')) {
2404
- return;
2405
- }
2406
- this.rowClick.emit(row);
2407
- }
2408
- updatePagingFromEvent(event) {
2409
- const first = event?.first ?? this.first();
2410
- const rows = event?.rows ?? this.pageSize();
2411
- this.first.set(first);
2412
- this.pageSize.set(rows);
2413
- const page = typeof event?.page === 'number'
2414
- ? event.page
2415
- : Math.floor((first ?? 0) / (rows || 1));
2416
- this.currentPage.set(page);
2417
- }
2418
- emitLazyLoad(event) {
2419
- const sortField = this.sortField();
2420
- this.lazyLoad.emit({
2421
- ...event,
2422
- // Sort is always reported, and `null` explicitly means "no sort". Without
2423
- // that, a host can't tell "sort unchanged" from "sort cleared" and keeps
2424
- // sending a stale backend sort after the user clears it.
2425
- sortField,
2426
- sortOrder: sortField ? (this.sortDirection() === 'desc' ? -1 : 1) : 0,
2427
- pageSize: this.pageSize(),
2428
- currentPage: this.currentPage() + 1,
2429
- first: this.first(),
2430
- filters: this.lazyLoadFilters(),
2431
- });
2432
- }
2433
- lazyLoadFilters() {
2434
- const filters = this.withoutGeneralSearch(this.filters());
2435
- const searchTerm = this.filterTerm().trim();
2436
- if (!searchTerm || this.lazyLocalSearch()) {
2437
- return filters;
2438
- }
2439
- return {
2440
- ...filters,
2441
- generalSearch: searchTerm,
2442
- };
2443
- }
2444
- withoutGeneralSearch(filters) {
2445
- if (!Object.prototype.hasOwnProperty.call(filters, 'generalSearch')) {
2446
- return filters;
2447
- }
2448
- const next = { ...filters };
2449
- delete next['generalSearch'];
2450
- return next;
2451
- }
2452
- exportExcel() {
2453
- if (this.loading()) {
2454
- return;
2455
- }
2456
- this.exportService.exportToExcel({
2457
- rows: this.filteredData(),
2458
- columns: this.columns(),
2459
- filename: this.exportFilename(),
2460
- resolveValue: (row, column) => this.getColumnExportValue(row, column),
2461
- });
2462
- }
2463
- printPdf() {
2464
- if (this.loading()) {
2465
- return;
2466
- }
2467
- this.exportService.printPdf({
2468
- rows: this.filteredData(),
2469
- columns: this.columns(),
2470
- filename: this.exportFilename(),
2471
- title: this.printTitle() || undefined,
2472
- resolveValue: (row, column) => this.getColumnExportValue(row, column),
2473
- });
2474
- }
2475
- onCellFilterClick(event, row, column) {
2476
- if (!this.cellClickFilter())
2477
- return;
2478
- const next = TableValueResolver.buildClickFilterValue(row, column);
2479
- if (next === null || next === undefined)
2480
- return;
2481
- event.stopPropagation();
2482
- const current = this.filters();
2483
- const patched = { ...current };
2484
- if (TableValueResolver.isFilterValueEqual(current[column.key], next)) {
2485
- delete patched[column.key];
2486
- }
2487
- else {
2488
- patched[column.key] = next;
2489
- }
2490
- this.onFilterApplied(patched);
2491
- }
2492
- isCellFilterActive(row, column) {
2493
- if (!this.cellClickFilter())
2494
- return false;
2495
- const current = this.filters()[column.key];
2496
- if (current === null || current === undefined)
2497
- return false;
2498
- const next = TableValueResolver.buildClickFilterValue(row, column);
2499
- if (next === null || next === undefined)
2500
- return false;
2501
- return TableValueResolver.isFilterValueEqual(current, next);
2502
- }
2503
- isCellClickFilterable(column, row) {
2504
- if (!this.cellClickFilter())
2505
- return false;
2506
- if (column.type === 'boolean') {
2507
- // Editable booleans keep the toggle interaction; only readonly ones filter.
2508
- return column.readonly === true;
2509
- }
2510
- if (column.type === 'status' || column.type === 'user')
2511
- return true;
2512
- if (column.type === 'entity') {
2513
- const filterType = TableValueResolver.getColumnFilterType(column, row);
2514
- return (filterType === 'select' ||
2515
- filterType === 'user' ||
2516
- filterType === 'boolean');
2517
- }
2518
- return false;
2519
- }
2520
- rowAction(event, action, row) {
2521
- if (!action.confirmation) {
2522
- action.action(row);
2523
- }
2524
- else if (action.confirmation?.confirmationType === 'delete') {
2525
- this.confirmationService.confirmDelete({
2526
- event: event,
2527
- ...action.confirmation,
2528
- accept: () => {
2529
- action.action(row);
2530
- },
2531
- reject: () => { },
2532
- });
2533
- }
2534
- else {
2535
- this.confirmationService.confirm({
2536
- event: event,
2537
- ...action.confirmation,
2538
- accept: () => {
2539
- action.action(row);
2540
- },
2541
- reject: () => { },
2542
- });
2543
- }
2544
- }
2545
- buildUserEntityData(value, columnLabel) {
2546
- if (!value)
2547
- return null;
2548
- // Some APIs return `image` instead of the `photoUrl` expected by EntityUserValue.
2549
- // Normalize here so the entity-user component always receives `photoUrl`.
2550
- const normalizedValue = typeof value === 'object' && !('photoUrl' in value) && 'image' in value
2551
- ? {
2552
- ...value,
2553
- photoUrl: value['image'],
2554
- }
2555
- : value;
2556
- return {
2557
- name: columnLabel,
2558
- viewType: 'User',
2559
- value: normalizedValue,
2560
- configuration: {
2561
- hideLabel: true,
2562
- showDisplayName: true,
2563
- showPhoneNumber: false,
2564
- showEmail: false,
2565
- },
2566
- };
2567
- }
2568
- buildStatusEntityData(value, column) {
2569
- const statusValue = this.resolveStatusValue(value, column);
2570
- return {
2571
- name: column.label,
2572
- viewType: 'Status',
2573
- value: statusValue ?? '',
2574
- configuration: {
2575
- hideName: true,
2576
- },
2577
- };
2578
- }
2579
- resolveStatusValue(value, column) {
2580
- const unwrappedValue = this.unwrapStatusValue(value, column);
2581
- if (unwrappedValue === null ||
2582
- unwrappedValue === undefined ||
2583
- unwrappedValue === '') {
2584
- return null;
2585
- }
2586
- if (typeof unwrappedValue === 'object') {
2587
- const objectValue = unwrappedValue;
2588
- const statusKey = this.readStringProperty(objectValue, 'key') ??
2589
- this.readStringProperty(objectValue, 'code') ??
2590
- this.readStringProperty(objectValue, 'value') ??
2591
- this.readStringProperty(objectValue, 'id') ??
2592
- this.readStringProperty(objectValue, 'display') ??
2593
- this.readStringProperty(objectValue, 'displayValue') ??
2594
- this.readStringProperty(objectValue, 'displayName') ??
2595
- this.readStringProperty(objectValue, 'label') ??
2596
- this.readStringProperty(objectValue, 'name');
2597
- const mappedStatus = this.resolveStatusMapValue(column, statusKey);
2598
- const display = this.readStringProperty(objectValue, 'display') ??
2599
- this.readStringProperty(objectValue, 'displayValue') ??
2600
- this.readStringProperty(objectValue, 'displayName') ??
2601
- this.readStringProperty(objectValue, 'label') ??
2602
- this.readStringProperty(objectValue, 'name') ??
2603
- mappedStatus?.display ??
2604
- statusKey;
2605
- if (!display) {
2606
- return null;
2607
- }
2608
- return {
2609
- key: statusKey ?? display,
2610
- display,
2611
- color: this.readStringProperty(objectValue, 'color') ??
2612
- mappedStatus?.color ??
2613
- this.resolveDefaultStatusColor(statusKey ?? display),
2614
- description: this.readStringProperty(objectValue, 'description') ??
2615
- mappedStatus?.description,
2616
- };
2617
- }
2618
- const normalizedValue = TableValueResolver.resolveDisplayValue(unwrappedValue);
2619
- if (normalizedValue === null || normalizedValue === undefined) {
2620
- return null;
2621
- }
2622
- const statusKey = String(normalizedValue);
2623
- const mappedStatus = this.resolveStatusMapValue(column, statusKey);
2624
- return {
2625
- key: statusKey,
2626
- display: mappedStatus?.display ?? statusKey,
2627
- color: mappedStatus?.color ?? this.resolveDefaultStatusColor(statusKey),
2628
- description: mappedStatus?.description,
2629
- };
2630
- }
2631
- unwrapStatusValue(value, column) {
2632
- if (!value || typeof value !== 'object') {
2633
- return value;
2634
- }
2635
- const entityValue = value;
2636
- if (!('value' in value)) {
2637
- return value;
2638
- }
2639
- if (entityValue.viewType === 'Status' ||
2640
- this.isEntityStatusCompatibilityColumn(column)) {
2641
- return entityValue.value;
2642
- }
2643
- return value;
2644
- }
2645
- isEntityStatusCompatibilityColumn(column) {
2646
- return column?.type === 'entity' && this.isStatusColumnKey(column.key);
2647
- }
2648
- isStatusColumnKey(key) {
2649
- return typeof key === 'string' && key.trim().toLowerCase() === 'status';
2650
- }
2651
- resolveStatusMapValue(column, key) {
2652
- if (!column?.statusMap || !key) {
2653
- return undefined;
2654
- }
2655
- const directMatch = column.statusMap[key];
2656
- if (directMatch) {
2657
- return directMatch;
2658
- }
2659
- const normalizedKey = this.normalizeStatusToken(key);
2660
- return Object.entries(column.statusMap).find(([entryKey]) => this.normalizeStatusToken(entryKey) === normalizedKey)?.[1];
2661
- }
2662
- resolveDefaultStatusColor(value) {
2663
- const normalizedValue = this.normalizeStatusToken(value);
2664
- if ([
2665
- 'active',
2666
- 'approved',
2667
- 'completed',
2668
- 'create',
2669
- 'created',
2670
- 'done',
2671
- 'enabled',
2672
- 'healthy',
2673
- 'low',
2674
- 'open',
2675
- 'published',
2676
- 'runtime',
2677
- 'success',
2678
- 'succeeded',
2679
- ].includes(normalizedValue)) {
2680
- return '#047857';
2681
- }
2682
- if ([
2683
- 'change',
2684
- 'current',
2685
- 'draft',
2686
- 'inprogress',
2687
- 'info',
2688
- 'medium',
2689
- 'process',
2690
- 'progress',
2691
- 'running',
2692
- 'update',
2693
- 'updated',
2694
- ].includes(normalizedValue)) {
2695
- return '#0369a1';
2696
- }
2697
- if ([
2698
- 'bulkupdate',
2699
- 'comment',
2700
- 'configure',
2701
- 'configured',
2702
- 'controlpanel',
2703
- 'discussion',
2704
- ].includes(normalizedValue)) {
2705
- return '#4338ca';
2706
- }
2707
- if ([
2708
- 'awaiting',
2709
- 'escalation',
2710
- 'high',
2711
- 'hold',
2712
- 'move',
2713
- 'moved',
2714
- 'pending',
2715
- 'phasegate',
2716
- 'queued',
2717
- 'warning',
2718
- ].includes(normalizedValue)) {
2719
- return '#b45309';
2720
- }
2721
- if ([
2722
- 'blocked',
2723
- 'cancelled',
2724
- 'canceled',
2725
- 'close',
2726
- 'closed',
2727
- 'critical',
2728
- 'delete',
2729
- 'deleted',
2730
- 'error',
2731
- 'failed',
2732
- 'governance',
2733
- 'inactive',
2734
- 'rejected',
2735
- ].includes(normalizedValue)) {
2736
- return '#be123c';
2737
- }
2738
- return '#475569';
2739
- }
2740
- normalizeStatusToken(value) {
2741
- return value
2742
- .trim()
2743
- .toLocaleLowerCase()
2744
- .replace(/[\s_-]+/g, '');
2745
- }
2746
- readStringProperty(value, key) {
2747
- const propertyValue = value[key];
2748
- return typeof propertyValue === 'string' && propertyValue.trim().length > 0
2749
- ? propertyValue.trim()
2750
- : null;
2751
- }
2752
- /**
2753
- * Gets the entity data for an 'entity' type column.
2754
- * The row data is expected to already be in EntityData format.
2755
- * Automatically hides entity name and configures User entities
2756
- * to show only avatar + displayName.
2757
- */
2758
- getEntityColumnData(row, col) {
2759
- const cellValue = this.getProperty(row, col.key);
2760
- if (!cellValue || typeof cellValue !== 'object')
2761
- return null;
2762
- const entityData = cellValue;
2763
- if (this.isEntityStatusCompatibilityColumn(col)) {
2764
- return this.buildStatusEntityData(cellValue, col);
2765
- }
2766
- // For User entities: show avatar + displayName only
2767
- if (entityData.viewType === 'User') {
2768
- return {
2769
- ...entityData,
2770
- configuration: {
2771
- ...entityData.configuration,
2772
- hideName: true,
2773
- showDisplayName: true,
2774
- showPhoneNumber: false,
2775
- showEmail: false,
2776
- },
2777
- };
2778
- }
2779
- // For all other entities: hide the name label
2780
- return {
2781
- ...entityData,
2782
- configuration: {
2783
- ...entityData.configuration,
2784
- hideName: true,
2785
- },
2786
- };
2787
- }
2788
- getStatusEntityAccentColor(row) {
2789
- const statusColumn = this.columns().find((column) => this.isStatusColumnKey(column.key));
2790
- if (!statusColumn) {
2791
- return null;
2792
- }
2793
- return this.resolveStatusEntityAccentColor(this.getProperty(row, statusColumn.key), statusColumn);
2794
- }
2795
- resolveStatusEntityAccentColor(value, column) {
2796
- return this.resolveStatusValue(value, column)?.color ?? null;
2797
- }
2798
- getBooleanProperty(obj, key) {
2799
- const value = this.getProperty(obj, key);
2800
- if (typeof value === 'boolean') {
2801
- return value;
2802
- }
2803
- return TableValueResolver.resolveBooleanValue(value) ?? false;
2804
- }
2805
- setProperty(obj, key, value) {
2806
- const path = key.split('.');
2807
- const lastKey = path.pop();
2808
- if (!lastKey) {
2809
- return;
2810
- }
2811
- const target = path.reduce((current, segment) => {
2812
- if (!current?.[segment] || typeof current[segment] !== 'object') {
2813
- current[segment] = {};
2814
- }
2815
- return current[segment];
2816
- }, obj);
2817
- if (target && typeof target === 'object') {
2818
- target[lastKey] = value;
2819
- }
2820
- }
2821
- sortData(data) {
2822
- const field = this.sortField();
2823
- const direction = this.sortDirection();
2824
- if (!field || !direction) {
2825
- return data;
2826
- }
2827
- const column = this.columns().find((item) => item.key === field);
2828
- if (!column || !this.isColumnSortable(column)) {
2829
- return data;
2830
- }
2831
- return [...data].sort((leftRow, rightRow) => {
2832
- const leftValue = this.getSortValue(leftRow, column);
2833
- const rightValue = this.getSortValue(rightRow, column);
2834
- if (leftValue === rightValue)
2835
- return 0;
2836
- if (leftValue === null || leftValue === undefined || leftValue === '') {
2837
- return 1;
2838
- }
2839
- if (rightValue === null ||
2840
- rightValue === undefined ||
2841
- rightValue === '') {
2842
- return -1;
2843
- }
2844
- const comparison = leftValue < rightValue ? -1 : 1;
2845
- return direction === 'asc' ? comparison : -comparison;
2846
- });
2847
- }
2848
- getSortValue(row, column) {
2849
- const cellValue = this.getProperty(row, column.key);
2850
- const resolvedValue = this.getColumnResolvedValue(row, column);
2851
- if (resolvedValue === null ||
2852
- resolvedValue === undefined ||
2853
- resolvedValue === '') {
2854
- return null;
2855
- }
2856
- if (column.type === 'date' || column.type === 'dateTime') {
2857
- return TableValueResolver.normalizeDateSortValue(cellValue);
2858
- }
2859
- if (typeof resolvedValue === 'number') {
2860
- return resolvedValue;
2861
- }
2862
- if (typeof resolvedValue === 'boolean') {
2863
- return resolvedValue ? 1 : 0;
2864
- }
2865
- if (cellValue instanceof Date) {
2866
- return cellValue.getTime();
2867
- }
2868
- return TableValueResolver.normalizeTextSortValue(resolvedValue);
2869
- }
2870
- /**
2871
- * Export/print value resolver — same pipeline as `getColumnResolvedValue`
2872
- * except date / dateTime columns (and their entity counterparts) are
2873
- * formatted via the MT date pipe so Excel and PDF show locale-aware dates
2874
- * instead of raw ISO strings. Sort path keeps the ISO form for ordering.
2875
- */
2876
- getColumnExportValue(row, column) {
2877
- const cellValue = this.getProperty(row, column.key);
2878
- if (cellValue === null || cellValue === undefined)
2879
- return null;
2880
- const dateType = this.resolveDateColumnType(column, row);
2881
- if (dateType) {
2882
- const dateValue = TableValueResolver.resolveDateValue(column.type === 'entity'
2883
- ? TableValueResolver.getEntityValueByType(cellValue, 'sort')
2884
- : cellValue);
2885
- if (dateValue === null)
2886
- return null;
2887
- const formatted = this.dateFormat.transform(dateValue, dateType);
2888
- return formatted || null;
2889
- }
2890
- return this.getColumnResolvedValue(row, column);
2891
- }
2892
- /**
2893
- * Detects whether a column should be treated as a date for export purposes:
2894
- * native `date` / `dateTime` types, or entity columns whose viewType is
2895
- * `Date` / `DateTime` / `Time`.
2896
- */
2897
- resolveDateColumnType(column, row) {
2898
- if (column.type === 'date')
2899
- return 'date';
2900
- if (column.type === 'dateTime')
2901
- return 'dateTime';
2902
- if (column.type === 'entity') {
2903
- // `Time` is resolved ahead of the filter gate below: it is deliberately
2904
- // not filterable, but it still has to export as a formatted clock time
2905
- // rather than the raw stored value.
2906
- if (TableValueResolver.getEntityViewType(column, row) === 'Time') {
2907
- return 'time';
2908
- }
2909
- const filterType = TableValueResolver.getColumnFilterType(column, row);
2910
- if (filterType !== 'date')
2911
- return null;
2912
- const viewType = column.viewType;
2913
- if (typeof viewType === 'string' &&
2914
- viewType.toLowerCase() === 'datetime') {
2915
- return 'dateTime';
2916
- }
2917
- const cellValue = this.getProperty(row, column.key);
2918
- if (cellValue &&
2919
- typeof cellValue === 'object' &&
2920
- cellValue.viewType === 'DateTime') {
2921
- return 'dateTime';
2922
- }
2923
- return 'date';
2924
- }
2925
- return null;
2926
- }
2927
- getColumnResolvedValue(row, column) {
2928
- const cellValue = this.getProperty(row, column.key);
2929
- if (cellValue === null || cellValue === undefined) {
2930
- return null;
2931
- }
2932
- if (column.type === 'entity') {
2933
- return TableValueResolver.getEntityValueByType(cellValue, 'export');
2934
- }
2935
- if (column.type === 'boolean') {
2936
- return this.getBooleanProperty(row, column.key);
2937
- }
2938
- if (column.type === 'date' || column.type === 'dateTime') {
2939
- const dateValue = TableValueResolver.resolveDateValue(cellValue);
2940
- return dateValue instanceof Date ? dateValue.toISOString() : dateValue;
2941
- }
2942
- if (typeof cellValue === 'number' || typeof cellValue === 'boolean') {
2943
- return cellValue;
2944
- }
2945
- if (cellValue instanceof Date) {
2946
- return cellValue.toISOString();
2947
- }
2948
- return TableValueResolver.resolveDisplayValue(cellValue);
2949
- }
2950
- isRowSelected(row) {
2951
- const rowKey = this.getRowSelectionKey(row);
2952
- if (rowKey !== null) {
2953
- return this.selectedRowKeys().has(rowKey);
2954
- }
2955
- return this.transientSelectedRows().has(row);
2956
- }
2957
- getColumnMinWidth(column) {
2958
- const width = column.width?.trim();
2959
- if (!width || width.endsWith('%')) {
2960
- return null;
2961
- }
2962
- return width;
2963
- }
2964
- emitSelectionChange() {
2965
- this.selectionChange.emit(this.getSelectedRows());
2966
- }
2967
- getSelectedRows() {
2968
- const dataKey = this.dataKey();
2969
- if (!dataKey) {
2970
- return Array.from(this.transientSelectedRows());
2971
- }
2972
- const selectedRowKeys = this.selectedRowKeys();
2973
- return this.data().filter((row) => {
2974
- const rowKey = this.getRowSelectionKey(row);
2975
- return rowKey !== null && selectedRowKeys.has(rowKey);
2976
- });
2977
- }
2978
- getRowSelectionKey(row) {
2979
- const dataKey = this.dataKey();
2980
- if (!dataKey) {
2981
- return null;
2982
- }
2983
- const value = this.getProperty(row, dataKey);
2984
- if (value === null || value === undefined || value === '') {
2985
- return null;
2986
- }
2987
- return String(value);
2988
- }
2989
- getNormalizedStorageKey() {
2990
- const storageKey = this.storageKey()?.trim();
2991
- return storageKey ? storageKey : null;
2992
- }
2993
- getStorage() {
2994
- if (typeof window === 'undefined') {
2995
- return null;
2996
- }
2997
- return this.storageMode() === 'session'
2998
- ? window.sessionStorage
2999
- : window.localStorage;
3000
- }
3001
- buildPersistedState() {
3002
- const state = {};
3003
- if (this.shouldPersistStateKey('pageSize')) {
3004
- state.pageSize = this.pageSize();
3005
- }
3006
- if (this.shouldPersistStateKey('pagePosition')) {
3007
- state.first = this.first();
3008
- state.currentPage = this.currentPage();
3009
- }
3010
- if (this.shouldPersistStateKey('sort')) {
3011
- state.sortField = this.sortField();
3012
- state.sortDirection = this.sortDirection();
3013
- }
3014
- if (this.shouldPersistStateKey('selection')) {
3015
- state.selectedRowKeys = this.dataKey()
3016
- ? Array.from(this.selectedRowKeys())
3017
- : [];
3018
- }
3019
- if (this.shouldPersistStateKey('groupBy')) {
3020
- state.groupBy = this.groupBy();
3021
- }
3022
- return state;
3023
- }
3024
- applyPersistedState(persistedState) {
3025
- this.transientSelectedRows.set(new Set());
3026
- if (!persistedState) {
3027
- this.selectedRowKeys.set(new Set());
3028
- return;
3029
- }
3030
- const pageSize = this.shouldPersistStateKey('pageSize')
3031
- ? this.normalizePersistedPageSize(this.toPositiveInteger(persistedState.pageSize))
3032
- : null;
3033
- if (pageSize !== null) {
3034
- this.pageSize.set(pageSize);
3035
- }
3036
- if (this.shouldPersistStateKey('pagePosition')) {
3037
- const first = this.toNonNegativeInteger(persistedState.first);
3038
- if (first !== null) {
3039
- this.first.set(first);
3040
- }
3041
- const currentPage = this.toNonNegativeInteger(persistedState.currentPage);
3042
- if (currentPage !== null) {
3043
- this.currentPage.set(currentPage);
3044
- }
3045
- else if (first !== null && pageSize !== null) {
3046
- this.currentPage.set(Math.floor(first / pageSize));
3047
- }
3048
- }
3049
- if (this.shouldPersistStateKey('sort')) {
3050
- this.sortField.set(typeof persistedState.sortField === 'string'
3051
- ? persistedState.sortField
3052
- : null);
3053
- this.sortDirection.set(persistedState.sortDirection === 'asc' ||
3054
- persistedState.sortDirection === 'desc'
3055
- ? persistedState.sortDirection
3056
- : null);
3057
- }
3058
- if (this.shouldPersistStateKey('selection')) {
3059
- this.selectedRowKeys.set(new Set(Array.isArray(persistedState.selectedRowKeys)
3060
- ? persistedState.selectedRowKeys
3061
- : []));
3062
- }
3063
- if (this.shouldPersistStateKey('groupBy')) {
3064
- this.groupBy.set(typeof persistedState.groupBy === 'string' && persistedState.groupBy
3065
- ? persistedState.groupBy
3066
- : null);
3067
- }
3068
- }
3069
- shouldEmitLazyLoadAfterRestore(persistedState) {
3070
- if (!persistedState) {
3071
- return false;
3072
- }
3073
- return ((this.shouldPersistStateKey('pageSize') &&
3074
- persistedState.pageSize !== undefined) ||
3075
- (this.shouldPersistStateKey('pagePosition') &&
3076
- (persistedState.first !== undefined ||
3077
- persistedState.currentPage !== undefined)));
3078
- }
3079
- shouldPersistStateKey(key) {
3080
- const excluded = this.persistStateExclude();
3081
- return !(Array.isArray(excluded) ? excluded : DEFAULT_PERSIST_STATE_EXCLUDE).includes(key);
3082
- }
3083
- readPersistedState(storage, storageKey) {
3084
- try {
3085
- const raw = storage.getItem(storageKey);
3086
- if (!raw) {
3087
- return null;
3088
- }
3089
- const parsed = JSON.parse(raw);
3090
- return parsed && typeof parsed === 'object' ? parsed : null;
3091
- }
3092
- catch {
3093
- return null;
3094
- }
3095
- }
3096
- getRestorablePersistedState(persistedState) {
3097
- if (!persistedState) {
3098
- return null;
3099
- }
3100
- const restorableState = {};
3101
- if (this.shouldPersistStateKey('pageSize')) {
3102
- restorableState.pageSize = persistedState.pageSize;
3103
- }
3104
- if (this.shouldPersistStateKey('pagePosition')) {
3105
- restorableState.first = persistedState.first;
3106
- restorableState.currentPage = persistedState.currentPage;
3107
- }
3108
- if (this.shouldPersistStateKey('sort')) {
3109
- restorableState.sortField = persistedState.sortField;
3110
- restorableState.sortDirection = persistedState.sortDirection;
3111
- }
3112
- if (this.shouldPersistStateKey('selection')) {
3113
- restorableState.selectedRowKeys = persistedState.selectedRowKeys;
3114
- }
3115
- if (this.shouldPersistStateKey('groupBy')) {
3116
- restorableState.groupBy = persistedState.groupBy;
3117
- }
3118
- return Object.keys(restorableState).some((key) => restorableState[key] !== undefined)
3119
- ? restorableState
3120
- : null;
3121
- }
3122
- writePersistedState(storage, storageKey, state) {
3123
- try {
3124
- storage.setItem(storageKey, JSON.stringify(state));
3125
- }
3126
- catch {
3127
- // Ignore storage write failures.
3128
- }
3129
- }
3130
- toPositiveInteger(value) {
3131
- const normalized = Number(value);
3132
- if (!Number.isFinite(normalized) || normalized <= 0) {
3133
- return null;
3134
- }
3135
- return Math.trunc(normalized);
3136
- }
3137
- normalizePersistedPageSize(value) {
3138
- if (value === null) {
3139
- return null;
3140
- }
3141
- const allowedOptions = this.rowsPerPageOptions().filter((option) => Number.isFinite(option) && option > 0);
3142
- if (!allowedOptions.length) {
3143
- return value;
3144
- }
3145
- return allowedOptions.includes(value) ? value : allowedOptions[0];
3146
- }
3147
- resolveScrollHeightPixels(value) {
3148
- const normalized = value.trim().toLowerCase();
3149
- const match = normalized.match(/^(\d+(?:\.\d+)?)(px|rem)$/);
3150
- if (!match) {
3151
- return null;
3152
- }
3153
- const amount = Number(match[1]);
3154
- if (!Number.isFinite(amount) || amount <= 0) {
3155
- return null;
3156
- }
3157
- return match[2] === 'rem' ? amount * 16 : amount;
3158
- }
3159
- toNonNegativeInteger(value) {
3160
- const normalized = Number(value);
3161
- if (!Number.isFinite(normalized) || normalized < 0) {
3162
- return null;
3163
- }
3164
- return Math.trunc(normalized);
3165
- }
3166
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
3167
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Table, isStandalone: true, selector: "mt-table", inputs: { filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, stripedRows: { classPropertyName: "stripedRows", publicName: "stripedRows", isSignal: true, isRequired: false, transformFunction: null }, selectableRows: { classPropertyName: "selectableRows", publicName: "selectableRows", isSignal: true, isRequired: false, transformFunction: null }, clickableRows: { classPropertyName: "clickableRows", publicName: "clickableRows", isSignal: true, isRequired: false, transformFunction: null }, generalSearch: { classPropertyName: "generalSearch", publicName: "generalSearch", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSearch: { classPropertyName: "lazyLocalSearch", publicName: "lazyLocalSearch", isSignal: true, isRequired: false, transformFunction: null }, showFilters: { classPropertyName: "showFilters", publicName: "showFilters", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, updating: { classPropertyName: "updating", publicName: "updating", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, lazyLocalSort: { classPropertyName: "lazyLocalSort", publicName: "lazyLocalSort", isSignal: true, isRequired: false, transformFunction: null }, lazyTotalRecords: { classPropertyName: "lazyTotalRecords", publicName: "lazyTotalRecords", isSignal: true, isRequired: false, transformFunction: null }, reorderableColumns: { classPropertyName: "reorderableColumns", publicName: "reorderableColumns", isSignal: true, isRequired: false, transformFunction: null }, reorderableRows: { classPropertyName: "reorderableRows", publicName: "reorderableRows", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, storageKey: { classPropertyName: "storageKey", publicName: "storageKey", isSignal: true, isRequired: false, transformFunction: null }, storageMode: { classPropertyName: "storageMode", publicName: "storageMode", isSignal: true, isRequired: false, transformFunction: null }, persistStateExclude: { classPropertyName: "persistStateExclude", publicName: "persistStateExclude", isSignal: true, isRequired: false, transformFunction: null }, exportable: { classPropertyName: "exportable", publicName: "exportable", isSignal: true, isRequired: false, transformFunction: null }, printable: { classPropertyName: "printable", publicName: "printable", isSignal: true, isRequired: false, transformFunction: null }, groupable: { classPropertyName: "groupable", publicName: "groupable", isSignal: true, isRequired: false, transformFunction: null }, groupCountMap: { classPropertyName: "groupCountMap", publicName: "groupCountMap", isSignal: true, isRequired: false, transformFunction: null }, cellClickFilter: { classPropertyName: "cellClickFilter", publicName: "cellClickFilter", isSignal: true, isRequired: false, transformFunction: null }, freezeActions: { classPropertyName: "freezeActions", publicName: "freezeActions", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSize: { classPropertyName: "virtualScrollItemSize", publicName: "virtualScrollItemSize", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, printTitle: { classPropertyName: "printTitle", publicName: "printTitle", isSignal: true, isRequired: false, transformFunction: null }, exportFilename: { classPropertyName: "exportFilename", publicName: "exportFilename", isSignal: true, isRequired: false, transformFunction: null }, actionShape: { classPropertyName: "actionShape", publicName: "actionShape", isSignal: true, isRequired: false, transformFunction: null }, rowActionsLoadingFn: { classPropertyName: "rowActionsLoadingFn", publicName: "rowActionsLoadingFn", isSignal: true, isRequired: false, transformFunction: null }, tableLayout: { classPropertyName: "tableLayout", publicName: "tableLayout", isSignal: true, isRequired: false, transformFunction: null }, noCard: { classPropertyName: "noCard", publicName: "noCard", isSignal: true, isRequired: false, transformFunction: null }, tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionLabel: { classPropertyName: "tabsOptionLabel", publicName: "tabsOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, tabsOptionValue: { classPropertyName: "tabsOptionValue", publicName: "tabsOptionValue", isSignal: true, isRequired: false, transformFunction: null }, activeTab: { classPropertyName: "activeTab", publicName: "activeTab", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, paginatorPosition: { classPropertyName: "paginatorPosition", publicName: "paginatorPosition", isSignal: true, isRequired: false, transformFunction: null }, alwaysShowPaginator: { classPropertyName: "alwaysShowPaginator", publicName: "alwaysShowPaginator", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, filterTerm: { classPropertyName: "filterTerm", publicName: "filterTerm", isSignal: true, isRequired: false, transformFunction: null }, groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, sortField: { classPropertyName: "sortField", publicName: "sortField", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", cellChange: "cellChange", lazyLoad: "lazyLoad", columnReorder: "columnReorder", rowReorder: "rowReorder", rowClick: "rowClick", rowActionsRequested: "rowActionsRequested", filters: "filtersChange", activeTab: "activeTabChange", onTabChange: "onTabChange", pageSize: "pageSizeChange", currentPage: "currentPageChange", first: "firstChange", filterTerm: "filterTermChange", groupBy: "groupByChange", sortField: "sortFieldChange", sortDirection: "sortDirectionChange" }, providers: [MTDateFormatPipe], queries: [{ propertyName: "captionStartContent", first: true, predicate: ["captionStart"], descendants: true, isSignal: true }, { propertyName: "captionEndContent", first: true, predicate: ["captionEnd"], descendants: true, isSignal: true }, { propertyName: "emptyContent", first: true, predicate: ["empty"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (!noCard()) {\r\n <mt-card>\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-card>\r\n} @else {\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"space-y-4 rounded-lg\">\r\n <div>\r\n <mt-table-caption\r\n [generalSearch]=\"generalSearch()\"\r\n [showFilters]=\"showFilters()\"\r\n [filterMode]=\"filterMode()\"\r\n [exportable]=\"exportable()\"\r\n [printable]=\"printable()\"\r\n [groupable]=\"groupable()\"\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [tabs]=\"tabs()\"\r\n [tabsOptionLabel]=\"tabsOptionLabel()\"\r\n [tabsOptionValue]=\"tabsOptionValue()\"\r\n [actions]=\"actions()\"\r\n [captionStart]=\"captionStartContent() ?? null\"\r\n [captionEnd]=\"captionEndContent() ?? null\"\r\n [(activeTab)]=\"activeTab\"\r\n [(filters)]=\"filters\"\r\n [(filterTerm)]=\"filterTerm\"\r\n [groupBy]=\"groupBy()\"\r\n (groupByChange)=\"onGroupByChange($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n (onTabChange)=\"tabChanged($event)\"\r\n (searchChange)=\"onSearchChange($event)\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"overflow-x-auto rounded-[10px] border border-surface-200 bg-white\"\r\n >\r\n <p-table\r\n [value]=\"groupKeyedData()\"\r\n [columns]=\"renderedColumns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n [rowGroupMode]=\"grouping.groupingActive() ? 'subheader' : null\"\r\n [groupRowsBy]=\"grouping.groupingActive() ? groupKeyField : null\"\r\n [sortField]=\"sortField()\"\r\n [sortOrder]=\"sortDirection() === 'desc' ? -1 : 1\"\r\n [scrollable]=\"freezeActions() || usesVirtualScroll()\"\r\n [virtualScroll]=\"usesVirtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [scrollHeight]=\"usesVirtualScroll() ? scrollHeight() : undefined\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n [paginator]=\"!virtualScroll()\"\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"mt-table min-w-full align-middle text-sm\"\r\n [class.table-auto]=\"tableLayout() === 'auto'\"\r\n [class.table-fixed]=\"tableLayout() === 'fixed'\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start text-sm font-normal text-[#323232]\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-start text-sm font-normal text-[#323232]\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n <div class=\"inline-flex items-center gap-1\">\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n </div>\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"mt-actions-column text-center! text-sm font-normal text-[#323232]\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n [pFrozenColumn]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\r\n [class.mt-table-clickable-row]=\"clickableRows()\"\r\n [class.mt-table-status-entity-row]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [style.--mt-table-status-accent]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [class.cursor-pointer]=\"clickableRows()\"\r\n [pReorderableRow]=\"index\"\r\n (click)=\"onRowClick($event, row)\"\r\n >\r\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"isRowSelected(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td\r\n class=\"text-sm font-normal text-[#4b4b4b]\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n @if (isCellClickFilterable(col, row)) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"inline-flex items-center cursor-pointer px-1.5 py-0.5 rounded transition-colors\"\r\n [class.ring-2]=\"isCellFilterActive(row, col)\"\r\n [class.ring-primary-400]=\"\r\n isCellFilterActive(row, col)\r\n \"\r\n [class.hover:underline]=\"\r\n !isCellFilterActive(row, col)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n {{\r\n getBooleanProperty(row, col.key)\r\n ? (\"components.table.yes\" | transloco)\r\n : (\"components.table.no\" | transloco)\r\n }}\r\n </span>\r\n } @else {\r\n <mt-toggle-field\r\n [disabled]=\"col.readonly\"\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n ></mt-toggle-field>\r\n }\r\n }\r\n @case (\"date\") {\r\n {{\r\n getDateProperty(row, col.key) | mtDateFormat: \"date\"\r\n }}\r\n }\r\n @case (\"dateTime\") {\r\n {{\r\n getDateProperty(row, col.key)\r\n | mtDateFormat: \"dateTime\"\r\n }}\r\n }\r\n @case (\"user\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"status\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"entity\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td\r\n class=\"mt-actions-column text-right\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n [pFrozenColumn]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-center gap-1\">\r\n @for (\r\n action of getInlineRowActions(row);\r\n track $index\r\n ) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n }\r\n @if (shouldShowRowActionsPopover(row)) {\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"\r\n onRowActionsToggle($event, rowPopover, row)\r\n \"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @if (isRowActionsLoading(row)) {\r\n <div class=\"flex flex-col gap-2 p-2\">\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n </div>\r\n } @else {\r\n @for (\r\n action of getMenuRowActions(row);\r\n track $index\r\n ) {\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-center gap-2\"\r\n >\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #filterableCell let-row=\"row\" let-col=\"col\">\r\n @let filterable = isCellClickFilterable(col, row);\r\n @let active = isCellFilterActive(row, col);\r\n @if (filterable) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"flex w-full items-center rounded px-1 transition-colors\"\r\n [class.mt-cell-filterable]=\"!active\"\r\n [class.mt-cell-filter-active]=\"active\"\r\n [title]=\"\r\n active\r\n ? ('components.table.clearFilter' | transloco)\r\n : ('components.table.filterByThis' | transloco)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n </span>\r\n } @else {\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </ng-template>\r\n <ng-template #groupheader let-row>\r\n @if (grouping.groupingActive()) {\r\n <tr\r\n class=\"mt-group-header\"\r\n [style.--mt-group-accent]=\"\r\n grouping.getGroupAccentColor(row) ??\r\n 'var(--p-primary-color)'\r\n \"\r\n >\r\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <div\r\n class=\"mt-group-header__accent flex items-center gap-2.5 px-4 py-2.5 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700\"\r\n >\r\n @if (grouping.showsGroupColumnLabel()) {\r\n <span\r\n class=\"shrink-0 text-xs text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ grouping.activeGroupColumn()?.label }}\r\n </span>\r\n <span\r\n class=\"shrink-0 text-gray-300 dark:text-gray-600\"\r\n aria-hidden=\"true\"\r\n >\u00B7</span\r\n >\r\n }\r\n <span\r\n class=\"truncate text-sm font-semibold text-gray-900 dark:text-gray-100\"\r\n >\r\n {{ grouping.getGroupLabel(row) }}\r\n </span>\r\n <span\r\n class=\"ms-auto shrink-0 inline-flex items-center rounded-full bg-surface-200/70 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-surface-700/60 dark:text-gray-300\"\r\n >\r\n {{ getDisplayGroupCount(row) }}\r\n </span>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"text-center\">\r\n <div\r\n class=\"flex min-h-44 flex-col items-center justify-center gap-3 py-8 text-center\"\r\n >\r\n <svg\r\n width=\"152\"\r\n height=\"120\"\r\n viewBox=\"0 0 152 120\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <circle cx=\"76\" cy=\"52\" r=\"52\" fill=\"#E9EAEB\" />\r\n <g filter=\"url(#filter0_ddd_2474_28277)\">\r\n <path\r\n d=\"M77.6 16C66.8273 16 57.2978 21.3233 51.4987 29.4829C49.605 29.0363 47.6301 28.8 45.6 28.8C31.4615 28.8 20 40.2615 20 54.4C20 68.5385 31.4615 80 45.6 80L109.6 80C121.971 80 132 69.9712 132 57.6C132 45.2288 121.971 35.2 109.6 35.2C108.721 35.2 107.854 35.2506 107.002 35.349C102.098 23.9677 90.7797 16 77.6 16Z\"\r\n fill=\"#FAFAFA\"\r\n />\r\n <ellipse\r\n cx=\"45.6\"\r\n cy=\"54.3998\"\r\n rx=\"25.6\"\r\n ry=\"25.6\"\r\n fill=\"url(#paint0_linear_2474_28277)\"\r\n />\r\n <circle\r\n cx=\"77.6016\"\r\n cy=\"48\"\r\n r=\"32\"\r\n fill=\"url(#paint1_linear_2474_28277)\"\r\n />\r\n <ellipse\r\n cx=\"109.599\"\r\n cy=\"57.6002\"\r\n rx=\"22.4\"\r\n ry=\"22.4\"\r\n fill=\"url(#paint2_linear_2474_28277)\"\r\n />\r\n </g>\r\n <circle cx=\"21\" cy=\"19\" r=\"5\" fill=\"#F5F5F5\" />\r\n <circle cx=\"18\" cy=\"109\" r=\"7\" fill=\"#F5F5F5\" />\r\n <circle cx=\"145\" cy=\"35\" r=\"7\" fill=\"#F5F5F5\" />\r\n <circle cx=\"134\" cy=\"8\" r=\"4\" fill=\"#F5F5F5\" />\r\n <foreignObject x=\"44\" y=\"54\" width=\"64\" height=\"64\">\r\n <div\r\n xmlns=\"http://www.w3.org/1999/xhtml\"\r\n style=\"\r\n backdrop-filter: blur(4px);\r\n clip-path: url(#bgblur_0_2474_28277_clip_path);\r\n height: 100%;\r\n width: 100%;\r\n \"\r\n ></div>\r\n </foreignObject>\r\n <g data-figma-bg-blur-radius=\"8\">\r\n <path\r\n d=\"M52 86C52 72.7452 62.7452 62 76 62C89.2548 62 100 72.7452 100 86C100 99.2548 89.2548 110 76 110C62.7452 110 52 99.2548 52 86Z\"\r\n fill=\"#344054\"\r\n fill-opacity=\"0.4\"\r\n />\r\n <path\r\n d=\"M85 95L81.5001 91.5M84 85.5C84 90.1944 80.1944 94 75.5 94C70.8056 94 67 90.1944 67 85.5C67 80.8056 70.8056 77 75.5 77C80.1944 77 84 80.8056 84 85.5Z\"\r\n stroke=\"white\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </g>\r\n <defs>\r\n <filter\r\n id=\"filter0_ddd_2474_28277\"\r\n x=\"0\"\r\n y=\"16\"\r\n width=\"152\"\r\n height=\"104\"\r\n filterUnits=\"userSpaceOnUse\"\r\n color-interpolation-filters=\"sRGB\"\r\n >\r\n <feFlood\r\n flood-opacity=\"0\"\r\n result=\"BackgroundImageFix\"\r\n />\r\n <feColorMatrix\r\n in=\"SourceAlpha\"\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n result=\"hardAlpha\"\r\n />\r\n <feMorphology\r\n radius=\"1.5\"\r\n operator=\"erode\"\r\n in=\"SourceAlpha\"\r\n result=\"effect1_dropShadow_2474_28277\"\r\n />\r\n <feOffset dy=\"3\" />\r\n <feGaussianBlur stdDeviation=\"1.5\" />\r\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n <feColorMatrix\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.04 0\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in2=\"BackgroundImageFix\"\r\n result=\"effect1_dropShadow_2474_28277\"\r\n />\r\n <feColorMatrix\r\n in=\"SourceAlpha\"\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n result=\"hardAlpha\"\r\n />\r\n <feMorphology\r\n radius=\"4\"\r\n operator=\"erode\"\r\n in=\"SourceAlpha\"\r\n result=\"effect2_dropShadow_2474_28277\"\r\n />\r\n <feOffset dy=\"8\" />\r\n <feGaussianBlur stdDeviation=\"4\" />\r\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n <feColorMatrix\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.03 0\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in2=\"effect1_dropShadow_2474_28277\"\r\n result=\"effect2_dropShadow_2474_28277\"\r\n />\r\n <feColorMatrix\r\n in=\"SourceAlpha\"\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n result=\"hardAlpha\"\r\n />\r\n <feMorphology\r\n radius=\"4\"\r\n operator=\"erode\"\r\n in=\"SourceAlpha\"\r\n result=\"effect3_dropShadow_2474_28277\"\r\n />\r\n <feOffset dy=\"20\" />\r\n <feGaussianBlur stdDeviation=\"12\" />\r\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n <feColorMatrix\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.08 0\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in2=\"effect2_dropShadow_2474_28277\"\r\n result=\"effect3_dropShadow_2474_28277\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in=\"SourceGraphic\"\r\n in2=\"effect3_dropShadow_2474_28277\"\r\n result=\"shape\"\r\n />\r\n </filter>\r\n <clipPath\r\n id=\"bgblur_0_2474_28277_clip_path\"\r\n transform=\"translate(-44 -54)\"\r\n >\r\n <path\r\n d=\"M52 86C52 72.7452 62.7452 62 76 62C89.2548 62 100 72.7452 100 86C100 99.2548 89.2548 110 76 110C62.7452 110 52 99.2548 52 86Z\"\r\n />\r\n </clipPath>\r\n <linearGradient\r\n id=\"paint0_linear_2474_28277\"\r\n x1=\"25.9429\"\r\n y1=\"37.4855\"\r\n x2=\"71.2\"\r\n y2=\"79.9998\"\r\n gradientUnits=\"userSpaceOnUse\"\r\n >\r\n <stop stop-color=\"#D0D5DD\" />\r\n <stop\r\n offset=\"0.350715\"\r\n stop-color=\"white\"\r\n stop-opacity=\"0\"\r\n />\r\n </linearGradient>\r\n <linearGradient\r\n id=\"paint1_linear_2474_28277\"\r\n x1=\"53.0301\"\r\n y1=\"26.8571\"\r\n x2=\"109.602\"\r\n y2=\"80\"\r\n gradientUnits=\"userSpaceOnUse\"\r\n >\r\n <stop stop-color=\"#D0D5DD\" />\r\n <stop\r\n offset=\"0.350715\"\r\n stop-color=\"white\"\r\n stop-opacity=\"0\"\r\n />\r\n </linearGradient>\r\n <linearGradient\r\n id=\"paint2_linear_2474_28277\"\r\n x1=\"92.3992\"\r\n y1=\"42.8002\"\r\n x2=\"131.999\"\r\n y2=\"80.0002\"\r\n gradientUnits=\"userSpaceOnUse\"\r\n >\r\n <stop stop-color=\"#D0D5DD\" />\r\n <stop\r\n offset=\"0.350715\"\r\n stop-color=\"white\"\r\n stop-opacity=\"0\"\r\n />\r\n </linearGradient>\r\n </defs>\r\n </svg>\r\n <p class=\"m-0 text-base font-medium text-surface-500\">\r\n {{ \"components.table.no-data-found\" | transloco }}\r\n </p>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (showPaginator()) {\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"alwaysShowPaginator()\"\r\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: [":host ::ng-deep .p-datatable-header{padding:0 0 1.5rem;background:transparent;border:0}:host ::ng-deep .p-datatable-table{border-collapse:separate;border-spacing:0}:host ::ng-deep .p-datatable-thead>tr>th{padding:.9rem 1rem;background:#fff;border-bottom:1px solid #ebebf0;color:#323232;font-size:14px;font-weight:400;line-height:20px;white-space:nowrap}:host ::ng-deep .p-datatable-tbody>tr>td{padding:.72rem 1rem;background:#fff;border-bottom:1px solid #ebebf0;color:#4b4b4b;font-size:14px;font-weight:400;line-height:20px;vertical-align:middle}:host ::ng-deep .p-datatable-tbody>tr:last-child>td{border-bottom:0}:host ::ng-deep .p-datatable-thead>tr>th:first-child{border-top-left-radius:.625rem}:host ::ng-deep .p-datatable-thead>tr>th:last-child{border-top-right-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:.625rem}.mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,border-color .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:#fafafa}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:none}.mt-table-status-entity-row>td{background:#fff}.mt-table-status-entity-row>td:first-child:before{display:none}:host ::ng-deep tr.mt-group-header>td{padding:0!important;background:transparent}tr.mt-group-header .mt-group-header__accent{border-inline-start:3px solid var(--mt-group-accent, var(--p-primary-color))}:host ::ng-deep .mt-frozen-actions{border-inline-start:1px solid #ebebf0}:host ::ng-deep .mt-actions-column{max-width:15rem;max-inline-size:8rem}.mt-cell-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in}.mt-cell-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out}.mt-cell-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-cell-filter-active{box-shadow:inset 0 0 0 1.5px #14b8a666}\n"], dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "component", type: i1$3.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i1$3.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i1$3.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "directive", type: i1$3.ReorderableRowHandle, selector: "[pReorderableRowHandle]" }, { kind: "directive", type: i1$3.ReorderableRow, selector: "[pReorderableRow]", inputs: ["pReorderableRow", "pReorderableRowDisabled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Paginator, selector: "mt-paginator", inputs: ["rows", "totalRecords", "first", "page", "rowsPerPageOptions", "showFirstLastIcon", "showCurrentPageReport", "fluid", "pageLinkSize", "alwaysShow"], outputs: ["rowsChange", "firstChange", "pageChange", "onPageChange"] }, { kind: "component", type: CheckboxField, selector: "mt-checkbox-field", inputs: ["label", "labelPosition", "placeholder", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i4.ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TableCaption, selector: "mt-table-caption", inputs: ["generalSearch", "showFilters", "filterMode", "exportable", "printable", "groupable", "columns", "data", "groupColumns", "tabs", "tabsOptionLabel", "tabsOptionValue", "actions", "captionStart", "captionEnd", "activeTab", "filters", "filterTerm", "groupBy"], outputs: ["activeTabChange", "filtersChange", "filterTermChange", "groupByChange", "exportRequested", "printRequested", "onTabChange", "searchChange", "filterApplied", "filterReset"] }, { kind: "component", type: TableColumnFilter, selector: "mt-table-column-filter", inputs: ["column", "value"], outputs: ["filterChange"] }, { kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i1$2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3168
- }
3169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Table, decorators: [{
3170
- type: Component,
3171
- args: [{ selector: 'mt-table', standalone: true, providers: [MTDateFormatPipe], imports: [
3172
- TableModule,
3173
- NgTemplateOutlet,
3174
- ToggleField,
3175
- FormsModule,
3176
- Button,
3177
- Paginator,
3178
- CheckboxField,
3179
- SkeletonModule,
3180
- ProgressBarModule,
3181
- TranslocoModule,
3182
- TableCaption,
3183
- TableColumnFilter,
3184
- EntityPreview,
3185
- PopoverModule,
3186
- Icon,
3187
- Card,
3188
- MTDateFormatPipe,
3189
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!noCard()) {\r\n <mt-card>\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-card>\r\n} @else {\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n}\r\n\r\n<ng-template #tableContent>\r\n <div class=\"space-y-4 rounded-lg\">\r\n <div>\r\n <mt-table-caption\r\n [generalSearch]=\"generalSearch()\"\r\n [showFilters]=\"showFilters()\"\r\n [filterMode]=\"filterMode()\"\r\n [exportable]=\"exportable()\"\r\n [printable]=\"printable()\"\r\n [groupable]=\"groupable()\"\r\n [columns]=\"columns()\"\r\n [data]=\"data()\"\r\n [groupColumns]=\"grouping.groupableColumns()\"\r\n [tabs]=\"tabs()\"\r\n [tabsOptionLabel]=\"tabsOptionLabel()\"\r\n [tabsOptionValue]=\"tabsOptionValue()\"\r\n [actions]=\"actions()\"\r\n [captionStart]=\"captionStartContent() ?? null\"\r\n [captionEnd]=\"captionEndContent() ?? null\"\r\n [(activeTab)]=\"activeTab\"\r\n [(filters)]=\"filters\"\r\n [(filterTerm)]=\"filterTerm\"\r\n [groupBy]=\"groupBy()\"\r\n (groupByChange)=\"onGroupByChange($event)\"\r\n (exportRequested)=\"exportExcel()\"\r\n (printRequested)=\"printPdf()\"\r\n (onTabChange)=\"tabChanged($event)\"\r\n (searchChange)=\"onSearchChange($event)\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (filterReset)=\"onFilterReset()\"\r\n />\r\n\r\n @if (!loading() && emptyContent() && data().length === 0) {\r\n <div\r\n class=\"p-4 bg-content rounded-md text-center text-gray-600 dark:text-gray-300\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"emptyContent()\"></ng-container>\r\n </div>\r\n } @else {\r\n <div\r\n class=\"overflow-x-auto rounded-[10px] border border-surface-200 bg-white\"\r\n >\r\n <p-table\r\n [value]=\"groupKeyedData()\"\r\n [columns]=\"renderedColumns()\"\r\n [size]=\"size()\"\r\n [showGridlines]=\"showGridlines()\"\r\n [stripedRows]=\"stripedRows()\"\r\n [lazy]=\"lazy()\"\r\n [totalRecords]=\"totalRecords()\"\r\n [reorderableColumns]=\"reorderableColumns()\"\r\n [reorderableRows]=\"reorderableRows()\"\r\n [dataKey]=\"dataKey()\"\r\n [first]=\"first()\"\r\n [rows]=\"pageSize()\"\r\n [exportFilename]=\"exportFilename()\"\r\n [rowGroupMode]=\"grouping.groupingActive() ? 'subheader' : null\"\r\n [groupRowsBy]=\"grouping.groupingActive() ? groupKeyField : null\"\r\n [sortField]=\"sortField()\"\r\n [sortOrder]=\"sortDirection() === 'desc' ? -1 : 1\"\r\n [scrollable]=\"freezeActions() || usesVirtualScroll()\"\r\n [virtualScroll]=\"usesVirtualScroll()\"\r\n [virtualScrollItemSize]=\"virtualScrollItemSize()\"\r\n [scrollHeight]=\"usesVirtualScroll() ? scrollHeight() : undefined\"\r\n (onPage)=\"onTablePage($event)\"\r\n (onLazyLoad)=\"handleLazyLoad($event)\"\r\n (onColReorder)=\"onColumnReorder($event)\"\r\n (onRowReorder)=\"onRowReorder($event)\"\r\n [paginator]=\"!virtualScroll()\"\r\n paginatorStyleClass=\"hidden!\"\r\n class=\"mt-table min-w-full align-middle text-sm\"\r\n [class.table-auto]=\"tableLayout() === 'auto'\"\r\n [class.table-fixed]=\"tableLayout() === 'fixed'\"\r\n >\r\n <ng-template\r\n #header\r\n let-columns\r\n class=\"bg-surface-50 dark:bg-surface-950 border-b border-surface-300 dark:border-surface-500\"\r\n >\r\n <tr>\r\n @if (reorderableRows()) {\r\n <th class=\"w-10\"></th>\r\n }\r\n @if (selectableRows()) {\r\n <th class=\"w-12 text-start\">\r\n <mt-checkbox-field\r\n [ngModel]=\"allSelectedOnPage()\"\r\n (ngModelChange)=\"toggleAllRowsOnPage()\"\r\n ></mt-checkbox-field>\r\n </th>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n @if (reorderableColumns()) {\r\n <th\r\n pReorderableColumn\r\n class=\"text-start text-sm font-normal text-[#323232]\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n {{ col.label }}\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n </div>\r\n </th>\r\n } @else {\r\n <th\r\n class=\"text-start text-sm font-normal text-[#323232]\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n <div class=\"inline-flex items-center gap-1\">\r\n @if (isColumnSortable(col)) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex items-center gap-2 cursor-pointer\"\r\n (click)=\"toggleSort(col)\"\r\n >\r\n <span>{{ col.label }}</span>\r\n <mt-icon\r\n [icon]=\"getSortIcon(col)\"\r\n class=\"text-xs text-gray-400\"\r\n />\r\n </button>\r\n } @else {\r\n {{ col.label }}\r\n }\r\n @if (\r\n isColumnFilterMode() && getFilterableColumn(col.key);\r\n as filterableCol\r\n ) {\r\n <mt-table-column-filter\r\n [column]=\"filterableCol\"\r\n [value]=\"filters()[col.key]\"\r\n (filterChange)=\"\r\n onColumnFilterChange(col.key, $event)\r\n \"\r\n />\r\n }\r\n </div>\r\n </th>\r\n }\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <th\r\n class=\"mt-actions-column text-center! text-sm font-normal text-[#323232]\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n [pFrozenColumn]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n {{ \"components.table.actions\" | transloco }}\r\n </th>\r\n }\r\n </tr>\r\n @if (updating()) {\r\n <tr>\r\n <th [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <p-progressBar\r\n mode=\"indeterminate\"\r\n [style]=\"{ height: '4px' }\"\r\n />\r\n </th>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template\r\n #body\r\n let-row\r\n let-columns=\"columns\"\r\n let-index=\"rowIndex\"\r\n class=\"divide-y divide-gray-200\"\r\n >\r\n @if (loading()) {\r\n <tr>\r\n @if (reorderableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (selectableRows()) {\r\n <td><p-skeleton /></td>\r\n }\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td><p-skeleton /></td>\r\n }\r\n @if (rowActions().length > 0) {\r\n <td><p-skeleton /></td>\r\n }\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"border-surface-300 transition-colors duration-150 dark:border-surface-500\"\r\n [class.mt-table-clickable-row]=\"clickableRows()\"\r\n [class.mt-table-status-entity-row]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [style.--mt-table-status-accent]=\"\r\n getStatusEntityAccentColor(row)\r\n \"\r\n [class.cursor-pointer]=\"clickableRows()\"\r\n [pReorderableRow]=\"index\"\r\n (click)=\"onRowClick($event, row)\"\r\n >\r\n @if (reorderableRows()) {\r\n <td class=\"w-10 text-center\">\r\n <mt-button\r\n styleClass=\"cursor-move!\"\r\n pReorderableRowHandle\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n icon=\"general.menu-05\"\r\n ></mt-button>\r\n <!-- <mt-icon-->\r\n <!-- icon=\"general.menu-05\"-->\r\n <!-- class=\"cursor-move text-gray-500\"-->\r\n <!-- pReorderableRowHandle-->\r\n <!-- ></mt-icon>-->\r\n </td>\r\n }\r\n @if (selectableRows()) {\r\n <td class=\"w-12\">\r\n <mt-checkbox-field\r\n [ngModel]=\"isRowSelected(row)\"\r\n (ngModelChange)=\"toggleRow(row)\"\r\n ></mt-checkbox-field>\r\n </td>\r\n }\r\n\r\n @for (col of columns; track col.key || col.label || $index) {\r\n <td\r\n class=\"text-sm font-normal text-[#4b4b4b]\"\r\n [style.width]=\"col.width ?? null\"\r\n [style.minWidth]=\"getColumnMinWidth(col)\"\r\n >\r\n @switch (col.type) {\r\n @case (\"boolean\") {\r\n @if (isCellClickFilterable(col, row)) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"inline-flex items-center cursor-pointer px-1.5 py-0.5 rounded transition-colors\"\r\n [class.ring-2]=\"isCellFilterActive(row, col)\"\r\n [class.ring-primary-400]=\"\r\n isCellFilterActive(row, col)\r\n \"\r\n [class.hover:underline]=\"\r\n !isCellFilterActive(row, col)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n {{\r\n getBooleanProperty(row, col.key)\r\n ? (\"components.table.yes\" | transloco)\r\n : (\"components.table.no\" | transloco)\r\n }}\r\n </span>\r\n } @else {\r\n <mt-toggle-field\r\n [disabled]=\"col.readonly\"\r\n [ngModel]=\"getBooleanProperty(row, col.key)\"\r\n (ngModelChange)=\"\r\n onCellChange(row, col.key, $event, 'boolean')\r\n \"\r\n ></mt-toggle-field>\r\n }\r\n }\r\n @case (\"date\") {\r\n {{\r\n getDateProperty(row, col.key) | mtDateFormat: \"date\"\r\n }}\r\n }\r\n @case (\"dateTime\") {\r\n {{\r\n getDateProperty(row, col.key)\r\n | mtDateFormat: \"dateTime\"\r\n }}\r\n }\r\n @case (\"user\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"status\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"entity\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n filterableCell;\r\n context: { row: row, col: col }\r\n \"\r\n ></ng-container>\r\n }\r\n @case (\"custom\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n col.customCellTpl;\r\n context: { $implicit: row }\r\n \"\r\n >\r\n </ng-container>\r\n }\r\n @default {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </td>\r\n }\r\n\r\n @if (rowActions().length > 0) {\r\n <td\r\n class=\"mt-actions-column text-right\"\r\n [class.mt-frozen-actions]=\"freezeActions()\"\r\n [pFrozenColumn]=\"freezeActions()\"\r\n alignFrozen=\"right\"\r\n >\r\n @if (actionShape() === \"popover\") {\r\n <div class=\"flex items-center justify-center gap-1\">\r\n @for (\r\n action of getInlineRowActions(row);\r\n track $index\r\n ) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n }\r\n @if (shouldShowRowActionsPopover(row)) {\r\n <mt-button\r\n icon=\"general.dots-vertical\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"large\"\r\n (click)=\"\r\n onRowActionsToggle($event, rowPopover, row)\r\n \"\r\n data-row-click-ignore=\"true\"\r\n ></mt-button>\r\n <p-popover #rowPopover appendTo=\"body\">\r\n <div class=\"flex flex-col min-w-40\">\r\n @if (isRowActionsLoading(row)) {\r\n <div class=\"flex flex-col gap-2 p-2\">\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n <p-skeleton height=\"1.5rem\" />\r\n </div>\r\n } @else {\r\n @for (\r\n action of getMenuRowActions(row);\r\n track $index\r\n ) {\r\n <button\r\n class=\"flex items-center gap-2 px-2 cursor-pointer py-2 text-sm rounded transition-colors\"\r\n [class]=\"\r\n action.color === 'danger'\r\n ? 'text-red-600 hover:bg-red-50 dark:hover:bg-red-950'\r\n : 'text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-surface-700'\r\n \"\r\n (click)=\"\r\n rowAction($event, action, row);\r\n rowPopover.hide()\r\n \"\r\n >\r\n @if (action.icon) {\r\n <mt-icon\r\n [icon]=\"action.icon\"\r\n class=\"text-base\"\r\n />\r\n }\r\n <span>{{\r\n action.label || action.tooltip\r\n }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </p-popover>\r\n }\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-center gap-2\"\r\n >\r\n @for (action of rowActions(); track $index) {\r\n @let hidden = action.hidden?.(row);\r\n @if (!hidden) {\r\n <mt-button\r\n [icon]=\"action.icon\"\r\n [severity]=\"action.color\"\r\n [variant]=\"action.variant\"\r\n [size]=\"action.size || 'small'\"\r\n (click)=\"rowAction($event, action, row)\"\r\n [tooltip]=\"action.tooltip\"\r\n [label]=\"action.label\"\r\n [loading]=\"resolveActionLoading(action, row)\"\r\n ></mt-button>\r\n }\r\n }\r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #filterableCell let-row=\"row\" let-col=\"col\">\r\n @let filterable = isCellClickFilterable(col, row);\r\n @let active = isCellFilterActive(row, col);\r\n @if (filterable) {\r\n <span\r\n data-row-click-ignore=\"true\"\r\n class=\"flex w-full items-center rounded px-1 transition-colors\"\r\n [class.mt-cell-filterable]=\"!active\"\r\n [class.mt-cell-filter-active]=\"active\"\r\n [title]=\"\r\n active\r\n ? ('components.table.clearFilter' | transloco)\r\n : ('components.table.filterByThis' | transloco)\r\n \"\r\n (click)=\"onCellFilterClick($event, row, col)\"\r\n >\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n </span>\r\n } @else {\r\n @if (resolveCellEntityData(row, col); as entityData) {\r\n <mt-entity-preview\r\n [data]=\"entityData\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n } @else {\r\n {{ getProperty(row, col.key) }}\r\n }\r\n }\r\n </ng-template>\r\n <ng-template #groupheader let-row>\r\n @if (grouping.groupingActive()) {\r\n <tr\r\n class=\"mt-group-header\"\r\n [style.--mt-group-accent]=\"\r\n grouping.getGroupAccentColor(row) ??\r\n 'var(--p-primary-color)'\r\n \"\r\n >\r\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"!p-0\">\r\n <div\r\n class=\"mt-group-header__accent flex items-center gap-2.5 px-4 py-2.5 bg-surface-50 dark:bg-surface-900 border-y border-surface-200 dark:border-surface-700\"\r\n >\r\n @if (grouping.showsGroupColumnLabel()) {\r\n <span\r\n class=\"shrink-0 text-xs text-gray-500 dark:text-gray-400\"\r\n >\r\n {{ grouping.activeGroupColumn()?.label }}\r\n </span>\r\n <span\r\n class=\"shrink-0 text-gray-300 dark:text-gray-600\"\r\n aria-hidden=\"true\"\r\n >\u00B7</span\r\n >\r\n }\r\n <span\r\n class=\"truncate text-sm font-semibold text-gray-900 dark:text-gray-100\"\r\n >\r\n {{ grouping.getGroupLabel(row) }}\r\n </span>\r\n <span\r\n class=\"ms-auto shrink-0 inline-flex items-center rounded-full bg-surface-200/70 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-surface-700/60 dark:text-gray-300\"\r\n >\r\n {{ getDisplayGroupCount(row) }}\r\n </span>\r\n </div>\r\n </td>\r\n </tr>\r\n }\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td [attr.colspan]=\"totalColumnSpan()\" class=\"text-center\">\r\n <div\r\n class=\"flex min-h-44 flex-col items-center justify-center gap-3 py-8 text-center\"\r\n >\r\n <svg\r\n width=\"152\"\r\n height=\"120\"\r\n viewBox=\"0 0 152 120\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <circle cx=\"76\" cy=\"52\" r=\"52\" fill=\"#E9EAEB\" />\r\n <g filter=\"url(#filter0_ddd_2474_28277)\">\r\n <path\r\n d=\"M77.6 16C66.8273 16 57.2978 21.3233 51.4987 29.4829C49.605 29.0363 47.6301 28.8 45.6 28.8C31.4615 28.8 20 40.2615 20 54.4C20 68.5385 31.4615 80 45.6 80L109.6 80C121.971 80 132 69.9712 132 57.6C132 45.2288 121.971 35.2 109.6 35.2C108.721 35.2 107.854 35.2506 107.002 35.349C102.098 23.9677 90.7797 16 77.6 16Z\"\r\n fill=\"#FAFAFA\"\r\n />\r\n <ellipse\r\n cx=\"45.6\"\r\n cy=\"54.3998\"\r\n rx=\"25.6\"\r\n ry=\"25.6\"\r\n fill=\"url(#paint0_linear_2474_28277)\"\r\n />\r\n <circle\r\n cx=\"77.6016\"\r\n cy=\"48\"\r\n r=\"32\"\r\n fill=\"url(#paint1_linear_2474_28277)\"\r\n />\r\n <ellipse\r\n cx=\"109.599\"\r\n cy=\"57.6002\"\r\n rx=\"22.4\"\r\n ry=\"22.4\"\r\n fill=\"url(#paint2_linear_2474_28277)\"\r\n />\r\n </g>\r\n <circle cx=\"21\" cy=\"19\" r=\"5\" fill=\"#F5F5F5\" />\r\n <circle cx=\"18\" cy=\"109\" r=\"7\" fill=\"#F5F5F5\" />\r\n <circle cx=\"145\" cy=\"35\" r=\"7\" fill=\"#F5F5F5\" />\r\n <circle cx=\"134\" cy=\"8\" r=\"4\" fill=\"#F5F5F5\" />\r\n <foreignObject x=\"44\" y=\"54\" width=\"64\" height=\"64\">\r\n <div\r\n xmlns=\"http://www.w3.org/1999/xhtml\"\r\n style=\"\r\n backdrop-filter: blur(4px);\r\n clip-path: url(#bgblur_0_2474_28277_clip_path);\r\n height: 100%;\r\n width: 100%;\r\n \"\r\n ></div>\r\n </foreignObject>\r\n <g data-figma-bg-blur-radius=\"8\">\r\n <path\r\n d=\"M52 86C52 72.7452 62.7452 62 76 62C89.2548 62 100 72.7452 100 86C100 99.2548 89.2548 110 76 110C62.7452 110 52 99.2548 52 86Z\"\r\n fill=\"#344054\"\r\n fill-opacity=\"0.4\"\r\n />\r\n <path\r\n d=\"M85 95L81.5001 91.5M84 85.5C84 90.1944 80.1944 94 75.5 94C70.8056 94 67 90.1944 67 85.5C67 80.8056 70.8056 77 75.5 77C80.1944 77 84 80.8056 84 85.5Z\"\r\n stroke=\"white\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </g>\r\n <defs>\r\n <filter\r\n id=\"filter0_ddd_2474_28277\"\r\n x=\"0\"\r\n y=\"16\"\r\n width=\"152\"\r\n height=\"104\"\r\n filterUnits=\"userSpaceOnUse\"\r\n color-interpolation-filters=\"sRGB\"\r\n >\r\n <feFlood\r\n flood-opacity=\"0\"\r\n result=\"BackgroundImageFix\"\r\n />\r\n <feColorMatrix\r\n in=\"SourceAlpha\"\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n result=\"hardAlpha\"\r\n />\r\n <feMorphology\r\n radius=\"1.5\"\r\n operator=\"erode\"\r\n in=\"SourceAlpha\"\r\n result=\"effect1_dropShadow_2474_28277\"\r\n />\r\n <feOffset dy=\"3\" />\r\n <feGaussianBlur stdDeviation=\"1.5\" />\r\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n <feColorMatrix\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.04 0\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in2=\"BackgroundImageFix\"\r\n result=\"effect1_dropShadow_2474_28277\"\r\n />\r\n <feColorMatrix\r\n in=\"SourceAlpha\"\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n result=\"hardAlpha\"\r\n />\r\n <feMorphology\r\n radius=\"4\"\r\n operator=\"erode\"\r\n in=\"SourceAlpha\"\r\n result=\"effect2_dropShadow_2474_28277\"\r\n />\r\n <feOffset dy=\"8\" />\r\n <feGaussianBlur stdDeviation=\"4\" />\r\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n <feColorMatrix\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.03 0\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in2=\"effect1_dropShadow_2474_28277\"\r\n result=\"effect2_dropShadow_2474_28277\"\r\n />\r\n <feColorMatrix\r\n in=\"SourceAlpha\"\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\r\n result=\"hardAlpha\"\r\n />\r\n <feMorphology\r\n radius=\"4\"\r\n operator=\"erode\"\r\n in=\"SourceAlpha\"\r\n result=\"effect3_dropShadow_2474_28277\"\r\n />\r\n <feOffset dy=\"20\" />\r\n <feGaussianBlur stdDeviation=\"12\" />\r\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\r\n <feColorMatrix\r\n type=\"matrix\"\r\n values=\"0 0 0 0 0.0392157 0 0 0 0 0.0496732 0 0 0 0 0.0705882 0 0 0 0.08 0\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in2=\"effect2_dropShadow_2474_28277\"\r\n result=\"effect3_dropShadow_2474_28277\"\r\n />\r\n <feBlend\r\n mode=\"normal\"\r\n in=\"SourceGraphic\"\r\n in2=\"effect3_dropShadow_2474_28277\"\r\n result=\"shape\"\r\n />\r\n </filter>\r\n <clipPath\r\n id=\"bgblur_0_2474_28277_clip_path\"\r\n transform=\"translate(-44 -54)\"\r\n >\r\n <path\r\n d=\"M52 86C52 72.7452 62.7452 62 76 62C89.2548 62 100 72.7452 100 86C100 99.2548 89.2548 110 76 110C62.7452 110 52 99.2548 52 86Z\"\r\n />\r\n </clipPath>\r\n <linearGradient\r\n id=\"paint0_linear_2474_28277\"\r\n x1=\"25.9429\"\r\n y1=\"37.4855\"\r\n x2=\"71.2\"\r\n y2=\"79.9998\"\r\n gradientUnits=\"userSpaceOnUse\"\r\n >\r\n <stop stop-color=\"#D0D5DD\" />\r\n <stop\r\n offset=\"0.350715\"\r\n stop-color=\"white\"\r\n stop-opacity=\"0\"\r\n />\r\n </linearGradient>\r\n <linearGradient\r\n id=\"paint1_linear_2474_28277\"\r\n x1=\"53.0301\"\r\n y1=\"26.8571\"\r\n x2=\"109.602\"\r\n y2=\"80\"\r\n gradientUnits=\"userSpaceOnUse\"\r\n >\r\n <stop stop-color=\"#D0D5DD\" />\r\n <stop\r\n offset=\"0.350715\"\r\n stop-color=\"white\"\r\n stop-opacity=\"0\"\r\n />\r\n </linearGradient>\r\n <linearGradient\r\n id=\"paint2_linear_2474_28277\"\r\n x1=\"92.3992\"\r\n y1=\"42.8002\"\r\n x2=\"131.999\"\r\n y2=\"80.0002\"\r\n gradientUnits=\"userSpaceOnUse\"\r\n >\r\n <stop stop-color=\"#D0D5DD\" />\r\n <stop\r\n offset=\"0.350715\"\r\n stop-color=\"white\"\r\n stop-opacity=\"0\"\r\n />\r\n </linearGradient>\r\n </defs>\r\n </svg>\r\n <p class=\"m-0 text-base font-medium text-surface-500\">\r\n {{ \"components.table.no-data-found\" | transloco }}\r\n </p>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (showPaginator()) {\r\n <div\r\n class=\"flex flex-col gap-3 pb-3 px-4\"\r\n [class]=\"'items-' + paginatorPosition()\"\r\n >\r\n <mt-paginator\r\n [(rows)]=\"pageSize\"\r\n [(first)]=\"first\"\r\n [(page)]=\"currentPage\"\r\n [totalRecords]=\"totalRecords()\"\r\n [alwaysShow]=\"alwaysShowPaginator()\"\r\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\r\n (onPageChange)=\"onPaginatorPage($event)\"\r\n ></mt-paginator>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: [":host ::ng-deep .p-datatable-header{padding:0 0 1.5rem;background:transparent;border:0}:host ::ng-deep .p-datatable-table{border-collapse:separate;border-spacing:0}:host ::ng-deep .p-datatable-thead>tr>th{padding:.9rem 1rem;background:#fff;border-bottom:1px solid #ebebf0;color:#323232;font-size:14px;font-weight:400;line-height:20px;white-space:nowrap}:host ::ng-deep .p-datatable-tbody>tr>td{padding:.72rem 1rem;background:#fff;border-bottom:1px solid #ebebf0;color:#4b4b4b;font-size:14px;font-weight:400;line-height:20px;vertical-align:middle}:host ::ng-deep .p-datatable-tbody>tr:last-child>td{border-bottom:0}:host ::ng-deep .p-datatable-thead>tr>th:first-child{border-top-left-radius:.625rem}:host ::ng-deep .p-datatable-thead>tr>th:last-child{border-top-right-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:.625rem}:host ::ng-deep .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:.625rem}.mt-table-clickable-row>td{transition:background-color .16s ease,color .16s ease,border-color .16s ease}.mt-table-clickable-row:hover>td,.mt-table-clickable-row:focus-within>td{background:#fafafa}.mt-table-clickable-row:hover>td:first-child,.mt-table-clickable-row:focus-within>td:first-child{border-inline-start:none}.mt-table-status-entity-row>td{background:#fff}.mt-table-status-entity-row>td:first-child:before{display:none}:host ::ng-deep tr.mt-group-header>td{padding:0!important;background:transparent}tr.mt-group-header .mt-group-header__accent{border-inline-start:3px solid var(--mt-group-accent, var(--p-primary-color))}:host ::ng-deep .mt-frozen-actions{border-inline-start:1px solid #ebebf0}:host ::ng-deep .mt-actions-column{max-width:15rem;max-inline-size:8rem}.mt-cell-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in}.mt-cell-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out}.mt-cell-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-cell-filter-active{box-shadow:inset 0 0 0 1.5px #14b8a666}\n"] }]
3190
- }], ctorParameters: () => [], propDecorators: { selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], cellChange: [{ type: i0.Output, args: ["cellChange"] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], columnReorder: [{ type: i0.Output, args: ["columnReorder"] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], rowActionsRequested: [{ type: i0.Output, args: ["rowActionsRequested"] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showGridlines: [{ type: i0.Input, args: [{ isSignal: true, alias: "showGridlines", required: false }] }], stripedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "stripedRows", required: false }] }], selectableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectableRows", required: false }] }], clickableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickableRows", required: false }] }], generalSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "generalSearch", required: false }] }], lazyLocalSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLocalSearch", required: false }] }], showFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFilters", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMode", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], updating: [{ type: i0.Input, args: [{ isSignal: true, alias: "updating", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], lazyLocalSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyLocalSort", required: false }] }], lazyTotalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyTotalRecords", required: false }] }], reorderableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableColumns", required: false }] }], reorderableRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderableRows", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], storageKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageKey", required: false }] }], storageMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "storageMode", required: false }] }], persistStateExclude: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistStateExclude", required: false }] }], exportable: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportable", required: false }] }], printable: [{ type: i0.Input, args: [{ isSignal: true, alias: "printable", required: false }] }], groupable: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupable", required: false }] }], groupCountMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupCountMap", required: false }] }], cellClickFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClickFilter", required: false }] }], freezeActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "freezeActions", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualScrollItemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollItemSize", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], printTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "printTitle", required: false }] }], exportFilename: [{ type: i0.Input, args: [{ isSignal: true, alias: "exportFilename", required: false }] }], actionShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionShape", required: false }] }], rowActionsLoadingFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActionsLoadingFn", required: false }] }], tableLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableLayout", required: false }] }], noCard: [{ type: i0.Input, args: [{ isSignal: true, alias: "noCard", required: false }] }], tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], tabsOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionLabel", required: false }] }], tabsOptionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsOptionValue", required: false }] }], activeTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTab", required: false }] }, { type: i0.Output, args: ["activeTabChange"] }], onTabChange: [{ type: i0.Output, args: ["onTabChange"] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], captionStartContent: [{ type: i0.ContentChild, args: ['captionStart', { isSignal: true }] }], captionEndContent: [{ type: i0.ContentChild, args: ['captionEnd', { isSignal: true }] }], emptyContent: [{ type: i0.ContentChild, args: ['empty', { isSignal: true }] }], paginatorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginatorPosition", required: false }] }], alwaysShowPaginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "alwaysShowPaginator", required: false }] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], filterTerm: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterTerm", required: false }] }, { type: i0.Output, args: ["filterTermChange"] }], groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }, { type: i0.Output, args: ["groupByChange"] }], sortField: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortField", required: false }] }, { type: i0.Output, args: ["sortFieldChange"] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }, { type: i0.Output, args: ["sortDirectionChange"] }] } });
3191
-
3192
- /**
3193
- * Generated bundle index. Do not edit.
3194
- */
3195
-
3196
- export { EMPTY_GROUP_KEY, Table, TableActionsMenu, TableCaption, TableColumnFilter, TableExportService, TableFilter, TableFilterField, TableGroupingController, TableValueResolver };
3197
- //# sourceMappingURL=masterteam-components-table.mjs.map