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, useState, useContext } 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, useContext } from 'react';
3
3
  import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
4
4
  import { classNames, getExtraAttrs, emit, getSlots, extend } from '../shared/utils.js';
5
5
  import { colorClasses } from '../shared/mixins.js';
@@ -7,9 +7,10 @@ import { f7ready, f7 } from '../shared/f7.js';
7
7
  import TextEditor from './text-editor.js';
8
8
  import { watchProp } from '../shared/watch-prop.js';
9
9
  import { ListContext } from '../shared/list-context.js';
10
+ import { setRef } from '../shared/set-ref.js';
10
11
 
11
12
 
12
- const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
13
+ const ListInput = props => {
13
14
  const {
14
15
  className,
15
16
  id,
@@ -70,7 +71,8 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
70
71
  // Colorpicker
71
72
  colorPickerParams,
72
73
  // Text editor
73
- textEditorParams
74
+ textEditorParams,
75
+ ref
74
76
  } = props;
75
77
  const [inputInvalid, setInputInvalid] = useState(false);
76
78
  const [inputFocused, setInputFocused] = useState(false);
@@ -124,44 +126,29 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
124
126
  const onInputClear = event => {
125
127
  emit(props, 'inputClear', event);
126
128
  };
127
- const onInput = function () {
128
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
129
- args[_key] = arguments[_key];
130
- }
129
+ const onInput = (...args) => {
131
130
  emit(props, 'input', ...args);
132
131
  if (!(validateOnBlur || validateOnBlur === '') && (validate || validate === '') && inputElRef.current) {
133
132
  validateInput(inputElRef.current);
134
133
  }
135
134
  };
136
- const onFocus = function () {
137
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
138
- args[_key2] = arguments[_key2];
139
- }
135
+ const onFocus = (...args) => {
140
136
  emit(props, 'focus', ...args);
141
137
  setInputFocused(true);
142
138
  };
143
- const onBlur = function () {
144
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
145
- args[_key3] = arguments[_key3];
146
- }
139
+ const onBlur = (...args) => {
147
140
  emit(props, 'blur', ...args);
148
141
  if ((validate || validate === '' || validateOnBlur || validateOnBlur === '') && inputElRef.current) {
149
142
  validateInput(inputElRef.current);
150
143
  }
151
144
  setInputFocused(false);
152
145
  };
153
- const onChange = function () {
154
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
155
- args[_key4] = arguments[_key4];
156
- }
146
+ const onChange = (...args) => {
157
147
  emit(props, 'change', ...args);
158
148
  if (type === 'texteditor') {
159
149
  emit(props, 'textEditorChange', args[0]);
160
150
  }
161
151
  };
162
- useImperativeHandle(ref, () => ({
163
- el: elRef.current
164
- }));
165
152
  const onMount = () => {
166
153
  if (!elRef.current && !itemContentElRef.current) return;
167
154
  f7ready(() => {
@@ -382,7 +369,10 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
382
369
  return ItemContent;
383
370
  }
384
371
  return /*#__PURE__*/React.createElement("li", _extends({
385
- ref: elRef,
372
+ ref: el => {
373
+ elRef.current = el;
374
+ setRef(ref, el);
375
+ },
386
376
  id: id,
387
377
  style: style,
388
378
  className: classNames(className, {
@@ -391,6 +381,6 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
391
381
  }, extraAttrs), slots['root-start'], ItemContent, isSortableComputed && /*#__PURE__*/React.createElement("div", {
392
382
  className: "sortable-handler"
393
383
  }), slots.root, slots['root-end']);
394
- });
384
+ };
395
385
  ListInput.displayName = 'f7-list-input';
396
386
  export default ListInput;
@@ -1,6 +1,7 @@
1
1
  import React, { useRef, useEffect } from 'react';
2
2
  import { classNames } from '../shared/utils.js';
3
3
  import { colorClasses } from '../shared/mixins.js';
4
+ import { setRef } from '../shared/set-ref.js';
4
5
  import Badge from './badge.js';
5
6
  const ListItemContent = props => {
6
7
  const {
@@ -33,7 +34,8 @@ const ListItemContent = props => {
33
34
  isMediaComputed,
34
35
  isSortableComputed,
35
36
  isSortableOppositeComputed,
36
- slots
37
+ slots,
38
+ ref
37
39
  } = props;
38
40
  const inputElRef = useRef(null);
39
41
  useEffect(() => {
@@ -147,7 +149,10 @@ const ListItemContent = props => {
147
149
  }, colorClasses(props));
148
150
  return /*#__PURE__*/React.createElement(ItemContentTag, {
149
151
  className: classes,
150
- onClick: onClick
152
+ onClick: onClick,
153
+ ref: el => {
154
+ setRef(ref, el);
155
+ }
151
156
  }, isSortableComputed && sortable !== false && isSortableOppositeComputed && /*#__PURE__*/React.createElement("div", {
152
157
  className: "sortable-handler"
153
158
  }), slots['content-start'], inputEl, inputIconEl, mediaEl, innerEl, slots.content, slots['content-end']);
@@ -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, useContext } 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, useContext } from 'react';
3
3
  import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
4
4
  import { classNames, getExtraAttrs, getSlots, emit, isStringProp } from '../shared/utils.js';
5
5
  import { colorClasses, actionsAttrs, actionsClasses, routerAttrs, routerClasses } from '../shared/mixins.js';
@@ -10,6 +10,7 @@ import { watchProp } from '../shared/watch-prop.js';
10
10
  import { f7ready, f7 } from '../shared/f7.js';
11
11
  import ListItemContent from './list-item-content.js';
12
12
  import { ListContext } from '../shared/list-context.js';
13
+ import { setRef } from '../shared/set-ref.js';
13
14
 
14
15
 
15
16
 
@@ -52,7 +53,7 @@ const ListItemContent = ({
52
53
 
53
54
  };
54
55
  */
55
- const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
56
+ const ListItem = props => {
56
57
  const {
57
58
  className,
58
59
  id,
@@ -81,7 +82,8 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
81
82
  radio,
82
83
  disabled,
83
84
  virtualListIndex,
84
- href
85
+ href,
86
+ ref
85
87
  } = props;
86
88
  const listContext = useContext(ListContext);
87
89
  const {
@@ -162,10 +164,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
162
164
  const onChange = event => {
163
165
  emit(props, 'change', event);
164
166
  };
165
- useImperativeHandle(ref, () => ({
166
- el: elRef.current,
167
- f7SmartSelect: () => f7SmartSelect.current
168
- }));
169
167
  useTooltip(elRef, props);
170
168
  useRouteProps(linkElRef, props);
171
169
  watchProp(swipeoutOpened, newValue => {
@@ -249,7 +247,7 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
249
247
  // Link
250
248
  if (link || href || accordionItem || smartSelect) {
251
249
  const linkAttrs = {
252
- href: link === true ? '' : link || href,
250
+ href: href === false ? undefined : link === true ? href || '' : link || href,
253
251
  target,
254
252
  'data-tab': isStringProp(tabLink) && tabLink || undefined,
255
253
  ...routerAttrs(props),
@@ -283,7 +281,12 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
283
281
  }, colorClasses(props));
284
282
  if (groupTitle) {
285
283
  return /*#__PURE__*/React.createElement("li", {
286
- ref: elRef,
284
+ ref: el => {
285
+ elRef.current = el;
286
+ setRef(ref, el, {
287
+ f7SmartSelect: () => f7SmartSelect.current
288
+ });
289
+ },
287
290
  id: id,
288
291
  style: style,
289
292
  className: liClasses,
@@ -313,6 +316,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
313
316
  }, linkItemEl) : linkItemEl, isSortableComputed && sortable !== false && !isSortableOppositeComputed && /*#__PURE__*/React.createElement("div", {
314
317
  className: "sortable-handler"
315
318
  }), (swipeout || accordionItem) && slots.default, slots.root, slots['root-end']);
316
- });
319
+ };
317
320
  ListItem.displayName = 'f7-list-item';
318
321
  export default ListItem;
@@ -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, getSlots, flattenArray, emit, extend } from '../shared/utils.js';
5
5
  import { colorClasses } from '../shared/mixins.js';
6
6
  import { f7, f7ready } from '../shared/f7.js';
7
7
  import { ListContext } from '../shared/list-context.js';
8
8
  import { useTab } from '../shared/use-tab.js';
9
+ import { setRef } from '../shared/set-ref.js';
9
10
 
10
11
 
11
- const List = /*#__PURE__*/forwardRef((props, ref) => {
12
+ const List = props => {
12
13
  const f7VirtualList = useRef(null);
13
14
  const {
14
15
  className,
@@ -60,7 +61,8 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
60
61
  form,
61
62
  formStoreData,
62
63
  virtualList,
63
- virtualListParams
64
+ virtualListParams,
65
+ ref
64
66
  } = props;
65
67
  const extraAttrs = getExtraAttrs(props);
66
68
  const elRef = useRef(null);
@@ -83,10 +85,6 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
83
85
  if (elRef.current !== listEl) return;
84
86
  emit(props, 'sortableMove', el, listEl);
85
87
  };
86
- useImperativeHandle(ref, () => ({
87
- el: elRef.current,
88
- f7VirtualList: () => f7VirtualList.current
89
- }));
90
88
  useTab(elRef, props);
91
89
  const attachEvents = () => {
92
90
  f7ready(() => {
@@ -217,7 +215,12 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
217
215
  }, colorClasses(props));
218
216
  return /*#__PURE__*/React.createElement(ListTag, _extends({
219
217
  id: id,
220
- ref: elRef,
218
+ ref: el => {
219
+ elRef.current = el;
220
+ setRef(ref, el, {
221
+ f7VirtualList: () => f7VirtualList.current
222
+ });
223
+ },
221
224
  style: style,
222
225
  className: classes
223
226
  }, extraAttrs, {
@@ -231,6 +234,6 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
231
234
  listIsSortableOpposite: sortableOpposite
232
235
  }
233
236
  }, slots['before-list'], rootChildrenBeforeList, ulChildren.length > 0 && /*#__PURE__*/React.createElement("ul", null, ulChildren), slots['after-list'], rootChildrenAfterList));
234
- });
237
+ };
235
238
  List.displayName = 'f7-list';
236
239
  export default List;
@@ -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 LoginScreenTitle = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const LoginScreenTitle = 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, 'login-screen-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
  LoginScreenTitle.displayName = 'f7-login-screen-title';
28
30
  export default LoginScreenTitle;
@@ -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, emit } from '../shared/utils.js';
5
5
  import { colorClasses } from '../shared/mixins.js';
6
6
  import { f7ready, f7 } from '../shared/f7.js';
7
7
  import { watchProp } from '../shared/watch-prop.js';
8
8
  import { modalStateClasses } from '../shared/modal-state-classes.js';
9
+ import { setRef } from '../shared/set-ref.js';
9
10
 
10
11
 
11
- const LoginScreen = /*#__PURE__*/forwardRef((props, ref) => {
12
+ const LoginScreen = props => {
12
13
  const f7LoginScreen = useRef(null);
13
14
  const {
14
15
  className,
@@ -17,7 +18,8 @@ const LoginScreen = /*#__PURE__*/forwardRef((props, ref) => {
17
18
  children,
18
19
  opened,
19
20
  animate,
20
- containerEl
21
+ containerEl,
22
+ ref
21
23
  } = props;
22
24
  const extraAttrs = getExtraAttrs(props);
23
25
  const isOpened = useRef(opened);
@@ -40,10 +42,6 @@ const LoginScreen = /*#__PURE__*/forwardRef((props, ref) => {
40
42
  isClosing.current = false;
41
43
  emit(props, 'loginScreenClosed', instance);
42
44
  };
43
- useImperativeHandle(ref, () => ({
44
- el: elRef.current,
45
- f7LoginScreen: () => f7LoginScreen.current
46
- }));
47
45
 
48
46
  // watch opened changes
49
47
  watchProp(opened, value => {
@@ -100,8 +98,13 @@ const LoginScreen = /*#__PURE__*/forwardRef((props, ref) => {
100
98
  id: id,
101
99
  style: style,
102
100
  className: classes,
103
- ref: elRef
101
+ ref: el => {
102
+ elRef.current = el;
103
+ setRef(ref, el, {
104
+ f7LoginScreen: () => f7LoginScreen.current
105
+ });
106
+ }
104
107
  }, extraAttrs), children);
105
- });
108
+ };
106
109
  LoginScreen.displayName = 'f7-login-screen';
107
110
  export default LoginScreen;
@@ -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 } 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
+ import { setRef } from '../shared/set-ref.js';
5
6
 
6
7
 
7
- const Message = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const Message = props => {
8
9
  const {
9
10
  className,
10
11
  id,
@@ -25,7 +26,8 @@ const Message = /*#__PURE__*/forwardRef((props, ref) => {
25
26
  sameHeader,
26
27
  sameFooter,
27
28
  sameAvatar,
28
- typing
29
+ typing,
30
+ ref
29
31
  } = props;
30
32
  const extraAttrs = getExtraAttrs(props);
31
33
  const elRef = useRef(null);
@@ -50,9 +52,6 @@ const Message = /*#__PURE__*/forwardRef((props, ref) => {
50
52
  const onBubbleClick = event => {
51
53
  emit(props, 'clickBubble', event);
52
54
  };
53
- useImperativeHandle(ref, () => ({
54
- el: elRef.current
55
- }));
56
55
  const slots = getSlots(props);
57
56
  const classes = classNames(className, 'message', {
58
57
  'message-sent': type === 'sent',
@@ -70,7 +69,10 @@ const Message = /*#__PURE__*/forwardRef((props, ref) => {
70
69
  id: id,
71
70
  style: style,
72
71
  className: classes,
73
- ref: elRef
72
+ ref: el => {
73
+ elRef.current = el;
74
+ setRef(ref, el);
75
+ }
74
76
  }, extraAttrs, {
75
77
  onClick: onClick
76
78
  }), slots.start, (avatar || slots.avatar) && /*#__PURE__*/React.createElement("div", {
@@ -107,6 +109,6 @@ const Message = /*#__PURE__*/forwardRef((props, ref) => {
107
109
  className: "message-footer",
108
110
  onClick: onFooterClick
109
111
  }, footer, slots.footer), slots['content-end']), slots.end);
110
- });
112
+ };
111
113
  Message.displayName = 'f7-message';
112
114
  export default Message;
@@ -1,17 +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, 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 MessagebarAttachment = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const MessagebarAttachment = props => {
8
9
  const {
9
10
  className,
10
11
  id,
11
12
  style,
12
13
  children,
13
14
  image,
14
- deletable = true
15
+ deletable = true,
16
+ ref
15
17
  } = props;
16
18
  const extraAttrs = getExtraAttrs(props);
17
19
  const elRef = useRef(null);
@@ -21,15 +23,15 @@ const MessagebarAttachment = /*#__PURE__*/forwardRef((props, ref) => {
21
23
  const onDeleteClick = event => {
22
24
  emit(props, 'attachmentDelete', event);
23
25
  };
24
- useImperativeHandle(ref, () => ({
25
- el: elRef.current
26
- }));
27
26
  const classes = classNames(className, 'messagebar-attachment', colorClasses(props));
28
27
  return /*#__PURE__*/React.createElement("div", _extends({
29
28
  id: id,
30
29
  style: style,
31
30
  className: classes,
32
- ref: elRef
31
+ ref: el => {
32
+ elRef.current = el;
33
+ setRef(ref, el);
34
+ }
33
35
  }, extraAttrs, {
34
36
  onClick: onClick
35
37
  }), image && /*#__PURE__*/React.createElement("img", {
@@ -38,6 +40,6 @@ const MessagebarAttachment = /*#__PURE__*/forwardRef((props, ref) => {
38
40
  className: "messagebar-attachment-delete",
39
41
  onClick: onDeleteClick
40
42
  }), children);
41
- });
43
+ };
42
44
  MessagebarAttachment.displayName = 'f7-messagebar-attachment';
43
45
  export default MessagebarAttachment;
@@ -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 MessagebarAttachments = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const MessagebarAttachments = 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, 'messagebar-attachments', 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
  MessagebarAttachments.displayName = 'f7-messagebar-attachments';
28
30
  export default MessagebarAttachments;
@@ -1,17 +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, 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 MessagebarSheetImage = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const MessagebarSheetImage = props => {
8
9
  const {
9
10
  className,
10
11
  id,
11
12
  style,
12
13
  children,
13
14
  image,
14
- checked
15
+ checked,
16
+ ref
15
17
  } = props;
16
18
  const extraAttrs = getExtraAttrs(props);
17
19
  const elRef = useRef(null);
@@ -19,9 +21,6 @@ const MessagebarSheetImage = /*#__PURE__*/forwardRef((props, ref) => {
19
21
  if (event.target.checked) emit(props, 'checked', event);else emit(props, 'unchecked', event);
20
22
  emit(props, 'change', event);
21
23
  };
22
- useImperativeHandle(ref, () => ({
23
- el: elRef.current
24
- }));
25
24
  const classes = classNames(className, 'messagebar-sheet-image', 'checkbox', colorClasses(props));
26
25
  const styles = {
27
26
  ...(style || {})
@@ -30,7 +29,10 @@ const MessagebarSheetImage = /*#__PURE__*/forwardRef((props, ref) => {
30
29
  id: id,
31
30
  className: classes,
32
31
  style: styles,
33
- ref: elRef
32
+ ref: el => {
33
+ elRef.current = el;
34
+ setRef(ref, el);
35
+ }
34
36
  }, extraAttrs), /*#__PURE__*/React.createElement("input", {
35
37
  type: "checkbox",
36
38
  checked: checked,
@@ -40,6 +42,6 @@ const MessagebarSheetImage = /*#__PURE__*/forwardRef((props, ref) => {
40
42
  }), image && /*#__PURE__*/React.createElement("img", {
41
43
  src: image
42
44
  }), children);
43
- });
45
+ };
44
46
  MessagebarSheetImage.displayName = 'f7-messagebar-sheet-image';
45
47
  export default MessagebarSheetImage;
@@ -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 MessagebarSheetItem = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const MessagebarSheetItem = 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, 'messagebar-sheet-item', 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
  MessagebarSheetItem.displayName = 'f7-messagebar-sheet-item';
28
30
  export default MessagebarSheetItem;
@@ -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 MessagebarSheet = /*#__PURE__*/forwardRef((props, ref) => {
8
+ const MessagebarSheet = 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, 'messagebar-sheet', 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
  MessagebarSheet.displayName = 'f7-messagebar-sheet';
28
30
  export default MessagebarSheet;