framework7-vue 7.0.9 → 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 -5
- package/components/accordion-item.js +0 -13
- package/components/accordion-toggle.js +2 -5
- package/components/accordion.js +0 -4
- package/components/actions-button.d.ts +1 -1
- package/components/actions-button.js +2 -9
- package/components/actions-group.js +2 -5
- package/components/actions-label.d.ts +1 -1
- package/components/actions-label.js +2 -8
- package/components/actions.js +2 -14
- package/components/app.d.ts +7 -12
- package/components/app.js +11 -24
- package/components/appbar.js +2 -5
- package/components/area-chart.js +4 -41
- package/components/badge.js +0 -4
- package/components/block-footer.js +2 -5
- package/components/block-header.js +2 -5
- package/components/block-title.js +0 -4
- package/components/block.d.ts +61 -9
- package/components/block.js +52 -17
- package/components/breadcrumbs-collapsed.js +0 -5
- package/components/breadcrumbs-item.js +0 -4
- package/components/breadcrumbs-separator.js +0 -4
- package/components/breadcrumbs.js +0 -4
- package/components/button.d.ts +9 -25
- package/components/button.js +9 -25
- package/components/card-content.js +0 -4
- package/components/card-footer.js +2 -5
- package/components/card-header.js +2 -5
- package/components/card.d.ts +17 -5
- package/components/card.js +10 -20
- package/components/checkbox.js +0 -7
- package/components/chip.d.ts +0 -4
- package/components/chip.js +0 -7
- package/components/col.js +3 -9
- package/components/fab-backdrop.js +2 -5
- package/components/fab-button.js +0 -6
- package/components/fab-buttons.js +0 -4
- package/components/fab.js +0 -9
- package/components/gauge.js +0 -4
- package/components/icon.d.ts +0 -4
- package/components/icon.js +1 -18
- package/components/input.js +0 -56
- package/components/link.d.ts +0 -4
- package/components/link.js +4 -13
- package/components/list-button.js +0 -6
- package/components/list-group.js +0 -4
- package/components/list-index.d.ts +0 -5
- package/components/list-index.js +0 -14
- package/components/list-input.d.ts +0 -4
- package/components/list-input.js +0 -53
- package/components/list-item-cell.js +3 -5
- package/components/list-item-row.js +3 -5
- package/components/list-item.d.ts +0 -4
- package/components/list-item.js +9 -52
- package/components/list.d.ts +71 -23
- package/components/list.js +42 -33
- package/components/login-screen-title.js +2 -5
- package/components/login-screen.js +2 -17
- package/components/menu-dropdown-item.js +1 -6
- package/components/menu-dropdown.js +1 -4
- package/components/menu-item.js +4 -18
- package/components/menu.js +3 -5
- package/components/message.js +0 -16
- package/components/messagebar-attachment.js +0 -7
- package/components/messagebar-attachments.js +2 -5
- package/components/messagebar-sheet-image.js +7 -15
- package/components/messagebar-sheet-item.js +2 -5
- package/components/messagebar-sheet.js +2 -5
- package/components/messagebar.js +0 -16
- package/components/messages-title.js +2 -5
- package/components/messages.js +0 -13
- package/components/nav-left.js +0 -9
- package/components/nav-right.js +0 -4
- package/components/nav-title-large.js +2 -5
- package/components/nav-title.js +0 -4
- package/components/navbar.d.ts +5 -8
- package/components/navbar.js +6 -29
- package/components/page-content.js +0 -16
- package/components/page.d.ts +0 -4
- package/components/page.js +2 -67
- package/components/panel.d.ts +4 -0
- package/components/panel.js +2 -23
- package/components/photo-browser.js +2 -18
- package/components/pie-chart.js +4 -20
- package/components/popover.d.ts +5 -0
- package/components/popover.js +8 -16
- package/components/popup.js +3 -19
- package/components/preloader.js +4 -23
- package/components/progressbar.js +0 -6
- package/components/radio.js +0 -7
- package/components/range.js +0 -7
- package/components/routable-modals.js +0 -7
- package/components/row.js +3 -9
- package/components/searchbar.d.ts +5 -8
- package/components/searchbar.js +7 -28
- package/components/segmented.d.ts +0 -12
- package/components/segmented.js +2 -12
- package/components/sheet.js +2 -18
- package/components/stepper.d.ts +0 -20
- package/components/stepper.js +1 -27
- package/components/subnavbar.js +0 -4
- package/components/swipeout-actions.js +0 -6
- package/components/swipeout-button.js +0 -6
- package/components/tab.js +2 -15
- package/components/tabs.js +0 -4
- package/components/text-editor.js +0 -17
- package/components/toggle.js +0 -9
- package/components/toolbar.d.ts +4 -21
- package/components/toolbar.js +12 -34
- package/components/treeview-item.d.ts +0 -4
- package/components/treeview-item.js +0 -13
- package/components/treeview.js +2 -5
- package/components/use-icon.js +0 -4
- package/components/view.d.ts +0 -28
- package/components/view.js +4 -50
- package/components/views.js +0 -4
- package/framework7-vue-bundle.js +3 -21
- package/framework7-vue-web-types.json +85 -644
- package/framework7-vue.d.ts +2 -12
- package/framework7-vue.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 +3 -15
- package/shared/plugin.js +2 -8
- package/shared/router-open-in.js +4 -13
- package/shared/use-icon.js +1 -6
- package/shared/use-smart-select.js +0 -1
- package/shared/use-store.js +2 -6
- package/shared/use-tab.js +0 -2
- package/shared/use-theme.js +0 -2
- package/shared/use-tooltip.js +0 -2
- package/shared/utils.js +0 -14
- package/components/appbar.d.ts +0 -67
- package/components/col.d.ts +0 -94
- package/components/list-item-cell.d.ts +0 -46
- package/components/list-item-row.d.ts +0 -46
- package/components/menu-dropdown-item.d.ts +0 -223
- package/components/menu-dropdown.d.ts +0 -66
- package/components/menu-item.d.ts +0 -267
- package/components/menu.d.ts +0 -46
- package/components/row.d.ts +0 -73
package/components/page.js
CHANGED
|
@@ -7,7 +7,6 @@ export default {
|
|
|
7
7
|
name: 'f7-page',
|
|
8
8
|
props: {
|
|
9
9
|
name: String,
|
|
10
|
-
stacked: Boolean,
|
|
11
10
|
withSubnavbar: {
|
|
12
11
|
type: Boolean,
|
|
13
12
|
default: undefined
|
|
@@ -56,7 +55,6 @@ export default {
|
|
|
56
55
|
...colorProps
|
|
57
56
|
},
|
|
58
57
|
emits: ['page:mounted', 'page:init', 'page:reinit', 'page:beforein', 'page:beforeout', 'page:afterout', 'page:afterin', 'page:beforeremove', 'page:beforeunmount', 'page:tabshow', 'page:tabhide', 'ptr:pullstart', 'ptr:pullmove', 'ptr:pullend', 'ptr:refresh', 'ptr:done', 'infinite'],
|
|
59
|
-
|
|
60
58
|
setup(props, _ref) {
|
|
61
59
|
let {
|
|
62
60
|
emit,
|
|
@@ -67,177 +65,132 @@ export default {
|
|
|
67
65
|
let hasNavbarLargeCollapsed = false;
|
|
68
66
|
let hasCardExpandableOpened = false;
|
|
69
67
|
let routerPositionClass = '';
|
|
70
|
-
let routerForceUnstack = false;
|
|
71
68
|
let routerPageRole = null;
|
|
72
69
|
let routerPageRoleDetailRoot = false;
|
|
73
70
|
let routerPageMasterStack = false;
|
|
74
|
-
const elRef = ref(null);
|
|
71
|
+
const elRef = ref(null);
|
|
75
72
|
|
|
73
|
+
// Main Page Events
|
|
76
74
|
const onPageMounted = page => {
|
|
77
75
|
if (elRef.value !== page.el) return;
|
|
78
76
|
emit('page:mounted', page);
|
|
79
77
|
};
|
|
80
|
-
|
|
81
78
|
const onPageInit = page => {
|
|
82
79
|
if (elRef.value !== page.el) return;
|
|
83
|
-
|
|
84
80
|
if (typeof props.withSubnavbar === 'undefined' && typeof props.subnavbar === 'undefined') {
|
|
85
81
|
if (page.$navbarEl && page.$navbarEl.length && page.$navbarEl.find('.subnavbar').length || page.$el.children('.navbar').find('.subnavbar').length) {
|
|
86
82
|
hasSubnavbar = true;
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
|
-
|
|
90
85
|
if (typeof props.withNavbarLarge === 'undefined' && typeof props.navbarLarge === 'undefined') {
|
|
91
86
|
if (page.$navbarEl && page.$navbarEl.hasClass('navbar-large')) {
|
|
92
87
|
hasNavbarLarge = true;
|
|
93
88
|
}
|
|
94
89
|
}
|
|
95
|
-
|
|
96
90
|
emit('page:init', page);
|
|
97
91
|
};
|
|
98
|
-
|
|
99
92
|
const onPageReinit = page => {
|
|
100
93
|
if (elRef.value !== page.el) return;
|
|
101
94
|
emit('page:reinit', page);
|
|
102
95
|
};
|
|
103
|
-
|
|
104
96
|
const onPageBeforeIn = page => {
|
|
105
97
|
if (elRef.value !== page.el) return;
|
|
106
|
-
|
|
107
98
|
if (!page.swipeBack) {
|
|
108
99
|
if (page.from === 'next') {
|
|
109
100
|
routerPositionClass = 'page-next';
|
|
110
101
|
}
|
|
111
|
-
|
|
112
102
|
if (page.from === 'previous') {
|
|
113
103
|
routerPositionClass = 'page-previous';
|
|
114
104
|
}
|
|
115
105
|
}
|
|
116
|
-
|
|
117
106
|
emit('page:beforein', page);
|
|
118
107
|
};
|
|
119
|
-
|
|
120
108
|
const onPageBeforeOut = page => {
|
|
121
109
|
if (elRef.value !== page.el) return;
|
|
122
110
|
emit('page:beforeout', page);
|
|
123
111
|
};
|
|
124
|
-
|
|
125
112
|
const onPageAfterOut = page => {
|
|
126
113
|
if (elRef.value !== page.el) return;
|
|
127
|
-
|
|
128
114
|
if (page.to === 'next') {
|
|
129
115
|
routerPositionClass = 'page-next';
|
|
130
116
|
}
|
|
131
|
-
|
|
132
117
|
if (page.to === 'previous') {
|
|
133
118
|
routerPositionClass = 'page-previous';
|
|
134
119
|
}
|
|
135
|
-
|
|
136
120
|
emit('page:afterout', page);
|
|
137
121
|
};
|
|
138
|
-
|
|
139
122
|
const onPageAfterIn = page => {
|
|
140
123
|
if (elRef.value !== page.el) return;
|
|
141
124
|
routerPositionClass = 'page-current';
|
|
142
125
|
emit('page:afterin', page);
|
|
143
126
|
};
|
|
144
|
-
|
|
145
127
|
const onPageBeforeRemove = page => {
|
|
146
128
|
if (elRef.value !== page.el) return;
|
|
147
129
|
emit('page:beforeremove', page);
|
|
148
130
|
};
|
|
149
|
-
|
|
150
131
|
const onPageBeforeUnmount = page => {
|
|
151
132
|
if (elRef.value !== page.el) return;
|
|
152
133
|
emit('page:beforeunmount', page);
|
|
153
|
-
}; // Helper events
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const onPageStack = pageEl => {
|
|
157
|
-
if (elRef.value !== pageEl) return;
|
|
158
|
-
routerForceUnstack = false;
|
|
159
134
|
};
|
|
160
|
-
|
|
161
|
-
const onPageUnstack = pageEl => {
|
|
162
|
-
if (elRef.value !== pageEl) return;
|
|
163
|
-
routerForceUnstack = true;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
135
|
const onPagePosition = (pageEl, position) => {
|
|
167
136
|
if (elRef.value !== pageEl) return;
|
|
168
137
|
routerPositionClass = `page-${position}`;
|
|
169
138
|
};
|
|
170
|
-
|
|
171
139
|
const onPageRole = (pageEl, rolesData) => {
|
|
172
140
|
if (elRef.value !== pageEl) return;
|
|
173
141
|
routerPageRole = rolesData.role;
|
|
174
142
|
routerPageRoleDetailRoot = rolesData.detailRoot;
|
|
175
143
|
};
|
|
176
|
-
|
|
177
144
|
const onPageMasterStack = pageEl => {
|
|
178
145
|
if (elRef.value !== pageEl) return;
|
|
179
146
|
routerPageMasterStack = true;
|
|
180
147
|
};
|
|
181
|
-
|
|
182
148
|
const onPageMasterUnstack = pageEl => {
|
|
183
149
|
if (elRef.value !== pageEl) return;
|
|
184
150
|
routerPageMasterStack = false;
|
|
185
151
|
};
|
|
186
|
-
|
|
187
152
|
const onPageNavbarLargeCollapsed = pageEl => {
|
|
188
153
|
if (elRef.value !== pageEl) return;
|
|
189
154
|
hasNavbarLargeCollapsed = true;
|
|
190
155
|
};
|
|
191
|
-
|
|
192
156
|
const onPageNavbarLargeExpanded = pageEl => {
|
|
193
157
|
if (elRef.value !== pageEl) return;
|
|
194
158
|
hasNavbarLargeCollapsed = false;
|
|
195
159
|
};
|
|
196
|
-
|
|
197
160
|
const onCardOpened = (cardEl, pageEl) => {
|
|
198
161
|
if (elRef.value !== pageEl) return;
|
|
199
162
|
hasCardExpandableOpened = true;
|
|
200
163
|
};
|
|
201
|
-
|
|
202
164
|
const onCardClose = (cardEl, pageEl) => {
|
|
203
165
|
if (elRef.value !== pageEl) return;
|
|
204
166
|
hasCardExpandableOpened = false;
|
|
205
167
|
};
|
|
206
|
-
|
|
207
168
|
const onPageTabShow = pageEl => {
|
|
208
169
|
if (elRef.value !== pageEl) return;
|
|
209
170
|
emit('page:tabshow');
|
|
210
171
|
};
|
|
211
|
-
|
|
212
172
|
const onPageTabHide = pageEl => {
|
|
213
173
|
if (elRef.value !== pageEl) return;
|
|
214
174
|
emit('page:tabhide');
|
|
215
175
|
};
|
|
216
|
-
|
|
217
176
|
const onPtrPullStart = () => {
|
|
218
177
|
emit('ptr:pullstart');
|
|
219
178
|
};
|
|
220
|
-
|
|
221
179
|
const onPtrPullMove = () => {
|
|
222
180
|
emit('ptr:pullmove');
|
|
223
181
|
};
|
|
224
|
-
|
|
225
182
|
const onPtrPullEnd = () => {
|
|
226
183
|
emit('ptr:pullend');
|
|
227
184
|
};
|
|
228
|
-
|
|
229
185
|
const onPtrRefresh = done => {
|
|
230
186
|
emit('ptr:refresh', done);
|
|
231
187
|
};
|
|
232
|
-
|
|
233
188
|
const onPtrDone = () => {
|
|
234
189
|
emit('ptr:done');
|
|
235
190
|
};
|
|
236
|
-
|
|
237
191
|
const onInfinite = () => {
|
|
238
192
|
emit('infinite');
|
|
239
193
|
};
|
|
240
|
-
|
|
241
194
|
onMounted(() => {
|
|
242
195
|
f7ready(() => {
|
|
243
196
|
f7.on('pageMounted', onPageMounted);
|
|
@@ -249,8 +202,6 @@ export default {
|
|
|
249
202
|
f7.on('pageAfterIn', onPageAfterIn);
|
|
250
203
|
f7.on('pageBeforeRemove', onPageBeforeRemove);
|
|
251
204
|
f7.on('pageBeforeUnmount', onPageBeforeUnmount);
|
|
252
|
-
f7.on('pageStack', onPageStack);
|
|
253
|
-
f7.on('pageUnstack', onPageUnstack);
|
|
254
205
|
f7.on('pagePosition', onPagePosition);
|
|
255
206
|
f7.on('pageRole', onPageRole);
|
|
256
207
|
f7.on('pageMasterStack', onPageMasterStack);
|
|
@@ -274,8 +225,6 @@ export default {
|
|
|
274
225
|
f7.off('pageAfterIn', onPageAfterIn);
|
|
275
226
|
f7.off('pageBeforeRemove', onPageBeforeRemove);
|
|
276
227
|
f7.off('pageBeforeUnmount', onPageBeforeUnmount);
|
|
277
|
-
f7.off('pageStack', onPageStack);
|
|
278
|
-
f7.off('pageUnstack', onPageUnstack);
|
|
279
228
|
f7.off('pagePosition', onPagePosition);
|
|
280
229
|
f7.off('pageRole', onPageRole);
|
|
281
230
|
f7.off('pageMasterStack', onPageMasterStack);
|
|
@@ -288,7 +237,6 @@ export default {
|
|
|
288
237
|
f7.off('pageTabHide', onPageTabHide);
|
|
289
238
|
});
|
|
290
239
|
const classes = computed(() => classNames('page', routerPositionClass, {
|
|
291
|
-
stacked: props.stacked && !routerForceUnstack,
|
|
292
240
|
tabs: props.tabs,
|
|
293
241
|
'page-with-subnavbar': props.subnavbar || props.withSubnavbar,
|
|
294
242
|
'page-with-navbar-large': props.navbarLarge || props.withNavbarLarge,
|
|
@@ -316,46 +264,35 @@ export default {
|
|
|
316
264
|
let hasNavbarLargeComputed = false;
|
|
317
265
|
let hasMessages = props.messagesContent;
|
|
318
266
|
const slotsDefaultRendered = slotsDefault && slotsDefault();
|
|
319
|
-
|
|
320
267
|
if (slotsDefaultRendered) {
|
|
321
268
|
slotsDefaultRendered.forEach(vnode => {
|
|
322
269
|
if (typeof vnode === 'undefined') return;
|
|
323
270
|
const tag = vnode.type && vnode.type.name ? vnode.type.name : vnode.type;
|
|
324
271
|
let isFixedTag = false;
|
|
325
|
-
|
|
326
272
|
if (!tag) {
|
|
327
273
|
if (props.pageContent || props.pageContent === '') staticList.push(vnode);
|
|
328
274
|
return;
|
|
329
275
|
}
|
|
330
|
-
|
|
331
276
|
if (tag === 'f7-subnavbar') hasSubnavbarComputed = true;
|
|
332
|
-
|
|
333
277
|
if (tag === 'f7-navbar') {
|
|
334
278
|
if (vnode.props && (vnode.props.large || vnode.props.large === '')) hasNavbarLargeComputed = true;
|
|
335
279
|
}
|
|
336
|
-
|
|
337
280
|
if (typeof hasMessages === 'undefined' && tag === 'f7-messages') hasMessages = true;
|
|
338
|
-
|
|
339
281
|
if (fixedTags.indexOf(tag) >= 0) {
|
|
340
282
|
isFixedTag = true;
|
|
341
283
|
}
|
|
342
|
-
|
|
343
284
|
if (props.pageContent) {
|
|
344
285
|
if (isFixedTag) fixedList.push(vnode);else staticList.push(vnode);
|
|
345
286
|
}
|
|
346
287
|
});
|
|
347
288
|
}
|
|
348
|
-
|
|
349
289
|
let classesValue = classes.value;
|
|
350
|
-
|
|
351
290
|
if ((hasSubnavbarComputed || hasSubnavbar) && typeof props.subnavbar === 'undefined' && typeof props.withSubnavbar === 'undefined' && classesValue.indexOf('page-with-subnavbar') < 0) {
|
|
352
291
|
classesValue += ' page-with-subnavbar';
|
|
353
292
|
}
|
|
354
|
-
|
|
355
293
|
if ((hasNavbarLargeComputed || hasNavbarLarge) && typeof props.navbarLarge === 'undefined' && typeof props.withNavbarLarge === 'undefined' && classesValue.indexOf('page-with-navbar-large') < 0) {
|
|
356
294
|
classesValue += ' page-with-navbar-large';
|
|
357
295
|
}
|
|
358
|
-
|
|
359
296
|
if (!props.pageContent) {
|
|
360
297
|
return h('div', {
|
|
361
298
|
class: classesValue,
|
|
@@ -363,7 +300,6 @@ export default {
|
|
|
363
300
|
'data-name': props.name
|
|
364
301
|
}, [slotsFixed && slotsFixed(), slotsStatic && slotsStatic(), slotsDefault && slotsDefaultRendered]);
|
|
365
302
|
}
|
|
366
|
-
|
|
367
303
|
return h('div', {
|
|
368
304
|
class: classesValue,
|
|
369
305
|
ref: elRef,
|
|
@@ -392,5 +328,4 @@ export default {
|
|
|
392
328
|
}, () => [slotsStatic && slotsStatic(), staticList])]);
|
|
393
329
|
};
|
|
394
330
|
}
|
|
395
|
-
|
|
396
331
|
};
|
package/components/panel.d.ts
CHANGED
package/components/panel.js
CHANGED
|
@@ -3,14 +3,12 @@ const _hoisted_1 = {
|
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "panel-resize-handler"
|
|
5
5
|
};
|
|
6
|
-
|
|
7
6
|
function render(_ctx, _cache) {
|
|
8
7
|
return _openBlock(), _createElementBlock("div", {
|
|
9
8
|
ref: "elRef",
|
|
10
9
|
class: _normalizeClass(_ctx.classes)
|
|
11
10
|
}, [_renderSlot(_ctx.$slots, "default"), _ctx.resizable ? (_openBlock(), _createElementBlock("div", _hoisted_1)) : _createCommentVNode("", true)], 2);
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
import { computed, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
15
13
|
import { classNames, noUndefinedProps } from '../shared/utils.js';
|
|
16
14
|
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
@@ -24,6 +22,7 @@ export default {
|
|
|
24
22
|
cover: Boolean,
|
|
25
23
|
reveal: Boolean,
|
|
26
24
|
push: Boolean,
|
|
25
|
+
floating: Boolean,
|
|
27
26
|
left: Boolean,
|
|
28
27
|
right: Boolean,
|
|
29
28
|
opened: Boolean,
|
|
@@ -66,7 +65,6 @@ export default {
|
|
|
66
65
|
...colorProps
|
|
67
66
|
},
|
|
68
67
|
emits: ['panel:open', 'panel:opened', 'panel:close', 'panel:closed', 'click', 'panel:backdropclick', 'panel:swipe', 'panel:swipeopen', 'panel:breakpoint', 'panel:collapsedbreakpoint', 'panel:resize', 'update:opened'],
|
|
69
|
-
|
|
70
68
|
setup(props, _ref) {
|
|
71
69
|
let {
|
|
72
70
|
emit
|
|
@@ -77,70 +75,57 @@ export default {
|
|
|
77
75
|
let isClosing = false;
|
|
78
76
|
let isCollapsed = false;
|
|
79
77
|
let isBreakpoint = false;
|
|
80
|
-
|
|
81
78
|
const onOpen = event => {
|
|
82
79
|
isOpened = true;
|
|
83
80
|
isClosing = false;
|
|
84
81
|
emit('panel:open', event);
|
|
85
82
|
emit('update:opened', true);
|
|
86
83
|
};
|
|
87
|
-
|
|
88
84
|
const onOpened = event => {
|
|
89
85
|
emit('panel:opened', event);
|
|
90
86
|
};
|
|
91
|
-
|
|
92
87
|
const onClose = event => {
|
|
93
88
|
isOpened = false;
|
|
94
89
|
isClosing = true;
|
|
95
90
|
emit('panel:close', event);
|
|
96
91
|
};
|
|
97
|
-
|
|
98
92
|
const onClosed = event => {
|
|
99
93
|
isClosing = false;
|
|
100
94
|
emit('panel:closed', event);
|
|
101
95
|
emit('update:opened', false);
|
|
102
96
|
};
|
|
103
|
-
|
|
104
97
|
const onBackdropClick = event => {
|
|
105
98
|
emit('click', event);
|
|
106
99
|
emit('panel:backdropclick', event);
|
|
107
100
|
};
|
|
108
|
-
|
|
109
101
|
const onSwipe = event => {
|
|
110
102
|
emit('panel:swipe', event);
|
|
111
103
|
};
|
|
112
|
-
|
|
113
104
|
const onSwipeOpen = event => {
|
|
114
105
|
emit('panel:swipeopen', event);
|
|
115
106
|
};
|
|
116
|
-
|
|
117
107
|
const onBreakpoint = event => {
|
|
118
108
|
isBreakpoint = true;
|
|
119
109
|
isCollapsed = false;
|
|
120
110
|
emit('panel:breakpoint', event);
|
|
121
111
|
};
|
|
122
|
-
|
|
123
112
|
const onCollapsedBreakpoint = event => {
|
|
124
113
|
isBreakpoint = false;
|
|
125
114
|
isCollapsed = true;
|
|
126
115
|
emit('panel:collapsedbreakpoint', event);
|
|
127
116
|
};
|
|
128
|
-
|
|
129
117
|
const onResize = function () {
|
|
130
118
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
131
119
|
args[_key] = arguments[_key];
|
|
132
120
|
}
|
|
133
|
-
|
|
134
121
|
emit('panel:resize', ...args);
|
|
135
122
|
};
|
|
136
|
-
|
|
137
123
|
watch(() => props.resizable, newValue => {
|
|
138
124
|
if (!f7Panel) return;
|
|
139
125
|
if (newValue) f7Panel.enableResizable();else f7Panel.disableResizable();
|
|
140
126
|
});
|
|
141
127
|
watch(() => props.opened, newValue => {
|
|
142
128
|
if (!f7Panel) return;
|
|
143
|
-
|
|
144
129
|
if (newValue) {
|
|
145
130
|
f7Panel.open();
|
|
146
131
|
} else {
|
|
@@ -151,11 +136,9 @@ export default {
|
|
|
151
136
|
f7ready(() => {
|
|
152
137
|
const $ = f7.$;
|
|
153
138
|
if (!$) return;
|
|
154
|
-
|
|
155
139
|
if ($('.panel-backdrop').length === 0) {
|
|
156
140
|
$('<div class="panel-backdrop"></div>').insertBefore(elRef.value);
|
|
157
141
|
}
|
|
158
|
-
|
|
159
142
|
const params = noUndefinedProps({
|
|
160
143
|
el: elRef.value,
|
|
161
144
|
resizable: props.resizable,
|
|
@@ -184,7 +167,6 @@ export default {
|
|
|
184
167
|
}
|
|
185
168
|
});
|
|
186
169
|
f7Panel = f7.panel.create(params);
|
|
187
|
-
|
|
188
170
|
if (props.opened) {
|
|
189
171
|
f7Panel.open(false);
|
|
190
172
|
}
|
|
@@ -194,13 +176,11 @@ export default {
|
|
|
194
176
|
if (f7Panel && f7Panel.destroy) {
|
|
195
177
|
f7Panel.destroy();
|
|
196
178
|
}
|
|
197
|
-
|
|
198
179
|
f7Panel = null;
|
|
199
180
|
});
|
|
200
181
|
const classes = computed(() => {
|
|
201
182
|
const sideComputed = props.side || (props.left ? 'left' : 'right');
|
|
202
|
-
const effectComputed = props.effect || (props.reveal ? 'reveal' : props.push ? 'push' : 'cover'); // eslint-disable-line
|
|
203
|
-
|
|
183
|
+
const effectComputed = props.effect || (props.reveal ? 'reveal' : props.push ? 'push' : props.floating ? 'floating' : 'cover'); // eslint-disable-line
|
|
204
184
|
return classNames('panel', {
|
|
205
185
|
'panel-in': isOpened && !isClosing && !isBreakpoint,
|
|
206
186
|
'panel-in-breakpoint': isBreakpoint,
|
|
@@ -215,5 +195,4 @@ export default {
|
|
|
215
195
|
classes
|
|
216
196
|
};
|
|
217
197
|
}
|
|
218
|
-
|
|
219
198
|
};
|
|
@@ -84,38 +84,30 @@ export default {
|
|
|
84
84
|
renderStandalone: Function
|
|
85
85
|
},
|
|
86
86
|
emits: ['photobrowser:open', 'photobrowser:close', 'photobrowser:opened', 'photobrowser:closed', 'photobrowser:swipetoclose'],
|
|
87
|
-
|
|
88
87
|
setup(props, _ref) {
|
|
89
88
|
let {
|
|
90
89
|
emit
|
|
91
90
|
} = _ref;
|
|
92
91
|
let f7PhotoBrowser = null;
|
|
93
|
-
|
|
94
92
|
const open = index => {
|
|
95
93
|
return f7PhotoBrowser.open(index);
|
|
96
94
|
};
|
|
97
|
-
|
|
98
95
|
const close = () => {
|
|
99
96
|
return f7PhotoBrowser.close();
|
|
100
97
|
};
|
|
101
|
-
|
|
102
98
|
const expositionToggle = () => {
|
|
103
99
|
return f7PhotoBrowser.expositionToggle();
|
|
104
100
|
};
|
|
105
|
-
|
|
106
101
|
const expositionEnable = () => {
|
|
107
102
|
return f7PhotoBrowser.expositionEnable();
|
|
108
103
|
};
|
|
109
|
-
|
|
110
104
|
const expositionDisable = () => {
|
|
111
105
|
return f7PhotoBrowser.expositionDisable();
|
|
112
106
|
};
|
|
113
|
-
|
|
114
107
|
watch(() => props.photos, value => {
|
|
115
108
|
const pb = f7PhotoBrowser;
|
|
116
109
|
if (!pb) return;
|
|
117
110
|
pb.params.photos = value;
|
|
118
|
-
|
|
119
111
|
if (pb.opened && pb.swiper) {
|
|
120
112
|
pb.swiper.update();
|
|
121
113
|
}
|
|
@@ -124,15 +116,14 @@ export default {
|
|
|
124
116
|
if (!props.init) return;
|
|
125
117
|
f7ready(() => {
|
|
126
118
|
let paramsComputed;
|
|
127
|
-
|
|
128
119
|
if (typeof props.params !== 'undefined') {
|
|
129
120
|
paramsComputed = props.params;
|
|
130
121
|
} else {
|
|
131
|
-
paramsComputed = {
|
|
122
|
+
paramsComputed = {
|
|
123
|
+
...props
|
|
132
124
|
};
|
|
133
125
|
delete paramsComputed.params;
|
|
134
126
|
}
|
|
135
|
-
|
|
136
127
|
Object.keys(paramsComputed).forEach(param => {
|
|
137
128
|
if (typeof paramsComputed[param] === 'undefined' || paramsComputed[param] === '') delete paramsComputed[param];
|
|
138
129
|
});
|
|
@@ -141,23 +132,18 @@ export default {
|
|
|
141
132
|
open() {
|
|
142
133
|
emit('photobrowser:open');
|
|
143
134
|
},
|
|
144
|
-
|
|
145
135
|
close() {
|
|
146
136
|
emit('photobrowser:close');
|
|
147
137
|
},
|
|
148
|
-
|
|
149
138
|
opened() {
|
|
150
139
|
emit('photobrowser:opened');
|
|
151
140
|
},
|
|
152
|
-
|
|
153
141
|
closed() {
|
|
154
142
|
emit('photobrowser:closed');
|
|
155
143
|
},
|
|
156
|
-
|
|
157
144
|
swipeToClose() {
|
|
158
145
|
emit('photobrowser:swipetoclose');
|
|
159
146
|
}
|
|
160
|
-
|
|
161
147
|
}
|
|
162
148
|
});
|
|
163
149
|
f7PhotoBrowser = f7.photoBrowser.create(paramsComputed);
|
|
@@ -175,9 +161,7 @@ export default {
|
|
|
175
161
|
expositionDisable
|
|
176
162
|
};
|
|
177
163
|
},
|
|
178
|
-
|
|
179
164
|
render() {
|
|
180
165
|
return null;
|
|
181
166
|
}
|
|
182
|
-
|
|
183
167
|
};
|
package/components/pie-chart.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, renderSlot as _renderSlot } from "vue";
|
|
2
2
|
const _hoisted_1 = ["width", "height", "viewBox"];
|
|
3
3
|
const _hoisted_2 = ["d", "fill", "data-index", "onClick", "onMouseenter"];
|
|
4
|
-
|
|
5
4
|
function render(_ctx, _cache) {
|
|
6
5
|
return _openBlock(), _createElementBlock("div", {
|
|
7
6
|
ref: "elRef",
|
|
@@ -29,7 +28,6 @@ function render(_ctx, _cache) {
|
|
|
29
28
|
}, null, 42, _hoisted_2);
|
|
30
29
|
}), 128))], 12, _hoisted_1)), _renderSlot(_ctx.$slots, "default")], 2);
|
|
31
30
|
}
|
|
32
|
-
|
|
33
31
|
import { computed, onBeforeUnmount, ref, watch } from 'vue';
|
|
34
32
|
import { classNames } from '../shared/utils.js';
|
|
35
33
|
import { f7 } from '../shared/f7.js';
|
|
@@ -49,7 +47,6 @@ export default {
|
|
|
49
47
|
formatTooltip: Function
|
|
50
48
|
},
|
|
51
49
|
emits: ['select'],
|
|
52
|
-
|
|
53
50
|
setup(props, _ref) {
|
|
54
51
|
let {
|
|
55
52
|
emit
|
|
@@ -57,11 +54,9 @@ export default {
|
|
|
57
54
|
const elRef = ref(null);
|
|
58
55
|
let f7Tooltip = null;
|
|
59
56
|
const currentIndex = ref(null);
|
|
60
|
-
|
|
61
57
|
const setCurrentIndex = index => {
|
|
62
58
|
currentIndex.value = index;
|
|
63
59
|
};
|
|
64
|
-
|
|
65
60
|
const summValue = computed(() => {
|
|
66
61
|
let summ = 0;
|
|
67
62
|
props.datasets.map(d => d.value || 0).forEach(value => {
|
|
@@ -72,13 +67,11 @@ export default {
|
|
|
72
67
|
const paths = computed(() => {
|
|
73
68
|
const p = [];
|
|
74
69
|
let cumulativePercentage = 0;
|
|
75
|
-
|
|
76
70
|
function getCoordinatesForPercentage(percentage) {
|
|
77
71
|
const x = Math.cos(2 * Math.PI * percentage) * (props.size / 3);
|
|
78
72
|
const y = Math.sin(2 * Math.PI * percentage) * (props.size / 3);
|
|
79
73
|
return [x, y];
|
|
80
74
|
}
|
|
81
|
-
|
|
82
75
|
props.datasets.forEach(_ref2 => {
|
|
83
76
|
let {
|
|
84
77
|
value,
|
|
@@ -90,8 +83,10 @@ export default {
|
|
|
90
83
|
cumulativePercentage += percentage;
|
|
91
84
|
const [endX, endY] = getCoordinatesForPercentage(cumulativePercentage);
|
|
92
85
|
const largeArcFlag = percentage > 0.5 ? 1 : 0;
|
|
93
|
-
const points = [`M ${startX} ${startY}`,
|
|
94
|
-
|
|
86
|
+
const points = [`M ${startX} ${startY}`,
|
|
87
|
+
// Move
|
|
88
|
+
`A ${props.size / 3} ${props.size / 3} 0 ${largeArcFlag} 1 ${endX} ${endY}`,
|
|
89
|
+
// Arc
|
|
95
90
|
'L 0 0' // Line
|
|
96
91
|
].join(' ');
|
|
97
92
|
p.push({
|
|
@@ -102,7 +97,6 @@ export default {
|
|
|
102
97
|
});
|
|
103
98
|
return p;
|
|
104
99
|
});
|
|
105
|
-
|
|
106
100
|
const formatTooltipText = () => {
|
|
107
101
|
if (currentIndex.value === null) return '';
|
|
108
102
|
const {
|
|
@@ -111,12 +105,10 @@ export default {
|
|
|
111
105
|
color
|
|
112
106
|
} = props.datasets[currentIndex.value];
|
|
113
107
|
const percentage = value / summValue.value * 100;
|
|
114
|
-
|
|
115
108
|
const round = v => {
|
|
116
109
|
if (parseInt(v, 10) === v) return v;
|
|
117
110
|
return Math.round(v * 100) / 100;
|
|
118
111
|
};
|
|
119
|
-
|
|
120
112
|
if (props.formatTooltip) {
|
|
121
113
|
return props.formatTooltip({
|
|
122
114
|
index: currentIndex.value,
|
|
@@ -126,7 +118,6 @@ export default {
|
|
|
126
118
|
percentage
|
|
127
119
|
});
|
|
128
120
|
}
|
|
129
|
-
|
|
130
121
|
const tooltipText = `${label ? `${label}: ` : ''}${round(value)} (${round(percentage)}%)`;
|
|
131
122
|
return `
|
|
132
123
|
<div class="pie-chart-tooltip-label">
|
|
@@ -134,12 +125,10 @@ export default {
|
|
|
134
125
|
</div>
|
|
135
126
|
`;
|
|
136
127
|
};
|
|
137
|
-
|
|
138
128
|
const setTooltip = () => {
|
|
139
129
|
const index = currentIndex.value;
|
|
140
130
|
if (index === null && !f7Tooltip) return;
|
|
141
131
|
if (!props.tooltip || !elRef.value || !f7) return;
|
|
142
|
-
|
|
143
132
|
if (index !== null && !f7Tooltip) {
|
|
144
133
|
f7Tooltip = f7.tooltip.create({
|
|
145
134
|
trigger: 'manual',
|
|
@@ -151,9 +140,7 @@ export default {
|
|
|
151
140
|
f7Tooltip.show();
|
|
152
141
|
return;
|
|
153
142
|
}
|
|
154
|
-
|
|
155
143
|
if (!f7Tooltip) return;
|
|
156
|
-
|
|
157
144
|
if (index !== null) {
|
|
158
145
|
f7Tooltip.setText(formatTooltipText());
|
|
159
146
|
f7Tooltip.setTargetEl(elRef.value.querySelector(`path[data-index="${index}"]`));
|
|
@@ -162,7 +149,6 @@ export default {
|
|
|
162
149
|
f7Tooltip.hide();
|
|
163
150
|
}
|
|
164
151
|
};
|
|
165
|
-
|
|
166
152
|
watch(() => currentIndex.value, () => {
|
|
167
153
|
emit('select', currentIndex.value, props.datasets[currentIndex.value]);
|
|
168
154
|
setTooltip();
|
|
@@ -171,7 +157,6 @@ export default {
|
|
|
171
157
|
if (f7Tooltip && f7Tooltip.destroy) {
|
|
172
158
|
f7Tooltip.destroy();
|
|
173
159
|
}
|
|
174
|
-
|
|
175
160
|
f7Tooltip = null;
|
|
176
161
|
});
|
|
177
162
|
const classes = computed(() => classNames('pie-chart'));
|
|
@@ -184,5 +169,4 @@ export default {
|
|
|
184
169
|
setCurrentIndex
|
|
185
170
|
};
|
|
186
171
|
}
|
|
187
|
-
|
|
188
172
|
};
|