@masterteam/components 0.0.265 → 0.0.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (756) hide show
  1. package/assets/common.css +2 -309
  2. package/fesm2022/masterteam-components-avatar-text.mjs +46 -0
  3. package/fesm2022/masterteam-components-avatar-text.mjs.map +1 -0
  4. package/fesm2022/masterteam-components-avatar.mjs +50 -0
  5. package/fesm2022/masterteam-components-avatar.mjs.map +1 -0
  6. package/fesm2022/masterteam-components-breadcrumb.mjs +27 -0
  7. package/fesm2022/masterteam-components-breadcrumb.mjs.map +1 -0
  8. package/fesm2022/masterteam-components-business-fields.mjs +1907 -0
  9. package/fesm2022/masterteam-components-business-fields.mjs.map +1 -0
  10. package/fesm2022/masterteam-components-button-group.mjs +20 -0
  11. package/fesm2022/masterteam-components-button-group.mjs.map +1 -0
  12. package/fesm2022/masterteam-components-button.mjs +82 -0
  13. package/fesm2022/masterteam-components-button.mjs.map +1 -0
  14. package/fesm2022/masterteam-components-card.mjs +28 -0
  15. package/fesm2022/masterteam-components-card.mjs.map +1 -0
  16. package/fesm2022/masterteam-components-checkbox-field.mjs +92 -0
  17. package/fesm2022/masterteam-components-checkbox-field.mjs.map +1 -0
  18. package/fesm2022/masterteam-components-chip.mjs +39 -0
  19. package/fesm2022/masterteam-components-chip.mjs.map +1 -0
  20. package/fesm2022/masterteam-components-client-page-menu.mjs +153 -0
  21. package/fesm2022/masterteam-components-client-page-menu.mjs.map +1 -0
  22. package/fesm2022/masterteam-components-client-page.mjs +413 -0
  23. package/fesm2022/masterteam-components-client-page.mjs.map +1 -0
  24. package/fesm2022/masterteam-components-color-picker-field.mjs +106 -0
  25. package/fesm2022/masterteam-components-color-picker-field.mjs.map +1 -0
  26. package/fesm2022/masterteam-components-confirmation.mjs +98 -0
  27. package/fesm2022/masterteam-components-confirmation.mjs.map +1 -0
  28. package/fesm2022/masterteam-components-date-field.mjs +158 -0
  29. package/fesm2022/masterteam-components-date-field.mjs.map +1 -0
  30. package/fesm2022/masterteam-components-dialog.mjs +33 -0
  31. package/fesm2022/masterteam-components-dialog.mjs.map +1 -0
  32. package/fesm2022/masterteam-components-drawer.mjs +268 -0
  33. package/fesm2022/masterteam-components-drawer.mjs.map +1 -0
  34. package/fesm2022/masterteam-components-dynamic-drawer.mjs +608 -0
  35. package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -0
  36. package/fesm2022/masterteam-components-editor-field.mjs +103 -0
  37. package/fesm2022/masterteam-components-editor-field.mjs.map +1 -0
  38. package/fesm2022/masterteam-components-empty-state.mjs +53 -0
  39. package/fesm2022/masterteam-components-empty-state.mjs.map +1 -0
  40. package/fesm2022/masterteam-components-entities.mjs +2242 -0
  41. package/fesm2022/masterteam-components-entities.mjs.map +1 -0
  42. package/fesm2022/masterteam-components-field-validation.mjs +237 -0
  43. package/fesm2022/masterteam-components-field-validation.mjs.map +1 -0
  44. package/fesm2022/masterteam-components-formula.mjs +3848 -0
  45. package/fesm2022/masterteam-components-formula.mjs.map +1 -0
  46. package/fesm2022/masterteam-components-icon-field.mjs +158 -0
  47. package/fesm2022/masterteam-components-icon-field.mjs.map +1 -0
  48. package/fesm2022/masterteam-components-list.mjs +31 -0
  49. package/fesm2022/masterteam-components-list.mjs.map +1 -0
  50. package/fesm2022/masterteam-components-location-field.mjs +607 -0
  51. package/fesm2022/masterteam-components-location-field.mjs.map +1 -0
  52. package/fesm2022/masterteam-components-menu.mjs +135 -0
  53. package/fesm2022/masterteam-components-menu.mjs.map +1 -0
  54. package/fesm2022/masterteam-components-modal.mjs +108 -0
  55. package/fesm2022/masterteam-components-modal.mjs.map +1 -0
  56. package/fesm2022/masterteam-components-module-summary-card.mjs +34 -0
  57. package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -0
  58. package/fesm2022/masterteam-components-multi-select-field.mjs +321 -0
  59. package/fesm2022/masterteam-components-multi-select-field.mjs.map +1 -0
  60. package/fesm2022/masterteam-components-number-field.mjs +102 -0
  61. package/fesm2022/masterteam-components-number-field.mjs.map +1 -0
  62. package/fesm2022/masterteam-components-page-header.mjs +42 -0
  63. package/fesm2022/masterteam-components-page-header.mjs.map +1 -0
  64. package/fesm2022/masterteam-components-page.mjs +35 -0
  65. package/fesm2022/masterteam-components-page.mjs.map +1 -0
  66. package/fesm2022/masterteam-components-paginator.mjs +43 -0
  67. package/fesm2022/masterteam-components-paginator.mjs.map +1 -0
  68. package/fesm2022/masterteam-components-pick-list-field.mjs +210 -0
  69. package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -0
  70. package/fesm2022/masterteam-components-progress.mjs +63 -0
  71. package/fesm2022/masterteam-components-progress.mjs.map +1 -0
  72. package/fesm2022/masterteam-components-property-filter-builder.mjs +386 -0
  73. package/fesm2022/masterteam-components-property-filter-builder.mjs.map +1 -0
  74. package/fesm2022/masterteam-components-radio-button-field.mjs +85 -0
  75. package/fesm2022/masterteam-components-radio-button-field.mjs.map +1 -0
  76. package/fesm2022/masterteam-components-radio-cards-field.mjs +131 -0
  77. package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -0
  78. package/fesm2022/masterteam-components-radio-cards.mjs +74 -0
  79. package/fesm2022/masterteam-components-radio-cards.mjs.map +1 -0
  80. package/fesm2022/masterteam-components-runtime-action.mjs +406 -0
  81. package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -0
  82. package/fesm2022/masterteam-components-select-field.mjs +415 -0
  83. package/fesm2022/masterteam-components-select-field.mjs.map +1 -0
  84. package/fesm2022/masterteam-components-sidebar.mjs +155 -0
  85. package/fesm2022/masterteam-components-sidebar.mjs.map +1 -0
  86. package/fesm2022/masterteam-components-slider-field.mjs +128 -0
  87. package/fesm2022/masterteam-components-slider-field.mjs.map +1 -0
  88. package/fesm2022/masterteam-components-statistic-card.mjs +42 -0
  89. package/fesm2022/masterteam-components-statistic-card.mjs.map +1 -0
  90. package/fesm2022/masterteam-components-table.mjs +3372 -0
  91. package/fesm2022/masterteam-components-table.mjs.map +1 -0
  92. package/fesm2022/masterteam-components-tabs.mjs +289 -0
  93. package/fesm2022/masterteam-components-tabs.mjs.map +1 -0
  94. package/fesm2022/masterteam-components-text-field.mjs +202 -0
  95. package/fesm2022/masterteam-components-text-field.mjs.map +1 -0
  96. package/fesm2022/masterteam-components-textarea-field.mjs +126 -0
  97. package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -0
  98. package/fesm2022/masterteam-components-toast.mjs +80 -0
  99. package/fesm2022/masterteam-components-toast.mjs.map +1 -0
  100. package/fesm2022/masterteam-components-toggle-field.mjs +116 -0
  101. package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -0
  102. package/fesm2022/masterteam-components-tooltip.mjs +147 -0
  103. package/fesm2022/masterteam-components-tooltip.mjs.map +1 -0
  104. package/fesm2022/masterteam-components-topbar.mjs +32 -0
  105. package/fesm2022/masterteam-components-topbar.mjs.map +1 -0
  106. package/fesm2022/masterteam-components-tree.mjs +260 -0
  107. package/fesm2022/masterteam-components-tree.mjs.map +1 -0
  108. package/fesm2022/masterteam-components-treeselect-field.mjs +265 -0
  109. package/fesm2022/masterteam-components-treeselect-field.mjs.map +1 -0
  110. package/fesm2022/masterteam-components-upload-field.mjs +846 -0
  111. package/fesm2022/masterteam-components-upload-field.mjs.map +1 -0
  112. package/fesm2022/masterteam-components-uploader.mjs +425 -0
  113. package/fesm2022/masterteam-components-uploader.mjs.map +1 -0
  114. package/fesm2022/masterteam-components-user-search-field.mjs +374 -0
  115. package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -0
  116. package/fesm2022/masterteam-components.mjs +2512 -0
  117. package/fesm2022/masterteam-components.mjs.map +1 -0
  118. package/package.json +278 -54
  119. package/types/masterteam-components-avatar-text.d.ts +23 -0
  120. package/types/masterteam-components-avatar.d.ts +23 -0
  121. package/types/masterteam-components-breadcrumb.d.ts +18 -0
  122. package/types/masterteam-components-business-fields.d.ts +675 -0
  123. package/types/masterteam-components-button-group.d.ts +8 -0
  124. package/types/masterteam-components-button.d.ts +62 -0
  125. package/types/masterteam-components-card.d.ts +14 -0
  126. package/types/masterteam-components-checkbox-field.d.ts +38 -0
  127. package/types/masterteam-components-chip.d.ts +21 -0
  128. package/types/masterteam-components-client-page-menu.d.ts +55 -0
  129. package/types/masterteam-components-client-page.d.ts +115 -0
  130. package/types/masterteam-components-color-picker-field.d.ts +39 -0
  131. package/types/masterteam-components-confirmation.d.ts +41 -0
  132. package/types/masterteam-components-date-field.d.ts +57 -0
  133. package/types/masterteam-components-dialog.d.ts +12 -0
  134. package/types/masterteam-components-drawer.d.ts +62 -0
  135. package/types/masterteam-components-dynamic-drawer.d.ts +159 -0
  136. package/types/masterteam-components-editor-field.d.ts +39 -0
  137. package/types/masterteam-components-empty-state.d.ts +47 -0
  138. package/types/masterteam-components-entities.d.ts +1116 -0
  139. package/types/masterteam-components-field-validation.d.ts +59 -0
  140. package/types/masterteam-components-formula.d.ts +759 -0
  141. package/types/masterteam-components-icon-field.d.ts +44 -0
  142. package/types/masterteam-components-list.d.ts +18 -0
  143. package/types/masterteam-components-location-field.d.ts +173 -0
  144. package/types/masterteam-components-menu.d.ts +55 -0
  145. package/types/masterteam-components-modal.d.ts +30 -0
  146. package/types/masterteam-components-module-summary-card.d.ts +18 -0
  147. package/types/masterteam-components-multi-select-field.d.ts +104 -0
  148. package/types/masterteam-components-number-field.d.ts +47 -0
  149. package/types/masterteam-components-page-header.d.ts +30 -0
  150. package/types/masterteam-components-page.d.ts +26 -0
  151. package/types/masterteam-components-paginator.d.ts +20 -0
  152. package/types/masterteam-components-pick-list-field.d.ts +65 -0
  153. package/types/masterteam-components-progress.d.ts +30 -0
  154. package/types/masterteam-components-property-filter-builder.d.ts +90 -0
  155. package/types/masterteam-components-radio-button-field.d.ts +41 -0
  156. package/types/masterteam-components-radio-cards-field.d.ts +39 -0
  157. package/types/masterteam-components-radio-cards.d.ts +33 -0
  158. package/types/masterteam-components-runtime-action.d.ts +105 -0
  159. package/types/masterteam-components-select-field.d.ts +136 -0
  160. package/types/masterteam-components-sidebar.d.ts +71 -0
  161. package/types/masterteam-components-slider-field.d.ts +41 -0
  162. package/types/masterteam-components-statistic-card.d.ts +28 -0
  163. package/types/masterteam-components-table.d.ts +937 -0
  164. package/types/masterteam-components-tabs.d.ts +80 -0
  165. package/types/masterteam-components-text-field.d.ts +60 -0
  166. package/types/masterteam-components-textarea-field.d.ts +45 -0
  167. package/types/masterteam-components-toast.d.ts +27 -0
  168. package/types/masterteam-components-toggle-field.d.ts +44 -0
  169. package/types/masterteam-components-tooltip.d.ts +26 -0
  170. package/types/masterteam-components-topbar.d.ts +20 -0
  171. package/types/masterteam-components-tree.d.ts +106 -0
  172. package/types/masterteam-components-treeselect-field.d.ts +79 -0
  173. package/types/masterteam-components-upload-field.d.ts +112 -0
  174. package/types/masterteam-components-uploader.d.ts +53 -0
  175. package/types/masterteam-components-user-search-field.d.ts +110 -0
  176. package/types/masterteam-components.d.ts +1261 -0
  177. package/.angular/cache/21.2.7/@masterteam/components/.tsbuildinfo +0 -1
  178. package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db +0 -0
  179. package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db-lock +0 -0
  180. package/.angular/cache/21.2.7/ng-packagr/045efd332b9db1d21b3a595a37ae03ebb11b457a5dc6e2d1cbc561b694e17f1a +0 -1
  181. package/.angular/cache/21.2.7/ng-packagr/0727b170af3d53236c0cafe16ea670d089e48d4c5c525b1dbcc1c684bb6e99c7 +0 -1
  182. package/.angular/cache/21.2.7/ng-packagr/0873bc9048494ebc33fe0a7b856324c7c4ca681b0dcaa87338e3290186906d49 +0 -1
  183. package/.angular/cache/21.2.7/ng-packagr/1010cd8fc996d0c2df519ed60085f4b1f38ccfc873900055bc75fc20a3c26bab +0 -1
  184. package/.angular/cache/21.2.7/ng-packagr/12379a8ab7254ad3df2635823a358cfce32e6d0f390be68596cc97e02307e6c4 +0 -1
  185. package/.angular/cache/21.2.7/ng-packagr/1239e7a937657b62f858d17d47738ed30facbdaa91032511e29ed148b748400b +0 -1
  186. package/.angular/cache/21.2.7/ng-packagr/133b9ecf47ba424244902da90d77cd3f135b85f95c01b16de7b2247f57518f01 +0 -1
  187. package/.angular/cache/21.2.7/ng-packagr/175d45dc6da51834e7fe937c09d23dbf28d2a823f838ef5271fd3e148776d6ec +0 -1
  188. package/.angular/cache/21.2.7/ng-packagr/19d99ad4d927324b03cdbef34331ba2c58bd580f1f0ca591cb5f8dbf436c913c +0 -1
  189. package/.angular/cache/21.2.7/ng-packagr/1a86918763f95c1c2b9fa781bda1ceedf15aead87f0e11ea1324318af43a897a +0 -1
  190. package/.angular/cache/21.2.7/ng-packagr/1f08100dbc280be7da64c809315376eb7d0cfd074916a6042f609f03f4276a8e +0 -1
  191. package/.angular/cache/21.2.7/ng-packagr/2224877a7e762b86541428e4c40d61f54f505867c305769ae42e67e4aa81bd93 +0 -1
  192. package/.angular/cache/21.2.7/ng-packagr/24957fb7ec060692ebcf1471e1bdce39f40aed938959e580048ade58015762d2 +0 -1
  193. package/.angular/cache/21.2.7/ng-packagr/295fcdc1c4462e7feae96a24255369508a559faaecc4676267749a7ce23e4b6d +0 -1
  194. package/.angular/cache/21.2.7/ng-packagr/2b37e2f2d6564d10bad1fd0ecc16453962fd855cd1e36ad7aa24baf3e4f2e8b3 +0 -1
  195. package/.angular/cache/21.2.7/ng-packagr/2c20f0929771e857b570ba2beffe91f598f299ce26d4825fe4315bfe5a3dd40a +0 -1
  196. package/.angular/cache/21.2.7/ng-packagr/37dea2e5798cad4a21d66292eeed5be26d04500d9a1534332ad42ce664a058c2 +0 -1
  197. package/.angular/cache/21.2.7/ng-packagr/3b6239b640fcb5ea7067a2655a2901d32f55372812b586aa008e77c59e8f2090 +0 -1
  198. package/.angular/cache/21.2.7/ng-packagr/3beb1b4dfe75d1e6749cf91f05d51ba4eece939f5c15f6f33ed587bfd198f0a3 +0 -1
  199. package/.angular/cache/21.2.7/ng-packagr/3f161e6c2ead4519d0663dd79199dafceb2cc22da7ce92a72b809b93bfce0bb0 +0 -1
  200. package/.angular/cache/21.2.7/ng-packagr/43551862d17cd02626e18b30243390081a6247784485660048b060a3d4ab7fa7 +0 -1
  201. package/.angular/cache/21.2.7/ng-packagr/47aedf032519b41d96866fcf8fbd4f1dfd29f9e9a534b39dee0e44d402227d2d +0 -1
  202. package/.angular/cache/21.2.7/ng-packagr/4a1768888c60921955bfdfba8b31c8d853bd7b2a7d3a7b83934de049e1e6e6a2 +0 -1
  203. package/.angular/cache/21.2.7/ng-packagr/4a783e339117597607bff17eeca0ad24d84b8cbc1e28927e7e453ccfa6223180 +0 -1
  204. package/.angular/cache/21.2.7/ng-packagr/4d9331b2050326f586cd8f6593a9e04e1c7944b2f9e98023649023c099597a5d +0 -1
  205. package/.angular/cache/21.2.7/ng-packagr/4e379f506919d47af7008658c75242aa05f0056c1caec4061d7fa5746f776049 +0 -1
  206. package/.angular/cache/21.2.7/ng-packagr/55009bb7d44552dd816ce32fa2b0f7985f3f08fefd6409c2b4f6b9ffe35dad83 +0 -1
  207. package/.angular/cache/21.2.7/ng-packagr/58ae3f1f9664f7b16844d2e4a279dd4ca9371de014cf5687320c2d5cb259a74f +0 -1
  208. package/.angular/cache/21.2.7/ng-packagr/5c08e906bd3fe1aa6c1d62f2bbb2b3f276e1c17fe45ef081e76bd1b865ac3dfa +0 -1
  209. package/.angular/cache/21.2.7/ng-packagr/5ce333a40ad635188347fa9bc601d5fd14be6baacbae7d096259d725ac9757af +0 -1
  210. package/.angular/cache/21.2.7/ng-packagr/5f32cceaee6a6ea19cc6cbff5ea089b752f13a0fdcd32597d4c99d5e1e031bb5 +0 -1
  211. package/.angular/cache/21.2.7/ng-packagr/691ad4ccdc0a8ede36e1f4e5e97638c20c2d3142916ffac3a1b172178c139205 +0 -1
  212. package/.angular/cache/21.2.7/ng-packagr/6b57160e0d2da3f31693831e84a3f4209c1f33a04abd636e34af03956e7329d8 +0 -1
  213. package/.angular/cache/21.2.7/ng-packagr/70bc711a1d7b631845885c26adc2d6b1bff47d11332b2625cedfa11e9d5ac79a +0 -1
  214. package/.angular/cache/21.2.7/ng-packagr/7427c266237012afaef486c2af94ee08a491e8d7b6fc7e5ee887980830bbd333 +0 -1
  215. package/.angular/cache/21.2.7/ng-packagr/7e8fa7c61cf9a932ba3a0e65eb73c7412e81666b7a8f923dac7b75acfbb94b1d +0 -1
  216. package/.angular/cache/21.2.7/ng-packagr/81aab7fdab43cbdfa869db759d6113ae01ec6f5e0e9061d7fc089c260886e4d1 +0 -1
  217. package/.angular/cache/21.2.7/ng-packagr/83a81758045ff710a34ea3cf6f54435a1f5dea9839d8c0adda0bbce7c3fb6e8b +0 -1
  218. package/.angular/cache/21.2.7/ng-packagr/883eae810a4c09f06617bdc2e4bc30a69f09726401b2a051840969f635d076f1 +0 -1
  219. package/.angular/cache/21.2.7/ng-packagr/8a6b9be66de40c57054dca5fde376c3cec1bec1ae191a16f1ae6a83306d9ebfe +0 -1
  220. package/.angular/cache/21.2.7/ng-packagr/8d42c8144f6929de46984094bf390a0c4168404ab13a5194839f6ba5e42bc3ce +0 -1
  221. package/.angular/cache/21.2.7/ng-packagr/91093656c61a5404f0d576f872247eeb480dd938e6999d481a97893c72b5f3d0 +0 -1
  222. package/.angular/cache/21.2.7/ng-packagr/91e881172037c63d819e30d30e390e0d7dc0dee9808b3902275ccc8b1887d864 +0 -1
  223. package/.angular/cache/21.2.7/ng-packagr/9ef28cf3a676e7bd0d37762c4868b4810efca2f241ed0dae75ebca41988e2c00 +0 -1
  224. package/.angular/cache/21.2.7/ng-packagr/a07cbea405c1831b3f686a8e57c4b500d89cbab2b95e110487890269945feeaa +0 -1
  225. package/.angular/cache/21.2.7/ng-packagr/a463deba940880d9461612c9cd00d90062bf97aa31b1c4556b8b47a967cb6882 +0 -1
  226. package/.angular/cache/21.2.7/ng-packagr/ab03ed1e4a371113b41b663d526d2b06565ceb062e6f033f726f1e455fc5d1d6 +0 -1
  227. package/.angular/cache/21.2.7/ng-packagr/ad0e84be4f2211aff6187b4bec9adbe15f0e8b36851e9c6c63b38303c2daad37 +0 -1
  228. package/.angular/cache/21.2.7/ng-packagr/aece79242dae70eb748605e37483e75e122e4ce414fa8be875499e8af26ee5d6 +0 -1
  229. package/.angular/cache/21.2.7/ng-packagr/aff32db91ce03de30d2bbc84f266fe3fb2c6629d5eeb39a364204d9499484368 +0 -1
  230. package/.angular/cache/21.2.7/ng-packagr/b0671e73a162927d28ef1742ec008e514264bc2ce29f2255bedaea553492fe5d +0 -1
  231. package/.angular/cache/21.2.7/ng-packagr/bb50d71f3cdeebbb85fd983be8103f9c216060464f8e7e534271197391e6dcf7 +0 -1
  232. package/.angular/cache/21.2.7/ng-packagr/c64241290ab30d8761b2f5493a039427f5cda1a48b5be88ce62ee5c714c0f690 +0 -1
  233. package/.angular/cache/21.2.7/ng-packagr/c794d2e79b26ab378c0dbf8afa7b8ac1337ba9afb288941d44a086cb1bd4bad2 +0 -1
  234. package/.angular/cache/21.2.7/ng-packagr/d942edf8fd8e8e884138ffcdb1a07ad14a0b5e211f8ccea1dc9ea0b48f50cfc9 +0 -1
  235. package/.angular/cache/21.2.7/ng-packagr/dbe0b9b9f18ba7b96d9c84f4fd16cde158c9701c202d00113e6f88ba93407bce +0 -1
  236. package/.angular/cache/21.2.7/ng-packagr/f564395a410a2723aac48e582f5fe416bfeaa48677cea47b10c5152d4f2b6672 +0 -1
  237. package/.angular/cache/21.2.7/ng-packagr/fc9b0d27f081ca7b2a4cbefa75136d7bd7a8c341dbaa0587855071a6003906b8 +0 -1
  238. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar-text.tsbuildinfo +0 -1
  239. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar.tsbuildinfo +0 -1
  240. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-breadcrumb.tsbuildinfo +0 -1
  241. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-business-fields.tsbuildinfo +0 -1
  242. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button-group.tsbuildinfo +0 -1
  243. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button.tsbuildinfo +0 -1
  244. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-card.tsbuildinfo +0 -1
  245. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-checkbox-field.tsbuildinfo +0 -1
  246. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-chip.tsbuildinfo +0 -1
  247. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page-menu.tsbuildinfo +0 -1
  248. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page.tsbuildinfo +0 -1
  249. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-color-picker-field.tsbuildinfo +0 -1
  250. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-confirmation.tsbuildinfo +0 -1
  251. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-date-field.tsbuildinfo +0 -1
  252. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dialog.tsbuildinfo +0 -1
  253. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-drawer.tsbuildinfo +0 -1
  254. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dynamic-drawer.tsbuildinfo +0 -1
  255. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-editor-field.tsbuildinfo +0 -1
  256. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-empty-state.tsbuildinfo +0 -1
  257. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-entities.tsbuildinfo +0 -1
  258. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-field-validation.tsbuildinfo +0 -1
  259. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-formula.tsbuildinfo +0 -1
  260. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-icon-field.tsbuildinfo +0 -1
  261. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-list.tsbuildinfo +0 -1
  262. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-location-field.tsbuildinfo +0 -1
  263. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-menu.tsbuildinfo +0 -1
  264. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-modal.tsbuildinfo +0 -1
  265. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-module-summary-card.tsbuildinfo +0 -1
  266. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-multi-select-field.tsbuildinfo +0 -1
  267. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-number-field.tsbuildinfo +0 -1
  268. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page-header.tsbuildinfo +0 -1
  269. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page.tsbuildinfo +0 -1
  270. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-paginator.tsbuildinfo +0 -1
  271. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-pick-list-field.tsbuildinfo +0 -1
  272. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-progress.tsbuildinfo +0 -1
  273. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-property-filter-builder.tsbuildinfo +0 -1
  274. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-button-field.tsbuildinfo +0 -1
  275. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards-field.tsbuildinfo +0 -1
  276. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards.tsbuildinfo +0 -1
  277. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-runtime-action.tsbuildinfo +0 -1
  278. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-select-field.tsbuildinfo +0 -1
  279. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-sidebar.tsbuildinfo +0 -1
  280. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-slider-field.tsbuildinfo +0 -1
  281. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-statistic-card.tsbuildinfo +0 -1
  282. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-table.tsbuildinfo +0 -1
  283. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tabs.tsbuildinfo +0 -1
  284. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-text-field.tsbuildinfo +0 -1
  285. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-textarea-field.tsbuildinfo +0 -1
  286. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toast.tsbuildinfo +0 -1
  287. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toggle-field.tsbuildinfo +0 -1
  288. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tooltip.tsbuildinfo +0 -1
  289. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-topbar.tsbuildinfo +0 -1
  290. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tree.tsbuildinfo +0 -1
  291. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-treeselect-field.tsbuildinfo +0 -1
  292. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-upload-field.tsbuildinfo +0 -1
  293. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-uploader.tsbuildinfo +0 -1
  294. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-user-search-field.tsbuildinfo +0 -1
  295. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components.tsbuildinfo +0 -1
  296. package/angular.json +0 -32
  297. package/api/api.ts +0 -1
  298. package/api/public-api.ts +0 -5
  299. package/avatar/avatar.html +0 -32
  300. package/avatar/avatar.scss +0 -0
  301. package/avatar/avatar.ts +0 -54
  302. package/avatar/ng-package.json +0 -6
  303. package/avatar/public-api.ts +0 -1
  304. package/avatar-text/avatar-text.html +0 -26
  305. package/avatar-text/avatar-text.scss +0 -0
  306. package/avatar-text/avatar-text.ts +0 -52
  307. package/avatar-text/ng-package.json +0 -6
  308. package/avatar-text/public-api.ts +0 -1
  309. package/breadcrumb/breadcrumb.html +0 -53
  310. package/breadcrumb/breadcrumb.scss +0 -0
  311. package/breadcrumb/breadcrumb.ts +0 -26
  312. package/breadcrumb/ng-package.json +0 -6
  313. package/breadcrumb/public-api.ts +0 -1
  314. package/business-fields/entity-list-field/entity-list-add-token.ts +0 -25
  315. package/business-fields/entity-list-field/entity-list-field.html +0 -70
  316. package/business-fields/entity-list-field/entity-list-field.scss +0 -3
  317. package/business-fields/entity-list-field/entity-list-field.ts +0 -1067
  318. package/business-fields/lookup-matrix-field/lookup-matrix-field.html +0 -38
  319. package/business-fields/lookup-matrix-field/lookup-matrix-field.spec.ts +0 -183
  320. package/business-fields/lookup-matrix-field/lookup-matrix-field.ts +0 -239
  321. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.html +0 -95
  322. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.ts +0 -336
  323. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-form-token.ts +0 -42
  324. package/business-fields/ng-package.json +0 -6
  325. package/business-fields/public-api.ts +0 -8
  326. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.html +0 -32
  327. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.ts +0 -272
  328. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.html +0 -89
  329. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.ts +0 -441
  330. package/business-fields/schema-connection-field/schema-connection-field.html +0 -58
  331. package/business-fields/schema-connection-field/schema-connection-field.scss +0 -0
  332. package/business-fields/schema-connection-field/schema-connection-field.ts +0 -456
  333. package/button/button.html +0 -44
  334. package/button/button.scss +0 -0
  335. package/button/button.ts +0 -120
  336. package/button/ng-package.json +0 -6
  337. package/button/public-api.ts +0 -1
  338. package/button-group/button-group.html +0 -3
  339. package/button-group/button-group.scss +0 -20
  340. package/button-group/button-group.ts +0 -12
  341. package/button-group/ng-package.json +0 -6
  342. package/button-group/public-api.ts +0 -1
  343. package/card/card.html +0 -26
  344. package/card/card.scss +0 -0
  345. package/card/card.ts +0 -29
  346. package/card/ng-package.json +0 -6
  347. package/card/public-api.ts +0 -1
  348. package/checkbox-field/checkbox-field.html +0 -31
  349. package/checkbox-field/checkbox-field.scss +0 -0
  350. package/checkbox-field/checkbox-field.spec.ts +0 -21
  351. package/checkbox-field/checkbox-field.ts +0 -123
  352. package/checkbox-field/ng-package.json +0 -6
  353. package/checkbox-field/public-api.ts +0 -1
  354. package/chip/chip.html +0 -16
  355. package/chip/chip.scss +0 -19
  356. package/chip/chip.ts +0 -45
  357. package/chip/ng-package.json +0 -6
  358. package/chip/public-api.ts +0 -1
  359. package/client-page/client-page.html +0 -232
  360. package/client-page/client-page.ts +0 -588
  361. package/client-page/index.ts +0 -2
  362. package/client-page/ng-package.json +0 -6
  363. package/client-page/public-api.ts +0 -1
  364. package/client-page-menu/client-page-menu.html +0 -142
  365. package/client-page-menu/client-page-menu.ts +0 -199
  366. package/client-page-menu/index.ts +0 -2
  367. package/client-page-menu/ng-package.json +0 -6
  368. package/client-page-menu/public-api.ts +0 -1
  369. package/color-picker-field/color-picker-field.html +0 -45
  370. package/color-picker-field/color-picker-field.scss +0 -52
  371. package/color-picker-field/color-picker-field.ts +0 -131
  372. package/color-picker-field/ng-package.json +0 -6
  373. package/color-picker-field/public-api.ts +0 -1
  374. package/confirmation/confirmation-dialog.html +0 -83
  375. package/confirmation/confirmation-dialog.scss +0 -0
  376. package/confirmation/confirmation-dialog.ts +0 -15
  377. package/confirmation/confirmation.spec.ts +0 -43
  378. package/confirmation/confirmation.ts +0 -103
  379. package/confirmation/ng-package.json +0 -6
  380. package/confirmation/public-api.ts +0 -2
  381. package/date-field/date-field.html +0 -65
  382. package/date-field/date-field.scss +0 -0
  383. package/date-field/date-field.spec.ts +0 -118
  384. package/date-field/date-field.ts +0 -196
  385. package/date-field/ng-package.json +0 -6
  386. package/date-field/public-api.ts +0 -1
  387. package/dialog/dialog.ts +0 -29
  388. package/dialog/ng-package.json +0 -6
  389. package/dialog/public-api.ts +0 -1
  390. package/drawer/drawer.html +0 -67
  391. package/drawer/drawer.scss +0 -1
  392. package/drawer/drawer.ts +0 -348
  393. package/drawer/ng-package.json +0 -5
  394. package/drawer/public-api.ts +0 -1
  395. package/dynamic-drawer/dynamic-drawer-host.ts +0 -476
  396. package/dynamic-drawer/dynamic-drawer.spec.ts +0 -204
  397. package/dynamic-drawer/dynamic-drawer.ts +0 -235
  398. package/dynamic-drawer/ng-package.json +0 -6
  399. package/dynamic-drawer/public-api.ts +0 -2
  400. package/editor-field/editor-field.html +0 -38
  401. package/editor-field/editor-field.scss +0 -219
  402. package/editor-field/editor-field.ts +0 -126
  403. package/editor-field/ng-package.json +0 -6
  404. package/editor-field/public-api.ts +0 -1
  405. package/empty-state/empty-state.html +0 -236
  406. package/empty-state/empty-state.ts +0 -85
  407. package/empty-state/ng-package.json +0 -6
  408. package/empty-state/public-api.ts +0 -1
  409. package/entities/comparison/comparison-entity-list/comparison-entity-list.html +0 -87
  410. package/entities/comparison/comparison-entity-list/comparison-entity-list.ts +0 -93
  411. package/entities/comparison/comparison-value/comparison-value.html +0 -31
  412. package/entities/comparison/comparison-value/comparison-value.ts +0 -53
  413. package/entities/currency-display.utils.spec.ts +0 -94
  414. package/entities/currency-display.utils.ts +0 -92
  415. package/entities/entities-manage/entities-manage.html +0 -74
  416. package/entities/entities-manage/entities-manage.scss +0 -72
  417. package/entities/entities-manage/entities-manage.ts +0 -121
  418. package/entities/entities-manage/entities-resize-base.ts +0 -153
  419. package/entities/entities-preview/entities-preview.css +0 -77
  420. package/entities/entities-preview/entities-preview.html +0 -56
  421. package/entities/entities-preview/entities-preview.ts +0 -281
  422. package/entities/entity-attachment/entity-attachment.html +0 -49
  423. package/entities/entity-attachment/entity-attachment.ts +0 -462
  424. package/entities/entity-checkbox/entity-checkbox.html +0 -28
  425. package/entities/entity-checkbox/entity-checkbox.ts +0 -65
  426. package/entities/entity-comparison.model.ts +0 -39
  427. package/entities/entity-connection/entity-connection.html +0 -12
  428. package/entities/entity-connection/entity-connection.ts +0 -75
  429. package/entities/entity-currency/entity-currency.html +0 -12
  430. package/entities/entity-currency/entity-currency.ts +0 -59
  431. package/entities/entity-date/entity-date.html +0 -16
  432. package/entities/entity-date/entity-date.ts +0 -50
  433. package/entities/entity-display.utils.ts +0 -94
  434. package/entities/entity-field/entity-field.ts +0 -94
  435. package/entities/entity-leaf-details/entity-leaf-details.html +0 -35
  436. package/entities/entity-leaf-details/entity-leaf-details.ts +0 -56
  437. package/entities/entity-location/entity-location.html +0 -34
  438. package/entities/entity-location/entity-location.ts +0 -98
  439. package/entities/entity-long-text/entity-long-text.html +0 -9
  440. package/entities/entity-long-text/entity-long-text.ts +0 -45
  441. package/entities/entity-lookup/entity-lookup.html +0 -25
  442. package/entities/entity-lookup/entity-lookup.ts +0 -68
  443. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html +0 -39
  444. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.spec.ts +0 -148
  445. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts +0 -152
  446. package/entities/entity-percentage/entity-percentage.html +0 -22
  447. package/entities/entity-percentage/entity-percentage.ts +0 -163
  448. package/entities/entity-phase-gate/entity-phase-gate.html +0 -20
  449. package/entities/entity-phase-gate/entity-phase-gate.ts +0 -129
  450. package/entities/entity-preview/entity-preview-body.html +0 -8
  451. package/entities/entity-preview/entity-preview-body.ts +0 -19
  452. package/entities/entity-preview/entity-preview.html +0 -14
  453. package/entities/entity-preview/entity-preview.ts +0 -33
  454. package/entities/entity-preview/entity-value-preview.html +0 -62
  455. package/entities/entity-preview/entity-value-preview.spec.ts +0 -191
  456. package/entities/entity-preview/entity-value-preview.ts +0 -69
  457. package/entities/entity-schedule-item/entity-schedule-item.html +0 -19
  458. package/entities/entity-schedule-item/entity-schedule-item.ts +0 -41
  459. package/entities/entity-sections.util.ts +0 -103
  460. package/entities/entity-status/entity-status.html +0 -20
  461. package/entities/entity-status/entity-status.ts +0 -60
  462. package/entities/entity-text/entity-text.html +0 -20
  463. package/entities/entity-text/entity-text.ts +0 -35
  464. package/entities/entity-user/entity-user.html +0 -181
  465. package/entities/entity-user/entity-user.ts +0 -179
  466. package/entities/entity.model.ts +0 -407
  467. package/entities/leaf-details-display.utils.ts +0 -269
  468. package/entities/ng-package.json +0 -6
  469. package/entities/percentage-color.utils.spec.ts +0 -94
  470. package/entities/percentage-color.utils.ts +0 -80
  471. package/entities/public-api.ts +0 -30
  472. package/field-validation/character-limit.validator.ts +0 -22
  473. package/field-validation/error-message.pipe.spec.ts +0 -184
  474. package/field-validation/error-message.pipe.ts +0 -80
  475. package/field-validation/field-validation.ts +0 -168
  476. package/field-validation/ng-package.json +0 -6
  477. package/field-validation/public-api.ts +0 -2
  478. package/formula/formula-editor/formula-editor.html +0 -89
  479. package/formula/formula-editor/formula-editor.scss +0 -25
  480. package/formula/formula-editor/formula-editor.ts +0 -467
  481. package/formula/formula-editor/index.ts +0 -1
  482. package/formula/formula-editor-code/formula-autocomplete-normalization.util.spec.ts +0 -58
  483. package/formula/formula-editor-code/formula-autocomplete-normalization.util.ts +0 -64
  484. package/formula/formula-editor-code/formula-completion-range.util.spec.ts +0 -62
  485. package/formula/formula-editor-code/formula-completion-range.util.ts +0 -71
  486. package/formula/formula-editor-code/formula-completion-suggestion.util.spec.ts +0 -23
  487. package/formula/formula-editor-code/formula-completion-suggestion.util.ts +0 -18
  488. package/formula/formula-editor-code/formula-editor-code.html +0 -15
  489. package/formula/formula-editor-code/formula-editor-code.scss +0 -90
  490. package/formula/formula-editor-code/formula-editor-code.ts +0 -1095
  491. package/formula/formula-editor-code/index.ts +0 -1
  492. package/formula/formula-status-bar/formula-status-bar.html +0 -119
  493. package/formula/formula-status-bar/formula-status-bar.ts +0 -66
  494. package/formula/formula-status-bar/index.ts +0 -1
  495. package/formula/formula-toolbar/formula-toolbar.html +0 -361
  496. package/formula/formula-toolbar/formula-toolbar.ts +0 -532
  497. package/formula/formula-toolbar/index.ts +0 -2
  498. package/formula/formula-toolbar/operators.ts +0 -122
  499. package/formula/models/formula-block.model.ts +0 -61
  500. package/formula/models/formula-token.model.spec.ts +0 -57
  501. package/formula/models/formula-token.model.ts +0 -852
  502. package/formula/models/index.ts +0 -5
  503. package/formula/models/smart-block.model.ts +0 -132
  504. package/formula/models/validation-result.model.ts +0 -80
  505. package/formula/ng-package.json +0 -6
  506. package/formula/public-api.ts +0 -8
  507. package/formula/runtime/formula-runtime-catalogs.ts +0 -554
  508. package/formula/runtime/formula-runtime-engine.spec.ts +0 -328
  509. package/formula/runtime/formula-runtime-engine.ts +0 -794
  510. package/formula/runtime/formula-runtime.model.ts +0 -53
  511. package/formula/runtime/index.ts +0 -3
  512. package/formula/toolbar-item/index.ts +0 -1
  513. package/formula/toolbar-item/toolbar-item.html +0 -143
  514. package/formula/toolbar-item/toolbar-item.scss +0 -14
  515. package/formula/toolbar-item/toolbar-item.ts +0 -223
  516. package/icon-field/icon-field.html +0 -58
  517. package/icon-field/icon-field.scss +0 -24
  518. package/icon-field/icon-field.spec.ts +0 -77
  519. package/icon-field/icon-field.ts +0 -205
  520. package/icon-field/ng-package.json +0 -6
  521. package/icon-field/public-api.ts +0 -1
  522. package/list/list.html +0 -22
  523. package/list/list.ts +0 -36
  524. package/list/ng-package.json +0 -6
  525. package/list/public-api.ts +0 -1
  526. package/location-field/location-field.html +0 -86
  527. package/location-field/location-field.spec.ts +0 -295
  528. package/location-field/location-field.ts +0 -662
  529. package/location-field/location-manual-dialog.html +0 -43
  530. package/location-field/location-manual-dialog.ts +0 -104
  531. package/location-field/location-value.ts +0 -67
  532. package/location-field/ng-package.json +0 -6
  533. package/location-field/public-api.ts +0 -3
  534. package/menu/menu.html +0 -71
  535. package/menu/menu.scss +0 -3
  536. package/menu/menu.ts +0 -186
  537. package/menu/ng-package.json +0 -6
  538. package/menu/public-api.ts +0 -1
  539. package/modal/modal.ts +0 -127
  540. package/modal/ng-package.json +0 -6
  541. package/modal/public-api.ts +0 -1
  542. package/module-summary-card/module-summary-card.html +0 -43
  543. package/module-summary-card/module-summary-card.scss +0 -0
  544. package/module-summary-card/module-summary-card.ts +0 -40
  545. package/module-summary-card/ng-package.json +0 -6
  546. package/module-summary-card/public-api.ts +0 -1
  547. package/multi-select-field/multi-select-field.html +0 -140
  548. package/multi-select-field/multi-select-field.scss +0 -0
  549. package/multi-select-field/multi-select-field.spec.ts +0 -21
  550. package/multi-select-field/multi-select-field.ts +0 -397
  551. package/multi-select-field/ng-package.json +0 -6
  552. package/multi-select-field/public-api.ts +0 -1
  553. package/ng-package.json +0 -9
  554. package/number-field/ng-package.json +0 -6
  555. package/number-field/number-field.html +0 -39
  556. package/number-field/number-field.scss +0 -8
  557. package/number-field/number-field.spec.ts +0 -21
  558. package/number-field/number-field.ts +0 -124
  559. package/number-field/public-api.ts +0 -1
  560. package/page/index.ts +0 -1
  561. package/page/ng-package.json +0 -6
  562. package/page/page.html +0 -37
  563. package/page/page.ts +0 -43
  564. package/page/public-api.ts +0 -1
  565. package/page-header/index.ts +0 -2
  566. package/page-header/ng-package.json +0 -6
  567. package/page-header/page-header.html +0 -60
  568. package/page-header/page-header.ts +0 -54
  569. package/page-header/public-api.ts +0 -1
  570. package/paginator/ng-package.json +0 -6
  571. package/paginator/paginator.html +0 -50
  572. package/paginator/paginator.scss +0 -0
  573. package/paginator/paginator.ts +0 -53
  574. package/paginator/public-api.ts +0 -1
  575. package/pick-list-field/ng-package.json +0 -6
  576. package/pick-list-field/pick-list-field.html +0 -39
  577. package/pick-list-field/pick-list-field.scss +0 -26
  578. package/pick-list-field/pick-list-field.ts +0 -259
  579. package/pick-list-field/public-api.ts +0 -1
  580. package/progress/ng-package.json +0 -6
  581. package/progress/progress.html +0 -36
  582. package/progress/progress.ts +0 -61
  583. package/progress/public-api.ts +0 -1
  584. package/property-filter-builder/ng-package.json +0 -6
  585. package/property-filter-builder/property-filter-builder.html +0 -192
  586. package/property-filter-builder/property-filter-builder.ts +0 -548
  587. package/property-filter-builder/public-api.ts +0 -1
  588. package/radio-button-field/ng-package.json +0 -6
  589. package/radio-button-field/public-api.ts +0 -1
  590. package/radio-button-field/radio-button-field.html +0 -44
  591. package/radio-button-field/radio-button-field.scss +0 -0
  592. package/radio-button-field/radio-button-field.ts +0 -114
  593. package/radio-cards/ng-package.json +0 -6
  594. package/radio-cards/public-api.ts +0 -1
  595. package/radio-cards/radio-cards.css +0 -3
  596. package/radio-cards/radio-cards.html +0 -54
  597. package/radio-cards/radio-cards.spec.ts +0 -22
  598. package/radio-cards/radio-cards.ts +0 -92
  599. package/radio-cards-field/ng-package.json +0 -6
  600. package/radio-cards-field/public-api.ts +0 -1
  601. package/radio-cards-field/radio-cards-field.css +0 -0
  602. package/radio-cards-field/radio-cards-field.html +0 -38
  603. package/radio-cards-field/radio-cards-field.spec.ts +0 -22
  604. package/radio-cards-field/radio-cards-field.ts +0 -182
  605. package/runtime-action/ng-package.json +0 -6
  606. package/runtime-action/payload-builder.ts +0 -246
  607. package/runtime-action/public-api.ts +0 -4
  608. package/runtime-action/runtime-action-context.store.ts +0 -26
  609. package/runtime-action/runtime-action.runner.ts +0 -302
  610. package/runtime-action/runtime-action.types.ts +0 -82
  611. package/select-field/current-user.util.ts +0 -54
  612. package/select-field/ng-package.json +0 -6
  613. package/select-field/public-api.ts +0 -1
  614. package/select-field/select-field.html +0 -142
  615. package/select-field/select-field.scss +0 -0
  616. package/select-field/select-field.spec.ts +0 -21
  617. package/select-field/select-field.ts +0 -471
  618. package/sidebar/ng-package.json +0 -6
  619. package/sidebar/public-api.ts +0 -1
  620. package/sidebar/sidebar.html +0 -368
  621. package/sidebar/sidebar.ts +0 -303
  622. package/slider-field/ng-package.json +0 -7
  623. package/slider-field/public-api.ts +0 -1
  624. package/slider-field/slider-field.html +0 -33
  625. package/slider-field/slider-field.scss +0 -11
  626. package/slider-field/slider-field.spec.ts +0 -44
  627. package/slider-field/slider-field.ts +0 -166
  628. package/src/lib/base/base.facade.ts +0 -159
  629. package/src/lib/base/crud-base.state.ts +0 -248
  630. package/src/lib/config/date-format.config.ts +0 -55
  631. package/src/lib/config/ds-identity.preset.ts +0 -538
  632. package/src/lib/config/ds-identity.tokens.ts +0 -209
  633. package/src/lib/config/dynamic-form.model.ts +0 -1162
  634. package/src/lib/config/povide-messages.ts +0 -5
  635. package/src/lib/config/provide-confirmation.ts +0 -5
  636. package/src/lib/config/providemt.ts +0 -506
  637. package/src/lib/config/public-api.ts +0 -0
  638. package/src/lib/pipes/mt-date-format.pipe.spec.ts +0 -60
  639. package/src/lib/pipes/mt-date-format.pipe.ts +0 -81
  640. package/src/lib/utils/api-request.helper.ts +0 -59
  641. package/src/lib/utils/clock-time.util.ts +0 -58
  642. package/src/lib/utils/color.utils.ts +0 -187
  643. package/src/lib/utils/entity-adapter.ts +0 -50
  644. package/src/lib/utils/field-id.ts +0 -42
  645. package/src/lib/utils/http-context.ts +0 -35
  646. package/src/lib/utils/inputs.ts +0 -6
  647. package/src/lib/utils/state-helpers.ts +0 -49
  648. package/src/lib/utils/theme.ts +0 -281
  649. package/src/public-api.ts +0 -30
  650. package/statistic-card/ng-package.json +0 -6
  651. package/statistic-card/public-api.ts +0 -1
  652. package/statistic-card/statistic-card.html +0 -31
  653. package/statistic-card/statistic-card.scss +0 -0
  654. package/statistic-card/statistic-card.ts +0 -59
  655. package/table/ng-package.json +0 -7
  656. package/table/public-api.ts +0 -10
  657. package/table/table-actions-menu/public-api.ts +0 -1
  658. package/table/table-actions-menu/table-actions-menu.html +0 -75
  659. package/table/table-actions-menu/table-actions-menu.ts +0 -171
  660. package/table/table-caption/public-api.ts +0 -1
  661. package/table/table-caption/table-caption.html +0 -118
  662. package/table/table-caption/table-caption.ts +0 -221
  663. package/table/table-column-filter/public-api.ts +0 -1
  664. package/table/table-column-filter/table-column-filter.html +0 -44
  665. package/table/table-column-filter/table-column-filter.ts +0 -106
  666. package/table/table-export/html-to-text.util.ts +0 -67
  667. package/table/table-export/public-api.ts +0 -1
  668. package/table/table-export/table-export.service.spec.ts +0 -186
  669. package/table/table-export/table-export.service.ts +0 -325
  670. package/table/table-filter/public-api.ts +0 -1
  671. package/table/table-filter/table-filter.css +0 -9
  672. package/table/table-filter/table-filter.html +0 -63
  673. package/table/table-filter/table-filter.ts +0 -126
  674. package/table/table-filter-field/public-api.ts +0 -1
  675. package/table/table-filter-field/table-filter-field.html +0 -182
  676. package/table/table-filter-field/table-filter-field.ts +0 -208
  677. package/table/table-grouping/public-api.ts +0 -1
  678. package/table/table-grouping/table-grouping.spec.ts +0 -218
  679. package/table/table-grouping/table-grouping.ts +0 -237
  680. package/table/table-types.ts +0 -242
  681. package/table/table-value.utils.spec.ts +0 -63
  682. package/table/table-value.utils.ts +0 -1014
  683. package/table/table.css +0 -145
  684. package/table/table.html +0 -572
  685. package/table/table.ts +0 -2042
  686. package/tabs/ng-package.json +0 -6
  687. package/tabs/public-api.ts +0 -1
  688. package/tabs/tabs.html +0 -417
  689. package/tabs/tabs.scss +0 -3
  690. package/tabs/tabs.spec.ts +0 -79
  691. package/tabs/tabs.ts +0 -397
  692. package/text-field/ng-package.json +0 -6
  693. package/text-field/public-api.ts +0 -1
  694. package/text-field/text-field.html +0 -75
  695. package/text-field/text-field.scss +0 -56
  696. package/text-field/text-field.ts +0 -251
  697. package/textarea-field/ng-package.json +0 -6
  698. package/textarea-field/public-api.ts +0 -1
  699. package/textarea-field/textarea-field.html +0 -37
  700. package/textarea-field/textarea-field.scss +0 -0
  701. package/textarea-field/textarea-field.spec.ts +0 -21
  702. package/textarea-field/textarea-field.ts +0 -169
  703. package/toast/ng-package.json +0 -6
  704. package/toast/public-api.ts +0 -2
  705. package/toast/toast.html +0 -18
  706. package/toast/toast.service.ts +0 -67
  707. package/toast/toast.ts +0 -21
  708. package/toggle-field/ng-package.json +0 -6
  709. package/toggle-field/public-api.ts +0 -1
  710. package/toggle-field/toggle-field.html +0 -78
  711. package/toggle-field/toggle-field.scss +0 -24
  712. package/toggle-field/toggle-field.ts +0 -150
  713. package/tooltip/ng-package.json +0 -6
  714. package/tooltip/public-api.ts +0 -2
  715. package/tooltip/tooltip.ts +0 -30
  716. package/tooltip/truncate-tooltip.ts +0 -124
  717. package/topbar/ng-package.json +0 -6
  718. package/topbar/public-api.ts +0 -1
  719. package/topbar/topbar.html +0 -52
  720. package/topbar/topbar.ts +0 -27
  721. package/tree/ng-package.json +0 -6
  722. package/tree/public-api.ts +0 -2
  723. package/tree/tree-types.ts +0 -55
  724. package/tree/tree.html +0 -126
  725. package/tree/tree.scss +0 -1
  726. package/tree/tree.ts +0 -303
  727. package/treeselect-field/ng-package.json +0 -6
  728. package/treeselect-field/public-api.ts +0 -1
  729. package/treeselect-field/treeselect-field.html +0 -71
  730. package/treeselect-field/treeselect-field.ts +0 -348
  731. package/tsconfig.check.json +0 -20
  732. package/tsconfig.json +0 -16
  733. package/tsconfig.spec.json +0 -24
  734. package/upload-field/ng-package.json +0 -6
  735. package/upload-field/public-api.ts +0 -2
  736. package/upload-field/secure-image.pipe.ts +0 -258
  737. package/upload-field/upload-field.html +0 -274
  738. package/upload-field/upload-field.scss +0 -0
  739. package/upload-field/upload-field.spec.ts +0 -169
  740. package/upload-field/upload-field.ts +0 -764
  741. package/upload-field/upload-file-preview/upload-file-preview.html +0 -41
  742. package/upload-field/upload-file-preview/upload-file-preview.scss +0 -0
  743. package/upload-field/upload-file-preview/upload-file-preview.ts +0 -57
  744. package/upload-field/upload-user-preview/upload-user-preview.css +0 -0
  745. package/upload-field/upload-user-preview/upload-user-preview.html +0 -73
  746. package/upload-field/upload-user-preview/upload-user-preview.ts +0 -54
  747. package/uploader/ng-package.json +0 -6
  748. package/uploader/public-api.ts +0 -1
  749. package/uploader/uploader.service.spec.ts +0 -271
  750. package/uploader/uploader.service.ts +0 -733
  751. package/user-search-field/ng-package.json +0 -6
  752. package/user-search-field/public-api.ts +0 -1
  753. package/user-search-field/user-search-field.html +0 -88
  754. package/user-search-field/user-search-field.scss +0 -4
  755. package/user-search-field/user-search-field.spec.ts +0 -176
  756. package/user-search-field/user-search-field.ts +0 -483
@@ -0,0 +1,1907 @@
1
+ import { CommonModule, NgComponentOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, inject, DestroyRef, signal, computed, ChangeDetectionStrategy, Component, effect, untracked, viewChild, linkedSignal, InjectionToken } from '@angular/core';
4
+ import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
5
+ import * as i1 from '@angular/forms';
6
+ import { ControlContainer, NgControl, FormsModule, Validators } from '@angular/forms';
7
+ import * as i2 from '@jsverse/transloco';
8
+ import { TranslocoService, TranslocoModule, TranslocoPipe } from '@jsverse/transloco';
9
+ import { startWith, finalize, catchError, of, take, expand, EMPTY, reduce, map } from 'rxjs';
10
+ import { Tooltip } from '@masterteam/components/tooltip';
11
+ import { Icon } from '@masterteam/icons';
12
+ import { SelectField } from '@masterteam/components/select-field';
13
+ import { MultiSelectField } from '@masterteam/components/multi-select-field';
14
+ import { FieldValidation } from '@masterteam/components/field-validation';
15
+ import { HttpClient, HttpParams } from '@angular/common/http';
16
+ import { Button } from '@masterteam/components/button';
17
+ import { NumberField } from '@masterteam/components/number-field';
18
+ import { Table } from '@masterteam/components/table';
19
+ import { nextFieldId, resolveFieldId } from '@masterteam/components';
20
+ import { Skeleton } from 'primeng/skeleton';
21
+ import { Message } from 'primeng/message';
22
+ import { ModalService } from '@masterteam/components/modal';
23
+ import * as i2$1 from 'primeng/inputtext';
24
+ import { InputTextModule } from 'primeng/inputtext';
25
+
26
+ class LookupMatrixField {
27
+ config = input.required(...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
28
+ controlContainer = inject(ControlContainer, {
29
+ optional: true,
30
+ });
31
+ destroyRef = inject(DestroyRef);
32
+ transloco = inject(TranslocoService);
33
+ valueVersion = signal(0, ...(ngDevMode ? [{ debugName: "valueVersion" }] : /* istanbul ignore next */ []));
34
+ subscribedControl = null;
35
+ hasYAxis = computed(() => !!this.config().yFieldKey, ...(ngDevMode ? [{ debugName: "hasYAxis" }] : /* istanbul ignore next */ []));
36
+ xOptions = computed(() => this.config().xOptions ?? [], ...(ngDevMode ? [{ debugName: "xOptions" }] : /* istanbul ignore next */ []));
37
+ yOptions = computed(() => this.config().yOptions ?? [], ...(ngDevMode ? [{ debugName: "yOptions" }] : /* istanbul ignore next */ []));
38
+ hasMatrix = computed(() => this.config().cells.length > 0, ...(ngDevMode ? [{ debugName: "hasMatrix" }] : /* istanbul ignore next */ []));
39
+ cellMap = computed(() => new Map(this.config().cells.map((cell) => [
40
+ this.cellKey(cell.xLookupItemId, cell.yLookupItemId),
41
+ cell,
42
+ ])), ...(ngDevMode ? [{ debugName: "cellMap" }] : /* istanbul ignore next */ []));
43
+ selectedXOption = computed(() => {
44
+ this.valueVersion();
45
+ return this.resolveSelectedOption(this.xOptions(), this.getControlValue(this.config().xFieldKey));
46
+ }, ...(ngDevMode ? [{ debugName: "selectedXOption" }] : /* istanbul ignore next */ []));
47
+ selectedYOption = computed(() => {
48
+ this.valueVersion();
49
+ const yFieldKey = this.config().yFieldKey;
50
+ if (!yFieldKey) {
51
+ return null;
52
+ }
53
+ return this.resolveSelectedOption(this.yOptions(), this.getControlValue(yFieldKey));
54
+ }, ...(ngDevMode ? [{ debugName: "selectedYOption" }] : /* istanbul ignore next */ []));
55
+ activeCell = computed(() => {
56
+ const selectedX = this.selectedXOption();
57
+ if (!selectedX) {
58
+ return null;
59
+ }
60
+ if (!this.hasYAxis()) {
61
+ return this.getCell(selectedX.id ?? selectedX.value);
62
+ }
63
+ const selectedY = this.selectedYOption();
64
+ if (!selectedY) {
65
+ return null;
66
+ }
67
+ return this.getCell(selectedX.id ?? selectedX.value, selectedY.id ?? selectedY.value);
68
+ }, ...(ngDevMode ? [{ debugName: "activeCell" }] : /* istanbul ignore next */ []));
69
+ selectionSummary = computed(() => {
70
+ const parts = [];
71
+ const xAxisLabel = this.config().xAxisLabel.trim() ||
72
+ this.transloco.translate('components.lookupMatrixField.xAxisFallback');
73
+ const selectedX = this.selectedXOption();
74
+ if (selectedX) {
75
+ parts.push(`${xAxisLabel}: ${selectedX.label}`);
76
+ }
77
+ const selectedY = this.selectedYOption();
78
+ const yAxisLabel = this.config().yAxisLabel?.trim() ||
79
+ this.transloco.translate('components.lookupMatrixField.yAxisFallback');
80
+ if (selectedY && this.hasYAxis()) {
81
+ parts.push(`${yAxisLabel}: ${selectedY.label}`);
82
+ }
83
+ return parts.join(' / ');
84
+ }, ...(ngDevMode ? [{ debugName: "selectionSummary" }] : /* istanbul ignore next */ []));
85
+ pendingMessage = computed(() => {
86
+ const xAxisLabel = this.config().xAxisLabel.trim() ||
87
+ this.transloco.translate('components.lookupMatrixField.firstValueFallback');
88
+ if (!this.hasYAxis()) {
89
+ return this.transloco.translate('components.lookupMatrixField.selectXAxisFirst', { xAxisLabel });
90
+ }
91
+ const yAxisLabel = this.config().yAxisLabel?.trim() ||
92
+ this.transloco.translate('components.lookupMatrixField.secondValueFallback');
93
+ return this.transloco.translate('components.lookupMatrixField.selectAxesFirst', { xAxisLabel, yAxisLabel });
94
+ }, ...(ngDevMode ? [{ debugName: "pendingMessage" }] : /* istanbul ignore next */ []));
95
+ missingResultMessage = computed(() => {
96
+ if (!this.selectedXOption()) {
97
+ return this.pendingMessage();
98
+ }
99
+ if (this.hasYAxis() && !this.selectedYOption()) {
100
+ return this.pendingMessage();
101
+ }
102
+ return this.transloco.translate('components.lookupMatrixField.noMatchingValue');
103
+ }, ...(ngDevMode ? [{ debugName: "missingResultMessage" }] : /* istanbul ignore next */ []));
104
+ ngAfterViewInit() {
105
+ this.ensureControlSubscription();
106
+ }
107
+ getCell(xLookupItemId, yLookupItemId) {
108
+ return (this.cellMap().get(this.cellKey(xLookupItemId, yLookupItemId)) ?? null);
109
+ }
110
+ getSwatchColor(color) {
111
+ return this.resolveColor(color);
112
+ }
113
+ getControlValue(path) {
114
+ if (!path)
115
+ return null;
116
+ return this.controlContainer?.control?.get(path)?.value ?? null;
117
+ }
118
+ ensureControlSubscription() {
119
+ const control = this.controlContainer?.control;
120
+ if (!control || control === this.subscribedControl) {
121
+ return;
122
+ }
123
+ this.subscribedControl = control;
124
+ control.valueChanges
125
+ .pipe(startWith(control.getRawValue()), takeUntilDestroyed(this.destroyRef))
126
+ .subscribe(() => {
127
+ this.valueVersion.update((value) => value + 1);
128
+ });
129
+ }
130
+ resolveSelectedOption(options, rawValue) {
131
+ if (rawValue == null || rawValue === '')
132
+ return null;
133
+ return (options.find((option) => this.optionMatchesValue(option, rawValue)) ??
134
+ null);
135
+ }
136
+ optionMatchesValue(option, rawValue) {
137
+ return [option.value, option.key, option.id].some((candidate) => candidate != null && String(candidate) === String(rawValue));
138
+ }
139
+ cellKey(xLookupItemId, yLookupItemId) {
140
+ return `${String(xLookupItemId)}::${String(yLookupItemId ?? '')}`;
141
+ }
142
+ resolveColor(color) {
143
+ if (!color)
144
+ return null;
145
+ if (color.startsWith('#') ||
146
+ color.startsWith('rgb') ||
147
+ color.startsWith('hsl') ||
148
+ color.startsWith('var(')) {
149
+ return color;
150
+ }
151
+ return `var(--p-${color}-500)`;
152
+ }
153
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LookupMatrixField, deps: [], target: i0.ɵɵFactoryTarget.Component });
154
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LookupMatrixField, isStandalone: true, selector: "mt-lookup-matrix-field", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "grid gap-2" }, ngImport: i0, template: "@if (config().label) {\r\n <label class=\"font-medium text-color\">\r\n {{ config().label }}\r\n </label>\r\n}\r\n\r\n<div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 flex items-center\"\r\n>\r\n @if (activeCell(); as cell) {\r\n <div class=\"flex flex-1 min-h-6 items-center gap-2 justify-between\">\r\n <span\r\n class=\"h-6 w-2 shrink-0 rounded-[2px] border border-surface-200\"\r\n [style.background-color]=\"getSwatchColor(cell.color)\"\r\n [style.border-color]=\"getSwatchColor(cell.color)\"\r\n ></span>\r\n\r\n <div class=\"min-w-0 flex-1 py-2 flex items-center justify-between\">\r\n <div class=\"truncate font-semibold text-gray-500\">\r\n {{ cell.label }}\r\n </div>\r\n\r\n @if (selectionSummary()) {\r\n <div class=\"font-bold text-gray-500\">\r\n <mt-icon\r\n [mtTooltip]=\"selectionSummary()\"\r\n icon=\"general.info-circle\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"flex min-h-6 items-center text-muted-color py-2\">\r\n {{ hasMatrix() ? missingResultMessage() : config().emptyMessage }}\r\n </div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
155
+ }
156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LookupMatrixField, decorators: [{
157
+ type: Component,
158
+ args: [{ selector: 'mt-lookup-matrix-field', standalone: true, imports: [CommonModule, Tooltip, Icon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
159
+ class: 'grid gap-2',
160
+ }, template: "@if (config().label) {\r\n <label class=\"font-medium text-color\">\r\n {{ config().label }}\r\n </label>\r\n}\r\n\r\n<div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 flex items-center\"\r\n>\r\n @if (activeCell(); as cell) {\r\n <div class=\"flex flex-1 min-h-6 items-center gap-2 justify-between\">\r\n <span\r\n class=\"h-6 w-2 shrink-0 rounded-[2px] border border-surface-200\"\r\n [style.background-color]=\"getSwatchColor(cell.color)\"\r\n [style.border-color]=\"getSwatchColor(cell.color)\"\r\n ></span>\r\n\r\n <div class=\"min-w-0 flex-1 py-2 flex items-center justify-between\">\r\n <div class=\"truncate font-semibold text-gray-500\">\r\n {{ cell.label }}\r\n </div>\r\n\r\n @if (selectionSummary()) {\r\n <div class=\"font-bold text-gray-500\">\r\n <mt-icon\r\n [mtTooltip]=\"selectionSummary()\"\r\n icon=\"general.info-circle\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"flex min-h-6 items-center text-muted-color py-2\">\r\n {{ hasMatrix() ? missingResultMessage() : config().emptyMessage }}\r\n </div>\r\n }\r\n</div>\r\n" }]
161
+ }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
162
+
163
+ class SchemaConnectionField {
164
+ // ============================================================================
165
+ // Inputs
166
+ // ============================================================================
167
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
168
+ placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
169
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
170
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
171
+ filter = input(true, ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
172
+ /**
173
+ * Full connection configuration object from the API.
174
+ * Includes `targetLevelId`, `sourceLevels[]`, `payloadTemplate`, etc.
175
+ */
176
+ configuration = input.required(...(ngDevMode ? [{ debugName: "configuration" }] : /* istanbul ignore next */ []));
177
+ /**
178
+ * Optional HttpContext for API requests (e.g. to set base URL behavior).
179
+ */
180
+ context = input(undefined, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
181
+ // ============================================================================
182
+ // Internal State
183
+ // ============================================================================
184
+ /** The full ConnectionPayload value */
185
+ value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
186
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
187
+ /** Per-source-level state: options + loading */
188
+ sourceLevelStates = signal([], ...(ngDevMode ? [{ debugName: "sourceLevelStates" }] : /* istanbul ignore next */ []));
189
+ /** Mutable selections per source level: sourceLevelId -> selected value */
190
+ selections = {};
191
+ onTouched = () => { };
192
+ onModelChange = () => { };
193
+ /**
194
+ * Required-validation for a connection: emptiness is decided by the selected
195
+ * `sources`, not by the value being null. The runtime loads an unselected
196
+ * connection as `{ levelId, sources: [] }` — a non-null object that Angular's
197
+ * stock `Validators.required` accepts — so a plain required check would let an
198
+ * empty connection pass and the form submit. Mirrors {@link syncValue}, which
199
+ * collapses a source-less selection to `null`.
200
+ */
201
+ connectionRequiredValidator = (control) => {
202
+ const value = control.value;
203
+ const hasSources = !!value && Array.isArray(value.sources) && value.sources.length > 0;
204
+ return hasSources ? null : { required: true };
205
+ };
206
+ ngControl = null;
207
+ http = inject(HttpClient);
208
+ destroyRef = inject(DestroyRef);
209
+ transloco = inject(TranslocoService);
210
+ /** Active UI language, kept reactive so source labels re-resolve on switch. */
211
+ activeLang = toSignal(this.transloco.langChanges$, {
212
+ initialValue: this.transloco.getActiveLang(),
213
+ });
214
+ /**
215
+ * Resolve a source level's display name in the active locale, falling back
216
+ * to English, Arabic, then the level/module key.
217
+ */
218
+ resolveSourceName(source) {
219
+ const name = source.name;
220
+ return (name?.[this.activeLang()] ||
221
+ name?.en ||
222
+ name?.ar ||
223
+ source.levelKey ||
224
+ source.moduleKey ||
225
+ '');
226
+ }
227
+ /**
228
+ * Source levels from configuration.
229
+ */
230
+ sourceLevels = computed(() => {
231
+ return this.configuration()?.sourceLevels ?? [];
232
+ }, ...(ngDevMode ? [{ debugName: "sourceLevels" }] : /* istanbul ignore next */ []));
233
+ /**
234
+ * Tooltip for the marker rendered next to every source label — it is what
235
+ * tells the user these dropdowns belong to a connection, now that the
236
+ * connection's own label no longer occupies a row above them. Reads
237
+ * {@link activeLang} so the text re-translates on language switch.
238
+ */
239
+ connectionHint = computed(() => {
240
+ this.activeLang();
241
+ return this.transloco.translate('components.schemaConnection.hint');
242
+ }, ...(ngDevMode ? [{ debugName: "connectionHint" }] : /* istanbul ignore next */ []));
243
+ /**
244
+ * Placeholder for a source dropdown: its own source name, matching the label
245
+ * above it. Falls back to the field-level placeholder only when the source
246
+ * has no resolvable name.
247
+ */
248
+ sourcePlaceholder(source) {
249
+ return (this.resolveSourceName(source) ||
250
+ this.placeholder() ||
251
+ this.transloco.translate('components.selectPlaceholder'));
252
+ }
253
+ /**
254
+ * Percentage width for each dropdown, evenly divided.
255
+ */
256
+ dropdownWidth = computed(() => {
257
+ const count = this.sourceLevels().length;
258
+ if (count <= 0)
259
+ return '100%';
260
+ return `${100 / count}%`;
261
+ }, ...(ngDevMode ? [{ debugName: "dropdownWidth" }] : /* istanbul ignore next */ []));
262
+ constructor() {
263
+ this.ngControl = inject(NgControl, { self: true, optional: true });
264
+ if (this.ngControl) {
265
+ this.ngControl.valueAccessor = this;
266
+ }
267
+ effect(() => {
268
+ const control = this.ngControl?.control;
269
+ if (!control)
270
+ return;
271
+ const required = this.required();
272
+ untracked(() => {
273
+ if (required) {
274
+ control.addValidators(this.connectionRequiredValidator);
275
+ }
276
+ else {
277
+ control.removeValidators(this.connectionRequiredValidator);
278
+ }
279
+ control.updateValueAndValidity({ emitEvent: false });
280
+ });
281
+ });
282
+ // Load options for each source level when configuration changes
283
+ effect(() => {
284
+ const levels = this.sourceLevels();
285
+ if (!levels.length)
286
+ return;
287
+ // Everything below must NOT create signal dependencies,
288
+ // only sourceLevels() (→ configuration) should trigger this effect.
289
+ untracked(() => {
290
+ // Initialize per-source states + selections
291
+ this.sourceLevelStates.set(levels.map((source) => ({
292
+ source,
293
+ options: [],
294
+ loading: false,
295
+ })));
296
+ for (const source of levels) {
297
+ const sourceId = this.getSourceId(source);
298
+ if (!(sourceId in this.selections)) {
299
+ this.selections[sourceId] = source.allowManyToMany ? [] : null;
300
+ }
301
+ }
302
+ // Distribute existing value to selections
303
+ this.distributeToSelections(this.value());
304
+ // Load options for each source level
305
+ for (const source of levels) {
306
+ this.loadOptions(source);
307
+ }
308
+ });
309
+ });
310
+ }
311
+ // ============================================================================
312
+ // Source Level Helpers
313
+ // ============================================================================
314
+ /**
315
+ * Returns a stable numeric ID for a source regardless of whether it is a
316
+ * level (`levelId`) or a module (`moduleId`). Used as the key in `selections`
317
+ * and `sourceLevelStates`.
318
+ */
319
+ getSourceId(source) {
320
+ return (source.levelId ?? source.moduleId);
321
+ }
322
+ /**
323
+ * Builds the `contextKey` for the `fetch/query` request based on source type.
324
+ */
325
+ getContextKey(source) {
326
+ return source.levelId != null
327
+ ? `level:${source.levelId}`
328
+ : `module:${source.moduleId}`;
329
+ }
330
+ // ============================================================================
331
+ // Option Loading (per source level)
332
+ // ============================================================================
333
+ loadOptions(source) {
334
+ this.updateSourceState(this.getSourceId(source), { loading: true });
335
+ const ctx = this.context();
336
+ const payload = {
337
+ contextKey: this.getContextKey(source),
338
+ projection: 'Flat',
339
+ propertyKeys: ['name'],
340
+ };
341
+ this.http
342
+ .post('fetch/query', payload, {
343
+ ...(ctx ? { context: ctx } : {}),
344
+ })
345
+ .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.updateSourceState(this.getSourceId(source), { loading: false })), catchError((err) => {
346
+ console.error(`Connection options load failed for ${source.levelKey ?? source.moduleKey}:`, err);
347
+ return of({ data: { records: [] } });
348
+ }))
349
+ .subscribe((response) => {
350
+ const options = (response?.data?.records ?? [])
351
+ .filter((record) => record?.id != null)
352
+ .map((record) => ({
353
+ ...record,
354
+ id: record.id,
355
+ name: record.name,
356
+ }));
357
+ this.updateSourceState(this.getSourceId(source), {
358
+ options,
359
+ loading: false,
360
+ });
361
+ });
362
+ }
363
+ updateSourceState(sourceId, patch) {
364
+ this.sourceLevelStates.update((states) => states.map((s) => this.getSourceId(s.source) === sourceId ? { ...s, ...patch } : s));
365
+ }
366
+ // ============================================================================
367
+ // Value Handling
368
+ // ============================================================================
369
+ /**
370
+ * Single handler — no params. Reads all selections, builds the combined payload.
371
+ */
372
+ syncValue() {
373
+ const cfg = this.configuration();
374
+ const states = this.sourceLevelStates();
375
+ const sources = [];
376
+ for (const state of states) {
377
+ const val = this.selections[this.getSourceId(state.source)];
378
+ if (val == null)
379
+ continue;
380
+ const effectiveId = this.getSourceId(state.source);
381
+ if (state.source.allowManyToMany && Array.isArray(val)) {
382
+ for (const id of val) {
383
+ sources.push({
384
+ sourceLevelId: effectiveId,
385
+ sourceLevelDataId: id,
386
+ });
387
+ }
388
+ }
389
+ else if (typeof val === 'number') {
390
+ sources.push({
391
+ sourceLevelId: effectiveId,
392
+ sourceLevelDataId: val,
393
+ });
394
+ }
395
+ }
396
+ const payload = sources.length > 0 ? { levelId: cfg.targetLevelId, sources } : null;
397
+ this.value.set(payload);
398
+ this.onModelChange(payload);
399
+ this.onTouched();
400
+ }
401
+ distributeToSelections(payload) {
402
+ const states = this.sourceLevelStates();
403
+ for (const state of states) {
404
+ const sourceId = this.getSourceId(state.source);
405
+ const ids = (payload?.sources ?? [])
406
+ .filter((s) => (s.sourceLevelId ?? s.sourceModuleId) === sourceId)
407
+ .map((s) => s.sourceLevelDataId ?? s.sourceModuleDataId)
408
+ .filter((id) => id != null);
409
+ this.selections[sourceId] = state.source.allowManyToMany
410
+ ? ids
411
+ : (ids[0] ?? null);
412
+ }
413
+ }
414
+ // ============================================================================
415
+ // ControlValueAccessor
416
+ // ============================================================================
417
+ writeValue(value) {
418
+ if (typeof value === 'string') {
419
+ try {
420
+ value = JSON.parse(value);
421
+ }
422
+ catch {
423
+ value = null;
424
+ }
425
+ }
426
+ this.value.set(value ?? null);
427
+ this.distributeToSelections(value ?? null);
428
+ }
429
+ registerOnChange(fn) {
430
+ this.onModelChange = fn;
431
+ }
432
+ registerOnTouched(fn) {
433
+ this.onTouched = fn;
434
+ }
435
+ setDisabledState(disabled) {
436
+ this.disabled.set(disabled);
437
+ }
438
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SchemaConnectionField, deps: [], target: i0.ɵɵFactoryTarget.Component });
439
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SchemaConnectionField, isStandalone: true, selector: "mt-schema-connection-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: true, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, ngImport: i0, template: "<div class=\"flex gap-4 w-full\">\r\n @for (state of sourceLevelStates(); track getSourceId(state.source)) {\r\n <!--\r\n `grid gap-1 grid-cols-[minmax(0,1fr)]` matches the label\u2192control spacing\r\n every other mt-* field gets from its host class; the explicit column\r\n keeps the implicit max-content track from letting long values overflow.\r\n -->\r\n <div\r\n [style.width]=\"dropdownWidth()\"\r\n class=\"grid gap-1 grid-cols-[minmax(0,1fr)] min-w-0\"\r\n >\r\n <div class=\"flex items-center gap-1\">\r\n <label class=\"truncate\" [class.required]=\"required()\">\r\n {{ resolveSourceName(state.source) }}\r\n </label>\r\n <span\r\n class=\"inline-flex shrink-0 text-surface-400\"\r\n [mtTooltip]=\"connectionHint()\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"general.link-01\" />\r\n </span>\r\n </div>\r\n\r\n @if (state.source.allowManyToMany) {\r\n <mt-multi-select-field\r\n [field]=\"false\"\r\n [(ngModel)]=\"selections[getSourceId(state.source)]\"\r\n (ngModelChange)=\"syncValue()\"\r\n [options]=\"state.options\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [placeholder]=\"sourcePlaceholder(state.source)\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [filter]=\"filter()\"\r\n [showClear]=\"true\"\r\n display=\"chip\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [field]=\"false\"\r\n [(ngModel)]=\"selections[getSourceId(state.source)]\"\r\n (ngModelChange)=\"syncValue()\"\r\n [options]=\"state.options\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [placeholder]=\"sourcePlaceholder(state.source)\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [filter]=\"filter()\"\r\n [loading]=\"state.loading\"\r\n [showClear]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", styles: [""], 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: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
440
+ }
441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SchemaConnectionField, decorators: [{
442
+ type: Component,
443
+ args: [{ selector: 'mt-schema-connection-field', standalone: true, imports: [
444
+ FormsModule,
445
+ SelectField,
446
+ MultiSelectField,
447
+ FieldValidation,
448
+ Tooltip,
449
+ Icon,
450
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
451
+ class: 'grid gap-1',
452
+ }, template: "<div class=\"flex gap-4 w-full\">\r\n @for (state of sourceLevelStates(); track getSourceId(state.source)) {\r\n <!--\r\n `grid gap-1 grid-cols-[minmax(0,1fr)]` matches the label\u2192control spacing\r\n every other mt-* field gets from its host class; the explicit column\r\n keeps the implicit max-content track from letting long values overflow.\r\n -->\r\n <div\r\n [style.width]=\"dropdownWidth()\"\r\n class=\"grid gap-1 grid-cols-[minmax(0,1fr)] min-w-0\"\r\n >\r\n <div class=\"flex items-center gap-1\">\r\n <label class=\"truncate\" [class.required]=\"required()\">\r\n {{ resolveSourceName(state.source) }}\r\n </label>\r\n <span\r\n class=\"inline-flex shrink-0 text-surface-400\"\r\n [mtTooltip]=\"connectionHint()\"\r\n tooltipPosition=\"top\"\r\n >\r\n <mt-icon icon=\"general.link-01\" />\r\n </span>\r\n </div>\r\n\r\n @if (state.source.allowManyToMany) {\r\n <mt-multi-select-field\r\n [field]=\"false\"\r\n [(ngModel)]=\"selections[getSourceId(state.source)]\"\r\n (ngModelChange)=\"syncValue()\"\r\n [options]=\"state.options\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [placeholder]=\"sourcePlaceholder(state.source)\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [filter]=\"filter()\"\r\n [showClear]=\"true\"\r\n display=\"chip\"\r\n />\r\n } @else {\r\n <mt-select-field\r\n [field]=\"false\"\r\n [(ngModel)]=\"selections[getSourceId(state.source)]\"\r\n (ngModelChange)=\"syncValue()\"\r\n [options]=\"state.options\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [placeholder]=\"sourcePlaceholder(state.source)\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [filter]=\"filter()\"\r\n [loading]=\"state.loading\"\r\n [showClear]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n" }]
453
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: true }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
454
+
455
+ const PREDECESSOR_TYPE_BY_TOKEN = {
456
+ FS: 0,
457
+ SS: 1,
458
+ FF: 2,
459
+ SF: 3,
460
+ };
461
+ const PREDECESSOR_TOKEN_BY_TYPE = {
462
+ 0: 'FS',
463
+ 1: 'SS',
464
+ 2: 'FF',
465
+ 3: 'SF',
466
+ };
467
+ class SchedulePredecessorField {
468
+ predecessorCellTpl = viewChild.required('predecessorCellTpl');
469
+ typeCellTpl = viewChild.required('typeCellTpl');
470
+ lagCellTpl = viewChild.required('lagCellTpl');
471
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
472
+ /** Fallback so a control-less, label-less field never renders id="undefined". */
473
+ defaultFieldId = nextFieldId('mt-schedule-predecessor-field');
474
+ /** Shared by the input and its <label for>. See src/lib/utils/field-id. */
475
+ fieldId = computed(() => resolveFieldId(this.ngControl?.name, this.label(), this.defaultFieldId), ...(ngDevMode ? [{ debugName: "fieldId" }] : /* istanbul ignore next */ []));
476
+ placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
477
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
478
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
479
+ configuration = input(null, ...(ngDevMode ? [{ debugName: "configuration" }] : /* istanbul ignore next */ []));
480
+ runtimeContext = input(null, ...(ngDevMode ? [{ debugName: "runtimeContext" }] : /* istanbul ignore next */ []));
481
+ loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
482
+ taskOptions = signal([], ...(ngDevMode ? [{ debugName: "taskOptions" }] : /* istanbul ignore next */ []));
483
+ rows = signal([], ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
484
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
485
+ typeOptions = computed(() => [
486
+ { label: 'FS', value: 0 },
487
+ { label: 'SS', value: 1 },
488
+ { label: 'FF', value: 2 },
489
+ { label: 'SF', value: 3 },
490
+ ], ...(ngDevMode ? [{ debugName: "typeOptions" }] : /* istanbul ignore next */ []));
491
+ availableTaskOptions = computed(() => {
492
+ const currentTaskId = this.runtimeContext()?.moduleDataId;
493
+ return this.taskOptions().filter((item) => String(item.value) !== String(currentTaskId ?? ''));
494
+ }, ...(ngDevMode ? [{ debugName: "availableTaskOptions" }] : /* istanbul ignore next */ []));
495
+ canAddRow = computed(() => !!this.runtimeContext()?.levelId &&
496
+ !!this.runtimeContext()?.levelDataId &&
497
+ this.availableTaskOptions().length > 0, ...(ngDevMode ? [{ debugName: "canAddRow" }] : /* istanbul ignore next */ []));
498
+ addTooltip = computed(() => this.canAddRow() ? undefined : this.texts().noAvailable, ...(ngDevMode ? [{ debugName: "addTooltip" }] : /* istanbul ignore next */ []));
499
+ pageSize = computed(() => this.rows().length > 0 ? this.rows().length : 1, ...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
500
+ columns = linkedSignal(() => [
501
+ {
502
+ key: 'predecessorId',
503
+ label: this.texts().predecessor,
504
+ type: 'custom',
505
+ customCellTpl: this.predecessorCellTpl(),
506
+ },
507
+ {
508
+ key: 'type',
509
+ label: this.texts().type,
510
+ type: 'custom',
511
+ customCellTpl: this.typeCellTpl(),
512
+ },
513
+ {
514
+ key: 'lagDays',
515
+ label: this.texts().lagDays,
516
+ type: 'custom',
517
+ customCellTpl: this.lagCellTpl(),
518
+ },
519
+ ], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
520
+ rowActions = computed(() => [
521
+ {
522
+ icon: 'general.trash-01',
523
+ color: 'danger',
524
+ variant: 'text',
525
+ tooltip: this.texts().delete,
526
+ hidden: () => this.disabled() || this.readonly(),
527
+ action: (row) => this.removeRow(row.key),
528
+ },
529
+ ], ...(ngDevMode ? [{ debugName: "rowActions" }] : /* istanbul ignore next */ []));
530
+ requiredValidator = Validators.required;
531
+ onTouched = () => { };
532
+ onModelChange = () => { };
533
+ ngControl = null;
534
+ http = inject(HttpClient);
535
+ transloco = inject(TranslocoService);
536
+ destroyRef = inject(DestroyRef);
537
+ activeLang = toSignal(this.transloco.langChanges$, {
538
+ initialValue: this.transloco.getActiveLang(),
539
+ });
540
+ rowKey = 0;
541
+ texts = computed(() => {
542
+ this.activeLang();
543
+ return {
544
+ noAvailable: this.transloco.translate('components.schedulePredecessorField.noAvailable'),
545
+ predecessor: this.transloco.translate('components.schedulePredecessorField.predecessor'),
546
+ type: this.transloco.translate('components.schedulePredecessorField.type'),
547
+ lagDays: this.transloco.translate('components.schedulePredecessorField.lagDays'),
548
+ delete: this.transloco.translate('components.schedulePredecessorField.delete'),
549
+ };
550
+ }, ...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
551
+ constructor() {
552
+ this.ngControl = inject(NgControl, { self: true, optional: true });
553
+ if (this.ngControl) {
554
+ this.ngControl.valueAccessor = this;
555
+ }
556
+ effect(() => {
557
+ if (this.ngControl?.control && this.required()) {
558
+ this.ngControl.control.addValidators(Validators.required);
559
+ this.ngControl.control.updateValueAndValidity();
560
+ }
561
+ });
562
+ effect(() => {
563
+ const context = this.runtimeContext();
564
+ const levelId = context?.levelId;
565
+ const levelDataId = context?.levelDataId;
566
+ if (levelId == null || levelDataId == null) {
567
+ this.taskOptions.set([]);
568
+ return;
569
+ }
570
+ untracked(() => this.loadTaskOptions(levelId, levelDataId));
571
+ });
572
+ }
573
+ addRow() {
574
+ if (this.disabled() || this.readonly() || !this.canAddRow()) {
575
+ return;
576
+ }
577
+ this.syncRows([
578
+ ...this.rows(),
579
+ {
580
+ key: this.nextRowKey(),
581
+ predecessorId: '',
582
+ type: 0,
583
+ lagDays: 0,
584
+ },
585
+ ]);
586
+ }
587
+ removeRow(key) {
588
+ if (this.disabled() || this.readonly()) {
589
+ return;
590
+ }
591
+ this.syncRows(this.rows().filter((row) => row.key !== key));
592
+ }
593
+ updateRow(key, patch) {
594
+ if (this.disabled() || this.readonly()) {
595
+ return;
596
+ }
597
+ this.syncRows(this.rows().map((row) => (row.key === key ? { ...row, ...patch } : row)));
598
+ }
599
+ writeValue(value) {
600
+ const rows = typeof value === 'string'
601
+ ? value
602
+ .split(',')
603
+ .map((item) => item.trim())
604
+ .filter(Boolean)
605
+ .map((item) => this.parseCompactValue(item))
606
+ .filter((item) => item != null)
607
+ .map((item) => ({
608
+ key: this.nextRowKey(),
609
+ ...item,
610
+ }))
611
+ : [];
612
+ this.rows.set(rows);
613
+ }
614
+ registerOnChange(fn) {
615
+ this.onModelChange = fn;
616
+ }
617
+ registerOnTouched(fn) {
618
+ this.onTouched = fn;
619
+ }
620
+ setDisabledState(disabled) {
621
+ this.disabled.set(disabled);
622
+ }
623
+ syncRows(rows) {
624
+ this.rows.set(rows);
625
+ const value = rows
626
+ .filter((row) => row.predecessorId !== null &&
627
+ row.predecessorId !== undefined &&
628
+ String(row.predecessorId).trim() !== '')
629
+ .map((row) => this.formatCompactValue(row))
630
+ .join(',');
631
+ this.onModelChange(value || null);
632
+ this.onTouched();
633
+ }
634
+ loadTaskOptions(levelId, levelDataId) {
635
+ this.loading.set(true);
636
+ this.http
637
+ .post(`levels/${levelId}/${levelDataId}/schedule/query`, {
638
+ projection: 'Tree',
639
+ propertyKeys: ['name'],
640
+ })
641
+ .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.loading.set(false)), catchError(() => of({ data: { records: [] } })))
642
+ .subscribe((response) => {
643
+ this.taskOptions.set(this.mapTaskOptions(response.data));
644
+ });
645
+ }
646
+ mapTaskOptions(data) {
647
+ // Labels show the ROW NUMBER (1-based position in the same pre-order walk
648
+ // the grid's ID column numbers), not the backend id — the two surfaces
649
+ // must speak one coordinate. The option VALUE stays the real id: the
650
+ // compact predecessor string this field produces is wire format.
651
+ return this.flattenRecords(this.resolveRootRecords(data?.records ?? [], data?.projectionMeta?.rootIds ?? [])).map((record, index) => ({
652
+ label: `${index + 1} - ${record.name ?? record.id}`,
653
+ value: String(record.id),
654
+ }));
655
+ }
656
+ resolveRootRecords(records, rootIds) {
657
+ if (!rootIds?.length) {
658
+ return records;
659
+ }
660
+ const recordsById = new Map(records.map((record) => [String(record.id), record]));
661
+ return rootIds
662
+ .map((id) => recordsById.get(String(id)))
663
+ .filter((record) => record != null);
664
+ }
665
+ flattenRecords(records) {
666
+ const output = [];
667
+ const walk = (items) => {
668
+ items.forEach((item) => {
669
+ output.push(item);
670
+ walk(item.children ?? []);
671
+ });
672
+ };
673
+ walk(records);
674
+ return output;
675
+ }
676
+ nextRowKey() {
677
+ this.rowKey += 1;
678
+ return `predecessor-${this.rowKey}`;
679
+ }
680
+ parseCompactValue(value) {
681
+ const match = value.match(/^(.+?)(FS|SS|FF|SF)([+-]\d+)?$/);
682
+ if (!match) {
683
+ return null;
684
+ }
685
+ return {
686
+ predecessorId: match[1],
687
+ type: PREDECESSOR_TYPE_BY_TOKEN[match[2]],
688
+ lagDays: match[3] ? Number(match[3]) : 0,
689
+ };
690
+ }
691
+ formatCompactValue(row) {
692
+ const lag = row.lagDays > 0 ? `+${row.lagDays}` : row.lagDays < 0 ? row.lagDays : '';
693
+ return `${row.predecessorId}${PREDECESSOR_TOKEN_BY_TYPE[row.type]}${lag}`;
694
+ }
695
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SchedulePredecessorField, deps: [], target: i0.ɵɵFactoryTarget.Component });
696
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SchedulePredecessorField, isStandalone: true, selector: "mt-schedule-predecessor-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, viewQueries: [{ propertyName: "predecessorCellTpl", first: true, predicate: ["predecessorCellTpl"], descendants: true, isSignal: true }, { propertyName: "typeCellTpl", first: true, predicate: ["typeCellTpl"], descendants: true, isSignal: true }, { propertyName: "lagCellTpl", first: true, predicate: ["lagCellTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"gap-3 overflow-auto\">\r\n <div class=\"flex items-center justify-between mb-2\">\r\n <div>\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n </div>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'components.schedulePredecessorField.add' | transloco\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [disabled]=\"disabled() || readonly() || !canAddRow()\"\r\n [tooltip]=\"addTooltip()\"\r\n (onClick)=\"addRow()\"\r\n />\r\n </div>\r\n\r\n <ng-template #predecessorCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"availableTaskOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"\r\n placeholder() ||\r\n ('components.schedulePredecessorField.selectPredecessor' | transloco)\r\n \"\r\n [filter]=\"true\"\r\n [showClear]=\"true\"\r\n [loading]=\"loading()\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.predecessorId || undefined\"\r\n (onChange)=\"updateRow(row.key, { predecessorId: $event ?? '' })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #typeCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"typeOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.type\"\r\n (onChange)=\"updateRow(row.key, { type: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #lagCellTpl let-row>\r\n <mt-number-field\r\n [field]=\"false\"\r\n [useGrouping]=\"false\"\r\n [placeholder]=\"'components.schedulePredecessorField.lagDays' | transloco\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.lagDays\"\r\n (ngModelChange)=\"updateRow(row.key, { lagDays: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"rowActions()\"\r\n [pageSize]=\"pageSize()\"\r\n [generalSearch]=\"false\"\r\n [showFilters]=\"false\"\r\n [dataKey]=\"'key'\"\r\n storageKey=\"schedule-predecessor-field-table\"\r\n [loading]=\"loading()\"\r\n >\r\n <ng-template #empty>\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface px-4 py-5 text-sm text-muted-color\"\r\n >\r\n {{ \"components.schedulePredecessorField.empty\" | transloco }}\r\n </div>\r\n </ng-template>\r\n </mt-table>\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
697
+ }
698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SchedulePredecessorField, decorators: [{
699
+ type: Component,
700
+ args: [{ selector: 'mt-schedule-predecessor-field', standalone: true, imports: [
701
+ CommonModule,
702
+ FormsModule,
703
+ Button,
704
+ FieldValidation,
705
+ NumberField,
706
+ SelectField,
707
+ Table,
708
+ TranslocoModule,
709
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
710
+ class: 'grid gap-1',
711
+ }, template: "<div class=\"gap-3 overflow-auto\">\r\n <div class=\"flex items-center justify-between mb-2\">\r\n <div>\r\n @if (label()) {\r\n <label\r\n [class.required]=\"ngControl?.control?.hasValidator(requiredValidator)\"\r\n [for]=\"fieldId()\"\r\n >\r\n {{ label() }}\r\n </label>\r\n }\r\n </div>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'components.schedulePredecessorField.add' | transloco\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n [disabled]=\"disabled() || readonly() || !canAddRow()\"\r\n [tooltip]=\"addTooltip()\"\r\n (onClick)=\"addRow()\"\r\n />\r\n </div>\r\n\r\n <ng-template #predecessorCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"availableTaskOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"\r\n placeholder() ||\r\n ('components.schedulePredecessorField.selectPredecessor' | transloco)\r\n \"\r\n [filter]=\"true\"\r\n [showClear]=\"true\"\r\n [loading]=\"loading()\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.predecessorId || undefined\"\r\n (onChange)=\"updateRow(row.key, { predecessorId: $event ?? '' })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #typeCellTpl let-row>\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"typeOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.type\"\r\n (onChange)=\"updateRow(row.key, { type: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <ng-template #lagCellTpl let-row>\r\n <mt-number-field\r\n [field]=\"false\"\r\n [useGrouping]=\"false\"\r\n [placeholder]=\"'components.schedulePredecessorField.lagDays' | transloco\"\r\n [readonly]=\"disabled() || readonly()\"\r\n [ngModel]=\"row.lagDays\"\r\n (ngModelChange)=\"updateRow(row.key, { lagDays: $event ?? 0 })\"\r\n />\r\n </ng-template>\r\n\r\n <mt-table\r\n noCard\r\n [data]=\"rows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"rowActions()\"\r\n [pageSize]=\"pageSize()\"\r\n [generalSearch]=\"false\"\r\n [showFilters]=\"false\"\r\n [dataKey]=\"'key'\"\r\n storageKey=\"schedule-predecessor-field-table\"\r\n [loading]=\"loading()\"\r\n >\r\n <ng-template #empty>\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface px-4 py-5 text-sm text-muted-color\"\r\n >\r\n {{ \"components.schedulePredecessorField.empty\" | transloco }}\r\n </div>\r\n </ng-template>\r\n </mt-table>\r\n</div>\r\n\r\n<mt-field-validation [control]=\"ngControl?.control\"></mt-field-validation>\r\n" }]
712
+ }], ctorParameters: () => [], propDecorators: { predecessorCellTpl: [{ type: i0.ViewChild, args: ['predecessorCellTpl', { isSignal: true }] }], typeCellTpl: [{ type: i0.ViewChild, args: ['typeCellTpl', { isSignal: true }] }], lagCellTpl: [{ type: i0.ViewChild, args: ['lagCellTpl', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], runtimeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "runtimeContext", required: false }] }] } });
713
+
714
+ /**
715
+ * Token used by `mt-entity-list-field` (Write mode) to open the rich add-row
716
+ * dialog backed by `@masterteam/forms`'s `mt-client-form`. Apps that want this
717
+ * behavior should call `provideEntityListAddForm()` from
718
+ * `@masterteam/forms/entity-list-add-form` in their app providers. When the
719
+ * token is not registered, the field falls back to a minimal text-only popup.
720
+ */
721
+ const ENTITY_LIST_ADD_DIALOG_COMPONENT = new InjectionToken('ENTITY_LIST_ADD_DIALOG_COMPONENT');
722
+
723
+ const UNSORTABLE_ENTITY_VIEW_TYPES = new Set([
724
+ 'Attachment',
725
+ 'Checkbox',
726
+ ]);
727
+ const ACCESS_ALIASES = {
728
+ '0': 'Auto',
729
+ '1': 'Read',
730
+ '2': 'Write',
731
+ '3': 'ReadWrite',
732
+ '4': 'None',
733
+ auto: 'Auto',
734
+ read: 'Read',
735
+ write: 'Write',
736
+ readwrite: 'ReadWrite',
737
+ none: 'None',
738
+ };
739
+ /** Internal row keys — not rendered, used to correlate rows with entities. */
740
+ const ROW_ID_KEY = '__rowId';
741
+ const ROW_ENTITY_ID_KEY = '__entityId';
742
+ const ROW_VALUES_KEY = '__values';
743
+ class EntityListField {
744
+ // Inputs
745
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
746
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
747
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
748
+ /** EntityList property id (kept for back-compat; unused by fetch/query). */
749
+ propertyId = input(null, ...(ngDevMode ? [{ debugName: "propertyId" }] : /* istanbul ignore next */ []));
750
+ /** Property configuration (sourceType, moduleId, access, readFields, etc). */
751
+ configuration = input(null, ...(ngDevMode ? [{ debugName: "configuration" }] : /* istanbul ignore next */ []));
752
+ /** Runtime ids needed to call the read endpoint. */
753
+ runtimeContext = input(null, ...(ngDevMode ? [{ debugName: "runtimeContext" }] : /* istanbul ignore next */ []));
754
+ /** Optional HttpContext (kept for back-compat). */
755
+ context = input(undefined, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
756
+ // CVA state — pass-through value (EntityList stored JSON shape).
757
+ storedValue = signal(null, ...(ngDevMode ? [{ debugName: "storedValue" }] : /* istanbul ignore next */ []));
758
+ // Loaded table state.
759
+ columns = signal([], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
760
+ /** Rows loaded from the backend (existing target records). */
761
+ rows = signal([], ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
762
+ loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
763
+ errorMessage = signal(null, ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
764
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
765
+ requiredValidator = Validators.required;
766
+ ngControl = null;
767
+ levelId = computed(() => {
768
+ const raw = this.runtimeContext()?.levelId ?? null;
769
+ return raw == null || raw === '' ? null : raw;
770
+ }, ...(ngDevMode ? [{ debugName: "levelId" }] : /* istanbul ignore next */ []));
771
+ levelDataId = computed(() => {
772
+ const raw = this.runtimeContext()?.levelDataId ?? null;
773
+ return raw == null || raw === '' ? null : raw;
774
+ }, ...(ngDevMode ? [{ debugName: "levelDataId" }] : /* istanbul ignore next */ []));
775
+ moduleId = computed(() => {
776
+ const raw = this.configuration()
777
+ ?.moduleId;
778
+ return raw == null || raw === '' ? null : raw;
779
+ }, ...(ngDevMode ? [{ debugName: "moduleId" }] : /* istanbul ignore next */ []));
780
+ readFields = computed(() => {
781
+ const raw = this.configuration()
782
+ ?.readFields;
783
+ if (!Array.isArray(raw))
784
+ return [];
785
+ return raw.filter((f) => typeof f === 'string' && f.length > 0);
786
+ }, ...(ngDevMode ? [{ debugName: "readFields" }] : /* istanbul ignore next */ []));
787
+ /** Normalized `access` from the property configuration. */
788
+ accessMode = computed(() => {
789
+ const raw = this.configuration()?.access;
790
+ if (raw == null || raw === '')
791
+ return 'Auto';
792
+ return ACCESS_ALIASES[String(raw).trim().toLowerCase()] ?? 'Auto';
793
+ }, ...(ngDevMode ? [{ debugName: "accessMode" }] : /* istanbul ignore next */ []));
794
+ canRead = computed(() => {
795
+ const access = this.accessMode();
796
+ return access === 'Auto' || access === 'Read' || access === 'ReadWrite';
797
+ }, ...(ngDevMode ? [{ debugName: "canRead" }] : /* istanbul ignore next */ []));
798
+ /** Access allows module-backed create/update/delete. */
799
+ writeAllowed = computed(() => {
800
+ const access = this.accessMode();
801
+ return access === 'Auto' || access === 'Write' || access === 'ReadWrite';
802
+ }, ...(ngDevMode ? [{ debugName: "writeAllowed" }] : /* istanbul ignore next */ []));
803
+ /** Write UI is rendered only when access allows it and the field is editable. */
804
+ canWrite = computed(() => this.writeAllowed() && !this.readonly(), ...(ngDevMode ? [{ debugName: "canWrite" }] : /* istanbul ignore next */ []));
805
+ writeFields = computed(() => {
806
+ const raw = this.configuration()
807
+ ?.writeFields;
808
+ if (!Array.isArray(raw))
809
+ return [];
810
+ return raw.filter((f) => typeof f === 'string' && f.length > 0);
811
+ }, ...(ngDevMode ? [{ debugName: "writeFields" }] : /* istanbul ignore next */ []));
812
+ /**
813
+ * Pending create/update rows, in the exact shape persisted by the backend
814
+ * (`rows[]` of the stored EntityList JSON). Rows with `entityId > 0` are
815
+ * partial updates of existing records; `entityId = 0` rows are creates.
816
+ */
817
+ pendingRows = signal([], ...(ngDevMode ? [{ debugName: "pendingRows" }] : /* istanbul ignore next */ []));
818
+ /** Existing entity ids the user removed (submitted as `deletedIds`). */
819
+ deletedIds = signal([], ...(ngDevMode ? [{ debugName: "deletedIds" }] : /* istanbul ignore next */ []));
820
+ /** rowId → original form values / option labels (view state only). */
821
+ rowDrafts = signal({}, ...(ngDevMode ? [{ debugName: "rowDrafts" }] : /* istanbul ignore next */ []));
822
+ localRowSeq = 0;
823
+ /** Serialized copy of the last value we emitted, to ignore CVA echoes. */
824
+ lastEmittedJson = null;
825
+ /** Server rows indexed by entity id, for merging pending updates. */
826
+ rowsByEntityId = computed(() => {
827
+ const map = new Map();
828
+ for (const row of this.rows()) {
829
+ const entityId = Number(row[ROW_ENTITY_ID_KEY]);
830
+ if (entityId > 0)
831
+ map.set(entityId, row);
832
+ }
833
+ return map;
834
+ }, ...(ngDevMode ? [{ debugName: "rowsByEntityId" }] : /* istanbul ignore next */ []));
835
+ /** Locally created rows (not yet persisted). */
836
+ createdRows = computed(() => {
837
+ const drafts = this.rowDrafts();
838
+ return this.pendingRows()
839
+ .filter((row) => !(row.entityId > 0))
840
+ .map((row) => {
841
+ const draft = drafts[row.rowId];
842
+ return this.buildRow(row.rowId, row.rowId, 0, draft?.values ?? this.toValueMap(row.values), draft?.display ?? {});
843
+ });
844
+ }, ...(ngDevMode ? [{ debugName: "createdRows" }] : /* istanbul ignore next */ []));
845
+ /** Pending edits of existing rows, keyed by entity id. */
846
+ editedRowsByEntityId = computed(() => {
847
+ const drafts = this.rowDrafts();
848
+ const serverRows = this.rowsByEntityId();
849
+ const map = new Map();
850
+ for (const row of this.pendingRows()) {
851
+ if (!(row.entityId > 0))
852
+ continue;
853
+ const base = serverRows.get(row.entityId);
854
+ const draft = drafts[row.rowId];
855
+ // A pending update only carries the keys the user changed.
856
+ const changed = draft?.values ?? this.toValueMap(row.values);
857
+ const display = draft?.display ?? {};
858
+ if (!base) {
859
+ map.set(row.entityId, this.buildRow(row.entityId, row.rowId, row.entityId, changed, display));
860
+ continue;
861
+ }
862
+ // Keep the backend-rendered cells for untouched columns so resolved
863
+ // labels (users, lookups, statuses) are not replaced by raw ids.
864
+ const baseValues = base[ROW_VALUES_KEY] ?? {};
865
+ const next = {
866
+ ...base,
867
+ [ROW_ID_KEY]: row.rowId,
868
+ [ROW_VALUES_KEY]: { ...baseValues, ...changed },
869
+ };
870
+ for (const column of this.columns()) {
871
+ const key = column.propertyKey ?? column.key;
872
+ if (!(key in changed))
873
+ continue;
874
+ next[column.key] = this.buildCell(column, changed[key], display[key]);
875
+ }
876
+ map.set(row.entityId, next);
877
+ }
878
+ return map;
879
+ }, ...(ngDevMode ? [{ debugName: "editedRowsByEntityId" }] : /* istanbul ignore next */ []));
880
+ /**
881
+ * Rows rendered in the table. In write mode existing rows are merged with
882
+ * pending edits, removed rows are hidden, and locally created rows are
883
+ * appended.
884
+ */
885
+ displayRows = computed(() => {
886
+ if (!this.canWrite())
887
+ return this.rows();
888
+ const deleted = new Set(this.deletedIds());
889
+ const edited = this.editedRowsByEntityId();
890
+ const existing = this.rows()
891
+ .filter((row) => !deleted.has(Number(row[ROW_ENTITY_ID_KEY])))
892
+ .map((row) => edited.get(Number(row[ROW_ENTITY_ID_KEY])) ?? row);
893
+ return [...existing, ...this.createdRows()];
894
+ }, ...(ngDevMode ? [{ debugName: "displayRows" }] : /* istanbul ignore next */ []));
895
+ hasRows = computed(() => this.displayRows().length > 0, ...(ngDevMode ? [{ debugName: "hasRows" }] : /* istanbul ignore next */ []));
896
+ hasRequiredContext = computed(() => this.levelId() != null &&
897
+ this.levelDataId() != null &&
898
+ this.moduleId() != null &&
899
+ this.readFields().length > 0, ...(ngDevMode ? [{ debugName: "hasRequiredContext" }] : /* istanbul ignore next */ []));
900
+ onTouched = () => { };
901
+ onModelChange = () => { };
902
+ http = inject(HttpClient);
903
+ destroyRef = inject(DestroyRef);
904
+ modal = inject(ModalService);
905
+ transloco = inject(TranslocoService);
906
+ /**
907
+ * Optional rich add-row dialog (provided by `@masterteam/forms` via
908
+ * `provideEntityListAddForm()`). When available, used instead of the local
909
+ * minimal dialog so the popup renders `mt-client-form` filtered by
910
+ * `writeFields`.
911
+ */
912
+ addDialogComponent = inject(ENTITY_LIST_ADD_DIALOG_COMPONENT, { optional: true });
913
+ constructor() {
914
+ this.ngControl = inject(NgControl, { self: true, optional: true });
915
+ if (this.ngControl) {
916
+ this.ngControl.valueAccessor = this;
917
+ }
918
+ // Trigger fetch when context inputs change. Columns always come from
919
+ // /api/fetch/query; records are kept whenever access allows reading.
920
+ effect(() => {
921
+ const allowedRead = this.canRead();
922
+ const allowedWrite = this.writeAllowed();
923
+ const ready = this.hasRequiredContext();
924
+ const levelId = this.levelId();
925
+ const levelDataId = this.levelDataId();
926
+ const moduleId = this.moduleId();
927
+ const readFields = this.readFields();
928
+ untracked(() => {
929
+ if ((!allowedRead && !allowedWrite) ||
930
+ !ready ||
931
+ levelId == null ||
932
+ levelDataId == null ||
933
+ moduleId == null) {
934
+ this.columns.set([]);
935
+ this.rows.set([]);
936
+ this.errorMessage.set(null);
937
+ return;
938
+ }
939
+ this.fetchRows(levelId, levelDataId, moduleId, readFields);
940
+ });
941
+ });
942
+ }
943
+ // ============================================================================
944
+ // CVA
945
+ // ============================================================================
946
+ writeValue(value) {
947
+ const incoming = this.coerceStoredValue(value);
948
+ // Ignore the echo of our own emission (DynamicForm re-writes the model on
949
+ // every value change) so pending edits/deletions are not reset.
950
+ if (this.isEchoOfLastEmit(incoming))
951
+ return;
952
+ this.lastEmittedJson = null;
953
+ this.storedValue.set(incoming);
954
+ // Restore rows the backend left unprocessed. `deletedIds` on a loaded
955
+ // value are historical operation markers, not pending intent.
956
+ const rows = Array.isArray(incoming?.rows) ? incoming.rows : [];
957
+ this.pendingRows.set(rows.filter((row) => !!row && typeof row === 'object'));
958
+ this.deletedIds.set([]);
959
+ this.rowDrafts.set({});
960
+ }
961
+ /**
962
+ * True when the written value still carries exactly the rows and deletions
963
+ * we last emitted — i.e. the form is echoing our own value back rather than
964
+ * loading a new one.
965
+ */
966
+ isEchoOfLastEmit(incoming) {
967
+ if (this.lastEmittedJson === null)
968
+ return false;
969
+ return (JSON.stringify({
970
+ rows: incoming?.rows ?? [],
971
+ deletedIds: incoming?.deletedIds ?? [],
972
+ }) === this.lastEmittedJson);
973
+ }
974
+ /**
975
+ * The stored value is persisted as JSON, so a host may write either the
976
+ * parsed object or its raw string form.
977
+ */
978
+ coerceStoredValue(value) {
979
+ if (value == null || value === '')
980
+ return null;
981
+ if (typeof value === 'string') {
982
+ try {
983
+ return this.coerceStoredValue(JSON.parse(value));
984
+ }
985
+ catch {
986
+ return null;
987
+ }
988
+ }
989
+ return typeof value === 'object' && !Array.isArray(value)
990
+ ? value
991
+ : null;
992
+ }
993
+ registerOnChange(fn) {
994
+ this.onModelChange = fn;
995
+ }
996
+ registerOnTouched(fn) {
997
+ this.onTouched = fn;
998
+ }
999
+ setDisabledState(isDisabled) {
1000
+ this.disabled.set(isDisabled);
1001
+ }
1002
+ // ============================================================================
1003
+ // Write mode — add / edit / delete
1004
+ // ============================================================================
1005
+ /** Row actions shown in write mode — edit and delete. */
1006
+ writeRowActions = computed(() => {
1007
+ if (this.disabled())
1008
+ return [];
1009
+ return [
1010
+ {
1011
+ icon: 'custom.pencil',
1012
+ tooltip: this.transloco.translate('components.entityListField.edit'),
1013
+ action: (row) => this.openEditDialog(row),
1014
+ },
1015
+ {
1016
+ icon: 'general.trash-01',
1017
+ tooltip: this.transloco.translate('components.entityListField.delete'),
1018
+ color: 'danger',
1019
+ confirmation: {
1020
+ type: 'popup',
1021
+ confirmationType: 'delete',
1022
+ },
1023
+ action: (row) => this.deleteRow(row),
1024
+ },
1025
+ ];
1026
+ }, ...(ngDevMode ? [{ debugName: "writeRowActions" }] : /* istanbul ignore next */ []));
1027
+ openAddDialog() {
1028
+ if (this.disabled())
1029
+ return;
1030
+ const component = this.addDialogComponent;
1031
+ if (!component)
1032
+ return;
1033
+ const ref = this.modal.openModal(component, 'dialog', {
1034
+ header: this.transloco.translate('components.entityListField.add'),
1035
+ styleClass: '!w-[48rem] max-w-[96vw]',
1036
+ dismissableMask: true,
1037
+ inputValues: {
1038
+ moduleId: this.moduleId(),
1039
+ levelId: this.levelId(),
1040
+ levelDataId: this.levelDataId(),
1041
+ writeFields: this.writeFields(),
1042
+ },
1043
+ });
1044
+ ref.onClose.pipe(take(1)).subscribe((result) => {
1045
+ const parsed = this.parseDialogResult(result);
1046
+ if (!parsed)
1047
+ return;
1048
+ // A create row carries every value the user filled in; empty fields are
1049
+ // dropped so the target module keeps its own defaults.
1050
+ const values = this.dropEmptyValues(parsed.values);
1051
+ const rowId = this.nextRowId();
1052
+ this.setRowDraft(rowId, values, parsed.display);
1053
+ this.pendingRows.set([
1054
+ ...this.pendingRows(),
1055
+ { rowId, entityId: 0, values: this.toSubmitValues(values) },
1056
+ ]);
1057
+ this.emitValue();
1058
+ });
1059
+ }
1060
+ openEditDialog(row) {
1061
+ if (this.disabled())
1062
+ return;
1063
+ const component = this.addDialogComponent;
1064
+ if (!component)
1065
+ return;
1066
+ const entityId = Number(row[ROW_ENTITY_ID_KEY]) || 0;
1067
+ const rowId = String(row[ROW_ID_KEY] ?? '');
1068
+ const initialValues = row[ROW_VALUES_KEY] ?? {};
1069
+ const ref = this.modal.openModal(component, 'dialog', {
1070
+ header: this.transloco.translate('components.entityListField.edit'),
1071
+ styleClass: '!w-[48rem] max-w-[96vw]',
1072
+ dismissableMask: true,
1073
+ inputValues: {
1074
+ moduleId: this.moduleId(),
1075
+ levelId: this.levelId(),
1076
+ levelDataId: this.levelDataId(),
1077
+ writeFields: this.writeFields(),
1078
+ initialValues,
1079
+ isEdit: true,
1080
+ },
1081
+ });
1082
+ ref.onClose.pipe(take(1)).subscribe((result) => {
1083
+ const parsed = this.parseDialogResult(result);
1084
+ if (!parsed)
1085
+ return;
1086
+ if (entityId > 0) {
1087
+ this.applyExistingRowEdit(entityId, rowId, initialValues, parsed);
1088
+ }
1089
+ else {
1090
+ this.applyCreatedRowEdit(rowId, parsed);
1091
+ }
1092
+ this.emitValue();
1093
+ });
1094
+ }
1095
+ /**
1096
+ * Existing target records are updated partially: only values the user
1097
+ * actually changed are submitted, so fields the dialog could not pre-fill
1098
+ * (keys outside `readFields`) are left untouched by the backend.
1099
+ */
1100
+ applyExistingRowEdit(entityId, fallbackRowId, initialValues, parsed) {
1101
+ const changed = this.diffValues(initialValues, parsed.values);
1102
+ const current = this.pendingRows();
1103
+ const existing = current.find((row) => row.entityId === entityId);
1104
+ const rowId = existing?.rowId || (fallbackRowId ? fallbackRowId : `entity-${entityId}`);
1105
+ const merged = {
1106
+ ...(this.rowDrafts()[rowId]?.values ?? {}),
1107
+ ...changed,
1108
+ };
1109
+ if (Object.keys(merged).length === 0) {
1110
+ // Nothing left to submit for this record — drop the pending update.
1111
+ this.clearRowDraft(rowId);
1112
+ this.pendingRows.set(current.filter((row) => row.entityId !== entityId));
1113
+ return;
1114
+ }
1115
+ this.setRowDraft(rowId, merged, parsed.display);
1116
+ const next = {
1117
+ rowId,
1118
+ entityId,
1119
+ values: this.toSubmitValues(merged),
1120
+ };
1121
+ this.pendingRows.set(existing
1122
+ ? current.map((row) => (row.entityId === entityId ? next : row))
1123
+ : [...current, next]);
1124
+ }
1125
+ /** A locally created row is replaced wholesale by the dialog result. */
1126
+ applyCreatedRowEdit(rowId, parsed) {
1127
+ const values = this.dropEmptyValues(parsed.values);
1128
+ this.setRowDraft(rowId, values, parsed.display);
1129
+ this.pendingRows.set(this.pendingRows().map((row) => row.rowId === rowId
1130
+ ? { ...row, values: this.toSubmitValues(values) }
1131
+ : row));
1132
+ }
1133
+ /**
1134
+ * Remove a row. Locally created rows are dropped from the pending payload;
1135
+ * existing records are queued in `deletedIds` for the backend to delete.
1136
+ */
1137
+ deleteRow(row) {
1138
+ if (this.disabled())
1139
+ return;
1140
+ const entityId = Number(row[ROW_ENTITY_ID_KEY]) || 0;
1141
+ const rowId = String(row[ROW_ID_KEY] ?? '');
1142
+ if (entityId > 0) {
1143
+ if (!this.deletedIds().includes(entityId)) {
1144
+ this.deletedIds.set([...this.deletedIds(), entityId]);
1145
+ }
1146
+ // A queued update for a deleted record is pointless — drop it.
1147
+ this.pendingRows.set(this.pendingRows().filter((pending) => pending.entityId !== entityId));
1148
+ }
1149
+ else {
1150
+ this.pendingRows.set(this.pendingRows().filter((pending) => pending.rowId !== rowId));
1151
+ }
1152
+ this.clearRowDraft(rowId);
1153
+ this.emitValue();
1154
+ }
1155
+ /**
1156
+ * Normalize the add/edit dialog close payload. The rich dialog returns
1157
+ * `{ values, display }`; a custom add-dialog may still return the raw values
1158
+ * object directly (no display map), which we treat as `display = {}`.
1159
+ */
1160
+ parseDialogResult(result) {
1161
+ if (!result || typeof result !== 'object')
1162
+ return null;
1163
+ const payload = result;
1164
+ const values = payload['values'];
1165
+ if (values && typeof values === 'object') {
1166
+ return {
1167
+ values: values,
1168
+ display: payload['display'] ?? {},
1169
+ };
1170
+ }
1171
+ return { values: payload, display: {} };
1172
+ }
1173
+ nextRowId() {
1174
+ const used = new Set(this.pendingRows().map((row) => row.rowId));
1175
+ let candidate = '';
1176
+ do {
1177
+ this.localRowSeq += 1;
1178
+ candidate = `client-${this.localRowSeq}`;
1179
+ } while (used.has(candidate));
1180
+ return candidate;
1181
+ }
1182
+ setRowDraft(rowId, values, display) {
1183
+ this.rowDrafts.set({ ...this.rowDrafts(), [rowId]: { values, display } });
1184
+ }
1185
+ clearRowDraft(rowId) {
1186
+ if (!rowId || !(rowId in this.rowDrafts()))
1187
+ return;
1188
+ const next = { ...this.rowDrafts() };
1189
+ delete next[rowId];
1190
+ this.rowDrafts.set(next);
1191
+ }
1192
+ buildRow(id, rowId, entityId, values, display = {}) {
1193
+ const row = {
1194
+ Id: id,
1195
+ [ROW_ID_KEY]: rowId,
1196
+ [ROW_ENTITY_ID_KEY]: entityId,
1197
+ [ROW_VALUES_KEY]: values,
1198
+ };
1199
+ for (const column of this.columns()) {
1200
+ // Form values are keyed by catalog property key (e.g. "task_name"),
1201
+ // but column.key is the normalizedKey (e.g. "Name"). Use propertyKey
1202
+ // for the lookup so the value is found.
1203
+ const key = column.propertyKey ?? column.key;
1204
+ row[column.key] = this.buildCell(column, values[key], display[key]);
1205
+ }
1206
+ return row;
1207
+ }
1208
+ /** Render one table cell from a raw form value and its resolved label. */
1209
+ buildCell(column, raw, label) {
1210
+ return {
1211
+ name: column.label ?? column.key,
1212
+ key: column.key,
1213
+ viewType: column.viewType ?? 'Text',
1214
+ value: this.toLocalEntityValue(column.viewType, raw, label),
1215
+ rawValue: raw ?? null,
1216
+ };
1217
+ }
1218
+ /**
1219
+ * Shape a raw form value into the value an entity renderer expects for the
1220
+ * given view type. Locally-added rows carry raw form values, but renderers
1221
+ * like `mt-entity-user` need a display object (`{ displayName }`) — a
1222
+ * team-member `User` field is a select whose control value is a bare user id.
1223
+ * `label` is the resolved option display (present for select-based fields).
1224
+ */
1225
+ toLocalEntityValue(viewType, raw, label) {
1226
+ if (viewType === 'User') {
1227
+ if (Array.isArray(raw)) {
1228
+ const names = raw
1229
+ .map((entry) => entry && typeof entry === 'object'
1230
+ ? (entry['displayName'] ?? '')
1231
+ : entry)
1232
+ .filter((name) => name != null && name !== '');
1233
+ return names.length ? { displayName: names.join(', ') } : '';
1234
+ }
1235
+ if (raw && typeof raw === 'object') {
1236
+ const user = raw;
1237
+ return {
1238
+ ...user,
1239
+ displayName: user['displayName'] ?? label ?? '',
1240
+ photoUrl: user['photoUrl'] ?? user['photo'] ?? '',
1241
+ };
1242
+ }
1243
+ if (raw != null && raw !== '') {
1244
+ const name = label == null ? String(raw) : String(label);
1245
+ return { id: String(raw), displayName: name, userName: name };
1246
+ }
1247
+ return '';
1248
+ }
1249
+ if (viewType === 'Status' || viewType === 'Lookup') {
1250
+ if (raw && typeof raw === 'object')
1251
+ return raw;
1252
+ if (raw != null && raw !== '' && label != null) {
1253
+ return { key: String(raw), display: String(label), color: '' };
1254
+ }
1255
+ return raw ?? '';
1256
+ }
1257
+ // Plain / scalar view types: prefer a resolved option label when present,
1258
+ // else the raw value (unchanged for text / number / date / percentage).
1259
+ if (label != null && (raw == null || typeof raw !== 'object')) {
1260
+ return Array.isArray(label) ? label.join(', ') : label;
1261
+ }
1262
+ return raw ?? '';
1263
+ }
1264
+ // ============================================================================
1265
+ // Submit payload (see EntityList.md — "Stored Value Shape")
1266
+ // ============================================================================
1267
+ emitValue() {
1268
+ const current = this.storedValue();
1269
+ // `entityIds` / `createdIds` / `updatedIds` / `snapshot` are backend-owned
1270
+ // and passed through untouched; the frontend only contributes pending rows
1271
+ // and delete intents.
1272
+ const next = {
1273
+ ...(current ?? {}),
1274
+ rows: this.pendingRows(),
1275
+ deletedIds: this.deletedIds(),
1276
+ };
1277
+ this.storedValue.set(next);
1278
+ this.lastEmittedJson = JSON.stringify({
1279
+ rows: next.rows,
1280
+ deletedIds: next.deletedIds,
1281
+ });
1282
+ this.onModelChange(next);
1283
+ this.onTouched();
1284
+ }
1285
+ /** `values[]` entries, restricted to `writeFields` when configured. */
1286
+ toSubmitValues(values) {
1287
+ const allowed = new Set(this.writeFields());
1288
+ return Object.entries(values)
1289
+ .filter(([propertyKey]) => allowed.size === 0 || allowed.has(propertyKey))
1290
+ .map(([propertyKey, value]) => ({
1291
+ propertyKey,
1292
+ rawValue: this.toRawValue(value),
1293
+ }));
1294
+ }
1295
+ /** Backend `rawValue` is a serialized scalar; objects/arrays go as JSON. */
1296
+ toRawValue(value) {
1297
+ if (value == null || value === '')
1298
+ return null;
1299
+ if (value instanceof Date)
1300
+ return value.toISOString();
1301
+ if (typeof value === 'object')
1302
+ return JSON.stringify(value);
1303
+ return String(value);
1304
+ }
1305
+ toValueMap(values) {
1306
+ const map = {};
1307
+ for (const value of values ?? []) {
1308
+ if (!value?.propertyKey)
1309
+ continue;
1310
+ map[value.propertyKey] = value.rawValue;
1311
+ }
1312
+ return map;
1313
+ }
1314
+ dropEmptyValues(values) {
1315
+ const next = {};
1316
+ for (const [key, value] of Object.entries(values)) {
1317
+ if (this.isEmptyValue(value))
1318
+ continue;
1319
+ next[key] = value;
1320
+ }
1321
+ return next;
1322
+ }
1323
+ /**
1324
+ * Keys the user actually changed. A key that was empty before and is still
1325
+ * empty is skipped (the dialog simply could not pre-fill it); a key that had
1326
+ * a value and is now empty is kept so the backend clears it.
1327
+ */
1328
+ diffValues(initial, next) {
1329
+ const changed = {};
1330
+ for (const [key, value] of Object.entries(next)) {
1331
+ const before = initial[key];
1332
+ if (this.isEmptyValue(value) && this.isEmptyValue(before))
1333
+ continue;
1334
+ if (this.isSameValue(before, value))
1335
+ continue;
1336
+ changed[key] = value;
1337
+ }
1338
+ return changed;
1339
+ }
1340
+ isEmptyValue(value) {
1341
+ if (value == null || value === '')
1342
+ return true;
1343
+ if (Array.isArray(value))
1344
+ return value.length === 0;
1345
+ return false;
1346
+ }
1347
+ isSameValue(a, b) {
1348
+ if (a === b)
1349
+ return true;
1350
+ // Values arriving from the read endpoint are serialized; compare the
1351
+ // submit-shaped representation so "5" and 5 are not treated as a change.
1352
+ return this.toRawValue(a) === this.toRawValue(b);
1353
+ }
1354
+ // ============================================================================
1355
+ // Read endpoint — POST /api/fetch/query (Table projection)
1356
+ // ============================================================================
1357
+ fetchRows(levelId, levelDataId, moduleId, propertyKeys) {
1358
+ this.loading.set(true);
1359
+ this.errorMessage.set(null);
1360
+ const ctx = this.context();
1361
+ const body = {
1362
+ contextKey: `level:${levelId}/module:${moduleId}`,
1363
+ projection: 'Table',
1364
+ surfaceKey: 'table',
1365
+ propertyKeys,
1366
+ filters: [
1367
+ {
1368
+ key: 'levelDataId',
1369
+ operator: 'Equals',
1370
+ value: String(levelDataId),
1371
+ },
1372
+ ],
1373
+ page: 1,
1374
+ pageSize: 3000,
1375
+ };
1376
+ this.http
1377
+ .post('fetch/query', body, ctx ? { context: ctx } : {})
1378
+ .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.loading.set(false)), catchError((err) => {
1379
+ console.error('EntityList fetch/query failed', err);
1380
+ this.errorMessage.set(this.transloco.translate('components.entityListField.loadFailed'));
1381
+ return of({});
1382
+ }))
1383
+ .subscribe((response) => {
1384
+ const payload = response && typeof response === 'object' && 'data' in response
1385
+ ? (response.data ?? response)
1386
+ : response;
1387
+ this.applyResponse(payload);
1388
+ });
1389
+ }
1390
+ applyResponse(response) {
1391
+ // Build property maps first so column defs can include the propertyKey
1392
+ // mapping (normalizedKey → catalog key) needed for row value lookup.
1393
+ const propertyByKey = new Map();
1394
+ const propertyByNormalizedKey = new Map();
1395
+ for (const property of response.catalog?.properties ?? []) {
1396
+ propertyByKey.set(property.key, property);
1397
+ propertyByNormalizedKey.set(property.normalizedKey, property);
1398
+ }
1399
+ const columns = (response.projectionMeta?.columns ?? [])
1400
+ .filter((column) => column.visible)
1401
+ .sort((a, b) => a.order - b.order)
1402
+ .map((column) => ({
1403
+ key: column.key,
1404
+ label: column.label,
1405
+ type: 'entity',
1406
+ sortable: !UNSORTABLE_ENTITY_VIEW_TYPES.has(column.viewType),
1407
+ viewType: column.viewType,
1408
+ order: column.order,
1409
+ visible: column.visible,
1410
+ configuration: column.configuration ?? null,
1411
+ // Store the catalog property key so buildRow can look up form values
1412
+ // keyed by property key (e.g. "task_name") rather than the
1413
+ // normalizedKey used as the column display key (e.g. "Name").
1414
+ propertyKey: propertyByNormalizedKey.get(column.key)?.key ?? column.key,
1415
+ }));
1416
+ this.columns.set(columns);
1417
+ // Reading blocked (access = Write / None): keep the columns, drop records.
1418
+ if (!this.canRead()) {
1419
+ this.rows.set([]);
1420
+ return;
1421
+ }
1422
+ const rows = (response.records ?? []).map((record) => {
1423
+ const values = {};
1424
+ const row = {
1425
+ Id: record.id,
1426
+ [ROW_ID_KEY]: `entity-${record.id}`,
1427
+ [ROW_ENTITY_ID_KEY]: record.id,
1428
+ };
1429
+ for (const column of columns) {
1430
+ const property = propertyByKey.get(column.key) ??
1431
+ propertyByNormalizedKey.get(column.key);
1432
+ const propertyKey = property?.key ?? column.key;
1433
+ const cell = record.values?.[propertyKey];
1434
+ row[column.key] = this.toEntityData(column, cell, property, record.id);
1435
+ // Keep the machine-readable value so the edit dialog can pre-fill and
1436
+ // partial updates can be diffed against it.
1437
+ values[propertyKey] = cell?.raw ?? cell?.value ?? null;
1438
+ }
1439
+ row[ROW_VALUES_KEY] = values;
1440
+ return row;
1441
+ });
1442
+ this.rows.set(rows);
1443
+ }
1444
+ toEntityData(column, cell, property, recordId) {
1445
+ return {
1446
+ id: recordId,
1447
+ propertyId: property?.id,
1448
+ key: property?.key ?? column.key,
1449
+ normalizedKey: property?.normalizedKey ?? column.key,
1450
+ name: column.label ?? property?.label ?? column.key,
1451
+ rawValue: cell?.raw === null || cell?.raw === undefined
1452
+ ? undefined
1453
+ : String(cell.raw),
1454
+ value: (cell?.value ?? ''),
1455
+ viewType: (column.viewType ?? 'Text'),
1456
+ type: property?.source,
1457
+ order: column.order ?? property?.order,
1458
+ configuration: column.configuration,
1459
+ propertyConfiguration: property?.configuration ?? undefined,
1460
+ comparison: cell?.comparison,
1461
+ };
1462
+ }
1463
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, deps: [], target: i0.ɵɵFactoryTarget.Component });
1464
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListField, isStandalone: true, selector: "mt-entity-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (!canRead()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.readingNotAllowed\" | transloco }}\r\n </div>\r\n } @else if (!hasRequiredContext()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.saveFormFirst\" | transloco }}\r\n </div>\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1465
+ }
1466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, decorators: [{
1467
+ type: Component,
1468
+ args: [{ selector: 'mt-entity-list-field', standalone: true, imports: [
1469
+ CommonModule,
1470
+ FieldValidation,
1471
+ Skeleton,
1472
+ Message,
1473
+ Table,
1474
+ Button,
1475
+ TranslocoPipe,
1476
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'grid gap-1' }, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (!canRead()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.readingNotAllowed\" | transloco }}\r\n </div>\r\n } @else if (!hasRequiredContext()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.saveFormFirst\" | transloco }}\r\n </div>\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
1477
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], runtimeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "runtimeContext", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
1478
+
1479
+ /** Page size when loading the full deliverable list, and a hard safety cap. */
1480
+ const PAGE_SIZE = 100;
1481
+ const MAX_ITEMS = 5000;
1482
+ /**
1483
+ * Runtime picker for `ScheduleItemSelector` properties.
1484
+ *
1485
+ * Backend-filtered: the full option list comes from
1486
+ * `GET forms/options/{propertyKey}` (which applies the configured rule, e.g.
1487
+ * `DeliverableAcceptance.AvailableDeliverables`). All available items are
1488
+ * loaded up front and rendered with the standard `mt-select-field` /
1489
+ * `mt-multi-select-field`; the field shows only the item name.
1490
+ *
1491
+ * The control value is always a numeric id array (`valueMode = "IdArray"`).
1492
+ * In `Single` mode only one id may be selected.
1493
+ */
1494
+ class ScheduleItemSelectorField {
1495
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
1496
+ placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
1497
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
1498
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
1499
+ propertyKey = input('', ...(ngDevMode ? [{ debugName: "propertyKey" }] : /* istanbul ignore next */ []));
1500
+ selectionMode = input('Multi', ...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
1501
+ runtimeContext = input(null, ...(ngDevMode ? [{ debugName: "runtimeContext" }] : /* istanbul ignore next */ []));
1502
+ context = input(undefined, ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
1503
+ /** Full list of available deliverables (loaded once). */
1504
+ options = signal([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
1505
+ loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
1506
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
1507
+ /** Selected ids — the control value (`number[]`). */
1508
+ value = signal([], ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1509
+ isMultiple = computed(() => this.selectionMode() !== 'Single', ...(ngDevMode ? [{ debugName: "isMultiple" }] : /* istanbul ignore next */ []));
1510
+ /** Single-mode ngModel value (a scalar id, not an array). */
1511
+ singleValue = computed(() => this.value()[0] ?? null, ...(ngDevMode ? [{ debugName: "singleValue" }] : /* istanbul ignore next */ []));
1512
+ ngControl = null;
1513
+ onTouched = () => { };
1514
+ onModelChange = () => { };
1515
+ http = inject(HttpClient);
1516
+ destroyRef = inject(DestroyRef);
1517
+ /** Query signature already loaded — prevents duplicate full loads. */
1518
+ loadedKey = null;
1519
+ constructor() {
1520
+ this.ngControl = inject(NgControl, { self: true, optional: true });
1521
+ if (this.ngControl) {
1522
+ this.ngControl.valueAccessor = this;
1523
+ }
1524
+ effect(() => {
1525
+ if (this.ngControl?.control && this.required()) {
1526
+ this.ngControl.control.addValidators(Validators.required);
1527
+ this.ngControl.control.updateValueAndValidity();
1528
+ }
1529
+ });
1530
+ // Load the full option list as soon as the query context is available.
1531
+ effect(() => {
1532
+ const key = this.queryKey();
1533
+ if (!key || this.loadedKey === key)
1534
+ return;
1535
+ untracked(() => this.loadAllOptions(key));
1536
+ });
1537
+ }
1538
+ // ── Selection ──────────────────────────────────────────────────────────
1539
+ onMultiChange(ids) {
1540
+ this.value.set(ids ?? []);
1541
+ this.emit();
1542
+ }
1543
+ onSingleChange(id) {
1544
+ this.value.set(id == null ? [] : [id]);
1545
+ this.emit();
1546
+ }
1547
+ // ── ControlValueAccessor ────────────────────────────────────────────────
1548
+ writeValue(value) {
1549
+ this.value.set(this.normalizeIds(value));
1550
+ }
1551
+ registerOnChange(fn) {
1552
+ this.onModelChange = fn;
1553
+ }
1554
+ registerOnTouched(fn) {
1555
+ this.onTouched = fn;
1556
+ }
1557
+ setDisabledState(disabled) {
1558
+ this.disabled.set(disabled);
1559
+ }
1560
+ // ── Option loading ──────────────────────────────────────────────────────
1561
+ loadAllOptions(key) {
1562
+ this.loadedKey = key;
1563
+ this.loading.set(true);
1564
+ this.fetchPage(0)
1565
+ .pipe(expand((page) => page.hasMore && page.nextSkip < MAX_ITEMS
1566
+ ? this.fetchPage(page.nextSkip)
1567
+ : EMPTY), reduce((acc, page) => acc.concat(page.options), []), takeUntilDestroyed(this.destroyRef), finalize(() => this.loading.set(false)), catchError(() => of([])))
1568
+ .subscribe((options) => this.options.set(options));
1569
+ }
1570
+ fetchPage(skip) {
1571
+ const params = this.buildParams(skip);
1572
+ if (!params) {
1573
+ return of({ options: [], hasMore: false, nextSkip: skip });
1574
+ }
1575
+ return this.http
1576
+ .get(`forms/options/${encodeURIComponent(this.propertyKey())}`, { params, context: this.context() })
1577
+ .pipe(map((response) => ({
1578
+ options: this.mapOptions(response),
1579
+ hasMore: !!response?.data?.hasMore,
1580
+ nextSkip: skip + PAGE_SIZE,
1581
+ })));
1582
+ }
1583
+ buildParams(skip) {
1584
+ const contextKey = this.buildContextKey();
1585
+ const levelDataId = this.runtimeContext()?.levelDataId;
1586
+ if (!contextKey || levelDataId == null)
1587
+ return null;
1588
+ let params = new HttpParams()
1589
+ .set('contextKey', contextKey)
1590
+ .set('levelDataId', String(levelDataId))
1591
+ .set('skip', String(skip))
1592
+ .set('take', String(PAGE_SIZE));
1593
+ const ownerRecordId = this.runtimeContext()?.ownerRecordId;
1594
+ if (ownerRecordId != null) {
1595
+ params = params.set('ownerRecordId', String(ownerRecordId));
1596
+ }
1597
+ return params;
1598
+ }
1599
+ mapOptions(response) {
1600
+ const items = response?.data?.items ?? [];
1601
+ return items
1602
+ .map((item) => {
1603
+ const id = Number(item.key);
1604
+ if (!Number.isFinite(id))
1605
+ return null;
1606
+ return { label: item.name || String(id), value: id };
1607
+ })
1608
+ .filter((option) => option != null);
1609
+ }
1610
+ // ── Context helpers ─────────────────────────────────────────────────────
1611
+ buildContextKey() {
1612
+ const levelId = this.runtimeContext()?.levelId;
1613
+ const moduleId = this.runtimeContext()?.moduleId;
1614
+ if (levelId == null || moduleId == null)
1615
+ return null;
1616
+ return `Level:${levelId}/Module:${moduleId}`;
1617
+ }
1618
+ queryKey() {
1619
+ const contextKey = this.buildContextKey();
1620
+ const levelDataId = this.runtimeContext()?.levelDataId;
1621
+ const propertyKey = this.propertyKey();
1622
+ if (!contextKey || levelDataId == null || !propertyKey)
1623
+ return null;
1624
+ const ownerRecordId = this.runtimeContext()?.ownerRecordId ?? '';
1625
+ return `${contextKey}|${levelDataId}|${ownerRecordId}|${propertyKey}`;
1626
+ }
1627
+ emit() {
1628
+ this.onModelChange(this.value());
1629
+ this.onTouched();
1630
+ }
1631
+ normalizeIds(value) {
1632
+ const raw = Array.isArray(value) ? value : value == null ? [] : [value];
1633
+ const ids = [];
1634
+ for (const entry of raw) {
1635
+ const id = entry && typeof entry === 'object'
1636
+ ? Number(entry.id)
1637
+ : Number(entry);
1638
+ if (Number.isFinite(id) && id > 0 && !ids.includes(id)) {
1639
+ ids.push(id);
1640
+ }
1641
+ }
1642
+ return ids;
1643
+ }
1644
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ScheduleItemSelectorField, deps: [], target: i0.ɵɵFactoryTarget.Component });
1645
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ScheduleItemSelectorField, isStandalone: true, selector: "mt-schedule-item-selector-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyKey: { classPropertyName: "propertyKey", publicName: "propertyKey", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, ngImport: i0, template: "@if (isMultiple()) {\r\n <mt-multi-select-field\r\n [label]=\"label()\"\r\n [placeholder]=\"placeholder()\"\r\n [options]=\"options()\"\r\n [optionLabel]=\"'label'\"\r\n [optionValue]=\"'value'\"\r\n [filter]=\"options().length > 10\"\r\n [showClear]=\"!required()\"\r\n [required]=\"required()\"\r\n [readonly]=\"readonly() || disabled()\"\r\n [ngModel]=\"value()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"onMultiChange($event)\"\r\n />\r\n} @else {\r\n <mt-select-field\r\n [label]=\"label()\"\r\n [placeholder]=\"placeholder()\"\r\n [options]=\"options()\"\r\n [optionLabel]=\"'label'\"\r\n [optionValue]=\"'value'\"\r\n [filter]=\"options().length > 10\"\r\n [showClear]=\"!required()\"\r\n [loading]=\"loading()\"\r\n [required]=\"required()\"\r\n [readonly]=\"readonly() || disabled()\"\r\n [ngModel]=\"singleValue()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"onSingleChange($event)\"\r\n />\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1646
+ }
1647
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ScheduleItemSelectorField, decorators: [{
1648
+ type: Component,
1649
+ args: [{ selector: 'mt-schedule-item-selector-field', standalone: true, imports: [FormsModule, MultiSelectField, SelectField], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1650
+ class: 'block',
1651
+ }, template: "@if (isMultiple()) {\r\n <mt-multi-select-field\r\n [label]=\"label()\"\r\n [placeholder]=\"placeholder()\"\r\n [options]=\"options()\"\r\n [optionLabel]=\"'label'\"\r\n [optionValue]=\"'value'\"\r\n [filter]=\"options().length > 10\"\r\n [showClear]=\"!required()\"\r\n [required]=\"required()\"\r\n [readonly]=\"readonly() || disabled()\"\r\n [ngModel]=\"value()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"onMultiChange($event)\"\r\n />\r\n} @else {\r\n <mt-select-field\r\n [label]=\"label()\"\r\n [placeholder]=\"placeholder()\"\r\n [options]=\"options()\"\r\n [optionLabel]=\"'label'\"\r\n [optionValue]=\"'value'\"\r\n [filter]=\"options().length > 10\"\r\n [showClear]=\"!required()\"\r\n [loading]=\"loading()\"\r\n [required]=\"required()\"\r\n [readonly]=\"readonly() || disabled()\"\r\n [ngModel]=\"singleValue()\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"onSingleChange($event)\"\r\n />\r\n}\r\n" }]
1652
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], propertyKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyKey", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], runtimeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "runtimeContext", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
1653
+
1654
+ /**
1655
+ * Token used by `mt-lookup-module-check-list-field` to render the checklist
1656
+ * sections + per-section forms via `@masterteam/forms`'s `mt-client-form`
1657
+ * machinery (`/api/process-form-load`, loaded once). Apps register it with
1658
+ * `provideLookupModuleCheckListForm()` from
1659
+ * `@masterteam/forms/lookup-module-check-list-form`. When the token is not
1660
+ * registered, the field falls back to plain text inputs per property.
1661
+ */
1662
+ const LOOKUP_CHECK_LIST_FORM_COMPONENT = new InjectionToken('LOOKUP_CHECK_LIST_FORM_COMPONENT');
1663
+
1664
+ class LookupModuleCheckListField {
1665
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
1666
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
1667
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
1668
+ /** Lookup items rendered as collapsible checklist sections. */
1669
+ lookupOptions = input([], ...(ngDevMode ? [{ debugName: "lookupOptions" }] : /* istanbul ignore next */ []));
1670
+ /** Full lookup catalog passed to the rich nested form renderer. */
1671
+ lookups = input([], ...(ngDevMode ? [{ debugName: "lookups" }] : /* istanbul ignore next */ []));
1672
+ /** Module property keys/labels (used by the text fallback + labels). */
1673
+ propertyFields = input([], ...(ngDevMode ? [{ debugName: "propertyFields" }] : /* istanbul ignore next */ []));
1674
+ /** Scope module id whose form is loaded for each section. */
1675
+ scopeId = input(null, ...(ngDevMode ? [{ debugName: "scopeId" }] : /* istanbul ignore next */ []));
1676
+ /** Property keys to render in each section form. */
1677
+ propertyKeys = input([], ...(ngDevMode ? [{ debugName: "propertyKeys" }] : /* istanbul ignore next */ []));
1678
+ /** Runtime ids needed to load each section form. */
1679
+ runtimeContext = input(null, ...(ngDevMode ? [{ debugName: "runtimeContext" }] : /* istanbul ignore next */ []));
1680
+ /** Per-lookupKey captured values, keyed by property key. */
1681
+ sectionValues = signal({}, ...(ngDevMode ? [{ debugName: "sectionValues" }] : /* istanbul ignore next */ []));
1682
+ expandedKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedKeys" }] : /* istanbul ignore next */ []));
1683
+ disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
1684
+ /** True when a section's required inner fields are unfilled. */
1685
+ incomplete = signal(false, ...(ngDevMode ? [{ debugName: "incomplete" }] : /* istanbul ignore next */ []));
1686
+ ngControl = null;
1687
+ /**
1688
+ * Rich checklist form provided by `@masterteam/forms`
1689
+ * (`provideLookupModuleCheckListForm()`). When absent the field falls back to
1690
+ * plain text inputs per property.
1691
+ */
1692
+ formComponent = inject(LOOKUP_CHECK_LIST_FORM_COMPONENT, {
1693
+ optional: true,
1694
+ });
1695
+ isReadonly = computed(() => this.readonly() || this.disabled(), ...(ngDevMode ? [{ debugName: "isReadonly" }] : /* istanbul ignore next */ []));
1696
+ sections = computed(() => this.lookupOptions().map((option) => ({
1697
+ lookupKey: String(option.value ?? option.key ?? ''),
1698
+ label: option.label ?? String(option.value ?? option.key ?? ''),
1699
+ })), ...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
1700
+ /**
1701
+ * Use the rich form whenever it's registered and a scope module is set. The
1702
+ * scope form only needs `scopeId` to load its field definitions; `levelId` /
1703
+ * `levelDataId` are passed when available but are not required (e.g. they are
1704
+ * null while creating a brand-new Level instance).
1705
+ */
1706
+ useRichForm = computed(() => !!this.formComponent && this.scopeId() != null, ...(ngDevMode ? [{ debugName: "useRichForm" }] : /* istanbul ignore next */ []));
1707
+ /**
1708
+ * The last externally-written value (via `writeValue`). Passed to the rich
1709
+ * form as its initial value. It is intentionally NOT updated from the form's
1710
+ * own `valueChange` — feeding emitted values back as an input would create an
1711
+ * infinite change-detection loop.
1712
+ */
1713
+ incomingValue = signal(null, ...(ngDevMode ? [{ debugName: "incomingValue" }] : /* istanbul ignore next */ []));
1714
+ onTouched = () => { };
1715
+ onModelChange = () => { };
1716
+ control = null;
1717
+ validatorAttached = false;
1718
+ /**
1719
+ * Validator attached imperatively to the host control. Attaching it here
1720
+ * (rather than via an `NG_VALIDATORS` provider) avoids a circular dependency
1721
+ * with the self-injected `NgControl` used as the value accessor.
1722
+ */
1723
+ checklistValidator = () => this.incomplete() ? { checklistIncomplete: true } : null;
1724
+ /** Stable callbacks so the outlet inputs object stays referentially calm. */
1725
+ emitValue = (value) => {
1726
+ // The rich form is the source of truth; forward its value without writing
1727
+ // back into `incomingValue` (which would re-feed the form and loop).
1728
+ this.onModelChange(value ?? null);
1729
+ this.onTouched();
1730
+ };
1731
+ emitValidity = (invalid) => {
1732
+ if (this.incomplete() === invalid)
1733
+ return;
1734
+ this.incomplete.set(invalid);
1735
+ this.ensureValidator();
1736
+ this.control?.updateValueAndValidity({ emitEvent: false });
1737
+ };
1738
+ constructor() {
1739
+ this.ngControl = inject(NgControl, { self: true, optional: true });
1740
+ if (this.ngControl) {
1741
+ this.ngControl.valueAccessor = this;
1742
+ }
1743
+ }
1744
+ ngOnInit() {
1745
+ this.ensureValidator();
1746
+ this.control?.updateValueAndValidity({ emitEvent: false });
1747
+ }
1748
+ ensureValidator() {
1749
+ if (this.validatorAttached)
1750
+ return;
1751
+ const control = this.ngControl?.control;
1752
+ if (!control)
1753
+ return;
1754
+ this.control = control;
1755
+ control.addValidators(this.checklistValidator);
1756
+ this.validatorAttached = true;
1757
+ }
1758
+ // ============================================================================
1759
+ // CVA
1760
+ // ============================================================================
1761
+ writeValue(value) {
1762
+ this.incomingValue.set(value);
1763
+ this.sectionValues.set(this.normalizeIncoming(value));
1764
+ }
1765
+ registerOnChange(fn) {
1766
+ this.onModelChange = fn;
1767
+ }
1768
+ registerOnTouched(fn) {
1769
+ this.onTouched = fn;
1770
+ }
1771
+ setDisabledState(isDisabled) {
1772
+ this.disabled.set(isDisabled);
1773
+ }
1774
+ // ============================================================================
1775
+ // Rich form host
1776
+ // ============================================================================
1777
+ formInputs = computed(() => ({
1778
+ lookupOptions: this.lookupOptions(),
1779
+ lookups: this.lookups(),
1780
+ propertyKeys: this.propertyKeys(),
1781
+ moduleId: this.scopeId(),
1782
+ levelId: this.runtimeContext()?.levelId ?? null,
1783
+ levelDataId: this.runtimeContext()?.levelDataId ?? null,
1784
+ value: this.incomingValue(),
1785
+ readonly: this.isReadonly(),
1786
+ valueChange: this.emitValue,
1787
+ validityChange: this.emitValidity,
1788
+ }), ...(ngDevMode ? [{ debugName: "formInputs" }] : /* istanbul ignore next */ []));
1789
+ // ============================================================================
1790
+ // Text fallback (no rich form registered)
1791
+ // ============================================================================
1792
+ isExpanded(lookupKey) {
1793
+ return this.expandedKeys().has(lookupKey);
1794
+ }
1795
+ toggle(lookupKey) {
1796
+ const next = new Set(this.expandedKeys());
1797
+ if (next.has(lookupKey)) {
1798
+ next.delete(lookupKey);
1799
+ }
1800
+ else {
1801
+ next.add(lookupKey);
1802
+ }
1803
+ this.expandedKeys.set(next);
1804
+ }
1805
+ hasValues(lookupKey) {
1806
+ const values = this.sectionValues()[lookupKey];
1807
+ if (!values)
1808
+ return false;
1809
+ return Object.values(values).some((v) => v != null && v !== '');
1810
+ }
1811
+ fieldValue(lookupKey, propKey) {
1812
+ const raw = this.sectionValues()[lookupKey]?.[propKey];
1813
+ return raw == null ? '' : String(raw);
1814
+ }
1815
+ setFieldValue(lookupKey, propKey, value) {
1816
+ this.sectionValues.update((current) => ({
1817
+ ...current,
1818
+ [lookupKey]: { ...(current[lookupKey] ?? {}), [propKey]: value },
1819
+ }));
1820
+ this.pushModelValue();
1821
+ }
1822
+ // ============================================================================
1823
+ // Value mapping
1824
+ // ============================================================================
1825
+ pushModelValue() {
1826
+ const payload = this.buildPayload();
1827
+ this.onModelChange(payload.length ? payload : null);
1828
+ this.onTouched();
1829
+ }
1830
+ buildPayload() {
1831
+ const keys = this.propertyKeys();
1832
+ const values = this.sectionValues();
1833
+ return this.sections()
1834
+ .filter((section) => this.hasValues(section.lookupKey))
1835
+ .map((section) => ({
1836
+ lookupKey: section.lookupKey,
1837
+ props: keys.map((key) => ({
1838
+ key,
1839
+ value: values[section.lookupKey]?.[key] ?? null,
1840
+ })),
1841
+ }));
1842
+ }
1843
+ normalizeIncoming(value) {
1844
+ const raw = this.extractEntries(value);
1845
+ const result = {};
1846
+ for (const entry of raw) {
1847
+ if (!entry || typeof entry !== 'object')
1848
+ continue;
1849
+ const record = entry;
1850
+ const lookupKeyRaw = record['lookupKey'] ?? record['Lookupkey'] ?? record['lookupkey'];
1851
+ const lookupKey = lookupKeyRaw == null ? '' : String(lookupKeyRaw);
1852
+ if (!lookupKey)
1853
+ continue;
1854
+ const propsRaw = record['props'] ?? record['Props'];
1855
+ const values = {};
1856
+ if (Array.isArray(propsRaw)) {
1857
+ for (const prop of propsRaw) {
1858
+ const propRecord = (prop ?? {});
1859
+ const key = String(propRecord['key'] ?? propRecord['Key'] ?? '');
1860
+ if (!key)
1861
+ continue;
1862
+ values[key] = propRecord['value'] ?? propRecord['Value'] ?? null;
1863
+ }
1864
+ }
1865
+ result[lookupKey] = values;
1866
+ }
1867
+ return result;
1868
+ }
1869
+ extractEntries(value) {
1870
+ if (Array.isArray(value)) {
1871
+ return value;
1872
+ }
1873
+ const wrapped = value?.items;
1874
+ if (Array.isArray(wrapped)) {
1875
+ return wrapped;
1876
+ }
1877
+ if (typeof value === 'string' && value.trim()) {
1878
+ try {
1879
+ return this.extractEntries(JSON.parse(value));
1880
+ }
1881
+ catch {
1882
+ return [];
1883
+ }
1884
+ }
1885
+ return [];
1886
+ }
1887
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LookupModuleCheckListField, deps: [], target: i0.ɵɵFactoryTarget.Component });
1888
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LookupModuleCheckListField, isStandalone: true, selector: "mt-lookup-module-check-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, lookupOptions: { classPropertyName: "lookupOptions", publicName: "lookupOptions", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, propertyFields: { classPropertyName: "propertyFields", publicName: "propertyFields", isSignal: true, isRequired: false, transformFunction: null }, scopeId: { classPropertyName: "scopeId", publicName: "scopeId", isSignal: true, isRequired: false, transformFunction: null }, propertyKeys: { classPropertyName: "propertyKeys", publicName: "propertyKeys", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-2" }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (useRichForm()) {\r\n <ng-container\r\n [ngComponentOutlet]=\"formComponent!\"\r\n [ngComponentOutletInputs]=\"formInputs()\"\r\n />\r\n } @else if (sections().length) {\r\n <!-- Fallback: plain text inputs per property (no rich form registered) -->\r\n <div class=\"flex flex-col gap-2\">\r\n @for (section of sections(); track section.lookupKey) {\r\n <div class=\"overflow-hidden rounded-lg border border-surface-200\">\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-between gap-2 bg-surface-50 px-3 py-2 text-start hover:bg-surface-100\"\r\n [attr.aria-expanded]=\"isExpanded(section.lookupKey)\"\r\n (click)=\"toggle(section.lookupKey)\"\r\n >\r\n <span class=\"flex min-w-0 items-center gap-2\">\r\n <mt-icon\r\n [icon]=\"\r\n isExpanded(section.lookupKey)\r\n ? 'arrow.chevron-down'\r\n : 'arrow.chevron-right'\r\n \"\r\n size=\"sm\"\r\n class=\"shrink-0 text-muted-color rtl:-scale-x-100\"\r\n />\r\n <span class=\"truncate text-sm font-medium text-color\">\r\n {{ section.label }}\r\n </span>\r\n </span>\r\n @if (hasValues(section.lookupKey)) {\r\n <span\r\n class=\"shrink-0 rounded-full bg-primary-50 px-2 py-0.5 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ \"components.lookupModuleCheckListField.filled\" | transloco }}\r\n </span>\r\n }\r\n </button>\r\n\r\n @if (isExpanded(section.lookupKey) && propertyFields().length) {\r\n <div class=\"border-t border-surface-200 p-3\">\r\n <div class=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\r\n @for (field of propertyFields(); track field.key) {\r\n <label class=\"flex min-w-0 flex-col gap-1\">\r\n <span class=\"truncate text-xs text-muted-color\">\r\n {{ field.label }}\r\n </span>\r\n @if (isReadonly()) {\r\n <span class=\"truncate text-sm text-color\">\r\n {{ fieldValue(section.lookupKey, field.key) || \"_\" }}\r\n </span>\r\n } @else {\r\n <input\r\n pInputText\r\n class=\"w-full\"\r\n [ngModel]=\"fieldValue(section.lookupKey, field.key)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"\r\n setFieldValue(section.lookupKey, field.key, $event)\r\n \"\r\n />\r\n }\r\n </label>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.lookupModuleCheckListField.empty\" | transloco }}\r\n </div>\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1889
+ }
1890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LookupModuleCheckListField, decorators: [{
1891
+ type: Component,
1892
+ args: [{ selector: 'mt-lookup-module-check-list-field', standalone: true, imports: [
1893
+ FormsModule,
1894
+ NgComponentOutlet,
1895
+ InputTextModule,
1896
+ Icon,
1897
+ FieldValidation,
1898
+ TranslocoPipe,
1899
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'grid gap-2' }, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (useRichForm()) {\r\n <ng-container\r\n [ngComponentOutlet]=\"formComponent!\"\r\n [ngComponentOutletInputs]=\"formInputs()\"\r\n />\r\n } @else if (sections().length) {\r\n <!-- Fallback: plain text inputs per property (no rich form registered) -->\r\n <div class=\"flex flex-col gap-2\">\r\n @for (section of sections(); track section.lookupKey) {\r\n <div class=\"overflow-hidden rounded-lg border border-surface-200\">\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-between gap-2 bg-surface-50 px-3 py-2 text-start hover:bg-surface-100\"\r\n [attr.aria-expanded]=\"isExpanded(section.lookupKey)\"\r\n (click)=\"toggle(section.lookupKey)\"\r\n >\r\n <span class=\"flex min-w-0 items-center gap-2\">\r\n <mt-icon\r\n [icon]=\"\r\n isExpanded(section.lookupKey)\r\n ? 'arrow.chevron-down'\r\n : 'arrow.chevron-right'\r\n \"\r\n size=\"sm\"\r\n class=\"shrink-0 text-muted-color rtl:-scale-x-100\"\r\n />\r\n <span class=\"truncate text-sm font-medium text-color\">\r\n {{ section.label }}\r\n </span>\r\n </span>\r\n @if (hasValues(section.lookupKey)) {\r\n <span\r\n class=\"shrink-0 rounded-full bg-primary-50 px-2 py-0.5 text-xs font-semibold text-primary-700\"\r\n >\r\n {{ \"components.lookupModuleCheckListField.filled\" | transloco }}\r\n </span>\r\n }\r\n </button>\r\n\r\n @if (isExpanded(section.lookupKey) && propertyFields().length) {\r\n <div class=\"border-t border-surface-200 p-3\">\r\n <div class=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\r\n @for (field of propertyFields(); track field.key) {\r\n <label class=\"flex min-w-0 flex-col gap-1\">\r\n <span class=\"truncate text-xs text-muted-color\">\r\n {{ field.label }}\r\n </span>\r\n @if (isReadonly()) {\r\n <span class=\"truncate text-sm text-color\">\r\n {{ fieldValue(section.lookupKey, field.key) || \"_\" }}\r\n </span>\r\n } @else {\r\n <input\r\n pInputText\r\n class=\"w-full\"\r\n [ngModel]=\"fieldValue(section.lookupKey, field.key)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"\r\n setFieldValue(section.lookupKey, field.key, $event)\r\n \"\r\n />\r\n }\r\n </label>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.lookupModuleCheckListField.empty\" | transloco }}\r\n </div>\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n" }]
1900
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], lookupOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookupOptions", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], propertyFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyFields", required: false }] }], scopeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "scopeId", required: false }] }], propertyKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyKeys", required: false }] }], runtimeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "runtimeContext", required: false }] }] } });
1901
+
1902
+ /**
1903
+ * Generated bundle index. Do not edit.
1904
+ */
1905
+
1906
+ export { ENTITY_LIST_ADD_DIALOG_COMPONENT, EntityListField, LOOKUP_CHECK_LIST_FORM_COMPONENT, LookupMatrixField, LookupModuleCheckListField, ScheduleItemSelectorField, SchedulePredecessorField, SchemaConnectionField };
1907
+ //# sourceMappingURL=masterteam-components-business-fields.mjs.map