framework7-react 8.3.3 → 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 +14 -11
- 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/fab-button.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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
5
|
import { useTooltip } from '../shared/use-tooltip.js';
|
|
6
|
+
import { setRef } from '../shared/set-ref.js';
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
const FabButton =
|
|
9
|
+
const FabButton = props => {
|
|
9
10
|
const {
|
|
10
11
|
className,
|
|
11
12
|
id,
|
|
@@ -13,16 +14,14 @@ const FabButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
13
14
|
children,
|
|
14
15
|
fabClose,
|
|
15
16
|
label,
|
|
16
|
-
target
|
|
17
|
+
target,
|
|
18
|
+
ref
|
|
17
19
|
} = props;
|
|
18
20
|
const extraAttrs = getExtraAttrs(props);
|
|
19
21
|
const elRef = useRef(null);
|
|
20
22
|
const onClick = e => {
|
|
21
23
|
emit(props, 'click', e);
|
|
22
24
|
};
|
|
23
|
-
useImperativeHandle(ref, () => ({
|
|
24
|
-
el: elRef.current
|
|
25
|
-
}));
|
|
26
25
|
useTooltip(elRef, props);
|
|
27
26
|
const classes = classNames(className, {
|
|
28
27
|
'fab-close': fabClose,
|
|
@@ -39,10 +38,13 @@ const FabButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
39
38
|
style: style,
|
|
40
39
|
target: target,
|
|
41
40
|
className: classes,
|
|
42
|
-
ref:
|
|
41
|
+
ref: el => {
|
|
42
|
+
elRef.current = el;
|
|
43
|
+
setRef(ref, el);
|
|
44
|
+
}
|
|
43
45
|
}, extraAttrs, {
|
|
44
46
|
onClick: onClick
|
|
45
47
|
}), children, labelEl);
|
|
46
|
-
}
|
|
48
|
+
};
|
|
47
49
|
FabButton.displayName = 'f7-fab-button';
|
|
48
50
|
export default FabButton;
|
|
@@ -1,29 +1,31 @@
|
|
|
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
|
+
import { setRef } from '../shared/set-ref.js';
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
const FabButtons =
|
|
8
|
+
const FabButtons = props => {
|
|
8
9
|
const {
|
|
9
10
|
className,
|
|
10
11
|
id,
|
|
11
12
|
style,
|
|
12
13
|
children,
|
|
13
|
-
position
|
|
14
|
+
position,
|
|
15
|
+
ref
|
|
14
16
|
} = props;
|
|
15
17
|
const extraAttrs = getExtraAttrs(props);
|
|
16
18
|
const elRef = useRef(null);
|
|
17
|
-
useImperativeHandle(ref, () => ({
|
|
18
|
-
el: elRef.current
|
|
19
|
-
}));
|
|
20
19
|
const classes = classNames(className, 'fab-buttons', `fab-buttons-${position}`, colorClasses(props));
|
|
21
20
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
22
21
|
id: id,
|
|
23
22
|
style: style,
|
|
24
23
|
className: classes,
|
|
25
|
-
ref:
|
|
24
|
+
ref: el => {
|
|
25
|
+
elRef.current = el;
|
|
26
|
+
setRef(ref, el);
|
|
27
|
+
}
|
|
26
28
|
}, extraAttrs), children);
|
|
27
|
-
}
|
|
29
|
+
};
|
|
28
30
|
FabButtons.displayName = 'f7-fab-buttons';
|
|
29
31
|
export default FabButtons;
|
package/components/fab.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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, getSlots, emit } from '../shared/utils.js';
|
|
4
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
5
5
|
import { useTooltip } from '../shared/use-tooltip.js';
|
|
6
|
+
import { setRef } from '../shared/set-ref.js';
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
const Fab =
|
|
9
|
+
const Fab = props => {
|
|
9
10
|
const {
|
|
10
11
|
className,
|
|
11
12
|
id,
|
|
@@ -14,16 +15,14 @@ const Fab = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
14
15
|
href,
|
|
15
16
|
target,
|
|
16
17
|
text,
|
|
17
|
-
position = 'right-bottom'
|
|
18
|
+
position = 'right-bottom',
|
|
19
|
+
ref
|
|
18
20
|
} = props;
|
|
19
21
|
const extraAttrs = getExtraAttrs(props);
|
|
20
22
|
const elRef = useRef(null);
|
|
21
23
|
const onClick = e => {
|
|
22
24
|
emit(props, 'click', e);
|
|
23
25
|
};
|
|
24
|
-
useImperativeHandle(ref, () => ({
|
|
25
|
-
el: elRef.current
|
|
26
|
-
}));
|
|
27
26
|
useTooltip(elRef, props);
|
|
28
27
|
let hrefComputed = href;
|
|
29
28
|
if (hrefComputed === true) hrefComputed = '#';
|
|
@@ -69,8 +68,11 @@ const Fab = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
69
68
|
style: style,
|
|
70
69
|
className: classes,
|
|
71
70
|
"data-morph-to": morphTo,
|
|
72
|
-
ref:
|
|
71
|
+
ref: el => {
|
|
72
|
+
elRef.current = el;
|
|
73
|
+
setRef(ref, el);
|
|
74
|
+
}
|
|
73
75
|
}, extraAttrs), linkEl, rootChildren, rootSlots);
|
|
74
|
-
}
|
|
76
|
+
};
|
|
75
77
|
Fab.displayName = 'f7-fab';
|
|
76
78
|
export default Fab;
|
package/components/gauge.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
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
2
|
/* eslint no-nested-ternary: off */
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { useRef } from 'react';
|
|
4
4
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
|
+
import { setRef } from '../shared/set-ref.js';
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
const Gauge =
|
|
8
|
+
const Gauge = props => {
|
|
8
9
|
const {
|
|
9
10
|
className,
|
|
10
11
|
id,
|
|
@@ -23,13 +24,11 @@ const Gauge = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
23
24
|
labelText,
|
|
24
25
|
labelTextColor = '#888888',
|
|
25
26
|
labelFontSize = 14,
|
|
26
|
-
labelFontWeight = 400
|
|
27
|
+
labelFontWeight = 400,
|
|
28
|
+
ref
|
|
27
29
|
} = props;
|
|
28
30
|
const extraAttrs = getExtraAttrs(props);
|
|
29
31
|
const elRef = useRef(null);
|
|
30
|
-
useImperativeHandle(ref, () => ({
|
|
31
|
-
el: elRef.current
|
|
32
|
-
}));
|
|
33
32
|
const classes = classNames(className, 'gauge');
|
|
34
33
|
const semiCircle = type === 'semicircle';
|
|
35
34
|
const radius = size / 2 - borderWidth / 2;
|
|
@@ -39,7 +38,10 @@ const Gauge = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
39
38
|
id: id,
|
|
40
39
|
style: style,
|
|
41
40
|
className: classes,
|
|
42
|
-
ref:
|
|
41
|
+
ref: el => {
|
|
42
|
+
elRef.current = el;
|
|
43
|
+
setRef(ref, el);
|
|
44
|
+
}
|
|
43
45
|
}, extraAttrs), /*#__PURE__*/React.createElement("svg", {
|
|
44
46
|
className: "gauge-svg",
|
|
45
47
|
width: `${size}px`,
|
|
@@ -99,6 +101,6 @@ const Gauge = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
99
101
|
textAnchor: "middle",
|
|
100
102
|
dominantBaseline: !semiCircle ? 'middle' : null
|
|
101
103
|
}, labelText)));
|
|
102
|
-
}
|
|
104
|
+
};
|
|
103
105
|
Gauge.displayName = 'f7-gauge';
|
|
104
106
|
export default Gauge;
|
package/components/icon.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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 { useTooltip } from '../shared/use-tooltip.js';
|
|
6
6
|
import { useTheme } from '../shared/use-theme.js';
|
|
7
|
+
import { setRef } from '../shared/set-ref.js';
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
const Icon =
|
|
10
|
+
const Icon = props => {
|
|
10
11
|
const theme = useTheme();
|
|
11
12
|
const {
|
|
12
13
|
className,
|
|
@@ -18,13 +19,11 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
18
19
|
icon,
|
|
19
20
|
md,
|
|
20
21
|
ios,
|
|
21
|
-
size
|
|
22
|
+
size,
|
|
23
|
+
ref
|
|
22
24
|
} = props;
|
|
23
25
|
const extraAttrs = getExtraAttrs(props);
|
|
24
26
|
const elRef = useRef(null);
|
|
25
|
-
useImperativeHandle(ref, () => ({
|
|
26
|
-
el: elRef.current
|
|
27
|
-
}));
|
|
28
27
|
useTooltip(elRef, props);
|
|
29
28
|
const getClasses = () => {
|
|
30
29
|
let classes = {
|
|
@@ -75,8 +74,11 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
75
74
|
height: sizeComputed
|
|
76
75
|
}, style),
|
|
77
76
|
className: getClasses(),
|
|
78
|
-
ref:
|
|
77
|
+
ref: el => {
|
|
78
|
+
elRef.current = el;
|
|
79
|
+
setRef(ref, el);
|
|
80
|
+
}
|
|
79
81
|
}, extraAttrs), getIconText(), children);
|
|
80
|
-
}
|
|
82
|
+
};
|
|
81
83
|
Icon.displayName = 'f7-icon';
|
|
82
84
|
export default Icon;
|
package/components/input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 { classNames, getExtraAttrs, getSlots, emit, extend } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
@@ -8,9 +8,10 @@ import { watchProp } from '../shared/watch-prop.js';
|
|
|
8
8
|
import Toggle from './toggle.js';
|
|
9
9
|
import Range from './range.js';
|
|
10
10
|
import TextEditor from './text-editor.js';
|
|
11
|
+
import { setRef } from '../shared/set-ref.js';
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
const Input =
|
|
14
|
+
const Input = props => {
|
|
14
15
|
const {
|
|
15
16
|
className,
|
|
16
17
|
id,
|
|
@@ -66,7 +67,8 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
66
67
|
// Colorpicker
|
|
67
68
|
colorPickerParams,
|
|
68
69
|
// Text editor
|
|
69
|
-
textEditorParams
|
|
70
|
+
textEditorParams,
|
|
71
|
+
ref
|
|
70
72
|
} = props;
|
|
71
73
|
const [inputInvalid, setInputInvalid] = useState(false);
|
|
72
74
|
const [inputFocused, setInputFocused] = useState(false);
|
|
@@ -115,44 +117,29 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
115
117
|
const onInputClear = event => {
|
|
116
118
|
emit(props, 'inputClear', event);
|
|
117
119
|
};
|
|
118
|
-
const onInput =
|
|
119
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
120
|
-
args[_key] = arguments[_key];
|
|
121
|
-
}
|
|
120
|
+
const onInput = (...args) => {
|
|
122
121
|
emit(props, 'input', ...args);
|
|
123
122
|
if (!(validateOnBlur || validateOnBlur === '') && (validate || validate === '') && inputElRef.current) {
|
|
124
123
|
validateInput();
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
|
-
const onFocus =
|
|
128
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
129
|
-
args[_key2] = arguments[_key2];
|
|
130
|
-
}
|
|
126
|
+
const onFocus = (...args) => {
|
|
131
127
|
emit(props, 'focus', ...args);
|
|
132
128
|
setInputFocused(true);
|
|
133
129
|
};
|
|
134
|
-
const onBlur =
|
|
135
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
136
|
-
args[_key3] = arguments[_key3];
|
|
137
|
-
}
|
|
130
|
+
const onBlur = (...args) => {
|
|
138
131
|
emit(props, 'blur', ...args);
|
|
139
132
|
if ((validate || validate === '' || validateOnBlur || validateOnBlur === '') && inputElRef.current) {
|
|
140
133
|
validateInput();
|
|
141
134
|
}
|
|
142
135
|
setInputFocused(false);
|
|
143
136
|
};
|
|
144
|
-
const onChange =
|
|
145
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
146
|
-
args[_key4] = arguments[_key4];
|
|
147
|
-
}
|
|
137
|
+
const onChange = (...args) => {
|
|
148
138
|
emit(props, 'change', ...args);
|
|
149
139
|
if (type === 'texteditor') {
|
|
150
140
|
emit(props, 'textEditorChange', args[1]);
|
|
151
141
|
}
|
|
152
142
|
};
|
|
153
|
-
useImperativeHandle(ref, () => ({
|
|
154
|
-
el: elRef.current
|
|
155
|
-
}));
|
|
156
143
|
const onMount = () => {
|
|
157
144
|
f7ready(() => {
|
|
158
145
|
if (type === 'range' || type === 'toggle') return;
|
|
@@ -378,7 +365,10 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
378
365
|
id: id,
|
|
379
366
|
className: wrapClasses,
|
|
380
367
|
style: style,
|
|
381
|
-
ref:
|
|
368
|
+
ref: el => {
|
|
369
|
+
elRef.current = el;
|
|
370
|
+
setRef(ref, el);
|
|
371
|
+
}
|
|
382
372
|
}, extraAttrs), inputEl, (errorMessage || slots['error-message'] && slots['error-message'].length) && errorMessageForce && /*#__PURE__*/React.createElement("div", {
|
|
383
373
|
className: "input-error-message"
|
|
384
374
|
}, errorMessage, slots['error-message']), clearButton && /*#__PURE__*/React.createElement("span", {
|
|
@@ -388,6 +378,6 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
388
378
|
}, info, slots.info));
|
|
389
379
|
}
|
|
390
380
|
return inputEl;
|
|
391
|
-
}
|
|
381
|
+
};
|
|
392
382
|
Input.displayName = 'f7-input';
|
|
393
383
|
export default Input;
|
package/components/link.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, useContext } from 'react';
|
|
3
3
|
import { classNames, getExtraAttrs, isStringProp, emit } from '../shared/utils.js';
|
|
4
4
|
import { colorClasses, routerAttrs, routerClasses, actionsAttrs, actionsClasses } from '../shared/mixins.js';
|
|
5
5
|
import { useIcon } from '../shared/use-icon.js';
|
|
@@ -8,10 +8,11 @@ import { useTooltip } from '../shared/use-tooltip.js';
|
|
|
8
8
|
import { TabbarContext } from '../shared/tabbar-context.js';
|
|
9
9
|
import Badge from './badge.js';
|
|
10
10
|
import { useSmartSelect } from '../shared/use-smart-select.js';
|
|
11
|
+
import { setRef } from '../shared/set-ref.js';
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
const Link =
|
|
15
|
+
const Link = props => {
|
|
15
16
|
const f7SmartSelect = useRef(null);
|
|
16
17
|
const {
|
|
17
18
|
className,
|
|
@@ -30,7 +31,8 @@ const Link = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
30
31
|
target,
|
|
31
32
|
// Smart Select
|
|
32
33
|
smartSelect,
|
|
33
|
-
smartSelectParams
|
|
34
|
+
smartSelectParams,
|
|
35
|
+
ref
|
|
34
36
|
} = props;
|
|
35
37
|
const tabbarContext = useContext(TabbarContext);
|
|
36
38
|
const isTabbarIcons = tabbarLabel || tabbarContext.tabbarHasIcons;
|
|
@@ -39,10 +41,6 @@ const Link = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
39
41
|
const onClick = e => {
|
|
40
42
|
emit(props, 'click', e);
|
|
41
43
|
};
|
|
42
|
-
useImperativeHandle(ref, () => ({
|
|
43
|
-
el: elRef.current,
|
|
44
|
-
f7SmartSelect: () => f7SmartSelect.current
|
|
45
|
-
}));
|
|
46
44
|
useTooltip(elRef, props);
|
|
47
45
|
useRouteProps(elRef, props);
|
|
48
46
|
useSmartSelect(smartSelect, smartSelectParams, f7SmartSelect, () => {
|
|
@@ -83,13 +81,18 @@ const Link = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
83
81
|
...actionsAttrs(props)
|
|
84
82
|
};
|
|
85
83
|
return /*#__PURE__*/React.createElement("a", _extends({
|
|
86
|
-
ref:
|
|
84
|
+
ref: el => {
|
|
85
|
+
elRef.current = el;
|
|
86
|
+
setRef(ref, el, {
|
|
87
|
+
f7SmartSelect: () => f7SmartSelect.current
|
|
88
|
+
});
|
|
89
|
+
},
|
|
87
90
|
id: id,
|
|
88
91
|
style: style,
|
|
89
92
|
className: classes
|
|
90
93
|
}, attrs, extraAttrs, {
|
|
91
94
|
onClick: onClick
|
|
92
95
|
}), iconEl, textEl, children);
|
|
93
|
-
}
|
|
96
|
+
};
|
|
94
97
|
Link.displayName = 'f7-link';
|
|
95
98
|
export default Link;
|
|
@@ -1,12 +1,13 @@
|
|
|
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, isStringProp, emit } from '../shared/utils.js';
|
|
4
4
|
import { colorClasses, actionsAttrs, actionsClasses, routerAttrs, routerClasses } from '../shared/mixins.js';
|
|
5
5
|
import { useTooltip } from '../shared/use-tooltip.js';
|
|
6
6
|
import { useRouteProps } from '../shared/use-route-props.js';
|
|
7
|
+
import { setRef } from '../shared/set-ref.js';
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
const ListButton =
|
|
10
|
+
const ListButton = props => {
|
|
10
11
|
const {
|
|
11
12
|
className,
|
|
12
13
|
id,
|
|
@@ -18,7 +19,8 @@ const ListButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
18
19
|
tabLinkActive,
|
|
19
20
|
link,
|
|
20
21
|
href,
|
|
21
|
-
target
|
|
22
|
+
target,
|
|
23
|
+
ref
|
|
22
24
|
} = props;
|
|
23
25
|
const extraAttrs = getExtraAttrs(props);
|
|
24
26
|
const elRef = useRef(null);
|
|
@@ -26,9 +28,6 @@ const ListButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
26
28
|
const onClick = e => {
|
|
27
29
|
emit(props, 'click', e);
|
|
28
30
|
};
|
|
29
|
-
useImperativeHandle(ref, () => ({
|
|
30
|
-
el: elRef.current
|
|
31
|
-
}));
|
|
32
31
|
useTooltip(linkElRef, props);
|
|
33
32
|
useRouteProps(linkElRef, props);
|
|
34
33
|
const linkAttrs = {
|
|
@@ -50,13 +49,16 @@ const ListButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
50
49
|
id: id,
|
|
51
50
|
style: style,
|
|
52
51
|
className: className,
|
|
53
|
-
ref:
|
|
52
|
+
ref: el => {
|
|
53
|
+
elRef.current = el;
|
|
54
|
+
setRef(ref, el);
|
|
55
|
+
}
|
|
54
56
|
}, extraAttrs), /*#__PURE__*/React.createElement("a", _extends({
|
|
55
57
|
className: linkClasses
|
|
56
58
|
}, linkAttrs, {
|
|
57
59
|
onClick: onClick,
|
|
58
60
|
ref: linkElRef
|
|
59
61
|
}), title, text, children));
|
|
60
|
-
}
|
|
62
|
+
};
|
|
61
63
|
ListButton.displayName = 'f7-list-button';
|
|
62
64
|
export default ListButton;
|
package/components/list-group.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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, useContext } from 'react';
|
|
3
3
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
4
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
5
5
|
import { ListContext } from '../shared/list-context.js';
|
|
6
|
+
import { setRef } from '../shared/set-ref.js';
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
const ListGroup =
|
|
9
|
+
const ListGroup = props => {
|
|
9
10
|
const {
|
|
10
11
|
className,
|
|
11
12
|
id,
|
|
@@ -16,14 +17,12 @@ const ListGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
16
17
|
sortable,
|
|
17
18
|
sortableOpposite,
|
|
18
19
|
sortableTapHold,
|
|
19
|
-
sortableMoveElements
|
|
20
|
+
sortableMoveElements,
|
|
21
|
+
ref
|
|
20
22
|
} = props;
|
|
21
23
|
const extraAttrs = getExtraAttrs(props);
|
|
22
24
|
const listContext = useContext(ListContext);
|
|
23
25
|
const elRef = useRef(null);
|
|
24
|
-
useImperativeHandle(ref, () => ({
|
|
25
|
-
el: elRef.current
|
|
26
|
-
}));
|
|
27
26
|
const classes = classNames(className, 'list-group', {
|
|
28
27
|
'media-list': mediaList,
|
|
29
28
|
sortable,
|
|
@@ -35,7 +34,10 @@ const ListGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
35
34
|
style: style,
|
|
36
35
|
className: classes,
|
|
37
36
|
"data-sortable-move-elements": typeof sortableMoveElements !== 'undefined' ? sortableMoveElements.toString() : undefined,
|
|
38
|
-
ref:
|
|
37
|
+
ref: el => {
|
|
38
|
+
elRef.current = el;
|
|
39
|
+
setRef(ref, el);
|
|
40
|
+
}
|
|
39
41
|
}, extraAttrs), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement(ListContext.Provider, {
|
|
40
42
|
value: {
|
|
41
43
|
listIsMedia: mediaList || listContext.listIsMedia,
|
|
@@ -44,6 +46,6 @@ const ListGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
44
46
|
listIsSortableOpposite: sortableOpposite || listContext.listIsSortableOpposite
|
|
45
47
|
}
|
|
46
48
|
}, children)));
|
|
47
|
-
}
|
|
49
|
+
};
|
|
48
50
|
ListGroup.displayName = 'f7-list-group';
|
|
49
51
|
export default ListGroup;
|
package/components/list-index.js
CHANGED
|
@@ -1,13 +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, 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
|
-
const ListIndex =
|
|
11
|
+
const ListIndex = props => {
|
|
11
12
|
const f7ListIndex = useRef(null);
|
|
12
13
|
const {
|
|
13
14
|
className,
|
|
@@ -20,7 +21,8 @@ const ListIndex = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
20
21
|
scrollList = true,
|
|
21
22
|
label = false,
|
|
22
23
|
iosItemHeight = 14,
|
|
23
|
-
mdItemHeight = 14
|
|
24
|
+
mdItemHeight = 14,
|
|
25
|
+
ref
|
|
24
26
|
} = props;
|
|
25
27
|
const extraAttrs = getExtraAttrs(props);
|
|
26
28
|
const elRef = useRef(null);
|
|
@@ -32,12 +34,6 @@ const ListIndex = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
32
34
|
if (!f7ListIndex.current) return;
|
|
33
35
|
f7ListIndex.current.scrollListToIndex(indexContent);
|
|
34
36
|
};
|
|
35
|
-
useImperativeHandle(ref, () => ({
|
|
36
|
-
el: elRef.current,
|
|
37
|
-
f7ListIndex: () => f7ListIndex.current,
|
|
38
|
-
update,
|
|
39
|
-
scrollListToIndex
|
|
40
|
-
}));
|
|
41
37
|
watchProp(indexes, newValue => {
|
|
42
38
|
if (!f7ListIndex.current) return;
|
|
43
39
|
f7ListIndex.current.params.indexes = newValue;
|
|
@@ -77,8 +73,15 @@ const ListIndex = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
77
73
|
id: id,
|
|
78
74
|
style: style,
|
|
79
75
|
className: classes,
|
|
80
|
-
ref:
|
|
76
|
+
ref: el => {
|
|
77
|
+
elRef.current = el;
|
|
78
|
+
setRef(ref, el, {
|
|
79
|
+
update,
|
|
80
|
+
scrollListToIndex,
|
|
81
|
+
f7ListIndex: () => f7ListIndex.current
|
|
82
|
+
});
|
|
83
|
+
}
|
|
81
84
|
}, extraAttrs), children);
|
|
82
|
-
}
|
|
85
|
+
};
|
|
83
86
|
ListIndex.displayName = 'f7-list-index';
|
|
84
87
|
export default ListIndex;
|