@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
package/table/table.ts ADDED
@@ -0,0 +1,2042 @@
1
+ import {
2
+ booleanAttribute,
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ computed,
6
+ contentChild,
7
+ effect,
8
+ inject,
9
+ input,
10
+ model,
11
+ output,
12
+ signal,
13
+ TemplateRef,
14
+ } from '@angular/core';
15
+ import { NgTemplateOutlet } from '@angular/common';
16
+ import {
17
+ ColumnDef,
18
+ TableAction,
19
+ TableActionShape,
20
+ CellChangeEvent,
21
+ ColumnTypeForActionCell,
22
+ TableFilters,
23
+ FilterValue,
24
+ TableFilterMode,
25
+ TablePersistStateKey,
26
+ } from './table-types';
27
+ import { Card } from '@masterteam/components/card';
28
+ import { TableCaption } from './table-caption/table-caption';
29
+ import { TableColumnFilter } from './table-column-filter/table-column-filter';
30
+ import { TableExportService } from './table-export/table-export.service';
31
+ import { TableGroupingController } from './table-grouping/table-grouping';
32
+ import { ToggleField } from '@masterteam/components/toggle-field';
33
+ import { FormsModule } from '@angular/forms';
34
+ import { Button } from '@masterteam/components/button';
35
+ import { Paginator } from '@masterteam/components/paginator';
36
+ import { CheckboxField } from '@masterteam/components/checkbox-field';
37
+ import { TableModule, TablePageEvent } from 'primeng/table';
38
+ import { SkeletonModule } from 'primeng/skeleton';
39
+ import { ProgressBarModule } from 'primeng/progressbar';
40
+ import {
41
+ MTDateFormatPipe,
42
+ type MTDateFormatType,
43
+ } from '@masterteam/components';
44
+ import { ConfirmationService } from '@masterteam/components/confirmation';
45
+ import { TranslocoModule, TranslocoService } from '@jsverse/transloco';
46
+ import {
47
+ EntityData,
48
+ EntityPreview,
49
+ EntityStatusValue,
50
+ } from '@masterteam/components/entities';
51
+ import { PopoverModule } from 'primeng/popover';
52
+ import { Icon, MTIcon } from '@masterteam/icons';
53
+ import { EmptyState } from '@masterteam/components/empty-state';
54
+ import { TableValueResolver } from './table-value.utils';
55
+
56
+ interface PersistedTableState {
57
+ pageSize?: number;
58
+ first?: number;
59
+ currentPage?: number;
60
+ sortField?: string | null;
61
+ sortDirection?: 'asc' | 'desc' | null;
62
+ selectedRowKeys?: string[];
63
+ groupBy?: string | null;
64
+ }
65
+
66
+ const DEFAULT_PERSIST_STATE_EXCLUDE: TablePersistStateKey[] = ['pagePosition'];
67
+
68
+ @Component({
69
+ selector: 'mt-table',
70
+ templateUrl: './table.html',
71
+ styleUrls: ['./table.css'],
72
+ standalone: true,
73
+ providers: [MTDateFormatPipe],
74
+ imports: [
75
+ TableModule,
76
+ NgTemplateOutlet,
77
+ ToggleField,
78
+ FormsModule,
79
+ Button,
80
+ Paginator,
81
+ CheckboxField,
82
+ SkeletonModule,
83
+ ProgressBarModule,
84
+ TranslocoModule,
85
+ TableCaption,
86
+ TableColumnFilter,
87
+ EntityPreview,
88
+ PopoverModule,
89
+ Icon,
90
+ Card,
91
+ MTDateFormatPipe,
92
+ EmptyState,
93
+ ],
94
+ changeDetection: ChangeDetectionStrategy.OnPush,
95
+ })
96
+ export class Table {
97
+ private static readonly LOADING_COLUMN_COUNT = 5;
98
+
99
+ selectionChange = output<any[]>();
100
+ cellChange = output<CellChangeEvent>();
101
+ lazyLoad = output<any>();
102
+ columnReorder = output<any>();
103
+ rowReorder = output<any>();
104
+ rowClick = output<any>();
105
+ /** Fired when the empty state's action button is pressed. */
106
+ emptyAction = output<void>();
107
+ /**
108
+ * Fires when the per-row actions popover is opened (3-dots click) so the
109
+ * parent can lazy-load row-specific actions instead of fetching for every
110
+ * visible row up front. Only emitted when `actionShape` is `popover`.
111
+ */
112
+ rowActionsRequested = output<any>();
113
+
114
+ filters = model<TableFilters>({});
115
+
116
+ data = input.required<any[]>();
117
+ columns = input.required<ColumnDef[]>();
118
+ rowActions = input<TableAction[]>([]);
119
+ size = input<'small' | 'large' | undefined>(undefined);
120
+ showGridlines = input<boolean, unknown>(false, {
121
+ transform: booleanAttribute,
122
+ });
123
+ stripedRows = input<boolean, unknown>(false, {
124
+ transform: booleanAttribute,
125
+ });
126
+ selectableRows = input<boolean, unknown>(false, {
127
+ transform: booleanAttribute,
128
+ });
129
+ clickableRows = input<boolean, unknown>(false, {
130
+ transform: booleanAttribute,
131
+ });
132
+ generalSearch = input<boolean, unknown>(false, {
133
+ transform: booleanAttribute,
134
+ });
135
+ lazyLocalSearch = input<boolean, unknown>(false, {
136
+ transform: booleanAttribute,
137
+ });
138
+ showFilters = input<boolean, unknown>(false, {
139
+ transform: booleanAttribute,
140
+ });
141
+ filterMode = input<TableFilterMode>('popover');
142
+ loading = input<boolean, unknown>(false, {
143
+ transform: booleanAttribute,
144
+ });
145
+ updating = input<boolean, unknown>(false, {
146
+ transform: booleanAttribute,
147
+ });
148
+ lazy = input<boolean, unknown>(false, {
149
+ transform: booleanAttribute,
150
+ });
151
+ lazyLocalSort = input<boolean, unknown>(false, {
152
+ transform: booleanAttribute,
153
+ });
154
+ lazyTotalRecords = input<number>();
155
+ reorderableColumns = input<boolean, unknown>(false, {
156
+ transform: booleanAttribute,
157
+ });
158
+ reorderableRows = input<boolean, unknown>(false, {
159
+ transform: booleanAttribute,
160
+ });
161
+ dataKey = input<string>();
162
+ storageKey = input<string | null>(null);
163
+ storageMode = input<'local' | 'session'>('local');
164
+ persistStateExclude = input<TablePersistStateKey[]>(
165
+ DEFAULT_PERSIST_STATE_EXCLUDE,
166
+ );
167
+ exportable = input<boolean, unknown>(false, {
168
+ transform: booleanAttribute,
169
+ });
170
+ printable = input<boolean, unknown>(false, {
171
+ transform: booleanAttribute,
172
+ });
173
+ groupable = input<boolean, unknown>(false, {
174
+ transform: booleanAttribute,
175
+ });
176
+ /**
177
+ * Optional external group-count map keyed by the group display label
178
+ * (e.g. `"Approved" → 42`). When provided, the group header shows these
179
+ * totals instead of the local page row count. Use this in lazy tables where
180
+ * the backend provides total-count-per-group via KPI/stats data.
181
+ */
182
+ groupCountMap = input<Map<string, number> | null>(null);
183
+ cellClickFilter = input<boolean, unknown>(false, {
184
+ transform: booleanAttribute,
185
+ });
186
+ /**
187
+ * When true and `rowActions` is non-empty, the trailing actions column is
188
+ * pinned to the right via PrimeNG's frozen-column support. The table also
189
+ * switches to scrollable mode so horizontal scrolling reveals the rest of
190
+ * the columns while the actions stay visible. Off by default to preserve
191
+ * existing layout for tables that don't opt in.
192
+ */
193
+ freezeActions = input<boolean, unknown>(false, {
194
+ transform: booleanAttribute,
195
+ });
196
+ virtualScroll = input<boolean, unknown>(false, {
197
+ transform: booleanAttribute,
198
+ });
199
+ virtualScrollItemSize = input<number>(52);
200
+ scrollHeight = input<string>('520px');
201
+ printTitle = input<string>('');
202
+ exportFilename = input<string>('download');
203
+ actionShape = input<TableActionShape>('flat');
204
+ /**
205
+ * Optional per-row predicate. When it returns true for a given row, the
206
+ * row-actions popover renders a small skeleton block instead of the action
207
+ * list — used while a parent is fetching that row's actions on demand.
208
+ */
209
+ rowActionsLoadingFn = input<((row: any) => boolean) | null>(null);
210
+ tableLayout = input<'fixed' | 'auto'>('fixed');
211
+
212
+ noCard = input<boolean, unknown>(false, { transform: booleanAttribute });
213
+
214
+ private readonly dateFormat = inject(MTDateFormatPipe);
215
+
216
+ // Tabs inputs and outputs
217
+ tabs = input<any[]>();
218
+ tabsOptionLabel = input<string>('label');
219
+ tabsOptionValue = input<string>('value');
220
+ activeTab = model<any>();
221
+ onTabChange = output<any>();
222
+
223
+ // Table actions inputs and outputs
224
+ actions = input<TableAction[]>([]);
225
+
226
+ // Content TemplateRefs
227
+ captionStartContent = contentChild<TemplateRef<any>>('captionStart');
228
+ captionEndContent = contentChild<TemplateRef<any>>('captionEnd');
229
+ emptyContent = contentChild<TemplateRef<any>>('empty');
230
+
231
+ /**
232
+ * Copy for the empty state. Left unset, the table falls back to the generic
233
+ * "Nothing here yet" / "No results match your filters" pair — but a list that
234
+ * knows what it holds should say so, which is the whole point of finding
235
+ * H-12: `emptyDescription="Deliverables you own appear here."`
236
+ */
237
+ emptyTitle = input<string>();
238
+ emptyDescription = input<string>();
239
+ /**
240
+ * Call to action on the empty state. Supplying a label takes ownership of the
241
+ * behaviour: `emptyAction` fires and the table does nothing else. Without
242
+ * one, a filtered-empty table offers "Clear filters" and handles it itself.
243
+ */
244
+ emptyActionLabel = input<string>();
245
+ emptyActionIcon = input<MTIcon>();
246
+
247
+ paginatorPosition = input<'end' | 'start' | 'center'>('end');
248
+ /**
249
+ * Pagination for a single page of rows is noise that implies more data
250
+ * exists, so it is off by default now (finding M-05). Set it when the row
251
+ * count is genuinely unknown to the user and the "1 of 1" is reassuring.
252
+ */
253
+ alwaysShowPaginator = input<boolean, unknown>(false, {
254
+ transform: booleanAttribute,
255
+ });
256
+ rowsPerPageOptions = input<number[]>([5, 10, 20, 50, 100]);
257
+ pageSize = model<number>(10);
258
+ currentPage = model<number>(0);
259
+ first = model<number>(0);
260
+ filterTerm = model<string>('');
261
+ groupBy = model<string | null>(null);
262
+ /**
263
+ * Sort state is a `model` so a lazy host that owns sort itself (URL / store)
264
+ * can push its value in instead of letting the table drift out of sync with
265
+ * the query it actually sent.
266
+ */
267
+ sortField = model<string | null>(null);
268
+ sortDirection = model<'asc' | 'desc' | null>(null);
269
+ confirmationService = inject(ConfirmationService);
270
+ private readonly exportService = inject(TableExportService);
271
+ private readonly transloco = inject(TranslocoService);
272
+ protected readonly grouping: TableGroupingController;
273
+
274
+ protected selectedRowKeys = signal<Set<string>>(new Set());
275
+ protected transientSelectedRows = signal<Set<any>>(new Set());
276
+ private readonly hydratedStorageKey = signal<string | null>(null);
277
+ private readonly storageHydrated = signal(false);
278
+
279
+ protected readonly isColumnFilterMode = computed(
280
+ () => this.showFilters() && this.filterMode() === 'column',
281
+ );
282
+
283
+ protected filterableColumnMap = computed<Map<string, ColumnDef>>(() => {
284
+ if (!this.isColumnFilterMode()) {
285
+ return new Map();
286
+ }
287
+
288
+ const data = this.data();
289
+ const map = new Map<string, ColumnDef>();
290
+
291
+ this.columns().forEach((col) => {
292
+ if (TableValueResolver.getColumnFilterType(col, data[0]) === null) {
293
+ return;
294
+ }
295
+ map.set(col.key, TableValueResolver.buildFilterableColumn(col, data));
296
+ });
297
+
298
+ return map;
299
+ });
300
+
301
+ protected getFilterableColumn(key: string): ColumnDef | undefined {
302
+ return this.filterableColumnMap().get(key);
303
+ }
304
+
305
+ onColumnFilterChange(key: string, value: any): void {
306
+ const next = { ...this.filters() };
307
+ if (value === null || value === undefined) {
308
+ delete next[key];
309
+ } else {
310
+ next[key] = value;
311
+ }
312
+ this.onFilterApplied(next);
313
+ }
314
+
315
+ protected activeFilterCount = computed(() => {
316
+ const filters = this.filters();
317
+ return Object.values(filters).filter(
318
+ (value) => value !== null && value !== undefined && value !== '',
319
+ ).length;
320
+ });
321
+
322
+ /**
323
+ * Whether the user narrowed the list themselves. Drives which empty state the
324
+ * table shows: "nothing matched what you asked for, clear it" reads very
325
+ * differently from "this list has nothing in it yet" (finding H-12).
326
+ */
327
+ protected hasActiveFilters = computed(
328
+ () => this.activeFilterCount() > 0 || this.filterTerm().trim().length > 0,
329
+ );
330
+
331
+ /** Action offered on the empty state. Defaults to clearing an active filter. */
332
+ protected resolvedEmptyActionLabel = computed(() => {
333
+ const configured = this.emptyActionLabel()?.trim();
334
+ if (configured) {
335
+ return configured;
336
+ }
337
+
338
+ return this.hasActiveFilters()
339
+ ? this.transloco.translate('components.emptyState.clearFilters')
340
+ : undefined;
341
+ });
342
+
343
+ protected resolvedEmptyActionIcon = computed<MTIcon | undefined>(() => {
344
+ if (this.emptyActionLabel()?.trim()) {
345
+ return this.emptyActionIcon();
346
+ }
347
+ return this.hasActiveFilters() ? 'general.x-close' : undefined;
348
+ });
349
+
350
+ /**
351
+ * The empty-state action. A caller that supplied its own label owns the
352
+ * behaviour and just gets the event; otherwise the default action is the one
353
+ * the default label promises — clear the filters and the search term.
354
+ */
355
+ protected onEmptyAction(): void {
356
+ if (this.emptyActionLabel()?.trim()) {
357
+ this.emptyAction.emit();
358
+ return;
359
+ }
360
+
361
+ this.filterTerm.set('');
362
+ this.onFilterApplied({});
363
+ this.emptyAction.emit();
364
+ }
365
+
366
+ protected filteredData = computed(() => {
367
+ const data = this.data();
368
+ const applyLocalSearch = !this.lazy() || this.lazyLocalSearch();
369
+ const applyLocalSort = !this.lazy() || this.lazyLocalSort();
370
+ const searchTerm = applyLocalSearch
371
+ ? this.filterTerm().trim().toLowerCase()
372
+ : '';
373
+ const filters = this.filters();
374
+ const filterKeys = this.lazy() ? [] : Object.keys(filters);
375
+ let result = data;
376
+
377
+ // Apply search term — recurse into nested objects/arrays so column keys
378
+ // that point at a nested display (e.g. `name.display` on a lookup row)
379
+ // are still searched. Top-level-only matching used to drop multi-word
380
+ // queries on tables whose display string lives one level deep.
381
+ if (searchTerm !== '') {
382
+ result = result.filter((item) =>
383
+ TableValueResolver.matchesSearchTerm(item, searchTerm),
384
+ );
385
+ }
386
+
387
+ // Apply column filters
388
+ if (filterKeys.length > 0) {
389
+ result = result.filter((item) =>
390
+ filterKeys.every((key) => this.matchesFilter(item, key, filters[key])),
391
+ );
392
+ }
393
+
394
+ return applyLocalSort ? this.sortData(result) : result;
395
+ });
396
+
397
+ protected renderedColumns = computed<ColumnDef[]>(() => {
398
+ const visible = this.columns().filter((column) => !column.filterOnly);
399
+
400
+ // The grouped column's value is already the group header — repeating it in
401
+ // every row is noise. Never hide the last one, or the table would render
402
+ // with no columns at all. Export/print still read the full `columns()`.
403
+ const groupedKey = this.groupBy();
404
+ const withoutGrouped = groupedKey
405
+ ? visible.filter((column) => column.key !== groupedKey)
406
+ : visible;
407
+ const columns = withoutGrouped.length ? withoutGrouped : visible;
408
+
409
+ if (columns.length > 0 || !this.loading()) {
410
+ return columns;
411
+ }
412
+
413
+ return Array.from(
414
+ { length: Table.LOADING_COLUMN_COUNT },
415
+ (_, index): ColumnDef => ({
416
+ key: `__loading-${index}`,
417
+ label: '',
418
+ type: 'text',
419
+ }),
420
+ );
421
+ });
422
+
423
+ /**
424
+ * Synthetic field name added to each row so PrimeNG's `groupRowsBy`
425
+ * compares a stable primitive string instead of a complex entity object.
426
+ */
427
+ static readonly GROUP_KEY_FIELD = '__mt_group__';
428
+ protected readonly groupKeyField = Table.GROUP_KEY_FIELD;
429
+
430
+ protected displayData = computed(() => {
431
+ if (this.loading()) {
432
+ return Array.from({ length: this.pageSize() }, () => ({}));
433
+ }
434
+ return this.filteredData();
435
+ });
436
+
437
+ /**
438
+ * Display data enriched with a stable group key field so PrimeNG groups
439
+ * rows correctly. Without this, PrimeNG JSON-stringifies the full entity
440
+ * object (spread of column + backend value), which may differ between rows
441
+ * even when they share the same status display.
442
+ */
443
+ protected groupKeyedData = computed<any[]>(() => {
444
+ const data = this.displayData();
445
+ if (!this.grouping.groupingActive()) return data;
446
+ return data.map((row) => ({
447
+ ...(row as object),
448
+ [Table.GROUP_KEY_FIELD]: this.grouping.getGroupSortKey(row),
449
+ }));
450
+ });
451
+
452
+ protected totalRecords = computed(() => {
453
+ if (this.lazy() && this.lazyTotalRecords() !== undefined) {
454
+ return this.lazyTotalRecords() as number;
455
+ }
456
+
457
+ return this.filteredData().length;
458
+ });
459
+
460
+ protected usesVirtualScroll = computed(() => {
461
+ if (!this.virtualScroll()) {
462
+ return false;
463
+ }
464
+
465
+ const rowCount = this.displayData().length;
466
+ if (rowCount === 0) {
467
+ return false;
468
+ }
469
+
470
+ const itemSize = this.virtualScrollItemSize();
471
+ if (!Number.isFinite(itemSize) || itemSize <= 0) {
472
+ return false;
473
+ }
474
+
475
+ const scrollHeightPx = this.resolveScrollHeightPixels(this.scrollHeight());
476
+ if (scrollHeightPx === null) {
477
+ return rowCount > this.pageSize();
478
+ }
479
+
480
+ return rowCount * itemSize > scrollHeightPx;
481
+ });
482
+
483
+ protected showPaginator = computed(() => {
484
+ if (this.virtualScroll()) {
485
+ return false;
486
+ }
487
+
488
+ if (this.alwaysShowPaginator()) {
489
+ return true;
490
+ }
491
+
492
+ const pageSize = this.pageSize();
493
+ return pageSize > 0 && this.totalRecords() > pageSize;
494
+ });
495
+
496
+ // TODO: remove after updating the toggle and checkbox logic
497
+ protected paginatedData = computed(() => {
498
+ const data = this.filteredData();
499
+ const first = this.first();
500
+ const pageSize = this.pageSize();
501
+ if (this.lazy() || this.virtualScroll()) {
502
+ return data;
503
+ }
504
+ return data.slice(first, first + pageSize);
505
+ });
506
+
507
+ protected allSelectedOnPage = computed(() => {
508
+ const pageData = this.paginatedData();
509
+ if (pageData.length === 0) return false;
510
+ return pageData.every((row) => this.isRowSelected(row));
511
+ });
512
+
513
+ protected totalColumnSpan = computed(
514
+ () =>
515
+ this.renderedColumns().length +
516
+ (this.reorderableRows() ? 1 : 0) +
517
+ (this.selectableRows() ? 1 : 0) +
518
+ (this.rowActions().length > 0 ? 1 : 0),
519
+ );
520
+
521
+ constructor() {
522
+ this.grouping = new TableGroupingController(
523
+ this.columns,
524
+ this.filteredData,
525
+ this.groupBy,
526
+ this.sortField,
527
+ this.sortDirection,
528
+ this.transloco,
529
+ );
530
+
531
+ effect(() => {
532
+ const storageKey = this.getNormalizedStorageKey();
533
+ const storage = this.getStorage();
534
+ const previousStorageKey = this.hydratedStorageKey();
535
+
536
+ this.storageHydrated.set(false);
537
+
538
+ if (!storageKey || !storage) {
539
+ this.hydratedStorageKey.set(storageKey);
540
+ this.storageHydrated.set(true);
541
+ return;
542
+ }
543
+
544
+ if (previousStorageKey === storageKey) {
545
+ this.storageHydrated.set(true);
546
+ return;
547
+ }
548
+
549
+ const persistedState = this.getRestorablePersistedState(
550
+ this.readPersistedState(storage, storageKey),
551
+ );
552
+ this.applyPersistedState(persistedState);
553
+ this.hydratedStorageKey.set(storageKey);
554
+ this.storageHydrated.set(true);
555
+
556
+ if (this.lazy() && this.shouldEmitLazyLoadAfterRestore(persistedState)) {
557
+ queueMicrotask(() => this.emitLazyLoad({}));
558
+ }
559
+ });
560
+
561
+ effect(() => {
562
+ const storageKey = this.getNormalizedStorageKey();
563
+ const storage = this.getStorage();
564
+
565
+ if (
566
+ !storageKey ||
567
+ !storage ||
568
+ !this.storageHydrated() ||
569
+ this.hydratedStorageKey() !== storageKey
570
+ ) {
571
+ return;
572
+ }
573
+
574
+ this.writePersistedState(storage, storageKey, this.buildPersistedState());
575
+ });
576
+
577
+ // Drop filters / groupBy whose column no longer exists. Dynamic tables
578
+ // (e.g. runtime schemas) can drop columns between fetches, which would
579
+ // otherwise strand a filter the user can't clear from the UI.
580
+ effect(() => {
581
+ const columns = this.columns();
582
+ if (columns.length === 0 || this.loading()) {
583
+ return;
584
+ }
585
+
586
+ const validKeys = new Set(columns.map((c) => c.key));
587
+
588
+ const currentFilters = this.filters();
589
+ const staleFilterKeys = Object.keys(currentFilters).filter(
590
+ (key) => key !== 'generalSearch' && !validKeys.has(key),
591
+ );
592
+ if (staleFilterKeys.length > 0) {
593
+ const next = { ...currentFilters };
594
+ staleFilterKeys.forEach((key) => delete next[key]);
595
+ this.filters.set(next);
596
+ }
597
+
598
+ const currentGroup = this.groupBy();
599
+ if (currentGroup && !validKeys.has(currentGroup)) {
600
+ this.groupBy.set(null);
601
+ }
602
+ });
603
+
604
+ effect(() => {
605
+ if (this.lazy()) {
606
+ return;
607
+ }
608
+
609
+ const totalRecords = this.totalRecords();
610
+ const pageSize = this.pageSize();
611
+ const currentFirst = this.first();
612
+
613
+ if (pageSize <= 0) {
614
+ return;
615
+ }
616
+
617
+ const maxFirst =
618
+ totalRecords > 0
619
+ ? Math.floor((totalRecords - 1) / pageSize) * pageSize
620
+ : 0;
621
+ const normalizedFirst = Math.min(currentFirst, maxFirst);
622
+ const normalizedPage = Math.floor(normalizedFirst / pageSize);
623
+
624
+ if (normalizedFirst !== currentFirst) {
625
+ this.first.set(normalizedFirst);
626
+ }
627
+
628
+ if (this.currentPage() !== normalizedPage) {
629
+ this.currentPage.set(normalizedPage);
630
+ }
631
+ });
632
+ }
633
+
634
+ /**
635
+ * Returns the count for a group row — uses `groupCountMap` when provided
636
+ * (e.g. backend KPI totals) so lazy tables show the real total instead of
637
+ * the current-page row count.
638
+ */
639
+ getDisplayGroupCount(row: unknown): number {
640
+ const map = this.groupCountMap();
641
+ if (map) {
642
+ const label = this.grouping.getGroupLabel(row);
643
+ const count = map.get(label);
644
+ if (count !== undefined) return count;
645
+ }
646
+ return this.grouping.getGroupCount(row);
647
+ }
648
+
649
+ /**
650
+ * Called when the user picks a group column from the caption's actions menu.
651
+ * Syncs PrimeNG grouping sort state and asks lazy tables to reload grouped
652
+ * rows consecutively from the backend.
653
+ */
654
+ onGroupByChange(key: string | null): void {
655
+ this.groupBy.set(key);
656
+
657
+ if (key) {
658
+ this.sortField.set(key);
659
+ if (this.sortDirection() === null) {
660
+ this.sortDirection.set('asc');
661
+ }
662
+ } else {
663
+ this.sortField.set(null);
664
+ this.sortDirection.set(null);
665
+ }
666
+
667
+ // Grouping re-orders the whole result set, so the current offset points at
668
+ // unrelated rows — restart at page 1 like a filter change does.
669
+ this.first.set(0);
670
+ this.currentPage.set(0);
671
+
672
+ if (this.lazy()) {
673
+ queueMicrotask(() => this.emitLazyLoad({}));
674
+ }
675
+ }
676
+
677
+ onFilterApplied(filters: TableFilters): void {
678
+ this.filters.set(this.withoutGeneralSearch(filters));
679
+ this.first.set(0);
680
+ this.currentPage.set(0);
681
+
682
+ if (this.lazy()) {
683
+ this.emitLazyLoad({});
684
+ }
685
+ }
686
+
687
+ onFilterReset(): void {
688
+ this.filters.set({});
689
+ this.first.set(0);
690
+ this.currentPage.set(0);
691
+
692
+ if (this.lazy()) {
693
+ this.emitLazyLoad({});
694
+ }
695
+ }
696
+
697
+ protected matchesFilter(
698
+ item: any,
699
+ key: string,
700
+ filterValue: FilterValue | any,
701
+ ): boolean {
702
+ const column = this.columns().find((col) => col.key === key);
703
+ return TableValueResolver.matchesFilter(item, key, filterValue, column);
704
+ }
705
+
706
+ toggleRow(row: any): void {
707
+ const rowKey = this.getRowSelectionKey(row);
708
+
709
+ if (rowKey !== null) {
710
+ const nextSelection = new Set(this.selectedRowKeys());
711
+ if (nextSelection.has(rowKey)) {
712
+ nextSelection.delete(rowKey);
713
+ } else {
714
+ nextSelection.add(rowKey);
715
+ }
716
+ this.selectedRowKeys.set(nextSelection);
717
+ } else {
718
+ const nextSelection = new Set(this.transientSelectedRows());
719
+ if (nextSelection.has(row)) {
720
+ nextSelection.delete(row);
721
+ } else {
722
+ nextSelection.add(row);
723
+ }
724
+ this.transientSelectedRows.set(nextSelection);
725
+ }
726
+
727
+ this.emitSelectionChange();
728
+ }
729
+
730
+ toggleAllRowsOnPage(): void {
731
+ const pageData = this.paginatedData();
732
+ const allSelected = this.allSelectedOnPage();
733
+ const nextSelectedRowKeys = new Set(this.selectedRowKeys());
734
+ const nextTransientSelection = new Set(this.transientSelectedRows());
735
+
736
+ pageData.forEach((row) => {
737
+ const rowKey = this.getRowSelectionKey(row);
738
+ if (rowKey !== null) {
739
+ if (allSelected) {
740
+ nextSelectedRowKeys.delete(rowKey);
741
+ } else {
742
+ nextSelectedRowKeys.add(rowKey);
743
+ }
744
+ return;
745
+ }
746
+
747
+ if (allSelected) {
748
+ nextTransientSelection.delete(row);
749
+ } else {
750
+ nextTransientSelection.add(row);
751
+ }
752
+ });
753
+
754
+ this.selectedRowKeys.set(nextSelectedRowKeys);
755
+ this.transientSelectedRows.set(nextTransientSelection);
756
+ this.emitSelectionChange();
757
+ }
758
+
759
+ getProperty(obj: any, key: string): any {
760
+ return TableValueResolver.getProperty(obj, key);
761
+ }
762
+
763
+ protected getDateProperty(
764
+ obj: any,
765
+ key: string,
766
+ ): string | number | Date | null {
767
+ return TableValueResolver.resolveDateValue(this.getProperty(obj, key));
768
+ }
769
+
770
+ getEntityPreviewData(row: any, col: ColumnDef): EntityData | null {
771
+ const cellValue = this.getProperty(row, col.key);
772
+
773
+ if (col.type === 'user') {
774
+ return this.buildUserEntityData(cellValue, col.label);
775
+ }
776
+
777
+ if (col.type === 'status') {
778
+ return this.buildStatusEntityData(cellValue, col);
779
+ }
780
+
781
+ return null;
782
+ }
783
+
784
+ /**
785
+ * Entity data resolver that abstracts over the `user` / `status` vs `entity`
786
+ * distinction — used by the shared filterable-cell template so the three
787
+ * cases don't duplicate markup.
788
+ */
789
+ resolveCellEntityData(row: any, col: ColumnDef): EntityData | null {
790
+ if (col.type === 'entity') {
791
+ return this.getEntityColumnData(row, col);
792
+ }
793
+ if (col.type === 'user' || col.type === 'status') {
794
+ return this.getEntityPreviewData(row, col);
795
+ }
796
+ return null;
797
+ }
798
+
799
+ tabChanged(tab: any): void {
800
+ this.filterTerm.set('');
801
+ this.first.set(0);
802
+ this.currentPage.set(0);
803
+ this.onTabChange.emit(tab);
804
+ }
805
+
806
+ onTablePage(event: TablePageEvent): void {
807
+ if (this.lazy()) {
808
+ this.handleLazyLoad(event);
809
+ return;
810
+ }
811
+
812
+ this.updatePagingFromEvent(event);
813
+ }
814
+
815
+ handleLazyLoad(event: any): void {
816
+ this.updatePagingFromEvent(event);
817
+ this.emitLazyLoad(event);
818
+ }
819
+
820
+ onPaginatorPage(event: any): void {
821
+ if (this.lazy()) {
822
+ this.handleLazyLoad(event);
823
+ return;
824
+ }
825
+
826
+ this.updatePagingFromEvent(event);
827
+ }
828
+
829
+ onSearchChange(searchTerm: string) {
830
+ this.filterTerm.set(searchTerm);
831
+ this.first.set(0);
832
+ this.currentPage.set(0);
833
+ if (this.lazy() && !this.lazyLocalSearch()) {
834
+ this.emitLazyLoad({});
835
+ }
836
+ }
837
+
838
+ toggleSort(column: ColumnDef): void {
839
+ if (!this.isColumnSortable(column)) {
840
+ return;
841
+ }
842
+
843
+ if (this.sortField() !== column.key) {
844
+ this.sortField.set(column.key);
845
+ this.sortDirection.set('asc');
846
+ return;
847
+ }
848
+
849
+ const direction = this.sortDirection();
850
+ if (direction === 'asc') {
851
+ this.sortDirection.set('desc');
852
+ return;
853
+ }
854
+
855
+ if (direction === 'desc') {
856
+ // Tri-state reset. PrimeNG subheader grouping breaks without a matching
857
+ // sort, so when this column is the active group we wrap to 'asc' instead.
858
+ if (this.grouping.isGroupLockedSort(column.key)) {
859
+ this.sortDirection.set('asc');
860
+ } else {
861
+ this.sortField.set(null);
862
+ this.sortDirection.set(null);
863
+ }
864
+ return;
865
+ }
866
+
867
+ this.sortDirection.set('asc');
868
+ }
869
+
870
+ isColumnSortable(column: ColumnDef): boolean {
871
+ return column.sortable === true && (!this.lazy() || this.lazyLocalSort());
872
+ }
873
+
874
+ getSortIcon(column: ColumnDef): MTIcon {
875
+ if (this.sortField() !== column.key || !this.sortDirection()) {
876
+ return 'arrow.chevron-selector-vertical';
877
+ }
878
+
879
+ return this.sortDirection() === 'asc'
880
+ ? 'arrow.arrow-up'
881
+ : 'arrow.arrow-down';
882
+ }
883
+
884
+ onCellChange(
885
+ row: any,
886
+ columnKey: string,
887
+ newValue: any,
888
+ type?: ColumnTypeForActionCell,
889
+ ): void {
890
+ this.setProperty(row, columnKey, newValue);
891
+
892
+ this.cellChange.emit({
893
+ row,
894
+ column: columnKey,
895
+ value: newValue,
896
+ type: type!,
897
+ });
898
+ }
899
+
900
+ resolveActionLoading(action: TableAction, row: any): boolean | undefined {
901
+ if (typeof action.loading === 'function') {
902
+ return action.loading(row);
903
+ }
904
+ return action.loading;
905
+ }
906
+
907
+ getVisibleRowActions(row: any): TableAction[] {
908
+ return this.rowActions().filter((action) => !action.hidden?.(row));
909
+ }
910
+
911
+ getInlineRowActions(row: any): TableAction[] {
912
+ return this.getVisibleRowActions(row).filter(
913
+ (action) => action.placement === 'inline',
914
+ );
915
+ }
916
+
917
+ /**
918
+ * Menu actions with the destructive ones moved to the bottom.
919
+ *
920
+ * The Risks row menu read Preview, Update Risk, **Delete Risk**, Close Risk,
921
+ * Transfer to Issue, Escalate — the irreversible action third of six, between
922
+ * the two most common ones, separated from them by nothing but its colour
923
+ * (finding M-07). Colour alone is not separation, and it is no separation at
924
+ * all for a user with a colour-vision deficiency. Order within each group is
925
+ * preserved, so a caller's deliberate sequence still holds.
926
+ */
927
+ getMenuRowActions(row: any): TableAction[] {
928
+ const menu = this.getVisibleRowActions(row).filter(
929
+ (action) => action.placement !== 'inline',
930
+ );
931
+
932
+ return [
933
+ ...menu.filter((action) => !Table.isDestructiveAction(action)),
934
+ ...menu.filter((action) => Table.isDestructiveAction(action)),
935
+ ];
936
+ }
937
+
938
+ /**
939
+ * True for the first destructive item, which is where the divider goes. The
940
+ * divider is rendered above it rather than below the last routine item so a
941
+ * menu that is *only* destructive does not open with a stray rule.
942
+ */
943
+ protected isFirstDestructiveAction(row: any, index: number): boolean {
944
+ const menu = this.getMenuRowActions(row);
945
+ const action = menu[index];
946
+ return (
947
+ index > 0 &&
948
+ !!action &&
949
+ Table.isDestructiveAction(action) &&
950
+ !Table.isDestructiveAction(menu[index - 1])
951
+ );
952
+ }
953
+
954
+ /** Deleting, or anything the caller flagged `danger`. */
955
+ private static isDestructiveAction(action: TableAction | undefined): boolean {
956
+ if (!action) {
957
+ return false;
958
+ }
959
+ return (
960
+ action.color === 'danger' ||
961
+ action.confirmation?.confirmationType === 'delete'
962
+ );
963
+ }
964
+
965
+ shouldShowRowActionsPopover(row: any): boolean {
966
+ return (
967
+ this.isRowActionsLoading(row) || this.getMenuRowActions(row).length > 0
968
+ );
969
+ }
970
+
971
+ isRowActionsLoading(row: any): boolean {
972
+ return this.rowActionsLoadingFn()?.(row) ?? false;
973
+ }
974
+
975
+ onRowActionsToggle(
976
+ event: Event,
977
+ popover: { toggle: (e: Event) => void },
978
+ row: any,
979
+ ): void {
980
+ this.rowActionsRequested.emit(row);
981
+ popover.toggle(event);
982
+ }
983
+
984
+ onColumnReorder(event: any): void {
985
+ this.columnReorder.emit(event);
986
+ }
987
+
988
+ onRowReorder(event: any): void {
989
+ this.rowReorder.emit({
990
+ ...event,
991
+ value: event.value ?? this.data(),
992
+ });
993
+ }
994
+
995
+ onRowClick(event: MouseEvent, row: any): void {
996
+ if (!this.clickableRows() || this.loading()) {
997
+ return;
998
+ }
999
+
1000
+ const target = event.target as HTMLElement | null;
1001
+ if (
1002
+ target?.closest(
1003
+ 'button, a, input, textarea, select, label, [role="button"], [data-row-click-ignore="true"]',
1004
+ )
1005
+ ) {
1006
+ return;
1007
+ }
1008
+
1009
+ this.rowClick.emit(row);
1010
+ }
1011
+
1012
+ protected updatePagingFromEvent(event: any): void {
1013
+ const first = event?.first ?? this.first();
1014
+ const rows = event?.rows ?? this.pageSize();
1015
+
1016
+ this.first.set(first);
1017
+ this.pageSize.set(rows);
1018
+
1019
+ const page =
1020
+ typeof event?.page === 'number'
1021
+ ? event.page
1022
+ : Math.floor((first ?? 0) / (rows || 1));
1023
+
1024
+ this.currentPage.set(page);
1025
+ }
1026
+
1027
+ protected emitLazyLoad(event: any): void {
1028
+ const sortField = this.sortField();
1029
+
1030
+ this.lazyLoad.emit({
1031
+ ...event,
1032
+ // Sort is always reported, and `null` explicitly means "no sort". Without
1033
+ // that, a host can't tell "sort unchanged" from "sort cleared" and keeps
1034
+ // sending a stale backend sort after the user clears it.
1035
+ sortField,
1036
+ sortOrder: sortField ? (this.sortDirection() === 'desc' ? -1 : 1) : 0,
1037
+ pageSize: this.pageSize(),
1038
+ currentPage: this.currentPage() + 1,
1039
+ first: this.first(),
1040
+ filters: this.lazyLoadFilters(),
1041
+ });
1042
+ }
1043
+
1044
+ private lazyLoadFilters(): TableFilters {
1045
+ const filters = this.withoutGeneralSearch(this.filters());
1046
+ const searchTerm = this.filterTerm().trim();
1047
+
1048
+ if (!searchTerm || this.lazyLocalSearch()) {
1049
+ return filters;
1050
+ }
1051
+
1052
+ return {
1053
+ ...filters,
1054
+ generalSearch: searchTerm,
1055
+ };
1056
+ }
1057
+
1058
+ private withoutGeneralSearch(filters: TableFilters): TableFilters {
1059
+ if (!Object.prototype.hasOwnProperty.call(filters, 'generalSearch')) {
1060
+ return filters;
1061
+ }
1062
+
1063
+ const next = { ...filters };
1064
+ delete next['generalSearch'];
1065
+ return next;
1066
+ }
1067
+
1068
+ exportExcel(): void {
1069
+ if (this.loading()) {
1070
+ return;
1071
+ }
1072
+
1073
+ this.exportService.exportToExcel({
1074
+ rows: this.filteredData(),
1075
+ columns: this.columns(),
1076
+ filename: this.exportFilename(),
1077
+ resolveValue: (row, column) =>
1078
+ this.getColumnExportValue(row as any, column),
1079
+ });
1080
+ }
1081
+
1082
+ printPdf(): void {
1083
+ if (this.loading()) {
1084
+ return;
1085
+ }
1086
+
1087
+ this.exportService.printPdf({
1088
+ rows: this.filteredData(),
1089
+ columns: this.columns(),
1090
+ filename: this.exportFilename(),
1091
+ title: this.printTitle() || undefined,
1092
+ resolveValue: (row, column) =>
1093
+ this.getColumnExportValue(row as any, column),
1094
+ });
1095
+ }
1096
+
1097
+ onCellFilterClick(event: Event, row: any, column: ColumnDef): void {
1098
+ if (!this.cellClickFilter()) return;
1099
+
1100
+ const next = TableValueResolver.buildClickFilterValue(row, column);
1101
+ if (next === null || next === undefined) return;
1102
+
1103
+ event.stopPropagation();
1104
+
1105
+ const current = this.filters();
1106
+ const patched: TableFilters = { ...current };
1107
+ if (TableValueResolver.isFilterValueEqual(current[column.key], next)) {
1108
+ delete patched[column.key];
1109
+ } else {
1110
+ patched[column.key] = next;
1111
+ }
1112
+ this.onFilterApplied(patched);
1113
+ }
1114
+
1115
+ isCellFilterActive(row: any, column: ColumnDef): boolean {
1116
+ if (!this.cellClickFilter()) return false;
1117
+ const current = this.filters()[column.key];
1118
+ if (current === null || current === undefined) return false;
1119
+ const next = TableValueResolver.buildClickFilterValue(row, column);
1120
+ if (next === null || next === undefined) return false;
1121
+ return TableValueResolver.isFilterValueEqual(current, next);
1122
+ }
1123
+
1124
+ isCellClickFilterable(column: ColumnDef, row: unknown): boolean {
1125
+ if (!this.cellClickFilter()) return false;
1126
+ if (column.type === 'boolean') {
1127
+ // Editable booleans keep the toggle interaction; only readonly ones filter.
1128
+ return column.readonly === true;
1129
+ }
1130
+ if (column.type === 'status' || column.type === 'user') return true;
1131
+ if (column.type === 'entity') {
1132
+ const filterType = TableValueResolver.getColumnFilterType(
1133
+ column,
1134
+ row as Record<string, unknown>,
1135
+ );
1136
+ return (
1137
+ filterType === 'select' ||
1138
+ filterType === 'user' ||
1139
+ filterType === 'boolean'
1140
+ );
1141
+ }
1142
+ return false;
1143
+ }
1144
+
1145
+ rowAction(event: Event, action: TableAction, row: any): void {
1146
+ if (!action.confirmation) {
1147
+ action.action(row);
1148
+ } else if (action.confirmation?.confirmationType === 'delete') {
1149
+ this.confirmationService.confirmDelete({
1150
+ event: event,
1151
+ ...action.confirmation,
1152
+ accept: () => {
1153
+ action.action(row);
1154
+ },
1155
+ reject: () => {},
1156
+ });
1157
+ } else {
1158
+ this.confirmationService.confirm({
1159
+ event: event,
1160
+ ...action.confirmation,
1161
+ accept: () => {
1162
+ action.action(row);
1163
+ },
1164
+ reject: () => {},
1165
+ });
1166
+ }
1167
+ }
1168
+
1169
+ private buildUserEntityData(
1170
+ value: unknown,
1171
+ columnLabel: string,
1172
+ ): EntityData | null {
1173
+ if (!value) return null;
1174
+
1175
+ // Some APIs return `image` instead of the `photoUrl` expected by EntityUserValue.
1176
+ // Normalize here so the entity-user component always receives `photoUrl`.
1177
+ const normalizedValue =
1178
+ typeof value === 'object' && !('photoUrl' in value) && 'image' in value
1179
+ ? {
1180
+ ...(value as Record<string, unknown>),
1181
+ photoUrl: (value as Record<string, unknown>)['image'],
1182
+ }
1183
+ : value;
1184
+
1185
+ return {
1186
+ name: columnLabel,
1187
+ viewType: 'User',
1188
+ value: normalizedValue,
1189
+ configuration: {
1190
+ hideLabel: true,
1191
+ showDisplayName: true,
1192
+ showPhoneNumber: false,
1193
+ showEmail: false,
1194
+ },
1195
+ };
1196
+ }
1197
+
1198
+ private buildStatusEntityData(value: unknown, column: ColumnDef): EntityData {
1199
+ const statusValue = this.resolveStatusValue(value, column);
1200
+
1201
+ return {
1202
+ name: column.label,
1203
+ viewType: 'Status',
1204
+ value: statusValue ?? '',
1205
+ configuration: {
1206
+ hideName: true,
1207
+ },
1208
+ };
1209
+ }
1210
+
1211
+ private resolveStatusValue(
1212
+ value: unknown,
1213
+ column?: ColumnDef,
1214
+ ): EntityStatusValue | null {
1215
+ const unwrappedValue = this.unwrapStatusValue(value, column);
1216
+ if (
1217
+ unwrappedValue === null ||
1218
+ unwrappedValue === undefined ||
1219
+ unwrappedValue === ''
1220
+ ) {
1221
+ return null;
1222
+ }
1223
+
1224
+ if (typeof unwrappedValue === 'object') {
1225
+ const objectValue = unwrappedValue as Record<string, unknown>;
1226
+ const statusKey =
1227
+ this.readStringProperty(objectValue, 'key') ??
1228
+ this.readStringProperty(objectValue, 'code') ??
1229
+ this.readStringProperty(objectValue, 'value') ??
1230
+ this.readStringProperty(objectValue, 'id') ??
1231
+ this.readStringProperty(objectValue, 'display') ??
1232
+ this.readStringProperty(objectValue, 'displayValue') ??
1233
+ this.readStringProperty(objectValue, 'displayName') ??
1234
+ this.readStringProperty(objectValue, 'label') ??
1235
+ this.readStringProperty(objectValue, 'name');
1236
+ const mappedStatus = this.resolveStatusMapValue(column, statusKey);
1237
+ const display =
1238
+ this.readStringProperty(objectValue, 'display') ??
1239
+ this.readStringProperty(objectValue, 'displayValue') ??
1240
+ this.readStringProperty(objectValue, 'displayName') ??
1241
+ this.readStringProperty(objectValue, 'label') ??
1242
+ this.readStringProperty(objectValue, 'name') ??
1243
+ mappedStatus?.display ??
1244
+ statusKey;
1245
+
1246
+ if (!display) {
1247
+ return null;
1248
+ }
1249
+
1250
+ return {
1251
+ key: statusKey ?? display,
1252
+ display,
1253
+ color:
1254
+ this.readStringProperty(objectValue, 'color') ??
1255
+ mappedStatus?.color ??
1256
+ this.resolveDefaultStatusColor(statusKey ?? display),
1257
+ description:
1258
+ this.readStringProperty(objectValue, 'description') ??
1259
+ mappedStatus?.description,
1260
+ };
1261
+ }
1262
+
1263
+ const normalizedValue =
1264
+ TableValueResolver.resolveDisplayValue(unwrappedValue);
1265
+ if (normalizedValue === null || normalizedValue === undefined) {
1266
+ return null;
1267
+ }
1268
+
1269
+ const statusKey = String(normalizedValue);
1270
+ const mappedStatus = this.resolveStatusMapValue(column, statusKey);
1271
+
1272
+ return {
1273
+ key: statusKey,
1274
+ display: mappedStatus?.display ?? statusKey,
1275
+ color: mappedStatus?.color ?? this.resolveDefaultStatusColor(statusKey),
1276
+ description: mappedStatus?.description,
1277
+ };
1278
+ }
1279
+
1280
+ private unwrapStatusValue(value: unknown, column?: ColumnDef): unknown {
1281
+ if (!value || typeof value !== 'object') {
1282
+ return value;
1283
+ }
1284
+
1285
+ const entityValue = value as Partial<EntityData>;
1286
+ if (!('value' in (value as Record<string, unknown>))) {
1287
+ return value;
1288
+ }
1289
+
1290
+ if (
1291
+ entityValue.viewType === 'Status' ||
1292
+ this.isEntityStatusCompatibilityColumn(column)
1293
+ ) {
1294
+ return entityValue.value;
1295
+ }
1296
+
1297
+ return value;
1298
+ }
1299
+
1300
+ private isEntityStatusCompatibilityColumn(
1301
+ column: ColumnDef | undefined,
1302
+ ): boolean {
1303
+ return column?.type === 'entity' && this.isStatusColumnKey(column.key);
1304
+ }
1305
+
1306
+ private isStatusColumnKey(key: string | null | undefined): boolean {
1307
+ return typeof key === 'string' && key.trim().toLowerCase() === 'status';
1308
+ }
1309
+
1310
+ private resolveStatusMapValue(
1311
+ column: ColumnDef | undefined,
1312
+ key: string | null | undefined,
1313
+ ) {
1314
+ if (!column?.statusMap || !key) {
1315
+ return undefined;
1316
+ }
1317
+
1318
+ const directMatch = column.statusMap[key];
1319
+ if (directMatch) {
1320
+ return directMatch;
1321
+ }
1322
+
1323
+ const normalizedKey = this.normalizeStatusToken(key);
1324
+ return Object.entries(column.statusMap).find(
1325
+ ([entryKey]) => this.normalizeStatusToken(entryKey) === normalizedKey,
1326
+ )?.[1];
1327
+ }
1328
+
1329
+ private resolveDefaultStatusColor(value: string): string {
1330
+ const normalizedValue = this.normalizeStatusToken(value);
1331
+
1332
+ if (
1333
+ [
1334
+ 'active',
1335
+ 'approved',
1336
+ 'completed',
1337
+ 'create',
1338
+ 'created',
1339
+ 'done',
1340
+ 'enabled',
1341
+ 'healthy',
1342
+ 'low',
1343
+ 'open',
1344
+ 'published',
1345
+ 'runtime',
1346
+ 'success',
1347
+ 'succeeded',
1348
+ ].includes(normalizedValue)
1349
+ ) {
1350
+ return '#047857';
1351
+ }
1352
+
1353
+ if (
1354
+ [
1355
+ 'change',
1356
+ 'current',
1357
+ 'draft',
1358
+ 'inprogress',
1359
+ 'info',
1360
+ 'medium',
1361
+ 'process',
1362
+ 'progress',
1363
+ 'running',
1364
+ 'update',
1365
+ 'updated',
1366
+ ].includes(normalizedValue)
1367
+ ) {
1368
+ return '#0369a1';
1369
+ }
1370
+
1371
+ if (
1372
+ [
1373
+ 'bulkupdate',
1374
+ 'comment',
1375
+ 'configure',
1376
+ 'configured',
1377
+ 'controlpanel',
1378
+ 'discussion',
1379
+ ].includes(normalizedValue)
1380
+ ) {
1381
+ return '#4338ca';
1382
+ }
1383
+
1384
+ if (
1385
+ [
1386
+ 'awaiting',
1387
+ 'escalation',
1388
+ 'high',
1389
+ 'hold',
1390
+ 'move',
1391
+ 'moved',
1392
+ 'pending',
1393
+ 'phasegate',
1394
+ 'queued',
1395
+ 'warning',
1396
+ ].includes(normalizedValue)
1397
+ ) {
1398
+ return '#b45309';
1399
+ }
1400
+
1401
+ if (
1402
+ [
1403
+ 'blocked',
1404
+ 'cancelled',
1405
+ 'canceled',
1406
+ 'close',
1407
+ 'closed',
1408
+ 'critical',
1409
+ 'delete',
1410
+ 'deleted',
1411
+ 'error',
1412
+ 'failed',
1413
+ 'governance',
1414
+ 'inactive',
1415
+ 'rejected',
1416
+ ].includes(normalizedValue)
1417
+ ) {
1418
+ return '#be123c';
1419
+ }
1420
+
1421
+ return '#475569';
1422
+ }
1423
+
1424
+ private normalizeStatusToken(value: string): string {
1425
+ return value
1426
+ .trim()
1427
+ .toLocaleLowerCase()
1428
+ .replace(/[\s_-]+/g, '');
1429
+ }
1430
+
1431
+ private readStringProperty(
1432
+ value: Record<string, unknown>,
1433
+ key: string,
1434
+ ): string | null {
1435
+ const propertyValue = value[key];
1436
+ return typeof propertyValue === 'string' && propertyValue.trim().length > 0
1437
+ ? propertyValue.trim()
1438
+ : null;
1439
+ }
1440
+
1441
+ /**
1442
+ * Gets the entity data for an 'entity' type column.
1443
+ * The row data is expected to already be in EntityData format.
1444
+ * Automatically hides entity name and configures User entities
1445
+ * to show only avatar + displayName.
1446
+ */
1447
+ getEntityColumnData(row: any, col: ColumnDef): EntityData | null {
1448
+ const cellValue = this.getProperty(row, col.key);
1449
+ if (!cellValue || typeof cellValue !== 'object') return null;
1450
+
1451
+ const entityData = cellValue as EntityData;
1452
+
1453
+ if (this.isEntityStatusCompatibilityColumn(col)) {
1454
+ return this.buildStatusEntityData(cellValue, col);
1455
+ }
1456
+
1457
+ // For User entities: show avatar + displayName only
1458
+ if (entityData.viewType === 'User') {
1459
+ return {
1460
+ ...entityData,
1461
+ configuration: {
1462
+ ...entityData.configuration,
1463
+ hideName: true,
1464
+ showDisplayName: true,
1465
+ showPhoneNumber: false,
1466
+ showEmail: false,
1467
+ },
1468
+ };
1469
+ }
1470
+
1471
+ // For all other entities: hide the name label
1472
+ return {
1473
+ ...entityData,
1474
+ configuration: {
1475
+ ...entityData.configuration,
1476
+ hideName: true,
1477
+ },
1478
+ };
1479
+ }
1480
+
1481
+ protected getStatusEntityAccentColor(
1482
+ row: Record<string, unknown>,
1483
+ ): string | null {
1484
+ const statusColumn = this.columns().find((column) =>
1485
+ this.isStatusColumnKey(column.key),
1486
+ );
1487
+ if (!statusColumn) {
1488
+ return null;
1489
+ }
1490
+
1491
+ return this.resolveStatusEntityAccentColor(
1492
+ this.getProperty(row, statusColumn.key),
1493
+ statusColumn,
1494
+ );
1495
+ }
1496
+
1497
+ private resolveStatusEntityAccentColor(
1498
+ value: unknown,
1499
+ column?: ColumnDef,
1500
+ ): string | null {
1501
+ return this.resolveStatusValue(value, column)?.color ?? null;
1502
+ }
1503
+
1504
+ protected getBooleanProperty(obj: any, key: string): boolean {
1505
+ const value = this.getProperty(obj, key);
1506
+
1507
+ if (typeof value === 'boolean') {
1508
+ return value;
1509
+ }
1510
+
1511
+ return TableValueResolver.resolveBooleanValue(value) ?? false;
1512
+ }
1513
+
1514
+ private setProperty(obj: any, key: string, value: any): void {
1515
+ const path = key.split('.');
1516
+ const lastKey = path.pop();
1517
+
1518
+ if (!lastKey) {
1519
+ return;
1520
+ }
1521
+
1522
+ const target = path.reduce((current, segment) => {
1523
+ if (!current?.[segment] || typeof current[segment] !== 'object') {
1524
+ current[segment] = {};
1525
+ }
1526
+
1527
+ return current[segment];
1528
+ }, obj);
1529
+
1530
+ if (target && typeof target === 'object') {
1531
+ target[lastKey] = value;
1532
+ }
1533
+ }
1534
+
1535
+ private sortData(data: any[]): any[] {
1536
+ const field = this.sortField();
1537
+ const direction = this.sortDirection();
1538
+
1539
+ if (!field || !direction) {
1540
+ return data;
1541
+ }
1542
+
1543
+ const column = this.columns().find((item) => item.key === field);
1544
+ if (!column || !this.isColumnSortable(column)) {
1545
+ return data;
1546
+ }
1547
+
1548
+ return [...data].sort((leftRow, rightRow) => {
1549
+ const leftValue = this.getSortValue(leftRow, column);
1550
+ const rightValue = this.getSortValue(rightRow, column);
1551
+
1552
+ if (leftValue === rightValue) return 0;
1553
+ if (leftValue === null || leftValue === undefined || leftValue === '') {
1554
+ return 1;
1555
+ }
1556
+ if (
1557
+ rightValue === null ||
1558
+ rightValue === undefined ||
1559
+ rightValue === ''
1560
+ ) {
1561
+ return -1;
1562
+ }
1563
+
1564
+ const comparison = leftValue < rightValue ? -1 : 1;
1565
+ return direction === 'asc' ? comparison : -comparison;
1566
+ });
1567
+ }
1568
+
1569
+ private getSortValue(
1570
+ row: Record<string, unknown>,
1571
+ column: ColumnDef,
1572
+ ): string | number | null {
1573
+ const cellValue = this.getProperty(row, column.key);
1574
+ const resolvedValue = this.getColumnResolvedValue(row, column);
1575
+
1576
+ if (
1577
+ resolvedValue === null ||
1578
+ resolvedValue === undefined ||
1579
+ resolvedValue === ''
1580
+ ) {
1581
+ return null;
1582
+ }
1583
+
1584
+ if (column.type === 'date' || column.type === 'dateTime') {
1585
+ return TableValueResolver.normalizeDateSortValue(cellValue);
1586
+ }
1587
+
1588
+ if (typeof resolvedValue === 'number') {
1589
+ return resolvedValue;
1590
+ }
1591
+
1592
+ if (typeof resolvedValue === 'boolean') {
1593
+ return resolvedValue ? 1 : 0;
1594
+ }
1595
+
1596
+ if (cellValue instanceof Date) {
1597
+ return cellValue.getTime();
1598
+ }
1599
+
1600
+ return TableValueResolver.normalizeTextSortValue(resolvedValue);
1601
+ }
1602
+
1603
+ /**
1604
+ * Export/print value resolver — same pipeline as `getColumnResolvedValue`
1605
+ * except date / dateTime columns (and their entity counterparts) are
1606
+ * formatted via the MT date pipe so Excel and PDF show locale-aware dates
1607
+ * instead of raw ISO strings. Sort path keeps the ISO form for ordering.
1608
+ */
1609
+ private getColumnExportValue(
1610
+ row: Record<string, unknown>,
1611
+ column: ColumnDef,
1612
+ ): string | number | boolean | null {
1613
+ const cellValue = this.getProperty(row, column.key);
1614
+ if (cellValue === null || cellValue === undefined) return null;
1615
+
1616
+ const dateType = this.resolveDateColumnType(column, row);
1617
+ if (dateType) {
1618
+ const dateValue = TableValueResolver.resolveDateValue(
1619
+ column.type === 'entity'
1620
+ ? TableValueResolver.getEntityValueByType(cellValue, 'sort')
1621
+ : cellValue,
1622
+ );
1623
+ if (dateValue === null) return null;
1624
+ const formatted = this.dateFormat.transform(dateValue, dateType);
1625
+ return formatted || null;
1626
+ }
1627
+
1628
+ return this.getColumnResolvedValue(row, column);
1629
+ }
1630
+
1631
+ /**
1632
+ * Detects whether a column should be treated as a date for export purposes:
1633
+ * native `date` / `dateTime` types, or entity columns whose viewType is
1634
+ * `Date` / `DateTime` / `Time`.
1635
+ */
1636
+ private resolveDateColumnType(
1637
+ column: ColumnDef,
1638
+ row: Record<string, unknown>,
1639
+ ): MTDateFormatType | null {
1640
+ if (column.type === 'date') return 'date';
1641
+ if (column.type === 'dateTime') return 'dateTime';
1642
+ if (column.type === 'entity') {
1643
+ // `Time` is resolved ahead of the filter gate below: it is deliberately
1644
+ // not filterable, but it still has to export as a formatted clock time
1645
+ // rather than the raw stored value.
1646
+ if (TableValueResolver.getEntityViewType(column, row) === 'Time') {
1647
+ return 'time';
1648
+ }
1649
+ const filterType = TableValueResolver.getColumnFilterType(column, row);
1650
+ if (filterType !== 'date') return null;
1651
+ const viewType = (column as { viewType?: unknown }).viewType;
1652
+ if (
1653
+ typeof viewType === 'string' &&
1654
+ viewType.toLowerCase() === 'datetime'
1655
+ ) {
1656
+ return 'dateTime';
1657
+ }
1658
+ const cellValue = this.getProperty(row, column.key);
1659
+ if (
1660
+ cellValue &&
1661
+ typeof cellValue === 'object' &&
1662
+ (cellValue as { viewType?: string }).viewType === 'DateTime'
1663
+ ) {
1664
+ return 'dateTime';
1665
+ }
1666
+ return 'date';
1667
+ }
1668
+ return null;
1669
+ }
1670
+
1671
+ private getColumnResolvedValue(
1672
+ row: Record<string, unknown>,
1673
+ column: ColumnDef,
1674
+ ): string | number | boolean | null {
1675
+ const cellValue = this.getProperty(row, column.key);
1676
+
1677
+ if (cellValue === null || cellValue === undefined) {
1678
+ return null;
1679
+ }
1680
+
1681
+ if (column.type === 'entity') {
1682
+ return TableValueResolver.getEntityValueByType(cellValue, 'export');
1683
+ }
1684
+
1685
+ if (column.type === 'boolean') {
1686
+ return this.getBooleanProperty(row, column.key);
1687
+ }
1688
+
1689
+ if (column.type === 'date' || column.type === 'dateTime') {
1690
+ const dateValue = TableValueResolver.resolveDateValue(cellValue);
1691
+ return dateValue instanceof Date ? dateValue.toISOString() : dateValue;
1692
+ }
1693
+
1694
+ if (typeof cellValue === 'number' || typeof cellValue === 'boolean') {
1695
+ return cellValue;
1696
+ }
1697
+
1698
+ if (cellValue instanceof Date) {
1699
+ return cellValue.toISOString();
1700
+ }
1701
+
1702
+ return TableValueResolver.resolveDisplayValue(cellValue);
1703
+ }
1704
+
1705
+ protected isRowSelected(row: Record<string, unknown>): boolean {
1706
+ const rowKey = this.getRowSelectionKey(row);
1707
+
1708
+ if (rowKey !== null) {
1709
+ return this.selectedRowKeys().has(rowKey);
1710
+ }
1711
+
1712
+ return this.transientSelectedRows().has(row);
1713
+ }
1714
+
1715
+ /**
1716
+ * Types whose rendered width is bounded by their own shape — a date, a
1717
+ * yes/no, an avatar, a status chip. They get sized to content so the columns
1718
+ * that hold real text absorb the leftover width instead (finding M-05).
1719
+ */
1720
+ private static readonly SHRINK_TO_CONTENT_TYPES: ReadonlySet<string> =
1721
+ new Set(['date', 'dateTime', 'boolean', 'number', 'user', 'status']);
1722
+
1723
+ /**
1724
+ * Alignment class for a column's header and cells. Numbers align to the end
1725
+ * with tabular figures so the digits line up down the column; everything else
1726
+ * keeps the reading direction.
1727
+ */
1728
+ protected getColumnAlignClass(column: ColumnDef): string {
1729
+ const align = column.align ?? (column.type === 'number' ? 'end' : 'start');
1730
+ if (align === 'end') {
1731
+ return 'text-end tabular-nums';
1732
+ }
1733
+ return align === 'center' ? 'text-center' : 'text-start';
1734
+ }
1735
+
1736
+ /**
1737
+ * `width: 1%` is the shrink-to-content idiom for an auto-layout table: the
1738
+ * browser treats it as a floor, gives the column exactly what its content
1739
+ * needs, and hands the remainder to the columns that asked for nothing. An
1740
+ * explicit `width` on the column always wins.
1741
+ */
1742
+ protected getColumnWidth(column: ColumnDef): string | null {
1743
+ if (column.width) {
1744
+ return column.width;
1745
+ }
1746
+
1747
+ const shrink =
1748
+ column.shrink ?? Table.SHRINK_TO_CONTENT_TYPES.has(column.type ?? 'text');
1749
+ return shrink ? '1%' : null;
1750
+ }
1751
+
1752
+ protected getColumnMinWidth(column: ColumnDef): string | null {
1753
+ const width = column.width?.trim();
1754
+ if (!width || width.endsWith('%')) {
1755
+ return null;
1756
+ }
1757
+
1758
+ return width;
1759
+ }
1760
+
1761
+ private emitSelectionChange(): void {
1762
+ this.selectionChange.emit(this.getSelectedRows());
1763
+ }
1764
+
1765
+ private getSelectedRows(): any[] {
1766
+ const dataKey = this.dataKey();
1767
+ if (!dataKey) {
1768
+ return Array.from(this.transientSelectedRows());
1769
+ }
1770
+
1771
+ const selectedRowKeys = this.selectedRowKeys();
1772
+ return this.data().filter((row) => {
1773
+ const rowKey = this.getRowSelectionKey(row);
1774
+ return rowKey !== null && selectedRowKeys.has(rowKey);
1775
+ });
1776
+ }
1777
+
1778
+ private getRowSelectionKey(row: Record<string, unknown>): string | null {
1779
+ const dataKey = this.dataKey();
1780
+ if (!dataKey) {
1781
+ return null;
1782
+ }
1783
+
1784
+ const value = this.getProperty(row, dataKey);
1785
+ if (value === null || value === undefined || value === '') {
1786
+ return null;
1787
+ }
1788
+
1789
+ return String(value);
1790
+ }
1791
+
1792
+ private getNormalizedStorageKey(): string | null {
1793
+ const storageKey = this.storageKey()?.trim();
1794
+ return storageKey ? storageKey : null;
1795
+ }
1796
+
1797
+ private getStorage(): Storage | null {
1798
+ if (typeof window === 'undefined') {
1799
+ return null;
1800
+ }
1801
+
1802
+ return this.storageMode() === 'session'
1803
+ ? window.sessionStorage
1804
+ : window.localStorage;
1805
+ }
1806
+
1807
+ private buildPersistedState(): PersistedTableState {
1808
+ const state: PersistedTableState = {};
1809
+
1810
+ if (this.shouldPersistStateKey('pageSize')) {
1811
+ state.pageSize = this.pageSize();
1812
+ }
1813
+
1814
+ if (this.shouldPersistStateKey('pagePosition')) {
1815
+ state.first = this.first();
1816
+ state.currentPage = this.currentPage();
1817
+ }
1818
+
1819
+ if (this.shouldPersistStateKey('sort')) {
1820
+ state.sortField = this.sortField();
1821
+ state.sortDirection = this.sortDirection();
1822
+ }
1823
+
1824
+ if (this.shouldPersistStateKey('selection')) {
1825
+ state.selectedRowKeys = this.dataKey()
1826
+ ? Array.from(this.selectedRowKeys())
1827
+ : [];
1828
+ }
1829
+
1830
+ if (this.shouldPersistStateKey('groupBy')) {
1831
+ state.groupBy = this.groupBy();
1832
+ }
1833
+
1834
+ return state;
1835
+ }
1836
+
1837
+ private applyPersistedState(
1838
+ persistedState: PersistedTableState | null,
1839
+ ): void {
1840
+ this.transientSelectedRows.set(new Set());
1841
+
1842
+ if (!persistedState) {
1843
+ this.selectedRowKeys.set(new Set());
1844
+ return;
1845
+ }
1846
+
1847
+ const pageSize = this.shouldPersistStateKey('pageSize')
1848
+ ? this.normalizePersistedPageSize(
1849
+ this.toPositiveInteger(persistedState.pageSize),
1850
+ )
1851
+ : null;
1852
+ if (pageSize !== null) {
1853
+ this.pageSize.set(pageSize);
1854
+ }
1855
+
1856
+ if (this.shouldPersistStateKey('pagePosition')) {
1857
+ const first = this.toNonNegativeInteger(persistedState.first);
1858
+ if (first !== null) {
1859
+ this.first.set(first);
1860
+ }
1861
+
1862
+ const currentPage = this.toNonNegativeInteger(persistedState.currentPage);
1863
+ if (currentPage !== null) {
1864
+ this.currentPage.set(currentPage);
1865
+ } else if (first !== null && pageSize !== null) {
1866
+ this.currentPage.set(Math.floor(first / pageSize));
1867
+ }
1868
+ }
1869
+
1870
+ if (this.shouldPersistStateKey('sort')) {
1871
+ this.sortField.set(
1872
+ typeof persistedState.sortField === 'string'
1873
+ ? persistedState.sortField
1874
+ : null,
1875
+ );
1876
+
1877
+ this.sortDirection.set(
1878
+ persistedState.sortDirection === 'asc' ||
1879
+ persistedState.sortDirection === 'desc'
1880
+ ? persistedState.sortDirection
1881
+ : null,
1882
+ );
1883
+ }
1884
+
1885
+ if (this.shouldPersistStateKey('selection')) {
1886
+ this.selectedRowKeys.set(
1887
+ new Set(
1888
+ Array.isArray(persistedState.selectedRowKeys)
1889
+ ? persistedState.selectedRowKeys
1890
+ : [],
1891
+ ),
1892
+ );
1893
+ }
1894
+
1895
+ if (this.shouldPersistStateKey('groupBy')) {
1896
+ this.groupBy.set(
1897
+ typeof persistedState.groupBy === 'string' && persistedState.groupBy
1898
+ ? persistedState.groupBy
1899
+ : null,
1900
+ );
1901
+ }
1902
+ }
1903
+
1904
+ private shouldEmitLazyLoadAfterRestore(
1905
+ persistedState: PersistedTableState | null,
1906
+ ): boolean {
1907
+ if (!persistedState) {
1908
+ return false;
1909
+ }
1910
+
1911
+ return (
1912
+ (this.shouldPersistStateKey('pageSize') &&
1913
+ persistedState.pageSize !== undefined) ||
1914
+ (this.shouldPersistStateKey('pagePosition') &&
1915
+ (persistedState.first !== undefined ||
1916
+ persistedState.currentPage !== undefined))
1917
+ );
1918
+ }
1919
+
1920
+ private shouldPersistStateKey(key: TablePersistStateKey): boolean {
1921
+ const excluded = this.persistStateExclude();
1922
+ return !(
1923
+ Array.isArray(excluded) ? excluded : DEFAULT_PERSIST_STATE_EXCLUDE
1924
+ ).includes(key);
1925
+ }
1926
+
1927
+ private readPersistedState(
1928
+ storage: Storage,
1929
+ storageKey: string,
1930
+ ): PersistedTableState | null {
1931
+ try {
1932
+ const raw = storage.getItem(storageKey);
1933
+ if (!raw) {
1934
+ return null;
1935
+ }
1936
+
1937
+ const parsed = JSON.parse(raw) as PersistedTableState;
1938
+ return parsed && typeof parsed === 'object' ? parsed : null;
1939
+ } catch {
1940
+ return null;
1941
+ }
1942
+ }
1943
+
1944
+ private getRestorablePersistedState(
1945
+ persistedState: PersistedTableState | null,
1946
+ ): PersistedTableState | null {
1947
+ if (!persistedState) {
1948
+ return null;
1949
+ }
1950
+
1951
+ const restorableState: PersistedTableState = {};
1952
+
1953
+ if (this.shouldPersistStateKey('pageSize')) {
1954
+ restorableState.pageSize = persistedState.pageSize;
1955
+ }
1956
+
1957
+ if (this.shouldPersistStateKey('pagePosition')) {
1958
+ restorableState.first = persistedState.first;
1959
+ restorableState.currentPage = persistedState.currentPage;
1960
+ }
1961
+
1962
+ if (this.shouldPersistStateKey('sort')) {
1963
+ restorableState.sortField = persistedState.sortField;
1964
+ restorableState.sortDirection = persistedState.sortDirection;
1965
+ }
1966
+
1967
+ if (this.shouldPersistStateKey('selection')) {
1968
+ restorableState.selectedRowKeys = persistedState.selectedRowKeys;
1969
+ }
1970
+
1971
+ if (this.shouldPersistStateKey('groupBy')) {
1972
+ restorableState.groupBy = persistedState.groupBy;
1973
+ }
1974
+
1975
+ return Object.keys(restorableState).some(
1976
+ (key) => restorableState[key as keyof PersistedTableState] !== undefined,
1977
+ )
1978
+ ? restorableState
1979
+ : null;
1980
+ }
1981
+
1982
+ private writePersistedState(
1983
+ storage: Storage,
1984
+ storageKey: string,
1985
+ state: PersistedTableState,
1986
+ ): void {
1987
+ try {
1988
+ storage.setItem(storageKey, JSON.stringify(state));
1989
+ } catch {
1990
+ // Ignore storage write failures.
1991
+ }
1992
+ }
1993
+
1994
+ private toPositiveInteger(value: unknown): number | null {
1995
+ const normalized = Number(value);
1996
+ if (!Number.isFinite(normalized) || normalized <= 0) {
1997
+ return null;
1998
+ }
1999
+
2000
+ return Math.trunc(normalized);
2001
+ }
2002
+
2003
+ private normalizePersistedPageSize(value: number | null): number | null {
2004
+ if (value === null) {
2005
+ return null;
2006
+ }
2007
+
2008
+ const allowedOptions = this.rowsPerPageOptions().filter(
2009
+ (option) => Number.isFinite(option) && option > 0,
2010
+ );
2011
+
2012
+ if (!allowedOptions.length) {
2013
+ return value;
2014
+ }
2015
+
2016
+ return allowedOptions.includes(value) ? value : allowedOptions[0]!;
2017
+ }
2018
+
2019
+ private resolveScrollHeightPixels(value: string): number | null {
2020
+ const normalized = value.trim().toLowerCase();
2021
+ const match = normalized.match(/^(\d+(?:\.\d+)?)(px|rem)$/);
2022
+ if (!match) {
2023
+ return null;
2024
+ }
2025
+
2026
+ const amount = Number(match[1]);
2027
+ if (!Number.isFinite(amount) || amount <= 0) {
2028
+ return null;
2029
+ }
2030
+
2031
+ return match[2] === 'rem' ? amount * 16 : amount;
2032
+ }
2033
+
2034
+ private toNonNegativeInteger(value: unknown): number | null {
2035
+ const normalized = Number(value);
2036
+ if (!Number.isFinite(normalized) || normalized < 0) {
2037
+ return null;
2038
+ }
2039
+
2040
+ return Math.trunc(normalized);
2041
+ }
2042
+ }