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/messagebar.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 } from 'react';
|
|
3
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
4
4
|
import { classNames, getExtraAttrs, emit, getSlots, noUndefinedProps } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
@@ -7,9 +7,11 @@ import Link from './link.js';
|
|
|
7
7
|
import Input from './input.js';
|
|
8
8
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
9
9
|
import { watchProp } from '../shared/watch-prop.js';
|
|
10
|
+
import { setRef } from '../shared/set-ref.js';
|
|
11
|
+
import ToolbarPane from './toolbar-pane.js';
|
|
10
12
|
|
|
11
13
|
|
|
12
|
-
const Messagebar =
|
|
14
|
+
const Messagebar = props => {
|
|
13
15
|
const f7Messagebar = useRef(null);
|
|
14
16
|
const updateSheetVisible = useRef(false);
|
|
15
17
|
const updateAttachmentsVisible = useRef(false);
|
|
@@ -32,7 +34,8 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
32
34
|
textareaId,
|
|
33
35
|
name,
|
|
34
36
|
placeholder = 'Message',
|
|
35
|
-
init = true
|
|
37
|
+
init = true,
|
|
38
|
+
ref
|
|
36
39
|
} = props;
|
|
37
40
|
const extraAttrs = getExtraAttrs(props);
|
|
38
41
|
const elRef = useRef(null);
|
|
@@ -67,10 +70,6 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
67
70
|
const onResizePage = instance => {
|
|
68
71
|
emit(props, 'messagebarResizePage', instance);
|
|
69
72
|
};
|
|
70
|
-
useImperativeHandle(ref, () => ({
|
|
71
|
-
el: elRef.current,
|
|
72
|
-
f7Messagebar: () => f7Messagebar.current
|
|
73
|
-
}));
|
|
74
73
|
watchProp(sheetVisible, () => {
|
|
75
74
|
if (!resizable || !f7Messagebar.current) return;
|
|
76
75
|
updateSheetVisible.current = true;
|
|
@@ -157,10 +156,15 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
157
156
|
id: id,
|
|
158
157
|
style: style,
|
|
159
158
|
className: classes,
|
|
160
|
-
ref:
|
|
159
|
+
ref: el => {
|
|
160
|
+
elRef.current = el;
|
|
161
|
+
setRef(ref, el, {
|
|
162
|
+
f7Messagebar: () => f7Messagebar.current
|
|
163
|
+
});
|
|
164
|
+
}
|
|
161
165
|
}, extraAttrs), slotsBeforeInner, /*#__PURE__*/React.createElement("div", {
|
|
162
166
|
className: "toolbar-inner"
|
|
163
|
-
}, slotsInnerStart, /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
}, slotsInnerStart && slotsInnerStart.length > 0 && /*#__PURE__*/React.createElement(ToolbarPane, null, slotsInnerStart), /*#__PURE__*/React.createElement("div", {
|
|
164
168
|
className: "messagebar-area"
|
|
165
169
|
}, slotsBeforeArea, messagebarAttachmentsEl, /*#__PURE__*/React.createElement(Input, _extends({
|
|
166
170
|
inputId: textareaId,
|
|
@@ -176,9 +180,9 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
176
180
|
onChange: onChange,
|
|
177
181
|
onFocus: onFocus,
|
|
178
182
|
onBlur: onBlur
|
|
179
|
-
}, valueProps)), slotsAfterArea), (sendLink && sendLink.length > 0 || slotsSendLink) && /*#__PURE__*/React.createElement(Link, {
|
|
183
|
+
}, valueProps)), slotsAfterArea), (sendLink && sendLink.length > 0 || slotsSendLink || slotsInnerStart && slotsInnerEnd.length > 0) && /*#__PURE__*/React.createElement(ToolbarPane, null, (sendLink && sendLink.length > 0 || slotsSendLink) && /*#__PURE__*/React.createElement(Link, {
|
|
180
184
|
onClick: onClick
|
|
181
|
-
}, slotsSendLink || sendLink), slotsInnerEnd, innerEndEls), slotsAfterInner, messagebarSheetEl);
|
|
182
|
-
}
|
|
185
|
+
}, slotsSendLink || sendLink), slotsInnerEnd), innerEndEls), slotsAfterInner, messagebarSheetEl);
|
|
186
|
+
};
|
|
183
187
|
Messagebar.displayName = 'f7-messagebar';
|
|
184
188
|
export default Messagebar;
|
|
@@ -1,28 +1,30 @@
|
|
|
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 MessagesTitle =
|
|
8
|
+
const MessagesTitle = props => {
|
|
8
9
|
const {
|
|
9
10
|
className,
|
|
10
11
|
id,
|
|
11
12
|
style,
|
|
12
|
-
children
|
|
13
|
+
children,
|
|
14
|
+
ref
|
|
13
15
|
} = props;
|
|
14
16
|
const extraAttrs = getExtraAttrs(props);
|
|
15
17
|
const elRef = useRef(null);
|
|
16
|
-
useImperativeHandle(ref, () => ({
|
|
17
|
-
el: elRef.current
|
|
18
|
-
}));
|
|
19
18
|
const classes = classNames(className, 'messages-title', colorClasses(props));
|
|
20
19
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
21
20
|
id: id,
|
|
22
21
|
style: style,
|
|
23
22
|
className: classes,
|
|
24
|
-
ref:
|
|
23
|
+
ref: el => {
|
|
24
|
+
elRef.current = el;
|
|
25
|
+
setRef(ref, el);
|
|
26
|
+
}
|
|
25
27
|
}, extraAttrs), children);
|
|
26
|
-
}
|
|
28
|
+
};
|
|
27
29
|
MessagesTitle.displayName = 'f7-messages-title';
|
|
28
30
|
export default MessagesTitle;
|
package/components/messages.js
CHANGED
|
@@ -1,14 +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, noUndefinedProps } 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
|
|
|
11
|
-
const Messages =
|
|
12
|
+
const Messages = props => {
|
|
12
13
|
const f7Messages = useRef(null);
|
|
13
14
|
const mounted = useRef(false);
|
|
14
15
|
const {
|
|
@@ -31,16 +32,13 @@ const Messages = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
31
32
|
customClassMessageRule,
|
|
32
33
|
renderMessage,
|
|
33
34
|
typing = false,
|
|
34
|
-
init = true
|
|
35
|
+
init = true,
|
|
36
|
+
ref
|
|
35
37
|
} = props;
|
|
36
38
|
const extraAttrs = getExtraAttrs(props);
|
|
37
39
|
const elRef = useRef(null);
|
|
38
40
|
const childrenBeforeUpdated = useRef(null);
|
|
39
41
|
const reactChildrenBefore = useRef(children ? React.Children.count(children) : 0);
|
|
40
|
-
useImperativeHandle(ref, () => ({
|
|
41
|
-
el: elRef.current,
|
|
42
|
-
f7Messages: () => f7Messages.current
|
|
43
|
-
}));
|
|
44
42
|
const onMount = () => {
|
|
45
43
|
if (!init) return;
|
|
46
44
|
f7ready(() => {
|
|
@@ -119,8 +117,13 @@ const Messages = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
119
117
|
id: id,
|
|
120
118
|
style: style,
|
|
121
119
|
className: classes,
|
|
122
|
-
ref:
|
|
120
|
+
ref: el => {
|
|
121
|
+
elRef.current = el;
|
|
122
|
+
setRef(ref, el, {
|
|
123
|
+
f7Messages: () => f7Messages.current
|
|
124
|
+
});
|
|
125
|
+
}
|
|
123
126
|
}, extraAttrs), children);
|
|
124
|
-
}
|
|
127
|
+
};
|
|
125
128
|
Messages.displayName = 'f7-messages';
|
|
126
129
|
export default Messages;
|
package/components/nav-left.d.ts
CHANGED
package/components/nav-left.js
CHANGED
|
@@ -1,12 +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
|
-
import {
|
|
5
|
+
import { setRef } from '../shared/set-ref.js';
|
|
6
6
|
import Link from './link.js';
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
const NavLeft =
|
|
9
|
+
const NavLeft = props => {
|
|
10
10
|
const {
|
|
11
11
|
className,
|
|
12
12
|
id,
|
|
@@ -16,22 +16,16 @@ const NavLeft = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
16
16
|
backLinkUrl,
|
|
17
17
|
backLinkForce,
|
|
18
18
|
backLinkShowText,
|
|
19
|
-
|
|
19
|
+
ref
|
|
20
20
|
} = props;
|
|
21
21
|
const extraAttrs = getExtraAttrs(props);
|
|
22
22
|
const elRef = useRef(null);
|
|
23
23
|
const onBackClick = event => {
|
|
24
24
|
emit(props, 'backClick clickBack', event);
|
|
25
25
|
};
|
|
26
|
-
useImperativeHandle(ref, () => ({
|
|
27
|
-
el: elRef.current
|
|
28
|
-
}));
|
|
29
|
-
const theme = useTheme();
|
|
30
26
|
let linkEl;
|
|
31
|
-
let needBackLinkText = backLinkShowText;
|
|
32
|
-
if (typeof needBackLinkText === 'undefined') needBackLinkText = !theme.md;
|
|
33
27
|
if (backLink) {
|
|
34
|
-
const text = backLink !== true &&
|
|
28
|
+
const text = backLink !== true && backLinkShowText ? backLink : undefined;
|
|
35
29
|
linkEl = /*#__PURE__*/React.createElement(Link, {
|
|
36
30
|
href: backLinkUrl || '#',
|
|
37
31
|
back: true,
|
|
@@ -42,15 +36,16 @@ const NavLeft = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
42
36
|
onClick: onBackClick
|
|
43
37
|
});
|
|
44
38
|
}
|
|
45
|
-
const classes = classNames(className, 'left', {
|
|
46
|
-
sliding
|
|
47
|
-
}, colorClasses(props));
|
|
39
|
+
const classes = classNames(className, 'left', {}, colorClasses(props));
|
|
48
40
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
49
41
|
id: id,
|
|
50
42
|
style: style,
|
|
51
43
|
className: classes,
|
|
52
|
-
ref:
|
|
44
|
+
ref: el => {
|
|
45
|
+
elRef.current = el;
|
|
46
|
+
setRef(ref, el);
|
|
47
|
+
}
|
|
53
48
|
}, extraAttrs), linkEl, children);
|
|
54
|
-
}
|
|
49
|
+
};
|
|
55
50
|
NavLeft.displayName = 'f7-nav-left';
|
|
56
51
|
export default NavLeft;
|
package/components/nav-right.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
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
|
-
const NavRight = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const NavRight = props => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
10
10
|
id,
|
|
11
11
|
style,
|
|
12
12
|
children,
|
|
13
|
-
|
|
13
|
+
ref
|
|
14
14
|
} = props;
|
|
15
15
|
const extraAttrs = getExtraAttrs(props);
|
|
16
16
|
const elRef = useRef(null);
|
|
17
|
-
|
|
18
|
-
el: elRef.current
|
|
19
|
-
}));
|
|
20
|
-
const classes = classNames(className, 'right', {
|
|
21
|
-
sliding
|
|
22
|
-
}, colorClasses(props));
|
|
17
|
+
const classes = classNames(className, 'right', {}, colorClasses(props));
|
|
23
18
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
24
19
|
id: id,
|
|
25
20
|
style: style,
|
|
26
21
|
className: classes,
|
|
27
|
-
ref:
|
|
22
|
+
ref: el => {
|
|
23
|
+
elRef.current = el;
|
|
24
|
+
setRef(ref, el);
|
|
25
|
+
}
|
|
28
26
|
}, extraAttrs), children);
|
|
29
|
-
}
|
|
27
|
+
};
|
|
30
28
|
NavRight.displayName = 'f7-nav-right';
|
|
31
29
|
export default NavRight;
|
|
@@ -1,30 +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
|
-
const NavTitleLarge = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const NavTitleLarge = props => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
10
10
|
id,
|
|
11
11
|
style,
|
|
12
|
-
children
|
|
12
|
+
children,
|
|
13
|
+
ref
|
|
13
14
|
} = props;
|
|
14
15
|
const extraAttrs = getExtraAttrs(props);
|
|
15
16
|
const elRef = useRef(null);
|
|
16
|
-
useImperativeHandle(ref, () => ({
|
|
17
|
-
el: elRef.current
|
|
18
|
-
}));
|
|
19
17
|
const classes = classNames(className, 'title-large', colorClasses(props));
|
|
20
18
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
21
19
|
id: id,
|
|
22
20
|
style: style,
|
|
23
21
|
className: classes,
|
|
24
|
-
ref:
|
|
22
|
+
ref: el => {
|
|
23
|
+
elRef.current = el;
|
|
24
|
+
setRef(ref, el);
|
|
25
|
+
}
|
|
25
26
|
}, extraAttrs), /*#__PURE__*/React.createElement("div", {
|
|
26
27
|
className: "title-large-text"
|
|
27
28
|
}, children));
|
|
28
|
-
}
|
|
29
|
+
};
|
|
29
30
|
NavTitleLarge.displayName = 'f7-nav-title-large';
|
|
30
31
|
export default NavTitleLarge;
|
package/components/nav-title.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 } 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 NavTitle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const NavTitle = props => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
10
10
|
id,
|
|
@@ -12,28 +12,26 @@ const NavTitle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
12
12
|
children,
|
|
13
13
|
title,
|
|
14
14
|
subtitle,
|
|
15
|
-
|
|
15
|
+
ref
|
|
16
16
|
} = props;
|
|
17
17
|
const extraAttrs = getExtraAttrs(props);
|
|
18
18
|
const elRef = useRef(null);
|
|
19
|
-
useImperativeHandle(ref, () => ({
|
|
20
|
-
el: elRef.current
|
|
21
|
-
}));
|
|
22
19
|
let subtitleEl;
|
|
23
20
|
if (subtitle) {
|
|
24
21
|
subtitleEl = /*#__PURE__*/React.createElement("span", {
|
|
25
22
|
className: "subtitle"
|
|
26
23
|
}, subtitle);
|
|
27
24
|
}
|
|
28
|
-
const classes = classNames(className, 'title', {
|
|
29
|
-
sliding
|
|
30
|
-
}, colorClasses(props));
|
|
25
|
+
const classes = classNames(className, 'title', {}, colorClasses(props));
|
|
31
26
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
32
27
|
id: id,
|
|
33
28
|
style: style,
|
|
34
29
|
className: classes,
|
|
35
|
-
ref:
|
|
30
|
+
ref: el => {
|
|
31
|
+
elRef.current = el;
|
|
32
|
+
setRef(ref, el);
|
|
33
|
+
}
|
|
36
34
|
}, extraAttrs), children, title, subtitleEl);
|
|
37
|
-
}
|
|
35
|
+
};
|
|
38
36
|
NavTitle.displayName = 'f7-nav-title';
|
|
39
37
|
export default NavTitle;
|
package/components/navbar.d.ts
CHANGED
package/components/navbar.js
CHANGED
|
@@ -1,21 +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 { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
4
4
|
import { classNames, getExtraAttrs, emit, getSlots } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
6
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
7
7
|
import { useTheme } from '../shared/use-theme.js';
|
|
8
|
+
import { setRef } from '../shared/set-ref.js';
|
|
8
9
|
import NavLeft from './nav-left.js';
|
|
9
10
|
import NavTitle from './nav-title.js';
|
|
10
11
|
import NavRight from './nav-right.js';
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
const Navbar =
|
|
14
|
+
const Navbar = props => {
|
|
14
15
|
const {
|
|
15
16
|
className,
|
|
16
17
|
id,
|
|
17
18
|
style,
|
|
18
|
-
sliding = true,
|
|
19
19
|
large,
|
|
20
20
|
largeTransparent,
|
|
21
21
|
transparent,
|
|
@@ -29,13 +29,11 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
29
29
|
subtitle,
|
|
30
30
|
titleLarge,
|
|
31
31
|
innerClass,
|
|
32
|
-
innerClassName
|
|
32
|
+
innerClassName,
|
|
33
|
+
ref
|
|
33
34
|
} = props;
|
|
34
35
|
const routerPositionClass = useRef('');
|
|
35
36
|
const largeCollapsed = useRef(false);
|
|
36
|
-
const routerNavbarRole = useRef(null);
|
|
37
|
-
const routerNavbarRoleDetailRoot = useRef(false);
|
|
38
|
-
const routerNavbarMasterStack = useRef(false);
|
|
39
37
|
const transparentVisible = useRef(false);
|
|
40
38
|
const extraAttrs = getExtraAttrs(props);
|
|
41
39
|
const elRef = useRef(null);
|
|
@@ -72,19 +70,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
72
70
|
if (elRef.current !== navbarEl) return;
|
|
73
71
|
routerPositionClass.current = position ? `navbar-${position}` : '';
|
|
74
72
|
};
|
|
75
|
-
const onNavbarRole = (navbarEl, rolesData) => {
|
|
76
|
-
if (elRef.current !== navbarEl) return;
|
|
77
|
-
routerNavbarRole.current = rolesData.role;
|
|
78
|
-
routerNavbarRoleDetailRoot.current = rolesData.detailRoot;
|
|
79
|
-
};
|
|
80
|
-
const onNavbarMasterStack = navbarEl => {
|
|
81
|
-
if (elRef.current !== navbarEl) return;
|
|
82
|
-
routerNavbarMasterStack.current = true;
|
|
83
|
-
};
|
|
84
|
-
const onNavbarMasterUnstack = navbarEl => {
|
|
85
|
-
if (elRef.current !== navbarEl) return;
|
|
86
|
-
routerNavbarMasterStack.current = false;
|
|
87
|
-
};
|
|
88
73
|
const hide = animate => {
|
|
89
74
|
if (!f7) return;
|
|
90
75
|
f7.navbar.hide(elRef.current, animate);
|
|
@@ -100,12 +85,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
100
85
|
const onBackClick = event => {
|
|
101
86
|
emit(props, 'backClick clickBack', event);
|
|
102
87
|
};
|
|
103
|
-
useImperativeHandle(ref, () => ({
|
|
104
|
-
el: elRef.current,
|
|
105
|
-
hide,
|
|
106
|
-
show,
|
|
107
|
-
size
|
|
108
|
-
}));
|
|
109
88
|
const attachEvents = () => {
|
|
110
89
|
if (!elRef.current) return;
|
|
111
90
|
f7ready(() => {
|
|
@@ -115,9 +94,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
115
94
|
f7.on('navbarCollapse', onCollapse);
|
|
116
95
|
f7.on('navbarExpand', onExpand);
|
|
117
96
|
f7.on('navbarPosition', onNavbarPosition);
|
|
118
|
-
f7.on('navbarRole', onNavbarRole);
|
|
119
|
-
f7.on('navbarMasterStack', onNavbarMasterStack);
|
|
120
|
-
f7.on('navbarMasterUnstack', onNavbarMasterUnstack);
|
|
121
97
|
f7.on('navbarTransparentShow', onNavbarTransparentShow);
|
|
122
98
|
f7.on('navbarTransparentHide', onNavbarTransparentHide);
|
|
123
99
|
});
|
|
@@ -129,9 +105,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
129
105
|
f7.off('navbarCollapse', onCollapse);
|
|
130
106
|
f7.off('navbarExpand', onExpand);
|
|
131
107
|
f7.off('navbarPosition', onNavbarPosition);
|
|
132
|
-
f7.off('navbarRole', onNavbarRole);
|
|
133
|
-
f7.off('navbarMasterStack', onNavbarMasterStack);
|
|
134
|
-
f7.off('navbarMasterUnstack', onNavbarMasterUnstack);
|
|
135
108
|
f7.off('navbarTransparentShow', onNavbarTransparentShow);
|
|
136
109
|
f7.off('navbarTransparentHide', onNavbarTransparentHide);
|
|
137
110
|
};
|
|
@@ -155,10 +128,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
155
128
|
'navbar-large-collapsed': isLarge && largeCollapsed.current,
|
|
156
129
|
'navbar-transparent': isTransparent,
|
|
157
130
|
'navbar-transparent-visible': isTransparentVisible,
|
|
158
|
-
'navbar-master': routerNavbarRole.current === 'master',
|
|
159
|
-
'navbar-master-detail': routerNavbarRole.current === 'detail',
|
|
160
|
-
'navbar-master-detail-root': routerNavbarRoleDetailRoot.current === true,
|
|
161
|
-
'navbar-master-stacked': routerNavbarMasterStack.current === true,
|
|
162
131
|
'no-outline': !outline
|
|
163
132
|
}, colorClasses(props));
|
|
164
133
|
if (backLink || slots['nav-left'] || slots.left) {
|
|
@@ -190,7 +159,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
190
159
|
}
|
|
191
160
|
const innerEl = /*#__PURE__*/React.createElement("div", {
|
|
192
161
|
className: classNames('navbar-inner', innerClass, innerClassName, {
|
|
193
|
-
sliding,
|
|
194
162
|
'navbar-inner-left-title': addLeftTitleClass,
|
|
195
163
|
'navbar-inner-centered-title': addCenterTitleClass
|
|
196
164
|
})
|
|
@@ -199,10 +167,17 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
199
167
|
id: id,
|
|
200
168
|
style: style,
|
|
201
169
|
className: classes,
|
|
202
|
-
ref:
|
|
170
|
+
ref: el => {
|
|
171
|
+
elRef.current = el;
|
|
172
|
+
setRef(ref, el, {
|
|
173
|
+
hide,
|
|
174
|
+
show,
|
|
175
|
+
size
|
|
176
|
+
});
|
|
177
|
+
}
|
|
203
178
|
}, extraAttrs), /*#__PURE__*/React.createElement("div", {
|
|
204
179
|
className: "navbar-bg"
|
|
205
180
|
}), slots['before-inner'], innerEl, slots['after-inner']);
|
|
206
|
-
}
|
|
181
|
+
};
|
|
207
182
|
Navbar.displayName = 'f7-navbar';
|
|
208
183
|
export default Navbar;
|
|
@@ -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, emit } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
6
|
import Preloader from './preloader.js';
|
|
7
7
|
import { useTab } from '../shared/use-tab.js';
|
|
8
8
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
9
|
+
import { setRef } from '../shared/set-ref.js';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
11
|
+
const PageContent = props => {
|
|
12
12
|
const {
|
|
13
13
|
className,
|
|
14
14
|
id,
|
|
@@ -29,7 +29,8 @@ const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
29
29
|
hideNavbarOnScroll,
|
|
30
30
|
hideToolbarOnScroll,
|
|
31
31
|
messagesContent,
|
|
32
|
-
loginScreen
|
|
32
|
+
loginScreen,
|
|
33
|
+
ref
|
|
33
34
|
} = props;
|
|
34
35
|
const extraAttrs = getExtraAttrs(props);
|
|
35
36
|
const elRef = useRef(null);
|
|
@@ -57,9 +58,6 @@ const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
57
58
|
if (elRef.current !== el) return;
|
|
58
59
|
emit(props, 'infinite');
|
|
59
60
|
};
|
|
60
|
-
useImperativeHandle(ref, () => ({
|
|
61
|
-
el: elRef.current
|
|
62
|
-
}));
|
|
63
61
|
useTab(elRef, props);
|
|
64
62
|
const attachEvents = () => {
|
|
65
63
|
f7ready(() => {
|
|
@@ -122,8 +120,11 @@ const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
122
120
|
"data-ptr-distance": ptrDistance || undefined,
|
|
123
121
|
"data-ptr-mousewheel": ptrMousewheel || undefined,
|
|
124
122
|
"data-infinite-distance": infiniteDistance || undefined,
|
|
125
|
-
ref:
|
|
123
|
+
ref: el => {
|
|
124
|
+
elRef.current = el;
|
|
125
|
+
setRef(ref, el);
|
|
126
|
+
}
|
|
126
127
|
}, extraAttrs), ptrBottom ? null : ptrEl, infiniteTop ? infiniteEl : null, children, infiniteTop ? null : infiniteEl, ptrBottom ? ptrEl : null);
|
|
127
|
-
}
|
|
128
|
+
};
|
|
128
129
|
PageContent.displayName = 'f7-page-content';
|
|
129
130
|
export default PageContent;
|
package/components/page.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, getSlots, emit } from '../shared/utils.js';
|
|
5
5
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
6
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
7
|
+
import { setRef } from '../shared/set-ref.js';
|
|
7
8
|
import PageContent from './page-content.js';
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
const Page =
|
|
11
|
+
const Page = props => {
|
|
11
12
|
const {
|
|
12
13
|
className,
|
|
13
14
|
id,
|
|
@@ -36,6 +37,7 @@ const Page = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
36
37
|
hideToolbarOnScroll,
|
|
37
38
|
messagesContent,
|
|
38
39
|
loginScreen,
|
|
40
|
+
ref,
|
|
39
41
|
onPtrPullStart,
|
|
40
42
|
onPtrPullMove,
|
|
41
43
|
onPtrPullEnd,
|
|
@@ -157,9 +159,6 @@ const Page = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
157
159
|
if (elRef.current !== pageEl) return;
|
|
158
160
|
emit(props, 'pageTabHide');
|
|
159
161
|
};
|
|
160
|
-
useImperativeHandle(ref, () => ({
|
|
161
|
-
el: elRef.current
|
|
162
|
-
}));
|
|
163
162
|
const attachEvents = () => {
|
|
164
163
|
f7ready(() => {
|
|
165
164
|
f7.on('pageMounted', onPageMounted);
|
|
@@ -296,8 +295,11 @@ const Page = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
296
295
|
style: style,
|
|
297
296
|
className: classes,
|
|
298
297
|
"data-name": name,
|
|
299
|
-
ref:
|
|
298
|
+
ref: el => {
|
|
299
|
+
elRef.current = el;
|
|
300
|
+
setRef(ref, el);
|
|
301
|
+
}
|
|
300
302
|
}, extraAttrs), fixedList, slotsFixed, pageContentEl);
|
|
301
|
-
}
|
|
303
|
+
};
|
|
302
304
|
Page.displayName = 'f7-page';
|
|
303
305
|
export default Page;
|