@masterteam/components 0.0.264 → 0.0.265

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (756) hide show
  1. package/.angular/cache/21.2.7/@masterteam/components/.tsbuildinfo +1 -0
  2. package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db +0 -0
  3. package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db-lock +0 -0
  4. package/.angular/cache/21.2.7/ng-packagr/045efd332b9db1d21b3a595a37ae03ebb11b457a5dc6e2d1cbc561b694e17f1a +1 -0
  5. package/.angular/cache/21.2.7/ng-packagr/0727b170af3d53236c0cafe16ea670d089e48d4c5c525b1dbcc1c684bb6e99c7 +1 -0
  6. package/.angular/cache/21.2.7/ng-packagr/0873bc9048494ebc33fe0a7b856324c7c4ca681b0dcaa87338e3290186906d49 +1 -0
  7. package/.angular/cache/21.2.7/ng-packagr/1010cd8fc996d0c2df519ed60085f4b1f38ccfc873900055bc75fc20a3c26bab +1 -0
  8. package/.angular/cache/21.2.7/ng-packagr/12379a8ab7254ad3df2635823a358cfce32e6d0f390be68596cc97e02307e6c4 +1 -0
  9. package/.angular/cache/21.2.7/ng-packagr/1239e7a937657b62f858d17d47738ed30facbdaa91032511e29ed148b748400b +1 -0
  10. package/.angular/cache/21.2.7/ng-packagr/133b9ecf47ba424244902da90d77cd3f135b85f95c01b16de7b2247f57518f01 +1 -0
  11. package/.angular/cache/21.2.7/ng-packagr/175d45dc6da51834e7fe937c09d23dbf28d2a823f838ef5271fd3e148776d6ec +1 -0
  12. package/.angular/cache/21.2.7/ng-packagr/19d99ad4d927324b03cdbef34331ba2c58bd580f1f0ca591cb5f8dbf436c913c +1 -0
  13. package/.angular/cache/21.2.7/ng-packagr/1a86918763f95c1c2b9fa781bda1ceedf15aead87f0e11ea1324318af43a897a +1 -0
  14. package/.angular/cache/21.2.7/ng-packagr/1f08100dbc280be7da64c809315376eb7d0cfd074916a6042f609f03f4276a8e +1 -0
  15. package/.angular/cache/21.2.7/ng-packagr/2224877a7e762b86541428e4c40d61f54f505867c305769ae42e67e4aa81bd93 +1 -0
  16. package/.angular/cache/21.2.7/ng-packagr/24957fb7ec060692ebcf1471e1bdce39f40aed938959e580048ade58015762d2 +1 -0
  17. package/.angular/cache/21.2.7/ng-packagr/295fcdc1c4462e7feae96a24255369508a559faaecc4676267749a7ce23e4b6d +1 -0
  18. package/.angular/cache/21.2.7/ng-packagr/2b37e2f2d6564d10bad1fd0ecc16453962fd855cd1e36ad7aa24baf3e4f2e8b3 +1 -0
  19. package/.angular/cache/21.2.7/ng-packagr/2c20f0929771e857b570ba2beffe91f598f299ce26d4825fe4315bfe5a3dd40a +1 -0
  20. package/.angular/cache/21.2.7/ng-packagr/37dea2e5798cad4a21d66292eeed5be26d04500d9a1534332ad42ce664a058c2 +1 -0
  21. package/.angular/cache/21.2.7/ng-packagr/3b6239b640fcb5ea7067a2655a2901d32f55372812b586aa008e77c59e8f2090 +1 -0
  22. package/.angular/cache/21.2.7/ng-packagr/3beb1b4dfe75d1e6749cf91f05d51ba4eece939f5c15f6f33ed587bfd198f0a3 +1 -0
  23. package/.angular/cache/21.2.7/ng-packagr/3f161e6c2ead4519d0663dd79199dafceb2cc22da7ce92a72b809b93bfce0bb0 +1 -0
  24. package/.angular/cache/21.2.7/ng-packagr/43551862d17cd02626e18b30243390081a6247784485660048b060a3d4ab7fa7 +1 -0
  25. package/.angular/cache/21.2.7/ng-packagr/47aedf032519b41d96866fcf8fbd4f1dfd29f9e9a534b39dee0e44d402227d2d +1 -0
  26. package/.angular/cache/21.2.7/ng-packagr/4a1768888c60921955bfdfba8b31c8d853bd7b2a7d3a7b83934de049e1e6e6a2 +1 -0
  27. package/.angular/cache/21.2.7/ng-packagr/4a783e339117597607bff17eeca0ad24d84b8cbc1e28927e7e453ccfa6223180 +1 -0
  28. package/.angular/cache/21.2.7/ng-packagr/4d9331b2050326f586cd8f6593a9e04e1c7944b2f9e98023649023c099597a5d +1 -0
  29. package/.angular/cache/21.2.7/ng-packagr/4e379f506919d47af7008658c75242aa05f0056c1caec4061d7fa5746f776049 +1 -0
  30. package/.angular/cache/21.2.7/ng-packagr/55009bb7d44552dd816ce32fa2b0f7985f3f08fefd6409c2b4f6b9ffe35dad83 +1 -0
  31. package/.angular/cache/21.2.7/ng-packagr/58ae3f1f9664f7b16844d2e4a279dd4ca9371de014cf5687320c2d5cb259a74f +1 -0
  32. package/.angular/cache/21.2.7/ng-packagr/5c08e906bd3fe1aa6c1d62f2bbb2b3f276e1c17fe45ef081e76bd1b865ac3dfa +1 -0
  33. package/.angular/cache/21.2.7/ng-packagr/5ce333a40ad635188347fa9bc601d5fd14be6baacbae7d096259d725ac9757af +1 -0
  34. package/.angular/cache/21.2.7/ng-packagr/5f32cceaee6a6ea19cc6cbff5ea089b752f13a0fdcd32597d4c99d5e1e031bb5 +1 -0
  35. package/.angular/cache/21.2.7/ng-packagr/691ad4ccdc0a8ede36e1f4e5e97638c20c2d3142916ffac3a1b172178c139205 +1 -0
  36. package/.angular/cache/21.2.7/ng-packagr/6b57160e0d2da3f31693831e84a3f4209c1f33a04abd636e34af03956e7329d8 +1 -0
  37. package/.angular/cache/21.2.7/ng-packagr/70bc711a1d7b631845885c26adc2d6b1bff47d11332b2625cedfa11e9d5ac79a +1 -0
  38. package/.angular/cache/21.2.7/ng-packagr/7427c266237012afaef486c2af94ee08a491e8d7b6fc7e5ee887980830bbd333 +1 -0
  39. package/.angular/cache/21.2.7/ng-packagr/7e8fa7c61cf9a932ba3a0e65eb73c7412e81666b7a8f923dac7b75acfbb94b1d +1 -0
  40. package/.angular/cache/21.2.7/ng-packagr/81aab7fdab43cbdfa869db759d6113ae01ec6f5e0e9061d7fc089c260886e4d1 +1 -0
  41. package/.angular/cache/21.2.7/ng-packagr/83a81758045ff710a34ea3cf6f54435a1f5dea9839d8c0adda0bbce7c3fb6e8b +1 -0
  42. package/.angular/cache/21.2.7/ng-packagr/883eae810a4c09f06617bdc2e4bc30a69f09726401b2a051840969f635d076f1 +1 -0
  43. package/.angular/cache/21.2.7/ng-packagr/8a6b9be66de40c57054dca5fde376c3cec1bec1ae191a16f1ae6a83306d9ebfe +1 -0
  44. package/.angular/cache/21.2.7/ng-packagr/8d42c8144f6929de46984094bf390a0c4168404ab13a5194839f6ba5e42bc3ce +1 -0
  45. package/.angular/cache/21.2.7/ng-packagr/91093656c61a5404f0d576f872247eeb480dd938e6999d481a97893c72b5f3d0 +1 -0
  46. package/.angular/cache/21.2.7/ng-packagr/91e881172037c63d819e30d30e390e0d7dc0dee9808b3902275ccc8b1887d864 +1 -0
  47. package/.angular/cache/21.2.7/ng-packagr/9ef28cf3a676e7bd0d37762c4868b4810efca2f241ed0dae75ebca41988e2c00 +1 -0
  48. package/.angular/cache/21.2.7/ng-packagr/a07cbea405c1831b3f686a8e57c4b500d89cbab2b95e110487890269945feeaa +1 -0
  49. package/.angular/cache/21.2.7/ng-packagr/a463deba940880d9461612c9cd00d90062bf97aa31b1c4556b8b47a967cb6882 +1 -0
  50. package/.angular/cache/21.2.7/ng-packagr/ab03ed1e4a371113b41b663d526d2b06565ceb062e6f033f726f1e455fc5d1d6 +1 -0
  51. package/.angular/cache/21.2.7/ng-packagr/ad0e84be4f2211aff6187b4bec9adbe15f0e8b36851e9c6c63b38303c2daad37 +1 -0
  52. package/.angular/cache/21.2.7/ng-packagr/aece79242dae70eb748605e37483e75e122e4ce414fa8be875499e8af26ee5d6 +1 -0
  53. package/.angular/cache/21.2.7/ng-packagr/aff32db91ce03de30d2bbc84f266fe3fb2c6629d5eeb39a364204d9499484368 +1 -0
  54. package/.angular/cache/21.2.7/ng-packagr/b0671e73a162927d28ef1742ec008e514264bc2ce29f2255bedaea553492fe5d +1 -0
  55. package/.angular/cache/21.2.7/ng-packagr/bb50d71f3cdeebbb85fd983be8103f9c216060464f8e7e534271197391e6dcf7 +1 -0
  56. package/.angular/cache/21.2.7/ng-packagr/c64241290ab30d8761b2f5493a039427f5cda1a48b5be88ce62ee5c714c0f690 +1 -0
  57. package/.angular/cache/21.2.7/ng-packagr/c794d2e79b26ab378c0dbf8afa7b8ac1337ba9afb288941d44a086cb1bd4bad2 +1 -0
  58. package/.angular/cache/21.2.7/ng-packagr/d942edf8fd8e8e884138ffcdb1a07ad14a0b5e211f8ccea1dc9ea0b48f50cfc9 +1 -0
  59. package/.angular/cache/21.2.7/ng-packagr/dbe0b9b9f18ba7b96d9c84f4fd16cde158c9701c202d00113e6f88ba93407bce +1 -0
  60. package/.angular/cache/21.2.7/ng-packagr/f564395a410a2723aac48e582f5fe416bfeaa48677cea47b10c5152d4f2b6672 +1 -0
  61. package/.angular/cache/21.2.7/ng-packagr/fc9b0d27f081ca7b2a4cbefa75136d7bd7a8c341dbaa0587855071a6003906b8 +1 -0
  62. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar-text.tsbuildinfo +1 -0
  63. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar.tsbuildinfo +1 -0
  64. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-breadcrumb.tsbuildinfo +1 -0
  65. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-business-fields.tsbuildinfo +1 -0
  66. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button-group.tsbuildinfo +1 -0
  67. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button.tsbuildinfo +1 -0
  68. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-card.tsbuildinfo +1 -0
  69. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-checkbox-field.tsbuildinfo +1 -0
  70. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-chip.tsbuildinfo +1 -0
  71. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page-menu.tsbuildinfo +1 -0
  72. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page.tsbuildinfo +1 -0
  73. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-color-picker-field.tsbuildinfo +1 -0
  74. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-confirmation.tsbuildinfo +1 -0
  75. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-date-field.tsbuildinfo +1 -0
  76. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dialog.tsbuildinfo +1 -0
  77. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-drawer.tsbuildinfo +1 -0
  78. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dynamic-drawer.tsbuildinfo +1 -0
  79. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-editor-field.tsbuildinfo +1 -0
  80. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-empty-state.tsbuildinfo +1 -0
  81. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-entities.tsbuildinfo +1 -0
  82. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-field-validation.tsbuildinfo +1 -0
  83. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-formula.tsbuildinfo +1 -0
  84. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-icon-field.tsbuildinfo +1 -0
  85. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-list.tsbuildinfo +1 -0
  86. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-location-field.tsbuildinfo +1 -0
  87. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-menu.tsbuildinfo +1 -0
  88. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-modal.tsbuildinfo +1 -0
  89. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-module-summary-card.tsbuildinfo +1 -0
  90. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-multi-select-field.tsbuildinfo +1 -0
  91. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-number-field.tsbuildinfo +1 -0
  92. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page-header.tsbuildinfo +1 -0
  93. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page.tsbuildinfo +1 -0
  94. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-paginator.tsbuildinfo +1 -0
  95. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-pick-list-field.tsbuildinfo +1 -0
  96. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-progress.tsbuildinfo +1 -0
  97. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-property-filter-builder.tsbuildinfo +1 -0
  98. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-button-field.tsbuildinfo +1 -0
  99. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards-field.tsbuildinfo +1 -0
  100. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards.tsbuildinfo +1 -0
  101. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-runtime-action.tsbuildinfo +1 -0
  102. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-select-field.tsbuildinfo +1 -0
  103. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-sidebar.tsbuildinfo +1 -0
  104. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-slider-field.tsbuildinfo +1 -0
  105. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-statistic-card.tsbuildinfo +1 -0
  106. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-table.tsbuildinfo +1 -0
  107. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tabs.tsbuildinfo +1 -0
  108. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-text-field.tsbuildinfo +1 -0
  109. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-textarea-field.tsbuildinfo +1 -0
  110. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toast.tsbuildinfo +1 -0
  111. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toggle-field.tsbuildinfo +1 -0
  112. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tooltip.tsbuildinfo +1 -0
  113. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-topbar.tsbuildinfo +1 -0
  114. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tree.tsbuildinfo +1 -0
  115. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-treeselect-field.tsbuildinfo +1 -0
  116. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-upload-field.tsbuildinfo +1 -0
  117. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-uploader.tsbuildinfo +1 -0
  118. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-user-search-field.tsbuildinfo +1 -0
  119. package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components.tsbuildinfo +1 -0
  120. package/angular.json +32 -0
  121. package/api/api.ts +1 -0
  122. package/api/public-api.ts +5 -0
  123. package/assets/common.css +309 -2
  124. package/avatar/avatar.html +32 -0
  125. package/avatar/avatar.scss +0 -0
  126. package/avatar/avatar.ts +54 -0
  127. package/avatar/ng-package.json +6 -0
  128. package/avatar/public-api.ts +1 -0
  129. package/avatar-text/avatar-text.html +26 -0
  130. package/avatar-text/avatar-text.scss +0 -0
  131. package/avatar-text/avatar-text.ts +52 -0
  132. package/avatar-text/ng-package.json +6 -0
  133. package/avatar-text/public-api.ts +1 -0
  134. package/breadcrumb/breadcrumb.html +53 -0
  135. package/breadcrumb/breadcrumb.scss +0 -0
  136. package/breadcrumb/breadcrumb.ts +26 -0
  137. package/breadcrumb/ng-package.json +6 -0
  138. package/breadcrumb/public-api.ts +1 -0
  139. package/business-fields/entity-list-field/entity-list-add-token.ts +25 -0
  140. package/business-fields/entity-list-field/entity-list-field.html +70 -0
  141. package/business-fields/entity-list-field/entity-list-field.scss +3 -0
  142. package/business-fields/entity-list-field/entity-list-field.ts +1067 -0
  143. package/business-fields/lookup-matrix-field/lookup-matrix-field.html +38 -0
  144. package/business-fields/lookup-matrix-field/lookup-matrix-field.spec.ts +183 -0
  145. package/business-fields/lookup-matrix-field/lookup-matrix-field.ts +239 -0
  146. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.html +95 -0
  147. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.ts +336 -0
  148. package/business-fields/lookup-module-check-list-field/lookup-module-check-list-form-token.ts +42 -0
  149. package/business-fields/ng-package.json +6 -0
  150. package/business-fields/public-api.ts +8 -0
  151. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.html +32 -0
  152. package/business-fields/schedule-item-selector-field/schedule-item-selector-field.ts +272 -0
  153. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.html +89 -0
  154. package/business-fields/schedule-predecessor-field/schedule-predecessor-field.ts +441 -0
  155. package/business-fields/schema-connection-field/schema-connection-field.html +58 -0
  156. package/business-fields/schema-connection-field/schema-connection-field.scss +0 -0
  157. package/business-fields/schema-connection-field/schema-connection-field.ts +456 -0
  158. package/button/button.html +44 -0
  159. package/button/button.scss +0 -0
  160. package/button/button.ts +120 -0
  161. package/button/ng-package.json +6 -0
  162. package/button/public-api.ts +1 -0
  163. package/button-group/button-group.html +3 -0
  164. package/button-group/button-group.scss +20 -0
  165. package/button-group/button-group.ts +12 -0
  166. package/button-group/ng-package.json +6 -0
  167. package/button-group/public-api.ts +1 -0
  168. package/card/card.html +26 -0
  169. package/card/card.scss +0 -0
  170. package/card/card.ts +29 -0
  171. package/card/ng-package.json +6 -0
  172. package/card/public-api.ts +1 -0
  173. package/checkbox-field/checkbox-field.html +31 -0
  174. package/checkbox-field/checkbox-field.scss +0 -0
  175. package/checkbox-field/checkbox-field.spec.ts +21 -0
  176. package/checkbox-field/checkbox-field.ts +123 -0
  177. package/checkbox-field/ng-package.json +6 -0
  178. package/checkbox-field/public-api.ts +1 -0
  179. package/chip/chip.html +16 -0
  180. package/chip/chip.scss +19 -0
  181. package/chip/chip.ts +45 -0
  182. package/chip/ng-package.json +6 -0
  183. package/chip/public-api.ts +1 -0
  184. package/client-page/client-page.html +232 -0
  185. package/client-page/client-page.ts +588 -0
  186. package/client-page/index.ts +2 -0
  187. package/client-page/ng-package.json +6 -0
  188. package/client-page/public-api.ts +1 -0
  189. package/client-page-menu/client-page-menu.html +142 -0
  190. package/client-page-menu/client-page-menu.ts +199 -0
  191. package/client-page-menu/index.ts +2 -0
  192. package/client-page-menu/ng-package.json +6 -0
  193. package/client-page-menu/public-api.ts +1 -0
  194. package/color-picker-field/color-picker-field.html +45 -0
  195. package/color-picker-field/color-picker-field.scss +52 -0
  196. package/color-picker-field/color-picker-field.ts +131 -0
  197. package/color-picker-field/ng-package.json +6 -0
  198. package/color-picker-field/public-api.ts +1 -0
  199. package/confirmation/confirmation-dialog.html +83 -0
  200. package/confirmation/confirmation-dialog.scss +0 -0
  201. package/confirmation/confirmation-dialog.ts +15 -0
  202. package/confirmation/confirmation.spec.ts +43 -0
  203. package/confirmation/confirmation.ts +103 -0
  204. package/confirmation/ng-package.json +6 -0
  205. package/confirmation/public-api.ts +2 -0
  206. package/date-field/date-field.html +65 -0
  207. package/date-field/date-field.scss +0 -0
  208. package/date-field/date-field.spec.ts +118 -0
  209. package/date-field/date-field.ts +196 -0
  210. package/date-field/ng-package.json +6 -0
  211. package/date-field/public-api.ts +1 -0
  212. package/dialog/dialog.ts +29 -0
  213. package/dialog/ng-package.json +6 -0
  214. package/dialog/public-api.ts +1 -0
  215. package/drawer/drawer.html +67 -0
  216. package/drawer/drawer.scss +1 -0
  217. package/drawer/drawer.ts +348 -0
  218. package/drawer/ng-package.json +5 -0
  219. package/drawer/public-api.ts +1 -0
  220. package/dynamic-drawer/dynamic-drawer-host.ts +476 -0
  221. package/dynamic-drawer/dynamic-drawer.spec.ts +204 -0
  222. package/dynamic-drawer/dynamic-drawer.ts +235 -0
  223. package/dynamic-drawer/ng-package.json +6 -0
  224. package/dynamic-drawer/public-api.ts +2 -0
  225. package/editor-field/editor-field.html +38 -0
  226. package/editor-field/editor-field.scss +219 -0
  227. package/editor-field/editor-field.ts +126 -0
  228. package/editor-field/ng-package.json +6 -0
  229. package/editor-field/public-api.ts +1 -0
  230. package/empty-state/empty-state.html +236 -0
  231. package/empty-state/empty-state.ts +85 -0
  232. package/empty-state/ng-package.json +6 -0
  233. package/empty-state/public-api.ts +1 -0
  234. package/entities/comparison/comparison-entity-list/comparison-entity-list.html +87 -0
  235. package/entities/comparison/comparison-entity-list/comparison-entity-list.ts +93 -0
  236. package/entities/comparison/comparison-value/comparison-value.html +31 -0
  237. package/entities/comparison/comparison-value/comparison-value.ts +53 -0
  238. package/entities/currency-display.utils.spec.ts +94 -0
  239. package/entities/currency-display.utils.ts +92 -0
  240. package/entities/entities-manage/entities-manage.html +74 -0
  241. package/entities/entities-manage/entities-manage.scss +72 -0
  242. package/entities/entities-manage/entities-manage.ts +121 -0
  243. package/entities/entities-manage/entities-resize-base.ts +153 -0
  244. package/entities/entities-preview/entities-preview.css +77 -0
  245. package/entities/entities-preview/entities-preview.html +56 -0
  246. package/entities/entities-preview/entities-preview.ts +281 -0
  247. package/entities/entity-attachment/entity-attachment.html +49 -0
  248. package/entities/entity-attachment/entity-attachment.ts +462 -0
  249. package/entities/entity-checkbox/entity-checkbox.html +28 -0
  250. package/entities/entity-checkbox/entity-checkbox.ts +65 -0
  251. package/entities/entity-comparison.model.ts +39 -0
  252. package/entities/entity-connection/entity-connection.html +12 -0
  253. package/entities/entity-connection/entity-connection.ts +75 -0
  254. package/entities/entity-currency/entity-currency.html +12 -0
  255. package/entities/entity-currency/entity-currency.ts +59 -0
  256. package/entities/entity-date/entity-date.html +16 -0
  257. package/entities/entity-date/entity-date.ts +50 -0
  258. package/entities/entity-display.utils.ts +94 -0
  259. package/entities/entity-field/entity-field.ts +94 -0
  260. package/entities/entity-leaf-details/entity-leaf-details.html +35 -0
  261. package/entities/entity-leaf-details/entity-leaf-details.ts +56 -0
  262. package/entities/entity-location/entity-location.html +34 -0
  263. package/entities/entity-location/entity-location.ts +98 -0
  264. package/entities/entity-long-text/entity-long-text.html +9 -0
  265. package/entities/entity-long-text/entity-long-text.ts +45 -0
  266. package/entities/entity-lookup/entity-lookup.html +25 -0
  267. package/entities/entity-lookup/entity-lookup.ts +68 -0
  268. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html +39 -0
  269. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.spec.ts +148 -0
  270. package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts +152 -0
  271. package/entities/entity-percentage/entity-percentage.html +22 -0
  272. package/entities/entity-percentage/entity-percentage.ts +163 -0
  273. package/entities/entity-phase-gate/entity-phase-gate.html +20 -0
  274. package/entities/entity-phase-gate/entity-phase-gate.ts +129 -0
  275. package/entities/entity-preview/entity-preview-body.html +8 -0
  276. package/entities/entity-preview/entity-preview-body.ts +19 -0
  277. package/entities/entity-preview/entity-preview.html +14 -0
  278. package/entities/entity-preview/entity-preview.ts +33 -0
  279. package/entities/entity-preview/entity-value-preview.html +62 -0
  280. package/entities/entity-preview/entity-value-preview.spec.ts +191 -0
  281. package/entities/entity-preview/entity-value-preview.ts +69 -0
  282. package/entities/entity-schedule-item/entity-schedule-item.html +19 -0
  283. package/entities/entity-schedule-item/entity-schedule-item.ts +41 -0
  284. package/entities/entity-sections.util.ts +103 -0
  285. package/entities/entity-status/entity-status.html +20 -0
  286. package/entities/entity-status/entity-status.ts +60 -0
  287. package/entities/entity-text/entity-text.html +20 -0
  288. package/entities/entity-text/entity-text.ts +35 -0
  289. package/entities/entity-user/entity-user.html +181 -0
  290. package/entities/entity-user/entity-user.ts +179 -0
  291. package/entities/entity.model.ts +407 -0
  292. package/entities/leaf-details-display.utils.ts +269 -0
  293. package/entities/ng-package.json +6 -0
  294. package/entities/percentage-color.utils.spec.ts +94 -0
  295. package/entities/percentage-color.utils.ts +80 -0
  296. package/entities/public-api.ts +30 -0
  297. package/field-validation/character-limit.validator.ts +22 -0
  298. package/field-validation/error-message.pipe.spec.ts +184 -0
  299. package/field-validation/error-message.pipe.ts +80 -0
  300. package/field-validation/field-validation.ts +168 -0
  301. package/field-validation/ng-package.json +6 -0
  302. package/field-validation/public-api.ts +2 -0
  303. package/formula/formula-editor/formula-editor.html +89 -0
  304. package/formula/formula-editor/formula-editor.scss +25 -0
  305. package/formula/formula-editor/formula-editor.ts +467 -0
  306. package/formula/formula-editor/index.ts +1 -0
  307. package/formula/formula-editor-code/formula-autocomplete-normalization.util.spec.ts +58 -0
  308. package/formula/formula-editor-code/formula-autocomplete-normalization.util.ts +64 -0
  309. package/formula/formula-editor-code/formula-completion-range.util.spec.ts +62 -0
  310. package/formula/formula-editor-code/formula-completion-range.util.ts +71 -0
  311. package/formula/formula-editor-code/formula-completion-suggestion.util.spec.ts +23 -0
  312. package/formula/formula-editor-code/formula-completion-suggestion.util.ts +18 -0
  313. package/formula/formula-editor-code/formula-editor-code.html +15 -0
  314. package/formula/formula-editor-code/formula-editor-code.scss +90 -0
  315. package/formula/formula-editor-code/formula-editor-code.ts +1095 -0
  316. package/formula/formula-editor-code/index.ts +1 -0
  317. package/formula/formula-status-bar/formula-status-bar.html +119 -0
  318. package/formula/formula-status-bar/formula-status-bar.ts +66 -0
  319. package/formula/formula-status-bar/index.ts +1 -0
  320. package/formula/formula-toolbar/formula-toolbar.html +361 -0
  321. package/formula/formula-toolbar/formula-toolbar.ts +532 -0
  322. package/formula/formula-toolbar/index.ts +2 -0
  323. package/formula/formula-toolbar/operators.ts +122 -0
  324. package/formula/models/formula-block.model.ts +61 -0
  325. package/formula/models/formula-token.model.spec.ts +57 -0
  326. package/formula/models/formula-token.model.ts +852 -0
  327. package/formula/models/index.ts +5 -0
  328. package/formula/models/smart-block.model.ts +132 -0
  329. package/formula/models/validation-result.model.ts +80 -0
  330. package/formula/ng-package.json +6 -0
  331. package/formula/public-api.ts +8 -0
  332. package/formula/runtime/formula-runtime-catalogs.ts +554 -0
  333. package/formula/runtime/formula-runtime-engine.spec.ts +328 -0
  334. package/formula/runtime/formula-runtime-engine.ts +794 -0
  335. package/formula/runtime/formula-runtime.model.ts +53 -0
  336. package/formula/runtime/index.ts +3 -0
  337. package/formula/toolbar-item/index.ts +1 -0
  338. package/formula/toolbar-item/toolbar-item.html +143 -0
  339. package/formula/toolbar-item/toolbar-item.scss +14 -0
  340. package/formula/toolbar-item/toolbar-item.ts +223 -0
  341. package/icon-field/icon-field.html +58 -0
  342. package/icon-field/icon-field.scss +24 -0
  343. package/icon-field/icon-field.spec.ts +77 -0
  344. package/icon-field/icon-field.ts +205 -0
  345. package/icon-field/ng-package.json +6 -0
  346. package/icon-field/public-api.ts +1 -0
  347. package/list/list.html +22 -0
  348. package/list/list.ts +36 -0
  349. package/list/ng-package.json +6 -0
  350. package/list/public-api.ts +1 -0
  351. package/location-field/location-field.html +86 -0
  352. package/location-field/location-field.spec.ts +295 -0
  353. package/location-field/location-field.ts +662 -0
  354. package/location-field/location-manual-dialog.html +43 -0
  355. package/location-field/location-manual-dialog.ts +104 -0
  356. package/location-field/location-value.ts +67 -0
  357. package/location-field/ng-package.json +6 -0
  358. package/location-field/public-api.ts +3 -0
  359. package/menu/menu.html +71 -0
  360. package/menu/menu.scss +3 -0
  361. package/menu/menu.ts +186 -0
  362. package/menu/ng-package.json +6 -0
  363. package/menu/public-api.ts +1 -0
  364. package/modal/modal.ts +127 -0
  365. package/modal/ng-package.json +6 -0
  366. package/modal/public-api.ts +1 -0
  367. package/module-summary-card/module-summary-card.html +43 -0
  368. package/module-summary-card/module-summary-card.scss +0 -0
  369. package/module-summary-card/module-summary-card.ts +40 -0
  370. package/module-summary-card/ng-package.json +6 -0
  371. package/module-summary-card/public-api.ts +1 -0
  372. package/multi-select-field/multi-select-field.html +140 -0
  373. package/multi-select-field/multi-select-field.scss +0 -0
  374. package/multi-select-field/multi-select-field.spec.ts +21 -0
  375. package/multi-select-field/multi-select-field.ts +397 -0
  376. package/multi-select-field/ng-package.json +6 -0
  377. package/multi-select-field/public-api.ts +1 -0
  378. package/ng-package.json +9 -0
  379. package/number-field/ng-package.json +6 -0
  380. package/number-field/number-field.html +39 -0
  381. package/number-field/number-field.scss +8 -0
  382. package/number-field/number-field.spec.ts +21 -0
  383. package/number-field/number-field.ts +124 -0
  384. package/number-field/public-api.ts +1 -0
  385. package/package.json +54 -278
  386. package/page/index.ts +1 -0
  387. package/page/ng-package.json +6 -0
  388. package/page/page.html +37 -0
  389. package/page/page.ts +43 -0
  390. package/page/public-api.ts +1 -0
  391. package/page-header/index.ts +2 -0
  392. package/page-header/ng-package.json +6 -0
  393. package/page-header/page-header.html +60 -0
  394. package/page-header/page-header.ts +54 -0
  395. package/page-header/public-api.ts +1 -0
  396. package/paginator/ng-package.json +6 -0
  397. package/paginator/paginator.html +50 -0
  398. package/paginator/paginator.scss +0 -0
  399. package/paginator/paginator.ts +53 -0
  400. package/paginator/public-api.ts +1 -0
  401. package/pick-list-field/ng-package.json +6 -0
  402. package/pick-list-field/pick-list-field.html +39 -0
  403. package/pick-list-field/pick-list-field.scss +26 -0
  404. package/pick-list-field/pick-list-field.ts +259 -0
  405. package/pick-list-field/public-api.ts +1 -0
  406. package/progress/ng-package.json +6 -0
  407. package/progress/progress.html +36 -0
  408. package/progress/progress.ts +61 -0
  409. package/progress/public-api.ts +1 -0
  410. package/property-filter-builder/ng-package.json +6 -0
  411. package/property-filter-builder/property-filter-builder.html +192 -0
  412. package/property-filter-builder/property-filter-builder.ts +548 -0
  413. package/property-filter-builder/public-api.ts +1 -0
  414. package/radio-button-field/ng-package.json +6 -0
  415. package/radio-button-field/public-api.ts +1 -0
  416. package/radio-button-field/radio-button-field.html +44 -0
  417. package/radio-button-field/radio-button-field.scss +0 -0
  418. package/radio-button-field/radio-button-field.ts +114 -0
  419. package/radio-cards/ng-package.json +6 -0
  420. package/radio-cards/public-api.ts +1 -0
  421. package/radio-cards/radio-cards.css +3 -0
  422. package/radio-cards/radio-cards.html +54 -0
  423. package/radio-cards/radio-cards.spec.ts +22 -0
  424. package/radio-cards/radio-cards.ts +92 -0
  425. package/radio-cards-field/ng-package.json +6 -0
  426. package/radio-cards-field/public-api.ts +1 -0
  427. package/radio-cards-field/radio-cards-field.css +0 -0
  428. package/radio-cards-field/radio-cards-field.html +38 -0
  429. package/radio-cards-field/radio-cards-field.spec.ts +22 -0
  430. package/radio-cards-field/radio-cards-field.ts +182 -0
  431. package/runtime-action/ng-package.json +6 -0
  432. package/runtime-action/payload-builder.ts +246 -0
  433. package/runtime-action/public-api.ts +4 -0
  434. package/runtime-action/runtime-action-context.store.ts +26 -0
  435. package/runtime-action/runtime-action.runner.ts +302 -0
  436. package/runtime-action/runtime-action.types.ts +82 -0
  437. package/select-field/current-user.util.ts +54 -0
  438. package/select-field/ng-package.json +6 -0
  439. package/select-field/public-api.ts +1 -0
  440. package/select-field/select-field.html +142 -0
  441. package/select-field/select-field.scss +0 -0
  442. package/select-field/select-field.spec.ts +21 -0
  443. package/select-field/select-field.ts +471 -0
  444. package/sidebar/ng-package.json +6 -0
  445. package/sidebar/public-api.ts +1 -0
  446. package/sidebar/sidebar.html +368 -0
  447. package/sidebar/sidebar.ts +303 -0
  448. package/slider-field/ng-package.json +7 -0
  449. package/slider-field/public-api.ts +1 -0
  450. package/slider-field/slider-field.html +33 -0
  451. package/slider-field/slider-field.scss +11 -0
  452. package/slider-field/slider-field.spec.ts +44 -0
  453. package/slider-field/slider-field.ts +166 -0
  454. package/src/lib/base/base.facade.ts +159 -0
  455. package/src/lib/base/crud-base.state.ts +248 -0
  456. package/src/lib/config/date-format.config.ts +55 -0
  457. package/src/lib/config/ds-identity.preset.ts +538 -0
  458. package/src/lib/config/ds-identity.tokens.ts +209 -0
  459. package/src/lib/config/dynamic-form.model.ts +1162 -0
  460. package/src/lib/config/povide-messages.ts +5 -0
  461. package/src/lib/config/provide-confirmation.ts +5 -0
  462. package/src/lib/config/providemt.ts +506 -0
  463. package/src/lib/config/public-api.ts +0 -0
  464. package/src/lib/pipes/mt-date-format.pipe.spec.ts +60 -0
  465. package/src/lib/pipes/mt-date-format.pipe.ts +81 -0
  466. package/src/lib/utils/api-request.helper.ts +59 -0
  467. package/src/lib/utils/clock-time.util.ts +58 -0
  468. package/src/lib/utils/color.utils.ts +187 -0
  469. package/src/lib/utils/entity-adapter.ts +50 -0
  470. package/src/lib/utils/field-id.ts +42 -0
  471. package/src/lib/utils/http-context.ts +35 -0
  472. package/src/lib/utils/inputs.ts +6 -0
  473. package/src/lib/utils/state-helpers.ts +49 -0
  474. package/src/lib/utils/theme.ts +281 -0
  475. package/src/public-api.ts +30 -0
  476. package/statistic-card/ng-package.json +6 -0
  477. package/statistic-card/public-api.ts +1 -0
  478. package/statistic-card/statistic-card.html +31 -0
  479. package/statistic-card/statistic-card.scss +0 -0
  480. package/statistic-card/statistic-card.ts +59 -0
  481. package/table/ng-package.json +7 -0
  482. package/table/public-api.ts +10 -0
  483. package/table/table-actions-menu/public-api.ts +1 -0
  484. package/table/table-actions-menu/table-actions-menu.html +75 -0
  485. package/table/table-actions-menu/table-actions-menu.ts +171 -0
  486. package/table/table-caption/public-api.ts +1 -0
  487. package/table/table-caption/table-caption.html +118 -0
  488. package/table/table-caption/table-caption.ts +221 -0
  489. package/table/table-column-filter/public-api.ts +1 -0
  490. package/table/table-column-filter/table-column-filter.html +44 -0
  491. package/table/table-column-filter/table-column-filter.ts +106 -0
  492. package/table/table-export/html-to-text.util.ts +67 -0
  493. package/table/table-export/public-api.ts +1 -0
  494. package/table/table-export/table-export.service.spec.ts +186 -0
  495. package/table/table-export/table-export.service.ts +325 -0
  496. package/table/table-filter/public-api.ts +1 -0
  497. package/table/table-filter/table-filter.css +9 -0
  498. package/table/table-filter/table-filter.html +63 -0
  499. package/table/table-filter/table-filter.ts +126 -0
  500. package/table/table-filter-field/public-api.ts +1 -0
  501. package/table/table-filter-field/table-filter-field.html +182 -0
  502. package/table/table-filter-field/table-filter-field.ts +208 -0
  503. package/table/table-grouping/public-api.ts +1 -0
  504. package/table/table-grouping/table-grouping.spec.ts +218 -0
  505. package/table/table-grouping/table-grouping.ts +237 -0
  506. package/table/table-types.ts +242 -0
  507. package/table/table-value.utils.spec.ts +63 -0
  508. package/table/table-value.utils.ts +1014 -0
  509. package/table/table.css +145 -0
  510. package/table/table.html +572 -0
  511. package/table/table.ts +2042 -0
  512. package/tabs/ng-package.json +6 -0
  513. package/tabs/public-api.ts +1 -0
  514. package/tabs/tabs.html +417 -0
  515. package/tabs/tabs.scss +3 -0
  516. package/tabs/tabs.spec.ts +79 -0
  517. package/tabs/tabs.ts +397 -0
  518. package/text-field/ng-package.json +6 -0
  519. package/text-field/public-api.ts +1 -0
  520. package/text-field/text-field.html +75 -0
  521. package/text-field/text-field.scss +56 -0
  522. package/text-field/text-field.ts +251 -0
  523. package/textarea-field/ng-package.json +6 -0
  524. package/textarea-field/public-api.ts +1 -0
  525. package/textarea-field/textarea-field.html +37 -0
  526. package/textarea-field/textarea-field.scss +0 -0
  527. package/textarea-field/textarea-field.spec.ts +21 -0
  528. package/textarea-field/textarea-field.ts +169 -0
  529. package/toast/ng-package.json +6 -0
  530. package/toast/public-api.ts +2 -0
  531. package/toast/toast.html +18 -0
  532. package/toast/toast.service.ts +67 -0
  533. package/toast/toast.ts +21 -0
  534. package/toggle-field/ng-package.json +6 -0
  535. package/toggle-field/public-api.ts +1 -0
  536. package/toggle-field/toggle-field.html +78 -0
  537. package/toggle-field/toggle-field.scss +24 -0
  538. package/toggle-field/toggle-field.ts +150 -0
  539. package/tooltip/ng-package.json +6 -0
  540. package/tooltip/public-api.ts +2 -0
  541. package/tooltip/tooltip.ts +30 -0
  542. package/tooltip/truncate-tooltip.ts +124 -0
  543. package/topbar/ng-package.json +6 -0
  544. package/topbar/public-api.ts +1 -0
  545. package/topbar/topbar.html +52 -0
  546. package/topbar/topbar.ts +27 -0
  547. package/tree/ng-package.json +6 -0
  548. package/tree/public-api.ts +2 -0
  549. package/tree/tree-types.ts +55 -0
  550. package/tree/tree.html +126 -0
  551. package/tree/tree.scss +1 -0
  552. package/tree/tree.ts +303 -0
  553. package/treeselect-field/ng-package.json +6 -0
  554. package/treeselect-field/public-api.ts +1 -0
  555. package/treeselect-field/treeselect-field.html +71 -0
  556. package/treeselect-field/treeselect-field.ts +348 -0
  557. package/tsconfig.check.json +20 -0
  558. package/tsconfig.json +16 -0
  559. package/tsconfig.spec.json +24 -0
  560. package/upload-field/ng-package.json +6 -0
  561. package/upload-field/public-api.ts +2 -0
  562. package/upload-field/secure-image.pipe.ts +258 -0
  563. package/upload-field/upload-field.html +274 -0
  564. package/upload-field/upload-field.scss +0 -0
  565. package/upload-field/upload-field.spec.ts +169 -0
  566. package/upload-field/upload-field.ts +764 -0
  567. package/upload-field/upload-file-preview/upload-file-preview.html +41 -0
  568. package/upload-field/upload-file-preview/upload-file-preview.scss +0 -0
  569. package/upload-field/upload-file-preview/upload-file-preview.ts +57 -0
  570. package/upload-field/upload-user-preview/upload-user-preview.css +0 -0
  571. package/upload-field/upload-user-preview/upload-user-preview.html +73 -0
  572. package/upload-field/upload-user-preview/upload-user-preview.ts +54 -0
  573. package/uploader/ng-package.json +6 -0
  574. package/uploader/public-api.ts +1 -0
  575. package/uploader/uploader.service.spec.ts +271 -0
  576. package/uploader/uploader.service.ts +733 -0
  577. package/user-search-field/ng-package.json +6 -0
  578. package/user-search-field/public-api.ts +1 -0
  579. package/user-search-field/user-search-field.html +88 -0
  580. package/user-search-field/user-search-field.scss +4 -0
  581. package/user-search-field/user-search-field.spec.ts +176 -0
  582. package/user-search-field/user-search-field.ts +483 -0
  583. package/fesm2022/masterteam-components-avatar-text.mjs +0 -46
  584. package/fesm2022/masterteam-components-avatar-text.mjs.map +0 -1
  585. package/fesm2022/masterteam-components-avatar.mjs +0 -50
  586. package/fesm2022/masterteam-components-avatar.mjs.map +0 -1
  587. package/fesm2022/masterteam-components-breadcrumb.mjs +0 -27
  588. package/fesm2022/masterteam-components-breadcrumb.mjs.map +0 -1
  589. package/fesm2022/masterteam-components-business-fields.mjs +0 -1907
  590. package/fesm2022/masterteam-components-business-fields.mjs.map +0 -1
  591. package/fesm2022/masterteam-components-button-group.mjs +0 -20
  592. package/fesm2022/masterteam-components-button-group.mjs.map +0 -1
  593. package/fesm2022/masterteam-components-button.mjs +0 -82
  594. package/fesm2022/masterteam-components-button.mjs.map +0 -1
  595. package/fesm2022/masterteam-components-card.mjs +0 -28
  596. package/fesm2022/masterteam-components-card.mjs.map +0 -1
  597. package/fesm2022/masterteam-components-checkbox-field.mjs +0 -92
  598. package/fesm2022/masterteam-components-checkbox-field.mjs.map +0 -1
  599. package/fesm2022/masterteam-components-chip.mjs +0 -39
  600. package/fesm2022/masterteam-components-chip.mjs.map +0 -1
  601. package/fesm2022/masterteam-components-client-page-menu.mjs +0 -153
  602. package/fesm2022/masterteam-components-client-page-menu.mjs.map +0 -1
  603. package/fesm2022/masterteam-components-client-page.mjs +0 -413
  604. package/fesm2022/masterteam-components-client-page.mjs.map +0 -1
  605. package/fesm2022/masterteam-components-color-picker-field.mjs +0 -106
  606. package/fesm2022/masterteam-components-color-picker-field.mjs.map +0 -1
  607. package/fesm2022/masterteam-components-confirmation.mjs +0 -98
  608. package/fesm2022/masterteam-components-confirmation.mjs.map +0 -1
  609. package/fesm2022/masterteam-components-date-field.mjs +0 -158
  610. package/fesm2022/masterteam-components-date-field.mjs.map +0 -1
  611. package/fesm2022/masterteam-components-dialog.mjs +0 -33
  612. package/fesm2022/masterteam-components-dialog.mjs.map +0 -1
  613. package/fesm2022/masterteam-components-drawer.mjs +0 -268
  614. package/fesm2022/masterteam-components-drawer.mjs.map +0 -1
  615. package/fesm2022/masterteam-components-dynamic-drawer.mjs +0 -608
  616. package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +0 -1
  617. package/fesm2022/masterteam-components-editor-field.mjs +0 -103
  618. package/fesm2022/masterteam-components-editor-field.mjs.map +0 -1
  619. package/fesm2022/masterteam-components-empty-state.mjs +0 -53
  620. package/fesm2022/masterteam-components-empty-state.mjs.map +0 -1
  621. package/fesm2022/masterteam-components-entities.mjs +0 -2183
  622. package/fesm2022/masterteam-components-entities.mjs.map +0 -1
  623. package/fesm2022/masterteam-components-field-validation.mjs +0 -237
  624. package/fesm2022/masterteam-components-field-validation.mjs.map +0 -1
  625. package/fesm2022/masterteam-components-formula.mjs +0 -3848
  626. package/fesm2022/masterteam-components-formula.mjs.map +0 -1
  627. package/fesm2022/masterteam-components-icon-field.mjs +0 -158
  628. package/fesm2022/masterteam-components-icon-field.mjs.map +0 -1
  629. package/fesm2022/masterteam-components-list.mjs +0 -31
  630. package/fesm2022/masterteam-components-list.mjs.map +0 -1
  631. package/fesm2022/masterteam-components-location-field.mjs +0 -607
  632. package/fesm2022/masterteam-components-location-field.mjs.map +0 -1
  633. package/fesm2022/masterteam-components-menu.mjs +0 -135
  634. package/fesm2022/masterteam-components-menu.mjs.map +0 -1
  635. package/fesm2022/masterteam-components-modal.mjs +0 -108
  636. package/fesm2022/masterteam-components-modal.mjs.map +0 -1
  637. package/fesm2022/masterteam-components-module-summary-card.mjs +0 -34
  638. package/fesm2022/masterteam-components-module-summary-card.mjs.map +0 -1
  639. package/fesm2022/masterteam-components-multi-select-field.mjs +0 -321
  640. package/fesm2022/masterteam-components-multi-select-field.mjs.map +0 -1
  641. package/fesm2022/masterteam-components-number-field.mjs +0 -102
  642. package/fesm2022/masterteam-components-number-field.mjs.map +0 -1
  643. package/fesm2022/masterteam-components-page-header.mjs +0 -42
  644. package/fesm2022/masterteam-components-page-header.mjs.map +0 -1
  645. package/fesm2022/masterteam-components-page.mjs +0 -35
  646. package/fesm2022/masterteam-components-page.mjs.map +0 -1
  647. package/fesm2022/masterteam-components-paginator.mjs +0 -43
  648. package/fesm2022/masterteam-components-paginator.mjs.map +0 -1
  649. package/fesm2022/masterteam-components-pick-list-field.mjs +0 -210
  650. package/fesm2022/masterteam-components-pick-list-field.mjs.map +0 -1
  651. package/fesm2022/masterteam-components-progress.mjs +0 -63
  652. package/fesm2022/masterteam-components-progress.mjs.map +0 -1
  653. package/fesm2022/masterteam-components-property-filter-builder.mjs +0 -386
  654. package/fesm2022/masterteam-components-property-filter-builder.mjs.map +0 -1
  655. package/fesm2022/masterteam-components-radio-button-field.mjs +0 -85
  656. package/fesm2022/masterteam-components-radio-button-field.mjs.map +0 -1
  657. package/fesm2022/masterteam-components-radio-cards-field.mjs +0 -131
  658. package/fesm2022/masterteam-components-radio-cards-field.mjs.map +0 -1
  659. package/fesm2022/masterteam-components-radio-cards.mjs +0 -74
  660. package/fesm2022/masterteam-components-radio-cards.mjs.map +0 -1
  661. package/fesm2022/masterteam-components-runtime-action.mjs +0 -406
  662. package/fesm2022/masterteam-components-runtime-action.mjs.map +0 -1
  663. package/fesm2022/masterteam-components-select-field.mjs +0 -415
  664. package/fesm2022/masterteam-components-select-field.mjs.map +0 -1
  665. package/fesm2022/masterteam-components-sidebar.mjs +0 -155
  666. package/fesm2022/masterteam-components-sidebar.mjs.map +0 -1
  667. package/fesm2022/masterteam-components-slider-field.mjs +0 -128
  668. package/fesm2022/masterteam-components-slider-field.mjs.map +0 -1
  669. package/fesm2022/masterteam-components-statistic-card.mjs +0 -42
  670. package/fesm2022/masterteam-components-statistic-card.mjs.map +0 -1
  671. package/fesm2022/masterteam-components-table.mjs +0 -3372
  672. package/fesm2022/masterteam-components-table.mjs.map +0 -1
  673. package/fesm2022/masterteam-components-tabs.mjs +0 -289
  674. package/fesm2022/masterteam-components-tabs.mjs.map +0 -1
  675. package/fesm2022/masterteam-components-text-field.mjs +0 -202
  676. package/fesm2022/masterteam-components-text-field.mjs.map +0 -1
  677. package/fesm2022/masterteam-components-textarea-field.mjs +0 -126
  678. package/fesm2022/masterteam-components-textarea-field.mjs.map +0 -1
  679. package/fesm2022/masterteam-components-toast.mjs +0 -80
  680. package/fesm2022/masterteam-components-toast.mjs.map +0 -1
  681. package/fesm2022/masterteam-components-toggle-field.mjs +0 -116
  682. package/fesm2022/masterteam-components-toggle-field.mjs.map +0 -1
  683. package/fesm2022/masterteam-components-tooltip.mjs +0 -147
  684. package/fesm2022/masterteam-components-tooltip.mjs.map +0 -1
  685. package/fesm2022/masterteam-components-topbar.mjs +0 -32
  686. package/fesm2022/masterteam-components-topbar.mjs.map +0 -1
  687. package/fesm2022/masterteam-components-tree.mjs +0 -260
  688. package/fesm2022/masterteam-components-tree.mjs.map +0 -1
  689. package/fesm2022/masterteam-components-treeselect-field.mjs +0 -265
  690. package/fesm2022/masterteam-components-treeselect-field.mjs.map +0 -1
  691. package/fesm2022/masterteam-components-upload-field.mjs +0 -846
  692. package/fesm2022/masterteam-components-upload-field.mjs.map +0 -1
  693. package/fesm2022/masterteam-components-uploader.mjs +0 -425
  694. package/fesm2022/masterteam-components-uploader.mjs.map +0 -1
  695. package/fesm2022/masterteam-components-user-search-field.mjs +0 -374
  696. package/fesm2022/masterteam-components-user-search-field.mjs.map +0 -1
  697. package/fesm2022/masterteam-components.mjs +0 -2512
  698. package/fesm2022/masterteam-components.mjs.map +0 -1
  699. package/types/masterteam-components-avatar-text.d.ts +0 -23
  700. package/types/masterteam-components-avatar.d.ts +0 -23
  701. package/types/masterteam-components-breadcrumb.d.ts +0 -18
  702. package/types/masterteam-components-business-fields.d.ts +0 -675
  703. package/types/masterteam-components-button-group.d.ts +0 -8
  704. package/types/masterteam-components-button.d.ts +0 -62
  705. package/types/masterteam-components-card.d.ts +0 -14
  706. package/types/masterteam-components-checkbox-field.d.ts +0 -38
  707. package/types/masterteam-components-chip.d.ts +0 -21
  708. package/types/masterteam-components-client-page-menu.d.ts +0 -55
  709. package/types/masterteam-components-client-page.d.ts +0 -115
  710. package/types/masterteam-components-color-picker-field.d.ts +0 -39
  711. package/types/masterteam-components-confirmation.d.ts +0 -41
  712. package/types/masterteam-components-date-field.d.ts +0 -57
  713. package/types/masterteam-components-dialog.d.ts +0 -12
  714. package/types/masterteam-components-drawer.d.ts +0 -62
  715. package/types/masterteam-components-dynamic-drawer.d.ts +0 -159
  716. package/types/masterteam-components-editor-field.d.ts +0 -39
  717. package/types/masterteam-components-empty-state.d.ts +0 -47
  718. package/types/masterteam-components-entities.d.ts +0 -1102
  719. package/types/masterteam-components-field-validation.d.ts +0 -59
  720. package/types/masterteam-components-formula.d.ts +0 -759
  721. package/types/masterteam-components-icon-field.d.ts +0 -44
  722. package/types/masterteam-components-list.d.ts +0 -18
  723. package/types/masterteam-components-location-field.d.ts +0 -173
  724. package/types/masterteam-components-menu.d.ts +0 -55
  725. package/types/masterteam-components-modal.d.ts +0 -30
  726. package/types/masterteam-components-module-summary-card.d.ts +0 -18
  727. package/types/masterteam-components-multi-select-field.d.ts +0 -104
  728. package/types/masterteam-components-number-field.d.ts +0 -47
  729. package/types/masterteam-components-page-header.d.ts +0 -30
  730. package/types/masterteam-components-page.d.ts +0 -26
  731. package/types/masterteam-components-paginator.d.ts +0 -20
  732. package/types/masterteam-components-pick-list-field.d.ts +0 -65
  733. package/types/masterteam-components-progress.d.ts +0 -30
  734. package/types/masterteam-components-property-filter-builder.d.ts +0 -90
  735. package/types/masterteam-components-radio-button-field.d.ts +0 -41
  736. package/types/masterteam-components-radio-cards-field.d.ts +0 -39
  737. package/types/masterteam-components-radio-cards.d.ts +0 -33
  738. package/types/masterteam-components-runtime-action.d.ts +0 -105
  739. package/types/masterteam-components-select-field.d.ts +0 -136
  740. package/types/masterteam-components-sidebar.d.ts +0 -71
  741. package/types/masterteam-components-slider-field.d.ts +0 -41
  742. package/types/masterteam-components-statistic-card.d.ts +0 -28
  743. package/types/masterteam-components-table.d.ts +0 -937
  744. package/types/masterteam-components-tabs.d.ts +0 -80
  745. package/types/masterteam-components-text-field.d.ts +0 -60
  746. package/types/masterteam-components-textarea-field.d.ts +0 -45
  747. package/types/masterteam-components-toast.d.ts +0 -27
  748. package/types/masterteam-components-toggle-field.d.ts +0 -44
  749. package/types/masterteam-components-tooltip.d.ts +0 -26
  750. package/types/masterteam-components-topbar.d.ts +0 -20
  751. package/types/masterteam-components-tree.d.ts +0 -106
  752. package/types/masterteam-components-treeselect-field.d.ts +0 -79
  753. package/types/masterteam-components-upload-field.d.ts +0 -112
  754. package/types/masterteam-components-uploader.d.ts +0 -53
  755. package/types/masterteam-components-user-search-field.d.ts +0 -110
  756. package/types/masterteam-components.d.ts +0 -1261
@@ -1,2512 +0,0 @@
1
- import { providePrimeNG } from 'primeng/config';
2
- import Aura from '@primeuix/themes/aura';
3
- import { updatePreset, definePreset, usePreset } from '@primeuix/themes';
4
- import { MessageService, ConfirmationService } from 'primeng/api';
5
- import * as i0 from '@angular/core';
6
- import { InjectionToken, makeEnvironmentProviders, computed, inject, LOCALE_ID, Pipe } from '@angular/core';
7
- import { tap, catchError, finalize } from 'rxjs/operators';
8
- import { HttpContextToken } from '@angular/common/http';
9
- import { formatDate } from '@angular/common';
10
-
11
- /**
12
- * Converts a hex color string to an HSL tuple.
13
- * @param hex - The hex color string (e.g., "#RRGGBB" or "#RGB").
14
- * @returns An HSL tuple [hue, saturation, lightness] where hue is in degrees (0-360),
15
- * and saturation/lightness are percentages (0-100).
16
- */
17
- function hexToHsl(hex) {
18
- let r = 0, g = 0, b = 0;
19
- // Handle shorthand hex codes
20
- if (hex.length === 4) {
21
- r = parseInt(hex[1] + hex[1], 16);
22
- g = parseInt(hex[2] + hex[2], 16);
23
- b = parseInt(hex[3] + hex[3], 16);
24
- }
25
- else if (hex.length === 7) {
26
- r = parseInt(hex.substring(1, 3), 16);
27
- g = parseInt(hex.substring(3, 5), 16);
28
- b = parseInt(hex.substring(5, 7), 16);
29
- }
30
- else {
31
- throw new Error('Invalid hex color format. Expected #RGB or #RRGGBB.');
32
- }
33
- r /= 255;
34
- g /= 255;
35
- b /= 255;
36
- const max = Math.max(r, g, b);
37
- const min = Math.min(r, g, b);
38
- let h = 0, s;
39
- const l = (max + min) / 2;
40
- if (max === min) {
41
- h = s = 0; // achromatic
42
- }
43
- else {
44
- const d = max - min;
45
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
46
- switch (max) {
47
- case r:
48
- h = (g - b) / d + (g < b ? 6 : 0);
49
- break;
50
- case g:
51
- h = (b - r) / d + 2;
52
- break;
53
- case b:
54
- h = (r - g) / d + 4;
55
- break;
56
- }
57
- h /= 6;
58
- }
59
- return [h * 360, s * 100, l * 100]; // HSL in degrees, percentage, percentage
60
- }
61
- /**
62
- * Converts HSL values to a hex color string.
63
- * @param h - Hue (0-360).
64
- * @param s - Saturation (0-100).
65
- * @param l - Lightness (0-100).
66
- * @returns The hex color string (e.g., "#RRGGBB").
67
- */
68
- function hslToHex(h, s, l) {
69
- l /= 100;
70
- const a = (s * Math.min(l, 1 - l)) / 100;
71
- const f = (n) => {
72
- const k = (n + h / 30) % 12;
73
- const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
74
- return Math.round(255 * color)
75
- .toString(16)
76
- .padStart(2, '0');
77
- };
78
- return `#${f(0)}${f(8)}${f(4)}`;
79
- }
80
- /**
81
- * Defines the "ideal" lightness and saturation adjustment for each shade.
82
- * Lightness for 500 is set to 50 as a balanced default.
83
- */
84
- const PALETTE_PROFILE = {
85
- '0': { l: 98, s_adjust: -50 },
86
- '50': { l: 95, s_adjust: -40 },
87
- '100': { l: 90, s_adjust: -30 },
88
- '200': { l: 80, s_adjust: -20 },
89
- '300': { l: 70, s_adjust: -10 },
90
- '400': { l: 60, s_adjust: -5 },
91
- '500': { l: 50, s_adjust: 0 },
92
- '600': { l: 45, s_adjust: 5 },
93
- '700': { l: 35, s_adjust: 10 },
94
- '800': { l: 25, s_adjust: 15 },
95
- '900': { l: 15, s_adjust: 20 },
96
- '950': { l: 8, s_adjust: 25 },
97
- };
98
- // Helper to ensure palette is always in the correct 50-950 order
99
- const ALL_SHADES = [
100
- '0',
101
- '50',
102
- '100',
103
- '200',
104
- '300',
105
- '400',
106
- '500',
107
- '600',
108
- '700',
109
- '800',
110
- '900',
111
- '950',
112
- ];
113
- /**
114
- * Clamps a number between a min and max value.
115
- */
116
- function clamp(value, min, max) {
117
- return Math.max(min, Math.min(max, value));
118
- }
119
- /**
120
- * Generates a Tailwind-like color palette (50-950) from any given base color.
121
- *
122
- * @param baseColorHex - The hex string of the base color (e.g., "#0284c7").
123
- * @param baseColorShade - The shade of the base color (e.g., "500", "700").
124
- * @returns An object representing the full color palette.
125
- */
126
- function generateTailwindPalette(baseColorHex, baseColorShade = '500') {
127
- // 1. Get HSL of the input color
128
- const [h_base, s_base, l_base] = hexToHsl(baseColorHex);
129
- // 2. Find the anchors
130
- const baseProfile = PALETTE_PROFILE[baseColorShade];
131
- /** The Hue is constant across the entire palette. */
132
- const h = h_base;
133
- /**
134
- * Calculate the 500-shade's saturation by "reversing" the adjustment
135
- * from the base color.
136
- * e.g., if base is 700 (s_adjust: +10) and s_base is 80,
137
- * s_500 will be 70.
138
- */
139
- const s_500 = clamp(s_base - baseProfile.s_adjust, 0, 100);
140
- /**
141
- * Calculate the lightness "offset". This is the difference between
142
- * the base color's actual lightness and its "ideal" lightness
143
- * from the profile.
144
- * e.g., if base is 700 (ideal L: 35) and l_base is 38,
145
- * the offset is +3. This offset will be applied to all shades.
146
- */
147
- const l_offset = l_base - baseProfile.l;
148
- // 3. Generate the full palette
149
- const palette = {};
150
- for (const shade of ALL_SHADES) {
151
- const profile = PALETTE_PROFILE[shade];
152
- // Calculate the new saturation and lightness for this shade
153
- const newS = clamp(s_500 + profile.s_adjust, 0, 100);
154
- const newL = clamp(profile.l + l_offset, 0, 100);
155
- palette[shade] = hslToHex(h, newS, newL);
156
- }
157
- // 4. Ensure the originally provided color is used exactly
158
- // (to avoid rounding errors from HSL conversion)
159
- palette[baseColorShade] = baseColorHex;
160
- return palette;
161
- }
162
-
163
- /**
164
- * Color utility functions for brand display.
165
- */
166
- /**
167
- * Converts a hex color to a light shade (equivalent to primary-100 in Tailwind).
168
- * This creates a color with ~10% opacity or a very light tint by mixing with white.
169
- */
170
- function getLightColor(hexColor) {
171
- const hex = hexColor.replace('#', '');
172
- const r = parseInt(hex.substring(0, 2), 16);
173
- const g = parseInt(hex.substring(2, 4), 16);
174
- const b = parseInt(hex.substring(4, 6), 16);
175
- const lightR = Math.round(r * 0.1 + 255 * 0.9);
176
- const lightG = Math.round(g * 0.1 + 255 * 0.9);
177
- const lightB = Math.round(b * 0.1 + 255 * 0.9);
178
- return `#${lightR.toString(16).padStart(2, '0')}${lightG
179
- .toString(16)
180
- .padStart(2, '0')}${lightB.toString(16).padStart(2, '0')}`;
181
- }
182
- function getContrastColor(bgColor) {
183
- let r = 0, g = 0, b = 0;
184
- if (bgColor.startsWith('#')) {
185
- const hex = bgColor.slice(1);
186
- if (hex.length === 3) {
187
- r = parseInt(hex[0] + hex[0], 16);
188
- g = parseInt(hex[1] + hex[1], 16);
189
- b = parseInt(hex[2] + hex[2], 16);
190
- }
191
- else if (hex.length === 6) {
192
- r = parseInt(hex.slice(0, 2), 16);
193
- g = parseInt(hex.slice(2, 4), 16);
194
- b = parseInt(hex.slice(4, 6), 16);
195
- }
196
- }
197
- const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
198
- return luminance > 0.5 ? '' : '#ffffff';
199
- }
200
- /** Parses `#rgb` / `#rrggbb` into 0-255 channels. Null when unparseable. */
201
- function toRgb(hex) {
202
- const value = hex.trim().replace('#', '');
203
- const full = value.length === 3
204
- ? value
205
- .split('')
206
- .map((c) => c + c)
207
- .join('')
208
- : value;
209
- if (full.length !== 6 || !/^[0-9a-f]{6}$/i.test(full)) {
210
- return null;
211
- }
212
- return [
213
- parseInt(full.slice(0, 2), 16),
214
- parseInt(full.slice(2, 4), 16),
215
- parseInt(full.slice(4, 6), 16),
216
- ];
217
- }
218
- /**
219
- * WCAG 2.x relative luminance.
220
- *
221
- * Note this is NOT the 0.299/0.587/0.114 perceived-brightness formula used by
222
- * `getContrastColor` above — that one is fine for "is this light or dark?" but
223
- * it is not the definition a conformance ratio is measured against, so it
224
- * cannot be used to decide whether text passes AA.
225
- */
226
- function relativeLuminance(hex) {
227
- const rgb = toRgb(hex);
228
- if (!rgb) {
229
- return null;
230
- }
231
- const [r, g, b] = rgb.map((channel) => {
232
- const c = channel / 255;
233
- return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
234
- });
235
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
236
- }
237
- /** WCAG contrast ratio between two hex colours, 1–21. Null if either is bad. */
238
- function contrastRatio(foreground, background) {
239
- const l1 = relativeLuminance(foreground);
240
- const l2 = relativeLuminance(background);
241
- if (l1 === null || l2 === null) {
242
- return null;
243
- }
244
- return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
245
- }
246
- /** WCAG 1.4.3 Contrast Minimum, normal-size text. */
247
- const WCAG_AA_NORMAL_TEXT = 4.5;
248
- /**
249
- * The first shade at or below `preferred` on a generated ramp whose contrast
250
- * against `foreground` clears `minRatio`.
251
- *
252
- * This is how the brand colour stays fully tenant-configurable while the
253
- * primary button still passes AA (finding H-03). The shipped default
254
- * `#2AAEC0` gives white text 2.65:1 — the single most important control in the
255
- * product was the least legible one, and any tenant picking a light brand hit
256
- * the same wall. Rather than hardcode a darker teal, which fixes exactly one
257
- * tenant, we keep their hue and step down the ramp their own colour generated
258
- * until the text is readable.
259
- *
260
- * Returns `preferred` unchanged when it already passes, so a tenant whose brand
261
- * is dark enough sees no change at all. Returns the darkest available shade if
262
- * none passes — better to be as close as the palette allows than to give up.
263
- */
264
- function pickAccessibleShade(palette, preferred, foreground = '#ffffff', minRatio = WCAG_AA_NORMAL_TEXT) {
265
- const ladder = ['500', '600', '700', '800', '900'];
266
- const startIndex = ladder.indexOf(preferred);
267
- const candidates = startIndex >= 0 ? ladder.slice(startIndex) : ladder;
268
- let darkestAvailable = null;
269
- for (const step of candidates) {
270
- const shade = palette[step];
271
- if (!shade) {
272
- continue;
273
- }
274
- darkestAvailable = step;
275
- const ratio = contrastRatio(foreground, shade);
276
- if (ratio !== null && ratio >= minRatio) {
277
- return step;
278
- }
279
- }
280
- // Nothing on the ramp clears the threshold — return the darkest step the
281
- // palette actually has rather than one we already know fails. Falls back to
282
- // `preferred` only when the palette carried none of the ladder steps at all.
283
- return darkestAvailable ?? preferred;
284
- }
285
- /** Dark ink used when white text would not be legible on a status colour. */
286
- const READABLE_DARK_INK = '#1f2937';
287
- /**
288
- * Picks the more legible of white and a dark ink for text sitting on `bgColor`.
289
- *
290
- * Status and lookup colours come from a tenant's own catalog, so they can be
291
- * any hex at all — and the count badges on the Explore cards were painting
292
- * white on every one of them, which measured 2.59:1 at the low end (finding
293
- * H-03 / M-04). Rather than restrict what colours a tenant may choose, pick the
294
- * foreground that actually reads on the colour they chose.
295
- *
296
- * Measured with the WCAG relative-luminance ratio, not the perceived-brightness
297
- * shortcut in `getContrastColor`, because that shortcut is not the definition
298
- * conformance is judged against. Unparseable input falls back to white, which
299
- * is the behaviour every caller had before.
300
- */
301
- function readableTextOn(bgColor, dark = READABLE_DARK_INK, light = '#ffffff') {
302
- if (!bgColor) {
303
- return light;
304
- }
305
- const onLight = contrastRatio(light, bgColor);
306
- const onDark = contrastRatio(dark, bgColor);
307
- if (onLight === null || onDark === null) {
308
- return light;
309
- }
310
- return onDark > onLight ? dark : light;
311
- }
312
-
313
- /**
314
- * Masterteam Design System — raw palettes and scales.
315
- *
316
- * Transcribed from the DS Storybook foundations (Figma
317
- * `WTmRAkJVvw0IvZMA7wBdTC`). These are primitives: they name colours, not
318
- * roles. The mapping from primitive to role lives in `ds-identity.preset.ts`.
319
- *
320
- * Adding a value here without a corresponding Figma variable is how a design
321
- * system drifts — extend the Figma file first, then mirror it.
322
- */
323
- /** Primary blue. 800 is the primary button background. */
324
- const DS_BLUE = {
325
- 25: '#F5FAFF',
326
- 50: '#EFF8FF',
327
- 100: '#D1E9FF',
328
- 200: '#B2DDFF',
329
- 300: '#84CAFF',
330
- 400: '#53B1FD',
331
- 500: '#2E90FA',
332
- 600: '#1570EF',
333
- 700: '#175CD3',
334
- 800: '#1849A9',
335
- 900: '#194185',
336
- 950: '#102A56',
337
- };
338
- /** Secondary indigo — accents, tags, selected states. */
339
- const DS_INDIGO = {
340
- 25: '#F5F8FF',
341
- 50: '#EEF4FF',
342
- 100: '#E0EAFF',
343
- 200: '#C7D7FE',
344
- 300: '#A4BCFD',
345
- 400: '#8098F9',
346
- 500: '#6172F3',
347
- 600: '#444CE7',
348
- 700: '#3538CD',
349
- 800: '#2D31A6',
350
- 900: '#2D3282',
351
- 950: '#1F235B',
352
- };
353
- const DS_SUCCESS = {
354
- 25: '#F6FEF9',
355
- 50: '#ECFDF3',
356
- 100: '#DCFAE6',
357
- 200: '#A9EFC5',
358
- 300: '#75E0A7',
359
- 400: '#47CD89',
360
- 500: '#17B26A',
361
- 600: '#079455',
362
- 700: '#067647',
363
- 800: '#085D3A',
364
- 900: '#074D31',
365
- 950: '#053321',
366
- };
367
- const DS_WARNING = {
368
- 25: '#FFFCF5',
369
- 50: '#FFFAEB',
370
- 100: '#FEF0C7',
371
- 200: '#FEDF89',
372
- 300: '#FEC84B',
373
- 400: '#FDB022',
374
- 500: '#F79009',
375
- 600: '#DC6803',
376
- 700: '#B54708',
377
- 800: '#93370D',
378
- 900: '#7A2E0E',
379
- 950: '#4E1D09',
380
- };
381
- const DS_ERROR = {
382
- 25: '#FFFBFA',
383
- 50: '#FEF3F2',
384
- 100: '#FEE4E2',
385
- 200: '#FECDCA',
386
- 300: '#FDA29B',
387
- 400: '#F97066',
388
- 500: '#F04438',
389
- 600: '#D92D20',
390
- 700: '#B42318',
391
- 800: '#912018',
392
- 900: '#7A271A',
393
- 950: '#55160C',
394
- };
395
- /** Neutral scale. Note it stops at 900 in Figma; 0/25/950 are extrapolated
396
- * because PrimeUIX requires a full 0–950 surface ramp. */
397
- const DS_GRAY = {
398
- 0: '#FFFFFF',
399
- 25: '#FCFCFD',
400
- 50: '#F9FAFB',
401
- 100: '#F3F4F6',
402
- 200: '#E5E7EB',
403
- 300: '#D1D5DB',
404
- 400: '#9CA3AF',
405
- 500: '#6B7280',
406
- 600: '#4B5563',
407
- 700: '#374151',
408
- 800: '#1F2937',
409
- 900: '#111827',
410
- 950: '#0A0F1C',
411
- };
412
- /**
413
- * Semantic values that are not part of a ramp. Each one is a named Figma
414
- * variable in its own right.
415
- */
416
- const DS_SEMANTIC = {
417
- /** Default body / label text. Deliberately navy-black, not gray-900. */
418
- textStrong: '#000B36',
419
- textSecondary: '#3C5073',
420
- textPlaceholder: '#B6BDCA',
421
- textHelper: '#384250',
422
- surface: '#FFFFFF',
423
- border: '#E5E7EB',
424
- /** Disabled is a colour swap, never an opacity fade. */
425
- disabledBg: '#D2D6DB',
426
- disabledText: '#6C7C96',
427
- inputBorder: '#D2D6DB',
428
- inputBorderHover: '#1F2A37',
429
- inputBorderReadonly: '#CED3DC',
430
- inputBgPressed: '#F3F4F6',
431
- /** Destructive red. Distinct from the error ramp — this is the button colour. */
432
- danger: '#A30000',
433
- dangerSecondaryBg: '#FCDAD7',
434
- dangerSecondaryBgHover: '#F8BAB5',
435
- dangerSecondaryBgPressed: '#F3908A',
436
- /** Tinted secondary button, expressed as primary-at-opacity. */
437
- secondaryBg: 'rgba(24, 73, 169, 0.2)',
438
- secondaryBgHover: 'rgba(24, 73, 169, 0.1)',
439
- focusRing: '#1849A9',
440
- focusOutline: '#FFFFFF',
441
- tooltipBg: '#1A2236',
442
- };
443
- /** Figma effect styles. Never invent a shadow outside this set. */
444
- const DS_SHADOW = {
445
- xs: '0 1px 2px 0 rgba(16, 24, 40, 0.05)',
446
- sm: '0 1px 3px 0 rgba(16, 24, 40, 0.10), 0 1px 2px 0 rgba(16, 24, 40, 0.06)',
447
- md: '0 4px 8px -2px rgba(16, 24, 40, 0.10), 0 2px 4px -2px rgba(16, 24, 40, 0.06)',
448
- lg: '0 12px 16px -6px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03)',
449
- xl: '0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03)',
450
- '2xl': '0 24px 48px -12px rgba(16, 24, 40, 0.18)',
451
- };
452
- /**
453
- * Radius scale. The DS names differ from the PrimeUIX names by one step —
454
- * DS `radius-sm` (4px, the default for buttons and inputs) lands on PrimeUIX
455
- * `md`, because that is the key PrimeNG components reference. Mapping them
456
- * here keeps the shift in one place instead of spreading it across overrides.
457
- */
458
- const DS_RADIUS = {
459
- none: '0',
460
- /** DS radius-xs — code badges, small tags */
461
- xs: '2px',
462
- /** DS radius-xs..sm boundary */
463
- sm: '4px',
464
- /** DS radius-sm — buttons, inputs, dropdowns (PrimeNG's default reference) */
465
- md: '4px',
466
- /** DS radius-md — cards, tooltips, popovers */
467
- lg: '8px',
468
- /** DS radius-lg — modals, drawers */
469
- xl: '16px',
470
- };
471
- /** Control heights, in px, from the Figma button spacing frame. */
472
- const DS_CONTROL_HEIGHT = {
473
- sm: 24,
474
- md: 32,
475
- lg: 40,
476
- };
477
- const DS_FONT_FAMILY = "'IBM Plex Sans Arabic', system-ui, 'Segoe UI', sans-serif";
478
- /** Ordered chart series. Six is the hard maximum. */
479
- const DS_CHART_SERIES = [
480
- '#1849A9',
481
- '#175CD3',
482
- '#2E90FA',
483
- '#53B1FD',
484
- '#B2DDFF',
485
- '#D1E9FF',
486
- ];
487
-
488
- /** Root class that gates the CSS half of the identity. */
489
- const MT_DESIGN_IDENTITY_CLASS = 'mt-ds';
490
- /** DS primary button background. Used when the host does not brand the app. */
491
- const DS_DEFAULT_PRIMARY_COLOR = DS_BLUE[800];
492
- /**
493
- * PrimeUIX wants a 50–950 ramp; the DS publishes 25–950. Drop the 25 step and
494
- * keep the rest — the ramp is dense enough that nothing downstream misses it.
495
- */
496
- function toPrimeRamp(scale) {
497
- return {
498
- 50: scale[50],
499
- 100: scale[100],
500
- 200: scale[200],
501
- 300: scale[300],
502
- 400: scale[400],
503
- 500: scale[500],
504
- 600: scale[600],
505
- 700: scale[700],
506
- 800: scale[800],
507
- 900: scale[900],
508
- 950: scale[950],
509
- };
510
- }
511
- /**
512
- * Control geometry, derived rather than hardcoded so the relationship between
513
- * height, line-height and border stays visible:
514
- *
515
- * height = lineHeight + 2 * paddingY + 2 * border(1px)
516
- *
517
- * sm 24px = 18 + 2*2 + 2
518
- * md 32px = 20 + 2*5 + 2 ← default
519
- * lg 40px = 24 + 2*7 + 2
520
- */
521
- const FIELD = {
522
- sm: { fontSize: '0.75rem', paddingX: '0.5rem', paddingY: '0.125rem' },
523
- md: { fontSize: '0.875rem', paddingX: '0.5rem', paddingY: '0.3125rem' },
524
- lg: { fontSize: '1rem', paddingX: '0.75rem', paddingY: '0.4375rem' },
525
- };
526
- /**
527
- * The DS identity as a partial preset.
528
- *
529
- * @param primaryColor Optional brand override. Tenants that white-label the
530
- * product still need their own colour; when omitted the DS blue is used.
531
- * Note the DS itself treats the blue as fixed — an override is a deliberate
532
- * deviation, not a supported DS variant.
533
- */
534
- function dsIdentityConfigs(primaryColor) {
535
- const primary = primaryColor
536
- ? // A branded run keeps the DS ramp shape but re-anchors the key steps, so
537
- // hover/pressed stay one and two steps darker as the DS specifies.
538
- { ...toPrimeRamp(DS_BLUE), 800: primaryColor }
539
- : toPrimeRamp(DS_BLUE);
540
- return {
541
- primitive: {
542
- borderRadius: { ...DS_RADIUS },
543
- blue: toPrimeRamp(DS_BLUE),
544
- indigo: toPrimeRamp(DS_INDIGO),
545
- green: toPrimeRamp(DS_SUCCESS),
546
- emerald: toPrimeRamp(DS_SUCCESS),
547
- amber: toPrimeRamp(DS_WARNING),
548
- orange: toPrimeRamp(DS_WARNING),
549
- yellow: toPrimeRamp(DS_WARNING),
550
- red: toPrimeRamp(DS_ERROR),
551
- rose: toPrimeRamp(DS_ERROR),
552
- gray: toPrimeRamp(DS_GRAY),
553
- slate: toPrimeRamp(DS_GRAY),
554
- zinc: toPrimeRamp(DS_GRAY),
555
- },
556
- semantic: {
557
- primary,
558
- transitionDuration: '0.2s',
559
- /**
560
- * Disabled is a colour swap, never a fade — a hard DS rule, because a
561
- * faded control on a tinted surface stops meeting contrast at all.
562
- */
563
- disabledOpacity: '1',
564
- iconSize: '1rem',
565
- /**
566
- * Inner 2px primary ring. The outer 3px white halo cannot be expressed as
567
- * a token (PrimeUIX renders `focusRing` as a single outline) and is added
568
- * in `ds-identity.css`.
569
- */
570
- focusRing: {
571
- width: '2px',
572
- style: 'solid',
573
- color: '{primary.color}',
574
- offset: '0',
575
- shadow: 'none',
576
- },
577
- formField: {
578
- paddingX: FIELD.md.paddingX,
579
- paddingY: FIELD.md.paddingY,
580
- sm: FIELD.sm,
581
- lg: FIELD.lg,
582
- borderRadius: '{border.radius.md}',
583
- focusRing: {
584
- width: '0',
585
- style: 'none',
586
- color: 'transparent',
587
- offset: '0',
588
- shadow: 'none',
589
- },
590
- transitionDuration: '{transition.duration}',
591
- },
592
- content: { borderRadius: '{border.radius.lg}' },
593
- overlay: {
594
- select: {
595
- borderRadius: '{border.radius.lg}',
596
- shadow: DS_SHADOW.md,
597
- },
598
- popover: {
599
- borderRadius: '{border.radius.lg}',
600
- padding: '0.75rem',
601
- shadow: DS_SHADOW.md,
602
- },
603
- modal: {
604
- // 8px, not the 16px the foundations table implies for "modals" —
605
- // the DS Modal component itself ships radius-md and shadow-3xl.
606
- borderRadius: '{border.radius.lg}',
607
- padding: '1.5rem',
608
- shadow: '0 32px 64px -12px rgba(16, 24, 40, 0.14)',
609
- },
610
- navigation: { shadow: DS_SHADOW.md },
611
- },
612
- list: {
613
- padding: '0.25rem',
614
- gap: '2px',
615
- option: {
616
- padding: '0.375rem 0.5rem',
617
- borderRadius: '{border.radius.md}',
618
- },
619
- optionGroup: { padding: '0.375rem 0.5rem', fontWeight: '600' },
620
- },
621
- navigation: {
622
- item: {
623
- padding: '0.375rem 0.5rem',
624
- borderRadius: '{border.radius.md}',
625
- gap: '0.5rem',
626
- },
627
- },
628
- colorScheme: {
629
- light: {
630
- surface: {
631
- 0: DS_GRAY[0],
632
- ...toPrimeRamp(DS_GRAY),
633
- },
634
- /**
635
- * The DS anchors the primary button on blue-800, with hover and
636
- * pressed one and two steps darker. Aura anchors on 500, so the whole
637
- * triple is remapped rather than inherited.
638
- */
639
- primary: {
640
- color: '{primary.800}',
641
- contrastColor: DS_GRAY[50],
642
- hoverColor: '{primary.900}',
643
- activeColor: '{primary.950}',
644
- },
645
- highlight: {
646
- background: '{primary.50}',
647
- focusBackground: '{primary.100}',
648
- color: '{primary.800}',
649
- focusColor: '{primary.900}',
650
- },
651
- mask: { background: 'rgba(16, 24, 40, 0.6)', color: '{surface.200}' },
652
- formField: {
653
- background: DS_SEMANTIC.surface,
654
- disabledBackground: DS_SEMANTIC.disabledBg,
655
- filledBackground: '{surface.50}',
656
- filledHoverBackground: '{surface.50}',
657
- filledFocusBackground: '{surface.50}',
658
- borderColor: DS_SEMANTIC.inputBorder,
659
- hoverBorderColor: DS_SEMANTIC.inputBorderHover,
660
- // The DS keeps the border neutral on focus and signals focus with
661
- // the underline bar instead (see ds-identity.css).
662
- focusBorderColor: DS_SEMANTIC.inputBorder,
663
- invalidBorderColor: DS_SEMANTIC.danger,
664
- color: DS_SEMANTIC.textStrong,
665
- disabledColor: DS_SEMANTIC.disabledText,
666
- placeholderColor: DS_SEMANTIC.textPlaceholder,
667
- invalidPlaceholderColor: DS_SEMANTIC.danger,
668
- floatLabelColor: '{surface.500}',
669
- floatLabelFocusColor: '{primary.800}',
670
- floatLabelActiveColor: '{surface.500}',
671
- floatLabelInvalidColor: DS_SEMANTIC.danger,
672
- iconColor: '{surface.500}',
673
- shadow: 'none',
674
- },
675
- text: {
676
- color: DS_SEMANTIC.textStrong,
677
- hoverColor: DS_SEMANTIC.textStrong,
678
- mutedColor: '{surface.500}',
679
- hoverMutedColor: '{surface.600}',
680
- },
681
- content: {
682
- background: DS_SEMANTIC.surface,
683
- hoverBackground: '{surface.50}',
684
- borderColor: DS_SEMANTIC.border,
685
- color: '{text.color}',
686
- hoverColor: '{text.hover.color}',
687
- },
688
- list: {
689
- option: {
690
- focusBackground: '{surface.100}',
691
- selectedBackground: '{primary.50}',
692
- selectedFocusBackground: '{primary.100}',
693
- color: '{text.color}',
694
- focusColor: '{text.color}',
695
- selectedColor: '{primary.800}',
696
- selectedFocusColor: '{primary.900}',
697
- },
698
- },
699
- },
700
- /**
701
- * The DS does not publish a dark theme. Dark mode is still a shipped
702
- * capability here, so this is an extrapolation: the ramps are the DS
703
- * ramps, re-anchored to lighter primary steps for contrast on dark
704
- * surfaces. Treat these values as ours, not as design-approved.
705
- */
706
- dark: {
707
- surface: {
708
- 0: DS_GRAY[0],
709
- ...toPrimeRamp(DS_GRAY),
710
- },
711
- primary: {
712
- color: '{primary.400}',
713
- contrastColor: '{surface.950}',
714
- hoverColor: '{primary.300}',
715
- activeColor: '{primary.200}',
716
- },
717
- formField: {
718
- borderColor: '{surface.600}',
719
- hoverBorderColor: '{surface.500}',
720
- focusBorderColor: '{surface.600}',
721
- invalidBorderColor: '{red.400}',
722
- disabledBackground: '{surface.700}',
723
- disabledColor: '{surface.400}',
724
- placeholderColor: '{surface.400}',
725
- shadow: 'none',
726
- },
727
- mask: { background: 'rgba(0, 0, 0, 0.6)', color: '{surface.200}' },
728
- },
729
- },
730
- },
731
- components: {
732
- button: {
733
- root: {
734
- borderRadius: '{border.radius.md}',
735
- gap: '0.25rem',
736
- paddingX: FIELD.md.paddingX,
737
- paddingY: FIELD.md.paddingY,
738
- iconOnlyWidth: '2rem',
739
- sm: { ...FIELD.sm, iconOnlyWidth: '1.5rem' },
740
- lg: { ...FIELD.lg, iconOnlyWidth: '2.5rem' },
741
- label: { fontWeight: '500' },
742
- badgeSize: '1rem',
743
- },
744
- colorScheme: {
745
- light: {
746
- root: {
747
- /** DS "neutral" button — the standard Cancel / secondary action. */
748
- secondary: {
749
- background: '{surface.100}',
750
- hoverBackground: '{surface.200}',
751
- activeBackground: DS_SEMANTIC.disabledBg,
752
- borderColor: '{surface.100}',
753
- hoverBorderColor: '{surface.200}',
754
- activeBorderColor: DS_SEMANTIC.disabledBg,
755
- color: DS_SEMANTIC.textStrong,
756
- hoverColor: DS_SEMANTIC.textStrong,
757
- activeColor: DS_SEMANTIC.textStrong,
758
- },
759
- /** DS "danger-primary" — irreversible actions only. */
760
- danger: {
761
- background: DS_SEMANTIC.danger,
762
- hoverBackground: '#8A0000',
763
- activeBackground: '#6E0000',
764
- borderColor: DS_SEMANTIC.danger,
765
- hoverBorderColor: '#8A0000',
766
- activeBorderColor: '#6E0000',
767
- color: DS_GRAY[50],
768
- hoverColor: DS_GRAY[50],
769
- activeColor: DS_GRAY[50],
770
- },
771
- },
772
- /** DS "transparent" / ghost — link-style text buttons. */
773
- text: {
774
- primary: {
775
- color: DS_BLUE[700],
776
- hoverBackground: '{primary.50}',
777
- activeBackground: '{primary.100}',
778
- },
779
- danger: {
780
- color: DS_SEMANTIC.danger,
781
- hoverBackground: DS_SEMANTIC.dangerSecondaryBg,
782
- activeBackground: DS_SEMANTIC.dangerSecondaryBgHover,
783
- },
784
- },
785
- /** DS "secondary-solid" is a tint, closest to the outlined slot. */
786
- outlined: {
787
- primary: {
788
- borderColor: '{primary.200}',
789
- color: '{primary.800}',
790
- hoverBackground: DS_SEMANTIC.secondaryBgHover,
791
- activeBackground: DS_SEMANTIC.secondaryBg,
792
- },
793
- danger: {
794
- borderColor: DS_SEMANTIC.dangerSecondaryBgPressed,
795
- color: DS_SEMANTIC.danger,
796
- hoverBackground: DS_SEMANTIC.dangerSecondaryBg,
797
- activeBackground: DS_SEMANTIC.dangerSecondaryBgHover,
798
- },
799
- },
800
- link: {
801
- color: DS_BLUE[700],
802
- hoverColor: DS_BLUE[600],
803
- activeColor: DS_BLUE[800],
804
- },
805
- },
806
- },
807
- css: () => `
808
- .p-button.p-button-icon-only { padding-inline: 0; }
809
- /* Disabled is a colour swap, not a fade. */
810
- .p-button:disabled {
811
- background: ${DS_SEMANTIC.disabledBg};
812
- border-color: ${DS_SEMANTIC.disabledBg};
813
- color: ${DS_SEMANTIC.disabledText};
814
- cursor: not-allowed;
815
- }
816
- .p-button.p-button-text:disabled,
817
- .p-button.p-button-outlined:disabled {
818
- background: transparent;
819
- color: ${DS_SEMANTIC.disabledText};
820
- }
821
- `,
822
- },
823
- card: {
824
- root: {
825
- borderRadius: '{border.radius.lg}',
826
- shadow: DS_SHADOW.sm,
827
- },
828
- body: { padding: '1rem', gap: '0.5rem' },
829
- title: { fontSize: '1rem', fontWeight: '600' },
830
- subtitle: { color: DS_SEMANTIC.textSecondary },
831
- },
832
- tabs: {
833
- tab: {
834
- padding: '0.5rem 0.75rem',
835
- fontWeight: '500',
836
- borderWidth: '0 0 2px 0',
837
- },
838
- activeBar: { height: '2px', bottom: '-2px' },
839
- colorScheme: {
840
- light: {
841
- tab: {
842
- color: '{surface.500}',
843
- hoverColor: DS_SEMANTIC.textStrong,
844
- activeColor: '{primary.800}',
845
- borderColor: DS_SEMANTIC.border,
846
- hoverBorderColor: '{surface.300}',
847
- activeBorderColor: '{primary.800}',
848
- },
849
- activeBar: { background: '{primary.800}' },
850
- },
851
- },
852
- },
853
- datatable: {
854
- headerCell: { padding: '0.5rem 0.75rem' },
855
- bodyCell: { padding: '0.5rem 0.75rem' },
856
- footerCell: { padding: '0.5rem 0.75rem' },
857
- colorScheme: {
858
- light: {
859
- headerCell: {
860
- background: '{surface.50}',
861
- color: '{surface.600}',
862
- borderColor: DS_SEMANTIC.border,
863
- hoverBackground: '{surface.100}',
864
- },
865
- bodyCell: { borderColor: DS_SEMANTIC.border },
866
- row: {
867
- background: DS_SEMANTIC.surface,
868
- hoverBackground: '{surface.50}',
869
- color: DS_SEMANTIC.textStrong,
870
- selectedBackground: '{primary.50}',
871
- selectedColor: DS_SEMANTIC.textStrong,
872
- },
873
- },
874
- },
875
- },
876
- tag: {
877
- root: {
878
- fontSize: '0.75rem',
879
- fontWeight: '500',
880
- padding: '0.125rem 0.5rem',
881
- borderRadius: '{border.radius.md}',
882
- },
883
- colorScheme: {
884
- light: {
885
- primary: { background: DS_BLUE[100], color: DS_BLUE[700] },
886
- secondary: { background: '{surface.100}', color: '{surface.700}' },
887
- success: { background: DS_SUCCESS[100], color: DS_SUCCESS[700] },
888
- info: { background: DS_BLUE[100], color: DS_BLUE[700] },
889
- warn: { background: DS_WARNING[100], color: DS_WARNING[700] },
890
- danger: { background: DS_ERROR[100], color: DS_ERROR[700] },
891
- },
892
- },
893
- },
894
- toast: {
895
- root: { borderRadius: '{border.radius.lg}' },
896
- },
897
- tooltip: {
898
- root: {
899
- borderRadius: '6px',
900
- padding: '0.5rem 0.75rem',
901
- maxWidth: '20rem',
902
- },
903
- colorScheme: {
904
- light: {
905
- root: { background: DS_SEMANTIC.tooltipBg, color: '#ffffff' },
906
- },
907
- dark: {
908
- root: { background: DS_SEMANTIC.tooltipBg, color: '#ffffff' },
909
- },
910
- },
911
- },
912
- progressbar: {
913
- root: { borderRadius: '{border.radius.full}', height: '0.5rem' },
914
- },
915
- skeleton: {
916
- colorScheme: {
917
- light: { root: { background: '#e7e9ed' } },
918
- },
919
- },
920
- avatar: {
921
- root: { borderRadius: '{border.radius.full}' },
922
- },
923
- chip: {
924
- root: { borderRadius: '{border.radius.full}' },
925
- },
926
- },
927
- };
928
- }
929
- /** The DS chart ramp, for hosts that render charts outside PrimeNG. */
930
- const dsChartSeries = DS_CHART_SERIES;
931
- /**
932
- * Adds or removes the root class that activates the CSS half of the identity.
933
- * No-ops outside the browser so SSR builds stay safe.
934
- */
935
- function applyDesignIdentityClass(identity) {
936
- if (typeof document === 'undefined')
937
- return;
938
- document.documentElement.classList.toggle(MT_DESIGN_IDENTITY_CLASS, identity === 'experimental');
939
- }
940
-
941
- const inputBorderRadius = '{border.radius.md}';
942
- const toastStyle = {
943
- // borderColor: '{surface.300}',
944
- background: '{content.background}',
945
- // color: '{surface.600}',
946
- // closeButton: {
947
- // hoverBackground: '{surface.100}',
948
- // focusRing: {
949
- // color: '{surface.600}',
950
- // },
951
- // },
952
- };
953
- /**
954
- * Which identity the app is currently wearing. Tracked because the runtime
955
- * colour helpers below have to anchor a generated ramp on a different step per
956
- * identity — classic reads the brand colour as the 500 shade, the DS reads it
957
- * as 800.
958
- */
959
- let activeDesignIdentity = 'classic';
960
- function getMTDesignIdentity() {
961
- return activeDesignIdentity;
962
- }
963
- function changePrimaryColor(color) {
964
- const isDS = activeDesignIdentity === 'experimental';
965
- const base = color || (isDS ? DS_DEFAULT_PRIMARY_COLOR : '#2AAEC0');
966
- updatePreset({
967
- semantic: {
968
- primary: isDS
969
- ? generateTailwindPalette(base, '800')
970
- : generateTailwindPalette(base),
971
- },
972
- });
973
- }
974
- function changeBackgroundColor(color) {
975
- if (color) {
976
- const palette = generateTailwindPalette(color, '100');
977
- document.documentElement.style.setProperty('--app-background-light', palette['100']);
978
- document.documentElement.style.setProperty('--app-background-dark', palette['950']);
979
- }
980
- }
981
- function changeTextColor(color) {
982
- const palette = generateTailwindPalette(color ?? '#334155', '700');
983
- updatePreset({
984
- semantic: {
985
- colorScheme: {
986
- light: {
987
- text: {
988
- color: palette['700'],
989
- hoverColor: palette['800'],
990
- hoverMutedColor: palette['600'],
991
- mutedColor: palette['500'],
992
- },
993
- },
994
- dark: {
995
- text: {
996
- color: palette['0'],
997
- hoverColor: palette['0'],
998
- hoverMutedColor: palette['300'],
999
- mutedColor: palette['400'],
1000
- },
1001
- },
1002
- },
1003
- },
1004
- });
1005
- }
1006
- /**
1007
- * The palette step a filled primary control should use so white text on it
1008
- * clears WCAG AA (4.5:1).
1009
- *
1010
- * Kept as a named helper because it is the whole of finding H-03: the shipped
1011
- * default `#2AAEC0` gives white text 2.65:1, so Add / New / Filter / Apply /
1012
- * Submit — the controls that most need to be legible — were the least legible
1013
- * in the product, and every tenant who configured a light brand colour hit the
1014
- * same wall. Darkening the shipped hex would have fixed exactly one tenant and
1015
- * changed the product's colour; this keeps the hue and moves one step down the
1016
- * ramp their own colour already generated. A brand that passes at 500 stays at
1017
- * 500 and looks identical.
1018
- */
1019
- function accessiblePrimaryShade(palette) {
1020
- return pickAccessibleShade(palette, '500', '#ffffff', WCAG_AA_NORMAL_TEXT);
1021
- }
1022
- const MTPreset = (themeOptions) => {
1023
- const textPalette = generateTailwindPalette(themeOptions?.textColor ?? '#334155', '700');
1024
- const primaryPalette = generateTailwindPalette(themeOptions?.primaryColor || '#2AAEC0');
1025
- // Which shade filled controls use. See `accessiblePrimaryShade` — the tenant's
1026
- // hue is untouched; only the step on their own ramp moves, and only when white
1027
- // text would otherwise fail WCAG AA (finding H-03).
1028
- const primaryActionShade = accessiblePrimaryShade(primaryPalette);
1029
- const configs = {
1030
- options: {
1031
- prefix: 'mt',
1032
- cssLayer: {
1033
- name: 'primeng',
1034
- order: 'theme, base, primeng',
1035
- },
1036
- },
1037
- semantic: {
1038
- colorScheme: {
1039
- light: {
1040
- // Filled primary surfaces resolve to the first shade whose contrast
1041
- // with white text passes AA — usually 500, deeper only when the
1042
- // tenant's brand is too light. Borders/icons keep reading `primary.500`
1043
- // directly, so the brand accent itself is unchanged.
1044
- primary: {
1045
- color: `{primary.${primaryActionShade}}`,
1046
- contrastColor: '#ffffff',
1047
- hoverColor: `{primary.${primaryActionShade}}`,
1048
- activeColor: `{primary.${primaryActionShade}}`,
1049
- },
1050
- text: {
1051
- color: textPalette['700'],
1052
- hoverColor: textPalette['800'],
1053
- hoverMutedColor: textPalette['600'],
1054
- mutedColor: textPalette['500'],
1055
- },
1056
- },
1057
- dark: {
1058
- text: {
1059
- color: textPalette['0'],
1060
- hoverColor: textPalette['0'],
1061
- hoverMutedColor: textPalette['300'],
1062
- mutedColor: textPalette['400'],
1063
- },
1064
- },
1065
- },
1066
- primary: primaryPalette,
1067
- content: {
1068
- borderRadius: '{border.radius.lg}',
1069
- },
1070
- formField: {
1071
- borderRadius: inputBorderRadius,
1072
- },
1073
- },
1074
- components: {
1075
- autocomplete: {
1076
- root: {
1077
- borderRadius: inputBorderRadius,
1078
- },
1079
- },
1080
- cascadeselect: {
1081
- root: {
1082
- borderRadius: inputBorderRadius,
1083
- },
1084
- },
1085
- dialog: {
1086
- header: {
1087
- padding: '0',
1088
- },
1089
- content: {
1090
- padding: '0',
1091
- },
1092
- footer: {
1093
- padding: '0',
1094
- },
1095
- },
1096
- toast: {
1097
- root: {
1098
- borderRadius: '{border.radius.xl}',
1099
- },
1100
- colorScheme: {
1101
- light: {
1102
- success: toastStyle,
1103
- info: toastStyle,
1104
- warn: toastStyle,
1105
- error: toastStyle,
1106
- secondary: toastStyle,
1107
- },
1108
- dark: {
1109
- success: toastStyle,
1110
- info: toastStyle,
1111
- warn: toastStyle,
1112
- error: toastStyle,
1113
- secondary: toastStyle,
1114
- },
1115
- },
1116
- },
1117
- togglebutton: {
1118
- root: {
1119
- padding: '1px',
1120
- borderRadius: '{border.radius.sm}',
1121
- },
1122
- colorScheme: {
1123
- light: {
1124
- root: {
1125
- checkedColor: '{primary.500}',
1126
- },
1127
- },
1128
- dark: {
1129
- root: {
1130
- checkedColor: '{primary.400}',
1131
- },
1132
- },
1133
- },
1134
- },
1135
- button: {
1136
- root: {
1137
- borderRadius: '{border.radius.md}',
1138
- gap: '0.25rem',
1139
- },
1140
- css: () => `
1141
- .p-button.p-button-icon-only {
1142
- padding-inline: 0;
1143
- }
1144
- `,
1145
- },
1146
- inputtext: {
1147
- root: {
1148
- borderRadius: inputBorderRadius,
1149
- },
1150
- },
1151
- inputchips: {
1152
- root: {
1153
- borderRadius: inputBorderRadius,
1154
- },
1155
- },
1156
- listbox: {
1157
- root: {
1158
- borderRadius: inputBorderRadius,
1159
- },
1160
- },
1161
- avatar: {
1162
- root: {
1163
- borderRadius: '{border.radius.md}',
1164
- },
1165
- },
1166
- tooltip: {
1167
- css: () => `
1168
- .p-tooltip .p-tooltip-text {
1169
- font-size: 0.75rem;
1170
- line-height: 1.2;
1171
- }
1172
- `,
1173
- },
1174
- selectbutton: {
1175
- root: {
1176
- borderRadius: '{border.radius.md}',
1177
- },
1178
- },
1179
- multiselect: {
1180
- root: {
1181
- borderRadius: inputBorderRadius,
1182
- },
1183
- },
1184
- textarea: {
1185
- root: {
1186
- borderRadius: inputBorderRadius,
1187
- },
1188
- },
1189
- treeselect: {
1190
- root: {
1191
- borderRadius: inputBorderRadius,
1192
- },
1193
- },
1194
- paginator: {
1195
- root: {
1196
- borderRadius: '{border.radius.md}',
1197
- padding: '0',
1198
- },
1199
- navButton: {
1200
- borderRadius: '{border.radius.sm}',
1201
- },
1202
- colorScheme: {
1203
- light: {
1204
- navButton: {
1205
- color: '{surface.500}',
1206
- hoverBackground: '{surface.50}',
1207
- selectedBackground: '{primary.500}',
1208
- selectedColor: '#ffffff',
1209
- focusRing: {
1210
- color: '{primary.100}',
1211
- },
1212
- },
1213
- },
1214
- dark: {
1215
- navButton: {
1216
- color: '{surface.200}',
1217
- hoverBackground: 'transparent',
1218
- selectedBackground: '{primary.500}',
1219
- selectedColor: '#fff',
1220
- focusRing: {
1221
- color: '{primary.500}',
1222
- },
1223
- },
1224
- },
1225
- },
1226
- css: () => `
1227
- .p-paginator {
1228
- --p-paginator-gap: 0.375rem;
1229
- --p-paginator-nav-button-width: 1.75rem;
1230
- --p-paginator-nav-button-height: 1.75rem;
1231
- width: fit-content;
1232
- padding: 0;
1233
- border: 0;
1234
- background: transparent;
1235
- font-size: 0.875rem;
1236
- }
1237
-
1238
- .p-paginator-pages {
1239
- display: flex;
1240
- gap: var(--p-paginator-gap);
1241
- }
1242
-
1243
- .p-paginator-pages button,
1244
- .p-paginator-prev,
1245
- .p-paginator-next,
1246
- .p-paginator-first,
1247
- .p-paginator-last {
1248
- min-width: var(--p-paginator-nav-button-width);
1249
- height: var(--p-paginator-nav-button-height);
1250
- border: 1px solid var(--p-surface-200);
1251
- border-radius: 0.375rem;
1252
- background: #fff;
1253
- color: #667085;
1254
- box-shadow: none;
1255
- }
1256
-
1257
- .p-paginator .p-paginator-page.p-paginator-page-selected {
1258
- border-color: var(--p-primary-color);
1259
- background: var(--p-primary-color);
1260
- color: #fff;
1261
- font-weight: 500;
1262
- }
1263
-
1264
- .p-paginator-pages button:not(.p-paginator-page-selected):hover,
1265
- .p-paginator-prev:hover,
1266
- .p-paginator-next:hover,
1267
- .p-paginator-first:hover,
1268
- .p-paginator-last:hover {
1269
- background: var(--p-surface-50);
1270
- }
1271
-
1272
- .p-paginator .p-select {
1273
- min-height: var(--p-paginator-nav-button-height);
1274
- margin-inline-start: 0.5rem;
1275
- border: 1px solid var(--p-surface-200);
1276
- border-radius: 0.5rem;
1277
- background: #fff;
1278
- }
1279
-
1280
- .p-paginator .p-select .p-select-label {
1281
- padding: 0.375rem 0.625rem;
1282
- font-size: 0.875rem;
1283
- }
1284
-
1285
- /* Dark Mode Styles */
1286
- .dark .p-paginator-pages button,
1287
- .dark .p-paginator-prev,
1288
- .dark .p-paginator-next,
1289
- .dark .p-paginator-first,
1290
- .dark .p-paginator-last,
1291
- .dark .p-paginator .p-select {
1292
- border-color: var(--p-surface-500);
1293
- background: var(--p-surface-900);
1294
- }
1295
-
1296
- .dark .p-paginator .p-paginator-page.p-paginator-page-selected {
1297
- border-color: var(--p-primary-color);
1298
- background: var(--p-primary-color);
1299
- color: #fff;
1300
- }
1301
- `,
1302
- },
1303
- toggleswitch: {
1304
- root: {
1305
- width: '2.5rem',
1306
- height: '1.4rem',
1307
- },
1308
- },
1309
- select: {
1310
- root: {
1311
- borderRadius: inputBorderRadius,
1312
- },
1313
- optionGroup: {
1314
- fontWeight: 'bold',
1315
- padding: '6px 8px',
1316
- background: '{surface.50}',
1317
- color: '{primary.700}',
1318
- },
1319
- },
1320
- // steps: {
1321
- // item: {
1322
- // link: {
1323
- // gap: 'calc(50% + 0.25rem)',
1324
- // },
1325
- // number: {
1326
- // font: {
1327
- // size: '0.9rem',
1328
- // },
1329
- // active: {
1330
- // color: 'white',
1331
- // background: '{primary.500}',
1332
- // border: {
1333
- // color: '{primary.500}',
1334
- // },
1335
- // },
1336
- // },
1337
- // },
1338
- // },
1339
- },
1340
- };
1341
- // The DS layer is merged last so it wins on the tokens it names, while
1342
- // everything it stays silent about keeps the classic behaviour.
1343
- if ((themeOptions?.designIdentity ?? 'classic') === 'experimental') {
1344
- return definePreset(Aura, configs, dsIdentityConfigs(themeOptions?.primaryColor));
1345
- }
1346
- return definePreset(Aura, configs);
1347
- };
1348
- /**
1349
- * Switches identity at runtime — for the showcase toggle and for side-by-side
1350
- * review. Replaces the active preset outright (rather than merging into it, as
1351
- * `updatePreset` would) so switching back to classic is lossless.
1352
- */
1353
- function setMTDesignIdentity(identity, themeOptions) {
1354
- activeDesignIdentity = identity;
1355
- applyDesignIdentityClass(identity);
1356
- usePreset(MTPreset({ ...themeOptions, designIdentity: identity }));
1357
- }
1358
- function provideMTComponents(themeOptions) {
1359
- activeDesignIdentity = themeOptions?.designIdentity ?? 'classic';
1360
- applyDesignIdentityClass(activeDesignIdentity);
1361
- changeBackgroundColor(themeOptions?.backgroundColor);
1362
- return providePrimeNG({
1363
- zIndex: {
1364
- modal: 1900,
1365
- overlay: 1500,
1366
- menu: 1500,
1367
- tooltip: 1600,
1368
- },
1369
- theme: {
1370
- preset: MTPreset(themeOptions),
1371
- options: {
1372
- darkModeSelector: '.dark',
1373
- },
1374
- },
1375
- });
1376
- }
1377
-
1378
- function provideMTMessages() {
1379
- return MessageService;
1380
- }
1381
-
1382
- function provideMTConfirmation() {
1383
- return ConfirmationService;
1384
- }
1385
-
1386
- const DEFAULT_MT_DATE_FORMATS = {
1387
- date: 'dd/MM/yyyy',
1388
- dateTime: 'dd/MM/yyyy HH:mm',
1389
- time: 'HH:mm',
1390
- };
1391
- const MT_DATE_FORMATS = new InjectionToken('MT_DATE_FORMATS', {
1392
- factory: () => ({ ...DEFAULT_MT_DATE_FORMATS }),
1393
- });
1394
- /**
1395
- * Converts .NET custom date/time format tokens to Angular `formatDate` (CLDR)
1396
- * tokens. System-setting formats are authored in .NET convention (e.g. `hh:mm tt`),
1397
- * but `formatDate` uses CLDR tokens where the AM/PM designator is `a`, not `tt`.
1398
- * Every other token in the supported set (d, M, y, H, h, m, s) is identical between
1399
- * the two, so only `tt`/`t` → `a` needs translating. Single-quoted literal sections
1400
- * (e.g. `'at'`) are left untouched.
1401
- */
1402
- function toAngularDateFormat(format) {
1403
- return format
1404
- .split(/('[^']*')/g)
1405
- .map((part) => (part.startsWith("'") ? part : part.replace(/t+/g, 'a')))
1406
- .join('');
1407
- }
1408
- function provideMTDateFormats(formats) {
1409
- return makeEnvironmentProviders([
1410
- {
1411
- provide: MT_DATE_FORMATS,
1412
- useFactory: () => ({
1413
- ...DEFAULT_MT_DATE_FORMATS,
1414
- ...formats,
1415
- }),
1416
- },
1417
- ]);
1418
- }
1419
-
1420
- class ValidatorConfig {
1421
- type;
1422
- value;
1423
- message;
1424
- customValidator;
1425
- constructor(config) {
1426
- this.type = config.type;
1427
- this.value = config.value;
1428
- this.message = config.message;
1429
- this.customValidator = config.customValidator;
1430
- }
1431
- // Factory methods for common validators.
1432
- //
1433
- // IMPORTANT: none of these default `message` to a hardcoded English string.
1434
- // buildValidators() wraps the underlying Angular validator (and keys the
1435
- // resulting error) whenever `config.message` is truthy — a default here
1436
- // would mean every consumer that omits a message still gets one baked in,
1437
- // permanently shadowing ErrorMessagePipe's translated generic message for
1438
- // that error type in every locale but English. Only pass a message when
1439
- // you have a real, field-specific (and ideally already-translated) one to
1440
- // show; otherwise leave it unset and let the pipe render the translated
1441
- // generic copy.
1442
- static required(message) {
1443
- return new ValidatorConfig({ type: 'required', message });
1444
- }
1445
- static email(message) {
1446
- return new ValidatorConfig({ type: 'email', message });
1447
- }
1448
- static minLength(length, message) {
1449
- return new ValidatorConfig({ type: 'minLength', value: length, message });
1450
- }
1451
- static maxLength(length, message) {
1452
- return new ValidatorConfig({ type: 'maxLength', value: length, message });
1453
- }
1454
- static min(value, message) {
1455
- return new ValidatorConfig({ type: 'min', value, message });
1456
- }
1457
- static max(value, message) {
1458
- return new ValidatorConfig({ type: 'max', value, message });
1459
- }
1460
- static pattern(pattern, message) {
1461
- return new ValidatorConfig({ type: 'pattern', value: pattern, message });
1462
- }
1463
- static custom(validator, message = 'Invalid value') {
1464
- return new ValidatorConfig({
1465
- type: 'custom',
1466
- customValidator: validator,
1467
- message,
1468
- });
1469
- }
1470
- }
1471
- class BaseFieldConfig {
1472
- key;
1473
- label;
1474
- type;
1475
- required;
1476
- disabled;
1477
- readonly;
1478
- hidden;
1479
- placeholder;
1480
- hint;
1481
- cssClass;
1482
- validators;
1483
- order;
1484
- colSpan;
1485
- defaultValue;
1486
- customTemplate;
1487
- relations;
1488
- formulaCondition;
1489
- constructor(config) {
1490
- this.key = config.key || 'Key';
1491
- this.label = config.label || '';
1492
- this.type = config.type;
1493
- this.required = config.required || false;
1494
- this.disabled = config.disabled || false;
1495
- this.readonly = config.readonly || false;
1496
- this.hidden = config.hidden || false;
1497
- this.placeholder = config.placeholder || '';
1498
- this.hint = config.hint || '';
1499
- this.cssClass = config.cssClass || '';
1500
- this.validators = config.validators || [];
1501
- this.order = config.order || 0;
1502
- this.relations = config.relations || [];
1503
- this.formulaCondition = config.formulaCondition;
1504
- this.colSpan = config.colSpan || 12;
1505
- }
1506
- }
1507
- // Specific configurations for different field types
1508
- class TextFieldConfig extends BaseFieldConfig {
1509
- inputType;
1510
- constructor(config) {
1511
- super({ ...config, type: 'text' });
1512
- this.inputType = config.inputType || 'text';
1513
- }
1514
- }
1515
- class TextareaFieldConfig extends BaseFieldConfig {
1516
- rows;
1517
- autoResize;
1518
- constructor(config) {
1519
- super({ ...config, type: 'textarea' });
1520
- this.rows = config.rows || 3;
1521
- this.autoResize = config.autoResize || false;
1522
- }
1523
- }
1524
- class SelectFieldConfig extends BaseFieldConfig {
1525
- options;
1526
- optionLabel;
1527
- optionValue;
1528
- group;
1529
- optionGroupLabel;
1530
- optionGroupChildren;
1531
- multiple;
1532
- filter;
1533
- filterBy;
1534
- filterPlaceholder;
1535
- showClear;
1536
- emptyMessage;
1537
- size;
1538
- hasPlaceholderPrefix;
1539
- constructor(config) {
1540
- super({ ...config, type: 'select' });
1541
- this.options = config.options;
1542
- this.optionLabel = config.optionLabel || 'label';
1543
- this.optionValue = config.optionValue || 'value';
1544
- this.group = config.group || false;
1545
- this.optionGroupLabel = config.optionGroupLabel || 'label';
1546
- this.optionGroupChildren = config.optionGroupChildren || 'items';
1547
- this.multiple = config.multiple || false;
1548
- this.filter = config.filter || false;
1549
- this.filterBy = config.filterBy || '';
1550
- this.filterPlaceholder = config.filterPlaceholder || 'Search...';
1551
- this.showClear = config.showClear || false;
1552
- this.emptyMessage = config.emptyMessage || 'No options available';
1553
- this.size = config.size || '';
1554
- this.hasPlaceholderPrefix =
1555
- config.hasPlaceholderPrefix === undefined
1556
- ? true
1557
- : config.hasPlaceholderPrefix;
1558
- }
1559
- }
1560
- class RadioButtonFieldConfig extends BaseFieldConfig {
1561
- options;
1562
- optionLabel;
1563
- optionValue;
1564
- orientation;
1565
- constructor(config) {
1566
- super({ ...config, type: 'radio-button' });
1567
- this.options = config.options;
1568
- this.optionLabel = config.optionLabel || 'label';
1569
- this.optionValue = config.optionValue || 'value';
1570
- this.orientation = config.orientation || 'vertical';
1571
- }
1572
- }
1573
- class RadioCardsFieldConfig extends BaseFieldConfig {
1574
- options;
1575
- optionLabel;
1576
- optionValue;
1577
- size;
1578
- constructor(config) {
1579
- super({ ...config, type: 'radio-cards' });
1580
- this.options = config.options;
1581
- this.optionLabel = config.optionLabel || 'label';
1582
- this.optionValue = config.optionValue || 'value';
1583
- this.size = config.size || 'small';
1584
- }
1585
- }
1586
- class UserSearchFieldConfig extends BaseFieldConfig {
1587
- optionLabel;
1588
- optionValue;
1589
- size;
1590
- apiUrl;
1591
- context;
1592
- isMultiple;
1593
- hideUnlinkedHint;
1594
- dataKey;
1595
- paramName;
1596
- minLength;
1597
- constructor(config) {
1598
- super({ ...config, type: 'user-search' });
1599
- this.optionLabel = config.optionLabel || 'label';
1600
- this.optionValue = config.optionValue || 'value';
1601
- this.size = config.size || '';
1602
- this.hint = config.hint || '';
1603
- this.context = config.context || undefined;
1604
- this.apiUrl = config.apiUrl || '';
1605
- this.placeholder = config.placeholder || 'Search';
1606
- this.isMultiple = config.isMultiple || false;
1607
- this.hideUnlinkedHint = config.hideUnlinkedHint || false;
1608
- this.dataKey = config.dataKey || 'data';
1609
- this.paramName = config.paramName || 'query';
1610
- this.minLength = config.minLength ?? 1;
1611
- }
1612
- }
1613
- class LocationFieldConfig extends BaseFieldConfig {
1614
- configuration;
1615
- searchUrl;
1616
- minLength;
1617
- constructor(config) {
1618
- super({ ...config, type: 'location' });
1619
- this.configuration = config.configuration ?? null;
1620
- this.searchUrl = config.searchUrl;
1621
- this.minLength = config.minLength ?? 2;
1622
- }
1623
- }
1624
- class UploadFileFieldConfig extends BaseFieldConfig {
1625
- size;
1626
- endPoint;
1627
- userImgClass;
1628
- shape;
1629
- multiple;
1630
- accept;
1631
- fileSizeLimit;
1632
- context;
1633
- title;
1634
- description;
1635
- constructor(config) {
1636
- super({ ...config, type: 'upload-file' });
1637
- this.size = config.size || 'normal';
1638
- this.endPoint = config.endPoint || 'uploader';
1639
- this.userImgClass =
1640
- config.userImgClass || 'w-25! h-25! text-4xl! text-gray-400!';
1641
- this.shape = config.shape || 'field';
1642
- this.multiple = config.multiple ?? false;
1643
- this.accept = config.accept || '.pdf,.doc,.docx,.xlsx,image/*';
1644
- this.fileSizeLimit = config.fileSizeLimit || undefined;
1645
- this.context = config.context || undefined;
1646
- this.title = config.title || 'Upload File';
1647
- this.description = config.description || 'Click or drop a file to upload';
1648
- }
1649
- }
1650
- class DateFieldConfig extends BaseFieldConfig {
1651
- dateFormat;
1652
- showTime;
1653
- /** Edits the clock time only — no calendar. The value stays a full `Date`. */
1654
- timeOnly;
1655
- showSeconds;
1656
- hourFormat;
1657
- minDate;
1658
- maxDate;
1659
- disabledDates;
1660
- disabledDays;
1661
- yearRange;
1662
- showIcon;
1663
- icon;
1664
- showButtonBar;
1665
- showClear;
1666
- inline;
1667
- constructor(config) {
1668
- super({ ...config, type: 'date' });
1669
- this.dateFormat = config.dateFormat || 'yyyy-mm-dd';
1670
- this.showTime = config.showTime || false;
1671
- this.timeOnly = config.timeOnly || false;
1672
- this.showSeconds = config.showSeconds || false;
1673
- this.hourFormat = config.hourFormat || '24';
1674
- this.minDate = config.minDate;
1675
- this.maxDate = config.maxDate;
1676
- this.disabledDates = config.disabledDates || [];
1677
- this.disabledDays = config.disabledDays || [];
1678
- this.yearRange = config.yearRange || '1900:2030';
1679
- this.showIcon = config.showIcon || true;
1680
- this.icon = config.icon || 'pi pi-calendar';
1681
- this.showButtonBar = config.showButtonBar || false;
1682
- this.showClear = config.showClear || true;
1683
- this.inline = config.inline || false;
1684
- }
1685
- }
1686
- class NumberFieldConfig extends BaseFieldConfig {
1687
- min;
1688
- max;
1689
- step;
1690
- prefix;
1691
- suffix;
1692
- currency;
1693
- locale;
1694
- minFractionDigits;
1695
- maxFractionDigits;
1696
- useGrouping;
1697
- showButtons;
1698
- buttonLayout;
1699
- incrementButtonClass;
1700
- decrementButtonClass;
1701
- incrementButtonIcon;
1702
- decrementButtonIcon;
1703
- constructor(config) {
1704
- super({ ...config, type: 'number' });
1705
- this.min = config.min;
1706
- this.max = config.max;
1707
- this.step = config.step || 1;
1708
- this.prefix = config.prefix;
1709
- this.suffix = config.suffix;
1710
- this.currency = config.currency;
1711
- this.locale = config.locale;
1712
- this.minFractionDigits = config.minFractionDigits;
1713
- this.maxFractionDigits = config.maxFractionDigits;
1714
- this.useGrouping = config.useGrouping || false;
1715
- this.showButtons = config.showButtons || false;
1716
- this.buttonLayout = config.buttonLayout || 'stacked';
1717
- this.incrementButtonClass = config.incrementButtonClass;
1718
- this.decrementButtonClass = config.decrementButtonClass;
1719
- this.incrementButtonIcon = config.incrementButtonIcon;
1720
- this.decrementButtonIcon = config.decrementButtonIcon;
1721
- }
1722
- }
1723
- class SliderFieldConfig extends BaseFieldConfig {
1724
- min;
1725
- max;
1726
- step;
1727
- orientation;
1728
- range;
1729
- animate;
1730
- unit;
1731
- constructor(config) {
1732
- super({ ...config, type: 'slider' });
1733
- this.min = config.min || 0;
1734
- this.max = config.max || 100;
1735
- this.step = config.step || 1;
1736
- this.orientation = config.orientation || 'horizontal';
1737
- this.range = config.range || false;
1738
- this.animate = config.animate || false;
1739
- this.unit = config.unit || '';
1740
- }
1741
- }
1742
- class MultiSelectFieldConfig extends BaseFieldConfig {
1743
- options;
1744
- optionLabel;
1745
- optionValue;
1746
- filter;
1747
- filterBy;
1748
- filterPlaceholder;
1749
- showClear;
1750
- emptyMessage;
1751
- display;
1752
- maxSelectedLabels;
1753
- selectedItemsLabel;
1754
- showToggleAll;
1755
- resetFilterOnHide;
1756
- constructor(config) {
1757
- super({ ...config, type: 'multi-select' });
1758
- this.options = config.options;
1759
- this.optionLabel = config.optionLabel || 'label';
1760
- this.optionValue = config.optionValue || 'value';
1761
- this.filter = config.filter || false;
1762
- this.filterBy = config.filterBy || '';
1763
- this.filterPlaceholder = config.filterPlaceholder || 'Search...';
1764
- this.showClear = config.showClear || false;
1765
- this.emptyMessage = config.emptyMessage || 'No options available';
1766
- this.display = config.display || 'comma';
1767
- this.maxSelectedLabels = config.maxSelectedLabels || 3;
1768
- this.selectedItemsLabel = config.selectedItemsLabel || '{0} items selected';
1769
- this.showToggleAll = config.showToggleAll || true;
1770
- this.resetFilterOnHide = config.resetFilterOnHide || false;
1771
- }
1772
- }
1773
- class PickListFieldConfig extends BaseFieldConfig {
1774
- options;
1775
- optionLabel;
1776
- optionValue;
1777
- sourceHeader;
1778
- targetHeader;
1779
- showSourceControls;
1780
- showTargetControls;
1781
- showSourceFilter;
1782
- showTargetFilter;
1783
- filterBy;
1784
- dataKey;
1785
- dragdrop;
1786
- responsive;
1787
- breakpoint;
1788
- constructor(config) {
1789
- super({ ...config, type: 'pick-list' });
1790
- this.options = config.options;
1791
- this.optionLabel = config.optionLabel || 'label';
1792
- this.optionValue = config.optionValue || 'value';
1793
- this.sourceHeader = config.sourceHeader || 'Available';
1794
- this.targetHeader = config.targetHeader || 'Selected';
1795
- this.showSourceControls =
1796
- config.showSourceControls !== undefined
1797
- ? config.showSourceControls
1798
- : true;
1799
- this.showTargetControls =
1800
- config.showTargetControls !== undefined
1801
- ? config.showTargetControls
1802
- : true;
1803
- this.showSourceFilter =
1804
- config.showSourceFilter !== undefined ? config.showSourceFilter : false;
1805
- this.showTargetFilter =
1806
- config.showTargetFilter !== undefined ? config.showTargetFilter : false;
1807
- this.filterBy = config.filterBy || this.optionLabel;
1808
- this.dataKey = config.dataKey || this.optionValue;
1809
- this.dragdrop = config.dragdrop ?? false;
1810
- this.responsive = config.responsive ?? true;
1811
- }
1812
- }
1813
- class CheckboxFieldConfig extends BaseFieldConfig {
1814
- binary;
1815
- trueValue;
1816
- falseValue;
1817
- checkboxIcon;
1818
- constructor(config) {
1819
- super({ ...config, type: 'checkbox' });
1820
- this.binary = config.binary !== false; // Default to true
1821
- this.trueValue = config.trueValue !== undefined ? config.trueValue : true;
1822
- this.falseValue =
1823
- config.falseValue !== undefined ? config.falseValue : false;
1824
- this.checkboxIcon = config.checkboxIcon;
1825
- }
1826
- }
1827
- class ToggleFieldConfig extends BaseFieldConfig {
1828
- toggleShape;
1829
- icon;
1830
- descriptionCard;
1831
- constructor(config) {
1832
- super({ ...config, type: 'toggle' });
1833
- this.toggleShape = config.toggleShape ?? 'toggle';
1834
- this.icon = config.icon;
1835
- this.descriptionCard = config.descriptionCard;
1836
- }
1837
- }
1838
- class EditorFieldConfig extends BaseFieldConfig {
1839
- constructor(config) {
1840
- super({ ...config, type: 'editor-field' });
1841
- }
1842
- }
1843
- class ColorPickerFieldConfig extends BaseFieldConfig {
1844
- format;
1845
- inline;
1846
- appendTo;
1847
- variant;
1848
- constructor(config) {
1849
- super({ ...config, type: 'color-picker' });
1850
- this.format = config.format || 'hex';
1851
- this.inline = config.inline || false;
1852
- this.appendTo = config.appendTo || 'body';
1853
- this.variant = config.variant || 'outlined';
1854
- }
1855
- }
1856
- class IconFieldConfig extends BaseFieldConfig {
1857
- constructor(config) {
1858
- super({ ...config, type: 'icon-field' });
1859
- }
1860
- }
1861
- class SpacerFieldConfig extends BaseFieldConfig {
1862
- constructor(config) {
1863
- super({
1864
- ...config,
1865
- type: 'spacer',
1866
- key: config.key || `spacer_${Date.now()}`,
1867
- label: config.label || '',
1868
- });
1869
- }
1870
- }
1871
- class LookupMatrixFieldConfig extends BaseFieldConfig {
1872
- xFieldKey;
1873
- yFieldKey;
1874
- xAxisLabel;
1875
- yAxisLabel;
1876
- xOptions;
1877
- yOptions;
1878
- cells;
1879
- emptyMessage;
1880
- constructor(config) {
1881
- super({ ...config, type: 'lookup-matrix' });
1882
- this.xFieldKey = config.xFieldKey;
1883
- this.yFieldKey = config.yFieldKey;
1884
- this.xAxisLabel = config.xAxisLabel || '';
1885
- this.yAxisLabel = config.yAxisLabel;
1886
- this.xOptions = config.xOptions || [];
1887
- this.yOptions = config.yOptions;
1888
- this.cells = config.cells || [];
1889
- this.emptyMessage = config.emptyMessage || 'No matrix data available';
1890
- }
1891
- }
1892
- class SchemaConnectionFieldConfig extends BaseFieldConfig {
1893
- configuration;
1894
- context;
1895
- filter;
1896
- constructor(config) {
1897
- super({ ...config, type: 'schema-connection' });
1898
- this.configuration = config.configuration;
1899
- this.context = config.context || undefined;
1900
- this.filter = config.filter ?? true;
1901
- }
1902
- }
1903
- class SchedulePredecessorFieldConfig extends BaseFieldConfig {
1904
- configuration;
1905
- runtimeContext;
1906
- constructor(config) {
1907
- super({ ...config, type: 'predecessor' });
1908
- this.configuration = config.configuration ?? null;
1909
- this.runtimeContext = config.runtimeContext ?? null;
1910
- }
1911
- }
1912
- class EntityListFieldConfig extends BaseFieldConfig {
1913
- /** EntityList property id (used in the read endpoint route). */
1914
- propertyId;
1915
- /** Property configuration (sourceType, moduleId, access, snapshotMode, fields). */
1916
- configuration;
1917
- /** Runtime ids needed to call the read endpoint. */
1918
- runtimeContext;
1919
- context;
1920
- constructor(config) {
1921
- super({ ...config, type: 'entity-list' });
1922
- this.propertyId = config.propertyId ?? null;
1923
- this.configuration = config.configuration ?? null;
1924
- this.runtimeContext = config.runtimeContext ?? null;
1925
- this.context = config.context;
1926
- }
1927
- }
1928
- class ScheduleItemSelectorFieldConfig extends BaseFieldConfig {
1929
- /** Property key — used in the options endpoint route `forms/options/{propertyKey}`. */
1930
- propertyKey;
1931
- /** `Single` renders a single-select picker, `Multi` a multi-select picker. */
1932
- selectionMode;
1933
- /** Raw property configuration (selectionMode, scheduleModuleKey, etc.). */
1934
- configuration;
1935
- /** Runtime ids needed to call the options endpoint. */
1936
- runtimeContext;
1937
- context;
1938
- constructor(config) {
1939
- super({ ...config, type: 'schedule-item-selector' });
1940
- this.propertyKey = config.propertyKey || config.key || '';
1941
- this.selectionMode = config.selectionMode || 'Multi';
1942
- this.configuration = config.configuration ?? null;
1943
- this.runtimeContext = config.runtimeContext ?? null;
1944
- this.context = config.context;
1945
- }
1946
- }
1947
- class LookupModuleCheckListFieldConfig extends BaseFieldConfig {
1948
- /** Lookup items rendered as collapsible checklist sections. */
1949
- lookupOptions;
1950
- /** Full lookup catalog passed through to the rich nested form renderer. */
1951
- lookups;
1952
- /** Module property keys/labels captured per checklist entry. */
1953
- propertyFields;
1954
- /** Scope module id whose form is loaded for each section. */
1955
- scopeId;
1956
- /** Property keys to render in each section form (`allowedFieldKeys`). */
1957
- propertyKeys;
1958
- /** Runtime ids needed to load each section form. */
1959
- runtimeContext;
1960
- /** Raw property configuration (lookup id, scope/module id, properties). */
1961
- configuration;
1962
- constructor(config) {
1963
- super({ ...config, type: 'lookup-module-check-list' });
1964
- this.lookupOptions = config.lookupOptions || [];
1965
- this.lookups = config.lookups || [];
1966
- this.propertyFields = config.propertyFields || [];
1967
- this.scopeId = config.scopeId ?? null;
1968
- this.propertyKeys = config.propertyKeys || [];
1969
- this.runtimeContext = config.runtimeContext ?? null;
1970
- this.configuration = config.configuration ?? null;
1971
- }
1972
- }
1973
- function createCustomValidator(customValidator, message) {
1974
- return (control) => {
1975
- const result = customValidator(control.value, control);
1976
- if (result instanceof Promise) {
1977
- // Handle async validation
1978
- result.then((isValid) => {
1979
- if (!isValid) {
1980
- control.setErrors({
1981
- custom: { message: message || 'Invalid value' },
1982
- });
1983
- }
1984
- });
1985
- return null; // For async, return null initially
1986
- }
1987
- else {
1988
- // Handle sync validation
1989
- return result
1990
- ? null
1991
- : { custom: { message: message || 'Invalid value' } };
1992
- }
1993
- };
1994
- }
1995
- function wrapValidatorWithMessage(validator, errorKey, message) {
1996
- return (control) => {
1997
- const result = validator(control);
1998
- if (result) {
1999
- // Replace the default error with custom message
2000
- return { [errorKey]: { ...result[Object.keys(result)[0]], message } };
2001
- }
2002
- return null;
2003
- };
2004
- }
2005
- // DynamicFieldConfig = input.required<any>({
2006
- // transform: (value: any) => this.transformToDateFieldConfig(value)
2007
- // });
2008
- // transformToDateFieldConfig(value: any){
2009
- // return new TextFieldConfig()
2010
- // }
2011
-
2012
- /**
2013
- * @deprecated Use direct `select()` + `computed()` pattern instead for better performance.
2014
- *
2015
- * **Problem with BaseFacade:**
2016
- * - All computed signals depend on the full state, causing unnecessary recomputations
2017
- * - Bypasses NGXS selector memoization
2018
- * - Uses `as any` casting, losing type safety
2019
- *
2020
- * **New Pattern - Use slice-based selectors:**
2021
- *
2022
- * ```typescript
2023
- * // In your State class - add slice selectors:
2024
- * @Selector()
2025
- * static getLoadingActive(state: MyStateModel): string[] {
2026
- * return state.loadingActive;
2027
- * }
2028
- *
2029
- * @Selector()
2030
- * static getErrors(state: MyStateModel): Record<string, string | null> {
2031
- * return state.errors;
2032
- * }
2033
- *
2034
- * // In your Facade - don't extend BaseFacade:
2035
- * @Injectable({ providedIn: 'root' })
2036
- * export class MyFacade {
2037
- * private readonly store = inject(Store);
2038
- *
2039
- * // Data selectors - memoized by NGXS
2040
- * readonly items = select(MyState.getItems);
2041
- *
2042
- * // Loading/Error slices - memoized by NGXS
2043
- * private readonly loadingActive = select(MyState.getLoadingActive);
2044
- * private readonly errors = select(MyState.getErrors);
2045
- *
2046
- * // Loading signals - computed from slice (minimal reactivity)
2047
- * readonly isLoadingItems = computed(() =>
2048
- * this.loadingActive().includes(MyActionKey.GetItems)
2049
- * );
2050
- *
2051
- * // Error signals - computed from slice (minimal reactivity)
2052
- * readonly itemsError = computed(() =>
2053
- * this.errors()[MyActionKey.GetItems] ?? null
2054
- * );
2055
- *
2056
- * // Dispatchers
2057
- * loadItems() {
2058
- * return this.store.dispatch(new GetItems());
2059
- * }
2060
- * }
2061
- * ```
2062
- *
2063
- * **Template Usage:**
2064
- * ```html
2065
- * @if (facade.isLoadingItems()) {
2066
- * <loading-spinner />
2067
- * } @else if (facade.itemsError(); as error) {
2068
- * <error-alert>{{ error }}</error-alert>
2069
- * } @else {
2070
- * @for (item of facade.items(); track item.id) {
2071
- * <item-card [item]="item" />
2072
- * }
2073
- * }
2074
- * ```
2075
- */
2076
- class BaseFacade {
2077
- /**
2078
- * Creates a query object with separate signals for data, loading, and error states
2079
- * Each property is its own signal for granular reactivity
2080
- *
2081
- * @example
2082
- * readonly modulesQuery = this.query(
2083
- * 'getModulesLoading',
2084
- * (state) => state.allModules
2085
- * );
2086
- *
2087
- * // In template - each is a separate signal:
2088
- * @if (modulesQuery.isPending()) { Loading... }
2089
- * @if (modulesQuery.error(); as error) { Error: {{ error }} }
2090
- * @if (modulesQuery.data(); as modules) {
2091
- * <div *ngFor="let m of modules">{{ m.title }}</div>
2092
- * }
2093
- */
2094
- query(loadingKey, dataSelector) {
2095
- const stateSignal = this.state();
2096
- const isPending = computed(() => {
2097
- const currentState = stateSignal();
2098
- return currentState.loadingActive?.includes(loadingKey) ?? false;
2099
- }, ...(ngDevMode ? [{ debugName: "isPending" }] : /* istanbul ignore next */ []));
2100
- const error = computed(() => {
2101
- const currentState = stateSignal();
2102
- return currentState.errors?.[loadingKey] ?? null;
2103
- }, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
2104
- const data = computed(() => {
2105
- const currentState = stateSignal();
2106
- const hasError = currentState.errors?.[loadingKey];
2107
- return hasError ? null : dataSelector(currentState);
2108
- }, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
2109
- const isSuccess = computed(() => !isPending() && !error() && data() !== null, ...(ngDevMode ? [{ debugName: "isSuccess" }] : /* istanbul ignore next */ []));
2110
- const isError = computed(() => !!error(), ...(ngDevMode ? [{ debugName: "isError" }] : /* istanbul ignore next */ []));
2111
- return {
2112
- data,
2113
- isPending,
2114
- isSuccess,
2115
- isError,
2116
- error,
2117
- };
2118
- }
2119
- /**
2120
- * Creates a loading signal for a specific operation
2121
- */
2122
- loading(loadingKey) {
2123
- const stateSignal = this.state();
2124
- return computed(() => {
2125
- const currentState = stateSignal();
2126
- return currentState.loadingActive?.includes(loadingKey) ?? false;
2127
- });
2128
- }
2129
- /**
2130
- * Creates an error signal for a specific operation
2131
- */
2132
- errorSignal(loadingKey) {
2133
- const stateSignal = this.state();
2134
- return computed(() => {
2135
- const currentState = stateSignal();
2136
- return currentState.errors?.[loadingKey] ?? null;
2137
- });
2138
- }
2139
- }
2140
-
2141
- function createEntityAdapter() {
2142
- return {
2143
- addOne: (state, entity) => [...state, entity],
2144
- upsertOne: (state, entity, uniqueKey = 'id') => {
2145
- const key = entity[uniqueKey];
2146
- if (key == null)
2147
- return state;
2148
- const index = state.findIndex((e) => e[uniqueKey] === key);
2149
- if (index === -1) {
2150
- return [...state, entity];
2151
- }
2152
- const clone = [...state];
2153
- clone[index] = entity;
2154
- return clone;
2155
- },
2156
- updateOne: (state, id, changes, uniqueKey = 'id') => state.map((e) => (e[uniqueKey] === id ? { ...e, ...changes } : e)),
2157
- removeOne: (state, id, uniqueKey = 'id') => state.filter((e) => e[uniqueKey] !== id),
2158
- setAll: (_state, entities) => [...entities],
2159
- };
2160
- }
2161
-
2162
- function startLoading(ctx, loadingName) {
2163
- const { loadingActive, errors } = ctx.getState();
2164
- if (!loadingActive.includes(loadingName)) {
2165
- ctx.patchState({
2166
- loadingActive: [...loadingActive, loadingName],
2167
- });
2168
- }
2169
- if (errors && errors[loadingName]) {
2170
- const { [loadingName]: _removed, ...rest } = errors;
2171
- ctx.patchState({ errors: rest });
2172
- }
2173
- }
2174
- function endLoading(ctx, loadingName) {
2175
- const { loadingActive } = ctx.getState();
2176
- ctx.patchState({
2177
- loadingActive: loadingActive.filter((name) => name !== loadingName),
2178
- });
2179
- }
2180
- function setLoadingError(ctx, loadingName, message) {
2181
- const { errors } = ctx.getState();
2182
- ctx.patchState({
2183
- errors: { ...errors, [loadingName]: message },
2184
- });
2185
- }
2186
-
2187
- function handleApiRequest(config) {
2188
- const { ctx, key, request$, onSuccess, onError, errorMessage } = config;
2189
- startLoading(ctx, key);
2190
- return request$.pipe(tap((response) => {
2191
- const state = ctx.getState();
2192
- const patch = onSuccess(response, state);
2193
- if (patch) {
2194
- ctx.patchState(patch);
2195
- }
2196
- }), catchError((error) => {
2197
- const state = ctx.getState();
2198
- const message = error?.error?.message ?? error?.message ?? errorMessage;
2199
- setLoadingError(ctx, key, message);
2200
- // Call onError callback if provided
2201
- if (onError) {
2202
- const patch = onError(error, state);
2203
- if (patch) {
2204
- ctx.patchState(patch);
2205
- }
2206
- }
2207
- throw error;
2208
- }), finalize(() => endLoading(ctx, key)));
2209
- }
2210
-
2211
- /**
2212
- * T = entity type (Module, User, ...)
2213
- * TState = full state model (must include LoadingStateShape)
2214
- * TLoad = union type of loading keys for this feature
2215
- */
2216
- class CrudStateBase {
2217
- adapter = createEntityAdapter();
2218
- /**
2219
- * Helper to create default updateState function
2220
- */
2221
- getDefaultUpdateState(stateProperty) {
2222
- // Try to extract the property name from the stateProperty function
2223
- const funcStr = stateProperty.toString();
2224
- const match = funcStr.match(/\.([a-zA-Z_$][a-zA-Z0-9_$]*)/); // Match .propertyName
2225
- const key = match ? match[1] : 'items';
2226
- return (state, items) => ({ [key]: items });
2227
- }
2228
- /**
2229
- * @deprecated Use `handleApiRequest` directly with `onSuccess` callback.
2230
- * The `load()` method provides no significant benefit over `handleApiRequest`.
2231
- *
2232
- * @example
2233
- * // Instead of this.load(), use:
2234
- * return handleApiRequest({
2235
- * ctx,
2236
- * key: ActionKey.GetItems,
2237
- * request$: req$,
2238
- * onSuccess: (response) => ({
2239
- * items: response.data ?? [],
2240
- * }),
2241
- * });
2242
- */
2243
- load(ctx, config) {
2244
- return handleApiRequest({
2245
- ctx,
2246
- key: config.key,
2247
- request$: config.request$,
2248
- onSuccess: (response, state) => {
2249
- const data = config.transform
2250
- ? config.transform(response.data)
2251
- : response.data;
2252
- // If stateProperty provided, use adapter for array operations
2253
- if (config.stateProperty) {
2254
- const items = this.adapter.setAll(config.stateProperty(state), data);
2255
- const updateState = config.updateState ??
2256
- this.getDefaultUpdateState(config.stateProperty);
2257
- return updateState(state, items);
2258
- }
2259
- // Otherwise, use custom updateState directly
2260
- if (config.updateState) {
2261
- return config.updateState(state, data);
2262
- }
2263
- throw new Error('Either stateProperty or updateState must be provided');
2264
- },
2265
- onError: config.onError,
2266
- errorMessage: config.errorMessage ?? 'Failed to load data',
2267
- });
2268
- }
2269
- /**
2270
- * Create one entity with config object
2271
- */
2272
- create(ctx, config) {
2273
- const updateState = config.updateState ?? this.getDefaultUpdateState(config.stateProperty);
2274
- return handleApiRequest({
2275
- ctx,
2276
- key: config.key,
2277
- request$: config.request$,
2278
- onSuccess: (response, state) => {
2279
- const entity = config.transform
2280
- ? config.transform(response.data)
2281
- : response.data;
2282
- const items = this.adapter.addOne(config.stateProperty(state), entity);
2283
- return updateState(state, items);
2284
- },
2285
- onError: config.onError,
2286
- errorMessage: config.errorMessage ?? 'Failed to create item',
2287
- });
2288
- }
2289
- /**
2290
- * Update one entity with config object
2291
- */
2292
- update(ctx, config) {
2293
- const updateState = config.updateState ?? this.getDefaultUpdateState(config.stateProperty);
2294
- return handleApiRequest({
2295
- ctx,
2296
- key: config.key,
2297
- request$: config.request$,
2298
- onSuccess: (response, state) => {
2299
- const entity = config.transform
2300
- ? config.transform(response.data)
2301
- : response.data;
2302
- const items = this.adapter.upsertOne(config.stateProperty(state), entity, config.uniqueKey);
2303
- return updateState(state, items);
2304
- },
2305
- onError: config.onError,
2306
- errorMessage: config.errorMessage ?? 'Failed to update item',
2307
- });
2308
- }
2309
- /**
2310
- * Delete one entity with config object
2311
- */
2312
- delete(ctx, config) {
2313
- const updateState = config.updateState ?? this.getDefaultUpdateState(config.stateProperty);
2314
- return handleApiRequest({
2315
- ctx,
2316
- key: config.key,
2317
- request$: config.request$,
2318
- onSuccess: (_response, state) => {
2319
- const items = this.adapter.removeOne(config.stateProperty(state), config.id, config.uniqueKey);
2320
- return updateState(state, items);
2321
- },
2322
- onError: config.onError,
2323
- errorMessage: config.errorMessage ?? 'Failed to delete item',
2324
- });
2325
- }
2326
- }
2327
-
2328
- function isInvalid(control) {
2329
- if (!control)
2330
- return false;
2331
- return control && control?.invalid && control?.touched;
2332
- }
2333
-
2334
- /**
2335
- * Shared HTTP context token for request configuration.
2336
- * Used by interceptors to determine base URL routing.
2337
- *
2338
- * @example
2339
- * ```typescript
2340
- * import { REQUEST_CONTEXT } from '@masterteam/components';
2341
- *
2342
- * // In a service
2343
- * private context = new HttpContext().set(REQUEST_CONTEXT, { useBaseUrl: true });
2344
- *
2345
- * getMetadata(): Observable<any> {
2346
- * return this.http.get('metadata', { context: this.context });
2347
- * }
2348
- *
2349
- * // In interceptor
2350
- * const config = req.context.get(REQUEST_CONTEXT);
2351
- * if (config?.useBaseUrl) {
2352
- * // Use base URL
2353
- * }
2354
- * ```
2355
- */
2356
- const REQUEST_CONTEXT = new HttpContextToken(() => ({ useBaseUrl: false }));
2357
-
2358
- /**
2359
- * Stable DOM ids for form fields.
2360
- *
2361
- * Every field component used to bind `[id]="ngControl?.name || label()"`. Used
2362
- * inside a reactive form that resolves, but a stand-alone field with no control
2363
- * and no label produced `id="undefined"` — literally, because Angular
2364
- * stringifies. The global search input was exactly that case, which is why it
2365
- * also had no associated `<label>` and reported as unlabelled in the
2366
- * accessibility tree (findings L-03 and H-04).
2367
- *
2368
- * `slider-field` already solved this locally; this is that solution extracted so
2369
- * the six components that got it wrong share one implementation instead of six
2370
- * near-copies.
2371
- */
2372
- let nextUniqueId = 0;
2373
- /** A process-unique fallback id, e.g. `mt-text-field-3`. */
2374
- function nextFieldId(prefix) {
2375
- return `${prefix}-${nextUniqueId++}`;
2376
- }
2377
- /**
2378
- * The id a field should render, in preference order: the reactive form control
2379
- * name, then a slug of the visible label, then the generated fallback.
2380
- *
2381
- * Never returns an empty string or `"undefined"` — a label/input pair is only
2382
- * associated if the id is real, so the fallback matters more than it looks.
2383
- */
2384
- function resolveFieldId(controlName, label, fallbackId) {
2385
- const name = controlName?.toString().trim();
2386
- if (name) {
2387
- return name;
2388
- }
2389
- const slug = label?.trim().toLowerCase().replace(/\s+/g, '-');
2390
- return slug || fallbackId;
2391
- }
2392
-
2393
- /**
2394
- * Helpers for wall-clock values — the `HH:mm:ss` shape a `Time` property
2395
- * stores. A time of day carries no calendar date and no timezone, so it is
2396
- * never serialized as an instant: `new Date('09:30:00')` is `Invalid Date`,
2397
- * and pushing the clock through UTC would shift it by the viewer's offset.
2398
- */
2399
- const CLOCK_TIME_PATTERN = /^(\d{1,2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/;
2400
- /**
2401
- * Parse a bare `H:mm`, `HH:mm`, or `HH:mm:ss` string — a trailing fractional
2402
- * second, as .NET `TimeOnly`/`TimeSpan` may emit, is ignored. Returns `null`
2403
- * for anything else, including full timestamps, which callers parse as dates.
2404
- */
2405
- function parseClockTime(value) {
2406
- if (typeof value !== 'string')
2407
- return null;
2408
- const match = CLOCK_TIME_PATTERN.exec(value.trim());
2409
- if (!match)
2410
- return null;
2411
- const hours = Number(match[1]);
2412
- const minutes = Number(match[2]);
2413
- const seconds = match[3] ? Number(match[3]) : 0;
2414
- if (hours > 23 || minutes > 59 || seconds > 59)
2415
- return null;
2416
- return { hours, minutes, seconds };
2417
- }
2418
- /** Read the local wall-clock time off a `Date`, or `null` for an invalid one. */
2419
- function toClockTimeParts(date) {
2420
- if (Number.isNaN(date.getTime()))
2421
- return null;
2422
- return {
2423
- hours: date.getHours(),
2424
- minutes: date.getMinutes(),
2425
- seconds: date.getSeconds(),
2426
- };
2427
- }
2428
- /** Format a wall-clock time as the `HH:mm:ss` text the backend stores. */
2429
- function formatClockTime(parts) {
2430
- return [parts.hours, parts.minutes, parts.seconds]
2431
- .map((part) => part.toString().padStart(2, '0'))
2432
- .join(':');
2433
- }
2434
- /** Seconds since midnight — the comparable form of a wall-clock time. */
2435
- function clockTimeToSeconds(parts) {
2436
- return parts.hours * 3600 + parts.minutes * 60 + parts.seconds;
2437
- }
2438
-
2439
- class MTDateFormatPipe {
2440
- locale = inject(LOCALE_ID);
2441
- formats = inject(MT_DATE_FORMATS);
2442
- transform(value, type = 'date') {
2443
- if (value === null || value === undefined || value === '') {
2444
- return '';
2445
- }
2446
- try {
2447
- // A calendar date and a wall clock both carry no timezone of their own,
2448
- // so they are pinned to `+0000` and rendered exactly as stored.
2449
- const zonelessValue = type === 'date' && typeof value === 'string'
2450
- ? parseDateOnlyValue(value)
2451
- : type === 'time'
2452
- ? parseClockOnlyValue(value)
2453
- : null;
2454
- return formatDate(zonelessValue ?? value, toAngularDateFormat(this.formats[type] ?? this.formats.date), this.locale, zonelessValue ? '+0000' : this.formats.timezone);
2455
- }
2456
- catch {
2457
- return String(value);
2458
- }
2459
- }
2460
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MTDateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2461
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.8", ngImport: i0, type: MTDateFormatPipe, isStandalone: true, name: "mtDateFormat" });
2462
- }
2463
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MTDateFormatPipe, decorators: [{
2464
- type: Pipe,
2465
- args: [{
2466
- name: 'mtDateFormat',
2467
- standalone: true,
2468
- }]
2469
- }] });
2470
- /**
2471
- * Keep a wall-clock time (`HH:mm:ss`, the shape a `Time` property stores)
2472
- * independent from both browser and configured zones. Values still stored as a
2473
- * full instant fall through to the normal timezone-aware path.
2474
- */
2475
- function parseClockOnlyValue(value) {
2476
- const clockTime = parseClockTime(value);
2477
- if (!clockTime)
2478
- return null;
2479
- const parsed = new Date(0);
2480
- parsed.setUTCHours(clockTime.hours, clockTime.minutes, clockTime.seconds, 0);
2481
- return parsed;
2482
- }
2483
- /** Keep a calendar date independent from both browser and configured zones. */
2484
- function parseDateOnlyValue(value) {
2485
- const match = /^(\d{4})-(\d{2})-(\d{2})(?=$|T)/.exec(value);
2486
- if (!match)
2487
- return null;
2488
- const year = Number(match[1]);
2489
- const monthIndex = Number(match[2]) - 1;
2490
- const day = Number(match[3]);
2491
- const parsed = new Date(0);
2492
- parsed.setUTCFullYear(year, monthIndex, day);
2493
- parsed.setUTCHours(0, 0, 0, 0);
2494
- if (parsed.getUTCFullYear() !== year ||
2495
- parsed.getUTCMonth() !== monthIndex ||
2496
- parsed.getUTCDate() !== day) {
2497
- throw new RangeError(`Invalid date-only value: ${value}`);
2498
- }
2499
- return parsed;
2500
- }
2501
-
2502
- /*
2503
- * Public API Surface of components
2504
- */
2505
- // Config
2506
-
2507
- /**
2508
- * Generated bundle index. Do not edit.
2509
- */
2510
-
2511
- export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, READABLE_DARK_INK, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, WCAG_AA_NORMAL_TEXT, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, clockTimeToSeconds, contrastRatio, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, formatClockTime, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, nextFieldId, parseClockTime, pickAccessibleShade, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, readableTextOn, relativeLuminance, resolveFieldId, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, toClockTimeParts, wrapValidatorWithMessage };
2512
- //# sourceMappingURL=masterteam-components.mjs.map