framework7-react 7.1.5 → 8.0.0-beta.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/accordion-content.js +2 -2
- package/components/accordion-item.js +2 -11
- package/components/accordion-toggle.js +2 -2
- package/components/accordion.js +2 -2
- package/components/actions-button.d.ts +1 -1
- package/components/actions-button.js +4 -8
- package/components/actions-group.js +2 -2
- package/components/actions-label.js +4 -6
- package/components/actions.js +4 -14
- package/components/app.js +4 -8
- package/components/area-chart.js +6 -45
- package/components/badge.js +2 -2
- package/components/block-footer.js +2 -2
- package/components/block-header.js +2 -2
- package/components/block-title.js +2 -2
- package/components/block.d.ts +17 -4
- package/components/block.js +37 -11
- package/components/breadcrumbs-collapsed.js +2 -4
- package/components/breadcrumbs-item.js +2 -4
- package/components/breadcrumbs-separator.js +2 -2
- package/components/breadcrumbs.js +2 -2
- package/components/button.d.ts +3 -7
- package/components/button.js +8 -24
- package/components/card-content.js +2 -2
- package/components/card-footer.js +2 -2
- package/components/card-header.js +2 -2
- package/components/card.d.ts +5 -2
- package/components/card.js +14 -23
- package/components/checkbox.js +2 -4
- package/components/chip.d.ts +0 -1
- package/components/chip.js +2 -9
- package/components/fab-backdrop.js +2 -2
- package/components/fab-button.js +2 -6
- package/components/fab-buttons.js +2 -2
- package/components/fab.js +2 -10
- package/components/gauge.js +2 -2
- package/components/icon.d.ts +0 -1
- package/components/icon.js +3 -17
- package/components/input.js +1 -57
- package/components/link.d.ts +0 -1
- package/components/link.js +5 -12
- package/components/list-button.js +2 -4
- package/components/list-group.js +2 -2
- package/components/list-index.d.ts +0 -1
- package/components/list-index.js +3 -13
- package/components/list-input.d.ts +0 -1
- package/components/list-input.js +1 -55
- package/components/list-item-content.js +9 -20
- package/components/list-item.d.ts +1 -1
- package/components/list-item.js +6 -35
- package/components/list.d.ts +21 -9
- package/components/list.js +43 -37
- package/components/login-screen-title.js +2 -2
- package/components/login-screen.js +3 -15
- package/components/message.js +2 -10
- package/components/messagebar-attachment.js +2 -5
- package/components/messagebar-attachments.js +2 -2
- package/components/messagebar-sheet-image.js +4 -5
- package/components/messagebar-sheet-item.js +2 -2
- package/components/messagebar-sheet.js +2 -2
- package/components/messagebar.js +1 -19
- package/components/messages-title.js +2 -2
- package/components/messages.js +2 -15
- package/components/nav-left.js +2 -6
- package/components/nav-right.js +2 -2
- package/components/nav-title-large.js +2 -2
- package/components/nav-title.js +2 -4
- package/components/navbar.d.ts +1 -2
- package/components/navbar.js +5 -31
- package/components/page-content.js +2 -16
- package/components/page.d.ts +0 -1
- package/components/page.js +4 -62
- package/components/panel.d.ts +1 -0
- package/components/panel.js +6 -26
- package/components/photo-browser.js +1 -17
- package/components/pie-chart.js +6 -18
- package/components/popover.d.ts +1 -0
- package/components/popover.js +4 -14
- package/components/popup.js +3 -19
- package/components/preloader.js +5 -14
- package/components/progressbar.js +2 -4
- package/components/radio.js +2 -4
- package/components/range.js +2 -9
- package/components/routable-modals.js +2 -7
- package/components/searchbar.d.ts +1 -2
- package/components/searchbar.js +5 -30
- package/components/segmented.d.ts +0 -3
- package/components/segmented.js +4 -10
- package/components/sheet.js +2 -22
- package/components/stepper.d.ts +0 -5
- package/components/stepper.js +3 -33
- package/components/subnavbar.js +2 -2
- package/components/swipeout-actions.js +2 -4
- package/components/swipeout-button.js +2 -4
- package/components/tab.js +4 -15
- package/components/tabs.js +1 -4
- package/components/text-editor.js +1 -18
- package/components/toggle.js +1 -13
- package/components/toolbar.d.ts +2 -6
- package/components/toolbar.js +9 -20
- package/components/treeview-item.d.ts +0 -1
- package/components/treeview-item.js +2 -11
- package/components/treeview.js +2 -2
- package/components/view.d.ts +0 -6
- package/components/view.js +3 -30
- package/components/views.js +2 -2
- package/framework7-react.d.ts +2 -14
- package/framework7-react.js +3 -14
- package/package.json +1 -1
- package/shared/components-router.js +0 -32
- package/shared/f7.js +5 -19
- package/shared/get-router-initial-component.js +0 -4
- package/shared/mixins.js +2 -8
- package/shared/plugin.js +2 -8
- package/shared/router-open-in.js +4 -15
- package/shared/tabbar-context.js +1 -1
- package/shared/use-icon.js +1 -6
- package/shared/use-isomorphic-layout-effect.js +0 -2
- package/shared/use-route-props.js +0 -1
- package/shared/use-smart-select.js +0 -3
- package/shared/use-store.js +4 -8
- package/shared/use-tab.js +0 -4
- package/shared/use-theme.js +0 -2
- package/shared/use-tooltip.js +0 -5
- package/shared/utils.js +0 -18
- package/shared/watch-prop.js +0 -1
- package/components/appbar.d.ts +0 -28
- package/components/appbar.js +0 -45
- package/components/col.d.ts +0 -36
- package/components/col.js +0 -75
- package/components/list-item-cell.d.ts +0 -23
- package/components/list-item-cell.js +0 -28
- package/components/list-item-row.d.ts +0 -23
- package/components/list-item-row.js +0 -28
- package/components/menu-dropdown-item.d.ts +0 -68
- package/components/menu-dropdown-item.js +0 -59
- package/components/menu-dropdown.d.ts +0 -28
- package/components/menu-dropdown.js +0 -42
- package/components/menu-item.d.ts +0 -81
- package/components/menu-item.js +0 -101
- package/components/menu.d.ts +0 -23
- package/components/menu.js +0 -30
- package/components/row.d.ts +0 -31
- package/components/row.js +0 -64
- package/components/swiper-slide.d.ts +0 -4
- package/components/swiper-slide.js +0 -3
- package/components/swiper.d.ts +0 -4
- package/components/swiper.js +0 -3
package/components/list-item.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle, useContext } from 'react';
|
|
4
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
5
4
|
import { classNames, getExtraAttrs, getSlots, emit, isStringProp } from '../shared/utils.js';
|
|
@@ -13,6 +12,7 @@ import ListItemContent from './list-item-content.js';
|
|
|
13
12
|
import { ListContext } from '../shared/list-context.js';
|
|
14
13
|
|
|
15
14
|
|
|
15
|
+
|
|
16
16
|
/*
|
|
17
17
|
const ListItemContent = ({
|
|
18
18
|
props,
|
|
@@ -43,6 +43,7 @@ const ListItemContent = ({
|
|
|
43
43
|
after,
|
|
44
44
|
badge,
|
|
45
45
|
badgeColor,
|
|
46
|
+
checkboxIcon,
|
|
46
47
|
radioIcon,
|
|
47
48
|
swipeout,
|
|
48
49
|
sortable,
|
|
@@ -51,7 +52,6 @@ const ListItemContent = ({
|
|
|
51
52
|
|
|
52
53
|
};
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
55
|
const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
56
56
|
const {
|
|
57
57
|
className,
|
|
@@ -66,7 +66,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
66
66
|
selected,
|
|
67
67
|
mediaItem,
|
|
68
68
|
mediaList,
|
|
69
|
-
divider,
|
|
70
69
|
groupTitle,
|
|
71
70
|
swipeout,
|
|
72
71
|
swipeoutOpened,
|
|
@@ -95,92 +94,74 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
95
94
|
const elRef = useRef(null);
|
|
96
95
|
const linkElRef = useRef(null);
|
|
97
96
|
const f7SmartSelect = useRef(null);
|
|
98
|
-
|
|
99
97
|
const onClick = event => {
|
|
100
98
|
if (event.target.tagName.toLowerCase() !== 'input') {
|
|
101
99
|
emit(props, 'click', event);
|
|
102
100
|
}
|
|
103
101
|
};
|
|
104
|
-
|
|
105
102
|
const onSwipeoutOverswipeEnter = el => {
|
|
106
103
|
if (elRef.current !== el) return;
|
|
107
104
|
emit(props, 'swipeoutOverswipeEnter');
|
|
108
105
|
};
|
|
109
|
-
|
|
110
106
|
const onSwipeoutOverswipeExit = el => {
|
|
111
107
|
if (elRef.current !== el) return;
|
|
112
108
|
emit(props, 'swipeoutOverswipeExit');
|
|
113
109
|
};
|
|
114
|
-
|
|
115
110
|
const onSwipeoutDeleted = el => {
|
|
116
111
|
if (elRef.current !== el) return;
|
|
117
112
|
emit(props, 'swipeoutDeleted');
|
|
118
113
|
};
|
|
119
|
-
|
|
120
114
|
const onSwipeoutDelete = el => {
|
|
121
115
|
if (elRef.current !== el) return;
|
|
122
116
|
emit(props, 'swipeoutDelete');
|
|
123
117
|
};
|
|
124
|
-
|
|
125
118
|
const onSwipeoutClose = el => {
|
|
126
119
|
if (elRef.current !== el) return;
|
|
127
120
|
emit(props, 'swipeoutClose');
|
|
128
121
|
};
|
|
129
|
-
|
|
130
122
|
const onSwipeoutClosed = el => {
|
|
131
123
|
if (elRef.current !== el) return;
|
|
132
124
|
emit(props, 'swipeoutClosed');
|
|
133
125
|
};
|
|
134
|
-
|
|
135
126
|
const onSwipeoutOpen = el => {
|
|
136
127
|
if (elRef.current !== el) return;
|
|
137
128
|
emit(props, 'swipeoutOpen');
|
|
138
129
|
};
|
|
139
|
-
|
|
140
130
|
const onSwipeoutOpened = el => {
|
|
141
131
|
if (elRef.current !== el) return;
|
|
142
132
|
emit(props, 'swipeoutOpened');
|
|
143
133
|
};
|
|
144
|
-
|
|
145
134
|
const onSwipeout = (el, progress) => {
|
|
146
135
|
if (elRef.current !== el) return;
|
|
147
136
|
emit(props, 'swipeout', progress);
|
|
148
137
|
};
|
|
149
|
-
|
|
150
138
|
const onAccBeforeClose = (el, prevent) => {
|
|
151
139
|
if (elRef.current !== el) return;
|
|
152
140
|
emit(props, 'accordionBeforeClose', prevent);
|
|
153
141
|
};
|
|
154
|
-
|
|
155
142
|
const onAccClose = el => {
|
|
156
143
|
if (elRef.current !== el) return;
|
|
157
144
|
emit(props, 'accordionClose');
|
|
158
145
|
};
|
|
159
|
-
|
|
160
146
|
const onAccClosed = el => {
|
|
161
147
|
if (elRef.current !== el) return;
|
|
162
148
|
emit(props, 'accordionClosed');
|
|
163
149
|
};
|
|
164
|
-
|
|
165
150
|
const onAccBeforeOpen = (el, prevent) => {
|
|
166
151
|
if (elRef.current !== el) return;
|
|
167
152
|
emit(props, 'accordionBeforeOpen', prevent);
|
|
168
153
|
};
|
|
169
|
-
|
|
170
154
|
const onAccOpen = el => {
|
|
171
155
|
if (elRef.current !== el) return;
|
|
172
156
|
emit(props, 'accordionOpen');
|
|
173
157
|
};
|
|
174
|
-
|
|
175
158
|
const onAccOpened = el => {
|
|
176
159
|
if (elRef.current !== el) return;
|
|
177
160
|
emit(props, 'accordionOpened');
|
|
178
161
|
};
|
|
179
|
-
|
|
180
162
|
const onChange = event => {
|
|
181
163
|
emit(props, 'change', event);
|
|
182
164
|
};
|
|
183
|
-
|
|
184
165
|
useImperativeHandle(ref, () => ({
|
|
185
166
|
el: elRef.current,
|
|
186
167
|
f7SmartSelect: () => f7SmartSelect.current
|
|
@@ -189,14 +170,12 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
189
170
|
useRouteProps(linkElRef, props);
|
|
190
171
|
watchProp(swipeoutOpened, newValue => {
|
|
191
172
|
if (!swipeout || !elRef.current || !f7) return;
|
|
192
|
-
|
|
193
173
|
if (newValue) {
|
|
194
174
|
f7.swipeout.open(elRef.current);
|
|
195
175
|
} else {
|
|
196
176
|
f7.swipeout.close(elRef.current);
|
|
197
177
|
}
|
|
198
178
|
});
|
|
199
|
-
|
|
200
179
|
const attachEvents = () => {
|
|
201
180
|
f7ready(() => {
|
|
202
181
|
if (swipeout) {
|
|
@@ -210,7 +189,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
210
189
|
f7.on('swipeoutOverswipeExit', onSwipeoutOverswipeExit);
|
|
211
190
|
f7.on('swipeout', onSwipeout);
|
|
212
191
|
}
|
|
213
|
-
|
|
214
192
|
if (accordionItem) {
|
|
215
193
|
f7.on('accordionBeforeOpen', onAccBeforeOpen);
|
|
216
194
|
f7.on('accordionOpen', onAccOpen);
|
|
@@ -221,7 +199,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
221
199
|
}
|
|
222
200
|
});
|
|
223
201
|
};
|
|
224
|
-
|
|
225
202
|
const detachEvents = () => {
|
|
226
203
|
if (!f7) return;
|
|
227
204
|
f7.off('swipeoutOpen', onSwipeoutOpen);
|
|
@@ -240,7 +217,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
240
217
|
f7.off('accordionClose', onAccClose);
|
|
241
218
|
f7.off('accordionClosed', onAccClosed);
|
|
242
219
|
};
|
|
243
|
-
|
|
244
220
|
useSmartSelect(smartSelect, smartSelectParams, f7SmartSelect, () => elRef.current.querySelector('a.smart-select'));
|
|
245
221
|
useIsomorphicLayoutEffect(() => {
|
|
246
222
|
f7ready(() => {
|
|
@@ -259,7 +235,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
259
235
|
const isMediaComputed = mediaItem || mediaList || listIsMedia;
|
|
260
236
|
const isSortableComputed = sortable === true || sortable === false ? sortable : listIsSortable;
|
|
261
237
|
const isSortableOppositeComputed = isSortableComputed && (sortableOpposite || listIsSortableOpposite);
|
|
262
|
-
|
|
263
238
|
if (!listIsSimple) {
|
|
264
239
|
// Item Content
|
|
265
240
|
itemContentEl = /*#__PURE__*/React.createElement(ListItemContent, _extends({}, props, {
|
|
@@ -269,8 +244,9 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
269
244
|
isMediaComputed: isMediaComputed,
|
|
270
245
|
isSortableComputed: isSortableComputed,
|
|
271
246
|
isSortableOppositeComputed: isSortableOppositeComputed
|
|
272
|
-
}));
|
|
247
|
+
}));
|
|
273
248
|
|
|
249
|
+
// Link
|
|
274
250
|
if (link || href || accordionItem || smartSelect) {
|
|
275
251
|
const linkAttrs = {
|
|
276
252
|
href: link === true ? '' : link || href,
|
|
@@ -294,9 +270,7 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
294
270
|
}), itemContentEl);
|
|
295
271
|
}
|
|
296
272
|
}
|
|
297
|
-
|
|
298
273
|
const liClasses = classNames(className, {
|
|
299
|
-
'item-divider': divider,
|
|
300
274
|
'list-group-title': groupTitle,
|
|
301
275
|
'media-item': isMediaComputed,
|
|
302
276
|
swipeout,
|
|
@@ -307,8 +281,7 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
307
281
|
'chevron-center': chevronCenter,
|
|
308
282
|
'disallow-sorting': sortable === false
|
|
309
283
|
}, colorClasses(props));
|
|
310
|
-
|
|
311
|
-
if (divider || groupTitle) {
|
|
284
|
+
if (groupTitle) {
|
|
312
285
|
return /*#__PURE__*/React.createElement("li", {
|
|
313
286
|
ref: elRef,
|
|
314
287
|
id: id,
|
|
@@ -318,7 +291,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
318
291
|
onClick: onClick
|
|
319
292
|
}, /*#__PURE__*/React.createElement("span", null, title, children));
|
|
320
293
|
}
|
|
321
|
-
|
|
322
294
|
if (listIsSimple) {
|
|
323
295
|
return /*#__PURE__*/React.createElement("li", {
|
|
324
296
|
ref: elRef,
|
|
@@ -329,7 +301,6 @@ const ListItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
329
301
|
onClick: onClick
|
|
330
302
|
}, title, children);
|
|
331
303
|
}
|
|
332
|
-
|
|
333
304
|
const linkItemEl = link || href || smartSelect || accordionItem ? linkEl : itemContentEl;
|
|
334
305
|
return /*#__PURE__*/React.createElement("li", _extends({
|
|
335
306
|
ref: elRef,
|
package/components/list.d.ts
CHANGED
|
@@ -10,11 +10,32 @@ export interface ListProps {
|
|
|
10
10
|
className?: string;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
inset ?: boolean;
|
|
13
|
+
insetIos ?: boolean;
|
|
14
|
+
insetMd ?: boolean;
|
|
13
15
|
xsmallInset ?: boolean;
|
|
16
|
+
xsmallInsetIos ?: boolean;
|
|
17
|
+
xsmallInsetMd ?: boolean;
|
|
14
18
|
smallInset ?: boolean;
|
|
19
|
+
smallInsetIos ?: boolean;
|
|
20
|
+
smallInsetMd ?: boolean;
|
|
15
21
|
mediumInset ?: boolean;
|
|
22
|
+
mediumInsetIos ?: boolean;
|
|
23
|
+
mediumInsetMd ?: boolean;
|
|
16
24
|
largeInset ?: boolean;
|
|
25
|
+
largeInsetIos ?: boolean;
|
|
26
|
+
largeInsetMd ?: boolean;
|
|
17
27
|
xlargeInset ?: boolean;
|
|
28
|
+
xlargeInsetIos ?: boolean;
|
|
29
|
+
xlargeInsetMd ?: boolean;
|
|
30
|
+
strong?: boolean;
|
|
31
|
+
strongIos?: boolean;
|
|
32
|
+
strongMd?: boolean;
|
|
33
|
+
outline?: boolean;
|
|
34
|
+
outlineIos?: boolean;
|
|
35
|
+
outlineMd?: boolean;
|
|
36
|
+
dividers?: boolean;
|
|
37
|
+
dividersIos?: boolean;
|
|
38
|
+
dividersMd?: boolean;
|
|
18
39
|
mediaList ?: boolean;
|
|
19
40
|
sortable ?: boolean;
|
|
20
41
|
sortableTapHold ?: boolean;
|
|
@@ -27,21 +48,12 @@ export interface ListProps {
|
|
|
27
48
|
simpleList ?: boolean;
|
|
28
49
|
linksList ?: boolean;
|
|
29
50
|
menuList ?: boolean;
|
|
30
|
-
noHairlines ?: boolean;
|
|
31
|
-
noHairlinesBetween ?: boolean;
|
|
32
|
-
noHairlinesMd ?: boolean;
|
|
33
|
-
noHairlinesBetweenMd ?: boolean;
|
|
34
|
-
noHairlinesIos ?: boolean;
|
|
35
|
-
noHairlinesBetweenIos ?: boolean;
|
|
36
|
-
noHairlinesAurora ?: boolean;
|
|
37
|
-
noHairlinesBetweenAurora ?: boolean;
|
|
38
51
|
noChevron ?: boolean;
|
|
39
52
|
chevronCenter ?: boolean;
|
|
40
53
|
tab ?: boolean;
|
|
41
54
|
tabActive ?: boolean;
|
|
42
55
|
form ?: boolean;
|
|
43
56
|
formStoreData ?: boolean;
|
|
44
|
-
inlineLabels ?: boolean;
|
|
45
57
|
virtualList ?: boolean;
|
|
46
58
|
virtualListParams ?: Object;
|
|
47
59
|
color?: string;
|
package/components/list.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
5
4
|
import { classNames, getExtraAttrs, getSlots, flattenArray, emit, extend } from '../shared/utils.js';
|
|
@@ -16,11 +15,32 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
16
15
|
id,
|
|
17
16
|
style,
|
|
18
17
|
inset,
|
|
18
|
+
insetIos,
|
|
19
|
+
insetMd,
|
|
19
20
|
xsmallInset,
|
|
21
|
+
xsmallInsetIos,
|
|
22
|
+
xsmallInsetMd,
|
|
20
23
|
smallInset,
|
|
24
|
+
smallInsetIos,
|
|
25
|
+
smallInsetMd,
|
|
21
26
|
mediumInset,
|
|
27
|
+
mediumInsetIos,
|
|
28
|
+
mediumInsetMd,
|
|
22
29
|
largeInset,
|
|
30
|
+
largeInsetIos,
|
|
31
|
+
largeInsetMd,
|
|
23
32
|
xlargeInset,
|
|
33
|
+
xlargeInsetIos,
|
|
34
|
+
xlargeInsetMd,
|
|
35
|
+
strong,
|
|
36
|
+
strongIos,
|
|
37
|
+
strongMd,
|
|
38
|
+
outline,
|
|
39
|
+
outlineIos,
|
|
40
|
+
outlineMd,
|
|
41
|
+
dividers,
|
|
42
|
+
dividersIos,
|
|
43
|
+
dividersMd,
|
|
24
44
|
mediaList,
|
|
25
45
|
sortable,
|
|
26
46
|
sortableTapHold,
|
|
@@ -33,57 +53,41 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
33
53
|
simpleList,
|
|
34
54
|
linksList,
|
|
35
55
|
menuList,
|
|
36
|
-
noHairlines,
|
|
37
|
-
noHairlinesBetween,
|
|
38
|
-
noHairlinesMd,
|
|
39
|
-
noHairlinesBetweenMd,
|
|
40
|
-
noHairlinesIos,
|
|
41
|
-
noHairlinesBetweenIos,
|
|
42
|
-
noHairlinesAurora,
|
|
43
|
-
noHairlinesBetweenAurora,
|
|
44
56
|
noChevron,
|
|
45
57
|
chevronCenter,
|
|
46
58
|
tab,
|
|
47
59
|
tabActive,
|
|
48
60
|
form,
|
|
49
61
|
formStoreData,
|
|
50
|
-
inlineLabels,
|
|
51
62
|
virtualList,
|
|
52
63
|
virtualListParams
|
|
53
64
|
} = props;
|
|
54
65
|
const extraAttrs = getExtraAttrs(props);
|
|
55
66
|
const elRef = useRef(null);
|
|
56
|
-
|
|
57
67
|
const onSubmit = event => {
|
|
58
68
|
emit(props, 'submit', event);
|
|
59
69
|
};
|
|
60
|
-
|
|
61
70
|
const onSortableEnable = el => {
|
|
62
71
|
if (elRef.current !== el) return;
|
|
63
72
|
emit(props, 'sortableEnable');
|
|
64
73
|
};
|
|
65
|
-
|
|
66
74
|
const onSortableDisable = el => {
|
|
67
75
|
if (elRef.current !== el) return;
|
|
68
76
|
emit(props, 'sortableDisable');
|
|
69
77
|
};
|
|
70
|
-
|
|
71
78
|
const onSortableSort = (el, sortData, listEl) => {
|
|
72
79
|
if (elRef.current !== listEl) return;
|
|
73
80
|
emit(props, 'sortableSort', sortData);
|
|
74
81
|
};
|
|
75
|
-
|
|
76
82
|
const onSortableMove = (el, listEl) => {
|
|
77
83
|
if (elRef.current !== listEl) return;
|
|
78
84
|
emit(props, 'sortableMove', el, listEl);
|
|
79
85
|
};
|
|
80
|
-
|
|
81
86
|
useImperativeHandle(ref, () => ({
|
|
82
87
|
el: elRef.current,
|
|
83
88
|
f7VirtualList: () => f7VirtualList.current
|
|
84
89
|
}));
|
|
85
90
|
useTab(elRef, props);
|
|
86
|
-
|
|
87
91
|
const attachEvents = () => {
|
|
88
92
|
f7ready(() => {
|
|
89
93
|
f7.on('sortableEnable', onSortableEnable);
|
|
@@ -92,7 +96,6 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
92
96
|
f7.on('sortableMove', onSortableMove);
|
|
93
97
|
});
|
|
94
98
|
};
|
|
95
|
-
|
|
96
99
|
const detachEvents = () => {
|
|
97
100
|
if (!f7) return;
|
|
98
101
|
f7.off('sortableEnable', onSortableEnable);
|
|
@@ -100,7 +103,6 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
100
103
|
f7.off('sortableSort', onSortableSort);
|
|
101
104
|
f7.off('sortableMove', onSortableMove);
|
|
102
105
|
};
|
|
103
|
-
|
|
104
106
|
const onMount = () => {
|
|
105
107
|
f7ready(() => {
|
|
106
108
|
if (!virtualList) return;
|
|
@@ -113,34 +115,28 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
113
115
|
const vl = this;
|
|
114
116
|
emit(props, 'virtualItemBeforeInsert', vl, itemEl, item);
|
|
115
117
|
},
|
|
116
|
-
|
|
117
118
|
beforeClear(fragment) {
|
|
118
119
|
const vl = this;
|
|
119
120
|
emit(props, 'virtualBeforeClear', vl, fragment);
|
|
120
121
|
},
|
|
121
|
-
|
|
122
122
|
itemsBeforeInsert(fragment) {
|
|
123
123
|
const vl = this;
|
|
124
124
|
emit(props, 'virtualItemsBeforeInsert', vl, fragment);
|
|
125
125
|
},
|
|
126
|
-
|
|
127
126
|
itemsAfterInsert(fragment) {
|
|
128
127
|
const vl = this;
|
|
129
128
|
emit(props, 'virtualItemsAfterInsert', vl, fragment);
|
|
130
129
|
}
|
|
131
|
-
|
|
132
130
|
}
|
|
133
131
|
}, vlParams));
|
|
134
132
|
});
|
|
135
133
|
};
|
|
136
|
-
|
|
137
134
|
const onDestroy = () => {
|
|
138
135
|
if (!f7) return;
|
|
139
136
|
if (!(virtualList && f7VirtualList.current)) return;
|
|
140
137
|
if (f7VirtualList.current.destroy) f7VirtualList.current.destroy();
|
|
141
138
|
f7VirtualList.current = null;
|
|
142
139
|
};
|
|
143
|
-
|
|
144
140
|
useIsomorphicLayoutEffect(() => {
|
|
145
141
|
onMount();
|
|
146
142
|
return onDestroy;
|
|
@@ -162,11 +158,9 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
162
158
|
flattenSlots.forEach(child => {
|
|
163
159
|
if (typeof child === 'undefined') return;
|
|
164
160
|
let tag = child.type && (child.type.displayName || child.type.name);
|
|
165
|
-
|
|
166
161
|
if (!tag && typeof child.type === 'string') {
|
|
167
162
|
tag = child.type;
|
|
168
163
|
}
|
|
169
|
-
|
|
170
164
|
if (!tag || tag && !(tag === 'li' || tag.indexOf('f7-list-item') >= 0 || tag.indexOf('f7-list-button') >= 0 || tag.indexOf('f7-list-input') >= 0)) {
|
|
171
165
|
if (wasUlChild) rootChildrenAfterList.push(child);else rootChildrenBeforeList.push(child);
|
|
172
166
|
} else if (tag) {
|
|
@@ -177,11 +171,32 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
177
171
|
const ListTag = form ? 'form' : 'div';
|
|
178
172
|
const classes = classNames(className, 'list', {
|
|
179
173
|
inset,
|
|
174
|
+
'inset-ios': insetIos,
|
|
175
|
+
'inset-md': insetMd,
|
|
180
176
|
'xsmall-inset': xsmallInset,
|
|
177
|
+
'xsmall-inset-ios': xsmallInsetIos,
|
|
178
|
+
'xsmall-inset-md': xsmallInsetMd,
|
|
181
179
|
'small-inset': smallInset,
|
|
180
|
+
'small-inset-ios': smallInsetIos,
|
|
181
|
+
'small-inset-md': smallInsetMd,
|
|
182
182
|
'medium-inset': mediumInset,
|
|
183
|
+
'medium-inset-ios': mediumInsetIos,
|
|
184
|
+
'medium-inset-md': mediumInsetMd,
|
|
183
185
|
'large-inset': largeInset,
|
|
186
|
+
'large-inset-ios': largeInsetIos,
|
|
187
|
+
'large-inset-md': largeInsetMd,
|
|
184
188
|
'xlarge-inset': xlargeInset,
|
|
189
|
+
'xlarge-inset-ios': xlargeInsetIos,
|
|
190
|
+
'xlarge-inset-md': xlargeInsetMd,
|
|
191
|
+
'list-strong': strong,
|
|
192
|
+
'list-strong-ios': strongIos,
|
|
193
|
+
'list-strong-md': strongMd,
|
|
194
|
+
'list-outline': outline,
|
|
195
|
+
'list-outline-ios': outlineIos,
|
|
196
|
+
'list-outline-md': outlineMd,
|
|
197
|
+
'list-dividers': dividers,
|
|
198
|
+
'list-dividers-ios': dividersIos,
|
|
199
|
+
'list-dividers-md': dividersMd,
|
|
185
200
|
'media-list': mediaList,
|
|
186
201
|
'simple-list': simpleList,
|
|
187
202
|
'links-list': linksList,
|
|
@@ -196,16 +211,7 @@ const List = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
196
211
|
'virtual-list': virtualList,
|
|
197
212
|
tab,
|
|
198
213
|
'tab-active': tabActive,
|
|
199
|
-
'no-hairlines': noHairlines,
|
|
200
|
-
'no-hairlines-md': noHairlinesMd,
|
|
201
|
-
'no-hairlines-ios': noHairlinesIos,
|
|
202
|
-
'no-hairlines-aurora': noHairlinesAurora,
|
|
203
|
-
'no-hairlines-between': noHairlinesBetween,
|
|
204
|
-
'no-hairlines-between-md': noHairlinesBetweenMd,
|
|
205
|
-
'no-hairlines-between-ios': noHairlinesBetweenIos,
|
|
206
|
-
'no-hairlines-between-aurora': noHairlinesBetweenAurora,
|
|
207
214
|
'form-store-data': formStoreData,
|
|
208
|
-
'inline-labels': inlineLabels,
|
|
209
215
|
'no-chevron': noChevron,
|
|
210
216
|
'chevron-center': chevronCenter
|
|
211
217
|
}, colorClasses(props));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
|
|
6
|
+
|
|
7
7
|
const LoginScreenTitle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { useIsomorphicLayoutEffect } from '../shared/use-isomorphic-layout-effect.js';
|
|
5
4
|
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
@@ -24,43 +23,37 @@ const LoginScreen = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24
23
|
const isOpened = useRef(opened);
|
|
25
24
|
const isClosing = useRef(false);
|
|
26
25
|
const elRef = useRef(null);
|
|
27
|
-
|
|
28
26
|
const onOpen = instance => {
|
|
29
27
|
isOpened.current = true;
|
|
30
28
|
isClosing.current = false;
|
|
31
29
|
emit(props, 'loginScreenOpen', instance);
|
|
32
30
|
};
|
|
33
|
-
|
|
34
31
|
const onOpened = instance => {
|
|
35
32
|
emit(props, 'loginScreenOpened', instance);
|
|
36
33
|
};
|
|
37
|
-
|
|
38
34
|
const onClose = instance => {
|
|
39
35
|
isOpened.current = false;
|
|
40
36
|
isClosing.current = true;
|
|
41
37
|
emit(props, 'loginScreenClose', instance);
|
|
42
38
|
};
|
|
43
|
-
|
|
44
39
|
const onClosed = instance => {
|
|
45
40
|
isClosing.current = false;
|
|
46
41
|
emit(props, 'loginScreenClosed', instance);
|
|
47
42
|
};
|
|
48
|
-
|
|
49
43
|
useImperativeHandle(ref, () => ({
|
|
50
44
|
el: elRef.current,
|
|
51
45
|
f7LoginScreen: () => f7LoginScreen.current
|
|
52
|
-
}));
|
|
46
|
+
}));
|
|
53
47
|
|
|
48
|
+
// watch opened changes
|
|
54
49
|
watchProp(opened, value => {
|
|
55
50
|
if (!f7LoginScreen.current) return;
|
|
56
|
-
|
|
57
51
|
if (value) {
|
|
58
52
|
f7LoginScreen.current.open();
|
|
59
53
|
} else {
|
|
60
54
|
f7LoginScreen.current.close();
|
|
61
55
|
}
|
|
62
56
|
});
|
|
63
|
-
|
|
64
57
|
const modalEvents = method => {
|
|
65
58
|
if (!f7LoginScreen.current) return;
|
|
66
59
|
f7LoginScreen.current[method]('open', onOpen);
|
|
@@ -68,7 +61,6 @@ const LoginScreen = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
68
61
|
f7LoginScreen.current[method]('close', onClose);
|
|
69
62
|
f7LoginScreen.current[method]('closed', onClosed);
|
|
70
63
|
};
|
|
71
|
-
|
|
72
64
|
const onMount = () => {
|
|
73
65
|
if (!elRef.current) return;
|
|
74
66
|
f7ready(() => {
|
|
@@ -79,21 +71,17 @@ const LoginScreen = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
79
71
|
if ('containerEl' in props) loginScreenParams.containerEl = containerEl;
|
|
80
72
|
f7LoginScreen.current = f7.loginScreen.create(loginScreenParams);
|
|
81
73
|
modalEvents('on');
|
|
82
|
-
|
|
83
74
|
if (opened) {
|
|
84
75
|
f7LoginScreen.current.open(false);
|
|
85
76
|
}
|
|
86
77
|
});
|
|
87
78
|
};
|
|
88
|
-
|
|
89
79
|
const onDestroy = () => {
|
|
90
80
|
if (f7LoginScreen.current) {
|
|
91
81
|
f7LoginScreen.current.destroy();
|
|
92
82
|
}
|
|
93
|
-
|
|
94
83
|
f7LoginScreen.current = null;
|
|
95
84
|
};
|
|
96
|
-
|
|
97
85
|
useIsomorphicLayoutEffect(() => {
|
|
98
86
|
modalEvents('on');
|
|
99
87
|
return () => {
|
package/components/message.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs, getSlots, emit } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
|
|
6
|
+
|
|
7
7
|
const Message = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
@@ -29,35 +29,27 @@ const Message = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
29
29
|
} = props;
|
|
30
30
|
const extraAttrs = getExtraAttrs(props);
|
|
31
31
|
const elRef = useRef(null);
|
|
32
|
-
|
|
33
32
|
const onClick = event => {
|
|
34
33
|
emit(props, 'click', event);
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
const onNameClick = event => {
|
|
38
36
|
emit(props, 'clickName', event);
|
|
39
37
|
};
|
|
40
|
-
|
|
41
38
|
const onTextClick = event => {
|
|
42
39
|
emit(props, 'clickText', event);
|
|
43
40
|
};
|
|
44
|
-
|
|
45
41
|
const onAvatarClick = event => {
|
|
46
42
|
emit(props, 'clickAvatar', event);
|
|
47
43
|
};
|
|
48
|
-
|
|
49
44
|
const onHeaderClick = event => {
|
|
50
45
|
emit(props, 'clickHeader', event);
|
|
51
46
|
};
|
|
52
|
-
|
|
53
47
|
const onFooterClick = event => {
|
|
54
48
|
emit(props, 'clickFooter', event);
|
|
55
49
|
};
|
|
56
|
-
|
|
57
50
|
const onBubbleClick = event => {
|
|
58
51
|
emit(props, 'clickBubble', event);
|
|
59
52
|
};
|
|
60
|
-
|
|
61
53
|
useImperativeHandle(ref, () => ({
|
|
62
54
|
el: elRef.current
|
|
63
55
|
}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs, emit } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
|
|
6
|
+
|
|
7
7
|
const MessagebarAttachment = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
@@ -15,15 +15,12 @@ const MessagebarAttachment = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15
15
|
} = props;
|
|
16
16
|
const extraAttrs = getExtraAttrs(props);
|
|
17
17
|
const elRef = useRef(null);
|
|
18
|
-
|
|
19
18
|
const onClick = event => {
|
|
20
19
|
emit(props, 'attachmentClick', event);
|
|
21
20
|
};
|
|
22
|
-
|
|
23
21
|
const onDeleteClick = event => {
|
|
24
22
|
emit(props, 'attachmentDelete', event);
|
|
25
23
|
};
|
|
26
|
-
|
|
27
24
|
useImperativeHandle(ref, () => ({
|
|
28
25
|
el: elRef.current
|
|
29
26
|
}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
2
|
-
|
|
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); }
|
|
3
2
|
import React, { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
3
|
import { classNames, getExtraAttrs } from '../shared/utils.js';
|
|
5
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
6
5
|
|
|
6
|
+
|
|
7
7
|
const MessagebarAttachments = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|