framework7-react 7.0.0-beta.15 → 7.0.0-beta.20

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.
@@ -48,9 +48,10 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
48
48
 
49
49
  const getSummValues = () => {
50
50
  const summValues = [];
51
- datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(({
52
- values
53
- }) => {
51
+ datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(_ref => {
52
+ let {
53
+ values
54
+ } = _ref;
54
55
  values.forEach((value, valueIndex) => {
55
56
  if (!summValues[valueIndex]) summValues[valueIndex] = 0;
56
57
  summValues[valueIndex] += value;
@@ -70,9 +71,10 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
70
71
  let maxValue = 0;
71
72
 
72
73
  if (lineChart) {
73
- datasets.forEach(({
74
- values
75
- }) => {
74
+ datasets.forEach(_ref2 => {
75
+ let {
76
+ values
77
+ } = _ref2;
76
78
  const datasetMaxValue = Math.max(...values);
77
79
  if (datasetMaxValue > maxValue) maxValue = datasetMaxValue;
78
80
  });
@@ -80,11 +82,12 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
80
82
  maxValue = Math.max(...getSummValues());
81
83
  }
82
84
 
83
- datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(({
84
- label,
85
- values,
86
- color
87
- }) => {
85
+ datasets.filter((dataset, index) => !hiddenDatasets.includes(index)).forEach(_ref3 => {
86
+ let {
87
+ label,
88
+ values,
89
+ color
90
+ } = _ref3;
88
91
  const points = values.map((originalValue, valueIndex) => {
89
92
  lastValues[valueIndex] += originalValue;
90
93
  const value = lineChart ? originalValue : lastValues[valueIndex];
@@ -183,11 +186,12 @@ const AreaChart = /*#__PURE__*/forwardRef((props, ref) => {
183
186
 
184
187
  const datasetsText = currentValues.length > 0 ? `
185
188
  <ul class="area-chart-tooltip-list">
186
- ${currentValues.map(({
187
- label,
188
- color,
189
- value
190
- }) => {
189
+ ${currentValues.map(_ref4 => {
190
+ let {
191
+ label,
192
+ color,
193
+ value
194
+ } = _ref4;
191
195
  const valueText = formatTooltipDataset ? formatTooltipDataset(label, value, color) : `${label}: ${value}`;
192
196
  return `
193
197
  <li><span style="background-color: ${color};"></span>${valueText}</li>
@@ -128,7 +128,11 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
128
128
  emit(props, 'inputClear', event);
129
129
  };
130
130
 
131
- const onInput = (...args) => {
131
+ const onInput = function () {
132
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
133
+ args[_key] = arguments[_key];
134
+ }
135
+
132
136
  emit(props, 'input', ...args);
133
137
 
134
138
  if (!(validateOnBlur || validateOnBlur === '') && (validate || validate === '') && inputElRef.current) {
@@ -136,12 +140,20 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
136
140
  }
137
141
  };
138
142
 
139
- const onFocus = (...args) => {
143
+ const onFocus = function () {
144
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
145
+ args[_key2] = arguments[_key2];
146
+ }
147
+
140
148
  emit(props, 'focus', ...args);
141
149
  setInputFocused(true);
142
150
  };
143
151
 
144
- const onBlur = (...args) => {
152
+ const onBlur = function () {
153
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
154
+ args[_key3] = arguments[_key3];
155
+ }
156
+
145
157
  emit(props, 'blur', ...args);
146
158
 
147
159
  if ((validate || validate === '' || validateOnBlur || validateOnBlur === '') && inputElRef.current) {
@@ -151,7 +163,11 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
151
163
  setInputFocused(false);
152
164
  };
153
165
 
154
- const onChange = (...args) => {
166
+ const onChange = function () {
167
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
168
+ args[_key4] = arguments[_key4];
169
+ }
170
+
155
171
  emit(props, 'change', ...args);
156
172
 
157
173
  if (type === 'texteditor') {
@@ -138,7 +138,11 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
138
138
  emit(props, 'inputClear', event);
139
139
  };
140
140
 
141
- const onInput = (...args) => {
141
+ const onInput = function () {
142
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
143
+ args[_key] = arguments[_key];
144
+ }
145
+
142
146
  emit(props, 'input', ...args);
143
147
 
144
148
  if (!(validateOnBlur || validateOnBlur === '') && (validate || validate === '') && inputElRef.current) {
@@ -146,12 +150,20 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
146
150
  }
147
151
  };
148
152
 
149
- const onFocus = (...args) => {
153
+ const onFocus = function () {
154
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
155
+ args[_key2] = arguments[_key2];
156
+ }
157
+
150
158
  emit(props, 'focus', ...args);
151
159
  setInputFocused(true);
152
160
  };
153
161
 
154
- const onBlur = (...args) => {
162
+ const onBlur = function () {
163
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
164
+ args[_key3] = arguments[_key3];
165
+ }
166
+
155
167
  emit(props, 'blur', ...args);
156
168
 
157
169
  if ((validate || validate === '' || validateOnBlur || validateOnBlur === '') && inputElRef.current) {
@@ -161,7 +173,11 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
161
173
  setInputFocused(false);
162
174
  };
163
175
 
164
- const onChange = (...args) => {
176
+ const onChange = function () {
177
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
178
+ args[_key4] = arguments[_key4];
179
+ }
180
+
165
181
  emit(props, 'change', ...args);
166
182
 
167
183
  if (type === 'texteditor') {
@@ -88,7 +88,11 @@ const Panel = /*#__PURE__*/forwardRef((props, ref) => {
88
88
  emit(props, 'panelCollapsedBreakpoint', event);
89
89
  };
90
90
 
91
- const onResize = (...args) => {
91
+ const onResize = function () {
92
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
93
+ args[_key] = arguments[_key];
94
+ }
95
+
92
96
  emit(props, 'panelResize', ...args);
93
97
  };
94
98
 
@@ -42,11 +42,12 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
42
42
  return [x, y];
43
43
  }
44
44
 
45
- datasets.forEach(({
46
- value,
47
- label,
48
- color
49
- }) => {
45
+ datasets.forEach(_ref => {
46
+ let {
47
+ value,
48
+ label,
49
+ color
50
+ } = _ref;
50
51
  const percentage = value / getSummValue();
51
52
  const [startX, startY] = getCoordinatesForPercentage(cumulativePercentage);
52
53
  cumulativePercentage += percentage;
@@ -42,11 +42,12 @@ const RoutableModals = /*#__PURE__*/forwardRef((props, ref) => {
42
42
  return /*#__PURE__*/React.createElement("div", {
43
43
  ref: elRef,
44
44
  className: "framework7-modals"
45
- }, modals.map(({
46
- component: ModalComponent,
47
- id: modalId,
48
- props: modalProps
49
- }) => {
45
+ }, modals.map(_ref => {
46
+ let {
47
+ component: ModalComponent,
48
+ id: modalId,
49
+ props: modalProps
50
+ } = _ref;
50
51
  return /*#__PURE__*/React.createElement(ModalComponent, _extends({
51
52
  key: modalId
52
53
  }, modalProps));
@@ -221,20 +221,23 @@ const View = /*#__PURE__*/forwardRef((props, ref) => {
221
221
  style: style,
222
222
  className: classes,
223
223
  ref: elRef
224
- }, extraAttrs), restChildren, pages.map(({
225
- component: PageComponent,
226
- id: pageId,
227
- props: pageProps,
228
- isAsync,
229
- initialComponent
230
- }) => /*#__PURE__*/React.createElement(RouterContext.Provider, {
231
- key: pageId,
232
- value: {
233
- router: pageProps.f7router,
234
- route: pageProps.f7route
235
- }
236
- }, initialComponent ? /*#__PURE__*/React.cloneElement(initialComponent, { ...pageProps
237
- }) : isAsync ? useAsyncComponent(PageComponent, pageProps) : /*#__PURE__*/React.createElement(PageComponent, pageProps))));
224
+ }, extraAttrs), restChildren, pages.map(_ref => {
225
+ let {
226
+ component: PageComponent,
227
+ id: pageId,
228
+ props: pageProps,
229
+ isAsync,
230
+ initialComponent
231
+ } = _ref;
232
+ return /*#__PURE__*/React.createElement(RouterContext.Provider, {
233
+ key: pageId,
234
+ value: {
235
+ router: pageProps.f7router,
236
+ route: pageProps.f7route
237
+ }
238
+ }, initialComponent ? /*#__PURE__*/React.cloneElement(initialComponent, { ...pageProps
239
+ }) : isAsync ? useAsyncComponent(PageComponent, pageProps) : /*#__PURE__*/React.createElement(PageComponent, pageProps));
240
+ }));
238
241
  });
239
242
  View.displayName = 'f7-view';
240
243
  export default View;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 React 7.0.0-beta.15
2
+ * Framework7 React 7.0.0-beta.20
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: April 11, 2022
10
+ * Released on: April 15, 2022
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": "7.0.0-beta.15",
3
+ "version": "7.0.0-beta.20",
4
4
  "description": "Build full featured iOS & Android apps using Framework7 & React",
5
5
  "type": "module",
6
6
  "exports": {
@@ -26,13 +26,14 @@ export default {
26
26
  return routerOpenIn(router, navigateUrl, options);
27
27
  },
28
28
 
29
- pageComponentLoader({
30
- routerEl,
31
- component,
32
- options,
33
- resolve,
34
- reject
35
- }) {
29
+ pageComponentLoader(_ref) {
30
+ let {
31
+ routerEl,
32
+ component,
33
+ options,
34
+ resolve,
35
+ reject
36
+ } = _ref;
36
37
  const router = this;
37
38
  const routerId = router.id;
38
39
  const el = routerEl;
@@ -117,13 +118,14 @@ export default {
117
118
  }
118
119
  },
119
120
 
120
- tabComponentLoader({
121
- tabEl,
122
- component,
123
- options,
124
- resolve,
125
- reject
126
- } = {}) {
121
+ tabComponentLoader(_temp) {
122
+ let {
123
+ tabEl,
124
+ component,
125
+ options,
126
+ resolve,
127
+ reject
128
+ } = _temp === void 0 ? {} : _temp;
127
129
  const router = this;
128
130
  if (!tabEl) reject();
129
131
  let tabRouter;
@@ -179,12 +181,13 @@ export default {
179
181
  tabRouter.setTabContent(null);
180
182
  },
181
183
 
182
- modalComponentLoader({
183
- component,
184
- options,
185
- resolve,
186
- reject
187
- } = {}) {
184
+ modalComponentLoader(_temp2) {
185
+ let {
186
+ component,
187
+ options,
188
+ resolve,
189
+ reject
190
+ } = _temp2 === void 0 ? {} : _temp2;
188
191
  const router = this;
189
192
  const modalsRouter = f7routers.modals;
190
193
 
package/shared/f7.js CHANGED
@@ -31,7 +31,15 @@ const f7initEvents = () => {
31
31
  f7events = new Framework7.Events();
32
32
  };
33
33
 
34
- const f7init = (rootEl, params = {}, init = true) => {
34
+ const f7init = function (rootEl, params, init) {
35
+ if (params === void 0) {
36
+ params = {};
37
+ }
38
+
39
+ if (init === void 0) {
40
+ init = true;
41
+ }
42
+
35
43
  const f7Params = extend({}, params, {
36
44
  el: rootEl,
37
45
  init
@@ -1,7 +1,8 @@
1
- export const modalStateClasses = ({
2
- isOpened,
3
- isClosing
4
- } = {}) => {
1
+ export const modalStateClasses = function (_temp) {
2
+ let {
3
+ isOpened,
4
+ isClosing
5
+ } = _temp === void 0 ? {} : _temp;
5
6
  return {
6
7
  'modal-in': isOpened.current && !isClosing.current,
7
8
  'modal-out': isClosing.current
package/shared/plugin.js CHANGED
@@ -5,7 +5,11 @@ const Framework7React = {
5
5
  name: 'reactPlugin',
6
6
  installed: false,
7
7
 
8
- install(params = {}) {
8
+ install(params) {
9
+ if (params === void 0) {
10
+ params = {};
11
+ }
12
+
9
13
  if (Framework7React.installed) return;
10
14
  Framework7React.installed = true;
11
15
  f7initEvents();
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  import Icon from '../components/icon.js';
3
3
  import Badge from '../components/badge.js';
4
- export const useIcon = (props = {}) => {
4
+ export const useIcon = function (props) {
5
+ if (props === void 0) {
6
+ props = {};
7
+ }
8
+
5
9
  const {
6
10
  icon,
7
11
  iconMaterial,
@@ -1,7 +1,8 @@
1
1
  import { useEffect } from 'react';
2
- export const useRouteProps = (elRef, {
3
- routeProps
4
- } = {}) => {
2
+ export const useRouteProps = function (elRef, _temp) {
3
+ let {
4
+ routeProps
5
+ } = _temp === void 0 ? {} : _temp;
5
6
  useEffect(() => {
6
7
  if (elRef.current) {
7
8
  elRef.current.f7RouteProps = routeProps;
@@ -1,15 +1,15 @@
1
1
  import { useState, useEffect, useRef } from 'react';
2
2
  import { f7 } from './f7.js';
3
- export const useStore = (...args) => {
3
+ export const useStore = function () {
4
4
  const assignedGetters = useRef({}); // (store, getter)
5
5
 
6
- let store = args[0];
7
- let getter = args[1];
6
+ let store = arguments.length <= 0 ? undefined : arguments[0];
7
+ let getter = arguments.length <= 1 ? undefined : arguments[1];
8
8
 
9
- if (args.length === 1) {
9
+ if (arguments.length === 1) {
10
10
  // (getter)
11
11
  store = f7.store;
12
- getter = args[0];
12
+ getter = arguments.length <= 0 ? undefined : arguments[0];
13
13
  } // eslint-disable-next-line
14
14
 
15
15
 
package/shared/utils.js CHANGED
@@ -14,11 +14,15 @@ export function isObject(o) {
14
14
  export function now() {
15
15
  return Date.now();
16
16
  }
17
- export function extend(...args) {
17
+ export function extend() {
18
18
  let deep = true;
19
19
  let to;
20
20
  let from;
21
21
 
22
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23
+ args[_key] = arguments[_key];
24
+ }
25
+
22
26
  if (typeof args[0] === 'boolean') {
23
27
  [deep, to] = args;
24
28
  args.splice(0, 2);
@@ -57,15 +61,25 @@ export function extend(...args) {
57
61
 
58
62
  return to;
59
63
  }
60
- export function flattenArray(...args) {
64
+ export function flattenArray() {
61
65
  const arr = [];
66
+
67
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
68
+ args[_key2] = arguments[_key2];
69
+ }
70
+
62
71
  args.forEach(arg => {
63
72
  if (Array.isArray(arg)) arr.push(...flattenArray(...arg));else arr.push(arg);
64
73
  });
65
74
  return arr;
66
75
  }
67
- export function classNames(...args) {
76
+ export function classNames() {
68
77
  const classes = [];
78
+
79
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
80
+ args[_key3] = arguments[_key3];
81
+ }
82
+
69
83
  args.forEach(arg => {
70
84
  if (typeof arg === 'object' && arg.constructor === Object) {
71
85
  Object.keys(arg).forEach(key => {
@@ -79,7 +93,11 @@ export function classNames(...args) {
79
93
  });
80
94
  return uniqueClasses.join(' ');
81
95
  }
82
- export function getSlots(props = {}) {
96
+ export function getSlots(props) {
97
+ if (props === void 0) {
98
+ props = {};
99
+ }
100
+
83
101
  const slots = {};
84
102
  if (!props) return slots;
85
103
  const children = props.children;
@@ -107,7 +125,11 @@ export function getSlots(props = {}) {
107
125
 
108
126
  return slots;
109
127
  }
110
- export function emit(props, events, ...args) {
128
+ export function emit(props, events) {
129
+ for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {
130
+ args[_key4 - 2] = arguments[_key4];
131
+ }
132
+
111
133
  if (!events || !events.trim().length || typeof events !== 'string') return;
112
134
  events.trim().split(' ').forEach(event => {
113
135
  let eventName = (event || '').trim();
@@ -117,7 +139,11 @@ export function emit(props, events, ...args) {
117
139
  if (props[propName]) props[propName](...args);
118
140
  });
119
141
  }
120
- export function getExtraAttrs(props = {}) {
142
+ export function getExtraAttrs(props) {
143
+ if (props === void 0) {
144
+ props = {};
145
+ }
146
+
121
147
  const extraAttrs = {};
122
148
  Object.keys(props).forEach(key => {
123
149
  if (key.indexOf('data-') === 0 || key.indexOf('aria-') === 0 || key === 'role') {