framework7-react 8.3.4 → 9.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion-content.js +6 -9
- package/components/accordion-item.js +11 -9
- package/components/accordion-toggle.js +11 -9
- package/components/accordion.js +11 -9
- package/components/actions-button.js +11 -9
- package/components/actions-group.js +11 -9
- package/components/actions-label.js +11 -9
- package/components/actions.js +13 -10
- package/components/app.js +10 -8
- package/components/area-chart.js +27 -29
- package/components/badge.js +11 -9
- package/components/block-footer.js +11 -9
- package/components/block-header.js +11 -9
- package/components/block-title.js +11 -9
- package/components/block.js +11 -9
- package/components/breadcrumbs-collapsed.js +11 -9
- package/components/breadcrumbs-item.js +11 -9
- package/components/breadcrumbs-separator.js +11 -9
- package/components/breadcrumbs.js +11 -9
- package/components/button.js +15 -10
- package/components/card-content.js +11 -9
- package/components/card-footer.js +11 -9
- package/components/card-header.js +11 -9
- package/components/card.js +14 -11
- package/components/checkbox.js +13 -10
- package/components/chip.js +11 -9
- package/components/fab-backdrop.js +11 -9
- package/components/fab-button.js +11 -9
- package/components/fab-buttons.js +11 -9
- package/components/fab.js +11 -9
- package/components/gauge.js +11 -9
- package/components/icon.js +11 -9
- package/components/input.js +15 -25
- package/components/link.js +13 -10
- package/components/list-button.js +11 -9
- package/components/list-group.js +11 -9
- package/components/list-index.js +15 -12
- package/components/list-input.js +15 -25
- package/components/list-item-content.js +7 -2
- package/components/list-item.js +13 -10
- package/components/list.js +13 -10
- package/components/login-screen-title.js +11 -9
- package/components/login-screen.js +13 -10
- package/components/message.js +11 -9
- package/components/messagebar-attachment.js +11 -9
- package/components/messagebar-attachments.js +11 -9
- package/components/messagebar-sheet-image.js +11 -9
- package/components/messagebar-sheet-item.js +11 -9
- package/components/messagebar-sheet.js +11 -9
- package/components/messagebar.js +17 -13
- package/components/messages-title.js +11 -9
- package/components/messages.js +13 -10
- package/components/nav-left.d.ts +0 -1
- package/components/nav-left.js +12 -17
- package/components/nav-right.d.ts +0 -1
- package/components/nav-right.js +11 -13
- package/components/nav-title-large.js +11 -10
- package/components/nav-title.d.ts +0 -1
- package/components/nav-title.js +11 -13
- package/components/navbar.d.ts +0 -1
- package/components/navbar.js +15 -40
- package/components/page-content.js +11 -10
- package/components/page.js +10 -8
- package/components/panel.js +14 -15
- package/components/photo-browser.d.ts +0 -1
- package/components/photo-browser.js +14 -15
- package/components/pie-chart.js +16 -16
- package/components/popover.d.ts +0 -1
- package/components/popover.js +14 -16
- package/components/popup.js +13 -11
- package/components/preloader.js +11 -10
- package/components/progressbar.js +13 -11
- package/components/radio.js +11 -10
- package/components/range.js +14 -12
- package/components/routable-modals.js +17 -15
- package/components/searchbar.js +22 -18
- package/components/segmented.js +11 -10
- package/components/sheet.js +13 -11
- package/components/stepper.js +18 -16
- package/components/subnavbar.d.ts +0 -1
- package/components/subnavbar.js +11 -13
- package/components/swipeout-actions.js +11 -10
- package/components/swipeout-button.js +11 -10
- package/components/tab.js +11 -10
- package/components/tabs.js +19 -12
- package/components/text-editor.js +14 -12
- package/components/toggle.js +19 -18
- package/components/toolbar-pane.d.ts +16 -0
- package/components/toolbar-pane.js +29 -0
- package/components/toolbar.js +14 -12
- package/components/treeview-item.js +11 -10
- package/components/treeview.js +11 -10
- package/components/view.d.ts +0 -2
- package/components/view.js +28 -28
- package/components/views.js +11 -10
- package/framework7-react.d.ts +2 -1
- package/framework7-react.js +5 -4
- package/package.json +2 -2
- package/shared/components-router.js +20 -23
- package/shared/f7.js +1 -7
- package/shared/modal-state-classes.js +4 -5
- package/shared/plugin.js +1 -4
- package/shared/set-ref.js +11 -0
- package/shared/use-icon.js +1 -4
- package/shared/use-route-props.js +3 -4
- package/shared/use-store.js +5 -5
- package/shared/utils.js +6 -24
package/shared/use-store.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { f7 } from './f7.js';
|
|
3
|
-
export const useStore =
|
|
3
|
+
export const useStore = (...args) => {
|
|
4
4
|
const assignedGetters = useRef({});
|
|
5
5
|
// (store, getter)
|
|
6
|
-
let store =
|
|
7
|
-
let getter =
|
|
8
|
-
if (
|
|
6
|
+
let store = args[0];
|
|
7
|
+
let getter = args[1];
|
|
8
|
+
if (args.length === 1) {
|
|
9
9
|
// (getter)
|
|
10
10
|
store = f7.store;
|
|
11
|
-
getter =
|
|
11
|
+
getter = args[0];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// eslint-disable-next-line
|
package/shared/utils.js
CHANGED
|
@@ -14,13 +14,10 @@ export function isObject(o) {
|
|
|
14
14
|
export function now() {
|
|
15
15
|
return Date.now();
|
|
16
16
|
}
|
|
17
|
-
export function extend() {
|
|
17
|
+
export function extend(...args) {
|
|
18
18
|
let deep = true;
|
|
19
19
|
let to;
|
|
20
20
|
let from;
|
|
21
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22
|
-
args[_key] = arguments[_key];
|
|
23
|
-
}
|
|
24
21
|
if (typeof args[0] === 'boolean') {
|
|
25
22
|
[deep, to] = args;
|
|
26
23
|
args.splice(0, 2);
|
|
@@ -54,21 +51,15 @@ export function extend() {
|
|
|
54
51
|
}
|
|
55
52
|
return to;
|
|
56
53
|
}
|
|
57
|
-
export function flattenArray() {
|
|
54
|
+
export function flattenArray(...args) {
|
|
58
55
|
const arr = [];
|
|
59
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
60
|
-
args[_key2] = arguments[_key2];
|
|
61
|
-
}
|
|
62
56
|
args.forEach(arg => {
|
|
63
57
|
if (Array.isArray(arg)) arr.push(...flattenArray(...arg));else arr.push(arg);
|
|
64
58
|
});
|
|
65
59
|
return arr;
|
|
66
60
|
}
|
|
67
|
-
export function classNames() {
|
|
61
|
+
export function classNames(...args) {
|
|
68
62
|
const classes = [];
|
|
69
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
70
|
-
args[_key3] = arguments[_key3];
|
|
71
|
-
}
|
|
72
63
|
args.forEach(arg => {
|
|
73
64
|
if (typeof arg === 'object' && arg.constructor === Object) {
|
|
74
65
|
Object.keys(arg).forEach(key => {
|
|
@@ -82,10 +73,7 @@ export function classNames() {
|
|
|
82
73
|
});
|
|
83
74
|
return uniqueClasses.join(' ');
|
|
84
75
|
}
|
|
85
|
-
export function getSlots(props) {
|
|
86
|
-
if (props === void 0) {
|
|
87
|
-
props = {};
|
|
88
|
-
}
|
|
76
|
+
export function getSlots(props = {}) {
|
|
89
77
|
const slots = {};
|
|
90
78
|
if (!props) return slots;
|
|
91
79
|
const children = props.children;
|
|
@@ -109,10 +97,7 @@ export function getSlots(props) {
|
|
|
109
97
|
}
|
|
110
98
|
return slots;
|
|
111
99
|
}
|
|
112
|
-
export function emit(props, events) {
|
|
113
|
-
for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {
|
|
114
|
-
args[_key4 - 2] = arguments[_key4];
|
|
115
|
-
}
|
|
100
|
+
export function emit(props, events, ...args) {
|
|
116
101
|
if (!events || !events.trim().length || typeof events !== 'string') return;
|
|
117
102
|
events.trim().split(' ').forEach(event => {
|
|
118
103
|
let eventName = (event || '').trim();
|
|
@@ -122,10 +107,7 @@ export function emit(props, events) {
|
|
|
122
107
|
if (props[propName]) props[propName](...args);
|
|
123
108
|
});
|
|
124
109
|
}
|
|
125
|
-
export function getExtraAttrs(props) {
|
|
126
|
-
if (props === void 0) {
|
|
127
|
-
props = {};
|
|
128
|
-
}
|
|
110
|
+
export function getExtraAttrs(props = {}) {
|
|
129
111
|
const extraAttrs = {};
|
|
130
112
|
Object.keys(props).forEach(key => {
|
|
131
113
|
if (key.indexOf('data-') === 0 || key.indexOf('aria-') === 0 || key === 'role') {
|