@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,712 @@
|
|
|
1
|
+
import $ from '../../shared/dom7.js';
|
|
2
|
+
import { bindMethods } from '../../shared/utils.js';
|
|
3
|
+
import { getSupport } from '../../shared/get-support.js';
|
|
4
|
+
const Navbar = {
|
|
5
|
+
size(el) {
|
|
6
|
+
const app = this;
|
|
7
|
+
let $el = $(el);
|
|
8
|
+
if ($el.hasClass('navbars')) {
|
|
9
|
+
$el = $el.children('.navbar').each(navbarEl => {
|
|
10
|
+
app.navbar.size(navbarEl);
|
|
11
|
+
});
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const $innerEl = $el.children('.navbar-inner');
|
|
15
|
+
if (!$innerEl.length) return;
|
|
16
|
+
const needCenterTitle = $innerEl.hasClass('navbar-inner-centered-title') || app.params.navbar[`${app.theme}CenterTitle`];
|
|
17
|
+
const needLeftTitle = app.theme === 'ios' && !app.params.navbar[`${app.theme}CenterTitle`];
|
|
18
|
+
if (!needCenterTitle && !needLeftTitle) return;
|
|
19
|
+
if ($el.parents('.tab:not(.tab-active)').length > 0 || $el.parents('.popup:not(.modal-in)').length > 0) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (app.theme !== 'ios' && app.params.navbar[`${app.theme}CenterTitle`]) {
|
|
23
|
+
$innerEl.addClass('navbar-inner-centered-title');
|
|
24
|
+
}
|
|
25
|
+
if (app.theme === 'ios' && !app.params.navbar.iosCenterTitle) {
|
|
26
|
+
$innerEl.addClass('navbar-inner-left-title');
|
|
27
|
+
}
|
|
28
|
+
const $viewEl = $el.parents('.view').eq(0);
|
|
29
|
+
const left = app.rtl ? $innerEl.children('.right') : $innerEl.children('.left');
|
|
30
|
+
const right = app.rtl ? $innerEl.children('.left') : $innerEl.children('.right');
|
|
31
|
+
const title = $innerEl.children('.title');
|
|
32
|
+
const subnavbar = $innerEl.children('.subnavbar');
|
|
33
|
+
const noLeft = left.length === 0;
|
|
34
|
+
const noRight = right.length === 0;
|
|
35
|
+
const leftWidth = noLeft ? 0 : left.outerWidth(true);
|
|
36
|
+
const rightWidth = noRight ? 0 : right.outerWidth(true);
|
|
37
|
+
const titleWidth = title.outerWidth(true);
|
|
38
|
+
const navbarStyles = $innerEl.styles();
|
|
39
|
+
const navbarWidth = $innerEl[0].offsetWidth;
|
|
40
|
+
const navbarInnerWidth = navbarWidth - parseInt(navbarStyles.paddingLeft, 10) - parseInt(navbarStyles.paddingRight, 10);
|
|
41
|
+
const isPrevious = $el.hasClass('navbar-previous');
|
|
42
|
+
const sliding = $innerEl.hasClass('sliding');
|
|
43
|
+
let router;
|
|
44
|
+
let dynamicNavbar;
|
|
45
|
+
if ($viewEl.length > 0 && $viewEl[0].f7View) {
|
|
46
|
+
router = $viewEl[0].f7View.router;
|
|
47
|
+
dynamicNavbar = router && router.dynamicNavbar;
|
|
48
|
+
}
|
|
49
|
+
let currLeft;
|
|
50
|
+
let diff;
|
|
51
|
+
if (noRight) {
|
|
52
|
+
currLeft = navbarInnerWidth - titleWidth;
|
|
53
|
+
}
|
|
54
|
+
if (noLeft) {
|
|
55
|
+
currLeft = 0;
|
|
56
|
+
}
|
|
57
|
+
if (!noLeft && !noRight) {
|
|
58
|
+
currLeft = (navbarInnerWidth - rightWidth - titleWidth + leftWidth) / 2;
|
|
59
|
+
}
|
|
60
|
+
let requiredLeft = (navbarInnerWidth - titleWidth) / 2;
|
|
61
|
+
if (navbarInnerWidth - leftWidth - rightWidth > titleWidth) {
|
|
62
|
+
if (requiredLeft < leftWidth) {
|
|
63
|
+
requiredLeft = leftWidth;
|
|
64
|
+
}
|
|
65
|
+
if (requiredLeft + titleWidth > navbarInnerWidth - rightWidth) {
|
|
66
|
+
requiredLeft = navbarInnerWidth - rightWidth - titleWidth;
|
|
67
|
+
}
|
|
68
|
+
diff = requiredLeft - currLeft;
|
|
69
|
+
} else {
|
|
70
|
+
diff = 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// RTL inverter
|
|
74
|
+
const inverter = app.rtl ? -1 : 1;
|
|
75
|
+
if (dynamicNavbar && app.theme === 'ios') {
|
|
76
|
+
if (title.hasClass('sliding') || title.length > 0 && sliding) {
|
|
77
|
+
let titleLeftOffset = -(currLeft + diff) * inverter;
|
|
78
|
+
const titleRightOffset = (navbarInnerWidth - currLeft - diff - titleWidth) * inverter;
|
|
79
|
+
if (isPrevious) {
|
|
80
|
+
if (router && router.params.iosAnimateNavbarBackIcon) {
|
|
81
|
+
const activeNavbarBackLink = $el.parent().find('.navbar-current').children('.left.sliding').find('.back .icon ~ span');
|
|
82
|
+
if (activeNavbarBackLink.length > 0) {
|
|
83
|
+
titleLeftOffset += activeNavbarBackLink[0].offsetLeft;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
title[0].f7NavbarLeftOffset = titleLeftOffset;
|
|
88
|
+
title[0].f7NavbarRightOffset = titleRightOffset;
|
|
89
|
+
}
|
|
90
|
+
if (!noLeft && (left.hasClass('sliding') || sliding)) {
|
|
91
|
+
if (app.rtl) {
|
|
92
|
+
left[0].f7NavbarLeftOffset = -(navbarInnerWidth - left[0].offsetWidth) / 2 * inverter;
|
|
93
|
+
left[0].f7NavbarRightOffset = leftWidth * inverter;
|
|
94
|
+
} else {
|
|
95
|
+
left[0].f7NavbarLeftOffset = -leftWidth;
|
|
96
|
+
left[0].f7NavbarRightOffset = (navbarInnerWidth - left[0].offsetWidth) / 2;
|
|
97
|
+
if (router && router.params.iosAnimateNavbarBackIcon && left.find('.back .icon').length > 0) {
|
|
98
|
+
if (left.find('.back .icon ~ span').length) {
|
|
99
|
+
const leftOffset = left[0].f7NavbarLeftOffset;
|
|
100
|
+
const rightOffset = left[0].f7NavbarRightOffset;
|
|
101
|
+
left[0].f7NavbarLeftOffset = 0;
|
|
102
|
+
left[0].f7NavbarRightOffset = 0;
|
|
103
|
+
left.find('.back .icon ~ span')[0].f7NavbarLeftOffset = leftOffset;
|
|
104
|
+
left.find('.back .icon ~ span')[0].f7NavbarRightOffset = rightOffset - left.find('.back .icon')[0].offsetWidth;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (!noRight && (right.hasClass('sliding') || sliding)) {
|
|
110
|
+
if (app.rtl) {
|
|
111
|
+
right[0].f7NavbarLeftOffset = -rightWidth * inverter;
|
|
112
|
+
right[0].f7NavbarRightOffset = (navbarInnerWidth - right[0].offsetWidth) / 2 * inverter;
|
|
113
|
+
} else {
|
|
114
|
+
right[0].f7NavbarLeftOffset = -(navbarInnerWidth - right[0].offsetWidth) / 2;
|
|
115
|
+
right[0].f7NavbarRightOffset = rightWidth;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (subnavbar.length && (subnavbar.hasClass('sliding') || sliding)) {
|
|
119
|
+
subnavbar[0].f7NavbarLeftOffset = app.rtl ? subnavbar[0].offsetWidth : -subnavbar[0].offsetWidth;
|
|
120
|
+
subnavbar[0].f7NavbarRightOffset = -subnavbar[0].f7NavbarLeftOffset;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Center title
|
|
125
|
+
if (needCenterTitle) {
|
|
126
|
+
let titleLeft = diff;
|
|
127
|
+
if (app.rtl && noLeft && noRight && title.length > 0) titleLeft = -titleLeft;
|
|
128
|
+
title.css({
|
|
129
|
+
left: `${titleLeft}px`
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
hide(el, animate, hideStatusbar, hideOnlyCurrent) {
|
|
134
|
+
if (animate === void 0) {
|
|
135
|
+
animate = true;
|
|
136
|
+
}
|
|
137
|
+
if (hideStatusbar === void 0) {
|
|
138
|
+
hideStatusbar = false;
|
|
139
|
+
}
|
|
140
|
+
if (hideOnlyCurrent === void 0) {
|
|
141
|
+
hideOnlyCurrent = false;
|
|
142
|
+
}
|
|
143
|
+
const app = this;
|
|
144
|
+
let $el = $(el);
|
|
145
|
+
const isDynamic = $el.hasClass('navbar') && $el.parent('.navbars').length && !hideOnlyCurrent;
|
|
146
|
+
if (isDynamic) $el = $el.parents('.navbars');
|
|
147
|
+
if (!$el.length) return;
|
|
148
|
+
if ($el.hasClass('navbar-hidden')) return;
|
|
149
|
+
let className = `navbar-hidden${animate ? ' navbar-transitioning' : ''}`;
|
|
150
|
+
const currentIsLarge = isDynamic ? $el.find('.navbar-current .title-large').length : $el.find('.title-large').length;
|
|
151
|
+
if (currentIsLarge) {
|
|
152
|
+
className += ' navbar-large-hidden';
|
|
153
|
+
}
|
|
154
|
+
if (hideStatusbar) {
|
|
155
|
+
className += ' navbar-hidden-statusbar';
|
|
156
|
+
}
|
|
157
|
+
$el.transitionEnd(() => {
|
|
158
|
+
$el.removeClass('navbar-transitioning');
|
|
159
|
+
});
|
|
160
|
+
$el.addClass(className);
|
|
161
|
+
if (isDynamic) {
|
|
162
|
+
$el.children('.navbar').each(subEl => {
|
|
163
|
+
$(subEl).trigger('navbar:hide');
|
|
164
|
+
app.emit('navbarHide', subEl);
|
|
165
|
+
});
|
|
166
|
+
} else {
|
|
167
|
+
$el.trigger('navbar:hide');
|
|
168
|
+
app.emit('navbarHide', $el[0]);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
show(el, animate, hideOnlyCurrent) {
|
|
172
|
+
if (el === void 0) {
|
|
173
|
+
el = '.navbar-hidden';
|
|
174
|
+
}
|
|
175
|
+
if (animate === void 0) {
|
|
176
|
+
animate = true;
|
|
177
|
+
}
|
|
178
|
+
if (hideOnlyCurrent === void 0) {
|
|
179
|
+
hideOnlyCurrent = false;
|
|
180
|
+
}
|
|
181
|
+
const app = this;
|
|
182
|
+
let $el = $(el);
|
|
183
|
+
const isDynamic = $el.hasClass('navbar') && $el.parent('.navbars').length && !hideOnlyCurrent;
|
|
184
|
+
if (isDynamic) $el = $el.parents('.navbars');
|
|
185
|
+
if (!$el.length) return;
|
|
186
|
+
if (!$el.hasClass('navbar-hidden')) return;
|
|
187
|
+
if (animate) {
|
|
188
|
+
$el.addClass('navbar-transitioning');
|
|
189
|
+
$el.transitionEnd(() => {
|
|
190
|
+
$el.removeClass('navbar-transitioning');
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
$el.removeClass('navbar-hidden navbar-large-hidden navbar-hidden-statusbar');
|
|
194
|
+
if (isDynamic) {
|
|
195
|
+
$el.children('.navbar').each(subEl => {
|
|
196
|
+
$(subEl).trigger('navbar:show');
|
|
197
|
+
app.emit('navbarShow', subEl);
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
$el.trigger('navbar:show');
|
|
201
|
+
app.emit('navbarShow', $el[0]);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
getElByPage(page) {
|
|
205
|
+
let $pageEl;
|
|
206
|
+
let $navbarEl;
|
|
207
|
+
let pageData;
|
|
208
|
+
if (page.$navbarEl || page.$el) {
|
|
209
|
+
pageData = page;
|
|
210
|
+
$pageEl = page.$el;
|
|
211
|
+
} else {
|
|
212
|
+
$pageEl = $(page);
|
|
213
|
+
if ($pageEl.length > 0) pageData = $pageEl[0].f7Page;
|
|
214
|
+
}
|
|
215
|
+
if (pageData && pageData.$navbarEl && pageData.$navbarEl.length > 0) {
|
|
216
|
+
$navbarEl = pageData.$navbarEl;
|
|
217
|
+
} else if ($pageEl) {
|
|
218
|
+
$navbarEl = $pageEl.children('.navbar');
|
|
219
|
+
}
|
|
220
|
+
if (!$navbarEl || $navbarEl && $navbarEl.length === 0) return undefined;
|
|
221
|
+
return $navbarEl[0];
|
|
222
|
+
},
|
|
223
|
+
getPageByEl(navbarEl) {
|
|
224
|
+
const $navbarEl = $(navbarEl);
|
|
225
|
+
if ($navbarEl.parents('.page').length) {
|
|
226
|
+
return $navbarEl.parents('.page')[0];
|
|
227
|
+
}
|
|
228
|
+
let pageEl;
|
|
229
|
+
$navbarEl.parents('.view').find('.page').each(el => {
|
|
230
|
+
if (el && el.f7Page && el.f7Page.navbarEl && $navbarEl[0] === el.f7Page.navbarEl) {
|
|
231
|
+
pageEl = el;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
return pageEl;
|
|
235
|
+
},
|
|
236
|
+
collapseLargeTitle(navbarEl) {
|
|
237
|
+
const app = this;
|
|
238
|
+
let $navbarEl = $(navbarEl);
|
|
239
|
+
if ($navbarEl.hasClass('navbars')) {
|
|
240
|
+
$navbarEl = $navbarEl.find('.navbar');
|
|
241
|
+
if ($navbarEl.length > 1) {
|
|
242
|
+
$navbarEl = $(navbarEl).find('.navbar-large.navbar-current');
|
|
243
|
+
}
|
|
244
|
+
if ($navbarEl.length > 1 || !$navbarEl.length) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const $pageEl = $(app.navbar.getPageByEl($navbarEl));
|
|
249
|
+
$navbarEl.addClass('navbar-large-collapsed');
|
|
250
|
+
$pageEl.eq(0).addClass('page-with-navbar-large-collapsed').trigger('page:navbarlargecollapsed');
|
|
251
|
+
app.emit('pageNavbarLargeCollapsed', $pageEl[0]);
|
|
252
|
+
$navbarEl.trigger('navbar:collapse');
|
|
253
|
+
app.emit('navbarCollapse', $navbarEl[0]);
|
|
254
|
+
},
|
|
255
|
+
expandLargeTitle(navbarEl) {
|
|
256
|
+
const app = this;
|
|
257
|
+
let $navbarEl = $(navbarEl);
|
|
258
|
+
if ($navbarEl.hasClass('navbars')) {
|
|
259
|
+
$navbarEl = $navbarEl.find('.navbar-large');
|
|
260
|
+
if ($navbarEl.length > 1) {
|
|
261
|
+
$navbarEl = $(navbarEl).find('.navbar-large.navbar-current');
|
|
262
|
+
}
|
|
263
|
+
if ($navbarEl.length > 1 || !$navbarEl.length) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const $pageEl = $(app.navbar.getPageByEl($navbarEl));
|
|
268
|
+
$navbarEl.removeClass('navbar-large-collapsed');
|
|
269
|
+
$pageEl.eq(0).removeClass('page-with-navbar-large-collapsed').trigger('page:navbarlargeexpanded');
|
|
270
|
+
app.emit('pageNavbarLargeExpanded', $pageEl[0]);
|
|
271
|
+
$navbarEl.trigger('navbar:expand');
|
|
272
|
+
app.emit('navbarExpand', $navbarEl[0]);
|
|
273
|
+
},
|
|
274
|
+
toggleLargeTitle(navbarEl) {
|
|
275
|
+
const app = this;
|
|
276
|
+
let $navbarEl = $(navbarEl);
|
|
277
|
+
if ($navbarEl.hasClass('navbars')) {
|
|
278
|
+
$navbarEl = $navbarEl.find('.navbar-large');
|
|
279
|
+
if ($navbarEl.length > 1) {
|
|
280
|
+
$navbarEl = $(navbarEl).find('.navbar-large.navbar-current');
|
|
281
|
+
}
|
|
282
|
+
if ($navbarEl.length > 1 || !$navbarEl.length) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if ($navbarEl.hasClass('navbar-large-collapsed')) {
|
|
287
|
+
app.navbar.expandLargeTitle($navbarEl);
|
|
288
|
+
} else {
|
|
289
|
+
app.navbar.collapseLargeTitle($navbarEl);
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
initNavbarOnScroll(pageEl, navbarEl, needHide, needCollapse, needTransparent) {
|
|
293
|
+
const app = this;
|
|
294
|
+
const support = getSupport();
|
|
295
|
+
const $pageEl = $(pageEl);
|
|
296
|
+
const $navbarEl = $(navbarEl);
|
|
297
|
+
const $titleLargeEl = $navbarEl.find('.title-large');
|
|
298
|
+
const isLarge = $titleLargeEl.length || $navbarEl.hasClass('.navbar-large');
|
|
299
|
+
let navbarHideHeight = 44;
|
|
300
|
+
const snapPageScrollToLargeTitle = app.params.navbar.snapPageScrollToLargeTitle;
|
|
301
|
+
const snapPageScrollToTransparentNavbar = app.params.navbar.snapPageScrollToTransparentNavbar;
|
|
302
|
+
let previousScrollTop;
|
|
303
|
+
let currentScrollTop;
|
|
304
|
+
let scrollHeight;
|
|
305
|
+
let offsetHeight;
|
|
306
|
+
let reachEnd;
|
|
307
|
+
let action;
|
|
308
|
+
let navbarHidden;
|
|
309
|
+
let navbarCollapsed;
|
|
310
|
+
let navbarTitleLargeHeight;
|
|
311
|
+
let navbarOffsetHeight;
|
|
312
|
+
if (needCollapse || needHide && isLarge) {
|
|
313
|
+
navbarTitleLargeHeight = $navbarEl.css('--f7-navbar-large-title-height');
|
|
314
|
+
if (navbarTitleLargeHeight && navbarTitleLargeHeight.indexOf('px') >= 0) {
|
|
315
|
+
navbarTitleLargeHeight = parseInt(navbarTitleLargeHeight, 10);
|
|
316
|
+
if (Number.isNaN(navbarTitleLargeHeight) && $titleLargeEl.length) {
|
|
317
|
+
navbarTitleLargeHeight = $titleLargeEl[0].offsetHeight;
|
|
318
|
+
} else if (Number.isNaN(navbarTitleLargeHeight)) {
|
|
319
|
+
if (app.theme === 'ios') navbarTitleLargeHeight = 52;else if (app.theme === 'md') navbarTitleLargeHeight = 88;
|
|
320
|
+
}
|
|
321
|
+
} else if ($titleLargeEl.length) {
|
|
322
|
+
navbarTitleLargeHeight = $titleLargeEl[0].offsetHeight;
|
|
323
|
+
} else {
|
|
324
|
+
// eslint-disable-next-line
|
|
325
|
+
if (app.theme === 'ios') navbarTitleLargeHeight = 52;else if (app.theme === 'md') navbarTitleLargeHeight = 88;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (needHide && isLarge) {
|
|
329
|
+
navbarHideHeight += navbarTitleLargeHeight;
|
|
330
|
+
}
|
|
331
|
+
let scrollChanged;
|
|
332
|
+
let scrollContent;
|
|
333
|
+
let scrollTimeoutId;
|
|
334
|
+
let touchEndTimeoutId;
|
|
335
|
+
const touchSnapTimeout = 70;
|
|
336
|
+
const desktopSnapTimeout = 300;
|
|
337
|
+
function calcScrollableDistance() {
|
|
338
|
+
$pageEl.find('.page-content').each(pageContentEl => {
|
|
339
|
+
pageContentEl.f7ScrollableDistance = pageContentEl.scrollHeight - pageContentEl.offsetHeight;
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
function snapLargeNavbar() {
|
|
343
|
+
const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');
|
|
344
|
+
if (inSearchbarExpanded) return;
|
|
345
|
+
if (!scrollContent || currentScrollTop < 0) return;
|
|
346
|
+
if (currentScrollTop >= navbarTitleLargeHeight / 2 && currentScrollTop < navbarTitleLargeHeight) {
|
|
347
|
+
$(scrollContent).scrollTop(navbarTitleLargeHeight, 100);
|
|
348
|
+
} else if (currentScrollTop < navbarTitleLargeHeight) {
|
|
349
|
+
$(scrollContent).scrollTop(0, 200);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function snapTransparentNavbar() {
|
|
353
|
+
const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');
|
|
354
|
+
if (inSearchbarExpanded) return;
|
|
355
|
+
if (!scrollContent || currentScrollTop < 0) return;
|
|
356
|
+
if (currentScrollTop >= navbarOffsetHeight / 2 && currentScrollTop < navbarOffsetHeight) {
|
|
357
|
+
$(scrollContent).scrollTop(navbarOffsetHeight, 100);
|
|
358
|
+
} else if (currentScrollTop < navbarOffsetHeight) {
|
|
359
|
+
$(scrollContent).scrollTop(0, 200);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function handleNavbarTransparent() {
|
|
363
|
+
const isHidden = $navbarEl.hasClass('navbar-hidden') || $navbarEl.parent('.navbars').hasClass('navbar-hidden');
|
|
364
|
+
const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');
|
|
365
|
+
if (inSearchbarExpanded || isHidden) return;
|
|
366
|
+
if (!navbarOffsetHeight) {
|
|
367
|
+
navbarOffsetHeight = navbarEl.offsetHeight;
|
|
368
|
+
}
|
|
369
|
+
let opacity = currentScrollTop / navbarOffsetHeight;
|
|
370
|
+
const notTransparent = $navbarEl.hasClass('navbar-transparent-visible');
|
|
371
|
+
opacity = Math.max(Math.min(opacity, 1), 0);
|
|
372
|
+
if (notTransparent && opacity === 1 || !notTransparent && opacity === 0) {
|
|
373
|
+
$navbarEl.find('.navbar-bg, .title').css('opacity', '');
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (notTransparent && opacity === 0) {
|
|
377
|
+
$navbarEl.trigger('navbar:transparenthide');
|
|
378
|
+
app.emit('navbarTransparentHide', $navbarEl[0]);
|
|
379
|
+
$navbarEl.removeClass('navbar-transparent-visible');
|
|
380
|
+
$navbarEl.find('.navbar-bg, .title').css('opacity', '');
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (!notTransparent && opacity === 1) {
|
|
384
|
+
$navbarEl.trigger('navbar:transparentshow');
|
|
385
|
+
app.emit('navbarTransparentShow', $navbarEl[0]);
|
|
386
|
+
$navbarEl.addClass('navbar-transparent-visible');
|
|
387
|
+
$navbarEl.find('.navbar-bg, .title').css('opacity', '');
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
$navbarEl.find('.navbar-bg, .title').css('opacity', opacity);
|
|
391
|
+
if (snapPageScrollToTransparentNavbar) {
|
|
392
|
+
if (!support.touch) {
|
|
393
|
+
clearTimeout(scrollTimeoutId);
|
|
394
|
+
scrollTimeoutId = setTimeout(() => {
|
|
395
|
+
snapTransparentNavbar();
|
|
396
|
+
}, desktopSnapTimeout);
|
|
397
|
+
} else if (touchEndTimeoutId) {
|
|
398
|
+
clearTimeout(touchEndTimeoutId);
|
|
399
|
+
touchEndTimeoutId = null;
|
|
400
|
+
touchEndTimeoutId = setTimeout(() => {
|
|
401
|
+
snapTransparentNavbar();
|
|
402
|
+
clearTimeout(touchEndTimeoutId);
|
|
403
|
+
touchEndTimeoutId = null;
|
|
404
|
+
}, touchSnapTimeout);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
let previousCollapseProgress = null;
|
|
409
|
+
let collapseProgress = null;
|
|
410
|
+
function handleLargeNavbarCollapse(pageContentEl) {
|
|
411
|
+
const isHidden = $navbarEl.hasClass('navbar-hidden') || $navbarEl.parent('.navbars').hasClass('navbar-hidden');
|
|
412
|
+
if (isHidden) return;
|
|
413
|
+
const isLargeTransparent = $navbarEl.hasClass('navbar-large-transparent') || $navbarEl.hasClass('navbar-large') && $navbarEl.hasClass('navbar-transparent');
|
|
414
|
+
previousCollapseProgress = collapseProgress;
|
|
415
|
+
const scrollableDistance = Math.min(navbarTitleLargeHeight, pageContentEl.f7ScrollableDistance || navbarTitleLargeHeight);
|
|
416
|
+
collapseProgress = Math.min(Math.max(currentScrollTop / scrollableDistance, 0), 1);
|
|
417
|
+
const previousCollapseWasInMiddle = previousCollapseProgress > 0 && previousCollapseProgress < 1;
|
|
418
|
+
const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');
|
|
419
|
+
if (inSearchbarExpanded) return;
|
|
420
|
+
navbarCollapsed = $navbarEl.hasClass('navbar-large-collapsed');
|
|
421
|
+
const $bgEl = $navbarEl.find('.navbar-bg');
|
|
422
|
+
if (collapseProgress === 0 && navbarCollapsed) {
|
|
423
|
+
app.navbar.expandLargeTitle($navbarEl[0]);
|
|
424
|
+
} else if (collapseProgress === 1 && !navbarCollapsed) {
|
|
425
|
+
app.navbar.collapseLargeTitle($navbarEl[0]);
|
|
426
|
+
}
|
|
427
|
+
if (collapseProgress === 0 && navbarCollapsed || collapseProgress === 0 && previousCollapseWasInMiddle || collapseProgress === 1 && !navbarCollapsed || collapseProgress === 1 && previousCollapseWasInMiddle) {
|
|
428
|
+
if (app.theme === 'md') {
|
|
429
|
+
$navbarEl.find('.navbar-inner').css('overflow', '');
|
|
430
|
+
}
|
|
431
|
+
$navbarEl.find('.title').css('opacity', '');
|
|
432
|
+
$navbarEl.find('.title-large-text, .subnavbar').css('transform', '');
|
|
433
|
+
$navbarEl.find('.title-large-text').css('opacity', '');
|
|
434
|
+
if (isLargeTransparent) {
|
|
435
|
+
$bgEl.css('opacity', '');
|
|
436
|
+
}
|
|
437
|
+
$bgEl.css('transform', '');
|
|
438
|
+
} else if (collapseProgress > 0 && collapseProgress < 1) {
|
|
439
|
+
if (app.theme === 'md') {
|
|
440
|
+
$navbarEl.find('.navbar-inner').css('overflow', 'visible');
|
|
441
|
+
}
|
|
442
|
+
$navbarEl.find('.title').css('opacity', -0.5 + collapseProgress * 1.5);
|
|
443
|
+
$navbarEl.find('.title-large-text, .subnavbar').css('transform', `translate3d(0px, ${-1 * collapseProgress * navbarTitleLargeHeight}px, 0)`);
|
|
444
|
+
$navbarEl.find('.title-large-text').css('opacity', 1 - collapseProgress * 2);
|
|
445
|
+
if (isLargeTransparent) {
|
|
446
|
+
$bgEl.css('opacity', collapseProgress);
|
|
447
|
+
}
|
|
448
|
+
$bgEl.css('transform', `translate3d(0px, ${-1 * collapseProgress * navbarTitleLargeHeight}px, 0)`);
|
|
449
|
+
}
|
|
450
|
+
if (snapPageScrollToLargeTitle) {
|
|
451
|
+
if (!support.touch) {
|
|
452
|
+
clearTimeout(scrollTimeoutId);
|
|
453
|
+
scrollTimeoutId = setTimeout(() => {
|
|
454
|
+
snapLargeNavbar();
|
|
455
|
+
}, desktopSnapTimeout);
|
|
456
|
+
} else if (touchEndTimeoutId) {
|
|
457
|
+
clearTimeout(touchEndTimeoutId);
|
|
458
|
+
touchEndTimeoutId = null;
|
|
459
|
+
touchEndTimeoutId = setTimeout(() => {
|
|
460
|
+
snapLargeNavbar();
|
|
461
|
+
clearTimeout(touchEndTimeoutId);
|
|
462
|
+
touchEndTimeoutId = null;
|
|
463
|
+
}, touchSnapTimeout);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function handleTitleHideShow() {
|
|
468
|
+
if ($pageEl.hasClass('page-with-card-opened')) return;
|
|
469
|
+
scrollHeight = scrollContent.scrollHeight;
|
|
470
|
+
offsetHeight = scrollContent.offsetHeight;
|
|
471
|
+
reachEnd = currentScrollTop + offsetHeight >= scrollHeight;
|
|
472
|
+
navbarHidden = $navbarEl.hasClass('navbar-hidden') || $navbarEl.parent('.navbars').hasClass('navbar-hidden');
|
|
473
|
+
if (reachEnd) {
|
|
474
|
+
if (app.params.navbar.showOnPageScrollEnd) {
|
|
475
|
+
action = 'show';
|
|
476
|
+
}
|
|
477
|
+
} else if (previousScrollTop > currentScrollTop) {
|
|
478
|
+
if (app.params.navbar.showOnPageScrollTop || currentScrollTop <= navbarHideHeight) {
|
|
479
|
+
action = 'show';
|
|
480
|
+
} else {
|
|
481
|
+
action = 'hide';
|
|
482
|
+
}
|
|
483
|
+
} else if (currentScrollTop > navbarHideHeight) {
|
|
484
|
+
action = 'hide';
|
|
485
|
+
} else {
|
|
486
|
+
action = 'show';
|
|
487
|
+
}
|
|
488
|
+
if (action === 'show' && navbarHidden) {
|
|
489
|
+
app.navbar.show($navbarEl, true, true);
|
|
490
|
+
navbarHidden = false;
|
|
491
|
+
} else if (action === 'hide' && !navbarHidden) {
|
|
492
|
+
app.navbar.hide($navbarEl, true, false, true);
|
|
493
|
+
navbarHidden = true;
|
|
494
|
+
}
|
|
495
|
+
previousScrollTop = currentScrollTop;
|
|
496
|
+
}
|
|
497
|
+
function handleScroll(e) {
|
|
498
|
+
scrollContent = this;
|
|
499
|
+
if (e && e.target && e.target !== scrollContent) {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
currentScrollTop = scrollContent.scrollTop;
|
|
503
|
+
scrollChanged = currentScrollTop;
|
|
504
|
+
if (needCollapse) {
|
|
505
|
+
handleLargeNavbarCollapse(scrollContent);
|
|
506
|
+
} else if (needTransparent) {
|
|
507
|
+
handleNavbarTransparent();
|
|
508
|
+
}
|
|
509
|
+
if ($pageEl.hasClass('page-previous')) return;
|
|
510
|
+
if (needHide) {
|
|
511
|
+
handleTitleHideShow();
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function handeTouchStart() {
|
|
515
|
+
scrollChanged = false;
|
|
516
|
+
}
|
|
517
|
+
function handleTouchEnd() {
|
|
518
|
+
clearTimeout(touchEndTimeoutId);
|
|
519
|
+
touchEndTimeoutId = null;
|
|
520
|
+
touchEndTimeoutId = setTimeout(() => {
|
|
521
|
+
if (scrollChanged !== false) {
|
|
522
|
+
if (needTransparent && !needCollapse) {
|
|
523
|
+
snapTransparentNavbar();
|
|
524
|
+
} else {
|
|
525
|
+
snapLargeNavbar();
|
|
526
|
+
}
|
|
527
|
+
clearTimeout(touchEndTimeoutId);
|
|
528
|
+
touchEndTimeoutId = null;
|
|
529
|
+
}
|
|
530
|
+
}, touchSnapTimeout);
|
|
531
|
+
}
|
|
532
|
+
$pageEl.on('scroll', '.page-content', handleScroll, true);
|
|
533
|
+
if (support.touch && (needCollapse && snapPageScrollToLargeTitle || needTransparent && snapPageScrollToTransparentNavbar)) {
|
|
534
|
+
app.on('touchstart:passive', handeTouchStart);
|
|
535
|
+
app.on('touchend:passive', handleTouchEnd);
|
|
536
|
+
}
|
|
537
|
+
calcScrollableDistance();
|
|
538
|
+
if (needCollapse || needTransparent) {
|
|
539
|
+
$pageEl.find('.page-content').each(pageContentEl => {
|
|
540
|
+
if (pageContentEl.scrollTop > 0) handleScroll.call(pageContentEl);
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
app.on('resize', calcScrollableDistance);
|
|
544
|
+
$pageEl[0].f7DetachNavbarScrollHandlers = function f7DetachNavbarScrollHandlers() {
|
|
545
|
+
app.off('resize', calcScrollableDistance);
|
|
546
|
+
delete $pageEl[0].f7DetachNavbarScrollHandlers;
|
|
547
|
+
$pageEl.off('scroll', '.page-content', handleScroll, true);
|
|
548
|
+
if (support.touch && (needCollapse && snapPageScrollToLargeTitle || needTransparent && snapPageScrollToTransparentNavbar)) {
|
|
549
|
+
app.off('touchstart:passive', handeTouchStart);
|
|
550
|
+
app.off('touchend:passive', handleTouchEnd);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
export default {
|
|
556
|
+
name: 'navbar',
|
|
557
|
+
create() {
|
|
558
|
+
const app = this;
|
|
559
|
+
bindMethods(app, {
|
|
560
|
+
navbar: Navbar
|
|
561
|
+
});
|
|
562
|
+
},
|
|
563
|
+
params: {
|
|
564
|
+
navbar: {
|
|
565
|
+
scrollTopOnTitleClick: true,
|
|
566
|
+
iosCenterTitle: true,
|
|
567
|
+
mdCenterTitle: false,
|
|
568
|
+
hideOnPageScroll: false,
|
|
569
|
+
showOnPageScrollEnd: true,
|
|
570
|
+
showOnPageScrollTop: true,
|
|
571
|
+
collapseLargeTitleOnScroll: true,
|
|
572
|
+
snapPageScrollToLargeTitle: true,
|
|
573
|
+
snapPageScrollToTransparentNavbar: true
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
on: {
|
|
577
|
+
'panelBreakpoint panelCollapsedBreakpoint panelResize viewResize resize viewMasterDetailBreakpoint': function onPanelResize() {
|
|
578
|
+
const app = this;
|
|
579
|
+
$('.navbar').each(navbarEl => {
|
|
580
|
+
app.navbar.size(navbarEl);
|
|
581
|
+
});
|
|
582
|
+
},
|
|
583
|
+
pageBeforeRemove(page) {
|
|
584
|
+
if (page.$el[0].f7DetachNavbarScrollHandlers) {
|
|
585
|
+
page.$el[0].f7DetachNavbarScrollHandlers();
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
pageBeforeIn(page) {
|
|
589
|
+
const app = this;
|
|
590
|
+
if (app.theme !== 'ios') return;
|
|
591
|
+
let $navbarsEl;
|
|
592
|
+
const view = page.$el.parents('.view')[0].f7View;
|
|
593
|
+
const navbarEl = app.navbar.getElByPage(page);
|
|
594
|
+
if (!navbarEl) {
|
|
595
|
+
$navbarsEl = page.$el.parents('.view').children('.navbars');
|
|
596
|
+
} else {
|
|
597
|
+
$navbarsEl = $(navbarEl).parents('.navbars');
|
|
598
|
+
}
|
|
599
|
+
if (page.$el.hasClass('no-navbar') || view.router.dynamicNavbar && !navbarEl) {
|
|
600
|
+
const animate = !!(page.pageFrom && page.router.history.length > 0);
|
|
601
|
+
app.navbar.hide($navbarsEl, animate);
|
|
602
|
+
} else {
|
|
603
|
+
app.navbar.show($navbarsEl);
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
pageReinit(page) {
|
|
607
|
+
const app = this;
|
|
608
|
+
const $navbarEl = $(app.navbar.getElByPage(page));
|
|
609
|
+
if (!$navbarEl || $navbarEl.length === 0) return;
|
|
610
|
+
app.navbar.size($navbarEl);
|
|
611
|
+
},
|
|
612
|
+
pageInit(page) {
|
|
613
|
+
const app = this;
|
|
614
|
+
const $navbarEl = $(app.navbar.getElByPage(page));
|
|
615
|
+
if (!$navbarEl || $navbarEl.length === 0) return;
|
|
616
|
+
|
|
617
|
+
// Size
|
|
618
|
+
app.navbar.size($navbarEl);
|
|
619
|
+
|
|
620
|
+
// Need Collapse On Scroll
|
|
621
|
+
let needCollapseOnScrollHandler;
|
|
622
|
+
if ($navbarEl.find('.title-large').length > 0) {
|
|
623
|
+
$navbarEl.addClass('navbar-large');
|
|
624
|
+
}
|
|
625
|
+
if ($navbarEl.hasClass('navbar-large')) {
|
|
626
|
+
if (app.params.navbar.collapseLargeTitleOnScroll) needCollapseOnScrollHandler = true;
|
|
627
|
+
page.$el.addClass('page-with-navbar-large');
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// Need transparent on scroll
|
|
631
|
+
let needTransparentOnScroll;
|
|
632
|
+
if (!needCollapseOnScrollHandler && $navbarEl.hasClass('navbar-transparent')) {
|
|
633
|
+
needTransparentOnScroll = true;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// Need Hide On Scroll
|
|
637
|
+
let needHideOnScrollHandler;
|
|
638
|
+
if (app.params.navbar.hideOnPageScroll || page.$el.find('.hide-navbar-on-scroll').length || page.$el.hasClass('hide-navbar-on-scroll') || page.$el.find('.hide-bars-on-scroll').length || page.$el.hasClass('hide-bars-on-scroll')) {
|
|
639
|
+
if (page.$el.find('.keep-navbar-on-scroll').length || page.$el.hasClass('keep-navbar-on-scroll') || page.$el.find('.keep-bars-on-scroll').length || page.$el.hasClass('keep-bars-on-scroll')) {
|
|
640
|
+
needHideOnScrollHandler = false;
|
|
641
|
+
} else {
|
|
642
|
+
needHideOnScrollHandler = true;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
if (needCollapseOnScrollHandler || needHideOnScrollHandler || needTransparentOnScroll) {
|
|
646
|
+
app.navbar.initNavbarOnScroll(page.el, $navbarEl[0], needHideOnScrollHandler, needCollapseOnScrollHandler, needTransparentOnScroll);
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
'panelOpen panelSwipeOpen modalOpen': function onPanelModalOpen(instance) {
|
|
650
|
+
const app = this;
|
|
651
|
+
instance.$el.find('.navbar:not(.navbar-previous)').each(navbarEl => {
|
|
652
|
+
app.navbar.size(navbarEl);
|
|
653
|
+
});
|
|
654
|
+
},
|
|
655
|
+
tabShow(tabEl) {
|
|
656
|
+
const app = this;
|
|
657
|
+
$(tabEl).find('.navbar:not(.navbar-previous)').each(navbarEl => {
|
|
658
|
+
app.navbar.size(navbarEl);
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
clicks: {
|
|
663
|
+
'.navbar .title': function onTitleClick($clickedEl, clickedData, e) {
|
|
664
|
+
const app = this;
|
|
665
|
+
if (!app.params.navbar.scrollTopOnTitleClick) return;
|
|
666
|
+
if ($(e.target).closest('a, button').length > 0) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
let $pageContentEl;
|
|
670
|
+
|
|
671
|
+
// Find active page
|
|
672
|
+
const $navbarEl = $clickedEl.parents('.navbar');
|
|
673
|
+
const $navbarsEl = $navbarEl.parents('.navbars');
|
|
674
|
+
|
|
675
|
+
// Static Layout
|
|
676
|
+
$pageContentEl = $navbarEl.parents('.page-content');
|
|
677
|
+
if ($pageContentEl.length === 0) {
|
|
678
|
+
// Fixed Layout
|
|
679
|
+
if ($navbarEl.parents('.page').length > 0) {
|
|
680
|
+
$pageContentEl = $navbarEl.parents('.page').find('.page-content');
|
|
681
|
+
}
|
|
682
|
+
// Through Layout iOS
|
|
683
|
+
if ($pageContentEl.length === 0 && $navbarsEl.length) {
|
|
684
|
+
if ($navbarsEl.nextAll('.page-current').length > 0) {
|
|
685
|
+
$pageContentEl = $navbarsEl.nextAll('.page-current').find('.page-content');
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
// Through Layout
|
|
689
|
+
if ($pageContentEl.length === 0) {
|
|
690
|
+
if ($navbarEl.nextAll('.page-current').length > 0) {
|
|
691
|
+
$pageContentEl = $navbarEl.nextAll('.page-current').find('.page-content');
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
if ($pageContentEl && $pageContentEl.length > 0) {
|
|
696
|
+
// Check for tab
|
|
697
|
+
if ($pageContentEl.hasClass('tab')) {
|
|
698
|
+
$pageContentEl = $pageContentEl.parent('.tabs').children('.page-content.tab-active');
|
|
699
|
+
}
|
|
700
|
+
if ($pageContentEl.length > 0) $pageContentEl.scrollTop(0, 300);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
vnode: {
|
|
705
|
+
navbar: {
|
|
706
|
+
postpatch(vnode) {
|
|
707
|
+
const app = this;
|
|
708
|
+
app.navbar.size(vnode.elm);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
};
|