framework7-react 7.0.9 → 8.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 +2 -2
- package/components/accordion-item.js +2 -11
- package/components/accordion-toggle.js +2 -2
- package/components/accordion.js +2 -2
- package/components/actions-button.d.ts +1 -1
- package/components/actions-button.js +4 -8
- package/components/actions-group.js +2 -2
- package/components/actions-label.js +4 -6
- package/components/actions.js +4 -14
- package/components/app.js +4 -8
- package/components/area-chart.js +6 -45
- package/components/badge.js +2 -2
- package/components/block-footer.js +2 -2
- package/components/block-header.js +2 -2
- package/components/block-title.js +2 -2
- package/components/block.d.ts +17 -4
- package/components/block.js +37 -11
- package/components/breadcrumbs-collapsed.js +2 -4
- package/components/breadcrumbs-item.js +2 -4
- package/components/breadcrumbs-separator.js +2 -2
- package/components/breadcrumbs.js +2 -2
- package/components/button.d.ts +3 -7
- package/components/button.js +8 -24
- package/components/card-content.js +2 -2
- package/components/card-footer.js +2 -2
- package/components/card-header.js +2 -2
- package/components/card.d.ts +5 -2
- package/components/card.js +14 -23
- package/components/checkbox.js +2 -4
- package/components/chip.d.ts +0 -1
- package/components/chip.js +2 -9
- package/components/fab-backdrop.js +2 -2
- package/components/fab-button.js +2 -6
- package/components/fab-buttons.js +2 -2
- package/components/fab.js +2 -10
- package/components/gauge.js +2 -2
- package/components/icon.d.ts +0 -1
- package/components/icon.js +3 -17
- package/components/input.js +1 -57
- package/components/link.d.ts +0 -1
- package/components/link.js +5 -12
- package/components/list-button.js +2 -4
- package/components/list-group.js +2 -2
- package/components/list-index.d.ts +0 -1
- package/components/list-index.js +3 -13
- package/components/list-input.d.ts +0 -1
- package/components/list-input.js +1 -55
- package/components/list-item-content.js +6 -20
- package/components/list-item.d.ts +0 -1
- package/components/list-item.js +5 -35
- package/components/list.d.ts +21 -9
- package/components/list.js +43 -37
- package/components/login-screen-title.js +2 -2
- package/components/login-screen.js +3 -15
- package/components/message.js +2 -10
- package/components/messagebar-attachment.js +2 -5
- package/components/messagebar-attachments.js +2 -2
- package/components/messagebar-sheet-image.js +4 -5
- package/components/messagebar-sheet-item.js +2 -2
- package/components/messagebar-sheet.js +2 -2
- package/components/messagebar.js +1 -19
- package/components/messages-title.js +2 -2
- package/components/messages.js +2 -15
- package/components/nav-left.js +2 -6
- package/components/nav-right.js +2 -2
- package/components/nav-title-large.js +2 -2
- package/components/nav-title.js +2 -4
- package/components/navbar.d.ts +1 -2
- package/components/navbar.js +5 -31
- package/components/page-content.js +2 -16
- package/components/page.d.ts +0 -1
- package/components/page.js +4 -62
- package/components/panel.d.ts +1 -0
- package/components/panel.js +6 -26
- package/components/photo-browser.js +1 -17
- package/components/pie-chart.js +6 -18
- package/components/popover.d.ts +1 -0
- package/components/popover.js +4 -14
- package/components/popup.js +3 -19
- package/components/preloader.js +5 -14
- package/components/progressbar.js +2 -4
- package/components/radio.js +2 -4
- package/components/range.js +2 -9
- package/components/routable-modals.js +2 -7
- package/components/searchbar.d.ts +1 -2
- package/components/searchbar.js +5 -30
- package/components/segmented.d.ts +0 -3
- package/components/segmented.js +4 -10
- package/components/sheet.js +2 -22
- package/components/stepper.d.ts +0 -5
- package/components/stepper.js +3 -33
- package/components/subnavbar.js +2 -2
- package/components/swipeout-actions.js +2 -4
- package/components/swipeout-button.js +2 -4
- package/components/swiper-slide.d.ts +1 -0
- package/components/swiper-slide.js +1 -0
- package/components/swiper.d.ts +1 -0
- package/components/swiper.js +1 -0
- package/components/tab.js +4 -15
- package/components/tabs.js +1 -4
- package/components/text-editor.js +1 -18
- package/components/toggle.js +1 -13
- package/components/toolbar.d.ts +2 -6
- package/components/toolbar.js +9 -20
- package/components/treeview-item.d.ts +0 -1
- package/components/treeview-item.js +2 -11
- package/components/treeview.js +2 -2
- package/components/view.d.ts +0 -6
- package/components/view.js +3 -30
- package/components/views.js +2 -2
- package/framework7-react.d.ts +2 -12
- package/framework7-react.js +3 -12
- package/package.json +1 -1
- package/shared/components-router.js +0 -32
- package/shared/f7.js +5 -19
- package/shared/get-router-initial-component.js +0 -4
- package/shared/mixins.js +2 -8
- package/shared/plugin.js +2 -8
- package/shared/router-open-in.js +4 -15
- package/shared/tabbar-context.js +1 -1
- package/shared/use-icon.js +1 -6
- package/shared/use-isomorphic-layout-effect.js +0 -2
- package/shared/use-route-props.js +0 -1
- package/shared/use-smart-select.js +0 -3
- package/shared/use-store.js +4 -8
- package/shared/use-tab.js +0 -4
- package/shared/use-theme.js +0 -2
- package/shared/use-tooltip.js +0 -5
- package/shared/utils.js +0 -18
- package/shared/watch-prop.js +0 -1
- package/components/appbar.d.ts +0 -28
- package/components/appbar.js +0 -45
- package/components/col.d.ts +0 -36
- package/components/col.js +0 -75
- package/components/list-item-cell.d.ts +0 -23
- package/components/list-item-cell.js +0 -28
- package/components/list-item-row.d.ts +0 -23
- package/components/list-item-row.js +0 -28
- package/components/menu-dropdown-item.d.ts +0 -68
- package/components/menu-dropdown-item.js +0 -59
- package/components/menu-dropdown.d.ts +0 -28
- package/components/menu-dropdown.js +0 -42
- package/components/menu-item.d.ts +0 -81
- package/components/menu-item.js +0 -101
- package/components/menu.d.ts +0 -23
- package/components/menu.js +0 -30
- package/components/row.d.ts +0 -31
- package/components/row.js +0 -64
package/components/messages.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
5
4
|
import { classNames, getExtraAttrs, noUndefinedProps } from '../shared/utils.js';
|
|
@@ -8,6 +7,7 @@ import { f7ready, f7 } from '../shared/f7.js';
|
|
|
8
7
|
import { watchProp } from '../shared/watch-prop.js';
|
|
9
8
|
|
|
10
9
|
|
|
10
|
+
|
|
11
11
|
const Messages = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
12
|
const f7Messages = useRef(null);
|
|
13
13
|
const mounted = useRef(false);
|
|
@@ -41,7 +41,6 @@ const Messages = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41
41
|
el: elRef.current,
|
|
42
42
|
f7Messages: () => f7Messages.current
|
|
43
43
|
}));
|
|
44
|
-
|
|
45
44
|
const onMount = () => {
|
|
46
45
|
if (!init) return;
|
|
47
46
|
f7ready(() => {
|
|
@@ -62,32 +61,26 @@ const Messages = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
62
61
|
customClassMessageRule,
|
|
63
62
|
renderMessage
|
|
64
63
|
}));
|
|
65
|
-
|
|
66
64
|
if (typing) {
|
|
67
65
|
f7Messages.current.showTyping();
|
|
68
66
|
}
|
|
69
67
|
});
|
|
70
68
|
};
|
|
71
|
-
|
|
72
69
|
const onDestroy = () => {
|
|
73
70
|
if (f7Messages.current && f7Messages.current.destroy) f7Messages.current.destroy();
|
|
74
71
|
f7Messages.current = null;
|
|
75
72
|
};
|
|
76
|
-
|
|
77
73
|
useIsomorphicLayoutEffect(() => {
|
|
78
74
|
onMount();
|
|
79
75
|
return onDestroy;
|
|
80
76
|
}, []);
|
|
81
77
|
const currentChildrenLength = children ? React.Children.count(children) : 0;
|
|
82
|
-
|
|
83
78
|
if (f7Messages.current && scrollMessages) {
|
|
84
79
|
const beforeChildrenLength = reactChildrenBefore.current || 0;
|
|
85
|
-
|
|
86
80
|
if (currentChildrenLength !== beforeChildrenLength) {
|
|
87
81
|
f7Messages.current.setScrollData();
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
|
-
|
|
91
84
|
reactChildrenBefore.current = currentChildrenLength;
|
|
92
85
|
useIsomorphicLayoutEffect(() => {
|
|
93
86
|
const wasMounted = mounted.current;
|
|
@@ -96,31 +89,25 @@ const Messages = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
96
89
|
const childElements = elRef.current.children;
|
|
97
90
|
if (!childElements) return;
|
|
98
91
|
const childrenAfterUpdated = childElements.length;
|
|
99
|
-
|
|
100
92
|
if (!wasMounted) {
|
|
101
93
|
for (let i = 0; i < childElements.length; i += 1) {
|
|
102
94
|
childElements[i].classList.add('message-appeared');
|
|
103
95
|
}
|
|
104
|
-
|
|
105
96
|
return;
|
|
106
97
|
}
|
|
107
|
-
|
|
108
98
|
for (let i = 0; i < childElements.length; i += 1) {
|
|
109
99
|
if (!childElements[i].classList.contains('message-appeared')) {
|
|
110
100
|
childElements[i].classList.add('message-appear-from-bottom');
|
|
111
101
|
}
|
|
112
102
|
}
|
|
113
|
-
|
|
114
103
|
if (f7Messages.current) {
|
|
115
104
|
if (f7Messages.current.layout && autoLayout) {
|
|
116
105
|
f7Messages.current.layout();
|
|
117
106
|
}
|
|
118
|
-
|
|
119
107
|
if (childrenBeforeUpdated.current !== childrenAfterUpdated && f7Messages.current.scroll && f7Messages.current.scrollData && scrollMessages) {
|
|
120
108
|
f7Messages.current.scrollWithEdgeCheck(true);
|
|
121
109
|
}
|
|
122
110
|
}
|
|
123
|
-
|
|
124
111
|
childrenBeforeUpdated.current = childrenAfterUpdated;
|
|
125
112
|
});
|
|
126
113
|
watchProp(typing, newValue => {
|
package/components/nav-left.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
import { useTheme } from '../shared/use-theme.js';
|
|
7
6
|
import Link from './link.js';
|
|
8
7
|
|
|
8
|
+
|
|
9
9
|
const NavLeft = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10
10
|
const {
|
|
11
11
|
className,
|
|
@@ -20,11 +20,9 @@ const NavLeft = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
20
20
|
} = props;
|
|
21
21
|
const extraAttrs = getExtraAttrs(props);
|
|
22
22
|
const elRef = useRef(null);
|
|
23
|
-
|
|
24
23
|
const onBackClick = event => {
|
|
25
24
|
emit(props, 'backClick clickBack', event);
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
useImperativeHandle(ref, () => ({
|
|
29
27
|
el: elRef.current
|
|
30
28
|
}));
|
|
@@ -32,7 +30,6 @@ const NavLeft = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
32
30
|
let linkEl;
|
|
33
31
|
let needBackLinkText = backLinkShowText;
|
|
34
32
|
if (typeof needBackLinkText === 'undefined') needBackLinkText = !theme.md;
|
|
35
|
-
|
|
36
33
|
if (backLink) {
|
|
37
34
|
const text = backLink !== true && needBackLinkText ? backLink : undefined;
|
|
38
35
|
linkEl = /*#__PURE__*/React.createElement(Link, {
|
|
@@ -45,7 +42,6 @@ const NavLeft = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
45
42
|
onClick: onBackClick
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
|
-
|
|
49
45
|
const classes = classNames(className, 'left', {
|
|
50
46
|
sliding
|
|
51
47
|
}, colorClasses(props));
|
package/components/nav-right.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
|
|
6
|
+
|
|
7
7
|
const NavRight = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
|
|
6
|
+
|
|
7
7
|
const NavTitleLarge = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
package/components/nav-title.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
|
|
6
|
+
|
|
7
7
|
const NavTitle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
@@ -20,13 +20,11 @@ const NavTitle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
20
20
|
el: elRef.current
|
|
21
21
|
}));
|
|
22
22
|
let subtitleEl;
|
|
23
|
-
|
|
24
23
|
if (subtitle) {
|
|
25
24
|
subtitleEl = /*#__PURE__*/React.createElement("span", {
|
|
26
25
|
className: "subtitle"
|
|
27
26
|
}, subtitle);
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
const classes = classNames(className, 'title', {
|
|
31
29
|
sliding
|
|
32
30
|
}, colorClasses(props));
|
package/components/navbar.d.ts
CHANGED
package/components/navbar.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
5
4
|
import { classNames, getExtraAttrs, emit, getSlots } from '../shared/utils.js';
|
|
@@ -10,6 +9,7 @@ import NavLeft from './nav-left.js';
|
|
|
10
9
|
import NavTitle from './nav-title.js';
|
|
11
10
|
import NavRight from './nav-right.js';
|
|
12
11
|
|
|
12
|
+
|
|
13
13
|
const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
14
14
|
const {
|
|
15
15
|
className,
|
|
@@ -20,8 +20,7 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
20
20
|
largeTransparent,
|
|
21
21
|
transparent,
|
|
22
22
|
hidden,
|
|
23
|
-
|
|
24
|
-
noHairline,
|
|
23
|
+
outline = true,
|
|
25
24
|
backLink,
|
|
26
25
|
backLinkForce,
|
|
27
26
|
backLinkUrl,
|
|
@@ -41,88 +40,72 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
41
40
|
const extraAttrs = getExtraAttrs(props);
|
|
42
41
|
const elRef = useRef(null);
|
|
43
42
|
const theme = useTheme();
|
|
44
|
-
|
|
45
43
|
const onHide = navbarEl => {
|
|
46
44
|
if (elRef.current !== navbarEl) return;
|
|
47
45
|
emit(props, 'navbarHide');
|
|
48
46
|
};
|
|
49
|
-
|
|
50
47
|
const onShow = navbarEl => {
|
|
51
48
|
if (elRef.current !== navbarEl) return;
|
|
52
49
|
emit(props, 'navbarShow');
|
|
53
50
|
};
|
|
54
|
-
|
|
55
51
|
const onExpand = navbarEl => {
|
|
56
52
|
if (elRef.current !== navbarEl) return;
|
|
57
53
|
largeCollapsed.current = false;
|
|
58
54
|
emit(props, 'navbarExpand');
|
|
59
55
|
};
|
|
60
|
-
|
|
61
56
|
const onCollapse = navbarEl => {
|
|
62
57
|
if (elRef.current !== navbarEl) return;
|
|
63
58
|
largeCollapsed.current = true;
|
|
64
59
|
emit(props, 'navbarCollapse');
|
|
65
60
|
};
|
|
66
|
-
|
|
67
61
|
const onNavbarTransparentShow = navbarEl => {
|
|
68
62
|
if (elRef.current !== navbarEl) return;
|
|
69
63
|
transparentVisible.current = true;
|
|
70
64
|
emit(props, 'navbarTransparentShow');
|
|
71
65
|
};
|
|
72
|
-
|
|
73
66
|
const onNavbarTransparentHide = navbarEl => {
|
|
74
67
|
if (elRef.current !== navbarEl) return;
|
|
75
68
|
transparentVisible.current = false;
|
|
76
69
|
emit(props, 'navbarTransparentHide');
|
|
77
70
|
};
|
|
78
|
-
|
|
79
71
|
const onNavbarPosition = (navbarEl, position) => {
|
|
80
72
|
if (elRef.current !== navbarEl) return;
|
|
81
73
|
routerPositionClass.current = position ? `navbar-${position}` : '';
|
|
82
74
|
};
|
|
83
|
-
|
|
84
75
|
const onNavbarRole = (navbarEl, rolesData) => {
|
|
85
76
|
if (elRef.current !== navbarEl) return;
|
|
86
77
|
routerNavbarRole.current = rolesData.role;
|
|
87
78
|
routerNavbarRoleDetailRoot.current = rolesData.detailRoot;
|
|
88
79
|
};
|
|
89
|
-
|
|
90
80
|
const onNavbarMasterStack = navbarEl => {
|
|
91
81
|
if (elRef.current !== navbarEl) return;
|
|
92
82
|
routerNavbarMasterStack.current = true;
|
|
93
83
|
};
|
|
94
|
-
|
|
95
84
|
const onNavbarMasterUnstack = navbarEl => {
|
|
96
85
|
if (elRef.current !== navbarEl) return;
|
|
97
86
|
routerNavbarMasterStack.current = false;
|
|
98
87
|
};
|
|
99
|
-
|
|
100
88
|
const hide = animate => {
|
|
101
89
|
if (!f7) return;
|
|
102
90
|
f7.navbar.hide(elRef.current, animate);
|
|
103
91
|
};
|
|
104
|
-
|
|
105
92
|
const show = animate => {
|
|
106
93
|
if (!f7) return;
|
|
107
94
|
f7.navbar.show(elRef.current, animate);
|
|
108
95
|
};
|
|
109
|
-
|
|
110
96
|
const size = () => {
|
|
111
97
|
if (!f7) return;
|
|
112
98
|
f7.navbar.size(elRef.current);
|
|
113
99
|
};
|
|
114
|
-
|
|
115
100
|
const onBackClick = event => {
|
|
116
101
|
emit(props, 'backClick clickBack', event);
|
|
117
102
|
};
|
|
118
|
-
|
|
119
103
|
useImperativeHandle(ref, () => ({
|
|
120
104
|
el: elRef.current,
|
|
121
105
|
hide,
|
|
122
106
|
show,
|
|
123
107
|
size
|
|
124
108
|
}));
|
|
125
|
-
|
|
126
109
|
const attachEvents = () => {
|
|
127
110
|
if (!elRef.current) return;
|
|
128
111
|
f7ready(() => {
|
|
@@ -139,7 +122,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
139
122
|
f7.on('navbarTransparentHide', onNavbarTransparentHide);
|
|
140
123
|
});
|
|
141
124
|
};
|
|
142
|
-
|
|
143
125
|
const detachEvents = () => {
|
|
144
126
|
if (!f7) return;
|
|
145
127
|
f7.off('navbarShow', onShow);
|
|
@@ -153,7 +135,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
153
135
|
f7.off('navbarTransparentShow', onNavbarTransparentShow);
|
|
154
136
|
f7.off('navbarTransparentHide', onNavbarTransparentHide);
|
|
155
137
|
};
|
|
156
|
-
|
|
157
138
|
useIsomorphicLayoutEffect(() => {
|
|
158
139
|
attachEvents();
|
|
159
140
|
return detachEvents;
|
|
@@ -164,7 +145,7 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
164
145
|
let rightEl;
|
|
165
146
|
let titleLargeEl;
|
|
166
147
|
const addLeftTitleClass = theme && theme.ios && f7 && !f7.params.navbar.iosCenterTitle;
|
|
167
|
-
const addCenterTitleClass = theme && theme.md && f7 && f7.params.navbar.mdCenterTitle
|
|
148
|
+
const addCenterTitleClass = theme && theme.md && f7 && f7.params.navbar.mdCenterTitle;
|
|
168
149
|
const isLarge = large || largeTransparent;
|
|
169
150
|
const isTransparent = transparent || isLarge && largeTransparent;
|
|
170
151
|
const isTransparentVisible = isTransparent && transparentVisible.current;
|
|
@@ -178,10 +159,8 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
178
159
|
'navbar-master-detail': routerNavbarRole.current === 'detail',
|
|
179
160
|
'navbar-master-detail-root': routerNavbarRoleDetailRoot.current === true,
|
|
180
161
|
'navbar-master-stacked': routerNavbarMasterStack.current === true,
|
|
181
|
-
'no-
|
|
182
|
-
'no-hairline': noHairline
|
|
162
|
+
'no-outline': !outline
|
|
183
163
|
}, colorClasses(props));
|
|
184
|
-
|
|
185
164
|
if (backLink || slots['nav-left'] || slots.left) {
|
|
186
165
|
leftEl = /*#__PURE__*/React.createElement(NavLeft, {
|
|
187
166
|
backLink: backLink,
|
|
@@ -191,21 +170,17 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
191
170
|
onBackClick: onBackClick
|
|
192
171
|
}, slots['nav-left'], slots.left);
|
|
193
172
|
}
|
|
194
|
-
|
|
195
173
|
if (title || subtitle || slots.title) {
|
|
196
174
|
titleEl = /*#__PURE__*/React.createElement(NavTitle, {
|
|
197
175
|
title: title,
|
|
198
176
|
subtitle: subtitle
|
|
199
177
|
}, slots.title);
|
|
200
178
|
}
|
|
201
|
-
|
|
202
179
|
if (slots['nav-right'] || slots.right) {
|
|
203
180
|
rightEl = /*#__PURE__*/React.createElement(NavRight, null, slots['nav-right'], slots.right);
|
|
204
181
|
}
|
|
205
|
-
|
|
206
182
|
let largeTitle = titleLarge;
|
|
207
183
|
if (!largeTitle && large && title) largeTitle = title;
|
|
208
|
-
|
|
209
184
|
if (largeTitle || slots['title-large']) {
|
|
210
185
|
titleLargeEl = /*#__PURE__*/React.createElement("div", {
|
|
211
186
|
className: "title-large"
|
|
@@ -213,7 +188,6 @@ const Navbar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
213
188
|
className: "title-large-text"
|
|
214
189
|
}, largeTitle || '', slots['title-large']));
|
|
215
190
|
}
|
|
216
|
-
|
|
217
191
|
const innerEl = /*#__PURE__*/React.createElement("div", {
|
|
218
192
|
className: classNames('navbar-inner', innerClass, innerClassName, {
|
|
219
193
|
sliding,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
5
4
|
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
@@ -8,6 +7,7 @@ import Preloader from './preloader.js';
|
|
|
8
7
|
import { useTab } from '../shared/use-tab.js';
|
|
9
8
|
import { f7ready, f7 } from '../shared/f7.js';
|
|
10
9
|
|
|
10
|
+
|
|
11
11
|
const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
12
|
const {
|
|
13
13
|
className,
|
|
@@ -33,42 +33,34 @@ const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
33
33
|
} = props;
|
|
34
34
|
const extraAttrs = getExtraAttrs(props);
|
|
35
35
|
const elRef = useRef(null);
|
|
36
|
-
|
|
37
36
|
const onPtrPullStart = el => {
|
|
38
37
|
if (elRef.current !== el) return;
|
|
39
38
|
emit(props, 'ptrPullStart');
|
|
40
39
|
};
|
|
41
|
-
|
|
42
40
|
const onPtrPullMove = el => {
|
|
43
41
|
if (elRef.current !== el) return;
|
|
44
42
|
emit(props, 'ptrPullMove');
|
|
45
43
|
};
|
|
46
|
-
|
|
47
44
|
const onPtrPullEnd = el => {
|
|
48
45
|
if (elRef.current !== el) return;
|
|
49
46
|
emit(props, 'ptrPullEnd');
|
|
50
47
|
};
|
|
51
|
-
|
|
52
48
|
const onPtrRefresh = (el, done) => {
|
|
53
49
|
if (elRef.current !== el) return;
|
|
54
50
|
emit(props, 'ptrRefresh', done);
|
|
55
51
|
};
|
|
56
|
-
|
|
57
52
|
const onPtrDone = el => {
|
|
58
53
|
if (elRef.current !== el) return;
|
|
59
54
|
emit(props, 'ptrDone');
|
|
60
55
|
};
|
|
61
|
-
|
|
62
56
|
const onInfinite = el => {
|
|
63
57
|
if (elRef.current !== el) return;
|
|
64
58
|
emit(props, 'infinite');
|
|
65
59
|
};
|
|
66
|
-
|
|
67
60
|
useImperativeHandle(ref, () => ({
|
|
68
61
|
el: elRef.current
|
|
69
62
|
}));
|
|
70
63
|
useTab(elRef, props);
|
|
71
|
-
|
|
72
64
|
const attachEvents = () => {
|
|
73
65
|
f7ready(() => {
|
|
74
66
|
if (ptr) {
|
|
@@ -78,13 +70,11 @@ const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
78
70
|
f7.on('ptrRefresh', onPtrRefresh);
|
|
79
71
|
f7.on('ptrDone', onPtrDone);
|
|
80
72
|
}
|
|
81
|
-
|
|
82
73
|
if (infinite) {
|
|
83
74
|
f7.on('infinite', onInfinite);
|
|
84
75
|
}
|
|
85
76
|
});
|
|
86
77
|
};
|
|
87
|
-
|
|
88
78
|
const detachEvents = () => {
|
|
89
79
|
if (!f7) return;
|
|
90
80
|
f7.off('ptrPullStart', onPtrPullStart);
|
|
@@ -94,14 +84,12 @@ const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
94
84
|
f7.off('ptrDone', onPtrDone);
|
|
95
85
|
f7.off('infinite', onInfinite);
|
|
96
86
|
};
|
|
97
|
-
|
|
98
87
|
useIsomorphicLayoutEffect(() => {
|
|
99
88
|
attachEvents();
|
|
100
89
|
return detachEvents;
|
|
101
90
|
});
|
|
102
91
|
let ptrEl;
|
|
103
92
|
let infiniteEl;
|
|
104
|
-
|
|
105
93
|
if (ptr && ptrPreloader) {
|
|
106
94
|
ptrEl = /*#__PURE__*/React.createElement("div", {
|
|
107
95
|
className: "ptr-preloader"
|
|
@@ -109,13 +97,11 @@ const PageContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
109
97
|
className: "ptr-arrow"
|
|
110
98
|
}));
|
|
111
99
|
}
|
|
112
|
-
|
|
113
100
|
if (infinite && infinitePreloader) {
|
|
114
101
|
infiniteEl = /*#__PURE__*/React.createElement(Preloader, {
|
|
115
102
|
className: "infinite-scroll-preloader"
|
|
116
103
|
});
|
|
117
104
|
}
|
|
118
|
-
|
|
119
105
|
const classes = classNames(className, 'page-content', {
|
|
120
106
|
tab,
|
|
121
107
|
'tab-active': tabActive,
|