framework7 8.3.4 → 9.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/actions/actions-ios.less +22 -15
- package/components/actions/actions-rtl.css +1 -1
- package/components/actions/actions-vars.less +4 -7
- package/components/actions/actions.css +1 -1
- package/components/actions/actions.js +2 -8
- package/components/actions/actions.less +0 -3
- package/components/app/app-class.d.ts +2 -0
- package/components/app/app-class.js +19 -15
- package/components/app/app-vars.less +41 -6
- package/components/app/app.less +1 -1
- package/components/area-chart/area-chart-class.js +18 -31
- package/components/area-chart/area-chart-rtl.css +1 -1
- package/components/area-chart/area-chart.css +1 -1
- package/components/autocomplete/autocomplete-class.js +13 -14
- package/components/autocomplete/autocomplete-ios.less +16 -0
- package/components/autocomplete/autocomplete-rtl.css +1 -1
- package/components/autocomplete/autocomplete.css +1 -1
- package/components/autocomplete/autocomplete.d.ts +3 -3
- package/components/autocomplete/autocomplete.js +3 -3
- package/components/autocomplete/autocomplete.less +7 -1
- package/components/block/block-vars.less +6 -6
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -1
- package/components/breadcrumbs/breadcrumbs.css +1 -1
- package/components/button/button-vars.less +13 -12
- package/components/button/button.less +2 -1
- package/components/calendar/calendar-class.js +20 -17
- package/components/calendar/calendar-ios.less +43 -0
- package/components/calendar/calendar-md.less +3 -0
- package/components/calendar/calendar-rtl.css +1 -1
- package/components/calendar/calendar-vars.less +24 -19
- package/components/calendar/calendar.css +1 -1
- package/components/calendar/calendar.d.ts +1 -1
- package/components/calendar/calendar.js +5 -8
- package/components/calendar/calendar.less +4 -2
- package/components/card/card-rtl.css +1 -1
- package/components/card/card-vars.less +5 -5
- package/components/card/card.css +1 -1
- package/components/card/card.js +3 -18
- package/components/card/card.less +1 -1
- package/components/color-picker/color-picker-class.js +11 -23
- package/components/color-picker/color-picker-ios.less +9 -0
- package/components/color-picker/color-picker-md.less +15 -0
- package/components/color-picker/color-picker-rtl.css +1 -1
- package/components/color-picker/color-picker-vars.less +9 -3
- package/components/color-picker/color-picker.css +1 -1
- package/components/color-picker/color-picker.d.ts +1 -2
- package/components/color-picker/color-picker.js +3 -7
- package/components/color-picker/color-picker.less +5 -25
- package/components/color-picker/modules/alpha-slider.js +2 -0
- package/components/color-picker/modules/brightness-slider.js +2 -0
- package/components/color-picker/modules/hs-spectrum.js +1 -2
- package/components/color-picker/modules/hsb-sliders.js +6 -0
- package/components/color-picker/modules/hue-slider.js +2 -0
- package/components/color-picker/modules/rgb-bars.js +6 -0
- package/components/color-picker/modules/rgb-sliders.js +6 -0
- package/components/color-picker/modules/sb-spectrum.js +1 -2
- package/components/color-picker/modules/wheel.js +1 -2
- package/components/data-table/data-table-class.js +1 -4
- package/components/data-table/data-table-ios.less +1 -1
- package/components/data-table/data-table-md.less +4 -2
- package/components/data-table/data-table-rtl.css +1 -1
- package/components/data-table/data-table.css +1 -1
- package/components/data-table/data-table.less +4 -4
- package/components/dialog/dialog-class.js +6 -3
- package/components/dialog/dialog-ios.less +10 -34
- package/components/dialog/dialog-md.less +2 -22
- package/components/dialog/dialog-rtl.css +1 -1
- package/components/dialog/dialog-vars.less +8 -10
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.js +9 -27
- package/components/dialog/dialog.less +6 -25
- package/components/fab/fab-ios.less +2 -0
- package/components/fab/fab-rtl.css +1 -1
- package/components/fab/fab-vars.less +30 -6
- package/components/fab/fab.css +1 -1
- package/components/fab/fab.js +3 -12
- package/components/gauge/gauge-class.js +2 -8
- package/components/icon/icon-ios.less +10 -0
- package/components/icon/icon-md.less +9 -0
- package/components/icon/icon.less +2 -1
- package/components/input/input-ios.less +3 -2
- package/components/input/input-rtl.css +1 -1
- package/components/input/input.css +1 -1
- package/components/input/input.js +2 -5
- package/components/list/list-vars.less +7 -5
- package/components/list/list.less +1 -1
- package/components/list-index/list-index-class.js +3 -7
- package/components/login-screen/login-screen.js +2 -8
- package/components/login-screen/login-screen.less +1 -0
- package/components/messagebar/messagebar-class.js +5 -20
- package/components/messagebar/messagebar-ios.less +19 -14
- package/components/messagebar/messagebar-md.less +3 -0
- package/components/messagebar/messagebar-rtl.css +1 -1
- package/components/messagebar/messagebar-vars.less +12 -15
- package/components/messagebar/messagebar.css +1 -1
- package/components/messagebar/messagebar.less +4 -5
- package/components/messages/messages-class.js +25 -52
- package/components/messages/messages-ios.less +6 -2
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages-vars.less +1 -1
- package/components/messages/messages.css +1 -1
- package/components/navbar/navbar-ios.less +48 -672
- package/components/navbar/navbar-md.less +41 -1
- package/components/navbar/navbar-vars.less +4 -3
- package/components/navbar/navbar.js +28 -185
- package/components/navbar/navbar.less +8 -66
- package/components/notification/notification-class.js +6 -6
- package/components/notification/notification-ios.less +3 -8
- package/components/notification/notification-md.less +1 -20
- package/components/notification/notification-rtl.css +1 -1
- package/components/notification/notification-vars.less +13 -16
- package/components/notification/notification.css +1 -1
- package/components/notification/notification.less +8 -1
- package/components/page/page-ios.less +1 -8
- package/components/page/page-md.less +12 -11
- package/components/page/page.less +14 -12
- package/components/panel/panel-class.js +7 -28
- package/components/panel/panel-ios.less +4 -0
- package/components/panel/panel-rtl.css +2 -2
- package/components/panel/panel-vars.less +8 -5
- package/components/panel/panel.css +2 -2
- package/components/panel/panel.js +8 -32
- package/components/panel/panel.less +9 -9
- package/components/panel/resizable-panel.js +2 -4
- package/components/photo-browser/photo-browser-class.js +12 -47
- package/components/photo-browser/photo-browser-rtl.css +1 -1
- package/components/photo-browser/photo-browser-vars.less +8 -10
- package/components/photo-browser/photo-browser.css +1 -1
- package/components/photo-browser/photo-browser.d.ts +2 -4
- package/components/photo-browser/photo-browser.js +1 -3
- package/components/photo-browser/photo-browser.less +15 -71
- package/components/picker/picker-class.js +4 -5
- package/components/picker/picker-ios.less +6 -1
- package/components/picker/picker-md.less +9 -0
- package/components/picker/picker-rtl.css +1 -1
- package/components/picker/picker-vars.less +1 -1
- package/components/picker/picker.css +1 -1
- package/components/picker/picker.d.ts +1 -1
- package/components/picker/picker.js +2 -5
- package/components/picker/picker.less +0 -4
- package/components/pie-chart/pie-chart-class.js +7 -14
- package/components/popover/popover-class.js +22 -62
- package/components/popover/popover-ios.less +66 -2
- package/components/popover/popover-md.less +2 -27
- package/components/popover/popover-rtl.css +1 -1
- package/components/popover/popover-vars.less +2 -3
- package/components/popover/popover.css +1 -1
- package/components/popover/popover.d.ts +0 -2
- package/components/popover/popover.js +2 -9
- package/components/popover/popover.less +28 -50
- package/components/popup/popup-class.js +15 -9
- package/components/popup/popup-rtl.css +1 -1
- package/components/popup/popup-vars.less +2 -2
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.js +2 -8
- package/components/popup/popup.less +6 -6
- package/components/preloader/preloader.js +2 -8
- package/components/progressbar/progressbar-md.less +12 -0
- package/components/progressbar/progressbar-rtl.css +1 -1
- package/components/progressbar/progressbar-vars.less +6 -5
- package/components/progressbar/progressbar.css +1 -1
- package/components/progressbar/progressbar.js +3 -12
- package/components/progressbar/progressbar.less +6 -0
- package/components/pull-to-refresh/pull-to-refresh-class.js +5 -12
- package/components/range/range-class.js +34 -27
- package/components/range/range-ios.less +60 -0
- package/components/range/range-md.less +67 -4
- package/components/range/range-rtl.css +1 -1
- package/components/range/range-vars.less +18 -13
- package/components/range/range.css +1 -1
- package/components/range/range.d.ts +3 -1
- package/components/range/range.js +2 -8
- package/components/range/range.less +11 -24
- package/components/searchbar/searchbar-class.js +7 -8
- package/components/searchbar/searchbar-ios.less +37 -13
- package/components/searchbar/searchbar-md.less +5 -0
- package/components/searchbar/searchbar-rtl.css +1 -1
- package/components/searchbar/searchbar-vars.less +13 -16
- package/components/searchbar/searchbar.css +1 -1
- package/components/searchbar/searchbar.js +4 -32
- package/components/searchbar/searchbar.less +4 -5
- package/components/sheet/sheet-class.js +21 -17
- package/components/sheet/sheet-ios.less +10 -0
- package/components/sheet/sheet-md.less +14 -0
- package/components/sheet/sheet-rtl.css +1 -1
- package/components/sheet/sheet-vars.less +5 -9
- package/components/sheet/sheet.css +1 -1
- package/components/sheet/sheet.js +2 -8
- package/components/sheet/sheet.less +5 -17
- package/components/skeleton/skeleton-rtl.css +1 -1
- package/components/skeleton/skeleton.css +1 -1
- package/components/smart-select/smart-select-class.js +15 -20
- package/components/smart-select/smart-select.d.ts +5 -7
- package/components/smart-select/smart-select.js +4 -4
- package/components/sortable/sortable.js +8 -27
- package/components/statusbar/statusbar.js +1 -4
- package/components/stepper/stepper-rtl.css +1 -1
- package/components/stepper/stepper-vars.less +3 -3
- package/components/stepper/stepper.css +1 -1
- package/components/stepper/stepper.js +2 -8
- package/components/subnavbar/subnavbar-ios.less +16 -1
- package/components/subnavbar/subnavbar-md.less +1 -1
- package/components/subnavbar/subnavbar-vars.less +12 -6
- package/components/subnavbar/subnavbar.less +5 -6
- package/components/swipeout/swipeout-ios.less +37 -0
- package/components/swipeout/swipeout-md.less +56 -0
- package/components/swipeout/swipeout-rtl.css +1 -1
- package/components/swipeout/swipeout-vars.less +13 -2
- package/components/swipeout/swipeout.css +1 -1
- package/components/swipeout/swipeout.js +102 -35
- package/components/swipeout/swipeout.less +20 -44
- package/components/swiper/swiper-rtl.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/tabs/tabs.js +3 -9
- package/components/text-editor/text-editor-class.js +1 -1
- package/components/text-editor/text-editor-rtl.css +1 -1
- package/components/text-editor/text-editor.css +1 -1
- package/components/timeline/timeline-ios.less +0 -5
- package/components/timeline/timeline-md.less +0 -5
- package/components/timeline/timeline-rtl.css +1 -1
- package/components/timeline/timeline-vars.less +1 -17
- package/components/timeline/timeline.css +1 -1
- package/components/timeline/timeline.less +0 -196
- package/components/toast/toast-class.js +2 -2
- package/components/toast/toast-ios.less +2 -0
- package/components/toast/toast-rtl.css +1 -1
- package/components/toast/toast-vars.less +2 -4
- package/components/toast/toast.css +1 -1
- package/components/toast/toast.less +1 -1
- package/components/toggle/toggle-class.js +5 -12
- package/components/toggle/toggle-ios.less +68 -50
- package/components/toggle/toggle-rtl.css +1 -1
- package/components/toggle/toggle-vars.less +2 -2
- package/components/toggle/toggle.css +1 -1
- package/components/toolbar/tabbar-highlight.js +134 -0
- package/components/toolbar/toolbar-ios.less +152 -14
- package/components/toolbar/toolbar-md.less +77 -3
- package/components/toolbar/toolbar-vars.less +14 -10
- package/components/toolbar/toolbar.js +32 -13
- package/components/toolbar/toolbar.less +8 -56
- package/components/tooltip/tooltip-class.js +13 -16
- package/components/tooltip/tooltip.js +0 -16
- package/components/touch-highlight/touch-highlight-ios.less +17 -0
- package/components/touch-highlight/touch-highlight-md.less +2 -0
- package/components/touch-highlight/touch-highlight-vars.less +8 -0
- package/components/touch-highlight/touch-highlight.d.ts +25 -0
- package/components/touch-highlight/touch-highlight.js +123 -0
- package/components/touch-highlight/touch-highlight.less +9 -0
- package/components/touch-ripple/touch-ripple.js +1 -4
- package/components/view/resizable-view.js +2 -4
- package/components/view/view-class.js +1 -15
- package/components/view/view.d.ts +0 -4
- package/components/view/view.js +1 -5
- package/components/virtual-list/virtual-list-class.js +2 -8
- package/framework7-bundle-rtl.css +2284 -3019
- package/framework7-bundle-rtl.min.css +9 -7
- package/framework7-bundle.css +2245 -2978
- package/framework7-bundle.esm.js +5 -4
- package/framework7-bundle.js +7170 -6469
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +4 -3
- package/framework7-bundle.min.css +9 -7
- package/framework7-bundle.min.js +4 -4
- package/framework7-bundle.min.js.map +1 -1
- package/framework7-lite-bundle.esm.js +5 -4
- package/framework7-lite.esm.js +5 -4
- package/framework7-rtl.css +509 -844
- package/framework7-rtl.min.css +8 -6
- package/framework7-types.d.ts +5 -1
- package/framework7.css +509 -843
- package/framework7.d.ts +4 -0
- package/framework7.esm.js +5 -4
- package/framework7.less +4 -3
- package/framework7.min.css +8 -6
- package/less/mixins.less +10 -12
- package/modules/component/$h.js +1 -4
- package/modules/component/$jsx.js +1 -4
- package/modules/component/component-class.js +49 -114
- package/modules/component/component.js +6 -7
- package/modules/component/eventslisteners.js +1 -4
- package/modules/component/snabbdom/modules/hero.js +0 -1
- package/modules/component/snabbdom/modules/style.js +1 -1
- package/modules/component/vdom.js +17 -29
- package/modules/router/back.js +22 -96
- package/modules/router/clear-previous-history.js +1 -7
- package/modules/router/component-loader.js +23 -32
- package/modules/router/modal.js +1 -4
- package/modules/router/navigate.js +28 -167
- package/modules/router/redirect.js +1 -5
- package/modules/router/router-class.js +21 -288
- package/modules/router/swipe-back.js +10 -318
- package/modules/router/tab.js +1 -4
- package/modules/store/create-store.js +2 -8
- package/modules/touch/touch.d.ts +5 -3
- package/modules/touch/touch.js +22 -36
- package/package.json +4 -4
- package/shared/$jsx.js +1 -4
- package/shared/class.js +5 -26
- package/shared/constructor-methods.js +4 -19
- package/shared/events-class.js +3 -12
- package/shared/get-device.js +4 -11
- package/shared/get-support.d.ts +0 -6
- package/shared/get-support.js +1 -20
- package/shared/material-color-utils.js +2102 -693
- package/shared/material-colors.js +94 -23
- package/shared/modal-methods.js +2 -8
- package/shared/utils.js +23 -45
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import $ from '../../shared/dom7.js';
|
|
2
2
|
import { nextFrame, bindMethods } from '../../shared/utils.js';
|
|
3
|
+
import { destroyTabbarHighlight, initTabbarHighlight } from './tabbar-highlight.js';
|
|
3
4
|
const Toolbar = {
|
|
4
5
|
setHighlight(tabbarEl) {
|
|
5
6
|
const app = this;
|
|
6
7
|
const $tabbarEl = $(tabbarEl);
|
|
7
|
-
if (
|
|
8
|
-
|
|
8
|
+
if ($tabbarEl.length === 0 || !($tabbarEl.hasClass('tabbar') || $tabbarEl.hasClass('tabbar-icons'))) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
9
11
|
let $highlightEl = $tabbarEl.find('.tab-link-highlight');
|
|
10
12
|
const tabLinksCount = $tabbarEl.find('.tab-link').length;
|
|
11
13
|
if (tabLinksCount === 0) {
|
|
@@ -13,10 +15,18 @@ const Toolbar = {
|
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
15
17
|
if ($highlightEl.length === 0) {
|
|
16
|
-
|
|
18
|
+
if (app.theme === 'ios') {
|
|
19
|
+
$tabbarEl.children('.toolbar-inner').children('.toolbar-pane').append('<span class="tab-link-highlight"></span>');
|
|
20
|
+
} else {
|
|
21
|
+
$tabbarEl.children('.toolbar-inner').append('<span class="tab-link-highlight"></span>');
|
|
22
|
+
}
|
|
17
23
|
$highlightEl = $tabbarEl.find('.tab-link-highlight');
|
|
18
|
-
} else if ($highlightEl.next().length) {
|
|
19
|
-
|
|
24
|
+
} else if ($highlightEl.next('a,button,.tab-link').length) {
|
|
25
|
+
if (app.theme === 'ios') {
|
|
26
|
+
$tabbarEl.children('.toolbar-inner').children('.toolbar-pane').append($highlightEl);
|
|
27
|
+
} else {
|
|
28
|
+
$tabbarEl.children('.toolbar-inner').append($highlightEl);
|
|
29
|
+
}
|
|
20
30
|
}
|
|
21
31
|
const $activeLink = $tabbarEl.find('.tab-link-active');
|
|
22
32
|
let highlightWidth;
|
|
@@ -36,11 +46,15 @@ const Toolbar = {
|
|
|
36
46
|
init(tabbarEl) {
|
|
37
47
|
const app = this;
|
|
38
48
|
app.toolbar.setHighlight(tabbarEl);
|
|
49
|
+
if (app.theme !== 'ios') return;
|
|
50
|
+
initTabbarHighlight(tabbarEl);
|
|
39
51
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
destroy(tabbarEl) {
|
|
53
|
+
const app = this;
|
|
54
|
+
if (app.theme !== 'ios') return;
|
|
55
|
+
destroyTabbarHighlight(tabbarEl);
|
|
56
|
+
},
|
|
57
|
+
hide(el, animate = true) {
|
|
44
58
|
const app = this;
|
|
45
59
|
const $el = $(el);
|
|
46
60
|
if ($el.hasClass('toolbar-hidden')) return;
|
|
@@ -52,10 +66,7 @@ const Toolbar = {
|
|
|
52
66
|
$el.trigger('toolbar:hide');
|
|
53
67
|
app.emit('toolbarHide', $el[0]);
|
|
54
68
|
},
|
|
55
|
-
show(el, animate) {
|
|
56
|
-
if (animate === void 0) {
|
|
57
|
-
animate = true;
|
|
58
|
-
}
|
|
69
|
+
show(el, animate = true) {
|
|
59
70
|
const app = this;
|
|
60
71
|
const $el = $(el);
|
|
61
72
|
if (!$el.hasClass('toolbar-hidden')) return;
|
|
@@ -146,9 +157,13 @@ export default {
|
|
|
146
157
|
},
|
|
147
158
|
on: {
|
|
148
159
|
pageBeforeRemove(page) {
|
|
160
|
+
const app = this;
|
|
149
161
|
if (page.$el[0].f7ScrollToolbarHandler) {
|
|
150
162
|
page.$el.off('scroll', '.page-content', page.$el[0].f7ScrollToolbarHandler, true);
|
|
151
163
|
}
|
|
164
|
+
page.$el.find('.tabbar, .tabbar-icons').each(tabbarEl => {
|
|
165
|
+
app.toolbar.destroy(tabbarEl);
|
|
166
|
+
});
|
|
152
167
|
},
|
|
153
168
|
pageBeforeIn(page) {
|
|
154
169
|
const app = this;
|
|
@@ -192,6 +207,10 @@ export default {
|
|
|
192
207
|
insert(vnode) {
|
|
193
208
|
const app = this;
|
|
194
209
|
app.toolbar.init(vnode.elm);
|
|
210
|
+
},
|
|
211
|
+
destroy(vnode) {
|
|
212
|
+
const app = this;
|
|
213
|
+
app.toolbar.destroy(vnode.elm);
|
|
195
214
|
}
|
|
196
215
|
}
|
|
197
216
|
}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
left: 0;
|
|
13
13
|
height: var(--f7-toolbar-height);
|
|
14
|
-
|
|
14
|
+
flex-shrink: 0;
|
|
15
15
|
color: var(--f7-toolbar-text-color, var(--f7-bars-text-color));
|
|
16
16
|
font-size: var(--f7-toolbar-font-size);
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
b {
|
|
19
19
|
font-weight: 600;
|
|
20
20
|
}
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
.link {
|
|
30
30
|
display: flex;
|
|
31
|
-
|
|
32
|
-
height: var(--f7-toolbar-link-height, var(--f7-toolbar-height));
|
|
31
|
+
|
|
33
32
|
font-weight: var(--f7-toolbar-link-font-weight);
|
|
34
33
|
}
|
|
35
34
|
i.icon {
|
|
@@ -51,63 +50,31 @@
|
|
|
51
50
|
.ios .toolbar-top-ios,
|
|
52
51
|
.md .toolbar-top-md {
|
|
53
52
|
top: 0;
|
|
54
|
-
.tab-link-highlight {
|
|
55
|
-
bottom: 0;
|
|
56
|
-
}
|
|
57
|
-
&.no-outline {
|
|
58
|
-
&:after {
|
|
59
|
-
display: none !important;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
&.toolbar-hidden {
|
|
63
|
-
&:before {
|
|
64
|
-
display: none !important;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
&:after,
|
|
68
|
-
&:before {
|
|
69
|
-
backface-visibility: hidden;
|
|
70
|
-
}
|
|
71
|
-
.hairline(bottom, var(--f7-toolbar-border-color, var(--f7-bars-border-color)));
|
|
72
53
|
}
|
|
73
54
|
.toolbar-bottom,
|
|
74
55
|
.ios .toolbar-bottom-ios,
|
|
75
56
|
.md .toolbar-bottom-md {
|
|
76
57
|
bottom: 0;
|
|
77
58
|
height: calc(var(--f7-toolbar-height) + var(--f7-safe-area-bottom));
|
|
78
|
-
.tab-link-highlight {
|
|
79
|
-
top: 0;
|
|
80
|
-
}
|
|
81
59
|
.toolbar-inner {
|
|
82
60
|
height: auto;
|
|
83
61
|
top: 0;
|
|
84
62
|
bottom: var(--f7-safe-area-bottom);
|
|
85
63
|
}
|
|
86
|
-
&.no-outline {
|
|
87
|
-
&:before {
|
|
88
|
-
display: none !important;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
&.toolbar-hidden {
|
|
92
|
-
&:after {
|
|
93
|
-
display: none !important;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.hairline(top, var(--f7-toolbar-border-color, var(--f7-bars-border-color)));
|
|
98
64
|
}
|
|
99
65
|
.toolbar-inner {
|
|
100
66
|
position: absolute;
|
|
67
|
+
z-index: 1;
|
|
101
68
|
left: 0;
|
|
102
69
|
top: 0;
|
|
103
70
|
width: 100%;
|
|
104
71
|
height: 100%;
|
|
105
72
|
display: flex;
|
|
106
|
-
|
|
73
|
+
|
|
107
74
|
box-sizing: border-box;
|
|
108
75
|
align-items: center;
|
|
109
76
|
align-content: center;
|
|
110
|
-
|
|
77
|
+
|
|
111
78
|
padding: 0 calc(var(--f7-toolbar-inner-padding-right) + var(--f7-safe-area-right)) 0
|
|
112
79
|
calc(var(--f7-toolbar-inner-padding-left) + var(--f7-safe-area-left));
|
|
113
80
|
}
|
|
@@ -145,22 +112,6 @@
|
|
|
145
112
|
height: var(--f7-tabbar-icon-size);
|
|
146
113
|
line-height: var(--f7-tabbar-icon-size);
|
|
147
114
|
}
|
|
148
|
-
.md &.tabbar-icons .tab-link-highlight {
|
|
149
|
-
display: none;
|
|
150
|
-
}
|
|
151
|
-
.md &:not(.tabbar-icons) .tab-link-highlight {
|
|
152
|
-
position: absolute;
|
|
153
|
-
left: 0;
|
|
154
|
-
height: 2px;
|
|
155
|
-
background: var(--f7-tabbar-link-active-border-color, var(--f7-theme-color));
|
|
156
|
-
transition-duration: 300ms;
|
|
157
|
-
.ltr({
|
|
158
|
-
left: 0;
|
|
159
|
-
});
|
|
160
|
-
.rtl({
|
|
161
|
-
right: 0;
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
115
|
}
|
|
165
116
|
.tabbar-icons {
|
|
166
117
|
--f7-toolbar-height: var(--f7-tabbar-icons-height);
|
|
@@ -228,7 +179,8 @@
|
|
|
228
179
|
}
|
|
229
180
|
.toolbar-top,
|
|
230
181
|
.ios .toolbar-top-ios,
|
|
231
|
-
.md .toolbar-top-md
|
|
182
|
+
.md .toolbar-top-md,
|
|
183
|
+
.sheet-modal-bottom > .toolbar:not(.toolbar-bottom) {
|
|
232
184
|
~ * {
|
|
233
185
|
--f7-page-toolbar-top-offset: var(--f7-toolbar-height);
|
|
234
186
|
}
|
|
@@ -4,10 +4,7 @@ import { extend, deleteProps } from '../../shared/utils.js';
|
|
|
4
4
|
import { getSupport } from '../../shared/get-support.js';
|
|
5
5
|
import Framework7Class from '../../shared/class.js';
|
|
6
6
|
class Tooltip extends Framework7Class {
|
|
7
|
-
constructor(app, params) {
|
|
8
|
-
if (params === void 0) {
|
|
9
|
-
params = {};
|
|
10
|
-
}
|
|
7
|
+
constructor(app, params = {}) {
|
|
11
8
|
super(params, [app]);
|
|
12
9
|
const tooltip = this;
|
|
13
10
|
const support = getSupport();
|
|
@@ -101,9 +98,9 @@ class Tooltip extends Framework7Class {
|
|
|
101
98
|
}
|
|
102
99
|
if (tooltip.params.trigger === 'manual') return;
|
|
103
100
|
if (support.touch) {
|
|
104
|
-
const passive =
|
|
101
|
+
const passive = {
|
|
105
102
|
passive: true
|
|
106
|
-
}
|
|
103
|
+
};
|
|
107
104
|
if (tooltip.params.delegated) {
|
|
108
105
|
$(document).on(app.touchEvents.start, tooltip.params.targetEl, handleTouchStart, passive);
|
|
109
106
|
} else {
|
|
@@ -114,11 +111,11 @@ class Tooltip extends Framework7Class {
|
|
|
114
111
|
} else {
|
|
115
112
|
// eslint-disable-next-line
|
|
116
113
|
if (tooltip.params.delegated) {
|
|
117
|
-
$(document).on(
|
|
118
|
-
$(document).on(
|
|
114
|
+
$(document).on('pointerenter', tooltip.params.targetEl, handleMouseEnter, true);
|
|
115
|
+
$(document).on('pointerleave', tooltip.params.targetEl, handleMouseLeave, true);
|
|
119
116
|
} else {
|
|
120
|
-
tooltip.$targetEl.on(
|
|
121
|
-
tooltip.$targetEl.on(
|
|
117
|
+
tooltip.$targetEl.on('pointerenter', handleMouseEnter);
|
|
118
|
+
tooltip.$targetEl.on('pointerleave', handleMouseLeave);
|
|
122
119
|
}
|
|
123
120
|
}
|
|
124
121
|
};
|
|
@@ -135,9 +132,9 @@ class Tooltip extends Framework7Class {
|
|
|
135
132
|
}
|
|
136
133
|
if (tooltip.params.trigger === 'manual') return;
|
|
137
134
|
if (support.touch) {
|
|
138
|
-
const passive =
|
|
135
|
+
const passive = {
|
|
139
136
|
passive: true
|
|
140
|
-
}
|
|
137
|
+
};
|
|
141
138
|
if (tooltip.params.delegated) {
|
|
142
139
|
$(document).off(app.touchEvents.start, tooltip.params.targetEl, handleTouchStart, passive);
|
|
143
140
|
} else {
|
|
@@ -148,11 +145,11 @@ class Tooltip extends Framework7Class {
|
|
|
148
145
|
} else {
|
|
149
146
|
// eslint-disable-next-line
|
|
150
147
|
if (tooltip.params.delegated) {
|
|
151
|
-
$(document).off(
|
|
152
|
-
$(document).off(
|
|
148
|
+
$(document).off('pointerenter', tooltip.params.targetEl, handleMouseEnter, true);
|
|
149
|
+
$(document).off('pointerleave', tooltip.params.targetEl, handleMouseLeave, true);
|
|
153
150
|
} else {
|
|
154
|
-
tooltip.$targetEl.off(
|
|
155
|
-
tooltip.$targetEl.off(
|
|
151
|
+
tooltip.$targetEl.off('pointerenter', handleMouseEnter);
|
|
152
|
+
tooltip.$targetEl.off('pointerleave', handleMouseLeave);
|
|
156
153
|
}
|
|
157
154
|
}
|
|
158
155
|
};
|
|
@@ -78,27 +78,11 @@ export default {
|
|
|
78
78
|
text
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
|
-
if (app.theme === 'ios' && page.view && page.view.router.dynamicNavbar && page.$navbarEl && page.$navbarEl.length > 0) {
|
|
82
|
-
page.$navbarEl.find('.tooltip-init').each(el => {
|
|
83
|
-
const text = $(el).attr('data-tooltip');
|
|
84
|
-
if (!text) return;
|
|
85
|
-
app.tooltip.create({
|
|
86
|
-
targetEl: el,
|
|
87
|
-
text
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
81
|
},
|
|
92
82
|
pageBeforeRemove(page) {
|
|
93
|
-
const app = this;
|
|
94
83
|
page.$el.find('.tooltip-init').each(el => {
|
|
95
84
|
if (el.f7Tooltip) el.f7Tooltip.destroy();
|
|
96
85
|
});
|
|
97
|
-
if (app.theme === 'ios' && page.view && page.view.router.dynamicNavbar && page.$navbarEl && page.$navbarEl.length > 0) {
|
|
98
|
-
page.$navbarEl.find('.tooltip-init').each(el => {
|
|
99
|
-
if (el.f7Tooltip) el.f7Tooltip.destroy();
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
86
|
}
|
|
103
87
|
},
|
|
104
88
|
vnode: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.ios {
|
|
2
|
+
.toolbar-pane,
|
|
3
|
+
.navbar .left,
|
|
4
|
+
.navbar .right,
|
|
5
|
+
.popover-inner,
|
|
6
|
+
.actions-group:not(.actions-grid .actions-group),
|
|
7
|
+
.searchbar-input-wrap,
|
|
8
|
+
.searchbar-disable-button,
|
|
9
|
+
.subnavbar,
|
|
10
|
+
.searchbar-input-wrap .autocomplete-dropdown,
|
|
11
|
+
.messagebar-area,
|
|
12
|
+
.notification,
|
|
13
|
+
.toast,
|
|
14
|
+
.fab > a {
|
|
15
|
+
touch-action: none;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Dom7Array } from 'dom7';
|
|
2
|
+
import Framework7, {
|
|
3
|
+
CSSSelector,
|
|
4
|
+
Framework7EventsClass,
|
|
5
|
+
Framework7Plugin,
|
|
6
|
+
} from '../app/app-class.js';
|
|
7
|
+
|
|
8
|
+
export namespace TouchHighlight {
|
|
9
|
+
interface TouchHighlight {
|
|
10
|
+
$highlightEl: Dom7Array;
|
|
11
|
+
highlightTransform: string;
|
|
12
|
+
removing: boolean;
|
|
13
|
+
remove(): void;
|
|
14
|
+
}
|
|
15
|
+
interface AppMethods {
|
|
16
|
+
touchHighlight: {
|
|
17
|
+
create($el: Dom7Array, x: number, y: number): TouchHighlight;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface AppParams {}
|
|
21
|
+
interface AppEvents {}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const TouchHighlightComponent: Framework7Plugin;
|
|
25
|
+
export default TouchHighlightComponent;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { getDocument } from 'ssr-window';
|
|
2
|
+
const initTouchHighlight = app => {
|
|
3
|
+
const document = getDocument();
|
|
4
|
+
const isEnabled = app.params.touch.touchHighlight;
|
|
5
|
+
const elements = app.params.touch.touchHighlightElements;
|
|
6
|
+
const data = {};
|
|
7
|
+
const offset = 1;
|
|
8
|
+
const opacity = 1;
|
|
9
|
+
const zIndex = 500;
|
|
10
|
+
const removeHoverHighlight = () => {
|
|
11
|
+
const el = data.currentEl;
|
|
12
|
+
if (el && data.elScale) {
|
|
13
|
+
data.elScale = false;
|
|
14
|
+
el.style.scale = '';
|
|
15
|
+
const onTransitionEnd = () => {
|
|
16
|
+
el.style.transitionDuration = '';
|
|
17
|
+
el.style.transitionTimingFunction = '';
|
|
18
|
+
el.removeEventListener('transitionend', onTransitionEnd);
|
|
19
|
+
};
|
|
20
|
+
el.addEventListener('transitionend', onTransitionEnd);
|
|
21
|
+
}
|
|
22
|
+
if (data.lightElWrap) {
|
|
23
|
+
const lightElWrap = data.lightElWrap;
|
|
24
|
+
if (lightElWrap.style.opacity === '0') {
|
|
25
|
+
lightElWrap.remove();
|
|
26
|
+
} else {
|
|
27
|
+
lightElWrap.addEventListener('transitionend', () => {
|
|
28
|
+
lightElWrap.remove();
|
|
29
|
+
});
|
|
30
|
+
lightElWrap.style.opacity = 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
data.currentEl = null;
|
|
34
|
+
data.lightElWrap = null;
|
|
35
|
+
data.lightEl = null;
|
|
36
|
+
};
|
|
37
|
+
const setLightPosition = e => {
|
|
38
|
+
if (data.lightEl) {
|
|
39
|
+
const {
|
|
40
|
+
x,
|
|
41
|
+
y
|
|
42
|
+
} = e;
|
|
43
|
+
const offsetX = x - data.rect.x;
|
|
44
|
+
const offsetY = y - data.rect.y;
|
|
45
|
+
data.lightEl.style.transform = `translate3d(${offsetX}px, ${offsetY}px, 0)`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const onPointerMove = e => {
|
|
49
|
+
if (!isEnabled) return;
|
|
50
|
+
setLightPosition(e);
|
|
51
|
+
};
|
|
52
|
+
const onPointerLeave = () => {
|
|
53
|
+
if (!isEnabled) return;
|
|
54
|
+
removeHoverHighlight();
|
|
55
|
+
};
|
|
56
|
+
const onPointerDown = e => {
|
|
57
|
+
if (!isEnabled) return;
|
|
58
|
+
if (e.pointerType === 'mouse') return;
|
|
59
|
+
const d = data;
|
|
60
|
+
const el = e.target.closest(elements);
|
|
61
|
+
if (!el) return;
|
|
62
|
+
if (d.currentEl === el) return;
|
|
63
|
+
d.currentEl = el;
|
|
64
|
+
d.rect = el.getBoundingClientRect();
|
|
65
|
+
const lightElWrap = document.createElement('span');
|
|
66
|
+
lightElWrap.className = 'rounded-[inherit]';
|
|
67
|
+
lightElWrap.style = `left: ${offset}px; top: ${offset}px; right: ${offset}px; bottom: ${offset}px;transition-duration: 300ms; opacity: 0; position: absolute; overflow: hidden; pointer-events: none; border-radius: inherit;`;
|
|
68
|
+
const lightEl = document.createElement('span');
|
|
69
|
+
const {
|
|
70
|
+
width,
|
|
71
|
+
height
|
|
72
|
+
} = d.rect;
|
|
73
|
+
const radius = (width ** 2 + height ** 2) ** 0.5;
|
|
74
|
+
lightEl.style.position = `absolute`;
|
|
75
|
+
lightEl.style.zIndex = zIndex;
|
|
76
|
+
lightEl.style.width = `${radius * 2}px`;
|
|
77
|
+
lightEl.style.left = `${-radius}px`;
|
|
78
|
+
lightEl.style.height = `${radius * 2}px`;
|
|
79
|
+
lightEl.style.top = `${-radius}px`;
|
|
80
|
+
lightEl.style.borderRadius = `50%`;
|
|
81
|
+
const lightColor = 'var(--f7-touch-highlight-bg-color)';
|
|
82
|
+
lightEl.style.backgroundImage = `radial-gradient(circle at center, color-mix(in oklab, ${lightColor} ${opacity * 100}%, transparent), transparent 50%)`;
|
|
83
|
+
lightEl.style.pointerEvents = 'none';
|
|
84
|
+
d.lightEl = lightEl;
|
|
85
|
+
d.lightElWrap = lightElWrap;
|
|
86
|
+
setLightPosition(e);
|
|
87
|
+
lightElWrap.append(lightEl);
|
|
88
|
+
el.append(lightElWrap);
|
|
89
|
+
if (e.pointerType !== 'mouse') {
|
|
90
|
+
if (e.pointerType !== 'mouse') {
|
|
91
|
+
d.elScale = true;
|
|
92
|
+
let scale = 1.25;
|
|
93
|
+
if (d.rect.width > 60 || d.rect.height > 60) {
|
|
94
|
+
scale = 1.05;
|
|
95
|
+
}
|
|
96
|
+
el.style.scale = scale;
|
|
97
|
+
el.style.transitionDuration = '300ms';
|
|
98
|
+
el.style.transitionTimingFunction = 'ease-in-out';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
requestAnimationFrame(() => {
|
|
102
|
+
lightElWrap.style.opacity = 1;
|
|
103
|
+
});
|
|
104
|
+
el.removeEventListener('pointermove', onPointerMove);
|
|
105
|
+
el.removeEventListener('pointerleave', onPointerLeave);
|
|
106
|
+
el.addEventListener('pointermove', onPointerMove);
|
|
107
|
+
el.addEventListener('pointerleave', onPointerLeave);
|
|
108
|
+
};
|
|
109
|
+
document.addEventListener('pointerdown', onPointerDown, {
|
|
110
|
+
capture: true
|
|
111
|
+
});
|
|
112
|
+
document.addEventListener('contextmenu', onPointerLeave, {
|
|
113
|
+
capture: true
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
export default {
|
|
117
|
+
name: 'touch-highlight',
|
|
118
|
+
on: {
|
|
119
|
+
init() {
|
|
120
|
+
initTouchHighlight(this);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
@@ -7,10 +7,7 @@ export default {
|
|
|
7
7
|
create() {
|
|
8
8
|
const app = this;
|
|
9
9
|
app.touchRipple = {
|
|
10
|
-
create() {
|
|
11
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12
|
-
args[_key] = arguments[_key];
|
|
13
|
-
}
|
|
10
|
+
create(...args) {
|
|
14
11
|
return new TouchRipple(...args);
|
|
15
12
|
}
|
|
16
13
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import $ from '../../shared/dom7.js';
|
|
2
2
|
import { extend } from '../../shared/utils.js';
|
|
3
|
-
import { getSupport } from '../../shared/get-support.js';
|
|
4
3
|
function resizableView(view) {
|
|
5
4
|
const app = view.app;
|
|
6
|
-
const support = getSupport();
|
|
7
5
|
if (view.resizableInitialized) return;
|
|
8
6
|
extend(view, {
|
|
9
7
|
resizable: true,
|
|
@@ -104,9 +102,9 @@ function resizableView(view) {
|
|
|
104
102
|
$el.addClass('view-resizable');
|
|
105
103
|
|
|
106
104
|
// Add Events
|
|
107
|
-
const passive =
|
|
105
|
+
const passive = {
|
|
108
106
|
passive: true
|
|
109
|
-
}
|
|
107
|
+
};
|
|
110
108
|
view.$el.on(app.touchEvents.start, '.view-resize-handler', handleTouchStart, passive);
|
|
111
109
|
app.on('touchmove:active', handleTouchMove);
|
|
112
110
|
app.on('touchend:passive', handleTouchEnd);
|
|
@@ -4,10 +4,7 @@ import Router from '../../modules/router/router.js';
|
|
|
4
4
|
import Framework7Class from '../../shared/class.js';
|
|
5
5
|
import resizableView from './resizable-view.js';
|
|
6
6
|
class View extends Framework7Class {
|
|
7
|
-
constructor(app, el, viewParams) {
|
|
8
|
-
if (viewParams === void 0) {
|
|
9
|
-
viewParams = {};
|
|
10
|
-
}
|
|
7
|
+
constructor(app, el, viewParams = {}) {
|
|
11
8
|
super(viewParams, [app]);
|
|
12
9
|
const view = this;
|
|
13
10
|
const ssr = view.params.routerId;
|
|
@@ -154,21 +151,10 @@ class View extends Framework7Class {
|
|
|
154
151
|
// Supposed to be HTMLElement or Dom7
|
|
155
152
|
selector = ($el.attr('id') ? `#${$el.attr('id')}` : '') + ($el.attr('class') ? `.${$el.attr('class').replace(/ /g, '.').replace('.active', '')}` : '');
|
|
156
153
|
}
|
|
157
|
-
|
|
158
|
-
// DynamicNavbar
|
|
159
|
-
let $navbarsEl;
|
|
160
|
-
if (app.theme === 'ios' && view.params.iosDynamicNavbar) {
|
|
161
|
-
$navbarsEl = $el.children('.navbars').eq(0);
|
|
162
|
-
if ($navbarsEl.length === 0) {
|
|
163
|
-
$navbarsEl = $('<div class="navbars"></div>');
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
154
|
extend(view, {
|
|
167
155
|
$el,
|
|
168
156
|
el: $el[0],
|
|
169
157
|
main: view.main || $el.hasClass('view-main'),
|
|
170
|
-
$navbarsEl,
|
|
171
|
-
navbarsEl: $navbarsEl ? $navbarsEl[0] : undefined,
|
|
172
158
|
selector
|
|
173
159
|
});
|
|
174
160
|
if (view.main) {
|
|
@@ -110,10 +110,6 @@ export namespace View {
|
|
|
110
110
|
componentCache?: boolean;
|
|
111
111
|
/** When enabled, and there is no children pages inside of the View. It will load initial page that matches to initial URL (default true) */
|
|
112
112
|
loadInitialPage?: boolean;
|
|
113
|
-
/** Enables dynamic navbar for iOS theme */
|
|
114
|
-
iosDynamicNavbar?: boolean;
|
|
115
|
-
/** This option (when enabled) gives more native look for dynamic navbar left back-link icon animation. Useful only when you use dynamic navbar with default back-link icon on left side set as "sliding". */
|
|
116
|
-
iosAnimateNavbarBackIcon?: boolean;
|
|
117
113
|
/** Enable/disable ability to swipe back from left edge of screen to get to the previous page. For iOS theme */
|
|
118
114
|
iosSwipeBack?: boolean;
|
|
119
115
|
/** Value in px. Swipe back action will start if "touch distance" will be more than this value. For iOS theme */
|
package/components/view/view.js
CHANGED
|
@@ -73,7 +73,7 @@ export default {
|
|
|
73
73
|
iosSwipeBackThreshold: 0,
|
|
74
74
|
mdSwipeBack: false,
|
|
75
75
|
mdSwipeBackAnimateShadow: true,
|
|
76
|
-
mdSwipeBackAnimateOpacity:
|
|
76
|
+
mdSwipeBackAnimateOpacity: true,
|
|
77
77
|
mdSwipeBackActiveArea: 30,
|
|
78
78
|
mdSwipeBackThreshold: 0,
|
|
79
79
|
// Push State
|
|
@@ -88,10 +88,6 @@ export default {
|
|
|
88
88
|
browserHistoryTabs: 'replace',
|
|
89
89
|
// Animate Pages
|
|
90
90
|
animate: true,
|
|
91
|
-
// iOS Dynamic Navbar
|
|
92
|
-
iosDynamicNavbar: true,
|
|
93
|
-
// Animate iOS Navbar Back Icon
|
|
94
|
-
iosAnimateNavbarBackIcon: true,
|
|
95
91
|
// Delays
|
|
96
92
|
iosPageLoadDelay: 0,
|
|
97
93
|
mdPageLoadDelay: 0,
|
|
@@ -4,10 +4,7 @@ import { extend, deleteProps } from '../../shared/utils.js';
|
|
|
4
4
|
import Framework7Class from '../../shared/class.js';
|
|
5
5
|
import { getDevice } from '../../shared/get-device.js';
|
|
6
6
|
class VirtualList extends Framework7Class {
|
|
7
|
-
constructor(app, params) {
|
|
8
|
-
if (params === void 0) {
|
|
9
|
-
params = {};
|
|
10
|
-
}
|
|
7
|
+
constructor(app, params = {}) {
|
|
11
8
|
super(params, [app]);
|
|
12
9
|
const vl = this;
|
|
13
10
|
const device = getDevice();
|
|
@@ -333,10 +330,7 @@ class VirtualList extends Framework7Class {
|
|
|
333
330
|
}
|
|
334
331
|
|
|
335
332
|
// Filter
|
|
336
|
-
filterItems(indexes, resetScrollTop) {
|
|
337
|
-
if (resetScrollTop === void 0) {
|
|
338
|
-
resetScrollTop = true;
|
|
339
|
-
}
|
|
333
|
+
filterItems(indexes, resetScrollTop = true) {
|
|
340
334
|
const vl = this;
|
|
341
335
|
vl.filteredItems = [];
|
|
342
336
|
for (let i = 0; i < indexes.length; i += 1) {
|