@xenknight/framework7 0.0.5 → 0.0.7
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/app/app.less +1 -1
- package/components/block/block-vars.less +6 -6
- package/components/button/button-vars.less +11 -10
- 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 +3 -3
- package/components/dialog/dialog.less +6 -25
- package/components/icon/icon-ios.less +9 -0
- package/components/icon/icon-md.less +9 -0
- package/components/icon/icon.less +2 -1
- package/components/list/list-vars.less +8 -6
- package/components/list/list.less +1 -1
- package/components/messagebar/messagebar-rtl.css +1 -1
- package/components/messagebar/messagebar-vars.less +1 -1
- package/components/messagebar/messagebar.css +1 -1
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages-vars.less +7 -7
- package/components/messages/messages.css +1 -1
- package/components/navbar-new/navbar-ios.less +135 -0
- package/components/navbar-new/navbar-md.less +105 -0
- package/components/navbar-new/navbar-vars.less +78 -0
- package/components/navbar-new/navbar.d.ts +77 -0
- package/components/navbar-new/navbar.js +568 -0
- package/components/navbar-new/navbar.less +268 -0
- 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 +13 -1
- package/components/popover/popover-class.js +21 -58
- 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 +0 -1
- package/components/popover/popover.less +28 -50
- 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.less +11 -24
- package/components/searchbar-new/remove-diacritics.js +271 -0
- package/components/searchbar-new/searchbar-ios.less +131 -0
- package/components/searchbar-new/searchbar-md.less +153 -0
- package/components/searchbar-new/searchbar-new-class.js +592 -0
- package/components/searchbar-new/searchbar-vars.less +75 -0
- package/components/searchbar-new/searchbar.js +122 -0
- package/components/searchbar-new/searchbar.less +331 -0
- 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 +98 -23
- package/components/swipeout/swipeout.less +20 -44
- package/components/tabs/tabs.js +5 -0
- 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/toolbar-new/tabbar-highlight.js +134 -0
- package/components/toolbar-new/toolbar-ios.less +193 -0
- package/components/toolbar-new/toolbar-md.less +152 -0
- package/components/toolbar-new/toolbar-vars.less +77 -0
- package/components/toolbar-new/toolbar.js +223 -0
- package/components/toolbar-new/toolbar.less +261 -0
- package/framework7-bundle-rtl.css +2606 -746
- package/framework7-bundle-rtl.min.css +12 -6
- package/framework7-bundle.css +2603 -743
- package/framework7-bundle.esm.js +11 -4
- package/framework7-bundle.js +4536 -1038
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +6 -3
- package/framework7-bundle.min.css +12 -6
- package/framework7-bundle.min.js +4 -4
- package/framework7-bundle.min.js.map +1 -1
- package/framework7-lite-bundle.esm.js +11 -4
- package/framework7-lite.esm.js +11 -4
- package/framework7-lite.js +8 -1
- package/framework7-rtl.css +2212 -399
- package/framework7-rtl.min.css +11 -5
- package/framework7.css +2211 -398
- package/framework7.esm.js +11 -4
- package/framework7.js +8 -1
- package/framework7.less +6 -3
- package/framework7.min.css +11 -5
- package/package.json +1 -1
- package/shared/get-support.d.ts +0 -6
- package/shared/get-support.js +1 -20
- package/shared/material-color-utils.js +2153 -679
- package/shared/material-colors.js +97 -17
- package/shared/utils.js +18 -6
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/* === Navbar New === */
|
|
2
|
+
@import './navbar-vars.less';
|
|
3
|
+
|
|
4
|
+
.navbars-new,
|
|
5
|
+
.navbar-new {
|
|
6
|
+
z-index: 500;
|
|
7
|
+
left: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
.navbars-new {
|
|
12
|
+
position: absolute;
|
|
13
|
+
.navbar-new {
|
|
14
|
+
z-index: auto;
|
|
15
|
+
}
|
|
16
|
+
.navbar-new-transitioning {
|
|
17
|
+
z-index: 500;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.navbar-new {
|
|
21
|
+
--f7-navbar-new-large-collapse-progress: 0;
|
|
22
|
+
position: relative;
|
|
23
|
+
backface-visibility: hidden;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
margin: 0;
|
|
26
|
+
height: calc(var(--f7-navbar-new-height) + var(--f7-safe-area-top));
|
|
27
|
+
color: var(--f7-navbar-new-text-color, var(--f7-bars-text-color));
|
|
28
|
+
font-size: var(--f7-navbar-new-font-size);
|
|
29
|
+
|
|
30
|
+
b {
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
}
|
|
33
|
+
a {
|
|
34
|
+
color: var(--f7-navbar-new-link-color, var(--f7-bars-link-color, var(--f7-theme-color)));
|
|
35
|
+
}
|
|
36
|
+
a.link {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: flex-start;
|
|
39
|
+
line-height: var(--f7-navbar-new-link-line-height, var(--f7-navbar-new-height));
|
|
40
|
+
height: var(--f7-navbar-new-link-height, var(--f7-navbar-new-height));
|
|
41
|
+
}
|
|
42
|
+
.title,
|
|
43
|
+
.left,
|
|
44
|
+
.right {
|
|
45
|
+
position: relative;
|
|
46
|
+
z-index: 10;
|
|
47
|
+
}
|
|
48
|
+
.title {
|
|
49
|
+
position: relative;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
flex-shrink: 10;
|
|
54
|
+
font-weight: var(--f7-navbar-new-title-font-weight);
|
|
55
|
+
display: inline-block;
|
|
56
|
+
line-height: var(--f7-navbar-new-title-line-height);
|
|
57
|
+
text-align: var(--f7-navbar-new-title-text-align);
|
|
58
|
+
font-size: var(--f7-navbar-new-title-font-size);
|
|
59
|
+
.ltr({
|
|
60
|
+
margin-left: var(--f7-navbar-new-title-margin-left);
|
|
61
|
+
margin-right: var(--f7-navbar-new-title-margin-left);
|
|
62
|
+
});
|
|
63
|
+
.rtl({
|
|
64
|
+
margin-right: var(--f7-navbar-new-title-margin-left);
|
|
65
|
+
margin-left: var(--f7-navbar-new-title-margin-left);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
.subtitle {
|
|
69
|
+
display: block;
|
|
70
|
+
color: var(--f7-navbar-new-subtitle-text-color);
|
|
71
|
+
font-weight: normal;
|
|
72
|
+
font-size: var(--f7-navbar-new-subtitle-font-size);
|
|
73
|
+
line-height: var(--f7-navbar-new-subtitle-line-height);
|
|
74
|
+
text-align: var(--f7-navbar-new-subtitle-text-align);
|
|
75
|
+
}
|
|
76
|
+
.left,
|
|
77
|
+
.right {
|
|
78
|
+
flex-shrink: 0;
|
|
79
|
+
display: flex;
|
|
80
|
+
justify-content: flex-start;
|
|
81
|
+
align-items: center;
|
|
82
|
+
// transform: translate3d(0,0,0);
|
|
83
|
+
}
|
|
84
|
+
.right:first-child {
|
|
85
|
+
position: absolute;
|
|
86
|
+
height: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.no-outline,
|
|
90
|
+
.no-outline {
|
|
91
|
+
.navbar-new-bg:after {
|
|
92
|
+
display: none !important;
|
|
93
|
+
}
|
|
94
|
+
.title-large:after {
|
|
95
|
+
display: none !important;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.navbar-new-hidden,
|
|
100
|
+
.navbar-new-hidden & {
|
|
101
|
+
.navbar-new-bg:before {
|
|
102
|
+
opacity: 0 !important;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
.navbar-new-bg {
|
|
107
|
+
position: absolute;
|
|
108
|
+
left: 0;
|
|
109
|
+
top: 0;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
z-index: 0;
|
|
114
|
+
|
|
115
|
+
transition-property: transform;
|
|
116
|
+
}
|
|
117
|
+
// Transitions
|
|
118
|
+
.navbar-new-transitioning {
|
|
119
|
+
&,
|
|
120
|
+
& .left,
|
|
121
|
+
& .title,
|
|
122
|
+
& .right,
|
|
123
|
+
& .title-large-text,
|
|
124
|
+
& .navbar-new-bg,
|
|
125
|
+
& .subnavbar,
|
|
126
|
+
& .navbar-new-bg:before {
|
|
127
|
+
transition-duration: var(--f7-navbar-new-hide-show-transition-duration);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
.navbar-new-page-transitioning {
|
|
131
|
+
transition-duration: var(--f7-page-swipeback-transition-duration) !important;
|
|
132
|
+
.title-large-text,
|
|
133
|
+
.navbar-new-bg {
|
|
134
|
+
transition-duration: var(--f7-page-swipeback-transition-duration) !important;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Hidden
|
|
139
|
+
.navbar-new-hidden {
|
|
140
|
+
transform: translate3d(0, calc(-1 * var(--f7-navbar-new-height)), 0);
|
|
141
|
+
.navbar-new-inner {
|
|
142
|
+
pointer-events: none;
|
|
143
|
+
> .left,
|
|
144
|
+
> .title,
|
|
145
|
+
> .right {
|
|
146
|
+
opacity: 0 !important;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
.subnavbar {
|
|
150
|
+
pointer-events: auto;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
.navbar-new-hidden-statusbar {
|
|
154
|
+
transform: translate3d(0, calc(-1 * var(--f7-navbar-new-height) - var(--f7-safe-area-top)), 0);
|
|
155
|
+
}
|
|
156
|
+
.navbar-new-large-hidden .navbar-new-large {
|
|
157
|
+
--f7-navbar-new-large-collapse-progress: 1;
|
|
158
|
+
}
|
|
159
|
+
.navbar-new-inner {
|
|
160
|
+
position: absolute;
|
|
161
|
+
left: 0;
|
|
162
|
+
bottom: 0;
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: 100%;
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
box-sizing: border-box;
|
|
168
|
+
padding: var(--f7-safe-area-top)
|
|
169
|
+
calc(var(--f7-navbar-new-inner-padding-right) + var(--f7-safe-area-right)) 0
|
|
170
|
+
calc(var(--f7-navbar-new-inner-padding-left) + var(--f7-safe-area-left));
|
|
171
|
+
transform: translate3d(0, 0, 0);
|
|
172
|
+
z-index: 10;
|
|
173
|
+
}
|
|
174
|
+
.views,
|
|
175
|
+
.view,
|
|
176
|
+
.page {
|
|
177
|
+
> .navbar-new {
|
|
178
|
+
position: absolute;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ios .navbar-new:not(.navbar-new-large) .navbar-new-bg {
|
|
183
|
+
--f7-navbar-new-large-collapse-progress: 1;
|
|
184
|
+
}
|
|
185
|
+
.navbar-new-large .title {
|
|
186
|
+
opacity: var(--f7-navbar-new-large-collapse-progress);
|
|
187
|
+
}
|
|
188
|
+
.navbar-new-large-collapsed {
|
|
189
|
+
--f7-navbar-new-large-collapse-progress: 1;
|
|
190
|
+
.title-large {
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
}
|
|
193
|
+
.title-large-text {
|
|
194
|
+
opacity: 0;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
.navbar-new .title-large {
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
position: absolute;
|
|
200
|
+
left: 0;
|
|
201
|
+
right: 0;
|
|
202
|
+
top: 100%;
|
|
203
|
+
display: flex;
|
|
204
|
+
white-space: nowrap;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
height: var(--f7-navbar-new-large-title-height);
|
|
207
|
+
z-index: 5;
|
|
208
|
+
}
|
|
209
|
+
.navbar-new .title-large-text {
|
|
210
|
+
text-overflow: ellipsis;
|
|
211
|
+
white-space: nowrap;
|
|
212
|
+
color: var(--f7-navbar-new-large-title-text-color);
|
|
213
|
+
letter-spacing: var(--f7-navbar-new-large-title-letter-spacing);
|
|
214
|
+
font-size: var(--f7-navbar-new-large-title-font-size);
|
|
215
|
+
font-weight: var(--f7-navbar-new-large-title-font-weight);
|
|
216
|
+
line-height: var(--f7-navbar-new-large-title-line-height);
|
|
217
|
+
padding-left: calc(var(--f7-navbar-new-large-title-padding-left) + var(--f7-safe-area-left));
|
|
218
|
+
padding-right: calc(var(--f7-navbar-new-large-title-padding-right) + var(--f7-safe-area-right));
|
|
219
|
+
padding-top: var(--f7-navbar-new-large-title-padding-vertical);
|
|
220
|
+
padding-bottom: var(--f7-navbar-new-large-title-padding-vertical);
|
|
221
|
+
box-sizing: border-box;
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
width: 100%;
|
|
224
|
+
transform: translate3d(
|
|
225
|
+
0px,
|
|
226
|
+
calc(
|
|
227
|
+
-1 * var(--f7-navbar-new-large-collapse-progress) * var(--f7-navbar-new-large-title-height)
|
|
228
|
+
),
|
|
229
|
+
0
|
|
230
|
+
);
|
|
231
|
+
.ltr({
|
|
232
|
+
transform-origin: calc(var(--f7-navbar-new-large-title-padding-left) + var(--f7-safe-area-left)) center;
|
|
233
|
+
});
|
|
234
|
+
.rtl({
|
|
235
|
+
transform-origin: calc(100% - var(--f7-navbar-new-large-title-padding-left) - var(--f7-safe-area-left)) center;
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
.navbar-no-title-large-transition {
|
|
239
|
+
.title-large-text {
|
|
240
|
+
transition-duration: 0ms;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Relation with page
|
|
245
|
+
.navbar-new ~ *,
|
|
246
|
+
.navbars-new ~ * {
|
|
247
|
+
--f7-page-navbar-offset: calc(var(--f7-navbar-new-height) + var(--f7-safe-area-top));
|
|
248
|
+
}
|
|
249
|
+
.navbar-new ~ * .page-with-navbar-new-large,
|
|
250
|
+
.navbar-new ~ .page-with-navbar-new-large,
|
|
251
|
+
.navbars-new ~ * .page-with-navbar-new-large,
|
|
252
|
+
.navbars-new ~ .page-with-navbar-new-large,
|
|
253
|
+
.page-with-navbar-new-large .navbar-new ~ * {
|
|
254
|
+
--f7-page-navbar-offset: calc(
|
|
255
|
+
var(--f7-navbar-new-height) + var(--f7-navbar-new-large-title-height) + var(--f7-safe-area-top)
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
.page.no-navbar,
|
|
259
|
+
.page.no-navbar .navbar-new ~ * {
|
|
260
|
+
--f7-page-navbar-offset: var(--f7-safe-area-top);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.if-ios-theme({
|
|
264
|
+
@import './navbar-ios.less';
|
|
265
|
+
});
|
|
266
|
+
.if-md-theme({
|
|
267
|
+
@import './navbar-md.less';
|
|
268
|
+
});
|
|
@@ -190,19 +190,19 @@ class Notification extends Modal {
|
|
|
190
190
|
} = notification.params;
|
|
191
191
|
return $jsx("div", {
|
|
192
192
|
class: `notification ${icon ? 'notification-with-icon' : ''} ${cssClass || ''}`
|
|
193
|
-
}, $jsx("div", {
|
|
194
|
-
class: "notification-header"
|
|
195
193
|
}, icon && $jsx("div", {
|
|
196
194
|
class: "notification-icon"
|
|
197
|
-
}, icon),
|
|
195
|
+
}, icon), $jsx("div", {
|
|
196
|
+
class: "notification-content"
|
|
197
|
+
}, (title || titleRightText || closeButton) && $jsx("div", {
|
|
198
|
+
class: "notification-header"
|
|
199
|
+
}, title && $jsx("div", {
|
|
198
200
|
class: "notification-title"
|
|
199
201
|
}, title), titleRightText && $jsx("div", {
|
|
200
202
|
class: "notification-title-right-text"
|
|
201
203
|
}, titleRightText), closeButton && $jsx("span", {
|
|
202
204
|
class: "notification-close-button"
|
|
203
|
-
})), $jsx("div", {
|
|
204
|
-
class: "notification-content"
|
|
205
|
-
}, subtitle && $jsx("div", {
|
|
205
|
+
})), subtitle && $jsx("div", {
|
|
206
206
|
class: "notification-subtitle"
|
|
207
207
|
}, subtitle), text && $jsx("div", {
|
|
208
208
|
class: "notification-text"
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
.notification {
|
|
3
3
|
transition-duration: 450ms;
|
|
4
4
|
transform: translate3d(0%, -200%, 0);
|
|
5
|
+
align-items: center;
|
|
6
|
+
|
|
5
7
|
&.modal-in {
|
|
6
8
|
transform: translate3d(0%, 0%, 0);
|
|
7
9
|
opacity: 1;
|
|
@@ -11,17 +13,10 @@
|
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
.notification-icon {
|
|
15
|
-
margin-right: 8px;
|
|
16
|
-
}
|
|
17
|
-
.notification-header + .notification-content {
|
|
18
|
-
margin-top: 10px;
|
|
19
|
-
}
|
|
20
16
|
.notification-title-right-text {
|
|
21
|
-
margin-right: 6px;
|
|
22
17
|
margin-left: auto;
|
|
23
18
|
+ .notification-close-button {
|
|
24
|
-
margin-left:
|
|
19
|
+
margin-left: 12px;
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
22
|
.notification-close-button {
|
|
@@ -16,27 +16,8 @@
|
|
|
16
16
|
transform: translate3d(0, -150%, 0);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
.notification-with-icon {
|
|
20
|
-
.notification-icon {
|
|
21
|
-
position: absolute;
|
|
22
|
-
left: var(--f7-notification-padding-horizontal);
|
|
23
|
-
top: var(--f7-notification-padding-vertical);
|
|
24
|
-
}
|
|
25
|
-
.notification-content,
|
|
26
|
-
.notification-header {
|
|
27
|
-
margin-left: calc(var(--f7-notification-icon-size) + 16px);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
19
|
|
|
31
|
-
.notification-
|
|
32
|
-
margin-right: 8px;
|
|
33
|
-
}
|
|
34
|
-
.notification-subtitle {
|
|
35
|
-
+ .notification-text {
|
|
36
|
-
margin-top: 4px;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
.notification-header + .notification-content {
|
|
20
|
+
.notification-header + :is(.notification-subtitle, .notification-text) {
|
|
40
21
|
margin-top: 8px;
|
|
41
22
|
}
|
|
42
23
|
.notification-title-right-text {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--f7-notification-max-width:568px;--f7-notification-subtitle-text-transform:none;--f7-notification-subtitle-line-height:1.35;--f7-notification-text-text-transform:none;--f7-notification-text-font-weight:400}.ios{--f7-notification-margin:8px;--f7-notification-padding-horizontal:
|
|
1
|
+
:root{--f7-notification-max-width:568px;--f7-notification-subtitle-text-transform:none;--f7-notification-subtitle-line-height:1.35;--f7-notification-text-text-transform:none;--f7-notification-text-font-weight:400}.ios{--f7-notification-margin:8px;--f7-notification-padding-horizontal:16px;--f7-notification-padding-vertical:16px;--f7-notification-border-radius:24px;--f7-notification-box-shadow:var(--f7-glass-shadow);--f7-notification-icon-size:28px;--f7-notification-title-font-size:14px;--f7-notification-title-text-transform:none;--f7-notification-title-line-height:1.4;--f7-notification-title-font-weight:bold;--f7-notification-title-letter-spacing:0.02em;--f7-notification-title-right-font-size:14px;--f7-notification-subtitle-font-size:14px;--f7-notification-subtitle-font-weight:600;--f7-notification-text-font-size:14px;--f7-notification-text-line-height:1.4;--f7-notification-bg-color:var(--f7-glass-bg-color);--f7-notification-title-color:#000;--f7-notification-title-right-color:rgba(0, 0, 0, 0.45);--f7-notification-subtitle-color:#000;--f7-notification-text-color:#000}.ios .dark,.ios.dark{--f7-notification-title-color:#fff;--f7-notification-text-color:#fff;--f7-notification-subtitle-color:#fff;--f7-notification-title-right-color:rgba(255, 255, 255, 0.55)}.md{--f7-notification-margin:16px;--f7-notification-padding-vertical:20px;--f7-notification-padding-horizontal:16px;--f7-notification-border-radius:16px;--f7-notification-box-shadow:none;--f7-notification-icon-size:24px;--f7-notification-title-font-size:16px;--f7-notification-title-text-transform:none;--f7-notification-title-line-height:1.35;--f7-notification-title-font-weight:500;--f7-notification-title-right-font-size:12px;--f7-notification-subtitle-font-size:14px;--f7-notification-subtitle-font-weight:400;--f7-notification-text-font-size:14px;--f7-notification-text-line-height:1.35}.md,.md .dark,.md [class*=color-]{--f7-notification-title-color:var(--f7-md-on-surface);--f7-notification-bg-color:var(--f7-md-surface-5);--f7-notification-text-color:var(--f7-md-on-surface-variant);--f7-notification-title-right-color:var(--f7-md-on-surface-variant);--f7-notification-subtitle-color:var(--f7-md-on-surface)}.notification{position:absolute;left:var(--f7-notification-margin);top:var(--f7-notification-margin);width:calc(100% - var(--f7-notification-margin) * 2);z-index:20000;font-size:14px;margin:0;border:none;display:none;box-sizing:border-box;transition-property:transform;direction:ltr;max-width:var(--f7-notification-max-width);padding:var(--f7-notification-padding-vertical) var(--f7-notification-padding-horizontal);border-radius:var(--f7-notification-border-radius);box-shadow:var(--f7-notification-box-shadow);background:var(--f7-notification-bg-color);margin-top:var(--f7-safe-area-top);display:flex;gap:16px;-webkit-backdrop-filter:saturate(180%) blur(16px);backdrop-filter:saturate(180%) blur(16px)}@media (min-width:568px){.notification{left:50%;width:var(--f7-notification-max-width);margin-left:calc(-1 * var(--f7-notification-max-width)/ 2)}}.notification-content{width:100%;flex-shrink:10}.notification-title{color:var(--f7-notification-title-color,var(--f7-theme-color));font-size:var(--f7-notification-title-font-size);text-transform:var(--f7-notification-title-text-transform);line-height:var(--f7-notification-title-line-height);font-weight:var(--f7-notification-title-font-weight);letter-spacing:var(--f7-notification-title-letter-spacing)}.notification-subtitle{color:var(--f7-notification-subtitle-color);font-size:var(--f7-notification-subtitle-font-size);text-transform:var(--f7-notification-subtitle-text-transform);line-height:var(--f7-notification-subtitle-line-height);font-weight:var(--f7-notification-subtitle-font-weight)}.notification-text{color:var(--f7-notification-text-color);font-size:var(--f7-notification-text-font-size);text-transform:var(--f7-notification-text-text-transform);line-height:var(--f7-notification-text-line-height);font-weight:var(--f7-notification-text-font-weight)}.notification-title-right-text{color:var(--f7-notification-title-right-color);font-size:var(--f7-notification-title-right-font-size)}.notification-icon{font-size:0;line-height:var(--f7-notification-icon-size);flex-shrink:0}.notification-icon,.notification-icon i{width:var(--f7-notification-icon-size)!important;height:var(--f7-notification-icon-size)!important}.notification-icon i{font-size:var(--f7-notification-icon-size)}.notification-icon img{height:var(--f7-notification-icon-size)}.notification-header{display:flex;justify-content:flex-start;align-items:center}.notification-close-button{margin-left:auto;cursor:pointer;position:relative}.notification-close-button:after{font-family:framework7-core-icons;font-weight:400;font-style:normal;line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga';display:block;width:100%;height:100%;font-size:20px;position:absolute;left:50%;top:50%;text-align:center}.ios .notification{transition-duration:450ms;transform:translate3d(0%,-200%,0);align-items:center}.ios .notification.modal-in{transform:translate3d(0%,0%,0);opacity:1}.ios .notification.modal-out{transform:translate3d(0%,-200%,0)}.ios .notification-title-right-text{margin-left:auto}.ios .notification-title-right-text+.notification-close-button{margin-left:12px}.ios .notification-close-button{font-size:14px;width:20px;height:20px;opacity:.3;transition-duration:.3s}.ios .notification-close-button.active-state{transition-duration:0s;opacity:.1}.ios .notification-close-button:after{color:#000;content:'notification_close_ios';font-size:.65em;line-height:44px;width:44px;height:44px;margin-left:-22px;margin-top:-22px}.ios .dark .notification-close-button:after,.ios.dark .notification-close-button:after{color:#fff}.md .notification{transform:translate3d(0,-150%,0)}.md .notification.modal-in{transition-duration:.5s;transform:translate3d(0,0%,0);transition-timing-function:cubic-bezier(0,0.8,0.34,1)}.md .notification.modal-in.notification-transitioning{transition-duration:.2s}.md .notification.modal-out{animation:none;transition-duration:.2s;transition-timing-function:ease-in;transform:translate3d(0,-150%,0)}.md .notification-header+:is(.notification-subtitle,.notification-text){margin-top:8px}.md .notification-title-right-text{margin-left:4px}.md .notification-title-right-text:before{content:'';width:3px;height:3px;border-radius:50%;display:inline-block;vertical-align:middle;margin-right:4px;background:var(--f7-notification-title-right-color)}.md .notification-close-button{width:16px;height:16px;transition-duration:.3s}.md .notification-close-button:after,.md .notification-close-button:before{width:48px;height:48px;left:50%;top:50%;margin-left:-24px;margin-top:-24px}.md .notification-close-button:after{color:var(--f7-md-on-surface-variant);content:'delete_round_md';line-height:48px;font-size:24px}@keyframes notification-md-in{0%{transform:translate3d(0,-150%,0)}50%{transform:translate3d(0,10%,0)}100%{transform:translate3d(0,0%,0)}}
|
|
@@ -7,36 +7,33 @@
|
|
|
7
7
|
}
|
|
8
8
|
.ios-vars({
|
|
9
9
|
--f7-notification-margin: 8px;
|
|
10
|
-
--f7-notification-padding-horizontal:
|
|
11
|
-
--f7-notification-padding-vertical:
|
|
12
|
-
--f7-notification-border-radius:
|
|
13
|
-
--f7-notification-box-shadow:
|
|
14
|
-
--f7-notification-icon-size:
|
|
10
|
+
--f7-notification-padding-horizontal: 16px;
|
|
11
|
+
--f7-notification-padding-vertical: 16px;
|
|
12
|
+
--f7-notification-border-radius: 24px;
|
|
13
|
+
--f7-notification-box-shadow: var(--f7-glass-shadow);
|
|
14
|
+
--f7-notification-icon-size: 28px;
|
|
15
15
|
|
|
16
|
-
--f7-notification-title-font-size:
|
|
17
|
-
--f7-notification-title-text-transform:
|
|
16
|
+
--f7-notification-title-font-size: 14px;
|
|
17
|
+
--f7-notification-title-text-transform: none;
|
|
18
18
|
--f7-notification-title-line-height: 1.4;
|
|
19
|
-
--f7-notification-title-font-weight:
|
|
19
|
+
--f7-notification-title-font-weight: bold;
|
|
20
20
|
--f7-notification-title-letter-spacing: 0.02em;
|
|
21
21
|
|
|
22
|
-
--f7-notification-title-right-font-size:
|
|
22
|
+
--f7-notification-title-right-font-size: 14px;
|
|
23
23
|
|
|
24
|
-
--f7-notification-subtitle-font-size:
|
|
24
|
+
--f7-notification-subtitle-font-size: 14px;
|
|
25
25
|
--f7-notification-subtitle-font-weight: 600;
|
|
26
26
|
|
|
27
|
-
--f7-notification-text-font-size:
|
|
28
|
-
--f7-notification-text-line-height: 1.
|
|
27
|
+
--f7-notification-text-font-size: 14px;
|
|
28
|
+
--f7-notification-text-line-height: 1.4;
|
|
29
|
+
--f7-notification-bg-color: var(--f7-glass-bg-color);
|
|
29
30
|
.light-vars({
|
|
30
|
-
--f7-notification-bg-color: rgba(250,250,250,0.95);
|
|
31
|
-
--f7-notification-bg-color-rgb: 255, 255, 255;
|
|
32
31
|
--f7-notification-title-color: #000;
|
|
33
32
|
--f7-notification-title-right-color: rgba(0,0,0,0.45);
|
|
34
33
|
--f7-notification-subtitle-color: #000;
|
|
35
34
|
--f7-notification-text-color: #000;
|
|
36
35
|
});
|
|
37
36
|
.dark-vars({
|
|
38
|
-
--f7-notification-bg-color: rgba(30,30,30,0.95);
|
|
39
|
-
--f7-notification-bg-color-rgb: 30, 30, 30;
|
|
40
37
|
--f7-notification-title-color: #fff;
|
|
41
38
|
--f7-notification-text-color: #fff;
|
|
42
39
|
--f7-notification-subtitle-color: #fff;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--f7-notification-max-width:568px;--f7-notification-subtitle-text-transform:none;--f7-notification-subtitle-line-height:1.35;--f7-notification-text-text-transform:none;--f7-notification-text-font-weight:400}.ios{--f7-notification-margin:8px;--f7-notification-padding-horizontal:
|
|
1
|
+
:root{--f7-notification-max-width:568px;--f7-notification-subtitle-text-transform:none;--f7-notification-subtitle-line-height:1.35;--f7-notification-text-text-transform:none;--f7-notification-text-font-weight:400}.ios{--f7-notification-margin:8px;--f7-notification-padding-horizontal:16px;--f7-notification-padding-vertical:16px;--f7-notification-border-radius:24px;--f7-notification-box-shadow:var(--f7-glass-shadow);--f7-notification-icon-size:28px;--f7-notification-title-font-size:14px;--f7-notification-title-text-transform:none;--f7-notification-title-line-height:1.4;--f7-notification-title-font-weight:bold;--f7-notification-title-letter-spacing:0.02em;--f7-notification-title-right-font-size:14px;--f7-notification-subtitle-font-size:14px;--f7-notification-subtitle-font-weight:600;--f7-notification-text-font-size:14px;--f7-notification-text-line-height:1.4;--f7-notification-bg-color:var(--f7-glass-bg-color);--f7-notification-title-color:#000;--f7-notification-title-right-color:rgba(0, 0, 0, 0.45);--f7-notification-subtitle-color:#000;--f7-notification-text-color:#000}.ios .dark,.ios.dark{--f7-notification-title-color:#fff;--f7-notification-text-color:#fff;--f7-notification-subtitle-color:#fff;--f7-notification-title-right-color:rgba(255, 255, 255, 0.55)}.md{--f7-notification-margin:16px;--f7-notification-padding-vertical:20px;--f7-notification-padding-horizontal:16px;--f7-notification-border-radius:16px;--f7-notification-box-shadow:none;--f7-notification-icon-size:24px;--f7-notification-title-font-size:16px;--f7-notification-title-text-transform:none;--f7-notification-title-line-height:1.35;--f7-notification-title-font-weight:500;--f7-notification-title-right-font-size:12px;--f7-notification-subtitle-font-size:14px;--f7-notification-subtitle-font-weight:400;--f7-notification-text-font-size:14px;--f7-notification-text-line-height:1.35}.md,.md .dark,.md [class*=color-]{--f7-notification-title-color:var(--f7-md-on-surface);--f7-notification-bg-color:var(--f7-md-surface-5);--f7-notification-text-color:var(--f7-md-on-surface-variant);--f7-notification-title-right-color:var(--f7-md-on-surface-variant);--f7-notification-subtitle-color:var(--f7-md-on-surface)}.notification{position:absolute;left:var(--f7-notification-margin);top:var(--f7-notification-margin);width:calc(100% - var(--f7-notification-margin) * 2);z-index:20000;font-size:14px;margin:0;border:none;display:none;box-sizing:border-box;transition-property:transform;direction:ltr;max-width:var(--f7-notification-max-width);padding:var(--f7-notification-padding-vertical) var(--f7-notification-padding-horizontal);border-radius:var(--f7-notification-border-radius);box-shadow:var(--f7-notification-box-shadow);background:var(--f7-notification-bg-color);margin-top:var(--f7-safe-area-top);display:flex;gap:16px;-webkit-backdrop-filter:saturate(180%) blur(16px);backdrop-filter:saturate(180%) blur(16px)}@media (min-width:568px){.notification{left:50%;width:var(--f7-notification-max-width);margin-left:calc(-1 * var(--f7-notification-max-width)/ 2)}}.notification-content{width:100%;flex-shrink:10}.notification-title{color:var(--f7-notification-title-color,var(--f7-theme-color));font-size:var(--f7-notification-title-font-size);text-transform:var(--f7-notification-title-text-transform);line-height:var(--f7-notification-title-line-height);font-weight:var(--f7-notification-title-font-weight);letter-spacing:var(--f7-notification-title-letter-spacing)}.notification-subtitle{color:var(--f7-notification-subtitle-color);font-size:var(--f7-notification-subtitle-font-size);text-transform:var(--f7-notification-subtitle-text-transform);line-height:var(--f7-notification-subtitle-line-height);font-weight:var(--f7-notification-subtitle-font-weight)}.notification-text{color:var(--f7-notification-text-color);font-size:var(--f7-notification-text-font-size);text-transform:var(--f7-notification-text-text-transform);line-height:var(--f7-notification-text-line-height);font-weight:var(--f7-notification-text-font-weight)}.notification-title-right-text{color:var(--f7-notification-title-right-color);font-size:var(--f7-notification-title-right-font-size)}.notification-icon{font-size:0;line-height:var(--f7-notification-icon-size);flex-shrink:0}.notification-icon,.notification-icon i{width:var(--f7-notification-icon-size)!important;height:var(--f7-notification-icon-size)!important}.notification-icon i{font-size:var(--f7-notification-icon-size)}.notification-icon img{height:var(--f7-notification-icon-size)}.notification-header{display:flex;justify-content:flex-start;align-items:center}.notification-close-button{margin-left:auto;cursor:pointer;position:relative}.notification-close-button:after{font-family:framework7-core-icons;font-weight:400;font-style:normal;line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga';display:block;width:100%;height:100%;font-size:20px;position:absolute;left:50%;top:50%;text-align:center}.ios .notification{transition-duration:450ms;transform:translate3d(0%,-200%,0);align-items:center}.ios .notification.modal-in{transform:translate3d(0%,0%,0);opacity:1}.ios .notification.modal-out{transform:translate3d(0%,-200%,0)}.ios .notification-title-right-text{margin-left:auto}.ios .notification-title-right-text+.notification-close-button{margin-left:12px}.ios .notification-close-button{font-size:14px;width:20px;height:20px;opacity:.3;transition-duration:.3s}.ios .notification-close-button.active-state{transition-duration:0s;opacity:.1}.ios .notification-close-button:after{color:#000;content:'notification_close_ios';font-size:.65em;line-height:44px;width:44px;height:44px;margin-left:-22px;margin-top:-22px}.ios .dark .notification-close-button:after,.ios.dark .notification-close-button:after{color:#fff}.md .notification{transform:translate3d(0,-150%,0)}.md .notification.modal-in{transition-duration:.5s;transform:translate3d(0,0%,0);transition-timing-function:cubic-bezier(0,0.8,0.34,1)}.md .notification.modal-in.notification-transitioning{transition-duration:.2s}.md .notification.modal-out{animation:none;transition-duration:.2s;transition-timing-function:ease-in;transform:translate3d(0,-150%,0)}.md .notification-header+:is(.notification-subtitle,.notification-text){margin-top:8px}.md .notification-title-right-text{margin-left:4px}.md .notification-title-right-text:before{content:'';width:3px;height:3px;border-radius:50%;display:inline-block;vertical-align:middle;margin-right:4px;background:var(--f7-notification-title-right-color)}.md .notification-close-button{width:16px;height:16px;transition-duration:.3s}.md .notification-close-button:after,.md .notification-close-button:before{width:48px;height:48px;left:50%;top:50%;margin-left:-24px;margin-top:-24px}.md .notification-close-button:after{color:var(--f7-md-on-surface-variant);content:'delete_round_md';line-height:48px;font-size:24px}@keyframes notification-md-in{0%{transform:translate3d(0,-150%,0)}50%{transform:translate3d(0,10%,0)}100%{transform:translate3d(0,0%,0)}}
|
|
@@ -20,7 +20,18 @@
|
|
|
20
20
|
box-shadow: var(--f7-notification-box-shadow);
|
|
21
21
|
background: var(--f7-notification-bg-color);
|
|
22
22
|
margin-top: var(--f7-safe-area-top);
|
|
23
|
-
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 16px;
|
|
25
|
+
.ios-glass-backdrop();
|
|
26
|
+
@media (min-width: 568px) {
|
|
27
|
+
left: 50%;
|
|
28
|
+
width: var(--f7-notification-max-width);
|
|
29
|
+
margin-left: calc(-1 * var(--f7-notification-max-width) / 2);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.notification-content {
|
|
33
|
+
width: 100%;
|
|
34
|
+
flex-shrink: 10;
|
|
24
35
|
}
|
|
25
36
|
.notification-title {
|
|
26
37
|
color: var(--f7-notification-title-color, var(--f7-theme-color));
|
|
@@ -51,6 +62,7 @@
|
|
|
51
62
|
.notification-icon {
|
|
52
63
|
font-size: 0;
|
|
53
64
|
line-height: var(--f7-notification-icon-size);
|
|
65
|
+
flex-shrink: 0;
|
|
54
66
|
i,
|
|
55
67
|
& {
|
|
56
68
|
width: var(--f7-notification-icon-size) !important;
|
|
@@ -53,15 +53,6 @@ class Popover extends Modal {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// Find Arrow
|
|
57
|
-
let $arrowEl;
|
|
58
|
-
if ($el.find('.popover-arrow').length === 0 && popover.params.arrow) {
|
|
59
|
-
$arrowEl = $('<div class="popover-arrow"></div>');
|
|
60
|
-
$el.prepend($arrowEl);
|
|
61
|
-
} else {
|
|
62
|
-
$arrowEl = $el.find('.popover-arrow');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
56
|
// Open
|
|
66
57
|
const originalOpen = popover.open;
|
|
67
58
|
extend(popover, {
|
|
@@ -70,8 +61,6 @@ class Popover extends Modal {
|
|
|
70
61
|
el: $el[0],
|
|
71
62
|
$targetEl,
|
|
72
63
|
targetEl: $targetEl[0],
|
|
73
|
-
$arrowEl,
|
|
74
|
-
arrowEl: $arrowEl[0],
|
|
75
64
|
$backdropEl,
|
|
76
65
|
backdropEl: $backdropEl && $backdropEl[0],
|
|
77
66
|
type: 'popover',
|
|
@@ -93,7 +82,15 @@ class Popover extends Modal {
|
|
|
93
82
|
popover.resize();
|
|
94
83
|
}
|
|
95
84
|
popover.on('popoverOpen', () => {
|
|
85
|
+
if (popover.app.theme === 'ios') {
|
|
86
|
+
$el.removeClass('modal-in');
|
|
87
|
+
}
|
|
96
88
|
popover.resize();
|
|
89
|
+
if (popover.app.theme === 'ios') {
|
|
90
|
+
requestAnimationFrame(() => {
|
|
91
|
+
$el.addClass('modal-in');
|
|
92
|
+
});
|
|
93
|
+
}
|
|
97
94
|
app.on('resize', handleResize);
|
|
98
95
|
$(window).on('keyboardDidShow keyboardDidHide', handleResize);
|
|
99
96
|
popover.on('popoverClose popoverBeforeDestroy', () => {
|
|
@@ -156,8 +153,7 @@ class Popover extends Modal {
|
|
|
156
153
|
const {
|
|
157
154
|
app,
|
|
158
155
|
$el,
|
|
159
|
-
$targetEl
|
|
160
|
-
$arrowEl
|
|
156
|
+
$targetEl
|
|
161
157
|
} = popover;
|
|
162
158
|
const {
|
|
163
159
|
targetX,
|
|
@@ -169,18 +165,6 @@ class Popover extends Modal {
|
|
|
169
165
|
top: ''
|
|
170
166
|
});
|
|
171
167
|
const [width, height] = [$el.width(), $el.height()];
|
|
172
|
-
let arrowSize = 0;
|
|
173
|
-
let arrowLeft;
|
|
174
|
-
let arrowTop;
|
|
175
|
-
const hasArrow = $arrowEl.length > 0;
|
|
176
|
-
const arrowMin = app.theme === 'ios' ? 13 : 24;
|
|
177
|
-
if (hasArrow) {
|
|
178
|
-
$arrowEl.removeClass('on-left on-right on-top on-bottom').css({
|
|
179
|
-
left: '',
|
|
180
|
-
top: ''
|
|
181
|
-
});
|
|
182
|
-
arrowSize = $arrowEl.width() / 2;
|
|
183
|
-
}
|
|
184
168
|
$el.removeClass('popover-on-left popover-on-right popover-on-top popover-on-bottom popover-on-middle').css({
|
|
185
169
|
left: '',
|
|
186
170
|
top: ''
|
|
@@ -211,30 +195,27 @@ class Popover extends Modal {
|
|
|
211
195
|
targetWidth = popover.params.targetWidth || 0;
|
|
212
196
|
targetHeight = popover.params.targetHeight || 0;
|
|
213
197
|
}
|
|
214
|
-
let [left, top
|
|
198
|
+
let [left, top] = [0, 0];
|
|
215
199
|
// Top Position
|
|
216
200
|
const forcedPosition = verticalPosition === 'auto' ? false : verticalPosition;
|
|
217
201
|
let position = forcedPosition || 'top';
|
|
218
|
-
if (forcedPosition === 'top' || !forcedPosition && height
|
|
202
|
+
if (forcedPosition === 'top' || !forcedPosition && height < targetOffsetTop - safeAreaTop) {
|
|
219
203
|
// On top
|
|
220
|
-
top = targetOffsetTop - height
|
|
221
|
-
} else if (forcedPosition === 'bottom' || !forcedPosition && height
|
|
204
|
+
top = targetOffsetTop - height;
|
|
205
|
+
} else if (forcedPosition === 'bottom' || !forcedPosition && height < app.height - targetOffsetTop - targetHeight) {
|
|
222
206
|
// On bottom
|
|
223
207
|
position = 'bottom';
|
|
224
|
-
top = targetOffsetTop + targetHeight
|
|
208
|
+
top = targetOffsetTop + targetHeight;
|
|
225
209
|
} else {
|
|
226
210
|
// On middle
|
|
227
211
|
position = 'middle';
|
|
228
212
|
top = targetHeight / 2 + targetOffsetTop - height / 2;
|
|
229
|
-
diff = top;
|
|
230
213
|
top = Math.max(5, Math.min(top, app.height - height - 5));
|
|
231
|
-
diff -= top;
|
|
232
214
|
}
|
|
233
215
|
|
|
234
216
|
// Horizontal Position
|
|
235
217
|
if (position === 'top' || position === 'bottom') {
|
|
236
218
|
left = targetWidth / 2 + targetOffsetLeft - width / 2;
|
|
237
|
-
diff = left;
|
|
238
219
|
left = Math.max(5, Math.min(left, app.width - width - 5));
|
|
239
220
|
if (safeAreaLeft) {
|
|
240
221
|
left = Math.max(left, safeAreaLeft);
|
|
@@ -242,35 +223,12 @@ class Popover extends Modal {
|
|
|
242
223
|
if (safeAreaRight && left + width > app.width - 5 - safeAreaRight) {
|
|
243
224
|
left = app.width - 5 - safeAreaRight - width;
|
|
244
225
|
}
|
|
245
|
-
diff -= left;
|
|
246
|
-
if (hasArrow) {
|
|
247
|
-
if (position === 'top') {
|
|
248
|
-
$arrowEl.addClass('on-bottom');
|
|
249
|
-
}
|
|
250
|
-
if (position === 'bottom') {
|
|
251
|
-
$arrowEl.addClass('on-top');
|
|
252
|
-
}
|
|
253
|
-
arrowLeft = width / 2 - arrowSize + diff;
|
|
254
|
-
arrowLeft = Math.max(Math.min(arrowLeft, width - arrowSize * 2 - arrowMin), arrowMin);
|
|
255
|
-
$arrowEl.css({
|
|
256
|
-
left: `${arrowLeft}px`
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
226
|
} else if (position === 'middle') {
|
|
260
|
-
left = targetOffsetLeft - width
|
|
261
|
-
if (hasArrow) $arrowEl.addClass('on-right');
|
|
227
|
+
left = targetOffsetLeft - width;
|
|
262
228
|
if (left < 5 || left + width + safeAreaRight > app.width || left < safeAreaLeft) {
|
|
263
|
-
if (left < 5) left = targetOffsetLeft + targetWidth
|
|
229
|
+
if (left < 5) left = targetOffsetLeft + targetWidth;
|
|
264
230
|
if (left + width + safeAreaRight > app.width) left = app.width - width - 5 - safeAreaRight;
|
|
265
231
|
if (left < safeAreaLeft) left = safeAreaLeft;
|
|
266
|
-
if (hasArrow) $arrowEl.removeClass('on-right').addClass('on-left');
|
|
267
|
-
}
|
|
268
|
-
if (hasArrow) {
|
|
269
|
-
arrowTop = height / 2 - arrowSize + diff;
|
|
270
|
-
arrowTop = Math.max(Math.min(arrowTop, height - arrowSize * 2 - arrowMin), arrowMin);
|
|
271
|
-
$arrowEl.css({
|
|
272
|
-
top: `${arrowTop}px`
|
|
273
|
-
});
|
|
274
232
|
}
|
|
275
233
|
}
|
|
276
234
|
|
|
@@ -288,6 +246,11 @@ class Popover extends Modal {
|
|
|
288
246
|
top: `${top}px`,
|
|
289
247
|
left: `${left}px`
|
|
290
248
|
});
|
|
249
|
+
if (app.theme === 'ios') {
|
|
250
|
+
$el.css({
|
|
251
|
+
transformOrigin: `${targetOffsetLeft + targetWidth / 2 - left}px ${targetOffsetTop + targetHeight / 2 - top}px`
|
|
252
|
+
});
|
|
253
|
+
}
|
|
291
254
|
}
|
|
292
255
|
}
|
|
293
256
|
export default Popover;
|