framework7 7.0.0-beta.7 → 7.0.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.lazy.js +1 -1
- package/components/actions/actions-class.js +6 -1
- package/components/actions/actions-rtl.css +1 -1
- package/components/actions/actions.css +1 -1
- package/components/actions/actions.d.ts +2 -0
- package/components/actions/actions.js +11 -2
- package/components/actions/actions.lazy.js +1 -1
- package/components/actions/actions.less +3 -0
- package/components/app/app-class.js +15 -9
- package/components/area-chart/area-chart-class.js +34 -18
- package/components/area-chart/area-chart.lazy.js +1 -1
- package/components/autocomplete/autocomplete-class.js +5 -1
- package/components/autocomplete/autocomplete.lazy.js +1 -1
- package/components/breadcrumbs/breadcrumbs-aurora.less +2 -0
- package/components/breadcrumbs/breadcrumbs-ios.less +2 -0
- package/components/breadcrumbs/breadcrumbs-md.less +2 -0
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -0
- package/components/breadcrumbs/breadcrumbs-vars.less +36 -0
- package/components/breadcrumbs/breadcrumbs.css +1 -0
- package/components/breadcrumbs/breadcrumbs.d.ts +15 -0
- package/components/breadcrumbs/breadcrumbs.js +13 -0
- package/components/breadcrumbs/breadcrumbs.lazy.js +1 -0
- package/components/breadcrumbs/breadcrumbs.less +100 -0
- package/components/calendar/calendar-class.js +216 -124
- package/components/calendar/calendar-rtl.css +1 -1
- package/components/calendar/calendar-vars.less +6 -10
- package/components/calendar/calendar.css +1 -1
- package/components/calendar/calendar.d.ts +2 -0
- package/components/calendar/calendar.js +6 -1
- package/components/calendar/calendar.lazy.js +1 -1
- package/components/calendar/calendar.less +21 -16
- package/components/card/card.js +23 -3
- package/components/card/card.lazy.js +1 -1
- package/components/color-picker/color-picker-class.js +19 -3
- package/components/color-picker/color-picker.js +5 -1
- package/components/color-picker/color-picker.lazy.js +1 -1
- package/components/data-table/data-table-class.js +5 -1
- package/components/data-table/data-table.lazy.js +1 -1
- package/components/dialog/dialog.js +30 -6
- package/components/dialog/dialog.lazy.js +1 -1
- package/components/fab/fab-rtl.css +1 -1
- package/components/fab/fab.css +1 -1
- package/components/fab/fab.js +15 -3
- package/components/fab/fab.lazy.js +1 -1
- package/components/form/form.lazy.js +1 -1
- package/components/gauge/gauge-class.js +10 -2
- package/components/gauge/gauge.d.ts +2 -2
- package/components/gauge/gauge.lazy.js +1 -1
- package/components/input/input.js +5 -1
- package/components/input/input.lazy.js +1 -1
- package/components/list-index/list-index-class.js +5 -1
- package/components/list-index/list-index.d.ts +1 -1
- package/components/list-index/list-index.lazy.js +1 -1
- package/components/login-screen/login-screen.js +10 -2
- package/components/login-screen/login-screen.lazy.js +1 -1
- package/components/menu/menu.js +10 -2
- package/components/menu/menu.lazy.js +1 -1
- package/components/messagebar/messagebar-class.js +25 -5
- package/components/messagebar/messagebar.lazy.js +1 -1
- package/components/messages/messages-class.js +60 -24
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages.css +1 -1
- package/components/messages/messages.lazy.js +1 -1
- package/components/modal/modal-class.js +10 -0
- package/components/navbar/navbar.js +26 -2
- package/components/notification/notification.d.ts +4 -4
- package/components/panel/panel-class.js +35 -7
- package/components/panel/panel.js +40 -8
- package/components/panel/panel.lazy.js +1 -1
- package/components/photo-browser/photo-browser-class.js +42 -8
- package/components/photo-browser/photo-browser.lazy.js +1 -1
- package/components/picker/picker-class.js +11 -7
- package/components/picker/picker-column.js +34 -270
- package/components/picker/picker-rtl.css +1 -1
- package/components/picker/picker.css +1 -1
- package/components/picker/picker.d.ts +2 -13
- package/components/picker/picker.js +5 -6
- package/components/picker/picker.lazy.js +1 -1
- package/components/picker/picker.less +28 -10
- package/components/pie-chart/pie-chart-class.js +16 -7
- package/components/pie-chart/pie-chart.lazy.js +1 -1
- package/components/popover/popover-class.js +20 -3
- package/components/popover/popover-rtl.css +1 -1
- package/components/popover/popover.css +1 -1
- package/components/popover/popover.d.ts +2 -0
- package/components/popover/popover.js +11 -2
- package/components/popover/popover.lazy.js +1 -1
- package/components/popover/popover.less +3 -0
- package/components/popup/popup-class.js +6 -1
- package/components/popup/popup-rtl.css +1 -1
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.d.ts +4 -0
- package/components/popup/popup.js +11 -2
- package/components/popup/popup.lazy.js +1 -1
- package/components/popup/popup.less +4 -0
- package/components/preloader/preloader-ios.less +3 -0
- package/components/preloader/preloader-rtl.css +1 -1
- package/components/preloader/preloader.css +1 -1
- package/components/preloader/preloader.d.ts +4 -0
- package/components/preloader/preloader.js +10 -2
- package/components/preloader/preloader.lazy.js +1 -1
- package/components/progressbar/progressbar-aurora.less +32 -13
- package/components/progressbar/progressbar-ios.less +19 -7
- package/components/progressbar/progressbar-md.less +64 -28
- package/components/progressbar/progressbar-rtl.css +1 -1
- package/components/progressbar/progressbar.css +1 -1
- package/components/progressbar/progressbar.js +17 -4
- package/components/progressbar/progressbar.lazy.js +1 -1
- package/components/progressbar/progressbar.less +16 -4
- package/components/pull-to-refresh/pull-to-refresh-class.js +5 -1
- package/components/pull-to-refresh/pull-to-refresh.lazy.js +1 -1
- package/components/range/range.d.ts +23 -5
- package/components/range/range.js +10 -2
- package/components/range/range.lazy.js +1 -1
- package/components/searchbar/searchbar-class.js +6 -2
- package/components/searchbar/searchbar.js +20 -4
- package/components/searchbar/searchbar.lazy.js +1 -1
- package/components/sheet/sheet-class.js +21 -2
- package/components/sheet/sheet-rtl.css +1 -1
- package/components/sheet/sheet.css +1 -1
- package/components/sheet/sheet.d.ts +2 -0
- package/components/sheet/sheet.js +11 -2
- package/components/sheet/sheet.lazy.js +1 -1
- package/components/sheet/sheet.less +3 -0
- package/components/smart-select/smart-select-class.js +15 -3
- package/components/smart-select/smart-select.lazy.js +1 -1
- package/components/sortable/sortable.d.ts +5 -1
- package/components/sortable/sortable.js +45 -8
- package/components/sortable/sortable.lazy.js +1 -1
- package/components/statusbar/statusbar.d.ts +9 -9
- package/components/statusbar/statusbar.js +5 -1
- package/components/stepper/stepper.js +10 -2
- package/components/stepper/stepper.lazy.js +1 -1
- package/components/swipeout/swipeout.js +16 -3
- package/components/swipeout/swipeout.lazy.js +1 -1
- package/components/swiper/swiper-rtl.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/swiper/swiper.lazy.js +1 -1
- package/components/tabs/tabs.js +14 -7
- package/components/tabs/tabs.lazy.js +1 -1
- package/components/toast/toast.d.ts +2 -2
- package/components/toggle/toggle-class.js +5 -1
- package/components/toggle/toggle.lazy.js +1 -1
- package/components/toolbar/toolbar-aurora.less +0 -13
- package/components/toolbar/toolbar-md.less +0 -13
- package/components/toolbar/toolbar.js +11 -3
- package/components/toolbar/toolbar.less +13 -0
- package/components/tooltip/tooltip-class.js +5 -1
- package/components/tooltip/tooltip.lazy.js +1 -1
- package/components/touch-ripple/touch-ripple.js +5 -1
- package/components/treeview/treeview.lazy.js +1 -1
- package/components/view/view-class.js +13 -2
- package/components/view/view.d.ts +5 -1
- package/components/view/view.js +2 -0
- package/components/virtual-list/virtual-list-class.js +54 -9
- package/components/virtual-list/virtual-list.d.ts +2 -2
- package/components/virtual-list/virtual-list.lazy.js +1 -1
- package/framework7-bundle-rtl.css +253 -150
- package/framework7-bundle-rtl.min.css +4 -4
- package/framework7-bundle.css +238 -134
- package/framework7-bundle.esm.js +5 -4
- package/framework7-bundle.js +2663 -1190
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +4 -3
- package/framework7-bundle.min.css +4 -4
- 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 +3 -3
- package/framework7-rtl.css +12 -21
- package/framework7-rtl.min.css +4 -4
- package/framework7-types.d.ts +5 -1
- package/framework7.css +11 -19
- package/framework7.d.ts +4 -0
- package/framework7.esm.js +3 -3
- package/framework7.js +609 -189
- package/framework7.js.map +1 -1
- package/framework7.less +3 -3
- package/framework7.min.css +4 -4
- package/framework7.min.js +4 -4
- package/framework7.min.js.map +1 -1
- package/modules/component/$h.js +5 -1
- package/modules/component/$jsx.js +5 -1
- package/modules/component/component-class.js +35 -22
- package/modules/component/component.d.ts +2 -2
- package/modules/component/component.js +7 -6
- package/modules/component/eventslisteners.js +5 -1
- package/modules/component/snabbdom/h.js +1 -1
- package/modules/component/vdom.js +32 -17
- package/modules/device/device.js +1 -1
- package/modules/router/back.js +16 -6
- package/modules/router/component-loader.js +34 -23
- package/modules/router/modal.js +5 -1
- package/modules/router/navigate.js +19 -3
- package/modules/router/redirect.js +5 -1
- package/modules/router/router-class.js +39 -10
- package/modules/router/swipe-back.js +7 -6
- package/modules/router/tab.js +6 -2
- package/modules/store/create-store.js +10 -2
- package/package.json +12 -6
- package/shared/$jsx.js +6 -1
- package/shared/class.js +33 -5
- package/shared/constructor-methods.js +25 -4
- package/shared/events-class.js +15 -3
- package/shared/get-device.d.ts +0 -2
- package/shared/get-device.js +10 -6
- package/shared/modal-methods.js +10 -2
- package/shared/request.js +45 -7
- package/shared/utils.js +47 -10
package/modules/component/$h.js
CHANGED
|
@@ -2,7 +2,11 @@ import htm from 'htm';
|
|
|
2
2
|
import { flattenArray } from '../../shared/utils.js';
|
|
3
3
|
const ignoreChildren = [false, null, '', undefined];
|
|
4
4
|
|
|
5
|
-
const h = (type, props
|
|
5
|
+
const h = function (type, props) {
|
|
6
|
+
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
7
|
+
children[_key - 2] = arguments[_key];
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
return {
|
|
7
11
|
type,
|
|
8
12
|
props: props || {},
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { flattenArray } from '../../shared/utils.js';
|
|
2
2
|
const ignoreChildren = [false, null, '', undefined];
|
|
3
3
|
|
|
4
|
-
const $jsx = (type, props
|
|
4
|
+
const $jsx = function (type, props) {
|
|
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
|
+
}
|
|
8
|
+
|
|
5
9
|
const flatChildren = flattenArray((children || []).filter(child => ignoreChildren.indexOf(child) < 0));
|
|
6
10
|
|
|
7
11
|
if (type === 'Fragment') {
|
|
@@ -7,11 +7,16 @@ import vdom from './vdom.js';
|
|
|
7
7
|
import patch from './patch.js';
|
|
8
8
|
|
|
9
9
|
class Component {
|
|
10
|
-
constructor(app, component, props
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
constructor(app, component, props, _temp) {
|
|
11
|
+
if (props === void 0) {
|
|
12
|
+
props = {};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
el,
|
|
17
|
+
context,
|
|
18
|
+
children
|
|
19
|
+
} = _temp === void 0 ? {} : _temp;
|
|
15
20
|
const document = getDocument();
|
|
16
21
|
merge(this, {
|
|
17
22
|
f7: app,
|
|
@@ -219,17 +224,19 @@ class Component {
|
|
|
219
224
|
} = this;
|
|
220
225
|
if (!this.__eventHandlers) return;
|
|
221
226
|
|
|
222
|
-
this.__eventHandlers.forEach(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
227
|
+
this.__eventHandlers.forEach(_ref => {
|
|
228
|
+
let {
|
|
229
|
+
eventName,
|
|
230
|
+
handler
|
|
231
|
+
} = _ref;
|
|
226
232
|
$el.on(eventNameToColonCase(eventName), handler);
|
|
227
233
|
});
|
|
228
234
|
|
|
229
|
-
this.__onceEventHandlers.forEach(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
235
|
+
this.__onceEventHandlers.forEach(_ref2 => {
|
|
236
|
+
let {
|
|
237
|
+
eventName,
|
|
238
|
+
handler
|
|
239
|
+
} = _ref2;
|
|
233
240
|
$el.once(eventNameToColonCase(eventName), handler);
|
|
234
241
|
});
|
|
235
242
|
}
|
|
@@ -240,17 +247,19 @@ class Component {
|
|
|
240
247
|
} = this;
|
|
241
248
|
if (!this.__eventHandlers) return;
|
|
242
249
|
|
|
243
|
-
this.__eventHandlers.forEach(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
250
|
+
this.__eventHandlers.forEach(_ref3 => {
|
|
251
|
+
let {
|
|
252
|
+
eventName,
|
|
253
|
+
handler
|
|
254
|
+
} = _ref3;
|
|
247
255
|
$el.on(eventNameToColonCase(eventName), handler);
|
|
248
256
|
});
|
|
249
257
|
|
|
250
|
-
this.__onceEventHandlers.forEach(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
258
|
+
this.__onceEventHandlers.forEach(_ref4 => {
|
|
259
|
+
let {
|
|
260
|
+
eventName,
|
|
261
|
+
handler
|
|
262
|
+
} = _ref4;
|
|
254
263
|
$el.once(eventNameToColonCase(eventName), handler);
|
|
255
264
|
});
|
|
256
265
|
}
|
|
@@ -370,7 +379,11 @@ class Component {
|
|
|
370
379
|
this.__destroyed = true;
|
|
371
380
|
}
|
|
372
381
|
|
|
373
|
-
hook(name
|
|
382
|
+
hook(name) {
|
|
383
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
384
|
+
args[_key - 1] = arguments[_key];
|
|
385
|
+
}
|
|
386
|
+
|
|
374
387
|
if (this.__destroyed) return;
|
|
375
388
|
this[`__${name}`].forEach(handler => {
|
|
376
389
|
handler(...args);
|
|
@@ -46,9 +46,9 @@ export interface ComponentContext {
|
|
|
46
46
|
/** Render function */
|
|
47
47
|
$render: ComponentRender;
|
|
48
48
|
/** Attach event handler to component root DOM element */
|
|
49
|
-
$on: (eventName, handler: () => void) => void;
|
|
49
|
+
$on: (eventName: string, handler: () => void) => void;
|
|
50
50
|
/** Attach event handler to component root DOM element that will be executed only once */
|
|
51
|
-
$once: (eventName, handler: () => void) => void;
|
|
51
|
+
$once: (eventName: string, handler: () => void) => void;
|
|
52
52
|
/** Hook called right before component will be added to DOM */
|
|
53
53
|
$onBeforeMount: (callback: () => void) => void;
|
|
54
54
|
/** Hook called right after component has been added to DOM */
|
|
@@ -30,12 +30,13 @@ export default {
|
|
|
30
30
|
return parseComponent(componentString);
|
|
31
31
|
},
|
|
32
32
|
|
|
33
|
-
create(component, props, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
create(component, props, _ref) {
|
|
34
|
+
let {
|
|
35
|
+
root,
|
|
36
|
+
el,
|
|
37
|
+
context,
|
|
38
|
+
children
|
|
39
|
+
} = _ref;
|
|
39
40
|
return new Component(app, component, props, {
|
|
40
41
|
root,
|
|
41
42
|
el,
|
|
@@ -17,7 +17,11 @@ function handleEvent(event, args, vnode) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function createListener() {
|
|
20
|
-
return function handler(event
|
|
20
|
+
return function handler(event) {
|
|
21
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
22
|
+
args[_key - 1] = arguments[_key];
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
handleEvent(event, args, handler.vnode);
|
|
22
26
|
};
|
|
23
27
|
}
|
|
@@ -19,9 +19,18 @@ const toCamelCase = name => {
|
|
|
19
19
|
}).join('');
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const propsFromAttrs = (
|
|
22
|
+
const propsFromAttrs = function () {
|
|
23
23
|
const context = {};
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
args.forEach(function (obj) {
|
|
30
|
+
if (obj === void 0) {
|
|
31
|
+
obj = {};
|
|
32
|
+
}
|
|
33
|
+
|
|
25
34
|
Object.keys(obj).forEach(key => {
|
|
26
35
|
context[toCamelCase(key)] = obj[key];
|
|
27
36
|
});
|
|
@@ -29,12 +38,13 @@ const propsFromAttrs = (...args) => {
|
|
|
29
38
|
return context;
|
|
30
39
|
};
|
|
31
40
|
|
|
32
|
-
const createCustomComponent =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
const createCustomComponent = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
f7,
|
|
44
|
+
treeNode,
|
|
45
|
+
vnode,
|
|
46
|
+
data
|
|
47
|
+
} = _ref;
|
|
38
48
|
const component = typeof treeNode.type === 'function' ? treeNode.type : customComponents[treeNode.type];
|
|
39
49
|
f7.component.create(component, propsFromAttrs(data.attrs || {}, data.props || {}), {
|
|
40
50
|
el: vnode.elm,
|
|
@@ -178,20 +188,21 @@ function getHooks(treeNode, data, f7, initial, isRoot) {
|
|
|
178
188
|
return hooks;
|
|
179
189
|
}
|
|
180
190
|
|
|
181
|
-
const getEventHandler = (eventHandler, {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
const getEventHandler = function (eventHandler, _temp) {
|
|
192
|
+
let {
|
|
193
|
+
stop,
|
|
194
|
+
prevent,
|
|
195
|
+
once
|
|
196
|
+
} = _temp === void 0 ? {} : _temp;
|
|
186
197
|
let fired = false;
|
|
187
198
|
|
|
188
|
-
function handler(
|
|
189
|
-
const e =
|
|
199
|
+
function handler() {
|
|
200
|
+
const e = arguments.length <= 0 ? undefined : arguments[0];
|
|
190
201
|
if (once && fired) return;
|
|
191
202
|
if (stop) e.stopPropagation();
|
|
192
203
|
if (prevent) e.preventDefault();
|
|
193
204
|
fired = true;
|
|
194
|
-
eventHandler(...
|
|
205
|
+
eventHandler(...arguments);
|
|
195
206
|
}
|
|
196
207
|
|
|
197
208
|
return handler;
|
|
@@ -357,6 +368,10 @@ const treeNodeToVNode = (treeNode, component, f7, initial, isRoot) => {
|
|
|
357
368
|
return h(getTagName(treeNode), data, children);
|
|
358
369
|
};
|
|
359
370
|
|
|
360
|
-
export default function vdom(tree
|
|
371
|
+
export default function vdom(tree, component, initial) {
|
|
372
|
+
if (tree === void 0) {
|
|
373
|
+
tree = {};
|
|
374
|
+
}
|
|
375
|
+
|
|
361
376
|
return treeNodeToVNode(tree, component, component.f7, initial, true);
|
|
362
377
|
}
|
package/modules/device/device.js
CHANGED
package/modules/router/back.js
CHANGED
|
@@ -14,7 +14,7 @@ function backward(router, el, backwardOptions) {
|
|
|
14
14
|
const $el = $(el);
|
|
15
15
|
const app = router.app;
|
|
16
16
|
const view = router.view;
|
|
17
|
-
const options = extend({
|
|
17
|
+
const options = extend(false, {
|
|
18
18
|
animate: router.params.animate,
|
|
19
19
|
browserHistory: true,
|
|
20
20
|
replaceState: false
|
|
@@ -558,7 +558,7 @@ function loadBack(router, backParams, backOptions, ignorePageChange) {
|
|
|
558
558
|
return router;
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
-
function back(
|
|
561
|
+
function back() {
|
|
562
562
|
const router = this;
|
|
563
563
|
const device = getDevice();
|
|
564
564
|
if (router.swipeBackActive) return router;
|
|
@@ -566,11 +566,11 @@ function back(...args) {
|
|
|
566
566
|
let navigateOptions;
|
|
567
567
|
let route;
|
|
568
568
|
|
|
569
|
-
if (typeof
|
|
570
|
-
navigateOptions =
|
|
569
|
+
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'object') {
|
|
570
|
+
navigateOptions = (arguments.length <= 0 ? undefined : arguments[0]) || {};
|
|
571
571
|
} else {
|
|
572
|
-
navigateUrl =
|
|
573
|
-
navigateOptions =
|
|
572
|
+
navigateUrl = arguments.length <= 0 ? undefined : arguments[0];
|
|
573
|
+
navigateOptions = (arguments.length <= 1 ? undefined : arguments[1]) || {};
|
|
574
574
|
}
|
|
575
575
|
|
|
576
576
|
const {
|
|
@@ -722,6 +722,16 @@ function back(...args) {
|
|
|
722
722
|
}
|
|
723
723
|
|
|
724
724
|
const previousPageRoute = $previousPage[0].f7Page.route;
|
|
725
|
+
|
|
726
|
+
if (navigateOptions.preload && $previousPage.hasClass('stacked')) {
|
|
727
|
+
loadBack(router, {
|
|
728
|
+
el: $previousPage
|
|
729
|
+
}, extend(navigateOptions, {
|
|
730
|
+
route: previousPageRoute
|
|
731
|
+
}));
|
|
732
|
+
return router;
|
|
733
|
+
}
|
|
734
|
+
|
|
725
735
|
processRouteQueue.call(router, previousPageRoute, router.currentRoute, () => {
|
|
726
736
|
loadBack(router, {
|
|
727
737
|
el: $previousPage
|
|
@@ -48,7 +48,11 @@ export default {
|
|
|
48
48
|
return router.navigate(navigateOptions);
|
|
49
49
|
},
|
|
50
50
|
|
|
51
|
-
componentLoader(component, componentUrl, options
|
|
51
|
+
componentLoader(component, componentUrl, options, resolve, reject) {
|
|
52
|
+
if (options === void 0) {
|
|
53
|
+
options = {};
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
const router = this;
|
|
53
57
|
const {
|
|
54
58
|
app
|
|
@@ -131,41 +135,48 @@ export default {
|
|
|
131
135
|
}
|
|
132
136
|
},
|
|
133
137
|
|
|
134
|
-
modalComponentLoader({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
modalComponentLoader(_temp) {
|
|
139
|
+
let {
|
|
140
|
+
component,
|
|
141
|
+
componentUrl,
|
|
142
|
+
options,
|
|
143
|
+
resolve,
|
|
144
|
+
reject
|
|
145
|
+
} = _temp === void 0 ? {} : _temp;
|
|
141
146
|
const router = this;
|
|
142
147
|
router.componentLoader(component, componentUrl, options, el => {
|
|
143
148
|
resolve(el);
|
|
144
149
|
}, reject);
|
|
145
150
|
},
|
|
146
151
|
|
|
147
|
-
tabComponentLoader({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
tabComponentLoader(_temp2) {
|
|
153
|
+
let {
|
|
154
|
+
component,
|
|
155
|
+
componentUrl,
|
|
156
|
+
options,
|
|
157
|
+
resolve,
|
|
158
|
+
reject
|
|
159
|
+
} = _temp2 === void 0 ? {} : _temp2;
|
|
154
160
|
const router = this;
|
|
155
161
|
router.componentLoader(component, componentUrl, options, el => {
|
|
156
162
|
resolve(el);
|
|
157
163
|
}, reject);
|
|
158
164
|
},
|
|
159
165
|
|
|
160
|
-
pageComponentLoader({
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
pageComponentLoader(_temp3) {
|
|
167
|
+
let {
|
|
168
|
+
component,
|
|
169
|
+
componentUrl,
|
|
170
|
+
options,
|
|
171
|
+
resolve,
|
|
172
|
+
reject
|
|
173
|
+
} = _temp3 === void 0 ? {} : _temp3;
|
|
167
174
|
const router = this;
|
|
168
|
-
router.componentLoader(component, componentUrl, options, (el, newOptions
|
|
175
|
+
router.componentLoader(component, componentUrl, options, function (el, newOptions) {
|
|
176
|
+
if (newOptions === void 0) {
|
|
177
|
+
newOptions = {};
|
|
178
|
+
}
|
|
179
|
+
|
|
169
180
|
resolve(el, newOptions);
|
|
170
181
|
}, reject);
|
|
171
182
|
}
|
package/modules/router/modal.js
CHANGED
|
@@ -2,7 +2,11 @@ import { extend, nextTick } from '../../shared/utils.js';
|
|
|
2
2
|
import History from '../../shared/history.js';
|
|
3
3
|
import asyncComponent from './async-component.js';
|
|
4
4
|
|
|
5
|
-
function modalLoad(modalType, route, loadOptions
|
|
5
|
+
function modalLoad(modalType, route, loadOptions, direction) {
|
|
6
|
+
if (loadOptions === void 0) {
|
|
7
|
+
loadOptions = {};
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
const router = this;
|
|
7
11
|
const app = router.app;
|
|
8
12
|
const isPanel = modalType === 'panel';
|
|
@@ -16,7 +16,11 @@ function refreshPage() {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function forward(router, el, forwardOptions
|
|
19
|
+
function forward(router, el, forwardOptions) {
|
|
20
|
+
if (forwardOptions === void 0) {
|
|
21
|
+
forwardOptions = {};
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
const document = getDocument();
|
|
21
25
|
const $el = $(el);
|
|
22
26
|
const app = router.app;
|
|
@@ -615,7 +619,15 @@ function forward(router, el, forwardOptions = {}) {
|
|
|
615
619
|
return router;
|
|
616
620
|
}
|
|
617
621
|
|
|
618
|
-
function load(router, loadParams
|
|
622
|
+
function load(router, loadParams, loadOptions, ignorePageChange) {
|
|
623
|
+
if (loadParams === void 0) {
|
|
624
|
+
loadParams = {};
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (loadOptions === void 0) {
|
|
628
|
+
loadOptions = {};
|
|
629
|
+
}
|
|
630
|
+
|
|
619
631
|
if (!router.allowPageChange && !ignorePageChange) return router;
|
|
620
632
|
const params = loadParams;
|
|
621
633
|
const options = loadOptions;
|
|
@@ -730,7 +742,11 @@ function load(router, loadParams = {}, loadOptions = {}, ignorePageChange) {
|
|
|
730
742
|
return router;
|
|
731
743
|
}
|
|
732
744
|
|
|
733
|
-
function navigate(navigateParams, navigateOptions
|
|
745
|
+
function navigate(navigateParams, navigateOptions) {
|
|
746
|
+
if (navigateOptions === void 0) {
|
|
747
|
+
navigateOptions = {};
|
|
748
|
+
}
|
|
749
|
+
|
|
734
750
|
const router = this;
|
|
735
751
|
if (router.swipeBackActive) return router;
|
|
736
752
|
let url;
|
|
@@ -10,7 +10,11 @@ export default function redirect(direction, route, options) {
|
|
|
10
10
|
options.history = true; // eslint-disable-line
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function redirectResolve(redirectUrl, redirectOptions
|
|
13
|
+
function redirectResolve(redirectUrl, redirectOptions) {
|
|
14
|
+
if (redirectOptions === void 0) {
|
|
15
|
+
redirectOptions = {};
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
router.allowPageChange = true;
|
|
15
19
|
router[method](redirectUrl, extend({}, options, redirectOptions));
|
|
16
20
|
}
|
|
@@ -56,7 +56,11 @@ class Router extends Framework7Class {
|
|
|
56
56
|
enumerable: true,
|
|
57
57
|
configurable: true,
|
|
58
58
|
|
|
59
|
-
set(newRoute
|
|
59
|
+
set(newRoute) {
|
|
60
|
+
if (newRoute === void 0) {
|
|
61
|
+
newRoute = {};
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
previousRoute = extend({}, currentRoute);
|
|
61
65
|
currentRoute = newRoute;
|
|
62
66
|
if (!currentRoute) return;
|
|
@@ -461,7 +465,11 @@ class Router extends Framework7Class {
|
|
|
461
465
|
return undefined;
|
|
462
466
|
}
|
|
463
467
|
|
|
464
|
-
flattenRoutes(routes
|
|
468
|
+
flattenRoutes(routes) {
|
|
469
|
+
if (routes === void 0) {
|
|
470
|
+
routes = this.routes;
|
|
471
|
+
}
|
|
472
|
+
|
|
465
473
|
const router = this;
|
|
466
474
|
let flattenedRoutes = [];
|
|
467
475
|
routes.forEach(route => {
|
|
@@ -529,7 +537,11 @@ class Router extends Framework7Class {
|
|
|
529
537
|
};
|
|
530
538
|
}
|
|
531
539
|
|
|
532
|
-
generateUrl(parameters
|
|
540
|
+
generateUrl(parameters) {
|
|
541
|
+
if (parameters === void 0) {
|
|
542
|
+
parameters = {};
|
|
543
|
+
}
|
|
544
|
+
|
|
533
545
|
if (typeof parameters === 'string') {
|
|
534
546
|
return parameters;
|
|
535
547
|
}
|
|
@@ -569,10 +581,11 @@ class Router extends Framework7Class {
|
|
|
569
581
|
} // eslint-disable-next-line
|
|
570
582
|
|
|
571
583
|
|
|
572
|
-
constructRouteUrl(route, {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
584
|
+
constructRouteUrl(route, _temp) {
|
|
585
|
+
let {
|
|
586
|
+
params,
|
|
587
|
+
query
|
|
588
|
+
} = _temp === void 0 ? {} : _temp;
|
|
576
589
|
const {
|
|
577
590
|
path
|
|
578
591
|
} = route;
|
|
@@ -693,7 +706,15 @@ class Router extends Framework7Class {
|
|
|
693
706
|
} // eslint-disable-next-line
|
|
694
707
|
|
|
695
708
|
|
|
696
|
-
replaceRequestUrlParams(url
|
|
709
|
+
replaceRequestUrlParams(url, options) {
|
|
710
|
+
if (url === void 0) {
|
|
711
|
+
url = '';
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (options === void 0) {
|
|
715
|
+
options = {};
|
|
716
|
+
}
|
|
717
|
+
|
|
697
718
|
let compiledUrl = url;
|
|
698
719
|
|
|
699
720
|
if (typeof compiledUrl === 'string' && compiledUrl.indexOf('{{') >= 0 && options && options.route && options.route.params && Object.keys(options.route.params).length) {
|
|
@@ -856,7 +877,11 @@ class Router extends Framework7Class {
|
|
|
856
877
|
$(el).find(toRemove).remove();
|
|
857
878
|
}
|
|
858
879
|
|
|
859
|
-
getPageData(pageEl, navbarEl, from, to, route
|
|
880
|
+
getPageData(pageEl, navbarEl, from, to, route, pageFromEl) {
|
|
881
|
+
if (route === void 0) {
|
|
882
|
+
route = {};
|
|
883
|
+
}
|
|
884
|
+
|
|
860
885
|
const router = this;
|
|
861
886
|
const $pageEl = $(pageEl).eq(0);
|
|
862
887
|
const $navbarEl = $(navbarEl).eq(0);
|
|
@@ -903,7 +928,11 @@ class Router extends Framework7Class {
|
|
|
903
928
|
} // Callbacks
|
|
904
929
|
|
|
905
930
|
|
|
906
|
-
pageCallback(callback, pageEl, navbarEl, from, to, options
|
|
931
|
+
pageCallback(callback, pageEl, navbarEl, from, to, options, pageFromEl) {
|
|
932
|
+
if (options === void 0) {
|
|
933
|
+
options = {};
|
|
934
|
+
}
|
|
935
|
+
|
|
907
936
|
if (!pageEl) return;
|
|
908
937
|
const router = this;
|
|
909
938
|
const $pageEl = $(pageEl);
|
|
@@ -287,12 +287,13 @@ function SwipeBack(r) {
|
|
|
287
287
|
return els;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
function setAnimatableNavElements({
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
290
|
+
function setAnimatableNavElements(_temp) {
|
|
291
|
+
let {
|
|
292
|
+
progress,
|
|
293
|
+
reset,
|
|
294
|
+
transition,
|
|
295
|
+
reflow
|
|
296
|
+
} = _temp === void 0 ? {} : _temp;
|
|
296
297
|
const styles = ['overflow', 'transform', 'transform-origin', 'opacity'];
|
|
297
298
|
|
|
298
299
|
if (transition === true || transition === false) {
|
package/modules/router/tab.js
CHANGED
|
@@ -3,7 +3,11 @@ import { extend } from '../../shared/utils.js';
|
|
|
3
3
|
import History from '../../shared/history.js';
|
|
4
4
|
import asyncComponent from './async-component.js';
|
|
5
5
|
|
|
6
|
-
function tabLoad(tabRoute, loadOptions
|
|
6
|
+
function tabLoad(tabRoute, loadOptions) {
|
|
7
|
+
if (loadOptions === void 0) {
|
|
8
|
+
loadOptions = {};
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
const router = this;
|
|
8
12
|
const options = extend({
|
|
9
13
|
animate: router.params.animate,
|
|
@@ -33,7 +37,7 @@ function tabLoad(tabRoute, loadOptions = {}) {
|
|
|
33
37
|
|
|
34
38
|
|
|
35
39
|
if (router.params.browserHistory && options.browserHistory && !options.reloadPrevious) {
|
|
36
|
-
History.
|
|
40
|
+
History[router.params.browserHistoryTabs](router.view.id, {
|
|
37
41
|
url: options.route.url
|
|
38
42
|
}, (router.params.browserHistoryRoot || '') + router.params.browserHistorySeparator + options.route.url);
|
|
39
43
|
} // Update Router History
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
|
2
2
|
import { extend } from '../../shared/utils.js';
|
|
3
3
|
|
|
4
|
-
function createStore(storeParams
|
|
4
|
+
function createStore(storeParams) {
|
|
5
|
+
if (storeParams === void 0) {
|
|
6
|
+
storeParams = {};
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
const store = {
|
|
6
10
|
__store: true
|
|
7
11
|
};
|
|
@@ -67,7 +71,11 @@ function createStore(storeParams = {}) {
|
|
|
67
71
|
removeGetterCallback(callback);
|
|
68
72
|
};
|
|
69
73
|
|
|
70
|
-
const getterValue = (getterKey, addCallback
|
|
74
|
+
const getterValue = function (getterKey, addCallback) {
|
|
75
|
+
if (addCallback === void 0) {
|
|
76
|
+
addCallback = true;
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
if (getterKey === 'constructor') return undefined;
|
|
72
80
|
propsQueue = [];
|
|
73
81
|
const value = getGetterValue(getterKey);
|