framework7-react 7.0.0-beta.8 → 7.0.2
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.
- package/components/actions.d.ts +1 -1
- package/components/area-chart.js +20 -16
- package/components/breadcrumbs-collapsed.d.ts +16 -0
- package/components/breadcrumbs-collapsed.js +32 -0
- package/components/breadcrumbs-item.d.ts +17 -0
- package/components/breadcrumbs-item.js +33 -0
- package/components/breadcrumbs-separator.d.ts +15 -0
- package/components/breadcrumbs-separator.js +25 -0
- package/components/breadcrumbs.d.ts +15 -0
- package/components/breadcrumbs.js +26 -0
- package/components/input.js +20 -4
- package/components/list-input.js +20 -4
- package/components/list.d.ts +1 -0
- package/components/list.js +7 -0
- package/components/panel.js +5 -1
- package/components/pie-chart.js +6 -5
- package/components/range.d.ts +1 -1
- package/components/routable-modals.js +6 -5
- package/components/toggle.js +12 -1
- package/components/view.d.ts +1 -0
- package/components/view.js +20 -15
- package/framework7-react.d.ts +5 -1
- package/framework7-react.js +8 -4
- package/package.json +2 -1
- package/shared/components-router.js +23 -20
- package/shared/f7.js +9 -1
- package/shared/modal-state-classes.js +5 -4
- package/shared/plugin.js +5 -1
- package/shared/use-icon.js +5 -1
- package/shared/use-route-props.js +4 -3
- package/shared/use-store.js +5 -5
- package/shared/utils.js +32 -6
package/components/actions.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ interface ActionsProps {
|
|
|
25
25
|
onActionsClose ?: (instance?: Actions.Actions) => void;
|
|
26
26
|
onActionsClosed ?: (instance?: Actions.Actions) => void;
|
|
27
27
|
containerEl ?: string | object;
|
|
28
|
-
ref?: React.MutableRefObject<{el: HTMLElement | null; f7Actions: () => Actions}>;
|
|
28
|
+
ref?: React.MutableRefObject<{el: HTMLElement | null; f7Actions: () => Actions.Actions}>;
|
|
29
29
|
color?: string;
|
|
30
30
|
colorTheme?: string;
|
|
31
31
|
textColor?: string;
|
package/components/area-chart.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
interface BreadcrumbsCollapsedProps {
|
|
6
|
+
slot?: string;
|
|
7
|
+
id?: string | number;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
onClick ?: (event?: any) => void;
|
|
11
|
+
ref?: React.MutableRefObject<{el: HTMLElement | null}>;
|
|
12
|
+
}
|
|
13
|
+
declare const BreadcrumbsCollapsed: React.FunctionComponent<BreadcrumbsCollapsedProps>;
|
|
14
|
+
|
|
15
|
+
export default BreadcrumbsCollapsed;
|
|
16
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
3
|
+
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
5
|
+
|
|
6
|
+
const BreadcrumbsCollapsed = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
className,
|
|
9
|
+
id,
|
|
10
|
+
style,
|
|
11
|
+
children
|
|
12
|
+
} = props;
|
|
13
|
+
const extraAttrs = getExtraAttrs(props);
|
|
14
|
+
const elRef = useRef(null);
|
|
15
|
+
useImperativeHandle(ref, () => ({
|
|
16
|
+
el: elRef.current
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const onClick = e => {
|
|
20
|
+
emit(props, 'click', e);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
24
|
+
className: classNames('breadcrumbs-collapsed', className),
|
|
25
|
+
ref: elRef,
|
|
26
|
+
id: id,
|
|
27
|
+
style: style,
|
|
28
|
+
onClick: onClick
|
|
29
|
+
}, extraAttrs), /*#__PURE__*/React.createElement("span", null), children);
|
|
30
|
+
});
|
|
31
|
+
BreadcrumbsCollapsed.displayName = 'f7-breadcrumbs-collapsed';
|
|
32
|
+
export default BreadcrumbsCollapsed;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
interface BreadcrumbsItemProps {
|
|
6
|
+
slot?: string;
|
|
7
|
+
id?: string | number;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
onClick ?: (event?: any) => void;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
ref?: React.MutableRefObject<{el: HTMLElement | null}>;
|
|
13
|
+
}
|
|
14
|
+
declare const BreadcrumbsItem: React.FunctionComponent<BreadcrumbsItemProps>;
|
|
15
|
+
|
|
16
|
+
export default BreadcrumbsItem;
|
|
17
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
3
|
+
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
5
|
+
|
|
6
|
+
const BreadcrumbsItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
className,
|
|
9
|
+
id,
|
|
10
|
+
style,
|
|
11
|
+
active,
|
|
12
|
+
children
|
|
13
|
+
} = props;
|
|
14
|
+
const extraAttrs = getExtraAttrs(props);
|
|
15
|
+
const elRef = useRef(null);
|
|
16
|
+
useImperativeHandle(ref, () => ({
|
|
17
|
+
el: elRef.current
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
const onClick = e => {
|
|
21
|
+
emit(props, 'click', e);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
25
|
+
className: classNames('breadcrumbs-item', className, active && 'breadcrumbs-item-active'),
|
|
26
|
+
ref: elRef,
|
|
27
|
+
id: id,
|
|
28
|
+
style: style,
|
|
29
|
+
onClick: onClick
|
|
30
|
+
}, extraAttrs), children);
|
|
31
|
+
});
|
|
32
|
+
BreadcrumbsItem.displayName = 'f7-breadcrumbs-item';
|
|
33
|
+
export default BreadcrumbsItem;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
interface BreadcrumbsSeparatorProps {
|
|
6
|
+
slot?: string;
|
|
7
|
+
id?: string | number;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
ref?: React.MutableRefObject<{el: HTMLElement | null}>;
|
|
11
|
+
}
|
|
12
|
+
declare const BreadcrumbsSeparator: React.FunctionComponent<BreadcrumbsSeparatorProps>;
|
|
13
|
+
|
|
14
|
+
export default BreadcrumbsSeparator;
|
|
15
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
3
|
+
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
|
+
|
|
6
|
+
const BreadcrumbsSeparator = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
className,
|
|
9
|
+
id,
|
|
10
|
+
style
|
|
11
|
+
} = props;
|
|
12
|
+
const extraAttrs = getExtraAttrs(props);
|
|
13
|
+
const elRef = useRef(null);
|
|
14
|
+
useImperativeHandle(ref, () => ({
|
|
15
|
+
el: elRef.current
|
|
16
|
+
}));
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
18
|
+
className: classNames('breadcrumbs-separator', className),
|
|
19
|
+
ref: elRef,
|
|
20
|
+
id: id,
|
|
21
|
+
style: style
|
|
22
|
+
}, extraAttrs));
|
|
23
|
+
});
|
|
24
|
+
BreadcrumbsSeparator.displayName = 'f7-breadcrumbs-separator';
|
|
25
|
+
export default BreadcrumbsSeparator;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
interface BreadcrumbsProps {
|
|
6
|
+
slot?: string;
|
|
7
|
+
id?: string | number;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
ref?: React.MutableRefObject<{el: HTMLElement | null}>;
|
|
11
|
+
}
|
|
12
|
+
declare const Breadcrumbs: React.FunctionComponent<BreadcrumbsProps>;
|
|
13
|
+
|
|
14
|
+
export default Breadcrumbs;
|
|
15
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
3
|
+
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
|
+
|
|
6
|
+
const Breadcrumbs = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
className,
|
|
9
|
+
id,
|
|
10
|
+
style,
|
|
11
|
+
children
|
|
12
|
+
} = props;
|
|
13
|
+
const extraAttrs = getExtraAttrs(props);
|
|
14
|
+
const elRef = useRef(null);
|
|
15
|
+
useImperativeHandle(ref, () => ({
|
|
16
|
+
el: elRef.current
|
|
17
|
+
}));
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
19
|
+
className: classNames('breadcrumbs', className),
|
|
20
|
+
ref: elRef,
|
|
21
|
+
id: id,
|
|
22
|
+
style: style
|
|
23
|
+
}, extraAttrs), children);
|
|
24
|
+
});
|
|
25
|
+
Breadcrumbs.displayName = 'f7-breadcrumbs';
|
|
26
|
+
export default Breadcrumbs;
|
package/components/input.js
CHANGED
|
@@ -128,7 +128,11 @@ const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
128
128
|
emit(props, 'inputClear', event);
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
const onInput = (
|
|
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 = (
|
|
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 = (
|
|
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 = (
|
|
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') {
|
package/components/list-input.js
CHANGED
|
@@ -138,7 +138,11 @@ const ListInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
138
138
|
emit(props, 'inputClear', event);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
const onInput = (
|
|
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 = (
|
|
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 = (
|
|
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 = (
|
|
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') {
|
package/components/list.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ interface ListProps {
|
|
|
59
59
|
onSortableEnable ?: (...args: any[]) => void;
|
|
60
60
|
onSortableDisable ?: (...args: any[]) => void;
|
|
61
61
|
onSortableSort ?: (sortData?: any) => void;
|
|
62
|
+
onSortableMove ?: (itemEl?: any) => void;
|
|
62
63
|
onTabShow ?: (el?: HTMLElement) => void;
|
|
63
64
|
onTabHide ?: (el?: HTMLElement) => void;
|
|
64
65
|
ref?: React.MutableRefObject<{el: HTMLElement | null; f7VirtualList: () => VirtualList.VirtualList}>;
|
package/components/list.js
CHANGED
|
@@ -73,6 +73,11 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
73
73
|
emit(props, 'sortableSort', sortData);
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
const onSortableMove = (el, listEl) => {
|
|
77
|
+
if (elRef.current !== listEl) return;
|
|
78
|
+
emit(props, 'sortableMove', el, listEl);
|
|
79
|
+
};
|
|
80
|
+
|
|
76
81
|
useImperativeHandle(ref, () => ({
|
|
77
82
|
el: elRef.current,
|
|
78
83
|
f7VirtualList: () => f7VirtualList.current
|
|
@@ -84,6 +89,7 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
84
89
|
f7.on('sortableEnable', onSortableEnable);
|
|
85
90
|
f7.on('sortableDisable', onSortableDisable);
|
|
86
91
|
f7.on('sortableSort', onSortableSort);
|
|
92
|
+
f7.on('sortableMove', onSortableMove);
|
|
87
93
|
});
|
|
88
94
|
};
|
|
89
95
|
|
|
@@ -92,6 +98,7 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
92
98
|
f7.off('sortableEnable', onSortableEnable);
|
|
93
99
|
f7.off('sortableDisable', onSortableDisable);
|
|
94
100
|
f7.off('sortableSort', onSortableSort);
|
|
101
|
+
f7.off('sortableMove', onSortableMove);
|
|
95
102
|
};
|
|
96
103
|
|
|
97
104
|
const onMount = () => {
|
package/components/panel.js
CHANGED
|
@@ -88,7 +88,11 @@ const Panel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
88
88
|
emit(props, 'panelCollapsedBreakpoint', event);
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
const onResize = (
|
|
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
|
|
package/components/pie-chart.js
CHANGED
|
@@ -42,11 +42,12 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
42
42
|
return [x, y];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
datasets.forEach(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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;
|
package/components/range.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ interface RangeProps {
|
|
|
38
38
|
themeDark?: boolean;
|
|
39
39
|
onRangeChange ?: (val?: any) => void;
|
|
40
40
|
onRangeChanged ?: (val?: any) => void;
|
|
41
|
-
ref?: React.MutableRefObject<{el: HTMLElement | null; f7Range: () => Range.
|
|
41
|
+
ref?: React.MutableRefObject<{el: HTMLElement | null; f7Range: () => Range.Range}>;
|
|
42
42
|
}
|
|
43
43
|
declare const Range: React.FunctionComponent<RangeProps>;
|
|
44
44
|
|
|
@@ -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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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));
|
package/components/toggle.js
CHANGED
|
@@ -25,6 +25,7 @@ const Toggle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25
25
|
} = props;
|
|
26
26
|
const extraAttrs = getExtraAttrs(props);
|
|
27
27
|
const elRef = useRef(null);
|
|
28
|
+
const inputElRef = useRef(null);
|
|
28
29
|
|
|
29
30
|
const onChange = event => {
|
|
30
31
|
emit(props, 'change', event);
|
|
@@ -69,8 +70,17 @@ const Toggle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
69
70
|
|
|
70
71
|
useIsomorphicLayoutEffect(() => {
|
|
71
72
|
toggleEvents('on');
|
|
73
|
+
|
|
74
|
+
if (inputElRef.current) {
|
|
75
|
+
inputElRef.current.addEventListener('change', onChange);
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
return () => {
|
|
73
79
|
toggleEvents('off');
|
|
80
|
+
|
|
81
|
+
if (inputElRef.current) {
|
|
82
|
+
inputElRef.current.removeEventListener('change', onChange);
|
|
83
|
+
}
|
|
74
84
|
};
|
|
75
85
|
});
|
|
76
86
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -81,6 +91,7 @@ const Toggle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
81
91
|
disabled
|
|
82
92
|
}, colorClasses(props));
|
|
83
93
|
const inputEl = /*#__PURE__*/React.createElement("input", {
|
|
94
|
+
ref: inputElRef,
|
|
84
95
|
type: "checkbox",
|
|
85
96
|
name: name,
|
|
86
97
|
disabled: disabled,
|
|
@@ -88,7 +99,7 @@ const Toggle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
88
99
|
checked: checked,
|
|
89
100
|
defaultChecked: defaultChecked,
|
|
90
101
|
value: value,
|
|
91
|
-
onChange:
|
|
102
|
+
onChange: () => {}
|
|
92
103
|
});
|
|
93
104
|
return /*#__PURE__*/React.createElement("label", _extends({
|
|
94
105
|
id: id,
|
package/components/view.d.ts
CHANGED
package/components/view.js
CHANGED
|
@@ -23,11 +23,13 @@ const View = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
23
23
|
tab,
|
|
24
24
|
tabActive,
|
|
25
25
|
url,
|
|
26
|
+
initRouterOnTabShow,
|
|
26
27
|
browserHistoryInitialMatch = true
|
|
27
28
|
} = props;
|
|
28
29
|
const childrenArray = React.Children.toArray(children);
|
|
29
30
|
const initialPageComponent = childrenArray.filter(c => c.props && c.props.initialPage)[0];
|
|
30
31
|
const restChildren = childrenArray.filter(c => !c.props || !c.props.initialPage);
|
|
32
|
+
const shouldInitRouter = !(initRouterOnTabShow && tab && !tabActive);
|
|
31
33
|
const extraAttrs = getExtraAttrs(props);
|
|
32
34
|
const f7View = useRef(null);
|
|
33
35
|
const elRef = useRef(null);
|
|
@@ -61,7 +63,7 @@ const View = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
61
63
|
};
|
|
62
64
|
f7routers.views.push(routerData.current);
|
|
63
65
|
|
|
64
|
-
if (f7View.current && f7View.current.router && (url || main)) {
|
|
66
|
+
if (shouldInitRouter && f7View.current && f7View.current.router && (url || main)) {
|
|
65
67
|
const initialData = getRouterInitialComponent(f7View.current.router, initialPageComponent);
|
|
66
68
|
initialPage = initialData.initialPage;
|
|
67
69
|
initialRoute = initialData.initialRoute;
|
|
@@ -219,20 +221,23 @@ const View = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
219
221
|
style: style,
|
|
220
222
|
className: classes,
|
|
221
223
|
ref: elRef
|
|
222
|
-
}, extraAttrs), restChildren, pages.map(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
+
}));
|
|
236
241
|
});
|
|
237
242
|
View.displayName = 'f7-view';
|
|
238
243
|
export default View;
|
package/framework7-react.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ import BlockFooter from './components/block-footer';
|
|
|
17
17
|
import BlockHeader from './components/block-header';
|
|
18
18
|
import BlockTitle from './components/block-title';
|
|
19
19
|
import Block from './components/block';
|
|
20
|
+
import BreadcrumbsCollapsed from './components/breadcrumbs-collapsed';
|
|
21
|
+
import BreadcrumbsItem from './components/breadcrumbs-item';
|
|
22
|
+
import BreadcrumbsSeparator from './components/breadcrumbs-separator';
|
|
23
|
+
import Breadcrumbs from './components/breadcrumbs';
|
|
20
24
|
import Button from './components/button';
|
|
21
25
|
import CardContent from './components/card-content';
|
|
22
26
|
import CardFooter from './components/card-footer';
|
|
@@ -122,6 +126,6 @@ declare const useStore: useStore;
|
|
|
122
126
|
|
|
123
127
|
declare const Framework7React: Framework7Plugin;
|
|
124
128
|
|
|
125
|
-
export { AccordionContent, AccordionItem, AccordionToggle, Accordion, ActionsButton, ActionsGroup, ActionsLabel, Actions, App, Appbar, AreaChart, Badge, BlockFooter, BlockHeader, BlockTitle, Block, Button, CardContent, CardFooter, CardHeader, Card, Checkbox, Chip, Col, FabBackdrop, FabButton, FabButtons, Fab, Gauge, Icon, Input, Link, ListButton, ListGroup, ListIndex, ListInput, ListItemCell, ListItemContent, ListItemRow, ListItem, List, LoginScreenTitle, LoginScreen, MenuDropdownItem, MenuDropdown, MenuItem, Menu, Message, MessagebarAttachment, MessagebarAttachments, MessagebarSheetImage, MessagebarSheetItem, MessagebarSheet, Messagebar, MessagesTitle, Messages, NavLeft, NavRight, NavTitleLarge, NavTitle, Navbar, PageContent, Page, Panel, PhotoBrowser, PieChart, Popover, Popup, Preloader, Progressbar, Radio, Range, RoutableModals, Row, Searchbar, Segmented, Sheet, SkeletonAvatar, SkeletonBlock, SkeletonImage, SkeletonText, Stepper, Subnavbar, SwipeoutActions, SwipeoutButton, SwiperSlide, Swiper, Tab, Tabs, TextEditor, Toggle, Toolbar, TreeviewItem, Treeview, View, Views }
|
|
129
|
+
export { AccordionContent, AccordionItem, AccordionToggle, Accordion, ActionsButton, ActionsGroup, ActionsLabel, Actions, App, Appbar, AreaChart, Badge, BlockFooter, BlockHeader, BlockTitle, Block, BreadcrumbsCollapsed, BreadcrumbsItem, BreadcrumbsSeparator, Breadcrumbs, Button, CardContent, CardFooter, CardHeader, Card, Checkbox, Chip, Col, FabBackdrop, FabButton, FabButtons, Fab, Gauge, Icon, Input, Link, ListButton, ListGroup, ListIndex, ListInput, ListItemCell, ListItemContent, ListItemRow, ListItem, List, LoginScreenTitle, LoginScreen, MenuDropdownItem, MenuDropdown, MenuItem, Menu, Message, MessagebarAttachment, MessagebarAttachments, MessagebarSheetImage, MessagebarSheetItem, MessagebarSheet, Messagebar, MessagesTitle, Messages, NavLeft, NavRight, NavTitleLarge, NavTitle, Navbar, PageContent, Page, Panel, PhotoBrowser, PieChart, Popover, Popup, Preloader, Progressbar, Radio, Range, RoutableModals, Row, Searchbar, Segmented, Sheet, SkeletonAvatar, SkeletonBlock, SkeletonImage, SkeletonText, Stepper, Subnavbar, SwipeoutActions, SwipeoutButton, SwiperSlide, Swiper, Tab, Tabs, TextEditor, Toggle, Toolbar, TreeviewItem, Treeview, View, Views }
|
|
126
130
|
export { f7, f7ready, theme, useStore };
|
|
127
131
|
export default Framework7React;
|
package/framework7-react.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Framework7 React 7.0.
|
|
2
|
+
* Framework7 React 7.0.2
|
|
3
3
|
* Build full featured iOS & Android apps using Framework7 & React
|
|
4
4
|
* https://framework7.io/react/
|
|
5
5
|
*
|
|
6
|
-
* Copyright 2014-
|
|
6
|
+
* Copyright 2014-2022 Vladimir Kharlampidi
|
|
7
7
|
*
|
|
8
8
|
* Released under the MIT License
|
|
9
9
|
*
|
|
10
|
-
* Released on:
|
|
10
|
+
* Released on: April 24, 2022
|
|
11
11
|
*/
|
|
12
12
|
import Framework7React from './shared/plugin.js';
|
|
13
13
|
import { f7, f7ready, theme } from './shared/f7.js';
|
|
@@ -29,6 +29,10 @@ import BlockFooter from './components/block-footer.js';
|
|
|
29
29
|
import BlockHeader from './components/block-header.js';
|
|
30
30
|
import BlockTitle from './components/block-title.js';
|
|
31
31
|
import Block from './components/block.js';
|
|
32
|
+
import BreadcrumbsCollapsed from './components/breadcrumbs-collapsed.js';
|
|
33
|
+
import BreadcrumbsItem from './components/breadcrumbs-item.js';
|
|
34
|
+
import BreadcrumbsSeparator from './components/breadcrumbs-separator.js';
|
|
35
|
+
import Breadcrumbs from './components/breadcrumbs.js';
|
|
32
36
|
import Button from './components/button.js';
|
|
33
37
|
import CardContent from './components/card-content.js';
|
|
34
38
|
import CardFooter from './components/card-footer.js';
|
|
@@ -110,6 +114,6 @@ import Treeview from './components/treeview.js';
|
|
|
110
114
|
import View from './components/view.js';
|
|
111
115
|
import Views from './components/views.js';
|
|
112
116
|
|
|
113
|
-
export { AccordionContent, AccordionItem, AccordionToggle, Accordion, ActionsButton, ActionsGroup, ActionsLabel, Actions, App, Appbar, AreaChart, Badge, BlockFooter, BlockHeader, BlockTitle, Block, Button, CardContent, CardFooter, CardHeader, Card, Checkbox, Chip, Col, FabBackdrop, FabButton, FabButtons, Fab, Gauge, Icon, Input, Link, ListButton, ListGroup, ListIndex, ListInput, ListItemCell, ListItemContent, ListItemRow, ListItem, List, LoginScreenTitle, LoginScreen, MenuDropdownItem, MenuDropdown, MenuItem, Menu, Message, MessagebarAttachment, MessagebarAttachments, MessagebarSheetImage, MessagebarSheetItem, MessagebarSheet, Messagebar, MessagesTitle, Messages, NavLeft, NavRight, NavTitleLarge, NavTitle, Navbar, PageContent, Page, Panel, PhotoBrowser, PieChart, Popover, Popup, Preloader, Progressbar, Radio, Range, RoutableModals, Row, Searchbar, Segmented, Sheet, SkeletonAvatar, SkeletonBlock, SkeletonImage, SkeletonText, Stepper, Subnavbar, SwipeoutActions, SwipeoutButton, SwiperSlide, Swiper, Tab, Tabs, TextEditor, Toggle, Toolbar, TreeviewItem, Treeview, View, Views }
|
|
117
|
+
export { AccordionContent, AccordionItem, AccordionToggle, Accordion, ActionsButton, ActionsGroup, ActionsLabel, Actions, App, Appbar, AreaChart, Badge, BlockFooter, BlockHeader, BlockTitle, Block, BreadcrumbsCollapsed, BreadcrumbsItem, BreadcrumbsSeparator, Breadcrumbs, Button, CardContent, CardFooter, CardHeader, Card, Checkbox, Chip, Col, FabBackdrop, FabButton, FabButtons, Fab, Gauge, Icon, Input, Link, ListButton, ListGroup, ListIndex, ListInput, ListItemCell, ListItemContent, ListItemRow, ListItem, List, LoginScreenTitle, LoginScreen, MenuDropdownItem, MenuDropdown, MenuItem, Menu, Message, MessagebarAttachment, MessagebarAttachments, MessagebarSheetImage, MessagebarSheetItem, MessagebarSheet, Messagebar, MessagesTitle, Messages, NavLeft, NavRight, NavTitleLarge, NavTitle, Navbar, PageContent, Page, Panel, PhotoBrowser, PieChart, Popover, Popup, Preloader, Progressbar, Radio, Range, RoutableModals, Row, Searchbar, Segmented, Sheet, SkeletonAvatar, SkeletonBlock, SkeletonImage, SkeletonText, Stepper, Subnavbar, SwipeoutActions, SwipeoutButton, SwiperSlide, Swiper, Tab, Tabs, TextEditor, Toggle, Toolbar, TreeviewItem, Treeview, View, Views }
|
|
114
118
|
export { f7, f7ready, theme, useStore };
|
|
115
119
|
export default Framework7React;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framework7-react",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "Build full featured iOS & Android apps using Framework7 & React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"ipad",
|
|
26
26
|
"apple",
|
|
27
27
|
"phonegap",
|
|
28
|
+
"capacitor",
|
|
28
29
|
"native",
|
|
29
30
|
"touch",
|
|
30
31
|
"appstore",
|
|
@@ -26,13 +26,14 @@ export default {
|
|
|
26
26
|
return routerOpenIn(router, navigateUrl, options);
|
|
27
27
|
},
|
|
28
28
|
|
|
29
|
-
pageComponentLoader({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
|
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
|
-
|
|
3
|
-
|
|
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();
|
package/shared/use-icon.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/shared/use-store.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { f7 } from './f7.js';
|
|
3
|
-
export const useStore = (
|
|
3
|
+
export const useStore = function () {
|
|
4
4
|
const assignedGetters = useRef({}); // (store, getter)
|
|
5
5
|
|
|
6
|
-
let store =
|
|
7
|
-
let getter =
|
|
6
|
+
let store = arguments.length <= 0 ? undefined : arguments[0];
|
|
7
|
+
let getter = arguments.length <= 1 ? undefined : arguments[1];
|
|
8
8
|
|
|
9
|
-
if (
|
|
9
|
+
if (arguments.length === 1) {
|
|
10
10
|
// (getter)
|
|
11
11
|
store = f7.store;
|
|
12
|
-
getter =
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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') {
|