@xenknight/framework7 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +32 -0
- package/components/accordion/accordion-ios.less +2 -0
- package/components/accordion/accordion-md.less +2 -0
- package/components/accordion/accordion-rtl.css +1 -0
- package/components/accordion/accordion-vars.less +0 -0
- package/components/accordion/accordion.css +1 -0
- package/components/accordion/accordion.d.ts +55 -0
- package/components/accordion/accordion.js +118 -0
- package/components/accordion/accordion.less +215 -0
- package/components/actions/actions-class.js +325 -0
- package/components/actions/actions-ios.less +51 -0
- package/components/actions/actions-md.less +24 -0
- package/components/actions/actions-rtl.css +1 -0
- package/components/actions/actions-vars.less +72 -0
- package/components/actions/actions.css +1 -0
- package/components/actions/actions.d.ts +164 -0
- package/components/actions/actions.js +47 -0
- package/components/actions/actions.less +182 -0
- package/components/app/app-class.d.ts +189 -0
- package/components/app/app-class.js +349 -0
- package/components/app/app-ios.less +23 -0
- package/components/app/app-md.less +8 -0
- package/components/app/app-vars.less +122 -0
- package/components/app/app.less +121 -0
- package/components/app/load-module.js +125 -0
- package/components/area-chart/area-chart-class.js +467 -0
- package/components/area-chart/area-chart-ios.less +2 -0
- package/components/area-chart/area-chart-md.less +2 -0
- package/components/area-chart/area-chart-rtl.css +1 -0
- package/components/area-chart/area-chart-vars.less +35 -0
- package/components/area-chart/area-chart.css +1 -0
- package/components/area-chart/area-chart.d.ts +128 -0
- package/components/area-chart/area-chart.js +44 -0
- package/components/area-chart/area-chart.less +131 -0
- package/components/autocomplete/autocomplete-class.js +813 -0
- package/components/autocomplete/autocomplete-ios.less +9 -0
- package/components/autocomplete/autocomplete-md.less +30 -0
- package/components/autocomplete/autocomplete-rtl.css +1 -0
- package/components/autocomplete/autocomplete-vars.less +36 -0
- package/components/autocomplete/autocomplete.css +1 -0
- package/components/autocomplete/autocomplete.d.ts +193 -0
- package/components/autocomplete/autocomplete.js +81 -0
- package/components/autocomplete/autocomplete.less +102 -0
- package/components/badge/badge-ios.less +2 -0
- package/components/badge/badge-md.less +2 -0
- package/components/badge/badge-vars.less +18 -0
- package/components/badge/badge.d.ts +14 -0
- package/components/badge/badge.js +3 -0
- package/components/badge/badge.less +45 -0
- package/components/block/block-ios.less +2 -0
- package/components/block/block-md.less +2 -0
- package/components/block/block-vars.less +77 -0
- package/components/block/block.d.ts +14 -0
- package/components/block/block.js +3 -0
- package/components/block/block.less +209 -0
- package/components/breadcrumbs/breadcrumbs-ios.less +2 -0
- package/components/breadcrumbs/breadcrumbs-md.less +2 -0
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -0
- package/components/breadcrumbs/breadcrumbs-vars.less +52 -0
- package/components/breadcrumbs/breadcrumbs.css +1 -0
- package/components/breadcrumbs/breadcrumbs.d.ts +15 -0
- package/components/breadcrumbs/breadcrumbs.js +11 -0
- package/components/breadcrumbs/breadcrumbs.less +91 -0
- package/components/button/button-ios.less +21 -0
- package/components/button/button-md.less +11 -0
- package/components/button/button-vars.less +114 -0
- package/components/button/button.d.ts +14 -0
- package/components/button/button.js +3 -0
- package/components/button/button.less +421 -0
- package/components/calendar/calendar-class.js +1872 -0
- package/components/calendar/calendar-ios.less +2 -0
- package/components/calendar/calendar-md.less +2 -0
- package/components/calendar/calendar-rtl.css +1 -0
- package/components/calendar/calendar-vars.less +108 -0
- package/components/calendar/calendar.css +1 -0
- package/components/calendar/calendar.d.ts +312 -0
- package/components/calendar/calendar.js +118 -0
- package/components/calendar/calendar.less +448 -0
- package/components/card/card-ios.less +2 -0
- package/components/card/card-md.less +2 -0
- package/components/card/card-rtl.css +1 -0
- package/components/card/card-vars.less +80 -0
- package/components/card/card.css +1 -0
- package/components/card/card.d.ts +69 -0
- package/components/card/card.js +504 -0
- package/components/card/card.less +307 -0
- package/components/checkbox/checkbox-ios.less +23 -0
- package/components/checkbox/checkbox-md.less +17 -0
- package/components/checkbox/checkbox-rtl.css +1 -0
- package/components/checkbox/checkbox-vars.less +25 -0
- package/components/checkbox/checkbox.css +1 -0
- package/components/checkbox/checkbox.d.ts +14 -0
- package/components/checkbox/checkbox.js +3 -0
- package/components/checkbox/checkbox.less +155 -0
- package/components/chip/chip-ios.less +25 -0
- package/components/chip/chip-md.less +30 -0
- package/components/chip/chip-rtl.css +1 -0
- package/components/chip/chip-vars.less +42 -0
- package/components/chip/chip.css +1 -0
- package/components/chip/chip.d.ts +14 -0
- package/components/chip/chip.js +3 -0
- package/components/chip/chip.less +106 -0
- package/components/color-picker/color-picker-class.js +871 -0
- package/components/color-picker/color-picker-ios.less +2 -0
- package/components/color-picker/color-picker-md.less +2 -0
- package/components/color-picker/color-picker-rtl.css +1 -0
- package/components/color-picker/color-picker-vars.less +39 -0
- package/components/color-picker/color-picker.css +1 -0
- package/components/color-picker/color-picker.d.ts +233 -0
- package/components/color-picker/color-picker.js +92 -0
- package/components/color-picker/color-picker.less +557 -0
- package/components/color-picker/modules/alpha-slider.js +91 -0
- package/components/color-picker/modules/brightness-slider.js +80 -0
- package/components/color-picker/modules/current-color.js +14 -0
- package/components/color-picker/modules/hex.js +71 -0
- package/components/color-picker/modules/hs-spectrum.js +118 -0
- package/components/color-picker/modules/hsb-sliders.js +191 -0
- package/components/color-picker/modules/hue-slider.js +73 -0
- package/components/color-picker/modules/initial-current-colors.js +43 -0
- package/components/color-picker/modules/palette.js +46 -0
- package/components/color-picker/modules/rgb-bars.js +183 -0
- package/components/color-picker/modules/rgb-sliders.js +185 -0
- package/components/color-picker/modules/sb-spectrum.js +119 -0
- package/components/color-picker/modules/wheel.js +173 -0
- package/components/contacts-list/contacts-list-ios.less +2 -0
- package/components/contacts-list/contacts-list-md.less +21 -0
- package/components/contacts-list/contacts-list-rtl.css +1 -0
- package/components/contacts-list/contacts-list-vars.less +24 -0
- package/components/contacts-list/contacts-list.css +1 -0
- package/components/contacts-list/contacts-list.d.ts +14 -0
- package/components/contacts-list/contacts-list.js +3 -0
- package/components/contacts-list/contacts-list.less +26 -0
- package/components/data-table/data-table-class.js +141 -0
- package/components/data-table/data-table-ios.less +70 -0
- package/components/data-table/data-table-md.less +88 -0
- package/components/data-table/data-table-rtl.css +1 -0
- package/components/data-table/data-table-vars.less +77 -0
- package/components/data-table/data-table.css +1 -0
- package/components/data-table/data-table.d.ts +61 -0
- package/components/data-table/data-table.js +64 -0
- package/components/data-table/data-table.less +429 -0
- package/components/dialog/dialog-class.js +196 -0
- package/components/dialog/dialog-ios.less +94 -0
- package/components/dialog/dialog-md.less +86 -0
- package/components/dialog/dialog-rtl.css +1 -0
- package/components/dialog/dialog-vars.less +93 -0
- package/components/dialog/dialog.css +1 -0
- package/components/dialog/dialog.d.ts +245 -0
- package/components/dialog/dialog.js +242 -0
- package/components/dialog/dialog.less +142 -0
- package/components/fab/fab-ios.less +9 -0
- package/components/fab/fab-md.less +11 -0
- package/components/fab/fab-rtl.css +1 -0
- package/components/fab/fab-vars.less +46 -0
- package/components/fab/fab.css +1 -0
- package/components/fab/fab.d.ts +32 -0
- package/components/fab/fab.js +172 -0
- package/components/fab/fab.less +523 -0
- package/components/form/form-ios.less +0 -0
- package/components/form/form-md.less +0 -0
- package/components/form/form-rtl.css +0 -0
- package/components/form/form.css +0 -0
- package/components/form/form.d.ts +64 -0
- package/components/form/form.js +311 -0
- package/components/form/form.less +7 -0
- package/components/gauge/gauge-class.js +298 -0
- package/components/gauge/gauge-ios.less +2 -0
- package/components/gauge/gauge-md.less +2 -0
- package/components/gauge/gauge-rtl.css +1 -0
- package/components/gauge/gauge.css +1 -0
- package/components/gauge/gauge.d.ts +100 -0
- package/components/gauge/gauge.js +90 -0
- package/components/gauge/gauge.less +24 -0
- package/components/grid/grid-ios.less +2 -0
- package/components/grid/grid-md.less +2 -0
- package/components/grid/grid-rtl.css +1 -0
- package/components/grid/grid-vars.less +3 -0
- package/components/grid/grid.css +1 -0
- package/components/grid/grid.d.ts +15 -0
- package/components/grid/grid.js +3 -0
- package/components/grid/grid.less +78 -0
- package/components/icon/icon-ios.less +44 -0
- package/components/icon/icon-md.less +56 -0
- package/components/icon/icon.d.ts +14 -0
- package/components/icon/icon.js +3 -0
- package/components/icon/icon.less +33 -0
- package/components/infinite-scroll/infinite-scroll-ios.less +11 -0
- package/components/infinite-scroll/infinite-scroll-md.less +6 -0
- package/components/infinite-scroll/infinite-scroll-rtl.css +1 -0
- package/components/infinite-scroll/infinite-scroll.css +1 -0
- package/components/infinite-scroll/infinite-scroll.d.ts +27 -0
- package/components/infinite-scroll/infinite-scroll.js +94 -0
- package/components/infinite-scroll/infinite-scroll.less +15 -0
- package/components/input/input-ios.less +129 -0
- package/components/input/input-md.less +171 -0
- package/components/input/input-rtl.css +1 -0
- package/components/input/input-vars.less +94 -0
- package/components/input/input.css +1 -0
- package/components/input/input.d.ts +60 -0
- package/components/input/input.js +339 -0
- package/components/input/input.less +355 -0
- package/components/link/link-ios.less +9 -0
- package/components/link/link-md.less +2 -0
- package/components/link/link-vars.less +9 -0
- package/components/link/link.d.ts +14 -0
- package/components/link/link.js +3 -0
- package/components/link/link.less +37 -0
- package/components/list/list-ios.less +15 -0
- package/components/list/list-md.less +5 -0
- package/components/list/list-vars.less +184 -0
- package/components/list/list.d.ts +14 -0
- package/components/list/list.js +3 -0
- package/components/list/list.less +718 -0
- package/components/list-index/list-index-class.js +333 -0
- package/components/list-index/list-index-ios.less +21 -0
- package/components/list-index/list-index-md.less +7 -0
- package/components/list-index/list-index-rtl.css +1 -0
- package/components/list-index/list-index-vars.less +25 -0
- package/components/list-index/list-index.css +1 -0
- package/components/list-index/list-index.d.ts +101 -0
- package/components/list-index/list-index.js +65 -0
- package/components/list-index/list-index.less +130 -0
- package/components/login-screen/login-screen-class.js +38 -0
- package/components/login-screen/login-screen-ios.less +2 -0
- package/components/login-screen/login-screen-md.less +2 -0
- package/components/login-screen/login-screen-rtl.css +1 -0
- package/components/login-screen/login-screen-vars.less +33 -0
- package/components/login-screen/login-screen.css +1 -0
- package/components/login-screen/login-screen.d.ts +99 -0
- package/components/login-screen/login-screen.js +32 -0
- package/components/login-screen/login-screen.less +100 -0
- package/components/messagebar/messagebar-class.js +367 -0
- package/components/messagebar/messagebar-ios.less +88 -0
- package/components/messagebar/messagebar-md.less +114 -0
- package/components/messagebar/messagebar-rtl.css +1 -0
- package/components/messagebar/messagebar-vars.less +75 -0
- package/components/messagebar/messagebar.css +1 -0
- package/components/messagebar/messagebar.d.ts +165 -0
- package/components/messagebar/messagebar.js +66 -0
- package/components/messagebar/messagebar.less +162 -0
- package/components/messages/messages-class.js +487 -0
- package/components/messages/messages-ios.less +165 -0
- package/components/messages/messages-md.less +140 -0
- package/components/messages/messages-rtl.css +1 -0
- package/components/messages/messages-vars.less +82 -0
- package/components/messages/messages.css +1 -0
- package/components/messages/messages.d.ts +162 -0
- package/components/messages/messages.js +65 -0
- package/components/messages/messages.less +218 -0
- package/components/modal/custom-modal-class.js +66 -0
- package/components/modal/modal-class.js +224 -0
- package/components/modal/modal.d.ts +82 -0
- package/components/modal/modal.js +22 -0
- package/components/modal/modal.less +14 -0
- package/components/navbar/navbar-ios.less +755 -0
- package/components/navbar/navbar-md.less +65 -0
- package/components/navbar/navbar-vars.less +74 -0
- package/components/navbar/navbar.d.ts +77 -0
- package/components/navbar/navbar.js +712 -0
- package/components/navbar/navbar.less +311 -0
- package/components/notification/notification-class.js +212 -0
- package/components/notification/notification-ios.less +55 -0
- package/components/notification/notification-md.less +87 -0
- package/components/notification/notification-rtl.css +1 -0
- package/components/notification/notification-vars.less +75 -0
- package/components/notification/notification.css +1 -0
- package/components/notification/notification.d.ts +122 -0
- package/components/notification/notification.js +33 -0
- package/components/notification/notification.less +94 -0
- package/components/page/page-ios.less +154 -0
- package/components/page/page-md.less +83 -0
- package/components/page/page-transitions/circle.less +107 -0
- package/components/page/page-transitions/cover-v.less +61 -0
- package/components/page/page-transitions/cover.less +71 -0
- package/components/page/page-transitions/dive.less +77 -0
- package/components/page/page-transitions/fade.less +53 -0
- package/components/page/page-transitions/flip.less +91 -0
- package/components/page/page-transitions/parallax.less +75 -0
- package/components/page/page-transitions/push.less +75 -0
- package/components/page/page-vars.less +47 -0
- package/components/page/page.d.ts +14 -0
- package/components/page/page.js +3 -0
- package/components/page/page.less +204 -0
- package/components/panel/panel-class.js +556 -0
- package/components/panel/panel-ios.less +2 -0
- package/components/panel/panel-md.less +11 -0
- package/components/panel/panel-rtl.css +3 -0
- package/components/panel/panel-vars.less +24 -0
- package/components/panel/panel.css +3 -0
- package/components/panel/panel.d.ts +198 -0
- package/components/panel/panel.js +189 -0
- package/components/panel/panel.less +403 -0
- package/components/panel/resizable-panel.js +160 -0
- package/components/panel/swipe-panel.js +311 -0
- package/components/photo-browser/photo-browser-class.js +734 -0
- package/components/photo-browser/photo-browser-ios.less +2 -0
- package/components/photo-browser/photo-browser-md.less +2 -0
- package/components/photo-browser/photo-browser-rtl.css +1 -0
- package/components/photo-browser/photo-browser-vars.less +16 -0
- package/components/photo-browser/photo-browser.css +1 -0
- package/components/photo-browser/photo-browser.d.ts +204 -0
- package/components/photo-browser/photo-browser.js +73 -0
- package/components/photo-browser/photo-browser.less +358 -0
- package/components/picker/picker-class.js +588 -0
- package/components/picker/picker-column.js +121 -0
- package/components/picker/picker-ios.less +12 -0
- package/components/picker/picker-md.less +8 -0
- package/components/picker/picker-rtl.css +1 -0
- package/components/picker/picker-vars.less +35 -0
- package/components/picker/picker.css +1 -0
- package/components/picker/picker.d.ts +209 -0
- package/components/picker/picker.js +59 -0
- package/components/picker/picker.less +180 -0
- package/components/pie-chart/pie-chart-class.js +250 -0
- package/components/pie-chart/pie-chart-ios.less +2 -0
- package/components/pie-chart/pie-chart-md.less +2 -0
- package/components/pie-chart/pie-chart-rtl.css +1 -0
- package/components/pie-chart/pie-chart.css +1 -0
- package/components/pie-chart/pie-chart.d.ts +99 -0
- package/components/pie-chart/pie-chart.js +32 -0
- package/components/pie-chart/pie-chart.less +43 -0
- package/components/popover/popover-class.js +293 -0
- package/components/popover/popover-ios.less +6 -0
- package/components/popover/popover-md.less +41 -0
- package/components/popover/popover-rtl.css +1 -0
- package/components/popover/popover-vars.less +25 -0
- package/components/popover/popover.css +1 -0
- package/components/popover/popover.d.ts +137 -0
- package/components/popover/popover.js +75 -0
- package/components/popover/popover.less +168 -0
- package/components/popup/popup-class.js +329 -0
- package/components/popup/popup-ios.less +2 -0
- package/components/popup/popup-md.less +2 -0
- package/components/popup/popup-rtl.css +1 -0
- package/components/popup/popup-vars.less +21 -0
- package/components/popup/popup.css +1 -0
- package/components/popup/popup.d.ts +143 -0
- package/components/popup/popup.js +46 -0
- package/components/popup/popup.less +204 -0
- package/components/preloader/preloader-ios.less +57 -0
- package/components/preloader/preloader-md.less +114 -0
- package/components/preloader/preloader-rtl.css +1 -0
- package/components/preloader/preloader-vars.less +16 -0
- package/components/preloader/preloader.css +1 -0
- package/components/preloader/preloader.d.ts +26 -0
- package/components/preloader/preloader.js +106 -0
- package/components/preloader/preloader.less +60 -0
- package/components/progressbar/progressbar-ios.less +59 -0
- package/components/progressbar/progressbar-md.less +141 -0
- package/components/progressbar/progressbar-rtl.css +1 -0
- package/components/progressbar/progressbar-vars.less +22 -0
- package/components/progressbar/progressbar.css +1 -0
- package/components/progressbar/progressbar.d.ts +31 -0
- package/components/progressbar/progressbar.js +150 -0
- package/components/progressbar/progressbar.less +111 -0
- package/components/pull-to-refresh/pull-to-refresh-class.js +512 -0
- package/components/pull-to-refresh/pull-to-refresh-ios.less +88 -0
- package/components/pull-to-refresh/pull-to-refresh-md.less +129 -0
- package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -0
- package/components/pull-to-refresh/pull-to-refresh-vars.less +14 -0
- package/components/pull-to-refresh/pull-to-refresh.css +1 -0
- package/components/pull-to-refresh/pull-to-refresh.d.ts +103 -0
- package/components/pull-to-refresh/pull-to-refresh.js +62 -0
- package/components/pull-to-refresh/pull-to-refresh.less +38 -0
- package/components/radio/radio-ios.less +61 -0
- package/components/radio/radio-md.less +64 -0
- package/components/radio/radio-rtl.css +1 -0
- package/components/radio/radio-vars.less +24 -0
- package/components/radio/radio.css +1 -0
- package/components/radio/radio.d.ts +14 -0
- package/components/radio/radio.js +3 -0
- package/components/radio/radio.less +64 -0
- package/components/range/range-class.js +577 -0
- package/components/range/range-ios.less +9 -0
- package/components/range/range-md.less +41 -0
- package/components/range/range-rtl.css +1 -0
- package/components/range/range-vars.less +61 -0
- package/components/range/range.css +1 -0
- package/components/range/range.d.ts +143 -0
- package/components/range/range.js +75 -0
- package/components/range/range.less +235 -0
- package/components/searchbar/remove-diacritics.js +271 -0
- package/components/searchbar/searchbar-class.js +592 -0
- package/components/searchbar/searchbar-ios.less +107 -0
- package/components/searchbar/searchbar-md.less +147 -0
- package/components/searchbar/searchbar-rtl.css +1 -0
- package/components/searchbar/searchbar-vars.less +77 -0
- package/components/searchbar/searchbar.css +1 -0
- package/components/searchbar/searchbar.d.ts +161 -0
- package/components/searchbar/searchbar.js +122 -0
- package/components/searchbar/searchbar.less +322 -0
- package/components/sheet/sheet-class.js +673 -0
- package/components/sheet/sheet-ios.less +2 -0
- package/components/sheet/sheet-md.less +9 -0
- package/components/sheet/sheet-rtl.css +1 -0
- package/components/sheet/sheet-vars.less +27 -0
- package/components/sheet/sheet.css +1 -0
- package/components/sheet/sheet.d.ts +170 -0
- package/components/sheet/sheet.js +76 -0
- package/components/sheet/sheet.less +196 -0
- package/components/skeleton/skeleton-ios.less +2 -0
- package/components/skeleton/skeleton-md.less +2 -0
- package/components/skeleton/skeleton-rtl.css +1 -0
- package/components/skeleton/skeleton-vars.less +8 -0
- package/components/skeleton/skeleton.css +1 -0
- package/components/skeleton/skeleton.d.ts +14 -0
- package/components/skeleton/skeleton.js +3 -0
- package/components/skeleton/skeleton.less +11 -0
- package/components/smart-select/smart-select-class.js +874 -0
- package/components/smart-select/smart-select-ios.less +2 -0
- package/components/smart-select/smart-select-md.less +2 -0
- package/components/smart-select/smart-select-rtl.css +1 -0
- package/components/smart-select/smart-select-vars.less +6 -0
- package/components/smart-select/smart-select.css +1 -0
- package/components/smart-select/smart-select.d.ts +204 -0
- package/components/smart-select/smart-select.js +138 -0
- package/components/smart-select/smart-select.less +42 -0
- package/components/sortable/sortable-ios.less +7 -0
- package/components/sortable/sortable-md.less +7 -0
- package/components/sortable/sortable-rtl.css +1 -0
- package/components/sortable/sortable-vars.less +22 -0
- package/components/sortable/sortable.css +1 -0
- package/components/sortable/sortable.d.ts +50 -0
- package/components/sortable/sortable.js +286 -0
- package/components/sortable/sortable.less +133 -0
- package/components/statusbar/statusbar-ios.less +2 -0
- package/components/statusbar/statusbar-md.less +2 -0
- package/components/statusbar/statusbar.d.ts +54 -0
- package/components/statusbar/statusbar.js +190 -0
- package/components/statusbar/statusbar.less +7 -0
- package/components/stepper/stepper-class.js +403 -0
- package/components/stepper/stepper-ios.less +36 -0
- package/components/stepper/stepper-md.less +16 -0
- package/components/stepper/stepper-rtl.css +1 -0
- package/components/stepper/stepper-vars.less +40 -0
- package/components/stepper/stepper.css +1 -0
- package/components/stepper/stepper.d.ts +121 -0
- package/components/stepper/stepper.js +82 -0
- package/components/stepper/stepper.less +178 -0
- package/components/subnavbar/subnavbar-ios.less +51 -0
- package/components/subnavbar/subnavbar-md.less +47 -0
- package/components/subnavbar/subnavbar-vars.less +36 -0
- package/components/subnavbar/subnavbar.d.ts +11 -0
- package/components/subnavbar/subnavbar.js +17 -0
- package/components/subnavbar/subnavbar.less +128 -0
- package/components/swipeout/swipeout-ios.less +2 -0
- package/components/swipeout/swipeout-md.less +2 -0
- package/components/swipeout/swipeout-rtl.css +1 -0
- package/components/swipeout/swipeout-vars.less +24 -0
- package/components/swipeout/swipeout.css +1 -0
- package/components/swipeout/swipeout.d.ts +68 -0
- package/components/swipeout/swipeout.js +513 -0
- package/components/swipeout/swipeout.less +109 -0
- package/components/swiper/swiper-ios.less +2 -0
- package/components/swiper/swiper-md.less +2 -0
- package/components/swiper/swiper-rtl.css +1 -0
- package/components/swiper/swiper.css +1 -0
- package/components/swiper/swiper.d.ts +25 -0
- package/components/swiper/swiper.js +141 -0
- package/components/swiper/swiper.less +5 -0
- package/components/tabs/tabs-ios.less +2 -0
- package/components/tabs/tabs-md.less +2 -0
- package/components/tabs/tabs-rtl.css +1 -0
- package/components/tabs/tabs.css +1 -0
- package/components/tabs/tabs.d.ts +39 -0
- package/components/tabs/tabs.js +243 -0
- package/components/tabs/tabs.less +45 -0
- package/components/text-editor/text-editor-class.js +516 -0
- package/components/text-editor/text-editor-ios.less +9 -0
- package/components/text-editor/text-editor-md.less +11 -0
- package/components/text-editor/text-editor-rtl.css +1 -0
- package/components/text-editor/text-editor-vars.less +51 -0
- package/components/text-editor/text-editor.css +1 -0
- package/components/text-editor/text-editor.d.ts +166 -0
- package/components/text-editor/text-editor.js +81 -0
- package/components/text-editor/text-editor.less +153 -0
- package/components/timeline/timeline-ios.less +11 -0
- package/components/timeline/timeline-md.less +7 -0
- package/components/timeline/timeline-rtl.css +1 -0
- package/components/timeline/timeline-vars.less +64 -0
- package/components/timeline/timeline.css +1 -0
- package/components/timeline/timeline.d.ts +14 -0
- package/components/timeline/timeline.js +3 -0
- package/components/timeline/timeline.less +413 -0
- package/components/toast/toast-class.js +105 -0
- package/components/toast/toast-ios.less +81 -0
- package/components/toast/toast-md.less +72 -0
- package/components/toast/toast-rtl.css +1 -0
- package/components/toast/toast-vars.less +24 -0
- package/components/toast/toast.css +1 -0
- package/components/toast/toast.d.ts +121 -0
- package/components/toast/toast.js +40 -0
- package/components/toast/toast.less +62 -0
- package/components/toggle/toggle-class.js +165 -0
- package/components/toggle/toggle-ios.less +70 -0
- package/components/toggle/toggle-md.less +44 -0
- package/components/toggle/toggle-rtl.css +1 -0
- package/components/toggle/toggle-vars.less +30 -0
- package/components/toggle/toggle.css +1 -0
- package/components/toggle/toggle.d.ts +73 -0
- package/components/toggle/toggle.js +57 -0
- package/components/toggle/toggle.less +52 -0
- package/components/toolbar/toolbar-ios.less +47 -0
- package/components/toolbar/toolbar-md.less +77 -0
- package/components/toolbar/toolbar-vars.less +71 -0
- package/components/toolbar/toolbar.d.ts +43 -0
- package/components/toolbar/toolbar.js +198 -0
- package/components/toolbar/toolbar.less +306 -0
- package/components/tooltip/tooltip-class.js +336 -0
- package/components/tooltip/tooltip-ios.less +2 -0
- package/components/tooltip/tooltip-md.less +2 -0
- package/components/tooltip/tooltip-rtl.css +1 -0
- package/components/tooltip/tooltip-vars.less +19 -0
- package/components/tooltip/tooltip.css +1 -0
- package/components/tooltip/tooltip.d.ts +105 -0
- package/components/tooltip/tooltip.js +129 -0
- package/components/tooltip/tooltip.less +39 -0
- package/components/touch-ripple/touch-ripple-class.js +85 -0
- package/components/touch-ripple/touch-ripple-ios.less +2 -0
- package/components/touch-ripple/touch-ripple-md.less +2 -0
- package/components/touch-ripple/touch-ripple-vars.less +8 -0
- package/components/touch-ripple/touch-ripple.d.ts +25 -0
- package/components/touch-ripple/touch-ripple.js +18 -0
- package/components/touch-ripple/touch-ripple.less +114 -0
- package/components/treeview/treeview-ios.less +2 -0
- package/components/treeview/treeview-md.less +2 -0
- package/components/treeview/treeview-rtl.css +1 -0
- package/components/treeview/treeview-vars.less +38 -0
- package/components/treeview/treeview.css +1 -0
- package/components/treeview/treeview.d.ts +42 -0
- package/components/treeview/treeview.js +74 -0
- package/components/treeview/treeview.less +160 -0
- package/components/typography/typography-ios.less +2 -0
- package/components/typography/typography-md.less +2 -0
- package/components/typography/typography-rtl.css +1 -0
- package/components/typography/typography-vars.less +4 -0
- package/components/typography/typography.css +1 -0
- package/components/typography/typography.d.ts +14 -0
- package/components/typography/typography.js +3 -0
- package/components/typography/typography.less +220 -0
- package/components/view/resizable-view.js +125 -0
- package/components/view/view-class.js +206 -0
- package/components/view/view-ios.less +2 -0
- package/components/view/view-md.less +2 -0
- package/components/view/view.d.ts +199 -0
- package/components/view/view.js +173 -0
- package/components/view/view.less +35 -0
- package/components/virtual-list/virtual-list-class.js +583 -0
- package/components/virtual-list/virtual-list-ios.less +2 -0
- package/components/virtual-list/virtual-list-md.less +2 -0
- package/components/virtual-list/virtual-list-rtl.css +0 -0
- package/components/virtual-list/virtual-list.css +0 -0
- package/components/virtual-list/virtual-list.d.ts +142 -0
- package/components/virtual-list/virtual-list.js +17 -0
- package/components/virtual-list/virtual-list.less +7 -0
- package/framework7-bundle-rtl.css +19821 -0
- package/framework7-bundle-rtl.min.css +19 -0
- package/framework7-bundle.css +19802 -0
- package/framework7-bundle.esm.js +93 -0
- package/framework7-bundle.js +48416 -0
- package/framework7-bundle.js.map +1 -0
- package/framework7-bundle.less +92 -0
- package/framework7-bundle.min.css +19 -0
- package/framework7-bundle.min.js +14 -0
- package/framework7-bundle.min.js.map +1 -0
- package/framework7-lite-bundle.esm.js +86 -0
- package/framework7-lite.esm.js +37 -0
- package/framework7-lite.js +31 -0
- package/framework7-rtl.css +5252 -0
- package/framework7-rtl.min.css +17 -0
- package/framework7-types.d.ts +336 -0
- package/framework7.css +5245 -0
- package/framework7.d.ts +322 -0
- package/framework7.esm.js +41 -0
- package/framework7.js +42 -0
- package/framework7.less +41 -0
- package/framework7.min.css +17 -0
- package/less/mixins.less +281 -0
- package/less/plugin.js +15 -0
- package/less/vars.less +7 -0
- package/modules/clicks/clicks.d.ts +19 -0
- package/modules/clicks/clicks.js +94 -0
- package/modules/component/$h.js +15 -0
- package/modules/component/$jsx.js +17 -0
- package/modules/component/component-class.js +517 -0
- package/modules/component/component.d.ts +111 -0
- package/modules/component/component.js +44 -0
- package/modules/component/custom-components.js +1 -0
- package/modules/component/eventslisteners.js +74 -0
- package/modules/component/parse-component.js +79 -0
- package/modules/component/patch.js +8 -0
- package/modules/component/snabbdom/h.d.ts +10 -0
- package/modules/component/snabbdom/h.js +50 -0
- package/modules/component/snabbdom/helpers/attachto.d.ts +9 -0
- package/modules/component/snabbdom/helpers/attachto.js +49 -0
- package/modules/component/snabbdom/hooks.d.ts +23 -0
- package/modules/component/snabbdom/hooks.js +0 -0
- package/modules/component/snabbdom/htmldomapi.d.ts +19 -0
- package/modules/component/snabbdom/htmldomapi.js +67 -0
- package/modules/component/snabbdom/is.d.ts +2 -0
- package/modules/component/snabbdom/is.js +4 -0
- package/modules/component/snabbdom/modules/attributes.d.ts +4 -0
- package/modules/component/snabbdom/modules/attributes.js +51 -0
- package/modules/component/snabbdom/modules/class.d.ts +4 -0
- package/modules/component/snabbdom/modules/class.js +27 -0
- package/modules/component/snabbdom/modules/dataset.d.ts +4 -0
- package/modules/component/snabbdom/modules/dataset.js +37 -0
- package/modules/component/snabbdom/modules/eventlisteners.d.ts +8 -0
- package/modules/component/snabbdom/modules/eventlisteners.js +93 -0
- package/modules/component/snabbdom/modules/hero.d.ts +6 -0
- package/modules/component/snabbdom/modules/hero.js +147 -0
- package/modules/component/snabbdom/modules/module.d.ts +9 -0
- package/modules/component/snabbdom/modules/module.js +0 -0
- package/modules/component/snabbdom/modules/props.d.ts +4 -0
- package/modules/component/snabbdom/modules/props.js +29 -0
- package/modules/component/snabbdom/modules/style.d.ts +7 -0
- package/modules/component/snabbdom/modules/style.js +93 -0
- package/modules/component/snabbdom/snabbdom.bundle.d.ts +5 -0
- package/modules/component/snabbdom/snabbdom.bundle.js +13 -0
- package/modules/component/snabbdom/snabbdom.d.ts +6 -0
- package/modules/component/snabbdom/snabbdom.js +282 -0
- package/modules/component/snabbdom/thunk.d.ts +14 -0
- package/modules/component/snabbdom/thunk.js +50 -0
- package/modules/component/snabbdom/tovnode.d.ts +4 -0
- package/modules/component/snabbdom/tovnode.js +40 -0
- package/modules/component/snabbdom/vnode.d.ts +36 -0
- package/modules/component/snabbdom/vnode.js +12 -0
- package/modules/component/vdom.js +319 -0
- package/modules/demo-module.js +44 -0
- package/modules/device/device.d.ts +14 -0
- package/modules/device/device.js +44 -0
- package/modules/history/history.js +12 -0
- package/modules/resize/resize.d.ts +25 -0
- package/modules/resize/resize.js +62 -0
- package/modules/router/app-router-check.js +5 -0
- package/modules/router/async-component.js +27 -0
- package/modules/router/back.js +723 -0
- package/modules/router/clear-previous-history.js +31 -0
- package/modules/router/component-loader.js +200 -0
- package/modules/router/modal.js +223 -0
- package/modules/router/navigate.js +814 -0
- package/modules/router/process-route-queue.js +66 -0
- package/modules/router/redirect.js +38 -0
- package/modules/router/router-class.js +1268 -0
- package/modules/router/router.d.ts +354 -0
- package/modules/router/router.js +26 -0
- package/modules/router/swipe-back.js +589 -0
- package/modules/router/tab.js +230 -0
- package/modules/service-worker/service-worker.d.ts +38 -0
- package/modules/service-worker/service-worker.js +86 -0
- package/modules/store/create-store.js +138 -0
- package/modules/store/store.d.ts +40 -0
- package/modules/store/store.js +11 -0
- package/modules/support/support.d.ts +15 -0
- package/modules/support/support.js +7 -0
- package/modules/touch/touch.d.ts +60 -0
- package/modules/touch/touch.js +482 -0
- package/modules/utils/utils.d.ts +15 -0
- package/modules/utils/utils.js +10 -0
- package/package.json +458 -0
- package/shared/$jsx.js +21 -0
- package/shared/class.js +146 -0
- package/shared/constructor-methods.js +52 -0
- package/shared/dom7.js +7 -0
- package/shared/events-class.js +95 -0
- package/shared/get-device.d.ts +52 -0
- package/shared/get-device.js +147 -0
- package/shared/get-support.d.ts +12 -0
- package/shared/get-support.js +35 -0
- package/shared/history.js +171 -0
- package/shared/material-color-utils.js +1377 -0
- package/shared/material-colors.js +75 -0
- package/shared/modal-methods.js +80 -0
- package/shared/utils.d.ts +88 -0
- package/shared/utils.js +535 -0
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
import { getDocument } from 'ssr-window';
|
|
2
|
+
import $ from '../../shared/dom7.js';
|
|
3
|
+
import { extend, parseUrlQuery } from '../../shared/utils.js';
|
|
4
|
+
import { getDevice } from '../../shared/get-device.js';
|
|
5
|
+
import History from '../../shared/history.js';
|
|
6
|
+
import redirect from './redirect.js';
|
|
7
|
+
import processRouteQueue from './process-route-queue.js';
|
|
8
|
+
import appRouterCheck from './app-router-check.js';
|
|
9
|
+
import asyncComponent from './async-component.js';
|
|
10
|
+
function backward(router, el, backwardOptions) {
|
|
11
|
+
const device = getDevice();
|
|
12
|
+
const document = getDocument();
|
|
13
|
+
const $el = $(el);
|
|
14
|
+
const app = router.app;
|
|
15
|
+
const view = router.view;
|
|
16
|
+
const options = extend(false, {
|
|
17
|
+
animate: router.params.animate,
|
|
18
|
+
browserHistory: true,
|
|
19
|
+
replaceState: false
|
|
20
|
+
}, backwardOptions);
|
|
21
|
+
const masterDetailEnabled = router.params.masterDetailBreakpoint > 0;
|
|
22
|
+
const isMaster = masterDetailEnabled && options.route && options.route.route && (options.route.route.master === true || typeof options.route.route.master === 'function' && options.route.route.master(app, router));
|
|
23
|
+
let masterPageEl;
|
|
24
|
+
let masterPageRemoved;
|
|
25
|
+
const dynamicNavbar = router.dynamicNavbar;
|
|
26
|
+
const $newPage = $el;
|
|
27
|
+
const $oldPage = router.$el.children('.page-current');
|
|
28
|
+
const initialPreload = $oldPage.length === 0 && options.preload;
|
|
29
|
+
const currentIsMaster = masterDetailEnabled && $oldPage.hasClass('page-master');
|
|
30
|
+
if ($newPage.length) {
|
|
31
|
+
// Remove theme elements
|
|
32
|
+
router.removeThemeElements($newPage);
|
|
33
|
+
}
|
|
34
|
+
let $navbarsEl;
|
|
35
|
+
let $newNavbarEl;
|
|
36
|
+
let $oldNavbarEl;
|
|
37
|
+
if (dynamicNavbar) {
|
|
38
|
+
$newNavbarEl = $newPage.children('.navbar');
|
|
39
|
+
$navbarsEl = router.$navbarsEl;
|
|
40
|
+
if ($newNavbarEl.length === 0 && $newPage[0] && $newPage[0].f7Page) {
|
|
41
|
+
// Try from pageData
|
|
42
|
+
$newNavbarEl = $newPage[0].f7Page.$navbarEl;
|
|
43
|
+
}
|
|
44
|
+
$oldNavbarEl = $navbarsEl.find('.navbar-current');
|
|
45
|
+
}
|
|
46
|
+
router.allowPageChange = false;
|
|
47
|
+
if ($newPage.length === 0 || $oldPage.length === 0 && !options.preload) {
|
|
48
|
+
router.allowPageChange = true;
|
|
49
|
+
return router;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Remove theme elements
|
|
53
|
+
router.removeThemeElements($newPage);
|
|
54
|
+
|
|
55
|
+
// Save Keep Alive Cache
|
|
56
|
+
if (options.route && options.route.route && options.route.route.keepAlive && !options.route.route.keepAliveData) {
|
|
57
|
+
options.route.route.keepAliveData = {
|
|
58
|
+
pageEl: $el[0]
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Pages In View
|
|
63
|
+
let isDetail;
|
|
64
|
+
let isDetailRoot;
|
|
65
|
+
if (masterDetailEnabled) {
|
|
66
|
+
const $pagesInView = router.$el.children('.page').filter(pageInView => pageInView !== $newPage[0]);
|
|
67
|
+
|
|
68
|
+
// Find Detail' master page
|
|
69
|
+
for (let i = 0; i < $pagesInView.length; i += 1) {
|
|
70
|
+
if (!masterPageEl && $pagesInView[i].classList.contains('page-master')) {
|
|
71
|
+
masterPageEl = $pagesInView[i];
|
|
72
|
+
continue; // eslint-disable-line
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
isDetail = !isMaster && masterPageEl && router.history.indexOf(options.route.url) > router.history.indexOf(masterPageEl.f7Page.route.url);
|
|
77
|
+
if (!isDetail && !isMaster && masterPageEl && masterPageEl.f7Page && options.route.route.masterRoute) {
|
|
78
|
+
isDetail = options.route.route.masterRoute.path === masterPageEl.f7Page.route.route.path;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (isDetail && masterPageEl && masterPageEl.f7Page) {
|
|
82
|
+
isDetailRoot = router.history.indexOf(options.route.url) - router.history.indexOf(masterPageEl.f7Page.route.url) === 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// New Page
|
|
86
|
+
$newPage.addClass(`page-${initialPreload ? 'current' : 'previous'}${isMaster ? ' page-master' : ''}${isDetail ? ' page-master-detail' : ''}${isDetailRoot ? ' page-master-detail-root' : ''}`).removeAttr('aria-hidden').trigger('page:unstack').trigger('page:position', {
|
|
87
|
+
position: initialPreload ? 'current' : 'previous'
|
|
88
|
+
});
|
|
89
|
+
router.emit('pageUnstack', $newPage[0]);
|
|
90
|
+
router.emit('pagePosition', $newPage[0], initialPreload ? 'current' : 'previous');
|
|
91
|
+
if (isMaster || isDetail) {
|
|
92
|
+
$newPage.trigger('page:role', {
|
|
93
|
+
role: isMaster ? 'master' : 'detail',
|
|
94
|
+
root: !!isDetailRoot
|
|
95
|
+
});
|
|
96
|
+
router.emit('pageRole', $newPage[0], {
|
|
97
|
+
role: isMaster ? 'master' : 'detail',
|
|
98
|
+
detailRoot: !!isDetailRoot
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (dynamicNavbar && $newNavbarEl.length > 0) {
|
|
102
|
+
$newNavbarEl.addClass(`navbar-${initialPreload ? 'current' : 'previous'}${isMaster ? ' navbar-master' : ''}${isDetail ? ' navbar-master-detail' : ''}${isDetailRoot ? ' navbar-master-detail-root' : ''}`).removeAttr('aria-hidden');
|
|
103
|
+
$newNavbarEl.trigger('navbar:position', {
|
|
104
|
+
position: initialPreload ? 'current' : 'previous'
|
|
105
|
+
});
|
|
106
|
+
router.emit('navbarPosition', $newNavbarEl[0], initialPreload ? 'current' : 'previous');
|
|
107
|
+
if (isMaster || isDetailRoot) {
|
|
108
|
+
router.emit('navbarRole', $newNavbarEl[0], {
|
|
109
|
+
role: isMaster ? 'master' : 'detail',
|
|
110
|
+
detailRoot: !!isDetailRoot
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Remove previous page in case of "forced"
|
|
116
|
+
let backIndex;
|
|
117
|
+
if (options.force) {
|
|
118
|
+
if ($oldPage.prev('.page-previous').length >= 0) {
|
|
119
|
+
if (router.history.indexOf(options.route.url) >= 0) {
|
|
120
|
+
backIndex = router.history.length - router.history.indexOf(options.route.url) - 1;
|
|
121
|
+
router.history = router.history.slice(0, router.history.indexOf(options.route.url) + 2);
|
|
122
|
+
router.propsHistory = router.propsHistory.slice(0, router.history.indexOf(options.route.url) + 2);
|
|
123
|
+
view.history = router.history;
|
|
124
|
+
} else if (router.history[[router.history.length - 2]]) {
|
|
125
|
+
router.propsHistory[router.propsHistory.length - 2] = options.props || {};
|
|
126
|
+
} else {
|
|
127
|
+
router.history.unshift(router.url);
|
|
128
|
+
router.propsHistory.unshift(options.props || {});
|
|
129
|
+
}
|
|
130
|
+
const $pageToRemove = $oldPage.prev('.page-previous');
|
|
131
|
+
let $navbarToRemove;
|
|
132
|
+
if (dynamicNavbar) {
|
|
133
|
+
$navbarToRemove = $(app.navbar.getElByPage($pageToRemove));
|
|
134
|
+
}
|
|
135
|
+
if ($pageToRemove.length > 0) {
|
|
136
|
+
router.pageCallback('beforeRemove', $pageToRemove, $navbarToRemove, 'previous', undefined, options);
|
|
137
|
+
if ($pageToRemove[0] === masterPageEl) {
|
|
138
|
+
masterPageRemoved = true;
|
|
139
|
+
}
|
|
140
|
+
router.removePage($pageToRemove);
|
|
141
|
+
if (dynamicNavbar && $navbarToRemove.length) {
|
|
142
|
+
router.removeNavbar($navbarToRemove);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Insert new page
|
|
149
|
+
const newPageInDom = $newPage.parents(document).length > 0;
|
|
150
|
+
const f7Component = $newPage[0].f7Component;
|
|
151
|
+
function insertPage() {
|
|
152
|
+
if (initialPreload) {
|
|
153
|
+
if (!newPageInDom && f7Component) {
|
|
154
|
+
f7Component.mount(componentEl => {
|
|
155
|
+
router.$el.append(componentEl);
|
|
156
|
+
});
|
|
157
|
+
} else {
|
|
158
|
+
router.$el.append($newPage);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if ($newPage.next($oldPage).length === 0) {
|
|
162
|
+
if (!newPageInDom && f7Component) {
|
|
163
|
+
f7Component.mount(componentEl => {
|
|
164
|
+
$(componentEl).insertBefore($oldPage);
|
|
165
|
+
});
|
|
166
|
+
} else {
|
|
167
|
+
$newPage.insertBefore($oldPage);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (dynamicNavbar && $newNavbarEl.length) {
|
|
171
|
+
if ($newNavbarEl.find('.title-large').length) {
|
|
172
|
+
$newNavbarEl.addClass('navbar-large');
|
|
173
|
+
}
|
|
174
|
+
$newNavbarEl.insertBefore($oldNavbarEl);
|
|
175
|
+
if ($oldNavbarEl.length > 0) {
|
|
176
|
+
$newNavbarEl.insertBefore($oldNavbarEl);
|
|
177
|
+
} else {
|
|
178
|
+
if (!router.$navbarsEl.parents(document).length) {
|
|
179
|
+
router.$el.prepend(router.$navbarsEl);
|
|
180
|
+
}
|
|
181
|
+
$navbarsEl.append($newNavbarEl);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (!newPageInDom) {
|
|
185
|
+
router.pageCallback('mounted', $newPage, $newNavbarEl, 'previous', 'current', options, $oldPage);
|
|
186
|
+
} else if (options.route && options.route.route && options.route.route.keepAlive && !$newPage[0].f7PageMounted) {
|
|
187
|
+
$newPage[0].f7PageMounted = true;
|
|
188
|
+
router.pageCallback('mounted', $newPage, $newNavbarEl, 'previous', 'current', options, $oldPage);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (options.preload) {
|
|
192
|
+
// Insert Page
|
|
193
|
+
insertPage();
|
|
194
|
+
// Tab route
|
|
195
|
+
if (options.route.route.tab) {
|
|
196
|
+
router.tabLoad(options.route.route.tab, extend({}, options, {
|
|
197
|
+
history: false,
|
|
198
|
+
browserHistory: false,
|
|
199
|
+
preload: true
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
if (isMaster) {
|
|
203
|
+
$newPage.removeClass('page-master-stacked').trigger('page:masterunstack');
|
|
204
|
+
router.emit('pageMasterUnstack', $newPage[0]);
|
|
205
|
+
if (dynamicNavbar) {
|
|
206
|
+
$(app.navbar.getElByPage($newPage)).removeClass('navbar-master-stacked');
|
|
207
|
+
router.emit('navbarMasterUnstack', app.navbar.getElByPage($newPage));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// Page init and before init events
|
|
211
|
+
router.pageCallback('init', $newPage, $newNavbarEl, 'previous', 'current', options, $oldPage);
|
|
212
|
+
if (initialPreload) {
|
|
213
|
+
router.pageCallback('beforeIn', $newPage, $newNavbarEl, 'current', undefined, options);
|
|
214
|
+
router.pageCallback('afterIn', $newPage, $newNavbarEl, 'current', undefined, options);
|
|
215
|
+
}
|
|
216
|
+
const $previousPages = $newPage.prevAll('.page-previous:not(.page-master)');
|
|
217
|
+
if ($previousPages.length > 0) {
|
|
218
|
+
$previousPages.each(pageToRemove => {
|
|
219
|
+
const $pageToRemove = $(pageToRemove);
|
|
220
|
+
let $navbarToRemove;
|
|
221
|
+
if (dynamicNavbar) {
|
|
222
|
+
$navbarToRemove = $(app.navbar.getElByPage($pageToRemove));
|
|
223
|
+
}
|
|
224
|
+
router.pageCallback('beforeRemove', $pageToRemove, $navbarToRemove, 'previous', undefined);
|
|
225
|
+
router.removePage($pageToRemove);
|
|
226
|
+
if (dynamicNavbar && $navbarToRemove.length) {
|
|
227
|
+
router.removeNavbar($navbarToRemove);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
router.allowPageChange = true;
|
|
232
|
+
return router;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// History State
|
|
236
|
+
if (!(device.ie || device.edge || device.firefox && !device.ios)) {
|
|
237
|
+
if (router.params.browserHistory && options.browserHistory) {
|
|
238
|
+
if (options.replaceState) {
|
|
239
|
+
const browserHistoryRoot = router.params.browserHistoryRoot || '';
|
|
240
|
+
History.replace(view.id, {
|
|
241
|
+
url: options.route.url
|
|
242
|
+
}, browserHistoryRoot + router.params.browserHistorySeparator + options.route.url);
|
|
243
|
+
} else if (backIndex) {
|
|
244
|
+
History.go(-backIndex);
|
|
245
|
+
} else {
|
|
246
|
+
History.back();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Update History
|
|
252
|
+
if (options.replaceState) {
|
|
253
|
+
router.history[router.history.length - 1] = options.route.url;
|
|
254
|
+
router.propsHistory[router.propsHistory.length - 1] = options.props || {};
|
|
255
|
+
} else {
|
|
256
|
+
if (router.history.length === 1) {
|
|
257
|
+
router.history.unshift(router.url);
|
|
258
|
+
router.propsHistory.unshift(options.props || {});
|
|
259
|
+
}
|
|
260
|
+
router.history.pop();
|
|
261
|
+
router.propsHistory.pop();
|
|
262
|
+
}
|
|
263
|
+
router.saveHistory();
|
|
264
|
+
|
|
265
|
+
// Current Page & Navbar
|
|
266
|
+
router.currentPageEl = $newPage[0];
|
|
267
|
+
if (dynamicNavbar && $newNavbarEl.length) {
|
|
268
|
+
router.currentNavbarEl = $newNavbarEl[0];
|
|
269
|
+
} else {
|
|
270
|
+
delete router.currentNavbarEl;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Current Route
|
|
274
|
+
router.currentRoute = options.route;
|
|
275
|
+
|
|
276
|
+
// History State
|
|
277
|
+
if (device.ie || device.edge || device.firefox && !device.ios) {
|
|
278
|
+
if (router.params.browserHistory && options.browserHistory) {
|
|
279
|
+
if (options.replaceState) {
|
|
280
|
+
const browserHistoryRoot = router.params.browserHistoryRoot || '';
|
|
281
|
+
History.replace(view.id, {
|
|
282
|
+
url: options.route.url
|
|
283
|
+
}, browserHistoryRoot + router.params.browserHistorySeparator + options.route.url);
|
|
284
|
+
} else if (backIndex) {
|
|
285
|
+
History.go(-backIndex);
|
|
286
|
+
} else {
|
|
287
|
+
History.back();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Insert Page
|
|
293
|
+
insertPage();
|
|
294
|
+
|
|
295
|
+
// Load Tab
|
|
296
|
+
if (options.route.route.tab) {
|
|
297
|
+
router.tabLoad(options.route.route.tab, extend({}, options, {
|
|
298
|
+
history: false,
|
|
299
|
+
browserHistory: false
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Check master detail
|
|
304
|
+
|
|
305
|
+
if (masterDetailEnabled && (currentIsMaster || masterPageRemoved)) {
|
|
306
|
+
view.checkMasterDetailBreakpoint(false);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Page init and before init events
|
|
310
|
+
router.pageCallback('init', $newPage, $newNavbarEl, 'previous', 'current', options, $oldPage);
|
|
311
|
+
|
|
312
|
+
// Before animation callback
|
|
313
|
+
router.pageCallback('beforeOut', $oldPage, $oldNavbarEl, 'current', 'next', options);
|
|
314
|
+
router.pageCallback('beforeIn', $newPage, $newNavbarEl, 'previous', 'current', options);
|
|
315
|
+
|
|
316
|
+
// Animation
|
|
317
|
+
function afterAnimation() {
|
|
318
|
+
// Set classes
|
|
319
|
+
router.setPagePosition($newPage, 'current', false);
|
|
320
|
+
router.setPagePosition($oldPage, 'next', true);
|
|
321
|
+
if (dynamicNavbar) {
|
|
322
|
+
router.setNavbarPosition($newNavbarEl, 'current', false);
|
|
323
|
+
router.setNavbarPosition($oldNavbarEl, 'next', true);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// After animation event
|
|
327
|
+
router.pageCallback('afterOut', $oldPage, $oldNavbarEl, 'current', 'next', options);
|
|
328
|
+
router.pageCallback('afterIn', $newPage, $newNavbarEl, 'previous', 'current', options);
|
|
329
|
+
|
|
330
|
+
// Remove Old Page
|
|
331
|
+
|
|
332
|
+
router.pageCallback('beforeRemove', $oldPage, $oldNavbarEl, 'next', undefined, options);
|
|
333
|
+
router.removePage($oldPage);
|
|
334
|
+
if (dynamicNavbar && $oldNavbarEl.length) {
|
|
335
|
+
router.removeNavbar($oldNavbarEl);
|
|
336
|
+
}
|
|
337
|
+
router.allowPageChange = true;
|
|
338
|
+
router.emit('routeChanged', router.currentRoute, router.previousRoute, router);
|
|
339
|
+
|
|
340
|
+
// Preload previous page
|
|
341
|
+
const preloadPreviousPage = router.params.preloadPreviousPage || router.params[`${app.theme}SwipeBack`];
|
|
342
|
+
if (preloadPreviousPage && router.history[router.history.length - 2] && !isMaster) {
|
|
343
|
+
router.back(router.history[router.history.length - 2], {
|
|
344
|
+
preload: true,
|
|
345
|
+
props: router.propsHistory[router.propsHistory.length - 2] || {}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
if (router.params.browserHistory) {
|
|
349
|
+
History.clearRouterQueue();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function setPositionClasses() {
|
|
353
|
+
router.setPagePosition($oldPage, 'current');
|
|
354
|
+
router.setPagePosition($newPage, 'previous', false);
|
|
355
|
+
if (dynamicNavbar) {
|
|
356
|
+
router.setNavbarPosition($oldNavbarEl, 'current');
|
|
357
|
+
router.setNavbarPosition($newNavbarEl, 'previous', false);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (options.animate && !(currentIsMaster && app.width >= router.params.masterDetailBreakpoint)) {
|
|
361
|
+
let transition = router.params.transition;
|
|
362
|
+
if ($oldPage[0] && $oldPage[0].f7PageTransition) {
|
|
363
|
+
transition = $oldPage[0].f7PageTransition;
|
|
364
|
+
delete $oldPage[0].f7PageTransition;
|
|
365
|
+
}
|
|
366
|
+
if (options.transition) transition = options.transition;
|
|
367
|
+
if (!transition && router.previousRoute && router.previousRoute.route) {
|
|
368
|
+
transition = router.previousRoute.route.transition;
|
|
369
|
+
}
|
|
370
|
+
if (!transition && router.previousRoute && router.previousRoute.route && router.previousRoute.route.options) {
|
|
371
|
+
transition = router.previousRoute.route.options.transition;
|
|
372
|
+
}
|
|
373
|
+
setPositionClasses();
|
|
374
|
+
router.animate($oldPage, $newPage, $oldNavbarEl, $newNavbarEl, 'backward', transition, () => {
|
|
375
|
+
afterAnimation();
|
|
376
|
+
});
|
|
377
|
+
} else {
|
|
378
|
+
afterAnimation();
|
|
379
|
+
}
|
|
380
|
+
return router;
|
|
381
|
+
}
|
|
382
|
+
function loadBack(router, backParams, backOptions, ignorePageChange) {
|
|
383
|
+
if (!router.allowPageChange && !ignorePageChange) return router;
|
|
384
|
+
const params = backParams;
|
|
385
|
+
const options = backOptions;
|
|
386
|
+
const {
|
|
387
|
+
url,
|
|
388
|
+
content,
|
|
389
|
+
el,
|
|
390
|
+
pageName,
|
|
391
|
+
component,
|
|
392
|
+
componentUrl
|
|
393
|
+
} = params;
|
|
394
|
+
if (options.route.url && router.url === options.route.url && !(options.reloadCurrent || options.reloadPrevious) && !router.params.allowDuplicateUrls) {
|
|
395
|
+
router.allowPageChange = true;
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
if (!options.route && url) {
|
|
399
|
+
options.route = router.parseRouteUrl(url);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Component Callbacks
|
|
403
|
+
function resolve(pageEl, newOptions) {
|
|
404
|
+
return backward(router, pageEl, extend(options, newOptions));
|
|
405
|
+
}
|
|
406
|
+
function reject() {
|
|
407
|
+
router.allowPageChange = true;
|
|
408
|
+
return router;
|
|
409
|
+
}
|
|
410
|
+
if (url || componentUrl || component) {
|
|
411
|
+
router.allowPageChange = false;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Proceed
|
|
415
|
+
if (content) {
|
|
416
|
+
backward(router, router.getPageEl(content), options);
|
|
417
|
+
} else if (el) {
|
|
418
|
+
// Load page from specified HTMLElement or by page name in pages container
|
|
419
|
+
backward(router, router.getPageEl(el), options);
|
|
420
|
+
} else if (pageName) {
|
|
421
|
+
// Load page by page name in pages container
|
|
422
|
+
backward(router, router.$el.children(`.page[data-name="${pageName}"]`).eq(0), options);
|
|
423
|
+
} else if (component || componentUrl) {
|
|
424
|
+
// Load from component (F7/Vue/React/...)
|
|
425
|
+
try {
|
|
426
|
+
router.pageComponentLoader({
|
|
427
|
+
routerEl: router.el,
|
|
428
|
+
component,
|
|
429
|
+
componentUrl,
|
|
430
|
+
options,
|
|
431
|
+
resolve,
|
|
432
|
+
reject
|
|
433
|
+
});
|
|
434
|
+
} catch (err) {
|
|
435
|
+
router.allowPageChange = true;
|
|
436
|
+
throw err;
|
|
437
|
+
}
|
|
438
|
+
} else if (url) {
|
|
439
|
+
// Load using XHR
|
|
440
|
+
if (router.xhrAbortController) {
|
|
441
|
+
router.xhrAbortController.abort();
|
|
442
|
+
router.xhrAbortController = false;
|
|
443
|
+
}
|
|
444
|
+
router.xhrRequest(url, options).then(pageContent => {
|
|
445
|
+
backward(router, router.getPageEl(pageContent), options);
|
|
446
|
+
}).catch(() => {
|
|
447
|
+
router.allowPageChange = true;
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
return router;
|
|
451
|
+
}
|
|
452
|
+
function back() {
|
|
453
|
+
const router = this;
|
|
454
|
+
const device = getDevice();
|
|
455
|
+
if (router.swipeBackActive) return router;
|
|
456
|
+
let navigateUrl;
|
|
457
|
+
let navigateOptions;
|
|
458
|
+
let navigateProps;
|
|
459
|
+
let route;
|
|
460
|
+
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') {
|
|
461
|
+
navigateOptions = (arguments.length <= 0 ? undefined : arguments[0]) || {};
|
|
462
|
+
} else {
|
|
463
|
+
navigateUrl = arguments.length <= 0 ? undefined : arguments[0];
|
|
464
|
+
navigateOptions = (arguments.length <= 1 ? undefined : arguments[1]) || {};
|
|
465
|
+
}
|
|
466
|
+
const {
|
|
467
|
+
name,
|
|
468
|
+
params,
|
|
469
|
+
query
|
|
470
|
+
} = navigateOptions;
|
|
471
|
+
if (name) {
|
|
472
|
+
navigateUrl = router.generateUrl({
|
|
473
|
+
name,
|
|
474
|
+
params,
|
|
475
|
+
query
|
|
476
|
+
});
|
|
477
|
+
if (navigateUrl) {
|
|
478
|
+
return router.back(navigateUrl, extend({}, navigateOptions, {
|
|
479
|
+
name: null,
|
|
480
|
+
params: null,
|
|
481
|
+
query: null
|
|
482
|
+
}));
|
|
483
|
+
}
|
|
484
|
+
return router;
|
|
485
|
+
}
|
|
486
|
+
const app = router.app;
|
|
487
|
+
appRouterCheck(router, 'back');
|
|
488
|
+
let currentRouteIsModal = router.currentRoute.modal;
|
|
489
|
+
let modalType;
|
|
490
|
+
if (!currentRouteIsModal) {
|
|
491
|
+
'popup popover sheet loginScreen actions customModal panel'.split(' ').forEach(modalLoadProp => {
|
|
492
|
+
if (router.currentRoute.route[modalLoadProp]) {
|
|
493
|
+
currentRouteIsModal = true;
|
|
494
|
+
modalType = modalLoadProp;
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
if (currentRouteIsModal && !navigateOptions.preload) {
|
|
499
|
+
const modalToClose = router.currentRoute.modal || router.currentRoute.route.modalInstance || app[modalType].get();
|
|
500
|
+
const previousUrl = router.history[router.history.length - 2];
|
|
501
|
+
let previousRoute;
|
|
502
|
+
// check if previous route is modal too
|
|
503
|
+
if (modalToClose && modalToClose.$el) {
|
|
504
|
+
const prevOpenedModals = modalToClose.$el.prevAll('.modal-in');
|
|
505
|
+
if (prevOpenedModals.length && prevOpenedModals[0].f7Modal) {
|
|
506
|
+
const modalEl = prevOpenedModals[0];
|
|
507
|
+
// check if current router not inside of the modalEl
|
|
508
|
+
if (!router.$el.parents(modalEl).length) {
|
|
509
|
+
previousRoute = modalEl.f7Modal.route;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (!previousRoute) {
|
|
514
|
+
previousRoute = router.findMatchingRoute(previousUrl);
|
|
515
|
+
}
|
|
516
|
+
if (!previousRoute && previousUrl) {
|
|
517
|
+
previousRoute = {
|
|
518
|
+
url: previousUrl,
|
|
519
|
+
path: previousUrl.split('?')[0],
|
|
520
|
+
query: parseUrlQuery(previousUrl),
|
|
521
|
+
route: {
|
|
522
|
+
path: previousUrl.split('?')[0],
|
|
523
|
+
url: previousUrl
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
if (!navigateUrl || navigateUrl.replace(/[# ]/g, '').trim().length === 0) {
|
|
528
|
+
if (!previousRoute || !modalToClose) {
|
|
529
|
+
return router;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
const forceOtherUrl = navigateOptions.force && previousRoute && navigateUrl;
|
|
533
|
+
if (previousRoute && modalToClose) {
|
|
534
|
+
const isBrokenBrowserHistory = device.ie || device.edge || device.firefox && !device.ios;
|
|
535
|
+
const needHistoryBack = router.params.browserHistory && navigateOptions.browserHistory !== false;
|
|
536
|
+
const currentRouteWithoutBrowserHistory = router.currentRoute && router.currentRoute.route && router.currentRoute.route.options && router.currentRoute.route.options.browserHistory === false;
|
|
537
|
+
if (needHistoryBack && !isBrokenBrowserHistory && !currentRouteWithoutBrowserHistory) {
|
|
538
|
+
History.back();
|
|
539
|
+
}
|
|
540
|
+
router.currentRoute = previousRoute;
|
|
541
|
+
router.history.pop();
|
|
542
|
+
router.propsHistory.pop();
|
|
543
|
+
router.saveHistory();
|
|
544
|
+
if (needHistoryBack && isBrokenBrowserHistory && !currentRouteWithoutBrowserHistory) {
|
|
545
|
+
History.back();
|
|
546
|
+
}
|
|
547
|
+
router.modalRemove(modalToClose);
|
|
548
|
+
if (forceOtherUrl) {
|
|
549
|
+
router.navigate(navigateUrl, {
|
|
550
|
+
reloadCurrent: true
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
} else if (modalToClose) {
|
|
554
|
+
router.modalRemove(modalToClose);
|
|
555
|
+
if (navigateUrl) {
|
|
556
|
+
router.navigate(navigateUrl, {
|
|
557
|
+
reloadCurrent: true
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
return router;
|
|
562
|
+
}
|
|
563
|
+
let $previousPage = router.$el.children('.page-current').prevAll('.page-previous:not(.page-master)').eq(0);
|
|
564
|
+
let skipMaster;
|
|
565
|
+
if (router.params.masterDetailBreakpoint > 0) {
|
|
566
|
+
const classes = [];
|
|
567
|
+
router.$el.children('.page').each(pageEl => {
|
|
568
|
+
classes.push(pageEl.className);
|
|
569
|
+
});
|
|
570
|
+
const $previousMaster = router.$el.children('.page-current').prevAll('.page-master').eq(0);
|
|
571
|
+
if ($previousMaster.length) {
|
|
572
|
+
const expectedPreviousPageUrl = router.history[router.history.length - 2];
|
|
573
|
+
const expectedPreviousPageRoute = router.findMatchingRoute(expectedPreviousPageUrl);
|
|
574
|
+
if (expectedPreviousPageRoute && $previousMaster[0].f7Page && expectedPreviousPageRoute.route === $previousMaster[0].f7Page.route.route) {
|
|
575
|
+
$previousPage = $previousMaster;
|
|
576
|
+
if (!navigateOptions.preload) {
|
|
577
|
+
skipMaster = app.width >= router.params.masterDetailBreakpoint;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
if (!navigateOptions.force && $previousPage.length && !skipMaster) {
|
|
583
|
+
const previousPageObj = $previousPage[0].f7Page;
|
|
584
|
+
if (router.params.browserHistory && previousPageObj && router.history[router.history.length - 2] !== previousPageObj.route.url) {
|
|
585
|
+
router.back(router.history[router.history.length - 2], extend(navigateOptions, {
|
|
586
|
+
force: true,
|
|
587
|
+
props: router.propsHistory[router.propsHistory.length - 2] || {}
|
|
588
|
+
}));
|
|
589
|
+
return router;
|
|
590
|
+
}
|
|
591
|
+
if (previousPageObj) {
|
|
592
|
+
const previousPageRoute = previousPageObj.route;
|
|
593
|
+
processRouteQueue.call(router, previousPageRoute, router.currentRoute, () => {
|
|
594
|
+
loadBack(router, {
|
|
595
|
+
el: $previousPage
|
|
596
|
+
}, extend(navigateOptions, {
|
|
597
|
+
route: previousPageRoute
|
|
598
|
+
}));
|
|
599
|
+
}, () => {}, 'backward');
|
|
600
|
+
return router;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Navigate URL
|
|
605
|
+
if (navigateUrl === '#') {
|
|
606
|
+
navigateUrl = undefined;
|
|
607
|
+
}
|
|
608
|
+
if (navigateUrl && navigateUrl[0] !== '/' && navigateUrl.indexOf('#') !== 0) {
|
|
609
|
+
navigateUrl = ((router.path || '/') + navigateUrl).replace('//', '/');
|
|
610
|
+
}
|
|
611
|
+
if (!navigateUrl && router.history.length > 1) {
|
|
612
|
+
navigateUrl = router.history[router.history.length - 2];
|
|
613
|
+
navigateProps = router.propsHistory[router.propsHistory.length - 2] || {};
|
|
614
|
+
}
|
|
615
|
+
if (skipMaster && !navigateOptions.force && router.history[router.history.length - 3]) {
|
|
616
|
+
return router.back(router.history[router.history.length - 3], extend({}, navigateOptions || {}, {
|
|
617
|
+
force: true,
|
|
618
|
+
animate: false,
|
|
619
|
+
props: router.propsHistory[router.propsHistory.length - 3] || {}
|
|
620
|
+
}));
|
|
621
|
+
}
|
|
622
|
+
if (skipMaster && !navigateOptions.force) {
|
|
623
|
+
return router;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// Find route to load
|
|
627
|
+
route = router.findMatchingRoute(navigateUrl);
|
|
628
|
+
if (!route) {
|
|
629
|
+
if (navigateUrl) {
|
|
630
|
+
route = {
|
|
631
|
+
url: navigateUrl,
|
|
632
|
+
path: navigateUrl.split('?')[0],
|
|
633
|
+
query: parseUrlQuery(navigateUrl),
|
|
634
|
+
route: {
|
|
635
|
+
path: navigateUrl.split('?')[0],
|
|
636
|
+
url: navigateUrl
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (!route) {
|
|
642
|
+
return router;
|
|
643
|
+
}
|
|
644
|
+
if (route.route.redirect) {
|
|
645
|
+
return redirect.call(router, 'backward', route, navigateOptions);
|
|
646
|
+
}
|
|
647
|
+
const options = {};
|
|
648
|
+
if (route.route.options) {
|
|
649
|
+
extend(options, route.route.options, navigateOptions, {
|
|
650
|
+
props: navigateProps || {}
|
|
651
|
+
});
|
|
652
|
+
} else {
|
|
653
|
+
extend(options, navigateOptions, {
|
|
654
|
+
props: navigateProps || {}
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
options.route = route;
|
|
658
|
+
function resolve() {
|
|
659
|
+
let routerLoaded = false;
|
|
660
|
+
if (route.route.keepAlive && route.route.keepAliveData) {
|
|
661
|
+
loadBack(router, {
|
|
662
|
+
el: route.route.keepAliveData.pageEl
|
|
663
|
+
}, options);
|
|
664
|
+
routerLoaded = true;
|
|
665
|
+
}
|
|
666
|
+
'url content component pageName el componentUrl'.split(' ').forEach(pageLoadProp => {
|
|
667
|
+
if (route.route[pageLoadProp] && !routerLoaded) {
|
|
668
|
+
routerLoaded = true;
|
|
669
|
+
loadBack(router, {
|
|
670
|
+
[pageLoadProp]: route.route[pageLoadProp]
|
|
671
|
+
}, options);
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
if (routerLoaded) return;
|
|
675
|
+
// Async
|
|
676
|
+
function asyncResolve(resolveParams, resolveOptions) {
|
|
677
|
+
router.allowPageChange = false;
|
|
678
|
+
loadBack(router, resolveParams, extend(options, resolveOptions), true);
|
|
679
|
+
}
|
|
680
|
+
function asyncReject() {
|
|
681
|
+
router.allowPageChange = true;
|
|
682
|
+
}
|
|
683
|
+
if (route.route.async) {
|
|
684
|
+
router.allowPageChange = false;
|
|
685
|
+
route.route.async.call(router, {
|
|
686
|
+
router,
|
|
687
|
+
to: route,
|
|
688
|
+
from: router.currentRoute,
|
|
689
|
+
resolve: asyncResolve,
|
|
690
|
+
reject: asyncReject,
|
|
691
|
+
direction: 'backward',
|
|
692
|
+
app
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
if (route.route.asyncComponent) {
|
|
696
|
+
asyncComponent(router, route.route.asyncComponent, asyncResolve, asyncReject);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function reject() {
|
|
700
|
+
router.allowPageChange = true;
|
|
701
|
+
}
|
|
702
|
+
if (options.preload) {
|
|
703
|
+
resolve();
|
|
704
|
+
} else {
|
|
705
|
+
processRouteQueue.call(router, route, router.currentRoute, () => {
|
|
706
|
+
if (route.route.modules) {
|
|
707
|
+
app.loadModules(Array.isArray(route.route.modules) ? route.route.modules : [route.route.modules]).then(() => {
|
|
708
|
+
resolve();
|
|
709
|
+
}).catch(() => {
|
|
710
|
+
reject();
|
|
711
|
+
});
|
|
712
|
+
} else {
|
|
713
|
+
resolve();
|
|
714
|
+
}
|
|
715
|
+
}, () => {
|
|
716
|
+
reject();
|
|
717
|
+
}, 'backward');
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
// Return Router
|
|
721
|
+
return router;
|
|
722
|
+
}
|
|
723
|
+
export { back };
|