flowbite-angular 1.3.0 → 20.0.2

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 (309) hide show
  1. package/README.md +30 -39
  2. package/accordion/index.d.ts +569 -16
  3. package/alert/index.d.ts +602 -4
  4. package/badge/index.d.ts +636 -4
  5. package/breadcrumb/index.d.ts +452 -8
  6. package/button/index.d.ts +335 -4
  7. package/button-group/README.md +4 -0
  8. package/button-group/index.d.ts +85 -0
  9. package/{core → card}/README.md +2 -2
  10. package/card/index.d.ts +640 -0
  11. package/{accordion → clipboard}/README.md +2 -2
  12. package/clipboard/index.d.ts +103 -0
  13. package/dropdown/index.d.ts +536 -16
  14. package/fesm2022/flowbite-angular-accordion.mjs +339 -479
  15. package/fesm2022/flowbite-angular-accordion.mjs.map +1 -1
  16. package/fesm2022/flowbite-angular-alert.mjs +308 -240
  17. package/fesm2022/flowbite-angular-alert.mjs.map +1 -1
  18. package/fesm2022/flowbite-angular-badge.mjs +332 -238
  19. package/fesm2022/flowbite-angular-badge.mjs.map +1 -1
  20. package/fesm2022/flowbite-angular-breadcrumb.mjs +262 -191
  21. package/fesm2022/flowbite-angular-breadcrumb.mjs.map +1 -1
  22. package/fesm2022/flowbite-angular-button-group.mjs +86 -0
  23. package/fesm2022/flowbite-angular-button-group.mjs.map +1 -0
  24. package/fesm2022/flowbite-angular-button.mjs +189 -270
  25. package/fesm2022/flowbite-angular-button.mjs.map +1 -1
  26. package/fesm2022/flowbite-angular-card.mjs +344 -0
  27. package/fesm2022/flowbite-angular-card.mjs.map +1 -0
  28. package/fesm2022/flowbite-angular-clipboard.mjs +174 -0
  29. package/fesm2022/flowbite-angular-clipboard.mjs.map +1 -0
  30. package/fesm2022/flowbite-angular-dropdown.mjs +272 -459
  31. package/fesm2022/flowbite-angular-dropdown.mjs.map +1 -1
  32. package/fesm2022/flowbite-angular-form.mjs +444 -0
  33. package/fesm2022/flowbite-angular-form.mjs.map +1 -0
  34. package/fesm2022/flowbite-angular-icon-brand.mjs +71 -0
  35. package/fesm2022/flowbite-angular-icon-brand.mjs.map +1 -0
  36. package/fesm2022/flowbite-angular-icon-outline-arrows.mjs +51 -0
  37. package/fesm2022/flowbite-angular-icon-outline-arrows.mjs.map +1 -0
  38. package/fesm2022/flowbite-angular-icon-outline-e-commerce.mjs +23 -0
  39. package/fesm2022/flowbite-angular-icon-outline-e-commerce.mjs.map +1 -0
  40. package/fesm2022/flowbite-angular-icon-outline-emoji.mjs +13 -0
  41. package/fesm2022/flowbite-angular-icon-outline-emoji.mjs.map +1 -0
  42. package/fesm2022/flowbite-angular-icon-outline-files-folders.mjs +42 -0
  43. package/fesm2022/flowbite-angular-icon-outline-files-folders.mjs.map +1 -0
  44. package/fesm2022/flowbite-angular-icon-outline-general.mjs +145 -0
  45. package/fesm2022/flowbite-angular-icon-outline-general.mjs.map +1 -0
  46. package/fesm2022/flowbite-angular-icon-outline-media.mjs +25 -0
  47. package/fesm2022/flowbite-angular-icon-outline-media.mjs.map +1 -0
  48. package/fesm2022/flowbite-angular-icon-outline-text.mjs +20 -0
  49. package/fesm2022/flowbite-angular-icon-outline-text.mjs.map +1 -0
  50. package/fesm2022/flowbite-angular-icon-outline-user.mjs +17 -0
  51. package/fesm2022/flowbite-angular-icon-outline-user.mjs.map +1 -0
  52. package/fesm2022/flowbite-angular-icon-outline-weather.mjs +9 -0
  53. package/fesm2022/flowbite-angular-icon-outline-weather.mjs.map +1 -0
  54. package/fesm2022/flowbite-angular-icon-outline.mjs +6 -0
  55. package/fesm2022/flowbite-angular-icon-outline.mjs.map +1 -0
  56. package/fesm2022/flowbite-angular-icon-solid-arrows.mjs +17 -0
  57. package/fesm2022/flowbite-angular-icon-solid-arrows.mjs.map +1 -0
  58. package/fesm2022/flowbite-angular-icon-solid-brands.mjs +33 -0
  59. package/fesm2022/flowbite-angular-icon-solid-brands.mjs.map +1 -0
  60. package/fesm2022/flowbite-angular-icon-solid-e-commerce.mjs +21 -0
  61. package/fesm2022/flowbite-angular-icon-solid-e-commerce.mjs.map +1 -0
  62. package/fesm2022/flowbite-angular-icon-solid-emoji.mjs +13 -0
  63. package/fesm2022/flowbite-angular-icon-solid-emoji.mjs.map +1 -0
  64. package/fesm2022/flowbite-angular-icon-solid-files-folder.mjs +42 -0
  65. package/fesm2022/flowbite-angular-icon-solid-files-folder.mjs.map +1 -0
  66. package/fesm2022/flowbite-angular-icon-solid-general.mjs +123 -0
  67. package/fesm2022/flowbite-angular-icon-solid-general.mjs.map +1 -0
  68. package/fesm2022/flowbite-angular-icon-solid-media.mjs +24 -0
  69. package/fesm2022/flowbite-angular-icon-solid-media.mjs.map +1 -0
  70. package/fesm2022/flowbite-angular-icon-solid-text.mjs +11 -0
  71. package/fesm2022/flowbite-angular-icon-solid-text.mjs.map +1 -0
  72. package/fesm2022/flowbite-angular-icon-solid-user.mjs +17 -0
  73. package/fesm2022/flowbite-angular-icon-solid-user.mjs.map +1 -0
  74. package/fesm2022/flowbite-angular-icon-solid-weather.mjs +9 -0
  75. package/fesm2022/flowbite-angular-icon-solid-weather.mjs.map +1 -0
  76. package/fesm2022/flowbite-angular-icon-solid.mjs +6 -0
  77. package/fesm2022/flowbite-angular-icon-solid.mjs.map +1 -0
  78. package/fesm2022/flowbite-angular-icon.mjs +318 -219
  79. package/fesm2022/flowbite-angular-icon.mjs.map +1 -1
  80. package/fesm2022/flowbite-angular-indicator.mjs +119 -231
  81. package/fesm2022/flowbite-angular-indicator.mjs.map +1 -1
  82. package/fesm2022/flowbite-angular-modal.mjs +337 -486
  83. package/fesm2022/flowbite-angular-modal.mjs.map +1 -1
  84. package/fesm2022/flowbite-angular-navbar.mjs +600 -604
  85. package/fesm2022/flowbite-angular-navbar.mjs.map +1 -1
  86. package/fesm2022/flowbite-angular-pagination.mjs +994 -0
  87. package/fesm2022/flowbite-angular-pagination.mjs.map +1 -0
  88. package/fesm2022/flowbite-angular-sidebar.mjs +400 -776
  89. package/fesm2022/flowbite-angular-sidebar.mjs.map +1 -1
  90. package/fesm2022/flowbite-angular-tab.mjs +465 -0
  91. package/fesm2022/flowbite-angular-tab.mjs.map +1 -0
  92. package/fesm2022/flowbite-angular-theme-toggle.mjs +263 -0
  93. package/fesm2022/flowbite-angular-theme-toggle.mjs.map +1 -0
  94. package/fesm2022/flowbite-angular-tooltip.mjs +117 -0
  95. package/fesm2022/flowbite-angular-tooltip.mjs.map +1 -0
  96. package/fesm2022/flowbite-angular.mjs +53 -66
  97. package/fesm2022/flowbite-angular.mjs.map +1 -1
  98. package/flowbite-angular.css +2 -0
  99. package/{alert → form}/README.md +2 -2
  100. package/form/index.d.ts +684 -0
  101. package/{breadcrumb → icon/brand}/README.md +2 -2
  102. package/icon/brand/index.d.ts +66 -0
  103. package/icon/index.d.ts +322 -5
  104. package/icon/outline/README.md +4 -0
  105. package/icon/outline/arrows/index.d.ts +46 -0
  106. package/icon/outline/e-commerce/index.d.ts +18 -0
  107. package/icon/outline/emoji/index.d.ts +8 -0
  108. package/icon/outline/files-folders/index.d.ts +37 -0
  109. package/icon/outline/general/index.d.ts +140 -0
  110. package/icon/outline/index.d.ts +2 -0
  111. package/icon/outline/media/index.d.ts +20 -0
  112. package/icon/outline/text/index.d.ts +15 -0
  113. package/icon/outline/user/index.d.ts +12 -0
  114. package/icon/outline/weather/index.d.ts +4 -0
  115. package/icon/solid/README.md +4 -0
  116. package/icon/solid/arrows/index.d.ts +12 -0
  117. package/icon/solid/brands/index.d.ts +28 -0
  118. package/icon/solid/e-commerce/index.d.ts +16 -0
  119. package/icon/solid/emoji/index.d.ts +8 -0
  120. package/icon/solid/files-folder/index.d.ts +37 -0
  121. package/icon/solid/general/index.d.ts +118 -0
  122. package/icon/solid/index.d.ts +2 -0
  123. package/icon/solid/media/index.d.ts +19 -0
  124. package/icon/solid/text/index.d.ts +6 -0
  125. package/icon/solid/user/index.d.ts +12 -0
  126. package/icon/solid/weather/index.d.ts +4 -0
  127. package/index.d.ts +126 -3
  128. package/indicator/index.d.ts +242 -4
  129. package/modal/index.d.ts +458 -16
  130. package/navbar/index.d.ts +1467 -24
  131. package/package.json +133 -38
  132. package/pagination/README.md +4 -0
  133. package/pagination/index.d.ts +1135 -0
  134. package/sidebar/index.d.ts +880 -24
  135. package/styles/flowbite-angular.css +8 -0
  136. package/styles/part/animation.css +0 -0
  137. package/styles/part/color.css +125 -0
  138. package/styles/part/font-size.css +67 -0
  139. package/styles/part/rounded.css +11 -0
  140. package/styles/part/shadow.css +9 -0
  141. package/styles/part/spacing.css +38 -0
  142. package/{badge → tab}/README.md +2 -2
  143. package/tab/index.d.ts +791 -0
  144. package/theme-toggle/README.md +4 -0
  145. package/theme-toggle/index.d.ts +342 -0
  146. package/{button → tooltip}/README.md +2 -2
  147. package/tooltip/index.d.ts +158 -0
  148. package/accordion/accordion-content.component.d.ts +0 -69
  149. package/accordion/accordion-content.theme.d.ts +0 -28
  150. package/accordion/accordion-content.theme.service.d.ts +0 -19
  151. package/accordion/accordion-panel.component.d.ts +0 -67
  152. package/accordion/accordion-panel.theme.d.ts +0 -23
  153. package/accordion/accordion-panel.theme.service.d.ts +0 -20
  154. package/accordion/accordion-title.component.d.ts +0 -106
  155. package/accordion/accordion-title.theme.d.ts +0 -35
  156. package/accordion/accordion-title.theme.service.d.ts +0 -19
  157. package/accordion/accordion.component.d.ts +0 -61
  158. package/accordion/accordion.theme.d.ts +0 -29
  159. package/accordion/accordion.theme.service.d.ts +0 -19
  160. package/alert/alert.component.d.ts +0 -150
  161. package/alert/alert.theme.d.ts +0 -39
  162. package/alert/alert.theme.service.d.ts +0 -19
  163. package/badge/badge.component.d.ts +0 -196
  164. package/badge/badge.theme.d.ts +0 -53
  165. package/badge/badge.theme.service.d.ts +0 -19
  166. package/base-component.directive.d.ts +0 -51
  167. package/breadcrumb/breadcrumb-item.component.d.ts +0 -84
  168. package/breadcrumb/breadcrumb-item.theme.d.ts +0 -33
  169. package/breadcrumb/breadcrumb-item.theme.service.d.ts +0 -19
  170. package/breadcrumb/breadcrumb.component.d.ts +0 -43
  171. package/breadcrumb/breadcrumb.theme.d.ts +0 -29
  172. package/breadcrumb/breadcrumb.theme.service.d.ts +0 -19
  173. package/button/button.component.d.ts +0 -250
  174. package/button/button.theme.d.ts +0 -79
  175. package/button/button.theme.service.d.ts +0 -19
  176. package/core/flowbite.theme.init.d.ts +0 -9
  177. package/core/index.d.ts +0 -1
  178. package/dark-theme-toggle/README.md +0 -4
  179. package/dark-theme-toggle/dark-theme-toggle.component.d.ts +0 -51
  180. package/dark-theme-toggle/dark-theme-toggle.theme.d.ts +0 -23
  181. package/dark-theme-toggle/dark-theme-toggle.theme.service.d.ts +0 -19
  182. package/dark-theme-toggle/index.d.ts +0 -3
  183. package/dropdown/README.md +0 -4
  184. package/dropdown/dropdown-divider.component.d.ts +0 -36
  185. package/dropdown/dropdown-divider.theme.d.ts +0 -23
  186. package/dropdown/dropdown-divider.theme.service.d.ts +0 -19
  187. package/dropdown/dropdown-header.component.d.ts +0 -42
  188. package/dropdown/dropdown-header.theme.d.ts +0 -28
  189. package/dropdown/dropdown-header.theme.service.d.ts +0 -19
  190. package/dropdown/dropdown-item.component.d.ts +0 -36
  191. package/dropdown/dropdown-item.theme.d.ts +0 -23
  192. package/dropdown/dropdown-item.theme.service.d.ts +0 -19
  193. package/dropdown/dropdown.component.d.ts +0 -136
  194. package/dropdown/dropdown.theme.d.ts +0 -56
  195. package/dropdown/dropdown.theme.service.d.ts +0 -19
  196. package/fesm2022/flowbite-angular-core.mjs +0 -322
  197. package/fesm2022/flowbite-angular-core.mjs.map +0 -1
  198. package/fesm2022/flowbite-angular-dark-theme-toggle.mjs +0 -139
  199. package/fesm2022/flowbite-angular-dark-theme-toggle.mjs.map +0 -1
  200. package/fesm2022/flowbite-angular-router-link-active.mjs +0 -68
  201. package/fesm2022/flowbite-angular-router-link-active.mjs.map +0 -1
  202. package/fesm2022/flowbite-angular-router-link.mjs +0 -73
  203. package/fesm2022/flowbite-angular-router-link.mjs.map +0 -1
  204. package/fesm2022/flowbite-angular-sanitize-html.mjs +0 -39
  205. package/fesm2022/flowbite-angular-sanitize-html.mjs.map +0 -1
  206. package/fesm2022/flowbite-angular-scroll-top.mjs +0 -193
  207. package/fesm2022/flowbite-angular-scroll-top.mjs.map +0 -1
  208. package/fesm2022/flowbite-angular-theme.mjs +0 -78
  209. package/fesm2022/flowbite-angular-theme.mjs.map +0 -1
  210. package/fesm2022/flowbite-angular-utils.mjs +0 -210
  211. package/fesm2022/flowbite-angular-utils.mjs.map +0 -1
  212. package/flowbite.theme.service.d.ts +0 -12
  213. package/icon/icon-registry.d.ts +0 -45
  214. package/icon/icon.component.d.ts +0 -22
  215. package/icon/trusted-types.d.ts +0 -15
  216. package/indicator/indicators.component.d.ts +0 -224
  217. package/indicator/indicators.theme.d.ts +0 -59
  218. package/indicator/indicators.theme.service.d.ts +0 -19
  219. package/modal/modal-body.component.d.ts +0 -36
  220. package/modal/modal-body.theme.d.ts +0 -23
  221. package/modal/modal-body.theme.service.d.ts +0 -19
  222. package/modal/modal-footer.component.d.ts +0 -36
  223. package/modal/modal-footer.theme.d.ts +0 -23
  224. package/modal/modal-footer.theme.service.d.ts +0 -19
  225. package/modal/modal-header.component.d.ts +0 -60
  226. package/modal/modal-header.theme.d.ts +0 -32
  227. package/modal/modal-header.theme.service.d.ts +0 -19
  228. package/modal/modal.component.d.ts +0 -146
  229. package/modal/modal.theme.d.ts +0 -35
  230. package/modal/modal.theme.service.d.ts +0 -19
  231. package/navbar/navbar-brand.component.d.ts +0 -36
  232. package/navbar/navbar-brand.theme.d.ts +0 -23
  233. package/navbar/navbar-brand.theme.service.d.ts +0 -19
  234. package/navbar/navbar-content.component.d.ts +0 -50
  235. package/navbar/navbar-content.theme.d.ts +0 -28
  236. package/navbar/navbar-content.theme.service.d.ts +0 -19
  237. package/navbar/navbar-icon-button.component.d.ts +0 -59
  238. package/navbar/navbar-icon-button.theme.d.ts +0 -26
  239. package/navbar/navbar-icon-button.theme.service.d.ts +0 -19
  240. package/navbar/navbar-item.component.d.ts +0 -67
  241. package/navbar/navbar-item.theme.d.ts +0 -26
  242. package/navbar/navbar-item.theme.service.d.ts +0 -19
  243. package/navbar/navbar-toggle.component.d.ts +0 -51
  244. package/navbar/navbar-toggle.theme.d.ts +0 -23
  245. package/navbar/navbar-toggle.theme.service.d.ts +0 -19
  246. package/navbar/navbar.component.d.ts +0 -121
  247. package/navbar/navbar.theme.d.ts +0 -21
  248. package/navbar/navbar.theme.service.d.ts +0 -19
  249. package/router-link/README.md +0 -4
  250. package/router-link/flowbite-router-link.directive.d.ts +0 -28
  251. package/router-link/index.d.ts +0 -1
  252. package/router-link-active/README.md +0 -4
  253. package/router-link-active/flowbite-router-link-active.directive.d.ts +0 -37
  254. package/router-link-active/index.d.ts +0 -1
  255. package/sanitize-html/README.md +0 -4
  256. package/sanitize-html/index.d.ts +0 -1
  257. package/sanitize-html/sanitize-html.pipe.d.ts +0 -20
  258. package/scroll-top/README.md +0 -4
  259. package/scroll-top/index.d.ts +0 -4
  260. package/scroll-top/scroll-top.component.d.ts +0 -114
  261. package/scroll-top/scroll-top.theme.d.ts +0 -39
  262. package/scroll-top/scroll-top.theme.service.d.ts +0 -19
  263. package/sidebar/sidebar-item-group.component.d.ts +0 -100
  264. package/sidebar/sidebar-item-group.theme.d.ts +0 -31
  265. package/sidebar/sidebar-item-group.theme.service.d.ts +0 -19
  266. package/sidebar/sidebar-item.component.d.ts +0 -101
  267. package/sidebar/sidebar-item.theme.d.ts +0 -33
  268. package/sidebar/sidebar-item.theme.service.d.ts +0 -19
  269. package/sidebar/sidebar-menu.component.d.ts +0 -93
  270. package/sidebar/sidebar-menu.theme.d.ts +0 -30
  271. package/sidebar/sidebar-menu.theme.service.d.ts +0 -19
  272. package/sidebar/sidebar-page-content.component.d.ts +0 -46
  273. package/sidebar/sidebar-page-content.theme.d.ts +0 -27
  274. package/sidebar/sidebar-page-content.theme.service.d.ts +0 -19
  275. package/sidebar/sidebar-toggle.component.d.ts +0 -95
  276. package/sidebar/sidebar-toggle.theme.d.ts +0 -34
  277. package/sidebar/sidebar-toggle.theme.service.d.ts +0 -19
  278. package/sidebar/sidebar.component.d.ts +0 -84
  279. package/sidebar/sidebar.theme.d.ts +0 -22
  280. package/sidebar/sidebar.theme.service.d.ts +0 -19
  281. package/tailwind.config.js +0 -303
  282. package/theme/README.md +0 -4
  283. package/theme/flowbite-theme.directive.d.ts +0 -36
  284. package/theme/index.d.ts +0 -1
  285. package/type-definitions/colors/flowbite.colors.d.ts +0 -19
  286. package/type-definitions/colors/flowbite.gradient-colors.d.ts +0 -11
  287. package/type-definitions/colors/flowbite.gradient-duo-tone-colors.d.ts +0 -12
  288. package/type-definitions/colors/index.d.ts +0 -3
  289. package/type-definitions/flowbite.boolean.d.ts +0 -14
  290. package/type-definitions/flowbite.class.d.ts +0 -6
  291. package/type-definitions/flowbite.combination.d.ts +0 -8
  292. package/type-definitions/flowbite.content-positions.d.ts +0 -6
  293. package/type-definitions/flowbite.deep-partial.d.ts +0 -6
  294. package/type-definitions/flowbite.heading-levels.d.ts +0 -4
  295. package/type-definitions/flowbite.positions.d.ts +0 -14
  296. package/type-definitions/flowbite.router-link-parameter.d.ts +0 -5
  297. package/type-definitions/flowbite.sizes.d.ts +0 -10
  298. package/type-definitions/flowbite.themes.d.ts +0 -4
  299. package/type-definitions/index.d.ts +0 -12
  300. package/utils/README.md +0 -4
  301. package/utils/icon.list.d.ts +0 -7
  302. package/utils/id.generator.d.ts +0 -59
  303. package/utils/index.d.ts +0 -8
  304. package/utils/theme/clone-deep.d.ts +0 -7
  305. package/utils/theme/create-class.d.ts +0 -7
  306. package/utils/theme/create-theme.d.ts +0 -7
  307. package/utils/theme/is-object.d.ts +0 -7
  308. package/utils/theme/merge-theme.d.ts +0 -8
  309. package/utils/theme/to-string.d.ts +0 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowbite-angular-icon-solid-weather.mjs","sources":["../tmp-esm2022/icon/solid/weather/index.js","../tmp-esm2022/icon/solid/weather/flowbite-angular-icon-solid-weather.js"],"sourcesContent":["export const sun = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 24 24\"><path fill-rule=\"evenodd\" d=\"M13 3a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0V3ZM6.343 4.929A1 1 0 0 0 4.93 6.343l1.414 1.414a1 1 0 0 0 1.414-1.414L6.343 4.929Zm12.728 1.414a1 1 0 0 0-1.414-1.414l-1.414 1.414a1 1 0 0 0 1.414 1.414l1.414-1.414ZM12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10Zm-9 4a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2H3Zm16 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2h-2ZM7.757 17.657a1 1 0 1 0-1.414-1.414l-1.414 1.414a1 1 0 1 0 1.414 1.414l1.414-1.414Zm9.9-1.414a1 1 0 0 0-1.414 1.414l1.414 1.414a1 1 0 0 0 1.414-1.414l-1.414-1.414ZM13 19a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2Z\" clip-rule=\"evenodd\" /></svg>`;\nexport const moon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 24 24\"><path fill-rule=\"evenodd\" d=\"M11.675 2.015a.998.998 0 0 0-.403.011C6.09 2.4 2 6.722 2 12c0 5.523 4.477 10 10 10 4.356 0 8.058-2.784 9.43-6.667a1 1 0 0 0-1.02-1.33c-.08.006-.105.005-.127.005h-.001l-.028-.002A5.227 5.227 0 0 0 20 14a8 8 0 0 1-8-8c0-.952.121-1.752.404-2.558a.996.996 0 0 0 .096-.428V3a1 1 0 0 0-.825-.985Z\" clip-rule=\"evenodd\" /></svg>`;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2Zsb3diaXRlLWFuZ3VsYXIvaWNvbi9zb2xpZC93ZWF0aGVyL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxHQUFHLEdBQUcsa3BCQUFrcEIsQ0FBQztBQUN0cUIsTUFBTSxDQUFDLE1BQU0sSUFBSSxHQUFHLCthQUErYSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IHN1biA9IGA8c3ZnIHhtbG5zPVwiaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmdcIiBmaWxsPVwiY3VycmVudENvbG9yXCIgdmlld0JveD1cIjAgMCAyNCAyNFwiPjxwYXRoIGZpbGwtcnVsZT1cImV2ZW5vZGRcIiBkPVwiTTEzIDNhMSAxIDAgMSAwLTIgMHYyYTEgMSAwIDEgMCAyIDBWM1pNNi4zNDMgNC45MjlBMSAxIDAgMCAwIDQuOTMgNi4zNDNsMS40MTQgMS40MTRhMSAxIDAgMCAwIDEuNDE0LTEuNDE0TDYuMzQzIDQuOTI5Wm0xMi43MjggMS40MTRhMSAxIDAgMCAwLTEuNDE0LTEuNDE0bC0xLjQxNCAxLjQxNGExIDEgMCAwIDAgMS40MTQgMS40MTRsMS40MTQtMS40MTRaTTEyIDdhNSA1IDAgMSAwIDAgMTAgNSA1IDAgMCAwIDAtMTBabS05IDRhMSAxIDAgMSAwIDAgMmgyYTEgMSAwIDEgMCAwLTJIM1ptMTYgMGExIDEgMCAxIDAgMCAyaDJhMSAxIDAgMSAwIDAtMmgtMlpNNy43NTcgMTcuNjU3YTEgMSAwIDEgMC0xLjQxNC0xLjQxNGwtMS40MTQgMS40MTRhMSAxIDAgMSAwIDEuNDE0IDEuNDE0bDEuNDE0LTEuNDE0Wm05LjktMS40MTRhMSAxIDAgMCAwLTEuNDE0IDEuNDE0bDEuNDE0IDEuNDE0YTEgMSAwIDAgMCAxLjQxNC0xLjQxNGwtMS40MTQtMS40MTRaTTEzIDE5YTEgMSAwIDEgMC0yIDB2MmExIDEgMCAxIDAgMiAwdi0yWlwiIGNsaXAtcnVsZT1cImV2ZW5vZGRcIiAvPjwvc3ZnPmA7XG5leHBvcnQgY29uc3QgbW9vbiA9IGA8c3ZnIHhtbG5zPVwiaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmdcIiBmaWxsPVwiY3VycmVudENvbG9yXCIgdmlld0JveD1cIjAgMCAyNCAyNFwiPjxwYXRoIGZpbGwtcnVsZT1cImV2ZW5vZGRcIiBkPVwiTTExLjY3NSAyLjAxNWEuOTk4Ljk5OCAwIDAgMC0uNDAzLjAxMUM2LjA5IDIuNCAyIDYuNzIyIDIgMTJjMCA1LjUyMyA0LjQ3NyAxMCAxMCAxMCA0LjM1NiAwIDguMDU4LTIuNzg0IDkuNDMtNi42NjdhMSAxIDAgMCAwLTEuMDItMS4zM2MtLjA4LjAwNi0uMTA1LjAwNS0uMTI3LjAwNWgtLjAwMWwtLjAyOC0uMDAyQTUuMjI3IDUuMjI3IDAgMCAwIDIwIDE0YTggOCAwIDAgMS04LThjMC0uOTUyLjEyMS0xLjc1Mi40MDQtMi41NThhLjk5Ni45OTYgMCAwIDAgLjA5Ni0uNDI4VjNhMSAxIDAgMCAwLS44MjUtLjk4NVpcIiBjbGlwLXJ1bGU9XCJldmVub2RkXCIgLz48L3N2Zz5gO1xuIl19","/**\n * Generated bundle index. Do not edit.\n */\nexport * from './index';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmxvd2JpdGUtYW5ndWxhci1pY29uLXNvbGlkLXdlYXRoZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2Zsb3diaXRlLWFuZ3VsYXIvaWNvbi9zb2xpZC93ZWF0aGVyL3NyYy9mbG93Yml0ZS1hbmd1bGFyLWljb24tc29saWQtd2VhdGhlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ=="],"names":[],"mappings":"AAAY,MAAC,GAAG,GAAG,CAAC,gpBAAgpB;AACxpB,MAAC,IAAI,GAAG,CAAC,6aAA6a;;ACDlc;AACA;AACA;;;;"}
@@ -0,0 +1,6 @@
1
+ var index = null;
2
+
3
+ /**
4
+ * Generated bundle index. Do not edit.
5
+ */
6
+ //# sourceMappingURL=flowbite-angular-icon-solid.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowbite-angular-icon-solid.mjs","sources":["../tmp-esm2022/icon/solid/index.js","../tmp-esm2022/icon/solid/flowbite-angular-icon-solid.js"],"sourcesContent":["export default null;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2Zsb3diaXRlLWFuZ3VsYXIvaWNvbi9zb2xpZC9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFBZSxJQUFJLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBudWxsO1xuIl19","/**\n * Generated bundle index. Do not edit.\n */\nexport * from './index';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmxvd2JpdGUtYW5ndWxhci1pY29uLXNvbGlkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9mbG93Yml0ZS1hbmd1bGFyL2ljb24vc29saWQvc3JjL2Zsb3diaXRlLWFuZ3VsYXItaWNvbi1zb2xpZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ=="],"names":[],"mappings":"AAAA,YAAe,IAAI;;ACAnB;AACA;AACA"}
@@ -1,254 +1,353 @@
1
- import { DOCUMENT, isPlatformBrowser } from '@angular/common';
2
- import { HttpClient } from '@angular/common/http';
1
+ import { createTheme, mergeDeep, colorToTheme } from 'flowbite-angular';
3
2
  import * as i0 from '@angular/core';
4
- import { inject, PLATFORM_ID, SecurityContext, Injectable, ElementRef, model, effect, Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
5
- import { DomSanitizer } from '@angular/platform-browser';
6
- import { of, throwError, map, tap, finalize, share, take } from 'rxjs';
7
- import { BaseComponent } from 'flowbite-angular';
3
+ import { InjectionToken, inject, Injector, Renderer2, PLATFORM_ID, ElementRef, input, computed, effect, HostAttributeToken, runInInjectionContext, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
4
+ import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
5
+ import { isPlatformServer } from '@angular/common';
6
+ import { injectNgIcons, injectNgIconLoader, injectNgIconLoaderCache } from '@ng-icons/core';
7
+ import { isObservable, firstValueFrom } from 'rxjs';
8
+ import { twMerge } from 'tailwind-merge';
8
9
 
10
+ const flowbiteIconTheme = createTheme({
11
+ host: {
12
+ base: 'self-center overflow-hidden',
13
+ transition: '',
14
+ color: {
15
+ default: {
16
+ light: '',
17
+ dark: '',
18
+ },
19
+ info: {
20
+ light: 'text-blue-500',
21
+ dark: 'dark:text-blue-500',
22
+ },
23
+ failure: {
24
+ light: 'text-red-500',
25
+ dark: 'dark:text-red-500',
26
+ },
27
+ success: {
28
+ light: 'text-green-500',
29
+ dark: 'dark:text-green-500',
30
+ },
31
+ warning: {
32
+ light: 'text-yellow-500',
33
+ dark: 'dark:text-yellow-500',
34
+ },
35
+ primary: {
36
+ light: 'text-primary-500',
37
+ dark: 'dark:text-primary-500',
38
+ },
39
+ dark: {
40
+ light: 'text-gray-700',
41
+ dark: 'dark:text-gray-700',
42
+ },
43
+ light: {
44
+ light: 'text-gray-300',
45
+ dark: 'dark:text-gray-300',
46
+ },
47
+ blue: {
48
+ light: 'text-blue-500',
49
+ dark: 'dark:text-blue-500',
50
+ },
51
+ cyan: {
52
+ light: 'text-cyan-500',
53
+ dark: 'dark:text-cyan-500',
54
+ },
55
+ gray: {
56
+ light: 'text-gray-500',
57
+ dark: 'dark:text-gray-500',
58
+ },
59
+ green: {
60
+ light: 'text-green-500',
61
+ dark: 'dark:text-green-500',
62
+ },
63
+ indigo: {
64
+ light: 'text-indigo-500',
65
+ dark: 'dark:text-indigo-500',
66
+ },
67
+ lime: {
68
+ light: 'text-lime-500',
69
+ dark: 'dark:text-lime-500',
70
+ },
71
+ pink: {
72
+ light: 'text-pink-500',
73
+ dark: 'dark:text-pink-500',
74
+ },
75
+ purple: {
76
+ light: 'text-purple-500',
77
+ dark: 'dark:text-purple-500',
78
+ },
79
+ red: {
80
+ light: 'text-red-500',
81
+ dark: 'dark:text-red-500',
82
+ },
83
+ teal: {
84
+ light: 'text-teal-500',
85
+ dark: 'dark:text-teal-500',
86
+ },
87
+ yellow: {
88
+ light: 'text-yellow-500',
89
+ dark: 'dark:text-yellow-500',
90
+ },
91
+ },
92
+ },
93
+ });
94
+
95
+ const defaultFlowbiteIconConfig = {
96
+ baseTheme: flowbiteIconTheme,
97
+ color: 'default',
98
+ customTheme: {},
99
+ };
100
+ const FlowbiteIconConfigToken = new InjectionToken('FlowbiteIconConfigToken');
9
101
  /**
10
- * Thanks to Angular Material for Icon part of this library : https://github.com/angular/components
102
+ * Provide the default Icon configuration
103
+ * @param config The Icon configuration
104
+ * @returns The provider
11
105
  */
12
- let policy;
13
- function getPolicy() {
14
- if (!policy) {
15
- if (typeof window !== 'undefined') {
16
- const tWindow = window;
17
- if (tWindow.trustedTypes !== undefined) {
18
- policy = tWindow.trustedTypes.createPolicy('angular#components', {
19
- createHTML: (s) => s,
20
- });
21
- }
22
- }
23
- }
24
- return policy;
25
- }
26
- function trustedHTMLFromString(raw) {
27
- return getPolicy()?.createHTML(raw) || raw;
28
- }
29
-
106
+ const provideFlowbiteIconConfig = (config) => [
107
+ {
108
+ provide: FlowbiteIconConfigToken,
109
+ useValue: { ...defaultFlowbiteIconConfig, ...config },
110
+ },
111
+ ];
30
112
  /**
31
- * Thanks to Angular Material for Icon part of this library : https://github.com/angular/components
113
+ * Inject the Icon configuration
114
+ * @see {@link defaultFlowbiteIconConfig}
115
+ * @returns The configuration
32
116
  */
33
- function getSvgIconFromNamedError(iconName) {
34
- return Error(`Unable to find icon with name ${iconName}`);
35
- }
36
- function getSvgIconFailedToSanitizeRawError(raw) {
37
- return Error(`The raw provided to IconRegistry was not trusted as safe HTML by ANGULAR's DOMSanitizer. Attempted raw was : ${raw}`);
38
- }
39
- function getSvgIconFailedToSanitizeUrlError(url) {
40
- return Error(`The URL provided to IconRegistry was not trusted as a resource URL via Angular's DOMSanitizer. Attempted URL was : ${url}`);
41
- }
42
- function getSvgIconNoHttpClientProvidedError() {
43
- return Error(`Could not fid HttpClient provider for use with flowbite-angular icons. Please include the HttpClientModule from @angular/common/http in your app imports`);
117
+ const injectFlowbiteIconConfig = () => inject(FlowbiteIconConfigToken, { optional: true }) ?? defaultFlowbiteIconConfig;
118
+
119
+ const FlowbiteIconStateToken = createStateToken('Flowbite Icon');
120
+ const provideFlowbiteIconState = createStateProvider(FlowbiteIconStateToken);
121
+ const injectFlowbiteIconState = createStateInjector(FlowbiteIconStateToken);
122
+ const flowbiteIconState = createState(FlowbiteIconStateToken);
123
+ const NgIconPreProcessorToken = new InjectionToken('Ng Icon Pre Processor');
124
+ const NgIconPostProcessorToken = new InjectionToken('Ng Icon Post Processor');
125
+ function injectNgIconPreProcessor() {
126
+ return inject(NgIconPreProcessorToken, { optional: true }) ?? ((icon) => icon);
44
127
  }
45
- class SvgIconConfig {
46
- constructor(url, svgText, options) {
47
- this.url = url;
48
- this.svgText = svgText;
49
- this.options = options;
50
- this.svgElement = null;
51
- }
128
+ function injectNgIconPostProcessor() {
129
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
130
+ return inject(NgIconPostProcessorToken, { optional: true }) ?? (() => { });
52
131
  }
53
- class IconRegistry {
132
+
133
+ /* https://github.com/ng-icons/ng-icons/blob/main/packages/core/src/lib/components/icon/icon.component.ts */
134
+ let uniqueId = 0;
135
+ class Icon {
54
136
  constructor() {
55
- this.platformId = inject(PLATFORM_ID);
56
- this._httpClient = inject(HttpClient, { optional: true });
57
- this._sanitizer = inject(DomSanitizer);
58
- this._document = inject(DOCUMENT);
59
- this._svgIconConfig = new Map();
60
- this._cachedSvgIconByUrl = new Map();
61
- this._inProgressSvgIconFetch = new Map();
62
- }
63
- addSvgIcon(iconName, url, options) {
64
- return this.addSvgIconInNamespace('', iconName, url, options);
65
- }
66
- addRawSvgIcon(iconName, raw, options) {
67
- return this.addRawSvgIconInNamepsace('', iconName, raw, options);
68
- }
69
- addSvgIconInNamespace(namespace, iconName, url, options) {
70
- return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig(url, undefined, options));
71
- }
72
- addRawSvgIconInNamepsace(namespace, iconName, raw, options) {
73
- const cleanRaw = this._sanitizer.sanitize(SecurityContext.HTML, raw);
74
- if (!cleanRaw) {
75
- throw getSvgIconFailedToSanitizeRawError(raw);
76
- }
77
- const trustedRaw = trustedHTMLFromString(cleanRaw);
78
- return this._addSvgIconConfig(namespace, iconName, new SvgIconConfig('', trustedRaw, options));
79
- }
80
- getSvgIconFromUrl(safeUrl) {
81
- const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, safeUrl);
82
- if (!url) {
83
- throw getSvgIconFailedToSanitizeUrlError(safeUrl);
84
- }
85
- const cachedIcon = this._cachedSvgIconByUrl.get(url);
86
- if (cachedIcon) {
87
- return of(cloneSvg(cachedIcon));
137
+ this.config = injectFlowbiteIconConfig();
138
+ /** Access the icons */
139
+ this.icons = injectNgIcons();
140
+ /** Access the icon loader if defined */
141
+ this.loader = injectNgIconLoader();
142
+ /** Access the icon cache if defined */
143
+ this.cache = injectNgIconLoaderCache();
144
+ /** Access the pre-processor */
145
+ this.preProcessor = injectNgIconPreProcessor();
146
+ /** Access the post-processor */
147
+ this.postProcessor = injectNgIconPostProcessor();
148
+ /** Access the injector */
149
+ this.injector = inject(Injector);
150
+ /** Access the renderer */
151
+ this.renderer = inject(Renderer2);
152
+ /** Determine the platform we are rendering on */
153
+ this.platform = inject(PLATFORM_ID);
154
+ /** Access the element ref */
155
+ this.elementRef = inject(ElementRef);
156
+ /** A unique id for this instance */
157
+ this.uniqueId = uniqueId++;
158
+ /** Define the name of the icon to display */
159
+ this.name = input();
160
+ /** Define the svg of the icon to display */
161
+ this.svg = input();
162
+ /**
163
+ * @see {@link injectFlowbiteIconConfig}
164
+ */
165
+ this.color = input(this.config.color);
166
+ /**
167
+ * @see {@link injectFlowbiteIconConfig}
168
+ */
169
+ this.customTheme = input(this.config.customTheme);
170
+ this.theme = computed(() => {
171
+ const mergedTheme = mergeDeep(this.config.baseTheme, this.state.customTheme());
172
+ return {
173
+ host: {
174
+ root: twMerge(mergedTheme.host.base, mergedTheme.host.transition, this.state.color() && colorToTheme(mergedTheme.host.color, this.state.color())),
175
+ },
176
+ };
177
+ });
178
+ this.state = flowbiteIconState(this);
179
+ // update the icon anytime the name or svg changes
180
+ effect(() => this.updateIcon());
181
+ const ariaHidden = inject(new HostAttributeToken('aria-hidden'), {
182
+ optional: true,
183
+ });
184
+ // If the user has not explicitly set aria-hidden, mark the icon as hidden, as this is
185
+ // the right thing to do for the majority of icon use-cases.
186
+ if (!ariaHidden) {
187
+ this.elementRef.nativeElement.setAttribute('aria-hidden', 'true');
88
188
  }
89
- return this._loadSvgIconFromConfig(new SvgIconConfig(safeUrl, undefined));
90
- }
91
- getSvgIconFromName(iconName, namespace) {
92
- const key = iconKey(namespace, iconName);
93
- const config = this._svgIconConfig.get(key);
94
- if (config) {
95
- return this._getSvgIconFromConfig(config);
96
- }
97
- return throwError(() => getSvgIconFromNamedError(key));
98
189
  }
99
190
  ngOnDestroy() {
100
- this._svgIconConfig.clear();
101
- this._cachedSvgIconByUrl.clear();
102
- }
103
- _addSvgIconConfig(namespace, iconName, config) {
104
- this._svgIconConfig.set(iconKey(namespace, iconName), config);
105
- return this;
191
+ this.svgElement = undefined;
106
192
  }
107
- _getSvgIconFromConfig(config) {
108
- if (config.svgText) {
109
- return of(cloneSvg(this._svgElementFromConfig(config)));
193
+ async updateIcon() {
194
+ const toPropertyName = (str) => str
195
+ .replace(/([^a-zA-Z0-9])+(.)?/g, (_, __, chr) => (chr ? chr.toUpperCase() : ''))
196
+ .replace(/[^a-zA-Z\d]/g, '')
197
+ .replace(/^([A-Z])/, (m) => m.toLowerCase());
198
+ const name = this.name();
199
+ const svg = this.svg();
200
+ // if the svg is defined, insert it into the template
201
+ if (svg !== undefined) {
202
+ this.setSvg(svg);
203
+ return;
110
204
  }
111
- else {
112
- return this._loadSvgIconFromConfig(config).pipe(map((svg) => cloneSvg(svg)));
205
+ if (name === undefined) {
206
+ return;
113
207
  }
114
- }
115
- _loadSvgIconFromConfig(config) {
116
- return this._fetchIcon(config).pipe(tap((svgText) => (config.svgText = svgText)), map(() => this._svgElementFromConfig(config)));
117
- }
118
- _setSvgAttributes(svg, options) {
119
- svg.setAttribute('fit', '');
120
- svg.setAttribute('height', '100%');
121
- svg.setAttribute('width', '100%');
122
- svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
123
- svg.setAttribute('focusable', 'false');
124
- if (options?.viewBox) {
125
- svg.setAttribute('viewBox', options.viewBox);
208
+ const propertyName = toPropertyName(name);
209
+ for (const icons of [...this.icons].reverse()) {
210
+ if (icons[propertyName]) {
211
+ // insert the SVG into the template
212
+ this.setSvg(icons[propertyName]);
213
+ return;
214
+ }
126
215
  }
127
- return svg;
128
- }
129
- _svgElementFromConfig(config) {
130
- if (!config.svgElement) {
131
- const svg = this._svgElementFromString(config.svgText);
132
- this._setSvgAttributes(svg, config.options);
133
- config.svgElement = svg;
216
+ // if there is a loader defined, use it to load the icon
217
+ if (this.loader) {
218
+ const result = await this.requestIconFromLoader(name);
219
+ // if the result is a string, insert the SVG into the template
220
+ if (result !== null) {
221
+ this.setSvg(result);
222
+ return;
223
+ }
134
224
  }
135
- return config.svgElement;
225
+ // if there is no icon with this name warn the user as they probably forgot to import it
226
+ console.warn(`No icon named ${name} was found. You may need to import it using the withIcons function.`);
136
227
  }
137
- _svgElementFromString(str) {
138
- const div = this._document.createElement('div');
139
- div.innerHTML = str;
140
- const svg = div.querySelector('svg');
141
- return svg;
142
- }
143
- _fetchIcon(iconConfig) {
144
- if (isPlatformBrowser(this.platformId)) {
145
- if (!this._httpClient) {
146
- throw getSvgIconNoHttpClientProvidedError();
147
- }
148
- const url = this._sanitizer.sanitize(SecurityContext.RESOURCE_URL, iconConfig.url);
149
- if (!url) {
150
- throw getSvgIconFailedToSanitizeUrlError(iconConfig.url);
151
- }
152
- const inProgressFetch = this._inProgressSvgIconFetch.get(url);
153
- if (inProgressFetch) {
154
- return inProgressFetch;
228
+ setSvg(svg) {
229
+ // if we are on the server, simply innerHTML the svg as we don't have the
230
+ // level of control over the DOM that we do on the client, in otherwords
231
+ // the approach we take to insert the svg on the client will not work on the server
232
+ if (isPlatformServer(this.platform)) {
233
+ this.elementRef.nativeElement.innerHTML = svg;
234
+ // mark this component as server side rendered
235
+ this.elementRef.nativeElement.setAttribute('data-ng-icon-ssr', '');
236
+ return;
237
+ }
238
+ // if this was previously server side rendered, we should check if the svg is the same
239
+ // if it is, we don't need to do anything
240
+ if (this.elementRef.nativeElement.hasAttribute('data-ng-icon-ssr')) {
241
+ // if it is different, we need to remove the server side rendered flag
242
+ this.elementRef.nativeElement.removeAttribute('data-ng-icon-ssr');
243
+ // retrieve the svg element
244
+ this.svgElement = this.elementRef.nativeElement.querySelector('svg') ?? undefined;
245
+ if (this.elementRef.nativeElement.innerHTML === svg) {
246
+ return;
155
247
  }
156
- const req = this._httpClient.get(url, { responseType: 'text' }).pipe(map((svg) => {
157
- return trustedHTMLFromString(svg);
158
- }), finalize(() => this._inProgressSvgIconFetch.delete(url)), share());
159
- this._inProgressSvgIconFetch.set(url, req);
160
- return req;
161
248
  }
162
- else {
163
- return of(trustedHTMLFromString('<svg></svg>'));
249
+ // remove the old element
250
+ if (this.svgElement) {
251
+ this.renderer.removeChild(this.elementRef.nativeElement, this.svgElement);
164
252
  }
253
+ // if the svg is empty, don't insert anything
254
+ if (svg === '') {
255
+ return;
256
+ }
257
+ const template = this.renderer.createElement('template');
258
+ svg = this.replaceIds(svg);
259
+ this.renderer.setProperty(template, 'innerHTML', this.preProcessor(svg));
260
+ this.svgElement = template.content.firstElementChild;
261
+ this.postProcessor(this.svgElement);
262
+ // insert the element into the dom
263
+ this.renderer.appendChild(this.elementRef.nativeElement, this.svgElement);
165
264
  }
166
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IconRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
167
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IconRegistry, providedIn: 'root' }); }
168
- }
169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IconRegistry, decorators: [{
170
- type: Injectable,
171
- args: [{
172
- providedIn: 'root',
173
- }]
174
- }] });
175
- function cloneSvg(svg) {
176
- return svg.cloneNode(true);
177
- }
178
- function iconKey(namespace, iconName) {
179
- return `${namespace}:${iconName}`;
180
- }
181
-
182
- /**
183
- * Thanks to Angular Material for Icon part of this library : https://github.com/angular/components
184
- */
185
- class IconComponent extends BaseComponent {
186
- constructor() {
187
- super(...arguments);
188
- this._elementRef = inject((ElementRef));
189
- this._iconRegistry = inject(IconRegistry);
190
- this.svgIcon = model.required();
191
- }
192
- init() {
193
- effect(() => {
194
- this._updateSvgIcon();
195
- }, { injector: this.injector });
196
- }
197
- fetchClass() {
198
- return { rootClass: '' };
199
- }
200
- _splitIconName(iconName) {
201
- if (!iconName) {
202
- return ['', ''];
265
+ replaceIds(svg) {
266
+ // ids are defined like ID_PLACEHOLDER_0, ID_PLACEHOLDER_1, etc.
267
+ // we need to replace these with the actual ids e.g. ng-icon-0-0, ng-icon-0-1, etc.
268
+ // if there are no ids, we don't need to do anything
269
+ if (!svg.includes('ID_PLACEHOLDER_')) {
270
+ return svg;
203
271
  }
204
- const parts = iconName.split(':');
205
- switch (parts.length) {
206
- case 1:
207
- return ['', parts[0]];
208
- case 2:
209
- return parts;
210
- default:
211
- throw Error(`Invalid icon name: "${iconName}"`);
272
+ // we can just retain the trailing number as the prefix is always the same
273
+ const regex = /ID_PLACEHOLDER_(\d+)/g;
274
+ // we need to keep track of the ids we have replaced
275
+ const idMap = new Map();
276
+ // find all the matches
277
+ const matches = new Set(svg.match(regex));
278
+ if (matches === null) {
279
+ return svg;
212
280
  }
281
+ // replace the ids
282
+ for (const match of matches) {
283
+ const id = match.replace('ID_PLACEHOLDER_', '');
284
+ const placeholder = `ng-icon-${this.uniqueId}-${idMap.size}`;
285
+ idMap.set(id, placeholder);
286
+ svg = svg.replace(new RegExp(match, 'g'), placeholder);
287
+ }
288
+ return svg;
213
289
  }
214
- _updateSvgIcon() {
215
- const [namespace, iconName] = this._splitIconName(this.svgIcon());
216
- this._iconRegistry
217
- .getSvgIconFromName(iconName, namespace)
218
- .pipe(take(1))
219
- .subscribe((svg) => this._setSvgElement(svg));
220
- }
221
- _setSvgElement(svg) {
222
- this._clearSvgElements();
223
- this._elementRef.nativeElement.appendChild(svg);
224
- }
225
- _clearSvgElements() {
226
- const layoutElement = this._elementRef.nativeElement;
227
- let childCount = layoutElement.childNodes.length;
228
- while (childCount--) {
229
- const child = layoutElement.childNodes[childCount];
230
- if (child.nodeType !== 1 || child.nodeName.toLowerCase() === 'svg') {
231
- child.remove();
290
+ /**
291
+ * Request the icon from the loader.
292
+ * @param name The name of the icon to load.
293
+ * @returns The SVG content for a given icon name.
294
+ */
295
+ requestIconFromLoader(name) {
296
+ const coerceLoaderResult = (result) => {
297
+ if (typeof result === 'string') {
298
+ return Promise.resolve(result);
232
299
  }
233
- }
300
+ if (isObservable(result)) {
301
+ // toPromise is deprecated, but we can't use lastValueFrom because it's not available in RxJS 6
302
+ // so for now we'll just use toPromise
303
+ return firstValueFrom(result);
304
+ }
305
+ return result;
306
+ };
307
+ return new Promise((resolve) => {
308
+ runInInjectionContext(this.injector, async () => {
309
+ // if we have a cache, check if the icon is already loaded (i.e, it is a string)
310
+ if (this.cache) {
311
+ const cachedResult = this.cache.get(name);
312
+ if (typeof cachedResult === 'string') {
313
+ resolve(cachedResult);
314
+ return;
315
+ }
316
+ // it may be a promise, so we need to await it
317
+ if (cachedResult instanceof Promise) {
318
+ const result = await cachedResult;
319
+ resolve(result);
320
+ return;
321
+ }
322
+ }
323
+ const promise = coerceLoaderResult(this.loader(name));
324
+ // store the promise in the cache so if we get repeated calls (e.g. in a loop) before the loader has resolved
325
+ // then don't call the loader function multiple times
326
+ this.cache?.set(name, promise);
327
+ // await the result of the promise
328
+ const result = await promise;
329
+ // if we have a cache, store the result
330
+ this.cache?.set(name, result);
331
+ resolve(result);
332
+ });
333
+ });
234
334
  }
235
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IconComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
236
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.4", type: IconComponent, isStandalone: true, selector: "flowbite-icon", inputs: { svgIcon: { classPropertyName: "svgIcon", publicName: "svgIcon", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { svgIcon: "svgIconChange" }, usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
335
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
336
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.6", type: Icon, isStandalone: true, selector: "flowbite-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, svg: { classPropertyName: "svg", publicName: "svg", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, customTheme: { classPropertyName: "customTheme", publicName: "customTheme", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "class": "theme().host.root" } }, providers: [provideFlowbiteIconState()], exportAs: ["flowbiteIcon"], ngImport: i0, template: ``, isInline: true, styles: [":host{display:inline-block;line-height:initial;vertical-align:initial;overflow:hidden}\n", ":host ::ng-deep svg{width:inherit;height:inherit;vertical-align:inherit}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
237
337
  }
238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: IconComponent, decorators: [{
338
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: Icon, decorators: [{
239
339
  type: Component,
240
- args: [{
241
- standalone: true,
242
- selector: 'flowbite-icon',
243
- template: `<ng-content />`,
244
- encapsulation: ViewEncapsulation.None,
245
- changeDetection: ChangeDetectionStrategy.OnPush,
246
- }]
247
- }] });
340
+ args: [{ standalone: true, selector: `flowbite-icon`, exportAs: 'flowbiteIcon', hostDirectives: [], imports: [], providers: [provideFlowbiteIconState()], host: {
341
+ '[class]': `theme().host.root`,
342
+ role: 'img',
343
+ }, template: ``, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-block;line-height:initial;vertical-align:initial;overflow:hidden}\n", ":host ::ng-deep svg{width:inherit;height:inherit;vertical-align:inherit}\n"] }]
344
+ }], ctorParameters: () => [] });
345
+
346
+ /* Icon */
248
347
 
249
348
  /**
250
349
  * Generated bundle index. Do not edit.
251
350
  */
252
351
 
253
- export { IconComponent, IconRegistry, SvgIconConfig, getSvgIconFailedToSanitizeRawError, getSvgIconFailedToSanitizeUrlError, getSvgIconFromNamedError, getSvgIconNoHttpClientProvidedError, trustedHTMLFromString };
352
+ export { FlowbiteIconConfigToken, FlowbiteIconStateToken, Icon, NgIconPostProcessorToken, NgIconPreProcessorToken, defaultFlowbiteIconConfig, flowbiteIconState, flowbiteIconTheme, injectFlowbiteIconConfig, injectFlowbiteIconState, injectNgIconPostProcessor, injectNgIconPreProcessor, provideFlowbiteIconConfig, provideFlowbiteIconState };
254
353
  //# sourceMappingURL=flowbite-angular-icon.mjs.map