@xenknight/framework7 0.0.3 → 0.0.6

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 (92) hide show
  1. package/components/actions/actions-ios.less +22 -15
  2. package/components/actions/actions-rtl.css +1 -1
  3. package/components/actions/actions-vars.less +4 -7
  4. package/components/actions/actions.css +1 -1
  5. package/components/actions/actions.less +0 -3
  6. package/components/app/app-class.d.ts +2 -0
  7. package/components/app/app-class.js +10 -2
  8. package/components/app/app-vars.less +36 -0
  9. package/components/block/block-vars.less +6 -6
  10. package/components/button/button-vars.less +11 -10
  11. package/components/card/card-rtl.css +1 -1
  12. package/components/card/card-vars.less +5 -5
  13. package/components/card/card.css +1 -1
  14. package/components/dialog/dialog-class.js +6 -3
  15. package/components/dialog/dialog-ios.less +10 -34
  16. package/components/dialog/dialog-md.less +2 -22
  17. package/components/dialog/dialog-rtl.css +1 -1
  18. package/components/dialog/dialog-vars.less +8 -10
  19. package/components/dialog/dialog.css +1 -1
  20. package/components/dialog/dialog.js +3 -3
  21. package/components/dialog/dialog.less +6 -25
  22. package/components/list/list-vars.less +7 -5
  23. package/components/list/list.less +1 -1
  24. package/components/notification/notification-class.js +6 -6
  25. package/components/notification/notification-ios.less +3 -8
  26. package/components/notification/notification-md.less +1 -20
  27. package/components/notification/notification-rtl.css +1 -1
  28. package/components/notification/notification-vars.less +13 -16
  29. package/components/notification/notification.css +1 -1
  30. package/components/notification/notification.less +13 -1
  31. package/components/page/page-ios.less +4 -4
  32. package/components/page/page-md.less +2 -2
  33. package/components/popover/popover-class.js +21 -58
  34. package/components/popover/popover-ios.less +66 -2
  35. package/components/popover/popover-md.less +2 -27
  36. package/components/popover/popover-rtl.css +1 -1
  37. package/components/popover/popover-vars.less +2 -3
  38. package/components/popover/popover.css +1 -1
  39. package/components/popover/popover.d.ts +0 -2
  40. package/components/popover/popover.js +0 -1
  41. package/components/popover/popover.less +28 -50
  42. package/components/range/range-class.js +34 -27
  43. package/components/range/range-ios.less +60 -0
  44. package/components/range/range-md.less +67 -4
  45. package/components/range/range-rtl.css +1 -1
  46. package/components/range/range-vars.less +18 -13
  47. package/components/range/range.css +1 -1
  48. package/components/range/range.d.ts +3 -1
  49. package/components/range/range.less +11 -24
  50. package/components/swipeout/swipeout-ios.less +37 -0
  51. package/components/swipeout/swipeout-md.less +56 -0
  52. package/components/swipeout/swipeout-rtl.css +1 -1
  53. package/components/swipeout/swipeout-vars.less +13 -2
  54. package/components/swipeout/swipeout.css +1 -1
  55. package/components/swipeout/swipeout.js +99 -23
  56. package/components/swipeout/swipeout.less +20 -44
  57. package/components/toast/toast-class.js +2 -2
  58. package/components/toast/toast-ios.less +2 -0
  59. package/components/toast/toast-rtl.css +1 -1
  60. package/components/toast/toast-vars.less +2 -4
  61. package/components/toast/toast.css +1 -1
  62. package/components/toast/toast.less +1 -1
  63. package/components/toggle/toggle-class.js +4 -8
  64. package/components/toggle/toggle-ios.less +68 -50
  65. package/components/toggle/toggle-rtl.css +1 -1
  66. package/components/toggle/toggle-vars.less +2 -2
  67. package/components/toggle/toggle.css +1 -1
  68. package/framework7-bundle-rtl.css +551 -452
  69. package/framework7-bundle-rtl.min.css +5 -5
  70. package/framework7-bundle.css +551 -452
  71. package/framework7-bundle.esm.js +2 -2
  72. package/framework7-bundle.js +2460 -858
  73. package/framework7-bundle.js.map +1 -1
  74. package/framework7-bundle.less +2 -2
  75. package/framework7-bundle.min.css +5 -5
  76. package/framework7-bundle.min.js +3 -3
  77. package/framework7-bundle.min.js.map +1 -1
  78. package/framework7-lite-bundle.esm.js +2 -2
  79. package/framework7-lite.esm.js +2 -2
  80. package/framework7-rtl.css +63 -29
  81. package/framework7-rtl.min.css +4 -4
  82. package/framework7.css +63 -29
  83. package/framework7.esm.js +2 -2
  84. package/framework7.less +2 -2
  85. package/framework7.min.css +4 -4
  86. package/less/mixins.less +8 -0
  87. package/package.json +1 -1
  88. package/shared/get-support.d.ts +0 -6
  89. package/shared/get-support.js +1 -20
  90. package/shared/material-color-utils.js +2153 -679
  91. package/shared/material-colors.js +97 -17
  92. package/shared/utils.js +18 -6
@@ -1,7 +1,6 @@
1
1
  import { getDocument } from 'ssr-window';
2
2
  import $ from '../../shared/dom7.js';
3
3
  import { nextFrame, bindMethods } from '../../shared/utils.js';
4
- import { getSupport } from '../../shared/get-support.js';
5
4
  const Swipeout = {
6
5
  init() {
7
6
  const app = this;
@@ -28,6 +27,7 @@ const Swipeout = {
28
27
  let $overswipeRightButton;
29
28
  let overswipeLeft;
30
29
  let overswipeRight;
30
+ const isIOS = app.theme === 'ios';
31
31
  function handleTouchStart(e) {
32
32
  if (!app.swipeout.allow) return;
33
33
  isMoved = false;
@@ -46,12 +46,16 @@ const Swipeout = {
46
46
  isScrolling = !!(isScrolling || Math.abs(pageY - touchesStart.y) > Math.abs(pageX - touchesStart.x));
47
47
  }
48
48
  if (isScrolling) {
49
+ $swipeoutEl.removeClass('swipeout-active');
49
50
  isTouched = false;
50
51
  return;
51
52
  }
52
53
  if (!isMoved) {
53
54
  if ($('.list.sortable-opened').length > 0) return;
54
55
  $swipeoutContent = $swipeoutEl.find('.swipeout-content');
56
+ if (!app.params.swipeout.noFollow) {
57
+ $swipeoutEl.addClass('swipeout-active');
58
+ }
55
59
  $actionsRight = $swipeoutEl.find('.swipeout-actions-right');
56
60
  $actionsLeft = $swipeoutEl.find('.swipeout-actions-left');
57
61
  actionsLeftWidth = null;
@@ -91,6 +95,7 @@ const Swipeout = {
91
95
  }
92
96
  if (translate > 0 && $actionsLeft.length === 0 || translate < 0 && $actionsRight.length === 0) {
93
97
  if (!opened) {
98
+ $swipeoutEl.removeClass('swipeout-active');
94
99
  isTouched = false;
95
100
  isMoved = false;
96
101
  $swipeoutContent.transform('');
@@ -151,11 +156,24 @@ const Swipeout = {
151
156
  if (typeof buttonEl.f7SwipeoutButtonOffset === 'undefined') {
152
157
  $buttonEl[0].f7SwipeoutButtonOffset = buttonEl.offsetLeft;
153
158
  }
159
+ if (typeof buttonEl.f7SwipeoutButtonWidth === 'undefined') {
160
+ $buttonEl[0].f7SwipeoutButtonWidth = buttonEl.offsetWidth;
161
+ }
154
162
  buttonOffset = buttonEl.f7SwipeoutButtonOffset;
163
+ const buttonWidth = $buttonEl[0].f7SwipeoutButtonWidth;
155
164
  if ($overswipeRightButton.length > 0 && $buttonEl.hasClass('swipeout-overswipe') && direction === 'to-left') {
156
- $buttonEl.css({
157
- left: `${overswipeRight ? -buttonOffset : 0}px`
158
- });
165
+ if (isIOS) {
166
+ const newWidth = overswipeRight ? buttonWidth + buttonOffset - 8 : buttonWidth;
167
+ const diff = newWidth - buttonWidth;
168
+ $buttonEl.css({
169
+ width: `${newWidth}px`,
170
+ marginLeft: overswipeRight ? `${-diff}px` : '0px'
171
+ });
172
+ } else {
173
+ $buttonEl.css({
174
+ left: `${overswipeRight ? -buttonOffset : 0}px`
175
+ });
176
+ }
159
177
  if (overswipeRight) {
160
178
  if (!$buttonEl.hasClass('swipeout-overswipe-active')) {
161
179
  $swipeoutEl.trigger('swipeout:overswipeenter');
@@ -170,7 +188,15 @@ const Swipeout = {
170
188
  $buttonEl.removeClass('swipeout-overswipe-active');
171
189
  }
172
190
  }
173
- $buttonEl.transform(`translate3d(${buttonTranslate - buttonOffset * (1 + Math.max(progress, -1))}px,0,0)`);
191
+ if (isIOS) {
192
+ const buttonEndPos = actionsRightWidth - buttonOffset;
193
+ const buttonStartPos = actionsRightWidth - buttonOffset - buttonWidth;
194
+ let buttonProgress = (-buttonTranslate - buttonStartPos) / (buttonEndPos - buttonStartPos);
195
+ buttonProgress = Math.max(Math.min(buttonProgress, 1), 0);
196
+ $buttonEl.transform(`scale(${buttonProgress})`);
197
+ } else {
198
+ $buttonEl.transform(`translate3d(${buttonTranslate - buttonOffset * (1 + Math.max(progress, -1))}px,0,0)`);
199
+ }
174
200
  });
175
201
  }
176
202
  if ($actionsLeft.length > 0) {
@@ -191,14 +217,27 @@ const Swipeout = {
191
217
  }
192
218
  $leftButtons.each((buttonEl, index) => {
193
219
  const $buttonEl = $(buttonEl);
220
+ if (typeof buttonEl.f7SwipeoutButtonWidth === 'undefined') {
221
+ $buttonEl[0].f7SwipeoutButtonWidth = buttonEl.offsetWidth;
222
+ }
194
223
  if (typeof buttonEl.f7SwipeoutButtonOffset === 'undefined') {
195
- $buttonEl[0].f7SwipeoutButtonOffset = actionsLeftWidth - buttonEl.offsetLeft - buttonEl.offsetWidth;
224
+ $buttonEl[0].f7SwipeoutButtonOffset = isIOS ? buttonEl.offsetLeft : actionsLeftWidth - buttonEl.offsetLeft - buttonEl.offsetWidth;
196
225
  }
226
+ const buttonWidth = $buttonEl[0].f7SwipeoutButtonWidth;
197
227
  buttonOffset = buttonEl.f7SwipeoutButtonOffset;
198
228
  if ($overswipeLeftButton.length > 0 && $buttonEl.hasClass('swipeout-overswipe') && direction === 'to-right') {
199
- $buttonEl.css({
200
- left: `${overswipeLeft ? buttonOffset : 0}px`
201
- });
229
+ if (isIOS) {
230
+ const newWidth = overswipeLeft ? actionsLeftWidth - 16 : buttonWidth;
231
+ const diff = newWidth - buttonWidth;
232
+ $buttonEl.css({
233
+ width: `${newWidth}px`,
234
+ marginRight: overswipeLeft ? `${-diff}px` : '0px'
235
+ });
236
+ } else {
237
+ $buttonEl.css({
238
+ left: `${overswipeLeft ? buttonOffset : 0}px`
239
+ });
240
+ }
202
241
  if (overswipeLeft) {
203
242
  if (!$buttonEl.hasClass('swipeout-overswipe-active')) {
204
243
  $swipeoutEl.trigger('swipeout:overswipeenter');
@@ -216,7 +255,15 @@ const Swipeout = {
216
255
  if ($leftButtons.length > 1) {
217
256
  $buttonEl.css('z-index', $leftButtons.length - index);
218
257
  }
219
- $buttonEl.transform(`translate3d(${buttonTranslate + buttonOffset * (1 - Math.min(progress, 1))}px,0,0)`);
258
+ if (isIOS) {
259
+ const buttonStartPos = buttonOffset;
260
+ const buttonEndPos = buttonStartPos + buttonWidth;
261
+ let buttonProgress = (buttonTranslate - buttonStartPos) / (buttonEndPos - buttonStartPos);
262
+ buttonProgress = Math.max(Math.min(buttonProgress, 1), 0);
263
+ $buttonEl.transform(`scale(${buttonProgress})`);
264
+ } else {
265
+ $buttonEl.transform(`translate3d(${buttonTranslate + buttonOffset * (1 - Math.min(progress, 1))}px,0,0)`);
266
+ }
220
267
  });
221
268
  }
222
269
  $swipeoutEl.trigger('swipeout', progress);
@@ -229,6 +276,7 @@ const Swipeout = {
229
276
  isMoved = false;
230
277
  return;
231
278
  }
279
+ $swipeoutEl.removeClass('swipeout-active');
232
280
  isTouched = false;
233
281
  isMoved = false;
234
282
  const timeDiff = new Date().getTime() - touchStartTime;
@@ -257,7 +305,11 @@ const Swipeout = {
257
305
  $buttons = direction === 'to-left' ? $rightButtons : $leftButtons;
258
306
  if ($buttons) {
259
307
  for (i = 0; i < $buttons.length; i += 1) {
260
- $($buttons[i]).transform(`translate3d(${newTranslate}px,0,0)`);
308
+ if (isIOS) {
309
+ $($buttons[i]).transform(`scale(1)`);
310
+ } else {
311
+ $($buttons[i]).transform(`translate3d(${newTranslate}px,0,0)`);
312
+ }
261
313
  }
262
314
  }
263
315
  if (overswipeRight) {
@@ -282,7 +334,11 @@ const Swipeout = {
282
334
  if (typeof buttonOffset === 'undefined') {
283
335
  $buttonEl[0].f7SwipeoutButtonOffset = actionsLeftWidth - buttonEl.offsetLeft - buttonEl.offsetWidth;
284
336
  }
285
- $buttonEl.transform(`translate3d(${buttonOffset}px,0,0)`);
337
+ if (isIOS) {
338
+ $buttonEl.transform(`scale(0)`);
339
+ } else {
340
+ $buttonEl.transform(`translate3d(${buttonOffset}px,0,0)`);
341
+ }
286
342
  });
287
343
  }
288
344
  if ($rightButtons && $rightButtons.length > 0 && $rightButtons !== $buttons) {
@@ -292,7 +348,11 @@ const Swipeout = {
292
348
  if (typeof buttonOffset === 'undefined') {
293
349
  $buttonEl[0].f7SwipeoutButtonOffset = buttonEl.offsetLeft;
294
350
  }
295
- $buttonEl.transform(`translate3d(${-buttonOffset}px,0,0)`);
351
+ if (isIOS) {
352
+ $buttonEl.transform(`scale(0)`);
353
+ } else {
354
+ $buttonEl.transform(`translate3d(${-buttonOffset}px,0,0)`);
355
+ }
296
356
  });
297
357
  }
298
358
  $swipeoutContent.transitionEnd(() => {
@@ -310,9 +370,9 @@ const Swipeout = {
310
370
  }
311
371
  });
312
372
  }
313
- const passiveListener = getSupport().passiveListener ? {
373
+ const passiveListener = {
314
374
  passive: true
315
- } : false;
375
+ };
316
376
  app.on('touchstart', e => {
317
377
  if (Swipeout.el) {
318
378
  const $targetEl = $(e.target);
@@ -354,10 +414,14 @@ const Swipeout = {
354
414
  if ($buttons.length > 1) {
355
415
  $buttons.each((buttonEl, buttonIndex) => {
356
416
  const $buttonEl = $(buttonEl);
357
- if (side === 'right') {
358
- $buttonEl.transform(`translate3d(${-buttonEl.offsetLeft}px,0,0)`);
417
+ if (app.theme === 'ios') {
418
+ $buttonEl.transform(`scale(1)`);
359
419
  } else {
360
- $buttonEl.css('z-index', $buttons.length - buttonIndex).transform(`translate3d(${swipeoutActionsWidth - buttonEl.offsetWidth - buttonEl.offsetLeft}px,0,0)`);
420
+ if (side === 'right') {
421
+ $buttonEl.transform(`translate3d(${-buttonEl.offsetLeft}px,0,0)`);
422
+ } else {
423
+ $buttonEl.css('z-index', $buttons.length - buttonIndex).transform(`translate3d(${swipeoutActionsWidth - buttonEl.offsetWidth - buttonEl.offsetLeft}px,0,0)`);
424
+ }
361
425
  }
362
426
  });
363
427
  }
@@ -368,7 +432,11 @@ const Swipeout = {
368
432
  if (callback) callback.call($el[0]);
369
433
  });
370
434
  nextFrame(() => {
371
- $buttons.transform(`translate3d(${translate}px,0,0)`);
435
+ if (app.theme === 'ios') {
436
+ $buttons.transform(`scale(1)`);
437
+ } else {
438
+ $buttons.transform(`translate3d(${translate}px,0,0)`);
439
+ }
372
440
  $swipeoutContent.transform(`translate3d(${translate}px,0,0)`);
373
441
  });
374
442
  Swipeout.el = $el[0];
@@ -401,14 +469,22 @@ const Swipeout = {
401
469
  closeTimeout = setTimeout(onSwipeoutClose, 500);
402
470
  $buttons.each(buttonEl => {
403
471
  const $buttonEl = $(buttonEl);
404
- if (side === 'right') {
405
- $buttonEl.transform(`translate3d(${-buttonEl.offsetLeft}px,0,0)`);
472
+ if (app.theme === 'ios') {
473
+ $buttonEl.transform(`scale(0)`);
406
474
  } else {
407
- $buttonEl.transform(`translate3d(${swipeoutActionsWidth - buttonEl.offsetWidth - buttonEl.offsetLeft}px,0,0)`);
475
+ if (side === 'right') {
476
+ $buttonEl.transform(`translate3d(${-buttonEl.offsetLeft}px,0,0)`);
477
+ } else {
478
+ $buttonEl.transform(`translate3d(${swipeoutActionsWidth - buttonEl.offsetWidth - buttonEl.offsetLeft}px,0,0)`);
479
+ }
408
480
  }
481
+ const buttonWidth = $buttonEl[0].f7SwipeoutButtonWidth;
409
482
  $buttonEl.css({
410
- left: '0px'
483
+ left: '0px',
484
+ width: buttonWidth ? `${buttonWidth}px` : '',
485
+ marginLeft: '0px'
411
486
  }).removeClass('swipeout-overswipe-active');
487
+ delete $buttonEl[0].f7SwipeoutButtonWidth;
412
488
  });
413
489
  if (Swipeout.el && Swipeout.el === $el[0]) Swipeout.el = undefined;
414
490
  },
@@ -13,11 +13,26 @@
13
13
  }
14
14
  .swipeout-transitioning {
15
15
  .swipeout-content,
16
+ .swipeout-content .item-inner::after {
17
+ transition-duration: 300ms;
18
+ transition-property: transform, left, background-color, border-radius, opacity;
19
+ }
16
20
  .swipeout-actions-right a,
17
21
  .swipeout-actions-left a,
18
22
  .swipeout-overswipe {
19
23
  transition-duration: 300ms;
20
- transition-property: transform, left;
24
+ transition-property: transform, left, width, margin-left, margin-right;
25
+ }
26
+ &:not(.swipeout-opened) {
27
+ .swipeout-content {
28
+ transition-delay: 0ms, 0ms, 300ms, 300ms, 0ms;
29
+ }
30
+ }
31
+ }
32
+ .list li:has(+ li:is(.swipeout-opened, .swipeout-active)) {
33
+ .item-inner::after {
34
+ opacity: 0;
35
+ transition-duration: 300ms;
21
36
  }
22
37
  }
23
38
  .swipeout-content {
@@ -26,7 +41,6 @@
26
41
  }
27
42
  .swipeout-overswipe {
28
43
  transition-duration: 200ms;
29
- transition-property: left;
30
44
  }
31
45
  .swipeout-actions-left,
32
46
  .swipeout-actions-right {
@@ -39,6 +53,9 @@
39
53
  > button,
40
54
  > span,
41
55
  > div {
56
+ box-sizing: border-box;
57
+ border-radius: var(--f7-swipeout-button-border-radius);
58
+
42
59
  color: var(--f7-swipeout-button-text-color);
43
60
  background: var(--f7-swipeout-button-bg-color);
44
61
  padding: var(--f7-swipeout-button-padding-vertical) var(--f7-swipeout-button-padding-horizontal);
@@ -48,53 +65,12 @@
48
65
  left: 0;
49
66
  font-size: var(--f7-swipeout-button-font-size);
50
67
  font-weight: var(--f7-swipeout-button-font-weight);
51
- &:after {
52
- content: '';
53
- pointer-events: none;
54
- position: absolute;
55
- top: 0;
56
- width: 600%;
57
- height: 100%;
58
- background: inherit;
59
- z-index: -1;
60
- transform: translate3d(0, 0, 0);
61
- pointer-events: none;
62
- }
63
68
  }
64
69
  .swipeout-delete {
65
70
  background: var(--f7-swipeout-delete-button-bg-color);
66
71
  }
67
72
  }
68
- .swipeout-actions-right {
69
- right: 0%;
70
- transform: translateX(calc(100% + 1px));
71
- > a,
72
- > button,
73
- > span,
74
- > div {
75
- &:after {
76
- left: 100%;
77
- }
78
- &:last-child {
79
- padding-right: calc(var(--f7-swipeout-button-padding-horizontal) + var(--f7-safe-area-right));
80
- }
81
- }
82
- }
83
- .swipeout-actions-left {
84
- left: 0%;
85
- transform: translateX(calc(-100% - 1px));
86
- > a,
87
- > button,
88
- > span,
89
- > div {
90
- &:after {
91
- right: 100%;
92
- }
93
- &:first-child {
94
- padding-left: calc(var(--f7-swipeout-button-padding-horizontal) + var(--f7-safe-area-left));
95
- }
96
- }
97
- }
73
+
98
74
  .swipeout-actions-left,
99
75
  .swipeout-actions-right {
100
76
  [class*='color-'] {
@@ -97,8 +97,8 @@ class Toast extends Modal {
97
97
  class: "toast-icon"
98
98
  }, icon), $jsx("div", {
99
99
  class: "toast-text"
100
- }, text), closeButton && !icon && $jsx("a", {
101
- class: `toast-button button ${closeButtonColor ? `color-${closeButtonColor}` : ''}`
100
+ }, text), closeButton && !icon && $jsx("button", {
101
+ class: `toast-button button ${closeButtonColor ? `color-${closeButtonColor}` : ''}${toast.app.theme === 'ios' ? ' button-round' : ''}`
102
102
  }, closeButtonText)));
103
103
  }
104
104
  }
@@ -3,6 +3,8 @@
3
3
  transition-duration: 300ms;
4
4
  width: 100%;
5
5
  left: 0;
6
+ .ios-glass-backdrop();
7
+ box-shadow: var(--f7-glass-shadow);
6
8
  &.toast-top {
7
9
  top: 0;
8
10
  transform: translate3d(0, -100%, 0);
@@ -1 +1 @@
1
- :root{--f7-toast-font-size:14px;--f7-toast-icon-size:48px;--f7-toast-max-width:568px}.ios{--f7-toast-text-color:#fff;--f7-toast-bg-color:rgba(0, 0, 0, 0.75);--f7-toast-bg-color-rgb:0,0,0;--f7-toast-padding-horizontal:16px;--f7-toast-padding-vertical:12px;--f7-toast-border-radius:8px;--f7-toast-button-min-width:64px}.md{--f7-toast-padding-horizontal:24px;--f7-toast-padding-vertical:14px;--f7-toast-border-radius:16px;--f7-toast-button-min-width:64px}.md,.md .dark,.md [class*=color-]{--f7-toast-text-color:var(--f7-md-on-surface);--f7-toast-bg-color:var(--f7-md-surface-5)}.toast{transition-property:transform,opacity;position:absolute;max-width:var(--f7-toast-max-width);z-index:20000;color:var(--f7-toast-text-color);font-size:var(--f7-toast-font-size);box-sizing:border-box;background-color:var(--f7-toast-bg-color);opacity:0}@supports ((-webkit-backdrop-filter:blur(20px)) or (backdrop-filter:blur(20px))){.ios-translucent-modals .toast{background-color:rgba(var(--f7-toast-bg-color-rgb),.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}.toast.modal-in{opacity:1}.toast .toast-content{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--f7-toast-padding-vertical) var(--f7-toast-padding-horizontal)}.toast .toast-text{line-height:20px;flex-shrink:1;min-width:0}.toast .toast-button{flex-shrink:0;min-width:var(--f7-toast-button-min-width);margin-top:-8px;margin-bottom:-8px}.toast.toast-with-icon .toast-content{display:block;text-align:center}.toast.toast-with-icon .toast-text{text-align:center}.toast.toast-with-icon .toast-icon .f7-icons,.toast.toast-with-icon .toast-icon .material-icons{font-size:var(--f7-toast-icon-size)}.toast.toast-center{top:50%}.toast.toast-top{margin-top:var(--f7-safe-area-top)}.ios .toast{transition-duration:.3s;width:100%;left:0}.ios .toast.toast-top{top:0;transform:translate3d(0,-100%,0)}.ios .toast.toast-top.modal-in{transform:translate3d(0,0%,0)}.ios .toast.toast-center{width:auto;left:50%;border-radius:var(--f7-toast-border-radius);transform:translate3d(-50%,-50%,0)}.ios .toast.toast-center.modal-in{transform:translate3d(-50%,-50%,0)}.ios .toast.toast-bottom{bottom:0;transform:translate3d(0,100%,0)}.ios .toast.toast-bottom.modal-in{transform:translate3d(0,0%,0)}@media (max-width:568px){.ios .toast.toast-top{margin-top:0}.ios .toast.toast-top .toast-content{padding-top:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-top))}.ios .toast.toast-bottom .toast-content{padding-bottom:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-bottom))}}@media (min-width:569px){.ios .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2);border-radius:var(--f7-toast-border-radius)}.ios .toast.toast-top{top:16px}.ios .toast.toast-center{margin-left:0}.ios .toast.toast-bottom{margin-bottom:calc(16px + var(--f7-safe-area-bottom))}}@media (min-width:1024px){.ios .toast{margin-left:0;width:auto}.ios .toast.toast-horizontal-left{left:16px}.ios .toast.toast-horizontal-right{left:auto;right:16px}.ios .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}}.ios .toast-button{margin-right:16px;margin-left:calc(-1 * var(--f7-button-padding-horizontal))}.md .toast{transition-duration:.2s;border-radius:var(--f7-toast-border-radius);width:calc(100% - 16px);transform:scale(.9);left:8px}.md .toast.modal-in{transform:scale(1)}.md .toast.modal-out{transform:scale(1)}.md .toast.toast-top{top:8px}.md .toast.toast-center{left:50%;width:auto;transform:scale(.9) translate3d(-55%,-55%,0)}.md .toast.toast-center.modal-in{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-center.modal-out{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-bottom{bottom:calc(8px + var(--f7-safe-area-bottom))}@media (min-width:584px){.md .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-center{margin-left:0}}@media (min-width:1024px){.md .toast{margin-left:0;width:auto}.md .toast.toast-horizontal-left{left:24px}.md .toast.toast-horizontal-right{left:auto;right:24px}.md .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-bottom{bottom:calc(24px + var(--f7-safe-area-bottom))}.md .toast.toast-top{top:24px}}.md .toast-button{margin-right:16px;margin-left:-8px}
1
+ :root{--f7-toast-font-size:14px;--f7-toast-icon-size:48px;--f7-toast-max-width:568px}.ios{--f7-toast-bg-color:var(--f7-glass-bg-color);--f7-toast-padding-horizontal:16px;--f7-toast-padding-vertical:12px;--f7-toast-border-radius:32px;--f7-toast-button-min-width:64px}.md{--f7-toast-padding-horizontal:24px;--f7-toast-padding-vertical:14px;--f7-toast-border-radius:16px;--f7-toast-button-min-width:64px}.md,.md .dark,.md [class*=color-]{--f7-toast-text-color:var(--f7-md-on-surface);--f7-toast-bg-color:var(--f7-md-surface-5)}.toast{transition-property:transform,opacity;position:absolute;max-width:var(--f7-toast-max-width);z-index:20000;color:var(--f7-toast-text-color);font-size:var(--f7-toast-font-size);box-sizing:border-box;background-color:var(--f7-toast-bg-color);opacity:0}.toast.modal-in{opacity:1}.toast .toast-content{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--f7-toast-padding-vertical) var(--f7-toast-padding-horizontal)}.toast .toast-text{line-height:20px;flex-shrink:1;min-width:0}.toast .toast-button{flex-shrink:0;min-width:var(--f7-toast-button-min-width);margin-top:-8px;margin-bottom:-8px;width:auto}.toast.toast-with-icon .toast-content{display:block;text-align:center}.toast.toast-with-icon .toast-text{text-align:center}.toast.toast-with-icon .toast-icon .f7-icons,.toast.toast-with-icon .toast-icon .material-icons{font-size:var(--f7-toast-icon-size)}.toast.toast-center{top:50%}.toast.toast-top{margin-top:var(--f7-safe-area-top)}.ios .toast{transition-duration:.3s;width:100%;left:0;-webkit-backdrop-filter:saturate(180%) blur(16px);backdrop-filter:saturate(180%) blur(16px);box-shadow:var(--f7-glass-shadow)}.ios .toast.toast-top{top:0;transform:translate3d(0,-100%,0)}.ios .toast.toast-top.modal-in{transform:translate3d(0,0%,0)}.ios .toast.toast-center{width:auto;left:50%;border-radius:var(--f7-toast-border-radius);transform:translate3d(-50%,-50%,0)}.ios .toast.toast-center.modal-in{transform:translate3d(-50%,-50%,0)}.ios .toast.toast-bottom{bottom:0;transform:translate3d(0,100%,0)}.ios .toast.toast-bottom.modal-in{transform:translate3d(0,0%,0)}@media (max-width:568px){.ios .toast.toast-top{margin-top:0}.ios .toast.toast-top .toast-content{padding-top:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-top))}.ios .toast.toast-bottom .toast-content{padding-bottom:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-bottom))}}@media (min-width:569px){.ios .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2);border-radius:var(--f7-toast-border-radius)}.ios .toast.toast-top{top:16px}.ios .toast.toast-center{margin-left:0}.ios .toast.toast-bottom{margin-bottom:calc(16px + var(--f7-safe-area-bottom))}}@media (min-width:1024px){.ios .toast{margin-left:0;width:auto}.ios .toast.toast-horizontal-left{left:16px}.ios .toast.toast-horizontal-right{left:auto;right:16px}.ios .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}}.ios .toast-button{margin-right:16px;margin-left:calc(-1 * var(--f7-button-padding-horizontal))}.md .toast{transition-duration:.2s;border-radius:var(--f7-toast-border-radius);width:calc(100% - 16px);transform:scale(.9);left:8px}.md .toast.modal-in{transform:scale(1)}.md .toast.modal-out{transform:scale(1)}.md .toast.toast-top{top:8px}.md .toast.toast-center{left:50%;width:auto;transform:scale(.9) translate3d(-55%,-55%,0)}.md .toast.toast-center.modal-in{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-center.modal-out{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-bottom{bottom:calc(8px + var(--f7-safe-area-bottom))}@media (min-width:584px){.md .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-center{margin-left:0}}@media (min-width:1024px){.md .toast{margin-left:0;width:auto}.md .toast.toast-horizontal-left{left:24px}.md .toast.toast-horizontal-right{left:auto;right:24px}.md .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-bottom{bottom:calc(24px + var(--f7-safe-area-bottom))}.md .toast.toast-top{top:24px}}.md .toast-button{margin-right:16px;margin-left:-8px}
@@ -4,12 +4,10 @@
4
4
  --f7-toast-max-width: 568px;
5
5
  }
6
6
  .ios-vars({
7
- --f7-toast-text-color: #fff;
8
- --f7-toast-bg-color: rgba(0,0,0,0.75);
9
- --f7-toast-bg-color-rgb: 0, 0, 0;
7
+ --f7-toast-bg-color: var(--f7-glass-bg-color);
10
8
  --f7-toast-padding-horizontal: 16px;
11
9
  --f7-toast-padding-vertical: 12px;
12
- --f7-toast-border-radius: 8px;
10
+ --f7-toast-border-radius: 32px;
13
11
  --f7-toast-button-min-width: 64px;
14
12
  });
15
13
  .md-vars({
@@ -1 +1 @@
1
- :root{--f7-toast-font-size:14px;--f7-toast-icon-size:48px;--f7-toast-max-width:568px}.ios{--f7-toast-text-color:#fff;--f7-toast-bg-color:rgba(0, 0, 0, 0.75);--f7-toast-bg-color-rgb:0,0,0;--f7-toast-padding-horizontal:16px;--f7-toast-padding-vertical:12px;--f7-toast-border-radius:8px;--f7-toast-button-min-width:64px}.md{--f7-toast-padding-horizontal:24px;--f7-toast-padding-vertical:14px;--f7-toast-border-radius:16px;--f7-toast-button-min-width:64px}.md,.md .dark,.md [class*=color-]{--f7-toast-text-color:var(--f7-md-on-surface);--f7-toast-bg-color:var(--f7-md-surface-5)}.toast{transition-property:transform,opacity;position:absolute;max-width:var(--f7-toast-max-width);z-index:20000;color:var(--f7-toast-text-color);font-size:var(--f7-toast-font-size);box-sizing:border-box;background-color:var(--f7-toast-bg-color);opacity:0}@supports ((-webkit-backdrop-filter:blur(20px)) or (backdrop-filter:blur(20px))){.ios-translucent-modals .toast{background-color:rgba(var(--f7-toast-bg-color-rgb),.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}.toast.modal-in{opacity:1}.toast .toast-content{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--f7-toast-padding-vertical) var(--f7-toast-padding-horizontal)}.toast .toast-text{line-height:20px;flex-shrink:1;min-width:0}.toast .toast-button{flex-shrink:0;min-width:var(--f7-toast-button-min-width);margin-top:-8px;margin-bottom:-8px}.toast.toast-with-icon .toast-content{display:block;text-align:center}.toast.toast-with-icon .toast-text{text-align:center}.toast.toast-with-icon .toast-icon .f7-icons,.toast.toast-with-icon .toast-icon .material-icons{font-size:var(--f7-toast-icon-size)}.toast.toast-center{top:50%}.toast.toast-top{margin-top:var(--f7-safe-area-top)}.ios .toast{transition-duration:.3s;width:100%;left:0}.ios .toast.toast-top{top:0;transform:translate3d(0,-100%,0)}.ios .toast.toast-top.modal-in{transform:translate3d(0,0%,0)}.ios .toast.toast-center{width:auto;left:50%;border-radius:var(--f7-toast-border-radius);transform:translate3d(-50%,-50%,0)}.ios .toast.toast-center.modal-in{transform:translate3d(-50%,-50%,0)}.ios .toast.toast-bottom{bottom:0;transform:translate3d(0,100%,0)}.ios .toast.toast-bottom.modal-in{transform:translate3d(0,0%,0)}@media (max-width:568px){.ios .toast.toast-top{margin-top:0}.ios .toast.toast-top .toast-content{padding-top:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-top))}.ios .toast.toast-bottom .toast-content{padding-bottom:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-bottom))}}@media (min-width:569px){.ios .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2);border-radius:var(--f7-toast-border-radius)}.ios .toast.toast-top{top:16px}.ios .toast.toast-center{margin-left:0}.ios .toast.toast-bottom{margin-bottom:calc(16px + var(--f7-safe-area-bottom))}}@media (min-width:1024px){.ios .toast{margin-left:0;width:auto}.ios .toast.toast-horizontal-left{left:16px}.ios .toast.toast-horizontal-right{left:auto;right:16px}.ios .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}}.ios .toast-button{margin-left:16px;margin-right:calc(-1 * var(--f7-button-padding-horizontal))}.md .toast{transition-duration:.2s;border-radius:var(--f7-toast-border-radius);width:calc(100% - 16px);transform:scale(.9);left:8px}.md .toast.modal-in{transform:scale(1)}.md .toast.modal-out{transform:scale(1)}.md .toast.toast-top{top:8px}.md .toast.toast-center{left:50%;width:auto;transform:scale(.9) translate3d(-55%,-55%,0)}.md .toast.toast-center.modal-in{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-center.modal-out{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-bottom{bottom:calc(8px + var(--f7-safe-area-bottom))}@media (min-width:584px){.md .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-center{margin-left:0}}@media (min-width:1024px){.md .toast{margin-left:0;width:auto}.md .toast.toast-horizontal-left{left:24px}.md .toast.toast-horizontal-right{left:auto;right:24px}.md .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-bottom{bottom:calc(24px + var(--f7-safe-area-bottom))}.md .toast.toast-top{top:24px}}.md .toast-button{margin-left:16px;margin-right:-8px}
1
+ :root{--f7-toast-font-size:14px;--f7-toast-icon-size:48px;--f7-toast-max-width:568px}.ios{--f7-toast-bg-color:var(--f7-glass-bg-color);--f7-toast-padding-horizontal:16px;--f7-toast-padding-vertical:12px;--f7-toast-border-radius:32px;--f7-toast-button-min-width:64px}.md{--f7-toast-padding-horizontal:24px;--f7-toast-padding-vertical:14px;--f7-toast-border-radius:16px;--f7-toast-button-min-width:64px}.md,.md .dark,.md [class*=color-]{--f7-toast-text-color:var(--f7-md-on-surface);--f7-toast-bg-color:var(--f7-md-surface-5)}.toast{transition-property:transform,opacity;position:absolute;max-width:var(--f7-toast-max-width);z-index:20000;color:var(--f7-toast-text-color);font-size:var(--f7-toast-font-size);box-sizing:border-box;background-color:var(--f7-toast-bg-color);opacity:0}.toast.modal-in{opacity:1}.toast .toast-content{display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;padding:var(--f7-toast-padding-vertical) var(--f7-toast-padding-horizontal)}.toast .toast-text{line-height:20px;flex-shrink:1;min-width:0}.toast .toast-button{flex-shrink:0;min-width:var(--f7-toast-button-min-width);margin-top:-8px;margin-bottom:-8px;width:auto}.toast.toast-with-icon .toast-content{display:block;text-align:center}.toast.toast-with-icon .toast-text{text-align:center}.toast.toast-with-icon .toast-icon .f7-icons,.toast.toast-with-icon .toast-icon .material-icons{font-size:var(--f7-toast-icon-size)}.toast.toast-center{top:50%}.toast.toast-top{margin-top:var(--f7-safe-area-top)}.ios .toast{transition-duration:.3s;width:100%;left:0;-webkit-backdrop-filter:saturate(180%) blur(16px);backdrop-filter:saturate(180%) blur(16px);box-shadow:var(--f7-glass-shadow)}.ios .toast.toast-top{top:0;transform:translate3d(0,-100%,0)}.ios .toast.toast-top.modal-in{transform:translate3d(0,0%,0)}.ios .toast.toast-center{width:auto;left:50%;border-radius:var(--f7-toast-border-radius);transform:translate3d(-50%,-50%,0)}.ios .toast.toast-center.modal-in{transform:translate3d(-50%,-50%,0)}.ios .toast.toast-bottom{bottom:0;transform:translate3d(0,100%,0)}.ios .toast.toast-bottom.modal-in{transform:translate3d(0,0%,0)}@media (max-width:568px){.ios .toast.toast-top{margin-top:0}.ios .toast.toast-top .toast-content{padding-top:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-top))}.ios .toast.toast-bottom .toast-content{padding-bottom:calc(var(--f7-toast-padding-vertical) + var(--f7-safe-area-bottom))}}@media (min-width:569px){.ios .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2);border-radius:var(--f7-toast-border-radius)}.ios .toast.toast-top{top:16px}.ios .toast.toast-center{margin-left:0}.ios .toast.toast-bottom{margin-bottom:calc(16px + var(--f7-safe-area-bottom))}}@media (min-width:1024px){.ios .toast{margin-left:0;width:auto}.ios .toast.toast-horizontal-left{left:16px}.ios .toast.toast-horizontal-right{left:auto;right:16px}.ios .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}}.ios .toast-button{margin-left:16px;margin-right:calc(-1 * var(--f7-button-padding-horizontal))}.md .toast{transition-duration:.2s;border-radius:var(--f7-toast-border-radius);width:calc(100% - 16px);transform:scale(.9);left:8px}.md .toast.modal-in{transform:scale(1)}.md .toast.modal-out{transform:scale(1)}.md .toast.toast-top{top:8px}.md .toast.toast-center{left:50%;width:auto;transform:scale(.9) translate3d(-55%,-55%,0)}.md .toast.toast-center.modal-in{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-center.modal-out{transform:scale(1) translate3d(-50%,-50%,0)}.md .toast.toast-bottom{bottom:calc(8px + var(--f7-safe-area-bottom))}@media (min-width:584px){.md .toast{left:50%;margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-center{margin-left:0}}@media (min-width:1024px){.md .toast{margin-left:0;width:auto}.md .toast.toast-horizontal-left{left:24px}.md .toast.toast-horizontal-right{left:auto;right:24px}.md .toast.toast-horizontal-center{left:50%;width:var(--f7-toast-max-width);margin-left:calc(-1 * var(--f7-toast-max-width)/ 2)}.md .toast.toast-bottom{bottom:calc(24px + var(--f7-safe-area-bottom))}.md .toast.toast-top{top:24px}}.md .toast-button{margin-left:16px;margin-right:-8px}
@@ -11,7 +11,6 @@
11
11
  box-sizing: border-box;
12
12
  background-color: var(--f7-toast-bg-color);
13
13
  opacity: 0;
14
- .ios-translucent-modals(var(--f7-toast-bg-color-rgb));
15
14
  &.modal-in {
16
15
  opacity: 1;
17
16
  }
@@ -32,6 +31,7 @@
32
31
  min-width: var(--f7-toast-button-min-width);
33
32
  margin-top: -8px;
34
33
  margin-bottom: -8px;
34
+ width: auto;
35
35
  }
36
36
  &.toast-with-icon {
37
37
  .toast-content {
@@ -1,7 +1,6 @@
1
1
  import $ from '../../shared/dom7.js';
2
2
  import { extend, now, nextTick, deleteProps } from '../../shared/utils.js';
3
3
  import Framework7Class from '../../shared/class.js';
4
- import { getSupport } from '../../shared/get-support.js';
5
4
  class Toggle extends Framework7Class {
6
5
  constructor(app, params) {
7
6
  if (params === void 0) {
@@ -9,7 +8,6 @@ class Toggle extends Framework7Class {
9
8
  }
10
9
  super(params, [app]);
11
10
  const toggle = this;
12
- const support = getSupport();
13
11
  const defaults = {};
14
12
 
15
13
  // Extend defaults with modules params
@@ -120,19 +118,17 @@ class Toggle extends Framework7Class {
120
118
  toggle.emit('local::change toggleChange', toggle);
121
119
  }
122
120
  toggle.attachEvents = function attachEvents() {
123
- const passive = support.passiveListener ? {
121
+ $el.on(app.touchEvents.start, handleTouchStart, {
124
122
  passive: true
125
- } : false;
126
- $el.on(app.touchEvents.start, handleTouchStart, passive);
123
+ });
127
124
  app.on('touchmove', handleTouchMove);
128
125
  app.on('touchend:passive', handleTouchEnd);
129
126
  toggle.$inputEl.on('change', handleInputChange);
130
127
  };
131
128
  toggle.detachEvents = function detachEvents() {
132
- const passive = support.passiveListener ? {
129
+ $el.off(app.touchEvents.start, handleTouchStart, {
133
130
  passive: true
134
- } : false;
135
- $el.off(app.touchEvents.start, handleTouchStart, passive);
131
+ });
136
132
  app.off('touchmove', handleTouchMove);
137
133
  app.off('touchend:passive', handleTouchEnd);
138
134
  toggle.$inputEl.off('change', handleInputChange);
@@ -1,69 +1,87 @@
1
1
  .ios {
2
2
  .toggle {
3
- background: var(--f7-toggle-inactive-border-color);
4
- input[type='checkbox']:checked + .toggle-icon {
5
- background: var(--f7-toggle-active-color, var(--f7-theme-color));
6
- &:before {
3
+ --f7-toggle-knob-tx: 0px;
4
+ &::before {
5
+ content: '';
6
+ border-radius: inherit;
7
+ inset: 0;
8
+ position: absolute;
9
+ background: var(--f7-toggle-inactive-border-color);
10
+ transition-duration: 300ms;
11
+ z-index: 0;
12
+ }
13
+ &::after {
14
+ content: '';
15
+ position: absolute;
16
+ left: 0;
17
+ transform: translateX(calc(var(--f7-toggle-width) - var(--f7-toggle-height)));
18
+
19
+ top: 0;
20
+ width: var(--f7-toggle-height);
21
+ height: var(--f7-toggle-height);
22
+ border-radius: var(--f7-toggle-height);
23
+ background: var(--f7-toggle-inactive-border-color);
24
+ transition-duration: 300ms;
25
+ z-index: 0;
26
+ }
27
+ &:has(input[type='checkbox']:checked) {
28
+ --f7-toggle-knob-tx: calc(var(--f7-toggle-width) - 38px - 4px);
29
+ &::before {
7
30
  background: var(--f7-toggle-active-bg-color, var(--f7-theme-color));
8
- transform: scale(0);
9
31
  }
10
- &:after {
11
- background: var(--f7-toggle-active-knob-bg-color);
12
- .ltr({
13
- transform: translateX(calc(var(--f7-toggle-width) - var(--f7-toggle-height)));
14
- });
15
- .rtl({
16
- transform: translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height))));
17
- });
32
+ &::after {
33
+ background: var(--f7-toggle-active-bg-color, var(--f7-theme-color));
34
+ transform: translateX(0);
18
35
  }
19
36
  }
20
37
  }
21
38
  .toggle-icon {
22
- background: var(--f7-toggle-border-color);
23
- &:before {
39
+ background: var(--f7-toggle-inactive-knob-bg-color);
40
+ height: calc(var(--f7-toggle-height) - 4px);
41
+ width: 38px;
42
+ top: 2px;
43
+ .ltr({ left: 2px; });
44
+ .rtl({ right: 2px; });
45
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
46
+ border-radius: calc(var(--f7-toggle-height) - 4px);
47
+ transition-duration: 300ms;
48
+ transform: translateX(var(--f7-toggle-knob-tx)) scale(1);
49
+ position: relative;
50
+ z-index: 1;
51
+ transform-origin: center;
52
+ &::before {
53
+ content: '';
24
54
  position: absolute;
25
- .ltr({ left: 2px; });
26
- .rtl({ right: 2px; });
27
- top: 2px;
28
- width: calc(var(--f7-toggle-width) - 4px);
29
- height: calc(var(--f7-toggle-height) - 4px);
30
- border-radius: var(--f7-toggle-height);
31
- box-sizing: border-box;
32
- background: var(--f7-toggle-inactive-bg-color);
33
- z-index: 1;
55
+ left: 50%;
56
+ top: 50%;
57
+ width: 1px;
58
+ height: 1px;
59
+ opacity: 0;
34
60
  transition-duration: 300ms;
35
- transform: scale(1);
61
+ box-shadow: 0px 0px 40px 15px rgba(var(--f7-theme-color-rgb), 0.75);
36
62
  }
37
- &:after {
38
- background: var(--f7-toggle-inactive-knob-bg-color);
39
- height: calc(var(--f7-toggle-height) - 4px);
40
- width: calc(var(--f7-toggle-height) - 4px);
41
- top: 2px;
42
- .ltr({ left: 2px; });
43
- .rtl({ right: 2px; });
44
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
45
- border-radius: calc(var(--f7-toggle-height) - 4px);
63
+ &::after {
64
+ content: '';
65
+ position: absolute;
66
+ inset: 0;
67
+ border-radius: inherit;
68
+ box-shadow: var(--f7-glass-shadow-thumb);
69
+ transition-duration: 300ms;
70
+ opacity: 0;
46
71
  }
47
72
  }
48
73
  .toggle-active-state {
49
- input[type='checkbox']:not(:checked) + .toggle-icon {
50
- &:before {
51
- transform: scale(0);
52
- }
74
+ &::before {
75
+ transform: scale(0.75);
53
76
  }
54
- input[type='checkbox'] + .toggle-icon {
55
- &:after {
56
- width: calc(var(--f7-toggle-height) + 4px);
77
+ .toggle-icon {
78
+ background: transparent;
79
+ transform: translateX(var(--f7-toggle-knob-tx)) scale(1.4);
80
+ &::before {
81
+ opacity: 1;
57
82
  }
58
- }
59
- input[type='checkbox']:checked + .toggle-icon {
60
- &:after {
61
- .ltr({
62
- transform: translateX(calc(var(--f7-toggle-width) - var(--f7-toggle-height) - 8px));
63
- });
64
- .rtl({
65
- transform: translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height) - 8px)));
66
- });
83
+ &::after {
84
+ opacity: 1;
67
85
  }
68
86
  }
69
87
  }
@@ -1 +1 @@
1
- .ios{--f7-toggle-width:52px;--f7-toggle-height:32px;--f7-toggle-inactive-knob-bg-color:#fff;--f7-toggle-active-knob-bg-color:#fff;--f7-toggle-inactive-border-color:#e5e5e5;--f7-toggle-inactive-bg-color:#fff}.ios .dark,.ios.dark{--f7-toggle-inactive-border-color:#555;--f7-toggle-inactive-bg-color:#555}.md{--f7-toggle-width:52px;--f7-toggle-height:32px}.md,.md .dark,.md [class*=color-]{--f7-toggle-inactive-bg-color:var(--f7-md-surface-variant);--f7-toggle-active-bg-color:var(--f7-theme-color);--f7-toggle-inactive-knob-bg-color:var(--f7-md-outline);--f7-toggle-active-knob-bg-color:var(--f7-md-on-primary);--f7-toggle-inactive-border-color:var(--f7-md-outline);--f7-toggle-active-border-color:var(--f7-theme-color)}.toggle,.toggle-icon{width:var(--f7-toggle-width);height:var(--f7-toggle-height);border-radius:var(--f7-toggle-height)}.toggle{display:inline-block;vertical-align:middle;position:relative;box-sizing:border-box;align-self:center;-webkit-user-select:none;user-select:none}.toggle input[type=checkbox]{display:none}.toggle input[disabled]~.toggle-icon{pointer-events:none}.toggle-icon{z-index:0;margin:0;padding:0;-webkit-appearance:none;appearance:none;border:none;position:relative;transition:.3s;box-sizing:border-box;display:block;cursor:pointer}.toggle-icon:after,.toggle-icon:before{content:''}.toggle-icon:after{position:absolute;z-index:2;transform:translateX(0px);transition-duration:.3s}.ios .toggle{background:var(--f7-toggle-inactive-border-color)}.ios .toggle input[type=checkbox]:checked+.toggle-icon{background:var(--f7-toggle-active-color,var(--f7-theme-color))}.ios .toggle input[type=checkbox]:checked+.toggle-icon:before{background:var(--f7-toggle-active-bg-color,var(--f7-theme-color));transform:scale(0)}.ios .toggle input[type=checkbox]:checked+.toggle-icon:after{background:var(--f7-toggle-active-knob-bg-color);transform:translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height))))}.ios .toggle-icon{background:var(--f7-toggle-border-color)}.ios .toggle-icon:before{position:absolute;right:2px;top:2px;width:calc(var(--f7-toggle-width) - 4px);height:calc(var(--f7-toggle-height) - 4px);border-radius:var(--f7-toggle-height);box-sizing:border-box;background:var(--f7-toggle-inactive-bg-color);z-index:1;transition-duration:.3s;transform:scale(1)}.ios .toggle-icon:after{background:var(--f7-toggle-inactive-knob-bg-color);height:calc(var(--f7-toggle-height) - 4px);width:calc(var(--f7-toggle-height) - 4px);top:2px;right:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);border-radius:calc(var(--f7-toggle-height) - 4px)}.ios .toggle-active-state input[type=checkbox]:not(:checked)+.toggle-icon:before{transform:scale(0)}.ios .toggle-active-state input[type=checkbox]+.toggle-icon:after{width:calc(var(--f7-toggle-height) + 4px)}.ios .toggle-active-state input[type=checkbox]:checked+.toggle-icon:after{transform:translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height) - 8px)))}.md .toggle input[type=checkbox]:checked+.toggle-icon{background:var(--f7-toggle-active-bg-color);border-color:var(--f7-toggle-active-border-color)}.md .toggle input[type=checkbox]:checked+.toggle-icon:after{transform:translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height)))) scale(1);background:var(--f7-toggle-active-knob-bg-color)}.md .toggle.active-state input[type=checkbox]:checked+.toggle-icon:after{transform:translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height)))) scale(1.1)}.md .toggle-icon{background:var(--f7-toggle-inactive-bg-color);border:2px solid var(--f7-toggle-inactive-border-color)}.md .toggle-icon:after{background:var(--f7-toggle-inactive-knob-bg-color);height:calc(var(--f7-toggle-height) - 8px);width:calc(var(--f7-toggle-height) - 8px);top:2px;border-radius:var(--f7-toggle-height);transform:scale(.666);right:2px}.md .toggle-icon.active-state:after{transform:scale(1.1)}
1
+ .ios{--f7-toggle-width:64px;--f7-toggle-height:28px;--f7-toggle-inactive-knob-bg-color:#fff;--f7-toggle-active-knob-bg-color:#fff;--f7-toggle-inactive-border-color:#e5e5e5;--f7-toggle-inactive-bg-color:#fff}.ios .dark,.ios.dark{--f7-toggle-inactive-border-color:#555;--f7-toggle-inactive-bg-color:#555}.md{--f7-toggle-width:52px;--f7-toggle-height:32px}.md,.md .dark,.md [class*=color-]{--f7-toggle-inactive-bg-color:var(--f7-md-surface-variant);--f7-toggle-active-bg-color:var(--f7-theme-color);--f7-toggle-inactive-knob-bg-color:var(--f7-md-outline);--f7-toggle-active-knob-bg-color:var(--f7-md-on-primary);--f7-toggle-inactive-border-color:var(--f7-md-outline);--f7-toggle-active-border-color:var(--f7-theme-color)}.toggle,.toggle-icon{width:var(--f7-toggle-width);height:var(--f7-toggle-height);border-radius:var(--f7-toggle-height)}.toggle{display:inline-block;vertical-align:middle;position:relative;box-sizing:border-box;align-self:center;-webkit-user-select:none;user-select:none}.toggle input[type=checkbox]{display:none}.toggle input[disabled]~.toggle-icon{pointer-events:none}.toggle-icon{z-index:0;margin:0;padding:0;-webkit-appearance:none;appearance:none;border:none;position:relative;transition:.3s;box-sizing:border-box;display:block;cursor:pointer}.toggle-icon:after,.toggle-icon:before{content:''}.toggle-icon:after{position:absolute;z-index:2;transform:translateX(0px);transition-duration:.3s}.ios .toggle{--f7-toggle-knob-tx:0px}.ios .toggle::before{content:'';border-radius:inherit;inset:0;position:absolute;background:var(--f7-toggle-inactive-border-color);transition-duration:.3s;z-index:0}.ios .toggle::after{content:'';position:absolute;left:0;transform:translateX(calc(var(--f7-toggle-width) - var(--f7-toggle-height)));top:0;width:var(--f7-toggle-height);height:var(--f7-toggle-height);border-radius:var(--f7-toggle-height);background:var(--f7-toggle-inactive-border-color);transition-duration:.3s;z-index:0}.ios .toggle:has(input[type=checkbox]:checked){--f7-toggle-knob-tx:calc(var(--f7-toggle-width) - 38px - 4px)}.ios .toggle:has(input[type=checkbox]:checked)::before{background:var(--f7-toggle-active-bg-color,var(--f7-theme-color))}.ios .toggle:has(input[type=checkbox]:checked)::after{background:var(--f7-toggle-active-bg-color,var(--f7-theme-color));transform:translateX(0)}.ios .toggle-icon{background:var(--f7-toggle-inactive-knob-bg-color);height:calc(var(--f7-toggle-height) - 4px);width:38px;top:2px;right:2px;box-shadow:0 2px 4px rgba(0,0,0,.3);border-radius:calc(var(--f7-toggle-height) - 4px);transition-duration:.3s;transform:translateX(var(--f7-toggle-knob-tx)) scale(1);position:relative;z-index:1;transform-origin:center}.ios .toggle-icon::before{content:'';position:absolute;left:50%;top:50%;width:1px;height:1px;opacity:0;transition-duration:.3s;box-shadow:0px 0px 40px 15px rgba(var(--f7-theme-color-rgb),.75)}.ios .toggle-icon::after{content:'';position:absolute;inset:0;border-radius:inherit;box-shadow:var(--f7-glass-shadow-thumb);transition-duration:.3s;opacity:0}.ios .toggle-active-state::before{transform:scale(.75)}.ios .toggle-active-state .toggle-icon{background:0 0;transform:translateX(var(--f7-toggle-knob-tx)) scale(1.4)}.ios .toggle-active-state .toggle-icon::before{opacity:1}.ios .toggle-active-state .toggle-icon::after{opacity:1}.md .toggle input[type=checkbox]:checked+.toggle-icon{background:var(--f7-toggle-active-bg-color);border-color:var(--f7-toggle-active-border-color)}.md .toggle input[type=checkbox]:checked+.toggle-icon:after{transform:translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height)))) scale(1);background:var(--f7-toggle-active-knob-bg-color)}.md .toggle.active-state input[type=checkbox]:checked+.toggle-icon:after{transform:translateX(calc(-1 * (var(--f7-toggle-width) - var(--f7-toggle-height)))) scale(1.1)}.md .toggle-icon{background:var(--f7-toggle-inactive-bg-color);border:2px solid var(--f7-toggle-inactive-border-color)}.md .toggle-icon:after{background:var(--f7-toggle-inactive-knob-bg-color);height:calc(var(--f7-toggle-height) - 8px);width:calc(var(--f7-toggle-height) - 8px);top:2px;border-radius:var(--f7-toggle-height);transform:scale(.666);right:2px}.md .toggle-icon.active-state:after{transform:scale(1.1)}
@@ -1,6 +1,6 @@
1
1
  .ios-vars({
2
- --f7-toggle-width: 52px;
3
- --f7-toggle-height: 32px;
2
+ --f7-toggle-width: 64px;
3
+ --f7-toggle-height: 28px;
4
4
  /*
5
5
  --f7-toggle-active-bg-color: var(--f7-theme-color);
6
6
  */