framework7 8.3.4 → 9.0.0

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.
Files changed (345) hide show
  1. package/components/accordion/accordion-rtl.css +1 -1
  2. package/components/accordion/accordion.css +1 -1
  3. package/components/actions/actions-ios.less +22 -15
  4. package/components/actions/actions-rtl.css +1 -1
  5. package/components/actions/actions-vars.less +4 -7
  6. package/components/actions/actions.css +1 -1
  7. package/components/actions/actions.js +2 -8
  8. package/components/actions/actions.less +0 -3
  9. package/components/app/app-class.d.ts +2 -0
  10. package/components/app/app-class.js +19 -15
  11. package/components/app/app-vars.less +41 -6
  12. package/components/app/app.less +1 -1
  13. package/components/area-chart/area-chart-class.js +18 -31
  14. package/components/area-chart/area-chart-rtl.css +1 -1
  15. package/components/area-chart/area-chart.css +1 -1
  16. package/components/autocomplete/autocomplete-class.js +13 -14
  17. package/components/autocomplete/autocomplete-ios.less +16 -0
  18. package/components/autocomplete/autocomplete-rtl.css +1 -1
  19. package/components/autocomplete/autocomplete.css +1 -1
  20. package/components/autocomplete/autocomplete.d.ts +3 -3
  21. package/components/autocomplete/autocomplete.js +3 -3
  22. package/components/autocomplete/autocomplete.less +7 -1
  23. package/components/block/block-vars.less +6 -6
  24. package/components/breadcrumbs/breadcrumbs-rtl.css +1 -1
  25. package/components/breadcrumbs/breadcrumbs.css +1 -1
  26. package/components/button/button-vars.less +13 -12
  27. package/components/button/button.less +2 -1
  28. package/components/calendar/calendar-class.js +20 -17
  29. package/components/calendar/calendar-ios.less +43 -0
  30. package/components/calendar/calendar-md.less +3 -0
  31. package/components/calendar/calendar-rtl.css +1 -1
  32. package/components/calendar/calendar-vars.less +24 -19
  33. package/components/calendar/calendar.css +1 -1
  34. package/components/calendar/calendar.d.ts +1 -1
  35. package/components/calendar/calendar.js +5 -8
  36. package/components/calendar/calendar.less +4 -2
  37. package/components/card/card-rtl.css +1 -1
  38. package/components/card/card-vars.less +5 -5
  39. package/components/card/card.css +1 -1
  40. package/components/card/card.js +3 -18
  41. package/components/card/card.less +1 -1
  42. package/components/checkbox/checkbox-rtl.css +1 -1
  43. package/components/checkbox/checkbox.css +1 -1
  44. package/components/chip/chip-rtl.css +1 -1
  45. package/components/chip/chip.css +1 -1
  46. package/components/color-picker/color-picker-class.js +11 -23
  47. package/components/color-picker/color-picker-ios.less +9 -0
  48. package/components/color-picker/color-picker-md.less +15 -0
  49. package/components/color-picker/color-picker-rtl.css +1 -1
  50. package/components/color-picker/color-picker-vars.less +9 -3
  51. package/components/color-picker/color-picker.css +1 -1
  52. package/components/color-picker/color-picker.d.ts +1 -2
  53. package/components/color-picker/color-picker.js +3 -7
  54. package/components/color-picker/color-picker.less +5 -25
  55. package/components/color-picker/modules/alpha-slider.js +2 -0
  56. package/components/color-picker/modules/brightness-slider.js +2 -0
  57. package/components/color-picker/modules/hs-spectrum.js +1 -2
  58. package/components/color-picker/modules/hsb-sliders.js +6 -0
  59. package/components/color-picker/modules/hue-slider.js +2 -0
  60. package/components/color-picker/modules/rgb-bars.js +6 -0
  61. package/components/color-picker/modules/rgb-sliders.js +6 -0
  62. package/components/color-picker/modules/sb-spectrum.js +1 -2
  63. package/components/color-picker/modules/wheel.js +1 -2
  64. package/components/contacts-list/contacts-list-rtl.css +1 -1
  65. package/components/contacts-list/contacts-list.css +1 -1
  66. package/components/data-table/data-table-class.js +1 -4
  67. package/components/data-table/data-table-ios.less +1 -1
  68. package/components/data-table/data-table-md.less +4 -2
  69. package/components/data-table/data-table-rtl.css +1 -1
  70. package/components/data-table/data-table.css +1 -1
  71. package/components/data-table/data-table.less +4 -4
  72. package/components/dialog/dialog-class.js +6 -3
  73. package/components/dialog/dialog-ios.less +10 -34
  74. package/components/dialog/dialog-md.less +2 -22
  75. package/components/dialog/dialog-rtl.css +1 -1
  76. package/components/dialog/dialog-vars.less +8 -10
  77. package/components/dialog/dialog.css +1 -1
  78. package/components/dialog/dialog.js +9 -27
  79. package/components/dialog/dialog.less +6 -25
  80. package/components/fab/fab-ios.less +2 -0
  81. package/components/fab/fab-rtl.css +1 -1
  82. package/components/fab/fab-vars.less +30 -6
  83. package/components/fab/fab.css +1 -1
  84. package/components/fab/fab.js +3 -12
  85. package/components/gauge/gauge-class.js +2 -8
  86. package/components/gauge/gauge-rtl.css +1 -1
  87. package/components/gauge/gauge.css +1 -1
  88. package/components/icon/icon-ios.less +10 -0
  89. package/components/icon/icon-md.less +9 -0
  90. package/components/icon/icon.less +2 -1
  91. package/components/infinite-scroll/infinite-scroll-rtl.css +1 -1
  92. package/components/infinite-scroll/infinite-scroll.css +1 -1
  93. package/components/input/input-ios.less +3 -2
  94. package/components/input/input-rtl.css +1 -1
  95. package/components/input/input.css +1 -1
  96. package/components/input/input.js +2 -5
  97. package/components/list/list-vars.less +7 -5
  98. package/components/list/list.less +1 -1
  99. package/components/list-index/list-index-class.js +3 -7
  100. package/components/list-index/list-index-rtl.css +1 -1
  101. package/components/list-index/list-index.css +1 -1
  102. package/components/login-screen/login-screen-rtl.css +1 -1
  103. package/components/login-screen/login-screen.css +1 -1
  104. package/components/login-screen/login-screen.js +2 -8
  105. package/components/login-screen/login-screen.less +1 -0
  106. package/components/messagebar/messagebar-class.js +5 -20
  107. package/components/messagebar/messagebar-ios.less +19 -14
  108. package/components/messagebar/messagebar-md.less +3 -0
  109. package/components/messagebar/messagebar-rtl.css +1 -1
  110. package/components/messagebar/messagebar-vars.less +12 -15
  111. package/components/messagebar/messagebar.css +1 -1
  112. package/components/messagebar/messagebar.less +4 -5
  113. package/components/messages/messages-class.js +25 -52
  114. package/components/messages/messages-ios.less +6 -2
  115. package/components/messages/messages-rtl.css +1 -1
  116. package/components/messages/messages-vars.less +1 -1
  117. package/components/messages/messages.css +1 -1
  118. package/components/navbar/navbar-ios.less +52 -672
  119. package/components/navbar/navbar-md.less +41 -1
  120. package/components/navbar/navbar-vars.less +4 -3
  121. package/components/navbar/navbar.js +28 -185
  122. package/components/navbar/navbar.less +8 -66
  123. package/components/notification/notification-class.js +6 -6
  124. package/components/notification/notification-ios.less +3 -8
  125. package/components/notification/notification-md.less +1 -20
  126. package/components/notification/notification-rtl.css +1 -1
  127. package/components/notification/notification-vars.less +13 -16
  128. package/components/notification/notification.css +1 -1
  129. package/components/notification/notification.less +8 -1
  130. package/components/page/page-ios.less +1 -8
  131. package/components/page/page-md.less +12 -11
  132. package/components/page/page.less +14 -12
  133. package/components/panel/panel-class.js +7 -28
  134. package/components/panel/panel-ios.less +4 -0
  135. package/components/panel/panel-rtl.css +1 -3
  136. package/components/panel/panel-vars.less +8 -5
  137. package/components/panel/panel.css +1 -3
  138. package/components/panel/panel.js +8 -32
  139. package/components/panel/panel.less +9 -9
  140. package/components/panel/resizable-panel.js +2 -4
  141. package/components/photo-browser/photo-browser-class.js +12 -47
  142. package/components/photo-browser/photo-browser-rtl.css +1 -1
  143. package/components/photo-browser/photo-browser-vars.less +8 -10
  144. package/components/photo-browser/photo-browser.css +1 -1
  145. package/components/photo-browser/photo-browser.d.ts +2 -4
  146. package/components/photo-browser/photo-browser.js +1 -3
  147. package/components/photo-browser/photo-browser.less +15 -71
  148. package/components/picker/picker-class.js +4 -5
  149. package/components/picker/picker-ios.less +6 -1
  150. package/components/picker/picker-md.less +9 -0
  151. package/components/picker/picker-rtl.css +1 -1
  152. package/components/picker/picker-vars.less +1 -1
  153. package/components/picker/picker.css +1 -1
  154. package/components/picker/picker.d.ts +1 -1
  155. package/components/picker/picker.js +2 -5
  156. package/components/picker/picker.less +0 -4
  157. package/components/pie-chart/pie-chart-class.js +7 -14
  158. package/components/pie-chart/pie-chart-rtl.css +1 -1
  159. package/components/pie-chart/pie-chart.css +1 -1
  160. package/components/popover/popover-class.js +22 -62
  161. package/components/popover/popover-ios.less +66 -2
  162. package/components/popover/popover-md.less +2 -27
  163. package/components/popover/popover-rtl.css +1 -1
  164. package/components/popover/popover-vars.less +2 -3
  165. package/components/popover/popover.css +1 -1
  166. package/components/popover/popover.d.ts +0 -2
  167. package/components/popover/popover.js +2 -9
  168. package/components/popover/popover.less +28 -50
  169. package/components/popup/popup-class.js +15 -9
  170. package/components/popup/popup-rtl.css +1 -1
  171. package/components/popup/popup-vars.less +2 -2
  172. package/components/popup/popup.css +1 -1
  173. package/components/popup/popup.js +2 -8
  174. package/components/popup/popup.less +6 -6
  175. package/components/preloader/preloader-rtl.css +1 -1
  176. package/components/preloader/preloader.css +1 -1
  177. package/components/preloader/preloader.js +2 -8
  178. package/components/progressbar/progressbar-md.less +12 -0
  179. package/components/progressbar/progressbar-rtl.css +1 -1
  180. package/components/progressbar/progressbar-vars.less +6 -5
  181. package/components/progressbar/progressbar.css +1 -1
  182. package/components/progressbar/progressbar.js +3 -12
  183. package/components/progressbar/progressbar.less +6 -0
  184. package/components/pull-to-refresh/pull-to-refresh-class.js +5 -12
  185. package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -1
  186. package/components/pull-to-refresh/pull-to-refresh.css +1 -1
  187. package/components/radio/radio-rtl.css +1 -1
  188. package/components/radio/radio.css +1 -1
  189. package/components/range/range-class.js +34 -27
  190. package/components/range/range-ios.less +60 -0
  191. package/components/range/range-md.less +67 -4
  192. package/components/range/range-rtl.css +1 -1
  193. package/components/range/range-vars.less +18 -13
  194. package/components/range/range.css +1 -1
  195. package/components/range/range.d.ts +3 -1
  196. package/components/range/range.js +2 -8
  197. package/components/range/range.less +11 -24
  198. package/components/searchbar/searchbar-class.js +7 -8
  199. package/components/searchbar/searchbar-ios.less +37 -13
  200. package/components/searchbar/searchbar-md.less +5 -0
  201. package/components/searchbar/searchbar-rtl.css +1 -1
  202. package/components/searchbar/searchbar-vars.less +13 -16
  203. package/components/searchbar/searchbar.css +1 -1
  204. package/components/searchbar/searchbar.js +4 -32
  205. package/components/searchbar/searchbar.less +4 -5
  206. package/components/sheet/sheet-class.js +21 -17
  207. package/components/sheet/sheet-ios.less +10 -0
  208. package/components/sheet/sheet-md.less +14 -0
  209. package/components/sheet/sheet-rtl.css +1 -1
  210. package/components/sheet/sheet-vars.less +5 -9
  211. package/components/sheet/sheet.css +1 -1
  212. package/components/sheet/sheet.js +2 -8
  213. package/components/sheet/sheet.less +5 -17
  214. package/components/skeleton/skeleton-rtl.css +1 -1
  215. package/components/skeleton/skeleton.css +1 -1
  216. package/components/smart-select/smart-select-class.js +15 -20
  217. package/components/smart-select/smart-select-rtl.css +1 -1
  218. package/components/smart-select/smart-select.css +1 -1
  219. package/components/smart-select/smart-select.d.ts +5 -7
  220. package/components/smart-select/smart-select.js +4 -4
  221. package/components/sortable/sortable-rtl.css +1 -1
  222. package/components/sortable/sortable.css +1 -1
  223. package/components/sortable/sortable.js +8 -27
  224. package/components/statusbar/statusbar.js +2 -5
  225. package/components/stepper/stepper-rtl.css +1 -1
  226. package/components/stepper/stepper-vars.less +3 -3
  227. package/components/stepper/stepper.css +1 -1
  228. package/components/stepper/stepper.js +2 -8
  229. package/components/subnavbar/subnavbar-ios.less +16 -1
  230. package/components/subnavbar/subnavbar-md.less +5 -5
  231. package/components/subnavbar/subnavbar-vars.less +12 -6
  232. package/components/subnavbar/subnavbar.less +5 -6
  233. package/components/swipeout/swipeout-ios.less +37 -0
  234. package/components/swipeout/swipeout-md.less +56 -0
  235. package/components/swipeout/swipeout-rtl.css +1 -1
  236. package/components/swipeout/swipeout-vars.less +13 -2
  237. package/components/swipeout/swipeout.css +1 -1
  238. package/components/swipeout/swipeout.js +102 -35
  239. package/components/swipeout/swipeout.less +20 -44
  240. package/components/swiper/swiper-rtl.css +1 -1
  241. package/components/swiper/swiper.css +1 -1
  242. package/components/tabs/tabs-rtl.css +1 -1
  243. package/components/tabs/tabs.css +1 -1
  244. package/components/tabs/tabs.js +3 -9
  245. package/components/text-editor/text-editor-class.js +1 -1
  246. package/components/text-editor/text-editor-rtl.css +1 -1
  247. package/components/text-editor/text-editor.css +1 -1
  248. package/components/timeline/timeline-ios.less +0 -5
  249. package/components/timeline/timeline-md.less +0 -5
  250. package/components/timeline/timeline-rtl.css +1 -1
  251. package/components/timeline/timeline-vars.less +1 -17
  252. package/components/timeline/timeline.css +1 -1
  253. package/components/timeline/timeline.less +0 -196
  254. package/components/toast/toast-class.js +2 -2
  255. package/components/toast/toast-ios.less +2 -0
  256. package/components/toast/toast-rtl.css +1 -1
  257. package/components/toast/toast-vars.less +2 -4
  258. package/components/toast/toast.css +1 -1
  259. package/components/toast/toast.less +1 -1
  260. package/components/toggle/toggle-class.js +5 -12
  261. package/components/toggle/toggle-ios.less +68 -50
  262. package/components/toggle/toggle-rtl.css +1 -1
  263. package/components/toggle/toggle-vars.less +2 -2
  264. package/components/toggle/toggle.css +1 -1
  265. package/components/toolbar/tabbar-highlight.js +134 -0
  266. package/components/toolbar/toolbar-ios.less +160 -14
  267. package/components/toolbar/toolbar-md.less +77 -3
  268. package/components/toolbar/toolbar-vars.less +14 -10
  269. package/components/toolbar/toolbar.js +32 -13
  270. package/components/toolbar/toolbar.less +8 -56
  271. package/components/tooltip/tooltip-class.js +13 -16
  272. package/components/tooltip/tooltip-rtl.css +1 -1
  273. package/components/tooltip/tooltip.css +1 -1
  274. package/components/tooltip/tooltip.js +0 -16
  275. package/components/touch-highlight/touch-highlight-ios.less +17 -0
  276. package/components/touch-highlight/touch-highlight-md.less +2 -0
  277. package/components/touch-highlight/touch-highlight-vars.less +8 -0
  278. package/components/touch-highlight/touch-highlight.d.ts +25 -0
  279. package/components/touch-highlight/touch-highlight.js +123 -0
  280. package/components/touch-highlight/touch-highlight.less +9 -0
  281. package/components/touch-ripple/touch-ripple.js +1 -4
  282. package/components/treeview/treeview-rtl.css +1 -1
  283. package/components/treeview/treeview.css +1 -1
  284. package/components/typography/typography-rtl.css +1 -1
  285. package/components/typography/typography.css +1 -1
  286. package/components/view/resizable-view.js +2 -4
  287. package/components/view/view-class.js +1 -15
  288. package/components/view/view.d.ts +0 -4
  289. package/components/view/view.js +1 -5
  290. package/components/virtual-list/virtual-list-class.js +2 -8
  291. package/framework7-bundle-rtl.css +2284 -3019
  292. package/framework7-bundle-rtl.min.css +4 -10
  293. package/framework7-bundle.css +2245 -2978
  294. package/framework7-bundle.esm.js +5 -4
  295. package/framework7-bundle.js +7180 -6477
  296. package/framework7-bundle.js.map +1 -1
  297. package/framework7-bundle.less +4 -3
  298. package/framework7-bundle.min.css +4 -10
  299. package/framework7-bundle.min.js +4 -4
  300. package/framework7-bundle.min.js.map +1 -1
  301. package/framework7-lite-bundle.esm.js +5 -4
  302. package/framework7-lite.esm.js +5 -4
  303. package/framework7-rtl.css +509 -844
  304. package/framework7-rtl.min.css +4 -8
  305. package/framework7-types.d.ts +5 -1
  306. package/framework7.css +509 -843
  307. package/framework7.d.ts +4 -0
  308. package/framework7.esm.js +5 -4
  309. package/framework7.less +4 -3
  310. package/framework7.min.css +4 -8
  311. package/less/mixins.less +10 -12
  312. package/modules/component/$h.js +1 -4
  313. package/modules/component/$jsx.js +1 -4
  314. package/modules/component/component-class.js +49 -114
  315. package/modules/component/component.js +6 -7
  316. package/modules/component/eventslisteners.js +1 -4
  317. package/modules/component/snabbdom/modules/hero.js +0 -1
  318. package/modules/component/snabbdom/modules/style.js +1 -1
  319. package/modules/component/vdom.js +17 -29
  320. package/modules/router/back.js +22 -96
  321. package/modules/router/clear-previous-history.js +1 -7
  322. package/modules/router/component-loader.js +23 -32
  323. package/modules/router/modal.js +1 -4
  324. package/modules/router/navigate.js +28 -167
  325. package/modules/router/redirect.js +1 -5
  326. package/modules/router/router-class.js +28 -293
  327. package/modules/router/router.d.ts +2 -0
  328. package/modules/router/swipe-back.js +10 -318
  329. package/modules/router/tab.js +1 -4
  330. package/modules/service-worker/service-worker.js +1 -1
  331. package/modules/store/create-store.js +2 -8
  332. package/modules/touch/touch.d.ts +5 -3
  333. package/modules/touch/touch.js +23 -37
  334. package/package.json +4 -4
  335. package/shared/$jsx.js +1 -4
  336. package/shared/class.js +5 -26
  337. package/shared/constructor-methods.js +4 -19
  338. package/shared/events-class.js +3 -12
  339. package/shared/get-device.js +4 -11
  340. package/shared/get-support.d.ts +0 -6
  341. package/shared/get-support.js +1 -20
  342. package/shared/material-color-utils.js +2102 -693
  343. package/shared/material-colors.js +94 -23
  344. package/shared/modal-methods.js +2 -8
  345. package/shared/utils.js +23 -45
@@ -0,0 +1,134 @@
1
+ import { getDocument } from 'ssr-window';
2
+ const startAnimation = data => {
3
+ data.raf = requestAnimationFrame(() => {
4
+ if (!data.setTransform) return;
5
+ const highlightEl = data.highlightEl;
6
+ if (!highlightEl) return;
7
+ highlightEl.style.transform = data.setTransform;
8
+ highlightEl.style.transitionTimingFunction = 'ease-out';
9
+ data.setTransform = null;
10
+ });
11
+ };
12
+ const stopAnimation = data => {
13
+ cancelAnimationFrame(data.raf);
14
+ };
15
+ const setHighlightOnTouch = (data, e) => {
16
+ const {
17
+ rect,
18
+ linkEls,
19
+ highlightEl
20
+ } = data;
21
+ if (!highlightEl) return;
22
+ const {
23
+ clientX
24
+ } = e;
25
+ const highlightWidth = rect.width / linkEls.length;
26
+ const leftOffset = clientX - rect.left - highlightWidth / 2;
27
+ const minLeft = 0;
28
+ const maxLeft = rect.width - highlightWidth;
29
+ const translateX = Math.max(minLeft, Math.min(leftOffset, maxLeft));
30
+ const linkCenters = [...linkEls].map((el, index) => {
31
+ return index * highlightWidth + highlightWidth / 2;
32
+ });
33
+ const closestLinkCenter = linkCenters.reduce((prev, curr) => {
34
+ const highlightCenter = translateX + highlightWidth / 2;
35
+ return Math.abs(curr - highlightCenter) < Math.abs(prev - highlightCenter) ? curr : prev;
36
+ }, linkCenters[0]);
37
+ const closestLinkIndex = linkCenters.indexOf(closestLinkCenter);
38
+ data.newActiveIndex = closestLinkIndex;
39
+ highlightEl.classList.add('tab-link-highlight-pressed');
40
+ data.setTransform = `translateX(${translateX}px)`;
41
+ startAnimation(data);
42
+ };
43
+ const unsetHighlightOnTouch = data => {
44
+ cancelAnimationFrame(data.raf);
45
+ data.setTransform = null;
46
+ const {
47
+ highlightEl
48
+ } = data;
49
+ if (!highlightEl) return;
50
+ highlightEl.classList.remove('tab-link-highlight-pressed');
51
+ const {
52
+ activeIndex,
53
+ newActiveIndex,
54
+ linkEls
55
+ } = data;
56
+ if (activeIndex !== newActiveIndex) {
57
+ linkEls[newActiveIndex].click();
58
+ }
59
+ highlightEl.style.transform = `translateX(${newActiveIndex * 100}%)`;
60
+ highlightEl.style.transitionTimingFunction = '';
61
+ highlightEl.style.transform = `translateX(${newActiveIndex * 100}%)`;
62
+ };
63
+ export const initTabbarHighlight = el => {
64
+ const document = getDocument();
65
+ if (!el) return;
66
+ if (el.classList.contains('tabbar-scrollable')) {
67
+ return;
68
+ }
69
+ const highlightEl = el.querySelector('.tab-link-highlight');
70
+ const toolbarPaneEl = el.querySelector('.toolbar-pane');
71
+ if (!highlightEl || !toolbarPaneEl) return;
72
+ const data = {
73
+ el,
74
+ highlightEl,
75
+ touched: false,
76
+ moved: false,
77
+ rect: null,
78
+ setTransform: null,
79
+ raf: null
80
+ };
81
+ el.f7ToolbarHighlightData = data;
82
+ el.f7ToolbarOnPointer = e => {
83
+ if (e.type === 'touchstart') {
84
+ e.preventDefault();
85
+ }
86
+ if (e.pointerType !== 'touch') return;
87
+ if (!el) return;
88
+ if (e.type === 'pointerdown') {
89
+ data.linkEls = el.querySelectorAll('.tab-link');
90
+ data.rect = toolbarPaneEl.getBoundingClientRect();
91
+ data.touched = true;
92
+ setHighlightOnTouch(data, e);
93
+ startAnimation(data);
94
+ }
95
+ if (e.type === 'pointermove') {
96
+ if (!data.touched) return;
97
+ data.moved = true;
98
+ setHighlightOnTouch(data, e);
99
+ }
100
+ if (e.type === 'pointerup') {
101
+ if (!data.touched) return;
102
+ data.touched = false;
103
+ data.moved = false;
104
+ unsetHighlightOnTouch(data);
105
+ stopAnimation(data);
106
+ }
107
+ };
108
+ el.addEventListener('touchstart', el.f7ToolbarOnPointer, {
109
+ passive: false
110
+ });
111
+ el.addEventListener('pointerdown', el.f7ToolbarOnPointer, {
112
+ passive: false
113
+ });
114
+ document.addEventListener('pointermove', el.f7ToolbarOnPointer, {
115
+ passive: false
116
+ });
117
+ document.addEventListener('pointerup', el.f7ToolbarOnPointer, {
118
+ passive: false
119
+ });
120
+ document.addEventListener('pointercancel', el.f7ToolbarOnPointer, {
121
+ passive: false
122
+ });
123
+ };
124
+ export const destroyTabbarHighlight = el => {
125
+ if (!el || !el.f7ToolbarOnPointer) return;
126
+ const document = getDocument();
127
+ el.removeEventListener('touchstart', el.f7ToolbarOnPointer);
128
+ el.removeEventListener('pointerdown', el.f7ToolbarOnPointer);
129
+ document.removeEventListener('pointermove', el.f7ToolbarOnPointer);
130
+ document.removeEventListener('pointerup', el.f7ToolbarOnPointer);
131
+ document.removeEventListener('pointercancel', el.f7ToolbarOnPointer);
132
+ el.f7ToolbarOnPointer = null;
133
+ el.f7ToolbarHighlightData = null;
134
+ };
@@ -1,13 +1,119 @@
1
1
  .ios {
2
+ .toolbar-pane {
3
+ user-select: none;
4
+ }
5
+ .toolbar-pane,
6
+ .toolbar .left,
7
+ .toolbar .right {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ height: 100%;
12
+ position: relative;
13
+ z-index: 1;
14
+ border-radius: 32px;
15
+ .ios-glass();
16
+ }
2
17
  .toolbar {
3
- a.icon-only {
4
- min-height: var(--f7-toolbar-height);
18
+ .left {
19
+ margin-right: auto;
20
+ }
21
+ .right {
22
+ margin-left: auto;
23
+ }
24
+ .left:empty,
25
+ .right:empty {
26
+ display: none;
27
+ }
28
+
29
+ a:is(.icon-only, :has(i:only-child), :has(svg:only-child)) {
5
30
  display: flex;
6
31
  justify-content: center;
7
32
  align-items: center;
8
33
  margin: 0;
9
- min-width: 44px;
34
+ min-width: 48px;
35
+ min-height: 48px;
36
+ padding: 0;
37
+ }
38
+ .link {
39
+ padding: 0 12px;
40
+ height: 100%;
41
+ }
42
+ &::before,
43
+ &::after {
44
+ pointer-events: none;
45
+ content: '';
46
+ position: absolute;
47
+ inset: 0;
10
48
  }
49
+ &::before {
50
+ backdrop-filter: blur(2px);
51
+ mask-image: linear-gradient(
52
+ to top,
53
+ black calc(50% + var(--f7-safe-area-bottom, 0px)),
54
+ transparent 100%
55
+ );
56
+ }
57
+ &::after {
58
+ background-image: linear-gradient(
59
+ to top,
60
+ var(--f7-toolbar-bg-color, var(--f7-bars-bg-color)) var(--f7-safe-area-bottom, 0px),
61
+ transparent 100%
62
+ );
63
+ }
64
+ &.toolbar-bottom,
65
+ &.messagebar {
66
+ &::before,
67
+ &::after {
68
+ top: -16px;
69
+ }
70
+ .toolbar-inner {
71
+ padding-bottom: 16px;
72
+ }
73
+ }
74
+ &.toolbar-top,
75
+ &:not(.toolbar-bottom, .toolbar-top, .messagebar) {
76
+ &::before {
77
+ mask-image: linear-gradient(
78
+ to bottom,
79
+ black calc(50% + var(--f7-safe-area-top, 0px)),
80
+ transparent 100%
81
+ );
82
+ }
83
+ &::after {
84
+ background-image: linear-gradient(
85
+ to bottom,
86
+ var(--f7-toolbar-bg-color, var(--f7-bars-bg-color)) var(--f7-safe-area-top, 0px),
87
+ transparent 100%
88
+ );
89
+ }
90
+ &::before,
91
+ &::after {
92
+ bottom: -16px;
93
+ }
94
+ .toolbar-inner {
95
+ padding-top: 16px;
96
+ }
97
+ }
98
+ }
99
+ .navbar ~ .toolbar-top {
100
+ &::before,
101
+ &::after {
102
+ display: none;
103
+ }
104
+ }
105
+ .toolbar-inner {
106
+ justify-content: center;
107
+ overflow: visible;
108
+ gap: 16px;
109
+ }
110
+ .tabbar-scrollable .toolbar-pane {
111
+ .scrollable();
112
+ .no-scrollbar();
113
+ justify-content: flex-start;
114
+ }
115
+ .tabbar:not(.tabbar-scrollable) {
116
+ touch-action: none;
11
117
  }
12
118
  .tabbar-icons {
13
119
  .tab-link,
@@ -20,17 +126,16 @@
20
126
  }
21
127
  }
22
128
  }
23
- @media (min-width: 768px) and (min-height: 600px) {
24
- .tabbar,
25
- .tabbar-icons {
26
- .tab-link,
27
- .link {
28
- justify-content: center;
29
- flex-direction: row;
30
- i + span {
31
- margin-left: 5px;
32
- }
33
- }
129
+ @media (max-width: 767px) {
130
+ .tabbar .toolbar-pane {
131
+ width: 100%;
132
+ }
133
+ }
134
+ @media (min-width: 768px) {
135
+ .tabbar .tab-link {
136
+ padding-left: 16px;
137
+ padding-right: 16px;
138
+ min-width: 96px;
34
139
  }
35
140
  }
36
141
 
@@ -44,4 +149,45 @@
44
149
  padding: 0 8px;
45
150
  }
46
151
  }
152
+ .tab-link-highlight {
153
+ position: absolute;
154
+ height: 100%;
155
+ top: 0;
156
+ transition-duration: 300ms;
157
+ border-radius: inherit;
158
+ .ltr({
159
+ left: 0;
160
+ });
161
+ .rtl({
162
+ right: 0;
163
+ });
164
+ &::before,
165
+ &::after {
166
+ content: '';
167
+ position: absolute;
168
+ inset: 4px;
169
+ border-radius: inherit;
170
+ transition-duration: 300ms;
171
+ }
172
+ &::before {
173
+ background-color: var(--f7-tabbar-link-highlight-bg-color);
174
+ }
175
+ &::after {
176
+ opacity: 0;
177
+ box-shadow: var(--f7-glass-shadow-thumb);
178
+ background-color: var(--f7-tabbar-link-highlight-active-bg-color);
179
+ }
180
+ }
181
+ .tab-link-highlight-pressed {
182
+ &::before {
183
+ opacity: 0;
184
+ }
185
+ &::after {
186
+ opacity: 1;
187
+ }
188
+ &::before,
189
+ &::after {
190
+ scale: 1.4;
191
+ }
192
+ }
47
193
  }
@@ -1,14 +1,58 @@
1
1
  .md {
2
+ .toolbar-pane {
3
+ display: contents;
4
+ }
2
5
  .toolbar {
6
+ background-color: var(--f7-toolbar-bg-color, var(--f7-bars-bg-color));
3
7
  .link {
4
8
  justify-content: center;
5
9
  padding: 0 12px;
6
10
  min-width: 48px;
11
+ min-height: 48px;
12
+ line-height: var(--f7-toolbar-link-line-height, var(--f7-toolbar-height));
13
+ height: var(--f7-toolbar-link-height, var(--f7-toolbar-height));
7
14
  }
8
- a.icon-only {
9
- min-width: 0;
15
+ a:is(.icon-only, :has(i:only-child), :has(svg:only-child)) {
16
+ min-width: 48px;
10
17
  flex-shrink: 0;
18
+ padding: 0;
19
+ }
20
+ }
21
+ .toolbar-top,
22
+ .md .toolbar-top-md {
23
+ &.no-outline {
24
+ &:after {
25
+ display: none !important;
26
+ }
27
+ }
28
+ &.toolbar-hidden {
29
+ &:before {
30
+ display: none !important;
31
+ }
32
+ }
33
+ &:after,
34
+ &:before {
35
+ backface-visibility: hidden;
36
+ }
37
+ .hairline(bottom, var(--f7-toolbar-border-color, var(--f7-bars-border-color)));
38
+ }
39
+ .toolbar-bottom,
40
+ .md .toolbar-bottom-md {
41
+ &.no-outline {
42
+ &:before {
43
+ display: none !important;
44
+ }
45
+ }
46
+ &.toolbar-hidden {
47
+ &:after {
48
+ display: none !important;
49
+ }
11
50
  }
51
+ .hairline(top, var(--f7-toolbar-border-color, var(--f7-bars-border-color)));
52
+ }
53
+ .toolbar-inner {
54
+ justify-content: space-between;
55
+ overflow: hidden;
12
56
  }
13
57
  .tabbar,
14
58
  .tabbar-icons {
@@ -17,7 +61,7 @@
17
61
  padding-left: 0;
18
62
  padding-right: 0;
19
63
  }
20
- a.icon-only {
64
+ a:is(.icon-only, :has(i:only-child), :has(svg:only-child)) {
21
65
  flex-shrink: initial;
22
66
  }
23
67
  .tab-link {
@@ -74,4 +118,34 @@
74
118
  padding: 0 12px;
75
119
  }
76
120
  }
121
+ .toolbar-top-md,
122
+ .toolbar-top {
123
+ .tab-link-highlight {
124
+ bottom: 0;
125
+ }
126
+ }
127
+ .toolbar-bottom,
128
+ .toolbar-bottom-md {
129
+ .tab-link-highlight {
130
+ top: 0;
131
+ }
132
+ }
133
+ .tabbar,
134
+ .tabbar-icons {
135
+ &.tabbar-icons .tab-link-highlight {
136
+ display: none;
137
+ }
138
+ &:not(.tabbar-icons) .tab-link-highlight {
139
+ position: absolute;
140
+ height: 2px;
141
+ background: var(--f7-tabbar-link-active-border-color, var(--f7-theme-color));
142
+ transition-duration: 300ms;
143
+ .ltr({
144
+ left: 0;
145
+ });
146
+ .rtl({
147
+ right: 0;
148
+ });
149
+ }
150
+ }
77
151
  }
@@ -3,7 +3,6 @@
3
3
  --f7-toolbar-bg-color: var(--f7-bars-bg-color);
4
4
  --f7-toolbar-bg-color-rgb: var(--f7-bars-bg-color-rgb);
5
5
  --f7-toolbar-border-color: var(--f7-bars-border-color);
6
- --f7-toolbar-link-color: var(--f7-bars-link-color);
7
6
  --f7-toolbar-text-color: var(--f7-bars-text-color);
8
7
  */
9
8
  --f7-tabbar-link-active-bg-color: transparent;
@@ -11,18 +10,20 @@
11
10
  --f7-toolbar-hide-show-transition-duration: 400ms;
12
11
  }
13
12
  .ios-vars({
14
- --f7-toolbar-height: 44px;
13
+ --f7-toolbar-height: 64px;
15
14
  --f7-toolbar-font-size: 17px;
16
- --f7-toolbar-inner-padding-left: 8px;
17
- --f7-toolbar-inner-padding-right: 8px;
15
+ --f7-toolbar-inner-padding-left: 16px;
16
+ --f7-toolbar-inner-padding-right: 16px;
18
17
  --f7-toolbar-link-font-weight: 400;
18
+ --f7-toolbar-link-color: var(--f7-bars-text-color);
19
+ --f7-tabbar-link-inactive-color: var(--f7-bars-text-color);
19
20
  /*
20
21
  --f7-toolbar-link-height: var(--f7-toolbar-height);
21
22
  --f7-toolbar-link-line-height: var(--f7-toolbar-height);
22
23
  --f7-tabbar-link-active-color: var(--f7-theme-color);
23
24
  */
24
- --f7-tabbar-icons-height: 50px;
25
- --f7-tabbar-icons-tablet-height: 50px;
25
+ --f7-tabbar-icons-height: 80px;
26
+ --f7-tabbar-icons-tablet-height: 80px;
26
27
  --f7-tabbar-icon-size: 28px;
27
28
  --f7-tabbar-link-text-transform: none;
28
29
  --f7-tabbar-link-font-weight: 400;
@@ -32,11 +33,13 @@
32
33
  --f7-tabbar-label-tablet-font-size: 14px;
33
34
  --f7-tabbar-label-font-weight: 500;
34
35
  --f7-tabbar-label-letter-spacing: 0.01;
35
- .light-vars({
36
- --f7-tabbar-link-inactive-color: rgba(0,0,0,0.4);
37
- });
38
36
  .dark-vars({
39
- --f7-tabbar-link-inactive-color: rgba(255,255,255,0.54);
37
+ --f7-tabbar-link-highlight-bg-color: rgba(255,255,255,0.15);
38
+ --f7-tabbar-link-highlight-active-bg-color: rgba(255,255,255,0.1);
39
+ });
40
+ .light-vars({
41
+ --f7-tabbar-link-highlight-bg-color: rgba(0,0,0,0.1);
42
+ --f7-tabbar-link-highlight-active-bg-color: rgba(0,0,0,0.05);
40
43
  });
41
44
 
42
45
  });
@@ -46,6 +49,7 @@
46
49
  --f7-toolbar-inner-padding-left: 0px;
47
50
  --f7-toolbar-inner-padding-right: 0px;
48
51
  /*
52
+ --f7-toolbar-link-color: var(--f7-bars-link-color);
49
53
  --f7-toolbar-link-height: var(--f7-toolbar-height);
50
54
  --f7-toolbar-link-line-height: var(--f7-toolbar-height);
51
55
  */
@@ -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 (app.theme === 'ios' && !$tabbarEl.hasClass('tabbar-highlight')) return;
8
- if ($tabbarEl.length === 0 || !($tabbarEl.hasClass('tabbar') || $tabbarEl.hasClass('tabbar-icons'))) return;
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
- $tabbarEl.children('.toolbar-inner').append('<span class="tab-link-highlight"></span>');
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
- $tabbarEl.children('.toolbar-inner').append($highlightEl);
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
- hide(el, animate) {
41
- if (animate === void 0) {
42
- animate = true;
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
- background-color: var(--f7-toolbar-bg-color, var(--f7-bars-bg-color));
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
- .ios-translucent-bars(var(--f7-toolbar-bg-color-rgb, var(--f7-bars-bg-color-rgb)));
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
- line-height: var(--f7-toolbar-link-line-height, var(--f7-toolbar-height));
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
- justify-content: space-between;
73
+
107
74
  box-sizing: border-box;
108
75
  align-items: center;
109
76
  align-content: center;
110
- overflow: hidden;
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
  }