@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,512 @@
|
|
|
1
|
+
import $ from '../../shared/dom7.js';
|
|
2
|
+
import { deleteProps } from '../../shared/utils.js';
|
|
3
|
+
import Framework7Class from '../../shared/class.js';
|
|
4
|
+
import { getSupport } from '../../shared/get-support.js';
|
|
5
|
+
import { getDevice } from '../../shared/get-device.js';
|
|
6
|
+
class PullToRefresh extends Framework7Class {
|
|
7
|
+
constructor(app, el) {
|
|
8
|
+
super({}, [app]);
|
|
9
|
+
const ptr = this;
|
|
10
|
+
const device = getDevice();
|
|
11
|
+
const support = getSupport();
|
|
12
|
+
const $el = $(el);
|
|
13
|
+
const $preloaderEl = $el.find('.ptr-preloader');
|
|
14
|
+
ptr.$el = $el;
|
|
15
|
+
ptr.el = $el[0];
|
|
16
|
+
ptr.app = app;
|
|
17
|
+
ptr.bottom = ptr.$el.hasClass('ptr-bottom');
|
|
18
|
+
|
|
19
|
+
// Extend defaults with modules params
|
|
20
|
+
ptr.useModulesParams({});
|
|
21
|
+
const isMaterial = app.theme === 'md';
|
|
22
|
+
const isIos = app.theme === 'ios';
|
|
23
|
+
|
|
24
|
+
// Done
|
|
25
|
+
ptr.done = function done() {
|
|
26
|
+
const $transitionTarget = isMaterial ? $preloaderEl : $el;
|
|
27
|
+
const onTranstionEnd = e => {
|
|
28
|
+
if ($(e.target).closest($preloaderEl).length) return;
|
|
29
|
+
$el.removeClass('ptr-transitioning ptr-pull-up ptr-pull-down ptr-closing');
|
|
30
|
+
$el.trigger('ptr:done');
|
|
31
|
+
ptr.emit('local::done ptrDone', $el[0]);
|
|
32
|
+
$transitionTarget.off('transitionend', onTranstionEnd);
|
|
33
|
+
};
|
|
34
|
+
$transitionTarget.on('transitionend', onTranstionEnd);
|
|
35
|
+
$el.removeClass('ptr-refreshing').addClass('ptr-transitioning ptr-closing');
|
|
36
|
+
return ptr;
|
|
37
|
+
};
|
|
38
|
+
ptr.refresh = function refresh() {
|
|
39
|
+
if ($el.hasClass('ptr-refreshing')) return ptr;
|
|
40
|
+
$el.addClass('ptr-transitioning ptr-refreshing');
|
|
41
|
+
$el.trigger('ptr:refresh', ptr.done);
|
|
42
|
+
ptr.emit('local::refresh ptrRefresh', $el[0], ptr.done);
|
|
43
|
+
return ptr;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Mousewheel
|
|
47
|
+
ptr.mousewheel = $el.attr('data-ptr-mousewheel') === 'true';
|
|
48
|
+
|
|
49
|
+
// Events handling
|
|
50
|
+
let touchId;
|
|
51
|
+
let isTouched;
|
|
52
|
+
let isMoved;
|
|
53
|
+
const touchesStart = {};
|
|
54
|
+
let isScrolling;
|
|
55
|
+
let touchesDiff;
|
|
56
|
+
let refresh = false;
|
|
57
|
+
let useTranslate = false;
|
|
58
|
+
let forceUseTranslate = false;
|
|
59
|
+
let startTranslate = 0;
|
|
60
|
+
let translate;
|
|
61
|
+
let scrollTop;
|
|
62
|
+
let wasScrolled;
|
|
63
|
+
let triggerDistance;
|
|
64
|
+
let dynamicTriggerDistance;
|
|
65
|
+
let pullStarted;
|
|
66
|
+
let hasNavbar = false;
|
|
67
|
+
let scrollHeight;
|
|
68
|
+
let offsetHeight;
|
|
69
|
+
let maxScrollTop;
|
|
70
|
+
const $pageEl = $el.parents('.page');
|
|
71
|
+
if ($pageEl.find('.navbar').length > 0 || $pageEl.parents('.view').children('.navbars').length > 0) hasNavbar = true;
|
|
72
|
+
if ($pageEl.hasClass('no-navbar')) hasNavbar = false;
|
|
73
|
+
if (!ptr.bottom) {
|
|
74
|
+
const pageNavbarEl = app.navbar.getElByPage($pageEl[0]);
|
|
75
|
+
if (pageNavbarEl) {
|
|
76
|
+
const $pageNavbarEl = $(pageNavbarEl);
|
|
77
|
+
const isLargeTransparent = $pageNavbarEl.hasClass('navbar-large-transparent') || $pageNavbarEl.hasClass('navbar-large') && $pageNavbarEl.hasClass('navbar-transparent');
|
|
78
|
+
const isTransparent = $pageNavbarEl.hasClass('navbar-transparent') && !$pageNavbarEl.hasClass('navbar-large');
|
|
79
|
+
if (isLargeTransparent) {
|
|
80
|
+
$el.addClass('ptr-with-navbar-large-transparent');
|
|
81
|
+
} else if (isTransparent) {
|
|
82
|
+
$el.addClass('ptr-with-navbar-transparent');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (!hasNavbar && !ptr.bottom) $el.addClass('ptr-no-navbar');
|
|
87
|
+
|
|
88
|
+
// Define trigger distance
|
|
89
|
+
if ($el.attr('data-ptr-distance')) {
|
|
90
|
+
dynamicTriggerDistance = true;
|
|
91
|
+
} else if (isMaterial) {
|
|
92
|
+
triggerDistance = 66;
|
|
93
|
+
} else if (isIos) {
|
|
94
|
+
triggerDistance = 44;
|
|
95
|
+
}
|
|
96
|
+
function setPreloaderProgress(progress) {
|
|
97
|
+
if (progress === void 0) {
|
|
98
|
+
progress = 0;
|
|
99
|
+
}
|
|
100
|
+
const $bars = $preloaderEl.find('.preloader-inner-line');
|
|
101
|
+
const perBarProgress = 1 / $bars.length;
|
|
102
|
+
$bars.forEach((barEl, barIndex) => {
|
|
103
|
+
const barProgress = (progress - barIndex * perBarProgress) / perBarProgress;
|
|
104
|
+
barEl.style.opacity = Math.max(Math.min(barProgress, 1), 0) * 0.27;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function unsetPreloaderProgress() {
|
|
108
|
+
$preloaderEl.find('.preloader-inner-line').css('opacity', '');
|
|
109
|
+
}
|
|
110
|
+
function handleTouchStart(e) {
|
|
111
|
+
if (!e.isTrusted) return;
|
|
112
|
+
if (isTouched) {
|
|
113
|
+
if (device.os === 'android') {
|
|
114
|
+
if ('targetTouches' in e && e.targetTouches.length > 1) return;
|
|
115
|
+
} else return;
|
|
116
|
+
}
|
|
117
|
+
if ($el.hasClass('ptr-refreshing')) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if ($(e.target).closest('.sortable-handler, .ptr-ignore, .card-expandable.card-opened').length) return;
|
|
121
|
+
isMoved = false;
|
|
122
|
+
pullStarted = false;
|
|
123
|
+
isTouched = true;
|
|
124
|
+
isScrolling = undefined;
|
|
125
|
+
wasScrolled = undefined;
|
|
126
|
+
if (e.type === 'touchstart') touchId = e.targetTouches[0].identifier;
|
|
127
|
+
touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
|
128
|
+
touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
|
129
|
+
}
|
|
130
|
+
function handleTouchMove(e) {
|
|
131
|
+
if (!isTouched || !e.isTrusted) return;
|
|
132
|
+
let pageX;
|
|
133
|
+
let pageY;
|
|
134
|
+
let touch;
|
|
135
|
+
if (e.type === 'touchmove') {
|
|
136
|
+
if (touchId && e.touches) {
|
|
137
|
+
for (let i = 0; i < e.touches.length; i += 1) {
|
|
138
|
+
if (e.touches[i].identifier === touchId) {
|
|
139
|
+
touch = e.touches[i];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (!touch) touch = e.targetTouches[0];
|
|
144
|
+
pageX = touch.pageX;
|
|
145
|
+
pageY = touch.pageY;
|
|
146
|
+
} else {
|
|
147
|
+
pageX = e.pageX;
|
|
148
|
+
pageY = e.pageY;
|
|
149
|
+
}
|
|
150
|
+
if (!pageX || !pageY) return;
|
|
151
|
+
if (typeof isScrolling === 'undefined') {
|
|
152
|
+
isScrolling = !!(isScrolling || Math.abs(pageY - touchesStart.y) > Math.abs(pageX - touchesStart.x));
|
|
153
|
+
}
|
|
154
|
+
if (!isScrolling) {
|
|
155
|
+
isTouched = false;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
scrollTop = $el[0].scrollTop;
|
|
159
|
+
if (!isMoved) {
|
|
160
|
+
$el.removeClass('ptr-transitioning');
|
|
161
|
+
if (isIos) {
|
|
162
|
+
setPreloaderProgress(0);
|
|
163
|
+
}
|
|
164
|
+
let targetIsScrollable;
|
|
165
|
+
scrollHeight = $el[0].scrollHeight;
|
|
166
|
+
offsetHeight = $el[0].offsetHeight;
|
|
167
|
+
if (ptr.bottom) {
|
|
168
|
+
maxScrollTop = scrollHeight - offsetHeight;
|
|
169
|
+
}
|
|
170
|
+
if (scrollTop > scrollHeight) {
|
|
171
|
+
isTouched = false;
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const $ptrWatchScrollable = $(e.target).closest('.ptr-watch-scroll');
|
|
175
|
+
if ($ptrWatchScrollable.length) {
|
|
176
|
+
$ptrWatchScrollable.each(ptrScrollableEl => {
|
|
177
|
+
if (ptrScrollableEl === el) return;
|
|
178
|
+
if (ptrScrollableEl.scrollHeight > ptrScrollableEl.offsetHeight && $(ptrScrollableEl).css('overflow') === 'auto' && (!ptr.bottom && ptrScrollableEl.scrollTop > 0 || ptr.bottom && ptrScrollableEl.scrollTop < ptrScrollableEl.scrollHeight - ptrScrollableEl.offsetHeight)) {
|
|
179
|
+
targetIsScrollable = true;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (targetIsScrollable) {
|
|
184
|
+
isTouched = false;
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (dynamicTriggerDistance) {
|
|
188
|
+
triggerDistance = $el.attr('data-ptr-distance');
|
|
189
|
+
if (triggerDistance.indexOf('%') >= 0) triggerDistance = scrollHeight * parseInt(triggerDistance, 10) / 100;
|
|
190
|
+
}
|
|
191
|
+
startTranslate = $el.hasClass('ptr-refreshing') ? triggerDistance : 0;
|
|
192
|
+
if (scrollHeight === offsetHeight || device.os !== 'ios' || isMaterial) {
|
|
193
|
+
useTranslate = true;
|
|
194
|
+
} else {
|
|
195
|
+
useTranslate = false;
|
|
196
|
+
}
|
|
197
|
+
forceUseTranslate = false;
|
|
198
|
+
}
|
|
199
|
+
isMoved = true;
|
|
200
|
+
touchesDiff = pageY - touchesStart.y;
|
|
201
|
+
if (typeof wasScrolled === 'undefined' && (ptr.bottom ? scrollTop !== maxScrollTop : scrollTop !== 0)) wasScrolled = true;
|
|
202
|
+
const ptrStarted = ptr.bottom ? touchesDiff < 0 && scrollTop >= maxScrollTop || scrollTop > maxScrollTop : touchesDiff > 0 && scrollTop <= 0 || scrollTop < 0;
|
|
203
|
+
if (ptrStarted) {
|
|
204
|
+
// iOS 8 fix
|
|
205
|
+
if (device.os === 'ios' && parseInt(device.osVersion.split('.')[0], 10) > 7) {
|
|
206
|
+
if (!ptr.bottom && scrollTop === 0 && !wasScrolled) useTranslate = true;
|
|
207
|
+
if (ptr.bottom && scrollTop === maxScrollTop && !wasScrolled) useTranslate = true;
|
|
208
|
+
}
|
|
209
|
+
if (!useTranslate && ptr.bottom && !isMaterial) {
|
|
210
|
+
$el.css('-webkit-overflow-scrolling', 'auto');
|
|
211
|
+
$el.scrollTop(maxScrollTop);
|
|
212
|
+
forceUseTranslate = true;
|
|
213
|
+
}
|
|
214
|
+
if (useTranslate || forceUseTranslate) {
|
|
215
|
+
if (e.cancelable) {
|
|
216
|
+
e.preventDefault();
|
|
217
|
+
}
|
|
218
|
+
translate = (ptr.bottom ? -1 * Math.abs(touchesDiff) ** 0.85 : touchesDiff ** 0.85) + startTranslate;
|
|
219
|
+
if (isMaterial) {
|
|
220
|
+
$preloaderEl.transform(`translate3d(0,${translate}px,0)`).find('.ptr-arrow').transform(`rotate(${180 * (Math.abs(touchesDiff) / 66) + 100}deg)`);
|
|
221
|
+
} else {
|
|
222
|
+
// eslint-disable-next-line
|
|
223
|
+
if (ptr.bottom || isIos) {
|
|
224
|
+
$el.children().transform(`translate3d(0,${translate}px,0)`);
|
|
225
|
+
} else {
|
|
226
|
+
// eslint-disable-next-line
|
|
227
|
+
$el.transform(`translate3d(0,${translate}px,0)`);
|
|
228
|
+
}
|
|
229
|
+
if (isIos) {
|
|
230
|
+
$preloaderEl.transform(`translate3d(0,0px,0)`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
} else if (isIos && !ptr.bottom) {
|
|
234
|
+
$preloaderEl.transform(`translate3d(0,${scrollTop}px,0)`);
|
|
235
|
+
}
|
|
236
|
+
let progress;
|
|
237
|
+
if (isIos && !refresh) {
|
|
238
|
+
progress = useTranslate || forceUseTranslate ? Math.abs(touchesDiff) ** 0.85 / triggerDistance : Math.abs(touchesDiff) / (triggerDistance * 2);
|
|
239
|
+
setPreloaderProgress(progress);
|
|
240
|
+
}
|
|
241
|
+
if ((useTranslate || forceUseTranslate) && Math.abs(touchesDiff) ** 0.85 > triggerDistance || !useTranslate && Math.abs(touchesDiff) >= triggerDistance * 2) {
|
|
242
|
+
refresh = true;
|
|
243
|
+
$el.addClass('ptr-pull-up').removeClass('ptr-pull-down');
|
|
244
|
+
unsetPreloaderProgress();
|
|
245
|
+
} else {
|
|
246
|
+
refresh = false;
|
|
247
|
+
$el.removeClass('ptr-pull-up').addClass('ptr-pull-down');
|
|
248
|
+
}
|
|
249
|
+
if (!pullStarted) {
|
|
250
|
+
$el.trigger('ptr:pullstart');
|
|
251
|
+
ptr.emit('local::pullStart ptrPullStart', $el[0]);
|
|
252
|
+
pullStarted = true;
|
|
253
|
+
}
|
|
254
|
+
$el.trigger('ptr:pullmove', {
|
|
255
|
+
event: e,
|
|
256
|
+
scrollTop,
|
|
257
|
+
translate,
|
|
258
|
+
touchesDiff
|
|
259
|
+
});
|
|
260
|
+
ptr.emit('local::pullMove ptrPullMove', $el[0], {
|
|
261
|
+
event: e,
|
|
262
|
+
scrollTop,
|
|
263
|
+
translate,
|
|
264
|
+
touchesDiff
|
|
265
|
+
});
|
|
266
|
+
} else {
|
|
267
|
+
pullStarted = false;
|
|
268
|
+
$el.removeClass('ptr-pull-up ptr-pull-down');
|
|
269
|
+
refresh = false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function handleTouchEnd(e) {
|
|
273
|
+
if (!e.isTrusted) return;
|
|
274
|
+
if (e.type === 'touchend' && e.changedTouches && e.changedTouches.length > 0 && touchId) {
|
|
275
|
+
if (e.changedTouches[0].identifier !== touchId) {
|
|
276
|
+
isTouched = false;
|
|
277
|
+
isScrolling = false;
|
|
278
|
+
isMoved = false;
|
|
279
|
+
touchId = null;
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (!isTouched || !isMoved) {
|
|
284
|
+
isTouched = false;
|
|
285
|
+
isMoved = false;
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
if (translate) {
|
|
289
|
+
$el.addClass('ptr-transitioning');
|
|
290
|
+
translate = 0;
|
|
291
|
+
}
|
|
292
|
+
if (isMaterial) {
|
|
293
|
+
$preloaderEl.transform('').find('.ptr-arrow').transform('');
|
|
294
|
+
} else {
|
|
295
|
+
$preloaderEl.transform('');
|
|
296
|
+
if (ptr.bottom || isIos) {
|
|
297
|
+
$el.children().transform('');
|
|
298
|
+
} else {
|
|
299
|
+
$el.transform('');
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (!useTranslate && ptr.bottom && !isMaterial) {
|
|
303
|
+
$el.css('-webkit-overflow-scrolling', '');
|
|
304
|
+
}
|
|
305
|
+
if (refresh) {
|
|
306
|
+
$el.addClass('ptr-refreshing');
|
|
307
|
+
$el.trigger('ptr:refresh', ptr.done);
|
|
308
|
+
ptr.emit('local::refresh ptrRefresh', $el[0], ptr.done);
|
|
309
|
+
} else {
|
|
310
|
+
$el.removeClass('ptr-pull-down');
|
|
311
|
+
}
|
|
312
|
+
isTouched = false;
|
|
313
|
+
isMoved = false;
|
|
314
|
+
if (pullStarted) {
|
|
315
|
+
$el.trigger('ptr:pullend');
|
|
316
|
+
ptr.emit('local::pullEnd ptrPullEnd', $el[0]);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
let mousewheelTimeout;
|
|
320
|
+
let mousewheelMoved;
|
|
321
|
+
let mousewheelAllow = true;
|
|
322
|
+
let mousewheelTranslate = 0;
|
|
323
|
+
function handleMouseWheelRelease() {
|
|
324
|
+
mousewheelAllow = true;
|
|
325
|
+
mousewheelMoved = false;
|
|
326
|
+
mousewheelTranslate = 0;
|
|
327
|
+
if (translate) {
|
|
328
|
+
$el.addClass('ptr-transitioning');
|
|
329
|
+
translate = 0;
|
|
330
|
+
}
|
|
331
|
+
if (isMaterial) {
|
|
332
|
+
$preloaderEl.transform('').find('.ptr-arrow').transform('');
|
|
333
|
+
} else {
|
|
334
|
+
$preloaderEl.transform('');
|
|
335
|
+
if (ptr.bottom) {
|
|
336
|
+
$el.children().transform('');
|
|
337
|
+
} else {
|
|
338
|
+
$el.transform('');
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (refresh) {
|
|
342
|
+
$el.addClass('ptr-refreshing');
|
|
343
|
+
$el.trigger('ptr:refresh', ptr.done);
|
|
344
|
+
ptr.emit('local::refresh ptrRefresh', $el[0], ptr.done);
|
|
345
|
+
} else {
|
|
346
|
+
$el.removeClass('ptr-pull-down');
|
|
347
|
+
}
|
|
348
|
+
if (pullStarted) {
|
|
349
|
+
$el.trigger('ptr:pullend');
|
|
350
|
+
ptr.emit('local::pullEnd ptrPullEnd', $el[0]);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function handleMouseWheel(e) {
|
|
354
|
+
if (!mousewheelAllow) return;
|
|
355
|
+
const {
|
|
356
|
+
deltaX,
|
|
357
|
+
deltaY
|
|
358
|
+
} = e;
|
|
359
|
+
if (Math.abs(deltaX) > Math.abs(deltaY)) return;
|
|
360
|
+
if ($el.hasClass('ptr-refreshing')) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
if ($(e.target).closest('.sortable-handler, .ptr-ignore, .card-expandable.card-opened').length) return;
|
|
364
|
+
clearTimeout(mousewheelTimeout);
|
|
365
|
+
scrollTop = $el[0].scrollTop;
|
|
366
|
+
if (!mousewheelMoved) {
|
|
367
|
+
$el.removeClass('ptr-transitioning');
|
|
368
|
+
if (isIos) {
|
|
369
|
+
setPreloaderProgress(0);
|
|
370
|
+
}
|
|
371
|
+
let targetIsScrollable;
|
|
372
|
+
scrollHeight = $el[0].scrollHeight;
|
|
373
|
+
offsetHeight = $el[0].offsetHeight;
|
|
374
|
+
if (ptr.bottom) {
|
|
375
|
+
maxScrollTop = scrollHeight - offsetHeight;
|
|
376
|
+
}
|
|
377
|
+
if (scrollTop > scrollHeight) {
|
|
378
|
+
mousewheelAllow = false;
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const $ptrWatchScrollable = $(e.target).closest('.ptr-watch-scroll');
|
|
382
|
+
if ($ptrWatchScrollable.length) {
|
|
383
|
+
$ptrWatchScrollable.each(ptrScrollableEl => {
|
|
384
|
+
if (ptrScrollableEl === el) return;
|
|
385
|
+
if (ptrScrollableEl.scrollHeight > ptrScrollableEl.offsetHeight && $(ptrScrollableEl).css('overflow') === 'auto' && (!ptr.bottom && ptrScrollableEl.scrollTop > 0 || ptr.bottom && ptrScrollableEl.scrollTop < ptrScrollableEl.scrollHeight - ptrScrollableEl.offsetHeight)) {
|
|
386
|
+
targetIsScrollable = true;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
if (targetIsScrollable) {
|
|
391
|
+
mousewheelAllow = false;
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
if (dynamicTriggerDistance) {
|
|
395
|
+
triggerDistance = $el.attr('data-ptr-distance');
|
|
396
|
+
if (triggerDistance.indexOf('%') >= 0) triggerDistance = scrollHeight * parseInt(triggerDistance, 10) / 100;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
isMoved = true;
|
|
400
|
+
mousewheelTranslate -= deltaY;
|
|
401
|
+
touchesDiff = mousewheelTranslate; // pageY - touchesStart.y;
|
|
402
|
+
|
|
403
|
+
if (typeof wasScrolled === 'undefined' && (ptr.bottom ? scrollTop !== maxScrollTop : scrollTop !== 0)) wasScrolled = true;
|
|
404
|
+
const ptrStarted = ptr.bottom ? touchesDiff < 0 && scrollTop >= maxScrollTop || scrollTop > maxScrollTop : touchesDiff > 0 && scrollTop <= 0 || scrollTop < 0;
|
|
405
|
+
if (ptrStarted) {
|
|
406
|
+
if (e.cancelable) {
|
|
407
|
+
e.preventDefault();
|
|
408
|
+
}
|
|
409
|
+
translate = touchesDiff;
|
|
410
|
+
if (Math.abs(translate) > triggerDistance) {
|
|
411
|
+
translate = triggerDistance + (Math.abs(translate) - triggerDistance) ** 0.7;
|
|
412
|
+
if (ptr.bottom) translate = -translate;
|
|
413
|
+
}
|
|
414
|
+
if (isMaterial) {
|
|
415
|
+
$preloaderEl.transform(`translate3d(0,${translate}px,0)`).find('.ptr-arrow').transform(`rotate(${180 * (Math.abs(touchesDiff) / 66) + 100}deg)`);
|
|
416
|
+
} else {
|
|
417
|
+
// eslint-disable-next-line
|
|
418
|
+
if (ptr.bottom) {
|
|
419
|
+
$el.children().transform(`translate3d(0,${translate}px,0)`);
|
|
420
|
+
} else {
|
|
421
|
+
$el.transform(`translate3d(0,${translate}px,0)`);
|
|
422
|
+
if (isIos) {
|
|
423
|
+
$preloaderEl.transform(`translate3d(0,${-translate}px,0)`);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
let progress;
|
|
428
|
+
if (isIos && !refresh) {
|
|
429
|
+
progress = Math.abs(translate) / triggerDistance;
|
|
430
|
+
setPreloaderProgress(progress);
|
|
431
|
+
}
|
|
432
|
+
if (Math.abs(translate) > triggerDistance) {
|
|
433
|
+
refresh = true;
|
|
434
|
+
$el.addClass('ptr-pull-up').removeClass('ptr-pull-down');
|
|
435
|
+
unsetPreloaderProgress();
|
|
436
|
+
} else {
|
|
437
|
+
refresh = false;
|
|
438
|
+
$el.removeClass('ptr-pull-up').addClass('ptr-pull-down');
|
|
439
|
+
}
|
|
440
|
+
if (!pullStarted) {
|
|
441
|
+
$el.trigger('ptr:pullstart');
|
|
442
|
+
ptr.emit('local::pullStart ptrPullStart', $el[0]);
|
|
443
|
+
pullStarted = true;
|
|
444
|
+
}
|
|
445
|
+
$el.trigger('ptr:pullmove', {
|
|
446
|
+
event: e,
|
|
447
|
+
scrollTop,
|
|
448
|
+
translate,
|
|
449
|
+
touchesDiff
|
|
450
|
+
});
|
|
451
|
+
ptr.emit('local::pullMove ptrPullMove', $el[0], {
|
|
452
|
+
event: e,
|
|
453
|
+
scrollTop,
|
|
454
|
+
translate,
|
|
455
|
+
touchesDiff
|
|
456
|
+
});
|
|
457
|
+
} else {
|
|
458
|
+
pullStarted = false;
|
|
459
|
+
$el.removeClass('ptr-pull-up ptr-pull-down');
|
|
460
|
+
refresh = false;
|
|
461
|
+
}
|
|
462
|
+
mousewheelTimeout = setTimeout(handleMouseWheelRelease, 300);
|
|
463
|
+
}
|
|
464
|
+
if (!$pageEl.length || !$el.length) return ptr;
|
|
465
|
+
$el[0].f7PullToRefresh = ptr;
|
|
466
|
+
|
|
467
|
+
// Events
|
|
468
|
+
ptr.attachEvents = function attachEvents() {
|
|
469
|
+
const passive = support.passiveListener ? {
|
|
470
|
+
passive: true
|
|
471
|
+
} : false;
|
|
472
|
+
$el.on(app.touchEvents.start, handleTouchStart, passive);
|
|
473
|
+
app.on('touchmove:active', handleTouchMove);
|
|
474
|
+
app.on('touchend:passive', handleTouchEnd);
|
|
475
|
+
if (ptr.mousewheel && !ptr.bottom) {
|
|
476
|
+
$el.on('wheel', handleMouseWheel);
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
ptr.detachEvents = function detachEvents() {
|
|
480
|
+
const passive = support.passiveListener ? {
|
|
481
|
+
passive: true
|
|
482
|
+
} : false;
|
|
483
|
+
$el.off(app.touchEvents.start, handleTouchStart, passive);
|
|
484
|
+
app.off('touchmove:active', handleTouchMove);
|
|
485
|
+
app.off('touchend:passive', handleTouchEnd);
|
|
486
|
+
if (ptr.mousewheel && !ptr.bottom) {
|
|
487
|
+
$el.off('wheel', handleMouseWheel);
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
// Install Modules
|
|
492
|
+
ptr.useModules();
|
|
493
|
+
|
|
494
|
+
// Init
|
|
495
|
+
ptr.init();
|
|
496
|
+
return ptr;
|
|
497
|
+
}
|
|
498
|
+
init() {
|
|
499
|
+
const ptr = this;
|
|
500
|
+
ptr.attachEvents();
|
|
501
|
+
}
|
|
502
|
+
destroy() {
|
|
503
|
+
let ptr = this;
|
|
504
|
+
ptr.emit('local::beforeDestroy ptrBeforeDestroy', ptr);
|
|
505
|
+
ptr.$el.trigger('ptr:beforedestroy');
|
|
506
|
+
delete ptr.el.f7PullToRefresh;
|
|
507
|
+
ptr.detachEvents();
|
|
508
|
+
deleteProps(ptr);
|
|
509
|
+
ptr = null;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
export default PullToRefresh;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.ios {
|
|
2
|
+
.ptr-preloader {
|
|
3
|
+
margin-bottom: calc(-1 * var(--f7-ptr-size));
|
|
4
|
+
width: 100%;
|
|
5
|
+
left: 0;
|
|
6
|
+
top: 0;
|
|
7
|
+
position: relative;
|
|
8
|
+
.preloader {
|
|
9
|
+
visibility: visible;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ptr-content:not(.ptr-refreshing):not(.ptr-pull-up) {
|
|
14
|
+
.ptr-preloader .preloader,
|
|
15
|
+
.ptr-preloader .preloader-inner {
|
|
16
|
+
animation: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.ptr-content:not(.ptr-refreshing):not(.ptr-pull-up):not(.ptr-pull-down),
|
|
20
|
+
.ptr-content.ptr-closing {
|
|
21
|
+
.ptr-preloader .preloader-inner-line {
|
|
22
|
+
opacity: 0 !important;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ptr-transitioning,
|
|
27
|
+
.ptr-refreshing {
|
|
28
|
+
> * {
|
|
29
|
+
transition-duration: 200ms;
|
|
30
|
+
transition-property: transform;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ptr-transitioning {
|
|
35
|
+
.ptr-preloader .preloader-inner-line {
|
|
36
|
+
transition-duration: 200ms;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ptr-pull-up {
|
|
41
|
+
.ptr-preloader .preloader {
|
|
42
|
+
animation: ios-ptr-preloader-spin 1s ease-out forwards;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ptr-refreshing:not(.ptr-bottom) {
|
|
47
|
+
transform: none;
|
|
48
|
+
> * {
|
|
49
|
+
transform: translate3d(0, var(--f7-ptr-size), 0);
|
|
50
|
+
}
|
|
51
|
+
> .ptr-preloader {
|
|
52
|
+
transform: translate3d(0, 0, 0);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ptr-bottom {
|
|
57
|
+
.ptr-preloader {
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
margin-top: calc(-1 * var(--f7-ptr-size));
|
|
60
|
+
position: relative;
|
|
61
|
+
}
|
|
62
|
+
&.ptr-transitioning,
|
|
63
|
+
&.ptr-refreshing {
|
|
64
|
+
> * {
|
|
65
|
+
transition-duration: 300ms;
|
|
66
|
+
transition-property: transform;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
&.ptr-refreshing {
|
|
70
|
+
transform: none;
|
|
71
|
+
> * {
|
|
72
|
+
transform: translate3d(0, calc(-1 * var(--f7-ptr-size)), 0);
|
|
73
|
+
}
|
|
74
|
+
> .ptr-preloader {
|
|
75
|
+
transform: translate3d(0, 0, 0);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@keyframes ios-ptr-preloader-spin {
|
|
82
|
+
from {
|
|
83
|
+
transform: rotate(0deg);
|
|
84
|
+
}
|
|
85
|
+
to {
|
|
86
|
+
transform: rotate(135deg);
|
|
87
|
+
}
|
|
88
|
+
}
|