framework7-svelte 7.0.0-beta.15 → 7.0.0-beta.20
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/panel.svelte +1 -0
- package/framework7-svelte.js +2 -2
- package/package.json +1 -1
- package/shared/components-router.js +23 -20
- package/shared/f7.js +30 -22
- package/shared/modal-state-classes.js +5 -4
- package/shared/plugin.js +7 -2
- package/shared/rest-props.js +5 -1
- package/shared/use-icon.js +5 -1
- package/shared/use-store.js +9 -9
- package/shared/use-tooltip.js +5 -3
- package/shared/utils.js +11 -2
package/components/panel.svelte
CHANGED
package/framework7-svelte.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Framework7 Svelte 7.0.0-beta.
|
|
2
|
+
* Framework7 Svelte 7.0.0-beta.20
|
|
3
3
|
* Build full featured iOS & Android apps using Framework7 & Svelte
|
|
4
4
|
* https://framework7.io/svelte/
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Released under the MIT License
|
|
9
9
|
*
|
|
10
|
-
* Released on: April
|
|
10
|
+
* Released on: April 15, 2022
|
|
11
11
|
*/
|
|
12
12
|
import Framework7Svelte from './shared/plugin.js';
|
|
13
13
|
import { f7, f7ready, theme, app } from './shared/f7.js';
|
package/package.json
CHANGED
|
@@ -26,13 +26,14 @@ export default {
|
|
|
26
26
|
return routerOpenIn(router, navigateUrl, options);
|
|
27
27
|
},
|
|
28
28
|
|
|
29
|
-
pageComponentLoader({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
pageComponentLoader(_ref) {
|
|
30
|
+
let {
|
|
31
|
+
routerEl,
|
|
32
|
+
component,
|
|
33
|
+
options,
|
|
34
|
+
resolve,
|
|
35
|
+
reject
|
|
36
|
+
} = _ref;
|
|
36
37
|
const router = this;
|
|
37
38
|
const routerId = router.id;
|
|
38
39
|
const el = routerEl;
|
|
@@ -117,13 +118,14 @@ export default {
|
|
|
117
118
|
}
|
|
118
119
|
},
|
|
119
120
|
|
|
120
|
-
tabComponentLoader({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
tabComponentLoader(_temp) {
|
|
122
|
+
let {
|
|
123
|
+
tabEl,
|
|
124
|
+
component,
|
|
125
|
+
options,
|
|
126
|
+
resolve,
|
|
127
|
+
reject
|
|
128
|
+
} = _temp === void 0 ? {} : _temp;
|
|
127
129
|
const router = this;
|
|
128
130
|
if (!tabEl) reject();
|
|
129
131
|
let tabRouter;
|
|
@@ -179,12 +181,13 @@ export default {
|
|
|
179
181
|
tabRouter.setTabContent(null);
|
|
180
182
|
},
|
|
181
183
|
|
|
182
|
-
modalComponentLoader({
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
modalComponentLoader(_temp2) {
|
|
185
|
+
let {
|
|
186
|
+
component,
|
|
187
|
+
options,
|
|
188
|
+
resolve,
|
|
189
|
+
reject
|
|
190
|
+
} = _temp2 === void 0 ? {} : _temp2;
|
|
188
191
|
const router = this;
|
|
189
192
|
const modalsRouter = app.f7routers.modals;
|
|
190
193
|
|
package/shared/f7.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* eslint-disable import/no-mutable-exports */
|
|
2
2
|
// eslint-disable-next-line
|
|
3
|
-
import Framework7 from 'framework7/lite';
|
|
4
3
|
import { extend, unsetRouterIds } from './utils.js';
|
|
5
4
|
let f7;
|
|
6
|
-
const theme = {};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Framework7
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
const theme = {};
|
|
6
|
+
/* eslint-disable no-restricted-globals */
|
|
7
|
+
|
|
8
|
+
const app = typeof window !== 'undefined' && window.Framework7ComponentsApp ? window.Framework7ComponentsApp : {
|
|
9
|
+
Framework7: undefined,
|
|
10
|
+
f7: undefined,
|
|
11
|
+
f7events: undefined,
|
|
12
|
+
theme: {},
|
|
13
|
+
f7routers: {
|
|
14
|
+
views: [],
|
|
15
|
+
tabs: [],
|
|
16
|
+
modals: null
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
if (typeof window !== 'undefined') {
|
|
21
|
+
window.Framework7ComponentsApp = app;
|
|
20
22
|
}
|
|
23
|
+
/* eslint-enable no-restricted-globals */
|
|
21
24
|
|
|
22
|
-
const {
|
|
23
|
-
__app__: app
|
|
24
|
-
} = Framework7;
|
|
25
25
|
|
|
26
26
|
app.setInstance = instance => {
|
|
27
27
|
f7 = instance;
|
|
@@ -51,10 +51,18 @@ const cleanup = () => {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const f7initEvents = () => {
|
|
54
|
-
app.f7events = new Framework7.Events();
|
|
54
|
+
app.f7events = new app.Framework7.Events();
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
const f7init = (rootEl, params
|
|
57
|
+
const f7init = function (rootEl, params, init) {
|
|
58
|
+
if (params === void 0) {
|
|
59
|
+
params = {};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (init === void 0) {
|
|
63
|
+
init = true;
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
const f7Params = extend({}, params, {
|
|
59
67
|
el: rootEl,
|
|
60
68
|
init
|
|
@@ -63,7 +71,7 @@ const f7init = (rootEl, params = {}, init = true) => {
|
|
|
63
71
|
if (!f7Params.routes) f7Params.routes = [];
|
|
64
72
|
|
|
65
73
|
if (f7Params.userAgent && (f7Params.theme === 'auto' || !f7Params.theme)) {
|
|
66
|
-
const device = Framework7.getDevice({
|
|
74
|
+
const device = app.Framework7.getDevice({
|
|
67
75
|
userAgent: f7Params.userAgent
|
|
68
76
|
}, true);
|
|
69
77
|
app.theme.ios = !!device.ios;
|
|
@@ -75,7 +83,7 @@ const f7init = (rootEl, params = {}, init = true) => {
|
|
|
75
83
|
if (app.f7 && typeof window !== 'undefined') return; // eslint-disable-next-line
|
|
76
84
|
|
|
77
85
|
if (typeof window === 'undefined') cleanup();
|
|
78
|
-
const instance = new Framework7(f7Params);
|
|
86
|
+
const instance = new app.Framework7(f7Params);
|
|
79
87
|
app.f7 = instance;
|
|
80
88
|
f7 = instance;
|
|
81
89
|
app.setInstance(instance);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export const modalStateClasses = ({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export const modalStateClasses = function (_temp) {
|
|
2
|
+
let {
|
|
3
|
+
isOpened,
|
|
4
|
+
isClosing
|
|
5
|
+
} = _temp === void 0 ? {} : _temp;
|
|
5
6
|
return {
|
|
6
7
|
'modal-in': isOpened && !isClosing,
|
|
7
8
|
'modal-out': isClosing
|
package/shared/plugin.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
// eslint-disable-next-line
|
|
2
|
-
import Framework7 from 'framework7/lite';
|
|
3
2
|
import componentsRouter from './components-router.js';
|
|
4
3
|
import { f7ready, theme, app, f7initEvents, setTheme } from './f7.js';
|
|
5
4
|
const Framework7Svelte = {
|
|
6
5
|
name: 'sveltePlugin',
|
|
7
6
|
installed: false,
|
|
8
7
|
|
|
9
|
-
install(params
|
|
8
|
+
install(params) {
|
|
9
|
+
if (params === void 0) {
|
|
10
|
+
params = {};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Framework7 = this;
|
|
14
|
+
app.Framework7 = Framework7;
|
|
10
15
|
if (Framework7Svelte.installed) return;
|
|
11
16
|
Framework7Svelte.installed = true;
|
|
12
17
|
f7initEvents();
|
package/shared/rest-props.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
const ignoreProps = ['color', 'colorTheme', 'textColor', 'bgColor', 'borderColor', 'rippleColor', 'dark', 'force', 'reloadCurrent', 'reloadPrevious', 'reloadAll', 'reloadDetail', 'animate', 'ignoreCache', 'routeTabId', 'view', 'transition', 'openIn', 'back', 'linkBack', 'external', 'preventRouter', 'searchbarEnable', 'searchbarDisable', 'searchbarClear', 'searchbarToggle', 'panelOpen', 'panelClose', 'panelToggle', 'popupOpen', 'popupClose', 'actionsOpen', 'actionsClose', 'popoverOpen', 'popoverClose', 'loginScreenOpen', 'loginScreenClose', 'sheetOpen', 'sheetClose', 'sortableEnable', 'sortableDisable', 'sortableToggle', 'cardOpen', 'cardClose'];
|
|
2
|
-
export function restProps(rest
|
|
2
|
+
export function restProps(rest) {
|
|
3
|
+
if (rest === void 0) {
|
|
4
|
+
rest = {};
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
const props = {};
|
|
4
8
|
Object.keys(rest).filter(prop => !ignoreProps.includes(prop)).forEach(key => {
|
|
5
9
|
if (key.indexOf('on') !== 0) {
|
package/shared/use-icon.js
CHANGED
package/shared/use-store.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// eslint-disable-next-line
|
|
2
2
|
import { onDestroy } from 'svelte';
|
|
3
3
|
import { f7 } from './f7.js';
|
|
4
|
-
export const useStore = (
|
|
4
|
+
export const useStore = function () {
|
|
5
5
|
// (store, getter, callback)
|
|
6
|
-
let store =
|
|
7
|
-
let getter =
|
|
8
|
-
let callback =
|
|
6
|
+
let store = arguments.length <= 0 ? undefined : arguments[0];
|
|
7
|
+
let getter = arguments.length <= 1 ? undefined : arguments[1];
|
|
8
|
+
let callback = arguments.length <= 2 ? undefined : arguments[2];
|
|
9
9
|
|
|
10
|
-
if (
|
|
10
|
+
if (arguments.length === 1) {
|
|
11
11
|
// (getter)
|
|
12
12
|
store = f7.store;
|
|
13
|
-
getter =
|
|
14
|
-
} else if (
|
|
13
|
+
getter = arguments.length <= 0 ? undefined : arguments[0];
|
|
14
|
+
} else if (arguments.length === 2 && typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
|
|
15
15
|
// (getter, callback)
|
|
16
16
|
store = f7.store;
|
|
17
|
-
getter =
|
|
18
|
-
callback =
|
|
17
|
+
getter = arguments.length <= 0 ? undefined : arguments[0];
|
|
18
|
+
callback = arguments.length <= 1 ? undefined : arguments[1];
|
|
19
19
|
} // eslint-disable-next-line
|
|
20
20
|
|
|
21
21
|
|
package/shared/use-tooltip.js
CHANGED
|
@@ -17,9 +17,11 @@ export const useTooltip = (el, props) => {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
return {
|
|
20
|
-
update({
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
update(_temp) {
|
|
21
|
+
let {
|
|
22
|
+
tooltip: value
|
|
23
|
+
} = _temp === void 0 ? {} : _temp;
|
|
24
|
+
|
|
23
25
|
if (!value && f7Tooltip) {
|
|
24
26
|
f7Tooltip.destroy();
|
|
25
27
|
f7Tooltip = null;
|
package/shared/utils.js
CHANGED
|
@@ -14,11 +14,15 @@ export function isObject(o) {
|
|
|
14
14
|
export function now() {
|
|
15
15
|
return Date.now();
|
|
16
16
|
}
|
|
17
|
-
export function extend(
|
|
17
|
+
export function extend() {
|
|
18
18
|
let deep = true;
|
|
19
19
|
let to;
|
|
20
20
|
let from;
|
|
21
21
|
|
|
22
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
+
args[_key] = arguments[_key];
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
if (typeof args[0] === 'boolean') {
|
|
23
27
|
[deep, to] = args;
|
|
24
28
|
args.splice(0, 2);
|
|
@@ -57,8 +61,13 @@ export function extend(...args) {
|
|
|
57
61
|
|
|
58
62
|
return to;
|
|
59
63
|
}
|
|
60
|
-
export function classNames(
|
|
64
|
+
export function classNames() {
|
|
61
65
|
const classes = [];
|
|
66
|
+
|
|
67
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
68
|
+
args[_key2] = arguments[_key2];
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
args.forEach(arg => {
|
|
63
72
|
if (typeof arg === 'object' && arg.constructor === Object) {
|
|
64
73
|
Object.keys(arg).forEach(key => {
|