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/components/panel.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
4
4
|
import { classNames, getExtraAttrs, noUndefinedProps, emit } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
6
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
7
7
|
import { watchProp } from '../shared/watch-prop.js';
|
|
8
|
+
import { setRef } from '../shared/set-ref.js';
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
const Panel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
11
|
+
const Panel = props => {
|
|
12
12
|
const f7Panel = useRef(null);
|
|
13
13
|
const {
|
|
14
14
|
className,
|
|
@@ -36,7 +36,8 @@ const Panel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
36
36
|
swipeNoFollow,
|
|
37
37
|
swipeOnlyClose,
|
|
38
38
|
swipeActiveArea = 0,
|
|
39
|
-
swipeThreshold = 0
|
|
39
|
+
swipeThreshold = 0,
|
|
40
|
+
ref
|
|
40
41
|
} = props;
|
|
41
42
|
const extraAttrs = getExtraAttrs(props);
|
|
42
43
|
const elRef = useRef(null);
|
|
@@ -80,16 +81,9 @@ const Panel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
80
81
|
isCollapsed.current = true;
|
|
81
82
|
emit(props, 'panelCollapsedBreakpoint', event);
|
|
82
83
|
};
|
|
83
|
-
const onResize =
|
|
84
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85
|
-
args[_key] = arguments[_key];
|
|
86
|
-
}
|
|
84
|
+
const onResize = (...args) => {
|
|
87
85
|
emit(props, 'panelResize', ...args);
|
|
88
86
|
};
|
|
89
|
-
useImperativeHandle(ref, () => ({
|
|
90
|
-
el: elRef.current,
|
|
91
|
-
f7Panel: () => f7Panel.current
|
|
92
|
-
}));
|
|
93
87
|
watchProp(resizable, newValue => {
|
|
94
88
|
if (!f7Panel.current) return;
|
|
95
89
|
if (newValue) f7Panel.current.enableResizable();else f7Panel.current.disableResizable();
|
|
@@ -175,10 +169,15 @@ const Panel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
175
169
|
id: id,
|
|
176
170
|
style: style,
|
|
177
171
|
className: classes,
|
|
178
|
-
ref:
|
|
172
|
+
ref: el => {
|
|
173
|
+
elRef.current = el;
|
|
174
|
+
setRef(ref, el, {
|
|
175
|
+
f7Panel: () => f7Panel.current
|
|
176
|
+
});
|
|
177
|
+
}
|
|
179
178
|
}, extraAttrs), children, resizable && /*#__PURE__*/React.createElement("div", {
|
|
180
179
|
className: "panel-resize-handler"
|
|
181
180
|
}));
|
|
182
|
-
}
|
|
181
|
+
};
|
|
183
182
|
Panel.displayName = 'f7-panel';
|
|
184
183
|
export default Panel;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRef } from 'react';
|
|
2
2
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
3
3
|
import { extend, emit } from '../shared/utils.js';
|
|
4
4
|
import { watchProp } from '../shared/watch-prop.js';
|
|
5
5
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
6
|
+
import { setRef } from '../shared/set-ref.js';
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
const PhotoBrowser = /*#__PURE__*/forwardRef((props, ref) => {
|
|
9
|
+
const PhotoBrowser = props => {
|
|
10
10
|
const f7PhotoBrowser = useRef(null);
|
|
11
11
|
const {
|
|
12
12
|
init = true,
|
|
@@ -23,7 +23,6 @@ const PhotoBrowser = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
23
23
|
iconsColor,
|
|
24
24
|
swipeToClose = true,
|
|
25
25
|
pageBackLinkText,
|
|
26
|
-
popupCloseLinkIcon,
|
|
27
26
|
popupCloseLinkText,
|
|
28
27
|
navbarOfText,
|
|
29
28
|
navbarShowCount,
|
|
@@ -41,7 +40,8 @@ const PhotoBrowser = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41
40
|
renderPage,
|
|
42
41
|
renderPopup,
|
|
43
42
|
renderStandalone,
|
|
44
|
-
renderThumb
|
|
43
|
+
renderThumb,
|
|
44
|
+
ref
|
|
45
45
|
} = props;
|
|
46
46
|
const open = index => {
|
|
47
47
|
return f7PhotoBrowser.current.open(index);
|
|
@@ -58,14 +58,6 @@ const PhotoBrowser = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
58
58
|
const expositionDisable = () => {
|
|
59
59
|
return f7PhotoBrowser.current.expositionDisable();
|
|
60
60
|
};
|
|
61
|
-
useImperativeHandle(ref, () => ({
|
|
62
|
-
f7PhotoBrowser: () => f7PhotoBrowser.current,
|
|
63
|
-
open,
|
|
64
|
-
close,
|
|
65
|
-
expositionToggle,
|
|
66
|
-
expositionEnable,
|
|
67
|
-
expositionDisable
|
|
68
|
-
}));
|
|
69
61
|
watchProp(photos, newValue => {
|
|
70
62
|
const pb = f7PhotoBrowser.current;
|
|
71
63
|
if (!pb) return;
|
|
@@ -103,7 +95,6 @@ const PhotoBrowser = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
103
95
|
swipeToClose,
|
|
104
96
|
pageBackLinkText,
|
|
105
97
|
popupCloseLinkText,
|
|
106
|
-
popupCloseLinkIcon,
|
|
107
98
|
navbarOfText,
|
|
108
99
|
navbarShowCount,
|
|
109
100
|
swiper,
|
|
@@ -156,7 +147,15 @@ const PhotoBrowser = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
156
147
|
onMount();
|
|
157
148
|
return onDestroy;
|
|
158
149
|
}, []);
|
|
150
|
+
setRef(ref, null, {
|
|
151
|
+
open,
|
|
152
|
+
close,
|
|
153
|
+
expositionToggle,
|
|
154
|
+
expositionEnable,
|
|
155
|
+
expositionDisable,
|
|
156
|
+
f7PhotoBrowser: () => f7PhotoBrowser.current
|
|
157
|
+
});
|
|
159
158
|
return null;
|
|
160
|
-
}
|
|
159
|
+
};
|
|
161
160
|
PhotoBrowser.displayName = 'f7-photo-browser';
|
|
162
161
|
export default PhotoBrowser;
|
package/components/pie-chart.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
3
3
|
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
4
4
|
import { f7 } from '../shared/f7.js';
|
|
5
|
+
import { setRef } from '../shared/set-ref.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const PieChart = props => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
10
10
|
id,
|
|
@@ -13,16 +13,14 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
13
13
|
tooltip = false,
|
|
14
14
|
datasets = [],
|
|
15
15
|
formatTooltip,
|
|
16
|
-
children
|
|
16
|
+
children,
|
|
17
|
+
ref
|
|
17
18
|
} = props;
|
|
18
19
|
const extraAttrs = getExtraAttrs(props);
|
|
19
20
|
const [currentIndex, setCurrentIndex] = useState(null);
|
|
20
21
|
const previousIndex = useRef(null);
|
|
21
22
|
const elRef = useRef(null);
|
|
22
23
|
const f7Tooltip = useRef(null);
|
|
23
|
-
useImperativeHandle(ref, () => ({
|
|
24
|
-
el: elRef.current
|
|
25
|
-
}));
|
|
26
24
|
const getSummValue = () => {
|
|
27
25
|
let summ = 0;
|
|
28
26
|
datasets.map(d => d.value || 0).forEach(value => {
|
|
@@ -38,12 +36,11 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
38
36
|
const y = Math.sin(2 * Math.PI * percentage) * (size / 3);
|
|
39
37
|
return [x, y];
|
|
40
38
|
}
|
|
41
|
-
datasets.forEach(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} = _ref;
|
|
39
|
+
datasets.forEach(({
|
|
40
|
+
value,
|
|
41
|
+
label,
|
|
42
|
+
color
|
|
43
|
+
}) => {
|
|
47
44
|
const percentage = value / getSummValue();
|
|
48
45
|
const [startX, startY] = getCoordinatesForPercentage(cumulativePercentage);
|
|
49
46
|
cumulativePercentage += percentage;
|
|
@@ -134,7 +131,10 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
134
131
|
id: id,
|
|
135
132
|
style: style,
|
|
136
133
|
className: classes,
|
|
137
|
-
ref:
|
|
134
|
+
ref: el => {
|
|
135
|
+
elRef.current = el;
|
|
136
|
+
setRef(ref, el);
|
|
137
|
+
}
|
|
138
138
|
}, extraAttrs), /*#__PURE__*/React.createElement("svg", {
|
|
139
139
|
xmlns: "http://www.w3.org/2000/svg",
|
|
140
140
|
width: size,
|
|
@@ -155,6 +155,6 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
155
155
|
onMouseEnter: () => setCurrentIndex(index),
|
|
156
156
|
onMouseLeave: () => setCurrentIndex(null)
|
|
157
157
|
}))), children);
|
|
158
|
-
}
|
|
158
|
+
};
|
|
159
159
|
PieChart.displayName = 'f7-pie-chart';
|
|
160
160
|
export default PieChart;
|
package/components/popover.d.ts
CHANGED
package/components/popover.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
4
4
|
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
6
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
7
7
|
import { watchProp } from '../shared/watch-prop.js';
|
|
8
8
|
import { modalStateClasses } from '../shared/modal-state-classes.js';
|
|
9
|
+
import { setRef } from '../shared/set-ref.js';
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
const Popover = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
|
+
const Popover = props => {
|
|
13
13
|
const f7Popover = useRef(null);
|
|
14
14
|
const {
|
|
15
15
|
className,
|
|
@@ -19,14 +19,14 @@ const Popover = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
19
19
|
opened,
|
|
20
20
|
animate,
|
|
21
21
|
targetEl,
|
|
22
|
-
arrow,
|
|
23
22
|
backdrop,
|
|
24
23
|
backdropEl,
|
|
25
24
|
closeByBackdropClick,
|
|
26
25
|
closeByOutsideClick,
|
|
27
26
|
closeOnEscape,
|
|
28
27
|
containerEl,
|
|
29
|
-
verticalPosition
|
|
28
|
+
verticalPosition,
|
|
29
|
+
ref
|
|
30
30
|
} = props;
|
|
31
31
|
const extraAttrs = getExtraAttrs(props);
|
|
32
32
|
const elRef = useRef(null);
|
|
@@ -49,10 +49,6 @@ const Popover = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
49
49
|
isClosing.current = false;
|
|
50
50
|
emit(props, 'popoverClosed', instance);
|
|
51
51
|
};
|
|
52
|
-
useImperativeHandle(ref, () => ({
|
|
53
|
-
el: elRef.current,
|
|
54
|
-
f7Popover: () => f7Popover.current
|
|
55
|
-
}));
|
|
56
52
|
watchProp(opened, value => {
|
|
57
53
|
if (!f7Popover.current) return;
|
|
58
54
|
if (value) {
|
|
@@ -77,7 +73,6 @@ const Popover = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
77
73
|
if ('closeByBackdropClick' in props) popoverParams.closeByBackdropClick = closeByBackdropClick;
|
|
78
74
|
if ('closeByOutsideClick' in props) popoverParams.closeByOutsideClick = closeByOutsideClick;
|
|
79
75
|
if ('closeOnEscape' in props) popoverParams.closeOnEscape = closeOnEscape;
|
|
80
|
-
if ('arrow' in props) popoverParams.arrow = arrow;
|
|
81
76
|
if ('backdrop' in props) popoverParams.backdrop = backdrop;
|
|
82
77
|
if ('backdropEl' in props) popoverParams.backdropEl = backdropEl;
|
|
83
78
|
if ('animate' in props) popoverParams.animate = animate;
|
|
@@ -115,12 +110,15 @@ const Popover = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
115
110
|
id: id,
|
|
116
111
|
style: style,
|
|
117
112
|
className: classes,
|
|
118
|
-
ref:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
ref: el => {
|
|
114
|
+
elRef.current = el;
|
|
115
|
+
setRef(ref, el, {
|
|
116
|
+
f7Popover: () => f7Popover.current
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}, extraAttrs), /*#__PURE__*/React.createElement("div", {
|
|
122
120
|
className: "popover-inner"
|
|
123
121
|
}, children));
|
|
124
|
-
}
|
|
122
|
+
};
|
|
125
123
|
Popover.displayName = 'f7-popover';
|
|
126
124
|
export default Popover;
|
package/components/popup.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { f7, f7ready } from '../shared/f7.js';
|
|
4
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
5
5
|
import { modalStateClasses } from '../shared/modal-state-classes.js';
|
|
6
6
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
7
7
|
import { classNames, emit, getExtraAttrs } from '../shared/utils.js';
|
|
8
8
|
import { watchProp } from '../shared/watch-prop.js';
|
|
9
|
+
import { setRef } from '../shared/set-ref.js';
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
const Popup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
|
+
const Popup = props => {
|
|
13
13
|
const f7Popup = useRef(null);
|
|
14
14
|
const {
|
|
15
15
|
className,
|
|
@@ -26,7 +26,8 @@ const Popup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26
26
|
closeOnEscape,
|
|
27
27
|
swipeToClose = false,
|
|
28
28
|
swipeHandler,
|
|
29
|
-
containerEl
|
|
29
|
+
containerEl,
|
|
30
|
+
ref
|
|
30
31
|
} = props;
|
|
31
32
|
const extraAttrs = getExtraAttrs(props);
|
|
32
33
|
const elRef = useRef(null);
|
|
@@ -61,10 +62,6 @@ const Popup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
61
62
|
isClosing.current = false;
|
|
62
63
|
emit(props, 'popupClosed', instance);
|
|
63
64
|
};
|
|
64
|
-
useImperativeHandle(ref, () => ({
|
|
65
|
-
el: elRef.current,
|
|
66
|
-
f7Popup: () => f7Popup.current
|
|
67
|
-
}));
|
|
68
65
|
watchProp(opened, value => {
|
|
69
66
|
if (!f7Popup.current) return;
|
|
70
67
|
if (value) {
|
|
@@ -132,8 +129,13 @@ const Popup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
132
129
|
id: id,
|
|
133
130
|
style: style,
|
|
134
131
|
className: classes,
|
|
135
|
-
ref:
|
|
132
|
+
ref: el => {
|
|
133
|
+
elRef.current = el;
|
|
134
|
+
setRef(ref, el, {
|
|
135
|
+
f7Popup: () => f7Popup.current
|
|
136
|
+
});
|
|
137
|
+
}
|
|
136
138
|
}, extraAttrs), children);
|
|
137
|
-
}
|
|
139
|
+
};
|
|
138
140
|
Popup.displayName = 'f7-popup';
|
|
139
141
|
export default Popup;
|
package/components/preloader.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { classNames, getExtraAttrs, extend } from '../shared/utils.js';
|
|
4
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
5
5
|
import { useTheme } from '../shared/use-theme.js';
|
|
6
|
+
import { setRef } from '../shared/set-ref.js';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const Preloader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
|
+
const Preloader = props => {
|
|
9
9
|
const theme = useTheme();
|
|
10
10
|
const {
|
|
11
11
|
className,
|
|
12
12
|
id,
|
|
13
13
|
style,
|
|
14
|
-
size
|
|
14
|
+
size,
|
|
15
|
+
ref
|
|
15
16
|
} = props;
|
|
16
17
|
const extraAttrs = getExtraAttrs(props);
|
|
17
18
|
const elRef = useRef(null);
|
|
18
|
-
useImperativeHandle(ref, () => ({
|
|
19
|
-
el: elRef.current
|
|
20
|
-
}));
|
|
21
19
|
const preloaderStyle = {};
|
|
22
20
|
let sizeComputed = size;
|
|
23
21
|
if (sizeComputed && typeof sizeComputed === 'string' && sizeComputed.indexOf('px') >= 0) {
|
|
@@ -72,8 +70,11 @@ const Preloader = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
72
70
|
id: id,
|
|
73
71
|
style: preloaderStyle,
|
|
74
72
|
className: classes,
|
|
75
|
-
ref:
|
|
73
|
+
ref: el => {
|
|
74
|
+
elRef.current = el;
|
|
75
|
+
setRef(ref, el);
|
|
76
|
+
}
|
|
76
77
|
}, extraAttrs), innerEl);
|
|
77
|
-
}
|
|
78
|
+
};
|
|
78
79
|
Preloader.displayName = 'f7-preloader';
|
|
79
80
|
export default Preloader;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
4
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
5
5
|
import { f7 } from '../shared/f7.js';
|
|
6
|
+
import { setRef } from '../shared/set-ref.js';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const Progressbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
|
+
const Progressbar = props => {
|
|
9
9
|
const {
|
|
10
10
|
className,
|
|
11
11
|
id,
|
|
12
12
|
style,
|
|
13
13
|
progress,
|
|
14
|
-
infinite
|
|
14
|
+
infinite,
|
|
15
|
+
ref
|
|
15
16
|
} = props;
|
|
16
17
|
const extraAttrs = getExtraAttrs(props);
|
|
17
18
|
const elRef = useRef(null);
|
|
@@ -19,10 +20,6 @@ const Progressbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
19
20
|
if (!f7) return;
|
|
20
21
|
f7.progressbar.set(elRef.current, newProgress, speed);
|
|
21
22
|
};
|
|
22
|
-
useImperativeHandle(ref, () => ({
|
|
23
|
-
el: elRef.current,
|
|
24
|
-
set
|
|
25
|
-
}));
|
|
26
23
|
const transformStyle = {
|
|
27
24
|
transform: progress ? `translate3d(${-100 + progress}%, 0, 0)` : '',
|
|
28
25
|
WebkitTransform: progress ? `translate3d(${-100 + progress}%, 0, 0)` : ''
|
|
@@ -31,7 +28,12 @@ const Progressbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
31
28
|
'progressbar-infinite': infinite
|
|
32
29
|
}, colorClasses(props));
|
|
33
30
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
34
|
-
ref:
|
|
31
|
+
ref: el => {
|
|
32
|
+
elRef.current = el;
|
|
33
|
+
setRef(ref, el, {
|
|
34
|
+
set
|
|
35
|
+
});
|
|
36
|
+
},
|
|
35
37
|
id: id,
|
|
36
38
|
style: style,
|
|
37
39
|
className: classes,
|
|
@@ -39,6 +41,6 @@ const Progressbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
39
41
|
}, extraAttrs), /*#__PURE__*/React.createElement("span", {
|
|
40
42
|
style: transformStyle
|
|
41
43
|
}));
|
|
42
|
-
}
|
|
44
|
+
};
|
|
43
45
|
Progressbar.displayName = 'f7-progressbar';
|
|
44
46
|
export default Progressbar;
|
package/components/radio.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
4
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
5
|
+
import { setRef } from '../shared/set-ref.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
const Radio = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const Radio = props => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
10
10
|
id,
|
|
@@ -14,16 +14,14 @@ const Radio = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
14
14
|
disabled,
|
|
15
15
|
readonly,
|
|
16
16
|
checked,
|
|
17
|
-
defaultChecked
|
|
17
|
+
defaultChecked,
|
|
18
|
+
ref
|
|
18
19
|
} = props;
|
|
19
20
|
const extraAttrs = getExtraAttrs(props);
|
|
20
21
|
const elRef = useRef(null);
|
|
21
22
|
const onChange = event => {
|
|
22
23
|
emit(props, 'change', event);
|
|
23
24
|
};
|
|
24
|
-
useImperativeHandle(ref, () => ({
|
|
25
|
-
el: elRef.current
|
|
26
|
-
}));
|
|
27
25
|
const inputEl = /*#__PURE__*/React.createElement("input", {
|
|
28
26
|
type: "radio",
|
|
29
27
|
name: name,
|
|
@@ -44,8 +42,11 @@ const Radio = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
44
42
|
id: id,
|
|
45
43
|
style: style,
|
|
46
44
|
className: classes,
|
|
47
|
-
ref:
|
|
45
|
+
ref: el => {
|
|
46
|
+
elRef.current = el;
|
|
47
|
+
setRef(ref, el);
|
|
48
|
+
}
|
|
48
49
|
}, extraAttrs), inputEl, iconEl, children);
|
|
49
|
-
}
|
|
50
|
+
};
|
|
50
51
|
Radio.displayName = 'f7-radio';
|
|
51
52
|
export default Radio;
|
package/components/range.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
4
4
|
import { classNames, getExtraAttrs, noUndefinedProps, emit } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
6
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
7
7
|
import { watchProp } from '../shared/watch-prop.js';
|
|
8
|
+
import { setRef } from '../shared/set-ref.js';
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
const Range = /*#__PURE__*/forwardRef((props, ref) => {
|
|
11
|
+
const Range = props => {
|
|
12
12
|
const f7Range = useRef(null);
|
|
13
13
|
const {
|
|
14
14
|
className,
|
|
@@ -34,14 +34,11 @@ const Range = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
34
34
|
name,
|
|
35
35
|
input,
|
|
36
36
|
inputId,
|
|
37
|
-
disabled
|
|
37
|
+
disabled,
|
|
38
|
+
ref
|
|
38
39
|
} = props;
|
|
39
40
|
const extraAttrs = getExtraAttrs(props);
|
|
40
41
|
const elRef = useRef(null);
|
|
41
|
-
useImperativeHandle(ref, () => ({
|
|
42
|
-
el: elRef.current,
|
|
43
|
-
f7Range: () => f7Range.current
|
|
44
|
-
}));
|
|
45
42
|
watchProp(value, newValue => {
|
|
46
43
|
if (!f7Range.current) return;
|
|
47
44
|
const rangeValue = f7Range.current.value;
|
|
@@ -109,15 +106,20 @@ const Range = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
109
106
|
disabled
|
|
110
107
|
}, colorClasses(props));
|
|
111
108
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
112
|
-
ref: elRef,
|
|
113
109
|
id: id,
|
|
114
110
|
style: style,
|
|
115
|
-
className: classes
|
|
111
|
+
className: classes,
|
|
112
|
+
ref: el => {
|
|
113
|
+
elRef.current = el;
|
|
114
|
+
setRef(ref, el, {
|
|
115
|
+
f7Range: () => f7Range.current
|
|
116
|
+
});
|
|
117
|
+
}
|
|
116
118
|
}, extraAttrs), input && /*#__PURE__*/React.createElement("input", {
|
|
117
119
|
type: "range",
|
|
118
120
|
name: name,
|
|
119
121
|
id: inputId
|
|
120
122
|
}), children);
|
|
121
|
-
}
|
|
123
|
+
};
|
|
122
124
|
Range.displayName = 'f7-range';
|
|
123
125
|
export default Range;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React, {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useRef, useState } from 'react';
|
|
3
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
4
4
|
import { f7events, f7routers, f7 } from '../shared/f7.js';
|
|
5
|
+
import { setRef } from '../shared/set-ref.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
const
|
|
7
|
+
const RoutableModals = props => {
|
|
8
|
+
const {
|
|
9
|
+
ref
|
|
10
|
+
} = props;
|
|
8
11
|
const [modals, setModals] = useState([]);
|
|
9
12
|
const elRef = useRef(null);
|
|
10
13
|
const routerData = useRef(null);
|
|
11
|
-
useImperativeHandle(ref, () => ({
|
|
12
|
-
el: elRef.current
|
|
13
|
-
}));
|
|
14
14
|
const onMount = () => {
|
|
15
15
|
routerData.current = {
|
|
16
16
|
modals,
|
|
@@ -35,18 +35,20 @@ const RoutableModals = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
35
35
|
f7events.emit('modalsRouterDidUpdate', routerData.current);
|
|
36
36
|
});
|
|
37
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
38
|
-
ref:
|
|
38
|
+
ref: el => {
|
|
39
|
+
elRef.current = el;
|
|
40
|
+
setRef(ref, el);
|
|
41
|
+
},
|
|
39
42
|
className: "framework7-modals"
|
|
40
|
-
}, modals.map(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} = _ref;
|
|
43
|
+
}, modals.map(({
|
|
44
|
+
component: ModalComponent,
|
|
45
|
+
id: modalId,
|
|
46
|
+
props: modalProps
|
|
47
|
+
}) => {
|
|
46
48
|
return /*#__PURE__*/React.createElement(ModalComponent, _extends({
|
|
47
49
|
key: modalId
|
|
48
50
|
}, modalProps));
|
|
49
51
|
}));
|
|
50
|
-
}
|
|
52
|
+
};
|
|
51
53
|
RoutableModals.displayName = 'f7-routable-modals';
|
|
52
54
|
export default RoutableModals;
|