@elurjs/ionic 2.0.7
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/CHANGELOG.md +272 -0
- package/MIGRATION.md +221 -0
- package/README.md +695 -0
- package/dist/lib/IonRouterOutlet.d.ts +134 -0
- package/dist/lib/__tests__/IonRouterOutlet.test.d.ts +1 -0
- package/dist/lib/__tests__/bundles.test.d.ts +1 -0
- package/dist/lib/__tests__/cache-policy.test.d.ts +1 -0
- package/dist/lib/__tests__/capacitor.test.d.ts +1 -0
- package/dist/lib/__tests__/components.test.d.ts +1 -0
- package/dist/lib/__tests__/lifecycle.test.d.ts +1 -0
- package/dist/lib/__tests__/mocks/ionic.d.ts +61 -0
- package/dist/lib/__tests__/navigation.test.d.ts +1 -0
- package/dist/lib/__tests__/overlays.test.d.ts +1 -0
- package/dist/lib/__tests__/page-state.test.d.ts +1 -0
- package/dist/lib/__tests__/phase0-bugs.test.d.ts +1 -0
- package/dist/lib/__tests__/setup.d.ts +1 -0
- package/dist/lib/__tests__/setup.test.d.ts +1 -0
- package/dist/lib/__tests__/tabs.test.d.ts +1 -0
- package/dist/lib/__tests__/vite-plugin.test.d.ts +1 -0
- package/dist/lib/bundles/all.cjs +2 -0
- package/dist/lib/bundles/all.cjs.map +1 -0
- package/dist/lib/bundles/all.d.ts +16 -0
- package/dist/lib/bundles/all.js +21 -0
- package/dist/lib/bundles/all.js.map +1 -0
- package/dist/lib/bundles/buttons.cjs +2 -0
- package/dist/lib/bundles/buttons.cjs.map +1 -0
- package/dist/lib/bundles/buttons.d.ts +7 -0
- package/dist/lib/bundles/buttons.js +17 -0
- package/dist/lib/bundles/buttons.js.map +1 -0
- package/dist/lib/bundles/feedback.cjs +2 -0
- package/dist/lib/bundles/feedback.cjs.map +1 -0
- package/dist/lib/bundles/feedback.d.ts +8 -0
- package/dist/lib/bundles/feedback.js +19 -0
- package/dist/lib/bundles/feedback.js.map +1 -0
- package/dist/lib/bundles/forms.cjs +2 -0
- package/dist/lib/bundles/forms.cjs.map +1 -0
- package/dist/lib/bundles/forms.d.ts +11 -0
- package/dist/lib/bundles/forms.js +47 -0
- package/dist/lib/bundles/forms.js.map +1 -0
- package/dist/lib/bundles/layout.cjs +2 -0
- package/dist/lib/bundles/layout.cjs.map +1 -0
- package/dist/lib/bundles/layout.d.ts +9 -0
- package/dist/lib/bundles/layout.js +33 -0
- package/dist/lib/bundles/layout.js.map +1 -0
- package/dist/lib/bundles/lists.cjs +2 -0
- package/dist/lib/bundles/lists.cjs.map +1 -0
- package/dist/lib/bundles/lists.d.ts +15 -0
- package/dist/lib/bundles/lists.js +65 -0
- package/dist/lib/bundles/lists.js.map +1 -0
- package/dist/lib/bundles/navigation.cjs +2 -0
- package/dist/lib/bundles/navigation.cjs.map +1 -0
- package/dist/lib/bundles/navigation.d.ts +9 -0
- package/dist/lib/bundles/navigation.js +29 -0
- package/dist/lib/bundles/navigation.js.map +1 -0
- package/dist/lib/bundles/overlays.cjs +2 -0
- package/dist/lib/bundles/overlays.cjs.map +1 -0
- package/dist/lib/bundles/overlays.d.ts +9 -0
- package/dist/lib/bundles/overlays.js +25 -0
- package/dist/lib/bundles/overlays.js.map +1 -0
- package/dist/lib/capacitor.cjs +2 -0
- package/dist/lib/capacitor.cjs.map +1 -0
- package/dist/lib/capacitor.d.ts +217 -0
- package/dist/lib/capacitor.js +223 -0
- package/dist/lib/capacitor.js.map +1 -0
- package/dist/lib/components/accordion-group.cjs +1 -0
- package/dist/lib/components/accordion-group.d.ts +11 -0
- package/dist/lib/components/accordion-group.js +2 -0
- package/dist/lib/components/accordion.cjs +1 -0
- package/dist/lib/components/accordion.d.ts +11 -0
- package/dist/lib/components/accordion.js +2 -0
- package/dist/lib/components/action-sheet.cjs +1 -0
- package/dist/lib/components/action-sheet.d.ts +11 -0
- package/dist/lib/components/action-sheet.js +2 -0
- package/dist/lib/components/alert.cjs +1 -0
- package/dist/lib/components/alert.d.ts +11 -0
- package/dist/lib/components/alert.js +2 -0
- package/dist/lib/components/avatar.cjs +1 -0
- package/dist/lib/components/avatar.d.ts +11 -0
- package/dist/lib/components/avatar.js +2 -0
- package/dist/lib/components/backdrop.cjs +1 -0
- package/dist/lib/components/backdrop.d.ts +11 -0
- package/dist/lib/components/backdrop.js +2 -0
- package/dist/lib/components/badge.cjs +1 -0
- package/dist/lib/components/badge.d.ts +11 -0
- package/dist/lib/components/badge.js +2 -0
- package/dist/lib/components/breadcrumb.cjs +1 -0
- package/dist/lib/components/breadcrumb.d.ts +11 -0
- package/dist/lib/components/breadcrumb.js +2 -0
- package/dist/lib/components/breadcrumbs.cjs +1 -0
- package/dist/lib/components/breadcrumbs.d.ts +11 -0
- package/dist/lib/components/breadcrumbs.js +2 -0
- package/dist/lib/components/button.cjs +1 -0
- package/dist/lib/components/button.d.ts +11 -0
- package/dist/lib/components/button.js +2 -0
- package/dist/lib/components/buttons.cjs +1 -0
- package/dist/lib/components/buttons.d.ts +11 -0
- package/dist/lib/components/buttons.js +2 -0
- package/dist/lib/components/card-content.cjs +1 -0
- package/dist/lib/components/card-content.d.ts +11 -0
- package/dist/lib/components/card-content.js +2 -0
- package/dist/lib/components/card-header.cjs +1 -0
- package/dist/lib/components/card-header.d.ts +11 -0
- package/dist/lib/components/card-header.js +2 -0
- package/dist/lib/components/card-subtitle.cjs +1 -0
- package/dist/lib/components/card-subtitle.d.ts +11 -0
- package/dist/lib/components/card-subtitle.js +2 -0
- package/dist/lib/components/card-title.cjs +1 -0
- package/dist/lib/components/card-title.d.ts +11 -0
- package/dist/lib/components/card-title.js +2 -0
- package/dist/lib/components/card.cjs +1 -0
- package/dist/lib/components/card.d.ts +11 -0
- package/dist/lib/components/card.js +2 -0
- package/dist/lib/components/checkbox.cjs +1 -0
- package/dist/lib/components/checkbox.d.ts +11 -0
- package/dist/lib/components/checkbox.js +2 -0
- package/dist/lib/components/chip.cjs +1 -0
- package/dist/lib/components/chip.d.ts +11 -0
- package/dist/lib/components/chip.js +2 -0
- package/dist/lib/components/col.cjs +1 -0
- package/dist/lib/components/col.d.ts +11 -0
- package/dist/lib/components/col.js +2 -0
- package/dist/lib/components/content.cjs +1 -0
- package/dist/lib/components/content.d.ts +11 -0
- package/dist/lib/components/content.js +2 -0
- package/dist/lib/components/datetime-button.cjs +1 -0
- package/dist/lib/components/datetime-button.d.ts +11 -0
- package/dist/lib/components/datetime-button.js +2 -0
- package/dist/lib/components/datetime.cjs +1 -0
- package/dist/lib/components/datetime.d.ts +11 -0
- package/dist/lib/components/datetime.js +2 -0
- package/dist/lib/components/fab-button.cjs +1 -0
- package/dist/lib/components/fab-button.d.ts +11 -0
- package/dist/lib/components/fab-button.js +2 -0
- package/dist/lib/components/fab-list.cjs +1 -0
- package/dist/lib/components/fab-list.d.ts +11 -0
- package/dist/lib/components/fab-list.js +2 -0
- package/dist/lib/components/fab.cjs +1 -0
- package/dist/lib/components/fab.d.ts +11 -0
- package/dist/lib/components/fab.js +2 -0
- package/dist/lib/components/footer.cjs +1 -0
- package/dist/lib/components/footer.d.ts +11 -0
- package/dist/lib/components/footer.js +2 -0
- package/dist/lib/components/grid.cjs +1 -0
- package/dist/lib/components/grid.d.ts +11 -0
- package/dist/lib/components/grid.js +2 -0
- package/dist/lib/components/header.cjs +1 -0
- package/dist/lib/components/header.d.ts +11 -0
- package/dist/lib/components/header.js +2 -0
- package/dist/lib/components/img.cjs +1 -0
- package/dist/lib/components/img.d.ts +11 -0
- package/dist/lib/components/img.js +2 -0
- package/dist/lib/components/infinite-scroll-content.cjs +1 -0
- package/dist/lib/components/infinite-scroll-content.d.ts +11 -0
- package/dist/lib/components/infinite-scroll-content.js +2 -0
- package/dist/lib/components/infinite-scroll.cjs +1 -0
- package/dist/lib/components/infinite-scroll.d.ts +11 -0
- package/dist/lib/components/infinite-scroll.js +2 -0
- package/dist/lib/components/input-otp.cjs +1 -0
- package/dist/lib/components/input-otp.d.ts +11 -0
- package/dist/lib/components/input-otp.js +2 -0
- package/dist/lib/components/input-password-toggle.cjs +1 -0
- package/dist/lib/components/input-password-toggle.d.ts +11 -0
- package/dist/lib/components/input-password-toggle.js +2 -0
- package/dist/lib/components/input.cjs +1 -0
- package/dist/lib/components/input.d.ts +11 -0
- package/dist/lib/components/input.js +2 -0
- package/dist/lib/components/item-divider.cjs +1 -0
- package/dist/lib/components/item-divider.d.ts +11 -0
- package/dist/lib/components/item-divider.js +2 -0
- package/dist/lib/components/item-group.cjs +1 -0
- package/dist/lib/components/item-group.d.ts +11 -0
- package/dist/lib/components/item-group.js +2 -0
- package/dist/lib/components/item-option.cjs +1 -0
- package/dist/lib/components/item-option.d.ts +11 -0
- package/dist/lib/components/item-option.js +2 -0
- package/dist/lib/components/item-options.cjs +1 -0
- package/dist/lib/components/item-options.d.ts +11 -0
- package/dist/lib/components/item-options.js +2 -0
- package/dist/lib/components/item-sliding.cjs +1 -0
- package/dist/lib/components/item-sliding.d.ts +11 -0
- package/dist/lib/components/item-sliding.js +2 -0
- package/dist/lib/components/item.cjs +1 -0
- package/dist/lib/components/item.d.ts +11 -0
- package/dist/lib/components/item.js +2 -0
- package/dist/lib/components/label.cjs +1 -0
- package/dist/lib/components/label.d.ts +11 -0
- package/dist/lib/components/label.js +2 -0
- package/dist/lib/components/list-header.cjs +1 -0
- package/dist/lib/components/list-header.d.ts +11 -0
- package/dist/lib/components/list-header.js +2 -0
- package/dist/lib/components/list.cjs +1 -0
- package/dist/lib/components/list.d.ts +11 -0
- package/dist/lib/components/list.js +2 -0
- package/dist/lib/components/loading.cjs +1 -0
- package/dist/lib/components/loading.d.ts +11 -0
- package/dist/lib/components/loading.js +2 -0
- package/dist/lib/components/manifest.cjs +2 -0
- package/dist/lib/components/manifest.cjs.map +1 -0
- package/dist/lib/components/manifest.d.ts +43 -0
- package/dist/lib/components/manifest.js +647 -0
- package/dist/lib/components/manifest.js.map +1 -0
- package/dist/lib/components/menu-button.cjs +1 -0
- package/dist/lib/components/menu-button.d.ts +11 -0
- package/dist/lib/components/menu-button.js +2 -0
- package/dist/lib/components/menu-toggle.cjs +1 -0
- package/dist/lib/components/menu-toggle.d.ts +11 -0
- package/dist/lib/components/menu-toggle.js +2 -0
- package/dist/lib/components/menu.cjs +1 -0
- package/dist/lib/components/menu.d.ts +11 -0
- package/dist/lib/components/menu.js +2 -0
- package/dist/lib/components/modal.cjs +1 -0
- package/dist/lib/components/modal.d.ts +11 -0
- package/dist/lib/components/modal.js +2 -0
- package/dist/lib/components/nav-link.cjs +1 -0
- package/dist/lib/components/nav-link.d.ts +11 -0
- package/dist/lib/components/nav-link.js +2 -0
- package/dist/lib/components/nav.cjs +1 -0
- package/dist/lib/components/nav.d.ts +11 -0
- package/dist/lib/components/nav.js +2 -0
- package/dist/lib/components/note.cjs +1 -0
- package/dist/lib/components/note.d.ts +11 -0
- package/dist/lib/components/note.js +2 -0
- package/dist/lib/components/picker-column-option.cjs +1 -0
- package/dist/lib/components/picker-column-option.d.ts +11 -0
- package/dist/lib/components/picker-column-option.js +2 -0
- package/dist/lib/components/picker-column.cjs +1 -0
- package/dist/lib/components/picker-column.d.ts +11 -0
- package/dist/lib/components/picker-column.js +2 -0
- package/dist/lib/components/picker.cjs +1 -0
- package/dist/lib/components/picker.d.ts +11 -0
- package/dist/lib/components/picker.js +2 -0
- package/dist/lib/components/popover.cjs +1 -0
- package/dist/lib/components/popover.d.ts +11 -0
- package/dist/lib/components/popover.js +2 -0
- package/dist/lib/components/progress-bar.cjs +1 -0
- package/dist/lib/components/progress-bar.d.ts +11 -0
- package/dist/lib/components/progress-bar.js +2 -0
- package/dist/lib/components/radio-group.cjs +1 -0
- package/dist/lib/components/radio-group.d.ts +11 -0
- package/dist/lib/components/radio-group.js +2 -0
- package/dist/lib/components/radio.cjs +1 -0
- package/dist/lib/components/radio.d.ts +11 -0
- package/dist/lib/components/radio.js +2 -0
- package/dist/lib/components/range.cjs +1 -0
- package/dist/lib/components/range.d.ts +11 -0
- package/dist/lib/components/range.js +2 -0
- package/dist/lib/components/refresher-content.cjs +1 -0
- package/dist/lib/components/refresher-content.d.ts +11 -0
- package/dist/lib/components/refresher-content.js +2 -0
- package/dist/lib/components/refresher.cjs +1 -0
- package/dist/lib/components/refresher.d.ts +11 -0
- package/dist/lib/components/refresher.js +2 -0
- package/dist/lib/components/reorder-group.cjs +1 -0
- package/dist/lib/components/reorder-group.d.ts +11 -0
- package/dist/lib/components/reorder-group.js +2 -0
- package/dist/lib/components/reorder.cjs +1 -0
- package/dist/lib/components/reorder.d.ts +11 -0
- package/dist/lib/components/reorder.js +2 -0
- package/dist/lib/components/ripple-effect.cjs +1 -0
- package/dist/lib/components/ripple-effect.d.ts +11 -0
- package/dist/lib/components/ripple-effect.js +2 -0
- package/dist/lib/components/router-link.cjs +1 -0
- package/dist/lib/components/router-link.d.ts +11 -0
- package/dist/lib/components/router-link.js +2 -0
- package/dist/lib/components/row.cjs +1 -0
- package/dist/lib/components/row.d.ts +11 -0
- package/dist/lib/components/row.js +2 -0
- package/dist/lib/components/searchbar.cjs +1 -0
- package/dist/lib/components/searchbar.d.ts +11 -0
- package/dist/lib/components/searchbar.js +2 -0
- package/dist/lib/components/segment-button.cjs +1 -0
- package/dist/lib/components/segment-button.d.ts +11 -0
- package/dist/lib/components/segment-button.js +2 -0
- package/dist/lib/components/segment-content.cjs +1 -0
- package/dist/lib/components/segment-content.d.ts +11 -0
- package/dist/lib/components/segment-content.js +2 -0
- package/dist/lib/components/segment-view.cjs +1 -0
- package/dist/lib/components/segment-view.d.ts +11 -0
- package/dist/lib/components/segment-view.js +2 -0
- package/dist/lib/components/segment.cjs +1 -0
- package/dist/lib/components/segment.d.ts +11 -0
- package/dist/lib/components/segment.js +2 -0
- package/dist/lib/components/select-modal.cjs +1 -0
- package/dist/lib/components/select-modal.d.ts +11 -0
- package/dist/lib/components/select-modal.js +2 -0
- package/dist/lib/components/select-option.cjs +1 -0
- package/dist/lib/components/select-option.d.ts +11 -0
- package/dist/lib/components/select-option.js +2 -0
- package/dist/lib/components/select-popover.cjs +1 -0
- package/dist/lib/components/select-popover.d.ts +11 -0
- package/dist/lib/components/select-popover.js +2 -0
- package/dist/lib/components/select.cjs +1 -0
- package/dist/lib/components/select.d.ts +11 -0
- package/dist/lib/components/select.js +2 -0
- package/dist/lib/components/skeleton-text.cjs +1 -0
- package/dist/lib/components/skeleton-text.d.ts +11 -0
- package/dist/lib/components/skeleton-text.js +2 -0
- package/dist/lib/components/spinner.cjs +1 -0
- package/dist/lib/components/spinner.d.ts +11 -0
- package/dist/lib/components/spinner.js +2 -0
- package/dist/lib/components/split-pane.cjs +1 -0
- package/dist/lib/components/split-pane.d.ts +11 -0
- package/dist/lib/components/split-pane.js +2 -0
- package/dist/lib/components/tab-bar.cjs +1 -0
- package/dist/lib/components/tab-bar.d.ts +11 -0
- package/dist/lib/components/tab-bar.js +2 -0
- package/dist/lib/components/tab-button.cjs +1 -0
- package/dist/lib/components/tab-button.d.ts +11 -0
- package/dist/lib/components/tab-button.js +2 -0
- package/dist/lib/components/tab.cjs +1 -0
- package/dist/lib/components/tab.d.ts +11 -0
- package/dist/lib/components/tab.js +2 -0
- package/dist/lib/components/tabs.cjs +1 -0
- package/dist/lib/components/tabs.d.ts +11 -0
- package/dist/lib/components/tabs.js +2 -0
- package/dist/lib/components/text.cjs +1 -0
- package/dist/lib/components/text.d.ts +11 -0
- package/dist/lib/components/text.js +2 -0
- package/dist/lib/components/textarea.cjs +1 -0
- package/dist/lib/components/textarea.d.ts +11 -0
- package/dist/lib/components/textarea.js +2 -0
- package/dist/lib/components/thumbnail.cjs +1 -0
- package/dist/lib/components/thumbnail.d.ts +11 -0
- package/dist/lib/components/thumbnail.js +2 -0
- package/dist/lib/components/title.cjs +1 -0
- package/dist/lib/components/title.d.ts +11 -0
- package/dist/lib/components/title.js +2 -0
- package/dist/lib/components/toast.cjs +1 -0
- package/dist/lib/components/toast.d.ts +11 -0
- package/dist/lib/components/toast.js +2 -0
- package/dist/lib/components/toggle.cjs +1 -0
- package/dist/lib/components/toggle.d.ts +11 -0
- package/dist/lib/components/toggle.js +2 -0
- package/dist/lib/components/toolbar.cjs +1 -0
- package/dist/lib/components/toolbar.d.ts +11 -0
- package/dist/lib/components/toolbar.js +2 -0
- package/dist/lib/components.cjs +1 -0
- package/dist/lib/components.d.ts +110 -0
- package/dist/lib/components.js +94 -0
- package/dist/lib/definitions-DZ-6I7Fj.js +282 -0
- package/dist/lib/definitions-DZ-6I7Fj.js.map +1 -0
- package/dist/lib/definitions-Lm2GaF-Z.cjs +2 -0
- package/dist/lib/definitions-Lm2GaF-Z.cjs.map +1 -0
- package/dist/lib/elur-ionic.cjs +1 -0
- package/dist/lib/elur-ionic.cjs.map +1 -0
- package/dist/lib/elur-ionic.js +1 -0
- package/dist/lib/elur-ionic.js.map +1 -0
- package/dist/lib/index.d.ts +47 -0
- package/dist/lib/lifecycle.d.ts +62 -0
- package/dist/lib/navigation.cjs +2 -0
- package/dist/lib/navigation.cjs.map +1 -0
- package/dist/lib/navigation.d.ts +214 -0
- package/dist/lib/navigation.js +193 -0
- package/dist/lib/navigation.js.map +1 -0
- package/dist/lib/overlays.cjs +2 -0
- package/dist/lib/overlays.cjs.map +1 -0
- package/dist/lib/overlays.d.ts +400 -0
- package/dist/lib/overlays.js +161 -0
- package/dist/lib/overlays.js.map +1 -0
- package/dist/lib/page-state.cjs +2 -0
- package/dist/lib/page-state.cjs.map +1 -0
- package/dist/lib/page-state.d.ts +160 -0
- package/dist/lib/page-state.js +91 -0
- package/dist/lib/page-state.js.map +1 -0
- package/dist/lib/setup.d.ts +105 -0
- package/dist/lib/tabs-ByPLrzax.cjs +50 -0
- package/dist/lib/tabs-ByPLrzax.cjs.map +1 -0
- package/dist/lib/tabs-DjD1_PTM.js +178 -0
- package/dist/lib/tabs-DjD1_PTM.js.map +1 -0
- package/dist/lib/tabs.cjs +1 -0
- package/dist/lib/tabs.d.ts +83 -0
- package/dist/lib/tabs.js +2 -0
- package/dist/lib/vite-plugin.cjs +39 -0
- package/dist/lib/vite-plugin.cjs.map +1 -0
- package/dist/lib/vite-plugin.d.ts +61 -0
- package/dist/lib/vite-plugin.js +26703 -0
- package/dist/lib/vite-plugin.js.map +1 -0
- package/dist/lib/web-C-maW8Tl.cjs +2 -0
- package/dist/lib/web-C-maW8Tl.cjs.map +1 -0
- package/dist/lib/web-jkqBWgLD.js +56 -0
- package/dist/lib/web-jkqBWgLD.js.map +1 -0
- package/package.json +204 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { ElurComponent as e, effect as t, elurRouter as n, html as r, nextTick as i, ref as a } from "@elurjs/core";
|
|
2
|
+
import { initialize as o } from "@ionic/core/components";
|
|
3
|
+
import { defineCustomElement as s } from "@ionic/core/components/ion-app.js";
|
|
4
|
+
import { defineCustomElement as c } from "@ionic/core/components/ion-router-outlet.js";
|
|
5
|
+
import { defineCustomElement as l } from "@ionic/core/components/ion-back-button.js";
|
|
6
|
+
import { defineCustomElement as u } from "@ionic/core/components/ion-buttons.js";
|
|
7
|
+
import { defineCustomElement as d } from "ionicons/components/ion-icon.js";
|
|
8
|
+
import { addIcons as f, setAssetPath as p } from "ionicons";
|
|
9
|
+
import { arrowBack as m, arrowBackSharp as h, chevronBack as g, chevronBackSharp as _ } from "ionicons/icons";
|
|
10
|
+
//#region src/setup.ts
|
|
11
|
+
var v = [
|
|
12
|
+
s,
|
|
13
|
+
c,
|
|
14
|
+
l,
|
|
15
|
+
u,
|
|
16
|
+
d
|
|
17
|
+
], y = {
|
|
18
|
+
"arrow-back": m,
|
|
19
|
+
"arrow-back-sharp": h,
|
|
20
|
+
"chevron-back": g,
|
|
21
|
+
"chevron-back-sharp": _
|
|
22
|
+
}, b = !1, x = /* @__PURE__ */ new Set();
|
|
23
|
+
function S() {
|
|
24
|
+
return typeof window < "u";
|
|
25
|
+
}
|
|
26
|
+
function C() {
|
|
27
|
+
return typeof customElements < "u";
|
|
28
|
+
}
|
|
29
|
+
function w(e = {}) {
|
|
30
|
+
let t = [];
|
|
31
|
+
if (!S()) return {
|
|
32
|
+
initialized: !1,
|
|
33
|
+
diagnostics: ["SSR: window unavailable, skipping init"]
|
|
34
|
+
};
|
|
35
|
+
if (b) return e.mode && t.push("mode cannot be changed after initialization; ignoring"), {
|
|
36
|
+
initialized: !1,
|
|
37
|
+
diagnostics: t
|
|
38
|
+
};
|
|
39
|
+
let n = e.icons ?? "inline";
|
|
40
|
+
if (n === "inline") p("");
|
|
41
|
+
else if (typeof n == "object" && n.mode === "assets") p(n.path);
|
|
42
|
+
else if (n === "assets") {
|
|
43
|
+
let e = document.baseURI || "/";
|
|
44
|
+
p(new URL("assets/icons/", e).href);
|
|
45
|
+
}
|
|
46
|
+
o();
|
|
47
|
+
for (let e of v) e();
|
|
48
|
+
f(y);
|
|
49
|
+
for (let e of Object.keys(y)) x.add(e);
|
|
50
|
+
return b = !0, {
|
|
51
|
+
initialized: !0,
|
|
52
|
+
diagnostics: t
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function T(...e) {
|
|
56
|
+
if (!C()) {
|
|
57
|
+
S() && console.warn("[elur-ionic] customElements unavailable; cannot register components");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
for (let t of e) try {
|
|
61
|
+
t();
|
|
62
|
+
} catch (e) {
|
|
63
|
+
e instanceof Error && !e.message.includes("already been registered") && console.warn(`[elur-ionic] Component registration error: ${e.message}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function E(e) {
|
|
67
|
+
if (!S()) return;
|
|
68
|
+
let t = {};
|
|
69
|
+
for (let [n, r] of Object.entries(e)) x.has(n) && console.warn(`[elur-ionic] Icon "${n}" already registered; overwriting.`), t[n] = r, x.add(n);
|
|
70
|
+
Object.keys(t).length > 0 && f(t);
|
|
71
|
+
}
|
|
72
|
+
function D(e = {}) {
|
|
73
|
+
if (!S()) return;
|
|
74
|
+
let t = {};
|
|
75
|
+
e.iconAssetPath && (t.icons = {
|
|
76
|
+
mode: "assets",
|
|
77
|
+
path: e.iconAssetPath
|
|
78
|
+
}), w(t), e.components && T(...e.components), e.icons && E(e.icons);
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/tabs.ts
|
|
82
|
+
function O(e) {
|
|
83
|
+
return !e || e === "/" ? "/" : e.endsWith("/") ? e.slice(0, -1) : e;
|
|
84
|
+
}
|
|
85
|
+
function k(e, t) {
|
|
86
|
+
let n = O(t), r = O(e.path);
|
|
87
|
+
return e.exact ? n === r : r === "/" ? n === "/" : n === r || n.startsWith(`${r}/`);
|
|
88
|
+
}
|
|
89
|
+
function A(e, t) {
|
|
90
|
+
if (!t?.length) return !1;
|
|
91
|
+
let n = O(e);
|
|
92
|
+
return t.some((e) => {
|
|
93
|
+
let t = O(e);
|
|
94
|
+
if (t.endsWith("/*")) {
|
|
95
|
+
let e = t.slice(0, -2);
|
|
96
|
+
return n === e || n.startsWith(`${e}/`);
|
|
97
|
+
}
|
|
98
|
+
return n === t;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function j(e) {
|
|
102
|
+
return e ? Object.entries(e).map(([e, t]) => `${e}: ${t}`).join("; ") : "";
|
|
103
|
+
}
|
|
104
|
+
function M(e, o = {}) {
|
|
105
|
+
let s = n(), c = o.slot ?? "bottom", l = o.className ?? "elur-ion-tab-bar", u = o.navigationDirection ?? "none", d = o.layout ?? "icon-top", p = o.cssVars;
|
|
106
|
+
o.icons && f(o.icons);
|
|
107
|
+
let m = a(), h = !1;
|
|
108
|
+
return t(() => {
|
|
109
|
+
let t = s.current.value, n = m.el;
|
|
110
|
+
if (!n) {
|
|
111
|
+
h || i(() => {
|
|
112
|
+
h = !0;
|
|
113
|
+
let t = m.el;
|
|
114
|
+
t && t.querySelectorAll("ion-tab-button").forEach((t, n) => {
|
|
115
|
+
let r = e[n];
|
|
116
|
+
r && (t.selected = k(r, s.current.value));
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
n.querySelectorAll("ion-tab-button").forEach((n, r) => {
|
|
122
|
+
let i = e[r];
|
|
123
|
+
i && (n.selected = k(i, t));
|
|
124
|
+
});
|
|
125
|
+
}), r`
|
|
126
|
+
<ion-tab-bar
|
|
127
|
+
slot=${c}
|
|
128
|
+
class=${l}
|
|
129
|
+
ref=${m}
|
|
130
|
+
style=${() => {
|
|
131
|
+
let e = s.current.value, t = o.hideWhen ? o.hideWhen(e) : A(e, o.hiddenPaths);
|
|
132
|
+
return [j(p), t ? "display:none" : ""].filter(Boolean).join("; ");
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
${e.map((e) => {
|
|
136
|
+
let t = e.path === "/" ? "root" : O(e.path).replace(/^\//, "").replace(/\//g, "-"), n = e.tabId ?? t;
|
|
137
|
+
return r`
|
|
138
|
+
<ion-tab-button
|
|
139
|
+
tab=${n}
|
|
140
|
+
layout=${d}
|
|
141
|
+
@click.prevent.stop=${() => {
|
|
142
|
+
k(e, s.current.value) ? s.replace(e.path, { direction: "none" }) : s.navigate(e.path, { direction: u });
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
${e.icon ? r`
|
|
146
|
+
<ion-icon
|
|
147
|
+
name=${() => k(e, s.current.value) && e.activeIcon ? e.activeIcon : e.icon}
|
|
148
|
+
></ion-icon>
|
|
149
|
+
` : ""}
|
|
150
|
+
<ion-label>${e.label}</ion-label>
|
|
151
|
+
${e.badge == null ? "" : r`<ion-badge color=${e.badgeColor ?? "danger"}>${e.badge}</ion-badge>`}
|
|
152
|
+
</ion-tab-button>
|
|
153
|
+
`;
|
|
154
|
+
})}
|
|
155
|
+
</ion-tab-bar>
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
function N(t, n) {
|
|
159
|
+
F();
|
|
160
|
+
let i = t instanceof e ? t.render() : t;
|
|
161
|
+
return r`
|
|
162
|
+
<ion-tabs>
|
|
163
|
+
${i}
|
|
164
|
+
${n}
|
|
165
|
+
</ion-tabs>
|
|
166
|
+
`;
|
|
167
|
+
}
|
|
168
|
+
var P = !1;
|
|
169
|
+
function F() {
|
|
170
|
+
if (P || typeof document > "u") return;
|
|
171
|
+
P = !0;
|
|
172
|
+
let e = document.createElement("style");
|
|
173
|
+
e.id = "elur-ionic-tabs-layout", e.textContent = "\nion-tabs {\n display: flex !important;\n flex-direction: column !important;\n height: 100% !important;\n width: 100% !important;\n position: relative !important;\n}\nion-tabs > ion-router-outlet {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n position: relative !important;\n top: auto !important;\n bottom: auto !important;\n left: auto !important;\n right: auto !important;\n}\nion-tabs > ion-tab-bar {\n flex-shrink: 0 !important;\n}\n", document.head.appendChild(e);
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { T as a, D as c, w as i, N as n, E as o, f as r, p as s, M as t };
|
|
177
|
+
|
|
178
|
+
//# sourceMappingURL=tabs-DjD1_PTM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs-DjD1_PTM.js","names":[],"sources":["../../src/setup.ts","../../src/tabs.ts"],"sourcesContent":["/**\n * @elurjs/ionic / setup.ts — v2 modular setup\n *\n * Architecture (Elur Ionic 2):\n *\n * initializeElurIonic(options) — configures Ionic Core once; returns a\n * handle with status/diagnostics. Safe to\n * call again (no-op after first init, but\n * validates incompatible config changes).\n *\n * registerIonicComponents(...definers) — incremental & idempotent. Always\n * registers new definers, skips already-\n * registered custom elements. Works for\n * lazy route loading.\n *\n * registerIonicons(map) — incremental with collision diagnostics.\n * Merges new icons into the global set;\n * warns on name collisions.\n *\n * setupElurIonic(options) — backward-compatible facade that calls all\n * three. Existing apps work unchanged.\n *\n * Key changes vs v1.x:\n * - No more `isInitialized` blocking: `registerIonicComponents` and\n * `registerIonicons` are always incremental.\n * - No `unpkg@latest` default asset path: uses official `setAssetPath` from\n * ionicons. CDN is opt-in only.\n * - SSR-safe: no `window` access at module load; guards in each function.\n * - Returns a handle with diagnostics from `initializeElurIonic`.\n */\n\nimport { initialize } from \"@ionic/core/components\";\n\n// Minimal core components — the bare minimum any elur-ionic app needs.\nimport { defineCustomElement as defineIonApp } from \"@ionic/core/components/ion-app.js\";\nimport { defineCustomElement as defineIonRouterOutlet } from \"@ionic/core/components/ion-router-outlet.js\";\nimport { defineCustomElement as defineIonBackButton } from \"@ionic/core/components/ion-back-button.js\";\nimport { defineCustomElement as defineIonButtons } from \"@ionic/core/components/ion-buttons.js\";\n\n// Icons\nimport { defineCustomElement as defineIonIcon } from \"ionicons/components/ion-icon.js\";\nimport { addIcons, setAssetPath } from \"ionicons\";\nimport { arrowBack, arrowBackSharp, chevronBack, chevronBackSharp } from \"ionicons/icons\";\n\nexport type ComponentDefiner = () => void;\nexport type IconDefinitionMap = Record<string, string>;\n\nexport interface SetupElurIonicOptions {\n /** @deprecated Use `icons` mode in `initializeElurIonic` instead. */\n iconAssetPath?: string;\n components?: ComponentDefiner[];\n icons?: IconDefinitionMap;\n}\n\nexport interface InitializeOptions {\n /**\n * Icon asset strategy:\n * - \"inline\" (default): icons are inlined via addIcons; no remote fetch.\n * - \"assets\": use setAssetPath to a local URL; icons fetched on demand.\n * - object with `mode: \"assets\"` and `path` for explicit local path.\n */\n icons?: \"inline\" | \"assets\" | { mode: \"assets\"; path: string };\n /** Ionic mode override: \"ios\" | \"md\" | undefined (auto-detect). */\n mode?: \"ios\" | \"md\";\n}\n\nexport interface SetupHandle {\n /** True if this call performed the initialization; false if already init. */\n readonly initialized: boolean;\n /** Diagnostics collected during initialization. */\n readonly diagnostics: string[];\n}\n\n// --- Internal registry state ---\n\nconst _coreDefiners: ComponentDefiner[] = [\n defineIonApp,\n defineIonRouterOutlet,\n defineIonBackButton,\n defineIonButtons,\n defineIonIcon,\n];\n\nconst _defaultIcons: IconDefinitionMap = {\n \"arrow-back\": arrowBack,\n \"arrow-back-sharp\": arrowBackSharp,\n \"chevron-back\": chevronBack,\n \"chevron-back-sharp\": chevronBackSharp,\n};\n\nlet _initialized = false;\nconst _registeredIconNames = new Set<string>();\n\nfunction _hasWindow(): boolean {\n return typeof window !== \"undefined\";\n}\n\nfunction _hasCustomElements(): boolean {\n return typeof customElements !== \"undefined\";\n}\n\n/**\n * Initialize Ionic Core for Elur. Configures the runtime once.\n *\n * Subsequent calls are no-ops for the core init, but `registerIonicComponents`\n * and `registerIonicons` remain incremental regardless.\n *\n * Returns a handle with diagnostics.\n */\nexport function initializeElurIonic(options: InitializeOptions = {}): SetupHandle {\n const diagnostics: string[] = [];\n\n if (!_hasWindow()) {\n // SSR/prerender: do not touch DOM. Module is import-safe.\n return { initialized: false, diagnostics: [\"SSR: window unavailable, skipping init\"] };\n }\n\n if (_initialized) {\n // Validate incompatible config changes after init.\n if (options.mode) {\n diagnostics.push(\"mode cannot be changed after initialization; ignoring\");\n }\n return { initialized: false, diagnostics };\n }\n\n // Icon asset strategy\n const iconsCfg = options.icons ?? \"inline\";\n if (iconsCfg === \"inline\") {\n // Default: no remote asset path. Icons are inlined via addIcons.\n // setAssetPath to empty string prevents any CDN fetch.\n setAssetPath(\"\");\n } else if (typeof iconsCfg === \"object\" && iconsCfg.mode === \"assets\") {\n setAssetPath(iconsCfg.path);\n } else if (iconsCfg === \"assets\") {\n // \"assets\" mode without explicit path — use a sensible default\n // relative to the document base.\n const base = document.baseURI || \"/\";\n setAssetPath(new URL(\"assets/icons/\", base).href);\n }\n\n // Initialize Ionic Core\n initialize();\n\n // Register minimal core components\n for (const definer of _coreDefiners) {\n definer();\n }\n\n // Register default back icons (used by IonBackButton)\n addIcons(_defaultIcons);\n for (const name of Object.keys(_defaultIcons)) {\n _registeredIconNames.add(name);\n }\n\n _initialized = true;\n\n return { initialized: true, diagnostics };\n}\n\n/**\n * Register additional Ionic custom element definers. Incremental and\n * idempotent — always processes new definers, safe to call from lazy routes.\n *\n * @example\n * ```ts\n * // In a lazy route module:\n * import { defineCustomElement as defineIonDatetime } from \"@ionic/core/components/ion-datetime.js\";\n * registerIonicComponents(defineIonDatetime);\n * ```\n */\nexport function registerIonicComponents(...definers: ComponentDefiner[]): void {\n if (!_hasCustomElements()) {\n if (_hasWindow()) {\n console.warn(\"[elur-ionic] customElements unavailable; cannot register components\");\n }\n return;\n }\n\n for (const definer of definers) {\n try {\n definer();\n } catch (e) {\n // Ionic definers internally guard against double-registration,\n // but we catch just in case.\n if (e instanceof Error && !e.message.includes(\"already been registered\")) {\n console.warn(`[elur-ionic] Component registration error: ${e.message}`);\n }\n }\n }\n}\n\n/**\n * Register additional Ionicons by name → SVG string mapping. Incremental\n * with collision diagnostics.\n *\n * @example\n * ```ts\n * import { registerIonicons } from \"@elurjs/ionic\";\n * import { home, homeOutline } from \"ionicons/icons\";\n *\n * registerIonicons({ home, \"home-outline\": homeOutline });\n * ```\n */\nexport function registerIonicons(map: IconDefinitionMap): void {\n if (!_hasWindow()) {\n return;\n }\n\n const toAdd: IconDefinitionMap = {};\n for (const [name, svg] of Object.entries(map)) {\n if (_registeredIconNames.has(name)) {\n // Overwriting is allowed (addIcons merges), but warn in dev.\n console.warn(`[elur-ionic] Icon \"${name}\" already registered; overwriting.`);\n }\n toAdd[name] = svg;\n _registeredIconNames.add(name);\n }\n\n if (Object.keys(toAdd).length > 0) {\n addIcons(toAdd);\n }\n}\n\n/**\n * Backward-compatible facade. Calls `initializeElurIonic`, then registers\n * any extra components and icons passed via options.\n *\n * Existing v1.x apps work unchanged. New apps should prefer the granular\n * functions (`initializeElurIonic` + `registerIonicComponents` + `registerIonicons`)\n * for lazy loading and HMR support.\n *\n * @deprecated Prefer `initializeElurIonic` + `registerIonicComponents` + `registerIonicons` for new code.\n */\nexport function setupElurIonic(options: SetupElurIonicOptions = {}): void {\n if (!_hasWindow()) return;\n\n // Map old options to new init\n const initOpts: InitializeOptions = {};\n if (options.iconAssetPath) {\n initOpts.icons = { mode: \"assets\", path: options.iconAssetPath };\n }\n\n const handle = initializeElurIonic(initOpts);\n\n // Register extra components (always incremental, even after init)\n if (options.components) {\n registerIonicComponents(...options.components);\n }\n\n // Register extra icons (always incremental, even after init)\n if (options.icons) {\n registerIonicons(options.icons);\n }\n\n void handle;\n}\n\nexport { addIcons, setAssetPath };\n","/**\n * @elurjs/ionic / tabs.ts — v2\n *\n * Bottom tab bar that drives navigation through the core router. The visual\n * \"active\" state is computed from `elurRouter().current` directly.\n *\n * Tab switches are intentionally direction:\"none\" — Ionic's convention is no\n * animation between tabs. Per-tab stacks (configured on IonRouterOutlet via\n * `tabs: [...]`) preserve each tab's deep view across switches.\n */\n\nimport { html, ElurComponent, effect, ref, nextTick } from \"@elurjs/core\";\nimport type { ElurTemplate } from \"@elurjs/core\";\nimport { elurRouter, type NavigationDirection } from \"@elurjs/core\";\nimport { addIcons, type IconDefinitionMap } from \"./setup.js\";\n\n/** Layout of icon and label inside each tab button. */\nexport type TabButtonLayout =\n | \"icon-top\"\n | \"icon-start\"\n | \"icon-end\"\n | \"icon-bottom\"\n | \"icon-hide\"\n | \"label-hide\";\n\nexport interface BottomTabItem {\n path: string;\n label: string;\n icon?: string;\n activeIcon?: string;\n exact?: boolean;\n tabId?: string;\n /** Badge text or number (e.g. notification count). */\n badge?: string | number;\n /** Badge color (Ionic color name). Default: \"danger\". */\n badgeColor?: string;\n}\n\nexport interface BottomTabBarOptions {\n slot?: \"top\" | \"bottom\";\n className?: string;\n hiddenPaths?: string[];\n /**\n * Direction passed to the router on tab change.\n * Default `\"none\"` — no animation, native Ionic feel.\n */\n navigationDirection?: NavigationDirection;\n hideWhen?: (path: string) => boolean;\n /**\n * Icon SVG data to register for the tab bar icons.\n *\n * The Vite plugin can only detect static `name=\"icon-name\"` in html``\n * templates. Tab bar icons are dynamic, so pass the data here.\n */\n icons?: IconDefinitionMap;\n /**\n * Layout of icon and label inside each tab button.\n * Default: `\"icon-top\"`.\n */\n layout?: TabButtonLayout;\n /**\n * CSS custom properties to set on the `ion-tab-bar` element.\n * Useful for theming: `--background`, `--color`, `--color-selected`, etc.\n *\n * @example\n * ```ts\n * createBottomTabBar(tabs, {\n * cssVars: {\n * \"--background\": \"#1a1a2e\",\n * \"--color-selected\": \"#00ff88\",\n * },\n * });\n * ```\n */\n cssVars?: Record<string, string>;\n}\n\nfunction _normalizePath(p: string): string {\n if (!p || p === \"/\") return \"/\";\n return p.endsWith(\"/\") ? p.slice(0, -1) : p;\n}\n\nfunction _isActive(tab: BottomTabItem, currentPath: string): boolean {\n const cur = _normalizePath(currentPath);\n const tgt = _normalizePath(tab.path);\n if (tab.exact) return cur === tgt;\n if (tgt === \"/\") return cur === \"/\";\n return cur === tgt || cur.startsWith(`${tgt}/`);\n}\n\nfunction _isHidden(path: string, patterns?: string[]): boolean {\n if (!patterns?.length) return false;\n const cur = _normalizePath(path);\n return patterns.some((pat) => {\n const norm = _normalizePath(pat);\n if (norm.endsWith(\"/*\")) {\n const base = norm.slice(0, -2);\n return cur === base || cur.startsWith(`${base}/`);\n }\n return cur === norm;\n });\n}\n\n/** Convert a cssVars record to a CSS string for the style attribute. */\nfunction _cssVarsToString(vars: Record<string, string> | undefined): string {\n if (!vars) return \"\";\n return Object.entries(vars)\n .map(([k, v]) => `${k}: ${v}`)\n .join(\"; \");\n}\n\nexport function createBottomTabBar(\n tabs: BottomTabItem[],\n options: BottomTabBarOptions = {},\n): ElurTemplate {\n const router = elurRouter();\n const slot = options.slot ?? \"bottom\";\n const className = options.className ?? \"elur-ion-tab-bar\";\n const direction: NavigationDirection = options.navigationDirection ?? \"none\";\n const layout: TabButtonLayout = options.layout ?? \"icon-top\";\n const cssVars = options.cssVars;\n\n // Register icons if provided.\n if (options.icons) {\n addIcons(options.icons);\n }\n\n // Stencil boolean props (like `selected`) cannot be set via HTML\n // attributes with Elur. We use an effect to set the JS property\n // directly on each ion-tab-button after it's in the DOM, and\n // re-sync whenever the route changes.\n const tabBarRef = ref<HTMLElement>();\n let synced = false;\n effect(() => {\n const currentPath = router.current.value;\n const tabBarEl = tabBarRef.el;\n if (!tabBarEl) {\n if (!synced) {\n nextTick(() => {\n synced = true;\n const el = tabBarRef.el;\n if (!el) return;\n const btns = el.querySelectorAll(\"ion-tab-button\");\n btns.forEach((btn, i) => {\n const tab = tabs[i];\n if (!tab) return;\n (btn as any).selected = _isActive(tab, router.current.value);\n });\n });\n }\n return;\n }\n const buttons = tabBarEl.querySelectorAll(\"ion-tab-button\");\n buttons.forEach((btn, i) => {\n const tab = tabs[i];\n if (!tab) return;\n const isActive = _isActive(tab, currentPath);\n (btn as any).selected = isActive;\n });\n });\n\n return html`\n <ion-tab-bar\n slot=${slot}\n class=${className}\n ref=${tabBarRef}\n style=${() => {\n const path = router.current.value;\n const hidden = options.hideWhen\n ? options.hideWhen(path)\n : _isHidden(path, options.hiddenPaths);\n const vars = _cssVarsToString(cssVars);\n const display = hidden ? \"display:none\" : \"\";\n return [vars, display].filter(Boolean).join(\"; \");\n }}\n >\n ${tabs.map((tab) => {\n const computedTabId = tab.path === \"/\"\n ? \"root\"\n : _normalizePath(tab.path).replace(/^\\//, \"\").replace(/\\//g, \"-\");\n const tabId = tab.tabId ?? computedTabId;\n\n return html`\n <ion-tab-button\n tab=${tabId}\n layout=${layout}\n @click.prevent.stop=${() => {\n // .prevent.stop prevents Ionic's internal tab selection\n // (which looks for <ion-tab> children we don't have).\n // We drive navigation through the Elur router instead.\n if (_isActive(tab, router.current.value)) {\n router.replace(tab.path, { direction: \"none\" });\n } else {\n router.navigate(tab.path, { direction });\n }\n }}\n >\n ${tab.icon\n ? html`\n <ion-icon\n name=${() => {\n const active = _isActive(tab, router.current.value);\n return active && tab.activeIcon ? tab.activeIcon : tab.icon;\n }}\n ></ion-icon>\n `\n : \"\"}\n <ion-label>${tab.label}</ion-label>\n ${tab.badge != null\n ? html`<ion-badge color=${tab.badgeColor ?? \"danger\"}>${tab.badge}</ion-badge>`\n : \"\"}\n </ion-tab-button>\n `;\n })}\n </ion-tab-bar>\n `;\n}\n\n/**\n * Wraps an IonRouterOutlet and a tab bar in <ion-tabs>.\n *\n * <ion-tabs> provides the correct CSS layout context: the outlet fills\n * the available space and the tab bar sits at the bottom (or top).\n *\n * We use <ion-tabs> for layout only — navigation is driven by the\n * Elur router via the @click handler on each <ion-tab-button>, not\n * by Ionic's internal tab selection. The tab buttons have `tab` IDs\n * so Ionic doesn't warn, but there are no <ion-tab> children.\n *\n * A small CSS snippet is injected to ensure <ion-tabs> fills its\n * parent and the absolutely-positioned <ion-router-outlet> doesn't\n * collapse the layout.\n */\nexport function createTabsLayout(\n outlet: ElurTemplate | ElurComponent,\n tabBar: ElurTemplate,\n): ElurTemplate {\n _injectTabsLayoutStyles();\n const outletTemplate = outlet instanceof ElurComponent ? outlet.render() : outlet;\n return html`\n <ion-tabs>\n ${outletTemplate}\n ${tabBar}\n </ion-tabs>\n `;\n}\n\n/** Inject the tabs layout CSS once (idempotent). */\nlet _tabsStylesInjected = false;\nfunction _injectTabsLayoutStyles(): void {\n if (_tabsStylesInjected) return;\n if (typeof document === \"undefined\") return;\n _tabsStylesInjected = true;\n const style = document.createElement(\"style\");\n style.id = \"elur-ionic-tabs-layout\";\n // ion-tabs defaults to display:block with no explicit height, which\n // collapses to the tab bar's height because ion-router-outlet is\n // position:absolute. Force ion-tabs to fill its parent and use flexbox\n // so the outlet takes the remaining space above the tab bar.\n style.textContent = `\nion-tabs {\n display: flex !important;\n flex-direction: column !important;\n height: 100% !important;\n width: 100% !important;\n position: relative !important;\n}\nion-tabs > ion-router-outlet {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n position: relative !important;\n top: auto !important;\n bottom: auto !important;\n left: auto !important;\n right: auto !important;\n}\nion-tabs > ion-tab-bar {\n flex-shrink: 0 !important;\n}\n`;\n document.head.appendChild(style);\n}\n"],"mappings":";;;;;;;;;;AA2EA,IAAM,IAAoC;CACtC;CACA;CACA;CACA;CACA;AACJ,GAEM,IAAmC;CACrC,cAAc;CACd,oBAAoB;CACpB,gBAAgB;CAChB,sBAAsB;AAC1B,GAEI,IAAe,IACb,oBAAuB,IAAI,IAAY;AAE7C,SAAS,IAAsB;CAC3B,OAAO,OAAO,SAAW;AAC7B;AAEA,SAAS,IAA8B;CACnC,OAAO,OAAO,iBA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L,EAAM;qBACH,EAAO;wCACY;GAIpB,AAAI,EAAU,GAAK,EAAO,QAAQ,KAAK,IACnC,EAAO,QAAQ,EAAI,MAAM,EAAE,WAAW,OAAO,CAAC,IAE9C,EAAO,SAAS,EAAI,MAAM,EAAE,aAAU,CAAC;EAE/C,EAAE;;cAEJ,EAAI,OACI,CAAI;;iCAGiB,EAAU,GAAK,EAAO,QAAQ,KACtC,KAAU,EAAI,aAAa,EAAI,aAAa,EAAI,KACzD;;oBAGJ,GAAG;yBACA,EAAI,MAAM;cACrB,EAAI,SAAS,OAEL,KADA,CAAI,oBAAoB,EAAI,cAAc,SAAS,GAAG,EAAI,MAAM,cAC7D;;;CAGjB,CAAC,EAAE;;;AAGX;AAiBA,SAAgB,EACZ,GACA,GACY;CACZ,EAAwB;CACxB,IAAM,IAAiB,aAAkB,IAAgB,EAAO,OAAO,IAAI;CAC3E,OAAO,CAAI;;cAED,EAAe;cACf,EAAO;;;AAGrB;AAGA,IAAI,IAAsB;AAC1B,SAAS,IAAgC;CAErC,IADI,KACA,OAAO,WAAa,KAAa;CACrC,IAAsB;CACtB,IAAM,IAAQ,SAAS,cAAc,OAAO;CA2B5C,AA1BA,EAAM,KAAK,0BAKX,EAAM,cAAc,6eAqBpB,SAAS,KAAK,YAAY,CAAK;AACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./tabs-ByPLrzax.cjs");require("./vite-plugin.cjs"),exports.createBottomTabBar=e.t,exports.createTabsLayout=e.n;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elurjs/ionic / tabs.ts — v2
|
|
3
|
+
*
|
|
4
|
+
* Bottom tab bar that drives navigation through the core router. The visual
|
|
5
|
+
* "active" state is computed from `elurRouter().current` directly.
|
|
6
|
+
*
|
|
7
|
+
* Tab switches are intentionally direction:"none" — Ionic's convention is no
|
|
8
|
+
* animation between tabs. Per-tab stacks (configured on IonRouterOutlet via
|
|
9
|
+
* `tabs: [...]`) preserve each tab's deep view across switches.
|
|
10
|
+
*/
|
|
11
|
+
import { ElurComponent } from "@elurjs/core";
|
|
12
|
+
import type { ElurTemplate } from "@elurjs/core";
|
|
13
|
+
import { type NavigationDirection } from "@elurjs/core";
|
|
14
|
+
import { type IconDefinitionMap } from "./setup.js";
|
|
15
|
+
/** Layout of icon and label inside each tab button. */
|
|
16
|
+
export type TabButtonLayout = "icon-top" | "icon-start" | "icon-end" | "icon-bottom" | "icon-hide" | "label-hide";
|
|
17
|
+
export interface BottomTabItem {
|
|
18
|
+
path: string;
|
|
19
|
+
label: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
activeIcon?: string;
|
|
22
|
+
exact?: boolean;
|
|
23
|
+
tabId?: string;
|
|
24
|
+
/** Badge text or number (e.g. notification count). */
|
|
25
|
+
badge?: string | number;
|
|
26
|
+
/** Badge color (Ionic color name). Default: "danger". */
|
|
27
|
+
badgeColor?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface BottomTabBarOptions {
|
|
30
|
+
slot?: "top" | "bottom";
|
|
31
|
+
className?: string;
|
|
32
|
+
hiddenPaths?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Direction passed to the router on tab change.
|
|
35
|
+
* Default `"none"` — no animation, native Ionic feel.
|
|
36
|
+
*/
|
|
37
|
+
navigationDirection?: NavigationDirection;
|
|
38
|
+
hideWhen?: (path: string) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Icon SVG data to register for the tab bar icons.
|
|
41
|
+
*
|
|
42
|
+
* The Vite plugin can only detect static `name="icon-name"` in html``
|
|
43
|
+
* templates. Tab bar icons are dynamic, so pass the data here.
|
|
44
|
+
*/
|
|
45
|
+
icons?: IconDefinitionMap;
|
|
46
|
+
/**
|
|
47
|
+
* Layout of icon and label inside each tab button.
|
|
48
|
+
* Default: `"icon-top"`.
|
|
49
|
+
*/
|
|
50
|
+
layout?: TabButtonLayout;
|
|
51
|
+
/**
|
|
52
|
+
* CSS custom properties to set on the `ion-tab-bar` element.
|
|
53
|
+
* Useful for theming: `--background`, `--color`, `--color-selected`, etc.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* createBottomTabBar(tabs, {
|
|
58
|
+
* cssVars: {
|
|
59
|
+
* "--background": "#1a1a2e",
|
|
60
|
+
* "--color-selected": "#00ff88",
|
|
61
|
+
* },
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
cssVars?: Record<string, string>;
|
|
66
|
+
}
|
|
67
|
+
export declare function createBottomTabBar(tabs: BottomTabItem[], options?: BottomTabBarOptions): ElurTemplate;
|
|
68
|
+
/**
|
|
69
|
+
* Wraps an IonRouterOutlet and a tab bar in <ion-tabs>.
|
|
70
|
+
*
|
|
71
|
+
* <ion-tabs> provides the correct CSS layout context: the outlet fills
|
|
72
|
+
* the available space and the tab bar sits at the bottom (or top).
|
|
73
|
+
*
|
|
74
|
+
* We use <ion-tabs> for layout only — navigation is driven by the
|
|
75
|
+
* Elur router via the @click handler on each <ion-tab-button>, not
|
|
76
|
+
* by Ionic's internal tab selection. The tab buttons have `tab` IDs
|
|
77
|
+
* so Ionic doesn't warn, but there are no <ion-tab> children.
|
|
78
|
+
*
|
|
79
|
+
* A small CSS snippet is injected to ensure <ion-tabs> fills its
|
|
80
|
+
* parent and the absolutely-positioned <ion-router-outlet> doesn't
|
|
81
|
+
* collapse the layout.
|
|
82
|
+
*/
|
|
83
|
+
export declare function createTabsLayout(outlet: ElurTemplate | ElurComponent, tabBar: ElurTemplate): ElurTemplate;
|
package/dist/lib/tabs.js
ADDED