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.
Files changed (107) hide show
  1. package/components/accordion-content.js +6 -9
  2. package/components/accordion-item.js +11 -9
  3. package/components/accordion-toggle.js +11 -9
  4. package/components/accordion.js +11 -9
  5. package/components/actions-button.js +11 -9
  6. package/components/actions-group.js +11 -9
  7. package/components/actions-label.js +11 -9
  8. package/components/actions.js +13 -10
  9. package/components/app.js +10 -8
  10. package/components/area-chart.js +27 -29
  11. package/components/badge.js +11 -9
  12. package/components/block-footer.js +11 -9
  13. package/components/block-header.js +11 -9
  14. package/components/block-title.js +11 -9
  15. package/components/block.js +11 -9
  16. package/components/breadcrumbs-collapsed.js +11 -9
  17. package/components/breadcrumbs-item.js +11 -9
  18. package/components/breadcrumbs-separator.js +11 -9
  19. package/components/breadcrumbs.js +11 -9
  20. package/components/button.js +15 -10
  21. package/components/card-content.js +11 -9
  22. package/components/card-footer.js +11 -9
  23. package/components/card-header.js +11 -9
  24. package/components/card.js +14 -11
  25. package/components/checkbox.js +13 -10
  26. package/components/chip.js +11 -9
  27. package/components/fab-backdrop.js +11 -9
  28. package/components/fab-button.js +11 -9
  29. package/components/fab-buttons.js +11 -9
  30. package/components/fab.js +11 -9
  31. package/components/gauge.js +11 -9
  32. package/components/icon.js +11 -9
  33. package/components/input.js +15 -25
  34. package/components/link.js +13 -10
  35. package/components/list-button.js +11 -9
  36. package/components/list-group.js +11 -9
  37. package/components/list-index.js +15 -12
  38. package/components/list-input.js +15 -25
  39. package/components/list-item-content.js +7 -2
  40. package/components/list-item.js +14 -11
  41. package/components/list.js +13 -10
  42. package/components/login-screen-title.js +11 -9
  43. package/components/login-screen.js +13 -10
  44. package/components/message.js +11 -9
  45. package/components/messagebar-attachment.js +11 -9
  46. package/components/messagebar-attachments.js +11 -9
  47. package/components/messagebar-sheet-image.js +11 -9
  48. package/components/messagebar-sheet-item.js +11 -9
  49. package/components/messagebar-sheet.js +11 -9
  50. package/components/messagebar.js +17 -13
  51. package/components/messages-title.js +11 -9
  52. package/components/messages.js +13 -10
  53. package/components/nav-left.d.ts +0 -1
  54. package/components/nav-left.js +12 -17
  55. package/components/nav-right.d.ts +0 -1
  56. package/components/nav-right.js +11 -13
  57. package/components/nav-title-large.js +11 -10
  58. package/components/nav-title.d.ts +0 -1
  59. package/components/nav-title.js +11 -13
  60. package/components/navbar.d.ts +0 -1
  61. package/components/navbar.js +15 -40
  62. package/components/page-content.js +11 -10
  63. package/components/page.js +10 -8
  64. package/components/panel.js +14 -15
  65. package/components/photo-browser.d.ts +0 -1
  66. package/components/photo-browser.js +14 -15
  67. package/components/pie-chart.js +16 -16
  68. package/components/popover.d.ts +0 -1
  69. package/components/popover.js +14 -16
  70. package/components/popup.js +13 -11
  71. package/components/preloader.js +11 -10
  72. package/components/progressbar.js +13 -11
  73. package/components/radio.js +11 -10
  74. package/components/range.js +14 -12
  75. package/components/routable-modals.js +17 -15
  76. package/components/searchbar.js +22 -18
  77. package/components/segmented.js +11 -10
  78. package/components/sheet.js +13 -11
  79. package/components/stepper.js +18 -16
  80. package/components/subnavbar.d.ts +0 -1
  81. package/components/subnavbar.js +11 -13
  82. package/components/swipeout-actions.js +11 -10
  83. package/components/swipeout-button.js +11 -10
  84. package/components/tab.js +11 -10
  85. package/components/tabs.js +19 -12
  86. package/components/text-editor.js +14 -12
  87. package/components/toggle.js +19 -18
  88. package/components/toolbar-pane.d.ts +16 -0
  89. package/components/toolbar-pane.js +29 -0
  90. package/components/toolbar.js +14 -12
  91. package/components/treeview-item.js +11 -10
  92. package/components/treeview.js +11 -10
  93. package/components/view.d.ts +0 -2
  94. package/components/view.js +28 -28
  95. package/components/views.js +11 -10
  96. package/framework7-react.d.ts +2 -1
  97. package/framework7-react.js +5 -4
  98. package/package.json +2 -2
  99. package/shared/components-router.js +20 -23
  100. package/shared/f7.js +1 -7
  101. package/shared/modal-state-classes.js +4 -5
  102. package/shared/plugin.js +1 -4
  103. package/shared/set-ref.js +11 -0
  104. package/shared/use-icon.js +1 -4
  105. package/shared/use-route-props.js +3 -4
  106. package/shared/use-store.js +5 -5
  107. package/shared/utils.js +6 -24
@@ -1,5 +1,5 @@
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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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 = /*#__PURE__*/forwardRef((props, ref) => {
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: elRef
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 (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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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 = /*#__PURE__*/forwardRef((props, ref) => {
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: elRef
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;
@@ -1,14 +1,15 @@
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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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 = /*#__PURE__*/forwardRef((props, ref) => {
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: elRef
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;
@@ -11,7 +11,6 @@ export interface NavLeftProps {
11
11
  backLinkUrl ?: string;
12
12
  backLinkForce ?: boolean;
13
13
  backLinkShowText ?: boolean;
14
- sliding ?: boolean;
15
14
  color?: string;
16
15
  colorTheme?: string;
17
16
  textColor?: string;
@@ -1,12 +1,12 @@
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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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 { useTheme } from '../shared/use-theme.js';
5
+ import { setRef } from '../shared/set-ref.js';
6
6
  import Link from './link.js';
7
7
 
8
8
 
9
- const NavLeft = /*#__PURE__*/forwardRef((props, ref) => {
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
- sliding
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 && needBackLinkText ? backLink : undefined;
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: elRef
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;
@@ -7,7 +7,6 @@ export interface NavRightProps {
7
7
  id?: string | number;
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
- sliding ?: boolean;
11
10
  ref?: React.MutableRefObject<{el: HTMLElement | null}>;
12
11
  children?: React.ReactNode;
13
12
  color?: string;
@@ -1,31 +1,29 @@
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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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
- sliding
13
+ ref
14
14
  } = props;
15
15
  const extraAttrs = getExtraAttrs(props);
16
16
  const elRef = useRef(null);
17
- useImperativeHandle(ref, () => ({
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: elRef
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 (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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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: elRef
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;
@@ -9,7 +9,6 @@ export interface NavTitleProps {
9
9
  style?: React.CSSProperties;
10
10
  title ?: string;
11
11
  subtitle ?: string;
12
- sliding ?: boolean;
13
12
  ref?: React.MutableRefObject<{el: HTMLElement | null}>;
14
13
  children?: React.ReactNode;
15
14
  color?: string;
@@ -1,10 +1,10 @@
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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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
- sliding
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: elRef
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;
@@ -11,7 +11,6 @@ export interface NavbarProps {
11
11
  backLinkUrl ?: string;
12
12
  backLinkForce ?: boolean;
13
13
  backLinkShowText ?: boolean;
14
- sliding ?: boolean;
15
14
  title ?: string;
16
15
  subtitle ?: string;
17
16
  hidden ?: boolean;
@@ -1,21 +1,21 @@
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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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 = /*#__PURE__*/forwardRef((props, ref) => {
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: elRef
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 (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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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: elRef
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;
@@ -1,13 +1,14 @@
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); }
2
- import React, { forwardRef, useRef, useImperativeHandle } from '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 = /*#__PURE__*/forwardRef((props, ref) => {
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: elRef
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;