framework7-react 8.0.0-beta.3 → 8.0.0-beta.5

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.
@@ -7,7 +7,7 @@ export interface ActionsLabelProps {
7
7
  id?: string | number;
8
8
  className?: string;
9
9
  style?: React.CSSProperties;
10
- bold?: boolean;
10
+ strong?: boolean;
11
11
  onClick?: (event?: any) => void;
12
12
  ref?: React.MutableRefObject<{el: HTMLElement | null}>;
13
13
  children?: React.ReactNode;
@@ -12,7 +12,7 @@ export interface PopoverProps {
12
12
  opened ?: boolean;
13
13
  animate ?: boolean;
14
14
  targetEl ?: string | object;
15
- angle ?: boolean;
15
+ arrow ?: boolean;
16
16
  backdrop ?: boolean;
17
17
  backdropEl ?: string | object;
18
18
  closeByBackdropClick ?: boolean;
@@ -19,7 +19,7 @@ const Popover = /*#__PURE__*/forwardRef((props, ref) => {
19
19
  opened,
20
20
  animate,
21
21
  targetEl,
22
- angle,
22
+ arrow,
23
23
  backdrop,
24
24
  backdropEl,
25
25
  closeByBackdropClick,
@@ -77,7 +77,7 @@ const Popover = /*#__PURE__*/forwardRef((props, ref) => {
77
77
  if ('closeByBackdropClick' in props) popoverParams.closeByBackdropClick = closeByBackdropClick;
78
78
  if ('closeByOutsideClick' in props) popoverParams.closeByOutsideClick = closeByOutsideClick;
79
79
  if ('closeOnEscape' in props) popoverParams.closeOnEscape = closeOnEscape;
80
- if ('angle' in props) popoverParams.angle = angle;
80
+ if ('arrow' in props) popoverParams.arrow = arrow;
81
81
  if ('backdrop' in props) popoverParams.backdrop = backdrop;
82
82
  if ('backdropEl' in props) popoverParams.backdropEl = backdropEl;
83
83
  if ('animate' in props) popoverParams.animate = animate;
@@ -117,7 +117,7 @@ const Popover = /*#__PURE__*/forwardRef((props, ref) => {
117
117
  className: classes,
118
118
  ref: elRef
119
119
  }, extraAttrs), /*#__PURE__*/React.createElement("div", {
120
- className: "popover-angle"
120
+ className: "popover-arrow"
121
121
  }), /*#__PURE__*/React.createElement("div", {
122
122
  className: "popover-inner"
123
123
  }, children));
@@ -33,7 +33,7 @@ export interface SearchbarProps {
33
33
  ignore ?: string;
34
34
  customSearch ?: boolean;
35
35
  removeDiacritics ?: boolean;
36
- hideDividers ?: boolean;
36
+ hideGroupTitles ?: boolean;
37
37
  hideGroups ?: boolean;
38
38
  init ?: boolean;
39
39
  color?: string;
@@ -40,7 +40,7 @@ const Searchbar = /*#__PURE__*/forwardRef((props, ref) => {
40
40
  ignore = '.searchbar-ignore',
41
41
  customSearch = false,
42
42
  removeDiacritics = false,
43
- hideDividers = true,
43
+ hideGroupTitles = true,
44
44
  hideGroups = true,
45
45
  init = true
46
46
  } = props;
@@ -117,7 +117,7 @@ const Searchbar = /*#__PURE__*/forwardRef((props, ref) => {
117
117
  ignore,
118
118
  customSearch,
119
119
  removeDiacritics,
120
- hideDividers,
120
+ hideGroupTitles,
121
121
  hideGroups,
122
122
  expandable,
123
123
  inline,
package/components/tab.js CHANGED
@@ -7,6 +7,7 @@ import { f7ready, f7routers, f7, f7events } from '../shared/f7.js';
7
7
  import { useTab } from '../shared/use-tab.js';
8
8
  import { RouterContext } from '../shared/router-context.js';
9
9
  import { useAsyncComponent } from '../shared/use-async-component.js';
10
+ import { TabsSwipeableContext } from '../shared/tabs-swipeable-context.js';
10
11
 
11
12
 
12
13
  const Tab = /*#__PURE__*/forwardRef((props, ref) => {
@@ -21,6 +22,7 @@ const Tab = /*#__PURE__*/forwardRef((props, ref) => {
21
22
  const elRef = useRef(null);
22
23
  const routerData = useRef(null);
23
24
  const routerContext = useContext(RouterContext);
25
+ const tabsSwipeableContext = useContext(TabsSwipeableContext);
24
26
  let initialTabContent = null;
25
27
  if (!routerData.current && routerContext && routerContext.route && routerContext.route.route && routerContext.route.route.tab && routerContext.route.route.tab.id === id) {
26
28
  const {
@@ -97,12 +99,17 @@ const Tab = /*#__PURE__*/forwardRef((props, ref) => {
97
99
  key: tabContent.id
98
100
  }, tabContent.props));
99
101
  };
100
- return /*#__PURE__*/React.createElement("div", _extends({
102
+ const Component = tabsSwipeableContext ? 'swiper-slide' : 'div';
103
+ const classAttrs = tabsSwipeableContext ? {
104
+ class: classes
105
+ } : {
106
+ className: classes
107
+ };
108
+ return /*#__PURE__*/React.createElement(Component, _extends({
101
109
  id: id,
102
110
  style: style,
103
- className: classes,
104
111
  ref: elRef
105
- }, extraAttrs), renderChildren());
112
+ }, extraAttrs, classAttrs), renderChildren());
106
113
  });
107
114
  Tab.displayName = 'f7-tab';
108
115
  export default Tab;
@@ -3,6 +3,7 @@ import React, { forwardRef, useRef, useImperativeHandle } 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
+ import { TabsSwipeableContext } from '../shared/tabs-swipeable-context.js';
6
7
 
7
8
 
8
9
  const Tabs = /*#__PURE__*/forwardRef((props, ref) => {
@@ -24,27 +25,35 @@ const Tabs = /*#__PURE__*/forwardRef((props, ref) => {
24
25
  useIsomorphicLayoutEffect(() => {
25
26
  if (!swipeable || !swiperParams) return;
26
27
  if (!elRef.current) return;
27
- elRef.current.f7SwiperParams = swiperParams;
28
+ Object.assign(elRef.current, swiperParams);
29
+ elRef.current.initialize();
28
30
  }, []);
29
31
  const classes = classNames(className, colorClasses(props));
30
- const wrapClasses = classNames({
31
- 'tabs-animated-wrap': animated,
32
- 'tabs-swipeable-wrap': swipeable
33
- });
34
32
  const tabsClasses = classNames({
35
33
  tabs: true,
36
34
  'tabs-routable': routable
37
35
  });
38
- if (animated || swipeable) {
36
+ if (animated) {
39
37
  return /*#__PURE__*/React.createElement("div", _extends({
40
38
  id: id,
41
39
  style: style,
42
- className: classNames(wrapClasses, classes),
40
+ className: classNames('tabs-animated-wrap', classes),
43
41
  ref: elRef
44
42
  }, extraAttrs), /*#__PURE__*/React.createElement("div", {
45
43
  className: tabsClasses
46
44
  }, children));
47
45
  }
46
+ if (swipeable) {
47
+ return /*#__PURE__*/React.createElement("swiper-container", _extends({
48
+ id: id,
49
+ style: style,
50
+ class: classNames(tabsClasses, classes),
51
+ ref: elRef,
52
+ init: swiperParams ? 'false' : 'true'
53
+ }, extraAttrs), /*#__PURE__*/React.createElement(TabsSwipeableContext.Provider, {
54
+ value: true
55
+ }, children));
56
+ }
48
57
  return /*#__PURE__*/React.createElement("div", _extends({
49
58
  id: id,
50
59
  style: style,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 React 8.0.0-beta.3
2
+ * Framework7 React 8.0.0-beta.5
3
3
  * Build full featured iOS & Android apps using Framework7 & React
4
4
  * https://framework7.io/react/
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: March 9, 2023
10
+ * Released on: March 23, 2023
11
11
  */
12
12
  import Framework7React from './shared/plugin.js';
13
13
  import { f7, f7ready, theme } from './shared/f7.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework7-react",
3
- "version": "8.0.0-beta.3",
3
+ "version": "8.0.0-beta.5",
4
4
  "description": "Build full featured iOS & Android apps using Framework7 & React",
5
5
  "type": "module",
6
6
  "exports": {
@@ -47,5 +47,5 @@
47
47
  "type": "patreon",
48
48
  "url": "https://www.patreon.com/framework7"
49
49
  },
50
- "releaseDate": "March 9, 2023"
50
+ "releaseDate": "March 23, 2023"
51
51
  }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ const TabsSwipeableContext = /*#__PURE__*/React.createContext(false);
3
+ export { TabsSwipeableContext };