@masterteam/components 0.0.263 → 0.0.265

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