framework7 8.3.4 → 9.0.0
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-rtl.css +1 -1
- package/components/accordion/accordion.css +1 -1
- package/components/actions/actions-ios.less +22 -15
- package/components/actions/actions-rtl.css +1 -1
- package/components/actions/actions-vars.less +4 -7
- package/components/actions/actions.css +1 -1
- package/components/actions/actions.js +2 -8
- package/components/actions/actions.less +0 -3
- package/components/app/app-class.d.ts +2 -0
- package/components/app/app-class.js +19 -15
- package/components/app/app-vars.less +41 -6
- package/components/app/app.less +1 -1
- package/components/area-chart/area-chart-class.js +18 -31
- package/components/area-chart/area-chart-rtl.css +1 -1
- package/components/area-chart/area-chart.css +1 -1
- package/components/autocomplete/autocomplete-class.js +13 -14
- package/components/autocomplete/autocomplete-ios.less +16 -0
- package/components/autocomplete/autocomplete-rtl.css +1 -1
- package/components/autocomplete/autocomplete.css +1 -1
- package/components/autocomplete/autocomplete.d.ts +3 -3
- package/components/autocomplete/autocomplete.js +3 -3
- package/components/autocomplete/autocomplete.less +7 -1
- package/components/block/block-vars.less +6 -6
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -1
- package/components/breadcrumbs/breadcrumbs.css +1 -1
- package/components/button/button-vars.less +13 -12
- package/components/button/button.less +2 -1
- package/components/calendar/calendar-class.js +20 -17
- package/components/calendar/calendar-ios.less +43 -0
- package/components/calendar/calendar-md.less +3 -0
- package/components/calendar/calendar-rtl.css +1 -1
- package/components/calendar/calendar-vars.less +24 -19
- package/components/calendar/calendar.css +1 -1
- package/components/calendar/calendar.d.ts +1 -1
- package/components/calendar/calendar.js +5 -8
- package/components/calendar/calendar.less +4 -2
- package/components/card/card-rtl.css +1 -1
- package/components/card/card-vars.less +5 -5
- package/components/card/card.css +1 -1
- package/components/card/card.js +3 -18
- package/components/card/card.less +1 -1
- package/components/checkbox/checkbox-rtl.css +1 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/chip/chip-rtl.css +1 -1
- package/components/chip/chip.css +1 -1
- package/components/color-picker/color-picker-class.js +11 -23
- package/components/color-picker/color-picker-ios.less +9 -0
- package/components/color-picker/color-picker-md.less +15 -0
- package/components/color-picker/color-picker-rtl.css +1 -1
- package/components/color-picker/color-picker-vars.less +9 -3
- package/components/color-picker/color-picker.css +1 -1
- package/components/color-picker/color-picker.d.ts +1 -2
- package/components/color-picker/color-picker.js +3 -7
- package/components/color-picker/color-picker.less +5 -25
- package/components/color-picker/modules/alpha-slider.js +2 -0
- package/components/color-picker/modules/brightness-slider.js +2 -0
- package/components/color-picker/modules/hs-spectrum.js +1 -2
- package/components/color-picker/modules/hsb-sliders.js +6 -0
- package/components/color-picker/modules/hue-slider.js +2 -0
- package/components/color-picker/modules/rgb-bars.js +6 -0
- package/components/color-picker/modules/rgb-sliders.js +6 -0
- package/components/color-picker/modules/sb-spectrum.js +1 -2
- package/components/color-picker/modules/wheel.js +1 -2
- package/components/contacts-list/contacts-list-rtl.css +1 -1
- package/components/contacts-list/contacts-list.css +1 -1
- package/components/data-table/data-table-class.js +1 -4
- package/components/data-table/data-table-ios.less +1 -1
- package/components/data-table/data-table-md.less +4 -2
- package/components/data-table/data-table-rtl.css +1 -1
- package/components/data-table/data-table.css +1 -1
- package/components/data-table/data-table.less +4 -4
- package/components/dialog/dialog-class.js +6 -3
- package/components/dialog/dialog-ios.less +10 -34
- package/components/dialog/dialog-md.less +2 -22
- package/components/dialog/dialog-rtl.css +1 -1
- package/components/dialog/dialog-vars.less +8 -10
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.js +9 -27
- package/components/dialog/dialog.less +6 -25
- package/components/fab/fab-ios.less +2 -0
- package/components/fab/fab-rtl.css +1 -1
- package/components/fab/fab-vars.less +30 -6
- package/components/fab/fab.css +1 -1
- package/components/fab/fab.js +3 -12
- package/components/gauge/gauge-class.js +2 -8
- package/components/gauge/gauge-rtl.css +1 -1
- package/components/gauge/gauge.css +1 -1
- package/components/icon/icon-ios.less +10 -0
- package/components/icon/icon-md.less +9 -0
- package/components/icon/icon.less +2 -1
- package/components/infinite-scroll/infinite-scroll-rtl.css +1 -1
- package/components/infinite-scroll/infinite-scroll.css +1 -1
- package/components/input/input-ios.less +3 -2
- package/components/input/input-rtl.css +1 -1
- package/components/input/input.css +1 -1
- package/components/input/input.js +2 -5
- package/components/list/list-vars.less +7 -5
- package/components/list/list.less +1 -1
- package/components/list-index/list-index-class.js +3 -7
- package/components/list-index/list-index-rtl.css +1 -1
- package/components/list-index/list-index.css +1 -1
- package/components/login-screen/login-screen-rtl.css +1 -1
- package/components/login-screen/login-screen.css +1 -1
- package/components/login-screen/login-screen.js +2 -8
- package/components/login-screen/login-screen.less +1 -0
- package/components/messagebar/messagebar-class.js +5 -20
- package/components/messagebar/messagebar-ios.less +19 -14
- package/components/messagebar/messagebar-md.less +3 -0
- package/components/messagebar/messagebar-rtl.css +1 -1
- package/components/messagebar/messagebar-vars.less +12 -15
- package/components/messagebar/messagebar.css +1 -1
- package/components/messagebar/messagebar.less +4 -5
- package/components/messages/messages-class.js +25 -52
- package/components/messages/messages-ios.less +6 -2
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages-vars.less +1 -1
- package/components/messages/messages.css +1 -1
- package/components/navbar/navbar-ios.less +52 -672
- package/components/navbar/navbar-md.less +41 -1
- package/components/navbar/navbar-vars.less +4 -3
- package/components/navbar/navbar.js +28 -185
- package/components/navbar/navbar.less +8 -66
- package/components/notification/notification-class.js +6 -6
- package/components/notification/notification-ios.less +3 -8
- package/components/notification/notification-md.less +1 -20
- package/components/notification/notification-rtl.css +1 -1
- package/components/notification/notification-vars.less +13 -16
- package/components/notification/notification.css +1 -1
- package/components/notification/notification.less +8 -1
- package/components/page/page-ios.less +1 -8
- package/components/page/page-md.less +12 -11
- package/components/page/page.less +14 -12
- package/components/panel/panel-class.js +7 -28
- package/components/panel/panel-ios.less +4 -0
- package/components/panel/panel-rtl.css +1 -3
- package/components/panel/panel-vars.less +8 -5
- package/components/panel/panel.css +1 -3
- package/components/panel/panel.js +8 -32
- package/components/panel/panel.less +9 -9
- package/components/panel/resizable-panel.js +2 -4
- package/components/photo-browser/photo-browser-class.js +12 -47
- package/components/photo-browser/photo-browser-rtl.css +1 -1
- package/components/photo-browser/photo-browser-vars.less +8 -10
- 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 -3
- package/components/photo-browser/photo-browser.less +15 -71
- package/components/picker/picker-class.js +4 -5
- package/components/picker/picker-ios.less +6 -1
- package/components/picker/picker-md.less +9 -0
- package/components/picker/picker-rtl.css +1 -1
- package/components/picker/picker-vars.less +1 -1
- package/components/picker/picker.css +1 -1
- package/components/picker/picker.d.ts +1 -1
- package/components/picker/picker.js +2 -5
- package/components/picker/picker.less +0 -4
- package/components/pie-chart/pie-chart-class.js +7 -14
- package/components/pie-chart/pie-chart-rtl.css +1 -1
- package/components/pie-chart/pie-chart.css +1 -1
- package/components/popover/popover-class.js +22 -62
- package/components/popover/popover-ios.less +66 -2
- package/components/popover/popover-md.less +2 -27
- package/components/popover/popover-rtl.css +1 -1
- package/components/popover/popover-vars.less +2 -3
- package/components/popover/popover.css +1 -1
- package/components/popover/popover.d.ts +0 -2
- package/components/popover/popover.js +2 -9
- package/components/popover/popover.less +28 -50
- package/components/popup/popup-class.js +15 -9
- package/components/popup/popup-rtl.css +1 -1
- package/components/popup/popup-vars.less +2 -2
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.js +2 -8
- package/components/popup/popup.less +6 -6
- package/components/preloader/preloader-rtl.css +1 -1
- package/components/preloader/preloader.css +1 -1
- package/components/preloader/preloader.js +2 -8
- package/components/progressbar/progressbar-md.less +12 -0
- package/components/progressbar/progressbar-rtl.css +1 -1
- package/components/progressbar/progressbar-vars.less +6 -5
- package/components/progressbar/progressbar.css +1 -1
- package/components/progressbar/progressbar.js +3 -12
- package/components/progressbar/progressbar.less +6 -0
- package/components/pull-to-refresh/pull-to-refresh-class.js +5 -12
- package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -1
- package/components/pull-to-refresh/pull-to-refresh.css +1 -1
- package/components/radio/radio-rtl.css +1 -1
- package/components/radio/radio.css +1 -1
- package/components/range/range-class.js +34 -27
- package/components/range/range-ios.less +60 -0
- package/components/range/range-md.less +67 -4
- package/components/range/range-rtl.css +1 -1
- package/components/range/range-vars.less +18 -13
- package/components/range/range.css +1 -1
- package/components/range/range.d.ts +3 -1
- package/components/range/range.js +2 -8
- package/components/range/range.less +11 -24
- package/components/searchbar/searchbar-class.js +7 -8
- package/components/searchbar/searchbar-ios.less +37 -13
- package/components/searchbar/searchbar-md.less +5 -0
- package/components/searchbar/searchbar-rtl.css +1 -1
- package/components/searchbar/searchbar-vars.less +13 -16
- package/components/searchbar/searchbar.css +1 -1
- package/components/searchbar/searchbar.js +4 -32
- package/components/searchbar/searchbar.less +4 -5
- package/components/sheet/sheet-class.js +21 -17
- package/components/sheet/sheet-ios.less +10 -0
- package/components/sheet/sheet-md.less +14 -0
- package/components/sheet/sheet-rtl.css +1 -1
- package/components/sheet/sheet-vars.less +5 -9
- package/components/sheet/sheet.css +1 -1
- package/components/sheet/sheet.js +2 -8
- package/components/sheet/sheet.less +5 -17
- package/components/skeleton/skeleton-rtl.css +1 -1
- package/components/skeleton/skeleton.css +1 -1
- package/components/smart-select/smart-select-class.js +15 -20
- package/components/smart-select/smart-select-rtl.css +1 -1
- package/components/smart-select/smart-select.css +1 -1
- package/components/smart-select/smart-select.d.ts +5 -7
- package/components/smart-select/smart-select.js +4 -4
- package/components/sortable/sortable-rtl.css +1 -1
- package/components/sortable/sortable.css +1 -1
- package/components/sortable/sortable.js +8 -27
- package/components/statusbar/statusbar.js +2 -5
- package/components/stepper/stepper-rtl.css +1 -1
- package/components/stepper/stepper-vars.less +3 -3
- package/components/stepper/stepper.css +1 -1
- package/components/stepper/stepper.js +2 -8
- package/components/subnavbar/subnavbar-ios.less +16 -1
- package/components/subnavbar/subnavbar-md.less +5 -5
- package/components/subnavbar/subnavbar-vars.less +12 -6
- package/components/subnavbar/subnavbar.less +5 -6
- package/components/swipeout/swipeout-ios.less +37 -0
- package/components/swipeout/swipeout-md.less +56 -0
- package/components/swipeout/swipeout-rtl.css +1 -1
- package/components/swipeout/swipeout-vars.less +13 -2
- package/components/swipeout/swipeout.css +1 -1
- package/components/swipeout/swipeout.js +102 -35
- package/components/swipeout/swipeout.less +20 -44
- package/components/swiper/swiper-rtl.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/tabs/tabs-rtl.css +1 -1
- package/components/tabs/tabs.css +1 -1
- package/components/tabs/tabs.js +3 -9
- package/components/text-editor/text-editor-class.js +1 -1
- package/components/text-editor/text-editor-rtl.css +1 -1
- package/components/text-editor/text-editor.css +1 -1
- package/components/timeline/timeline-ios.less +0 -5
- package/components/timeline/timeline-md.less +0 -5
- package/components/timeline/timeline-rtl.css +1 -1
- package/components/timeline/timeline-vars.less +1 -17
- package/components/timeline/timeline.css +1 -1
- package/components/timeline/timeline.less +0 -196
- package/components/toast/toast-class.js +2 -2
- package/components/toast/toast-ios.less +2 -0
- package/components/toast/toast-rtl.css +1 -1
- package/components/toast/toast-vars.less +2 -4
- package/components/toast/toast.css +1 -1
- package/components/toast/toast.less +1 -1
- package/components/toggle/toggle-class.js +5 -12
- package/components/toggle/toggle-ios.less +68 -50
- package/components/toggle/toggle-rtl.css +1 -1
- package/components/toggle/toggle-vars.less +2 -2
- package/components/toggle/toggle.css +1 -1
- package/components/toolbar/tabbar-highlight.js +134 -0
- package/components/toolbar/toolbar-ios.less +160 -14
- package/components/toolbar/toolbar-md.less +77 -3
- package/components/toolbar/toolbar-vars.less +14 -10
- package/components/toolbar/toolbar.js +32 -13
- package/components/toolbar/toolbar.less +8 -56
- package/components/tooltip/tooltip-class.js +13 -16
- package/components/tooltip/tooltip-rtl.css +1 -1
- package/components/tooltip/tooltip.css +1 -1
- package/components/tooltip/tooltip.js +0 -16
- package/components/touch-highlight/touch-highlight-ios.less +17 -0
- package/components/touch-highlight/touch-highlight-md.less +2 -0
- package/components/touch-highlight/touch-highlight-vars.less +8 -0
- package/components/touch-highlight/touch-highlight.d.ts +25 -0
- package/components/touch-highlight/touch-highlight.js +123 -0
- package/components/touch-highlight/touch-highlight.less +9 -0
- package/components/touch-ripple/touch-ripple.js +1 -4
- package/components/treeview/treeview-rtl.css +1 -1
- package/components/treeview/treeview.css +1 -1
- package/components/typography/typography-rtl.css +1 -1
- package/components/typography/typography.css +1 -1
- package/components/view/resizable-view.js +2 -4
- package/components/view/view-class.js +1 -15
- package/components/view/view.d.ts +0 -4
- package/components/view/view.js +1 -5
- package/components/virtual-list/virtual-list-class.js +2 -8
- package/framework7-bundle-rtl.css +2284 -3019
- package/framework7-bundle-rtl.min.css +4 -10
- package/framework7-bundle.css +2245 -2978
- package/framework7-bundle.esm.js +5 -4
- package/framework7-bundle.js +7180 -6477
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +4 -3
- package/framework7-bundle.min.css +4 -10
- package/framework7-bundle.min.js +4 -4
- package/framework7-bundle.min.js.map +1 -1
- package/framework7-lite-bundle.esm.js +5 -4
- package/framework7-lite.esm.js +5 -4
- package/framework7-rtl.css +509 -844
- package/framework7-rtl.min.css +4 -8
- package/framework7-types.d.ts +5 -1
- package/framework7.css +509 -843
- package/framework7.d.ts +4 -0
- package/framework7.esm.js +5 -4
- package/framework7.less +4 -3
- package/framework7.min.css +4 -8
- package/less/mixins.less +10 -12
- package/modules/component/$h.js +1 -4
- package/modules/component/$jsx.js +1 -4
- package/modules/component/component-class.js +49 -114
- package/modules/component/component.js +6 -7
- package/modules/component/eventslisteners.js +1 -4
- package/modules/component/snabbdom/modules/hero.js +0 -1
- package/modules/component/snabbdom/modules/style.js +1 -1
- package/modules/component/vdom.js +17 -29
- package/modules/router/back.js +22 -96
- package/modules/router/clear-previous-history.js +1 -7
- package/modules/router/component-loader.js +23 -32
- package/modules/router/modal.js +1 -4
- package/modules/router/navigate.js +28 -167
- package/modules/router/redirect.js +1 -5
- package/modules/router/router-class.js +28 -293
- package/modules/router/router.d.ts +2 -0
- package/modules/router/swipe-back.js +10 -318
- package/modules/router/tab.js +1 -4
- package/modules/service-worker/service-worker.js +1 -1
- package/modules/store/create-store.js +2 -8
- package/modules/touch/touch.d.ts +5 -3
- package/modules/touch/touch.js +23 -37
- package/package.json +4 -4
- package/shared/$jsx.js +1 -4
- package/shared/class.js +5 -26
- package/shared/constructor-methods.js +4 -19
- package/shared/events-class.js +3 -12
- package/shared/get-device.js +4 -11
- package/shared/get-support.d.ts +0 -6
- package/shared/get-support.js +1 -20
- package/shared/material-color-utils.js +2102 -693
- package/shared/material-colors.js +94 -23
- package/shared/modal-methods.js +2 -8
- package/shared/utils.js +23 -45
package/less/mixins.less
CHANGED
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
transition-duration: 300ms;
|
|
199
199
|
transition-property: opacity;
|
|
200
200
|
}
|
|
201
|
-
|
|
201
|
+
&:is(.icon-only, a:has(i:only-child), a:has(svg:only-child)):before,
|
|
202
202
|
&.ripple-inset:before,
|
|
203
203
|
&.searchbar-disable-button:before,
|
|
204
204
|
&.input-clear-button:before,
|
|
@@ -243,19 +243,17 @@
|
|
|
243
243
|
|
|
244
244
|
.ios-translucent-bars(@color) {
|
|
245
245
|
.ios-translucent-bars & {
|
|
246
|
-
@
|
|
247
|
-
|
|
248
|
-
backdrop-filter: saturate(180%) blur(var(--f7-bars-translucent-blur));
|
|
249
|
-
}
|
|
246
|
+
background-color: rgba(@color, var(--f7-bars-translucent-opacity));
|
|
247
|
+
backdrop-filter: saturate(180%) blur(var(--f7-bars-translucent-blur));
|
|
250
248
|
}
|
|
251
249
|
}
|
|
252
|
-
.ios-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
250
|
+
.ios-glass-backdrop() {
|
|
251
|
+
backdrop-filter: saturate(180%) blur(16px);
|
|
252
|
+
}
|
|
253
|
+
.ios-glass() {
|
|
254
|
+
.ios-glass-backdrop();
|
|
255
|
+
box-shadow: var(--f7-glass-shadow);
|
|
256
|
+
background-color: var(--f7-glass-bg-color);
|
|
259
257
|
}
|
|
260
258
|
|
|
261
259
|
.no-scrollbar() {
|
package/modules/component/$h.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import htm from 'htm';
|
|
2
2
|
import { flattenArray } from '../../shared/utils.js';
|
|
3
3
|
const ignoreChildren = [false, null, '', undefined];
|
|
4
|
-
const h =
|
|
5
|
-
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
6
|
-
children[_key - 2] = arguments[_key];
|
|
7
|
-
}
|
|
4
|
+
const h = (type, props, ...children) => {
|
|
8
5
|
return {
|
|
9
6
|
type,
|
|
10
7
|
props: props || {},
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { flattenArray } from '../../shared/utils.js';
|
|
2
2
|
const ignoreChildren = [false, null, '', undefined];
|
|
3
|
-
const $jsx =
|
|
4
|
-
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
5
|
-
children[_key - 2] = arguments[_key];
|
|
6
|
-
}
|
|
3
|
+
const $jsx = (type, props, ...children) => {
|
|
7
4
|
const flatChildren = flattenArray((children || []).filter(child => ignoreChildren.indexOf(child) < 0));
|
|
8
5
|
if (type === 'Fragment') {
|
|
9
6
|
return flatChildren;
|
|
@@ -17,45 +17,15 @@ const types = [{
|
|
|
17
17
|
init: i => i,
|
|
18
18
|
type: i => [i].find(Array.isArray),
|
|
19
19
|
update: (i, o) => [o].filter(Array.isArray).find(() => (i.length = 0, i.push(...o))),
|
|
20
|
-
insert:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return i.splice(Math.max(x, 0), 0, ...[o].flat());
|
|
25
|
-
},
|
|
26
|
-
replace: function (i, x, o) {
|
|
27
|
-
if (o === void 0) {
|
|
28
|
-
o = [];
|
|
29
|
-
}
|
|
30
|
-
return i.splice(Math.max(x, 0), Math.min(++x, 1), ...[o].flat());
|
|
31
|
-
},
|
|
32
|
-
append: function (i, o) {
|
|
33
|
-
if (o === void 0) {
|
|
34
|
-
o = [];
|
|
35
|
-
}
|
|
36
|
-
return i.push(...[o].flat());
|
|
37
|
-
},
|
|
38
|
-
prepend: function (i, o) {
|
|
39
|
-
if (o === void 0) {
|
|
40
|
-
o = [];
|
|
41
|
-
}
|
|
42
|
-
return i.unshift(...[o].flat());
|
|
43
|
-
},
|
|
20
|
+
insert: (i, x, o = []) => i.splice(Math.max(x, 0), 0, ...[o].flat()),
|
|
21
|
+
replace: (i, x, o = []) => i.splice(Math.max(x, 0), Math.min(++x, 1), ...[o].flat()),
|
|
22
|
+
append: (i, o = []) => i.push(...[o].flat()),
|
|
23
|
+
prepend: (i, o = []) => i.unshift(...[o].flat()),
|
|
44
24
|
swap: (i, a, b) => {
|
|
45
25
|
[i[a], i[b]] = [i[b], i[a]];
|
|
46
26
|
},
|
|
47
|
-
fromTo:
|
|
48
|
-
|
|
49
|
-
b = a;
|
|
50
|
-
}
|
|
51
|
-
return i.splice(Math.max(b, 0), 0, ...i.splice(Math.max(a, 0), 1));
|
|
52
|
-
},
|
|
53
|
-
remove: function (i, o, a) {
|
|
54
|
-
if (a === void 0) {
|
|
55
|
-
a = i.map((_, x) => x);
|
|
56
|
-
}
|
|
57
|
-
return [o].flat().filter(i => a.includes(i)).sort((a, b) => b - a).forEach(x => i.splice(x, 1));
|
|
58
|
-
},
|
|
27
|
+
fromTo: (i, a, b = a) => i.splice(Math.max(b, 0), 0, ...i.splice(Math.max(a, 0), 1)),
|
|
28
|
+
remove: (i, o, a = i.map((_, x) => x)) => [o].flat().filter(i => a.includes(i)).sort((a, b) => b - a).forEach(x => i.splice(x, 1)),
|
|
59
29
|
clear: i => i.length = 0
|
|
60
30
|
}, {
|
|
61
31
|
name: 'object',
|
|
@@ -75,22 +45,14 @@ const types = [{
|
|
|
75
45
|
}, {
|
|
76
46
|
name: 'atoms',
|
|
77
47
|
type: () => true,
|
|
78
|
-
init:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
get: () => i,
|
|
84
|
-
set: v => {
|
|
85
|
-
// eslint-disable-next-line
|
|
86
|
-
i = v;
|
|
87
|
-
}
|
|
88
|
-
}), o;
|
|
89
|
-
},
|
|
90
|
-
update: function (i, v) {
|
|
91
|
-
if (v === void 0) {
|
|
92
|
-
v = i.value;
|
|
48
|
+
init: (i, o = {}) => (Object.defineProperty(o, 'value', {
|
|
49
|
+
get: () => i,
|
|
50
|
+
set: v => {
|
|
51
|
+
// eslint-disable-next-line
|
|
52
|
+
i = v;
|
|
93
53
|
}
|
|
54
|
+
}), o),
|
|
55
|
+
update: (i, v = i.value) => {
|
|
94
56
|
i.value = v;
|
|
95
57
|
},
|
|
96
58
|
insert: () => ({}),
|
|
@@ -119,15 +81,11 @@ const types = [{
|
|
|
119
81
|
/* eslint-enable no-sequences */
|
|
120
82
|
|
|
121
83
|
class Component {
|
|
122
|
-
constructor(app, component, props
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
el,
|
|
128
|
-
context,
|
|
129
|
-
children
|
|
130
|
-
} = _temp === void 0 ? {} : _temp;
|
|
84
|
+
constructor(app, component, props = {}, {
|
|
85
|
+
el,
|
|
86
|
+
context,
|
|
87
|
+
children
|
|
88
|
+
} = {}) {
|
|
131
89
|
const document = getDocument();
|
|
132
90
|
merge(this, {
|
|
133
91
|
f7: app,
|
|
@@ -265,37 +223,21 @@ class Component {
|
|
|
265
223
|
|
|
266
224
|
/* eslint-disable no-sequences */
|
|
267
225
|
getUseState() {
|
|
268
|
-
var _this = this;
|
|
269
226
|
return o => {
|
|
270
|
-
const obj = [o].reduce(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
fromTo: (a, b) => (t.fromTo(i, a, b), _this.update()),
|
|
285
|
-
method: function (f) {
|
|
286
|
-
if (f === void 0) {
|
|
287
|
-
f = () => ({});
|
|
288
|
-
}
|
|
289
|
-
return f(i), _this.update();
|
|
290
|
-
},
|
|
291
|
-
async: function (f) {
|
|
292
|
-
if (f === void 0) {
|
|
293
|
-
f = () => Promise.reject(i);
|
|
294
|
-
}
|
|
295
|
-
return f(i).then(() => _this.update());
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
}, types.find(i => i.type(o)));
|
|
227
|
+
const obj = [o].reduce((t, _i, _x, _a, i = t.init(_i)) => ({
|
|
228
|
+
state: i,
|
|
229
|
+
update: v => (t.update(i, v), this.update()),
|
|
230
|
+
remove: v => (t.remove(i, v), this.update()),
|
|
231
|
+
clear: () => (t.clear(i), this.update()),
|
|
232
|
+
insert: (x, v) => (t.insert(i, x, v), this.update()),
|
|
233
|
+
replace: (x, v) => (t.replace(i, x, v), this.update()),
|
|
234
|
+
append: v => (t.append(i, v), this.update()),
|
|
235
|
+
prepend: v => (t.prepend(i, v), this.update()),
|
|
236
|
+
swap: (a, b) => (t.swap(i, a, b), this.update()),
|
|
237
|
+
fromTo: (a, b) => (t.fromTo(i, a, b), this.update()),
|
|
238
|
+
method: (f = () => ({})) => (f(i), this.update()),
|
|
239
|
+
async: (f = () => Promise.reject(i)) => f(i).then(() => this.update())
|
|
240
|
+
}), types.find(i => i.type(o)));
|
|
299
241
|
obj.length = 12;
|
|
300
242
|
obj[Symbol.iterator] = function Iterate() {
|
|
301
243
|
const values = Object.values(this);
|
|
@@ -369,18 +311,16 @@ class Component {
|
|
|
369
311
|
$el
|
|
370
312
|
} = this;
|
|
371
313
|
if (!this.__eventHandlers) return;
|
|
372
|
-
this.__eventHandlers.forEach(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
} = _ref;
|
|
314
|
+
this.__eventHandlers.forEach(({
|
|
315
|
+
eventName,
|
|
316
|
+
handler
|
|
317
|
+
}) => {
|
|
377
318
|
$el.on(eventNameToColonCase(eventName), handler);
|
|
378
319
|
});
|
|
379
|
-
this.__onceEventHandlers.forEach(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
} = _ref2;
|
|
320
|
+
this.__onceEventHandlers.forEach(({
|
|
321
|
+
eventName,
|
|
322
|
+
handler
|
|
323
|
+
}) => {
|
|
384
324
|
$el.once(eventNameToColonCase(eventName), handler);
|
|
385
325
|
});
|
|
386
326
|
}
|
|
@@ -389,18 +329,16 @@ class Component {
|
|
|
389
329
|
$el
|
|
390
330
|
} = this;
|
|
391
331
|
if (!this.__eventHandlers) return;
|
|
392
|
-
this.__eventHandlers.forEach(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
} = _ref3;
|
|
332
|
+
this.__eventHandlers.forEach(({
|
|
333
|
+
eventName,
|
|
334
|
+
handler
|
|
335
|
+
}) => {
|
|
397
336
|
$el.on(eventNameToColonCase(eventName), handler);
|
|
398
337
|
});
|
|
399
|
-
this.__onceEventHandlers.forEach(
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
} = _ref4;
|
|
338
|
+
this.__onceEventHandlers.forEach(({
|
|
339
|
+
eventName,
|
|
340
|
+
handler
|
|
341
|
+
}) => {
|
|
404
342
|
$el.once(eventNameToColonCase(eventName), handler);
|
|
405
343
|
});
|
|
406
344
|
}
|
|
@@ -503,10 +441,7 @@ class Component {
|
|
|
503
441
|
deleteProps(this);
|
|
504
442
|
this.__destroyed = true;
|
|
505
443
|
}
|
|
506
|
-
hook(name) {
|
|
507
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
508
|
-
args[_key - 1] = arguments[_key];
|
|
509
|
-
}
|
|
444
|
+
hook(name, ...args) {
|
|
510
445
|
if (this.__destroyed) return;
|
|
511
446
|
this[`__${name}`].forEach(handler => {
|
|
512
447
|
handler(...args);
|
|
@@ -25,13 +25,12 @@ export default {
|
|
|
25
25
|
parse(componentString) {
|
|
26
26
|
return parseComponent(componentString);
|
|
27
27
|
},
|
|
28
|
-
create(component, props,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref;
|
|
28
|
+
create(component, props, {
|
|
29
|
+
root,
|
|
30
|
+
el,
|
|
31
|
+
context,
|
|
32
|
+
children
|
|
33
|
+
}) {
|
|
35
34
|
return new Component(app, component, props, {
|
|
36
35
|
root,
|
|
37
36
|
el,
|
|
@@ -14,10 +14,7 @@ function handleEvent(event, args, vnode) {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
function createListener() {
|
|
17
|
-
return function handler(event) {
|
|
18
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
19
|
-
args[_key - 1] = arguments[_key];
|
|
20
|
-
}
|
|
17
|
+
return function handler(event, ...args) {
|
|
21
18
|
handleEvent(event, args, handler.vnode);
|
|
22
19
|
};
|
|
23
20
|
}
|
|
@@ -31,7 +31,6 @@ function calcTransformOrigin(isTextNode, textRect, boundingRect) {
|
|
|
31
31
|
}
|
|
32
32
|
return '0 0'; //top left
|
|
33
33
|
}
|
|
34
|
-
|
|
35
34
|
function getTextDx(oldTextRect, newTextRect) {
|
|
36
35
|
if (oldTextRect && newTextRect) {
|
|
37
36
|
return oldTextRect.left + oldTextRect.width / 2 - (newTextRect.left + newTextRect.width / 2);
|
|
@@ -19,7 +19,7 @@ function updateStyle(oldVnode, vnode) {
|
|
|
19
19
|
if (oldStyle === style) return;
|
|
20
20
|
oldStyle = oldStyle || {};
|
|
21
21
|
style = style || {};
|
|
22
|
-
var oldHasDel =
|
|
22
|
+
var oldHasDel = 'delayed' in oldStyle;
|
|
23
23
|
for (name in oldStyle) {
|
|
24
24
|
if (!style[name]) {
|
|
25
25
|
if (name[0] === '-' && name[1] === '-') {
|
|
@@ -15,28 +15,21 @@ const toCamelCase = name => {
|
|
|
15
15
|
return word[0].toUpperCase() + word.substr(1);
|
|
16
16
|
}).join('');
|
|
17
17
|
};
|
|
18
|
-
const propsFromAttrs =
|
|
18
|
+
const propsFromAttrs = (...args) => {
|
|
19
19
|
const context = {};
|
|
20
|
-
|
|
21
|
-
args[_key] = arguments[_key];
|
|
22
|
-
}
|
|
23
|
-
args.forEach(function (obj) {
|
|
24
|
-
if (obj === void 0) {
|
|
25
|
-
obj = {};
|
|
26
|
-
}
|
|
20
|
+
args.forEach((obj = {}) => {
|
|
27
21
|
Object.keys(obj).forEach(key => {
|
|
28
22
|
context[toCamelCase(key)] = obj[key];
|
|
29
23
|
});
|
|
30
24
|
});
|
|
31
25
|
return context;
|
|
32
26
|
};
|
|
33
|
-
const createCustomComponent =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref;
|
|
27
|
+
const createCustomComponent = ({
|
|
28
|
+
f7,
|
|
29
|
+
treeNode,
|
|
30
|
+
vnode,
|
|
31
|
+
data
|
|
32
|
+
}) => {
|
|
40
33
|
const component = typeof treeNode.type === 'function' ? treeNode.type : customComponents[treeNode.type];
|
|
41
34
|
f7.component.create(component, propsFromAttrs(data.attrs || {}, data.props || {}), {
|
|
42
35
|
el: vnode.elm,
|
|
@@ -78,7 +71,6 @@ const destroyCustomComponent = vnode => {
|
|
|
78
71
|
delete vnode.elm.__component__; // eslint-disable-line
|
|
79
72
|
}
|
|
80
73
|
};
|
|
81
|
-
|
|
82
74
|
const isCustomComponent = treeNodeType => {
|
|
83
75
|
return typeof treeNodeType === 'function' || treeNodeType && treeNodeType.indexOf('-') > 0 && customComponents[treeNodeType];
|
|
84
76
|
};
|
|
@@ -159,20 +151,19 @@ function getHooks(treeNode, data, f7, initial, isRoot) {
|
|
|
159
151
|
}
|
|
160
152
|
return hooks;
|
|
161
153
|
}
|
|
162
|
-
const getEventHandler =
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
} = _temp === void 0 ? {} : _temp;
|
|
154
|
+
const getEventHandler = (eventHandler, {
|
|
155
|
+
stop,
|
|
156
|
+
prevent,
|
|
157
|
+
once
|
|
158
|
+
} = {}) => {
|
|
168
159
|
let fired = false;
|
|
169
|
-
function handler() {
|
|
170
|
-
const e =
|
|
160
|
+
function handler(...args) {
|
|
161
|
+
const e = args[0];
|
|
171
162
|
if (once && fired) return;
|
|
172
163
|
if (stop) e.stopPropagation();
|
|
173
164
|
if (prevent) e.preventDefault();
|
|
174
165
|
fired = true;
|
|
175
|
-
eventHandler(...
|
|
166
|
+
eventHandler(...args);
|
|
176
167
|
}
|
|
177
168
|
return handler;
|
|
178
169
|
};
|
|
@@ -311,9 +302,6 @@ const treeNodeToVNode = (treeNode, component, f7, initial, isRoot) => {
|
|
|
311
302
|
const children = isCustomComponent(treeNode.type) ? [] : getChildren(treeNode, component, f7, initial);
|
|
312
303
|
return h(getTagName(treeNode), data, children);
|
|
313
304
|
};
|
|
314
|
-
export default function vdom(tree, component, initial) {
|
|
315
|
-
if (tree === void 0) {
|
|
316
|
-
tree = {};
|
|
317
|
-
}
|
|
305
|
+
export default function vdom(tree = {}, component, initial) {
|
|
318
306
|
return treeNodeToVNode(tree, component, component.f7, initial, true);
|
|
319
307
|
}
|
package/modules/router/back.js
CHANGED
|
@@ -22,7 +22,6 @@ function backward(router, el, backwardOptions) {
|
|
|
22
22
|
const isMaster = masterDetailEnabled && options.route && options.route.route && (options.route.route.master === true || typeof options.route.route.master === 'function' && options.route.route.master(app, router));
|
|
23
23
|
let masterPageEl;
|
|
24
24
|
let masterPageRemoved;
|
|
25
|
-
const dynamicNavbar = router.dynamicNavbar;
|
|
26
25
|
const $newPage = $el;
|
|
27
26
|
const $oldPage = router.$el.children('.page-current');
|
|
28
27
|
const initialPreload = $oldPage.length === 0 && options.preload;
|
|
@@ -31,18 +30,6 @@ function backward(router, el, backwardOptions) {
|
|
|
31
30
|
// Remove theme elements
|
|
32
31
|
router.removeThemeElements($newPage);
|
|
33
32
|
}
|
|
34
|
-
let $navbarsEl;
|
|
35
|
-
let $newNavbarEl;
|
|
36
|
-
let $oldNavbarEl;
|
|
37
|
-
if (dynamicNavbar) {
|
|
38
|
-
$newNavbarEl = $newPage.children('.navbar');
|
|
39
|
-
$navbarsEl = router.$navbarsEl;
|
|
40
|
-
if ($newNavbarEl.length === 0 && $newPage[0] && $newPage[0].f7Page) {
|
|
41
|
-
// Try from pageData
|
|
42
|
-
$newNavbarEl = $newPage[0].f7Page.$navbarEl;
|
|
43
|
-
}
|
|
44
|
-
$oldNavbarEl = $navbarsEl.find('.navbar-current');
|
|
45
|
-
}
|
|
46
33
|
router.allowPageChange = false;
|
|
47
34
|
if ($newPage.length === 0 || $oldPage.length === 0 && !options.preload) {
|
|
48
35
|
router.allowPageChange = true;
|
|
@@ -72,7 +59,6 @@ function backward(router, el, backwardOptions) {
|
|
|
72
59
|
continue; // eslint-disable-line
|
|
73
60
|
}
|
|
74
61
|
}
|
|
75
|
-
|
|
76
62
|
isDetail = !isMaster && masterPageEl && router.history.indexOf(options.route.url) > router.history.indexOf(masterPageEl.f7Page.route.url);
|
|
77
63
|
if (!isDetail && !isMaster && masterPageEl && masterPageEl.f7Page && options.route.route.masterRoute) {
|
|
78
64
|
isDetail = options.route.route.masterRoute.path === masterPageEl.f7Page.route.route.path;
|
|
@@ -98,19 +84,6 @@ function backward(router, el, backwardOptions) {
|
|
|
98
84
|
detailRoot: !!isDetailRoot
|
|
99
85
|
});
|
|
100
86
|
}
|
|
101
|
-
if (dynamicNavbar && $newNavbarEl.length > 0) {
|
|
102
|
-
$newNavbarEl.addClass(`navbar-${initialPreload ? 'current' : 'previous'}${isMaster ? ' navbar-master' : ''}${isDetail ? ' navbar-master-detail' : ''}${isDetailRoot ? ' navbar-master-detail-root' : ''}`).removeAttr('aria-hidden');
|
|
103
|
-
$newNavbarEl.trigger('navbar:position', {
|
|
104
|
-
position: initialPreload ? 'current' : 'previous'
|
|
105
|
-
});
|
|
106
|
-
router.emit('navbarPosition', $newNavbarEl[0], initialPreload ? 'current' : 'previous');
|
|
107
|
-
if (isMaster || isDetailRoot) {
|
|
108
|
-
router.emit('navbarRole', $newNavbarEl[0], {
|
|
109
|
-
role: isMaster ? 'master' : 'detail',
|
|
110
|
-
detailRoot: !!isDetailRoot
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
87
|
|
|
115
88
|
// Remove previous page in case of "forced"
|
|
116
89
|
let backIndex;
|
|
@@ -128,19 +101,12 @@ function backward(router, el, backwardOptions) {
|
|
|
128
101
|
router.propsHistory.unshift(options.props || {});
|
|
129
102
|
}
|
|
130
103
|
const $pageToRemove = $oldPage.prev('.page-previous');
|
|
131
|
-
let $navbarToRemove;
|
|
132
|
-
if (dynamicNavbar) {
|
|
133
|
-
$navbarToRemove = $(app.navbar.getElByPage($pageToRemove));
|
|
134
|
-
}
|
|
135
104
|
if ($pageToRemove.length > 0) {
|
|
136
|
-
router.pageCallback('beforeRemove', $pageToRemove,
|
|
105
|
+
router.pageCallback('beforeRemove', $pageToRemove, 'previous', undefined, options);
|
|
137
106
|
if ($pageToRemove[0] === masterPageEl) {
|
|
138
107
|
masterPageRemoved = true;
|
|
139
108
|
}
|
|
140
109
|
router.removePage($pageToRemove);
|
|
141
|
-
if (dynamicNavbar && $navbarToRemove.length) {
|
|
142
|
-
router.removeNavbar($navbarToRemove);
|
|
143
|
-
}
|
|
144
110
|
}
|
|
145
111
|
}
|
|
146
112
|
}
|
|
@@ -167,25 +133,11 @@ function backward(router, el, backwardOptions) {
|
|
|
167
133
|
$newPage.insertBefore($oldPage);
|
|
168
134
|
}
|
|
169
135
|
}
|
|
170
|
-
if (dynamicNavbar && $newNavbarEl.length) {
|
|
171
|
-
if ($newNavbarEl.find('.title-large').length) {
|
|
172
|
-
$newNavbarEl.addClass('navbar-large');
|
|
173
|
-
}
|
|
174
|
-
$newNavbarEl.insertBefore($oldNavbarEl);
|
|
175
|
-
if ($oldNavbarEl.length > 0) {
|
|
176
|
-
$newNavbarEl.insertBefore($oldNavbarEl);
|
|
177
|
-
} else {
|
|
178
|
-
if (!router.$navbarsEl.parents(document).length) {
|
|
179
|
-
router.$el.prepend(router.$navbarsEl);
|
|
180
|
-
}
|
|
181
|
-
$navbarsEl.append($newNavbarEl);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
136
|
if (!newPageInDom) {
|
|
185
|
-
router.pageCallback('mounted', $newPage,
|
|
137
|
+
router.pageCallback('mounted', $newPage, 'previous', 'current', options, $oldPage);
|
|
186
138
|
} else if (options.route && options.route.route && options.route.route.keepAlive && !$newPage[0].f7PageMounted) {
|
|
187
139
|
$newPage[0].f7PageMounted = true;
|
|
188
|
-
router.pageCallback('mounted', $newPage,
|
|
140
|
+
router.pageCallback('mounted', $newPage, 'previous', 'current', options, $oldPage);
|
|
189
141
|
}
|
|
190
142
|
}
|
|
191
143
|
if (options.preload) {
|
|
@@ -202,30 +154,19 @@ function backward(router, el, backwardOptions) {
|
|
|
202
154
|
if (isMaster) {
|
|
203
155
|
$newPage.removeClass('page-master-stacked').trigger('page:masterunstack');
|
|
204
156
|
router.emit('pageMasterUnstack', $newPage[0]);
|
|
205
|
-
if (dynamicNavbar) {
|
|
206
|
-
$(app.navbar.getElByPage($newPage)).removeClass('navbar-master-stacked');
|
|
207
|
-
router.emit('navbarMasterUnstack', app.navbar.getElByPage($newPage));
|
|
208
|
-
}
|
|
209
157
|
}
|
|
210
158
|
// Page init and before init events
|
|
211
|
-
router.pageCallback('init', $newPage,
|
|
159
|
+
router.pageCallback('init', $newPage, 'previous', 'current', options, $oldPage);
|
|
212
160
|
if (initialPreload) {
|
|
213
|
-
router.pageCallback('beforeIn', $newPage,
|
|
214
|
-
router.pageCallback('afterIn', $newPage,
|
|
161
|
+
router.pageCallback('beforeIn', $newPage, 'current', undefined, options);
|
|
162
|
+
router.pageCallback('afterIn', $newPage, 'current', undefined, options);
|
|
215
163
|
}
|
|
216
164
|
const $previousPages = $newPage.prevAll('.page-previous:not(.page-master)');
|
|
217
165
|
if ($previousPages.length > 0) {
|
|
218
166
|
$previousPages.each(pageToRemove => {
|
|
219
167
|
const $pageToRemove = $(pageToRemove);
|
|
220
|
-
|
|
221
|
-
if (dynamicNavbar) {
|
|
222
|
-
$navbarToRemove = $(app.navbar.getElByPage($pageToRemove));
|
|
223
|
-
}
|
|
224
|
-
router.pageCallback('beforeRemove', $pageToRemove, $navbarToRemove, 'previous', undefined);
|
|
168
|
+
router.pageCallback('beforeRemove', $pageToRemove, 'previous', undefined);
|
|
225
169
|
router.removePage($pageToRemove);
|
|
226
|
-
if (dynamicNavbar && $navbarToRemove.length) {
|
|
227
|
-
router.removeNavbar($navbarToRemove);
|
|
228
|
-
}
|
|
229
170
|
});
|
|
230
171
|
}
|
|
231
172
|
router.allowPageChange = true;
|
|
@@ -262,13 +203,8 @@ function backward(router, el, backwardOptions) {
|
|
|
262
203
|
}
|
|
263
204
|
router.saveHistory();
|
|
264
205
|
|
|
265
|
-
// Current Page
|
|
206
|
+
// Current Page
|
|
266
207
|
router.currentPageEl = $newPage[0];
|
|
267
|
-
if (dynamicNavbar && $newNavbarEl.length) {
|
|
268
|
-
router.currentNavbarEl = $newNavbarEl[0];
|
|
269
|
-
} else {
|
|
270
|
-
delete router.currentNavbarEl;
|
|
271
|
-
}
|
|
272
208
|
|
|
273
209
|
// Current Route
|
|
274
210
|
router.currentRoute = options.route;
|
|
@@ -307,33 +243,26 @@ function backward(router, el, backwardOptions) {
|
|
|
307
243
|
}
|
|
308
244
|
|
|
309
245
|
// Page init and before init events
|
|
310
|
-
router.pageCallback('init', $newPage,
|
|
246
|
+
router.pageCallback('init', $newPage, 'previous', 'current', options, $oldPage);
|
|
311
247
|
|
|
312
248
|
// Before animation callback
|
|
313
|
-
router.pageCallback('beforeOut', $oldPage,
|
|
314
|
-
router.pageCallback('beforeIn', $newPage,
|
|
249
|
+
router.pageCallback('beforeOut', $oldPage, 'current', 'next', options);
|
|
250
|
+
router.pageCallback('beforeIn', $newPage, 'previous', 'current', options);
|
|
315
251
|
|
|
316
252
|
// Animation
|
|
317
253
|
function afterAnimation() {
|
|
318
254
|
// Set classes
|
|
319
255
|
router.setPagePosition($newPage, 'current', false);
|
|
320
256
|
router.setPagePosition($oldPage, 'next', true);
|
|
321
|
-
if (dynamicNavbar) {
|
|
322
|
-
router.setNavbarPosition($newNavbarEl, 'current', false);
|
|
323
|
-
router.setNavbarPosition($oldNavbarEl, 'next', true);
|
|
324
|
-
}
|
|
325
257
|
|
|
326
258
|
// After animation event
|
|
327
|
-
router.pageCallback('afterOut', $oldPage,
|
|
328
|
-
router.pageCallback('afterIn', $newPage,
|
|
259
|
+
router.pageCallback('afterOut', $oldPage, 'current', 'next', options);
|
|
260
|
+
router.pageCallback('afterIn', $newPage, 'previous', 'current', options);
|
|
329
261
|
|
|
330
262
|
// Remove Old Page
|
|
331
263
|
|
|
332
|
-
router.pageCallback('beforeRemove', $oldPage,
|
|
264
|
+
router.pageCallback('beforeRemove', $oldPage, 'next', undefined, options);
|
|
333
265
|
router.removePage($oldPage);
|
|
334
|
-
if (dynamicNavbar && $oldNavbarEl.length) {
|
|
335
|
-
router.removeNavbar($oldNavbarEl);
|
|
336
|
-
}
|
|
337
266
|
router.allowPageChange = true;
|
|
338
267
|
router.emit('routeChanged', router.currentRoute, router.previousRoute, router);
|
|
339
268
|
|
|
@@ -352,10 +281,6 @@ function backward(router, el, backwardOptions) {
|
|
|
352
281
|
function setPositionClasses() {
|
|
353
282
|
router.setPagePosition($oldPage, 'current');
|
|
354
283
|
router.setPagePosition($newPage, 'previous', false);
|
|
355
|
-
if (dynamicNavbar) {
|
|
356
|
-
router.setNavbarPosition($oldNavbarEl, 'current');
|
|
357
|
-
router.setNavbarPosition($newNavbarEl, 'previous', false);
|
|
358
|
-
}
|
|
359
284
|
}
|
|
360
285
|
if (options.animate && !(currentIsMaster && app.width >= router.params.masterDetailBreakpoint)) {
|
|
361
286
|
let transition = router.params.transition;
|
|
@@ -371,7 +296,7 @@ function backward(router, el, backwardOptions) {
|
|
|
371
296
|
transition = router.previousRoute.route.options.transition;
|
|
372
297
|
}
|
|
373
298
|
setPositionClasses();
|
|
374
|
-
router.animate($oldPage, $newPage,
|
|
299
|
+
router.animate($oldPage, $newPage, 'backward', transition, () => {
|
|
375
300
|
afterAnimation();
|
|
376
301
|
});
|
|
377
302
|
} else {
|
|
@@ -429,7 +354,8 @@ function loadBack(router, backParams, backOptions, ignorePageChange) {
|
|
|
429
354
|
componentUrl,
|
|
430
355
|
options,
|
|
431
356
|
resolve,
|
|
432
|
-
reject
|
|
357
|
+
reject,
|
|
358
|
+
direction: 'backward'
|
|
433
359
|
});
|
|
434
360
|
} catch (err) {
|
|
435
361
|
router.allowPageChange = true;
|
|
@@ -449,7 +375,7 @@ function loadBack(router, backParams, backOptions, ignorePageChange) {
|
|
|
449
375
|
}
|
|
450
376
|
return router;
|
|
451
377
|
}
|
|
452
|
-
function back() {
|
|
378
|
+
function back(...args) {
|
|
453
379
|
const router = this;
|
|
454
380
|
const device = getDevice();
|
|
455
381
|
if (router.swipeBackActive) return router;
|
|
@@ -457,11 +383,11 @@ function back() {
|
|
|
457
383
|
let navigateOptions;
|
|
458
384
|
let navigateProps;
|
|
459
385
|
let route;
|
|
460
|
-
if (typeof
|
|
461
|
-
navigateOptions =
|
|
386
|
+
if (typeof args[0] === 'object') {
|
|
387
|
+
navigateOptions = args[0] || {};
|
|
462
388
|
} else {
|
|
463
|
-
navigateUrl =
|
|
464
|
-
navigateOptions =
|
|
389
|
+
navigateUrl = args[0];
|
|
390
|
+
navigateOptions = args[1] || {};
|
|
465
391
|
}
|
|
466
392
|
const {
|
|
467
393
|
name,
|