framework7-react 7.0.8 → 8.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +6 -20
- package/components/list-item.d.ts +0 -1
- package/components/list-item.js +5 -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/swiper-slide.d.ts +1 -0
- package/components/swiper-slide.js +1 -0
- package/components/swiper.d.ts +1 -0
- package/components/swiper.js +1 -0
- 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 -12
- package/framework7-react.js +3 -12
- 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/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,
|
|
@@ -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 MessagebarSheetImage = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
@@ -15,18 +15,15 @@ const MessagebarSheetImage = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15
15
|
} = props;
|
|
16
16
|
const extraAttrs = getExtraAttrs(props);
|
|
17
17
|
const elRef = useRef(null);
|
|
18
|
-
|
|
19
18
|
const onChange = event => {
|
|
20
19
|
if (event.target.checked) emit(props, 'checked', event);else emit(props, 'unchecked', event);
|
|
21
20
|
emit(props, 'change', event);
|
|
22
21
|
};
|
|
23
|
-
|
|
24
22
|
useImperativeHandle(ref, () => ({
|
|
25
23
|
el: elRef.current
|
|
26
24
|
}));
|
|
27
25
|
const classes = classNames(className, 'messagebar-sheet-image', 'checkbox', colorClasses(props));
|
|
28
26
|
const styles = {
|
|
29
|
-
backgroundImage: image && `url(${image})`,
|
|
30
27
|
...(style || {})
|
|
31
28
|
};
|
|
32
29
|
return /*#__PURE__*/React.createElement("label", _extends({
|
|
@@ -40,6 +37,8 @@ const MessagebarSheetImage = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
40
37
|
onChange: onChange
|
|
41
38
|
}), /*#__PURE__*/React.createElement("i", {
|
|
42
39
|
className: "icon icon-checkbox"
|
|
40
|
+
}), image && /*#__PURE__*/React.createElement("img", {
|
|
41
|
+
src: image
|
|
43
42
|
}), children);
|
|
44
43
|
});
|
|
45
44
|
MessagebarSheetImage.displayName = 'f7-messagebar-sheet-image';
|
|
@@ -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 MessagebarSheetItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
|
@@ -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 MessagebarSheet = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|
package/components/messagebar.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, emit, getSlots, noUndefinedProps } from '../shared/utils.js';
|
|
@@ -38,23 +37,18 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
38
37
|
const extraAttrs = getExtraAttrs(props);
|
|
39
38
|
const elRef = useRef(null);
|
|
40
39
|
const areaElRef = useRef(null);
|
|
41
|
-
|
|
42
40
|
const onChange = event => {
|
|
43
41
|
emit(props, 'change', event);
|
|
44
42
|
};
|
|
45
|
-
|
|
46
43
|
const onInput = event => {
|
|
47
44
|
emit(props, 'input', event);
|
|
48
45
|
};
|
|
49
|
-
|
|
50
46
|
const onFocus = event => {
|
|
51
47
|
emit(props, 'focus', event);
|
|
52
48
|
};
|
|
53
|
-
|
|
54
49
|
const onBlur = event => {
|
|
55
50
|
emit(props, 'blur', event);
|
|
56
51
|
};
|
|
57
|
-
|
|
58
52
|
const onClick = event => {
|
|
59
53
|
const inputValue = areaElRef.current.el.value;
|
|
60
54
|
const clear = f7Messagebar.current ? () => {
|
|
@@ -64,19 +58,15 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
64
58
|
emit(props, 'send', inputValue, clear);
|
|
65
59
|
emit(props, 'click', event);
|
|
66
60
|
};
|
|
67
|
-
|
|
68
61
|
const onAttachmentDelete = (instance, attachmentEl, attachmentElIndex) => {
|
|
69
62
|
emit(props, 'messagebarAttachmentDelete', instance, attachmentEl, attachmentElIndex);
|
|
70
63
|
};
|
|
71
|
-
|
|
72
64
|
const onAttachmentClick = (instance, attachmentEl, attachmentElIndex) => {
|
|
73
65
|
emit(props, 'messagebarAttachmentClick', instance, attachmentEl, attachmentElIndex);
|
|
74
66
|
};
|
|
75
|
-
|
|
76
67
|
const onResizePage = instance => {
|
|
77
68
|
emit(props, 'messagebarResizePage', instance);
|
|
78
69
|
};
|
|
79
|
-
|
|
80
70
|
useImperativeHandle(ref, () => ({
|
|
81
71
|
el: elRef.current,
|
|
82
72
|
f7Messagebar: () => f7Messagebar.current
|
|
@@ -91,20 +81,17 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
91
81
|
});
|
|
92
82
|
useIsomorphicLayoutEffect(() => {
|
|
93
83
|
if (!f7Messagebar.current) return;
|
|
94
|
-
|
|
95
84
|
if (updateSheetVisible.current) {
|
|
96
85
|
updateSheetVisible.current = false;
|
|
97
86
|
f7Messagebar.current.sheetVisible = sheetVisible;
|
|
98
87
|
f7Messagebar.current.resizePage();
|
|
99
88
|
}
|
|
100
|
-
|
|
101
89
|
if (updateAttachmentsVisible.current) {
|
|
102
90
|
updateAttachmentsVisible.current = false;
|
|
103
91
|
f7Messagebar.current.attachmentsVisible = attachmentsVisible;
|
|
104
92
|
f7Messagebar.current.resizePage();
|
|
105
93
|
}
|
|
106
94
|
});
|
|
107
|
-
|
|
108
95
|
const onMount = () => {
|
|
109
96
|
if (!init) return;
|
|
110
97
|
if (!elRef.current) return;
|
|
@@ -125,12 +112,10 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
125
112
|
f7Messagebar.current = f7.messagebar.create(params);
|
|
126
113
|
});
|
|
127
114
|
};
|
|
128
|
-
|
|
129
115
|
const onDestroy = () => {
|
|
130
116
|
if (f7Messagebar.current && f7Messagebar.current.destroy) f7Messagebar.current.destroy();
|
|
131
117
|
f7Messagebar.current = null;
|
|
132
118
|
};
|
|
133
|
-
|
|
134
119
|
useIsomorphicLayoutEffect(() => {
|
|
135
120
|
onMount();
|
|
136
121
|
return onDestroy;
|
|
@@ -149,12 +134,10 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
149
134
|
const innerEndEls = [];
|
|
150
135
|
let messagebarAttachmentsEl;
|
|
151
136
|
let messagebarSheetEl;
|
|
152
|
-
|
|
153
137
|
if (slotsDefault) {
|
|
154
138
|
slotsDefault.forEach(child => {
|
|
155
139
|
if (typeof child === 'undefined') return;
|
|
156
140
|
const tag = child.type && (child.type.displayName || child.type.name);
|
|
157
|
-
|
|
158
141
|
if (tag && (tag.indexOf('messagebar-attachments') >= 0 || tag === 'F7MessagebarAttachments' || tag === 'f7-messagebar-attachments')) {
|
|
159
142
|
messagebarAttachmentsEl = child;
|
|
160
143
|
} else if (tag && (tag.indexOf('messagebar-sheet') >= 0 || tag === 'F7MessagebarSheet' || tag === 'f7-messagebar-sheet')) {
|
|
@@ -164,7 +147,6 @@ const Messagebar = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
164
147
|
}
|
|
165
148
|
});
|
|
166
149
|
}
|
|
167
|
-
|
|
168
150
|
const valueProps = {};
|
|
169
151
|
if ('value' in props) valueProps.value = value;
|
|
170
152
|
const classes = classNames(className, 'toolbar', 'messagebar', {
|
|
@@ -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 MessagesTitle = /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
className,
|