framework7-react 7.0.0-beta.2 → 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/accordion-content.js +2 -2
- package/components/accordion-item.js +4 -4
- package/components/accordion-toggle.js +2 -2
- package/components/accordion.js +2 -2
- package/components/actions-button.js +3 -3
- package/components/actions-group.js +2 -2
- package/components/actions-label.js +2 -2
- package/components/actions.d.ts +1 -1
- package/components/actions.js +6 -6
- package/components/app.js +5 -5
- package/components/appbar.js +2 -2
- package/components/area-chart.js +22 -18
- package/components/badge.js +3 -3
- package/components/block-footer.js +2 -2
- package/components/block-header.js +2 -2
- package/components/block-title.js +2 -2
- package/components/block.js +3 -3
- package/components/breadcrumbs-collapsed.d.ts +16 -0
- package/components/breadcrumbs-collapsed.js +32 -0
- package/components/breadcrumbs-item.d.ts +17 -0
- package/components/breadcrumbs-item.js +33 -0
- package/components/breadcrumbs-separator.d.ts +15 -0
- package/components/breadcrumbs-separator.js +25 -0
- package/components/breadcrumbs.d.ts +15 -0
- package/components/breadcrumbs.js +26 -0
- package/components/button.js +6 -6
- package/components/card-content.js +2 -2
- package/components/card-footer.js +2 -2
- package/components/card-header.js +2 -2
- package/components/card.js +8 -8
- package/components/checkbox.js +2 -2
- package/components/chip.js +4 -4
- package/components/col.js +3 -3
- package/components/fab-backdrop.js +1 -1
- package/components/fab-button.js +3 -3
- package/components/fab-buttons.js +2 -2
- package/components/fab.js +3 -3
- package/components/gauge.js +1 -1
- package/components/icon.js +4 -4
- package/components/input.js +28 -12
- package/components/link.js +8 -8
- package/components/list-button.js +4 -4
- package/components/list-group.js +3 -3
- package/components/list-index.js +5 -5
- package/components/list-input.js +27 -11
- package/components/list-item-cell.js +2 -2
- package/components/list-item-content.js +3 -3
- package/components/list-item-row.js +2 -2
- package/components/list-item.js +10 -10
- package/components/list.d.ts +1 -0
- package/components/list.js +13 -6
- package/components/login-screen-title.js +2 -2
- package/components/login-screen.js +6 -6
- package/components/menu-dropdown-item.js +3 -3
- package/components/menu-dropdown.js +2 -2
- package/components/menu-item.js +7 -7
- package/components/menu.js +2 -2
- package/components/message.js +2 -2
- package/components/messagebar-attachment.js +2 -2
- package/components/messagebar-attachments.js +2 -2
- package/components/messagebar-sheet-image.js +2 -2
- package/components/messagebar-sheet-item.js +2 -2
- package/components/messagebar-sheet.js +2 -2
- package/components/messagebar.js +7 -7
- package/components/messages-title.js +2 -2
- package/components/messages.js +5 -5
- package/components/nav-left.js +4 -4
- package/components/nav-right.js +2 -2
- package/components/nav-title-large.js +2 -2
- package/components/nav-title.js +2 -2
- package/components/navbar.js +8 -8
- package/components/page-content.js +6 -6
- package/components/page.js +5 -5
- package/components/panel.js +10 -6
- package/components/photo-browser.js +4 -4
- package/components/pie-chart.js +8 -7
- package/components/popover.js +6 -6
- package/components/popup.js +6 -6
- package/components/preloader.js +3 -3
- package/components/progressbar.js +3 -3
- package/components/radio.js +2 -2
- package/components/range.d.ts +1 -1
- package/components/range.js +5 -5
- package/components/routable-modals.js +8 -7
- package/components/row.js +3 -3
- package/components/searchbar.js +4 -4
- package/components/segmented.js +2 -2
- package/components/sheet.js +6 -6
- package/components/skeleton-avatar.d.ts +1 -0
- package/components/skeleton-avatar.js +1 -0
- package/components/skeleton-block.d.ts +1 -0
- package/components/skeleton-block.js +1 -0
- package/components/skeleton-image.d.ts +1 -0
- package/components/skeleton-image.js +1 -0
- package/components/skeleton-text.d.ts +1 -0
- package/components/skeleton-text.js +1 -0
- package/components/stepper.js +5 -5
- package/components/subnavbar.js +2 -2
- package/components/swipeout-actions.js +2 -2
- package/components/swipeout-button.js +2 -2
- package/components/tab.js +7 -7
- package/components/tabs.js +3 -3
- package/components/text-editor.js +5 -5
- package/components/toggle.js +18 -7
- package/components/toolbar.js +6 -6
- package/components/treeview-item.js +5 -5
- package/components/treeview.js +2 -2
- package/components/view.d.ts +1 -0
- package/components/view.js +28 -23
- package/components/views.js +2 -2
- package/framework7-react.d.ts +5 -1
- package/framework7-react.js +107 -103
- package/package.json +2 -1
- package/shared/components-router.js +30 -22
- package/shared/f7.js +10 -2
- package/shared/get-router-initial-component.js +1 -1
- package/shared/mixins.js +3 -3
- package/shared/modal-state-classes.js +5 -4
- package/shared/plugin.js +7 -3
- package/shared/router-open-in.js +106 -0
- package/shared/use-icon.js +7 -3
- package/shared/use-route-props.js +4 -3
- package/shared/use-smart-select.js +2 -2
- package/shared/use-store.js +6 -6
- package/shared/use-tab.js +3 -3
- package/shared/use-theme.js +1 -1
- package/shared/use-tooltip.js +2 -2
- package/shared/utils.js +32 -6
- package/shared/watch-prop.js +1 -1
package/shared/plugin.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import Framework7 from 'framework7/lite';
|
|
2
|
-
import componentsRouter from './components-router';
|
|
3
|
-
import { f7, f7ready, theme, f7initEvents, setTheme } from './f7';
|
|
2
|
+
import componentsRouter from './components-router.js';
|
|
3
|
+
import { f7, f7ready, theme, f7initEvents, setTheme } from './f7.js';
|
|
4
4
|
const Framework7React = {
|
|
5
5
|
name: 'reactPlugin',
|
|
6
6
|
installed: false,
|
|
7
7
|
|
|
8
|
-
install(params
|
|
8
|
+
install(params) {
|
|
9
|
+
if (params === void 0) {
|
|
10
|
+
params = {};
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
if (Framework7React.installed) return;
|
|
10
14
|
Framework7React.installed = true;
|
|
11
15
|
f7initEvents();
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Popup from '../components/popup.js';
|
|
3
|
+
import View from '../components/view.js';
|
|
4
|
+
import LoginScreen from '../components/login-screen.js';
|
|
5
|
+
import Sheet from '../components/sheet.js';
|
|
6
|
+
import Popover from '../components/popover.js';
|
|
7
|
+
import Panel from '../components/panel.js';
|
|
8
|
+
export const routerOpenIn = (router, url, options) => {
|
|
9
|
+
const navigateOptions = {
|
|
10
|
+
url,
|
|
11
|
+
route: {
|
|
12
|
+
path: url,
|
|
13
|
+
options: { ...options,
|
|
14
|
+
openIn: undefined
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const params = { ...options
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
if (options.openIn === 'popup') {
|
|
22
|
+
params.component = function DynamicPopup() {
|
|
23
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
24
|
+
className: "popup-router-open-in",
|
|
25
|
+
"data-url": url
|
|
26
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
linksView: router.view.selector,
|
|
28
|
+
url: url,
|
|
29
|
+
ignoreOpenIn: true
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
navigateOptions.route.popup = params;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (options.openIn === 'loginScreen') {
|
|
37
|
+
params.component = function DynamicPopover() {
|
|
38
|
+
return /*#__PURE__*/React.createElement(LoginScreen, {
|
|
39
|
+
className: "login-screen-router-open-in",
|
|
40
|
+
"data-url": url
|
|
41
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
42
|
+
linksView: router.view.selector,
|
|
43
|
+
url: url,
|
|
44
|
+
ignoreOpenIn: true
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
navigateOptions.route.loginScreen = params;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (options.openIn === 'sheet') {
|
|
52
|
+
params.component = function DynamicSheet() {
|
|
53
|
+
return /*#__PURE__*/React.createElement(Sheet, {
|
|
54
|
+
className: "sheet-modal-router-open-in",
|
|
55
|
+
"data-url": url
|
|
56
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
57
|
+
linksView: router.view.selector,
|
|
58
|
+
url: url,
|
|
59
|
+
ignoreOpenIn: true
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
navigateOptions.route.sheet = params;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (options.openIn === 'popover') {
|
|
67
|
+
params.targetEl = options.clickedEl || options.targetEl;
|
|
68
|
+
|
|
69
|
+
params.component = function DynamicPopover() {
|
|
70
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
71
|
+
className: "popover-router-open-in",
|
|
72
|
+
targetEl: options.clickedEl || options.targetEl,
|
|
73
|
+
"data-url": url
|
|
74
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
75
|
+
linksView: router.view.selector,
|
|
76
|
+
url: url,
|
|
77
|
+
ignoreOpenIn: true
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
navigateOptions.route.popover = params;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (options.openIn.indexOf('panel') >= 0) {
|
|
85
|
+
const parts = options.openIn.split(':');
|
|
86
|
+
const side = parts[1] || 'left';
|
|
87
|
+
const effect = parts[2] || 'cover';
|
|
88
|
+
|
|
89
|
+
params.component = function DynamicPanel() {
|
|
90
|
+
return /*#__PURE__*/React.createElement(Panel, {
|
|
91
|
+
side: side,
|
|
92
|
+
effect: effect,
|
|
93
|
+
className: "panel-router-open-in",
|
|
94
|
+
"data-url": url
|
|
95
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
96
|
+
linksView: router.view.selector,
|
|
97
|
+
url: url,
|
|
98
|
+
ignoreOpenIn: true
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
navigateOptions.route.panel = params;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return router.navigate(navigateOptions);
|
|
106
|
+
};
|
package/shared/use-icon.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Icon from '../components/icon';
|
|
3
|
-
import Badge from '../components/badge';
|
|
4
|
-
export const useIcon = (props
|
|
2
|
+
import Icon from '../components/icon.js';
|
|
3
|
+
import Badge from '../components/badge.js';
|
|
4
|
+
export const useIcon = function (props) {
|
|
5
|
+
if (props === void 0) {
|
|
6
|
+
props = {};
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
const {
|
|
6
10
|
icon,
|
|
7
11
|
iconMaterial,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
export const useRouteProps = (elRef, {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export const useRouteProps = function (elRef, _temp) {
|
|
3
|
+
let {
|
|
4
|
+
routeProps
|
|
5
|
+
} = _temp === void 0 ? {} : _temp;
|
|
5
6
|
useEffect(() => {
|
|
6
7
|
if (elRef.current) {
|
|
7
8
|
elRef.current.f7RouteProps = routeProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import { f7ready, f7 } from './f7';
|
|
3
|
-
import { extend } from './utils';
|
|
2
|
+
import { f7ready, f7 } from './f7.js';
|
|
3
|
+
import { extend } from './utils.js';
|
|
4
4
|
export const useSmartSelect = (smartSelect, smartSelectParams, f7SmartSelect, getEl) => {
|
|
5
5
|
const onMount = () => {
|
|
6
6
|
f7ready(() => {
|
package/shared/use-store.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { f7 } from './f7';
|
|
3
|
-
export const useStore = (
|
|
2
|
+
import { f7 } from './f7.js';
|
|
3
|
+
export const useStore = function () {
|
|
4
4
|
const assignedGetters = useRef({}); // (store, getter)
|
|
5
5
|
|
|
6
|
-
let store =
|
|
7
|
-
let getter =
|
|
6
|
+
let store = arguments.length <= 0 ? undefined : arguments[0];
|
|
7
|
+
let getter = arguments.length <= 1 ? undefined : arguments[1];
|
|
8
8
|
|
|
9
|
-
if (
|
|
9
|
+
if (arguments.length === 1) {
|
|
10
10
|
// (getter)
|
|
11
11
|
store = f7.store;
|
|
12
|
-
getter =
|
|
12
|
+
getter = arguments.length <= 0 ? undefined : arguments[0];
|
|
13
13
|
} // eslint-disable-next-line
|
|
14
14
|
|
|
15
15
|
|
package/shared/use-tab.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';
|
|
2
|
-
import { f7, f7ready } from './f7';
|
|
3
|
-
import { emit } from './utils';
|
|
1
|
+
import { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect.js';
|
|
2
|
+
import { f7, f7ready } from './f7.js';
|
|
3
|
+
import { emit } from './utils.js';
|
|
4
4
|
export const useTab = (elRef, props) => {
|
|
5
5
|
const onTabShow = el => {
|
|
6
6
|
if (elRef.current !== el) return;
|
package/shared/use-theme.js
CHANGED
package/shared/use-tooltip.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
-
import { watchProp } from './watch-prop';
|
|
3
|
-
import { f7, f7ready } from './f7';
|
|
2
|
+
import { watchProp } from './watch-prop.js';
|
|
3
|
+
import { f7, f7ready } from './f7.js';
|
|
4
4
|
export const useTooltip = (elRef, props) => {
|
|
5
5
|
const f7Tooltip = useRef(null);
|
|
6
6
|
const {
|
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,15 +61,25 @@ export function extend(...args) {
|
|
|
57
61
|
|
|
58
62
|
return to;
|
|
59
63
|
}
|
|
60
|
-
export function flattenArray(
|
|
64
|
+
export function flattenArray() {
|
|
61
65
|
const arr = [];
|
|
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 (Array.isArray(arg)) arr.push(...flattenArray(...arg));else arr.push(arg);
|
|
64
73
|
});
|
|
65
74
|
return arr;
|
|
66
75
|
}
|
|
67
|
-
export function classNames(
|
|
76
|
+
export function classNames() {
|
|
68
77
|
const classes = [];
|
|
78
|
+
|
|
79
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
80
|
+
args[_key3] = arguments[_key3];
|
|
81
|
+
}
|
|
82
|
+
|
|
69
83
|
args.forEach(arg => {
|
|
70
84
|
if (typeof arg === 'object' && arg.constructor === Object) {
|
|
71
85
|
Object.keys(arg).forEach(key => {
|
|
@@ -79,7 +93,11 @@ export function classNames(...args) {
|
|
|
79
93
|
});
|
|
80
94
|
return uniqueClasses.join(' ');
|
|
81
95
|
}
|
|
82
|
-
export function getSlots(props
|
|
96
|
+
export function getSlots(props) {
|
|
97
|
+
if (props === void 0) {
|
|
98
|
+
props = {};
|
|
99
|
+
}
|
|
100
|
+
|
|
83
101
|
const slots = {};
|
|
84
102
|
if (!props) return slots;
|
|
85
103
|
const children = props.children;
|
|
@@ -107,7 +125,11 @@ export function getSlots(props = {}) {
|
|
|
107
125
|
|
|
108
126
|
return slots;
|
|
109
127
|
}
|
|
110
|
-
export function emit(props, events
|
|
128
|
+
export function emit(props, events) {
|
|
129
|
+
for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {
|
|
130
|
+
args[_key4 - 2] = arguments[_key4];
|
|
131
|
+
}
|
|
132
|
+
|
|
111
133
|
if (!events || !events.trim().length || typeof events !== 'string') return;
|
|
112
134
|
events.trim().split(' ').forEach(event => {
|
|
113
135
|
let eventName = (event || '').trim();
|
|
@@ -117,7 +139,11 @@ export function emit(props, events, ...args) {
|
|
|
117
139
|
if (props[propName]) props[propName](...args);
|
|
118
140
|
});
|
|
119
141
|
}
|
|
120
|
-
export function getExtraAttrs(props
|
|
142
|
+
export function getExtraAttrs(props) {
|
|
143
|
+
if (props === void 0) {
|
|
144
|
+
props = {};
|
|
145
|
+
}
|
|
146
|
+
|
|
121
147
|
const extraAttrs = {};
|
|
122
148
|
Object.keys(props).forEach(key => {
|
|
123
149
|
if (key.indexOf('data-') === 0 || key.indexOf('aria-') === 0 || key === 'role') {
|
package/shared/watch-prop.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
|
-
import { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';
|
|
2
|
+
import { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect.js';
|
|
3
3
|
export const watchProp = (value, callback) => {
|
|
4
4
|
const valueRef = useRef(value);
|
|
5
5
|
useIsomorphicLayoutEffect(() => {
|