framework7-react 8.3.4 → 9.0.0

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 +13 -10
  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,28 +1,25 @@
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 from 'react';
3
3
  import { classNames, getExtraAttrs } from '../shared/utils.js';
4
4
  import { colorClasses } from '../shared/mixins.js';
5
5
 
6
6
 
7
- const AccordionContent = /*#__PURE__*/forwardRef((props, ref) => {
7
+ const AccordionContent = props => {
8
8
  const {
9
9
  className,
10
10
  id,
11
11
  style,
12
+ ref,
12
13
  children
13
14
  } = props;
14
- const elRef = useRef(null);
15
- useImperativeHandle(ref, () => ({
16
- el: elRef.current
17
- }));
18
15
  const extraAttrs = getExtraAttrs(props);
19
16
  const classes = classNames(className, 'accordion-item-content', colorClasses(props));
20
17
  return /*#__PURE__*/React.createElement("div", _extends({
21
18
  id: id,
22
19
  style: style,
23
20
  className: classes,
24
- ref: elRef
21
+ ref: ref
25
22
  }, extraAttrs), children);
26
- });
23
+ };
27
24
  AccordionContent.displayName = 'f7-accordion-content';
28
25
  export default AccordionContent;
@@ -1,23 +1,22 @@
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 { f7, f7ready } from '../shared/f7.js';
7
+ import { setRef } from '../shared/set-ref.js';
7
8
 
8
9
 
9
- const AccordionItem = /*#__PURE__*/forwardRef((props, ref) => {
10
+ const AccordionItem = props => {
10
11
  const {
11
12
  className,
12
13
  id,
13
14
  style,
14
15
  children,
15
- opened
16
+ opened,
17
+ ref
16
18
  } = props;
17
19
  const elRef = useRef(null);
18
- useImperativeHandle(ref, () => ({
19
- el: elRef.current
20
- }));
21
20
  const onBeforeOpen = (el, prevent) => {
22
21
  if (elRef.current !== el) return;
23
22
  emit(props, 'accordionBeforeOpen', prevent);
@@ -72,8 +71,11 @@ const AccordionItem = /*#__PURE__*/forwardRef((props, ref) => {
72
71
  id: id,
73
72
  style: style,
74
73
  className: classes,
75
- ref: elRef
74
+ ref: el => {
75
+ elRef.current = el;
76
+ setRef(ref, el);
77
+ }
76
78
  }, extraAttrs), children);
77
- });
79
+ };
78
80
  AccordionItem.displayName = 'f7-accordion-item';
79
81
  export default AccordionItem;
@@ -1,20 +1,19 @@
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 AccordionToggle = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const AccordionToggle = 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 elRef = useRef(null);
15
- useImperativeHandle(ref, () => ({
16
- el: elRef.current
17
- }));
18
17
  const extraAttrs = getExtraAttrs(props);
19
18
  const classes = classNames(className, 'accordion-item-toggle', colorClasses(props));
20
19
  return /*#__PURE__*/React.createElement("div", _extends({
@@ -22,8 +21,11 @@ const AccordionToggle = /*#__PURE__*/forwardRef((props, ref) => {
22
21
  style: style,
23
22
  className: classes
24
23
  }, extraAttrs, {
25
- ref: elRef
24
+ ref: el => {
25
+ elRef.current = el;
26
+ setRef(ref, el);
27
+ }
26
28
  }), children);
27
- });
29
+ };
28
30
  AccordionToggle.displayName = 'f7-accordion-toggle';
29
31
  export default AccordionToggle;
@@ -1,29 +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, useImperativeHandle, useRef } 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 Accordion = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const Accordion = props => {
8
9
  const {
9
10
  className,
10
11
  id,
11
12
  style,
12
13
  accordionOpposite,
13
- children
14
+ children,
15
+ ref
14
16
  } = props;
15
17
  const elRef = useRef(null);
16
- useImperativeHandle(ref, () => ({
17
- el: elRef.current
18
- }));
19
18
  const extraAttrs = getExtraAttrs(props);
20
19
  const classes = classNames(className, 'accordion-list', accordionOpposite && 'accordion-opposite', colorClasses(props));
21
20
  return /*#__PURE__*/React.createElement("div", _extends({
22
21
  id: id,
23
22
  style: style,
24
23
  className: classes,
25
- ref: elRef
24
+ ref: el => {
25
+ elRef.current = el;
26
+ setRef(ref, el);
27
+ }
26
28
  }, extraAttrs), children);
27
- });
29
+ };
28
30
  Accordion.displayName = 'f7-accordion';
29
31
  export default Accordion;
@@ -1,23 +1,22 @@
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, getSlots, emit } from '../shared/utils.js';
4
4
  import { colorClasses } from '../shared/mixins.js';
5
5
  import { f7 } from '../shared/f7.js';
6
+ import { setRef } from '../shared/set-ref.js';
6
7
 
7
8
 
8
- const ComponentName = /*#__PURE__*/forwardRef((props, ref) => {
9
+ const ComponentName = props => {
9
10
  const {
10
11
  className,
11
12
  id,
12
13
  style,
13
14
  strong,
14
- close = true
15
+ close = true,
16
+ ref
15
17
  } = props;
16
18
  const extraAttrs = getExtraAttrs(props);
17
19
  const elRef = useRef(null);
18
- useImperativeHandle(ref, () => ({
19
- el: elRef.current
20
- }));
21
20
  const classes = classNames(className, {
22
21
  'actions-button': true,
23
22
  'actions-button-strong': strong
@@ -39,12 +38,15 @@ const ComponentName = /*#__PURE__*/forwardRef((props, ref) => {
39
38
  id: id,
40
39
  style: style,
41
40
  className: classes,
42
- ref: elRef
41
+ ref: el => {
42
+ elRef.current = el;
43
+ setRef(ref, el);
44
+ }
43
45
  }, extraAttrs, {
44
46
  onClick: onClick
45
47
  }), mediaEl, /*#__PURE__*/React.createElement("div", {
46
48
  className: "actions-button-text"
47
49
  }, slots.default));
48
- });
50
+ };
49
51
  ComponentName.displayName = 'f7-actions-button';
50
52
  export default ComponentName;
@@ -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 ActionsGroup = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const ActionsGroup = 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, 'actions-group', 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
  ActionsGroup.displayName = 'f7-actions-group';
28
30
  export default ActionsGroup;
@@ -1,22 +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 { classNames, getExtraAttrs, emit } from '../shared/utils.js';
4
4
  import { colorClasses } from '../shared/mixins.js';
5
+ import { setRef } from '../shared/set-ref.js';
5
6
 
6
7
 
7
- const ActionsLabel = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const ActionsLabel = props => {
8
9
  const {
9
10
  className,
10
11
  id,
11
12
  style,
12
13
  children,
13
- strong
14
+ strong,
15
+ ref
14
16
  } = props;
15
17
  const extraAttrs = getExtraAttrs(props);
16
18
  const elRef = useRef(null);
17
- useImperativeHandle(ref, () => ({
18
- el: elRef.current
19
- }));
20
19
  const classes = classNames(className, 'actions-label', {
21
20
  'actions-button-strong': strong
22
21
  }, colorClasses(props));
@@ -27,10 +26,13 @@ const ActionsLabel = /*#__PURE__*/forwardRef((props, ref) => {
27
26
  id: id,
28
27
  style: style,
29
28
  className: classes,
30
- ref: elRef
29
+ ref: el => {
30
+ elRef.current = el;
31
+ setRef(ref, el);
32
+ }
31
33
  }, extraAttrs, {
32
34
  onClick: onClick
33
35
  }), children);
34
- });
36
+ };
35
37
  ActionsLabel.displayName = 'f7-actions-label';
36
38
  export default ActionsLabel;
@@ -1,15 +1,16 @@
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 { f7, f7ready } from '../shared/f7.js';
7
7
  import { watchProp } from '../shared/watch-prop.js';
8
8
  import { modalStateClasses } from '../shared/modal-state-classes.js';
9
+ import { setRef } from '../shared/set-ref.js';
9
10
 
10
11
 
11
12
 
12
- const Actions = /*#__PURE__*/forwardRef((props, ref) => {
13
+ const Actions = props => {
13
14
  const {
14
15
  className,
15
16
  id,
@@ -17,7 +18,8 @@ const Actions = /*#__PURE__*/forwardRef((props, ref) => {
17
18
  children,
18
19
  grid,
19
20
  opened = false,
20
- animate
21
+ animate,
22
+ ref
21
23
  } = props;
22
24
  const extraAttrs = getExtraAttrs(props);
23
25
  const elRef = useRef(null);
@@ -41,10 +43,6 @@ const Actions = /*#__PURE__*/forwardRef((props, ref) => {
41
43
  isClosing.current = false;
42
44
  emit(props, 'actionsClosed', instance);
43
45
  };
44
- useImperativeHandle(ref, () => ({
45
- el: elRef.current,
46
- f7Actions: () => f7Actions.current
47
- }));
48
46
 
49
47
  // watch opened changes
50
48
  watchProp(opened, value => {
@@ -121,8 +119,13 @@ const Actions = /*#__PURE__*/forwardRef((props, ref) => {
121
119
  id: id,
122
120
  style: style,
123
121
  className: classes,
124
- ref: elRef
122
+ ref: el => {
123
+ elRef.current = el;
124
+ setRef(ref, el, {
125
+ f7Actions: () => f7Actions.current
126
+ });
127
+ }
125
128
  }, extraAttrs), children);
126
- });
129
+ };
127
130
  Actions.displayName = 'f7-actions';
128
131
  export default Actions;
package/components/app.js CHANGED
@@ -1,27 +1,26 @@
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 } from '../shared/utils.js';
5
5
  import { colorClasses } from '../shared/mixins.js';
6
6
  import RoutableModals from './routable-modals.js';
7
7
  import { f7init, f7 } from '../shared/f7.js';
8
+ import { setRef } from '../shared/set-ref.js';
8
9
 
9
10
 
10
11
 
11
12
 
12
- const App = /*#__PURE__*/forwardRef((props, ref) => {
13
+ const App = props => {
13
14
  const {
14
15
  className,
15
16
  style,
16
17
  children,
18
+ ref,
17
19
  ...rest
18
20
  } = props;
19
21
  const extraAttrs = getExtraAttrs(props);
20
22
  const params = rest;
21
23
  const elRef = useRef(null);
22
- useImperativeHandle(ref, () => ({
23
- el: elRef.current
24
- }));
25
24
  const classes = classNames(className, 'framework7-root', colorClasses(props));
26
25
 
27
26
  // eslint-disable-next-line
@@ -45,8 +44,11 @@ const App = /*#__PURE__*/forwardRef((props, ref) => {
45
44
  id: "framework7-root",
46
45
  style: style,
47
46
  className: classes,
48
- ref: elRef
47
+ ref: el => {
48
+ elRef.current = el;
49
+ setRef(ref, el);
50
+ }
49
51
  }, extraAttrs), children, /*#__PURE__*/React.createElement(RoutableModals, null));
50
- });
52
+ };
51
53
  App.displayName = 'f7-app';
52
54
  export default App;
@@ -1,10 +1,11 @@
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, useState, useEffect } 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, useState, useEffect } from 'react';
3
3
  import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
4
4
  import { f7 } from '../shared/f7.js';
5
+ import { setRef } from '../shared/set-ref.js';
5
6
 
6
7
 
7
- const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const AreaChart = props => {
8
9
  const {
9
10
  className,
10
11
  id,
@@ -25,7 +26,8 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
25
26
  formatTooltipAxisLabel,
26
27
  formatTooltipTotal,
27
28
  formatTooltipDataset,
28
- children
29
+ children,
30
+ ref
29
31
  } = props;
30
32
  const [currentIndex, setCurrentIndex] = useState(null);
31
33
  const previousIndex = useRef(null);
@@ -35,9 +37,6 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
35
37
  const svgElRef = useRef(null);
36
38
  const f7Tooltip = useRef(null);
37
39
  const linesOffsets = useRef(null);
38
- useImperativeHandle(ref, () => ({
39
- el: elRef.current
40
- }));
41
40
  const getVisibleLegends = () => {
42
41
  if (!maxAxisLabels || axisLabels.length <= maxAxisLabels) return axisLabels;
43
42
  const skipStep = Math.ceil(axisLabels.length / maxAxisLabels);
@@ -46,10 +45,9 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
46
45
  };
47
46
  const getSummValues = () => {
48
47
  const summValues = [];
49
- datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(_ref => {
50
- let {
51
- values
52
- } = _ref;
48
+ datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(({
49
+ values
50
+ }) => {
53
51
  values.forEach((value, valueIndex) => {
54
52
  if (!summValues[valueIndex]) summValues[valueIndex] = 0;
55
53
  summValues[valueIndex] += value;
@@ -65,22 +63,20 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
65
63
  const lastValues = datasets[0].values.map(() => 0);
66
64
  let maxValue = 0;
67
65
  if (lineChart) {
68
- datasets.forEach(_ref2 => {
69
- let {
70
- values
71
- } = _ref2;
66
+ datasets.forEach(({
67
+ values
68
+ }) => {
72
69
  const datasetMaxValue = Math.max(...values);
73
70
  if (datasetMaxValue > maxValue) maxValue = datasetMaxValue;
74
71
  });
75
72
  } else {
76
73
  maxValue = Math.max(...getSummValues());
77
74
  }
78
- datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(_ref3 => {
79
- let {
80
- label,
81
- values,
82
- color
83
- } = _ref3;
75
+ datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(({
76
+ label,
77
+ values,
78
+ color
79
+ }) => {
84
80
  const points = values.map((originalValue, valueIndex) => {
85
81
  lastValues[valueIndex] += originalValue;
86
82
  const value = lineChart ? originalValue : lastValues[valueIndex];
@@ -162,12 +158,11 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
162
158
  // prettier-ignore
163
159
  const datasetsText = currentValues.length > 0 ? `
164
160
  <ul class="area-chart-tooltip-list">
165
- ${currentValues.map(_ref4 => {
166
- let {
167
- label,
168
- color,
169
- value
170
- } = _ref4;
161
+ ${currentValues.map(({
162
+ label,
163
+ color,
164
+ value
165
+ }) => {
171
166
  const valueText = formatTooltipDataset ? formatTooltipDataset(label, value, color) : `${label}: ${value}`;
172
167
  return `
173
168
  <li><span style="background-color: ${color};"></span>${valueText}</li>
@@ -269,7 +264,10 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
269
264
  id: id,
270
265
  style: style,
271
266
  className: classes,
272
- ref: elRef
267
+ ref: el => {
268
+ elRef.current = el;
269
+ setRef(ref, el);
270
+ }
273
271
  }, extraAttrs), /*#__PURE__*/React.createElement("svg", {
274
272
  xmlns: "http://www.w3.org/2000/svg",
275
273
  width: width,
@@ -314,6 +312,6 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
314
312
  backgroundColor: dataset.color
315
313
  }
316
314
  }), formatLegendLabel(dataset.label)))), children);
317
- });
315
+ };
318
316
  AreaChart.displayName = 'f7-area-chart';
319
317
  export default AreaChart;
@@ -1,8 +1,9 @@
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
5
  import { useTooltip } from '../shared/use-tooltip.js';
6
+ import { setRef } from '../shared/set-ref.js';
6
7
 
7
8
 
8
9
  /* dts-instance
@@ -10,26 +11,27 @@ f7Tooltip: Tooltip.Tooltip
10
11
  */
11
12
 
12
13
 
13
- const Badge = /*#__PURE__*/forwardRef((props, ref) => {
14
+ const Badge = props => {
14
15
  const {
15
16
  className,
16
17
  id,
17
18
  style,
18
- children
19
+ children,
20
+ ref
19
21
  } = props;
20
22
  const extraAttrs = getExtraAttrs(props);
21
23
  const elRef = useRef(null);
22
- useImperativeHandle(ref, () => ({
23
- el: elRef.current
24
- }));
25
24
  useTooltip(elRef, props);
26
25
  const classes = classNames(className, 'badge', colorClasses(props));
27
26
  return /*#__PURE__*/React.createElement("span", _extends({
28
27
  id: id,
29
28
  style: style,
30
29
  className: classes,
31
- ref: elRef
30
+ ref: el => {
31
+ elRef.current = el;
32
+ setRef(ref, el);
33
+ }
32
34
  }, extraAttrs), children);
33
- });
35
+ };
34
36
  Badge.displayName = 'f7-badge';
35
37
  export default Badge;
@@ -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 BlockFooter = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const BlockFooter = 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, 'block-footer', 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
  BlockFooter.displayName = 'f7-block-footer';
28
30
  export default BlockFooter;
@@ -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 BlockHeader = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const BlockHeader = 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, 'block-header', 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
  BlockHeader.displayName = 'f7-block-header';
28
30
  export default BlockHeader;