@edsis/angular 22.1.6 → 22.2.10

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 (366) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +87 -399
  3. package/SECURITY.md +18 -0
  4. package/SUPPORT.md +15 -0
  5. package/chart/README.md +275 -0
  6. package/component/README.md +89 -0
  7. package/component/accordion/README.md +195 -0
  8. package/component/alert/README.md +184 -0
  9. package/component/alert-dialog/README.md +255 -0
  10. package/component/aspect-ratio/README.md +116 -0
  11. package/component/avatar/README.md +182 -0
  12. package/component/badge/README.md +143 -0
  13. package/component/breadcrumb/README.md +223 -0
  14. package/component/button/README.md +141 -0
  15. package/component/button-group/README.md +214 -0
  16. package/component/calendar/README.md +125 -0
  17. package/component/card/README.md +232 -0
  18. package/component/carousel/README.md +276 -0
  19. package/component/checkbox/README.md +153 -0
  20. package/component/collapsible/README.md +216 -0
  21. package/component/combobox/README.md +202 -0
  22. package/component/command/README.md +287 -0
  23. package/component/composer/README.md +241 -0
  24. package/component/context-menu/README.md +268 -0
  25. package/component/date-picker/README.md +202 -0
  26. package/component/dialog/README.md +276 -0
  27. package/component/drawer/README.md +146 -0
  28. package/component/dropdown-menu/README.md +336 -0
  29. package/component/editor/README.md +152 -0
  30. package/component/empty/README.md +193 -0
  31. package/component/form/README.md +216 -0
  32. package/component/hover-card/README.md +150 -0
  33. package/component/icon/README.md +52 -0
  34. package/component/input/README.md +160 -0
  35. package/component/input-group/README.md +245 -0
  36. package/component/input-otp/README.md +331 -0
  37. package/component/item/README.md +254 -0
  38. package/component/kanban/README.md +81 -0
  39. package/component/kbd/README.md +141 -0
  40. package/component/label/README.md +137 -0
  41. package/component/menubar/README.md +270 -0
  42. package/component/native-select/README.md +176 -0
  43. package/component/navigation-menu/README.md +165 -0
  44. package/component/pagination/README.md +151 -0
  45. package/component/pillbox/README.md +68 -0
  46. package/component/popover/README.md +54 -0
  47. package/component/progress/README.md +160 -0
  48. package/component/radio/README.md +212 -0
  49. package/component/resizable/README.md +178 -0
  50. package/component/scroll-area/README.md +150 -0
  51. package/component/select/README.md +228 -0
  52. package/component/separator/README.md +175 -0
  53. package/component/sheet/README.md +190 -0
  54. package/component/skeleton/README.md +158 -0
  55. package/component/slider/README.md +207 -0
  56. package/component/spinner/README.md +160 -0
  57. package/component/switch/README.md +170 -0
  58. package/component/table/README.md +292 -0
  59. package/component/tabs/README.md +220 -0
  60. package/component/textarea/README.md +169 -0
  61. package/component/timeline/README.md +94 -0
  62. package/component/toast/README.md +173 -0
  63. package/component/toggle/README.md +133 -0
  64. package/component/toggle-group/README.md +234 -0
  65. package/component/tooltip/README.md +230 -0
  66. package/fesm2022/edsis-angular-chart-area.mjs +508 -0
  67. package/fesm2022/edsis-angular-chart-bar.mjs +946 -0
  68. package/fesm2022/edsis-angular-chart-core.mjs +1319 -0
  69. package/fesm2022/edsis-angular-chart-line.mjs +544 -0
  70. package/fesm2022/edsis-angular-chart-pie.mjs +531 -0
  71. package/fesm2022/edsis-angular-chart-primitives.mjs +1647 -0
  72. package/fesm2022/edsis-angular-chart-radar.mjs +693 -0
  73. package/fesm2022/edsis-angular-chart-radial.mjs +542 -0
  74. package/fesm2022/edsis-angular-chart-scatter.mjs +486 -0
  75. package/fesm2022/edsis-angular-chart.mjs +3 -0
  76. package/fesm2022/edsis-angular-component-accordion.mjs +513 -0
  77. package/fesm2022/edsis-angular-component-alert-dialog.mjs +1001 -0
  78. package/fesm2022/edsis-angular-component-alert.mjs +268 -0
  79. package/fesm2022/edsis-angular-component-aspect-ratio.mjs +80 -0
  80. package/fesm2022/edsis-angular-component-avatar.mjs +410 -0
  81. package/fesm2022/edsis-angular-component-badge.mjs +111 -0
  82. package/fesm2022/edsis-angular-component-breadcrumb.mjs +464 -0
  83. package/fesm2022/edsis-angular-component-button-group.mjs +252 -0
  84. package/fesm2022/edsis-angular-component-button.mjs +155 -0
  85. package/fesm2022/edsis-angular-component-calendar.mjs +835 -0
  86. package/fesm2022/edsis-angular-component-card.mjs +460 -0
  87. package/fesm2022/edsis-angular-component-carousel.mjs +700 -0
  88. package/fesm2022/edsis-angular-component-checkbox.mjs +398 -0
  89. package/fesm2022/edsis-angular-component-collapsible.mjs +305 -0
  90. package/fesm2022/edsis-angular-component-combobox.mjs +544 -0
  91. package/fesm2022/edsis-angular-component-command.mjs +815 -0
  92. package/fesm2022/edsis-angular-component-composer.mjs +840 -0
  93. package/fesm2022/edsis-angular-component-context-menu.mjs +197 -0
  94. package/fesm2022/edsis-angular-component-date-picker.mjs +798 -0
  95. package/fesm2022/edsis-angular-component-dialog.mjs +798 -0
  96. package/fesm2022/edsis-angular-component-drawer.mjs +1 -0
  97. package/fesm2022/edsis-angular-component-dropdown-menu.mjs +1259 -0
  98. package/fesm2022/edsis-angular-component-editor.mjs +1000 -0
  99. package/fesm2022/edsis-angular-component-empty.mjs +351 -0
  100. package/fesm2022/edsis-angular-component-form.mjs +821 -0
  101. package/fesm2022/edsis-angular-component-hover-card.mjs +486 -0
  102. package/fesm2022/edsis-angular-component-icon.mjs +253 -0
  103. package/fesm2022/edsis-angular-component-input-group.mjs +453 -0
  104. package/fesm2022/edsis-angular-component-input-otp.mjs +957 -0
  105. package/fesm2022/edsis-angular-component-input.mjs +87 -0
  106. package/fesm2022/edsis-angular-component-item.mjs +720 -0
  107. package/fesm2022/edsis-angular-component-kanban.mjs +812 -0
  108. package/fesm2022/edsis-angular-component-kbd.mjs +124 -0
  109. package/fesm2022/edsis-angular-component-label.mjs +82 -0
  110. package/fesm2022/edsis-angular-component-menubar.mjs +481 -0
  111. package/fesm2022/edsis-angular-component-native-select.mjs +168 -0
  112. package/fesm2022/edsis-angular-component-navigation-menu.mjs +685 -0
  113. package/fesm2022/edsis-angular-component-pagination.mjs +425 -0
  114. package/fesm2022/edsis-angular-component-pillbox.mjs +1679 -0
  115. package/fesm2022/edsis-angular-component-popover.mjs +292 -0
  116. package/fesm2022/edsis-angular-component-progress.mjs +184 -0
  117. package/fesm2022/edsis-angular-component-radio.mjs +491 -0
  118. package/fesm2022/edsis-angular-component-resizable.mjs +703 -0
  119. package/fesm2022/edsis-angular-component-scroll-area.mjs +133 -0
  120. package/fesm2022/edsis-angular-component-segmented-control.mjs +408 -0
  121. package/fesm2022/edsis-angular-component-select.mjs +743 -0
  122. package/fesm2022/edsis-angular-component-separator.mjs +102 -0
  123. package/fesm2022/edsis-angular-component-sheet.mjs +874 -0
  124. package/fesm2022/edsis-angular-component-skeleton.mjs +62 -0
  125. package/fesm2022/edsis-angular-component-slider.mjs +676 -0
  126. package/fesm2022/edsis-angular-component-spinner.mjs +157 -0
  127. package/fesm2022/edsis-angular-component-switch.mjs +361 -0
  128. package/fesm2022/edsis-angular-component-table.mjs +446 -0
  129. package/fesm2022/edsis-angular-component-tabs.mjs +592 -0
  130. package/fesm2022/edsis-angular-component-textarea.mjs +85 -0
  131. package/fesm2022/edsis-angular-component-timeline.mjs +619 -0
  132. package/fesm2022/edsis-angular-component-toast.mjs +231 -0
  133. package/fesm2022/edsis-angular-component-toggle-group.mjs +579 -0
  134. package/fesm2022/edsis-angular-component-toggle.mjs +189 -0
  135. package/fesm2022/edsis-angular-component-tooltip.mjs +804 -0
  136. package/fesm2022/edsis-angular-component-utils-core.mjs +181 -0
  137. package/fesm2022/edsis-angular-component-utils-overlay.mjs +54 -0
  138. package/fesm2022/edsis-angular-component-utils-scale.mjs +76 -0
  139. package/fesm2022/edsis-angular-component-utils.mjs +2 -0
  140. package/fesm2022/edsis-angular-component.mjs +0 -0
  141. package/fesm2022/edsis-angular-navigation-core.mjs +15 -0
  142. package/fesm2022/edsis-angular-navigation-icon.mjs +35 -0
  143. package/fesm2022/edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs +234 -0
  144. package/fesm2022/edsis-angular-navigation-navigation-dockbar-menu.component-BaFnh48V.mjs +834 -0
  145. package/fesm2022/edsis-angular-navigation-navigation-entry-grid.component-D39W0FQZ.mjs +823 -0
  146. package/fesm2022/edsis-angular-navigation-navigation-flyout-menu.component-CpmsY8hb.mjs +670 -0
  147. package/fesm2022/edsis-angular-navigation-navigation-horizontal.component-D35IfX6r.mjs +689 -0
  148. package/fesm2022/edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs +1522 -0
  149. package/fesm2022/edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs +346 -0
  150. package/fesm2022/edsis-angular-navigation-service.mjs +558 -0
  151. package/fesm2022/edsis-angular-navigation-types.mjs +151 -0
  152. package/fesm2022/edsis-angular-navigation.mjs +3338 -0
  153. package/fesm2022/edsis-angular-sdk.mjs +100 -0
  154. package/fesm2022/edsis-angular-theme-component-settings.mjs +1863 -0
  155. package/fesm2022/edsis-angular-theme-layout-services.mjs +252 -0
  156. package/fesm2022/edsis-angular-theme-layout-types.mjs +45 -0
  157. package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +2568 -0
  158. package/fesm2022/edsis-angular-theme-layout.mjs +1089 -0
  159. package/fesm2022/edsis-angular-theme-on-fill.mjs +89 -0
  160. package/fesm2022/edsis-angular-theme-page-core.mjs +315 -0
  161. package/fesm2022/edsis-angular-theme-page-filter.mjs +409 -0
  162. package/fesm2022/edsis-angular-theme-page-overview.mjs +88 -0
  163. package/fesm2022/edsis-angular-theme-page-root.mjs +693 -0
  164. package/fesm2022/edsis-angular-theme-page-side.mjs +342 -0
  165. package/fesm2022/edsis-angular-theme-page-slots.mjs +258 -0
  166. package/fesm2022/edsis-angular-theme-page.mjs +7 -0
  167. package/fesm2022/edsis-angular-theme-shell-services.mjs +231 -0
  168. package/fesm2022/edsis-angular-theme-shell-types.mjs +102 -0
  169. package/fesm2022/edsis-angular-theme-shell.mjs +1352 -0
  170. package/fesm2022/edsis-angular-theme-styles.mjs +605 -0
  171. package/fesm2022/edsis-angular-theme.mjs +0 -0
  172. package/fesm2022/edsis-angular.mjs +5 -8
  173. package/navigation/README.md +576 -0
  174. package/package.json +481 -52
  175. package/sdk/README.md +212 -0
  176. package/sdk/schematics/collection.json +20 -0
  177. package/sdk/schematics/init/index.js +83 -0
  178. package/sdk/schematics/init/schema.json +19 -0
  179. package/sdk/schematics/ng-add/index.js +147 -0
  180. package/sdk/schematics/ng-add/schema.json +14 -0
  181. package/sdk/schematics/package.json +3 -0
  182. package/sdk/schematics/sdk/index.js +175 -0
  183. package/sdk/schematics/sdk/schema.json +19 -0
  184. package/sdk/sdk.config.example.json +24 -0
  185. package/sdk/src/config/loader.js +43 -0
  186. package/sdk/src/config/schema.js +59 -0
  187. package/sdk/src/emit/client.js +251 -0
  188. package/sdk/src/emit/metadata.js +310 -0
  189. package/sdk/src/emit/models.js +104 -0
  190. package/sdk/src/emit/navigation.js +56 -0
  191. package/sdk/src/emit/operations.js +118 -0
  192. package/sdk/src/emit/public-api.js +54 -0
  193. package/sdk/src/emit/services.js +110 -0
  194. package/sdk/src/engine.js +67 -0
  195. package/sdk/src/layout/per-domain.js +360 -0
  196. package/sdk/src/package.json +3 -0
  197. package/sdk/src/parser/bundle.js +25 -0
  198. package/sdk/src/parser/ir.js +429 -0
  199. package/sdk/src/parser/types.js +7 -0
  200. package/sdk/src/render/template.js +152 -0
  201. package/sdk/src/writer/index.js +286 -0
  202. package/theme/README.md +120 -0
  203. package/theme/component/settings/README.md +154 -0
  204. package/theme/layout/README.md +604 -0
  205. package/theme/page/README.md +505 -0
  206. package/theme/shell/README.md +344 -0
  207. package/theme/styles/README.md +251 -0
  208. package/theme/styles/css/base/components.css +577 -0
  209. package/theme/styles/css/base/index.css +14 -0
  210. package/theme/styles/css/base/on-fill.css +153 -0
  211. package/theme/styles/css/base/package.css +10 -0
  212. package/theme/styles/css/base/prefers-dark.css +81 -0
  213. package/theme/styles/css/base/print.css +62 -0
  214. package/theme/styles/css/base/status.css +38 -0
  215. package/theme/styles/css/base/tailwind.css +208 -0
  216. package/theme/styles/css/base/theme.css +306 -0
  217. package/theme/styles/css/base/tokens.css +388 -0
  218. package/theme/styles/css/color/amber.css +72 -0
  219. package/theme/styles/css/color/blue.css +72 -0
  220. package/theme/styles/css/color/brand.css +38 -0
  221. package/theme/styles/css/color/cyan.css +72 -0
  222. package/theme/styles/css/color/emerald.css +72 -0
  223. package/theme/styles/css/color/fuchsia.css +72 -0
  224. package/theme/styles/css/color/green.css +72 -0
  225. package/theme/styles/css/color/index.css +19 -0
  226. package/theme/styles/css/color/indigo.css +72 -0
  227. package/theme/styles/css/color/lime.css +72 -0
  228. package/theme/styles/css/color/orange.css +72 -0
  229. package/theme/styles/css/color/pink.css +72 -0
  230. package/theme/styles/css/color/purple.css +72 -0
  231. package/theme/styles/css/color/red.css +72 -0
  232. package/theme/styles/css/color/rose.css +72 -0
  233. package/theme/styles/css/color/sky.css +72 -0
  234. package/theme/styles/css/color/teal.css +72 -0
  235. package/theme/styles/css/color/violet.css +72 -0
  236. package/theme/styles/css/color/yellow.css +72 -0
  237. package/theme/styles/css/fonts.css +85 -0
  238. package/theme/styles/css/index.css +18 -0
  239. package/theme/styles/css/neutral/gray.css +63 -0
  240. package/theme/styles/css/neutral/index.css +11 -0
  241. package/theme/styles/css/neutral/mauve.css +63 -0
  242. package/theme/styles/css/neutral/mist.css +63 -0
  243. package/theme/styles/css/neutral/neutral.css +63 -0
  244. package/theme/styles/css/neutral/olive.css +63 -0
  245. package/theme/styles/css/neutral/slate.css +63 -0
  246. package/theme/styles/css/neutral/stone.css +63 -0
  247. package/theme/styles/css/neutral/taupe.css +63 -0
  248. package/theme/styles/css/neutral/zinc.css +63 -0
  249. package/theme/styles/css/radius/index.css +30 -0
  250. package/theme/styles/css/space/index.css +20 -0
  251. package/types/edsis-angular-chart-area.d.ts +139 -0
  252. package/types/edsis-angular-chart-bar.d.ts +291 -0
  253. package/types/edsis-angular-chart-core.d.ts +824 -0
  254. package/types/edsis-angular-chart-line.d.ts +148 -0
  255. package/types/edsis-angular-chart-pie.d.ts +207 -0
  256. package/types/edsis-angular-chart-primitives.d.ts +360 -0
  257. package/types/edsis-angular-chart-radar.d.ts +198 -0
  258. package/types/edsis-angular-chart-radial.d.ts +187 -0
  259. package/types/edsis-angular-chart-scatter.d.ts +181 -0
  260. package/types/edsis-angular-chart.d.ts +3 -0
  261. package/types/edsis-angular-component-accordion.d.ts +139 -0
  262. package/types/edsis-angular-component-alert-dialog.d.ts +288 -0
  263. package/types/edsis-angular-component-alert.d.ts +72 -0
  264. package/types/edsis-angular-component-aspect-ratio.d.ts +20 -0
  265. package/types/edsis-angular-component-avatar.d.ts +111 -0
  266. package/types/edsis-angular-component-badge.d.ts +36 -0
  267. package/types/edsis-angular-component-breadcrumb.d.ts +85 -0
  268. package/types/edsis-angular-component-button-group.d.ts +50 -0
  269. package/types/edsis-angular-component-button.d.ts +44 -0
  270. package/types/edsis-angular-component-calendar.d.ts +150 -0
  271. package/types/edsis-angular-component-card.d.ts +123 -0
  272. package/types/edsis-angular-component-carousel.d.ts +155 -0
  273. package/types/edsis-angular-component-checkbox.d.ts +100 -0
  274. package/types/edsis-angular-component-collapsible.d.ts +68 -0
  275. package/types/edsis-angular-component-combobox.d.ts +105 -0
  276. package/types/edsis-angular-component-command.d.ts +215 -0
  277. package/types/edsis-angular-component-composer.d.ts +190 -0
  278. package/types/edsis-angular-component-context-menu.d.ts +64 -0
  279. package/types/edsis-angular-component-date-picker.d.ts +199 -0
  280. package/types/edsis-angular-component-dialog.d.ts +231 -0
  281. package/types/edsis-angular-component-drawer.d.ts +2 -0
  282. package/types/edsis-angular-component-dropdown-menu.d.ts +370 -0
  283. package/types/edsis-angular-component-editor.d.ts +234 -0
  284. package/types/edsis-angular-component-empty.d.ts +85 -0
  285. package/types/edsis-angular-component-form.d.ts +223 -0
  286. package/types/edsis-angular-component-hover-card.d.ts +133 -0
  287. package/types/edsis-angular-component-icon.d.ts +90 -0
  288. package/types/edsis-angular-component-input-group.d.ts +98 -0
  289. package/types/edsis-angular-component-input-otp.d.ts +249 -0
  290. package/types/edsis-angular-component-input.d.ts +31 -0
  291. package/types/edsis-angular-component-item.d.ts +169 -0
  292. package/types/edsis-angular-component-kanban.d.ts +165 -0
  293. package/types/edsis-angular-component-kbd.d.ts +25 -0
  294. package/types/edsis-angular-component-label.d.ts +19 -0
  295. package/types/edsis-angular-component-menubar.d.ts +123 -0
  296. package/types/edsis-angular-component-native-select.d.ts +39 -0
  297. package/types/edsis-angular-component-navigation-menu.d.ts +163 -0
  298. package/types/edsis-angular-component-pagination.d.ts +83 -0
  299. package/types/edsis-angular-component-pillbox.d.ts +380 -0
  300. package/types/edsis-angular-component-popover.d.ts +96 -0
  301. package/types/edsis-angular-component-progress.d.ts +45 -0
  302. package/types/edsis-angular-component-radio.d.ts +137 -0
  303. package/types/edsis-angular-component-resizable.d.ts +166 -0
  304. package/types/edsis-angular-component-scroll-area.d.ts +37 -0
  305. package/types/edsis-angular-component-segmented-control.d.ts +102 -0
  306. package/types/edsis-angular-component-select.d.ts +138 -0
  307. package/types/edsis-angular-component-separator.d.ts +26 -0
  308. package/types/edsis-angular-component-sheet.d.ts +240 -0
  309. package/types/edsis-angular-component-skeleton.d.ts +13 -0
  310. package/types/edsis-angular-component-slider.d.ts +148 -0
  311. package/types/edsis-angular-component-spinner.d.ts +31 -0
  312. package/types/edsis-angular-component-switch.d.ts +101 -0
  313. package/types/edsis-angular-component-table.d.ts +109 -0
  314. package/types/edsis-angular-component-tabs.d.ts +183 -0
  315. package/types/edsis-angular-component-textarea.d.ts +27 -0
  316. package/types/edsis-angular-component-timeline.d.ts +146 -0
  317. package/types/edsis-angular-component-toast.d.ts +60 -0
  318. package/types/edsis-angular-component-toggle-group.d.ts +161 -0
  319. package/types/edsis-angular-component-toggle.d.ts +47 -0
  320. package/types/edsis-angular-component-tooltip.d.ts +233 -0
  321. package/types/edsis-angular-component-utils-core.d.ts +175 -0
  322. package/types/edsis-angular-component-utils-overlay.d.ts +17 -0
  323. package/types/edsis-angular-component-utils-scale.d.ts +27 -0
  324. package/types/edsis-angular-component-utils.d.ts +2 -0
  325. package/types/edsis-angular-component.d.ts +1 -0
  326. package/types/edsis-angular-navigation-core.d.ts +55 -0
  327. package/types/edsis-angular-navigation-icon.d.ts +9 -0
  328. package/types/edsis-angular-navigation-service.d.ts +121 -0
  329. package/types/edsis-angular-navigation-types.d.ts +185 -0
  330. package/types/edsis-angular-navigation.d.ts +862 -0
  331. package/types/edsis-angular-sdk.d.ts +87 -0
  332. package/types/edsis-angular-theme-component-settings.d.ts +205 -0
  333. package/types/edsis-angular-theme-layout-services.d.ts +143 -0
  334. package/types/edsis-angular-theme-layout-types.d.ts +36 -0
  335. package/types/edsis-angular-theme-layout-wrapper.d.ts +670 -0
  336. package/types/edsis-angular-theme-layout.d.ts +218 -0
  337. package/types/edsis-angular-theme-on-fill.d.ts +45 -0
  338. package/types/edsis-angular-theme-page-core.d.ts +151 -0
  339. package/types/edsis-angular-theme-page-filter.d.ts +127 -0
  340. package/types/edsis-angular-theme-page-overview.d.ts +28 -0
  341. package/types/edsis-angular-theme-page-root.d.ts +172 -0
  342. package/types/edsis-angular-theme-page-side.d.ts +90 -0
  343. package/types/edsis-angular-theme-page-slots.d.ts +61 -0
  344. package/types/edsis-angular-theme-page.d.ts +7 -0
  345. package/types/edsis-angular-theme-shell-services.d.ts +188 -0
  346. package/types/edsis-angular-theme-shell-types.d.ts +102 -0
  347. package/types/edsis-angular-theme-shell.d.ts +178 -0
  348. package/types/edsis-angular-theme-styles.d.ts +328 -0
  349. package/types/edsis-angular-theme.d.ts +1 -0
  350. package/types/edsis-angular.d.ts +5 -2
  351. package/fesm2022/edsis-angular-block-shell.mjs +0 -1329
  352. package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
  353. package/fesm2022/edsis-angular-block-themes.mjs +0 -1007
  354. package/fesm2022/edsis-angular-block-themes.mjs.map +0 -1
  355. package/fesm2022/edsis-angular-module-auth.mjs +0 -2582
  356. package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
  357. package/fesm2022/edsis-angular-platform-mfe.mjs +0 -329
  358. package/fesm2022/edsis-angular-platform-mfe.mjs.map +0 -1
  359. package/fesm2022/edsis-angular-services-runtime.mjs +0 -385
  360. package/fesm2022/edsis-angular-services-runtime.mjs.map +0 -1
  361. package/fesm2022/edsis-angular.mjs.map +0 -1
  362. package/types/edsis-angular-block-shell.d.ts +0 -190
  363. package/types/edsis-angular-block-themes.d.ts +0 -94
  364. package/types/edsis-angular-module-auth.d.ts +0 -533
  365. package/types/edsis-angular-platform-mfe.d.ts +0 -126
  366. package/types/edsis-angular-services-runtime.d.ts +0 -118
@@ -0,0 +1,558 @@
1
+ import { DOCUMENT, Location } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Service, computed, inject, isDevMode, signal } from "@angular/core";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import { DefaultUrlSerializer, NavigationEnd, PRIMARY_OUTLET, Router, UrlTree, containsTree } from "@angular/router";
6
+ import { documentLocalStorage } from "@edsis/angular/component/utils/core";
7
+ const DEFAULT_NAVIGATION_ID = "default";
8
+ const PERSISTED_NAVIGATION_ID = "main";
9
+ const INSTANCE_STORAGE_PROPERTIES = [
10
+ "orientation",
11
+ "appearance",
12
+ "position",
13
+ "collapsed",
14
+ "dockbar-mode"
15
+ ];
16
+ const TYPE_MODE_STORAGE_KEY = "nav-type-mode";
17
+ var NavigationPersistence = class {
18
+ documentRef;
19
+ storageRef;
20
+ constructor(documentRef) {
21
+ this.documentRef = documentRef;
22
+ this.storageRef = documentLocalStorage(documentRef);
23
+ }
24
+ resolveState(input) {
25
+ const id = this.normalizeId(input.id);
26
+ const orientation = input.orientation;
27
+ const type = this.resolveType(id, orientation, input.type);
28
+ return {
29
+ id,
30
+ orientation,
31
+ type,
32
+ position: this.resolvePosition(id, orientation, input.position),
33
+ collapsed: this.resolveCollapsed(id, type, input.collapsed),
34
+ dockbarMode: this.resolveDockbarMode(id, type, input.dockbarMode)
35
+ };
36
+ }
37
+ persistState(state) {
38
+ if (state.id !== PERSISTED_NAVIGATION_ID) {
39
+ this.clearLegacyInstanceStorage(state.id);
40
+ return;
41
+ }
42
+ this.writeStorage(this.persistedStorageKey("orientation"), state.orientation);
43
+ this.writeStorage(this.persistedStorageKey("type"), state.type);
44
+ this.writeStorage(this.persistedStorageKey("position"), state.position);
45
+ this.writeStorage(TYPE_MODE_STORAGE_KEY, this.persistedTypeMode(state));
46
+ }
47
+ normalizeId(id) {
48
+ return id.trim() || "default";
49
+ }
50
+ resolveType(id, orientation, type) {
51
+ if (this.isTypeForOrientation(type, orientation)) return type;
52
+ const stored = this.readInstanceStorage(id, "type");
53
+ if (this.isTypeForOrientation(stored, orientation)) return stored;
54
+ return orientation === "vertical" ? "sidebar" : "navbar";
55
+ }
56
+ resolvePosition(id, orientation, position) {
57
+ if (this.isPositionForOrientation(position, orientation)) return position;
58
+ const stored = this.readInstanceStorage(id, "position");
59
+ if (this.isPositionForOrientation(stored, orientation)) return stored;
60
+ return orientation === "horizontal" ? "top" : "left";
61
+ }
62
+ resolveCollapsed(id, type, collapsed) {
63
+ if (typeof collapsed === "boolean") return collapsed;
64
+ return type === "sidebar" && this.readPersistedTypeMode(id) === "collapsed";
65
+ }
66
+ resolveDockbarMode(id, type, mode) {
67
+ if (this.isDockbarMode(mode)) return mode;
68
+ if (type !== "dockbar") return "sticky";
69
+ const stored = this.readPersistedTypeMode(id);
70
+ return this.isDockbarMode(stored) ? stored : "sticky";
71
+ }
72
+ readStorage(key) {
73
+ return this.storageRef.read(key);
74
+ }
75
+ readInstanceStorage(id, property) {
76
+ return id === PERSISTED_NAVIGATION_ID ? this.readStorage(this.persistedStorageKey(property)) : null;
77
+ }
78
+ readPersistedTypeMode(id) {
79
+ if (id !== PERSISTED_NAVIGATION_ID) return null;
80
+ const stored = this.readStorage(TYPE_MODE_STORAGE_KEY);
81
+ return this.isPersistedTypeMode(stored) ? stored : null;
82
+ }
83
+ writeStorage(key, value) {
84
+ this.storageRef.write(key, value);
85
+ }
86
+ removeStorage(key) {
87
+ this.storageRef.remove(key);
88
+ }
89
+ clearLegacyInstanceStorage(id) {
90
+ for (const property of INSTANCE_STORAGE_PROPERTIES) this.removeStorage(`nav:${id}:${property}`);
91
+ }
92
+ persistedStorageKey(property) {
93
+ return `nav-${property}`;
94
+ }
95
+ persistedTypeMode(state) {
96
+ if (state.type === "dockbar") return state.dockbarMode;
97
+ if (state.type === "minidock") return "default";
98
+ return state.collapsed ? "collapsed" : "default";
99
+ }
100
+ isPersistedTypeMode(value) {
101
+ return value === "default" || value === "collapsed" || this.isDockbarMode(value);
102
+ }
103
+ isTypeForOrientation(value, orientation) {
104
+ return orientation === "vertical" ? value === "sidebar" || value === "dockbar" || value === "minidock" : value === "navbar" || value === "flyout";
105
+ }
106
+ isPositionForOrientation(value, orientation) {
107
+ return orientation === "vertical" ? value === "left" || value === "right" : value === "top" || value === "bottom";
108
+ }
109
+ isDockbarMode(value) {
110
+ return value === "drawer" || value === "sticky";
111
+ }
112
+ };
113
+ var NavigationActiveUrlResolver = class {
114
+ router;
115
+ urlSerializer = new DefaultUrlSerializer();
116
+ itemUrlTrees = /* @__PURE__ */ new WeakMap();
117
+ activeUrlTree = null;
118
+ constructor(router) {
119
+ this.router = router;
120
+ }
121
+ match(activeUrl, routerUrl, relativeTo) {
122
+ return {
123
+ activeUrl,
124
+ activeTree: this.parseActiveUrl(activeUrl),
125
+ relativeTo,
126
+ routerUrl
127
+ };
128
+ }
129
+ matches(item, match, options) {
130
+ const activeTree = match.activeTree;
131
+ if (!item.link || item.externalLink || activeTree === null) return false;
132
+ const itemTree = this.cachedItemUrlTree(item, match, activeTree);
133
+ return itemTree === null ? false : containsNavigationUrlTree(activeTree, itemTree, options);
134
+ }
135
+ cachedItemUrlTree(item, match, activeTree) {
136
+ if (match.relativeTo !== null) return this.itemUrlTree(item, activeTree, match.relativeTo);
137
+ const key = this.dependsOnActiveUrl(item) ? `${match.activeUrl} ${match.routerUrl}` : null;
138
+ const cached = this.itemUrlTrees.get(item);
139
+ if (cached !== void 0 && cached.key === key) return cached.tree;
140
+ const tree = this.itemUrlTree(item, activeTree, null);
141
+ this.itemUrlTrees.set(item, {
142
+ key,
143
+ tree
144
+ });
145
+ return tree;
146
+ }
147
+ dependsOnActiveUrl(item) {
148
+ if (item.preserveFragment === true || item.queryParamsHandling === "preserve" || item.queryParamsHandling === "merge") return true;
149
+ const link = item.link;
150
+ if (link instanceof UrlTree) return false;
151
+ if (typeof link === "string") return !link.startsWith("/");
152
+ const first = Array.isArray(link) ? link[0] : void 0;
153
+ return !(typeof first === "string" && first.startsWith("/"));
154
+ }
155
+ parseActiveUrl(url) {
156
+ if (this.activeUrlTree !== null && this.activeUrlTree.url === url) return this.activeUrlTree.tree;
157
+ const tree = this.parseUrl(url);
158
+ this.activeUrlTree = {
159
+ url,
160
+ tree
161
+ };
162
+ return tree;
163
+ }
164
+ itemUrlTree(item, activeTree, relativeTo) {
165
+ const link = item.link;
166
+ if (!link) return null;
167
+ if (link instanceof UrlTree) return link;
168
+ if (this.router !== null) try {
169
+ const commands = typeof link === "string" ? [link] : Array.from(link);
170
+ return this.router.createUrlTree(commands, {
171
+ relativeTo,
172
+ queryParams: item.queryParams,
173
+ queryParamsHandling: item.queryParamsHandling,
174
+ fragment: item.fragment,
175
+ preserveFragment: item.preserveFragment
176
+ });
177
+ } catch {
178
+ return null;
179
+ }
180
+ const baseTree = typeof link === "string" ? this.parseUrl(link) : null;
181
+ return baseTree === null ? null : this.applyRouteExtras(baseTree, item, activeTree);
182
+ }
183
+ applyRouteExtras(baseTree, item, activeTree) {
184
+ const handling = item.queryParamsHandling ?? "replace";
185
+ let queryParams = baseTree.queryParams;
186
+ if (handling === "preserve") queryParams = activeTree.queryParams;
187
+ else if (handling === "merge") queryParams = {
188
+ ...activeTree.queryParams,
189
+ ...item.queryParams ?? {}
190
+ };
191
+ else if (item.queryParams !== void 0) queryParams = item.queryParams ?? {};
192
+ const fragment = item.preserveFragment ? activeTree.fragment : item.fragment ?? baseTree.fragment;
193
+ try {
194
+ return this.urlSerializer.parse(this.urlSerializer.serialize(new UrlTree(baseTree.root, queryParams, fragment)));
195
+ } catch {
196
+ return null;
197
+ }
198
+ }
199
+ parseUrl(url) {
200
+ try {
201
+ return this.router?.parseUrl(url) ?? this.urlSerializer.parse(url);
202
+ } catch {
203
+ return null;
204
+ }
205
+ }
206
+ };
207
+ function containsNavigationUrlTree(container, containee, options) {
208
+ return containsTree(container, containee, options);
209
+ }
210
+ const EMPTY_NAV_DATA = Object.freeze([]);
211
+ var NavigationService = class NavigationService {
212
+ documentRef = inject(DOCUMENT, { optional: true });
213
+ persistence = new NavigationPersistence(this.documentRef);
214
+ router = inject(Router, { optional: true });
215
+ urlResolver = new NavigationActiveUrlResolver(this.router);
216
+ location = inject(Location, { optional: true });
217
+ routerUrl = signal(this.initialUrl(), ...ngDevMode ? [{ debugName: "routerUrl" }] : /* istanbul ignore next */ []);
218
+ states = signal({}, ...ngDevMode ? [{ debugName: "states" }] : /* istanbul ignore next */ []);
219
+ openPanelKeys = signal({}, ...ngDevMode ? [{ debugName: "openPanelKeys" }] : /* istanbul ignore next */ []);
220
+ drawerOpenState = signal({}, ...ngDevMode ? [{ debugName: "drawerOpenState" }] : /* istanbul ignore next */ []);
221
+ dataById = signal({}, ...ngDevMode ? [{ debugName: "dataById" }] : /* istanbul ignore next */ []);
222
+ dataPublishers = /* @__PURE__ */ new Map();
223
+ ownerlessDataPublisher = {};
224
+ idOwners = /* @__PURE__ */ new Map();
225
+ openPanelKey = computed(() => this.openPanelKeys()["default"] ?? null, ...ngDevMode ? [{ debugName: "openPanelKey" }] : /* istanbul ignore next */ []);
226
+ routeContext = computed(() => {
227
+ const url = this.routerUrl();
228
+ return this.readRouteContext(url);
229
+ }, ...ngDevMode ? [{ debugName: "routeContext" }] : /* istanbul ignore next */ []);
230
+ exactMatchOptions = {
231
+ paths: "exact",
232
+ queryParams: "exact",
233
+ fragment: "exact",
234
+ matrixParams: "exact"
235
+ };
236
+ subsetMatchOptions = {
237
+ paths: "subset",
238
+ queryParams: "subset",
239
+ fragment: "ignored",
240
+ matrixParams: "ignored"
241
+ };
242
+ constructor() {
243
+ this.router?.events.pipe(takeUntilDestroyed()).subscribe((event) => {
244
+ if (event instanceof NavigationEnd) {
245
+ const previousUrl = this.routerUrl();
246
+ this.routerUrl.set(event.urlAfterRedirects);
247
+ if (this.urlPath(previousUrl) !== this.urlPath(event.urlAfterRedirects)) this.releasePanelsAfterNavigation();
248
+ }
249
+ });
250
+ }
251
+ releasePanelsAfterNavigation() {
252
+ this.openPanelKeys.update((state) => Object.values(state).some((key) => key !== null) ? {} : state);
253
+ }
254
+ initialUrl() {
255
+ if (this.router && !this.router.navigated) {
256
+ const path = this.location?.path(true);
257
+ if (path) return path;
258
+ }
259
+ return this.router?.url ?? "/";
260
+ }
261
+ urlPath(url) {
262
+ const end = url.search(/[?#]/);
263
+ return end === -1 ? url : url.slice(0, end);
264
+ }
265
+ readRouteContext(url) {
266
+ let snapshot = this.router?.routerState.snapshot.root ?? null;
267
+ let icon = null;
268
+ let badge = null;
269
+ let label = null;
270
+ while (snapshot !== null) {
271
+ const data = snapshot.data;
272
+ if (Object.prototype.hasOwnProperty.call(data, "navigationIcon")) icon = this.optionalString(data.navigationIcon);
273
+ if (Object.prototype.hasOwnProperty.call(data, "navigationBadge")) badge = this.optionalString(data.navigationBadge);
274
+ if (Object.prototype.hasOwnProperty.call(data, "navigationLabel")) label = this.optionalString(data.navigationLabel);
275
+ else if (snapshot.title) label = snapshot.title;
276
+ snapshot = snapshot.children.find((child) => child.outlet === PRIMARY_OUTLET) ?? snapshot.firstChild ?? null;
277
+ }
278
+ return {
279
+ url,
280
+ icon,
281
+ badge,
282
+ label
283
+ };
284
+ }
285
+ optionalString(value) {
286
+ return typeof value === "string" && value.trim() ? value.trim() : null;
287
+ }
288
+ register(input, owner) {
289
+ const state = this.persistence.resolveState(input);
290
+ this.claimId(state.id, owner);
291
+ this.states.update((states) => ({
292
+ ...states,
293
+ [state.id]: state
294
+ }));
295
+ this.persistence.persistState(state);
296
+ return state;
297
+ }
298
+ unregister(id, owner) {
299
+ const navId = this.persistence.normalizeId(id);
300
+ this.releaseId(navId, owner);
301
+ this.states.update((states) => this.withoutKey(states, navId));
302
+ this.openPanelKeys.update((state) => this.withoutKey(state, navId));
303
+ this.drawerOpenState.update((state) => this.withoutKey(state, navId));
304
+ }
305
+ claimId(id, owner) {
306
+ if (owner === void 0) return;
307
+ const currentOwner = this.idOwners.get(id);
308
+ if (currentOwner !== void 0 && currentOwner !== owner && isDevMode()) throw new Error(`[Navigation] Duplikasi id navigasi "${id}". Setiap <Navigation> wajib memakai id unik. Id "main" dikhususkan untuk navigasi utama pada layout/shell (block-shell).`);
309
+ this.idOwners.set(id, owner);
310
+ }
311
+ releaseId(id, owner) {
312
+ if (owner === void 0 || this.idOwners.get(id) === owner) this.idOwners.delete(id);
313
+ }
314
+ state(id) {
315
+ const navId = this.persistence.normalizeId(id);
316
+ return computed(() => this.states()[navId] ?? null);
317
+ }
318
+ currentState(id) {
319
+ return this.states()[this.persistence.normalizeId(id)] ?? null;
320
+ }
321
+ data(id) {
322
+ const navId = this.persistence.normalizeId(id);
323
+ return computed(() => this.dataById()[navId] ?? EMPTY_NAV_DATA);
324
+ }
325
+ publishData(id, data, owner) {
326
+ const navId = this.persistence.normalizeId(id);
327
+ const publisher = owner ?? this.ownerlessDataPublisher;
328
+ const publishers = this.dataPublishers.get(navId) ?? /* @__PURE__ */ new Map();
329
+ publishers.delete(publisher);
330
+ publishers.set(publisher, data);
331
+ this.dataPublishers.set(navId, publishers);
332
+ this.dataById.update((map) => ({
333
+ ...map,
334
+ [navId]: data
335
+ }));
336
+ }
337
+ clearData(id, owner) {
338
+ const navId = this.persistence.normalizeId(id);
339
+ const publisher = owner ?? this.ownerlessDataPublisher;
340
+ const publishers = this.dataPublishers.get(navId);
341
+ if (!publishers?.delete(publisher)) return;
342
+ const fallback = Array.from(publishers.values()).at(-1);
343
+ if (fallback) {
344
+ this.dataById.update((map) => ({
345
+ ...map,
346
+ [navId]: fallback
347
+ }));
348
+ return;
349
+ }
350
+ this.dataPublishers.delete(navId);
351
+ this.dataById.update((map) => this.withoutKey(map, navId));
352
+ }
353
+ currentPanelKey(id) {
354
+ return this.openPanelKeys()[this.persistence.normalizeId(id)] ?? null;
355
+ }
356
+ update(id, patch) {
357
+ const navId = this.persistence.normalizeId(id);
358
+ const current = this.states()[navId] ?? this.persistence.resolveState({
359
+ id: navId,
360
+ orientation: patch.orientation ?? "vertical"
361
+ });
362
+ return this.register({
363
+ id: navId,
364
+ orientation: patch.orientation ?? current.orientation,
365
+ type: patch.type ?? current.type,
366
+ position: patch.position ?? current.position,
367
+ collapsed: patch.collapsed ?? current.collapsed,
368
+ dockbarMode: patch.dockbarMode ?? current.dockbarMode
369
+ });
370
+ }
371
+ setType(id, type) {
372
+ return this.update(id, { type });
373
+ }
374
+ setPosition(id, position) {
375
+ return this.update(id, { position });
376
+ }
377
+ setCollapsed(id, collapsed) {
378
+ return this.update(id, { collapsed });
379
+ }
380
+ toggleCollapsed(id) {
381
+ const navId = this.persistence.normalizeId(id);
382
+ const current = this.states()[navId] ?? this.persistence.resolveState({
383
+ id: navId,
384
+ orientation: "vertical"
385
+ });
386
+ if (current.type === "minidock") return current;
387
+ return this.setCollapsed(navId, !current.collapsed);
388
+ }
389
+ setDockbarMode(id, mode) {
390
+ return this.update(id, { dockbarMode: mode });
391
+ }
392
+ isRouterItem(item) {
393
+ return !!item.link && !item.externalLink;
394
+ }
395
+ hrefFor(item) {
396
+ if (item.href) return item.href;
397
+ if (item.externalLink && typeof item.link === "string") return item.link;
398
+ return null;
399
+ }
400
+ relFor(item) {
401
+ const consumerTokens = item.rel?.split(/\s+/).filter(Boolean) ?? [];
402
+ if (item.target !== "_blank" && !item.externalLink) return consumerTokens.length > 0 ? consumerTokens.join(" ") : null;
403
+ const tokens = new Set(consumerTokens);
404
+ tokens.add("noopener");
405
+ tokens.add("noreferrer");
406
+ return [...tokens].join(" ");
407
+ }
408
+ routerLinkActiveOptions(item) {
409
+ return item.isActiveMatchOptions ?? (item.exactMatch ? this.exactMatchOptions : this.subsetMatchOptions);
410
+ }
411
+ itemRole(orientation, level) {
412
+ return orientation === "horizontal" ? "menuitem" : null;
413
+ }
414
+ compactLabel(item, compact) {
415
+ return compact ? item.tooltip ?? item.title ?? null : null;
416
+ }
417
+ titleFor(item, compact) {
418
+ return item.tooltip ?? (compact ? item.title ?? null : null);
419
+ }
420
+ compactFallback(item) {
421
+ return (item.title ?? item.id ?? "?").trim().slice(0, 2);
422
+ }
423
+ iconContext(item, active, level, orientation) {
424
+ return {
425
+ $implicit: item.icon ?? "",
426
+ icon: item.icon ?? "",
427
+ item: item.source,
428
+ active,
429
+ orientation,
430
+ level
431
+ };
432
+ }
433
+ isItemActive(item, activeIds, explicitActiveUrl) {
434
+ return this.matchesActiveTreeDeep(item, activeIds, this.activeMatch(explicitActiveUrl, null));
435
+ }
436
+ isItemRouteActive(item, explicitActiveUrl, relativeTo = null) {
437
+ return this.matchesActiveTreeDeep(item, null, this.activeMatch(explicitActiveUrl, relativeTo));
438
+ }
439
+ matchesActiveTreeDeep(item, activeIds, match) {
440
+ if (activeIds !== null && (item.active || activeIds.has(item.stateId) || activeIds.has(item.key))) return true;
441
+ if (this.matchesActiveTree(item, match)) return true;
442
+ return item.children.some((child) => this.matchesActiveTreeDeep(child, activeIds, match));
443
+ }
444
+ activeMatch(explicitActiveUrl, relativeTo) {
445
+ const cachedUrl = this.routerUrl();
446
+ const currentUrl = this.router?.navigated ? this.router.url : cachedUrl;
447
+ const activeUrl = explicitActiveUrl ?? currentUrl;
448
+ return this.urlResolver.match(activeUrl, currentUrl, relativeTo);
449
+ }
450
+ isPanelOpen(navIdOrItem, item) {
451
+ const { navId, navItem } = this.resolvePanelArgs("isPanelOpen", navIdOrItem, item);
452
+ return this.openPanelKeys()[navId] === navItem.key;
453
+ }
454
+ openPanel(navIdOrItem, item) {
455
+ const { navId, navItem } = this.resolvePanelArgs("openPanel", navIdOrItem, item);
456
+ if (navItem.disabled) return;
457
+ this.openPanelKeys.update((state) => ({
458
+ ...state,
459
+ [navId]: navItem.key
460
+ }));
461
+ }
462
+ togglePanel(navIdOrItem, item) {
463
+ const { navId, navItem } = this.resolvePanelArgs("togglePanel", navIdOrItem, item);
464
+ if (navItem.disabled) return;
465
+ this.openPanelKeys.update((state) => ({
466
+ ...state,
467
+ [navId]: state[navId] === navItem.key ? null : navItem.key
468
+ }));
469
+ }
470
+ closePanel(id = DEFAULT_NAVIGATION_ID) {
471
+ const navId = this.persistence.normalizeId(id);
472
+ this.openPanelKeys.update((state) => ({
473
+ ...state,
474
+ [navId]: null
475
+ }));
476
+ }
477
+ dockbarGroups(items) {
478
+ return items.filter((item) => item.children.length > 0);
479
+ }
480
+ resolveDockbarGroup(id, items, mode, activeIds, activeUrl) {
481
+ const groups = this.dockbarGroups(items);
482
+ const panelKey = this.openPanelKeys()[this.persistence.normalizeId(id)] ?? null;
483
+ if (panelKey !== null) {
484
+ const explicit = groups.find((group) => group.key === panelKey);
485
+ if (explicit) return explicit;
486
+ }
487
+ if (mode !== "sticky") return null;
488
+ return groups.find((group) => this.isItemActive(group, activeIds, activeUrl)) ?? null;
489
+ }
490
+ isDrawerOpen(id) {
491
+ return this.drawerOpenState()[this.persistence.normalizeId(id)] ?? false;
492
+ }
493
+ openDrawer(id) {
494
+ const navId = this.persistence.normalizeId(id);
495
+ this.drawerOpenState.update((state) => ({
496
+ ...state,
497
+ [navId]: true
498
+ }));
499
+ }
500
+ toggleDrawer(id) {
501
+ const navId = this.persistence.normalizeId(id);
502
+ this.drawerOpenState.update((state) => ({
503
+ ...state,
504
+ [navId]: !(state[navId] ?? false)
505
+ }));
506
+ }
507
+ closeDrawer(id) {
508
+ const navId = this.persistence.normalizeId(id);
509
+ this.drawerOpenState.update((state) => ({
510
+ ...state,
511
+ [navId]: false
512
+ }));
513
+ }
514
+ matchesActiveTree(item, match) {
515
+ return this.urlResolver.matches(item, match, this.routerLinkActiveOptions(item));
516
+ }
517
+ withoutKey(record, key) {
518
+ const next = { ...record };
519
+ delete next[key];
520
+ return next;
521
+ }
522
+ resolvePanelArgs(method, navIdOrItem, item) {
523
+ if (typeof navIdOrItem === "string") {
524
+ if (item === void 0) throw new Error(`[Navigation] ${method}(navId, item) membutuhkan item navigasi sebagai argumen kedua.`);
525
+ return {
526
+ navId: this.persistence.normalizeId(navIdOrItem),
527
+ navItem: item
528
+ };
529
+ }
530
+ return {
531
+ navId: DEFAULT_NAVIGATION_ID,
532
+ navItem: navIdOrItem
533
+ };
534
+ }
535
+ static ɵfac = i0.ɵɵngDeclareFactory({
536
+ minVersion: "12.0.0",
537
+ version: "22.2.4",
538
+ ngImport: i0,
539
+ type: NavigationService,
540
+ deps: [],
541
+ target: i0.ɵɵFactoryTarget.Service
542
+ });
543
+ static ɵprov = i0.ɵɵngDeclareService({
544
+ minVersion: "22.0.0",
545
+ version: "22.2.4",
546
+ ngImport: i0,
547
+ type: NavigationService
548
+ });
549
+ };
550
+ i0.ɵɵngDeclareClassMetadata({
551
+ minVersion: "12.0.0",
552
+ version: "22.2.4",
553
+ ngImport: i0,
554
+ type: NavigationService,
555
+ decorators: [{ type: Service }],
556
+ ctorParameters: () => []
557
+ });
558
+ export { NavigationService };
@@ -0,0 +1,151 @@
1
+ const NAVIGATION_DOCKBAR_FALLBACK_ICON = "route";
2
+ function normalizeType(type, hasChildren) {
3
+ if (type === "divider" || type === "spacer" || type === "group" || type === "mega") return type;
4
+ if (type === "collapsible" || type === "collapsable") return "collapsible";
5
+ if (type === "aside" && hasChildren) return "collapsible";
6
+ if (!type && hasChildren) return "collapsible";
7
+ return "item";
8
+ }
9
+ function toKeyPart(value) {
10
+ return value.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
11
+ }
12
+ function itemFallbackKey(item, index) {
13
+ return toKeyPart(item.title ?? item.link?.toString() ?? item.href ?? `item-${index}`) || `item-${index}`;
14
+ }
15
+ function normalizeItem(item, index, path) {
16
+ if (item.isHidden?.(item)) return null;
17
+ const children = (item.children ?? []).map((child, childIndex) => normalizeItem(child, childIndex, `${path}-${childIndex}`)).filter((child) => child !== null);
18
+ const hasChildren = children.length > 0;
19
+ const key = item.id ?? `${path}-${itemFallbackKey(item, index)}`;
20
+ return {
21
+ ...item,
22
+ key,
23
+ stateId: item.id ?? key,
24
+ panelId: `nav-panel-${toKeyPart(key) || index}`,
25
+ type: normalizeType(item.type, hasChildren),
26
+ source: item,
27
+ children
28
+ };
29
+ }
30
+ function normalizeUiNavItems(items) {
31
+ return items.map((item, index) => normalizeItem(item, index, `nav-${index}`)).filter((item) => item !== null);
32
+ }
33
+ function formatNavigationBadgeCount(value) {
34
+ if (value === null || value === void 0 || !Number.isFinite(value)) return null;
35
+ const count = Math.trunc(value);
36
+ if (count <= 0) return null;
37
+ return count > 99 ? "99+" : String(count);
38
+ }
39
+ const MINIDOCK_REJECTED_TYPES = /* @__PURE__ */ new Set([
40
+ "group",
41
+ "collapsible",
42
+ "collapsable",
43
+ "mega",
44
+ "aside"
45
+ ]);
46
+ const MINIDOCK_ERROR_PREFIX = "[Navigation] Minidock hanya menerima item basic, divider, dan spacer.";
47
+ function ɵcompactNavigationDividers(items) {
48
+ const result = [];
49
+ let run = [];
50
+ for (const item of items) {
51
+ if (item.type === "divider") {
52
+ run.push(item);
53
+ continue;
54
+ }
55
+ if (run.length > 0 && result.length > 0) result.push(run.find((divider) => !divider.isHidden) ?? run[0]);
56
+ run = [];
57
+ result.push(item);
58
+ }
59
+ return result;
60
+ }
61
+ function ɵassertMinidockItems(items) {
62
+ items.forEach((item, index) => {
63
+ const label = `Item [${index}] "${item.title ?? item.id ?? ""}"`;
64
+ if (item.type && MINIDOCK_REJECTED_TYPES.has(item.type)) throw new Error(`${MINIDOCK_ERROR_PREFIX} ${label} bertipe "${item.type}".`);
65
+ if ((item.children?.length ?? 0) > 0) throw new Error(`${MINIDOCK_ERROR_PREFIX} ${label} punya children.`);
66
+ });
67
+ }
68
+ function toMinidockItems(items) {
69
+ const output = [];
70
+ const seenIds = /* @__PURE__ */ new Set();
71
+ let boundaryPending = false;
72
+ const visit = (list, ancestors) => {
73
+ const topLevel = ancestors.length === 0;
74
+ for (const item of list) {
75
+ const children = item.children ?? [];
76
+ if (item.type === "divider") {
77
+ output.push(withAncestorVisibility(withoutChildren(item), ancestors));
78
+ boundaryPending = false;
79
+ continue;
80
+ }
81
+ if (item.type === "spacer") {
82
+ if (topLevel) {
83
+ output.push(withoutChildren(item));
84
+ boundaryPending = false;
85
+ }
86
+ continue;
87
+ }
88
+ if (item.type === "group" || item.type === "mega") {
89
+ const start = output.length;
90
+ const pendingBefore = boundaryPending;
91
+ const divider = { type: "divider" };
92
+ const isHidden = chainedVisibility([...ancestors, item]);
93
+ output.push(isHidden ? {
94
+ ...divider,
95
+ isHidden
96
+ } : divider);
97
+ boundaryPending = false;
98
+ visit(children, [...ancestors, item]);
99
+ if (!output.slice(start + 1).some(isContent)) {
100
+ output.length = start;
101
+ boundaryPending = pendingBefore;
102
+ continue;
103
+ }
104
+ boundaryPending = true;
105
+ continue;
106
+ }
107
+ if (item.type && MINIDOCK_REJECTED_TYPES.has(item.type)) {
108
+ visit(children, [...ancestors, item]);
109
+ continue;
110
+ }
111
+ if (children.length > 0) {
112
+ visit(children, [...ancestors, item]);
113
+ continue;
114
+ }
115
+ if (item.id !== void 0) {
116
+ if (seenIds.has(item.id)) continue;
117
+ seenIds.add(item.id);
118
+ }
119
+ if (boundaryPending) {
120
+ output.push({ type: "divider" });
121
+ boundaryPending = false;
122
+ }
123
+ output.push(withAncestorVisibility(item, ancestors));
124
+ }
125
+ };
126
+ visit(items, []);
127
+ return ɵcompactNavigationDividers(output);
128
+ }
129
+ function isContent(item) {
130
+ return item.type !== "divider";
131
+ }
132
+ function withoutChildren(item) {
133
+ if (item.children === void 0) return item;
134
+ const copy = { ...item };
135
+ delete copy.children;
136
+ return copy;
137
+ }
138
+ function chainedVisibility(chain) {
139
+ const hiders = chain.filter((entry) => entry.isHidden !== void 0);
140
+ if (hiders.length === 0) return null;
141
+ return () => hiders.some((entry) => entry.isHidden?.(entry) === true);
142
+ }
143
+ function withAncestorVisibility(leaf, ancestors) {
144
+ const ancestorHidden = chainedVisibility(ancestors);
145
+ if (ancestorHidden === null) return leaf;
146
+ return {
147
+ ...leaf,
148
+ isHidden: () => ancestorHidden(leaf) || leaf.isHidden?.(leaf) === true
149
+ };
150
+ }
151
+ export { NAVIGATION_DOCKBAR_FALLBACK_ICON, formatNavigationBadgeCount, normalizeUiNavItems, toMinidockItems, ɵassertMinidockItems, ɵcompactNavigationDividers };