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.
- package/README.md +30 -39
- package/accordion/index.d.ts +569 -16
- package/alert/index.d.ts +602 -4
- package/badge/index.d.ts +636 -4
- package/breadcrumb/index.d.ts +452 -8
- package/button/index.d.ts +335 -4
- package/button-group/README.md +4 -0
- package/button-group/index.d.ts +85 -0
- package/{core → card}/README.md +2 -2
- package/card/index.d.ts +640 -0
- package/{accordion → clipboard}/README.md +2 -2
- package/clipboard/index.d.ts +103 -0
- package/dropdown/index.d.ts +536 -16
- package/fesm2022/flowbite-angular-accordion.mjs +339 -479
- package/fesm2022/flowbite-angular-accordion.mjs.map +1 -1
- package/fesm2022/flowbite-angular-alert.mjs +308 -240
- package/fesm2022/flowbite-angular-alert.mjs.map +1 -1
- package/fesm2022/flowbite-angular-badge.mjs +332 -238
- package/fesm2022/flowbite-angular-badge.mjs.map +1 -1
- package/fesm2022/flowbite-angular-breadcrumb.mjs +262 -191
- package/fesm2022/flowbite-angular-breadcrumb.mjs.map +1 -1
- package/fesm2022/flowbite-angular-button-group.mjs +86 -0
- package/fesm2022/flowbite-angular-button-group.mjs.map +1 -0
- package/fesm2022/flowbite-angular-button.mjs +189 -270
- package/fesm2022/flowbite-angular-button.mjs.map +1 -1
- package/fesm2022/flowbite-angular-card.mjs +344 -0
- package/fesm2022/flowbite-angular-card.mjs.map +1 -0
- package/fesm2022/flowbite-angular-clipboard.mjs +174 -0
- package/fesm2022/flowbite-angular-clipboard.mjs.map +1 -0
- package/fesm2022/flowbite-angular-dropdown.mjs +272 -459
- package/fesm2022/flowbite-angular-dropdown.mjs.map +1 -1
- package/fesm2022/flowbite-angular-form.mjs +444 -0
- package/fesm2022/flowbite-angular-form.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-brand.mjs +71 -0
- package/fesm2022/flowbite-angular-icon-brand.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-arrows.mjs +51 -0
- package/fesm2022/flowbite-angular-icon-outline-arrows.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-e-commerce.mjs +23 -0
- package/fesm2022/flowbite-angular-icon-outline-e-commerce.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-emoji.mjs +13 -0
- package/fesm2022/flowbite-angular-icon-outline-emoji.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-files-folders.mjs +42 -0
- package/fesm2022/flowbite-angular-icon-outline-files-folders.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-general.mjs +145 -0
- package/fesm2022/flowbite-angular-icon-outline-general.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-media.mjs +25 -0
- package/fesm2022/flowbite-angular-icon-outline-media.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-text.mjs +20 -0
- package/fesm2022/flowbite-angular-icon-outline-text.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-user.mjs +17 -0
- package/fesm2022/flowbite-angular-icon-outline-user.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline-weather.mjs +9 -0
- package/fesm2022/flowbite-angular-icon-outline-weather.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-outline.mjs +6 -0
- package/fesm2022/flowbite-angular-icon-outline.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-arrows.mjs +17 -0
- package/fesm2022/flowbite-angular-icon-solid-arrows.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-brands.mjs +33 -0
- package/fesm2022/flowbite-angular-icon-solid-brands.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-e-commerce.mjs +21 -0
- package/fesm2022/flowbite-angular-icon-solid-e-commerce.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-emoji.mjs +13 -0
- package/fesm2022/flowbite-angular-icon-solid-emoji.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-files-folder.mjs +42 -0
- package/fesm2022/flowbite-angular-icon-solid-files-folder.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-general.mjs +123 -0
- package/fesm2022/flowbite-angular-icon-solid-general.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-media.mjs +24 -0
- package/fesm2022/flowbite-angular-icon-solid-media.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-text.mjs +11 -0
- package/fesm2022/flowbite-angular-icon-solid-text.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-user.mjs +17 -0
- package/fesm2022/flowbite-angular-icon-solid-user.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid-weather.mjs +9 -0
- package/fesm2022/flowbite-angular-icon-solid-weather.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon-solid.mjs +6 -0
- package/fesm2022/flowbite-angular-icon-solid.mjs.map +1 -0
- package/fesm2022/flowbite-angular-icon.mjs +318 -219
- package/fesm2022/flowbite-angular-icon.mjs.map +1 -1
- package/fesm2022/flowbite-angular-indicator.mjs +119 -231
- package/fesm2022/flowbite-angular-indicator.mjs.map +1 -1
- package/fesm2022/flowbite-angular-modal.mjs +337 -486
- package/fesm2022/flowbite-angular-modal.mjs.map +1 -1
- package/fesm2022/flowbite-angular-navbar.mjs +600 -604
- package/fesm2022/flowbite-angular-navbar.mjs.map +1 -1
- package/fesm2022/flowbite-angular-pagination.mjs +994 -0
- package/fesm2022/flowbite-angular-pagination.mjs.map +1 -0
- package/fesm2022/flowbite-angular-sidebar.mjs +400 -776
- package/fesm2022/flowbite-angular-sidebar.mjs.map +1 -1
- package/fesm2022/flowbite-angular-tab.mjs +465 -0
- package/fesm2022/flowbite-angular-tab.mjs.map +1 -0
- package/fesm2022/flowbite-angular-theme-toggle.mjs +263 -0
- package/fesm2022/flowbite-angular-theme-toggle.mjs.map +1 -0
- package/fesm2022/flowbite-angular-tooltip.mjs +117 -0
- package/fesm2022/flowbite-angular-tooltip.mjs.map +1 -0
- package/fesm2022/flowbite-angular.mjs +53 -66
- package/fesm2022/flowbite-angular.mjs.map +1 -1
- package/flowbite-angular.css +2 -0
- package/{alert → form}/README.md +2 -2
- package/form/index.d.ts +684 -0
- package/{breadcrumb → icon/brand}/README.md +2 -2
- package/icon/brand/index.d.ts +66 -0
- package/icon/index.d.ts +322 -5
- package/icon/outline/README.md +4 -0
- package/icon/outline/arrows/index.d.ts +46 -0
- package/icon/outline/e-commerce/index.d.ts +18 -0
- package/icon/outline/emoji/index.d.ts +8 -0
- package/icon/outline/files-folders/index.d.ts +37 -0
- package/icon/outline/general/index.d.ts +140 -0
- package/icon/outline/index.d.ts +2 -0
- package/icon/outline/media/index.d.ts +20 -0
- package/icon/outline/text/index.d.ts +15 -0
- package/icon/outline/user/index.d.ts +12 -0
- package/icon/outline/weather/index.d.ts +4 -0
- package/icon/solid/README.md +4 -0
- package/icon/solid/arrows/index.d.ts +12 -0
- package/icon/solid/brands/index.d.ts +28 -0
- package/icon/solid/e-commerce/index.d.ts +16 -0
- package/icon/solid/emoji/index.d.ts +8 -0
- package/icon/solid/files-folder/index.d.ts +37 -0
- package/icon/solid/general/index.d.ts +118 -0
- package/icon/solid/index.d.ts +2 -0
- package/icon/solid/media/index.d.ts +19 -0
- package/icon/solid/text/index.d.ts +6 -0
- package/icon/solid/user/index.d.ts +12 -0
- package/icon/solid/weather/index.d.ts +4 -0
- package/index.d.ts +126 -3
- package/indicator/index.d.ts +242 -4
- package/modal/index.d.ts +458 -16
- package/navbar/index.d.ts +1467 -24
- package/package.json +133 -38
- package/pagination/README.md +4 -0
- package/pagination/index.d.ts +1135 -0
- package/sidebar/index.d.ts +880 -24
- package/styles/flowbite-angular.css +8 -0
- package/styles/part/animation.css +0 -0
- package/styles/part/color.css +125 -0
- package/styles/part/font-size.css +67 -0
- package/styles/part/rounded.css +11 -0
- package/styles/part/shadow.css +9 -0
- package/styles/part/spacing.css +38 -0
- package/{badge → tab}/README.md +2 -2
- package/tab/index.d.ts +791 -0
- package/theme-toggle/README.md +4 -0
- package/theme-toggle/index.d.ts +342 -0
- package/{button → tooltip}/README.md +2 -2
- package/tooltip/index.d.ts +158 -0
- package/accordion/accordion-content.component.d.ts +0 -69
- package/accordion/accordion-content.theme.d.ts +0 -28
- package/accordion/accordion-content.theme.service.d.ts +0 -19
- package/accordion/accordion-panel.component.d.ts +0 -67
- package/accordion/accordion-panel.theme.d.ts +0 -23
- package/accordion/accordion-panel.theme.service.d.ts +0 -20
- package/accordion/accordion-title.component.d.ts +0 -106
- package/accordion/accordion-title.theme.d.ts +0 -35
- package/accordion/accordion-title.theme.service.d.ts +0 -19
- package/accordion/accordion.component.d.ts +0 -61
- package/accordion/accordion.theme.d.ts +0 -29
- package/accordion/accordion.theme.service.d.ts +0 -19
- package/alert/alert.component.d.ts +0 -150
- package/alert/alert.theme.d.ts +0 -39
- package/alert/alert.theme.service.d.ts +0 -19
- package/badge/badge.component.d.ts +0 -196
- package/badge/badge.theme.d.ts +0 -53
- package/badge/badge.theme.service.d.ts +0 -19
- package/base-component.directive.d.ts +0 -51
- package/breadcrumb/breadcrumb-item.component.d.ts +0 -84
- package/breadcrumb/breadcrumb-item.theme.d.ts +0 -33
- package/breadcrumb/breadcrumb-item.theme.service.d.ts +0 -19
- package/breadcrumb/breadcrumb.component.d.ts +0 -43
- package/breadcrumb/breadcrumb.theme.d.ts +0 -29
- package/breadcrumb/breadcrumb.theme.service.d.ts +0 -19
- package/button/button.component.d.ts +0 -250
- package/button/button.theme.d.ts +0 -79
- package/button/button.theme.service.d.ts +0 -19
- package/core/flowbite.theme.init.d.ts +0 -9
- package/core/index.d.ts +0 -1
- package/dark-theme-toggle/README.md +0 -4
- package/dark-theme-toggle/dark-theme-toggle.component.d.ts +0 -51
- package/dark-theme-toggle/dark-theme-toggle.theme.d.ts +0 -23
- package/dark-theme-toggle/dark-theme-toggle.theme.service.d.ts +0 -19
- package/dark-theme-toggle/index.d.ts +0 -3
- package/dropdown/README.md +0 -4
- package/dropdown/dropdown-divider.component.d.ts +0 -36
- package/dropdown/dropdown-divider.theme.d.ts +0 -23
- package/dropdown/dropdown-divider.theme.service.d.ts +0 -19
- package/dropdown/dropdown-header.component.d.ts +0 -42
- package/dropdown/dropdown-header.theme.d.ts +0 -28
- package/dropdown/dropdown-header.theme.service.d.ts +0 -19
- package/dropdown/dropdown-item.component.d.ts +0 -36
- package/dropdown/dropdown-item.theme.d.ts +0 -23
- package/dropdown/dropdown-item.theme.service.d.ts +0 -19
- package/dropdown/dropdown.component.d.ts +0 -136
- package/dropdown/dropdown.theme.d.ts +0 -56
- package/dropdown/dropdown.theme.service.d.ts +0 -19
- package/fesm2022/flowbite-angular-core.mjs +0 -322
- package/fesm2022/flowbite-angular-core.mjs.map +0 -1
- package/fesm2022/flowbite-angular-dark-theme-toggle.mjs +0 -139
- package/fesm2022/flowbite-angular-dark-theme-toggle.mjs.map +0 -1
- package/fesm2022/flowbite-angular-router-link-active.mjs +0 -68
- package/fesm2022/flowbite-angular-router-link-active.mjs.map +0 -1
- package/fesm2022/flowbite-angular-router-link.mjs +0 -73
- package/fesm2022/flowbite-angular-router-link.mjs.map +0 -1
- package/fesm2022/flowbite-angular-sanitize-html.mjs +0 -39
- package/fesm2022/flowbite-angular-sanitize-html.mjs.map +0 -1
- package/fesm2022/flowbite-angular-scroll-top.mjs +0 -193
- package/fesm2022/flowbite-angular-scroll-top.mjs.map +0 -1
- package/fesm2022/flowbite-angular-theme.mjs +0 -78
- package/fesm2022/flowbite-angular-theme.mjs.map +0 -1
- package/fesm2022/flowbite-angular-utils.mjs +0 -210
- package/fesm2022/flowbite-angular-utils.mjs.map +0 -1
- package/flowbite.theme.service.d.ts +0 -12
- package/icon/icon-registry.d.ts +0 -45
- package/icon/icon.component.d.ts +0 -22
- package/icon/trusted-types.d.ts +0 -15
- package/indicator/indicators.component.d.ts +0 -224
- package/indicator/indicators.theme.d.ts +0 -59
- package/indicator/indicators.theme.service.d.ts +0 -19
- package/modal/modal-body.component.d.ts +0 -36
- package/modal/modal-body.theme.d.ts +0 -23
- package/modal/modal-body.theme.service.d.ts +0 -19
- package/modal/modal-footer.component.d.ts +0 -36
- package/modal/modal-footer.theme.d.ts +0 -23
- package/modal/modal-footer.theme.service.d.ts +0 -19
- package/modal/modal-header.component.d.ts +0 -60
- package/modal/modal-header.theme.d.ts +0 -32
- package/modal/modal-header.theme.service.d.ts +0 -19
- package/modal/modal.component.d.ts +0 -146
- package/modal/modal.theme.d.ts +0 -35
- package/modal/modal.theme.service.d.ts +0 -19
- package/navbar/navbar-brand.component.d.ts +0 -36
- package/navbar/navbar-brand.theme.d.ts +0 -23
- package/navbar/navbar-brand.theme.service.d.ts +0 -19
- package/navbar/navbar-content.component.d.ts +0 -50
- package/navbar/navbar-content.theme.d.ts +0 -28
- package/navbar/navbar-content.theme.service.d.ts +0 -19
- package/navbar/navbar-icon-button.component.d.ts +0 -59
- package/navbar/navbar-icon-button.theme.d.ts +0 -26
- package/navbar/navbar-icon-button.theme.service.d.ts +0 -19
- package/navbar/navbar-item.component.d.ts +0 -67
- package/navbar/navbar-item.theme.d.ts +0 -26
- package/navbar/navbar-item.theme.service.d.ts +0 -19
- package/navbar/navbar-toggle.component.d.ts +0 -51
- package/navbar/navbar-toggle.theme.d.ts +0 -23
- package/navbar/navbar-toggle.theme.service.d.ts +0 -19
- package/navbar/navbar.component.d.ts +0 -121
- package/navbar/navbar.theme.d.ts +0 -21
- package/navbar/navbar.theme.service.d.ts +0 -19
- package/router-link/README.md +0 -4
- package/router-link/flowbite-router-link.directive.d.ts +0 -28
- package/router-link/index.d.ts +0 -1
- package/router-link-active/README.md +0 -4
- package/router-link-active/flowbite-router-link-active.directive.d.ts +0 -37
- package/router-link-active/index.d.ts +0 -1
- package/sanitize-html/README.md +0 -4
- package/sanitize-html/index.d.ts +0 -1
- package/sanitize-html/sanitize-html.pipe.d.ts +0 -20
- package/scroll-top/README.md +0 -4
- package/scroll-top/index.d.ts +0 -4
- package/scroll-top/scroll-top.component.d.ts +0 -114
- package/scroll-top/scroll-top.theme.d.ts +0 -39
- package/scroll-top/scroll-top.theme.service.d.ts +0 -19
- package/sidebar/sidebar-item-group.component.d.ts +0 -100
- package/sidebar/sidebar-item-group.theme.d.ts +0 -31
- package/sidebar/sidebar-item-group.theme.service.d.ts +0 -19
- package/sidebar/sidebar-item.component.d.ts +0 -101
- package/sidebar/sidebar-item.theme.d.ts +0 -33
- package/sidebar/sidebar-item.theme.service.d.ts +0 -19
- package/sidebar/sidebar-menu.component.d.ts +0 -93
- package/sidebar/sidebar-menu.theme.d.ts +0 -30
- package/sidebar/sidebar-menu.theme.service.d.ts +0 -19
- package/sidebar/sidebar-page-content.component.d.ts +0 -46
- package/sidebar/sidebar-page-content.theme.d.ts +0 -27
- package/sidebar/sidebar-page-content.theme.service.d.ts +0 -19
- package/sidebar/sidebar-toggle.component.d.ts +0 -95
- package/sidebar/sidebar-toggle.theme.d.ts +0 -34
- package/sidebar/sidebar-toggle.theme.service.d.ts +0 -19
- package/sidebar/sidebar.component.d.ts +0 -84
- package/sidebar/sidebar.theme.d.ts +0 -22
- package/sidebar/sidebar.theme.service.d.ts +0 -19
- package/tailwind.config.js +0 -303
- package/theme/README.md +0 -4
- package/theme/flowbite-theme.directive.d.ts +0 -36
- package/theme/index.d.ts +0 -1
- package/type-definitions/colors/flowbite.colors.d.ts +0 -19
- package/type-definitions/colors/flowbite.gradient-colors.d.ts +0 -11
- package/type-definitions/colors/flowbite.gradient-duo-tone-colors.d.ts +0 -12
- package/type-definitions/colors/index.d.ts +0 -3
- package/type-definitions/flowbite.boolean.d.ts +0 -14
- package/type-definitions/flowbite.class.d.ts +0 -6
- package/type-definitions/flowbite.combination.d.ts +0 -8
- package/type-definitions/flowbite.content-positions.d.ts +0 -6
- package/type-definitions/flowbite.deep-partial.d.ts +0 -6
- package/type-definitions/flowbite.heading-levels.d.ts +0 -4
- package/type-definitions/flowbite.positions.d.ts +0 -14
- package/type-definitions/flowbite.router-link-parameter.d.ts +0 -5
- package/type-definitions/flowbite.sizes.d.ts +0 -10
- package/type-definitions/flowbite.themes.d.ts +0 -4
- package/type-definitions/index.d.ts +0 -12
- package/utils/README.md +0 -4
- package/utils/icon.list.d.ts +0 -7
- package/utils/id.generator.d.ts +0 -59
- package/utils/index.d.ts +0 -8
- package/utils/theme/clone-deep.d.ts +0 -7
- package/utils/theme/create-class.d.ts +0 -7
- package/utils/theme/create-theme.d.ts +0 -7
- package/utils/theme/is-object.d.ts +0 -7
- package/utils/theme/merge-theme.d.ts +0 -8
- 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 @@
|
|
|
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 {
|
|
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,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
-
*
|
|
102
|
+
* Provide the default Icon configuration
|
|
103
|
+
* @param config The Icon configuration
|
|
104
|
+
* @returns The provider
|
|
11
105
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
*
|
|
113
|
+
* Inject the Icon configuration
|
|
114
|
+
* @see {@link defaultFlowbiteIconConfig}
|
|
115
|
+
* @returns The configuration
|
|
32
116
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
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.
|
|
56
|
-
|
|
57
|
-
this.
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
|
|
61
|
-
this.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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.
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
112
|
-
return
|
|
205
|
+
if (name === undefined) {
|
|
206
|
+
return;
|
|
113
207
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
163
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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: "
|
|
236
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
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: "
|
|
338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: Icon, decorators: [{
|
|
239
339
|
type: Component,
|
|
240
|
-
args: [{
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
template:
|
|
244
|
-
|
|
245
|
-
|
|
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 {
|
|
352
|
+
export { FlowbiteIconConfigToken, FlowbiteIconStateToken, Icon, NgIconPostProcessorToken, NgIconPreProcessorToken, defaultFlowbiteIconConfig, flowbiteIconState, flowbiteIconTheme, injectFlowbiteIconConfig, injectFlowbiteIconState, injectNgIconPostProcessor, injectNgIconPreProcessor, provideFlowbiteIconConfig, provideFlowbiteIconState };
|
|
254
353
|
//# sourceMappingURL=flowbite-angular-icon.mjs.map
|