@masterteam/components 0.0.264 → 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 (756) 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/avatar/avatar.html +32 -0
  125. package/avatar/avatar.scss +0 -0
  126. package/avatar/avatar.ts +54 -0
  127. package/avatar/ng-package.json +6 -0
  128. package/avatar/public-api.ts +1 -0
  129. package/avatar-text/avatar-text.html +26 -0
  130. package/avatar-text/avatar-text.scss +0 -0
  131. package/avatar-text/avatar-text.ts +52 -0
  132. package/avatar-text/ng-package.json +6 -0
  133. package/avatar-text/public-api.ts +1 -0
  134. package/breadcrumb/breadcrumb.html +53 -0
  135. package/breadcrumb/breadcrumb.scss +0 -0
  136. package/breadcrumb/breadcrumb.ts +26 -0
  137. package/breadcrumb/ng-package.json +6 -0
  138. package/breadcrumb/public-api.ts +1 -0
  139. package/business-fields/entity-list-field/entity-list-add-token.ts +25 -0
  140. package/business-fields/entity-list-field/entity-list-field.html +70 -0
  141. package/business-fields/entity-list-field/entity-list-field.scss +3 -0
  142. package/business-fields/entity-list-field/entity-list-field.ts +1067 -0
  143. package/business-fields/lookup-matrix-field/lookup-matrix-field.html +38 -0
  144. package/business-fields/lookup-matrix-field/lookup-matrix-field.spec.ts +183 -0
  145. package/business-fields/lookup-matrix-field/lookup-matrix-field.ts +239 -0
  146. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.html +95 -0
  147. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.ts +336 -0
  148. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-form-token.ts +42 -0
  149. package/business-fields/ng-package.json +6 -0
  150. package/business-fields/public-api.ts +8 -0
  151. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.html +32 -0
  152. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.ts +272 -0
  153. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.html +89 -0
  154. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.ts +441 -0
  155. package/business-fields/schema-connection-field/schema-connection-field.html +58 -0
  156. package/business-fields/schema-connection-field/schema-connection-field.scss +0 -0
  157. package/business-fields/schema-connection-field/schema-connection-field.ts +456 -0
  158. package/button/button.html +44 -0
  159. package/button/button.scss +0 -0
  160. package/button/button.ts +120 -0
  161. package/button/ng-package.json +6 -0
  162. package/button/public-api.ts +1 -0
  163. package/button-group/button-group.html +3 -0
  164. package/button-group/button-group.scss +20 -0
  165. package/button-group/button-group.ts +12 -0
  166. package/button-group/ng-package.json +6 -0
  167. package/button-group/public-api.ts +1 -0
  168. package/card/card.html +26 -0
  169. package/card/card.scss +0 -0
  170. package/card/card.ts +29 -0
  171. package/card/ng-package.json +6 -0
  172. package/card/public-api.ts +1 -0
  173. package/checkbox-field/checkbox-field.html +31 -0
  174. package/checkbox-field/checkbox-field.scss +0 -0
  175. package/checkbox-field/checkbox-field.spec.ts +21 -0
  176. package/checkbox-field/checkbox-field.ts +123 -0
  177. package/checkbox-field/ng-package.json +6 -0
  178. package/checkbox-field/public-api.ts +1 -0
  179. package/chip/chip.html +16 -0
  180. package/chip/chip.scss +19 -0
  181. package/chip/chip.ts +45 -0
  182. package/chip/ng-package.json +6 -0
  183. package/chip/public-api.ts +1 -0
  184. package/client-page/client-page.html +232 -0
  185. package/client-page/client-page.ts +588 -0
  186. package/client-page/index.ts +2 -0
  187. package/client-page/ng-package.json +6 -0
  188. package/client-page/public-api.ts +1 -0
  189. package/client-page-menu/client-page-menu.html +142 -0
  190. package/client-page-menu/client-page-menu.ts +199 -0
  191. package/client-page-menu/index.ts +2 -0
  192. package/client-page-menu/ng-package.json +6 -0
  193. package/client-page-menu/public-api.ts +1 -0
  194. package/color-picker-field/color-picker-field.html +45 -0
  195. package/color-picker-field/color-picker-field.scss +52 -0
  196. package/color-picker-field/color-picker-field.ts +131 -0
  197. package/color-picker-field/ng-package.json +6 -0
  198. package/color-picker-field/public-api.ts +1 -0
  199. package/confirmation/confirmation-dialog.html +83 -0
  200. package/confirmation/confirmation-dialog.scss +0 -0
  201. package/confirmation/confirmation-dialog.ts +15 -0
  202. package/confirmation/confirmation.spec.ts +43 -0
  203. package/confirmation/confirmation.ts +103 -0
  204. package/confirmation/ng-package.json +6 -0
  205. package/confirmation/public-api.ts +2 -0
  206. package/date-field/date-field.html +65 -0
  207. package/date-field/date-field.scss +0 -0
  208. package/date-field/date-field.spec.ts +118 -0
  209. package/date-field/date-field.ts +196 -0
  210. package/date-field/ng-package.json +6 -0
  211. package/date-field/public-api.ts +1 -0
  212. package/dialog/dialog.ts +29 -0
  213. package/dialog/ng-package.json +6 -0
  214. package/dialog/public-api.ts +1 -0
  215. package/drawer/drawer.html +67 -0
  216. package/drawer/drawer.scss +1 -0
  217. package/drawer/drawer.ts +348 -0
  218. package/drawer/ng-package.json +5 -0
  219. package/drawer/public-api.ts +1 -0
  220. package/dynamic-drawer/dynamic-drawer-host.ts +476 -0
  221. package/dynamic-drawer/dynamic-drawer.spec.ts +204 -0
  222. package/dynamic-drawer/dynamic-drawer.ts +235 -0
  223. package/dynamic-drawer/ng-package.json +6 -0
  224. package/dynamic-drawer/public-api.ts +2 -0
  225. package/editor-field/editor-field.html +38 -0
  226. package/editor-field/editor-field.scss +219 -0
  227. package/editor-field/editor-field.ts +126 -0
  228. package/editor-field/ng-package.json +6 -0
  229. package/editor-field/public-api.ts +1 -0
  230. package/empty-state/empty-state.html +236 -0
  231. package/empty-state/empty-state.ts +85 -0
  232. package/empty-state/ng-package.json +6 -0
  233. package/empty-state/public-api.ts +1 -0
  234. package/entities/comparison/comparison-entity-list/comparison-entity-list.html +87 -0
  235. package/entities/comparison/comparison-entity-list/comparison-entity-list.ts +93 -0
  236. package/entities/comparison/comparison-value/comparison-value.html +31 -0
  237. package/entities/comparison/comparison-value/comparison-value.ts +53 -0
  238. package/entities/currency-display.utils.spec.ts +94 -0
  239. package/entities/currency-display.utils.ts +92 -0
  240. package/entities/entities-manage/entities-manage.html +74 -0
  241. package/entities/entities-manage/entities-manage.scss +72 -0
  242. package/entities/entities-manage/entities-manage.ts +121 -0
  243. package/entities/entities-manage/entities-resize-base.ts +153 -0
  244. package/entities/entities-preview/entities-preview.css +77 -0
  245. package/entities/entities-preview/entities-preview.html +56 -0
  246. package/entities/entities-preview/entities-preview.ts +281 -0
  247. package/entities/entity-attachment/entity-attachment.html +49 -0
  248. package/entities/entity-attachment/entity-attachment.ts +462 -0
  249. package/entities/entity-checkbox/entity-checkbox.html +28 -0
  250. package/entities/entity-checkbox/entity-checkbox.ts +65 -0
  251. package/entities/entity-comparison.model.ts +39 -0
  252. package/entities/entity-connection/entity-connection.html +12 -0
  253. package/entities/entity-connection/entity-connection.ts +75 -0
  254. package/entities/entity-currency/entity-currency.html +12 -0
  255. package/entities/entity-currency/entity-currency.ts +59 -0
  256. package/entities/entity-date/entity-date.html +16 -0
  257. package/entities/entity-date/entity-date.ts +50 -0
  258. package/entities/entity-display.utils.ts +94 -0
  259. package/entities/entity-field/entity-field.ts +94 -0
  260. package/entities/entity-leaf-details/entity-leaf-details.html +35 -0
  261. package/entities/entity-leaf-details/entity-leaf-details.ts +56 -0
  262. package/entities/entity-location/entity-location.html +34 -0
  263. package/entities/entity-location/entity-location.ts +98 -0
  264. package/entities/entity-long-text/entity-long-text.html +9 -0
  265. package/entities/entity-long-text/entity-long-text.ts +45 -0
  266. package/entities/entity-lookup/entity-lookup.html +25 -0
  267. package/entities/entity-lookup/entity-lookup.ts +68 -0
  268. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html +39 -0
  269. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.spec.ts +148 -0
  270. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts +152 -0
  271. package/entities/entity-percentage/entity-percentage.html +22 -0
  272. package/entities/entity-percentage/entity-percentage.ts +163 -0
  273. package/entities/entity-phase-gate/entity-phase-gate.html +20 -0
  274. package/entities/entity-phase-gate/entity-phase-gate.ts +129 -0
  275. package/entities/entity-preview/entity-preview-body.html +8 -0
  276. package/entities/entity-preview/entity-preview-body.ts +19 -0
  277. package/entities/entity-preview/entity-preview.html +14 -0
  278. package/entities/entity-preview/entity-preview.ts +33 -0
  279. package/entities/entity-preview/entity-value-preview.html +62 -0
  280. package/entities/entity-preview/entity-value-preview.spec.ts +191 -0
  281. package/entities/entity-preview/entity-value-preview.ts +69 -0
  282. package/entities/entity-schedule-item/entity-schedule-item.html +19 -0
  283. package/entities/entity-schedule-item/entity-schedule-item.ts +41 -0
  284. package/entities/entity-sections.util.ts +103 -0
  285. package/entities/entity-status/entity-status.html +20 -0
  286. package/entities/entity-status/entity-status.ts +60 -0
  287. package/entities/entity-text/entity-text.html +20 -0
  288. package/entities/entity-text/entity-text.ts +35 -0
  289. package/entities/entity-user/entity-user.html +181 -0
  290. package/entities/entity-user/entity-user.ts +179 -0
  291. package/entities/entity.model.ts +407 -0
  292. package/entities/leaf-details-display.utils.ts +269 -0
  293. package/entities/ng-package.json +6 -0
  294. package/entities/percentage-color.utils.spec.ts +94 -0
  295. package/entities/percentage-color.utils.ts +80 -0
  296. package/entities/public-api.ts +30 -0
  297. package/field-validation/character-limit.validator.ts +22 -0
  298. package/field-validation/error-message.pipe.spec.ts +184 -0
  299. package/field-validation/error-message.pipe.ts +80 -0
  300. package/field-validation/field-validation.ts +168 -0
  301. package/field-validation/ng-package.json +6 -0
  302. package/field-validation/public-api.ts +2 -0
  303. package/formula/formula-editor/formula-editor.html +89 -0
  304. package/formula/formula-editor/formula-editor.scss +25 -0
  305. package/formula/formula-editor/formula-editor.ts +467 -0
  306. package/formula/formula-editor/index.ts +1 -0
  307. package/formula/formula-editor-code/formula-autocomplete-normalization.util.spec.ts +58 -0
  308. package/formula/formula-editor-code/formula-autocomplete-normalization.util.ts +64 -0
  309. package/formula/formula-editor-code/formula-completion-range.util.spec.ts +62 -0
  310. package/formula/formula-editor-code/formula-completion-range.util.ts +71 -0
  311. package/formula/formula-editor-code/formula-completion-suggestion.util.spec.ts +23 -0
  312. package/formula/formula-editor-code/formula-completion-suggestion.util.ts +18 -0
  313. package/formula/formula-editor-code/formula-editor-code.html +15 -0
  314. package/formula/formula-editor-code/formula-editor-code.scss +90 -0
  315. package/formula/formula-editor-code/formula-editor-code.ts +1095 -0
  316. package/formula/formula-editor-code/index.ts +1 -0
  317. package/formula/formula-status-bar/formula-status-bar.html +119 -0
  318. package/formula/formula-status-bar/formula-status-bar.ts +66 -0
  319. package/formula/formula-status-bar/index.ts +1 -0
  320. package/formula/formula-toolbar/formula-toolbar.html +361 -0
  321. package/formula/formula-toolbar/formula-toolbar.ts +532 -0
  322. package/formula/formula-toolbar/index.ts +2 -0
  323. package/formula/formula-toolbar/operators.ts +122 -0
  324. package/formula/models/formula-block.model.ts +61 -0
  325. package/formula/models/formula-token.model.spec.ts +57 -0
  326. package/formula/models/formula-token.model.ts +852 -0
  327. package/formula/models/index.ts +5 -0
  328. package/formula/models/smart-block.model.ts +132 -0
  329. package/formula/models/validation-result.model.ts +80 -0
  330. package/formula/ng-package.json +6 -0
  331. package/formula/public-api.ts +8 -0
  332. package/formula/runtime/formula-runtime-catalogs.ts +554 -0
  333. package/formula/runtime/formula-runtime-engine.spec.ts +328 -0
  334. package/formula/runtime/formula-runtime-engine.ts +794 -0
  335. package/formula/runtime/formula-runtime.model.ts +53 -0
  336. package/formula/runtime/index.ts +3 -0
  337. package/formula/toolbar-item/index.ts +1 -0
  338. package/formula/toolbar-item/toolbar-item.html +143 -0
  339. package/formula/toolbar-item/toolbar-item.scss +14 -0
  340. package/formula/toolbar-item/toolbar-item.ts +223 -0
  341. package/icon-field/icon-field.html +58 -0
  342. package/icon-field/icon-field.scss +24 -0
  343. package/icon-field/icon-field.spec.ts +77 -0
  344. package/icon-field/icon-field.ts +205 -0
  345. package/icon-field/ng-package.json +6 -0
  346. package/icon-field/public-api.ts +1 -0
  347. package/list/list.html +22 -0
  348. package/list/list.ts +36 -0
  349. package/list/ng-package.json +6 -0
  350. package/list/public-api.ts +1 -0
  351. package/location-field/location-field.html +86 -0
  352. package/location-field/location-field.spec.ts +295 -0
  353. package/location-field/location-field.ts +662 -0
  354. package/location-field/location-manual-dialog.html +43 -0
  355. package/location-field/location-manual-dialog.ts +104 -0
  356. package/location-field/location-value.ts +67 -0
  357. package/location-field/ng-package.json +6 -0
  358. package/location-field/public-api.ts +3 -0
  359. package/menu/menu.html +71 -0
  360. package/menu/menu.scss +3 -0
  361. package/menu/menu.ts +186 -0
  362. package/menu/ng-package.json +6 -0
  363. package/menu/public-api.ts +1 -0
  364. package/modal/modal.ts +127 -0
  365. package/modal/ng-package.json +6 -0
  366. package/modal/public-api.ts +1 -0
  367. package/module-summary-card/module-summary-card.html +43 -0
  368. package/module-summary-card/module-summary-card.scss +0 -0
  369. package/module-summary-card/module-summary-card.ts +40 -0
  370. package/module-summary-card/ng-package.json +6 -0
  371. package/module-summary-card/public-api.ts +1 -0
  372. package/multi-select-field/multi-select-field.html +140 -0
  373. package/multi-select-field/multi-select-field.scss +0 -0
  374. package/multi-select-field/multi-select-field.spec.ts +21 -0
  375. package/multi-select-field/multi-select-field.ts +397 -0
  376. package/multi-select-field/ng-package.json +6 -0
  377. package/multi-select-field/public-api.ts +1 -0
  378. package/ng-package.json +9 -0
  379. package/number-field/ng-package.json +6 -0
  380. package/number-field/number-field.html +39 -0
  381. package/number-field/number-field.scss +8 -0
  382. package/number-field/number-field.spec.ts +21 -0
  383. package/number-field/number-field.ts +124 -0
  384. package/number-field/public-api.ts +1 -0
  385. package/package.json +54 -278
  386. package/page/index.ts +1 -0
  387. package/page/ng-package.json +6 -0
  388. package/page/page.html +37 -0
  389. package/page/page.ts +43 -0
  390. package/page/public-api.ts +1 -0
  391. package/page-header/index.ts +2 -0
  392. package/page-header/ng-package.json +6 -0
  393. package/page-header/page-header.html +60 -0
  394. package/page-header/page-header.ts +54 -0
  395. package/page-header/public-api.ts +1 -0
  396. package/paginator/ng-package.json +6 -0
  397. package/paginator/paginator.html +50 -0
  398. package/paginator/paginator.scss +0 -0
  399. package/paginator/paginator.ts +53 -0
  400. package/paginator/public-api.ts +1 -0
  401. package/pick-list-field/ng-package.json +6 -0
  402. package/pick-list-field/pick-list-field.html +39 -0
  403. package/pick-list-field/pick-list-field.scss +26 -0
  404. package/pick-list-field/pick-list-field.ts +259 -0
  405. package/pick-list-field/public-api.ts +1 -0
  406. package/progress/ng-package.json +6 -0
  407. package/progress/progress.html +36 -0
  408. package/progress/progress.ts +61 -0
  409. package/progress/public-api.ts +1 -0
  410. package/property-filter-builder/ng-package.json +6 -0
  411. package/property-filter-builder/property-filter-builder.html +192 -0
  412. package/property-filter-builder/property-filter-builder.ts +548 -0
  413. package/property-filter-builder/public-api.ts +1 -0
  414. package/radio-button-field/ng-package.json +6 -0
  415. package/radio-button-field/public-api.ts +1 -0
  416. package/radio-button-field/radio-button-field.html +44 -0
  417. package/radio-button-field/radio-button-field.scss +0 -0
  418. package/radio-button-field/radio-button-field.ts +114 -0
  419. package/radio-cards/ng-package.json +6 -0
  420. package/radio-cards/public-api.ts +1 -0
  421. package/radio-cards/radio-cards.css +3 -0
  422. package/radio-cards/radio-cards.html +54 -0
  423. package/radio-cards/radio-cards.spec.ts +22 -0
  424. package/radio-cards/radio-cards.ts +92 -0
  425. package/radio-cards-field/ng-package.json +6 -0
  426. package/radio-cards-field/public-api.ts +1 -0
  427. package/radio-cards-field/radio-cards-field.css +0 -0
  428. package/radio-cards-field/radio-cards-field.html +38 -0
  429. package/radio-cards-field/radio-cards-field.spec.ts +22 -0
  430. package/radio-cards-field/radio-cards-field.ts +182 -0
  431. package/runtime-action/ng-package.json +6 -0
  432. package/runtime-action/payload-builder.ts +246 -0
  433. package/runtime-action/public-api.ts +4 -0
  434. package/runtime-action/runtime-action-context.store.ts +26 -0
  435. package/runtime-action/runtime-action.runner.ts +302 -0
  436. package/runtime-action/runtime-action.types.ts +82 -0
  437. package/select-field/current-user.util.ts +54 -0
  438. package/select-field/ng-package.json +6 -0
  439. package/select-field/public-api.ts +1 -0
  440. package/select-field/select-field.html +142 -0
  441. package/select-field/select-field.scss +0 -0
  442. package/select-field/select-field.spec.ts +21 -0
  443. package/select-field/select-field.ts +471 -0
  444. package/sidebar/ng-package.json +6 -0
  445. package/sidebar/public-api.ts +1 -0
  446. package/sidebar/sidebar.html +368 -0
  447. package/sidebar/sidebar.ts +303 -0
  448. package/slider-field/ng-package.json +7 -0
  449. package/slider-field/public-api.ts +1 -0
  450. package/slider-field/slider-field.html +33 -0
  451. package/slider-field/slider-field.scss +11 -0
  452. package/slider-field/slider-field.spec.ts +44 -0
  453. package/slider-field/slider-field.ts +166 -0
  454. package/src/lib/base/base.facade.ts +159 -0
  455. package/src/lib/base/crud-base.state.ts +248 -0
  456. package/src/lib/config/date-format.config.ts +55 -0
  457. package/src/lib/config/ds-identity.preset.ts +538 -0
  458. package/src/lib/config/ds-identity.tokens.ts +209 -0
  459. package/src/lib/config/dynamic-form.model.ts +1162 -0
  460. package/src/lib/config/povide-messages.ts +5 -0
  461. package/src/lib/config/provide-confirmation.ts +5 -0
  462. package/src/lib/config/providemt.ts +506 -0
  463. package/src/lib/config/public-api.ts +0 -0
  464. package/src/lib/pipes/mt-date-format.pipe.spec.ts +60 -0
  465. package/src/lib/pipes/mt-date-format.pipe.ts +81 -0
  466. package/src/lib/utils/api-request.helper.ts +59 -0
  467. package/src/lib/utils/clock-time.util.ts +58 -0
  468. package/src/lib/utils/color.utils.ts +187 -0
  469. package/src/lib/utils/entity-adapter.ts +50 -0
  470. package/src/lib/utils/field-id.ts +42 -0
  471. package/src/lib/utils/http-context.ts +35 -0
  472. package/src/lib/utils/inputs.ts +6 -0
  473. package/src/lib/utils/state-helpers.ts +49 -0
  474. package/src/lib/utils/theme.ts +281 -0
  475. package/src/public-api.ts +30 -0
  476. package/statistic-card/ng-package.json +6 -0
  477. package/statistic-card/public-api.ts +1 -0
  478. package/statistic-card/statistic-card.html +31 -0
  479. package/statistic-card/statistic-card.scss +0 -0
  480. package/statistic-card/statistic-card.ts +59 -0
  481. package/table/ng-package.json +7 -0
  482. package/table/public-api.ts +10 -0
  483. package/table/table-actions-menu/public-api.ts +1 -0
  484. package/table/table-actions-menu/table-actions-menu.html +75 -0
  485. package/table/table-actions-menu/table-actions-menu.ts +171 -0
  486. package/table/table-caption/public-api.ts +1 -0
  487. package/table/table-caption/table-caption.html +118 -0
  488. package/table/table-caption/table-caption.ts +221 -0
  489. package/table/table-column-filter/public-api.ts +1 -0
  490. package/table/table-column-filter/table-column-filter.html +44 -0
  491. package/table/table-column-filter/table-column-filter.ts +106 -0
  492. package/table/table-export/html-to-text.util.ts +67 -0
  493. package/table/table-export/public-api.ts +1 -0
  494. package/table/table-export/table-export.service.spec.ts +186 -0
  495. package/table/table-export/table-export.service.ts +325 -0
  496. package/table/table-filter/public-api.ts +1 -0
  497. package/table/table-filter/table-filter.css +9 -0
  498. package/table/table-filter/table-filter.html +63 -0
  499. package/table/table-filter/table-filter.ts +126 -0
  500. package/table/table-filter-field/public-api.ts +1 -0
  501. package/table/table-filter-field/table-filter-field.html +182 -0
  502. package/table/table-filter-field/table-filter-field.ts +208 -0
  503. package/table/table-grouping/public-api.ts +1 -0
  504. package/table/table-grouping/table-grouping.spec.ts +218 -0
  505. package/table/table-grouping/table-grouping.ts +237 -0
  506. package/table/table-types.ts +242 -0
  507. package/table/table-value.utils.spec.ts +63 -0
  508. package/table/table-value.utils.ts +1014 -0
  509. package/table/table.css +145 -0
  510. package/table/table.html +572 -0
  511. package/table/table.ts +2042 -0
  512. package/tabs/ng-package.json +6 -0
  513. package/tabs/public-api.ts +1 -0
  514. package/tabs/tabs.html +417 -0
  515. package/tabs/tabs.scss +3 -0
  516. package/tabs/tabs.spec.ts +79 -0
  517. package/tabs/tabs.ts +397 -0
  518. package/text-field/ng-package.json +6 -0
  519. package/text-field/public-api.ts +1 -0
  520. package/text-field/text-field.html +75 -0
  521. package/text-field/text-field.scss +56 -0
  522. package/text-field/text-field.ts +251 -0
  523. package/textarea-field/ng-package.json +6 -0
  524. package/textarea-field/public-api.ts +1 -0
  525. package/textarea-field/textarea-field.html +37 -0
  526. package/textarea-field/textarea-field.scss +0 -0
  527. package/textarea-field/textarea-field.spec.ts +21 -0
  528. package/textarea-field/textarea-field.ts +169 -0
  529. package/toast/ng-package.json +6 -0
  530. package/toast/public-api.ts +2 -0
  531. package/toast/toast.html +18 -0
  532. package/toast/toast.service.ts +67 -0
  533. package/toast/toast.ts +21 -0
  534. package/toggle-field/ng-package.json +6 -0
  535. package/toggle-field/public-api.ts +1 -0
  536. package/toggle-field/toggle-field.html +78 -0
  537. package/toggle-field/toggle-field.scss +24 -0
  538. package/toggle-field/toggle-field.ts +150 -0
  539. package/tooltip/ng-package.json +6 -0
  540. package/tooltip/public-api.ts +2 -0
  541. package/tooltip/tooltip.ts +30 -0
  542. package/tooltip/truncate-tooltip.ts +124 -0
  543. package/topbar/ng-package.json +6 -0
  544. package/topbar/public-api.ts +1 -0
  545. package/topbar/topbar.html +52 -0
  546. package/topbar/topbar.ts +27 -0
  547. package/tree/ng-package.json +6 -0
  548. package/tree/public-api.ts +2 -0
  549. package/tree/tree-types.ts +55 -0
  550. package/tree/tree.html +126 -0
  551. package/tree/tree.scss +1 -0
  552. package/tree/tree.ts +303 -0
  553. package/treeselect-field/ng-package.json +6 -0
  554. package/treeselect-field/public-api.ts +1 -0
  555. package/treeselect-field/treeselect-field.html +71 -0
  556. package/treeselect-field/treeselect-field.ts +348 -0
  557. package/tsconfig.check.json +20 -0
  558. package/tsconfig.json +16 -0
  559. package/tsconfig.spec.json +24 -0
  560. package/upload-field/ng-package.json +6 -0
  561. package/upload-field/public-api.ts +2 -0
  562. package/upload-field/secure-image.pipe.ts +258 -0
  563. package/upload-field/upload-field.html +274 -0
  564. package/upload-field/upload-field.scss +0 -0
  565. package/upload-field/upload-field.spec.ts +169 -0
  566. package/upload-field/upload-field.ts +764 -0
  567. package/upload-field/upload-file-preview/upload-file-preview.html +41 -0
  568. package/upload-field/upload-file-preview/upload-file-preview.scss +0 -0
  569. package/upload-field/upload-file-preview/upload-file-preview.ts +57 -0
  570. package/upload-field/upload-user-preview/upload-user-preview.css +0 -0
  571. package/upload-field/upload-user-preview/upload-user-preview.html +73 -0
  572. package/upload-field/upload-user-preview/upload-user-preview.ts +54 -0
  573. package/uploader/ng-package.json +6 -0
  574. package/uploader/public-api.ts +1 -0
  575. package/uploader/uploader.service.spec.ts +271 -0
  576. package/uploader/uploader.service.ts +733 -0
  577. package/user-search-field/ng-package.json +6 -0
  578. package/user-search-field/public-api.ts +1 -0
  579. package/user-search-field/user-search-field.html +88 -0
  580. package/user-search-field/user-search-field.scss +4 -0
  581. package/user-search-field/user-search-field.spec.ts +176 -0
  582. package/user-search-field/user-search-field.ts +483 -0
  583. package/fesm2022/masterteam-components-avatar-text.mjs +0 -46
  584. package/fesm2022/masterteam-components-avatar-text.mjs.map +0 -1
  585. package/fesm2022/masterteam-components-avatar.mjs +0 -50
  586. package/fesm2022/masterteam-components-avatar.mjs.map +0 -1
  587. package/fesm2022/masterteam-components-breadcrumb.mjs +0 -27
  588. package/fesm2022/masterteam-components-breadcrumb.mjs.map +0 -1
  589. package/fesm2022/masterteam-components-business-fields.mjs +0 -1907
  590. package/fesm2022/masterteam-components-business-fields.mjs.map +0 -1
  591. package/fesm2022/masterteam-components-button-group.mjs +0 -20
  592. package/fesm2022/masterteam-components-button-group.mjs.map +0 -1
  593. package/fesm2022/masterteam-components-button.mjs +0 -82
  594. package/fesm2022/masterteam-components-button.mjs.map +0 -1
  595. package/fesm2022/masterteam-components-card.mjs +0 -28
  596. package/fesm2022/masterteam-components-card.mjs.map +0 -1
  597. package/fesm2022/masterteam-components-checkbox-field.mjs +0 -92
  598. package/fesm2022/masterteam-components-checkbox-field.mjs.map +0 -1
  599. package/fesm2022/masterteam-components-chip.mjs +0 -39
  600. package/fesm2022/masterteam-components-chip.mjs.map +0 -1
  601. package/fesm2022/masterteam-components-client-page-menu.mjs +0 -153
  602. package/fesm2022/masterteam-components-client-page-menu.mjs.map +0 -1
  603. package/fesm2022/masterteam-components-client-page.mjs +0 -413
  604. package/fesm2022/masterteam-components-client-page.mjs.map +0 -1
  605. package/fesm2022/masterteam-components-color-picker-field.mjs +0 -106
  606. package/fesm2022/masterteam-components-color-picker-field.mjs.map +0 -1
  607. package/fesm2022/masterteam-components-confirmation.mjs +0 -98
  608. package/fesm2022/masterteam-components-confirmation.mjs.map +0 -1
  609. package/fesm2022/masterteam-components-date-field.mjs +0 -158
  610. package/fesm2022/masterteam-components-date-field.mjs.map +0 -1
  611. package/fesm2022/masterteam-components-dialog.mjs +0 -33
  612. package/fesm2022/masterteam-components-dialog.mjs.map +0 -1
  613. package/fesm2022/masterteam-components-drawer.mjs +0 -268
  614. package/fesm2022/masterteam-components-drawer.mjs.map +0 -1
  615. package/fesm2022/masterteam-components-dynamic-drawer.mjs +0 -608
  616. package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +0 -1
  617. package/fesm2022/masterteam-components-editor-field.mjs +0 -103
  618. package/fesm2022/masterteam-components-editor-field.mjs.map +0 -1
  619. package/fesm2022/masterteam-components-empty-state.mjs +0 -53
  620. package/fesm2022/masterteam-components-empty-state.mjs.map +0 -1
  621. package/fesm2022/masterteam-components-entities.mjs +0 -2183
  622. package/fesm2022/masterteam-components-entities.mjs.map +0 -1
  623. package/fesm2022/masterteam-components-field-validation.mjs +0 -237
  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 -158
  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 -607
  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 -321
  640. package/fesm2022/masterteam-components-multi-select-field.mjs.map +0 -1
  641. package/fesm2022/masterteam-components-number-field.mjs +0 -102
  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 -210
  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 -131
  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 -415
  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 -3372
  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 -202
  676. package/fesm2022/masterteam-components-text-field.mjs.map +0 -1
  677. package/fesm2022/masterteam-components-textarea-field.mjs +0 -126
  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 -846
  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 -374
  696. package/fesm2022/masterteam-components-user-search-field.mjs.map +0 -1
  697. package/fesm2022/masterteam-components.mjs +0 -2512
  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 -675
  703. package/types/masterteam-components-button-group.d.ts +0 -8
  704. package/types/masterteam-components-button.d.ts +0 -62
  705. package/types/masterteam-components-card.d.ts +0 -14
  706. package/types/masterteam-components-checkbox-field.d.ts +0 -38
  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 -115
  710. package/types/masterteam-components-color-picker-field.d.ts +0 -39
  711. package/types/masterteam-components-confirmation.d.ts +0 -41
  712. package/types/masterteam-components-date-field.d.ts +0 -57
  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 -39
  717. package/types/masterteam-components-empty-state.d.ts +0 -47
  718. package/types/masterteam-components-entities.d.ts +0 -1102
  719. package/types/masterteam-components-field-validation.d.ts +0 -59
  720. package/types/masterteam-components-formula.d.ts +0 -759
  721. package/types/masterteam-components-icon-field.d.ts +0 -44
  722. package/types/masterteam-components-list.d.ts +0 -18
  723. package/types/masterteam-components-location-field.d.ts +0 -173
  724. package/types/masterteam-components-menu.d.ts +0 -55
  725. package/types/masterteam-components-modal.d.ts +0 -30
  726. package/types/masterteam-components-module-summary-card.d.ts +0 -18
  727. package/types/masterteam-components-multi-select-field.d.ts +0 -104
  728. package/types/masterteam-components-number-field.d.ts +0 -47
  729. package/types/masterteam-components-page-header.d.ts +0 -30
  730. package/types/masterteam-components-page.d.ts +0 -26
  731. package/types/masterteam-components-paginator.d.ts +0 -20
  732. package/types/masterteam-components-pick-list-field.d.ts +0 -65
  733. package/types/masterteam-components-progress.d.ts +0 -30
  734. package/types/masterteam-components-property-filter-builder.d.ts +0 -90
  735. package/types/masterteam-components-radio-button-field.d.ts +0 -41
  736. package/types/masterteam-components-radio-cards-field.d.ts +0 -39
  737. package/types/masterteam-components-radio-cards.d.ts +0 -33
  738. package/types/masterteam-components-runtime-action.d.ts +0 -105
  739. package/types/masterteam-components-select-field.d.ts +0 -136
  740. package/types/masterteam-components-sidebar.d.ts +0 -71
  741. package/types/masterteam-components-slider-field.d.ts +0 -41
  742. package/types/masterteam-components-statistic-card.d.ts +0 -28
  743. package/types/masterteam-components-table.d.ts +0 -937
  744. package/types/masterteam-components-tabs.d.ts +0 -80
  745. package/types/masterteam-components-text-field.d.ts +0 -60
  746. package/types/masterteam-components-textarea-field.d.ts +0 -45
  747. package/types/masterteam-components-toast.d.ts +0 -27
  748. package/types/masterteam-components-toggle-field.d.ts +0 -44
  749. package/types/masterteam-components-tooltip.d.ts +0 -26
  750. package/types/masterteam-components-topbar.d.ts +0 -20
  751. package/types/masterteam-components-tree.d.ts +0 -106
  752. package/types/masterteam-components-treeselect-field.d.ts +0 -79
  753. package/types/masterteam-components-upload-field.d.ts +0 -112
  754. package/types/masterteam-components-uploader.d.ts +0 -53
  755. package/types/masterteam-components-user-search-field.d.ts +0 -110
  756. package/types/masterteam-components.d.ts +0 -1261
@@ -1,2183 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { input, computed, ChangeDetectionStrategy, Component, signal, effect, untracked, inject, output, ElementRef, NgZone, Directive, model } from '@angular/core';
3
- import { TruncateTooltip, Tooltip } from '@masterteam/components/tooltip';
4
- import { Icon } from '@masterteam/icons';
5
- import { MTDateFormatPipe, REQUEST_CONTEXT, readableTextOn } from '@masterteam/components';
6
- import { HttpContext, HttpClient } from '@angular/common/http';
7
- import { TranslocoPipe, TranslocoService } from '@jsverse/transloco';
8
- import { Avatar } from '@masterteam/components/avatar';
9
- import { SecureImagePipe, UploadField } from '@masterteam/components/upload-field';
10
- import { Progress } from '@masterteam/components/progress';
11
- import { toSignal } from '@angular/core/rxjs-interop';
12
- import * as i1 from '@angular/forms';
13
- import { FormsModule } from '@angular/forms';
14
- import { Button } from '@masterteam/components/button';
15
- import { forkJoin, finalize, of, take, switchMap, EMPTY, map, catchError } from 'rxjs';
16
- import { Chip } from '@masterteam/components/chip';
17
- import * as i1$1 from 'primeng/tooltip';
18
- import { TooltipModule } from 'primeng/tooltip';
19
- import { NgTemplateOutlet, DOCUMENT } from '@angular/common';
20
- import { CdkDrag, CdkDropList, CdkDragPlaceholder } from '@angular/cdk/drag-drop';
21
-
22
- const ENTITY_EMPTY_VALUE_PLACEHOLDER = '_';
23
- function isValueMissing(value) {
24
- if (value === null || value === undefined) {
25
- return true;
26
- }
27
- if (typeof value === 'string') {
28
- return value.trim().length === 0;
29
- }
30
- return false;
31
- }
32
- function displayOrPlaceholder(value) {
33
- if (isValueMissing(value)) {
34
- return ENTITY_EMPTY_VALUE_PLACEHOLDER;
35
- }
36
- return String(value);
37
- }
38
- function isEntityLabelHidden(configuration) {
39
- const config = configuration;
40
- return config?.hideLabel ?? config?.hideName ?? false;
41
- }
42
- function isEntityAlignEnd(configuration) {
43
- const config = configuration;
44
- return config?.alignEnd ?? false;
45
- }
46
- /**
47
- * The product default: label above value.
48
- *
49
- * It used to be `bottom`, which is why Portfolio and Program cards rendered
50
- * "06/07/2026" then "Start Date" while Project cards — whose properties had
51
- * been through the property-configuration drawer, and so carry an explicit
52
- * `labelPosition` — rendered the label first. Two orders inside one Explore
53
- * module, reachable by clicking a different item in the same sidebar
54
- * (finding M-13). Label-first reads better down a column of mixed field types,
55
- * so it is what every unconfigured property now gets.
56
- *
57
- * An explicit configuration still wins: an administrator who deliberately
58
- * chose value-above-label for a property keeps it.
59
- */
60
- function resolveEntityLabelPosition(configuration) {
61
- const config = configuration;
62
- return config?.labelPosition ?? config?.labelPostion ?? 'top';
63
- }
64
- /**
65
- * Rewrites a localised numeric string into something `parseFloat` can read.
66
- *
67
- * `rawNumericValue` can fall back to the already-formatted display string, so
68
- * whatever `Intl.NumberFormat` produced has to survive a round trip. Under
69
- * `ar` that is harmless (Latin digits plus invisible direction marks), but
70
- * `ar-SA` renders Arabic-Indic digits and an Arabic decimal separator, which
71
- * parse to NaN — the bar would silently disappear rather than show a value.
72
- *
73
- * Handles Arabic-Indic (U+0660-0669) and Eastern Arabic-Indic (U+06F0-06F9)
74
- * digits, the Arabic decimal separator, thousands separators, and the
75
- * bidirectional marks Intl inserts around the percent sign.
76
- */
77
- function normalizeNumerals(input) {
78
- return input
79
- .replace(/[‎‏؜]/g, '')
80
- .replace(/[٠-٩]/g, (d) => String(d.charCodeAt(0) - 0x0660))
81
- .replace(/[۰-۹]/g, (d) => String(d.charCodeAt(0) - 0x06f0))
82
- .replace(/[٫]/g, '.')
83
- .replace(/[٬  ]/g, '');
84
- }
85
-
86
- class EntityField {
87
- label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
88
- labelIconName = input(null, ...(ngDevMode ? [{ debugName: "labelIconName" }] : /* istanbul ignore next */ []));
89
- configuration = input(...(ngDevMode ? [undefined, { debugName: "configuration" }] : /* istanbul ignore next */ []));
90
- gap = input('compact', ...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
91
- hideLabel = computed(() => isEntityLabelHidden(this.configuration()), ...(ngDevMode ? [{ debugName: "hideLabel" }] : /* istanbul ignore next */ []));
92
- labelPosition = computed(() => resolveEntityLabelPosition(this.configuration()), ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
93
- labelContainerClass = computed(() => {
94
- const justifyClass = isEntityAlignEnd(this.configuration())
95
- ? 'justify-end'
96
- : '';
97
- return `flex min-w-0 max-w-full items-center gap-1 text-sm text-gray-500 ${justifyClass}`.trimEnd();
98
- }, ...(ngDevMode ? [{ debugName: "labelContainerClass" }] : /* istanbul ignore next */ []));
99
- contentContainerClass = computed(() => {
100
- const alignClass = isEntityAlignEnd(this.configuration())
101
- ? 'self-end'
102
- : 'self-stretch';
103
- return `min-w-0 max-w-full ${alignClass}`;
104
- }, ...(ngDevMode ? [{ debugName: "contentContainerClass" }] : /* istanbul ignore next */ []));
105
- containerClass = computed(() => {
106
- const gapClass = this.gap() === 'relaxed'
107
- ? 'gap-2'
108
- : this.gap() === 'normal'
109
- ? 'gap-1'
110
- : 'gap-0.5';
111
- const directionClass = this.labelPosition() === 'top' ? 'flex-col-reverse' : 'flex-col';
112
- const alignClass = isEntityAlignEnd(this.configuration())
113
- ? 'items-end'
114
- : '';
115
- return `flex min-w-0 ${directionClass} ${gapClass} ${alignClass}`.trimEnd();
116
- }, ...(ngDevMode ? [{ debugName: "containerClass" }] : /* istanbul ignore next */ []));
117
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityField, deps: [], target: i0.ɵɵFactoryTarget.Component });
118
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityField, isStandalone: true, selector: "mt-entity-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelIconName: { classPropertyName: "labelIconName", publicName: "labelIconName", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: `
119
- <div [class]="containerClass()">
120
- <div [class]="contentContainerClass()">
121
- <ng-content />
122
- </div>
123
- @if (!hideLabel()) {
124
- <div [class]="labelContainerClass()">
125
- @if (labelIconName(); as iconName) {
126
- <mt-icon [icon]="iconName" size="xs" class="shrink-0" />
127
- }
128
- <span
129
- class="block min-w-0 truncate"
130
- mtTruncateTooltip
131
- tooltipPosition="top"
132
- >
133
- {{ label() }}
134
- </span>
135
- </div>
136
- }
137
- </div>
138
- `, isInline: true, dependencies: [{ kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
139
- }
140
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityField, decorators: [{
141
- type: Component,
142
- args: [{
143
- selector: 'mt-entity-field',
144
- changeDetection: ChangeDetectionStrategy.OnPush,
145
- imports: [TruncateTooltip, Icon],
146
- template: `
147
- <div [class]="containerClass()">
148
- <div [class]="contentContainerClass()">
149
- <ng-content />
150
- </div>
151
- @if (!hideLabel()) {
152
- <div [class]="labelContainerClass()">
153
- @if (labelIconName(); as iconName) {
154
- <mt-icon [icon]="iconName" size="xs" class="shrink-0" />
155
- }
156
- <span
157
- class="block min-w-0 truncate"
158
- mtTruncateTooltip
159
- tooltipPosition="top"
160
- >
161
- {{ label() }}
162
- </span>
163
- </div>
164
- }
165
- </div>
166
- `,
167
- host: {
168
- class: 'block min-w-0 w-full',
169
- },
170
- }]
171
- }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelIconName: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelIconName", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }] } });
172
-
173
- class EntityText {
174
- /** Full entity data object */
175
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
176
- /** Individual inputs (used when data is not provided) */
177
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
178
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
179
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
180
- displayValue = computed(() => {
181
- const d = this.data();
182
- if (d) {
183
- return displayOrPlaceholder(typeof d.value === 'string' ? d.value : null);
184
- }
185
- return displayOrPlaceholder(this.value());
186
- }, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
187
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityText, deps: [], target: i0.ɵɵFactoryTarget.Component });
188
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: EntityText, isStandalone: true, selector: "mt-entity-text", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n>\n <!--\n Two lines before the ellipsis, not one. Portfolio and project names were\n being cut mid-word on the Explore board (\"Smart City Infrastructure Po\u2026\"),\n which makes similarly-titled records indistinguishable without opening each\n one (finding H-06). `line-clamp-2` still ellipsises what genuinely does not\n fit, and `mtTruncateTooltip` reads `scrollHeight > clientHeight`, so the\n tooltip keeps working for the clamped case exactly as it did for the\n single-line one.\n -->\n <div\n class=\"min-w-0 max-w-full line-clamp-2 break-words text-sm font-semibold\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n [innerHTML]=\"displayValue()\"\n ></div>\n</mt-entity-field>\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
189
- }
190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityText, decorators: [{
191
- type: Component,
192
- args: [{ selector: 'mt-entity-text', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField, TruncateTooltip], template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n>\n <!--\n Two lines before the ellipsis, not one. Portfolio and project names were\n being cut mid-word on the Explore board (\"Smart City Infrastructure Po\u2026\"),\n which makes similarly-titled records indistinguishable without opening each\n one (finding H-06). `line-clamp-2` still ellipsises what genuinely does not\n fit, and `mtTruncateTooltip` reads `scrollHeight > clientHeight`, so the\n tooltip keeps working for the clamped case exactly as it did for the\n single-line one.\n -->\n <div\n class=\"min-w-0 max-w-full line-clamp-2 break-words text-sm font-semibold\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n [innerHTML]=\"displayValue()\"\n ></div>\n</mt-entity-field>\n" }]
193
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
194
-
195
- class EntityDate {
196
- /** Full entity data object */
197
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
198
- /** Individual inputs (used when data is not provided) */
199
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
200
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
201
- viewType = input('Date', ...(ngDevMode ? [{ debugName: "viewType" }] : /* istanbul ignore next */ []));
202
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
203
- /**
204
- * `Time` carries a wall-clock value (`HH:mm:ss`) with no date and no zone, so
205
- * `mtDateFormat` renders it as stored instead of shifting it into the
206
- * viewer's timezone the way its `DateTime` sibling is shifted.
207
- */
208
- resolvedViewType = computed(() => {
209
- switch (this.data()?.viewType ?? this.viewType()) {
210
- case 'DateTime':
211
- return 'dateTime';
212
- case 'Time':
213
- return 'time';
214
- default:
215
- return 'date';
216
- }
217
- }, ...(ngDevMode ? [{ debugName: "resolvedViewType" }] : /* istanbul ignore next */ []));
218
- displayValue = computed(() => this.data()?.rawValue ?? this.data()?.value ?? this.value(), ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
219
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityDate, deps: [], target: i0.ɵɵFactoryTarget.Component });
220
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityDate, isStandalone: true, selector: "mt-entity-date", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, viewType: { classPropertyName: "viewType", publicName: "viewType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n>\n <span\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n @if (displayValue()) {\n {{ displayValue() | mtDateFormat: resolvedViewType() }}\n } @else {\n -\n }\n </span>\n</mt-entity-field>\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "pipe", type: MTDateFormatPipe, name: "mtDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
221
- }
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityDate, decorators: [{
223
- type: Component,
224
- args: [{ selector: 'mt-entity-date', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField, TruncateTooltip, MTDateFormatPipe], template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n>\n <span\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\n mtTruncateTooltip\n tooltipPosition=\"top\"\n >\n @if (displayValue()) {\n {{ displayValue() | mtDateFormat: resolvedViewType() }}\n } @else {\n -\n }\n </span>\n</mt-entity-field>\n" }]
225
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], viewType: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewType", required: false }] }] } });
226
-
227
- class EntityStatus {
228
- /** Full entity data object */
229
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
230
- /** Individual inputs (used when data is not provided) */
231
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
232
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
233
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
234
- statusValue = computed(() => {
235
- const d = this.data();
236
- if (d && typeof d.value === 'object' && d.value !== null) {
237
- return d.value;
238
- }
239
- return this.value() ?? null;
240
- }, ...(ngDevMode ? [{ debugName: "statusValue" }] : /* istanbul ignore next */ []));
241
- badgeStyle = computed(() => {
242
- const status = this.statusValue();
243
- if (!status?.color)
244
- return {};
245
- return {
246
- color: status.color,
247
- backgroundColor: this.hexToRgba(status.color, 0.12),
248
- };
249
- }, ...(ngDevMode ? [{ debugName: "badgeStyle" }] : /* istanbul ignore next */ []));
250
- emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;
251
- statusLabel = computed(() => displayOrPlaceholder(this.statusValue()?.display), ...(ngDevMode ? [{ debugName: "statusLabel" }] : /* istanbul ignore next */ []));
252
- hexToRgba(hex, alpha) {
253
- const r = parseInt(hex.slice(1, 3), 16);
254
- const g = parseInt(hex.slice(3, 5), 16);
255
- const b = parseInt(hex.slice(5, 7), 16);
256
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
257
- }
258
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityStatus, deps: [], target: i0.ɵɵFactoryTarget.Component });
259
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityStatus, isStandalone: true, selector: "mt-entity-status", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (statusValue(); as status) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ statusLabel() }}\r\n </span>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
260
- }
261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityStatus, decorators: [{
262
- type: Component,
263
- args: [{ selector: 'mt-entity-status', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (statusValue(); as status) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ statusLabel() }}\r\n </span>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
264
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
265
-
266
- class EntityUser {
267
- httpContext = new HttpContext().set(REQUEST_CONTEXT, {
268
- useBaseUrl: true,
269
- });
270
- /** Full entity data object */
271
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
272
- expanded = signal(false, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
273
- displayName = computed(() => this.data()?.name ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
274
- isMultiUser = computed(() => this.data()?.viewType === 'MultiUser', ...(ngDevMode ? [{ debugName: "isMultiUser" }] : /* istanbul ignore next */ []));
275
- /** Resolved user objects from either a User or MultiUser entity value. */
276
- users = computed(() => {
277
- const val = this.data()?.value;
278
- const values = Array.isArray(val) ? val : [val];
279
- return values.filter(isEntityUserValue);
280
- }, ...(ngDevMode ? [{ debugName: "users" }] : /* istanbul ignore next */ []));
281
- maxVisibleUsers = computed(() => {
282
- const configured = Number(this.config().maxVisibleUsers);
283
- return Number.isInteger(configured) && configured > 0 ? configured : 5;
284
- }, ...(ngDevMode ? [{ debugName: "maxVisibleUsers" }] : /* istanbul ignore next */ []));
285
- visibleUsers = computed(() => {
286
- const users = this.users();
287
- if (!this.isMultiUser() || this.expanded()) {
288
- return users;
289
- }
290
- return users.slice(0, this.maxVisibleUsers());
291
- }, ...(ngDevMode ? [{ debugName: "visibleUsers" }] : /* istanbul ignore next */ []));
292
- hiddenUserCount = computed(() => this.users().length - this.visibleUsers().length, ...(ngDevMode ? [{ debugName: "hiddenUserCount" }] : /* istanbul ignore next */ []));
293
- /** First user retained for the existing single-user computed API. */
294
- userValue = computed(() => this.users()[0] ?? null, ...(ngDevMode ? [{ debugName: "userValue" }] : /* istanbul ignore next */ []));
295
- userNameFor(user) {
296
- return displayOrPlaceholder(user.displayName ?? null);
297
- }
298
- userPhotoFor(user) {
299
- return this.showUserImage() ? (user.photoUrl ?? '') : '';
300
- }
301
- labelTextFor(user) {
302
- return user.name ?? '';
303
- }
304
- isUnlinkedUser(user) {
305
- return user.isLinkedToCurrentApplication === false && !!user.userName;
306
- }
307
- phoneNumberFor(user) {
308
- return user.phoneNumber ?? '';
309
- }
310
- emailFor(user) {
311
- return user.email ?? '';
312
- }
313
- hasContactInfoFor(user) {
314
- return ((this.showPhoneNumber() && !!this.phoneNumberFor(user)) ||
315
- (this.showEmail() && !!this.emailFor(user)));
316
- }
317
- emptyUserName = computed(() => displayOrPlaceholder(null), ...(ngDevMode ? [{ debugName: "emptyUserName" }] : /* istanbul ignore next */ []));
318
- rawUserName = computed(() => this.userValue()?.displayName ?? null, ...(ngDevMode ? [{ debugName: "rawUserName" }] : /* istanbul ignore next */ []));
319
- userName = computed(() => displayOrPlaceholder(this.rawUserName()), ...(ngDevMode ? [{ debugName: "userName" }] : /* istanbul ignore next */ []));
320
- userPhoto = computed(() => this.showUserImage() ? (this.userValue()?.photoUrl ?? '') : '', ...(ngDevMode ? [{ debugName: "userPhoto" }] : /* istanbul ignore next */ []));
321
- labelText = computed(() => this.userValue()?.name ?? '', ...(ngDevMode ? [{ debugName: "labelText" }] : /* istanbul ignore next */ []));
322
- /**
323
- * `true` when the referenced user is no longer linked to the application.
324
- * Drives the inline info badge/tooltip next to the display name.
325
- */
326
- isUnlinked = computed(() => this.userValue()?.isLinkedToCurrentApplication === false &&
327
- this.userValue()?.userName, ...(ngDevMode ? [{ debugName: "isUnlinked" }] : /* istanbul ignore next */ []));
328
- // ── Configuration-driven visibility ──
329
- config = computed(() => this.data()?.configuration ?? {}, ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
330
- showDisplayName = computed(() => this.config().showDisplayName ?? true, ...(ngDevMode ? [{ debugName: "showDisplayName" }] : /* istanbul ignore next */ []));
331
- showPhoneNumber = computed(() => this.config().showPhoneNumber ?? false, ...(ngDevMode ? [{ debugName: "showPhoneNumber" }] : /* istanbul ignore next */ []));
332
- showEmail = computed(() => this.config().showEmail ?? false, ...(ngDevMode ? [{ debugName: "showEmail" }] : /* istanbul ignore next */ []));
333
- /**
334
- * When off, the avatar falls back to the generic user icon so the layout keeps
335
- * its shape while the user's real picture stays hidden.
336
- */
337
- showUserImage = computed(() => this.config().showUserImage ?? true, ...(ngDevMode ? [{ debugName: "showUserImage" }] : /* istanbul ignore next */ []));
338
- phoneNumber = computed(() => this.userValue()?.phoneNumber ?? '', ...(ngDevMode ? [{ debugName: "phoneNumber" }] : /* istanbul ignore next */ []));
339
- email = computed(() => this.userValue()?.email ?? '', ...(ngDevMode ? [{ debugName: "email" }] : /* istanbul ignore next */ []));
340
- hasContactInfo = computed(() => (this.showPhoneNumber() && !!this.phoneNumber()) ||
341
- (this.showEmail() && !!this.email()), ...(ngDevMode ? [{ debugName: "hasContactInfo" }] : /* istanbul ignore next */ []));
342
- constructor() {
343
- effect(() => {
344
- void this.data()?.value;
345
- untracked(() => this.expanded.set(false));
346
- });
347
- }
348
- showAllUsers() {
349
- this.expanded.set(true);
350
- }
351
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityUser, deps: [], target: i0.ɵɵFactoryTarget.Component });
352
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityUser, isStandalone: true, selector: "mt-entity-user", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (isMultiUser()) {\r\n <div\r\n class=\"flex min-w-0 flex-wrap items-center gap-2\"\r\n data-testid=\"multi-user-list\"\r\n >\r\n @for (user of visibleUsers(); track user.id ?? $index) {\r\n <div\r\n class=\"inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-full border border-surface-200 bg-surface-50 py-1 ps-1 pe-2\"\r\n >\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-7! h-7! text-white! text-sm! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <span\r\n class=\"max-w-36 truncate text-xs text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n }\r\n\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-xs text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.phone\" size=\"xs\" />\r\n </a>\r\n }\r\n\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.mail-01\" size=\"xs\" />\r\n </a>\r\n }\r\n </div>\r\n } @empty {\r\n <span class=\"text-sm text-gray-700\">{{ emptyUserName() }}</span>\r\n }\r\n\r\n @if (hiddenUserCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-8 min-w-8 shrink-0 cursor-pointer items-center justify-center rounded-full border border-primary-200 bg-primary-50 px-2 text-xs font-semibold text-primary-700 transition-colors hover:bg-primary-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500\"\r\n data-testid=\"show-all-users\"\r\n [attr.aria-label]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n [mtTooltip]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n tooltipPosition=\"top\"\r\n (click)=\"showAllUsers()\"\r\n >\r\n +{{ hiddenUserCount() }}\r\n </button>\r\n }\r\n </div>\r\n } @else {\r\n @if (users()[0]; as user) {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <div class=\"flex min-w-0 flex-1 flex-col\">\r\n <div class=\"flex min-w-0 items-center gap-1\">\r\n <span\r\n class=\"truncate text-sm text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-sm text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n </div>\r\n @if (labelTextFor(user)) {\r\n <span class=\"truncate text-xs text-gray-500\">{{\r\n labelTextFor(user)\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (hasContactInfoFor(user)) {\r\n <div class=\"ms-auto flex shrink-0 items-center gap-1.5\">\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n icon=\"communication.phone\"\r\n badgeSeverity=\"secondary\"\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n />\r\n </a>\r\n }\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n icon=\"communication.mail-01\"\r\n badgeSeverity=\"secondary\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n @if (showDisplayName()) {\r\n <span class=\"truncate text-sm text-gray-700\">{{\r\n emptyUserName()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "pipe", type: SecureImagePipe, name: "secureImage" }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
353
- }
354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityUser, decorators: [{
355
- type: Component,
356
- args: [{ selector: 'mt-entity-user', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
357
- Avatar,
358
- Tooltip,
359
- TruncateTooltip,
360
- Icon,
361
- SecureImagePipe,
362
- EntityField,
363
- TranslocoPipe,
364
- ], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (isMultiUser()) {\r\n <div\r\n class=\"flex min-w-0 flex-wrap items-center gap-2\"\r\n data-testid=\"multi-user-list\"\r\n >\r\n @for (user of visibleUsers(); track user.id ?? $index) {\r\n <div\r\n class=\"inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-full border border-surface-200 bg-surface-50 py-1 ps-1 pe-2\"\r\n >\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-7! h-7! text-white! text-sm! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <span\r\n class=\"max-w-36 truncate text-xs text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n }\r\n\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-xs text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.phone\" size=\"xs\" />\r\n </a>\r\n }\r\n\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex shrink-0\"\r\n >\r\n <mt-icon icon=\"communication.mail-01\" size=\"xs\" />\r\n </a>\r\n }\r\n </div>\r\n } @empty {\r\n <span class=\"text-sm text-gray-700\">{{ emptyUserName() }}</span>\r\n }\r\n\r\n @if (hiddenUserCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-8 min-w-8 shrink-0 cursor-pointer items-center justify-center rounded-full border border-primary-200 bg-primary-50 px-2 text-xs font-semibold text-primary-700 transition-colors hover:bg-primary-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500\"\r\n data-testid=\"show-all-users\"\r\n [attr.aria-label]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n [mtTooltip]=\"\r\n 'components.userReference.showMore'\r\n | transloco: { count: hiddenUserCount() }\r\n \"\r\n tooltipPosition=\"top\"\r\n (click)=\"showAllUsers()\"\r\n >\r\n +{{ hiddenUserCount() }}\r\n </button>\r\n }\r\n </div>\r\n } @else {\r\n @if (users()[0]; as user) {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [image]=\"\r\n userPhotoFor(user)\r\n ? (userPhotoFor(user)\r\n | secureImage: true : httpContext : 'avatar/')\r\n : ''\r\n \"\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n\r\n @if (showDisplayName()) {\r\n <div class=\"flex min-w-0 flex-1 flex-col\">\r\n <div class=\"flex min-w-0 items-center gap-1\">\r\n <span\r\n class=\"truncate text-sm text-gray-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ userNameFor(user) }}</span\r\n >\r\n @if (isUnlinkedUser(user)) {\r\n <mt-icon\r\n icon=\"general.info-circle\"\r\n class=\"shrink-0 text-sm text-amber-500\"\r\n [mtTooltip]=\"'components.userReference.notLinked' | transloco\"\r\n tooltipPosition=\"top\"\r\n />\r\n }\r\n </div>\r\n @if (labelTextFor(user)) {\r\n <span class=\"truncate text-xs text-gray-500\">{{\r\n labelTextFor(user)\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n\r\n @if (hasContactInfoFor(user)) {\r\n <div class=\"ms-auto flex shrink-0 items-center gap-1.5\">\r\n @if (showPhoneNumber() && phoneNumberFor(user)) {\r\n <a\r\n [href]=\"'tel:' + phoneNumberFor(user)\"\r\n [attr.aria-label]=\"phoneNumberFor(user)\"\r\n [mtTooltip]=\"phoneNumberFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n icon=\"communication.phone\"\r\n badgeSeverity=\"secondary\"\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n />\r\n </a>\r\n }\r\n @if (showEmail() && emailFor(user)) {\r\n <a\r\n [href]=\"'mailto:' + emailFor(user)\"\r\n [attr.aria-label]=\"emailFor(user)\"\r\n [mtTooltip]=\"emailFor(user)\"\r\n tooltipPosition=\"top\"\r\n class=\"inline-flex\"\r\n >\r\n <mt-avatar\r\n styleClass=\"bg-surface-100! text-surface-600! h-7! w-7! text-sm! font-semibold!\"\r\n icon=\"communication.mail-01\"\r\n badgeSeverity=\"secondary\"\r\n />\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"flex min-w-0 items-center gap-2\">\r\n <mt-avatar\r\n [icon]=\"'user.user-01'\"\r\n styleClass=\"w-10! h-10! text-white! text-xxl! bg-primary-500!\"\r\n ></mt-avatar>\r\n @if (showDisplayName()) {\r\n <span class=\"truncate text-sm text-gray-700\">{{\r\n emptyUserName()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n }\r\n</mt-entity-field>\r\n" }]
365
- }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
366
- function isEntityUserValue(value) {
367
- if (!value || typeof value !== 'object' || Array.isArray(value)) {
368
- return false;
369
- }
370
- return 'displayName' in value;
371
- }
372
-
373
- /** A finite number, or null for anything that cannot be compared numerically. */
374
- function toFiniteNumber(value) {
375
- if (value === null || value === undefined || value === '') {
376
- return null;
377
- }
378
- const parsed = typeof value === 'number'
379
- ? value
380
- : Number(String(value).replace(/%/g, '').trim());
381
- return Number.isFinite(parsed) ? parsed : null;
382
- }
383
- /**
384
- * Whether `value` falls inside a rule's band. Both bounds are inclusive, an
385
- * absent bound is open-ended, and a rule carrying neither bound is malformed —
386
- * it never matches rather than swallowing every value.
387
- */
388
- function matchesPercentageColorRule(value, rule) {
389
- if (!rule) {
390
- return false;
391
- }
392
- const min = toFiniteNumber(rule.minValue);
393
- const max = toFiniteNumber(rule.maxValue);
394
- if (min === null && max === null) {
395
- return false;
396
- }
397
- if (min !== null && value < min) {
398
- return false;
399
- }
400
- return max === null || value <= max;
401
- }
402
- /**
403
- * The colour for a percentage value: rules in their configured order, first
404
- * match wins, `defaultColor` when nothing matches.
405
- *
406
- * The backend owns this evaluation and ships the winner as `color` on
407
- * render/value/fetch responses, so callers must prefer that resolved colour.
408
- * This exists for the surfaces that hold a raw rule set and no resolved colour
409
- * — the property-form preview, and catalog reads that never went through a
410
- * value response.
411
- */
412
- function resolvePercentageColor(value, source) {
413
- const fallback = source?.defaultColor?.trim() || null;
414
- const numericValue = toFiniteNumber(value);
415
- const rules = source?.colorRules;
416
- if (numericValue === null || !Array.isArray(rules)) {
417
- return fallback;
418
- }
419
- const match = rules.find((rule) => matchesPercentageColorRule(numericValue, rule));
420
- return match?.color?.trim() || fallback;
421
- }
422
-
423
- class EntityPercentage {
424
- transloco = inject(TranslocoService);
425
- /** Active locale, so number formatting follows the UI language. */
426
- locale = computed(() => this.transloco.getActiveLang() || 'en', ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
427
- /** Full entity data object */
428
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
429
- /** Individual inputs (used when data is not provided) */
430
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
431
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
432
- rawValue = input(...(ngDevMode ? [undefined, { debugName: "rawValue" }] : /* istanbul ignore next */ []));
433
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
434
- displayValue = computed(() => {
435
- const d = this.data();
436
- const raw = d
437
- ? typeof d.value === 'string'
438
- ? d.value
439
- : null
440
- : this.value();
441
- return displayOrPlaceholder(this.formatPercentageDisplay(raw));
442
- }, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
443
- rawNumericValue = computed(() => this.data()?.rawValue ??
444
- this.rawValue() ??
445
- this.value() ??
446
- this.displayValue(), ...(ngDevMode ? [{ debugName: "rawNumericValue" }] : /* istanbul ignore next */ []));
447
- hasNumericValue = computed(() => {
448
- return this.parseNumericValue(this.rawNumericValue()) !== null;
449
- }, ...(ngDevMode ? [{ debugName: "hasNumericValue" }] : /* istanbul ignore next */ []));
450
- numericValue = computed(() => {
451
- const num = this.parseNumericValue(this.rawNumericValue());
452
- return num === null ? 0 : Math.min(num, 100);
453
- }, ...(ngDevMode ? [{ debugName: "numericValue" }] : /* istanbul ignore next */ []));
454
- maxValue = computed(() => {
455
- const num = this.parseNumericValue(this.rawNumericValue());
456
- if (num === null)
457
- return 100;
458
- return num > 100 ? Math.ceil(num) : 100;
459
- }, ...(ngDevMode ? [{ debugName: "maxValue" }] : /* istanbul ignore next */ []));
460
- // ── Configuration-driven visibility ──
461
- hideName = computed(() => isEntityLabelHidden(this.data()?.configuration), ...(ngDevMode ? [{ debugName: "hideName" }] : /* istanbul ignore next */ []));
462
- /**
463
- * The bar colour. The backend evaluates the property's colour rules and
464
- * returns the winner as `color` on render/value/fetch responses, so a
465
- * resolved colour always wins — the rules are only evaluated here for
466
- * configurations that arrive without one (a catalog read, or the
467
- * property-form preview).
468
- */
469
- progressColor = computed(() => {
470
- const d = this.data();
471
- const direct = d?.configuration;
472
- const fromProperty = d?.propertyConfiguration;
473
- const resolved = direct?.color?.trim() || fromProperty?.color?.trim();
474
- if (resolved) {
475
- return resolved;
476
- }
477
- const raw = this.rawNumericValue();
478
- return (resolvePercentageColor(raw, direct) ??
479
- resolvePercentageColor(raw, fromProperty) ??
480
- 'primary');
481
- }, ...(ngDevMode ? [{ debugName: "progressColor" }] : /* istanbul ignore next */ []));
482
- /**
483
- * Renders a percentage for the active locale.
484
- *
485
- * This used to echo the backend's string and only append `%` when that string
486
- * already carried one — so in Arabic, where the API returns a bare `"25"`,
487
- * the symbol vanished and a progress value rendered as an unlabelled `25`.
488
- * Next to a bar that could be a percentage, a count or a score (finding
489
- * H-08).
490
- *
491
- * Formatting from the NUMBER through `Intl.NumberFormat` makes the symbol,
492
- * the decimal separator and the digit shapes follow the locale instead of the
493
- * payload. `maximumFractionDigits: 1` preserves the precision the old code
494
- * kept; `style: 'percent'` expects a fraction, hence the /100.
495
- *
496
- * Non-numeric values pass through untouched — a status string or an em dash
497
- * must not be mangled into `NaN%`.
498
- */
499
- formatPercentageDisplay(raw) {
500
- if (isValueMissing(raw)) {
501
- return raw;
502
- }
503
- const num = this.parseNumericValue(raw);
504
- if (num === null) {
505
- return raw;
506
- }
507
- try {
508
- return new Intl.NumberFormat(this.locale(), {
509
- style: 'percent',
510
- maximumFractionDigits: 1,
511
- }).format(num / 100);
512
- }
513
- catch {
514
- // An unknown locale tag must not cost the user their number.
515
- return `${Number(num.toFixed(1))}%`;
516
- }
517
- }
518
- parseNumericValue(raw) {
519
- if (isValueMissing(raw)) {
520
- return null;
521
- }
522
- const normalizedRawValue = normalizeNumerals(String(raw))
523
- .replace(/[%٪]/g, '')
524
- .trim();
525
- if (!normalizedRawValue) {
526
- return null;
527
- }
528
- const numericValue = Number.parseFloat(normalizedRawValue);
529
- return Number.isNaN(numericValue) ? null : numericValue;
530
- }
531
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPercentage, deps: [], target: i0.ɵɵFactoryTarget.Component });
532
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPercentage, isStandalone: true, selector: "mt-entity-percentage", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, rawValue: { classPropertyName: "rawValue", publicName: "rawValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "component", type: Progress, selector: "mt-progress", inputs: ["value", "mode", "showLabel", "unit", "color", "minValue", "maxValue", "height", "circleSize", "strokeWidth", "customClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
533
- }
534
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPercentage, decorators: [{
535
- type: Component,
536
- args: [{ selector: 'mt-entity-percentage', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [Progress], template: "<div class=\"flex flex-col gap-1\">\r\n <div class=\"flex items-center justify-between\">\r\n @if (!hideName()) {\r\n <span class=\"text-xs font-semibold\">{{ displayName() }}</span>\r\n }\r\n <span class=\"text-xs font-bold\" [class.ms-auto]=\"hideName()\">{{\r\n displayValue()\r\n }}</span>\r\n </div>\r\n @if (hasNumericValue()) {\r\n <mt-progress\r\n [value]=\"numericValue()\"\r\n [showLabel]=\"false\"\r\n [height]=\"9\"\r\n [maxValue]=\"maxValue()\"\r\n [color]=\"progressColor()\"\r\n >\r\n </mt-progress>\r\n } @else {\r\n <div class=\"h-[9px] rounded-full bg-gray-200\"></div>\r\n }\r\n</div>\r\n" }]
537
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], rawValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "rawValue", required: false }] }] } });
538
-
539
- /**
540
- * The largest amount still rendered in full.
541
- *
542
- * The reviewer measured exactly where the line falls: `100,000 SAR` fits a card
543
- * slot, `1,000,000 SAR` does not and loses its currency to the ellipsis. So the
544
- * comparison below is inclusive — anything ABOVE this compacts, and everything
545
- * a tenant sees today at or under it is untouched.
546
- */
547
- const CURRENCY_COMPACT_THRESHOLD = 100_000;
548
- /**
549
- * The numeric amount inside a formatted currency string.
550
- *
551
- * Strips the currency token, the grouping separators and the bidirectional
552
- * marks `Intl` leaves around them, and normalises Arabic-Indic digits so an
553
- * `ar-SA` payload parses like an `en` one. `null` when there is no number.
554
- */
555
- function parseCurrencyAmount(raw) {
556
- if (typeof raw !== 'string') {
557
- return null;
558
- }
559
- const numeric = normalizeNumerals(raw).replace(/[^0-9.+-]/g, '');
560
- if (!numeric || !/\d/.test(numeric)) {
561
- return null;
562
- }
563
- const parsed = Number.parseFloat(numeric);
564
- return Number.isFinite(parsed) ? parsed : null;
565
- }
566
- /**
567
- * Whatever is left of a formatted amount once the number is removed — `SAR`,
568
- * `ر.س`, `$`. Read from the payload rather than configured, so a tenant's own
569
- * currency survives untouched.
570
- */
571
- function currencyUnitOf(formatted) {
572
- return normalizeNumerals(formatted)
573
- .replace(/[0-9.,+-]/g, '')
574
- .trim();
575
- }
576
- /**
577
- * A large currency amount shortened so it fits a card slot, with the unit kept.
578
- *
579
- * A budget of a million or more used to render as `1,000,000 …`: the digits
580
- * survived the ellipsis and the currency did not, so the largest and most
581
- * consequential figures in the product were the only ones whose unit could not
582
- * be read (finding H-06). Compact notation keeps the whole thing inside the
583
- * slot — `SAR 1M` instead of `1,000,000 SAR` — and callers put the exact figure
584
- * in a tooltip, which is where a precise number belongs on a summary card.
585
- *
586
- * Returns `formatted` unchanged whenever the value already fits, is not a
587
- * number, or the runtime has no compact notation — so no tenant sees an
588
- * existing number change shape for no reason.
589
- */
590
- function compactCurrencyDisplay(formatted, rawValue, locale, threshold = CURRENCY_COMPACT_THRESHOLD) {
591
- const amount = parseCurrencyAmount(rawValue ?? formatted);
592
- if (amount === null || Math.abs(amount) <= threshold) {
593
- return formatted;
594
- }
595
- let compact;
596
- try {
597
- compact = new Intl.NumberFormat(locale, {
598
- notation: 'compact',
599
- maximumFractionDigits: 1,
600
- }).format(amount);
601
- }
602
- catch {
603
- return formatted;
604
- }
605
- const unit = currencyUnitOf(formatted);
606
- if (!unit) {
607
- return compact;
608
- }
609
- // Keep the payload's own unit placement — `SAR 1,000` and `1,000 SAR` are
610
- // both in use, and flipping one to the other reads as a different currency.
611
- return formatted.trimStart().startsWith(unit)
612
- ? `${unit} ${compact}`
613
- : `${compact} ${unit}`;
614
- }
615
-
616
- class EntityCurrency {
617
- transloco = inject(TranslocoService);
618
- /** Active locale, so number formatting follows the UI language. */
619
- locale = computed(() => this.transloco.getActiveLang() || 'en', ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
620
- /** Full entity data object */
621
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
622
- /** Individual inputs (used when data is not provided) */
623
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
624
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
625
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
626
- /** The backend's fully grouped string — always the tooltip, never truncated. */
627
- fullValue = computed(() => {
628
- const d = this.data();
629
- if (d) {
630
- return displayOrPlaceholder(typeof d.value === 'string' ? d.value : null);
631
- }
632
- return displayOrPlaceholder(this.value());
633
- }, ...(ngDevMode ? [{ debugName: "fullValue" }] : /* istanbul ignore next */ []));
634
- /**
635
- * What the cell renders: the backend's string, or a compact form of it when
636
- * the amount is large enough that the currency token would be truncated away.
637
- * See {@link compactCurrencyDisplay} (finding H-06).
638
- */
639
- displayValue = computed(() => compactCurrencyDisplay(this.fullValue(), this.data()?.rawValue, this.locale()), ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
640
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCurrency, deps: [], target: i0.ɵɵFactoryTarget.Component });
641
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: EntityCurrency, isStandalone: true, selector: "mt-entity-currency", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n>\n <span\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\n [mtTooltip]=\"fullValue()\"\n tooltipPosition=\"top\"\n >\n {{ displayValue() }}\n </span>\n</mt-entity-field>\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
642
- }
643
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCurrency, decorators: [{
644
- type: Component,
645
- args: [{ selector: 'mt-entity-currency', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField, Tooltip], template: "<mt-entity-field\n [label]=\"displayName()\"\n [configuration]=\"data()?.configuration\"\n>\n <span\n class=\"block min-w-0 truncate text-sm font-semibold tabular-nums whitespace-nowrap\"\n [mtTooltip]=\"fullValue()\"\n tooltipPosition=\"top\"\n >\n {{ displayValue() }}\n </span>\n</mt-entity-field>\n" }]
646
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
647
-
648
- class EntityCheckbox {
649
- /** Full entity data object */
650
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
651
- /** Individual inputs (used when data is not provided) */
652
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
653
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
654
- rawValue = input(...(ngDevMode ? [undefined, { debugName: "rawValue" }] : /* istanbul ignore next */ []));
655
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
656
- emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;
657
- hideName = computed(() => isEntityLabelHidden(this.data()?.configuration), ...(ngDevMode ? [{ debugName: "hideName" }] : /* istanbul ignore next */ []));
658
- checkboxState = computed(() => {
659
- const raw = this.data()?.rawValue ?? this.rawValue();
660
- if (raw !== undefined && raw !== null) {
661
- return this.parseBoolean(raw);
662
- }
663
- const val = this.data()?.value ?? this.value();
664
- if (typeof val === 'string') {
665
- return this.parseBoolean(val);
666
- }
667
- return null;
668
- }, ...(ngDevMode ? [{ debugName: "checkboxState" }] : /* istanbul ignore next */ []));
669
- parseBoolean(value) {
670
- const normalized = value.trim().toLowerCase();
671
- if (!normalized.length) {
672
- return null;
673
- }
674
- if (normalized === 'true') {
675
- return true;
676
- }
677
- if (normalized === 'false') {
678
- return false;
679
- }
680
- return null;
681
- }
682
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
683
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityCheckbox, isStandalone: true, selector: "mt-entity-checkbox", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, rawValue: { classPropertyName: "rawValue", publicName: "rawValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n }\r\n</div>\r\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
684
- }
685
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityCheckbox, decorators: [{
686
- type: Component,
687
- args: [{ selector: 'mt-entity-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"flex items-center gap-2\">\r\n @if (checkboxState() === true) {\r\n <svg class=\"w-5 h-5 text-green-500\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else if (checkboxState() === false) {\r\n <svg class=\"w-5 h-5 text-gray-300\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5.414l-2.293-2.293a1 1 0 011.414-1.414L10 11.172l3.879-3.879a1 1 0 111.414 1.414L10 13.414l-.707-.707-.293-.293z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n } @else {\r\n <span\r\n class=\"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-100 px-1 text-[10px] font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n @if (!hideName()) {\r\n <span class=\"text-sm font-semibold\">{{ displayName() }}</span>\r\n }\r\n</div>\r\n" }]
688
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], rawValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "rawValue", required: false }] }] } });
689
-
690
- class EntityLongText {
691
- /** Full entity data object */
692
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
693
- /** Individual inputs (used when data is not provided) */
694
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
695
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
696
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
697
- displayValue = computed(() => {
698
- const d = this.data();
699
- const raw = d
700
- ? typeof d.value === 'string'
701
- ? d.value
702
- : null
703
- : this.value();
704
- if (isValueMissing(raw)) {
705
- return ENTITY_EMPTY_VALUE_PLACEHOLDER;
706
- }
707
- return raw;
708
- }, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
709
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLongText, deps: [], target: i0.ɵɵFactoryTarget.Component });
710
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: EntityLongText, isStandalone: true, selector: "mt-entity-long-text", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"text-sm font-semibold break-words\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
711
- }
712
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLongText, decorators: [{
713
- type: Component,
714
- args: [{ selector: 'mt-entity-long-text', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"text-sm font-semibold break-words\"\r\n [innerHTML]=\"displayValue()\"\r\n ></div>\r\n</mt-entity-field>\r\n" }]
715
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
716
-
717
- class EntityLookup {
718
- /** Full entity data object */
719
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
720
- /** Individual inputs (used when data is not provided) */
721
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
722
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
723
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
724
- lookupValues = computed(() => {
725
- const value = this.data()?.value ?? this.value();
726
- if (Array.isArray(value)) {
727
- return value;
728
- }
729
- if (typeof value === 'object' && value !== null) {
730
- return [value];
731
- }
732
- return [];
733
- }, ...(ngDevMode ? [{ debugName: "lookupValues" }] : /* istanbul ignore next */ []));
734
- lookupBadgeStyle(lookup) {
735
- if (!lookup?.color)
736
- return {};
737
- return {
738
- color: lookup.color,
739
- backgroundColor: this.hexToRgba(lookup.color, 0.12),
740
- };
741
- }
742
- emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;
743
- lookupLabel(lookup) {
744
- return displayOrPlaceholder(lookup.display);
745
- }
746
- hexToRgba(hex, alpha) {
747
- const r = parseInt(hex.slice(1, 3), 16);
748
- const g = parseInt(hex.slice(3, 5), 16);
749
- const b = parseInt(hex.slice(5, 7), 16);
750
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
751
- }
752
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookup, deps: [], target: i0.ɵɵFactoryTarget.Component });
753
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookup, isStandalone: true, selector: "mt-entity-lookup", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (lookupValues().length) {\r\n <div class=\"flex flex-wrap gap-2\" data-testid=\"lookup-values\">\r\n @for (lookup of lookupValues(); track lookup.key) {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md px-3 py-2 text-xs font-semibold\"\r\n data-testid=\"lookup-value\"\r\n [style]=\"lookupBadgeStyle(lookup)\"\r\n >\r\n {{ lookupLabel(lookup) }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
754
- }
755
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookup, decorators: [{
756
- type: Component,
757
- args: [{ selector: 'mt-entity-lookup', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (lookupValues().length) {\r\n <div class=\"flex flex-wrap gap-2\" data-testid=\"lookup-values\">\r\n @for (lookup of lookupValues(); track lookup.key) {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md px-3 py-2 text-xs font-semibold\"\r\n data-testid=\"lookup-value\"\r\n [style]=\"lookupBadgeStyle(lookup)\"\r\n >\r\n {{ lookupLabel(lookup) }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
758
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
759
-
760
- /**
761
- * A section is persisted/transported as an ordinary display item whose
762
- * `propertyKey` carries this sentinel prefix instead of a real property key
763
- * (mirrors the LeafDetails synthetic-key convention). Both the customization
764
- * builder and the runtime renderer recognize it, so the constant lives here in
765
- * the shared entities layer rather than in either consumer.
766
- */
767
- const SECTION_KEY_PREFIX = '__section__::';
768
- /** True when a display item's key denotes a section marker. */
769
- function isSectionKey(key) {
770
- return typeof key === 'string' && key.startsWith(SECTION_KEY_PREFIX);
771
- }
772
- /** Mints a unique section marker key. */
773
- function buildSectionKey() {
774
- return `${SECTION_KEY_PREFIX}${crypto.randomUUID()}`;
775
- }
776
- /**
777
- * Resolves a localized label (`{ en, ar }`) for the given language, falling
778
- * back across locales. Returns '' when nothing is set.
779
- */
780
- function resolveLocalizedLabel(label, lang) {
781
- if (!label)
782
- return '';
783
- const primary = lang === 'ar' ? label.ar : label.en;
784
- return (primary || label.en || label.ar || '').trim();
785
- }
786
- /** True when the entity is a `Section` layout marker rather than a value. */
787
- function isEntitySection(entity) {
788
- return entity?.viewType === 'Section';
789
- }
790
- /**
791
- * Splits a flat, order-sorted entity list into section groups. Membership is
792
- * purely positional: each entity belongs to whichever `Section` marker precedes
793
- * it. Pass the output of `buildDisplayEntities` (already sorted by `order`).
794
- *
795
- * Zero markers → a single `{ section: null }` group holding everything, so the
796
- * bare-grid rendering is unchanged. Empty leading/trailing runs are dropped.
797
- */
798
- function groupEntitiesIntoSections(entities) {
799
- const groups = [];
800
- let current = { section: null, entities: [] };
801
- const flush = () => {
802
- if (current.section || current.entities.length > 0) {
803
- groups.push(current);
804
- }
805
- };
806
- for (const entity of entities) {
807
- if (isEntitySection(entity)) {
808
- flush();
809
- current = { section: entity, entities: [] };
810
- }
811
- else {
812
- current.entities.push(entity);
813
- }
814
- }
815
- flush();
816
- return groups;
817
- }
818
- /**
819
- * Resolves a section marker's display label for the given language, falling
820
- * back across locales and finally to the entity's `name`.
821
- */
822
- function getEntitySectionTitle(section, lang) {
823
- if (!section)
824
- return '';
825
- const label = section.configuration
826
- ?.label;
827
- return resolveLocalizedLabel(label, lang) || (section.name ?? '');
828
- }
829
-
830
- /** `#RGB` / `#RRGGBB`. Anything else is used as-is for the text color only. */
831
- const HEX_COLOR_PATTERN = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
832
- /**
833
- * Badge color used when the phase gate carries no `color`. `color` is optional
834
- * presentation metadata, so a phase gate without one must still read as a
835
- * badge rather than as bare text — this is the same neutral slate the table
836
- * falls back to for uncategorized status chips.
837
- */
838
- const DEFAULT_PHASE_GATE_COLOR = '#475569';
839
- /**
840
- * Preview renderer for `PhaseGate` properties — a calculated, read-only lookup
841
- * pointing at the schema phase gate the record currently sits on. It renders
842
- * exactly like {@link EntityLookup} (colored badge) but resolves its label
843
- * per-language.
844
- *
845
- * Label resolution, in order:
846
- * 1. `value.ar` / `value.en` for the active language — the backend sends both
847
- * so a client-side language switch re-renders without a refetch, which is
848
- * why they win over the already-resolved `display`.
849
- * 2. `value.display`, then the other locale.
850
- * 3. The flat display, for payloads that send the value as a bare string
851
- * (comparison snapshots build their sides that way).
852
- * 4. `rawValue` — the schema phase-gate id — as a last resort.
853
- */
854
- class EntityPhaseGate {
855
- transloco = inject(TranslocoService);
856
- /** Full entity data object */
857
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
858
- /** Individual inputs (used when data is not provided) */
859
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
860
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
861
- activeLang = toSignal(this.transloco.langChanges$, {
862
- initialValue: this.transloco.getActiveLang(),
863
- });
864
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
865
- phaseGateValue = computed(() => {
866
- const value = this.data()?.value;
867
- if (value && typeof value === 'object' && !Array.isArray(value)) {
868
- return value;
869
- }
870
- return this.value() ?? null;
871
- }, ...(ngDevMode ? [{ debugName: "phaseGateValue" }] : /* istanbul ignore next */ []));
872
- /** Resolved label, or `null` when nothing at all is available. */
873
- resolvedLabel = computed(() => {
874
- const phaseGate = this.phaseGateValue();
875
- if (phaseGate) {
876
- const localized = resolveLocalizedLabel(phaseGate, this.activeLang());
877
- const label = localized || phaseGate.display?.trim();
878
- if (label)
879
- return label;
880
- }
881
- return this.flatDisplay() ?? this.rawId();
882
- }, ...(ngDevMode ? [{ debugName: "resolvedLabel" }] : /* istanbul ignore next */ []));
883
- hasValue = computed(() => this.resolvedLabel() !== null, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
884
- phaseGateLabel = computed(() => displayOrPlaceholder(this.resolvedLabel()), ...(ngDevMode ? [{ debugName: "phaseGateLabel" }] : /* istanbul ignore next */ []));
885
- badgeStyle = computed(() => {
886
- const color = this.phaseGateValue()?.color?.trim() || DEFAULT_PHASE_GATE_COLOR;
887
- if (!HEX_COLOR_PATTERN.test(color))
888
- return { color };
889
- return {
890
- color,
891
- backgroundColor: this.hexToRgba(color, 0.12),
892
- };
893
- }, ...(ngDevMode ? [{ debugName: "badgeStyle" }] : /* istanbul ignore next */ []));
894
- emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;
895
- /** The value flattened to a plain display string by the sender. */
896
- flatDisplay() {
897
- const value = this.data()?.value;
898
- return typeof value === 'string' && value.trim() ? value.trim() : null;
899
- }
900
- /** The schema phase-gate id. */
901
- rawId() {
902
- const rawValue = this.data()?.rawValue;
903
- return typeof rawValue === 'string' && rawValue.trim()
904
- ? rawValue.trim()
905
- : null;
906
- }
907
- hexToRgba(hex, alpha) {
908
- const expanded = hex.length === 4
909
- ? `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`
910
- : hex;
911
- const r = parseInt(expanded.slice(1, 3), 16);
912
- const g = parseInt(expanded.slice(3, 5), 16);
913
- const b = parseInt(expanded.slice(5, 7), 16);
914
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
915
- }
916
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPhaseGate, deps: [], target: i0.ɵɵFactoryTarget.Component });
917
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPhaseGate, isStandalone: true, selector: "mt-entity-phase-gate", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasValue()) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ phaseGateLabel() }}\r\n </span>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
918
- }
919
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPhaseGate, decorators: [{
920
- type: Component,
921
- args: [{ selector: 'mt-entity-phase-gate', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasValue()) {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit\"\r\n [style]=\"badgeStyle()\"\r\n >\r\n {{ phaseGateLabel() }}\r\n </span>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
922
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
923
-
924
- class EntityAttachment {
925
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
926
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
927
- shape = input('default', ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
928
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
929
- endPoint = input('uploader', ...(ngDevMode ? [{ debugName: "endPoint" }] : /* istanbul ignore next */ []));
930
- context = input(undefined, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
931
- httpClient = inject(HttpClient);
932
- transloco = inject(TranslocoService);
933
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
934
- loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
935
- attachments = signal([], ...(ngDevMode ? [{ debugName: "attachments" }] : /* istanbul ignore next */ []));
936
- /** Key of the compact chip currently hovered, so it can reveal the download affordance. */
937
- hoveredAttachmentKey = signal(null, ...(ngDevMode ? [{ debugName: "hoveredAttachmentKey" }] : /* istanbul ignore next */ []));
938
- attachmentReferences = computed(() => this.normalizeAttachmentValue(this.data()?.value ?? this.value()), ...(ngDevMode ? [{ debugName: "attachmentReferences" }] : /* istanbul ignore next */ []));
939
- uploadValue = computed(() => {
940
- const references = this.attachmentReferences().map((reference) => {
941
- if (typeof reference === 'string') {
942
- return reference.trim();
943
- }
944
- if (reference.fileName) {
945
- return reference;
946
- }
947
- return reference.id?.trim() || reference;
948
- });
949
- if (!references.length) {
950
- return null;
951
- }
952
- return references.length === 1 ? references[0] : references;
953
- }, ...(ngDevMode ? [{ debugName: "uploadValue" }] : /* istanbul ignore next */ []));
954
- hasAttachments = computed(() => this.shape() === 'compact'
955
- ? this.attachments().length > 0
956
- : this.uploadValue() != null, ...(ngDevMode ? [{ debugName: "hasAttachments" }] : /* istanbul ignore next */ []));
957
- isMultiple = computed(() => this.attachmentReferences().length > 1, ...(ngDevMode ? [{ debugName: "isMultiple" }] : /* istanbul ignore next */ []));
958
- acceptTypes = computed(() => this.normalizeAcceptTypes(this.data()?.configuration?.['AcceptTypes']), ...(ngDevMode ? [{ debugName: "acceptTypes" }] : /* istanbul ignore next */ []));
959
- empty = '-';
960
- constructor() {
961
- effect((onCleanup) => {
962
- if (this.shape() !== 'compact') {
963
- this.loading.set(false);
964
- this.attachments.set([]);
965
- return;
966
- }
967
- const references = this.attachmentReferences();
968
- if (!references.length) {
969
- this.loading.set(false);
970
- this.attachments.set([]);
971
- return;
972
- }
973
- const shouldFetchMetadata = references.some((reference) => this.requiresMetadataRequest(reference));
974
- if (!shouldFetchMetadata) {
975
- this.attachments.set(references.filter(this.isAttachmentItemValue).map((reference) => ({
976
- ...reference,
977
- name: reference.name ??
978
- reference.fileName ??
979
- reference.id ??
980
- reference.name,
981
- extension: this.resolveExtension(reference),
982
- })));
983
- this.loading.set(false);
984
- return;
985
- }
986
- this.loading.set(true);
987
- const sub = forkJoin(references.map((reference) => this.resolveAttachment$(reference)))
988
- .pipe(finalize(() => this.loading.set(false)))
989
- .subscribe((attachments) => {
990
- this.attachments.set(attachments.filter((attachment) => attachment != null));
991
- });
992
- onCleanup(() => sub.unsubscribe());
993
- });
994
- }
995
- attachmentTrackBy(index, attachment) {
996
- return (attachment.id ?? attachment.fileName ?? attachment.name ?? String(index));
997
- }
998
- attachmentTooltip(attachment) {
999
- const name = attachment.name ??
1000
- attachment.fileName ??
1001
- attachment.id ??
1002
- this.transloco.translate('components.entitiesPreview.attachment');
1003
- return this.transloco.translate('components.entitiesPreview.downloadAttachment', { name });
1004
- }
1005
- /**
1006
- * Compact chips are clickable downloads but only show a file-type glyph,
1007
- * which doesn't read as actionable. Swap to a download icon while hovered
1008
- * so the action is obvious.
1009
- */
1010
- attachmentActionIcon(index, attachment) {
1011
- return this.hoveredAttachmentKey() ===
1012
- this.attachmentTrackBy(index, attachment)
1013
- ? 'general.download-01'
1014
- : this.attachmentIcon(attachment);
1015
- }
1016
- attachmentIcon(attachment) {
1017
- const extension = this.resolveExtension(attachment);
1018
- const contentType = attachment.contentType?.toLowerCase() ?? '';
1019
- if (contentType.startsWith('image/')) {
1020
- return 'image.image-03';
1021
- }
1022
- switch (extension) {
1023
- case '.pdf':
1024
- return 'file.file-06';
1025
- case '.doc':
1026
- case '.docx':
1027
- case '.txt':
1028
- case '.rtf':
1029
- return 'file.file-04';
1030
- case '.xls':
1031
- case '.xlsx':
1032
- case '.csv':
1033
- return 'file.file-03';
1034
- case '.ppt':
1035
- case '.pptx':
1036
- return 'file.file-05';
1037
- default:
1038
- return 'file.clipboard-attachment';
1039
- }
1040
- }
1041
- onCompactAttachmentClick(event, attachment) {
1042
- event.stopPropagation();
1043
- this.downloadAttachment(attachment);
1044
- }
1045
- downloadAttachment(attachment) {
1046
- const resolvedAttachment$ = this.requiresMetadataRequest(attachment)
1047
- ? this.resolveAttachment$(attachment)
1048
- : of(this.normalizeAttachmentItem(attachment));
1049
- resolvedAttachment$
1050
- .pipe(take(1), switchMap((resolvedAttachment) => {
1051
- if (!resolvedAttachment?.fileName) {
1052
- return EMPTY;
1053
- }
1054
- return this.httpClient
1055
- .get(`${this.endPoint()}/${resolvedAttachment.fileName}`, {
1056
- responseType: 'blob',
1057
- context: this.context(),
1058
- })
1059
- .pipe(take(1), map((blob) => ({
1060
- attachment: resolvedAttachment,
1061
- blob,
1062
- })));
1063
- }))
1064
- .subscribe(({ attachment, blob }) => {
1065
- const downloadBlob = new Blob([blob], {
1066
- type: attachment.contentType || blob.type || 'application/octet-stream',
1067
- });
1068
- const objectUrl = window.URL.createObjectURL(downloadBlob);
1069
- const anchor = document.createElement('a');
1070
- anchor.href = objectUrl;
1071
- anchor.download =
1072
- attachment.name ??
1073
- attachment.fileName ??
1074
- attachment.id ??
1075
- 'attachment';
1076
- anchor.click();
1077
- window.URL.revokeObjectURL(objectUrl);
1078
- });
1079
- }
1080
- resolveAttachment$(reference) {
1081
- const normalizedAttachment = this.normalizeAttachmentItem(reference);
1082
- if (!this.requiresMetadataRequest(reference)) {
1083
- return of(normalizedAttachment);
1084
- }
1085
- const attachmentId = typeof reference === 'string' ? reference.trim() : reference.id?.trim();
1086
- if (!attachmentId) {
1087
- return of(normalizedAttachment);
1088
- }
1089
- return this.httpClient
1090
- .get(`${this.endPoint()}/${attachmentId}/metaData`, {
1091
- context: this.context(),
1092
- })
1093
- .pipe(take(1), map((response) => this.normalizeAttachmentItem(response.data)), catchError(() => of(normalizedAttachment)));
1094
- }
1095
- normalizeAttachmentValue(value) {
1096
- if (value === null || value === undefined) {
1097
- return [];
1098
- }
1099
- if (Array.isArray(value)) {
1100
- return value.flatMap((item) => this.normalizeAttachmentValue(item));
1101
- }
1102
- if (typeof value === 'string') {
1103
- const trimmedValue = value.trim();
1104
- if (!trimmedValue || trimmedValue === '[]') {
1105
- return [];
1106
- }
1107
- if ((trimmedValue.startsWith('[') && trimmedValue.endsWith(']')) ||
1108
- (trimmedValue.startsWith('{') && trimmedValue.endsWith('}'))) {
1109
- try {
1110
- return this.normalizeAttachmentValue(JSON.parse(trimmedValue));
1111
- }
1112
- catch {
1113
- return [trimmedValue];
1114
- }
1115
- }
1116
- return [trimmedValue];
1117
- }
1118
- if (typeof value === 'object') {
1119
- const envelope = value;
1120
- // Backend attachment envelope:
1121
- // { value: <id | id[]>, attachments: [{ value: <id>, name, fileName }] }
1122
- // The stored items don't carry the storage key (their `fileName` is the
1123
- // display name), only the upload id, so resolve every attachment by its
1124
- // id through the metadata endpoint — the same contract
1125
- // `mt-upload-field` uses.
1126
- if (Array.isArray(envelope.attachments)) {
1127
- return envelope.attachments.flatMap((item) => this.normalizeAttachmentValue(item));
1128
- }
1129
- // A single backend attachment item carries its upload id under `value`.
1130
- if (typeof envelope.value === 'string' &&
1131
- envelope.id === undefined &&
1132
- (envelope.fileName !== undefined || envelope.name !== undefined)) {
1133
- return this.normalizeAttachmentValue(envelope.value);
1134
- }
1135
- // Envelope with no resolved attachments yet — unwrap the inner id(s).
1136
- if ('value' in envelope &&
1137
- envelope.id === undefined &&
1138
- envelope.fileName === undefined &&
1139
- envelope.name === undefined) {
1140
- return this.normalizeAttachmentValue(envelope.value);
1141
- }
1142
- return [value];
1143
- }
1144
- return [];
1145
- }
1146
- normalizeAttachmentItem(value) {
1147
- if (!value) {
1148
- return null;
1149
- }
1150
- if (typeof value === 'string') {
1151
- const trimmedValue = value.trim();
1152
- return trimmedValue
1153
- ? {
1154
- id: trimmedValue,
1155
- name: trimmedValue,
1156
- }
1157
- : null;
1158
- }
1159
- const normalizedAttachment = {
1160
- ...value,
1161
- name: value.name ?? value.fileName ?? value.id ?? '',
1162
- extension: this.resolveExtension(value),
1163
- };
1164
- return normalizedAttachment.name ||
1165
- normalizedAttachment.fileName ||
1166
- normalizedAttachment.id
1167
- ? normalizedAttachment
1168
- : null;
1169
- }
1170
- requiresMetadataRequest(reference) {
1171
- if (typeof reference === 'string') {
1172
- return reference.trim().length > 0;
1173
- }
1174
- return !!reference.id?.trim() && !reference.fileName;
1175
- }
1176
- isAttachmentItemValue(reference) {
1177
- return typeof reference === 'object' && reference != null;
1178
- }
1179
- resolveExtension(value) {
1180
- const explicitExtension = value.extension?.trim();
1181
- if (explicitExtension) {
1182
- return explicitExtension.startsWith('.')
1183
- ? explicitExtension.toLowerCase()
1184
- : `.${explicitExtension.toLowerCase()}`;
1185
- }
1186
- const fileName = value.fileName ?? value.name;
1187
- if (!fileName || !fileName.includes('.')) {
1188
- return undefined;
1189
- }
1190
- return `.${fileName.split('.').pop().toLowerCase()}`;
1191
- }
1192
- normalizeAcceptTypes(value) {
1193
- if (Array.isArray(value)) {
1194
- const acceptTypes = value
1195
- .map((item) => (typeof item === 'string' ? item.trim() : ''))
1196
- .filter(Boolean);
1197
- return acceptTypes.length ? acceptTypes.join(',') : undefined;
1198
- }
1199
- if (typeof value === 'string') {
1200
- const acceptTypes = value.trim();
1201
- return acceptTypes || undefined;
1202
- }
1203
- return undefined;
1204
- }
1205
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityAttachment, deps: [], target: i0.ɵɵFactoryTarget.Component });
1206
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityAttachment, isStandalone: true, selector: "mt-entity-attachment", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, endPoint: { classPropertyName: "endPoint", publicName: "endPoint", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"relaxed\"\r\n>\r\n @if (hasAttachments()) {\r\n @if (shape() === \"compact\") {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (\r\n attachment of attachments();\r\n track attachmentTrackBy($index, attachment)\r\n ) {\r\n <mt-button\r\n iconPos=\"top\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [icon]=\"attachmentActionIcon($index, attachment)\"\r\n [tooltip]=\"attachmentTooltip(attachment)\"\r\n styleClass=\"h-9! w-9! rounded-lg! transition-all duration-200 hover:scale-105 hover:border-primary-500! hover:text-primary-600! hover:bg-primary-50!\"\r\n (onClick)=\"onCompactAttachmentClick($event, attachment)\"\r\n (mouseenter)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (mouseleave)=\"hoveredAttachmentKey.set(null)\"\r\n (onFocus)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (onBlur)=\"hoveredAttachmentKey.set(null)\"\r\n />\r\n }\r\n </div>\r\n } @else {\r\n <mt-upload-field\r\n class=\"w-full\"\r\n [ngModel]=\"uploadValue()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [shape]=\"'card'\"\r\n [multiple]=\"isMultiple()\"\r\n [readonly]=\"true\"\r\n [endPoint]=\"endPoint()\"\r\n [accept]=\"acceptTypes()\"\r\n [context]=\"context()\"\r\n />\r\n }\r\n } @else {\r\n <span class=\"text-sm font-semibold\">{{ empty }}</span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: UploadField, selector: "mt-upload-field", inputs: ["label", "title", "description", "endPoint", "size", "userImgClass", "shape", "multiple", "accept", "isDragging", "fileSizeLimit", "readonly", "context"], outputs: ["isDraggingChange", "onChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1207
- }
1208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityAttachment, decorators: [{
1209
- type: Component,
1210
- args: [{ selector: 'mt-entity-attachment', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [FormsModule, UploadField, Button, EntityField], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"relaxed\"\r\n>\r\n @if (hasAttachments()) {\r\n @if (shape() === \"compact\") {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (\r\n attachment of attachments();\r\n track attachmentTrackBy($index, attachment)\r\n ) {\r\n <mt-button\r\n iconPos=\"top\"\r\n size=\"small\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n [icon]=\"attachmentActionIcon($index, attachment)\"\r\n [tooltip]=\"attachmentTooltip(attachment)\"\r\n styleClass=\"h-9! w-9! rounded-lg! transition-all duration-200 hover:scale-105 hover:border-primary-500! hover:text-primary-600! hover:bg-primary-50!\"\r\n (onClick)=\"onCompactAttachmentClick($event, attachment)\"\r\n (mouseenter)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (mouseleave)=\"hoveredAttachmentKey.set(null)\"\r\n (onFocus)=\"\r\n hoveredAttachmentKey.set(attachmentTrackBy($index, attachment))\r\n \"\r\n (onBlur)=\"hoveredAttachmentKey.set(null)\"\r\n />\r\n }\r\n </div>\r\n } @else {\r\n <mt-upload-field\r\n class=\"w-full\"\r\n [ngModel]=\"uploadValue()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [shape]=\"'card'\"\r\n [multiple]=\"isMultiple()\"\r\n [readonly]=\"true\"\r\n [endPoint]=\"endPoint()\"\r\n [accept]=\"acceptTypes()\"\r\n [context]=\"context()\"\r\n />\r\n }\r\n } @else {\r\n <span class=\"text-sm font-semibold\">{{ empty }}</span>\r\n }\r\n</mt-entity-field>\r\n" }]
1211
- }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], endPoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "endPoint", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
1212
-
1213
- class EntityLocation {
1214
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
1215
- displayName = computed(() => this.data()?.name ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
1216
- location = computed(() => normalizeEntityLocation(this.data()?.value), ...(ngDevMode ? [{ debugName: "location" }] : /* istanbul ignore next */ []));
1217
- displayValue = computed(() => displayOrPlaceholder(this.location()?.display_name ?? this.location()?.address ?? null), ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
1218
- coordinates = computed(() => {
1219
- const location = this.location();
1220
- const lat = location?.lat;
1221
- const lon = location?.lon ?? location?.lng;
1222
- if (lat === undefined || lon === undefined || lat === '' || lon === '') {
1223
- return '';
1224
- }
1225
- return `${lat}, ${lon}`;
1226
- }, ...(ngDevMode ? [{ debugName: "coordinates" }] : /* istanbul ignore next */ []));
1227
- mapsUrl = computed(() => {
1228
- const location = this.location();
1229
- const lat = location?.lat;
1230
- const lon = location?.lon ?? location?.lng;
1231
- if (lat === undefined || lon === undefined || lat === '' || lon === '') {
1232
- return '';
1233
- }
1234
- return `https://www.google.com/maps/?q=${encodeURIComponent(`${lat},${lon}`)}`;
1235
- }, ...(ngDevMode ? [{ debugName: "mapsUrl" }] : /* istanbul ignore next */ []));
1236
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLocation, deps: [], target: i0.ɵɵFactoryTarget.Component });
1237
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLocation, isStandalone: true, selector: "mt-entity-location", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [labelIconName]=\"'map.marker-pin-01'\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (mapsUrl()) {\r\n <a\r\n [href]=\"mapsUrl()\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n class=\"flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold text-primary-600 hover:text-primary-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"map.marker-pin-01\" size=\"sm\" class=\"shrink-0\" />\r\n <span class=\"min-w-0 truncate\">{{ displayValue() }}</span>\r\n </a>\r\n } @else {\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </div>\r\n }\r\n\r\n @if (coordinates()) {\r\n <div class=\"min-w-0 truncate text-xs text-gray-500\">\r\n {{ coordinates() }}\r\n </div>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1238
- }
1239
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLocation, decorators: [{
1240
- type: Component,
1241
- args: [{ selector: 'mt-entity-location', changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, Icon, TruncateTooltip], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [labelIconName]=\"'map.marker-pin-01'\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (mapsUrl()) {\r\n <a\r\n [href]=\"mapsUrl()\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n class=\"flex min-w-0 max-w-full items-center gap-1.5 text-sm font-semibold text-primary-600 hover:text-primary-700\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"map.marker-pin-01\" size=\"sm\" class=\"shrink-0\" />\r\n <span class=\"min-w-0 truncate\">{{ displayValue() }}</span>\r\n </a>\r\n } @else {\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </div>\r\n }\r\n\r\n @if (coordinates()) {\r\n <div class=\"min-w-0 truncate text-xs text-gray-500\">\r\n {{ coordinates() }}\r\n </div>\r\n }\r\n</mt-entity-field>\r\n" }]
1242
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
1243
- function normalizeEntityLocation(value) {
1244
- if (value === null || value === undefined || value === '') {
1245
- return null;
1246
- }
1247
- if (typeof value === 'string') {
1248
- const trimmed = value.trim();
1249
- if (!trimmed)
1250
- return null;
1251
- try {
1252
- return normalizeEntityLocation(JSON.parse(trimmed));
1253
- }
1254
- catch {
1255
- return {
1256
- display_name: trimmed,
1257
- address: trimmed,
1258
- };
1259
- }
1260
- }
1261
- if (typeof value !== 'object' || Array.isArray(value)) {
1262
- return {
1263
- display_name: String(value),
1264
- address: String(value),
1265
- };
1266
- }
1267
- const source = value;
1268
- const displayName = readString(source['display_name']) ??
1269
- readString(source['displayName']) ??
1270
- readString(source['address']) ??
1271
- readString(source['name']);
1272
- const lon = source['lon'] ?? source['lng'];
1273
- return {
1274
- ...source,
1275
- ...(displayName ? { display_name: displayName, address: displayName } : {}),
1276
- ...(lon !== undefined ? { lon: lon } : {}),
1277
- };
1278
- }
1279
- function readString(value) {
1280
- return typeof value === 'string' && value.trim() ? value.trim() : undefined;
1281
- }
1282
-
1283
- class EntityConnection {
1284
- /** Full entity data object */
1285
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
1286
- /** Individual inputs (used when data is not provided) */
1287
- name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
1288
- value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
1289
- displayName = computed(() => this.data()?.name ?? this.name() ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
1290
- /** The connection display lives on `rawValue.display`; fall back to `value`. */
1291
- connection = computed(() => {
1292
- const d = this.data();
1293
- return (normalizeEntityConnection(d?.value ?? d?.rawValue) ??
1294
- normalizeEntityConnection(this.value()));
1295
- }, ...(ngDevMode ? [{ debugName: "connection" }] : /* istanbul ignore next */ []));
1296
- displayValue = computed(() => displayOrPlaceholder(this.connection()?.display), ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
1297
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityConnection, deps: [], target: i0.ɵɵFactoryTarget.Component });
1298
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: EntityConnection, isStandalone: true, selector: "mt-entity-connection", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </div>\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1299
- }
1300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityConnection, decorators: [{
1301
- type: Component,
1302
- args: [{ selector: 'mt-entity-connection', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField, TruncateTooltip], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n>\r\n <div\r\n class=\"min-w-0 max-w-full truncate text-sm font-semibold\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >\r\n {{ displayValue() }}\r\n </div>\r\n</mt-entity-field>\r\n" }]
1303
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
1304
- function normalizeEntityConnection(value) {
1305
- if (value === null || value === undefined || value === '') {
1306
- return null;
1307
- }
1308
- if (typeof value === 'string') {
1309
- const trimmed = value.trim();
1310
- if (!trimmed)
1311
- return null;
1312
- try {
1313
- return normalizeEntityConnection(JSON.parse(trimmed));
1314
- }
1315
- catch {
1316
- return { display: trimmed };
1317
- }
1318
- }
1319
- if (typeof value !== 'object' || Array.isArray(value)) {
1320
- return { display: String(value) };
1321
- }
1322
- const source = value;
1323
- // Parsed payload uses `display`; the serialized JSON value uses `Display`.
1324
- const display = typeof source['display'] === 'string'
1325
- ? source['display']
1326
- : typeof source['Display'] === 'string'
1327
- ? source['Display']
1328
- : undefined;
1329
- return { ...source, ...(display !== undefined ? { display } : {}) };
1330
- }
1331
-
1332
- /**
1333
- * Preview renderer for `ScheduleItemSelector` properties.
1334
- *
1335
- * The value is the array of resolved schedule items returned by runtime
1336
- * rendering (`{ id, name, status, ... }`); each one is shown as a chip.
1337
- */
1338
- class EntityScheduleItem {
1339
- /** Full entity data object */
1340
- data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
1341
- displayName = computed(() => this.data()?.name ?? '', ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
1342
- items = computed(() => {
1343
- const value = this.data()?.value;
1344
- if (!Array.isArray(value))
1345
- return [];
1346
- return value.filter((item) => !!item && typeof item === 'object' && 'name' in item);
1347
- }, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
1348
- emptyLabel = ENTITY_EMPTY_VALUE_PLACEHOLDER;
1349
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityScheduleItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
1350
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityScheduleItem, isStandalone: true, selector: "mt-entity-schedule-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (items().length) {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (item of items(); track item.id) {\r\n <mt-chip [label]=\"item.name\" size=\"small\" />\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "component", type: Chip, selector: "mt-chip", inputs: ["label", "icon", "image", "removable", "removeIcon", "styleClass", "size"], outputs: ["onRemove", "onImageError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1351
- }
1352
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityScheduleItem, decorators: [{
1353
- type: Component,
1354
- args: [{ selector: 'mt-entity-schedule-item', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityField, Chip], template: "<mt-entity-field\r\n [label]=\"displayName()\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (items().length) {\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (item of items(); track item.id) {\r\n <mt-chip [label]=\"item.name\" size=\"small\" />\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex items-center px-3 py-2 rounded-md text-xs font-semibold w-fit text-gray-500 bg-gray-100\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
1355
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
1356
-
1357
- /** Neutral grey for a status the catalog left without a colour. */
1358
- const DEFAULT_STATUS_COLOR = '#9CA3AF';
1359
- class EntityLeafDetails {
1360
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1361
- leafValue = computed(() => {
1362
- const v = this.data().value;
1363
- if (v && typeof v === 'object' && !Array.isArray(v) && 'levelId' in v) {
1364
- return v;
1365
- }
1366
- return null;
1367
- }, ...(ngDevMode ? [{ debugName: "leafValue" }] : /* istanbul ignore next */ []));
1368
- /** Label shown below the badges: "Level Name (total)" */
1369
- labelWithTotal = computed(() => {
1370
- const leaf = this.leafValue();
1371
- const name = this.data().name ?? leaf?.levelName ?? '';
1372
- if (!leaf)
1373
- return name;
1374
- const total = leaf.statuses.reduce((sum, s) => sum + s.count, 0);
1375
- return `${name} (${total})`;
1376
- }, ...(ngDevMode ? [{ debugName: "labelWithTotal" }] : /* istanbul ignore next */ []));
1377
- labelIcon = computed(() => this.leafValue()?.levelIcon ?? null, ...(ngDevMode ? [{ debugName: "labelIcon" }] : /* istanbul ignore next */ []));
1378
- statusColor(color) {
1379
- return color ?? DEFAULT_STATUS_COLOR;
1380
- }
1381
- /**
1382
- * Foreground for the count, chosen against the badge colour instead of always
1383
- * white — a light catalog colour measured 2.59:1 with white on it, the lowest
1384
- * contrast in the product (findings M-04, H-03).
1385
- */
1386
- statusTextColor(color) {
1387
- return readableTextOn(this.statusColor(color));
1388
- }
1389
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, deps: [], target: i0.ɵɵFactoryTarget.Component });
1390
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLeafDetails, isStandalone: true, selector: "mt-entity-leaf-details", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"labelWithTotal()\"\r\n [labelIconName]=\"labelIcon()\"\r\n [configuration]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue(); as leaf) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (status of leaf.statuses; track status.key) {\r\n <!--\r\n The badge is a count, and the colour is the only thing saying WHICH\r\n count \u2014 so the status name has to be reachable without hovering, and\r\n the number has to be legible on whatever hex the tenant's catalog\r\n carries. The tooltip names it for a pointer, the aria-label names it\r\n for a screen reader, and the foreground is chosen against the badge\r\n colour rather than hardcoded white (findings M-04, H-03).\r\n -->\r\n <div\r\n class=\"flex h-7 min-w-7 items-center justify-center rounded-lg px-1.5 text-xs font-bold tabular-nums\"\r\n role=\"img\"\r\n [style.background-color]=\"statusColor(status.color)\"\r\n [style.color]=\"statusTextColor(status.color)\"\r\n [attr.aria-label]=\"status.display + ': ' + status.count\"\r\n [pTooltip]=\"status.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ status.count }}\r\n </div>\r\n }\r\n @if (leaf.statuses.length === 0) {\r\n <span class=\"text-sm text-muted-color\">\u2014</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1391
- }
1392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLeafDetails, decorators: [{
1393
- type: Component,
1394
- args: [{ selector: 'mt-entity-leaf-details', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, TooltipModule], template: "<mt-entity-field\r\n [label]=\"labelWithTotal()\"\r\n [labelIconName]=\"labelIcon()\"\r\n [configuration]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (leafValue(); as leaf) {\r\n <div class=\"flex flex-wrap gap-1.5\">\r\n @for (status of leaf.statuses; track status.key) {\r\n <!--\r\n The badge is a count, and the colour is the only thing saying WHICH\r\n count \u2014 so the status name has to be reachable without hovering, and\r\n the number has to be legible on whatever hex the tenant's catalog\r\n carries. The tooltip names it for a pointer, the aria-label names it\r\n for a screen reader, and the foreground is chosen against the badge\r\n colour rather than hardcoded white (findings M-04, H-03).\r\n -->\r\n <div\r\n class=\"flex h-7 min-w-7 items-center justify-center rounded-lg px-1.5 text-xs font-bold tabular-nums\"\r\n role=\"img\"\r\n [style.background-color]=\"statusColor(status.color)\"\r\n [style.color]=\"statusTextColor(status.color)\"\r\n [attr.aria-label]=\"status.display + ': ' + status.count\"\r\n [pTooltip]=\"status.display\"\r\n tooltipPosition=\"top\"\r\n >\r\n {{ status.count }}\r\n </div>\r\n }\r\n @if (leaf.statuses.length === 0) {\r\n <span class=\"text-sm text-muted-color\">\u2014</span>\r\n }\r\n </div>\r\n }\r\n</mt-entity-field>\r\n" }]
1395
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
1396
-
1397
- /**
1398
- * Renders an entity value by view type.
1399
- *
1400
- * `LookupModuleCheckList` is deliberately not handled here: that component
1401
- * renders each of its nested properties *through* this one, so routing it back
1402
- * through here would make the two files import each other. `EntityPreviewBody`
1403
- * owns that case and delegates every other view type to this component.
1404
- */
1405
- class EntityValuePreview {
1406
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1407
- attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
1408
- /** Lookup variants share the same colored-badge renderer. */
1409
- previewType = computed(() => {
1410
- const viewType = this.data().viewType;
1411
- return viewType === 'LookupMatrix' || viewType === 'LookupMultiSelect'
1412
- ? 'Lookup'
1413
- : viewType;
1414
- }, ...(ngDevMode ? [{ debugName: "previewType" }] : /* istanbul ignore next */ []));
1415
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
1416
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityValuePreview, isStandalone: true, selector: "mt-entity-value-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"Time\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'Time'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"MultiUser\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n", dependencies: [{ kind: "component", type: EntityText, selector: "mt-entity-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLongText, selector: "mt-entity-long-text", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityDate, selector: "mt-entity-date", inputs: ["data", "name", "value", "viewType"] }, { kind: "component", type: EntityUser, selector: "mt-entity-user", inputs: ["data"] }, { kind: "component", type: EntityPercentage, selector: "mt-entity-percentage", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityCurrency, selector: "mt-entity-currency", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityCheckbox, selector: "mt-entity-checkbox", inputs: ["data", "name", "value", "rawValue"] }, { kind: "component", type: EntityLookup, selector: "mt-entity-lookup", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityPhaseGate, selector: "mt-entity-phase-gate", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityAttachment, selector: "mt-entity-attachment", inputs: ["data", "name", "shape", "value", "endPoint", "context"] }, { kind: "component", type: EntityStatus, selector: "mt-entity-status", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityLeafDetails, selector: "mt-entity-leaf-details", inputs: ["data"] }, { kind: "component", type: EntityLocation, selector: "mt-entity-location", inputs: ["data"] }, { kind: "component", type: EntityConnection, selector: "mt-entity-connection", inputs: ["data", "name", "value"] }, { kind: "component", type: EntityScheduleItem, selector: "mt-entity-schedule-item", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1417
- }
1418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityValuePreview, decorators: [{
1419
- type: Component,
1420
- args: [{ selector: 'mt-entity-value-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1421
- EntityText,
1422
- EntityLongText,
1423
- EntityDate,
1424
- EntityUser,
1425
- EntityPercentage,
1426
- EntityCurrency,
1427
- EntityCheckbox,
1428
- EntityLookup,
1429
- EntityPhaseGate,
1430
- EntityAttachment,
1431
- EntityStatus,
1432
- EntityLeafDetails,
1433
- EntityLocation,
1434
- EntityConnection,
1435
- EntityScheduleItem,
1436
- ], host: {
1437
- class: 'block min-w-0 w-full',
1438
- }, template: "@switch (previewType()) {\r\n @case (\"Text\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"LongText\") {\r\n <mt-entity-long-text [data]=\"data()\" />\r\n }\r\n @case (\"Date\") {\r\n <mt-entity-date [data]=\"data()\" />\r\n }\r\n @case (\"DateTime\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'DateTime'\" />\r\n }\r\n @case (\"Time\") {\r\n <mt-entity-date [data]=\"data()\" [viewType]=\"'Time'\" />\r\n }\r\n @case (\"User\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"MultiUser\") {\r\n <mt-entity-user [data]=\"data()\" />\r\n }\r\n @case (\"Percentage\") {\r\n <mt-entity-percentage [data]=\"data()\" />\r\n }\r\n @case (\"Currency\") {\r\n <mt-entity-currency [data]=\"data()\" />\r\n }\r\n @case (\"Number\") {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n @case (\"Checkbox\") {\r\n <mt-entity-checkbox [data]=\"data()\" />\r\n }\r\n @case (\"Lookup\") {\r\n <mt-entity-lookup [data]=\"data()\" />\r\n }\r\n @case (\"Status\") {\r\n <mt-entity-status [data]=\"data()\" />\r\n }\r\n @case (\"PhaseGate\") {\r\n <mt-entity-phase-gate [data]=\"data()\" />\r\n }\r\n @case (\"Attachment\") {\r\n <mt-entity-attachment [data]=\"data()\" [shape]=\"attachmentShape()\" />\r\n }\r\n @case (\"Location\") {\r\n <mt-entity-location [data]=\"data()\" />\r\n }\r\n @case (\"Connection\") {\r\n <mt-entity-connection [data]=\"data()\" />\r\n }\r\n @case (\"ScheduleItemSelector\") {\r\n <mt-entity-schedule-item [data]=\"data()\" />\r\n }\r\n @case (\"LeafDetails\") {\r\n <mt-entity-leaf-details [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-text [data]=\"data()\" />\r\n }\r\n}\r\n" }]
1439
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
1440
-
1441
- /**
1442
- * Nested props render inside the entry card's own grid, so they take the label
1443
- * treatment and leave sizing to the grid.
1444
- */
1445
- const NESTED_PROP_CONFIG = {
1446
- labelPosition: 'top',
1447
- hideLabel: false,
1448
- };
1449
- /**
1450
- * Derive a readable label from a raw lookup key. The stored checklist value
1451
- * only carries the key of the selected lookup item (e.g. `Open_test`) and the
1452
- * response resolves no display for it, so this strips separators and
1453
- * title-cases the key.
1454
- */
1455
- function humanizeKey(key) {
1456
- const words = key
1457
- .replace(/[_-]+/g, ' ')
1458
- .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
1459
- .trim();
1460
- if (!words)
1461
- return key;
1462
- return words.charAt(0).toUpperCase() + words.slice(1);
1463
- }
1464
- class EntityLookupModuleCheckList {
1465
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1466
- /**
1467
- * Catalog metadata for the captured properties, keyed by property key. The
1468
- * stored value carries keys only — this is what gives each nested prop its
1469
- * label and view type.
1470
- */
1471
- metaByKey = computed(() => {
1472
- const map = new Map();
1473
- for (const meta of this.data().nestedProperties ?? []) {
1474
- map.set(meta.key, meta);
1475
- }
1476
- return map;
1477
- }, ...(ngDevMode ? [{ debugName: "metaByKey" }] : /* istanbul ignore next */ []));
1478
- /**
1479
- * Normalizes the stored value into a flat list of checklist entries.
1480
- * Accepts both the rendered view model (`{ items: [...] }`) and the raw
1481
- * stored array (`[{ lookupKey, props }]`); returns `[]` for anything else.
1482
- */
1483
- items = computed(() => {
1484
- const raw = this.data().value;
1485
- const entries = this.extractEntries(raw);
1486
- return entries
1487
- .filter((entry) => entry && typeof entry === 'object')
1488
- .map((entry) => {
1489
- const record = entry;
1490
- const props = record['props'] ?? record['Props'];
1491
- const lookupKey = this.resolveLookupKey(entry);
1492
- return {
1493
- lookupKey,
1494
- lookupLabel: humanizeKey(lookupKey),
1495
- props: (Array.isArray(props) ? props : []).map((prop) => this.toNestedEntity(prop)),
1496
- };
1497
- });
1498
- }, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
1499
- hasItems = computed(() => this.items().length > 0, ...(ngDevMode ? [{ debugName: "hasItems" }] : /* istanbul ignore next */ []));
1500
- emptyLabel = displayOrPlaceholder(null);
1501
- /**
1502
- * Builds the entity for one captured property. Without catalog metadata the
1503
- * key is all there is to show it with, so it degrades to a humanized label
1504
- * and plain text.
1505
- */
1506
- toNestedEntity(prop) {
1507
- const propRecord = (prop ?? {});
1508
- const key = String(propRecord['key'] ?? propRecord['Key'] ?? '');
1509
- const meta = this.metaByKey().get(key);
1510
- const value = propRecord['value'] ?? propRecord['Value'] ?? null;
1511
- return {
1512
- propertyId: meta?.id,
1513
- key,
1514
- normalizedKey: meta?.normalizedKey,
1515
- name: meta?.label ?? humanizeKey(key),
1516
- value: (value ?? ''),
1517
- viewType: meta?.viewType ?? 'Text',
1518
- propertyConfiguration: meta?.configuration,
1519
- configuration: NESTED_PROP_CONFIG,
1520
- order: meta?.order,
1521
- };
1522
- }
1523
- extractEntries(raw) {
1524
- if (Array.isArray(raw)) {
1525
- return raw;
1526
- }
1527
- const wrapped = raw?.items;
1528
- if (Array.isArray(wrapped)) {
1529
- return wrapped;
1530
- }
1531
- if (typeof raw === 'string' && raw.trim()) {
1532
- try {
1533
- return this.extractEntries(JSON.parse(raw));
1534
- }
1535
- catch {
1536
- return [];
1537
- }
1538
- }
1539
- return [];
1540
- }
1541
- resolveLookupKey(entry) {
1542
- const record = entry;
1543
- const key = entry.lookupKey ?? record['Lookupkey'] ?? record['lookupkey'];
1544
- return typeof key === 'string' ? key : '';
1545
- }
1546
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, deps: [], target: i0.ɵɵFactoryTarget.Component });
1547
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityLookupModuleCheckList, isStandalone: true, selector: "mt-entity-lookup-module-check-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupLabel || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"prop\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1548
- }
1549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityLookupModuleCheckList, decorators: [{
1550
- type: Component,
1551
- args: [{ selector: 'mt-entity-lookup-module-check-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, EntityValuePreview], template: "<mt-entity-field\r\n [label]=\"data().name ?? ''\"\r\n [configuration]=\"data()?.configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (hasItems()) {\r\n <div class=\"flex flex-col gap-2\">\r\n @for (item of items(); track $index) {\r\n <div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-primary-50 px-2 py-1 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ item.lookupLabel || emptyLabel }}\r\n </span>\r\n @if (item.props.length) {\r\n <div class=\"mt-2 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2\">\r\n @for (prop of item.props; track prop.key) {\r\n <div class=\"min-w-0 overflow-hidden\">\r\n <mt-entity-value-preview\r\n [data]=\"prop\"\r\n attachmentShape=\"compact\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-gray-100 px-3 py-2 text-xs font-semibold text-gray-500\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
1552
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
1553
-
1554
- const LEAF_DETAILS_KEY_SEPARATOR = '::leaflevel::';
1555
- function isLeafDetailsStatusSummary(value) {
1556
- return (!!value &&
1557
- typeof value === 'object' &&
1558
- 'key' in value &&
1559
- 'display' in value &&
1560
- 'count' in value);
1561
- }
1562
- function isLeafDetailsCatalogStatusValue(value) {
1563
- return (!!value && typeof value === 'object' && 'key' in value && 'display' in value);
1564
- }
1565
- function isLeafDetailsCatalogLevelValue(value) {
1566
- return (!!value &&
1567
- typeof value === 'object' &&
1568
- 'levelId' in value &&
1569
- 'levelName' in value &&
1570
- 'levelIcon' in value &&
1571
- 'statuses' in value &&
1572
- Array.isArray(value.statuses) &&
1573
- value.statuses.every(isLeafDetailsCatalogStatusValue));
1574
- }
1575
- function isLeafDetailsRuntimeStatusDetails(value) {
1576
- return (!!value && typeof value === 'object' && 'key' in value && 'display' in value);
1577
- }
1578
- function isLeafDetailsRuntimeStatusCount(value) {
1579
- return (!!value &&
1580
- typeof value === 'object' &&
1581
- 'details' in value &&
1582
- isLeafDetailsRuntimeStatusDetails(value.details) &&
1583
- 'count' in value);
1584
- }
1585
- function isLeafDetailsRuntimeChildSchema(value) {
1586
- return (!!value &&
1587
- typeof value === 'object' &&
1588
- 'levelId' in value &&
1589
- 'levelName' in value &&
1590
- 'levelIcon' in value &&
1591
- 'statuses' in value &&
1592
- Array.isArray(value.statuses) &&
1593
- value.statuses.every(isLeafDetailsRuntimeStatusCount));
1594
- }
1595
- function isLeafDetailsValue(value) {
1596
- return (!!value &&
1597
- typeof value === 'object' &&
1598
- !Array.isArray(value) &&
1599
- 'levelId' in value &&
1600
- 'statuses' in value &&
1601
- Array.isArray(value.statuses) &&
1602
- value.statuses.every(isLeafDetailsStatusSummary));
1603
- }
1604
- function isLeafDetailsCollectionValue(value) {
1605
- return Array.isArray(value) && value.every(isLeafDetailsValue);
1606
- }
1607
- function isLeafDetailsCatalogConfiguration(value) {
1608
- return Array.isArray(value) && value.every(isLeafDetailsCatalogLevelValue);
1609
- }
1610
- function isLeafDetailsRuntimeValue(value) {
1611
- return (!!value &&
1612
- typeof value === 'object' &&
1613
- !Array.isArray(value) &&
1614
- 'childSchemas' in value &&
1615
- Array.isArray(value.childSchemas) &&
1616
- value.childSchemas.every(isLeafDetailsRuntimeChildSchema));
1617
- }
1618
- function isLeafDetailsSyntheticKey(key) {
1619
- return key?.includes(LEAF_DETAILS_KEY_SEPARATOR) ?? false;
1620
- }
1621
- function toLeafDetailsStatusSummary(status) {
1622
- return {
1623
- key: status.details.key,
1624
- display: status.details.display,
1625
- color: status.details.color ?? null,
1626
- count: status.count,
1627
- };
1628
- }
1629
- function normalizeLeafDetailsCollection(value) {
1630
- if (isLeafDetailsCollectionValue(value)) {
1631
- return value;
1632
- }
1633
- if (isLeafDetailsValue(value)) {
1634
- return [value];
1635
- }
1636
- if (isLeafDetailsRuntimeValue(value)) {
1637
- return value.childSchemas.map((schema) => ({
1638
- levelId: schema.levelId,
1639
- levelName: schema.levelName,
1640
- levelIcon: schema.levelIcon,
1641
- statuses: schema.statuses.map(toLeafDetailsStatusSummary),
1642
- }));
1643
- }
1644
- if (typeof value === 'string' && value.trim().length > 0) {
1645
- try {
1646
- return normalizeLeafDetailsCollection(JSON.parse(value));
1647
- }
1648
- catch {
1649
- return [];
1650
- }
1651
- }
1652
- return [];
1653
- }
1654
- function normalizeLeafDetailsCatalogConfiguration(value) {
1655
- if (isLeafDetailsCatalogConfiguration(value)) {
1656
- return value.map((level) => ({
1657
- levelId: level.levelId,
1658
- levelName: level.levelName,
1659
- levelIcon: level.levelIcon,
1660
- statuses: level.statuses.map((status) => ({
1661
- key: status.key,
1662
- display: status.display,
1663
- color: status.color ?? null,
1664
- count: 0,
1665
- })),
1666
- }));
1667
- }
1668
- if (typeof value === 'string' && value.trim().length > 0) {
1669
- try {
1670
- return normalizeLeafDetailsCatalogConfiguration(JSON.parse(value));
1671
- }
1672
- catch {
1673
- return [];
1674
- }
1675
- }
1676
- return [];
1677
- }
1678
- function expandLeafDetailsEntity(entity) {
1679
- if (entity.viewType !== 'LeafDetails') {
1680
- return [entity];
1681
- }
1682
- if (isLeafDetailsSyntheticKey(entity.key) &&
1683
- isLeafDetailsValue(entity.value)) {
1684
- return [entity];
1685
- }
1686
- const configuration = entity.configuration;
1687
- const levels = normalizeLeafDetailsCollection(entity.value);
1688
- const fallbackLevels = levels.length
1689
- ? levels
1690
- : normalizeLeafDetailsCollection(entity.rawValue);
1691
- const resolvedLevels = fallbackLevels.length
1692
- ? fallbackLevels
1693
- : normalizeLeafDetailsCatalogConfiguration(entity.propertyConfiguration);
1694
- if (resolvedLevels.length === 0) {
1695
- return [entity];
1696
- }
1697
- const expanded = resolvedLevels.flatMap((level) => {
1698
- const levelConfig = configuration?.leafLevels?.[String(level.levelId)];
1699
- if (configuration?.leafLevels && !levelConfig) {
1700
- return [];
1701
- }
1702
- const selectedStatuses = levelConfig?.selectedStatuses?.length
1703
- ? new Set(levelConfig.selectedStatuses)
1704
- : null;
1705
- return [
1706
- {
1707
- ...entity,
1708
- key: entity.key
1709
- ? `${entity.key}${LEAF_DETAILS_KEY_SEPARATOR}${level.levelId}`
1710
- : entity.key,
1711
- name: level.levelName,
1712
- value: {
1713
- ...level,
1714
- statuses: selectedStatuses
1715
- ? level.statuses.filter((status) => selectedStatuses.has(status.key))
1716
- : level.statuses,
1717
- },
1718
- order: levelConfig?.order ?? entity.order,
1719
- configuration: {
1720
- ...configuration,
1721
- size: levelConfig?.size ?? configuration?.size,
1722
- },
1723
- },
1724
- ];
1725
- });
1726
- return expanded.length > 0 ? expanded : [entity];
1727
- }
1728
- function buildDisplayEntities(entities) {
1729
- return entities
1730
- .flatMap((entity) => expandLeafDetailsEntity(entity))
1731
- .sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
1732
- }
1733
-
1734
- class EntityPreviewBody {
1735
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1736
- attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
1737
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
1738
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreviewBody, isStandalone: true, selector: "mt-entity-preview-body", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@if (data().viewType === \"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\r\n} @else {\r\n <mt-entity-value-preview\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n}\r\n", dependencies: [{ kind: "component", type: EntityLookupModuleCheckList, selector: "mt-entity-lookup-module-check-list", inputs: ["data"] }, { kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1739
- }
1740
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreviewBody, decorators: [{
1741
- type: Component,
1742
- args: [{ selector: 'mt-entity-preview-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityLookupModuleCheckList, EntityValuePreview], host: {
1743
- class: 'w-full',
1744
- }, template: "@if (data().viewType === \"LookupModuleCheckList\") {\r\n <mt-entity-lookup-module-check-list [data]=\"data()\" />\r\n} @else {\r\n <mt-entity-value-preview\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n}\r\n" }]
1745
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
1746
-
1747
- class ComparisonValue {
1748
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1749
- comparison = computed(() => {
1750
- const c = this.data().comparison;
1751
- return c?.kind === 'Value' ? c : null;
1752
- }, ...(ngDevMode ? [{ debugName: "comparison" }] : /* istanbul ignore next */ []));
1753
- oldEntity = computed(() => this.buildSide(this.comparison()?.oldValue), ...(ngDevMode ? [{ debugName: "oldEntity" }] : /* istanbul ignore next */ []));
1754
- newEntity = computed(() => this.buildSide(this.comparison()?.newValue), ...(ngDevMode ? [{ debugName: "newEntity" }] : /* istanbul ignore next */ []));
1755
- buildSide(side) {
1756
- if (!side)
1757
- return null;
1758
- const base = this.data();
1759
- return {
1760
- ...base,
1761
- rawValue: side.raw === null || side.raw === undefined
1762
- ? undefined
1763
- : String(side.raw),
1764
- value: (side.display ?? side.value ?? ''),
1765
- comparison: undefined,
1766
- };
1767
- }
1768
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonValue, deps: [], target: i0.ɵɵFactoryTarget.Component });
1769
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ComparisonValue, isStandalone: true, selector: "mt-comparison-value", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "block w-full" }, ngImport: i0, template: "@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 items-stretch gap-3\">\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >Before</span\r\n >\r\n @if (oldEntity(); as old) {\r\n <mt-entity-preview-body [data]=\"old\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n <div class=\"flex shrink-0 items-center text-muted-color\" aria-hidden=\"true\">\r\n &rarr;\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >After</span\r\n >\r\n @if (newEntity(); as next) {\r\n <mt-entity-preview-body [data]=\"next\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n </div>\r\n}\r\n", dependencies: [{ kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1770
- }
1771
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonValue, decorators: [{
1772
- type: Component,
1773
- args: [{ selector: 'mt-comparison-value', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityPreviewBody], host: {
1774
- class: 'block w-full',
1775
- }, template: "@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 items-stretch gap-3\">\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-muted-color\"\r\n >Before</span\r\n >\r\n @if (oldEntity(); as old) {\r\n <mt-entity-preview-body [data]=\"old\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n <div class=\"flex shrink-0 items-center text-muted-color\" aria-hidden=\"true\">\r\n &rarr;\r\n </div>\r\n <div\r\n class=\"flex min-w-0 flex-1 flex-col gap-1 rounded-md border border-primary-200 bg-primary-50 px-3 py-2\"\r\n >\r\n <span class=\"text-xs font-medium uppercase tracking-wide text-primary-600\"\r\n >After</span\r\n >\r\n @if (newEntity(); as next) {\r\n <mt-entity-preview-body [data]=\"next\" />\r\n } @else {\r\n <span class=\"text-sm text-muted-color\">_</span>\r\n }\r\n </div>\r\n </div>\r\n}\r\n" }]
1776
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
1777
-
1778
- const OPERATION_BADGE_KEYS = {
1779
- CreateRecord: {
1780
- key: 'components.comparisonEntities.added',
1781
- classes: 'bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-200',
1782
- },
1783
- UpdateRecord: {
1784
- key: 'components.comparisonEntities.updated',
1785
- classes: 'bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-200',
1786
- },
1787
- DeleteRecord: {
1788
- key: 'components.comparisonEntities.removed',
1789
- classes: 'bg-rose-50 text-rose-700 ring-1 ring-inset ring-rose-200',
1790
- },
1791
- };
1792
- class ComparisonEntityList {
1793
- transloco = inject(TranslocoService);
1794
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1795
- comparison = computed(() => {
1796
- const c = this.data().comparison;
1797
- return c?.kind === 'EntityList' ? c : null;
1798
- }, ...(ngDevMode ? [{ debugName: "comparison" }] : /* istanbul ignore next */ []));
1799
- rows = computed(() => this.comparison()?.rows ?? [], ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
1800
- targetModuleKey = computed(() => this.comparison()?.targetModuleKey ?? '', ...(ngDevMode ? [{ debugName: "targetModuleKey" }] : /* istanbul ignore next */ []));
1801
- label = computed(() => this.data().name ?? '', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
1802
- badgeFor(op) {
1803
- const config = OPERATION_BADGE_KEYS[op];
1804
- return {
1805
- label: this.transloco.translate(config.key),
1806
- classes: config.classes,
1807
- };
1808
- }
1809
- displayField(value, display) {
1810
- if (display && display.trim().length > 0)
1811
- return display;
1812
- return displayOrPlaceholder(value);
1813
- }
1814
- rowId(_i, row) {
1815
- return row.entityId ?? _i;
1816
- }
1817
- oldField(row, propertyKey) {
1818
- return row.oldValues.find((v) => v.propertyKey === propertyKey);
1819
- }
1820
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonEntityList, deps: [], target: i0.ɵɵFactoryTarget.Component });
1821
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ComparisonEntityList, isStandalone: true, selector: "mt-comparison-entity-list", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "block w-full" }, ngImport: i0, template: "@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 flex-col gap-2\">\r\n @if (label()) {\r\n <div class=\"flex items-baseline justify-between\">\r\n <span class=\"text-sm font-medium text-color\">{{ label() }}</span>\r\n @if (targetModuleKey()) {\r\n <span class=\"text-xs text-muted-color\">{{ targetModuleKey() }}</span>\r\n }\r\n </div>\r\n }\r\n @if (rows().length === 0) {\r\n <div class=\"text-sm text-muted-color\">_</div>\r\n } @else {\r\n <ul class=\"flex flex-col gap-2\">\r\n @for (row of rows(); track rowId($index, row)) {\r\n <li\r\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <span\r\n class=\"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"badgeFor(row.operation).classes\"\r\n >\r\n {{ badgeFor(row.operation).label }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">#{{ row.entityId }}</span>\r\n </div>\r\n\r\n @switch (row.operation) {\r\n @case (\"CreateRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @case (\"DeleteRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.oldValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color line-through\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @default {\r\n <dl class=\"flex flex-col gap-1\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"flex min-w-0 flex-wrap items-center gap-2\">\r\n <span\r\n class=\"max-w-[40%] truncate text-sm text-muted-color line-through\"\r\n >\r\n {{\r\n displayField(\r\n $any(oldField(row, f.propertyKey))?.value,\r\n $any(oldField(row, f.propertyKey))?.display\r\n )\r\n }}\r\n </span>\r\n <span class=\"text-muted-color\" aria-hidden=\"true\"\r\n >&rarr;</span\r\n >\r\n <span class=\"max-w-[40%] truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </span>\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n }\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n}\r\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
1822
- }
1823
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ComparisonEntityList, decorators: [{
1824
- type: Component,
1825
- args: [{ selector: 'mt-comparison-entity-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [], host: {
1826
- class: 'block w-full',
1827
- }, template: "@if (comparison(); as cmp) {\r\n <div class=\"flex w-full min-w-0 flex-col gap-2\">\r\n @if (label()) {\r\n <div class=\"flex items-baseline justify-between\">\r\n <span class=\"text-sm font-medium text-color\">{{ label() }}</span>\r\n @if (targetModuleKey()) {\r\n <span class=\"text-xs text-muted-color\">{{ targetModuleKey() }}</span>\r\n }\r\n </div>\r\n }\r\n @if (rows().length === 0) {\r\n <div class=\"text-sm text-muted-color\">_</div>\r\n } @else {\r\n <ul class=\"flex flex-col gap-2\">\r\n @for (row of rows(); track rowId($index, row)) {\r\n <li\r\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <span\r\n class=\"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium\"\r\n [class]=\"badgeFor(row.operation).classes\"\r\n >\r\n {{ badgeFor(row.operation).label }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">#{{ row.entityId }}</span>\r\n </div>\r\n\r\n @switch (row.operation) {\r\n @case (\"CreateRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @case (\"DeleteRecord\") {\r\n <dl class=\"grid grid-cols-1 gap-1 sm:grid-cols-2\">\r\n @for (f of row.oldValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"truncate text-sm text-color line-through\">\r\n {{ displayField(f.value, f.display) }}\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n @default {\r\n <dl class=\"flex flex-col gap-1\">\r\n @for (f of row.newValues; track f.propertyKey) {\r\n <div class=\"flex min-w-0 flex-col\">\r\n <dt class=\"text-xs text-muted-color\">{{ f.label }}</dt>\r\n <dd class=\"flex min-w-0 flex-wrap items-center gap-2\">\r\n <span\r\n class=\"max-w-[40%] truncate text-sm text-muted-color line-through\"\r\n >\r\n {{\r\n displayField(\r\n $any(oldField(row, f.propertyKey))?.value,\r\n $any(oldField(row, f.propertyKey))?.display\r\n )\r\n }}\r\n </span>\r\n <span class=\"text-muted-color\" aria-hidden=\"true\"\r\n >&rarr;</span\r\n >\r\n <span class=\"max-w-[40%] truncate text-sm text-color\">\r\n {{ displayField(f.value, f.display) }}\r\n </span>\r\n </dd>\r\n </div>\r\n }\r\n </dl>\r\n }\r\n }\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n}\r\n" }]
1828
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
1829
-
1830
- class EntityPreview {
1831
- data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
1832
- attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
1833
- comparisonKind = computed(() => {
1834
- const c = this.data().comparison;
1835
- if (!c)
1836
- return null;
1837
- if (c.kind === 'Value')
1838
- return 'Value';
1839
- if (c.kind === 'EntityList')
1840
- return 'EntityList';
1841
- return null;
1842
- }, ...(ngDevMode ? [{ debugName: "comparisonKind" }] : /* istanbul ignore next */ []));
1843
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
1844
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityPreview, isStandalone: true, selector: "mt-entity-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, ngImport: i0, template: "@switch (comparisonKind()) {\r\n @case (\"Value\") {\r\n <mt-comparison-value [data]=\"data()\" />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-comparison-entity-list [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-preview-body\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n }\r\n}\r\n", dependencies: [{ kind: "component", type: EntityPreviewBody, selector: "mt-entity-preview-body", inputs: ["data", "attachmentShape"] }, { kind: "component", type: ComparisonValue, selector: "mt-comparison-value", inputs: ["data"] }, { kind: "component", type: ComparisonEntityList, selector: "mt-comparison-entity-list", inputs: ["data"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1845
- }
1846
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityPreview, decorators: [{
1847
- type: Component,
1848
- args: [{ selector: 'mt-entity-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityPreviewBody, ComparisonValue, ComparisonEntityList], host: {
1849
- class: 'w-full',
1850
- }, template: "@switch (comparisonKind()) {\r\n @case (\"Value\") {\r\n <mt-comparison-value [data]=\"data()\" />\r\n }\r\n @case (\"EntityList\") {\r\n <mt-comparison-entity-list [data]=\"data()\" />\r\n }\r\n @default {\r\n <mt-entity-preview-body\r\n [data]=\"data()\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n }\r\n}\r\n" }]
1851
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }] } });
1852
-
1853
- const EMPTY_KEY_SET = new Set();
1854
- /** Classes every entity slot carries, before its per-slot modifiers. */
1855
- const SLOT_BASE_CLASS = 'min-w-0 overflow-hidden flex items-center rounded transition-colors';
1856
- /** Opt-in dashed frame (`configuration.showBorder`). */
1857
- const SLOT_BORDER_CLASS = 'border p-3 border-dashed border-gray-200 rounded-lg';
1858
- class EntitiesPreview {
1859
- transloco = inject(TranslocoService);
1860
- /** Array of entity data to display */
1861
- entities = input.required(...(ngDevMode ? [{ debugName: "entities" }] : /* istanbul ignore next */ []));
1862
- attachmentShape = input('default', ...(ngDevMode ? [{ debugName: "attachmentShape" }] : /* istanbul ignore next */ []));
1863
- /**
1864
- * Soft "stack every field full-width when the host is narrower than the
1865
- * 24-column grid reads well" behavior (the ≤400px container-query fallback,
1866
- * default on). Set to `false` in wide-enough card layouts — e.g. client-list
1867
- * cards (~350px) — so the per-entity `size` configuration is honored instead
1868
- * of forcing every item to full width. A hard ≤280px stack always applies
1869
- * regardless, so the 24-column gap floor can never overflow the host (#1081).
1870
- */
1871
- stackOnNarrow = input(true, ...(ngDevMode ? [{ debugName: "stackOnNarrow" }] : /* istanbul ignore next */ []));
1872
- /**
1873
- * Set of entity keys that should appear interactive (cursor pointer,
1874
- * clicks emit). Pass `new Set([...])` from a computed signal in the host
1875
- * for reactive enabling — when the host's set changes, Angular re-renders
1876
- * via its normal change detection, no manual subscriptions required.
1877
- *
1878
- * Pass a *stable* reference: a host method that mints a fresh `Set` on every
1879
- * call re-writes this input on every change detection pass and defeats the
1880
- * slot memoization below.
1881
- */
1882
- clickableKeys = input(EMPTY_KEY_SET, ...(ngDevMode ? [{ debugName: "clickableKeys" }] : /* istanbul ignore next */ []));
1883
- /**
1884
- * Set of entity keys that should render with the "active" treatment
1885
- * (e.g. currently the filter source). Same reactive pattern — and the same
1886
- * stable-reference requirement — as `clickableKeys`.
1887
- */
1888
- activeKeys = input(EMPTY_KEY_SET, ...(ngDevMode ? [{ debugName: "activeKeys" }] : /* istanbul ignore next */ []));
1889
- /** Tooltip text shown on hover when an entity is clickable but not active. */
1890
- clickableTooltip = input(this.transloco.translate('components.entitiesPreview.filterByThis'), ...(ngDevMode ? [{ debugName: "clickableTooltip" }] : /* istanbul ignore next */ []));
1891
- /** Tooltip text shown on hover when an entity is the current active filter. */
1892
- activeTooltip = input(this.transloco.translate('components.entitiesPreview.clearFilter'), ...(ngDevMode ? [{ debugName: "activeTooltip" }] : /* istanbul ignore next */ []));
1893
- /**
1894
- * Emits when an individual entity slot is clicked. Only fires when the
1895
- * entity's key is present in `clickableKeys`.
1896
- */
1897
- entityClick = output();
1898
- /**
1899
- * The active language as a signal. Section headings are resolved per-language
1900
- * in a `computed`, so under `OnPush` a plain `getActiveLang()` read would
1901
- * freeze them at whatever language was active on first render.
1902
- */
1903
- activeLang = toSignal(this.transloco.langChanges$, {
1904
- initialValue: this.transloco.getActiveLang(),
1905
- });
1906
- /** Entities expanded and sorted by order */
1907
- displayEntities = computed(() => buildDisplayEntities(this.entities()), ...(ngDevMode ? [{ debugName: "displayEntities" }] : /* istanbul ignore next */ []));
1908
- /**
1909
- * The display entities split into section groups. With no `Section` markers
1910
- * this is a single `{ section: null }` group, so the bare grid renders
1911
- * exactly as before.
1912
- */
1913
- sectionGroups = computed(() => groupEntitiesIntoSections(this.displayEntities()), ...(ngDevMode ? [{ debugName: "sectionGroups" }] : /* istanbul ignore next */ []));
1914
- /**
1915
- * The render model the template iterates. Split from `sectionGroups` on
1916
- * purpose: grouping only re-runs when the entities themselves change, while
1917
- * this cheap mapping re-runs when the key sets or tooltips change.
1918
- */
1919
- slotGroups = computed(() => {
1920
- const clickableKeys = this.clickableKeys();
1921
- const activeKeys = this.activeKeys();
1922
- const clickableTooltip = this.clickableTooltip();
1923
- const activeTooltip = this.activeTooltip();
1924
- const lang = this.activeLang();
1925
- return this.sectionGroups().map((group, groupIndex) => ({
1926
- trackKey: group.section?.key ?? `__group__${groupIndex}`,
1927
- boxed: !!group.section,
1928
- title: getEntitySectionTitle(group.section, lang),
1929
- slots: group.entities.map((entity, entityIndex) => {
1930
- const key = resolveEntityKey(entity);
1931
- const clickable = key.length > 0 && clickableKeys.has(key);
1932
- const active = clickable && activeKeys.has(key);
1933
- return {
1934
- entity,
1935
- trackKey: entity.key ?? String(entity.order ?? entityIndex),
1936
- containerClass: buildSlotClass(entity, clickable, active),
1937
- colSpan: `span ${(entity.configuration?.size ?? 8)}`,
1938
- clickable,
1939
- rowClickIgnore: clickable ? 'true' : null,
1940
- title: clickable ? (active ? activeTooltip : clickableTooltip) : null,
1941
- };
1942
- }),
1943
- }));
1944
- }, ...(ngDevMode ? [{ debugName: "slotGroups" }] : /* istanbul ignore next */ []));
1945
- onSlotClick(source, slot) {
1946
- if (!slot.clickable)
1947
- return;
1948
- source.stopPropagation();
1949
- this.entityClick.emit({
1950
- entity: slot.entity,
1951
- key: resolveEntityKey(slot.entity),
1952
- source,
1953
- });
1954
- }
1955
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntitiesPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
1956
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntitiesPreview, isStandalone: true, selector: "mt-entities-preview", inputs: { entities: { classPropertyName: "entities", publicName: "entities", isSignal: true, isRequired: true, transformFunction: null }, attachmentShape: { classPropertyName: "attachmentShape", publicName: "attachmentShape", isSignal: true, isRequired: false, transformFunction: null }, stackOnNarrow: { classPropertyName: "stackOnNarrow", publicName: "stackOnNarrow", isSignal: true, isRequired: false, transformFunction: null }, clickableKeys: { classPropertyName: "clickableKeys", publicName: "clickableKeys", isSignal: true, isRequired: false, transformFunction: null }, activeKeys: { classPropertyName: "activeKeys", publicName: "activeKeys", isSignal: true, isRequired: false, transformFunction: null }, clickableTooltip: { classPropertyName: "clickableTooltip", publicName: "clickableTooltip", isSignal: true, isRequired: false, transformFunction: null }, activeTooltip: { classPropertyName: "activeTooltip", publicName: "activeTooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { entityClick: "entityClick" }, host: { properties: { "class.mt-entities-stack-narrow": "stackOnNarrow()" }, classAttribute: "block min-w-0 w-full" }, ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\r\n @for (group of slotGroups(); track group.trackKey) {\r\n @if (group.boxed) {\r\n <!-- Titled section box (matches the client-form section view) -->\r\n <div\r\n class=\"flex flex-col gap-0 overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n @if (group.title) {\r\n <h3\r\n class=\"m-0 border-b border-surface-200 bg-surface-50 px-4 py-3 text-lg font-semibold text-color\"\r\n dir=\"auto\"\r\n >\r\n {{ group.title }}\r\n </h3>\r\n }\r\n <div class=\"p-4\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n }\r\n }\r\n</div>\r\n\r\n<!--\r\n Every binding here reads a value the component already resolved into the slot\r\n (see `EntitiesPreview.slotGroups`). Keep it that way: this template runs once\r\n per entity per change detection pass, and a card grid renders thousands of\r\n them, so a method call or a fresh object literal in this block is measurably\r\n expensive.\r\n-->\r\n<ng-template #entityGrid let-slots>\r\n <div class=\"mt-entities-grid grid grid-cols-24 gap-x-3 gap-y-5\">\r\n @for (slot of slots; track slot.trackKey) {\r\n <div\r\n [class]=\"slot.containerClass\"\r\n [attr.data-row-click-ignore]=\"slot.rowClickIgnore\"\r\n [attr.title]=\"slot.title\"\r\n [style.grid-column]=\"slot.colSpan\"\r\n (click)=\"onSlotClick($event, slot)\"\r\n >\r\n <mt-entity-preview\r\n [data]=\"slot.entity\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: [":host{container-type:inline-size}@container (max-width: 400px){:host(.mt-entities-stack-narrow) .mt-entities-grid{grid-template-columns:1fr;column-gap:0}:host(.mt-entities-stack-narrow) .mt-entities-grid>*{grid-column:1 / -1!important}}@container (max-width: 280px){.mt-entities-grid{grid-template-columns:1fr;column-gap:0}.mt-entities-grid>*{grid-column:1 / -1!important}}.mt-entity-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in!important}.mt-entity-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out!important}.mt-entity-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-entity-filter-active{background-color:#ccfbf14d;box-shadow:inset 0 0 0 1.5px #14b8a666,0 0 0 1px #ffffff80}\n"], dependencies: [{ kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1957
- }
1958
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntitiesPreview, decorators: [{
1959
- type: Component,
1960
- args: [{ selector: 'mt-entities-preview', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [EntityPreview, NgTemplateOutlet], host: {
1961
- class: 'block min-w-0 w-full',
1962
- '[class.mt-entities-stack-narrow]': 'stackOnNarrow()',
1963
- }, template: "<div class=\"flex flex-col gap-4\">\r\n @for (group of slotGroups(); track group.trackKey) {\r\n @if (group.boxed) {\r\n <!-- Titled section box (matches the client-form section view) -->\r\n <div\r\n class=\"flex flex-col gap-0 overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n @if (group.title) {\r\n <h3\r\n class=\"m-0 border-b border-surface-200 bg-surface-50 px-4 py-3 text-lg font-semibold text-color\"\r\n dir=\"auto\"\r\n >\r\n {{ group.title }}\r\n </h3>\r\n }\r\n <div class=\"p-4\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <ng-container\r\n [ngTemplateOutlet]=\"entityGrid\"\r\n [ngTemplateOutletContext]=\"{ $implicit: group.slots }\"\r\n />\r\n }\r\n }\r\n</div>\r\n\r\n<!--\r\n Every binding here reads a value the component already resolved into the slot\r\n (see `EntitiesPreview.slotGroups`). Keep it that way: this template runs once\r\n per entity per change detection pass, and a card grid renders thousands of\r\n them, so a method call or a fresh object literal in this block is measurably\r\n expensive.\r\n-->\r\n<ng-template #entityGrid let-slots>\r\n <div class=\"mt-entities-grid grid grid-cols-24 gap-x-3 gap-y-5\">\r\n @for (slot of slots; track slot.trackKey) {\r\n <div\r\n [class]=\"slot.containerClass\"\r\n [attr.data-row-click-ignore]=\"slot.rowClickIgnore\"\r\n [attr.title]=\"slot.title\"\r\n [style.grid-column]=\"slot.colSpan\"\r\n (click)=\"onSlotClick($event, slot)\"\r\n >\r\n <mt-entity-preview\r\n [data]=\"slot.entity\"\r\n [attachmentShape]=\"attachmentShape()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n", styles: [":host{container-type:inline-size}@container (max-width: 400px){:host(.mt-entities-stack-narrow) .mt-entities-grid{grid-template-columns:1fr;column-gap:0}:host(.mt-entities-stack-narrow) .mt-entities-grid>*{grid-column:1 / -1!important}}@container (max-width: 280px){.mt-entities-grid{grid-template-columns:1fr;column-gap:0}.mt-entities-grid>*{grid-column:1 / -1!important}}.mt-entity-filterable{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-in!important}.mt-entity-filter-active{cursor:url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%2314b8a6' stroke='%2314b8a6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E\") 7 3,zoom-out!important}.mt-entity-filterable:hover{background-color:#ccfbf147;outline:1px dashed rgb(20 184 166 / .28);outline-offset:2px}.mt-entity-filter-active{background-color:#ccfbf14d;box-shadow:inset 0 0 0 1.5px #14b8a666,0 0 0 1px #ffffff80}\n"] }]
1964
- }], propDecorators: { entities: [{ type: i0.Input, args: [{ isSignal: true, alias: "entities", required: true }] }], attachmentShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachmentShape", required: false }] }], stackOnNarrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "stackOnNarrow", required: false }] }], clickableKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickableKeys", required: false }] }], activeKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeKeys", required: false }] }], clickableTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickableTooltip", required: false }] }], activeTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTooltip", required: false }] }], entityClick: [{ type: i0.Output, args: ["entityClick"] }] } });
1965
- /** Stable key resolution shared with the host — must agree on order. */
1966
- function resolveEntityKey(entity) {
1967
- return entity.key || entity.normalizedKey || entity.name || '';
1968
- }
1969
- function buildSlotClass(entity, clickable, active) {
1970
- let result = SLOT_BASE_CLASS;
1971
- if (entity.configuration?.showBorder)
1972
- result += ` ${SLOT_BORDER_CLASS}`;
1973
- if (clickable) {
1974
- result += active ? ' mt-entity-filter-active' : ' mt-entity-filterable';
1975
- }
1976
- return result;
1977
- }
1978
-
1979
- /**
1980
- * Base class that encapsulates all entity resize-via-drag logic.
1981
- *
1982
- * Extend this directive in any component that needs column-resize behaviour
1983
- * on a 24-column CSS grid. The subclass must:
1984
- * - Provide a `model.required<EntityData[]>()` (or equivalent) for the
1985
- * entity list so `updateEntitySize()` can be called after resize.
1986
- * - Contain a `.grid` element (or override `getGridElement()`).
1987
- *
1988
- * Resize flow:
1989
- * 1. `onResizeStart(event, entity)` — called from a mousedown on the handle
1990
- * 2. mousemove → snaps to nearest column, updates `resizePreviewSize`
1991
- * 3. mouseup → emits `entityResized` with previous & new size
1992
- */
1993
- class EntitiesResizeBase {
1994
- elRef = inject(ElementRef);
1995
- zone = inject(NgZone);
1996
- doc = inject(DOCUMENT);
1997
- /** Emits when an entity is resized via the drag handle */
1998
- entityResized = output();
1999
- // ── Resize state ──
2000
- /** The entity currently being resized (null when idle) */
2001
- resizingEntity = signal(null, ...(ngDevMode ? [{ debugName: "resizingEntity" }] : /* istanbul ignore next */ []));
2002
- /** Live preview size while dragging */
2003
- resizePreviewSize = signal(null, ...(ngDevMode ? [{ debugName: "resizePreviewSize" }] : /* istanbul ignore next */ []));
2004
- /** Bound listeners kept for cleanup */
2005
- _onMouseMove = null;
2006
- _onMouseUp = null;
2007
- // ── Public API ──
2008
- /**
2009
- * Returns the grid element used to compute column widths.
2010
- * Override if the grid selector differs.
2011
- */
2012
- getGridElement() {
2013
- return this.elRef.nativeElement.querySelector('.grid');
2014
- }
2015
- /**
2016
- * Returns the grid-column span string for a given entity.
2017
- * While resizing the active entity, returns the preview size.
2018
- */
2019
- getResizeColSpan(entity) {
2020
- if (this.resizingEntity() === entity && this.resizePreviewSize() !== null) {
2021
- return `span ${this.resizePreviewSize()}`;
2022
- }
2023
- const size = entity.configuration?.size ?? 8;
2024
- return `span ${size}`;
2025
- }
2026
- /** Starts a resize operation from the right-edge handle */
2027
- onResizeStart(event, entity) {
2028
- // Prevent the drag-drop from starting
2029
- event.preventDefault();
2030
- event.stopPropagation();
2031
- const gridEl = this.getGridElement();
2032
- if (!gridEl)
2033
- return;
2034
- const gridRect = gridEl.getBoundingClientRect();
2035
- const gridWidth = gridRect.width;
2036
- const columnWidth = gridWidth / 24;
2037
- const previousSize = entity.configuration?.size ?? 8;
2038
- // Left edge of the entity cell
2039
- const cellEl = event.target.closest('.entity-cell');
2040
- if (!cellEl)
2041
- return;
2042
- const cellRect = cellEl.getBoundingClientRect();
2043
- const isRtl = this.doc.documentElement.getAttribute('dir') === 'rtl' ||
2044
- getComputedStyle(this.doc.documentElement).direction === 'rtl';
2045
- this.resizingEntity.set(entity);
2046
- this.resizePreviewSize.set(previousSize);
2047
- // Run mouse listeners outside Angular zone for performance
2048
- this.zone.runOutsideAngular(() => {
2049
- this._onMouseMove = (e) => {
2050
- // In RTL the logical end is the left edge; dragging left widens the cell
2051
- const rawWidth = isRtl
2052
- ? cellRect.right - e.clientX
2053
- : e.clientX - cellRect.left;
2054
- // Snap to nearest full column (min 1, max 12)
2055
- let cols = Math.round(rawWidth / columnWidth);
2056
- cols = Math.max(1, Math.min(24, cols));
2057
- const current = this.resizePreviewSize();
2058
- if (current !== cols) {
2059
- this.zone.run(() => this.resizePreviewSize.set(cols));
2060
- }
2061
- };
2062
- this._onMouseUp = () => {
2063
- this._cleanupListeners();
2064
- const newSize = this.resizePreviewSize();
2065
- this.resizingEntity.set(null);
2066
- this.resizePreviewSize.set(null);
2067
- if (newSize !== previousSize) {
2068
- this.zone.run(() => {
2069
- this.onResizeComplete(entity, previousSize, newSize);
2070
- });
2071
- }
2072
- };
2073
- this.doc.addEventListener('mousemove', this._onMouseMove);
2074
- this.doc.addEventListener('mouseup', this._onMouseUp, { once: true });
2075
- });
2076
- }
2077
- /** Removes global mouse listeners */
2078
- _cleanupListeners() {
2079
- if (this._onMouseMove) {
2080
- this.doc.removeEventListener('mousemove', this._onMouseMove);
2081
- this._onMouseMove = null;
2082
- }
2083
- if (this._onMouseUp) {
2084
- this.doc.removeEventListener('mouseup', this._onMouseUp);
2085
- this._onMouseUp = null;
2086
- }
2087
- }
2088
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntitiesResizeBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2089
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: EntitiesResizeBase, isStandalone: true, outputs: { entityResized: "entityResized" }, ngImport: i0 });
2090
- }
2091
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntitiesResizeBase, decorators: [{
2092
- type: Directive
2093
- }], propDecorators: { entityResized: [{ type: i0.Output, args: ["entityResized"] }] } });
2094
-
2095
- class EntitiesManage extends EntitiesResizeBase {
2096
- /** Array of entity data – supports two-way binding to keep order in sync */
2097
- entities = model.required(...(ngDevMode ? [{ debugName: "entities" }] : /* istanbul ignore next */ []));
2098
- /** Emits the reordered entities array after each drag-drop */
2099
- entitiesReordered = output();
2100
- /** Emits when an entity cell is clicked (for opening edit drawer) */
2101
- entityClicked = output();
2102
- /**
2103
- * Emits when an item dragged from a *different* connected list (e.g. a sidebar
2104
- * "add section" tool) is dropped onto this grid. `index` is the target slot;
2105
- * `data` is the dropped `cdkDragData`. The host decides what to insert.
2106
- */
2107
- externalItemDropped = output();
2108
- /** Entities expanded and sorted by their configured order */
2109
- displayEntities = computed(() => buildDisplayEntities(this.entities()), ...(ngDevMode ? [{ debugName: "displayEntities" }] : /* istanbul ignore next */ []));
2110
- /** Returns the grid-column span for a given entity size (1-24) */
2111
- getColSpan(entity) {
2112
- if (isEntitySection(entity))
2113
- return 'span 24';
2114
- return this.getResizeColSpan(entity);
2115
- }
2116
- /** True when the entity is a full-width `Section` layout marker. */
2117
- isSection(entity) {
2118
- return isEntitySection(entity);
2119
- }
2120
- /** Handle drag-drop reorder */
2121
- onDrop(event) {
2122
- // Item dragged in from another connected list — let the host handle it.
2123
- if (event.previousContainer !== event.container) {
2124
- this.externalItemDropped.emit({
2125
- index: event.currentIndex,
2126
- data: event.item.data,
2127
- });
2128
- return;
2129
- }
2130
- if (event.previousIndex === event.currentIndex)
2131
- return;
2132
- const items = [...this.displayEntities()];
2133
- const [moved] = items.splice(event.previousIndex, 1);
2134
- items.splice(event.currentIndex, 0, moved);
2135
- // Reassign order based on new positions
2136
- const reordered = items.map((item, index) => ({
2137
- ...item,
2138
- order: index + 1,
2139
- }));
2140
- // Update the model (two-way binding)
2141
- this.entities.set(reordered);
2142
- // Emit the reordered list
2143
- this.entitiesReordered.emit(reordered);
2144
- }
2145
- // ── Resize completion (from EntitiesResizeBase) ──
2146
- onResizeComplete(entity, previousSize, newSize) {
2147
- const currentEntities = this.entities();
2148
- const sourceEntities = currentEntities.some((e) => e === entity)
2149
- ? currentEntities
2150
- : this.displayEntities();
2151
- const updated = sourceEntities.map((e) => e === entity || (isLeafDetailsSyntheticKey(e.key) && e.key === entity.key)
2152
- ? {
2153
- ...e,
2154
- configuration: {
2155
- ...e.configuration,
2156
- size: newSize,
2157
- },
2158
- }
2159
- : e);
2160
- this.entities.set(updated);
2161
- this.entityResized.emit({
2162
- entity: {
2163
- ...entity,
2164
- configuration: { ...entity.configuration, size: newSize },
2165
- },
2166
- previousSize,
2167
- newSize,
2168
- });
2169
- }
2170
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntitiesManage, deps: null, target: i0.ɵɵFactoryTarget.Component });
2171
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntitiesManage, isStandalone: true, selector: "mt-entities-manage", inputs: { entities: { classPropertyName: "entities", publicName: "entities", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { entities: "entitiesChange", entitiesReordered: "entitiesReordered", entityClicked: "entityClicked", externalItemDropped: "externalItemDropped" }, usesInheritance: true, ngImport: i0, template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n [cdkDropListData]=\"displayEntities()\"\r\n (cdkDropListDropped)=\"onDrop($event)\"\r\n class=\"grid grid-cols-24 gap-x-4 gap-y-6\"\r\n>\r\n @for (\r\n entity of displayEntities();\r\n track entity.key ?? entity.order ?? $index\r\n ) {\r\n @if (isSection(entity)) {\r\n <!-- Section marker: full-width, non-resizable header row -->\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell section-row group relative min-w-0 flex items-center gap-2 px-4 py-2.5 cursor-grab active:cursor-grabbing rounded-md border border-surface-200 bg-surface-50 transition-colors hover:bg-emphasis\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n >\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-11 bg-black/10 rounded-md\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <span\r\n class=\"flex-1 min-w-0 truncate text-base font-semibold\"\r\n dir=\"auto\"\r\n >\r\n {{ entity.name }}\r\n </span>\r\n <mt-icon\r\n icon=\"editor.pencil-01\"\r\n class=\"shrink-0 opacity-0 transition-opacity group-hover:opacity-60\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell group relative min-w-0 flex items-center p-3 cursor-grab active:cursor-grabbing rounded-lg transition-colors bg-surface-100/60\"\r\n [class.border]=\"entity.configuration?.showBorder\"\r\n [class.border-dashed]=\"entity.configuration?.showBorder\"\r\n [class.border-gray-300]=\"entity.configuration?.showBorder\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n >\r\n <!-- Drag placeholder -->\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-12 bg-black/10 rounded-xl\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <mt-entity-preview\r\n [data]=\"entity\"\r\n class=\"flex-1 min-w-0 cursor-pointer\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n />\r\n\r\n <!-- Resize handle (right edge) -->\r\n <div\r\n class=\"resize-handle\"\r\n (mousedown)=\"onResizeStart($event, entity)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div class=\"resize-handle-bar\"></div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n</div>\r\n", styles: [".cdk-drag{cursor:grab}.cdk-drag:active{cursor:grabbing}.cdk-drag-preview{cursor:grabbing;overflow:hidden}.cdk-drag-placeholder{opacity:.5}.cdk-drop-list-dragging .cdk-drag{cursor:grabbing}.entity-cell{position:relative}.resize-handle{position:absolute;top:0;inset-inline-end:-4px;width:8px;height:100%;cursor:col-resize;z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s ease}.entity-cell:hover .resize-handle,.entity-cell.resizing .resize-handle{opacity:1}.resize-handle-bar{width:3px;height:24px;border-radius:2px;background-color:var(--p-primary-color, #6366f1);transition:height .15s ease,background-color .15s ease}.resize-handle:hover .resize-handle-bar{height:36px;background-color:var(--p-primary-color, #4f46e5)}.entity-cell.resizing{outline:2px dashed var(--p-primary-color, #6366f1);outline-offset:-1px;border-radius:8px;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "component", type: EntityPreview, selector: "mt-entity-preview", inputs: ["data", "attachmentShape"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDragPlaceholder, selector: "ng-template[cdkDragPlaceholder]", inputs: ["data"] }] });
2172
- }
2173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntitiesManage, decorators: [{
2174
- type: Component,
2175
- args: [{ selector: 'mt-entities-manage', standalone: true, imports: [EntityPreview, Icon, CdkDrag, CdkDropList, CdkDragPlaceholder], template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n [cdkDropListData]=\"displayEntities()\"\r\n (cdkDropListDropped)=\"onDrop($event)\"\r\n class=\"grid grid-cols-24 gap-x-4 gap-y-6\"\r\n>\r\n @for (\r\n entity of displayEntities();\r\n track entity.key ?? entity.order ?? $index\r\n ) {\r\n @if (isSection(entity)) {\r\n <!-- Section marker: full-width, non-resizable header row -->\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell section-row group relative min-w-0 flex items-center gap-2 px-4 py-2.5 cursor-grab active:cursor-grabbing rounded-md border border-surface-200 bg-surface-50 transition-colors hover:bg-emphasis\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n >\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-11 bg-black/10 rounded-md\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <span\r\n class=\"flex-1 min-w-0 truncate text-base font-semibold\"\r\n dir=\"auto\"\r\n >\r\n {{ entity.name }}\r\n </span>\r\n <mt-icon\r\n icon=\"editor.pencil-01\"\r\n class=\"shrink-0 opacity-0 transition-opacity group-hover:opacity-60\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n cdkDrag\r\n [cdkDragData]=\"entity\"\r\n class=\"entity-cell group relative min-w-0 flex items-center p-3 cursor-grab active:cursor-grabbing rounded-lg transition-colors bg-surface-100/60\"\r\n [class.border]=\"entity.configuration?.showBorder\"\r\n [class.border-dashed]=\"entity.configuration?.showBorder\"\r\n [class.border-gray-300]=\"entity.configuration?.showBorder\"\r\n [class.resizing]=\"resizingEntity() === entity\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n >\r\n <!-- Drag placeholder -->\r\n <div\r\n *cdkDragPlaceholder\r\n class=\"h-full min-h-12 bg-black/10 rounded-xl\"\r\n [style.grid-column]=\"getColSpan(entity)\"\r\n ></div>\r\n\r\n <mt-entity-preview\r\n [data]=\"entity\"\r\n class=\"flex-1 min-w-0 cursor-pointer\"\r\n (click)=\"entityClicked.emit(entity)\"\r\n />\r\n\r\n <!-- Resize handle (right edge) -->\r\n <div\r\n class=\"resize-handle\"\r\n (mousedown)=\"onResizeStart($event, entity)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div class=\"resize-handle-bar\"></div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n</div>\r\n", styles: [".cdk-drag{cursor:grab}.cdk-drag:active{cursor:grabbing}.cdk-drag-preview{cursor:grabbing;overflow:hidden}.cdk-drag-placeholder{opacity:.5}.cdk-drop-list-dragging .cdk-drag{cursor:grabbing}.entity-cell{position:relative}.resize-handle{position:absolute;top:0;inset-inline-end:-4px;width:8px;height:100%;cursor:col-resize;z-index:10;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s ease}.entity-cell:hover .resize-handle,.entity-cell.resizing .resize-handle{opacity:1}.resize-handle-bar{width:3px;height:24px;border-radius:2px;background-color:var(--p-primary-color, #6366f1);transition:height .15s ease,background-color .15s ease}.resize-handle:hover .resize-handle-bar{height:36px;background-color:var(--p-primary-color, #4f46e5)}.entity-cell.resizing{outline:2px dashed var(--p-primary-color, #6366f1);outline-offset:-1px;border-radius:8px;-webkit-user-select:none;user-select:none}\n"] }]
2176
- }], propDecorators: { entities: [{ type: i0.Input, args: [{ isSignal: true, alias: "entities", required: true }] }, { type: i0.Output, args: ["entitiesChange"] }], entitiesReordered: [{ type: i0.Output, args: ["entitiesReordered"] }], entityClicked: [{ type: i0.Output, args: ["entityClicked"] }], externalItemDropped: [{ type: i0.Output, args: ["externalItemDropped"] }] } });
2177
-
2178
- /**
2179
- * Generated bundle index. Do not edit.
2180
- */
2181
-
2182
- export { CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityLeafDetails, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityScheduleItem, EntityStatus, EntityText, EntityUser, LEAF_DETAILS_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildDisplayEntities, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, expandLeafDetailsEntity, getEntitySectionTitle, groupEntitiesIntoSections, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isSectionKey, matchesPercentageColorRule, parseCurrencyAmount, resolveLocalizedLabel, resolvePercentageColor };
2183
- //# sourceMappingURL=masterteam-components-entities.mjs.map