framework7 6.3.4 → 7.0.0-beta.3
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/components/accordion/accordion.js +132 -1
- package/components/accordion/accordion.umd.js +1 -0
- package/components/actions/actions-class.js +365 -0
- package/components/actions/actions-rtl.css +1 -1
- package/components/actions/actions.css +1 -1
- package/components/actions/actions.js +42 -1
- package/components/actions/actions.umd.js +1 -0
- package/components/app/app-class.d.ts +10 -10
- package/{esm/components → components}/app/app-class.js +107 -140
- package/components/app/app.less +3 -3
- package/{esm/components → components}/app/load-module.js +32 -32
- package/components/appbar/appbar.js +3 -1
- package/components/appbar/appbar.umd.js +1 -0
- package/components/area-chart/area-chart-class.js +507 -0
- package/components/area-chart/area-chart-rtl.css +1 -1
- package/components/area-chart/area-chart.css +1 -1
- package/components/area-chart/area-chart.js +47 -1
- package/components/area-chart/area-chart.umd.js +1 -0
- package/{esm/components → components}/autocomplete/autocomplete-class.js +241 -253
- package/components/autocomplete/autocomplete-rtl.css +1 -1
- package/components/autocomplete/autocomplete.css +1 -1
- package/components/autocomplete/autocomplete.js +86 -1
- package/components/autocomplete/autocomplete.umd.js +1 -0
- package/{esm/components → components}/badge/badge.js +0 -0
- package/{esm/components → components}/block/block.js +0 -0
- package/{esm/components → components}/button/button.js +0 -0
- package/{esm/components → components}/calendar/calendar-class.js +676 -643
- package/components/calendar/calendar-rtl.css +1 -1
- package/components/calendar/calendar.css +1 -1
- package/components/calendar/calendar.js +111 -1
- package/components/calendar/calendar.umd.js +1 -0
- package/components/card/card-rtl.css +1 -1
- package/components/card/card.css +1 -1
- package/components/card/card.js +592 -1
- package/components/card/card.umd.js +1 -0
- package/components/checkbox/checkbox-rtl.css +1 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/checkbox/checkbox.js +3 -1
- package/components/checkbox/checkbox.umd.js +1 -0
- package/components/chip/chip-rtl.css +1 -1
- package/components/chip/chip.css +1 -1
- package/components/chip/chip.js +3 -1
- package/components/chip/chip.umd.js +1 -0
- package/{esm/components → components}/color-picker/color-picker-class.js +336 -349
- package/components/color-picker/color-picker-rtl.css +1 -1
- package/components/color-picker/color-picker.css +1 -1
- package/components/color-picker/color-picker.js +92 -1
- package/components/color-picker/color-picker.umd.js +1 -0
- package/{esm/components → components}/color-picker/modules/alpha-slider.js +30 -19
- package/{esm/components → components}/color-picker/modules/brightness-slider.js +35 -24
- package/{esm/components → components}/color-picker/modules/current-color.js +4 -2
- package/{esm/components → components}/color-picker/modules/hex.js +27 -16
- package/{esm/components → components}/color-picker/modules/hs-spectrum.js +37 -25
- package/{esm/components → components}/color-picker/modules/hsb-sliders.js +54 -41
- package/{esm/components → components}/color-picker/modules/hue-slider.js +29 -18
- package/{esm/components → components}/color-picker/modules/initial-current-colors.js +14 -9
- package/{esm/components → components}/color-picker/modules/palette.js +14 -11
- package/{esm/components → components}/color-picker/modules/rgb-bars.js +42 -29
- package/{esm/components → components}/color-picker/modules/rgb-sliders.js +47 -34
- package/{esm/components → components}/color-picker/modules/sb-spectrum.js +38 -26
- package/{esm/components → components}/color-picker/modules/wheel.js +59 -47
- package/components/contacts-list/contacts-list-rtl.css +1 -1
- package/components/contacts-list/contacts-list.css +1 -1
- package/components/contacts-list/contacts-list.js +3 -1
- package/components/contacts-list/contacts-list.umd.js +1 -0
- package/{esm/components → components}/data-table/data-table-class.js +40 -59
- package/components/data-table/data-table-rtl.css +1 -1
- package/components/data-table/data-table.css +1 -1
- package/components/data-table/data-table.js +72 -1
- package/components/data-table/data-table.umd.js +1 -0
- package/{esm/components → components}/dialog/dialog-class.js +58 -67
- package/components/dialog/dialog-rtl.css +1 -1
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.js +254 -1
- package/components/dialog/dialog.umd.js +1 -0
- package/components/elevation/elevation.js +3 -1
- package/components/elevation/elevation.umd.js +1 -0
- package/components/fab/fab.js +181 -1
- package/components/fab/fab.umd.js +1 -0
- package/components/form/form.js +347 -1
- package/components/form/form.umd.js +1 -0
- package/components/gauge/gauge-class.js +306 -0
- package/components/gauge/gauge.js +99 -1
- package/components/gauge/gauge.umd.js +1 -0
- package/components/grid/grid-rtl.css +1 -1
- package/components/grid/grid.css +1 -1
- package/components/grid/grid.js +227 -1
- package/components/grid/grid.umd.js +1 -0
- package/{esm/components → components}/icon/icon.js +0 -0
- package/components/infinite-scroll/infinite-scroll.js +110 -1
- package/components/infinite-scroll/infinite-scroll.umd.js +1 -0
- package/components/input/input-rtl.css +1 -1
- package/components/input/input.css +1 -1
- package/components/input/input.js +394 -1
- package/components/input/input.less +1 -1
- package/components/input/input.umd.js +1 -0
- package/components/lazy/lazy.js +283 -1
- package/components/lazy/lazy.umd.js +1 -0
- package/{esm/components → components}/link/link.js +0 -0
- package/{esm/components → components}/list/list.js +0 -0
- package/{esm/components → components}/list-index/list-index-class.js +113 -121
- package/components/list-index/list-index-rtl.css +1 -1
- package/components/list-index/list-index.css +1 -1
- package/components/list-index/list-index.js +73 -1
- package/components/list-index/list-index.umd.js +1 -0
- package/components/login-screen/login-screen-class.js +43 -0
- package/components/login-screen/login-screen-rtl.css +1 -1
- package/components/login-screen/login-screen.css +1 -1
- package/components/login-screen/login-screen.js +28 -1
- package/components/login-screen/login-screen.less +1 -1
- package/components/login-screen/login-screen.umd.js +1 -0
- package/components/menu/menu.js +79 -1
- package/components/menu/menu.umd.js +1 -0
- package/{esm/components → components}/messagebar/messagebar-class.js +124 -152
- package/components/messagebar/messagebar-rtl.css +1 -1
- package/components/messagebar/messagebar.css +1 -1
- package/components/messagebar/messagebar.js +74 -1
- package/components/messagebar/messagebar.umd.js +1 -0
- package/{esm/components → components}/messages/messages-class.js +162 -242
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages.css +1 -1
- package/components/messages/messages.js +73 -1
- package/components/messages/messages.umd.js +1 -0
- package/{esm/components → components}/modal/custom-modal-class.js +16 -29
- package/{esm/components → components}/modal/modal-class.js +68 -83
- package/{esm/components → components}/modal/modal.js +8 -5
- package/{esm/components → components}/navbar/navbar.js +166 -171
- package/components/notification/notification-aurora.less +1 -1
- package/{esm/components → components}/notification/notification-class.js +65 -78
- package/components/notification/notification-ios.less +1 -1
- package/components/notification/notification-rtl.css +1 -1
- package/components/notification/notification.css +1 -1
- package/components/notification/notification.js +35 -1
- package/components/notification/notification.umd.js +1 -0
- package/components/page/page-vars.less +1 -1
- package/{esm/components → components}/page/page.js +0 -0
- package/{esm/components → components}/panel/panel-class.js +183 -214
- package/components/panel/panel-rtl.css +1 -1
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.js +190 -1
- package/components/panel/panel.umd.js +1 -0
- package/{esm/components → components}/panel/resizable-panel.js +30 -28
- package/{esm/components → components}/panel/swipe-panel.js +46 -44
- package/{esm/components → components}/photo-browser/photo-browser-class.js +206 -234
- package/components/photo-browser/photo-browser.js +73 -1
- package/components/photo-browser/photo-browser.umd.js +1 -0
- package/{esm/components → components}/picker/picker-class.js +233 -233
- package/{esm/components → components}/picker/picker-column.js +70 -72
- package/components/picker/picker-rtl.css +1 -1
- package/components/picker/picker.css +1 -1
- package/components/picker/picker.js +64 -1
- package/components/picker/picker.umd.js +1 -0
- package/components/pie-chart/pie-chart-class.js +264 -0
- package/components/pie-chart/pie-chart.js +35 -1
- package/components/pie-chart/pie-chart.umd.js +1 -0
- package/{esm/components → components}/popover/popover-class.js +72 -97
- package/components/popover/popover-rtl.css +1 -1
- package/components/popover/popover.css +1 -1
- package/components/popover/popover.js +76 -1
- package/components/popover/popover.umd.js +1 -0
- package/{esm/components → components}/popup/popup-class.js +66 -81
- package/components/popup/popup-rtl.css +1 -1
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.js +41 -1
- package/components/popup/popup.less +21 -21
- package/components/popup/popup.umd.js +1 -0
- package/components/preloader/preloader.js +115 -1
- package/components/preloader/preloader.umd.js +1 -0
- package/components/progressbar/progressbar-rtl.css +1 -1
- package/components/progressbar/progressbar.css +1 -1
- package/components/progressbar/progressbar.js +166 -1
- package/components/progressbar/progressbar.umd.js +1 -0
- package/{esm/components → components}/pull-to-refresh/pull-to-refresh-class.js +101 -118
- package/components/pull-to-refresh/pull-to-refresh.js +70 -1
- package/components/pull-to-refresh/pull-to-refresh.umd.js +1 -0
- package/components/radio/radio-rtl.css +1 -1
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.js +3 -1
- package/components/radio/radio.umd.js +1 -0
- package/{esm/components → components}/range/range-class.js +191 -192
- package/components/range/range-rtl.css +1 -1
- package/components/range/range.css +1 -1
- package/components/range/range.js +79 -1
- package/components/range/range.umd.js +1 -0
- package/components/searchbar/remove-diacritics.js +275 -0
- package/{esm/components → components}/searchbar/searchbar-class.js +129 -146
- package/components/searchbar/searchbar-rtl.css +1 -1
- package/components/searchbar/searchbar.css +1 -1
- package/components/searchbar/searchbar.js +121 -1
- package/components/searchbar/searchbar.less +1 -1
- package/components/searchbar/searchbar.umd.js +1 -0
- package/{esm/components → components}/sheet/sheet-class.js +87 -106
- package/components/sheet/sheet-rtl.css +1 -1
- package/components/sheet/sheet.css +1 -1
- package/components/sheet/sheet.js +68 -1
- package/components/sheet/sheet.less +16 -16
- package/components/sheet/sheet.umd.js +1 -0
- package/components/skeleton/skeleton-rtl.css +1 -1
- package/components/skeleton/skeleton-vars.less +1 -1
- package/components/skeleton/skeleton.css +1 -1
- package/components/skeleton/skeleton.js +3 -1
- package/components/skeleton/skeleton.less +1 -1
- package/components/skeleton/skeleton.umd.js +1 -0
- package/{esm/components → components}/smart-select/smart-select-class.js +284 -296
- package/components/smart-select/smart-select.js +149 -1
- package/components/smart-select/smart-select.umd.js +1 -0
- package/components/sortable/sortable-rtl.css +1 -1
- package/components/sortable/sortable.css +1 -1
- package/components/sortable/sortable.js +293 -1
- package/components/sortable/sortable.umd.js +1 -0
- package/{esm/components → components}/statusbar/statusbar.js +48 -41
- package/{esm/components → components}/stepper/stepper-class.js +104 -115
- package/components/stepper/stepper-rtl.css +1 -1
- package/components/stepper/stepper.css +1 -1
- package/components/stepper/stepper.js +86 -1
- package/components/stepper/stepper.umd.js +1 -0
- package/{esm/components → components}/subnavbar/subnavbar.js +3 -2
- package/components/swipeout/swipeout-rtl.css +1 -1
- package/components/swipeout/swipeout.css +1 -1
- package/components/swipeout/swipeout.js +597 -1
- package/components/swipeout/swipeout.umd.js +1 -0
- package/components/swiper/swiper-rtl.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/swiper/swiper.js +191 -1
- package/components/swiper/swiper.less +1 -1
- package/components/swiper/swiper.umd.js +1 -0
- package/components/tabs/tabs.js +272 -1
- package/components/tabs/tabs.umd.js +1 -0
- package/{esm/components → components}/text-editor/text-editor-class.js +170 -182
- package/components/text-editor/text-editor-rtl.css +1 -1
- package/components/text-editor/text-editor.css +1 -1
- package/components/text-editor/text-editor.js +89 -1
- package/components/text-editor/text-editor.umd.js +1 -0
- package/components/timeline/timeline-rtl.css +1 -1
- package/components/timeline/timeline.css +1 -1
- package/components/timeline/timeline.js +3 -1
- package/components/timeline/timeline.umd.js +1 -0
- package/components/toast/toast-class.js +119 -0
- package/components/toast/toast.js +43 -1
- package/components/toast/toast.umd.js +1 -0
- package/{esm/components → components}/toggle/toggle-class.js +46 -63
- package/components/toggle/toggle-rtl.css +1 -1
- package/components/toggle/toggle.css +1 -1
- package/components/toggle/toggle.js +65 -1
- package/components/toggle/toggle.umd.js +1 -0
- package/{esm/components → components}/toolbar/toolbar.js +63 -59
- package/{esm/components → components}/tooltip/tooltip-class.js +95 -106
- package/components/tooltip/tooltip.js +144 -1
- package/components/tooltip/tooltip.umd.js +1 -0
- package/components/touch-ripple/touch-ripple-class.js +98 -0
- package/components/touch-ripple/touch-ripple-vars.less +1 -1
- package/components/touch-ripple/touch-ripple.js +18 -0
- package/components/treeview/treeview-rtl.css +1 -1
- package/components/treeview/treeview.css +1 -1
- package/components/treeview/treeview.js +83 -1
- package/components/treeview/treeview.umd.js +1 -0
- package/components/typography/typography.js +3 -1
- package/components/typography/typography.umd.js +1 -0
- package/{esm/components → components}/view/resizable-view.js +23 -21
- package/{esm/components → components}/view/view-class.js +48 -67
- package/{esm/components → components}/view/view.js +37 -28
- package/{esm/components → components}/virtual-list/virtual-list-class.js +153 -170
- package/components/virtual-list/virtual-list.js +19 -1
- package/components/virtual-list/virtual-list.umd.js +1 -0
- package/framework7-bundle-rtl.css +268 -852
- package/framework7-bundle-rtl.min.css +3 -3
- package/framework7-bundle.css +268 -852
- package/{esm/framework7-bundle.js → framework7-bundle.esm.js} +2 -2
- package/framework7-bundle.js +30782 -31429
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +2 -2
- package/framework7-bundle.min.css +3 -3
- package/framework7-bundle.min.js +3 -3
- package/framework7-bundle.min.js.map +1 -1
- package/{esm/framework7-lite-bundle.js → framework7-lite-bundle.esm.js} +2 -2
- package/{esm/framework7-lite.js → framework7-lite.esm.js} +2 -2
- package/framework7-rtl.css +52 -56
- package/framework7-rtl.min.css +3 -3
- package/{types/types.d.ts → framework7-types.d.ts} +0 -0
- package/framework7.css +52 -56
- package/framework7.d.ts +81 -81
- package/{esm/framework7.js → framework7.esm.js} +2 -2
- package/framework7.js +3386 -4049
- package/framework7.js.map +1 -1
- package/framework7.less +2 -2
- package/framework7.min.css +3 -3
- package/framework7.min.js +3 -3
- package/framework7.min.js.map +1 -1
- package/less/mixins.less +2 -2
- package/{esm/modules → modules}/clicks/clicks.js +17 -16
- package/modules/component/$h.js +14 -0
- package/modules/component/$jsx.js +18 -0
- package/modules/component/component-class.js +382 -0
- package/modules/component/component.d.ts +2 -0
- package/{esm/modules → modules}/component/component.js +23 -17
- package/{esm/modules → modules}/component/custom-components.js +0 -0
- package/{esm/modules → modules}/component/eventslisteners.js +14 -18
- package/modules/component/parse-component.js +80 -0
- package/{esm/modules → modules}/component/patch.js +1 -1
- package/{esm/modules → modules}/component/snabbdom/h.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/helpers/attachto.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/hooks.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/htmldomapi.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/is.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/modules/attributes.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/modules/class.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/modules/dataset.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/modules/eventlisteners.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/modules/hero.js +1 -1
- package/{esm/modules → modules}/component/snabbdom/modules/module.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/modules/props.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/modules/style.js +1 -1
- package/{esm/modules → modules}/component/snabbdom/snabbdom.bundle.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/snabbdom.js +6 -18
- package/{esm/modules → modules}/component/snabbdom/thunk.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/tovnode.js +0 -0
- package/{esm/modules → modules}/component/snabbdom/vnode.js +0 -0
- package/{esm/modules → modules}/component/vdom.js +106 -130
- package/{esm/modules → modules}/demo-module.js +15 -7
- package/{esm/modules → modules}/device/device.js +12 -11
- package/{esm/modules → modules}/history/history.js +2 -1
- package/{esm/modules → modules}/request/request.js +2 -2
- package/modules/resize/resize.js +65 -0
- package/{esm/modules → modules}/router/app-router-check.js +1 -1
- package/{esm/modules → modules}/router/async-component.js +3 -3
- package/{esm/modules → modules}/router/back.js +117 -117
- package/{esm/modules → modules}/router/clear-previous-history.js +8 -8
- package/modules/router/component-loader.js +174 -0
- package/{esm/modules → modules}/router/modal.js +49 -49
- package/{esm/modules → modules}/router/navigate.js +140 -221
- package/{esm/modules → modules}/router/process-route-queue.js +20 -17
- package/{esm/modules → modules}/router/redirect.js +7 -11
- package/{esm/modules → modules}/router/router-class.js +411 -432
- package/{esm/modules → modules}/router/router.js +5 -3
- package/{esm/modules → modules}/router/swipe-back.js +143 -177
- package/{esm/modules → modules}/router/tab.js +46 -46
- package/{esm/modules → modules}/service-worker/service-worker.js +41 -37
- package/modules/store/create-store.js +149 -0
- package/{esm/modules → modules}/store/store.js +2 -2
- package/{esm/modules → modules}/support/support.js +1 -1
- package/{esm/modules → modules}/touch/touch.js +71 -70
- package/{esm/modules → modules}/utils/utils.js +2 -2
- package/package.json +252 -11
- package/shared/$jsx.js +22 -0
- package/shared/class.js +143 -0
- package/shared/constructor-methods.js +42 -0
- package/{esm/shared → shared}/dom7.js +2 -1
- package/shared/events-class.js +100 -0
- package/{types/shared → shared}/get-device.d.ts +0 -0
- package/{esm/shared → shared}/get-device.js +32 -37
- package/{types/shared → shared}/get-support.d.ts +0 -0
- package/{esm/shared → shared}/get-support.js +7 -6
- package/{esm/shared → shared}/history.js +61 -47
- package/shared/modal-methods.js +90 -0
- package/{types/shared → shared}/request.d.ts +0 -0
- package/shared/request.js +474 -0
- package/{types/shared → shared}/utils.d.ts +0 -0
- package/{esm/shared → shared}/utils.js +125 -162
- package/bundle/package.json +0 -8
- package/cjs/components/accordion/accordion.js +0 -136
- package/cjs/components/actions/actions-class.js +0 -383
- package/cjs/components/actions/actions.js +0 -58
- package/cjs/components/app/app-class.js +0 -378
- package/cjs/components/app/load-module.js +0 -155
- package/cjs/components/appbar/appbar.js +0 -8
- package/cjs/components/area-chart/area-chart-class.js +0 -526
- package/cjs/components/area-chart/area-chart.js +0 -56
- package/cjs/components/autocomplete/autocomplete-class.js +0 -975
- package/cjs/components/autocomplete/autocomplete.js +0 -93
- package/cjs/components/badge/badge.js +0 -8
- package/cjs/components/block/block.js +0 -8
- package/cjs/components/button/button.js +0 -8
- package/cjs/components/calendar/calendar-class.js +0 -2078
- package/cjs/components/calendar/calendar.js +0 -124
- package/cjs/components/card/card.js +0 -625
- package/cjs/components/checkbox/checkbox.js +0 -8
- package/cjs/components/chip/chip.js +0 -8
- package/cjs/components/color-picker/color-picker-class.js +0 -1022
- package/cjs/components/color-picker/color-picker.js +0 -105
- package/cjs/components/color-picker/modules/alpha-slider.js +0 -101
- package/cjs/components/color-picker/modules/brightness-slider.js +0 -86
- package/cjs/components/color-picker/modules/current-color.js +0 -23
- package/cjs/components/color-picker/modules/hex.js +0 -81
- package/cjs/components/color-picker/modules/hs-spectrum.js +0 -137
- package/cjs/components/color-picker/modules/hsb-sliders.js +0 -206
- package/cjs/components/color-picker/modules/hue-slider.js +0 -78
- package/cjs/components/color-picker/modules/initial-current-colors.js +0 -54
- package/cjs/components/color-picker/modules/palette.js +0 -61
- package/cjs/components/color-picker/modules/rgb-bars.js +0 -196
- package/cjs/components/color-picker/modules/rgb-sliders.js +0 -198
- package/cjs/components/color-picker/modules/sb-spectrum.js +0 -137
- package/cjs/components/color-picker/modules/wheel.js +0 -198
- package/cjs/components/contacts-list/contacts-list.js +0 -8
- package/cjs/components/data-table/data-table-class.js +0 -188
- package/cjs/components/data-table/data-table.js +0 -75
- package/cjs/components/dialog/dialog-class.js +0 -250
- package/cjs/components/dialog/dialog.js +0 -297
- package/cjs/components/elevation/elevation.js +0 -8
- package/cjs/components/fab/fab.js +0 -195
- package/cjs/components/form/form.js +0 -341
- package/cjs/components/gauge/gauge-class.js +0 -332
- package/cjs/components/gauge/gauge.js +0 -103
- package/cjs/components/grid/grid.js +0 -233
- package/cjs/components/icon/icon.js +0 -8
- package/cjs/components/infinite-scroll/infinite-scroll.js +0 -111
- package/cjs/components/input/input.js +0 -396
- package/cjs/components/lazy/lazy.js +0 -283
- package/cjs/components/link/link.js +0 -8
- package/cjs/components/list/list.js +0 -8
- package/cjs/components/list-index/list-index-class.js +0 -405
- package/cjs/components/list-index/list-index.js +0 -77
- package/cjs/components/login-screen/login-screen-class.js +0 -68
- package/cjs/components/login-screen/login-screen.js +0 -44
- package/cjs/components/menu/menu.js +0 -92
- package/cjs/components/messagebar/messagebar-class.js +0 -446
- package/cjs/components/messagebar/messagebar.js +0 -78
- package/cjs/components/messages/messages-class.js +0 -633
- package/cjs/components/messages/messages.js +0 -76
- package/cjs/components/modal/custom-modal-class.js +0 -99
- package/cjs/components/modal/modal-class.js +0 -277
- package/cjs/components/modal/modal.js +0 -32
- package/cjs/components/navbar/navbar.js +0 -833
- package/cjs/components/notification/notification-class.js +0 -269
- package/cjs/components/notification/notification.js +0 -44
- package/cjs/components/page/page.js +0 -8
- package/cjs/components/panel/panel-class.js +0 -660
- package/cjs/components/panel/panel.js +0 -219
- package/cjs/components/panel/resizable-panel.js +0 -197
- package/cjs/components/panel/swipe-panel.js +0 -363
- package/cjs/components/photo-browser/photo-browser-class.js +0 -781
- package/cjs/components/photo-browser/photo-browser.js +0 -78
- package/cjs/components/picker/picker-class.js +0 -704
- package/cjs/components/picker/picker-column.js +0 -389
- package/cjs/components/picker/picker.js +0 -77
- package/cjs/components/pie-chart/pie-chart-class.js +0 -290
- package/cjs/components/pie-chart/pie-chart.js +0 -44
- package/cjs/components/popover/popover-class.js +0 -365
- package/cjs/components/popover/popover.js +0 -93
- package/cjs/components/popup/popup-class.js +0 -416
- package/cjs/components/popup/popup.js +0 -57
- package/cjs/components/preloader/preloader.js +0 -111
- package/cjs/components/progressbar/progressbar.js +0 -185
- package/cjs/components/pull-to-refresh/pull-to-refresh-class.js +0 -627
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +0 -74
- package/cjs/components/radio/radio.js +0 -8
- package/cjs/components/range/range-class.js +0 -674
- package/cjs/components/range/range.js +0 -93
- package/cjs/components/searchbar/remove-diacritics.js +0 -283
- package/cjs/components/searchbar/searchbar-class.js +0 -739
- package/cjs/components/searchbar/searchbar.js +0 -141
- package/cjs/components/sheet/sheet-class.js +0 -583
- package/cjs/components/sheet/sheet.js +0 -83
- package/cjs/components/skeleton/skeleton.js +0 -8
- package/cjs/components/smart-select/smart-select-class.js +0 -1005
- package/cjs/components/smart-select/smart-select.js +0 -151
- package/cjs/components/sortable/sortable.js +0 -322
- package/cjs/components/statusbar/statusbar.js +0 -226
- package/cjs/components/stepper/stepper-class.js +0 -497
- package/cjs/components/stepper/stepper.js +0 -96
- package/cjs/components/subnavbar/subnavbar.js +0 -28
- package/cjs/components/swipeout/swipeout.js +0 -618
- package/cjs/components/swiper/swiper.js +0 -189
- package/cjs/components/tabs/tabs.js +0 -296
- package/cjs/components/text-editor/text-editor-class.js +0 -627
- package/cjs/components/text-editor/text-editor.js +0 -93
- package/cjs/components/timeline/timeline.js +0 -8
- package/cjs/components/toast/toast-class.js +0 -142
- package/cjs/components/toast/toast.js +0 -51
- package/cjs/components/toggle/toggle-class.js +0 -213
- package/cjs/components/toggle/toggle.js +0 -72
- package/cjs/components/toolbar/toolbar.js +0 -234
- package/cjs/components/tooltip/tooltip-class.js +0 -409
- package/cjs/components/tooltip/tooltip.js +0 -146
- package/cjs/components/touch-ripple/touch-ripple-class.js +0 -110
- package/cjs/components/touch-ripple/touch-ripple.js +0 -34
- package/cjs/components/treeview/treeview.js +0 -88
- package/cjs/components/typography/typography.js +0 -8
- package/cjs/components/view/resizable-view.js +0 -155
- package/cjs/components/view/view-class.js +0 -251
- package/cjs/components/view/view.js +0 -196
- package/cjs/components/virtual-list/virtual-list-class.js +0 -654
- package/cjs/components/virtual-list/virtual-list.js +0 -27
- package/cjs/framework7-bundle.js +0 -208
- package/cjs/framework7-lite-bundle.js +0 -191
- package/cjs/framework7-lite.js +0 -87
- package/cjs/framework7.js +0 -98
- package/cjs/modules/clicks/clicks.js +0 -115
- package/cjs/modules/component/$h.js +0 -31
- package/cjs/modules/component/$jsx.js +0 -31
- package/cjs/modules/component/component-class.js +0 -415
- package/cjs/modules/component/component.js +0 -58
- package/cjs/modules/component/custom-components.js +0 -6
- package/cjs/modules/component/eventslisteners.js +0 -90
- package/cjs/modules/component/parse-component.js +0 -80
- package/cjs/modules/component/patch.js +0 -21
- package/cjs/modules/component/snabbdom/h.js +0 -72
- package/cjs/modules/component/snabbdom/helpers/attachto.js +0 -62
- package/cjs/modules/component/snabbdom/hooks.js +0 -1
- package/cjs/modules/component/snabbdom/htmldomapi.js +0 -90
- package/cjs/modules/component/snabbdom/is.js +0 -11
- package/cjs/modules/component/snabbdom/modules/attributes.js +0 -61
- package/cjs/modules/component/snabbdom/modules/class.js +0 -38
- package/cjs/modules/component/snabbdom/modules/dataset.js +0 -47
- package/cjs/modules/component/snabbdom/modules/eventlisteners.js +0 -106
- package/cjs/modules/component/snabbdom/modules/hero.js +0 -193
- package/cjs/modules/component/snabbdom/modules/module.js +0 -1
- package/cjs/modules/component/snabbdom/modules/props.js +0 -40
- package/cjs/modules/component/snabbdom/modules/style.js +0 -116
- package/cjs/modules/component/snabbdom/snabbdom.bundle.js +0 -33
- package/cjs/modules/component/snabbdom/snabbdom.js +0 -374
- package/cjs/modules/component/snabbdom/thunk.js +0 -66
- package/cjs/modules/component/snabbdom/tovnode.js +0 -57
- package/cjs/modules/component/snabbdom/vnode.js +0 -20
- package/cjs/modules/component/vdom.js +0 -393
- package/cjs/modules/demo-module.js +0 -49
- package/cjs/modules/device/device.js +0 -56
- package/cjs/modules/history/history.js +0 -21
- package/cjs/modules/request/request.js +0 -20
- package/cjs/modules/resize/resize.js +0 -72
- package/cjs/modules/router/app-router-check.js +0 -10
- package/cjs/modules/router/async-component.js +0 -33
- package/cjs/modules/router/back.js +0 -899
- package/cjs/modules/router/clear-previous-history.js +0 -50
- package/cjs/modules/router/component-loader.js +0 -140
- package/cjs/modules/router/modal.js +0 -254
- package/cjs/modules/router/navigate.js +0 -1054
- package/cjs/modules/router/process-route-queue.js +0 -80
- package/cjs/modules/router/redirect.js +0 -52
- package/cjs/modules/router/router-class.js +0 -1500
- package/cjs/modules/router/router.js +0 -36
- package/cjs/modules/router/swipe-back.js +0 -735
- package/cjs/modules/router/tab.js +0 -264
- package/cjs/modules/service-worker/service-worker.js +0 -101
- package/cjs/modules/store/create-store.js +0 -169
- package/cjs/modules/store/store.js +0 -21
- package/cjs/modules/support/support.js +0 -14
- package/cjs/modules/touch/touch.js +0 -585
- package/cjs/modules/utils/utils.js +0 -21
- package/cjs/shared/$jsx.js +0 -39
- package/cjs/shared/class.js +0 -206
- package/cjs/shared/constructor-methods.js +0 -73
- package/cjs/shared/dom7.js +0 -17
- package/cjs/shared/events-class.js +0 -125
- package/cjs/shared/get-device.js +0 -157
- package/cjs/shared/get-support.js +0 -44
- package/cjs/shared/history.js +0 -185
- package/cjs/shared/modal-methods.js +0 -105
- package/cjs/shared/request.js +0 -552
- package/cjs/shared/utils.js +0 -472
- package/components/accordion/package.json +0 -9
- package/components/actions/package.json +0 -9
- package/components/app/package.json +0 -9
- package/components/appbar/package.json +0 -9
- package/components/area-chart/package.json +0 -9
- package/components/autocomplete/package.json +0 -9
- package/components/badge/package.json +0 -9
- package/components/block/package.json +0 -9
- package/components/button/package.json +0 -9
- package/components/calendar/package.json +0 -9
- package/components/card/package.json +0 -9
- package/components/checkbox/package.json +0 -9
- package/components/chip/package.json +0 -9
- package/components/color-picker/package.json +0 -9
- package/components/contacts-list/package.json +0 -9
- package/components/data-table/package.json +0 -9
- package/components/dialog/package.json +0 -9
- package/components/elevation/package.json +0 -9
- package/components/fab/package.json +0 -9
- package/components/form/package.json +0 -9
- package/components/gauge/package.json +0 -9
- package/components/grid/package.json +0 -9
- package/components/icon/package.json +0 -9
- package/components/infinite-scroll/package.json +0 -9
- package/components/input/package.json +0 -9
- package/components/lazy/package.json +0 -9
- package/components/link/package.json +0 -9
- package/components/list/package.json +0 -9
- package/components/list-index/package.json +0 -9
- package/components/login-screen/package.json +0 -9
- package/components/menu/package.json +0 -9
- package/components/messagebar/package.json +0 -9
- package/components/messages/package.json +0 -9
- package/components/modal/package.json +0 -9
- package/components/navbar/package.json +0 -9
- package/components/notification/package.json +0 -9
- package/components/page/package.json +0 -9
- package/components/panel/package.json +0 -9
- package/components/photo-browser/package.json +0 -9
- package/components/picker/package.json +0 -9
- package/components/pie-chart/package.json +0 -9
- package/components/popover/package.json +0 -9
- package/components/popup/package.json +0 -9
- package/components/preloader/package.json +0 -9
- package/components/progressbar/package.json +0 -9
- package/components/pull-to-refresh/package.json +0 -9
- package/components/radio/package.json +0 -9
- package/components/range/package.json +0 -9
- package/components/searchbar/package.json +0 -9
- package/components/sheet/package.json +0 -9
- package/components/skeleton/package.json +0 -9
- package/components/smart-select/package.json +0 -9
- package/components/sortable/package.json +0 -9
- package/components/statusbar/package.json +0 -9
- package/components/stepper/package.json +0 -9
- package/components/subnavbar/package.json +0 -9
- package/components/swipeout/package.json +0 -9
- package/components/swiper/package.json +0 -9
- package/components/tabs/package.json +0 -9
- package/components/text-editor/package.json +0 -9
- package/components/timeline/package.json +0 -9
- package/components/toast/package.json +0 -9
- package/components/toggle/package.json +0 -9
- package/components/toolbar/package.json +0 -9
- package/components/tooltip/package.json +0 -9
- package/components/touch-ripple/package.json +0 -9
- package/components/treeview/package.json +0 -9
- package/components/typography/package.json +0 -9
- package/components/view/package.json +0 -9
- package/components/virtual-list/package.json +0 -9
- package/core/package.json +0 -8
- package/esm/components/accordion/accordion.js +0 -126
- package/esm/components/actions/actions-class.js +0 -373
- package/esm/components/actions/actions.js +0 -48
- package/esm/components/appbar/appbar.js +0 -3
- package/esm/components/area-chart/area-chart-class.js +0 -517
- package/esm/components/area-chart/area-chart.js +0 -45
- package/esm/components/autocomplete/autocomplete.js +0 -82
- package/esm/components/calendar/calendar.js +0 -113
- package/esm/components/card/card.js +0 -612
- package/esm/components/checkbox/checkbox.js +0 -3
- package/esm/components/chip/chip.js +0 -3
- package/esm/components/color-picker/color-picker.js +0 -94
- package/esm/components/contacts-list/contacts-list.js +0 -3
- package/esm/components/data-table/data-table.js +0 -64
- package/esm/components/dialog/dialog.js +0 -286
- package/esm/components/elevation/elevation.js +0 -3
- package/esm/components/fab/fab.js +0 -185
- package/esm/components/form/form.js +0 -330
- package/esm/components/gauge/gauge-class.js +0 -323
- package/esm/components/gauge/gauge.js +0 -91
- package/esm/components/grid/grid.js +0 -223
- package/esm/components/infinite-scroll/infinite-scroll.js +0 -101
- package/esm/components/input/input.js +0 -384
- package/esm/components/lazy/lazy.js +0 -271
- package/esm/components/list-index/list-index.js +0 -65
- package/esm/components/login-screen/login-screen-class.js +0 -58
- package/esm/components/login-screen/login-screen.js +0 -34
- package/esm/components/menu/menu.js +0 -82
- package/esm/components/messagebar/messagebar.js +0 -66
- package/esm/components/messages/messages.js +0 -65
- package/esm/components/notification/notification.js +0 -33
- package/esm/components/panel/panel.js +0 -208
- package/esm/components/photo-browser/photo-browser.js +0 -68
- package/esm/components/picker/picker.js +0 -66
- package/esm/components/pie-chart/pie-chart-class.js +0 -281
- package/esm/components/pie-chart/pie-chart.js +0 -33
- package/esm/components/popover/popover.js +0 -81
- package/esm/components/popup/popup.js +0 -47
- package/esm/components/preloader/preloader.js +0 -101
- package/esm/components/progressbar/progressbar.js +0 -175
- package/esm/components/pull-to-refresh/pull-to-refresh.js +0 -62
- package/esm/components/radio/radio.js +0 -3
- package/esm/components/range/range.js +0 -81
- package/esm/components/searchbar/remove-diacritics.js +0 -277
- package/esm/components/searchbar/searchbar.js +0 -129
- package/esm/components/sheet/sheet.js +0 -71
- package/esm/components/skeleton/skeleton.js +0 -3
- package/esm/components/smart-select/smart-select.js +0 -139
- package/esm/components/sortable/sortable.js +0 -310
- package/esm/components/stepper/stepper.js +0 -84
- package/esm/components/swipeout/swipeout.js +0 -606
- package/esm/components/swiper/swiper.js +0 -177
- package/esm/components/tabs/tabs.js +0 -286
- package/esm/components/text-editor/text-editor.js +0 -81
- package/esm/components/timeline/timeline.js +0 -3
- package/esm/components/toast/toast-class.js +0 -132
- package/esm/components/toast/toast.js +0 -40
- package/esm/components/toggle/toggle.js +0 -61
- package/esm/components/tooltip/tooltip.js +0 -135
- package/esm/components/touch-ripple/touch-ripple-class.js +0 -103
- package/esm/components/touch-ripple/touch-ripple.js +0 -25
- package/esm/components/treeview/treeview.js +0 -78
- package/esm/components/typography/typography.js +0 -3
- package/esm/components/virtual-list/virtual-list.js +0 -17
- package/esm/modules/component/$h.js +0 -20
- package/esm/modules/component/$jsx.js +0 -24
- package/esm/modules/component/component-class.js +0 -402
- package/esm/modules/component/parse-component.js +0 -70
- package/esm/modules/resize/resize.js +0 -64
- package/esm/modules/router/component-loader.js +0 -133
- package/esm/modules/store/create-store.js +0 -164
- package/esm/shared/$jsx.js +0 -33
- package/esm/shared/class.js +0 -197
- package/esm/shared/constructor-methods.js +0 -65
- package/esm/shared/events-class.js +0 -119
- package/esm/shared/modal-methods.js +0 -95
- package/esm/shared/request.js +0 -545
- package/lite/package.json +0 -8
- package/lite-bundle/package.json +0 -8
- package/modules/clicks/package.json +0 -9
- package/modules/component/package.json +0 -9
- package/modules/device/package.json +0 -9
- package/modules/history/package.json +0 -9
- package/modules/request/package.json +0 -9
- package/modules/resize/package.json +0 -9
- package/modules/router/package.json +0 -9
- package/modules/service-worker/package.json +0 -9
- package/modules/store/package.json +0 -9
- package/modules/support/package.json +0 -9
- package/modules/touch/package.json +0 -9
- package/modules/utils/package.json +0 -9
- package/types/components/accordion/accordion.d.ts +0 -55
- package/types/components/actions/actions.d.ts +0 -158
- package/types/components/app/app-class.d.ts +0 -196
- package/types/components/appbar/appbar.d.ts +0 -10
- package/types/components/area-chart/area-chart.d.ts +0 -124
- package/types/components/autocomplete/autocomplete.d.ts +0 -191
- package/types/components/badge/badge.d.ts +0 -10
- package/types/components/block/block.d.ts +0 -10
- package/types/components/button/button.d.ts +0 -10
- package/types/components/calendar/calendar.d.ts +0 -304
- package/types/components/card/card.d.ts +0 -65
- package/types/components/checkbox/checkbox.d.ts +0 -10
- package/types/components/chip/chip.d.ts +0 -10
- package/types/components/color-picker/color-picker.d.ts +0 -229
- package/types/components/contacts-list/contacts-list.d.ts +0 -10
- package/types/components/data-table/data-table.d.ts +0 -57
- package/types/components/dialog/dialog.d.ts +0 -241
- package/types/components/elevation/elevation.d.ts +0 -10
- package/types/components/fab/fab.d.ts +0 -28
- package/types/components/form/form.d.ts +0 -60
- package/types/components/gauge/gauge.d.ts +0 -96
- package/types/components/grid/grid.d.ts +0 -17
- package/types/components/icon/icon.d.ts +0 -10
- package/types/components/infinite-scroll/infinite-scroll.d.ts +0 -23
- package/types/components/input/input.d.ts +0 -56
- package/types/components/lazy/lazy.d.ts +0 -53
- package/types/components/link/link.d.ts +0 -10
- package/types/components/list/list.d.ts +0 -10
- package/types/components/list-index/list-index.d.ts +0 -99
- package/types/components/login-screen/login-screen.d.ts +0 -95
- package/types/components/menu/menu.d.ts +0 -28
- package/types/components/messagebar/messagebar.d.ts +0 -161
- package/types/components/messages/messages.d.ts +0 -158
- package/types/components/modal/modal.d.ts +0 -78
- package/types/components/navbar/navbar.d.ts +0 -75
- package/types/components/notification/notification.d.ts +0 -118
- package/types/components/page/page.d.ts +0 -10
- package/types/components/panel/panel.d.ts +0 -194
- package/types/components/photo-browser/photo-browser.d.ts +0 -194
- package/types/components/picker/picker.d.ts +0 -216
- package/types/components/pie-chart/pie-chart.d.ts +0 -95
- package/types/components/popover/popover.d.ts +0 -127
- package/types/components/popup/popup.d.ts +0 -135
- package/types/components/preloader/preloader.d.ts +0 -18
- package/types/components/progressbar/progressbar.d.ts +0 -27
- package/types/components/pull-to-refresh/pull-to-refresh.d.ts +0 -99
- package/types/components/radio/radio.d.ts +0 -10
- package/types/components/range/range.d.ts +0 -121
- package/types/components/searchbar/searchbar.d.ts +0 -157
- package/types/components/sheet/sheet.d.ts +0 -149
- package/types/components/skeleton/skeleton.d.ts +0 -10
- package/types/components/smart-select/smart-select.d.ts +0 -199
- package/types/components/sortable/sortable.d.ts +0 -46
- package/types/components/statusbar/statusbar.d.ts +0 -50
- package/types/components/stepper/stepper.d.ts +0 -117
- package/types/components/subnavbar/subnavbar.d.ts +0 -11
- package/types/components/swipeout/swipeout.d.ts +0 -68
- package/types/components/swiper/swiper.d.ts +0 -21
- package/types/components/tabs/tabs.d.ts +0 -39
- package/types/components/text-editor/text-editor.d.ts +0 -162
- package/types/components/timeline/timeline.d.ts +0 -10
- package/types/components/toast/toast.d.ts +0 -117
- package/types/components/toggle/toggle.d.ts +0 -69
- package/types/components/toolbar/toolbar.d.ts +0 -43
- package/types/components/tooltip/tooltip.d.ts +0 -101
- package/types/components/touch-ripple/touch-ripple.d.ts +0 -21
- package/types/components/treeview/treeview.d.ts +0 -38
- package/types/components/typography/typography.d.ts +0 -10
- package/types/components/view/view.d.ts +0 -205
- package/types/components/virtual-list/virtual-list.d.ts +0 -138
- package/types/modules/clicks/clicks.d.ts +0 -19
- package/types/modules/component/component.d.ts +0 -94
- package/types/modules/component/snabbdom/h.d.ts +0 -10
- package/types/modules/component/snabbdom/helpers/attachto.d.ts +0 -9
- package/types/modules/component/snabbdom/hooks.d.ts +0 -23
- package/types/modules/component/snabbdom/htmldomapi.d.ts +0 -19
- package/types/modules/component/snabbdom/is.d.ts +0 -2
- package/types/modules/component/snabbdom/modules/attributes.d.ts +0 -4
- package/types/modules/component/snabbdom/modules/class.d.ts +0 -4
- package/types/modules/component/snabbdom/modules/dataset.d.ts +0 -4
- package/types/modules/component/snabbdom/modules/eventlisteners.d.ts +0 -8
- package/types/modules/component/snabbdom/modules/hero.d.ts +0 -6
- package/types/modules/component/snabbdom/modules/module.d.ts +0 -9
- package/types/modules/component/snabbdom/modules/props.d.ts +0 -4
- package/types/modules/component/snabbdom/modules/style.d.ts +0 -7
- package/types/modules/component/snabbdom/snabbdom.bundle.d.ts +0 -5
- package/types/modules/component/snabbdom/snabbdom.d.ts +0 -6
- package/types/modules/component/snabbdom/thunk.d.ts +0 -14
- package/types/modules/component/snabbdom/tovnode.d.ts +0 -4
- package/types/modules/component/snabbdom/vnode.d.ts +0 -36
- package/types/modules/device/device.d.ts +0 -14
- package/types/modules/request/request.d.ts +0 -15
- package/types/modules/resize/resize.d.ts +0 -25
- package/types/modules/router/router.d.ts +0 -356
- package/types/modules/service-worker/service-worker.d.ts +0 -38
- package/types/modules/store/store.d.ts +0 -40
- package/types/modules/support/support.d.ts +0 -15
- package/types/modules/touch/touch.d.ts +0 -62
- package/types/modules/utils/utils.d.ts +0 -15
- package/types/package.json +0 -6
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2
|
-
|
|
3
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
4
|
-
|
|
5
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
6
|
-
|
|
7
1
|
import { getWindow, getDocument } from 'ssr-window';
|
|
8
2
|
import { pathToRegexp, compile } from 'path-to-regexp';
|
|
9
3
|
import $ from '../../shared/dom7';
|
|
@@ -18,23 +12,17 @@ import { back } from './back';
|
|
|
18
12
|
import { clearPreviousHistory } from './clear-previous-history';
|
|
19
13
|
import appRouterCheck from './app-router-check';
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var _this;
|
|
26
|
-
|
|
27
|
-
_this = _Framework7Class.call(this, {}, [typeof view === 'undefined' ? app : view]) || this;
|
|
28
|
-
|
|
29
|
-
var router = _assertThisInitialized(_this); // Is App Router
|
|
30
|
-
|
|
15
|
+
class Router extends Framework7Class {
|
|
16
|
+
constructor(app, view) {
|
|
17
|
+
super({}, [typeof view === 'undefined' ? app : view]);
|
|
18
|
+
const router = this; // Is App Router
|
|
31
19
|
|
|
32
20
|
router.isAppRouter = typeof view === 'undefined';
|
|
33
21
|
|
|
34
22
|
if (router.isAppRouter) {
|
|
35
23
|
// App Router
|
|
36
24
|
extend(false, router, {
|
|
37
|
-
app
|
|
25
|
+
app,
|
|
38
26
|
params: app.params.view,
|
|
39
27
|
routes: app.routes || [],
|
|
40
28
|
cache: app.cache
|
|
@@ -42,8 +30,8 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
42
30
|
} else {
|
|
43
31
|
// View Router
|
|
44
32
|
extend(false, router, {
|
|
45
|
-
app
|
|
46
|
-
view
|
|
33
|
+
app,
|
|
34
|
+
view,
|
|
47
35
|
viewId: view.id,
|
|
48
36
|
id: view.params.routerId,
|
|
49
37
|
params: view.params,
|
|
@@ -62,45 +50,45 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
62
50
|
|
|
63
51
|
router.allowPageChange = true; // Current Route
|
|
64
52
|
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
let currentRoute = {};
|
|
54
|
+
let previousRoute = {};
|
|
67
55
|
Object.defineProperty(router, 'currentRoute', {
|
|
68
56
|
enumerable: true,
|
|
69
57
|
configurable: true,
|
|
70
|
-
set: function set(newRoute) {
|
|
71
|
-
if (newRoute === void 0) {
|
|
72
|
-
newRoute = {};
|
|
73
|
-
}
|
|
74
58
|
|
|
59
|
+
set(newRoute = {}) {
|
|
75
60
|
previousRoute = extend({}, currentRoute);
|
|
76
61
|
currentRoute = newRoute;
|
|
77
62
|
if (!currentRoute) return;
|
|
78
63
|
router.url = currentRoute.url;
|
|
79
64
|
router.emit('routeChange', newRoute, previousRoute, router);
|
|
80
65
|
},
|
|
81
|
-
|
|
66
|
+
|
|
67
|
+
get() {
|
|
82
68
|
return currentRoute;
|
|
83
69
|
}
|
|
70
|
+
|
|
84
71
|
});
|
|
85
72
|
Object.defineProperty(router, 'previousRoute', {
|
|
86
73
|
enumerable: true,
|
|
87
74
|
configurable: true,
|
|
88
|
-
|
|
75
|
+
|
|
76
|
+
get() {
|
|
89
77
|
return previousRoute;
|
|
90
78
|
},
|
|
91
|
-
|
|
79
|
+
|
|
80
|
+
set(newRoute) {
|
|
92
81
|
previousRoute = newRoute;
|
|
93
82
|
}
|
|
83
|
+
|
|
94
84
|
});
|
|
95
|
-
return router
|
|
85
|
+
return router;
|
|
96
86
|
}
|
|
97
87
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
var view = router.view;
|
|
103
|
-
var document = getDocument();
|
|
88
|
+
mount() {
|
|
89
|
+
const router = this;
|
|
90
|
+
const view = router.view;
|
|
91
|
+
const document = getDocument();
|
|
104
92
|
extend(false, router, {
|
|
105
93
|
tempDom: document.createElement('div'),
|
|
106
94
|
$el: view.$el,
|
|
@@ -109,21 +97,21 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
109
97
|
navbarsEl: view.navbarsEl
|
|
110
98
|
});
|
|
111
99
|
router.emit('local::mount routerMount', router);
|
|
112
|
-
}
|
|
100
|
+
}
|
|
113
101
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
102
|
+
animatableNavElements($newNavbarEl, $oldNavbarEl, toLarge, fromLarge, direction) {
|
|
103
|
+
const router = this;
|
|
104
|
+
const dynamicNavbar = router.dynamicNavbar;
|
|
105
|
+
const animateIcon = router.params.iosAnimateNavbarBackIcon;
|
|
106
|
+
let newNavEls;
|
|
107
|
+
let oldNavEls;
|
|
120
108
|
|
|
121
109
|
function animatableNavEl($el, $navbarInner) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
110
|
+
const isSliding = $el.hasClass('sliding') || $navbarInner.hasClass('sliding');
|
|
111
|
+
const isSubnavbar = $el.hasClass('subnavbar');
|
|
112
|
+
const needsOpacityTransition = isSliding ? !isSubnavbar : true;
|
|
113
|
+
const $iconEl = $el.find('.back .icon');
|
|
114
|
+
let isIconLabel;
|
|
127
115
|
|
|
128
116
|
if (isSliding && animateIcon && $el.hasClass('left') && $iconEl.length > 0 && $iconEl.next('span').length) {
|
|
129
117
|
$el = $iconEl.next('span'); // eslint-disable-line
|
|
@@ -132,29 +120,29 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
132
120
|
}
|
|
133
121
|
|
|
134
122
|
return {
|
|
135
|
-
$el
|
|
136
|
-
isIconLabel
|
|
123
|
+
$el,
|
|
124
|
+
isIconLabel,
|
|
137
125
|
leftOffset: $el[0].f7NavbarLeftOffset,
|
|
138
126
|
rightOffset: $el[0].f7NavbarRightOffset,
|
|
139
|
-
isSliding
|
|
140
|
-
isSubnavbar
|
|
141
|
-
needsOpacityTransition
|
|
127
|
+
isSliding,
|
|
128
|
+
isSubnavbar,
|
|
129
|
+
needsOpacityTransition
|
|
142
130
|
};
|
|
143
131
|
}
|
|
144
132
|
|
|
145
133
|
if (dynamicNavbar) {
|
|
146
134
|
newNavEls = [];
|
|
147
135
|
oldNavEls = [];
|
|
148
|
-
$newNavbarEl.children('.navbar-inner').children('.left, .right, .title, .subnavbar').each(
|
|
149
|
-
|
|
136
|
+
$newNavbarEl.children('.navbar-inner').children('.left, .right, .title, .subnavbar').each(navEl => {
|
|
137
|
+
const $navEl = $(navEl);
|
|
150
138
|
if ($navEl.hasClass('left') && fromLarge && direction === 'forward') return;
|
|
151
139
|
if ($navEl.hasClass('title') && toLarge) return;
|
|
152
140
|
newNavEls.push(animatableNavEl($navEl, $newNavbarEl.children('.navbar-inner')));
|
|
153
141
|
});
|
|
154
142
|
|
|
155
143
|
if (!($oldNavbarEl.hasClass('navbar-master') && router.params.masterDetailBreakpoint > 0 && router.app.width >= router.params.masterDetailBreakpoint)) {
|
|
156
|
-
$oldNavbarEl.children('.navbar-inner').children('.left, .right, .title, .subnavbar').each(
|
|
157
|
-
|
|
144
|
+
$oldNavbarEl.children('.navbar-inner').children('.left, .right, .title, .subnavbar').each(navEl => {
|
|
145
|
+
const $navEl = $(navEl);
|
|
158
146
|
if ($navEl.hasClass('left') && toLarge && !fromLarge && direction === 'forward') return;
|
|
159
147
|
if ($navEl.hasClass('left') && toLarge && direction === 'backward') return;
|
|
160
148
|
|
|
@@ -166,16 +154,18 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
166
154
|
});
|
|
167
155
|
}
|
|
168
156
|
|
|
169
|
-
[oldNavEls, newNavEls].forEach(
|
|
170
|
-
navEls.forEach(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
157
|
+
[oldNavEls, newNavEls].forEach(navEls => {
|
|
158
|
+
navEls.forEach(navEl => {
|
|
159
|
+
const n = navEl;
|
|
160
|
+
const {
|
|
161
|
+
isSliding,
|
|
162
|
+
$el
|
|
163
|
+
} = navEl;
|
|
164
|
+
const otherEls = navEls === oldNavEls ? newNavEls : oldNavEls;
|
|
175
165
|
if (!(isSliding && $el.hasClass('title') && otherEls)) return;
|
|
176
|
-
otherEls.forEach(
|
|
166
|
+
otherEls.forEach(otherNavEl => {
|
|
177
167
|
if (otherNavEl.isIconLabel) {
|
|
178
|
-
|
|
168
|
+
const iconTextEl = otherNavEl.$el[0];
|
|
179
169
|
n.leftOffset += iconTextEl ? iconTextEl.offsetLeft || 0 : 0;
|
|
180
170
|
}
|
|
181
171
|
});
|
|
@@ -184,26 +174,26 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
184
174
|
}
|
|
185
175
|
|
|
186
176
|
return {
|
|
187
|
-
newNavEls
|
|
188
|
-
oldNavEls
|
|
177
|
+
newNavEls,
|
|
178
|
+
oldNavEls
|
|
189
179
|
};
|
|
190
|
-
}
|
|
180
|
+
}
|
|
191
181
|
|
|
192
|
-
|
|
193
|
-
|
|
182
|
+
animate($oldPageEl, $newPageEl, $oldNavbarEl, $newNavbarEl, direction, transition, callback) {
|
|
183
|
+
const router = this;
|
|
194
184
|
|
|
195
185
|
if (router.params.animateCustom) {
|
|
196
186
|
router.params.animateCustom.apply(router, [$oldPageEl, $newPageEl, $oldNavbarEl, $newNavbarEl, direction, callback]);
|
|
197
187
|
return;
|
|
198
188
|
}
|
|
199
189
|
|
|
200
|
-
|
|
201
|
-
|
|
190
|
+
const dynamicNavbar = router.dynamicNavbar;
|
|
191
|
+
const ios = router.app.theme === 'ios';
|
|
202
192
|
|
|
203
193
|
if (transition) {
|
|
204
|
-
|
|
194
|
+
const routerCustomTransitionClass = `router-transition-custom router-transition-${transition}-${direction}`; // Animate
|
|
205
195
|
|
|
206
|
-
|
|
196
|
+
const onCustomTransitionDone = () => {
|
|
207
197
|
router.$el.removeClass(routerCustomTransitionClass);
|
|
208
198
|
|
|
209
199
|
if (dynamicNavbar && router.$navbarsEl.length) {
|
|
@@ -240,17 +230,17 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
240
230
|
} // Router Animation class
|
|
241
231
|
|
|
242
232
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
233
|
+
const routerTransitionClass = `router-transition-${direction} router-transition`;
|
|
234
|
+
let newNavEls;
|
|
235
|
+
let oldNavEls;
|
|
236
|
+
let fromLarge;
|
|
237
|
+
let toLarge;
|
|
238
|
+
let toDifferent;
|
|
239
|
+
let oldIsLarge;
|
|
240
|
+
let newIsLarge;
|
|
251
241
|
|
|
252
242
|
if (ios && dynamicNavbar) {
|
|
253
|
-
|
|
243
|
+
const betweenMasterAndDetail = router.params.masterDetailBreakpoint > 0 && router.app.width >= router.params.masterDetailBreakpoint && ($oldNavbarEl.hasClass('navbar-master') && $newNavbarEl.hasClass('navbar-master-detail') || $oldNavbarEl.hasClass('navbar-master-detail') && $newNavbarEl.hasClass('navbar-master'));
|
|
254
244
|
|
|
255
245
|
if (!betweenMasterAndDetail) {
|
|
256
246
|
oldIsLarge = $oldNavbarEl && $oldNavbarEl.hasClass('navbar-large');
|
|
@@ -260,7 +250,7 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
260
250
|
toDifferent = fromLarge && !toLarge || toLarge && !fromLarge;
|
|
261
251
|
}
|
|
262
252
|
|
|
263
|
-
|
|
253
|
+
const navEls = router.animatableNavElements($newNavbarEl, $oldNavbarEl, toLarge, fromLarge, direction);
|
|
264
254
|
newNavEls = navEls.newNavEls;
|
|
265
255
|
oldNavEls = navEls.oldNavEls;
|
|
266
256
|
}
|
|
@@ -280,28 +270,28 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
280
270
|
}
|
|
281
271
|
}
|
|
282
272
|
|
|
283
|
-
newNavEls.forEach(
|
|
284
|
-
|
|
285
|
-
|
|
273
|
+
newNavEls.forEach(navEl => {
|
|
274
|
+
const $el = navEl.$el;
|
|
275
|
+
const offset = direction === 'forward' ? navEl.rightOffset : navEl.leftOffset;
|
|
286
276
|
|
|
287
277
|
if (navEl.isSliding) {
|
|
288
278
|
if (navEl.isSubnavbar && newIsLarge) {
|
|
289
279
|
// prettier-ignore
|
|
290
|
-
$el[0].style.setProperty('transform',
|
|
280
|
+
$el[0].style.setProperty('transform', `translate3d(${offset * (1 - progress)}px, calc(-1 * var(--f7-navbar-large-collapse-progress) * var(--f7-navbar-large-title-height)), 0)`, 'important');
|
|
291
281
|
} else {
|
|
292
|
-
$el.transform(
|
|
282
|
+
$el.transform(`translate3d(${offset * (1 - progress)}px,0,0)`);
|
|
293
283
|
}
|
|
294
284
|
}
|
|
295
285
|
});
|
|
296
|
-
oldNavEls.forEach(
|
|
297
|
-
|
|
298
|
-
|
|
286
|
+
oldNavEls.forEach(navEl => {
|
|
287
|
+
const $el = navEl.$el;
|
|
288
|
+
const offset = direction === 'forward' ? navEl.leftOffset : navEl.rightOffset;
|
|
299
289
|
|
|
300
290
|
if (navEl.isSliding) {
|
|
301
291
|
if (navEl.isSubnavbar && oldIsLarge) {
|
|
302
|
-
$el.transform(
|
|
292
|
+
$el.transform(`translate3d(${offset * progress}px, calc(-1 * var(--f7-navbar-large-collapse-progress) * var(--f7-navbar-large-title-height)), 0)`);
|
|
303
293
|
} else {
|
|
304
|
-
$el.transform(
|
|
294
|
+
$el.transform(`translate3d(${offset * progress}px,0,0)`);
|
|
305
295
|
}
|
|
306
296
|
}
|
|
307
297
|
});
|
|
@@ -313,7 +303,7 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
313
303
|
if ($newNavbarEl) {
|
|
314
304
|
$newNavbarEl.removeClass('router-navbar-transition-to-large router-navbar-transition-from-large');
|
|
315
305
|
$newNavbarEl.addClass('navbar-no-title-large-transition');
|
|
316
|
-
nextFrame(
|
|
306
|
+
nextFrame(() => {
|
|
317
307
|
$newNavbarEl.removeClass('navbar-no-title-large-transition');
|
|
318
308
|
});
|
|
319
309
|
}
|
|
@@ -339,14 +329,14 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
339
329
|
if (callback) callback();
|
|
340
330
|
}
|
|
341
331
|
|
|
342
|
-
(direction === 'forward' ? $newPageEl : $oldPageEl).animationEnd(
|
|
332
|
+
(direction === 'forward' ? $newPageEl : $oldPageEl).animationEnd(() => {
|
|
343
333
|
onDone();
|
|
344
334
|
}); // Animate
|
|
345
335
|
|
|
346
336
|
if (dynamicNavbar) {
|
|
347
337
|
// Prepare Navbars
|
|
348
338
|
animateNavbars(0);
|
|
349
|
-
nextFrame(
|
|
339
|
+
nextFrame(() => {
|
|
350
340
|
// Add class, start animation
|
|
351
341
|
router.$el.addClass(routerTransitionClass);
|
|
352
342
|
|
|
@@ -361,28 +351,28 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
361
351
|
// Add class, start animation
|
|
362
352
|
router.$el.addClass(routerTransitionClass);
|
|
363
353
|
}
|
|
364
|
-
}
|
|
354
|
+
}
|
|
365
355
|
|
|
366
|
-
|
|
367
|
-
|
|
356
|
+
removeModal(modalEl) {
|
|
357
|
+
const router = this;
|
|
368
358
|
router.removeEl(modalEl);
|
|
369
359
|
} // eslint-disable-next-line
|
|
370
|
-
;
|
|
371
360
|
|
|
372
|
-
|
|
373
|
-
|
|
361
|
+
|
|
362
|
+
removeTabContent(tabEl) {
|
|
363
|
+
const $tabEl = $(tabEl);
|
|
374
364
|
$tabEl.html('');
|
|
375
|
-
}
|
|
365
|
+
}
|
|
376
366
|
|
|
377
|
-
|
|
378
|
-
|
|
367
|
+
removeNavbar(el) {
|
|
368
|
+
const router = this;
|
|
379
369
|
router.removeEl(el);
|
|
380
|
-
}
|
|
370
|
+
}
|
|
381
371
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
372
|
+
removePage(el) {
|
|
373
|
+
const $el = $(el);
|
|
374
|
+
const f7Page = $el && $el[0] && $el[0].f7Page;
|
|
375
|
+
const router = this;
|
|
386
376
|
|
|
387
377
|
if (f7Page && f7Page.route && f7Page.route.route && f7Page.route.route.keepAlive) {
|
|
388
378
|
$el.remove();
|
|
@@ -390,15 +380,15 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
390
380
|
}
|
|
391
381
|
|
|
392
382
|
router.removeEl(el);
|
|
393
|
-
}
|
|
383
|
+
}
|
|
394
384
|
|
|
395
|
-
|
|
385
|
+
removeEl(el) {
|
|
396
386
|
if (!el) return;
|
|
397
|
-
|
|
398
|
-
|
|
387
|
+
const router = this;
|
|
388
|
+
const $el = $(el);
|
|
399
389
|
if ($el.length === 0) return;
|
|
400
|
-
$el.find('.tab').each(
|
|
401
|
-
$(tabEl).children().each(
|
|
390
|
+
$el.find('.tab').each(tabEl => {
|
|
391
|
+
$(tabEl).children().each(tabChild => {
|
|
402
392
|
if (tabChild.f7Component) {
|
|
403
393
|
$(tabChild).trigger('tab:beforeremove');
|
|
404
394
|
tabChild.f7Component.destroy();
|
|
@@ -415,16 +405,16 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
415
405
|
}
|
|
416
406
|
|
|
417
407
|
if (router.params.removeElementsWithTimeout) {
|
|
418
|
-
setTimeout(
|
|
408
|
+
setTimeout(() => {
|
|
419
409
|
$el.remove();
|
|
420
410
|
}, router.params.removeElementsTimeout);
|
|
421
411
|
} else {
|
|
422
412
|
$el.remove();
|
|
423
413
|
}
|
|
424
|
-
}
|
|
414
|
+
}
|
|
425
415
|
|
|
426
|
-
|
|
427
|
-
|
|
416
|
+
getPageEl(content) {
|
|
417
|
+
const router = this;
|
|
428
418
|
|
|
429
419
|
if (typeof content === 'string') {
|
|
430
420
|
router.tempDom.innerHTML = content;
|
|
@@ -438,30 +428,28 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
438
428
|
}
|
|
439
429
|
|
|
440
430
|
return router.findElement('.page', router.tempDom);
|
|
441
|
-
}
|
|
431
|
+
}
|
|
442
432
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
433
|
+
findElement(stringSelector, container, notStacked) {
|
|
434
|
+
const router = this;
|
|
435
|
+
const view = router.view;
|
|
436
|
+
const app = router.app; // Modals Selector
|
|
447
437
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
438
|
+
const modalsSelector = '.popup, .dialog, .popover, .actions-modal, .sheet-modal, .login-screen, .page';
|
|
439
|
+
const $container = $(container);
|
|
440
|
+
let selector = stringSelector;
|
|
451
441
|
if (notStacked) selector += ':not(.stacked)';
|
|
452
|
-
|
|
453
|
-
return $(el).parents(modalsSelector).length === 0;
|
|
454
|
-
});
|
|
442
|
+
let found = $container.find(selector).filter(el => $(el).parents(modalsSelector).length === 0);
|
|
455
443
|
|
|
456
444
|
if (found.length > 1) {
|
|
457
445
|
if (typeof view.selector === 'string') {
|
|
458
446
|
// Search in related view
|
|
459
|
-
found = $container.find(view.selector
|
|
447
|
+
found = $container.find(`${view.selector} ${selector}`);
|
|
460
448
|
}
|
|
461
449
|
|
|
462
450
|
if (found.length > 1) {
|
|
463
451
|
// Search in main view
|
|
464
|
-
found = $container.find(
|
|
452
|
+
found = $container.find(`.${app.params.viewMainClass} ${selector}`);
|
|
465
453
|
}
|
|
466
454
|
}
|
|
467
455
|
|
|
@@ -471,22 +459,18 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
471
459
|
if (found && found.length === 1) return found;
|
|
472
460
|
if (found && found.length > 1) return $(found[0]);
|
|
473
461
|
return undefined;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
_proto.flattenRoutes = function flattenRoutes(routes) {
|
|
477
|
-
if (routes === void 0) {
|
|
478
|
-
routes = this.routes;
|
|
479
|
-
}
|
|
462
|
+
}
|
|
480
463
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
464
|
+
flattenRoutes(routes = this.routes) {
|
|
465
|
+
const router = this;
|
|
466
|
+
let flattenedRoutes = [];
|
|
467
|
+
routes.forEach(route => {
|
|
468
|
+
let hasTabRoutes = false;
|
|
485
469
|
|
|
486
470
|
if ('tabs' in route && route.tabs) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
path:
|
|
471
|
+
const mergedPathsRoutes = route.tabs.map(tabRoute => {
|
|
472
|
+
const tRoute = extend({}, route, {
|
|
473
|
+
path: `${route.path}/${tabRoute.path}`.replace('///', '/').replace('//', '/'),
|
|
490
474
|
parentPath: route.path,
|
|
491
475
|
tab: tabRoute
|
|
492
476
|
});
|
|
@@ -499,27 +483,26 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
499
483
|
}
|
|
500
484
|
|
|
501
485
|
if ('detailRoutes' in route) {
|
|
502
|
-
|
|
503
|
-
|
|
486
|
+
const mergedPathsRoutes = route.detailRoutes.map(detailRoute => {
|
|
487
|
+
const dRoute = extend({}, detailRoute);
|
|
504
488
|
dRoute.masterRoute = route;
|
|
505
489
|
dRoute.masterRoutePath = route.path;
|
|
506
490
|
return dRoute;
|
|
507
491
|
});
|
|
508
|
-
|
|
509
|
-
flattenedRoutes = flattenedRoutes.concat(route, router.flattenRoutes(_mergedPathsRoutes));
|
|
492
|
+
flattenedRoutes = flattenedRoutes.concat(route, router.flattenRoutes(mergedPathsRoutes));
|
|
510
493
|
}
|
|
511
494
|
|
|
512
495
|
if ('routes' in route) {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
cRoute.path =
|
|
496
|
+
const mergedPathsRoutes = route.routes.map(childRoute => {
|
|
497
|
+
const cRoute = extend({}, childRoute);
|
|
498
|
+
cRoute.path = `${route.path}/${cRoute.path}`.replace('///', '/').replace('//', '/');
|
|
516
499
|
return cRoute;
|
|
517
500
|
});
|
|
518
501
|
|
|
519
502
|
if (hasTabRoutes) {
|
|
520
|
-
flattenedRoutes = flattenedRoutes.concat(router.flattenRoutes(
|
|
503
|
+
flattenedRoutes = flattenedRoutes.concat(router.flattenRoutes(mergedPathsRoutes));
|
|
521
504
|
} else {
|
|
522
|
-
flattenedRoutes = flattenedRoutes.concat(route, router.flattenRoutes(
|
|
505
|
+
flattenedRoutes = flattenedRoutes.concat(route, router.flattenRoutes(mergedPathsRoutes));
|
|
523
506
|
}
|
|
524
507
|
}
|
|
525
508
|
|
|
@@ -529,96 +512,94 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
529
512
|
});
|
|
530
513
|
return flattenedRoutes;
|
|
531
514
|
} // eslint-disable-next-line
|
|
532
|
-
;
|
|
533
515
|
|
|
534
|
-
|
|
516
|
+
|
|
517
|
+
parseRouteUrl(url) {
|
|
535
518
|
if (!url) return {};
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
519
|
+
const query = parseUrlQuery(url);
|
|
520
|
+
const hash = url.split('#')[1];
|
|
521
|
+
const params = {};
|
|
522
|
+
const path = url.split('#')[0].split('?')[0];
|
|
540
523
|
return {
|
|
541
|
-
query
|
|
542
|
-
hash
|
|
543
|
-
params
|
|
544
|
-
url
|
|
545
|
-
path
|
|
524
|
+
query,
|
|
525
|
+
hash,
|
|
526
|
+
params,
|
|
527
|
+
url,
|
|
528
|
+
path
|
|
546
529
|
};
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
_proto.generateUrl = function generateUrl(parameters) {
|
|
550
|
-
if (parameters === void 0) {
|
|
551
|
-
parameters = {};
|
|
552
|
-
}
|
|
530
|
+
}
|
|
553
531
|
|
|
532
|
+
generateUrl(parameters = {}) {
|
|
554
533
|
if (typeof parameters === 'string') {
|
|
555
534
|
return parameters;
|
|
556
535
|
}
|
|
557
536
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
537
|
+
const {
|
|
538
|
+
name,
|
|
539
|
+
path,
|
|
540
|
+
params,
|
|
541
|
+
query
|
|
542
|
+
} = parameters;
|
|
563
543
|
|
|
564
544
|
if (!name && !path) {
|
|
565
545
|
throw new Error('Framework7: "name" or "path" parameter is required');
|
|
566
546
|
}
|
|
567
547
|
|
|
568
|
-
|
|
569
|
-
|
|
548
|
+
const router = this;
|
|
549
|
+
const route = name ? router.findRouteByKey('name', name) : router.findRouteByKey('path', path);
|
|
570
550
|
|
|
571
551
|
if (!route) {
|
|
572
552
|
if (name) {
|
|
573
|
-
throw new Error(
|
|
553
|
+
throw new Error(`Framework7: route with name "${name}" not found`);
|
|
574
554
|
} else {
|
|
575
|
-
throw new Error(
|
|
555
|
+
throw new Error(`Framework7: route with path "${path}" not found`);
|
|
576
556
|
}
|
|
577
557
|
}
|
|
578
558
|
|
|
579
|
-
|
|
580
|
-
params
|
|
581
|
-
query
|
|
559
|
+
const url = router.constructRouteUrl(route, {
|
|
560
|
+
params,
|
|
561
|
+
query
|
|
582
562
|
});
|
|
583
563
|
|
|
584
564
|
if (!url) {
|
|
585
|
-
throw new Error(
|
|
565
|
+
throw new Error(`Framework7: can't construct URL for route with name "${name}"`);
|
|
586
566
|
}
|
|
587
567
|
|
|
588
568
|
return url;
|
|
589
569
|
} // eslint-disable-next-line
|
|
590
|
-
;
|
|
591
570
|
|
|
592
|
-
_proto.constructRouteUrl = function constructRouteUrl(route, _temp) {
|
|
593
|
-
var _ref = _temp === void 0 ? {} : _temp,
|
|
594
|
-
params = _ref.params,
|
|
595
|
-
query = _ref.query;
|
|
596
571
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
572
|
+
constructRouteUrl(route, {
|
|
573
|
+
params,
|
|
574
|
+
query
|
|
575
|
+
} = {}) {
|
|
576
|
+
const {
|
|
577
|
+
path
|
|
578
|
+
} = route;
|
|
579
|
+
const toUrl = compile(path);
|
|
580
|
+
let url;
|
|
600
581
|
|
|
601
582
|
try {
|
|
602
583
|
url = toUrl(params || {});
|
|
603
584
|
} catch (error) {
|
|
604
|
-
throw new Error(
|
|
585
|
+
throw new Error(`Framework7: error constructing route URL from passed params:\nRoute: ${path}\n${error.toString()}`);
|
|
605
586
|
}
|
|
606
587
|
|
|
607
588
|
if (query) {
|
|
608
|
-
if (typeof query === 'string') url +=
|
|
589
|
+
if (typeof query === 'string') url += `?${query}`;else if (Object.keys(query).length) url += `?${serializeObject(query)}`;
|
|
609
590
|
}
|
|
610
591
|
|
|
611
592
|
return url;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
flattenedRoutes.forEach(
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
findTabRouteUrl(tabEl) {
|
|
596
|
+
const router = this;
|
|
597
|
+
const $tabEl = $(tabEl);
|
|
598
|
+
const parentPath = router.currentRoute.route.parentPath;
|
|
599
|
+
const tabId = $tabEl.attr('id');
|
|
600
|
+
const flattenedRoutes = router.flattenRoutes(router.routes);
|
|
601
|
+
let foundTabRouteUrl;
|
|
602
|
+
flattenedRoutes.forEach(route => {
|
|
622
603
|
if (route.parentPath === parentPath && route.tab && route.tab.id === tabId) {
|
|
623
604
|
if (router.currentRoute.params && Object.keys(router.currentRoute.params).length > 0) {
|
|
624
605
|
foundTabRouteUrl = router.constructRouteUrl(route, {
|
|
@@ -631,14 +612,14 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
631
612
|
}
|
|
632
613
|
});
|
|
633
614
|
return foundTabRouteUrl;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
flattenedRoutes.forEach(
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
findRouteByKey(key, value) {
|
|
618
|
+
const router = this;
|
|
619
|
+
const routes = router.routes;
|
|
620
|
+
const flattenedRoutes = router.flattenRoutes(routes);
|
|
621
|
+
let matchingRoute;
|
|
622
|
+
flattenedRoutes.forEach(route => {
|
|
642
623
|
if (matchingRoute) return;
|
|
643
624
|
|
|
644
625
|
if (route[key] === value) {
|
|
@@ -646,44 +627,43 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
646
627
|
}
|
|
647
628
|
});
|
|
648
629
|
return matchingRoute;
|
|
649
|
-
}
|
|
630
|
+
}
|
|
650
631
|
|
|
651
|
-
|
|
632
|
+
findMatchingRoute(url) {
|
|
652
633
|
if (!url) return undefined;
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
flattenedRoutes.forEach(function (route) {
|
|
634
|
+
const router = this;
|
|
635
|
+
const routes = router.routes;
|
|
636
|
+
const flattenedRoutes = router.flattenRoutes(routes);
|
|
637
|
+
const {
|
|
638
|
+
path,
|
|
639
|
+
query,
|
|
640
|
+
hash,
|
|
641
|
+
params
|
|
642
|
+
} = router.parseRouteUrl(url);
|
|
643
|
+
let matchingRoute;
|
|
644
|
+
flattenedRoutes.forEach(route => {
|
|
665
645
|
if (matchingRoute) return;
|
|
666
|
-
|
|
667
|
-
|
|
646
|
+
const keys = [];
|
|
647
|
+
const pathsToMatch = [route.path];
|
|
668
648
|
|
|
669
649
|
if (route.alias) {
|
|
670
650
|
if (typeof route.alias === 'string') pathsToMatch.push(route.alias);else if (Array.isArray(route.alias)) {
|
|
671
|
-
route.alias.forEach(
|
|
651
|
+
route.alias.forEach(aliasPath => {
|
|
672
652
|
pathsToMatch.push(aliasPath);
|
|
673
653
|
});
|
|
674
654
|
}
|
|
675
655
|
}
|
|
676
656
|
|
|
677
|
-
|
|
678
|
-
pathsToMatch.forEach(
|
|
657
|
+
let matched;
|
|
658
|
+
pathsToMatch.forEach(pathToMatch => {
|
|
679
659
|
if (matched) return;
|
|
680
660
|
matched = pathToRegexp(pathToMatch, keys).exec(path);
|
|
681
661
|
});
|
|
682
662
|
|
|
683
663
|
if (matched) {
|
|
684
|
-
keys.forEach(
|
|
664
|
+
keys.forEach((keyObj, index) => {
|
|
685
665
|
if (typeof keyObj.name === 'number') return;
|
|
686
|
-
|
|
666
|
+
const paramValue = matched[index + 1];
|
|
687
667
|
|
|
688
668
|
if (typeof paramValue === 'undefined' || paramValue === null) {
|
|
689
669
|
params[keyObj.name] = paramValue;
|
|
@@ -691,75 +671,69 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
691
671
|
params[keyObj.name] = decodeURIComponent(paramValue);
|
|
692
672
|
}
|
|
693
673
|
});
|
|
694
|
-
|
|
674
|
+
let parentPath;
|
|
695
675
|
|
|
696
676
|
if (route.parentPath) {
|
|
697
677
|
parentPath = path.split('/').slice(0, route.parentPath.split('/').length - 1).join('/');
|
|
698
678
|
}
|
|
699
679
|
|
|
700
680
|
matchingRoute = {
|
|
701
|
-
query
|
|
702
|
-
hash
|
|
703
|
-
params
|
|
704
|
-
url
|
|
705
|
-
path
|
|
706
|
-
parentPath
|
|
707
|
-
route
|
|
681
|
+
query,
|
|
682
|
+
hash,
|
|
683
|
+
params,
|
|
684
|
+
url,
|
|
685
|
+
path,
|
|
686
|
+
parentPath,
|
|
687
|
+
route,
|
|
708
688
|
name: route.name
|
|
709
689
|
};
|
|
710
690
|
}
|
|
711
691
|
});
|
|
712
692
|
return matchingRoute;
|
|
713
693
|
} // eslint-disable-next-line
|
|
714
|
-
;
|
|
715
694
|
|
|
716
|
-
_proto.replaceRequestUrlParams = function replaceRequestUrlParams(url, options) {
|
|
717
|
-
if (url === void 0) {
|
|
718
|
-
url = '';
|
|
719
|
-
}
|
|
720
695
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
var compiledUrl = url;
|
|
696
|
+
replaceRequestUrlParams(url = '', options = {}) {
|
|
697
|
+
let compiledUrl = url;
|
|
726
698
|
|
|
727
699
|
if (typeof compiledUrl === 'string' && compiledUrl.indexOf('{{') >= 0 && options && options.route && options.route.params && Object.keys(options.route.params).length) {
|
|
728
|
-
Object.keys(options.route.params).forEach(
|
|
729
|
-
|
|
700
|
+
Object.keys(options.route.params).forEach(paramName => {
|
|
701
|
+
const regExp = new RegExp(`{{${paramName}}}`, 'g');
|
|
730
702
|
compiledUrl = compiledUrl.replace(regExp, options.route.params[paramName] || '');
|
|
731
703
|
});
|
|
732
704
|
}
|
|
733
705
|
|
|
734
706
|
return compiledUrl;
|
|
735
|
-
}
|
|
707
|
+
}
|
|
736
708
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
709
|
+
removeFromXhrCache(url) {
|
|
710
|
+
const router = this;
|
|
711
|
+
const xhrCache = router.cache.xhr;
|
|
712
|
+
let index = false;
|
|
741
713
|
|
|
742
|
-
for (
|
|
714
|
+
for (let i = 0; i < xhrCache.length; i += 1) {
|
|
743
715
|
if (xhrCache[i].url === url) index = i;
|
|
744
716
|
}
|
|
745
717
|
|
|
746
718
|
if (index !== false) xhrCache.splice(index, 1);
|
|
747
|
-
}
|
|
719
|
+
}
|
|
748
720
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
721
|
+
xhrRequest(requestUrl, options) {
|
|
722
|
+
const router = this;
|
|
723
|
+
const params = router.params;
|
|
724
|
+
const {
|
|
725
|
+
ignoreCache
|
|
726
|
+
} = options;
|
|
727
|
+
let url = requestUrl;
|
|
728
|
+
let hasQuery = url.indexOf('?') >= 0;
|
|
755
729
|
|
|
756
730
|
if (params.passRouteQueryToRequest && options && options.route && options.route.query && Object.keys(options.route.query).length) {
|
|
757
|
-
url +=
|
|
731
|
+
url += `${hasQuery ? '&' : '?'}${serializeObject(options.route.query)}`;
|
|
758
732
|
hasQuery = true;
|
|
759
733
|
}
|
|
760
734
|
|
|
761
735
|
if (params.passRouteParamsToRequest && options && options.route && options.route.params && Object.keys(options.route.params).length) {
|
|
762
|
-
url +=
|
|
736
|
+
url += `${hasQuery ? '&' : '?'}${serializeObject(options.route.params)}`;
|
|
763
737
|
hasQuery = true;
|
|
764
738
|
}
|
|
765
739
|
|
|
@@ -772,10 +746,10 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
772
746
|
url = url.split('?')[0];
|
|
773
747
|
}
|
|
774
748
|
|
|
775
|
-
return new Promise(
|
|
749
|
+
return new Promise((resolve, reject) => {
|
|
776
750
|
if (params.xhrCache && !ignoreCache && url.indexOf('nocache') < 0 && params.xhrCacheIgnore.indexOf(url) < 0) {
|
|
777
|
-
for (
|
|
778
|
-
|
|
751
|
+
for (let i = 0; i < router.cache.xhr.length; i += 1) {
|
|
752
|
+
const cachedUrl = router.cache.xhr[i];
|
|
779
753
|
|
|
780
754
|
if (cachedUrl.url === url) {
|
|
781
755
|
// Check expiration
|
|
@@ -791,19 +765,21 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
791
765
|
router.xhrAbortController = router.app.request.abortController();
|
|
792
766
|
router.app.request({
|
|
793
767
|
abortController: router.xhrAbortController,
|
|
794
|
-
url
|
|
768
|
+
url,
|
|
795
769
|
method: 'GET',
|
|
796
|
-
|
|
770
|
+
|
|
771
|
+
beforeSend(xhr) {
|
|
797
772
|
router.emit('routerAjaxStart', xhr, options);
|
|
798
773
|
},
|
|
799
|
-
|
|
774
|
+
|
|
775
|
+
complete(xhr, status) {
|
|
800
776
|
router.emit('routerAjaxComplete', xhr);
|
|
801
777
|
|
|
802
778
|
if (status !== 'error' && status !== 'timeout' && xhr.status >= 200 && xhr.status < 300 || xhr.status === 0) {
|
|
803
779
|
if (params.xhrCache && xhr.responseText !== '') {
|
|
804
780
|
router.removeFromXhrCache(url);
|
|
805
781
|
router.cache.xhr.push({
|
|
806
|
-
url
|
|
782
|
+
url,
|
|
807
783
|
time: now(),
|
|
808
784
|
content: xhr.responseText
|
|
809
785
|
});
|
|
@@ -816,20 +792,22 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
816
792
|
reject(xhr);
|
|
817
793
|
}
|
|
818
794
|
},
|
|
819
|
-
|
|
795
|
+
|
|
796
|
+
error(xhr) {
|
|
820
797
|
router.emit('routerAjaxError', xhr, options);
|
|
821
798
|
reject(xhr);
|
|
822
799
|
}
|
|
800
|
+
|
|
823
801
|
});
|
|
824
802
|
});
|
|
825
|
-
}
|
|
803
|
+
}
|
|
826
804
|
|
|
827
|
-
|
|
828
|
-
|
|
805
|
+
setNavbarPosition($el, position, ariaHidden) {
|
|
806
|
+
const router = this;
|
|
829
807
|
$el.removeClass('navbar-previous navbar-current navbar-next');
|
|
830
808
|
|
|
831
809
|
if (position) {
|
|
832
|
-
$el.addClass(
|
|
810
|
+
$el.addClass(`navbar-${position}`);
|
|
833
811
|
}
|
|
834
812
|
|
|
835
813
|
if (ariaHidden === false) {
|
|
@@ -839,15 +817,15 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
839
817
|
}
|
|
840
818
|
|
|
841
819
|
$el.trigger('navbar:position', {
|
|
842
|
-
position
|
|
820
|
+
position
|
|
843
821
|
});
|
|
844
822
|
router.emit('navbarPosition', $el[0], position);
|
|
845
|
-
}
|
|
823
|
+
}
|
|
846
824
|
|
|
847
|
-
|
|
848
|
-
|
|
825
|
+
setPagePosition($el, position, ariaHidden) {
|
|
826
|
+
const router = this;
|
|
849
827
|
$el.removeClass('page-previous page-current page-next');
|
|
850
|
-
$el.addClass(
|
|
828
|
+
$el.addClass(`page-${position}`);
|
|
851
829
|
|
|
852
830
|
if (ariaHidden === false) {
|
|
853
831
|
$el.removeAttr('aria-hidden');
|
|
@@ -856,16 +834,16 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
856
834
|
}
|
|
857
835
|
|
|
858
836
|
$el.trigger('page:position', {
|
|
859
|
-
position
|
|
837
|
+
position
|
|
860
838
|
});
|
|
861
839
|
router.emit('pagePosition', $el[0], position);
|
|
862
840
|
} // Remove theme elements
|
|
863
|
-
;
|
|
864
841
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
842
|
+
|
|
843
|
+
removeThemeElements(el) {
|
|
844
|
+
const router = this;
|
|
845
|
+
const theme = router.app.theme;
|
|
846
|
+
let toRemove;
|
|
869
847
|
|
|
870
848
|
if (theme === 'ios') {
|
|
871
849
|
toRemove = '.md-only, .aurora-only, .if-md, .if-aurora, .if-not-ios, .not-ios';
|
|
@@ -876,24 +854,20 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
876
854
|
}
|
|
877
855
|
|
|
878
856
|
$(el).find(toRemove).remove();
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
_proto.getPageData = function getPageData(pageEl, navbarEl, from, to, route, pageFromEl) {
|
|
882
|
-
if (route === void 0) {
|
|
883
|
-
route = {};
|
|
884
|
-
}
|
|
857
|
+
}
|
|
885
858
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
859
|
+
getPageData(pageEl, navbarEl, from, to, route = {}, pageFromEl) {
|
|
860
|
+
const router = this;
|
|
861
|
+
const $pageEl = $(pageEl).eq(0);
|
|
862
|
+
const $navbarEl = $(navbarEl).eq(0);
|
|
863
|
+
const currentPage = $pageEl[0].f7Page || {};
|
|
864
|
+
let direction;
|
|
865
|
+
let pageFrom;
|
|
892
866
|
if (from === 'next' && to === 'current' || from === 'current' && to === 'previous') direction = 'forward';
|
|
893
867
|
if (from === 'current' && to === 'next' || from === 'previous' && to === 'current') direction = 'backward';
|
|
894
868
|
|
|
895
869
|
if (currentPage && !currentPage.fromPage) {
|
|
896
|
-
|
|
870
|
+
const $pageFromEl = $(pageFromEl);
|
|
897
871
|
|
|
898
872
|
if ($pageFromEl.length) {
|
|
899
873
|
pageFrom = $pageFromEl[0].f7Page;
|
|
@@ -906,56 +880,53 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
906
880
|
pageFrom.pageFrom = null;
|
|
907
881
|
}
|
|
908
882
|
|
|
909
|
-
|
|
883
|
+
const page = {
|
|
910
884
|
app: router.app,
|
|
911
885
|
view: router.view,
|
|
912
|
-
router
|
|
886
|
+
router,
|
|
913
887
|
$el: $pageEl,
|
|
914
888
|
el: $pageEl[0],
|
|
915
|
-
$pageEl
|
|
889
|
+
$pageEl,
|
|
916
890
|
pageEl: $pageEl[0],
|
|
917
|
-
$navbarEl
|
|
891
|
+
$navbarEl,
|
|
918
892
|
navbarEl: $navbarEl[0],
|
|
919
893
|
name: $pageEl.attr('data-name'),
|
|
920
894
|
position: from,
|
|
921
|
-
from
|
|
922
|
-
to
|
|
923
|
-
direction
|
|
895
|
+
from,
|
|
896
|
+
to,
|
|
897
|
+
direction,
|
|
924
898
|
route: currentPage.route ? currentPage.route : route,
|
|
925
|
-
pageFrom
|
|
899
|
+
pageFrom
|
|
926
900
|
};
|
|
927
901
|
$pageEl[0].f7Page = page;
|
|
928
902
|
return page;
|
|
929
903
|
} // Callbacks
|
|
930
|
-
;
|
|
931
904
|
|
|
932
|
-
_proto.pageCallback = function pageCallback(callback, pageEl, navbarEl, from, to, options, pageFromEl) {
|
|
933
|
-
if (options === void 0) {
|
|
934
|
-
options = {};
|
|
935
|
-
}
|
|
936
905
|
|
|
906
|
+
pageCallback(callback, pageEl, navbarEl, from, to, options = {}, pageFromEl) {
|
|
937
907
|
if (!pageEl) return;
|
|
938
|
-
|
|
939
|
-
|
|
908
|
+
const router = this;
|
|
909
|
+
const $pageEl = $(pageEl);
|
|
940
910
|
if (!$pageEl.length) return;
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
911
|
+
const $navbarEl = $(navbarEl);
|
|
912
|
+
const {
|
|
913
|
+
route
|
|
914
|
+
} = options;
|
|
915
|
+
const restoreScrollTopOnBack = router.params.restoreScrollTopOnBack && !(router.params.masterDetailBreakpoint > 0 && $pageEl.hasClass('page-master') && router.app.width >= router.params.masterDetailBreakpoint);
|
|
916
|
+
const keepAlive = $pageEl[0].f7Page && $pageEl[0].f7Page.route && $pageEl[0].f7Page.route.route && $pageEl[0].f7Page.route.route.keepAlive;
|
|
946
917
|
|
|
947
918
|
if (callback === 'beforeRemove' && keepAlive) {
|
|
948
919
|
callback = 'beforeUnmount'; // eslint-disable-line
|
|
949
920
|
}
|
|
950
921
|
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
922
|
+
const camelName = `page${callback[0].toUpperCase() + callback.slice(1, callback.length)}`;
|
|
923
|
+
const colonName = `page:${callback.toLowerCase()}`;
|
|
924
|
+
let page = {};
|
|
954
925
|
|
|
955
926
|
if (callback === 'beforeRemove' && $pageEl[0].f7Page) {
|
|
956
927
|
page = extend($pageEl[0].f7Page, {
|
|
957
|
-
from
|
|
958
|
-
to
|
|
928
|
+
from,
|
|
929
|
+
to,
|
|
959
930
|
position: from
|
|
960
931
|
});
|
|
961
932
|
} else {
|
|
@@ -963,12 +934,10 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
963
934
|
}
|
|
964
935
|
|
|
965
936
|
page.swipeBack = !!options.swipeBack;
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
_ref2$once = _ref2.once,
|
|
971
|
-
once = _ref2$once === void 0 ? {} : _ref2$once;
|
|
937
|
+
const {
|
|
938
|
+
on = {},
|
|
939
|
+
once = {}
|
|
940
|
+
} = options.route ? options.route.route : {};
|
|
972
941
|
|
|
973
942
|
if (options.on) {
|
|
974
943
|
extend(on, options.on);
|
|
@@ -984,7 +953,7 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
984
953
|
|
|
985
954
|
if (on && Object.keys(on).length > 0) {
|
|
986
955
|
$pageEl[0].f7RouteEventsOn = on;
|
|
987
|
-
Object.keys(on).forEach(
|
|
956
|
+
Object.keys(on).forEach(eventName => {
|
|
988
957
|
on[eventName] = on[eventName].bind(router);
|
|
989
958
|
$pageEl.on(eventNameToColonCase(eventName), on[eventName]);
|
|
990
959
|
});
|
|
@@ -992,7 +961,7 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
992
961
|
|
|
993
962
|
if (once && Object.keys(once).length > 0) {
|
|
994
963
|
$pageEl[0].f7RouteEventsOnce = once;
|
|
995
|
-
Object.keys(once).forEach(
|
|
964
|
+
Object.keys(once).forEach(eventName => {
|
|
996
965
|
once[eventName] = once[eventName].bind(router);
|
|
997
966
|
$pageEl.once(eventNameToColonCase(eventName), once[eventName]);
|
|
998
967
|
});
|
|
@@ -1003,13 +972,13 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1003
972
|
if (!$pageEl[0].f7RouteEventsAttached) return;
|
|
1004
973
|
|
|
1005
974
|
if ($pageEl[0].f7RouteEventsOn) {
|
|
1006
|
-
Object.keys($pageEl[0].f7RouteEventsOn).forEach(
|
|
975
|
+
Object.keys($pageEl[0].f7RouteEventsOn).forEach(eventName => {
|
|
1007
976
|
$pageEl.off(eventNameToColonCase(eventName), $pageEl[0].f7RouteEventsOn[eventName]);
|
|
1008
977
|
});
|
|
1009
978
|
}
|
|
1010
979
|
|
|
1011
980
|
if ($pageEl[0].f7RouteEventsOnce) {
|
|
1012
|
-
Object.keys($pageEl[0].f7RouteEventsOnce).forEach(
|
|
981
|
+
Object.keys($pageEl[0].f7RouteEventsOnce).forEach(eventName => {
|
|
1013
982
|
$pageEl.off(eventNameToColonCase(eventName), $pageEl[0].f7RouteEventsOnce[eventName]);
|
|
1014
983
|
});
|
|
1015
984
|
}
|
|
@@ -1028,11 +997,11 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1028
997
|
|
|
1029
998
|
if (callback === 'init') {
|
|
1030
999
|
if (restoreScrollTopOnBack && (from === 'previous' || !from) && to === 'current' && router.scrollHistory[page.route.url] && !$pageEl.hasClass('no-restore-scroll')) {
|
|
1031
|
-
|
|
1000
|
+
let $pageContent = $pageEl.find('.page-content');
|
|
1032
1001
|
|
|
1033
1002
|
if ($pageContent.length > 0) {
|
|
1034
1003
|
// eslint-disable-next-line
|
|
1035
|
-
$pageContent = $pageContent.filter(
|
|
1004
|
+
$pageContent = $pageContent.filter(pageContentEl => {
|
|
1036
1005
|
return $(pageContentEl).parents('.tab:not(.tab-active)').length === 0 && !$(pageContentEl).is('.tab:not(.tab-active)');
|
|
1037
1006
|
});
|
|
1038
1007
|
}
|
|
@@ -1053,16 +1022,16 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1053
1022
|
|
|
1054
1023
|
if (restoreScrollTopOnBack && callback === 'beforeOut' && from === 'current' && to === 'previous') {
|
|
1055
1024
|
// Save scroll position
|
|
1056
|
-
|
|
1025
|
+
let $pageContent = $pageEl.find('.page-content');
|
|
1057
1026
|
|
|
1058
|
-
if (
|
|
1027
|
+
if ($pageContent.length > 0) {
|
|
1059
1028
|
// eslint-disable-next-line
|
|
1060
|
-
|
|
1029
|
+
$pageContent = $pageContent.filter(pageContentEl => {
|
|
1061
1030
|
return $(pageContentEl).parents('.tab:not(.tab-active)').length === 0 && !$(pageContentEl).is('.tab:not(.tab-active)');
|
|
1062
1031
|
});
|
|
1063
1032
|
}
|
|
1064
1033
|
|
|
1065
|
-
router.scrollHistory[page.route.url] =
|
|
1034
|
+
router.scrollHistory[page.route.url] = $pageContent.scrollTop();
|
|
1066
1035
|
}
|
|
1067
1036
|
|
|
1068
1037
|
if (restoreScrollTopOnBack && callback === 'beforeOut' && from === 'current' && to === 'next') {
|
|
@@ -1084,37 +1053,37 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1084
1053
|
$pageEl[0].f7Page = null;
|
|
1085
1054
|
}
|
|
1086
1055
|
}
|
|
1087
|
-
}
|
|
1056
|
+
}
|
|
1088
1057
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1058
|
+
saveHistory() {
|
|
1059
|
+
const router = this;
|
|
1060
|
+
const window = getWindow();
|
|
1092
1061
|
router.view.history = router.history;
|
|
1093
1062
|
|
|
1094
1063
|
if (router.params.browserHistory && router.params.browserHistoryStoreHistory && window.localStorage) {
|
|
1095
|
-
window.localStorage[
|
|
1064
|
+
window.localStorage[`f7router-${router.view.id}-history`] = JSON.stringify(router.history);
|
|
1096
1065
|
}
|
|
1097
|
-
}
|
|
1066
|
+
}
|
|
1098
1067
|
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1068
|
+
restoreHistory() {
|
|
1069
|
+
const router = this;
|
|
1070
|
+
const window = getWindow();
|
|
1102
1071
|
|
|
1103
|
-
if (router.params.browserHistory && router.params.browserHistoryStoreHistory && window.localStorage && window.localStorage[
|
|
1104
|
-
router.history = JSON.parse(window.localStorage[
|
|
1072
|
+
if (router.params.browserHistory && router.params.browserHistoryStoreHistory && window.localStorage && window.localStorage[`f7router-${router.view.id}-history`]) {
|
|
1073
|
+
router.history = JSON.parse(window.localStorage[`f7router-${router.view.id}-history`]);
|
|
1105
1074
|
router.view.history = router.history;
|
|
1106
1075
|
}
|
|
1107
|
-
}
|
|
1076
|
+
}
|
|
1108
1077
|
|
|
1109
|
-
|
|
1110
|
-
|
|
1078
|
+
clearHistory() {
|
|
1079
|
+
const router = this;
|
|
1111
1080
|
router.history = [];
|
|
1112
1081
|
if (router.view) router.view.history = [];
|
|
1113
1082
|
router.saveHistory();
|
|
1114
|
-
}
|
|
1083
|
+
}
|
|
1115
1084
|
|
|
1116
|
-
|
|
1117
|
-
|
|
1085
|
+
updateCurrentUrl(newUrl) {
|
|
1086
|
+
const router = this;
|
|
1118
1087
|
appRouterCheck(router, 'updateCurrentUrl'); // Update history
|
|
1119
1088
|
|
|
1120
1089
|
if (router.history.length) {
|
|
@@ -1124,25 +1093,26 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1124
1093
|
} // Update current route params
|
|
1125
1094
|
|
|
1126
1095
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1096
|
+
const {
|
|
1097
|
+
query,
|
|
1098
|
+
hash,
|
|
1099
|
+
params,
|
|
1100
|
+
url,
|
|
1101
|
+
path
|
|
1102
|
+
} = router.parseRouteUrl(newUrl);
|
|
1133
1103
|
|
|
1134
1104
|
if (router.currentRoute) {
|
|
1135
1105
|
extend(router.currentRoute, {
|
|
1136
|
-
query
|
|
1137
|
-
hash
|
|
1138
|
-
params
|
|
1139
|
-
url
|
|
1140
|
-
path
|
|
1106
|
+
query,
|
|
1107
|
+
hash,
|
|
1108
|
+
params,
|
|
1109
|
+
url,
|
|
1110
|
+
path
|
|
1141
1111
|
});
|
|
1142
1112
|
}
|
|
1143
1113
|
|
|
1144
1114
|
if (router.params.browserHistory) {
|
|
1145
|
-
|
|
1115
|
+
const browserHistoryRoot = router.params.browserHistoryRoot || '';
|
|
1146
1116
|
History.replace(router.view.id, {
|
|
1147
1117
|
url: newUrl
|
|
1148
1118
|
}, browserHistoryRoot + router.params.browserHistorySeparator + newUrl);
|
|
@@ -1151,10 +1121,10 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1151
1121
|
|
|
1152
1122
|
router.saveHistory();
|
|
1153
1123
|
router.emit('routeUrlUpdate', router.currentRoute, router);
|
|
1154
|
-
}
|
|
1124
|
+
}
|
|
1155
1125
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1126
|
+
getInitialUrl() {
|
|
1127
|
+
const router = this;
|
|
1158
1128
|
|
|
1159
1129
|
if (router.initialUrl) {
|
|
1160
1130
|
return {
|
|
@@ -1163,19 +1133,24 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1163
1133
|
};
|
|
1164
1134
|
}
|
|
1165
1135
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1136
|
+
const {
|
|
1137
|
+
app,
|
|
1138
|
+
view
|
|
1139
|
+
} = router;
|
|
1140
|
+
const document = getDocument();
|
|
1141
|
+
const window = getWindow();
|
|
1142
|
+
const location = app.params.url && typeof app.params.url === 'string' && typeof URL !== 'undefined' ? new URL(app.params.url) : document.location;
|
|
1143
|
+
let initialUrl = router.params.url;
|
|
1144
|
+
let documentUrl = location.href.split(location.origin)[1];
|
|
1145
|
+
let historyRestored;
|
|
1146
|
+
const {
|
|
1147
|
+
browserHistory,
|
|
1148
|
+
browserHistoryOnLoad,
|
|
1149
|
+
browserHistorySeparator
|
|
1150
|
+
} = router.params;
|
|
1151
|
+
let {
|
|
1152
|
+
browserHistoryRoot
|
|
1153
|
+
} = router.params;
|
|
1179
1154
|
|
|
1180
1155
|
if ((window.cordova || window.Capacitor && window.Capacitor.isNative) && browserHistory && !browserHistorySeparator && !browserHistoryRoot && location.pathname.indexOf('index.html')) {
|
|
1181
1156
|
// eslint-disable-next-line
|
|
@@ -1231,37 +1206,39 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1231
1206
|
router.initialUrl = initialUrl;
|
|
1232
1207
|
router.historyRestored = historyRestored;
|
|
1233
1208
|
return {
|
|
1234
|
-
initialUrl
|
|
1235
|
-
historyRestored
|
|
1209
|
+
initialUrl,
|
|
1210
|
+
historyRestored
|
|
1236
1211
|
};
|
|
1237
|
-
}
|
|
1212
|
+
}
|
|
1238
1213
|
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1214
|
+
init() {
|
|
1215
|
+
const router = this;
|
|
1216
|
+
const {
|
|
1217
|
+
app,
|
|
1218
|
+
view
|
|
1219
|
+
} = router;
|
|
1220
|
+
const document = getDocument();
|
|
1244
1221
|
router.mount();
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1222
|
+
const {
|
|
1223
|
+
initialUrl,
|
|
1224
|
+
historyRestored
|
|
1225
|
+
} = router.getInitialUrl(); // Init Swipeback
|
|
1250
1226
|
|
|
1251
1227
|
if (view && router.params.iosSwipeBack && app.theme === 'ios' || view && router.params.mdSwipeBack && app.theme === 'md' || view && router.params.auroraSwipeBack && app.theme === 'aurora') {
|
|
1252
1228
|
SwipeBack(router);
|
|
1253
1229
|
}
|
|
1254
1230
|
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1231
|
+
const {
|
|
1232
|
+
browserHistory,
|
|
1233
|
+
browserHistoryOnLoad,
|
|
1234
|
+
browserHistoryAnimateOnLoad,
|
|
1235
|
+
browserHistoryInitialMatch
|
|
1236
|
+
} = router.params;
|
|
1237
|
+
let currentRoute;
|
|
1261
1238
|
|
|
1262
1239
|
if (router.history.length > 1) {
|
|
1263
1240
|
// Will load page
|
|
1264
|
-
|
|
1241
|
+
const initUrl = browserHistoryInitialMatch ? initialUrl : router.history[0];
|
|
1265
1242
|
currentRoute = router.findMatchingRoute(initUrl);
|
|
1266
1243
|
|
|
1267
1244
|
if (!currentRoute) {
|
|
@@ -1287,8 +1264,8 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1287
1264
|
}
|
|
1288
1265
|
|
|
1289
1266
|
if (router.params.stackPages) {
|
|
1290
|
-
router.$el.children('.page').each(
|
|
1291
|
-
|
|
1267
|
+
router.$el.children('.page').each(pageEl => {
|
|
1268
|
+
const $pageEl = $(pageEl);
|
|
1292
1269
|
router.initialPages.push($pageEl[0]);
|
|
1293
1270
|
|
|
1294
1271
|
if (router.dynamicNavbar && $pageEl.children('.navbar').length > 0) {
|
|
@@ -1305,9 +1282,9 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1305
1282
|
browserHistory: false,
|
|
1306
1283
|
animate: false,
|
|
1307
1284
|
once: {
|
|
1308
|
-
modalOpen
|
|
1285
|
+
modalOpen() {
|
|
1309
1286
|
if (!historyRestored) return;
|
|
1310
|
-
|
|
1287
|
+
const preloadPreviousPage = router.params.preloadPreviousPage || router.params[`${app.theme}SwipeBack`];
|
|
1311
1288
|
|
|
1312
1289
|
if (preloadPreviousPage && router.history.length > 1) {
|
|
1313
1290
|
router.back({
|
|
@@ -1315,9 +1292,10 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1315
1292
|
});
|
|
1316
1293
|
}
|
|
1317
1294
|
},
|
|
1318
|
-
|
|
1295
|
+
|
|
1296
|
+
pageAfterIn() {
|
|
1319
1297
|
if (!historyRestored) return;
|
|
1320
|
-
|
|
1298
|
+
const preloadPreviousPage = router.params.preloadPreviousPage || router.params[`${app.theme}SwipeBack`];
|
|
1321
1299
|
|
|
1322
1300
|
if (preloadPreviousPage && router.history.length > 1) {
|
|
1323
1301
|
router.back({
|
|
@@ -1325,15 +1303,16 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1325
1303
|
});
|
|
1326
1304
|
}
|
|
1327
1305
|
}
|
|
1306
|
+
|
|
1328
1307
|
}
|
|
1329
1308
|
});
|
|
1330
1309
|
} else if (router.$el.children('.page:not(.stacked)').length) {
|
|
1331
1310
|
// Init current DOM page
|
|
1332
|
-
|
|
1311
|
+
let hasTabRoute;
|
|
1333
1312
|
router.currentRoute = currentRoute;
|
|
1334
|
-
router.$el.children('.page:not(.stacked)').each(
|
|
1335
|
-
|
|
1336
|
-
|
|
1313
|
+
router.$el.children('.page:not(.stacked)').each(pageEl => {
|
|
1314
|
+
const $pageEl = $(pageEl);
|
|
1315
|
+
let $navbarEl;
|
|
1337
1316
|
router.setPagePosition($pageEl, 'current');
|
|
1338
1317
|
|
|
1339
1318
|
if (router.dynamicNavbar) {
|
|
@@ -1374,7 +1353,7 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1374
1353
|
view.checkMasterDetailBreakpoint();
|
|
1375
1354
|
}
|
|
1376
1355
|
|
|
1377
|
-
|
|
1356
|
+
const initOptions = {
|
|
1378
1357
|
route: router.currentRoute
|
|
1379
1358
|
};
|
|
1380
1359
|
|
|
@@ -1406,7 +1385,7 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1406
1385
|
|
|
1407
1386
|
if (historyRestored) {
|
|
1408
1387
|
if (browserHistoryInitialMatch) {
|
|
1409
|
-
|
|
1388
|
+
const preloadPreviousPage = router.params.preloadPreviousPage || router.params[`${app.theme}SwipeBack`];
|
|
1410
1389
|
|
|
1411
1390
|
if (preloadPreviousPage && router.history.length > 1) {
|
|
1412
1391
|
router.back({
|
|
@@ -1420,8 +1399,8 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1420
1399
|
history: false,
|
|
1421
1400
|
animate: browserHistoryAnimateOnLoad,
|
|
1422
1401
|
once: {
|
|
1423
|
-
pageAfterIn
|
|
1424
|
-
|
|
1402
|
+
pageAfterIn() {
|
|
1403
|
+
const preloadPreviousPage = router.params.preloadPreviousPage || router.params[`${app.theme}SwipeBack`];
|
|
1425
1404
|
|
|
1426
1405
|
if (preloadPreviousPage && router.history.length > 2) {
|
|
1427
1406
|
router.back({
|
|
@@ -1429,6 +1408,7 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1429
1408
|
});
|
|
1430
1409
|
}
|
|
1431
1410
|
}
|
|
1411
|
+
|
|
1432
1412
|
}
|
|
1433
1413
|
});
|
|
1434
1414
|
}
|
|
@@ -1447,21 +1427,20 @@ var Router = /*#__PURE__*/function (_Framework7Class) {
|
|
|
1447
1427
|
}
|
|
1448
1428
|
|
|
1449
1429
|
router.emit('local::init routerInit', router);
|
|
1450
|
-
}
|
|
1430
|
+
}
|
|
1451
1431
|
|
|
1452
|
-
|
|
1453
|
-
|
|
1432
|
+
destroy() {
|
|
1433
|
+
let router = this;
|
|
1454
1434
|
router.emit('local::destroy routerDestroy', router); // Delete props & methods
|
|
1455
1435
|
|
|
1456
|
-
Object.keys(router).forEach(
|
|
1436
|
+
Object.keys(router).forEach(routerProp => {
|
|
1457
1437
|
router[routerProp] = null;
|
|
1458
1438
|
delete router[routerProp];
|
|
1459
1439
|
});
|
|
1460
1440
|
router = null;
|
|
1461
|
-
}
|
|
1441
|
+
}
|
|
1462
1442
|
|
|
1463
|
-
|
|
1464
|
-
}(Framework7Class); // Load
|
|
1443
|
+
} // Load
|
|
1465
1444
|
|
|
1466
1445
|
|
|
1467
1446
|
Router.prototype.navigate = navigate;
|