@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,734 @@
|
|
|
1
|
+
/* eslint indent: ["off"] */
|
|
2
|
+
import { getWindow } from 'ssr-window';
|
|
3
|
+
import $ from '../../shared/dom7.js';
|
|
4
|
+
import { extend, now, nextTick, deleteProps } from '../../shared/utils.js';
|
|
5
|
+
import Framework7Class from '../../shared/class.js';
|
|
6
|
+
/** @jsx $jsx */
|
|
7
|
+
import $jsx from '../../shared/$jsx.js';
|
|
8
|
+
class PhotoBrowser extends Framework7Class {
|
|
9
|
+
constructor(app, params) {
|
|
10
|
+
if (params === void 0) {
|
|
11
|
+
params = {};
|
|
12
|
+
}
|
|
13
|
+
super(params, [app]);
|
|
14
|
+
const pb = this;
|
|
15
|
+
pb.app = app;
|
|
16
|
+
const defaults = extend({
|
|
17
|
+
on: {}
|
|
18
|
+
}, app.params.photoBrowser);
|
|
19
|
+
|
|
20
|
+
// Extend defaults with modules params
|
|
21
|
+
pb.useModulesParams(defaults);
|
|
22
|
+
pb.params = extend(defaults, params);
|
|
23
|
+
extend(pb, {
|
|
24
|
+
exposed: false,
|
|
25
|
+
opened: false,
|
|
26
|
+
activeIndex: pb.params.swiper.initialSlide,
|
|
27
|
+
url: pb.params.url,
|
|
28
|
+
swipeToClose: {
|
|
29
|
+
allow: true,
|
|
30
|
+
isTouched: false,
|
|
31
|
+
diff: undefined,
|
|
32
|
+
start: undefined,
|
|
33
|
+
current: undefined,
|
|
34
|
+
started: false,
|
|
35
|
+
activeSlide: undefined,
|
|
36
|
+
timeStart: undefined
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Install Modules
|
|
41
|
+
pb.useModules();
|
|
42
|
+
|
|
43
|
+
// Init
|
|
44
|
+
pb.init();
|
|
45
|
+
}
|
|
46
|
+
get view() {
|
|
47
|
+
const {
|
|
48
|
+
params,
|
|
49
|
+
app
|
|
50
|
+
} = this;
|
|
51
|
+
return params.view || app.views.main;
|
|
52
|
+
}
|
|
53
|
+
onSlideChange(swiper) {
|
|
54
|
+
const pb = this;
|
|
55
|
+
pb.activeIndex = swiper.activeIndex;
|
|
56
|
+
let current = swiper.activeIndex + 1;
|
|
57
|
+
let total = pb.params.virtualSlides ? pb.params.photos.length : swiper.slides.length;
|
|
58
|
+
if (swiper.params.loop) {
|
|
59
|
+
total -= 2;
|
|
60
|
+
current -= swiper.loopedSlides;
|
|
61
|
+
if (current < 1) current = total + current;
|
|
62
|
+
if (current > total) current -= total;
|
|
63
|
+
}
|
|
64
|
+
const $activeSlideEl = pb.params.virtualSlides ? $(swiper.wrapperEl).find(`.swiper-slide[data-swiper-slide-index="${swiper.activeIndex}"]`) : $(swiper.slides).eq(swiper.activeIndex);
|
|
65
|
+
const $previousSlideEl = pb.params.virtualSlides ? $(swiper.wrapperEl).find(`.swiper-slide[data-swiper-slide-index="${swiper.previousIndex}"]`) : $(swiper.slides).eq(swiper.previousIndex);
|
|
66
|
+
let $currentEl = pb.$el.find('.photo-browser-current');
|
|
67
|
+
let $totalEl = pb.$el.find('.photo-browser-total');
|
|
68
|
+
let navbarEl;
|
|
69
|
+
if (pb.params.type === 'page' && pb.params.navbar && $currentEl.length === 0 && pb.app.theme === 'ios') {
|
|
70
|
+
navbarEl = pb.app.navbar.getElByPage(pb.$el);
|
|
71
|
+
if (navbarEl) {
|
|
72
|
+
$currentEl = $(navbarEl).find('.photo-browser-current');
|
|
73
|
+
$totalEl = $(navbarEl).find('.photo-browser-total');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if ($currentEl.length && $totalEl.length) {
|
|
77
|
+
$currentEl.text(current);
|
|
78
|
+
$totalEl.text(total);
|
|
79
|
+
if (!navbarEl) navbarEl = $currentEl.parents('.navbar')[0];
|
|
80
|
+
if (navbarEl) {
|
|
81
|
+
pb.app.navbar.size(navbarEl);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Update captions
|
|
86
|
+
if (pb.captions.length > 0) {
|
|
87
|
+
const captionIndex = swiper.params.loop ? $activeSlideEl.attr('data-swiper-slide-index') : pb.activeIndex;
|
|
88
|
+
pb.$captionsContainerEl.find('.photo-browser-caption-active').removeClass('photo-browser-caption-active');
|
|
89
|
+
pb.$captionsContainerEl.find(`[data-caption-index="${captionIndex}"]`).addClass('photo-browser-caption-active');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Stop Video
|
|
93
|
+
const previousSlideVideo = $previousSlideEl.find('video');
|
|
94
|
+
if (previousSlideVideo.length > 0) {
|
|
95
|
+
if ('pause' in previousSlideVideo[0]) previousSlideVideo[0].pause();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
onTouchStart() {
|
|
99
|
+
const pb = this;
|
|
100
|
+
const swipeToClose = pb.swipeToClose;
|
|
101
|
+
if (!swipeToClose.allow) return;
|
|
102
|
+
swipeToClose.isTouched = true;
|
|
103
|
+
}
|
|
104
|
+
onTouchMove(e) {
|
|
105
|
+
const pb = this;
|
|
106
|
+
const swipeToClose = pb.swipeToClose;
|
|
107
|
+
if (!swipeToClose.isTouched) return;
|
|
108
|
+
if (!swipeToClose.started) {
|
|
109
|
+
swipeToClose.started = true;
|
|
110
|
+
swipeToClose.start = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
|
111
|
+
if (pb.params.virtualSlides) {
|
|
112
|
+
swipeToClose.activeSlide = $(pb.swiper.wrapperEl).children('.swiper-slide-active');
|
|
113
|
+
} else {
|
|
114
|
+
swipeToClose.activeSlide = $(pb.swiper.slides).eq(pb.swiper.activeIndex);
|
|
115
|
+
}
|
|
116
|
+
swipeToClose.timeStart = now();
|
|
117
|
+
}
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
swipeToClose.current = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
|
120
|
+
swipeToClose.diff = swipeToClose.start - swipeToClose.current;
|
|
121
|
+
pb.$el.transition(0).transform(`translate3d(0,${-swipeToClose.diff}px,0)`);
|
|
122
|
+
}
|
|
123
|
+
onTouchEnd() {
|
|
124
|
+
const pb = this;
|
|
125
|
+
const swipeToClose = pb.swipeToClose;
|
|
126
|
+
swipeToClose.isTouched = false;
|
|
127
|
+
if (!swipeToClose.started) {
|
|
128
|
+
swipeToClose.started = false;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
swipeToClose.started = false;
|
|
132
|
+
swipeToClose.allow = false;
|
|
133
|
+
const diff = Math.abs(swipeToClose.diff);
|
|
134
|
+
const timeDiff = new Date().getTime() - swipeToClose.timeStart;
|
|
135
|
+
if (timeDiff < 300 && diff > 20 || timeDiff >= 300 && diff > 100) {
|
|
136
|
+
nextTick(() => {
|
|
137
|
+
if (pb.$el) {
|
|
138
|
+
if (swipeToClose.diff < 0) pb.$el.addClass('swipe-close-to-bottom');else pb.$el.addClass('swipe-close-to-top');
|
|
139
|
+
}
|
|
140
|
+
pb.emit('local::swipeToClose', pb);
|
|
141
|
+
pb.$el.transform('').transition('');
|
|
142
|
+
pb.close();
|
|
143
|
+
swipeToClose.allow = true;
|
|
144
|
+
});
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (diff !== 0) {
|
|
148
|
+
pb.$el.addClass('photo-browser-transitioning').transitionEnd(() => {
|
|
149
|
+
swipeToClose.allow = true;
|
|
150
|
+
pb.$el.removeClass('photo-browser-transitioning');
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
swipeToClose.allow = true;
|
|
154
|
+
}
|
|
155
|
+
nextTick(() => {
|
|
156
|
+
pb.$el.transform('').transition('');
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Render Functions
|
|
161
|
+
renderNavbar() {
|
|
162
|
+
const pb = this;
|
|
163
|
+
if (pb.params.renderNavbar) return pb.params.renderNavbar.call(pb);
|
|
164
|
+
const iconsColor = pb.params.iconsColor;
|
|
165
|
+
const pageBackLinkText = pb.app.theme === 'ios' && pb.params.pageBackLinkText ? pb.params.pageBackLinkText : '';
|
|
166
|
+
const renderNavbarCount = typeof pb.params.navbarShowCount === 'undefined' ? pb.params.photos.length > 1 : pb.params.navbarShowCount;
|
|
167
|
+
const isPopup = pb.params.type !== 'page';
|
|
168
|
+
return $jsx("div", {
|
|
169
|
+
class: `navbar navbar-photo-browser ${pb.params.theme === 'dark' ? 'navbar-photo-browser-dark' : ''}`
|
|
170
|
+
}, $jsx("div", {
|
|
171
|
+
class: "navbar-bg"
|
|
172
|
+
}), $jsx("div", {
|
|
173
|
+
class: "navbar-inner navbar-inner-centered-title sliding"
|
|
174
|
+
}, !isPopup && $jsx("div", {
|
|
175
|
+
class: "left"
|
|
176
|
+
}, $jsx("a", {
|
|
177
|
+
class: `link ${!pageBackLinkText ? 'icon-only' : ''} back`
|
|
178
|
+
}, $jsx("i", {
|
|
179
|
+
class: `icon icon-back ${iconsColor ? `color-${iconsColor}` : ''}`
|
|
180
|
+
}), pageBackLinkText && $jsx("span", null, pageBackLinkText))), renderNavbarCount && $jsx("div", {
|
|
181
|
+
class: "title"
|
|
182
|
+
}, $jsx("span", {
|
|
183
|
+
class: "photo-browser-current"
|
|
184
|
+
}), $jsx("span", {
|
|
185
|
+
class: "photo-browser-of"
|
|
186
|
+
}, pb.params.navbarOfText), $jsx("span", {
|
|
187
|
+
class: "photo-browser-total"
|
|
188
|
+
})), isPopup && (pb.params.popupCloseLinkText || pb.params.popupCloseLinkIcon) && $jsx("div", {
|
|
189
|
+
class: "right"
|
|
190
|
+
}, $jsx("a", {
|
|
191
|
+
class: "link popup-close",
|
|
192
|
+
"data-popup": ".photo-browser-popup"
|
|
193
|
+
}, pb.params.popupCloseLinkIcon && pb.app.theme === 'ios' && $jsx("i", null, $jsx("svg", {
|
|
194
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
195
|
+
width: "56",
|
|
196
|
+
height: "56",
|
|
197
|
+
viewBox: "0 0 56 56"
|
|
198
|
+
}, $jsx("path", {
|
|
199
|
+
fill: "currentColor",
|
|
200
|
+
d: "M 10.0234 43.0234 C 9.2266 43.8203 9.2031 45.1797 10.0234 45.9766 C 10.8438 46.7734 12.1797 46.7734 13.0000 45.9766 L 28.0000 30.9766 L 43.0000 45.9766 C 43.7969 46.7734 45.1563 46.7969 45.9766 45.9766 C 46.7734 45.1562 46.7734 43.8203 45.9766 43.0234 L 30.9531 28.0000 L 45.9766 13.0000 C 46.7734 12.2031 46.7969 10.8437 45.9766 10.0469 C 45.1328 9.2266 43.7969 9.2266 43.0000 10.0469 L 28.0000 25.0469 L 13.0000 10.0469 C 12.1797 9.2266 10.8203 9.2031 10.0234 10.0469 C 9.2266 10.8672 9.2266 12.2031 10.0234 13.0000 L 25.0234 28.0000 Z"
|
|
201
|
+
}))), pb.params.popupCloseLinkIcon && pb.app.theme === 'md' && $jsx("i", null, $jsx("svg", {
|
|
202
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
203
|
+
height: "24px",
|
|
204
|
+
viewBox: "0 0 24 24",
|
|
205
|
+
width: "24px",
|
|
206
|
+
fill: "currentColor"
|
|
207
|
+
}, $jsx("path", {
|
|
208
|
+
d: "M0 0h24v24H0V0z",
|
|
209
|
+
fill: "none"
|
|
210
|
+
}), $jsx("path", {
|
|
211
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
212
|
+
}))), pb.params.popupCloseLinkText && $jsx("span", null, pb.params.popupCloseLinkText)))));
|
|
213
|
+
}
|
|
214
|
+
renderToolbar() {
|
|
215
|
+
const pb = this;
|
|
216
|
+
if (pb.params.renderToolbar) return pb.params.renderToolbar.call(pb);
|
|
217
|
+
const iconsColor = pb.params.iconsColor;
|
|
218
|
+
return $jsx("div", {
|
|
219
|
+
class: "toolbar toolbar-bottom tabbar"
|
|
220
|
+
}, $jsx("div", {
|
|
221
|
+
class: "toolbar-inner"
|
|
222
|
+
}, $jsx("a", {
|
|
223
|
+
class: "link photo-browser-prev"
|
|
224
|
+
}, $jsx("i", {
|
|
225
|
+
class: `icon icon-back ${iconsColor ? `color-${iconsColor}` : ''}`
|
|
226
|
+
})), $jsx("a", {
|
|
227
|
+
class: "link photo-browser-next"
|
|
228
|
+
}, $jsx("i", {
|
|
229
|
+
class: `icon icon-forward ${iconsColor ? `color-${iconsColor}` : ''}`
|
|
230
|
+
}))));
|
|
231
|
+
}
|
|
232
|
+
renderThumbs() {
|
|
233
|
+
const pb = this;
|
|
234
|
+
return $jsx("div", {
|
|
235
|
+
class: "toolbar toolbar-bottom photo-browser-thumbs"
|
|
236
|
+
}, $jsx("div", {
|
|
237
|
+
class: "swiper"
|
|
238
|
+
}, $jsx("div", {
|
|
239
|
+
class: "swiper-wrapper"
|
|
240
|
+
}, pb.params.thumbs.map((thumb, index) => pb.renderThumb(thumb, index)))));
|
|
241
|
+
}
|
|
242
|
+
renderCaption(caption, index) {
|
|
243
|
+
const pb = this;
|
|
244
|
+
if (pb.params.renderCaption) return pb.params.renderCaption.call(pb, caption, index);
|
|
245
|
+
return $jsx("div", {
|
|
246
|
+
class: "photo-browser-caption",
|
|
247
|
+
"data-caption-index": index
|
|
248
|
+
}, caption);
|
|
249
|
+
}
|
|
250
|
+
renderObject(photo, index) {
|
|
251
|
+
const pb = this;
|
|
252
|
+
if (pb.params.renderObject) return pb.params.renderObject.call(pb, photo, index);
|
|
253
|
+
return $jsx("div", {
|
|
254
|
+
class: "photo-browser-slide photo-browser-object-slide swiper-slide",
|
|
255
|
+
"data-swiper-slide-index": index
|
|
256
|
+
}, photo.html ? photo.html : photo);
|
|
257
|
+
}
|
|
258
|
+
renderLazyPhoto(photo, index) {
|
|
259
|
+
const pb = this;
|
|
260
|
+
if (pb.params.renderLazyPhoto) return pb.params.renderLazyPhoto.call(pb, photo, index);
|
|
261
|
+
return $jsx("div", {
|
|
262
|
+
class: "photo-browser-slide photo-browser-slide-lazy swiper-slide",
|
|
263
|
+
"data-swiper-slide-index": index
|
|
264
|
+
}, $jsx("div", {
|
|
265
|
+
class: "swiper-lazy-preloader"
|
|
266
|
+
}), $jsx("span", {
|
|
267
|
+
class: "swiper-zoom-container"
|
|
268
|
+
}, $jsx("img", {
|
|
269
|
+
loading: "lazy",
|
|
270
|
+
src: photo.url ? photo.url : photo
|
|
271
|
+
})));
|
|
272
|
+
}
|
|
273
|
+
renderPhoto(photo, index) {
|
|
274
|
+
const pb = this;
|
|
275
|
+
if (pb.params.renderPhoto) return pb.params.renderPhoto.call(pb, photo, index);
|
|
276
|
+
return $jsx("div", {
|
|
277
|
+
class: "photo-browser-slide swiper-slide",
|
|
278
|
+
"data-swiper-slide-index": index
|
|
279
|
+
}, $jsx("span", {
|
|
280
|
+
class: "swiper-zoom-container"
|
|
281
|
+
}, $jsx("img", {
|
|
282
|
+
src: photo.url ? photo.url : photo
|
|
283
|
+
})));
|
|
284
|
+
}
|
|
285
|
+
renderThumb(thumb, index) {
|
|
286
|
+
const pb = this;
|
|
287
|
+
const url = typeof thumb === 'string' ? thumb : thumb.url;
|
|
288
|
+
if (pb.params.renderThumb) return pb.params.renderThumb.call(pb, thumb, index);
|
|
289
|
+
return $jsx("div", {
|
|
290
|
+
class: "photo-browser-thumbs-slide swiper-slide",
|
|
291
|
+
"data-swiper-slide-index": index
|
|
292
|
+
}, url && $jsx("img", {
|
|
293
|
+
src: url,
|
|
294
|
+
loading: "lazy"
|
|
295
|
+
}));
|
|
296
|
+
}
|
|
297
|
+
render() {
|
|
298
|
+
const pb = this;
|
|
299
|
+
if (pb.params.render) return pb.params.render.call(pb, pb.params);
|
|
300
|
+
return $jsx("div", {
|
|
301
|
+
class: `photo-browser photo-browser-${pb.params.theme}`
|
|
302
|
+
}, $jsx("div", {
|
|
303
|
+
class: "view"
|
|
304
|
+
}, $jsx("div", {
|
|
305
|
+
class: `page photo-browser-page photo-browser-page-${pb.params.theme} no-toolbar ${!pb.params.navbar ? 'no-navbar' : ''}`,
|
|
306
|
+
"data-name": "photo-browser-page"
|
|
307
|
+
}, pb.params.navbar && pb.renderNavbar(), pb.params.toolbar && pb.renderToolbar(), pb.params.thumbs && pb.params.thumbs.length && pb.renderThumbs(), $jsx("div", {
|
|
308
|
+
class: `photo-browser-captions photo-browser-captions-${pb.params.captionsTheme || pb.params.theme}`
|
|
309
|
+
}, pb.params.photos.map((photo, index) => {
|
|
310
|
+
if (photo.caption) return pb.renderCaption(photo.caption, index);
|
|
311
|
+
return '';
|
|
312
|
+
})), $jsx("div", {
|
|
313
|
+
class: "photo-browser-swiper-container swiper"
|
|
314
|
+
}, $jsx("div", {
|
|
315
|
+
class: "photo-browser-swiper-wrapper swiper-wrapper"
|
|
316
|
+
}, !pb.params.virtualSlides && pb.params.photos.map((photo, index) => {
|
|
317
|
+
if (photo.html || (typeof photo === 'string' || photo instanceof String) && photo.indexOf('<') >= 0 && photo.indexOf('>') >= 0) {
|
|
318
|
+
return pb.renderObject(photo, index);
|
|
319
|
+
}
|
|
320
|
+
if (pb.params.lazy === true) {
|
|
321
|
+
return pb.renderLazyPhoto(photo, index);
|
|
322
|
+
}
|
|
323
|
+
return pb.renderPhoto(photo, index);
|
|
324
|
+
}))))));
|
|
325
|
+
}
|
|
326
|
+
renderStandalone() {
|
|
327
|
+
const pb = this;
|
|
328
|
+
if (pb.params.renderStandalone) return pb.params.renderStandalone.call(pb);
|
|
329
|
+
const standaloneHtml = `<div class="popup photo-browser-popup photo-browser-standalone popup-tablet-fullscreen">${pb.render()}</div>`;
|
|
330
|
+
return standaloneHtml;
|
|
331
|
+
}
|
|
332
|
+
renderPage() {
|
|
333
|
+
const pb = this;
|
|
334
|
+
if (pb.params.renderPage) return pb.params.renderPage.call(pb);
|
|
335
|
+
const pageHtml = pb.render();
|
|
336
|
+
return pageHtml;
|
|
337
|
+
}
|
|
338
|
+
renderPopup() {
|
|
339
|
+
const pb = this;
|
|
340
|
+
if (pb.params.renderPopup) return pb.params.renderPopup.call(pb);
|
|
341
|
+
const popupHtml = `<div class="popup photo-browser-popup">${pb.render()}</div>`;
|
|
342
|
+
return popupHtml;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Callbacks
|
|
346
|
+
onOpen(type, el) {
|
|
347
|
+
const pb = this;
|
|
348
|
+
const app = pb.app;
|
|
349
|
+
const $el = $(el);
|
|
350
|
+
$el[0].f7PhotoBrowser = pb;
|
|
351
|
+
pb.$el = $el;
|
|
352
|
+
pb.el = $el[0];
|
|
353
|
+
pb.openedIn = type;
|
|
354
|
+
pb.opened = true;
|
|
355
|
+
pb.$swiperContainerEl = pb.$el.find('.photo-browser-swiper-container');
|
|
356
|
+
pb.$swiperWrapperEl = pb.$el.find('.photo-browser-swiper-wrapper');
|
|
357
|
+
pb.slides = pb.$el.find('.photo-browser-slide');
|
|
358
|
+
pb.$captionsContainerEl = pb.$el.find('.photo-browser-captions');
|
|
359
|
+
pb.captions = pb.$el.find('.photo-browser-caption');
|
|
360
|
+
const hasThumbs = pb.params.thumbs && pb.params.thumbs.length > 0;
|
|
361
|
+
|
|
362
|
+
// Init Swiper
|
|
363
|
+
let clickTimeout;
|
|
364
|
+
let preventThumbsSlide;
|
|
365
|
+
let preventMainSlide;
|
|
366
|
+
const initialSlide = pb.activeIndex;
|
|
367
|
+
const swiperParams = extend({}, pb.params.swiper, {
|
|
368
|
+
initialSlide,
|
|
369
|
+
// cssMode:
|
|
370
|
+
// typeof pb.params.swiper.cssMode === 'undefined' && (app.device.ios || app.device.android)
|
|
371
|
+
// ? true
|
|
372
|
+
// : pb.params.swiper.cssMode,
|
|
373
|
+
on: {
|
|
374
|
+
click(e) {
|
|
375
|
+
clearTimeout(clickTimeout);
|
|
376
|
+
if (pb.params.exposition) {
|
|
377
|
+
clickTimeout = setTimeout(() => {
|
|
378
|
+
pb.expositionToggle();
|
|
379
|
+
}, 350);
|
|
380
|
+
}
|
|
381
|
+
pb.emit('local::tap', e);
|
|
382
|
+
pb.emit('local::click', e);
|
|
383
|
+
},
|
|
384
|
+
doubleClick(e) {
|
|
385
|
+
clearTimeout(clickTimeout);
|
|
386
|
+
pb.emit('local::doubleTap', e);
|
|
387
|
+
pb.emit('local::doubleClick', e);
|
|
388
|
+
},
|
|
389
|
+
slideChange() {
|
|
390
|
+
const swiper = this;
|
|
391
|
+
if (hasThumbs && pb.thumbsSwiper && !preventMainSlide) {
|
|
392
|
+
preventThumbsSlide = true;
|
|
393
|
+
pb.thumbsSwiper.slideTo(pb.swiper.activeIndex);
|
|
394
|
+
setTimeout(() => {
|
|
395
|
+
preventThumbsSlide = false;
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
pb.onSlideChange(swiper);
|
|
399
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
400
|
+
args[_key] = arguments[_key];
|
|
401
|
+
}
|
|
402
|
+
pb.emit('local::slideChange', ...args);
|
|
403
|
+
},
|
|
404
|
+
transitionStart() {
|
|
405
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
406
|
+
args[_key2] = arguments[_key2];
|
|
407
|
+
}
|
|
408
|
+
pb.emit('local::transitionStart', ...args);
|
|
409
|
+
},
|
|
410
|
+
transitionEnd() {
|
|
411
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
412
|
+
args[_key3] = arguments[_key3];
|
|
413
|
+
}
|
|
414
|
+
pb.emit('local::transitionEnd', ...args);
|
|
415
|
+
},
|
|
416
|
+
slideChangeTransitionStart() {
|
|
417
|
+
const swiper = this;
|
|
418
|
+
pb.onSlideChange(swiper);
|
|
419
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
420
|
+
args[_key4] = arguments[_key4];
|
|
421
|
+
}
|
|
422
|
+
pb.emit('local::slideChangeTransitionStart', ...args);
|
|
423
|
+
},
|
|
424
|
+
slideChangeTransitionEnd() {
|
|
425
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
426
|
+
args[_key5] = arguments[_key5];
|
|
427
|
+
}
|
|
428
|
+
pb.emit('local::slideChangeTransitionEnd', ...args);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
if (pb.params.swipeToClose && pb.params.type !== 'page') {
|
|
433
|
+
extend(swiperParams.on, {
|
|
434
|
+
touchStart(swiper, e) {
|
|
435
|
+
pb.onTouchStart(e);
|
|
436
|
+
pb.emit('local::touchStart', e);
|
|
437
|
+
},
|
|
438
|
+
touchMoveOpposite(swiper, e) {
|
|
439
|
+
pb.onTouchMove(e);
|
|
440
|
+
pb.emit('local::touchMoveOpposite', e);
|
|
441
|
+
},
|
|
442
|
+
touchEnd(swiper, e) {
|
|
443
|
+
pb.onTouchEnd(e);
|
|
444
|
+
pb.emit('local::touchEnd', e);
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
if (pb.params.virtualSlides) {
|
|
449
|
+
extend(swiperParams, {
|
|
450
|
+
virtual: {
|
|
451
|
+
slides: pb.params.photos,
|
|
452
|
+
renderSlide(photo, index) {
|
|
453
|
+
if (photo.html || (typeof photo === 'string' || photo instanceof String) && photo.indexOf('<') >= 0 && photo.indexOf('>') >= 0) {
|
|
454
|
+
return pb.renderObject(photo, index);
|
|
455
|
+
}
|
|
456
|
+
if (pb.params.lazy === true) {
|
|
457
|
+
return pb.renderLazyPhoto(photo, index);
|
|
458
|
+
}
|
|
459
|
+
return pb.renderPhoto(photo, index);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
const window = getWindow();
|
|
465
|
+
pb.swiper = app.swiper ? app.swiper.create(pb.$swiperContainerEl[0], swiperParams) : new window.Swiper(pb.$swiperContainerEl[0], swiperParams);
|
|
466
|
+
if (pb.activeIndex === 0 || pb.params.virtualSlides) {
|
|
467
|
+
pb.onSlideChange(pb.swiper);
|
|
468
|
+
}
|
|
469
|
+
if (hasThumbs) {
|
|
470
|
+
const thumbsSwiperParams = {
|
|
471
|
+
el: pb.$el.find('.photo-browser-thumbs .swiper')[0],
|
|
472
|
+
slidesPerView: 'auto',
|
|
473
|
+
centeredSlides: true,
|
|
474
|
+
spaceBetween: 4,
|
|
475
|
+
watchSlidesProgress: true,
|
|
476
|
+
initialSlide,
|
|
477
|
+
on: {
|
|
478
|
+
touchMove() {
|
|
479
|
+
preventMainSlide = true;
|
|
480
|
+
},
|
|
481
|
+
touchEnd() {
|
|
482
|
+
preventMainSlide = false;
|
|
483
|
+
},
|
|
484
|
+
slideChange(s) {
|
|
485
|
+
if (preventThumbsSlide) return;
|
|
486
|
+
pb.swiper.slideTo(s.activeIndex, 0);
|
|
487
|
+
},
|
|
488
|
+
click(s) {
|
|
489
|
+
if (!s.clickedSlide) return;
|
|
490
|
+
const index = parseInt($(s.clickedSlide).attr('data-swiper-slide-index'), 10);
|
|
491
|
+
s.slideTo(index, 0);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
pb.thumbsSwiper = app.swiper ? app.swiper.create(thumbsSwiperParams) : new window.Swiper(thumbsSwiperParams);
|
|
496
|
+
}
|
|
497
|
+
if (pb.$el) {
|
|
498
|
+
pb.$el.trigger('photobrowser:open');
|
|
499
|
+
}
|
|
500
|
+
pb.emit('local::open photoBrowserOpen', pb);
|
|
501
|
+
}
|
|
502
|
+
onOpened() {
|
|
503
|
+
const pb = this;
|
|
504
|
+
if (pb.$el && pb.params.type === 'standalone') {
|
|
505
|
+
pb.$el.css('animation', 'none');
|
|
506
|
+
}
|
|
507
|
+
if (pb.$el) {
|
|
508
|
+
pb.$el.trigger('photobrowser:opened');
|
|
509
|
+
}
|
|
510
|
+
pb.emit('local::opened photoBrowserOpened', pb);
|
|
511
|
+
}
|
|
512
|
+
onClose() {
|
|
513
|
+
const pb = this;
|
|
514
|
+
if (pb.destroyed) return;
|
|
515
|
+
|
|
516
|
+
// Destroy Swiper
|
|
517
|
+
if (pb.swiper && pb.swiper.destroy) {
|
|
518
|
+
pb.swiper.destroy(true, false);
|
|
519
|
+
pb.swiper = null;
|
|
520
|
+
delete pb.swiper;
|
|
521
|
+
}
|
|
522
|
+
if (pb.thumbsSwiper && pb.thumbsSwiper.destroy) {
|
|
523
|
+
pb.thumbsSwiper.destroy(true, false);
|
|
524
|
+
pb.thumbsSwiper = null;
|
|
525
|
+
delete pb.thumbsSwiper;
|
|
526
|
+
}
|
|
527
|
+
if (pb.$el) {
|
|
528
|
+
pb.$el.trigger('photobrowser:close');
|
|
529
|
+
}
|
|
530
|
+
pb.emit('local::close photoBrowserClose', pb);
|
|
531
|
+
}
|
|
532
|
+
onClosed() {
|
|
533
|
+
const pb = this;
|
|
534
|
+
if (pb.destroyed) return;
|
|
535
|
+
pb.opened = false;
|
|
536
|
+
pb.$el = null;
|
|
537
|
+
pb.el = null;
|
|
538
|
+
delete pb.$el;
|
|
539
|
+
delete pb.el;
|
|
540
|
+
if (pb.$el) {
|
|
541
|
+
pb.$el.trigger('photobrowser:closed');
|
|
542
|
+
}
|
|
543
|
+
pb.emit('local::closed photoBrowserClosed', pb);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Open
|
|
547
|
+
openPage() {
|
|
548
|
+
const pb = this;
|
|
549
|
+
if (pb.opened) return pb;
|
|
550
|
+
const pageHtml = pb.renderPage();
|
|
551
|
+
pb.view.router.navigate({
|
|
552
|
+
url: pb.url,
|
|
553
|
+
route: {
|
|
554
|
+
content: pageHtml,
|
|
555
|
+
path: pb.url,
|
|
556
|
+
on: {
|
|
557
|
+
pageBeforeIn(e, page) {
|
|
558
|
+
pb.view.$el.addClass(`with-photo-browser-page with-photo-browser-page-${pb.params.theme}`);
|
|
559
|
+
pb.onOpen('page', page.el);
|
|
560
|
+
},
|
|
561
|
+
pageAfterIn(e, page) {
|
|
562
|
+
pb.onOpened('page', page.el);
|
|
563
|
+
},
|
|
564
|
+
pageBeforeOut(e, page) {
|
|
565
|
+
pb.view.$el.removeClass(`with-photo-browser-page with-photo-browser-page-exposed with-photo-browser-page-${pb.params.theme}`);
|
|
566
|
+
pb.onClose('page', page.el);
|
|
567
|
+
},
|
|
568
|
+
pageAfterOut(e, page) {
|
|
569
|
+
pb.onClosed('page', page.el);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
return pb;
|
|
575
|
+
}
|
|
576
|
+
openStandalone() {
|
|
577
|
+
const pb = this;
|
|
578
|
+
if (pb.opened) return pb;
|
|
579
|
+
const standaloneHtml = pb.renderStandalone();
|
|
580
|
+
const popupParams = {
|
|
581
|
+
backdrop: false,
|
|
582
|
+
content: standaloneHtml,
|
|
583
|
+
on: {
|
|
584
|
+
popupOpen(popup) {
|
|
585
|
+
pb.onOpen('popup', popup.el);
|
|
586
|
+
},
|
|
587
|
+
popupOpened(popup) {
|
|
588
|
+
pb.onOpened('popup', popup.el);
|
|
589
|
+
},
|
|
590
|
+
popupClose(popup) {
|
|
591
|
+
pb.onClose('popup', popup.el);
|
|
592
|
+
},
|
|
593
|
+
popupClosed(popup) {
|
|
594
|
+
pb.onClosed('popup', popup.el);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
if (pb.params.routableModals && pb.view) {
|
|
599
|
+
pb.view.router.navigate({
|
|
600
|
+
url: pb.url,
|
|
601
|
+
route: {
|
|
602
|
+
path: pb.url,
|
|
603
|
+
popup: popupParams
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
} else {
|
|
607
|
+
pb.modal = pb.app.popup.create(popupParams).open();
|
|
608
|
+
}
|
|
609
|
+
return pb;
|
|
610
|
+
}
|
|
611
|
+
openPopup() {
|
|
612
|
+
const pb = this;
|
|
613
|
+
if (pb.opened) return pb;
|
|
614
|
+
const popupHtml = pb.renderPopup();
|
|
615
|
+
const popupParams = {
|
|
616
|
+
content: popupHtml,
|
|
617
|
+
push: pb.params.popupPush,
|
|
618
|
+
closeByBackdropClick: pb.params.closeByBackdropClick,
|
|
619
|
+
on: {
|
|
620
|
+
popupOpen(popup) {
|
|
621
|
+
pb.onOpen('popup', popup.el);
|
|
622
|
+
},
|
|
623
|
+
popupOpened(popup) {
|
|
624
|
+
pb.onOpened('popup', popup.el);
|
|
625
|
+
},
|
|
626
|
+
popupClose(popup) {
|
|
627
|
+
pb.onClose('popup', popup.el);
|
|
628
|
+
},
|
|
629
|
+
popupClosed(popup) {
|
|
630
|
+
pb.onClosed('popup', popup.el);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
if (pb.params.routableModals && pb.view) {
|
|
635
|
+
pb.view.router.navigate({
|
|
636
|
+
url: pb.url,
|
|
637
|
+
route: {
|
|
638
|
+
path: pb.url,
|
|
639
|
+
popup: popupParams
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
} else {
|
|
643
|
+
pb.modal = pb.app.popup.create(popupParams).open();
|
|
644
|
+
}
|
|
645
|
+
return pb;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// Exposition
|
|
649
|
+
expositionEnable() {
|
|
650
|
+
const pb = this;
|
|
651
|
+
if (pb.params.type === 'page') {
|
|
652
|
+
pb.view.$el.addClass('with-photo-browser-page-exposed');
|
|
653
|
+
}
|
|
654
|
+
if (pb.$el) pb.$el.addClass('photo-browser-exposed');
|
|
655
|
+
if (pb.params.expositionHideCaptions) pb.$captionsContainerEl.addClass('photo-browser-captions-exposed');
|
|
656
|
+
pb.exposed = true;
|
|
657
|
+
return pb;
|
|
658
|
+
}
|
|
659
|
+
expositionDisable() {
|
|
660
|
+
const pb = this;
|
|
661
|
+
if (pb.params.type === 'page') {
|
|
662
|
+
pb.view.$el.removeClass('with-photo-browser-page-exposed');
|
|
663
|
+
}
|
|
664
|
+
if (pb.$el) pb.$el.removeClass('photo-browser-exposed');
|
|
665
|
+
if (pb.params.expositionHideCaptions) pb.$captionsContainerEl.removeClass('photo-browser-captions-exposed');
|
|
666
|
+
pb.exposed = false;
|
|
667
|
+
return pb;
|
|
668
|
+
}
|
|
669
|
+
expositionToggle() {
|
|
670
|
+
const pb = this;
|
|
671
|
+
if (pb.params.type === 'page') {
|
|
672
|
+
pb.view.$el.toggleClass('with-photo-browser-page-exposed');
|
|
673
|
+
}
|
|
674
|
+
if (pb.$el) pb.$el.toggleClass('photo-browser-exposed');
|
|
675
|
+
if (pb.params.expositionHideCaptions) pb.$captionsContainerEl.toggleClass('photo-browser-captions-exposed');
|
|
676
|
+
pb.exposed = !pb.exposed;
|
|
677
|
+
return pb;
|
|
678
|
+
}
|
|
679
|
+
open(index) {
|
|
680
|
+
const pb = this;
|
|
681
|
+
const type = pb.params.type;
|
|
682
|
+
if (pb.opened) {
|
|
683
|
+
if (pb.swiper && typeof index !== 'undefined') {
|
|
684
|
+
pb.swiper.slideTo(parseInt(index, 10));
|
|
685
|
+
}
|
|
686
|
+
return pb;
|
|
687
|
+
}
|
|
688
|
+
if (typeof index !== 'undefined') {
|
|
689
|
+
pb.activeIndex = index;
|
|
690
|
+
}
|
|
691
|
+
if (type === 'standalone') {
|
|
692
|
+
pb.openStandalone();
|
|
693
|
+
}
|
|
694
|
+
if (type === 'page') {
|
|
695
|
+
pb.openPage();
|
|
696
|
+
}
|
|
697
|
+
if (type === 'popup') {
|
|
698
|
+
pb.openPopup();
|
|
699
|
+
}
|
|
700
|
+
return pb;
|
|
701
|
+
}
|
|
702
|
+
close() {
|
|
703
|
+
const pb = this;
|
|
704
|
+
if (!pb.opened) return pb;
|
|
705
|
+
if (pb.params.routableModals && pb.view || pb.openedIn === 'page') {
|
|
706
|
+
pb.view.router.back();
|
|
707
|
+
} else {
|
|
708
|
+
pb.modal.once('modalClosed', () => {
|
|
709
|
+
nextTick(() => {
|
|
710
|
+
if (pb.destroyed) return;
|
|
711
|
+
pb.modal.destroy();
|
|
712
|
+
delete pb.modal;
|
|
713
|
+
});
|
|
714
|
+
});
|
|
715
|
+
pb.modal.close();
|
|
716
|
+
}
|
|
717
|
+
return pb;
|
|
718
|
+
}
|
|
719
|
+
// eslint-disable-next-line
|
|
720
|
+
init() {}
|
|
721
|
+
destroy() {
|
|
722
|
+
let pb = this;
|
|
723
|
+
pb.emit('local::beforeDestroy photoBrowserBeforeDestroy', pb);
|
|
724
|
+
if (pb.$el) {
|
|
725
|
+
pb.$el.trigger('photobrowser:beforedestroy');
|
|
726
|
+
pb.$el[0].f7PhotoBrowser = null;
|
|
727
|
+
delete pb.$el[0].f7PhotoBrowser;
|
|
728
|
+
}
|
|
729
|
+
deleteProps(pb);
|
|
730
|
+
pb.destroyed = true;
|
|
731
|
+
pb = null;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
export default PhotoBrowser;
|