framework7 7.0.8 → 8.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion.js +2 -16
- package/components/accordion/accordion.less +0 -3
- package/components/actions/actions-class.js +13 -58
- package/components/actions/actions-ios.less +42 -0
- package/components/actions/actions-md.less +12 -0
- package/components/actions/actions-rtl.css +1 -1
- package/components/actions/actions-vars.less +17 -42
- package/components/actions/actions.css +1 -1
- package/components/actions/actions.d.ts +2 -2
- package/components/actions/actions.js +0 -4
- package/components/actions/actions.lazy.js +1 -1
- package/components/actions/actions.less +5 -35
- package/components/app/app-class.d.ts +14 -12
- package/components/app/app-class.js +93 -75
- package/components/app/app-ios.less +0 -2
- package/components/app/app-md.less +0 -2
- package/components/app/app-vars.less +13 -96
- package/components/app/app.less +1 -4
- package/components/app/load-module.js +17 -36
- package/components/area-chart/area-chart-class.js +8 -64
- package/components/area-chart/area-chart.js +0 -3
- package/components/area-chart/area-chart.less +0 -3
- package/components/autocomplete/autocomplete-class.js +30 -175
- package/components/autocomplete/autocomplete-ios.less +0 -8
- package/components/autocomplete/autocomplete-rtl.css +1 -1
- package/components/autocomplete/autocomplete-vars.less +8 -22
- package/components/autocomplete/autocomplete.css +1 -1
- package/components/autocomplete/autocomplete.d.ts +1 -3
- package/components/autocomplete/autocomplete.js +1 -6
- package/components/autocomplete/autocomplete.lazy.js +1 -1
- package/components/autocomplete/autocomplete.less +6 -18
- package/components/badge/badge-vars.less +3 -6
- package/components/badge/badge.less +1 -3
- package/components/block/block-vars.less +25 -52
- package/components/block/block.less +37 -12
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -1
- package/components/breadcrumbs/breadcrumbs-vars.less +31 -15
- package/components/breadcrumbs/breadcrumbs.css +1 -1
- package/components/breadcrumbs/breadcrumbs.js +0 -2
- package/components/breadcrumbs/breadcrumbs.less +4 -10
- package/components/button/button-vars.less +42 -43
- package/components/button/button.less +24 -26
- package/components/calendar/calendar-class.js +81 -401
- package/components/calendar/calendar-rtl.css +1 -1
- package/components/calendar/calendar-vars.less +32 -46
- package/components/calendar/calendar.css +1 -1
- package/components/calendar/calendar.js +6 -4
- package/components/calendar/calendar.lazy.js +1 -1
- package/components/calendar/calendar.less +10 -21
- package/components/card/card-rtl.css +1 -1
- package/components/card/card-vars.less +41 -44
- package/components/card/card.css +1 -1
- package/components/card/card.js +0 -108
- package/components/card/card.less +18 -24
- package/components/checkbox/checkbox-rtl.css +1 -1
- package/components/checkbox/checkbox-vars.less +0 -8
- package/components/checkbox/checkbox.css +1 -1
- package/components/checkbox/checkbox.less +10 -3
- package/components/chip/chip-ios.less +3 -0
- package/components/chip/chip-md.less +4 -3
- package/components/chip/chip-rtl.css +1 -1
- package/components/chip/chip-vars.less +17 -20
- package/components/chip/chip.css +1 -1
- package/components/chip/chip.less +16 -21
- package/components/color-picker/color-picker-class.js +27 -158
- package/components/color-picker/color-picker-rtl.css +1 -1
- package/components/color-picker/color-picker.css +1 -1
- package/components/color-picker/color-picker.js +0 -4
- package/components/color-picker/color-picker.lazy.js +1 -1
- package/components/color-picker/color-picker.less +18 -8
- package/components/color-picker/modules/alpha-slider.js +0 -12
- package/components/color-picker/modules/brightness-slider.js +0 -8
- package/components/color-picker/modules/current-color.js +0 -2
- package/components/color-picker/modules/hex.js +0 -12
- package/components/color-picker/modules/hs-spectrum.js +0 -20
- package/components/color-picker/modules/hsb-sliders.js +0 -18
- package/components/color-picker/modules/hue-slider.js +0 -7
- package/components/color-picker/modules/initial-current-colors.js +0 -7
- package/components/color-picker/modules/palette.js +2 -10
- package/components/color-picker/modules/rgb-bars.js +0 -17
- package/components/color-picker/modules/rgb-sliders.js +0 -17
- package/components/color-picker/modules/sb-spectrum.js +0 -20
- package/components/color-picker/modules/wheel.js +0 -28
- package/components/contacts-list/contacts-list-md.less +4 -3
- package/components/contacts-list/contacts-list-rtl.css +1 -1
- package/components/contacts-list/contacts-list-vars.less +3 -15
- package/components/contacts-list/contacts-list.css +1 -1
- package/components/contacts-list/contacts-list.less +0 -3
- package/components/data-table/data-table-class.js +10 -32
- package/components/data-table/data-table-rtl.css +1 -1
- package/components/data-table/data-table-vars.less +6 -39
- package/components/data-table/data-table.css +1 -1
- package/components/data-table/data-table.js +0 -8
- package/components/data-table/data-table.less +0 -3
- package/components/dialog/dialog-class.js +7 -41
- package/components/dialog/dialog-ios.less +0 -3
- package/components/dialog/dialog-md.less +9 -9
- package/components/dialog/dialog-rtl.css +1 -1
- package/components/dialog/dialog-vars.less +25 -70
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +12 -48
- package/components/dialog/dialog.lazy.js +1 -1
- package/components/dialog/dialog.less +8 -4
- package/components/fab/fab-rtl.css +1 -1
- package/components/fab/fab-vars.less +20 -14
- package/components/fab/fab.css +1 -1
- package/components/fab/fab.js +0 -21
- package/components/fab/fab.less +50 -53
- package/components/form/form.d.ts +4 -4
- package/components/form/form.js +58 -94
- package/components/form/form.lazy.js +1 -1
- package/components/form/form.less +0 -3
- package/components/gauge/gauge-class.js +4 -20
- package/components/gauge/gauge.js +0 -9
- package/components/gauge/gauge.less +0 -3
- package/components/grid/grid-rtl.css +1 -1
- package/components/grid/grid-vars.less +0 -7
- package/components/grid/grid.css +1 -1
- package/components/grid/grid.d.ts +2 -8
- package/components/grid/grid.js +1 -225
- package/components/grid/grid.lazy.js +1 -1
- package/components/grid/grid.less +54 -184
- package/components/icon/icon.less +0 -3
- package/components/infinite-scroll/infinite-scroll-rtl.css +1 -1
- package/components/infinite-scroll/infinite-scroll.css +1 -1
- package/components/infinite-scroll/infinite-scroll.js +0 -16
- package/components/infinite-scroll/infinite-scroll.less +0 -3
- package/components/input/input-ios.less +49 -41
- package/components/input/input-md.less +87 -19
- package/components/input/input-rtl.css +1 -1
- package/components/input/input-vars.less +26 -60
- package/components/input/input.css +1 -1
- package/components/input/input.js +8 -67
- package/components/input/input.less +67 -153
- package/components/link/link-vars.less +0 -5
- package/components/link/link.less +3 -3
- package/components/list/list-md.less +0 -7
- package/components/list/list-vars.less +59 -108
- package/components/list/list.less +122 -90
- package/components/list-index/list-index-class.js +12 -69
- package/components/list-index/list-index-rtl.css +1 -1
- package/components/list-index/list-index-vars.less +0 -7
- package/components/list-index/list-index.css +1 -1
- package/components/list-index/list-index.d.ts +1 -3
- package/components/list-index/list-index.js +0 -8
- package/components/list-index/list-index.lazy.js +1 -1
- package/components/list-index/list-index.less +4 -7
- package/components/login-screen/login-screen-class.js +4 -9
- package/components/login-screen/login-screen-rtl.css +1 -1
- package/components/login-screen/login-screen-vars.less +13 -12
- package/components/login-screen/login-screen.css +1 -1
- package/components/login-screen/login-screen.js +0 -4
- package/components/login-screen/login-screen.less +2 -8
- package/components/messagebar/messagebar-class.js +18 -79
- package/components/messagebar/messagebar-ios.less +36 -0
- package/components/messagebar/messagebar-md.less +96 -16
- package/components/messagebar/messagebar-rtl.css +1 -1
- package/components/messagebar/messagebar-vars.less +27 -50
- package/components/messagebar/messagebar.css +1 -1
- package/components/messagebar/messagebar.js +0 -8
- package/components/messagebar/messagebar.less +11 -42
- package/components/messages/messages-class.js +17 -110
- package/components/messages/messages-ios.less +9 -0
- package/components/messages/messages-md.less +63 -28
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages-vars.less +43 -50
- package/components/messages/messages.css +1 -1
- package/components/messages/messages.js +0 -8
- package/components/messages/messages.lazy.js +1 -1
- package/components/messages/messages.less +0 -11
- package/components/modal/custom-modal-class.js +4 -14
- package/components/modal/modal-class.js +19 -55
- package/components/modal/modal.js +0 -3
- package/components/navbar/navbar-ios.less +3 -39
- package/components/navbar/navbar-md.less +12 -0
- package/components/navbar/navbar-vars.less +20 -49
- package/components/navbar/navbar.d.ts +0 -2
- package/components/navbar/navbar.js +37 -166
- package/components/navbar/navbar.less +4 -26
- package/components/notification/notification-class.js +4 -39
- package/components/notification/notification-md.less +18 -8
- package/components/notification/notification-rtl.css +1 -1
- package/components/notification/notification-vars.less +15 -54
- package/components/notification/notification.css +1 -1
- package/components/notification/notification.js +0 -2
- package/components/notification/notification.lazy.js +1 -1
- package/components/notification/notification.less +0 -3
- package/components/page/page-md.less +40 -10
- package/components/page/page-transitions/circle.less +15 -9
- package/components/page/page-transitions/fade.less +17 -11
- package/components/page/page-transitions/flip.less +9 -4
- package/components/page/page-vars.less +3 -19
- package/components/page/page.less +2 -10
- package/components/panel/panel-class.js +23 -127
- package/components/panel/panel-md.less +9 -0
- package/components/panel/panel-rtl.css +1 -1
- package/components/panel/panel-vars.less +7 -21
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +2 -2
- package/components/panel/panel.js +0 -34
- package/components/panel/panel.lazy.js +1 -1
- package/components/panel/panel.less +56 -48
- package/components/panel/resizable-panel.js +2 -32
- package/components/panel/swipe-panel.js +16 -71
- package/components/photo-browser/photo-browser-class.js +41 -171
- package/components/photo-browser/photo-browser-rtl.css +1 -1
- package/components/photo-browser/photo-browser-vars.less +0 -3
- package/components/photo-browser/photo-browser.css +1 -1
- package/components/photo-browser/photo-browser.d.ts +2 -4
- package/components/photo-browser/photo-browser.js +1 -6
- package/components/photo-browser/photo-browser.lazy.js +1 -1
- package/components/photo-browser/photo-browser.less +0 -4
- package/components/picker/picker-class.js +26 -133
- package/components/picker/picker-column.js +11 -31
- package/components/picker/picker-ios.less +10 -0
- package/components/picker/picker-md.less +6 -0
- package/components/picker/picker-rtl.css +1 -1
- package/components/picker/picker-vars.less +9 -25
- package/components/picker/picker.css +1 -1
- package/components/picker/picker.js +0 -4
- package/components/picker/picker.lazy.js +1 -1
- package/components/picker/picker.less +0 -11
- package/components/pie-chart/pie-chart-class.js +8 -31
- package/components/pie-chart/pie-chart.js +0 -3
- package/components/pie-chart/pie-chart.less +0 -3
- package/components/popover/popover-class.js +72 -126
- package/components/popover/popover-ios.less +0 -50
- package/components/popover/popover-rtl.css +1 -1
- package/components/popover/popover-vars.less +6 -23
- package/components/popover/popover.css +1 -1
- package/components/popover/popover.d.ts +2 -0
- package/components/popover/popover.js +1 -12
- package/components/popover/popover.lazy.js +1 -1
- package/components/popover/popover.less +62 -5
- package/components/popup/popup-class.js +12 -78
- package/components/popup/popup-rtl.css +1 -1
- package/components/popup/popup-vars.less +7 -9
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.js +0 -4
- package/components/popup/popup.lazy.js +1 -1
- package/components/popup/popup.less +4 -4
- package/components/preloader/preloader-ios.less +3 -1
- package/components/preloader/preloader-md.less +5 -1
- package/components/preloader/preloader-rtl.css +1 -1
- package/components/preloader/preloader-vars.less +0 -6
- package/components/preloader/preloader.css +1 -1
- package/components/preloader/preloader.js +8 -25
- package/components/preloader/preloader.lazy.js +1 -1
- package/components/preloader/preloader.less +6 -3
- package/components/progressbar/progressbar-rtl.css +1 -1
- package/components/progressbar/progressbar-vars.less +2 -12
- package/components/progressbar/progressbar.css +1 -1
- package/components/progressbar/progressbar.js +2 -31
- package/components/progressbar/progressbar.less +0 -3
- package/components/pull-to-refresh/pull-to-refresh-class.js +15 -107
- package/components/pull-to-refresh/pull-to-refresh-md.less +2 -1
- package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -1
- package/components/pull-to-refresh/pull-to-refresh-vars.less +0 -4
- package/components/pull-to-refresh/pull-to-refresh.css +1 -1
- package/components/pull-to-refresh/pull-to-refresh.js +0 -8
- package/components/pull-to-refresh/pull-to-refresh.lazy.js +1 -1
- package/components/pull-to-refresh/pull-to-refresh.less +0 -3
- package/components/radio/radio-rtl.css +1 -1
- package/components/radio/radio-vars.less +0 -7
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.less +12 -5
- package/components/range/range-class.js +27 -112
- package/components/range/range-rtl.css +1 -1
- package/components/range/range-vars.less +10 -32
- package/components/range/range.css +1 -1
- package/components/range/range.js +0 -12
- package/components/range/range.less +0 -3
- package/components/searchbar/remove-diacritics.js +0 -4
- package/components/searchbar/searchbar-class.js +17 -138
- package/components/searchbar/searchbar-md.less +41 -16
- package/components/searchbar/searchbar-rtl.css +1 -1
- package/components/searchbar/searchbar-vars.less +25 -76
- package/components/searchbar/searchbar.css +1 -1
- package/components/searchbar/searchbar.d.ts +2 -2
- package/components/searchbar/searchbar.js +0 -15
- package/components/searchbar/searchbar.lazy.js +1 -1
- package/components/searchbar/searchbar.less +14 -28
- package/components/sheet/sheet-class.js +15 -110
- package/components/sheet/sheet-rtl.css +1 -1
- package/components/sheet/sheet-vars.less +17 -6
- package/components/sheet/sheet.css +1 -1
- package/components/sheet/sheet.js +0 -9
- package/components/sheet/sheet.lazy.js +1 -1
- package/components/sheet/sheet.less +10 -3
- package/components/skeleton/skeleton.less +1 -4
- package/components/smart-select/smart-select-class.js +36 -173
- package/components/smart-select/smart-select.d.ts +1 -3
- package/components/smart-select/smart-select.js +1 -14
- package/components/smart-select/smart-select.lazy.js +1 -1
- package/components/smart-select/smart-select.less +0 -3
- package/components/sortable/sortable-rtl.css +1 -1
- package/components/sortable/sortable-vars.less +8 -8
- package/components/sortable/sortable.css +1 -1
- package/components/sortable/sortable.js +0 -44
- package/components/sortable/sortable.less +0 -3
- package/components/statusbar/statusbar.js +0 -36
- package/components/statusbar/statusbar.less +0 -3
- package/components/stepper/stepper-class.js +10 -83
- package/components/stepper/stepper-rtl.css +1 -1
- package/components/stepper/stepper-vars.less +12 -24
- package/components/stepper/stepper.css +1 -1
- package/components/stepper/stepper.js +0 -12
- package/components/stepper/stepper.less +12 -23
- package/components/subnavbar/subnavbar-vars.less +3 -18
- package/components/subnavbar/subnavbar.js +0 -3
- package/components/subnavbar/subnavbar.less +1 -11
- package/components/swipeout/swipeout-rtl.css +1 -1
- package/components/swipeout/swipeout-vars.less +7 -6
- package/components/swipeout/swipeout.css +1 -1
- package/components/swipeout/swipeout.js +2 -99
- package/components/swipeout/swipeout.less +2 -7
- package/components/swiper/swiper-rtl.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/swiper/swiper.js +9 -30
- package/components/swiper/swiper.lazy.js +1 -1
- package/components/swiper/swiper.less +1 -16
- package/components/tabs/tabs-rtl.css +1 -1
- package/components/tabs/tabs.css +1 -1
- package/components/tabs/tabs.js +23 -60
- package/components/tabs/tabs.lazy.js +1 -1
- package/components/tabs/tabs.less +1 -3
- package/components/text-editor/text-editor-class.js +16 -102
- package/components/text-editor/text-editor-rtl.css +1 -1
- package/components/text-editor/text-editor-vars.less +12 -16
- package/components/text-editor/text-editor.css +1 -1
- package/components/text-editor/text-editor.js +0 -8
- package/components/text-editor/text-editor.lazy.js +1 -1
- package/components/text-editor/text-editor.less +0 -6
- package/components/timeline/timeline-rtl.css +1 -1
- package/components/timeline/timeline-vars.less +13 -47
- package/components/timeline/timeline.css +1 -1
- package/components/timeline/timeline.less +2 -9
- package/components/toast/toast-class.js +2 -16
- package/components/toast/toast-rtl.css +1 -1
- package/components/toast/toast-vars.less +5 -9
- package/components/toast/toast.css +1 -1
- package/components/toast/toast.js +0 -3
- package/components/toast/toast.less +0 -3
- package/components/toggle/toggle-class.js +6 -30
- package/components/toggle/toggle-ios.less +5 -1
- package/components/toggle/toggle-md.less +27 -11
- package/components/toggle/toggle-rtl.css +1 -1
- package/components/toggle/toggle-vars.less +19 -21
- package/components/toggle/toggle.css +1 -1
- package/components/toggle/toggle.js +0 -8
- package/components/toggle/toggle.less +0 -4
- package/components/toolbar/toolbar-ios.less +2 -2
- package/components/toolbar/toolbar-md.less +28 -4
- package/components/toolbar/toolbar-vars.less +17 -52
- package/components/toolbar/toolbar.js +5 -43
- package/components/toolbar/toolbar.less +27 -45
- package/components/tooltip/tooltip-class.js +10 -64
- package/components/tooltip/tooltip-rtl.css +1 -1
- package/components/tooltip/tooltip-vars.less +12 -3
- package/components/tooltip/tooltip.css +1 -1
- package/components/tooltip/tooltip.js +0 -15
- package/components/tooltip/tooltip.less +0 -3
- package/components/touch-ripple/touch-ripple-class.js +0 -13
- package/components/touch-ripple/touch-ripple.js +0 -4
- package/components/touch-ripple/touch-ripple.less +1 -5
- package/components/treeview/treeview-rtl.css +1 -1
- package/components/treeview/treeview-vars.less +0 -3
- package/components/treeview/treeview.css +1 -1
- package/components/treeview/treeview.js +2 -11
- package/components/treeview/treeview.lazy.js +1 -1
- package/components/treeview/treeview.less +0 -3
- package/components/typography/typography-rtl.css +1 -1
- package/components/typography/typography.css +1 -1
- package/components/typography/typography.less +25 -3
- package/components/view/resizable-view.js +2 -24
- package/components/view/view-class.js +28 -53
- package/components/view/view.d.ts +0 -14
- package/components/view/view.js +8 -32
- package/components/view/view.less +1 -4
- package/components/virtual-list/virtual-list-class.js +58 -146
- package/components/virtual-list/virtual-list.d.ts +1 -1
- package/components/virtual-list/virtual-list.js +0 -2
- package/components/virtual-list/virtual-list.lazy.js +1 -1
- package/components/virtual-list/virtual-list.less +0 -3
- package/framework7-bundle-rtl.css +3593 -5977
- package/framework7-bundle-rtl.min.css +3 -3
- package/framework7-bundle.css +3591 -5978
- package/framework7-bundle.esm.js +4 -10
- package/framework7-bundle.js +6063 -12044
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +2 -27
- package/framework7-bundle.min.css +3 -3
- package/framework7-bundle.min.js +3 -3
- package/framework7-bundle.min.js.map +1 -1
- package/framework7-lite-bundle.esm.js +4 -10
- package/framework7-lite.esm.js +4 -6
- package/framework7-lite.js +31 -0
- package/framework7-rtl.css +803 -1591
- package/framework7-rtl.min.css +3 -3
- package/framework7-types.d.ts +1 -32
- package/framework7.css +803 -1594
- package/framework7.d.ts +1 -32
- package/framework7.esm.js +4 -6
- package/framework7.js +1770 -3407
- package/framework7.js.map +1 -1
- package/framework7.less +2 -23
- package/framework7.min.css +3 -3
- package/framework7.min.js +3 -3
- package/framework7.min.js.map +1 -1
- package/less/mixins.less +7 -88
- package/less/plugin.js +15 -0
- package/modules/clicks/clicks.js +10 -22
- package/modules/component/$h.js +0 -3
- package/modules/component/$jsx.js +0 -5
- package/modules/component/component-class.js +13 -66
- package/modules/component/component.d.ts +1 -2
- package/modules/component/component.js +0 -8
- package/modules/component/eventslisteners.js +12 -20
- package/modules/component/parse-component.js +18 -20
- package/modules/component/snabbdom/h.js +3 -12
- package/modules/component/snabbdom/helpers/attachto.js +9 -14
- package/modules/component/snabbdom/htmldomapi.js +0 -16
- package/modules/component/snabbdom/modules/attributes.js +7 -11
- package/modules/component/snabbdom/modules/class.js +4 -8
- package/modules/component/snabbdom/modules/dataset.js +3 -7
- package/modules/component/snabbdom/modules/eventlisteners.js +16 -22
- package/modules/component/snabbdom/modules/hero.js +4 -44
- package/modules/component/snabbdom/modules/props.js +5 -9
- package/modules/component/snabbdom/modules/style.js +13 -30
- package/modules/component/snabbdom/snabbdom.bundle.js +0 -6
- package/modules/component/snabbdom/snabbdom.js +13 -72
- package/modules/component/snabbdom/thunk.js +3 -11
- package/modules/component/snabbdom/tovnode.js +1 -6
- package/modules/component/vdom.js +4 -62
- package/modules/demo-module.js +0 -8
- package/modules/device/device.js +6 -11
- package/modules/history/history.js +0 -1
- package/modules/resize/resize.js +8 -11
- package/modules/router/async-component.js +0 -3
- package/modules/router/back.js +86 -275
- package/modules/router/clear-previous-history.js +5 -18
- package/modules/router/component-loader.js +4 -25
- package/modules/router/modal.js +16 -43
- package/modules/router/navigate.js +80 -249
- package/modules/router/process-route-queue.js +0 -12
- package/modules/router/redirect.js +0 -8
- package/modules/router/router-class.js +92 -315
- package/modules/router/router.d.ts +3 -5
- package/modules/router/router.js +0 -3
- package/modules/router/swipe-back.js +35 -139
- package/modules/router/tab.js +14 -43
- package/modules/service-worker/service-worker.js +0 -11
- package/modules/store/create-store.js +10 -29
- package/modules/touch/touch.d.ts +2 -4
- package/modules/touch/touch.js +13 -108
- package/package.json +4 -18
- package/shared/$jsx.js +0 -6
- package/shared/class.js +18 -43
- package/shared/constructor-methods.js +0 -11
- package/shared/events-class.js +0 -17
- package/shared/get-device.js +18 -34
- package/shared/get-support.js +2 -8
- package/shared/history.js +2 -30
- package/shared/material-color-utils.js +728 -0
- package/shared/material-colors.js +75 -0
- package/shared/modal-methods.js +0 -18
- package/shared/utils.d.ts +0 -4
- package/shared/utils.js +191 -71
- package/components/accordion/accordion-aurora.less +0 -2
- package/components/actions/actions-aurora.less +0 -9
- package/components/app/app-aurora.less +0 -10
- package/components/appbar/appbar-aurora.less +0 -2
- package/components/appbar/appbar-ios.less +0 -2
- package/components/appbar/appbar-md.less +0 -2
- package/components/appbar/appbar-rtl.css +0 -1
- package/components/appbar/appbar-vars.less +0 -28
- package/components/appbar/appbar.css +0 -1
- package/components/appbar/appbar.d.ts +0 -14
- package/components/appbar/appbar.js +0 -3
- package/components/appbar/appbar.lazy.js +0 -1
- package/components/appbar/appbar.less +0 -106
- package/components/area-chart/area-chart-aurora.less +0 -2
- package/components/autocomplete/autocomplete-aurora.less +0 -17
- package/components/badge/badge-aurora.less +0 -2
- package/components/block/block-aurora.less +0 -2
- package/components/breadcrumbs/breadcrumbs-aurora.less +0 -2
- package/components/button/button-aurora.less +0 -25
- package/components/calendar/calendar-aurora.less +0 -2
- package/components/card/card-aurora.less +0 -2
- package/components/checkbox/checkbox-aurora.less +0 -39
- package/components/chip/chip-aurora.less +0 -14
- package/components/color-picker/color-picker-aurora.less +0 -2
- package/components/contacts-list/contacts-list-aurora.less +0 -2
- package/components/data-table/data-table-aurora.less +0 -64
- package/components/dialog/dialog-aurora.less +0 -112
- package/components/elevation/elevation-aurora.less +0 -2
- package/components/elevation/elevation-ios.less +0 -2
- package/components/elevation/elevation-md.less +0 -2
- package/components/elevation/elevation-rtl.css +0 -1
- package/components/elevation/elevation-vars.less +0 -51
- package/components/elevation/elevation.css +0 -1
- package/components/elevation/elevation.d.ts +0 -14
- package/components/elevation/elevation.js +0 -3
- package/components/elevation/elevation.lazy.js +0 -1
- package/components/elevation/elevation.less +0 -54
- package/components/fab/fab-aurora.less +0 -2
- package/components/form/form-aurora.less +0 -0
- package/components/gauge/gauge-aurora.less +0 -2
- package/components/grid/grid-aurora.less +0 -2
- package/components/icon/icon-aurora.less +0 -49
- package/components/infinite-scroll/infinite-scroll-aurora.less +0 -6
- package/components/input/input-aurora.less +0 -120
- package/components/lazy/lazy-aurora.less +0 -2
- package/components/lazy/lazy-ios.less +0 -2
- package/components/lazy/lazy-md.less +0 -2
- package/components/lazy/lazy-rtl.css +0 -1
- package/components/lazy/lazy.css +0 -1
- package/components/lazy/lazy.d.ts +0 -57
- package/components/lazy/lazy.js +0 -283
- package/components/lazy/lazy.lazy.js +0 -1
- package/components/lazy/lazy.less +0 -23
- package/components/link/link-aurora.less +0 -15
- package/components/list/list-aurora.less +0 -25
- package/components/list-index/list-index-aurora.less +0 -21
- package/components/login-screen/login-screen-aurora.less +0 -2
- package/components/menu/menu-aurora.less +0 -8
- package/components/menu/menu-ios.less +0 -2
- package/components/menu/menu-md.less +0 -2
- package/components/menu/menu-rtl.css +0 -1
- package/components/menu/menu-vars.less +0 -27
- package/components/menu/menu.css +0 -1
- package/components/menu/menu.d.ts +0 -32
- package/components/menu/menu.js +0 -87
- package/components/menu/menu.lazy.js +0 -1
- package/components/menu/menu.less +0 -232
- package/components/messagebar/messagebar-aurora.less +0 -53
- package/components/messages/messages-aurora.less +0 -137
- package/components/navbar/navbar-aurora.less +0 -70
- package/components/notification/notification-aurora.less +0 -59
- package/components/page/page-aurora.less +0 -49
- package/components/panel/panel-aurora.less +0 -2
- package/components/photo-browser/photo-browser-aurora.less +0 -2
- package/components/picker/picker-aurora.less +0 -2
- package/components/pie-chart/pie-chart-aurora.less +0 -2
- package/components/popover/popover-aurora.less +0 -56
- package/components/popup/popup-aurora.less +0 -2
- package/components/preloader/preloader-aurora.less +0 -53
- package/components/progressbar/progressbar-aurora.less +0 -72
- package/components/pull-to-refresh/pull-to-refresh-aurora.less +0 -122
- package/components/radio/radio-aurora.less +0 -86
- package/components/range/range-aurora.less +0 -9
- package/components/searchbar/searchbar-aurora.less +0 -86
- package/components/sheet/sheet-aurora.less +0 -2
- package/components/skeleton/skeleton-aurora.less +0 -2
- package/components/smart-select/smart-select-aurora.less +0 -2
- package/components/sortable/sortable-aurora.less +0 -7
- package/components/statusbar/statusbar-aurora.less +0 -2
- package/components/stepper/stepper-aurora.less +0 -32
- package/components/subnavbar/subnavbar-aurora.less +0 -51
- package/components/swipeout/swipeout-aurora.less +0 -2
- package/components/swiper/swiper-aurora.less +0 -2
- package/components/tabs/tabs-aurora.less +0 -2
- package/components/text-editor/text-editor-aurora.less +0 -9
- package/components/timeline/timeline-aurora.less +0 -7
- package/components/toast/toast-aurora.less +0 -64
- package/components/toggle/toggle-aurora.less +0 -26
- package/components/toolbar/toolbar-aurora.less +0 -43
- package/components/tooltip/tooltip-aurora.less +0 -2
- package/components/touch-ripple/touch-ripple-aurora.less +0 -2
- package/components/treeview/treeview-aurora.less +0 -31
- package/components/typography/typography-aurora.less +0 -2
- package/components/view/view-aurora.less +0 -2
- package/components/virtual-list/virtual-list-aurora.less +0 -2
- package/modules/request/request.d.ts +0 -15
- package/modules/request/request.js +0 -11
- package/postinstall.js +0 -3
- package/shared/request.d.ts +0 -115
- package/shared/request.js +0 -512
package/less/mixins.less
CHANGED
|
@@ -20,11 +20,6 @@
|
|
|
20
20
|
@ruleset();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
.if-aurora-theme(@ruleset) {
|
|
24
|
-
& when (@includeAuroraTheme) {
|
|
25
|
-
@ruleset();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
23
|
.if-dark-theme(@ruleset) {
|
|
29
24
|
& when(@includeDarkTheme) {
|
|
30
25
|
@ruleset();
|
|
@@ -44,9 +39,11 @@
|
|
|
44
39
|
}
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
|
-
.
|
|
48
|
-
& when (@
|
|
49
|
-
.
|
|
42
|
+
.md-color-vars(@ruleset) {
|
|
43
|
+
& when (@includeMdTheme) {
|
|
44
|
+
.md,
|
|
45
|
+
.md .dark,
|
|
46
|
+
.md [class*='color-'] {
|
|
50
47
|
@ruleset();
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -100,59 +97,7 @@
|
|
|
100
97
|
opacity: 1;
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
|
-
|
|
104
|
-
.no-hairlines() {
|
|
105
|
-
&.no-hairlines,
|
|
106
|
-
&.no-hairlines ul,
|
|
107
|
-
.md &.no-hairlines-md,
|
|
108
|
-
.md &.no-hairlines-md ul,
|
|
109
|
-
.ios &.no-hairlines-ios,
|
|
110
|
-
.ios &.no-hairlines-ios ul,
|
|
111
|
-
.aurora &.no-hairlines-aurora,
|
|
112
|
-
.aurora &.no-hairlines-aurora ul {
|
|
113
|
-
.hairline-remove-top-bottom();
|
|
114
|
-
}
|
|
115
|
-
&.no-hairline-top,
|
|
116
|
-
&.no-hairline-top ul,
|
|
117
|
-
.md &.no-hairline-top-md,
|
|
118
|
-
.md &.no-hairline-top-md ul,
|
|
119
|
-
.ios &.no-hairline-top-ios,
|
|
120
|
-
.ios &.no-hairline-top-ios ul,
|
|
121
|
-
.aurora &.no-hairline-top-aurora,
|
|
122
|
-
.aurora &.no-hairline-top-aurora ul {
|
|
123
|
-
.hairline-remove(top);
|
|
124
|
-
}
|
|
125
|
-
&.no-hairline-bottom,
|
|
126
|
-
&.no-hairline-bottom ul,
|
|
127
|
-
.md &.no-hairline-bottom-md,
|
|
128
|
-
.md &.no-hairline-bottom-md ul,
|
|
129
|
-
.ios &.no-hairline-bottom-ios,
|
|
130
|
-
.ios &.no-hairline-bottom-ios ul,
|
|
131
|
-
.aurora &.no-hairline-bottom-aurora,
|
|
132
|
-
.aurora &.no-hairline-bottom-aurora ul {
|
|
133
|
-
.hairline-remove(bottom);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
.no-hairlines-between() {
|
|
137
|
-
&.no-hairlines-between,
|
|
138
|
-
.md &.no-hairlines-between-md,
|
|
139
|
-
.ios &.no-hairlines-between-ios,
|
|
140
|
-
.aurora &.no-hairlines-between-aurora {
|
|
141
|
-
.item-inner,
|
|
142
|
-
.list-button,
|
|
143
|
-
.item-divider,
|
|
144
|
-
.list-group-title,
|
|
145
|
-
.list-group-title {
|
|
146
|
-
.hairline-remove(bottom);
|
|
147
|
-
}
|
|
148
|
-
&.simple-list li {
|
|
149
|
-
.hairline-remove(bottom);
|
|
150
|
-
}
|
|
151
|
-
&.links-list a {
|
|
152
|
-
.hairline-remove(bottom);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
100
|
+
|
|
156
101
|
// Hairlines
|
|
157
102
|
.hairline-pseudo(@color, @top, @right, @bottom, @left) {
|
|
158
103
|
content: '';
|
|
@@ -274,33 +219,7 @@
|
|
|
274
219
|
}
|
|
275
220
|
}
|
|
276
221
|
// MD Bars Shadow
|
|
277
|
-
|
|
278
|
-
&:before {
|
|
279
|
-
content: '';
|
|
280
|
-
position: absolute;
|
|
281
|
-
right: 0;
|
|
282
|
-
width: 100%;
|
|
283
|
-
top: 100%;
|
|
284
|
-
bottom: auto;
|
|
285
|
-
height: 8px;
|
|
286
|
-
pointer-events: none;
|
|
287
|
-
background: @image;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
.bar-shadow-top(@image) {
|
|
291
|
-
&:after {
|
|
292
|
-
content: '';
|
|
293
|
-
position: absolute;
|
|
294
|
-
right: 0;
|
|
295
|
-
width: 100%;
|
|
296
|
-
bottom: 100%;
|
|
297
|
-
height: 8px;
|
|
298
|
-
top: auto;
|
|
299
|
-
pointer-events: none;
|
|
300
|
-
background: @image;
|
|
301
|
-
transform: translate3d(0, 0, 0);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
222
|
+
|
|
304
223
|
.core-icons-font() {
|
|
305
224
|
font-family: 'framework7-core-icons';
|
|
306
225
|
font-weight: normal;
|
package/less/plugin.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
function base64Encode(file) {
|
|
3
|
+
// read binary data
|
|
4
|
+
const bitmap = fs.readFileSync(file);
|
|
5
|
+
// convert binary data to base64 encoded string
|
|
6
|
+
return Buffer.from(bitmap).toString('base64');
|
|
7
|
+
}
|
|
8
|
+
module.exports = {
|
|
9
|
+
install(less, pluginManager, functions) {
|
|
10
|
+
functions.add('framework7_coreIconsFont', () => {
|
|
11
|
+
const iconsFontBase64 = base64Encode('./src/core/icons/font/framework7-core-icons.woff');
|
|
12
|
+
return iconsFontBase64;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
package/modules/clicks/clicks.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { getWindow } from 'ssr-window';
|
|
2
2
|
import $ from '../../shared/dom7.js';
|
|
3
3
|
import ViewClass from '../../components/view/view-class.js';
|
|
4
|
-
|
|
5
4
|
function initClicks(app) {
|
|
6
5
|
function handleClicks(e) {
|
|
7
6
|
const window = getWindow();
|
|
8
7
|
const $clickedEl = $(e.target);
|
|
9
8
|
const $clickedLinkEl = $clickedEl.closest('a');
|
|
10
9
|
const isLink = $clickedLinkEl.length > 0;
|
|
11
|
-
const url = isLink && $clickedLinkEl.attr('href');
|
|
10
|
+
const url = isLink && $clickedLinkEl.attr('href');
|
|
12
11
|
|
|
12
|
+
// Check if link is external
|
|
13
13
|
if (isLink) {
|
|
14
|
-
if ($clickedLinkEl.is(app.params.clicks.externalLinks) ||
|
|
14
|
+
if ($clickedLinkEl.is(app.params.clicks.externalLinks) ||
|
|
15
|
+
// eslint-disable-next-line
|
|
15
16
|
url && url.indexOf('javascript:') >= 0) {
|
|
16
17
|
const target = $clickedLinkEl.attr('target');
|
|
17
|
-
|
|
18
18
|
if (url && window.cordova && window.cordova.InAppBrowser && (target === '_system' || target === '_blank')) {
|
|
19
19
|
e.preventDefault();
|
|
20
20
|
window.cordova.InAppBrowser.open(url, target);
|
|
@@ -24,70 +24,59 @@ function initClicks(app) {
|
|
|
24
24
|
url
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
29
|
+
}
|
|
32
30
|
|
|
31
|
+
// Modules Clicks
|
|
33
32
|
Object.keys(app.modules).forEach(moduleName => {
|
|
34
33
|
const moduleClicks = app.modules[moduleName].clicks;
|
|
35
34
|
if (!moduleClicks) return;
|
|
36
35
|
if (e.preventF7Router) return;
|
|
37
36
|
Object.keys(moduleClicks).forEach(clickSelector => {
|
|
38
37
|
const matchingClickedElement = $clickedEl.closest(clickSelector).eq(0);
|
|
39
|
-
|
|
40
38
|
if (matchingClickedElement.length > 0) {
|
|
41
39
|
moduleClicks[clickSelector].call(app, matchingClickedElement, matchingClickedElement.dataset(), e);
|
|
42
40
|
}
|
|
43
41
|
});
|
|
44
|
-
});
|
|
42
|
+
});
|
|
45
43
|
|
|
44
|
+
// Load Page
|
|
46
45
|
let clickedLinkData = {};
|
|
47
|
-
|
|
48
46
|
if (isLink) {
|
|
49
47
|
e.preventDefault();
|
|
50
48
|
clickedLinkData = $clickedLinkEl.dataset();
|
|
51
49
|
}
|
|
50
|
+
clickedLinkData.clickedEl = $clickedLinkEl[0];
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// Prevent Router
|
|
55
53
|
if (e.preventF7Router) return;
|
|
56
54
|
if ($clickedLinkEl.hasClass('prevent-router') || $clickedLinkEl.hasClass('router-prevent')) return;
|
|
57
55
|
const validUrl = url && url.length > 0 && url[0] !== '#';
|
|
58
|
-
|
|
59
56
|
if (validUrl || $clickedLinkEl.hasClass('back')) {
|
|
60
57
|
let view;
|
|
61
|
-
|
|
62
58
|
if (clickedLinkData.view && clickedLinkData.view === 'current') {
|
|
63
59
|
view = app.views.current;
|
|
64
60
|
} else if (clickedLinkData.view) {
|
|
65
61
|
view = $(clickedLinkData.view)[0].f7View;
|
|
66
62
|
} else {
|
|
67
63
|
view = $clickedEl.parents('.view')[0] && $clickedEl.parents('.view')[0].f7View;
|
|
68
|
-
|
|
69
64
|
if (!$clickedLinkEl.hasClass('back') && view && view.params.linksView) {
|
|
70
65
|
if (typeof view.params.linksView === 'string') view = $(view.params.linksView)[0].f7View;else if (view.params.linksView instanceof ViewClass) view = view.params.linksView;
|
|
71
66
|
}
|
|
72
67
|
}
|
|
73
|
-
|
|
74
68
|
if (!view) {
|
|
75
69
|
if (app.views.main) view = app.views.main;
|
|
76
70
|
}
|
|
77
|
-
|
|
78
71
|
if (!view || !view.router) return;
|
|
79
|
-
|
|
80
72
|
if ($clickedLinkEl[0].f7RouteProps) {
|
|
81
73
|
clickedLinkData.props = $clickedLinkEl[0].f7RouteProps;
|
|
82
74
|
}
|
|
83
|
-
|
|
84
75
|
if ($clickedLinkEl.hasClass('back')) view.router.back(url, clickedLinkData);else view.router.navigate(url, clickedLinkData);
|
|
85
76
|
}
|
|
86
77
|
}
|
|
87
|
-
|
|
88
78
|
app.on('click', handleClicks);
|
|
89
79
|
}
|
|
90
|
-
|
|
91
80
|
export default {
|
|
92
81
|
name: 'clicks',
|
|
93
82
|
params: {
|
|
@@ -101,6 +90,5 @@ export default {
|
|
|
101
90
|
const app = this;
|
|
102
91
|
initClicks(app);
|
|
103
92
|
}
|
|
104
|
-
|
|
105
93
|
}
|
|
106
94
|
};
|
package/modules/component/$h.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import htm from 'htm';
|
|
2
2
|
import { flattenArray } from '../../shared/utils.js';
|
|
3
3
|
const ignoreChildren = [false, null, '', undefined];
|
|
4
|
-
|
|
5
4
|
const h = function (type, props) {
|
|
6
5
|
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
7
6
|
children[_key - 2] = arguments[_key];
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
return {
|
|
11
9
|
type,
|
|
12
10
|
props: props || {},
|
|
13
11
|
children: flattenArray(children.filter(child => ignoreChildren.indexOf(child) < 0))
|
|
14
12
|
};
|
|
15
13
|
};
|
|
16
|
-
|
|
17
14
|
const $h = htm.bind(h);
|
|
18
15
|
export default $h;
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import { flattenArray } from '../../shared/utils.js';
|
|
2
2
|
const ignoreChildren = [false, null, '', undefined];
|
|
3
|
-
|
|
4
3
|
const $jsx = function (type, props) {
|
|
5
4
|
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
6
5
|
children[_key - 2] = arguments[_key];
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
const flatChildren = flattenArray((children || []).filter(child => ignoreChildren.indexOf(child) < 0));
|
|
10
|
-
|
|
11
8
|
if (type === 'Fragment') {
|
|
12
9
|
return flatChildren;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
11
|
return {
|
|
16
12
|
type,
|
|
17
13
|
props: props || {},
|
|
18
14
|
children: flatChildren
|
|
19
15
|
};
|
|
20
16
|
};
|
|
21
|
-
|
|
22
17
|
export default $jsx;
|
|
@@ -6,13 +6,11 @@ import { id as generateId, merge, eventNameToColonCase, deleteProps } from '../.
|
|
|
6
6
|
import vdom from './vdom.js';
|
|
7
7
|
import patch from './patch.js';
|
|
8
8
|
import $jsx from './$jsx.js';
|
|
9
|
-
|
|
10
9
|
class Component {
|
|
11
10
|
constructor(app, component, props, _temp) {
|
|
12
11
|
if (props === void 0) {
|
|
13
12
|
props = {};
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
let {
|
|
17
15
|
el,
|
|
18
16
|
context,
|
|
@@ -27,8 +25,7 @@ class Component {
|
|
|
27
25
|
children: children || [],
|
|
28
26
|
theme: {
|
|
29
27
|
ios: app.theme === 'ios',
|
|
30
|
-
md: app.theme === 'md'
|
|
31
|
-
aurora: app.theme === 'aurora'
|
|
28
|
+
md: app.theme === 'md'
|
|
32
29
|
},
|
|
33
30
|
style: component.style,
|
|
34
31
|
__updateQueue: [],
|
|
@@ -41,11 +38,9 @@ class Component {
|
|
|
41
38
|
__onBeforeUnmount: [],
|
|
42
39
|
__onUnmounted: []
|
|
43
40
|
});
|
|
44
|
-
|
|
45
41
|
const createComponent = () => {
|
|
46
42
|
return component(this.props, this.getComponentContext(true));
|
|
47
43
|
};
|
|
48
|
-
|
|
49
44
|
const getRenderFuncion = componentResult => new Promise((resolve, reject) => {
|
|
50
45
|
if (typeof componentResult === 'function') {
|
|
51
46
|
resolve(componentResult);
|
|
@@ -59,21 +54,17 @@ class Component {
|
|
|
59
54
|
reject(new Error('Framework7: Component render function is not a "function" type. Didn\'t you forget to "return $render"?'));
|
|
60
55
|
}
|
|
61
56
|
});
|
|
62
|
-
|
|
63
57
|
return new Promise((resolve, reject) => {
|
|
64
58
|
const componentResult = createComponent();
|
|
65
59
|
getRenderFuncion(componentResult).then(render => {
|
|
66
60
|
this.renderFunction = render;
|
|
67
61
|
const tree = this.render();
|
|
68
|
-
|
|
69
62
|
if (el) {
|
|
70
63
|
this.vnode = vdom(tree, this, true);
|
|
71
|
-
|
|
72
64
|
if (this.style) {
|
|
73
65
|
this.styleEl = document.createElement('style');
|
|
74
66
|
this.styleEl.innerHTML = this.style;
|
|
75
67
|
}
|
|
76
|
-
|
|
77
68
|
this.el = el;
|
|
78
69
|
patch(this.el, this.vnode);
|
|
79
70
|
this.el = this.vnode.elm;
|
|
@@ -83,52 +74,42 @@ class Component {
|
|
|
83
74
|
this.mount();
|
|
84
75
|
resolve(this);
|
|
85
76
|
return;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
}
|
|
78
|
+
// Make Dom
|
|
89
79
|
if (tree) {
|
|
90
80
|
this.vnode = vdom(tree, this, true);
|
|
91
81
|
this.el = document.createElement(this.vnode.sel || 'div');
|
|
92
82
|
patch(this.el, this.vnode);
|
|
93
83
|
this.$el = $(this.el);
|
|
94
84
|
}
|
|
95
|
-
|
|
96
85
|
if (this.style) {
|
|
97
86
|
this.styleEl = document.createElement('style');
|
|
98
87
|
this.styleEl.innerHTML = this.style;
|
|
99
88
|
}
|
|
100
|
-
|
|
101
89
|
this.attachEvents();
|
|
102
|
-
|
|
103
90
|
if (this.el) {
|
|
104
91
|
this.el.f7Component = this;
|
|
105
92
|
}
|
|
106
|
-
|
|
107
93
|
resolve(this);
|
|
108
94
|
}).catch(err => {
|
|
109
95
|
reject(err);
|
|
110
96
|
});
|
|
111
97
|
});
|
|
112
98
|
}
|
|
113
|
-
|
|
114
99
|
on(eventName, handler) {
|
|
115
100
|
if (!this.__eventHandlers) return;
|
|
116
|
-
|
|
117
101
|
this.__eventHandlers.push({
|
|
118
102
|
eventName,
|
|
119
103
|
handler
|
|
120
104
|
});
|
|
121
105
|
}
|
|
122
|
-
|
|
123
106
|
once(eventName, handler) {
|
|
124
107
|
if (!this.__eventHandlers) return;
|
|
125
|
-
|
|
126
108
|
this.__onceEventHandlers.push({
|
|
127
109
|
eventName,
|
|
128
110
|
handler
|
|
129
111
|
});
|
|
130
112
|
}
|
|
131
|
-
|
|
132
113
|
getComponentRef() {
|
|
133
114
|
const self = this;
|
|
134
115
|
return initialValue => {
|
|
@@ -138,17 +119,14 @@ class Component {
|
|
|
138
119
|
get() {
|
|
139
120
|
return value;
|
|
140
121
|
},
|
|
141
|
-
|
|
142
122
|
set(v) {
|
|
143
123
|
value = v;
|
|
144
124
|
self.update();
|
|
145
125
|
}
|
|
146
|
-
|
|
147
126
|
});
|
|
148
127
|
return obj;
|
|
149
128
|
};
|
|
150
129
|
}
|
|
151
|
-
|
|
152
130
|
getComponentStore() {
|
|
153
131
|
const {
|
|
154
132
|
state,
|
|
@@ -162,19 +140,16 @@ class Component {
|
|
|
162
140
|
$store.getters = new Proxy(_gettersPlain, {
|
|
163
141
|
get: (target, prop) => {
|
|
164
142
|
const obj = target[prop];
|
|
165
|
-
|
|
166
143
|
const callback = v => {
|
|
167
144
|
obj.value = v;
|
|
168
145
|
this.update();
|
|
169
146
|
};
|
|
170
|
-
|
|
171
147
|
obj.onUpdated(callback);
|
|
172
148
|
return obj;
|
|
173
149
|
}
|
|
174
150
|
});
|
|
175
151
|
return $store;
|
|
176
152
|
}
|
|
177
|
-
|
|
178
153
|
getComponentContext(includeHooks) {
|
|
179
154
|
const ctx = {
|
|
180
155
|
$f7route: this.context.f7route,
|
|
@@ -209,22 +184,18 @@ class Component {
|
|
|
209
184
|
});
|
|
210
185
|
return ctx;
|
|
211
186
|
}
|
|
212
|
-
|
|
213
187
|
render() {
|
|
214
188
|
return this.renderFunction(this.getComponentContext());
|
|
215
189
|
}
|
|
216
|
-
|
|
217
190
|
emit(name, data) {
|
|
218
191
|
if (!this.el) return;
|
|
219
192
|
this.$el.trigger(name, data);
|
|
220
193
|
}
|
|
221
|
-
|
|
222
194
|
attachEvents() {
|
|
223
195
|
const {
|
|
224
196
|
$el
|
|
225
197
|
} = this;
|
|
226
198
|
if (!this.__eventHandlers) return;
|
|
227
|
-
|
|
228
199
|
this.__eventHandlers.forEach(_ref => {
|
|
229
200
|
let {
|
|
230
201
|
eventName,
|
|
@@ -232,7 +203,6 @@ class Component {
|
|
|
232
203
|
} = _ref;
|
|
233
204
|
$el.on(eventNameToColonCase(eventName), handler);
|
|
234
205
|
});
|
|
235
|
-
|
|
236
206
|
this.__onceEventHandlers.forEach(_ref2 => {
|
|
237
207
|
let {
|
|
238
208
|
eventName,
|
|
@@ -241,13 +211,11 @@ class Component {
|
|
|
241
211
|
$el.once(eventNameToColonCase(eventName), handler);
|
|
242
212
|
});
|
|
243
213
|
}
|
|
244
|
-
|
|
245
214
|
detachEvents() {
|
|
246
215
|
const {
|
|
247
216
|
$el
|
|
248
217
|
} = this;
|
|
249
218
|
if (!this.__eventHandlers) return;
|
|
250
|
-
|
|
251
219
|
this.__eventHandlers.forEach(_ref3 => {
|
|
252
220
|
let {
|
|
253
221
|
eventName,
|
|
@@ -255,7 +223,6 @@ class Component {
|
|
|
255
223
|
} = _ref3;
|
|
256
224
|
$el.on(eventNameToColonCase(eventName), handler);
|
|
257
225
|
});
|
|
258
|
-
|
|
259
226
|
this.__onceEventHandlers.forEach(_ref4 => {
|
|
260
227
|
let {
|
|
261
228
|
eventName,
|
|
@@ -264,21 +231,19 @@ class Component {
|
|
|
264
231
|
$el.once(eventNameToColonCase(eventName), handler);
|
|
265
232
|
});
|
|
266
233
|
}
|
|
267
|
-
|
|
268
234
|
startUpdateQueue() {
|
|
269
235
|
const window = getWindow();
|
|
270
236
|
if (this.__requestAnimationFrameId) return;
|
|
271
|
-
|
|
272
237
|
const update = () => {
|
|
273
238
|
this.hook('onBeforeUpdate');
|
|
274
|
-
const tree = this.render();
|
|
239
|
+
const tree = this.render();
|
|
275
240
|
|
|
241
|
+
// Make Dom
|
|
276
242
|
if (tree) {
|
|
277
243
|
const newVNode = vdom(tree, this, false);
|
|
278
244
|
this.vnode = patch(this.vnode, newVNode);
|
|
279
245
|
}
|
|
280
246
|
};
|
|
281
|
-
|
|
282
247
|
this.__requestAnimationFrameId = window.requestAnimationFrame(() => {
|
|
283
248
|
if (this.__updateIsPending) update();
|
|
284
249
|
let resolvers = [...this.__updateQueue];
|
|
@@ -291,20 +256,16 @@ class Component {
|
|
|
291
256
|
resolvers = [];
|
|
292
257
|
});
|
|
293
258
|
}
|
|
294
|
-
|
|
295
259
|
tick(callback) {
|
|
296
260
|
return new Promise(resolve => {
|
|
297
261
|
function resolver() {
|
|
298
262
|
resolve();
|
|
299
263
|
if (callback) callback();
|
|
300
264
|
}
|
|
301
|
-
|
|
302
265
|
this.__updateQueue.push(resolver);
|
|
303
|
-
|
|
304
266
|
this.startUpdateQueue();
|
|
305
267
|
});
|
|
306
268
|
}
|
|
307
|
-
|
|
308
269
|
update(callback) {
|
|
309
270
|
if (this.__destroyed) return new Promise(() => {});
|
|
310
271
|
return new Promise(resolve => {
|
|
@@ -312,59 +273,49 @@ class Component {
|
|
|
312
273
|
resolve();
|
|
313
274
|
if (callback) callback();
|
|
314
275
|
};
|
|
315
|
-
|
|
316
276
|
this.__updateIsPending = true;
|
|
317
|
-
|
|
318
277
|
this.__updateQueue.push(resolver);
|
|
319
|
-
|
|
320
278
|
this.startUpdateQueue();
|
|
321
279
|
});
|
|
322
280
|
}
|
|
323
|
-
|
|
324
281
|
setState(callback) {
|
|
325
282
|
return this.update(callback);
|
|
326
283
|
}
|
|
327
|
-
|
|
328
284
|
f7ready(callback) {
|
|
329
285
|
if (this.f7.initialized) {
|
|
330
286
|
callback(this.f7);
|
|
331
287
|
return;
|
|
332
288
|
}
|
|
333
|
-
|
|
334
289
|
this.f7.once('init', () => {
|
|
335
290
|
callback(this.f7);
|
|
336
291
|
});
|
|
337
292
|
}
|
|
338
|
-
|
|
339
293
|
mount(mountMethod) {
|
|
340
294
|
this.hook('onBeforeMount', this.$el);
|
|
341
295
|
if (this.styleEl) $('head').append(this.styleEl);
|
|
342
296
|
if (mountMethod) mountMethod(this.el);
|
|
343
297
|
this.hook('onMounted', this.$el);
|
|
344
298
|
}
|
|
345
|
-
|
|
346
299
|
destroy() {
|
|
347
300
|
if (this.__destroyed) return;
|
|
348
301
|
const window = getWindow();
|
|
349
302
|
this.hook('onBeforeUnmount');
|
|
350
303
|
if (this.styleEl) $(this.styleEl).remove();
|
|
351
304
|
this.detachEvents();
|
|
352
|
-
this.hook('onUnmounted');
|
|
353
|
-
|
|
305
|
+
this.hook('onUnmounted');
|
|
306
|
+
// Delete component instance
|
|
354
307
|
if (this.el && this.el.f7Component) {
|
|
355
308
|
this.el.f7Component = null;
|
|
356
309
|
delete this.el.f7Component;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
310
|
+
}
|
|
311
|
+
// Patch with empty node
|
|
360
312
|
if (this.vnode) {
|
|
361
313
|
this.vnode = patch(this.vnode, {
|
|
362
314
|
sel: this.vnode.sel,
|
|
363
315
|
data: {}
|
|
364
316
|
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
317
|
+
}
|
|
318
|
+
// Clear update queue
|
|
368
319
|
window.cancelAnimationFrame(this.__requestAnimationFrameId);
|
|
369
320
|
this.__updateQueue = [];
|
|
370
321
|
this.__eventHandlers = [];
|
|
@@ -374,24 +325,20 @@ class Component {
|
|
|
374
325
|
this.__onBeforeUpdate = [];
|
|
375
326
|
this.__onUpdated = [];
|
|
376
327
|
this.__onBeforeUnmount = [];
|
|
377
|
-
this.__onUnmounted = [];
|
|
378
|
-
|
|
328
|
+
this.__onUnmounted = [];
|
|
329
|
+
// Delete all props
|
|
379
330
|
deleteProps(this);
|
|
380
331
|
this.__destroyed = true;
|
|
381
332
|
}
|
|
382
|
-
|
|
383
333
|
hook(name) {
|
|
384
334
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
385
335
|
args[_key - 1] = arguments[_key];
|
|
386
336
|
}
|
|
387
|
-
|
|
388
337
|
if (this.__destroyed) return;
|
|
389
338
|
this[`__${name}`].forEach(handler => {
|
|
390
339
|
handler(...args);
|
|
391
340
|
});
|
|
392
341
|
}
|
|
393
|
-
|
|
394
342
|
}
|
|
395
|
-
|
|
396
343
|
Component.$jsx = $jsx;
|
|
397
344
|
export default Component;
|
|
@@ -20,11 +20,10 @@ export interface ComponentContext {
|
|
|
20
20
|
$f7router: Router.Router;
|
|
21
21
|
/** Framework7 app instance */
|
|
22
22
|
$f7: Framework7;
|
|
23
|
-
/** Object with md
|
|
23
|
+
/** Object with `md` and `ios` boolean properties which indicating current theme. */
|
|
24
24
|
$theme: {
|
|
25
25
|
ios: boolean;
|
|
26
26
|
md: boolean;
|
|
27
|
-
aurora: boolean;
|
|
28
27
|
};
|
|
29
28
|
/** Main app store */
|
|
30
29
|
$store: Store;
|
|
@@ -2,15 +2,12 @@ import Component from './component-class.js';
|
|
|
2
2
|
import parseComponent from './parse-component.js';
|
|
3
3
|
import customComponents from './custom-components.js';
|
|
4
4
|
import $jsx from './$jsx.js';
|
|
5
|
-
|
|
6
5
|
function registerComponent(tagName, component) {
|
|
7
6
|
customComponents[tagName] = component;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
function unregisterComponent(tagName) {
|
|
11
9
|
delete customComponents[tagName];
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
export { Component, $jsx };
|
|
15
12
|
export default {
|
|
16
13
|
name: 'component',
|
|
@@ -20,17 +17,14 @@ export default {
|
|
|
20
17
|
registerComponent,
|
|
21
18
|
unregisterComponent
|
|
22
19
|
},
|
|
23
|
-
|
|
24
20
|
create() {
|
|
25
21
|
const app = this;
|
|
26
22
|
app.component = {
|
|
27
23
|
registerComponent,
|
|
28
24
|
unregisterComponent,
|
|
29
|
-
|
|
30
25
|
parse(componentString) {
|
|
31
26
|
return parseComponent(componentString);
|
|
32
27
|
},
|
|
33
|
-
|
|
34
28
|
create(component, props, _ref) {
|
|
35
29
|
let {
|
|
36
30
|
root,
|
|
@@ -45,8 +39,6 @@ export default {
|
|
|
45
39
|
children
|
|
46
40
|
});
|
|
47
41
|
}
|
|
48
|
-
|
|
49
42
|
};
|
|
50
43
|
}
|
|
51
|
-
|
|
52
44
|
};
|